tao-test/app/taoQtiItem/views/js/loader/taoQtiItem.min.js

2 lines
2.2 MiB

function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(iter){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(iter))return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(arr)){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!(i&&_arr.length===i));_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i["return"]||_i["return"]()}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}define("taoQtiItem/portableElementRegistry/factory/factory",["lodash","core/promise","core/eventifier"],function(_,Promise,eventifier){'use strict';var _requirejs=window.require,_defaultLoadingOptions={reload:!1},loadModuleConfig=function(manifest){return new Promise(function(resolve,reject){var requireConfigAliases={},reqConfigs=[],modules={},baseUrl;return manifest&&manifest.runtime?void(baseUrl=manifest.baseUrl,_.isArray(manifest.runtime.config)&&manifest.runtime.config.length&&_.forEach(manifest.runtime.config,function(pciConfig){_.isString(pciConfig)?reqConfigs.push("json!"+baseUrl+"/"+pciConfig):pciConfig.data?modules=_.defaults(modules,pciConfig.data.paths||{}):pciConfig.file&&reqConfigs.push("json!"+baseUrl+"/"+pciConfig.file)}),require(reqConfigs,function(){var runtimeModules={};requireConfigAliases[manifest.typeIdentifier]=baseUrl,"IMSPCI"===manifest.model&&(modules=_.reduce(arguments,function(acc,conf){return _.defaults(acc,conf.paths||{})},modules),_.forEach(manifest.runtime.modules||{},function(paths,id){paths&&(_.isString(paths)||_.isArray(paths)&&paths.length)&&(runtimeModules[id]=paths)}),modules=_.merge(modules,runtimeModules),_.forEach(modules,function(paths,id){paths=_.isArray(paths)?paths:[paths],requireConfigAliases[id]=_.map(paths,function(path){return baseUrl+"/"+path.replace(/\.js$/,"")})})),resolve(requireConfigAliases)},reject)):reject("invalid manifest")})},isPortableElementProvider=function(provider){return provider&&_.isFunction(provider.load)};return function(methods){var _loaded=!1,__providers={};return eventifier(_.defaults(methods||{},{_registry:{},get:function(typeIdentifier,version){if(this._registry[typeIdentifier])return version?_.find(this._registry[typeIdentifier],{version:version}):_.last(this._registry[typeIdentifier])},registerProvider:function(moduleName,provider){return __providers[moduleName]=isPortableElementProvider(provider)?provider:null,_loaded=!1,this},resetProviders:function(){return __providers={},_loaded=!1,this},loadProviders:function(options){var self=this,loadPromise;return loadPromise=_loaded&&!options.reload?Promise.resolve([]):new Promise(function(resolve,reject){var providerLoadingStack=[];_.forIn(__providers,function(provider,id){null===provider&&providerLoadingStack.push(id)}),_requirejs(providerLoadingStack,function(){_.each([].slice.call(arguments),function(provider){isPortableElementProvider(provider)&&(__providers[providerLoadingStack.shift()]=provider)}),resolve(__providers),_loaded=!0,self.trigger("providersloaded",__providers)},reject)}),loadPromise},getAllVersions:function(){var all={};return _.forIn(this._registry,function(versions,id){all[id]=_.map(versions,"version")}),all},getRuntime:function(typeIdentifier,version){var portableElement=this.get(typeIdentifier,version);return portableElement?_.assign(portableElement.runtime,{id:portableElement.typeIdentifier,label:portableElement.label,baseUrl:portableElement.baseUrl,model:portableElement.model}):void this.trigger("error",{message:"no portable element runtime found",typeIdentifier:typeIdentifier,version:version})},getCreator:function(typeIdentifier,version){var portableElement=this.get(typeIdentifier,version);return portableElement&&portableElement.creator?_.assign(portableElement.creator,{id:portableElement.typeIdentifier,label:portableElement.label,baseUrl:portableElement.baseUrl,response:portableElement.response,model:portableElement.model,xmlns:portableElement.xmlns}):void this.trigger("error",{message:"no portable element runtime found",typeIdentifier:typeIdentifier,version:version})},getLatestCreators:function(){var all={};return _.forIn(this._registry,function(versions,id){var lastVersion=_.last(versions);lastVersion.creator&&lastVersion.creator.hook&&lastVersion.enabled&&(all[id]=lastVersion)}),all},getBaseUrl:function(typeIdentifier,version){var runtime=this.get(typeIdentifier,version);return runtime?runtime.baseUrl:""},loadRuntimes:function(options){var self=this,loadPromise;return options=_.defaults(options||{},_defaultLoadingOptions),loadPromise=self.loadProviders(options).then(function(providers){var loadStack=[];return _.forEach(providers,function(provider){provider&&loadStack.push(provider.load())}),Promise.all(loadStack).then(function(results){var configLoadingStack=[];return self._registry=_.reduce(results,function(acc,_pcis){return _.merge(acc,_pcis)},self._registry||{}),_.forIn(self._registry,function(versions,typeIdentifier){return!!(_.isArray(options.include)&&0>_.indexOf(options.include,typeIdentifier))||void configLoadingStack.push(loadModuleConfig(self.get(typeIdentifier)))}),Promise.all(configLoadingStack).then(function(moduleConfigs){var requireConfigAliases=_.reduce(moduleConfigs,function(acc,paths){return _.merge(acc,paths)},{});_requirejs.config({paths:requireConfigAliases})})})}),loadPromise.then(function(){self.trigger("runtimesloaded")}).catch(function(err){self.trigger("error",err)}),loadPromise},loadCreators:function(options){var self=this,loadPromise;return options=_.defaults(options||{},_defaultLoadingOptions),loadPromise=self.loadRuntimes(options).then(function(){var requiredCreatorHooks=[];return _.forIn(self._registry,function(versions,typeIdentifier){var portableElementModel=self.get(typeIdentifier);if(portableElementModel.creator&&portableElementModel.creator.hook){if(portableElementModel.enabled){if(_.isArray(options.include)&&0>_.indexOf(options.include,typeIdentifier))return!0;}else if(!_.isArray(options.include)||0>_.indexOf(options.include,typeIdentifier))return!0;requiredCreatorHooks.push(portableElementModel.creator.hook.replace(/\.js$/,""))}}),requiredCreatorHooks.length?new Promise(function(resolve,reject){_requirejs(requiredCreatorHooks,function(){var creators={};_.each(arguments,function(creatorHook){var id=creatorHook.getTypeIdentifier(),portableElementModel=self.get(id),i=_.findIndex(self._registry[id],{version:portableElementModel.version});0>i?self.trigger("error","no creator found for id/version "+id+"/"+portableElementModel.version):(self._registry[id][i].creator.module=creatorHook,creators[id]=creatorHook)}),resolve(creators)},reject)}):Promise.resolve({})}),loadPromise.then(function(creators){return self.trigger("creatorsloaded",creators),creators}).catch(function(err){self.trigger("error",err)}),loadPromise},enable:function(typeIdentifier,version){var portableElement=this.get(typeIdentifier,version);return portableElement&&(portableElement.enabled=!0),this},disable:function(typeIdentifier,version){var portableElement=this.get(typeIdentifier,version);return portableElement&&(portableElement.enabled=!1),this},isEnabled:function(typeIdentifier,version){var portableElement=this.get(typeIdentifier,version);return portableElement&&!0===portableElement.enabled}}))}}),define("taoQtiItem/qtiCreator/helper/qtiElements",["jquery","lodash","i18n"],function($,_,__){"use strict";var QtiElements={};return QtiElements.classes={itemBody:{parents:["bodyElement"],contains:["block"],abstract:!0},atomicBlock:{parents:["blockStatic","bodyElement","flowStatic"],contains:["inline"],abstract:!0},atomicInline:{parents:["bodyElement","flowStatic","inlineStatic"],contains:["inline"],abstract:!0},simpleBlock:{parents:["blockStatic","bodyElement","flowStatic"],contains:["block"],abstract:!0},simpleInline:{parents:["bodyElement","flowStatic","inlineStatic"],contains:["inline"],abstract:!0},flowStatic:{parents:["flow"],abstract:!0},blockStatic:{parents:["block"],abstract:!0},inlineStatic:{parents:["inline"],abstract:!0},flow:{parents:["objectFlow"],abstract:!0},tableCell:{parents:["bodyElement"],contains:["flow"],abstract:!0},caption:{parents:["bodyElement"],contains:["inline"],xhtml:!0},col:{parents:["bodyElement"],xhtml:!0},colgroup:{parents:["bodyElement"],contains:["col"],xhtml:!0},div:{parents:["blockStatic","bodyElement","flowStatic"],contains:["flow"],xhtml:!0},dl:{parents:["blockStatic","bodyElement","flowStatic"],contains:["dlElement"],xhtml:!0},dt:{parents:["dlElement"],contains:["inline"],xhtml:!0},dd:{parents:["dlElement"],contains:["flow"],xhtml:!0},hr:{parents:["blockStatic","bodyElement","flowStatic"],xhtml:!0},math:{parents:["blockStatic","flowStatic","inlineStatic"],xhtml:!0},li:{parents:["bodyElement"],contains:["flow"],xhtml:!0},ol:{parents:["blockStatic","bodyElement","flowStatic"],contains:["li"],xhtml:!0},ul:{parents:["blockStatic","bodyElement","flowStatic"],contains:["li"],xhtml:!0},object:{parents:["bodyElement","flowStatic","inlineStatic"],contains:["objectFlow"],xhtml:!0},param:{parents:["objectFlow"],xhtml:!0},table:{parents:["blockStatic","bodyElement","flowStatic"],contains:["caption","col","colgroup","thead","tfoot","tbody"],xhtml:!0},tbody:{parents:["bodyElement"],contains:["tr"],xhtml:!0},tfoot:{parents:["bodyElement"],contains:["tr"],xhtml:!0},thead:{parents:["bodyElement"],contains:["tr"],xhtml:!0},td:{parents:["tableCell"],xhtml:!0},th:{parents:["tableCell"],xhtml:!0},tr:{parents:["bodyElement"],contains:["tableCell"],xhtml:!0},a:{parents:["simpleInline"],xhtml:!0},abbr:{parents:["simpleInline"],xhtml:!0},acronym:{parents:["simpleInline"],xhtml:!0},b:{parents:["simpleInline"],xhtml:!0},big:{parents:["simpleInline"],xhtml:!0},cite:{parents:["simpleInline"],xhtml:!0},code:{parents:["simpleInline"],xhtml:!0},dfn:{parents:["simpleInline"],xhtml:!0},em:{parents:["simpleInline"],xhtml:!0},i:{parents:["simpleInline"],xhtml:!0},kbd:{parents:["simpleInline"],xhtml:!0},q:{parents:["simpleInline"],xhtml:!0},samp:{parents:["simpleInline"],xhtml:!0},small:{parents:["simpleInline"],xhtml:!0},span:{parents:["simpleInline"],xhtml:!0},strong:{parents:["simpleInline"],xhtml:!0},sub:{parents:["simpleInline"],xhtml:!0},sup:{parents:["simpleInline"],xhtml:!0},tt:{parents:["simpleInline"],xhtml:!0},var:{parents:["simpleInline"],xhtml:!0},blockquote:{parents:["simpleBlock"],xhtml:!0},address:{parents:["atomicBlock"],xhtml:!0},h1:{parents:["atomicBlock"],xhtml:!0},h2:{parents:["atomicBlock"],xhtml:!0},h3:{parents:["atomicBlock"],xhtml:!0},h4:{parents:["atomicBlock"],xhtml:!0},h5:{parents:["atomicBlock"],xhtml:!0},h6:{parents:["atomicBlock"],xhtml:!0},p:{parents:["atomicBlock"],xhtml:!0},pre:{parents:["atomicBlock"],xhtml:!0},img:{parents:["atomicInline"],xhtml:!0,attributes:["src","alt","longdesc","height","width"]},br:{parents:["atomicInline"],xhtml:!0},infoControl:{parents:["blockStatic","bodyElement","flowStatic"],qti:!0},textRun:{parents:["inlineStatic","flowstatic"],qti:!0},feedbackInline:{parents:["simpleInline","feedbackElement"],qti:!0},feedbackBlock:{parents:["simpleBlock"],qti:!0},rubricBlock:{parents:["simpleBlock"],qti:!0},blockInteraction:{parents:["block","flow","interaction"],qti:!0},inlineInteraction:{parents:["inline","flow","interaction"],qti:!0},gap:{parents:["inlineStatic"],qti:!0},hottext:{parents:["flowstatic","inlineStatic"],contains:["inlineStatic"],qti:!0},printedVariable:{parents:["bodyElement","flowStatic","inlineStatic","textOrVariable"],qti:!0},prompt:{parents:["bodyElement"],contains:["inlineStatic"],qti:!0},templateElement:{parents:["bodyElement"],qti:!0},templateBlock:{parents:["blockStatic","flowStatic","templateElement"],contains:["blockStatic"],qti:!0},templateInline:{parents:["inlineStatic","flowStatic","templateElement"],contains:["inlineStatic"],qti:!0},choiceInteraction:{parents:["blockInteraction"],qti:!0},associateInteraction:{parents:["blockInteraction"],qti:!0},orderInteraction:{parents:["blockInteraction"],qti:!0},matchInteraction:{parents:["blockInteraction"],qti:!0},hottextInteraction:{parents:["blockInteraction"],qti:!0},gapMatchInteraction:{parents:["blockInteraction"],qti:!0},mediaInteraction:{parents:["blockInteraction"],qti:!0},sliderInteraction:{parents:["blockInteraction"],qti:!0},uploadInteraction:{parents:["blockInteraction"],qti:!0},drawingInteraction:{parents:["blockInteraction"],qti:!0},graphicInteraction:{parents:["blockInteraction"],qti:!0},hotspotInteraction:{parents:["graphicInteraction"],qti:!0},graphicAssociateInteraction:{parents:["graphicInteraction"],qti:!0},graphicOrderInteraction:{parents:["graphicInteraction"],qti:!0},graphicGapMatchInteraction:{parents:["graphicInteraction"],qti:!0},selectPointInteraction:{parents:["graphicInteraction"],qti:!0},textEntryInteraction:{parents:["stringInteraction","inlineInteraction"],qti:!0},extendedTextInteraction:{parents:["stringInteraction","blockInteraction"],qti:!0},inlineChoiceInteraction:{parents:["inlineInteraction"],qti:!0},endAttemptInteraction:{parents:["inlineInteraction"],qti:!0},customInteraction:{parents:["block","flow","interaction"],qti:!0},_container:{parents:["block"],qti:!0}},QtiElements.cache={containable:{},children:{},parents:{}},QtiElements.getAllowedContainersElements=function(qtiClass,$container){var classes=QtiElements.getAllowedContainers(qtiClass),jqSelector="";for(var i in classes)classes[i].qti||(jqSelector+=classes[i]+", ");return jqSelector&&(jqSelector=jqSelector.substring(0,jqSelector.length-2)),$(jqSelector,$container?$container:$(document)).filter(":not([data-qti-type])")},QtiElements.getAllowedContainers=function(qtiClass){var ret;if(QtiElements.cache.containable[qtiClass])ret=QtiElements.cache.containable[qtiClass];else{ret=[];var parents=QtiElements.getParentClasses(qtiClass,!0);for(var aClass in QtiElements.classes){var model=QtiElements.classes[aClass];if(model.contains){var intersect=_.intersection(model.contains,parents);intersect.length&&(!model.abstract&&ret.push(aClass),ret=_.union(ret,QtiElements.getChildClasses(aClass,!0)))}}QtiElements.cache.containable[qtiClass]=ret}return ret},QtiElements.getAllowedContents=function(qtiClass,recursive,checked){var ret=[];checked=checked||{};var model=QtiElements.classes[qtiClass];if(model&&model.contains)for(var i in model.contains){var contain=model.contains[i];if(!checked[contain]){checked[contain]=!0,ret.push(contain);var children=QtiElements.getChildClasses(contain,!0);for(var i in children){var child=children[i];checked[child]||(checked[child]=!0,ret.push(child),recursive&&(ret=_.union(ret,QtiElements.getAllowedContents(child,!0,checked))))}recursive&&(ret=_.union(ret,QtiElements.getAllowedContents(contain,!0,checked)))}}var parents=QtiElements.getParentClasses(qtiClass,!0);for(var i in parents)ret=_.union(ret,QtiElements.getAllowedContents(parents[i],recursive,checked));return _.uniq(ret,!1)},QtiElements.isAllowedClass=function(qtiContainerClass,qtiContentClass){var allowedClasses=QtiElements.getAllowedContents(qtiContainerClass);return 0<=_.indexOf(allowedClasses,qtiContentClass)},QtiElements.getParentClasses=function(qtiClass,recursive){var ret;if(recursive&&QtiElements.cache.parents[qtiClass])ret=QtiElements.cache.parents[qtiClass];else{if(ret=[],QtiElements.classes[qtiClass]&&(ret=QtiElements.classes[qtiClass].parents,recursive)){for(var i in ret)ret=_.union(ret,QtiElements.getParentClasses(ret[i],recursive));ret=_.uniq(ret,!1)}QtiElements.cache.parents[qtiClass]=ret}return ret},QtiElements.getChildClasses=function(qtiClass,recursive,type){var cacheType=type?type:"all",ret;if(recursive&&QtiElements.cache.children[qtiClass]&&QtiElements.cache.children[qtiClass][cacheType])ret=QtiElements.cache.children[qtiClass][cacheType];else{for(var aClass in ret=[],QtiElements.classes){var model=QtiElements.classes[aClass];0<=_.indexOf(model.parents,qtiClass)&&(type?model[type]&&ret.push(aClass):ret.push(aClass),recursive&&(ret=_.union(ret,QtiElements.getChildClasses(aClass,recursive,type))))}QtiElements.cache.children[qtiClass]||(QtiElements.cache.children[qtiClass]={}),QtiElements.cache.children[qtiClass][cacheType]=ret}return ret},QtiElements.isBlock=function(qtiClass){return QtiElements.is(qtiClass,"block")},QtiElements.isInline=function(qtiClass){return QtiElements.is(qtiClass,"inline")},QtiElements.is=function(qtiClass,topClass){if(qtiClass===topClass)return!0;var parents=QtiElements.getParentClasses(qtiClass,!0);return 0<=_.indexOf(parents,topClass)},QtiElements.getAvailableAuthoringElements=function(){var tagTitles={commonInteractions:__("Common Interactions"),inlineInteractions:__("Inline Interactions"),graphicInteractions:__("Graphic Interactions")};return{choiceInteraction:{label:__("Choice Interaction"),description:__("Select a single (radio buttons) or multiple (check boxes) responses among a set of choices."),icon:"icon-choice",short:__("Choice"),qtiClass:"choiceInteraction",tags:[tagTitles.commonInteractions,"mcq"],group:"common-interactions"},orderInteraction:{label:__("Order Interaction"),icon:"icon-order",description:__("Arrange a list of choices in the correct order."),short:__("Order"),qtiClass:"orderInteraction",tags:[tagTitles.commonInteractions,"ordering"],group:"common-interactions"},associateInteraction:{label:__("Associate Interaction"),icon:"icon-associate",description:__("Create pair(s) from a series of choices."),short:__("Associate"),qtiClass:"associateInteraction",tags:[tagTitles.commonInteractions,"association"],group:"common-interactions"},matchInteraction:{label:__("Match Interaction"),icon:"icon-match",description:__("Create association(s) between two sets of choices displayed in a table (row and column)."),short:__("Match"),qtiClass:"matchInteraction",tags:[tagTitles.commonInteractions,"association"],group:"common-interactions"},hottextInteraction:{label:__("Hottext Interaction"),icon:"icon-hottext",description:__("Select one or more text parts (hottext) within a text."),short:__("Hottext"),qtiClass:"hottextInteraction",tags:[tagTitles.commonInteractions,"text"],group:"common-interactions"},gapMatchInteraction:{label:__("Gap Match Interaction"),icon:"icon-gap-match",description:__(" Fill in the gaps in a text from a set of choices."),short:__("Gap Match"),qtiClass:"gapMatchInteraction",tags:[tagTitles.commonInteractions,"text","association"],group:"common-interactions"},sliderInteraction:{label:__("Slider Interaction"),icon:"icon-slider",description:__("Select a value within a numerical range."),short:__("Slider"),qtiClass:"sliderInteraction",tags:[tagTitles.commonInteractions,"special"],group:"common-interactions"},extendedTextInteraction:{label:__("Extended Text Interaction"),icon:"icon-extended-text",description:__("Collect open-ended information in one or more text area(s) (strings or numeric values)."),short:__("Extended Text"),qtiClass:"extendedTextInteraction",tags:[tagTitles.commonInteractions,"text"],group:"common-interactions"},uploadInteraction:{label:__("File Upload Interaction"),icon:"icon-upload",description:__("Upload a file (e.g. document, picture...) as a response."),short:__("File Upload"),qtiClass:"uploadInteraction",tags:[tagTitles.commonInteractions,"special"],group:"common-interactions"},mediaInteraction:{label:__("Media Interaction"),icon:"icon-media",description:__("Control the playing parameters (auto-start, loop) of a video or audio file and report the number of time it has been played."),short:__("Media"),qtiClass:"mediaInteraction",tags:[tagTitles.commonInteractions,"media"],group:"common-interactions"},_container:{label:__("Text Block"),icon:"icon-font",description:__("Block contains the content (stimulus) of the item such as text or image. It is also required for Inline Interactions."),short:__("Block"),qtiClass:"_container",tags:[tagTitles.inlineInteractions,"text"],group:"inline-interactions"},inlineChoiceInteraction:{label:__("Inline Choice Interaction"),icon:"icon-inline-choice",description:__("Select a choice from a drop-down list."),short:__("Inline Choice"),qtiClass:"inlineChoiceInteraction",tags:[tagTitles.inlineInteractions,"inline-interactions","mcq"],group:"inline-interactions"},textEntryInteraction:{label:__("Text Entry Interaction"),icon:"icon-text-entry",description:__("Collect open-ended information in a short text input (strings or numeric values)."),short:__("Text Entry"),qtiClass:"textEntryInteraction",tags:[tagTitles.inlineInteractions,"inline-interactions","text"],group:"inline-interactions"},endAttemptInteraction:{label:__("End Attempt Interaction"),icon:"icon-end-attempt",description:__("Trigger the end of the item attempt."),short:__("End Attempt"),qtiClass:"endAttemptInteraction",tags:[tagTitles.inlineInteractions,"inline-interactions","button","submit"],group:"inline-interactions"},hotspotInteraction:{label:__("Hotspot Interaction"),icon:"icon-hotspot",description:__("Select one or more areas (hotspots) displayed on an picture."),short:__("Hotspot"),qtiClass:"hotspotInteraction",tags:[tagTitles.graphicInteractions,"mcq"],group:"graphic-interactions"},graphicOrderInteraction:{label:__("Graphic Order Interaction"),icon:"icon-graphic-order",description:__("Order the areas (hotspots) displayed on a picture."),short:__("Order"),qtiClass:"graphicOrderInteraction",tags:[tagTitles.graphicInteractions,"ordering"],group:"graphic-interactions"},graphicAssociateInteraction:{label:__("Graphic Associate Interaction"),icon:"icon-graphic-associate",description:__("Create association(s) between areas (hotspots) displayed on a picture."),short:__("Associate"),qtiClass:"graphicAssociateInteraction",tags:[tagTitles.graphicInteractions,"association"],group:"graphic-interactions"},graphicGapMatchInteraction:{label:__("Graphic Gap Match Interaction"),icon:"icon-graphic-gap",description:__("Fill in the gaps on a picture with a set of image choices."),short:__("Gap Match"),qtiClass:"graphicGapMatchInteraction",tags:[tagTitles.graphicInteractions,"association"],group:"graphic-interactions"},selectPointInteraction:{label:__("Select Point Interaction"),icon:"icon-select-point",description:__("Position one or more points on a picture (response areas are not displayed)."),short:__("Select Point"),qtiClass:"selectPointInteraction",tags:[tagTitles.graphicInteractions],group:"graphic-interactions"}}},QtiElements}),define("taoQtiItem/portableElementRegistry/factory/ciRegistry",["lodash","taoQtiItem/portableElementRegistry/factory/factory","taoQtiItem/qtiCreator/helper/qtiElements"],function(_,portableElementRegistry,qtiElements){'use strict';return function(){return portableElementRegistry({getAuthoringData:function(typeIdentifier,options){var pciModel;if(options=_.defaults(options||{},{version:0,enabledOnly:!1}),pciModel=this.get(typeIdentifier,options.version),pciModel&&pciModel.creator&&pciModel.creator.hook&&pciModel.creator.icon&&(pciModel.enabled||!options.enabledOnly))return{label:pciModel.label,icon:pciModel.creator.icon.replace(new RegExp("^"+typeIdentifier+"/"),pciModel.baseUrl),short:pciModel.short,description:pciModel.description,qtiClass:"customInteraction."+pciModel.typeIdentifier,tags:_.union(["Custom Interactions"],pciModel.tags),group:"custom-interactions"}}}).on("creatorsloaded",function(){var creators=this.getLatestCreators();_.forEach(creators,function(creator,typeIdentifier){qtiElements.classes["customInteraction."+typeIdentifier]={parents:["customInteraction"],qti:!0}})})}}),define("taoQtiItem/portableElementRegistry/ciRegistry",["lodash","taoQtiItem/portableElementRegistry/factory/ciRegistry","module"],function(_,ciRegistry,module){'use strict';var registry=ciRegistry(),providers=[],config=module.config();return config&&config.providers&&(providers=config.providers),_.each(providers,function(provider){provider.name&&provider.module&&registry.registerProvider(provider.module)}),registry}),define("taoQtiItem/portableElementRegistry/factory/icRegistry",["lodash","taoQtiItem/portableElementRegistry/factory/factory"],function(_,portableElementRegistry){'use strict';return function(){return portableElementRegistry()}}),define("taoQtiItem/portableElementRegistry/icRegistry",["lodash","taoQtiItem/portableElementRegistry/factory/icRegistry","module"],function(_,icRegistry,module){'use strict';var registry=icRegistry(),providers=[],config=module.config();return config&&config.providers&&(providers=config.providers),_.each(providers,function(provider){provider.name&&provider.module&&registry.registerProvider(provider.module)}),registry}),define("taoQtiItem/qtiCreator/context/plugins/content/windowResizer",["jquery","lodash","core/plugin"],function($,_,pluginFactory){'use strict';var $window=$(window);return pluginFactory({name:"windowResizer",init:function(){var qtiCreatorContext=this.getHost();$window.on("resize.itemcreatorwindowresizer",_.throttle(function(){qtiCreatorContext.trigger("resize")},200))},destroy:function(){$window.off("resize.itemcreatorwindowresizer")}})}),define("taoQtiItem/qtiCreator/context/loader",["core/pluginLoader","taoQtiItem/qtiCreator/context/plugins/content/windowResizer"],function(pluginLoader,windowResizer){'use strict';return pluginLoader({content:[windowResizer]})}),define("taoQtiItem/qtiCreator/context/qtiCreatorContext",["lodash","core/eventifier","core/promise","taoQtiItem/qtiCreator/context/loader"],function(_,eventifier,Promise,pluginLoader){'use strict';return function(){var plugins={},pluginRun=function(method){var execStack=[];return _.forEach(plugins,function(plugin){_.isFunction(plugin[method])&&execStack.push(plugin[method]())}),Promise.all(execStack)};return eventifier({init:function init(){var _this2=this;return pluginLoader.load().then(function(){var pluginFactories=pluginLoader.getPlugins();return _.forEach(pluginFactories,function(pluginFactory){var plugin=pluginFactory(_this2);plugins[plugin.getName()]=plugin}),pluginRun("init").then(function(){_this2.trigger("init")})}).catch(function(err){_this2.trigger("error",err)})},destroy:function destroy(){var _this3=this;return pluginRun("destroy").then(function(){_this3.trigger("destroy")}).catch(function(err){this.trigger("error",err)})}})}}),define("taoQtiItem/qtiItem/core/qtiClasses",[],function(){'use strict';return{_container:"taoQtiItem/qtiItem/core/Container",assessmentItem:"taoQtiItem/qtiItem/core/Item",responseProcessing:"taoQtiItem/qtiItem/core/ResponseProcessing",_simpleFeedbackRule:"taoQtiItem/qtiItem/core/response/SimpleFeedbackRule",stylesheet:"taoQtiItem/qtiItem/core/Stylesheet",math:"taoQtiItem/qtiItem/core/Math",img:"taoQtiItem/qtiItem/core/Img",object:"taoQtiItem/qtiItem/core/Object",outcomeDeclaration:"taoQtiItem/qtiItem/core/variables/OutcomeDeclaration",responseDeclaration:"taoQtiItem/qtiItem/core/variables/ResponseDeclaration",rubricBlock:"taoQtiItem/qtiItem/core/RubricBlock",associableHotspot:"taoQtiItem/qtiItem/core/choices/AssociableHotspot",gap:"taoQtiItem/qtiItem/core/choices/Gap",gapImg:"taoQtiItem/qtiItem/core/choices/GapImg",gapText:"taoQtiItem/qtiItem/core/choices/GapText",hotspotChoice:"taoQtiItem/qtiItem/core/choices/HotspotChoice",hottext:"taoQtiItem/qtiItem/core/choices/Hottext",inlineChoice:"taoQtiItem/qtiItem/core/choices/InlineChoice",simpleAssociableChoice:"taoQtiItem/qtiItem/core/choices/SimpleAssociableChoice",simpleChoice:"taoQtiItem/qtiItem/core/choices/SimpleChoice",associateInteraction:"taoQtiItem/qtiItem/core/interactions/AssociateInteraction",choiceInteraction:"taoQtiItem/qtiItem/core/interactions/ChoiceInteraction",endAttemptInteraction:"taoQtiItem/qtiItem/core/interactions/EndAttemptInteraction",extendedTextInteraction:"taoQtiItem/qtiItem/core/interactions/ExtendedTextInteraction",gapMatchInteraction:"taoQtiItem/qtiItem/core/interactions/GapMatchInteraction",graphicAssociateInteraction:"taoQtiItem/qtiItem/core/interactions/GraphicAssociateInteraction",graphicGapMatchInteraction:"taoQtiItem/qtiItem/core/interactions/GraphicGapMatchInteraction",graphicOrderInteraction:"taoQtiItem/qtiItem/core/interactions/GraphicOrderInteraction",hotspotInteraction:"taoQtiItem/qtiItem/core/interactions/HotspotInteraction",hottextInteraction:"taoQtiItem/qtiItem/core/interactions/HottextInteraction",inlineChoiceInteraction:"taoQtiItem/qtiItem/core/interactions/InlineChoiceInteraction",matchInteraction:"taoQtiItem/qtiItem/core/interactions/MatchInteraction",mediaInteraction:"taoQtiItem/qtiItem/core/interactions/MediaInteraction",orderInteraction:"taoQtiItem/qtiItem/core/interactions/OrderInteraction",prompt:"taoQtiItem/qtiItem/core/interactions/Prompt",selectPointInteraction:"taoQtiItem/qtiItem/core/interactions/SelectPointInteraction",sliderInteraction:"taoQtiItem/qtiItem/core/interactions/SliderInteraction",textEntryInteraction:"taoQtiItem/qtiItem/core/interactions/TextEntryInteraction",uploadInteraction:"taoQtiItem/qtiItem/core/interactions/UploadInteraction",feedbackBlock:"taoQtiItem/qtiItem/core/feedbacks/FeedbackBlock",feedbackInline:"taoQtiItem/qtiItem/core/feedbacks/FeedbackInline",modalFeedback:"taoQtiItem/qtiItem/core/feedbacks/ModalFeedback",customInteraction:"taoQtiItem/qtiItem/core/interactions/CustomInteraction",infoControl:"taoQtiItem/qtiItem/core/PortableInfoControl",include:"taoQtiItem/qtiItem/core/Include",table:"taoQtiItem/qtiItem/core/Table",printedVariable:"taoQtiItem/qtiItem/core/PrintedVariable",_tooltip:"taoQtiItem/qtiItem/core/Tooltip"}}),define("taoQtiItem/qtiItem/helper/util",["lodash"],function(_){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;return{buildSerial:function(prefix){for(var id=prefix||"",chars="abcdefghijklmnopqrstuvwxyz0123456789",i=0;22>i;i++)id+=chars.charAt(Math.floor(Math.random()*chars.length));return id},buildId:function(item,prefix){var i=1,suffix="",exists=!1,id,usedIds;if(!item)throw new TypeError("A item is required to generate a unique identifier");usedIds=item.getUsedIds();do exists=!1,id=prefix+suffix,_.contains(usedIds,id)&&(exists=!0,suffix="_"+i,i++);while(exists);return id},buildIdentifier:function(item,prefix,useSuffix){var suffix="",i=1,exists=!1,id,usedIds;if(!item)throw new TypeError("A item is required to generate a unique identifier");if(!prefix)throw new TypeError("Prefix is required to build an identifier");usedIds=item.getUsedIdentifiers(),useSuffix=!!_.isUndefined(useSuffix)||useSuffix,prefix&&(prefix=prefix.replace(/_[0-9]+$/gi,"_").replace(/[^a-zA-Z0-9_]/gi,"_").replace(/(_)+/gi,"_"),useSuffix&&(suffix="_"+i));do exists=!1,id=prefix+suffix,usedIds[id]&&(exists=!0,suffix="_"+i,i++);while(exists);return id},findInCollection:function(element,collectionNames,searchedSerial){var found=null;if(_.isString(collectionNames)&&(collectionNames=[collectionNames]),_.isArray(collectionNames))_.each(collectionNames,function(collectionName){var collection=element;_.each(collectionName.split("."),function(nameToken){collection=collection[nameToken]});var elt=collection[searchedSerial];return elt?(found={parent:element,element:elt},!1):(_.each(collection,function(elt){if(_.isFunction(elt.find)&&(found=elt.find(searchedSerial),found))return!1}),!found)&&void 0});else throw new Error("invalid argument : collectionNames must be an array or a string");return found},addMarkupNamespace:function(markup,ns){return ns?(markup=markup.replace(/<(\/)?([a-z:]+)(\s?)([^><]*)>/g,function($0,$1,$2,$3,$4){return 0<$2.indexOf(":")?$0:($1=$1||"",$3=$3||"","<"+$1+ns+":"+$2+$3+$4+">")}),markup):markup},removeMarkupNamespaces:function(markup){return markup.replace(/<(\/)?(\w*):([^>]*)>/g,"<$1$3>")},getMarkupUsedNamespaces:function(markup){var namespaces=[];return markup.replace(/<(\/)?(\w*):([^>]*)>/g,function(original,slash,ns,node){return namespaces.push(ns),"<"+slash+node+">"}),_.uniq(namespaces)}}}),define("taoQtiItem/qtiItem/helper/rendererConfig",["lodash","jquery"],function(_,$){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$;return{getOptionsFromArguments:function(args){var options={data:{},placeholder:null,subclass:"",renderer:null};return _.each(args,function(arg){arg&&(arg.isRenderer?options.renderer=arg:arg instanceof $&&arg.length?options.placeholder=arg:_.isString(arg)?options.subclass=arg:_.isPlainObject(arg)?options.data=arg:console.log("invalid arg",arg,args))}),options}}}),define("taoQtiItem/qtiItem/core/Element",["jquery","lodash","class","core/logger","taoQtiItem/qtiItem/helper/util","taoQtiItem/qtiItem/helper/rendererConfig"],function($,_,_class,loggerFactory,util,rendererConfig){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,loggerFactory=loggerFactory&&Object.prototype.hasOwnProperty.call(loggerFactory,"default")?loggerFactory["default"]:loggerFactory,util=util&&Object.prototype.hasOwnProperty.call(util,"default")?util["default"]:util,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var _instances={},logger=loggerFactory("taoQtiItem/qtiItem/core/Element"),Element=Class.extend({qtiClass:"",serial:"",rootElement:null,init:function init(serial,attributes){if(this.attributes={},this.metaData={},"object"===_typeof(serial)&&(attributes=serial,serial=""),serial||(serial=util.buildSerial(this.qtiClass+"_")),serial&&("string"!=typeof serial||!serial.match(/^[a-z_0-9]*$/i)))throw"invalid QTI serial : ("+_typeof(serial)+") "+serial;if(!_instances[serial])_instances[serial]=this,this.serial=serial,this.setAttributes(attributes||{});else throw"a QTI Element with the same serial already exists "+serial;"function"==typeof this.initContainer&&this.initContainer(arguments[2]||""),"function"==typeof this.initObject&&this.initObject()},is:function is(qtiClass){return qtiClass===this.qtiClass},placeholder:function placeholder(){return"{{"+this.serial+"}}"},getSerial:function getSerial(){return this.serial},getUsedIdentifiers:function getUsedIdentifiers(){var usedIds={},elts=this.getComposingElements();for(var i in elts){var elt=elts[i],id=elt.attr("identifier");id&&(usedIds[id]=elt)}return usedIds},getUsedIds:function(){var usedIds=[];return _.forEach(this.getComposingElements(),function(elt){var id=elt.attr("id");id&&!_.contains(usedIds,id)&&usedIds.push(id)}),usedIds},attr:function attr(name,value){if(name)if(void 0!==value)this.attributes[name]=value;else if("object"===_typeof(name))for(var prop in name)this.attr(prop,name[prop]);else if("string"==typeof name)return void 0===this.attributes[name]?void 0:this.attributes[name];return this},data:function data(name,value){if(name)if(void 0!==value)this.metaData[name]=value,$(document).trigger("metaChange.qti-widget",{element:this,key:name,value:value});else if("object"===_typeof(name))for(var prop in name)this.data(prop,name[prop]);else if("string"==typeof name)return void 0===this.metaData[name]?void 0:this.metaData[name];return this},removeData:function removeData(name){return delete this.metaData[name],this},removeAttr:function removeAttr(name){return this.removeAttributes(name)},setAttributes:function setAttributes(attributes){return _.isPlainObject(attributes)||logger.warn("attributes should be a plain object"),this.attributes=attributes,this},getAttributes:function getAttributes(){return _.clone(this.attributes)},removeAttributes:function removeAttributes(attrNames){for(var i in"string"==typeof attrNames&&(attrNames=[attrNames]),attrNames)delete this.attributes[attrNames[i]];return this},getComposingElements:function getComposingElements(){function append(element){elts[element.getSerial()]=element,elts=_.extend(elts,element.getComposingElements())}var elts={};return"function"==typeof this.initContainer&&append(this.getBody()),"function"==typeof this.initObject&&append(this.getObject()),_.each(this.metaData,function(v){Element.isA(v,"_container")?append(v):_.isArray(v)&&_.each(v,function(v){Element.isA(v,"_container")&&append(v)})}),elts},getUsedClasses:function getUsedClasses(){var ret=[this.qtiClass],composingElts=this.getComposingElements();return _.each(composingElts,function(elt){ret.push(elt.qtiClass)}),_.uniq(ret)},find:function find(serial){var found=null,object,body;return"function"==typeof this.initObject&&(object=this.getObject(),object.serial===serial&&(found={parent:this,element:object,location:"object"})),found||"function"!=typeof this.initContainer||(body=this.getBody(),found=body.serial===serial?{parent:this,element:body,location:"body"}:this.getBody().find(serial,this)),found},parent:function parent(){var item=this.getRootElement();if(item){var found=item.find(this.getSerial());if(found)return found.parent}return null},setRelatedItem:function setRelatedItem(item){logger.warn("Deprecated use of setRelatedItem()"),this.setRootElement(item)},setRootElement:function setRootElement(item){var composingElts,i;if(Element.isA(item,"assessmentItem"))for(i in this.rootElement=item,composingElts=this.getComposingElements(),composingElts)composingElts[i].setRootElement(item)},getRelatedItem:function getRelatedItem(){return logger.warn("Deprecated use of getRelatedItem()"),this.getRootElement()},getRootElement:function getRootElement(){var ret=null;return Element.isA(this.rootElement,"assessmentItem")&&(ret=this.rootElement),ret},setRenderer:function setRenderer(renderer){if(renderer&&renderer.isRenderer){this.renderer=renderer;var elts=this.getComposingElements();for(var serial in elts)elts[serial].setRenderer(renderer)}else throw"invalid qti rendering engine"},getRenderer:function getRenderer(){return this.renderer},render:function(){var args=rendererConfig.getOptionsFromArguments(arguments),_renderer=args.renderer||this.getRenderer(),tplData={},defaultData={tag:this.qtiClass,serial:this.serial,attributes:this.getAttributes()},rendering;if(!_renderer)throw new Error("render: no renderer found for the element "+this.qtiClass+":"+this.serial);return"function"==typeof this.initContainer&&(defaultData.body=this.getBody().render(args.renderer)),"function"==typeof this.initObject&&(defaultData.object={attributes:this.object.getAttributes()},defaultData.object.attributes.data=_renderer.resolveUrl(this.object.attr("data"))),tplData=_.merge(defaultData,args.data||{}),tplData=_renderer.getData(this,tplData,args.subclass),rendering=_renderer.renderTpl(this,tplData,args.subclass),args.placeholder&&args.placeholder.replaceWith(rendering),rendering},postRender:function postRender(data,altClassName,renderer){var postRenderers=[],_renderer=renderer||this.getRenderer();if("function"==typeof this.initContainer&&(postRenderers=this.getBody().postRender(data,"",renderer)),_renderer)postRenderers.push(_renderer.postRender(this,data,altClassName));else throw"postRender: no renderer found for the element "+this.qtiClass+":"+this.serial;return _.compact(postRenderers)},getContainer:function getContainer($scope,subclass){var renderer=this.getRenderer();if(renderer)return renderer.getContainer(this,$scope,subclass);throw"getContainer: no renderer found for the element "+this.qtiClass+":"+this.serial},toArray:function toArray(){var arr={serial:this.serial,type:this.qtiClass,attributes:this.getAttributes()};return"function"==typeof this.initContainer&&(arr.body=this.getBody().toArray()),"function"==typeof this.initObject&&(arr.object=this.object.toArray()),arr},isEmpty:function isEmpty(){return!1},addClass:function addClass(className){var clazz=this.attr("class")||"";_containClass(clazz,className)||this.attr("class",clazz+(clazz.length?" ":"")+className)},hasClass:function hasClass(className){return _containClass(this.attr("class"),className)},removeClass:function removeClass(className){var clazz=this.attr("class")||"";if(clazz){var regex=new RegExp("(?:^|\\s)"+className+"(?:\\s|$)");clazz=clazz.replace(regex," ").trim(),clazz?this.attr("class",clazz):this.removeAttr("class")}},toggleClass:function toggleClass(className,state){return"boolean"==typeof state?state?this.addClass(className):this.removeClass(className):this.hasClass(className)?this.removeClass(className):this.addClass(className)},isset:function isset(){return Element.issetElement(this.serial)},unset:function unset(){return Element.unsetElement(this.serial)}}),_containClass=function(allClassStr,className){var regex=new RegExp("(?:^|\\s)"+className+"(?:\\s|$)","");return allClassStr&&regex.test(allClassStr)};return Element.isA=function(qtiElement,qtiClass){return qtiElement instanceof Element&&qtiElement.is(qtiClass)},Element.getElementBySerial=function(serial){return _instances[serial]},Element.issetElement=function(serial){return!!_instances[serial]},Element.unsetElement=function(serial){var element=Element.getElementBySerial(serial);if(element){var composingElements=element.getComposingElements();return _.each(composingElements,function(elt){delete _instances[elt.serial]}),delete _instances[element.serial],!0}return!1},Element}),define("taoQtiItem/qtiItem/helper/xmlNsHandler",[],function(){'use strict';function getPrefix(namespaces,html5Ns){for(var key in namespaces)if(namespaces[key]===html5Ns)return key;return"qh5"}return{stripNs:function(body){return body.replace(/(<([\w]+)\:(article|aside|bdi|figure|footer|header|nav|rb|rp|rt|rtc|ruby|section))/gi,"<$3").replace(/(<\/([\w]+)\:(article|aside|bdi|figure|footer|header|nav|rb|rp|rt|rtc|ruby|section)>)/gi,"</$3>")},restoreNs:function(xml,namespaces){var xmlMatch=xml.match(/(<(article|aside|bdi|figure|footer|header|nav|rb|rp|rt|rtc|ruby|section)[^>]*>|<\/(article|aside|bdi|figure|footer|header|nav|rb|rp|rt|rtc|ruby|section)>)/gi),imsXsd="http://www.imsglobal.org/xsd",html5Ns=imsXsd+"/imsqtiv2p2_html5_v1p0",prefix=getPrefix(namespaces,html5Ns),prefixAtt="xmlns:"+prefix+"=\""+html5Ns+"\"",i=xmlMatch?xmlMatch.length:0,tagMatch;if(!xmlMatch)return xml;for(;i--;)tagMatch=xmlMatch[i].match(/((<)(article|aside|bdi|figure|footer|header|nav|rb|rp|rt|rtc|ruby|section)([^>]*)(>)|(<\/)(article|aside|bdi|figure|footer|header|nav|rb|rp|rt|rtc|ruby|section)(>))/i),xml=xml.replace(xmlMatch[i],tagMatch[5]?"<"+prefix+":"+tagMatch[3]+tagMatch[4]+">":"</"+prefix+":"+tagMatch[7]+">");return xmlMatch.length&&-1===xml.indexOf(prefixAtt)&&(xml=xml.replace("<assessmentItem","<assessmentItem "+prefixAtt)),xml=xml.replace("xmlns=\""+imsXsd+"/imsqti_v2p1\"","xmlns=\""+imsXsd+"/imsqti_v2p2\""),xml=xml.replace("xsi:schemaLocation=\""+imsXsd+"/imsqti_v2p1 imsqti_v2p1.xsd\"","xsi:schemaLocation=\""+imsXsd+"/imsqti_v2p2 "+imsXsd+"/qti/qtiv2p2/imsqti_v2p2.xsd\""),xml}}}),define("taoQtiItem/qtiItem/helper/responseRules",[],function(){'use strict';return{MATCH_CORRECT:function MATCH_CORRECT(responseIdentifier,outcomeIdentifier){return{qtiClass:"responseCondition",responseIf:{qtiClass:"responseIf",expression:{qtiClass:"match",expressions:[{qtiClass:"variable",attributes:{identifier:responseIdentifier}},{qtiClass:"correct",attributes:{identifier:responseIdentifier}}]},responseRules:[{qtiClass:"setOutcomeValue",attributes:{identifier:outcomeIdentifier},expression:{qtiClass:"sum",expressions:[{qtiClass:"variable",attributes:{identifier:outcomeIdentifier}},{qtiClass:"baseValue",attributes:{baseType:"integer"},value:"1"}]}}]}}},MAP_RESPONSE:function MAP_RESPONSE(responseIdentifier,outcomeIdentifier){return{qtiClass:"responseCondition",responseIf:{qtiClass:"responseIf",expression:{qtiClass:"not",expressions:[{qtiClass:"isNull",expressions:[{qtiClass:"variable",attributes:{identifier:responseIdentifier}}]}]},responseRules:[{qtiClass:"setOutcomeValue",attributes:{identifier:outcomeIdentifier},expression:{qtiClass:"sum",expressions:[{qtiClass:"variable",attributes:{identifier:outcomeIdentifier}},{qtiClass:"mapResponse",attributes:{identifier:responseIdentifier}}]}}]}}},MAP_RESPONSE_POINT:function MAP_RESPONSE_POINT(responseIdentifier,outcomeIdentifier){return{qtiClass:"responseCondition",responseIf:{qtiClass:"responseIf",expression:{qtiClass:"not",expressions:[{qtiClass:"isNull",expressions:[{qtiClass:"variable",attributes:{identifier:responseIdentifier}}]}]},responseRules:[{qtiClass:"setOutcomeValue",attributes:{identifier:outcomeIdentifier},expression:{qtiClass:"sum",expressions:[{qtiClass:"variable",attributes:{identifier:outcomeIdentifier}},{qtiClass:"mapResponsePoint",attributes:{identifier:responseIdentifier}}]}}]}}}}}),define("taoQtiItem/qtiItem/helper/response",["lodash","taoQtiItem/qtiItem/helper/responseRules"],function(_,responseRulesHelper){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,responseRulesHelper=responseRulesHelper&&Object.prototype.hasOwnProperty.call(responseRulesHelper,"default")?responseRulesHelper["default"]:responseRulesHelper;var _templateNames={MATCH_CORRECT:"http://www.imsglobal.org/question/qti_v2p1/rptemplates/match_correct",MAP_RESPONSE:"http://www.imsglobal.org/question/qti_v2p1/rptemplates/map_response",MAP_RESPONSE_POINT:"http://www.imsglobal.org/question/qti_v2p1/rptemplates/map_response_point",NONE:"no_response_processing"};return{isUsingTemplate:function isUsingTemplate(response,tpl){return!!(_.isString(tpl)&&(tpl===response.template||_templateNames[tpl]===response.template))},isValidTemplateName:function isValidTemplateName(tplName){return!!this.getTemplateUriFromName(tplName)},getTemplateUriFromName:function getTemplateUriFromName(tplName){return _templateNames[tplName]||""},getTemplateNameFromUri:function getTemplateNameFromUri(tplUri){var tplName="";return _.forIn(_templateNames,function(uri,name){if(uri===tplUri)return tplName=name,!1}),tplName},getTemplateNameFromResponseRules:function getTemplateNameFromResponseRules(responseIdentifier,responseRules){if(!responseRules)return"NONE";var _responseRules$respon=responseRules.responseIf;_responseRules$respon=void 0===_responseRules$respon?{}:_responseRules$respon;var _responseRules$respon2=_responseRules$respon.responseRules;_responseRules$respon2=void 0===_responseRules$respon2?[]:_responseRules$respon2;var _responseRules$respon3=_slicedToArray(_responseRules$respon2,1),_responseRules$respon4=_responseRules$respon3[0],outcomeRules=void 0===_responseRules$respon4?{}:_responseRules$respon4,_outcomeRules$attribu=outcomeRules.attributes;_outcomeRules$attribu=void 0===_outcomeRules$attribu?{}:_outcomeRules$attribu;var outcomeIdentifier=_outcomeRules$attribu.identifier;return outcomeIdentifier?Object.keys(responseRulesHelper).find(function(key){return _.isEqual(responseRules,responseRulesHelper[key](responseIdentifier,outcomeIdentifier))}):""}}}),define("taoQtiItem/qtiItem/helper/itemScore",[],function(){'use strict';return function itemScore(responseIdentifiers){var outcomeExpressions=responseIdentifiers.map(function(outcomeIdentifier){return{qtiClass:"variable",attributes:{identifier:"SCORE_".concat(outcomeIdentifier)}}});return{qtiClass:"setOutcomeValue",attributes:{identifier:"SCORE"},expression:{qtiClass:"sum",expressions:outcomeExpressions}}}}),define("taoQtiItem/qtiItem/core/Loader",["lodash","class","taoQtiItem/qtiItem/core/qtiClasses","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/helper/xmlNsHandler","core/moduleLoader","taoQtiItem/qtiItem/helper/response","taoQtiItem/qtiItem/helper/itemScore"],function(_,_class,qtiClasses,Element,xmlNsHandler,moduleLoader,responseHelper,itemScoreHelper){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,qtiClasses=qtiClasses&&Object.prototype.hasOwnProperty.call(qtiClasses,"default")?qtiClasses["default"]:qtiClasses,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,xmlNsHandler=xmlNsHandler&&Object.prototype.hasOwnProperty.call(xmlNsHandler,"default")?xmlNsHandler["default"]:xmlNsHandler,moduleLoader=moduleLoader&&Object.prototype.hasOwnProperty.call(moduleLoader,"default")?moduleLoader["default"]:moduleLoader,responseHelper=responseHelper&&Object.prototype.hasOwnProperty.call(responseHelper,"default")?responseHelper["default"]:responseHelper,itemScoreHelper=itemScoreHelper&&Object.prototype.hasOwnProperty.call(itemScoreHelper,"default")?itemScoreHelper["default"]:itemScoreHelper;var loadPortableCustomElementProperties=function(portableElement,rawProperties){var properties={};_.forOwn(rawProperties,function(value,key){try{properties[key]=JSON.parse(value)}catch(e){properties[key]=value}}),portableElement.properties=properties},loadPortableCustomElementData=function(portableElement,data){portableElement.typeIdentifier=data.typeIdentifier,portableElement.markup=data.markup,portableElement.entryPoint=data.entryPoint,portableElement.libraries=data.libraries,portableElement.setNamespace("",data.xmlns),loadPortableCustomElementProperties(portableElement,data.properties)},Loader=Class.extend({init:function init(item,classesLocation){this.qti={},this.classesLocation={},this.item=item||null,this.setClassesLocation(classesLocation||qtiClasses)},setClassesLocation:function setClassesLocation(qtiClassesList){return _.extend(this.classesLocation,qtiClassesList),this},getRequiredClasses:function getRequiredClasses(data){var ret=[];for(var i in data)"qtiClass"==i&&"_container"!==data[i]&&"rootElement"!==i?ret.push(data[i]):"object"===_typeof(data[i])&&"responseRules"!==i&&(ret=_.union(ret,this.getRequiredClasses(data[i])));return ret},loadRequiredClasses:function loadRequiredClasses(data,callback,reload){var _this4=this,requiredClasses=this.getRequiredClasses(data,reload),required=[],requiredClass;for(var i in requiredClasses)if(requiredClass=requiredClasses[i],this.classesLocation[requiredClass])required.push({module:this.classesLocation[requiredClass],category:"qti"});else throw new Error("missing qti class location declaration : ".concat(requiredClass));moduleLoader([],function(){return!0}).addList(required).load().then(function(loadeded){loadeded.forEach(function(QtiClass){_this4.qti[QtiClass.prototype.qtiClass]=QtiClass}),callback.call(_this4,_this4.qti)})},getLoadedClasses:function getLoadedClasses(){return _.keys(this.qti)},loadItemData:function loadItemData(data,callback){var _this5=this;this.loadRequiredClasses(data,function(Qti){"object"===_typeof(data)&&"assessmentItem"===data.qtiClass&&function(){for(var i in data.serial&&Element.unsetElement(data.serial),_this5.item=new Qti.assessmentItem(data.serial,data.attributes||{}),_this5.loadContainer(_this5.item.getBody(),data.body),data.outcomes){var outcome=_this5.buildOutcome(data.outcomes[i]);outcome&&_this5.item.addOutcomeDeclaration(outcome)}for(var _i2 in data.feedbacks){var feedback=_this5.buildElement(data.feedbacks[_i2]);feedback&&_this5.item.addModalFeedback(feedback)}for(var _i3 in data.stylesheets){var stylesheet=_this5.buildElement(data.stylesheets[_i3]);stylesheet&&_this5.item.addStylesheet(stylesheet)}var responseRules=data.responseProcessing&&data.responseProcessing.responseRules?_toConsumableArray(data.responseProcessing.responseRules):[],_loop=function(_i4){var responseIdentifier=data.responses[_i4].identifier,responseRuleItemIndex=responseRules.findIndex(function(_ref){var _ref$responseIf=_ref.responseIf;_ref$responseIf=void 0===_ref$responseIf?{}:_ref$responseIf;var _ref$responseIf$expre=_ref$responseIf.expression;_ref$responseIf$expre=void 0===_ref$responseIf$expre?{}:_ref$responseIf$expre;var _ref$responseIf$expre2=_ref$responseIf$expre.expressions;_ref$responseIf$expre2=void 0===_ref$responseIf$expre2?[]:_ref$responseIf$expre2;var _ref$responseIf$expre3=_slicedToArray(_ref$responseIf$expre2,1),_ref$responseIf$expre4=_ref$responseIf$expre3[0],expression=void 0===_ref$responseIf$expre4?{}:_ref$responseIf$expre4;return expression.attributes&&expression.attributes.identifier===responseIdentifier||expression.expressions&&expression.expressions[0]&&expression.expressions[0].attributes&&expression.expressions[0].attributes.identifier===responseIdentifier}),_ref2=-1===responseRuleItemIndex?[]:responseRules.splice(responseRuleItemIndex,1),_ref3=_slicedToArray(_ref2,1),responseRule=_ref3[0],response=_this5.buildResponse(data.responses[_i4],responseRule);if(response){_this5.item.addResponseDeclaration(response);var feedbackRules=data.responses[_i4].feedbackRules;feedbackRules&&_.forIn(feedbackRules,function(fbData,serial){var _ref4=data.outcomes[fbData.feedbackOutcome]||{},_ref4$attributes=_ref4.attributes;_ref4$attributes=void 0===_ref4$attributes?{}:_ref4$attributes;var feedbackOutcomeIdentifier=_ref4$attributes.identifier;response.feedbackRules[serial]=_this5.buildSimpleFeedbackRule(fbData,response);var feedbackResponseRuleIndex=responseRules.findIndex(function(_ref5){var _ref5$responseIf=_ref5.responseIf;_ref5$responseIf=void 0===_ref5$responseIf?{}:_ref5$responseIf;var _ref5$responseIf$resp=_ref5$responseIf.responseRules;_ref5$responseIf$resp=void 0===_ref5$responseIf$resp?[]:_ref5$responseIf$resp;var _ref5$responseIf$resp2=_slicedToArray(_ref5$responseIf$resp,1),_ref5$responseIf$resp3=_ref5$responseIf$resp2[0],setOutcomeResponseRule=void 0===_ref5$responseIf$resp3?{}:_ref5$responseIf$resp3,_setOutcomeResponseRu=setOutcomeResponseRule.attributes,attributes=void 0===_setOutcomeResponseRu?{}:_setOutcomeResponseRu,qtiClass=setOutcomeResponseRule.qtiClass,outcomeIdentifier=attributes.identifier;return feedbackOutcomeIdentifier===outcomeIdentifier&&"setOutcomeValue"===qtiClass});-1!==feedbackResponseRuleIndex&&responseRules.splice(feedbackResponseRuleIndex,1)})}};for(var _i4 in data.responses)_loop(_i4);var responseIdentifiers=Object.keys(_this5.item.responses||{}).map(function(responseKey){return _this5.item.responses[responseKey].attributes.identifier});if(data.responseProcessing){var customResponseProcessing=0<responseRules.length&&!(1===responseRules.length&&_.isEqual(responseRules[0],itemScoreHelper(responseIdentifiers)))||_this5.item.responses&&Object.keys(_this5.item.responses).some(function(responseKey){return!_this5.item.responses[responseKey].template});_this5.item.setResponseProcessing(_this5.buildResponseProcessing(data.responseProcessing,customResponseProcessing))}_this5.item.setNamespaces(data.namespaces),_this5.item.setSchemaLocations(data.schemaLocations),_this5.item.setApipAccessibility(data.apipAccessibility)}(),"function"==typeof callback&&callback.call(_this5,_this5.item)})},loadAndBuildElement:function loadAndBuildElement(data,callback){var _this6=this;this.loadRequiredClasses(data,function(){var element=_this6.buildElement(data);"function"==typeof callback&&callback.call(_this6,element)})},loadElement:function loadElement(element,data,callback){var _this7=this;this.loadRequiredClasses(data,function(){_this7.loadElementData(element,data),"function"==typeof callback&&callback.call(_this7,element)})},loadElements:function loadElements(data,callback){var _this8=this;if(!this.item)throw new Error("QtiLoader : cannot load elements in empty item");this.loadRequiredClasses(data,function(){var allElements=_this8.item.getComposingElements();for(var i in data){var elementData=data[i];elementData&&elementData.qtiClass&&elementData.serial&&allElements[elementData.serial]&&_this8.loadElementData(allElements[elementData.serial],elementData)}"function"==typeof callback&&callback.call(_this8,_this8.item)})},buildResponse:function buildResponse(data,responseRule){var response=this.buildElement(data);return response.template=responseHelper.getTemplateUriFromName(responseHelper.getTemplateNameFromResponseRules(data.identifier,responseRule))||data.howMatch||null,response.defaultValue=data.defaultValue||null,response.correctResponse=data.correctResponses||null,response.mapEntries=_.size(data.mapping)?data.mapping:_.size(data.areaMapping)?data.areaMapping:{},response.mappingAttributes=data.mappingAttributes||{},response},buildSimpleFeedbackRule:function buildSimpleFeedbackRule(data,response){var feedbackRule=this.buildElement(data);feedbackRule.setCondition(response,data.condition,data.comparedValue||null),feedbackRule.feedbackOutcome=this.item.outcomes[data.feedbackOutcome]||null,feedbackRule.feedbackThen=this.item.modalFeedbacks[data.feedbackThen]||null,feedbackRule.feedbackElse=this.item.modalFeedbacks[data.feedbackElse]||null;var comparedOutcome=feedbackRule.comparedOutcome;return feedbackRule.feedbackThen&&feedbackRule.feedbackThen.data("relatedResponse",comparedOutcome),feedbackRule.feedbackElse&&feedbackRule.feedbackElse.data("relatedResponse",comparedOutcome),feedbackRule},buildOutcome:function buildOutcome(data){var outcome=this.buildElement(data);return outcome.defaultValue=data.defaultValue||null,outcome},buildResponseProcessing:function buildResponseProcessing(data,customResponseProcessing){var rp=this.buildElement(data);return customResponseProcessing?(rp.xml=data.data,rp.processingType="custom"):rp.processingType="templateDriven",rp},loadContainer:function loadContainer(bodyObject,bodyData){if(!Element.isA(bodyObject,"_container"))throw new Error("bodyObject must be a QTI Container");if(!(bodyData&&"string"==typeof bodyData.body&&"object"===_typeof(bodyData.elements)))throw new Error("wrong bodydata format");for(var serial in bodyData.elements){var eltData=bodyData.elements[serial],element=this.buildElement(eltData);element&&bodyObject.setElement(element,bodyData.body)}bodyObject.body(xmlNsHandler.stripNs(bodyData.body))},buildElement:function buildElement(elementData){if(!(elementData&&elementData.qtiClass&&elementData.serial))throw new Error("wrong elementData format");var className=elementData.qtiClass;if(!this.qti[className])throw new Error("the qti element class does not exist: ".concat(className));var elt=new this.qti[className](elementData.serial);return this.loadElementData(elt,elementData),elt},loadElementData:function loadElementData(element,data){var attributes=_.defaults(data.attributes||{},element.attributes||{});return element.setAttributes(attributes),element.body&&data.body&&element.bdy&&this.loadContainer(element.getBody(),data.body),element.object&&data.object&&element.object&&this.loadObjectData(element.object,data.object),Element.isA(element,"interaction")?this.loadInteractionData(element,data):Element.isA(element,"choice")?this.loadChoiceData(element,data):Element.isA(element,"math")?this.loadMathData(element,data):Element.isA(element,"infoControl")?this.loadPicData(element,data):Element.isA(element,"_tooltip")&&this.loadTooltipData(element,data),element},loadInteractionData:function loadInteractionData(interaction,data){Element.isA(interaction,"blockInteraction")&&data.prompt&&this.loadContainer(interaction.prompt.getBody(),data.prompt),this.buildInteractionChoices(interaction,data),Element.isA(interaction,"customInteraction")&&this.loadPciData(interaction,data)},buildInteractionChoices:function buildInteractionChoices(interaction,data){if(data.choices){if(Element.isA(interaction,"matchInteraction"))for(var set=0;2>set;set++){if(!data.choices[set])throw new Error("missing match set #".concat(set));var matchSet=data.choices[set];for(var serial in matchSet){var choice=this.buildElement(matchSet[serial]);choice&&interaction.addChoice(choice,set)}}else for(var _serial in data.choices){var _choice=this.buildElement(data.choices[_serial]);_choice&&interaction.addChoice(_choice)}if(Element.isA(interaction,"graphicGapMatchInteraction")&&data.gapImgs)for(var _serial2 in data.gapImgs){var gapImg=this.buildElement(data.gapImgs[_serial2]);gapImg&&interaction.addGapImg(gapImg)}}},loadChoiceData:function loadChoiceData(choice,data){if(Element.isA(choice,"textVariableChoice"))choice.val(data.text);else if(Element.isA(choice,"gapImg"));else if(Element.isA(choice,"gapText"))choice.body()||choice.body(data.text);else if(Element.isA(choice,"containerChoice"));},loadObjectData:function loadObjectData(object,data){object.setAttributes(data.attributes),data._alt&&("object"===data._alt.qtiClass?object._alt=Loader.buildElement(data._alt):object._alt=data._alt)},loadMathData:function loadMathData(math,data){math.ns=data.ns||{},math.setMathML(data.mathML||""),_.forIn(data.annotations||{},function(value,encoding){math.setAnnotation(encoding,value)})},loadTooltipData:function loadTooltipData(tooltip,data){tooltip.content(data.content)},loadPciData:function loadPciData(pci,data){loadPortableCustomElementData(pci,data)},loadPicData:function loadPicData(pic,data){loadPortableCustomElementData(pic,data)}});return Loader}),define("taoQtiItem/qtiCreator/model/helper/event",["jquery","lodash"],function($,_){"use strict";var namespaceModel=".qti-creator",eventList=["containerBodyChange","containerElementAdded","elementCreated.qti-widget","attributeChange.qti-widget","choiceCreated.qti-widget","correctResponseChange.qti-widget","mapEntryChange.qti-widget","mapEntryRemove.qti-widget","deleted.qti-widget","choiceTextChange.qti-widget","responseTemplateChange.qti-widget","mappingAttributeChange.qti-widget","feedbackRuleConditionChange.qti-widget","feedbackRuleCreated.qti-widget","feedbackRuleRemoved.qti-widget","feedbackRuleElseCreated.qti-widget","feedbackRuleElseRemoved.qti-widget"],event={choiceCreated:function(choice,interaction){$(document).trigger("choiceCreated.qti-widget",{choice:choice,interaction:interaction})},choiceDeleted:function(choice,interaction){$(document).trigger("choiceDeleted.qti-widget",{choice:choice,interaction:interaction})},deleted:function deleted(element,parent){element.isset()&&element.unset(),$(document).off("."+element.getSerial()),$(document).trigger("deleted.qti-widget",{element:element,parent:parent})},getList:function getList(addedNamespace){var events=_.clone(eventList);return addedNamespace?_.map(events,function(e){return e+"."+addedNamespace}):events},initElementToWidgetListeners:function initElementToWidgetListeners(){$(document).off(".widget-container").on(event.getList(".widget-container").join(" "),function(e,data){var element=data.element||data.container||null,widget=data&&element&&element.data("widget");!widget&&data.parent&&(element=data.parent,widget=element.data("widget")),widget&&widget.$container.trigger(e.type+".qti-creator"+namespaceModel,data)})},getNs:function getNs(){return".qti-creator"},getNsModel:function getNsModel(){return namespaceModel}};return event}),define("taoQtiItem/qtiCreator/model/helper/invalidator",["lodash"],function(_){'use strict';return{completelyValid:function completelyValid(element){var item=element.getRootElement();if(item){var serial=element.getSerial(),invalidElements=item.data("invalid")||{};delete invalidElements[serial],item.data("invalid",invalidElements)}},valid:function valid(element,key){var item=element.getRootElement(),serial=element.getSerial();if(item){var invalidElements=item.data("invalid")||{};if(key)invalidElements[serial]&&invalidElements[serial][key]&&(delete invalidElements[serial][key],!_.size(invalidElements[serial])&&delete invalidElements[serial],item.data("invalid",invalidElements));else throw new Error("missing required argument \"key\"")}},invalid:function invalid(element,key,message,stateName){var item=element.getRootElement(),serial=element.getSerial();if(item){var invalidElements=item.data("invalid")||{};if(key)invalidElements[serial]||(invalidElements[serial]={}),invalidElements[serial][key]={message:message||"",stateName:stateName||"active"},item.data("invalid",invalidElements);else throw new Error("missing required arguments \"key\"")}},isValid:function isValid(element,key){var item=element.getRootElement(),serial=element.getSerial();if(item){var invalidElements=item.data("invalid")||{};return key?!(invalidElements[serial]&&invalidElements[serial][key]):!invalidElements[serial]}return!0}}}),define("taoQtiItem/qtiCreator/model/mixin/editable",["lodash","jquery","core/encoder/entity","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/model/helper/event","taoQtiItem/qtiCreator/model/helper/invalidator"],function(_,$,entity,Element,event,invalidator){'use strict';var _removeSelf=function(element){var removed=!1,related=element.getRootElement();if(related){var found=related.find(element.getSerial());if(found){var parent=found.parent;if(element.getResponseDeclaration){var response=element.getResponseDeclaration();response&&(invalidator.completelyValid(response),Element.unsetElement(response))}Element.isA(parent,"interaction")?("gapImg"===element.qtiClass?parent.removeGapImg(element):Element.isA(element,"choice")&&parent.removeChoice(element),removed=!0):"body"===found.location&&_.isFunction(parent.initContainer)?(_.isFunction(element.beforeRemove)&&element.beforeRemove(),parent.getBody().removeElement(element),removed=!0):Element.isA(parent,"_container")&&(_.isFunction(element.beforeRemove)&&element.beforeRemove(),parent.removeElement(element),removed=!0),removed&&(element.data("removed",!0),invalidator.completelyValid(element),event.deleted(element,parent))}}else throw new Error("no related item found");return removed},_removeElement=function(element,containerPropName,eltToBeRemoved){var targetSerial="",targetElt;return element[containerPropName]&&("string"==typeof eltToBeRemoved?(targetSerial=eltToBeRemoved,targetElt=Element.getElementBySerial(targetSerial)):eltToBeRemoved instanceof Element&&(targetSerial=eltToBeRemoved.getSerial(),targetElt=eltToBeRemoved),targetSerial&&(invalidator.completelyValid(targetElt),delete element[containerPropName][targetSerial],Element.unsetElement(targetSerial))),element};return{init:function init(serial,attributes){var attr={};"object"===_typeof(serial)&&(attributes=serial,serial=""),_.isFunction(this.getDefaultAttributes)&&_.extend(attr,this.getDefaultAttributes()),_.extend(attr,attributes),this._super(serial,attr)},attr:function attr(key,value){var ret=this._super(key,value);return"undefined"!=typeof key&&"undefined"!=typeof value&&$(document).trigger("attributeChange.qti-widget",{element:this,key:key,value:entity.encode(value)}),_.isString(ret)?entity.decode(ret):ret},removeAttr:function removeAttr(key){var ret=this._super(key);return $(document).trigger("attributeChange.qti-widget",{element:this,key:key,value:null}),ret},remove:function remove(){if(0===arguments.length)return _removeSelf(this);if(2===arguments.length)return _removeElement(this,arguments[0],arguments[1]);throw new Error("invalid number of argument given")}}}),define("taoQtiItem/qtiCreator/model/qtiClasses",["lodash","taoQtiItem/qtiItem/core/qtiClasses"],function(_,qtiClasses){"use strict";return _.defaults({assessmentItem:"taoQtiItem/qtiCreator/model/Item",_container:"taoQtiItem/qtiCreator/model/Container",img:"taoQtiItem/qtiCreator/model/Img",math:"taoQtiItem/qtiCreator/model/Math",object:"taoQtiItem/qtiCreator/model/Object",table:"taoQtiItem/qtiCreator/model/Table",rubricBlock:"taoQtiItem/qtiCreator/model/RubricBlock",modalFeedback:"taoQtiItem/qtiCreator/model/feedbacks/ModalFeedback",choiceInteraction:"taoQtiItem/qtiCreator/model/interactions/ChoiceInteraction",orderInteraction:"taoQtiItem/qtiCreator/model/interactions/OrderInteraction",associateInteraction:"taoQtiItem/qtiCreator/model/interactions/AssociateInteraction",matchInteraction:"taoQtiItem/qtiCreator/model/interactions/MatchInteraction",inlineChoiceInteraction:"taoQtiItem/qtiCreator/model/interactions/InlineChoiceInteraction",simpleChoice:"taoQtiItem/qtiCreator/model/choices/SimpleChoice",simpleAssociableChoice:"taoQtiItem/qtiCreator/model/choices/SimpleAssociableChoice",inlineChoice:"taoQtiItem/qtiCreator/model/choices/InlineChoice",mediaInteraction:"taoQtiItem/qtiCreator/model/interactions/MediaInteraction",uploadInteraction:"taoQtiItem/qtiCreator/model/interactions/UploadInteraction",textEntryInteraction:"taoQtiItem/qtiCreator/model/interactions/TextEntryInteraction",sliderInteraction:"taoQtiItem/qtiCreator/model/interactions/SliderInteraction",extendedTextInteraction:"taoQtiItem/qtiCreator/model/interactions/ExtendedTextInteraction",hotspotInteraction:"taoQtiItem/qtiCreator/model/interactions/HotspotInteraction",selectPointInteraction:"taoQtiItem/qtiCreator/model/interactions/SelectPointInteraction",graphicInteraction:"taoQtiItem/qtiCreator/model/interactions/GraphicOrderInteraction",graphicAssociateInteraction:"taoQtiItem/qtiCreator/model/interactions/GraphicAssociateInteraction",graphicGapMatchInteraction:"taoQtiItem/qtiCreator/model/interactions/GraphicGapMatchInteraction",graphicOrderInteraction:"taoQtiItem/qtiCreator/model/interactions/GraphicOrderInteraction",hotspotChoice:"taoQtiItem/qtiCreator/model/choices/HotspotChoice",gapImg:"taoQtiItem/qtiCreator/model/choices/GapImg",associableHotspot:"taoQtiItem/qtiCreator/model/choices/AssociableHotspot",gapMatchInteraction:"taoQtiItem/qtiCreator/model/interactions/GapMatchInteraction",hottextInteraction:"taoQtiItem/qtiCreator/model/interactions/HottextInteraction",hottext:"taoQtiItem/qtiCreator/model/choices/Hottext",gapText:"taoQtiItem/qtiCreator/model/choices/GapText",gap:"taoQtiItem/qtiCreator/model/choices/Gap",responseDeclaration:"taoQtiItem/qtiCreator/model/variables/ResponseDeclaration",responseProcessing:"taoQtiItem/qtiCreator/model/ResponseProcessing",customInteraction:"taoQtiItem/qtiCreator/model/interactions/PortableCustomInteraction",endAttemptInteraction:"taoQtiItem/qtiCreator/model/interactions/EndAttemptInteraction",infoControl:"taoQtiItem/qtiCreator/model/PortableInfoControl",include:"taoQtiItem/qtiCreator/model/Include",printedVariable:"taoQtiItem/qtiCreator/model/PrintedVariable",_tooltip:"taoQtiItem/qtiCreator/model/Tooltip"},qtiClasses)}),define("taoQtiItem/qtiCreator/model/helper/container",["jquery","lodash","taoQtiItem/qtiCreator/model/qtiClasses"],function($,_,qtiClasses){"use strict";return{createElements:function createElements(container,body,callback){var regex=/{{([a-z_]+)\.?([a-z_]*):new}}/ig,required={};body.replace(regex,function(original,qtiClass){if(qtiClasses[qtiClass])required[qtiClass]=qtiClasses[qtiClass];else throw new Error("missing required class : "+qtiClass)}),require(_.values(required),function(){var Qti=_.reduce([].slice.call(arguments),function(acc,qtiClassElt){return acc[qtiClassElt.prototype.qtiClass]=qtiClassElt,acc},{}),promises=[],$doc=$(document),newElts={},newBody=body.replace(regex,function(original,qtiClass,subClass){var elt=new Qti[qtiClass];return Qti[qtiClass]?(container.getRenderer()&&elt.setRenderer(container.getRenderer()),newElts[elt.getSerial()]=elt,subClass&&(elt.typeIdentifier=subClass),elt.placeholder()):original});container.setElements(newElts,newBody),_.each(newElts,function(elt){_.isFunction(elt.buildIdentifier)&&elt.buildIdentifier(),_.isFunction(elt.afterCreate)&&promises.push(elt.afterCreate())}),"function"==typeof callback&&Promise.all(promises).then(function(){_.each(newElts,function(elt){$doc.trigger("elementCreated.qti-widget",{parent:container.parent(),element:elt})}),callback.call(container,newElts)}).catch(function(err){container.getRenderer().getCreatorContext().trigger("error",err)})})}}}),define("taoQtiItem/qtiCreator/model/mixin/editableContainer",["taoQtiItem/qtiCreator/model/helper/container"],function(containerHelper){"use strict";return{createElements:function createElements(body,callback){var _this=this;containerHelper.createElements(_this.getBody(),body,function(newElts){callback.call(_this,newElts)})}}}),define("taoQtiItem/qtiItem/core/IdentifiedElement",["taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/helper/util"],function(Element,util){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,util=util&&Object.prototype.hasOwnProperty.call(util,"default")?util["default"]:util;var IdentifiedElement=Element.extend({buildIdentifier:function(prefix,useSuffix){var item=this.getRootElement(),id=util.buildIdentifier(item,prefix||this.qtiClass,useSuffix);return id&&this.attr("identifier",id),this},id:function(value){return value||this.attr("identifier")||this.buildIdentifier(this.qtiClass,!0),this.attr("identifier",value)}});return IdentifiedElement}),define("taoQtiItem/qtiItem/mixin/Mixin",[],function(){'use strict';return{augment:function augment(targetClass,methods,options){if("function"==typeof targetClass&&"object"===_typeof(methods))for(var methodName in methods)if(!Object.hasOwnProperty(targetClass.prototype,methodName))targetClass.prototype[methodName]=methods[methodName];else if(options&&options.append){var _parent=targetClass.prototype[methodName];targetClass.prototype[methodName]=function(){return methods[methodName].apply(this,arguments),_parent.apply(this,arguments)}}}}}),define("taoQtiItem/qtiItem/core/Container",["jquery","lodash","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/helper/rendererConfig"],function($,_,Element,rendererConfig){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var Container=Element.extend({qtiClass:"_container",init:function init(body){if(this._super(),body&&"string"!=typeof body)throw"the body of a container must be a string";this.bdy=body||"",this.elements={}},body:function body(_body){if("undefined"==typeof _body)return this.bdy;if("string"==typeof _body)this.bdy=_body,$(document).trigger("containerBodyChange",{body:_body,container:this,parent:this.parent()});else throw"body must be a string"},setElements:function setElements(elements,body){var returnValue=!1;for(var i in elements){var elt=elements[i];if(elt instanceof Element)body=body||this.bdy,-1===body.indexOf(elt.placeholder())&&(body+=elt.placeholder()),elt.setRootElement(this.getRootElement()||null),this.elements[elt.getSerial()]=elt,$(document).trigger("containerElementAdded",{element:elt,container:this}),returnValue=!0;else throw returnValue=!1,"expected a qti element"}return this.body(body),returnValue},setElement:function setElement(element,body){return this.setElements([element],body)},removeElement:function removeElement(element){var serial="";return"string"==typeof element?serial=element:element instanceof Element&&(serial=element.getSerial()),delete this.elements[serial],this.body(this.body().replace("{{"+serial+"}}","")),this},getElements:function getElements(qtiClass){var elts={};if("string"==typeof qtiClass)for(var serial in this.elements)Element.isA(this.elements[serial],qtiClass)&&(elts[serial]=this.elements[serial]);else elts=_.clone(this.elements);return elts},getElement:function getElement(serial){return this.elements[serial]?this.elements[serial]:null},getComposingElements:function getComposingElements(){var elements=this.getElements(),elts={};for(var serial in elements)elts[serial]=elements[serial],elts=_.extend(elts,elements[serial].getComposingElements());return elts},render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),elementsData=[],tpl=this.body();for(var serial in this.elements){var elt=this.elements[serial];if("function"==typeof elt.render)"_container"===elt.qtiClass?tpl=tpl.replace(elt.placeholder(),elt.render(renderer)):(tpl=tpl.replace(elt.placeholder(),"{{{"+serial+"}}}"),elementsData[serial]=elt.render(renderer));else throw"render() is not defined for the qti element: "+serial}if(renderer.isRenderer)return this._super({body:renderer.renderDirect(tpl,elementsData),contentModel:this.contentModel||"flow"},renderer,args.placeholder);throw"invalid qti renderer for qti container"},postRender:function postRender(data,altClassName,renderer){renderer=renderer||this.getRenderer();var res=_(this.elements).filter(function(elt){return"function"==typeof elt.postRender}).map(function(elt){return elt.postRender(data,"",renderer)}).flatten(!0).value().concat(this._super(data,altClassName,renderer));return res},toArray:function toArray(){var arr={serial:this.serial,body:this.bdy,elements:{}};for(var serial in this.elements)arr.elements[serial]=this.elements[serial].toArray();return arr},find:function find(serial,parent){var found=null;return this.elements[serial]?found={parent:parent||this,element:this.elements[serial],location:"body"}:_.each(this.elements,function(elt){if(found=elt.find(serial),found)return!1}),found},isEmpty:function isEmpty(){return!this.bdy}});return Container}),define("taoQtiItem/qtiItem/mixin/Container",["taoQtiItem/qtiItem/mixin/Mixin","taoQtiItem/qtiItem/core/Container"],function(Mixin,Container$1){'use strict';Mixin=Mixin&&Object.prototype.hasOwnProperty.call(Mixin,"default")?Mixin["default"]:Mixin,Container$1=Container$1&&Object.prototype.hasOwnProperty.call(Container$1,"default")?Container$1["default"]:Container$1;var methods={initContainer:function initContainer(body){this.bdy=new Container$1(body||""),this.bdy.setRootElement(this.getRootElement()||null),this.bdy.contentModel="blockStatic"},getBody:function getBody(){return this.bdy},body:function body(_body2){var ret=this.bdy.body(_body2);return _body2?this:ret},setElement:function setElement(element,body){return this.bdy.setElement(element,body),this},removeElement:function removeElement(element){return this.bdy.removeElement(element)},getElements:function getElements(qtiClass){return this.bdy.getElements(qtiClass)},getElement:function getElement(serial){return this.bdy.getElement(serial)}};return{augment:function augment(targetClass){Mixin.augment(targetClass,methods)},methods:methods}}),define("taoQtiItem/qtiItem/mixin/ContainerItemBody",["taoQtiItem/qtiItem/mixin/Mixin","taoQtiItem/qtiItem/mixin/Container","lodash"],function(Mixin,Container,_){'use strict';Mixin=Mixin&&Object.prototype.hasOwnProperty.call(Mixin,"default")?Mixin["default"]:Mixin,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;var methods={};_.extend(methods,Container.methods),_.extend(methods,{initContainer:function initContainer(body){Container.methods.initContainer.call(this,body),this.bdy.contentModel="itemBody"}});return{augment:function augment(targetClass){Mixin.augment(targetClass,methods)},methods:methods}}),define("taoQtiItem/qtiItem/core/Item",["taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/core/IdentifiedElement","taoQtiItem/qtiItem/mixin/ContainerItemBody","lodash","jquery","taoQtiItem/qtiItem/helper/util"],function(Element,IdentifiedElement,Container,_,$,util){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,IdentifiedElement=IdentifiedElement&&Object.prototype.hasOwnProperty.call(IdentifiedElement,"default")?IdentifiedElement["default"]:IdentifiedElement,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,util=util&&Object.prototype.hasOwnProperty.call(util,"default")?util["default"]:util;var Item=IdentifiedElement.extend({qtiClass:"assessmentItem",init:function(serial,attributes){this._super(serial,attributes),this.rootElement=this,this.stylesheets={},this.responses={},this.outcomes={},this.modalFeedbacks={},this.namespaces={},this.schemaLocations={},this.responseProcessing=null,this.apipAccessibility=null},getInteractions:function(){var interactions=[],elts=this.getComposingElements();for(var serial in elts)Element.isA(elts[serial],"interaction")&&interactions.push(elts[serial]);return interactions},addResponseDeclaration:function(response){if(Element.isA(response,"responseDeclaration"))response.setRootElement(this),this.responses[response.getSerial()]=response;else throw"is not a qti response declaration";return this},getResponseDeclaration:function(identifier){for(var i in this.responses)if(this.responses[i].attr("identifier")===identifier)return this.responses[i];return null},addOutcomeDeclaration:function(outcome){if(Element.isA(outcome,"outcomeDeclaration"))outcome.setRootElement(this),this.outcomes[outcome.getSerial()]=outcome;else throw"is not a qti outcome declaration";return this},getOutcomeDeclaration:function(identifier){var found;return _.forEach(this.outcomes,function(outcome){if(outcome.id()===identifier)return found=outcome,!1}),found},getOutcomes:function(){return _.clone(this.outcomes)},removeOutcome:function(identifier){var outcome=this.getOutcomeDeclaration(identifier);outcome&&(this.outcomes=_.omit(this.outcomes,outcome.getSerial()))},addModalFeedback:function(feedback){if(Element.isA(feedback,"modalFeedback"))feedback.setRootElement(this),this.modalFeedbacks[feedback.getSerial()]=feedback;else throw"is not a qti modal feedback";return this},getComposingElements:function(){var elts=this._super(),_this=this;return _.forEach(["responses","outcomes","modalFeedbacks","stylesheets"],function(elementCollection){for(var i in _this[elementCollection]){var elt=_this[elementCollection][i];elts[i]=elt,elts=_.extend(elts,elt.getComposingElements())}}),this.responseProcessing instanceof Element&&(elts[this.responseProcessing.getSerial()]=this.responseProcessing),elts},find:function(serial){var found=this._super(serial);return found||(found=util.findInCollection(this,["responses","outcomes","modalFeedbacks","stylesheets"],serial)),found},getResponses:function(){return _.clone(this.responses)},getRootElement:function(){return this},addNamespace:function(name,uri){this.namespaces[name]=uri},setNamespaces:function(namespaces){this.namespaces=namespaces},getNamespaces:function(){return _.clone(this.namespaces)},setSchemaLocations:function(locations){this.schemaLocations=locations},getSchemaLocations:function(){return _.clone(this.schemaLocations)},setApipAccessibility:function(apip){this.apipAccessibility=apip||null},getApipAccessibility:function(){return this.apipAccessibility},addStylesheet:function(stylesheet){if(Element.isA(stylesheet,"stylesheet"))stylesheet.setRootElement(this),this.stylesheets[stylesheet.getSerial()]=stylesheet;else throw"is not a qti stylesheet declaration";return this},removeStyleSheet:function(stylesheet){return delete this.stylesheets[stylesheet.getSerial()],this},stylesheetExists:function(href){var exists=!1;return _.forEach(this.stylesheets,function(stylesheet){if(stylesheet.attr("href")===href)return exists=!0,!1}),exists},setResponseProcessing:function(rp){if(Element.isA(rp,"responseProcessing"))rp.setRootElement(this),this.responseProcessing=rp;else throw"is not a response processing";return this},toArray:function toArray(){var arr=this._super(),toArray=function(elt){return elt.toArray()};return arr.namespaces=this.namespaces,arr.schemaLocations=this.schemaLocations,arr.outcomes=_.map(this.outcomes,toArray),arr.responses=_.map(this.responses,toArray),arr.stylesheets=_.map(this.stylesheets,toArray),arr.modalFeedbacks=_.map(this.modalFeedbacks,toArray),arr.responseProcessing=this.responseProcessing.toArray(),arr},isEmpty:function(){var body=this.body().trim();if(body){var $dummy=$("<div>").html(body),$children=$dummy.children();return!!(1===$children.length&&$children.hasClass("empty"))}return!0},clear:function(){var renderer=this.getRenderer();renderer&&_.isFunction(renderer.destroy)&&renderer.destroy(this)}});return Container.augment(Item),Item}),define("taoQtiItem/qtiItem/core/Stylesheet",["taoQtiItem/qtiItem/core/Element","lodash","taoQtiItem/qtiItem/helper/rendererConfig"],function(Element,_,rendererConfig){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var Stylesheet=Element.extend({qtiClass:"stylesheet",render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={};return defaultData.attributes={href:renderer.resolveUrl(this.attr("href"))},this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)}});return Stylesheet}),define("taoQtiItem/qtiCreator/model/Stylesheet",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/Stylesheet"],function(_,editable,Stylesheet){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{href:"css/tao-user-styles.css",title:"",type:"text/css",media:"all"}}}),Stylesheet.extend(methods)}),define("taoQtiItem/qtiItem/core/ResponseProcessing",["taoQtiItem/qtiItem/core/Element"],function(Element){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element;var ResponseProcessing=Element.extend({qtiClass:"responseProcessing",processingType:"",xml:"",toArray:function toArray(){var arr=this._super();return arr.processingType=this.processingType,arr.xml=this.xml,arr}});return ResponseProcessing}),define("taoQtiItem/qtiItem/helper/interactionHelper",["lodash","taoQtiItem/qtiItem/core/Element"],function(_,Element){'use strict';var _Mathfloor=Math.floor;_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element;return{convertChoices:function convertChoices(choices,outputType){var ret=[],_this=this;return _.each(choices,function(c){Element.isA(c,"choice")?"serial"===outputType?ret.push(c.getSerial()):"identifier"===outputType?ret.push(c.id()):ret.push(c):_.isArray(c)&&ret.push(_this.convertChoices(c,outputType))}),ret},findChoices:function findChoices(interaction,choices,inputType){var ret=[],_this=this;return _.each(choices,function(c){var choice;_.isString(c)?"serial"===inputType?(choice=interaction.getChoice(c),choice&&ret.push(choice)):"identifier"===inputType?(choice=interaction.getChoiceByIdentifier(c),choice&&ret.push(choice)):ret.push(c):_.isArray(c)?ret.push(_this.findChoices(interaction,c,inputType)):ret.push(c)}),ret},shuffleChoices:function shuffleChoices(choices){var r=[],f={},j=0;for(var i in choices)if(Element.isA(choices[i],"choice")){var choice=choices[i];choice.attr("fixed")&&(f[j]=choice),r.push(choice),j++}else throw"invalid element in array: is not a qti choice";for(var n=0;n<r.length-1;n++)if(!f[n]){var k=-1;do k=n+_Mathfloor(Math.random()*(r.length-n));while(f[k]);var tmp=r[k];r[k]=r[n],r[n]=tmp}return r},serialToIdentifier:function serialToIdentifier(interaction,choiceSerial){var choice=interaction.getChoice(choiceSerial);return choice?choice.id():""}}}),define("taoQtiItem/qtiRunner/core/Renderer",["lodash","jquery","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/helper/interactionHelper","ui/themeLoader","ui/themes","core/moduleLoader","handlebars"],function(_,$,Element,interactionHelper,themeLoader,themesHelper,moduleLoader,Handlebars){'use strict';function getDocumentBaseUrl(){return window.location.protocol+"//"+window.location.host+window.location.pathname.replace(/([^\/]*)$/,"")}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,interactionHelper=interactionHelper&&Object.prototype.hasOwnProperty.call(interactionHelper,"default")?interactionHelper["default"]:interactionHelper,themeLoader=themeLoader&&Object.prototype.hasOwnProperty.call(themeLoader,"default")?themeLoader["default"]:themeLoader,themesHelper=themesHelper&&Object.prototype.hasOwnProperty.call(themesHelper,"default")?themesHelper["default"]:themesHelper,moduleLoader=moduleLoader&&Object.prototype.hasOwnProperty.call(moduleLoader,"default")?moduleLoader["default"]:moduleLoader,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var hb=Handlebars;"function"!=typeof hb.compile&&(hb=require("handlebars"));var _isValidRenderer=function(renderer){var valid=!0;if("object"!==_typeof(renderer))return!1;var classCorrect=!1;if(renderer.qtiClass)if(0<=_.indexOf(_renderableClasses,renderer.qtiClass))classCorrect=!0;else{var pos=renderer.qtiClass.indexOf(".");if(0<pos){var qtiClass=renderer.qtiClass.slice(0,pos),subClass=renderer.qtiClass.slice(pos+1);_renderableSubclasses[qtiClass]&&0<=_.indexOf(_renderableSubclasses[qtiClass],subClass)&&(classCorrect=!0)}}if(!classCorrect)throw valid=!1,new Error("invalid qti class name in renderer declaration : "+renderer.qtiClass);if(!renderer.template)throw valid=!1,new Error("missing template in renderer declaration : "+renderer.qtiClass);return valid},_renderableClasses=["_container","assessmentItem","stylesheet","responseDeclaration","outcomeDeclaration","responseProcessing","_simpleFeedbackRule","_tooltip","img","math","object","table","modalFeedback","rubricBlock","associateInteraction","choiceInteraction","extendedTextInteraction","gapMatchInteraction","graphicAssociateInteraction","graphicGapMatchInteraction","graphicOrderInteraction","hotspotInteraction","hottextInteraction","inlineChoiceInteraction","matchInteraction","mediaInteraction","orderInteraction","selectPointInteraction","sliderInteraction","textEntryInteraction","uploadInteraction","endAttemptInteraction","customInteraction","prompt","associableHotspot","gap","gapImg","gapText","hotspotChoice","hottext","inlineChoice","simpleAssociableChoice","simpleChoice","infoControl","include","printedVariable"],_dependencies={assessmentItem:["stylesheet","_container","prompt","modalFeedback"],rubricBlock:["_container"],associateInteraction:["simpleAssociableChoice"],choiceInteraction:["simpleChoice"],gapMatchInteraction:["gap","gapText"],graphicAssociateInteraction:["associableHotspot"],graphicGapMatchInteraction:["associableHotspot","gapImg"],graphicOrderInteraction:["hotspotChoice"],hotspotInteraction:["hotspotChoice"],hottextInteraction:["hottext"],inlineChoiceInteraction:["inlineChoice"],matchInteraction:["simpleAssociableChoice"],orderInteraction:["simpleChoice"]},_renderableSubclasses={simpleAssociableChoice:["associateInteraction","matchInteraction"],simpleChoice:["choiceInteraction","orderInteraction"]},_defaults={shuffleChoices:!0},Renderer=function(options){function registerRendererClass(qtiClass,list){var success=!1;return!1===_locations[qtiClass]?(_renderers[qtiClass]=!1,success=!0):_locations[qtiClass]&&(list.push(_locations[qtiClass]),success=!0),success}var _locations={},_renderers={};options=_.defaults(options||{},_defaults),this.isRenderer=!0,this.name="",this.shuffledChoices=[];var _getClassRenderer=function(qtiClass){var ret=null;if(_renderers[qtiClass])ret=_renderers[qtiClass];else{var pos=qtiClass.indexOf(".");0<pos&&(qtiClass=qtiClass.slice(0,pos),_renderers[qtiClass]&&(ret=_renderers[qtiClass]))}return ret};this.setOption=function(key,value){return"string"==typeof key&&(options[key]=value),this},this.setOptions=function(opts){return options=_.extend(options,opts),this},this.getOption=function(key){return"string"==typeof key&&options[key]?options[key]:null},this.getCustomMessage=function(elementName,messageKey){var messages=this.getOption("messages");return messages&&elementName&&messages[elementName]&&_.isString(messages[elementName][messageKey])?hb.compile(messages[elementName][messageKey]):null},this.getAssetManager=function(){return options.assetManager},this.getThemeLoader=function(){return this.themeLoader},this.renderTpl=function(element,data,qtiSubclass){var ret="",qtiClass=qtiSubclass||element.qtiClass,renderer=_getClassRenderer(qtiClass),decorators=this.getOption("decorators"),res;if(!renderer||!_.isFunction(renderer.template))throw new Error("no renderer template loaded under the class name : "+qtiClass);return _.isObject(decorators)&&_.isFunction(decorators.before)&&(res=decorators.before(element,qtiSubclass),_.isString(res)&&(ret+=res)),ret+=renderer.template(data),_.isObject(decorators)&&_.isFunction(decorators.after)&&(res=decorators.after(element,qtiSubclass),_.isString(res)&&(ret+=res)),ret},this.getData=function(element,data,qtiSubclass){var ret=data,qtiClass=qtiSubclass||element.qtiClass,renderer=_getClassRenderer(qtiClass);return renderer&&"function"==typeof renderer.getData&&(ret=renderer.getData.call(this,element,data)),ret},this.renderDirect=function(tpl,data){return hb.compile(tpl)(data)},this.getContainer=function(qtiElement,$scope,qtiSubclass){var ret=null,qtiClass=qtiSubclass||qtiElement.qtiClass,renderer=_getClassRenderer(qtiClass);if(renderer)ret=renderer.getContainer(qtiElement,$scope);else throw"no renderer found for the class : "+qtiElement.qtiClass;return ret},this.postRender=function(qtiElement,data,qtiSubclass){var qtiClass=qtiSubclass||qtiElement.qtiClass,renderer=_getClassRenderer(qtiClass);if(renderer&&"function"==typeof renderer.render)return renderer.render.call(this,qtiElement,data)},this.setResponse=function(qtiInteraction,response,qtiSubclass){var ret=!1,qtiClass=qtiSubclass||qtiInteraction.qtiClass,renderer=_getClassRenderer(qtiClass);if(!renderer)throw"no renderer registered under the name : "+qtiClass;else if("function"==typeof renderer.setResponse){ret=renderer.setResponse.call(this,qtiInteraction,response);var $container=renderer.getContainer.call(this,qtiInteraction);$container instanceof $&&$container.length&&$container.trigger("responseSet",[qtiInteraction,response])}return ret},this.getResponse=function(qtiInteraction,qtiSubclass){var ret=!1,qtiClass=qtiSubclass||qtiInteraction.qtiClass,renderer=_getClassRenderer(qtiClass);if(renderer)"function"==typeof renderer.getResponse&&(ret=renderer.getResponse.call(this,qtiInteraction));else throw"no renderer registered under the name : "+qtiClass;return ret},this.resetResponse=function(qtiInteraction,qtiSubclass){var ret=!1,qtiClass=qtiSubclass||qtiInteraction.qtiClass,renderer=_getClassRenderer(qtiClass);if(renderer)"function"==typeof renderer.resetResponse&&(ret=renderer.resetResponse.call(this,qtiInteraction));else throw"no renderer registered under the name : "+qtiClass;return ret},this.getState=function(qtiInteraction,qtiSubclass){var ret=!1,qtiClass=qtiSubclass||qtiInteraction.qtiClass,renderer=_getClassRenderer(qtiClass);if(renderer)ret=_.isFunction(renderer.getState)?renderer.getState.call(this,qtiInteraction):renderer.getResponse.call(this,qtiInteraction);else throw"no renderer registered under the name : "+qtiClass;return ret},this.setState=function(qtiInteraction,state,qtiSubclass){var qtiClass=qtiSubclass||qtiInteraction.qtiClass,renderer=_getClassRenderer(qtiClass);if(renderer)_.isFunction(renderer.setState)?renderer.setState.call(this,qtiInteraction,state):(renderer.resetResponse.call(this,qtiInteraction),renderer.setResponse.call(this,qtiInteraction,state));else throw"no renderer registered under the name : "+qtiClass},this.destroy=function(qtiInteraction,qtiSubclass){var ret=!1,qtiClass=qtiSubclass||qtiInteraction.qtiClass,renderer=_getClassRenderer(qtiClass);if(renderer)_.isFunction(renderer.destroy)&&(ret=renderer.destroy.call(this,qtiInteraction));else throw"no renderer registered under the name : "+qtiClass;return ret},this.getLoadedRenderers=function(){return _renderers},this.register=function(renderersLocations){_.extend(_locations,renderersLocations)},this.load=function(callback,requiredClasses){var self=this,required=[],themeData=themesHelper.getCurrentThemeData();if(themeData&&(options.themes=themeData),options.themes&&(options.themes.base=this.resolveUrl(options.themes.base),_.forEach(options.themes.available,function(theme,index){options.themes.available[index].path=self.resolveUrl(theme.path)}),this.themeLoader=themeLoader(options.themes).load(options.preload)),!requiredClasses)required=_.values(_locations);else if(_.isArray(requiredClasses))requiredClasses=_.intersection(requiredClasses,_renderableClasses),_.each(requiredClasses,function(reqClass){var deps=_dependencies[reqClass];deps&&(requiredClasses=_.union(requiredClasses,deps))}),_.forEach(requiredClasses,function(qtiClass){var requiredSubClasses;if(_renderableSubclasses[qtiClass])requiredSubClasses=_.intersection(requiredClasses,_renderableSubclasses[qtiClass]),_.each(requiredSubClasses,function(subclass){if(!registerRendererClass(qtiClass+"."+subclass,required)&&!registerRendererClass(qtiClass,required))throw new Error(self.name+" : missing qti class location declaration: "+qtiClass+", subclass: "+subclass)});else if(!registerRendererClass(qtiClass,required))throw new Error(self.name+" : missing qti class location declaration: "+qtiClass)});else throw new Error("invalid argument type: expected array for arg \"requireClasses\"");return moduleLoader([],function(){return!0}).addList(required.map(function(module){return{module:module,category:"qti"}})).load().then(function(loaded){loaded.forEach(function(clazz){_isValidRenderer(clazz)&&(_renderers[clazz.qtiClass]=clazz)}),"function"==typeof callback&&callback.call(self,_renderers)}),this},this.unload=function(){return this.themeLoader&&themeLoader(options.themes).unload(),this},this.setShuffledChoices=function(interaction,choices,identificationType){Element.isA(interaction,"interaction")&&(this.shuffledChoices[interaction.getSerial()]=_.pluck(interactionHelper.findChoices(interaction,choices,identificationType),"serial"))},this.getShuffledChoices=function(interaction,reshuffle,returnedType){var choices=[],serial,i;if(Element.isA(interaction,"interaction")){if(serial=interaction.getSerial(),this.shuffledChoices[serial]&&!reshuffle)Element.isA(interaction,"matchInteraction")?_.forEach(choices,function(choice,index){2>index&&_.forEach(this.shuffledChoices[serial][i],function(choiceSerial){choice.push(interaction.getChoice(choiceSerial))})}):_.forEach(this.shuffledChoices[serial],function(choiceSerial){choices.push(interaction.getChoice(choiceSerial))});else if(Element.isA(interaction,"matchInteraction"))for(this.shuffledChoices[serial]=[],i=0;2>i;i++)choices[i]=interactionHelper.shuffleChoices(interaction.getChoices(i)),this.shuffledChoices[serial][i]=_.pluck(choices[i],"serial");else choices=interactionHelper.shuffleChoices(interaction.getChoices()),this.shuffledChoices[serial]=_.pluck(choices,"serial");return"serial"===returnedType||"identifier"===returnedType?interactionHelper.convertChoices(choices,returnedType):_.clone(choices)}return[]},this.getRenderers=function(){return _renderers},this.getLocations=function(){return _locations},this.resolveUrl=function(url){return options.assetManager?"string"==typeof url&&0<url.length?options.assetManager.resolve(url):void 0:url},this.getAbsoluteUrl=function(relUrl){if(console.warn("DEPRECATED used getAbsoluteUrl with ",arguments),this.getOption("userRelativeUrl"))return relUrl.replace(/^\.?\//,"");if(/^http(s)?:\/\//i.test(relUrl)||/^data:[^\/]+\/[^;]+(;charset=[\w]+)?;base64,/.test(relUrl))return relUrl;var absUrl="",runtimeLocations=this.getOption("runtimeLocations");if(runtimeLocations&&_.size(runtimeLocations)&&_.forIn(runtimeLocations,function(runtimeLocation,typeIdentifier){if(0===relUrl.indexOf(typeIdentifier))return absUrl=relUrl.replace(typeIdentifier,runtimeLocation),!1}),absUrl)return absUrl;var baseUrl=this.getOption("baseUrl")||getDocumentBaseUrl();return baseUrl+relUrl},this.setAreaBroker=function(areaBroker){this._areaBroker=areaBroker},this.getAreaBroker=function(){if(this._areaBroker)return this._areaBroker},this.getItemCreator=function(){return this.getOption("itemCreator")}};return{build:function build(renderersLocations,name,defaultOptions){var NewRenderer=function(){var options=_.isPlainObject(arguments[0])?arguments[0]:{};Renderer.apply(this),this.register(renderersLocations),this.name=name||"",this.setOptions(_.defaults(options,defaultOptions||{}))};return NewRenderer.prototype=Renderer.prototype,NewRenderer}}}),define("taoQtiItem/qtiXmlRenderer/renderers/config",["taoItems/assets/manager"],function(assetManagerFactory){'use strict';var assetManager=assetManagerFactory([{name:"nomalize",handle:function(url){if(url)return url.toString().replace(/^\.?\//,"")}}]);return{name:"xmlRenderer",locations:{_container:"taoQtiItem/qtiXmlRenderer/renderers/Container",assessmentItem:"taoQtiItem/qtiXmlRenderer/renderers/Item",stylesheet:"taoQtiItem/qtiXmlRenderer/renderers/Stylesheet",responseDeclaration:"taoQtiItem/qtiXmlRenderer/renderers/ResponseDeclaration",outcomeDeclaration:"taoQtiItem/qtiXmlRenderer/renderers/OutcomeDeclaration",responseProcessing:"taoQtiItem/qtiXmlRenderer/renderers/ResponseProcessing",_simpleFeedbackRule:"taoQtiItem/qtiXmlRenderer/renderers/responses/SimpleFeedbackRule",_tooltip:"taoQtiItem/qtiXmlRenderer/renderers/Tooltip",math:"taoQtiItem/qtiXmlRenderer/renderers/Math",img:"taoQtiItem/qtiXmlRenderer/renderers/Img",object:"taoQtiItem/qtiXmlRenderer/renderers/Object",table:"taoQtiItem/qtiXmlRenderer/renderers/Table",modalFeedback:"taoQtiItem/qtiXmlRenderer/renderers/feedbacks/ModalFeedback",rubricBlock:"taoQtiItem/qtiXmlRenderer/renderers/RubricBlock",associateInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/AssociateInteraction",choiceInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/ChoiceInteraction",extendedTextInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/ExtendedTextInteraction",gapMatchInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/GapMatchInteraction",graphicAssociateInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/GraphicAssociateInteraction",graphicGapMatchInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/GraphicGapMatchInteraction",graphicOrderInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/GraphicOrderInteraction",hotspotInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/HotspotInteraction",hottextInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/HottextInteraction",inlineChoiceInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/InlineChoiceInteraction",matchInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/MatchInteraction",mediaInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/MediaInteraction",orderInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/OrderInteraction",selectPointInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/SelectPointInteraction",sliderInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/SliderInteraction",textEntryInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/TextEntryInteraction",uploadInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/UploadInteraction",prompt:"taoQtiItem/qtiXmlRenderer/renderers/interactions/Prompt",associableHotspot:"taoQtiItem/qtiXmlRenderer/renderers/choices/AssociableHotspot",gap:"taoQtiItem/qtiXmlRenderer/renderers/choices/Gap",gapImg:"taoQtiItem/qtiXmlRenderer/renderers/choices/GapImg",gapText:"taoQtiItem/qtiXmlRenderer/renderers/choices/GapText",hotspotChoice:"taoQtiItem/qtiXmlRenderer/renderers/choices/HotspotChoice",hottext:"taoQtiItem/qtiXmlRenderer/renderers/choices/Hottext",inlineChoice:"taoQtiItem/qtiXmlRenderer/renderers/choices/InlineChoice",simpleAssociableChoice:"taoQtiItem/qtiXmlRenderer/renderers/choices/SimpleAssociableChoice",simpleChoice:"taoQtiItem/qtiXmlRenderer/renderers/choices/SimpleChoice",customInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/PortableCustomInteraction",endAttemptInteraction:"taoQtiItem/qtiXmlRenderer/renderers/interactions/EndAttemptInteraction",infoControl:"taoQtiItem/qtiXmlRenderer/renderers/PortableInfoControl",include:"taoQtiItem/qtiXmlRenderer/renderers/Include",printedVariable:"taoQtiItem/qtiXmlRenderer/renderers/PrintedVariable"},options:{assetManager:assetManager}}}),define("taoQtiItem/qtiXmlRenderer/renderers/Renderer",["taoQtiItem/qtiRunner/core/Renderer","taoQtiItem/qtiXmlRenderer/renderers/config"],function(Renderer,config){'use strict';return Renderer.build(config.locations,config.name,config.options)}),define("taoQtiItem/qtiItem/core/variables/VariableDeclaration",["taoQtiItem/qtiItem/core/IdentifiedElement"],function(IdentifiedElement){'use strict';IdentifiedElement=IdentifiedElement&&Object.prototype.hasOwnProperty.call(IdentifiedElement,"default")?IdentifiedElement["default"]:IdentifiedElement;var VariableDeclaration=IdentifiedElement.extend({init:function(serial,attributes){this._super(serial,attributes),this.defaultValue=null},is:function(qtiClass){return"variableDeclaration"===qtiClass||this._super(qtiClass)},toArray:function(){var arr=this._super();return arr.defaultValue=this.defaultValue,arr},setDefaultValue:function(value){this.defaultValue=value},getDefaultValue:function(){return this.defaultValue}});return VariableDeclaration}),define("taoQtiItem/qtiItem/core/variables/OutcomeDeclaration",["taoQtiItem/qtiItem/core/variables/VariableDeclaration"],function(VariableDeclaration){'use strict';VariableDeclaration=VariableDeclaration&&Object.prototype.hasOwnProperty.call(VariableDeclaration,"default")?VariableDeclaration["default"]:VariableDeclaration;var OutcomeDeclaration=VariableDeclaration.extend({qtiClass:"outcomeDeclaration"});return OutcomeDeclaration}),define("taoQtiItem/qtiItem/helper/maxScore",["lodash","lib/gamp/gamp","taoQtiItem/qtiItem/helper/response","taoQtiItem/qtiItem/core/variables/OutcomeDeclaration"],function(_,gamp,responseHelper,OutcomeDeclaration){'use strict';var _Mathmin=Math.min;_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,gamp=gamp&&Object.prototype.hasOwnProperty.call(gamp,"default")?gamp["default"]:gamp,responseHelper=responseHelper&&Object.prototype.hasOwnProperty.call(responseHelper,"default")?responseHelper["default"]:responseHelper,OutcomeDeclaration=OutcomeDeclaration&&Object.prototype.hasOwnProperty.call(OutcomeDeclaration,"default")?OutcomeDeclaration["default"]:OutcomeDeclaration;var pairExists=function(collection,pair){return!(2!==pair.length)&&(collection[pair[0]+" "+pair[1]]||collection[pair[1]+" "+pair[0]])};return{setNormalMaximum:function(item){var scoreOutcome=item.getOutcomeDeclaration("SCORE"),normalMaximum;scoreOutcome&&item.responseProcessing&&"templateDriven"===item.responseProcessing.processingType&&(normalMaximum=_.reduce(item.getInteractions(),function(acc,interaction){var interactionMaxScore=interaction.getNormalMaximum();return!!_.isNumber(interactionMaxScore)&&gamp.add(acc,interactionMaxScore)},0),_.isNumber(normalMaximum)?scoreOutcome.attr("normalMaximum",normalMaximum):scoreOutcome.removeAttr("normalMaximum"))},setMaxScore:function(item){var hasInvalidInteraction=!1,scoreOutcome=item.getOutcomeDeclaration("SCORE"),customOutcomes,maxScore,maxScoreOutcome;scoreOutcome&&item.responseProcessing&&"templateDriven"===item.responseProcessing.processingType&&(maxScore=_.reduce(item.getInteractions(),function(acc,interaction){var interactionMaxScore=interaction.getNormalMaximum();return _.isNumber(interactionMaxScore)?gamp.add(acc,interactionMaxScore):(hasInvalidInteraction=!0,acc)},0),customOutcomes=_(item.getOutcomes()).filter(function(outcome){return"SCORE"!==outcome.id()&&"MAXSCORE"!==outcome.id()}),customOutcomes.size()&&(maxScore=customOutcomes.reduce(function(acc,outcome){return gamp.add(acc,parseFloat(outcome.attr("normalMaximum")||0))},maxScore)),!hasInvalidInteraction||customOutcomes.size()?(maxScoreOutcome=item.getOutcomeDeclaration("MAXSCORE"),!maxScoreOutcome&&(maxScoreOutcome=new OutcomeDeclaration({cardinality:"single",baseType:"float"}),item.addOutcomeDeclaration(maxScoreOutcome),maxScoreOutcome.buildIdentifier("MAXSCORE",!1)),maxScoreOutcome.setDefaultValue(maxScore)):item.removeOutcome("MAXSCORE"))},getMatchMaxOrderedChoices:function(choiceCollection){return _(choiceCollection).map(function(choice){var matchMax=parseInt(choice.attr("matchMax"),10);return _.isNaN(matchMax)&&(matchMax=0),{matchMax:0===matchMax?1/0:matchMax,id:choice.id()}}).sortBy("matchMax").reverse().valueOf()},choiceInteractionBased:function(interaction,options){var responseDeclaration=interaction.getResponseDeclaration(),mapDefault=parseFloat(responseDeclaration.mappingAttributes.defaultValue||0),template=responseHelper.getTemplateNameFromUri(responseDeclaration.template),max,maxChoice,minChoice,scoreMaps,requiredChoiceCount,totalAnswerableResponse,sortedMapEntries,missingMapsCount;if(options=_.defaults(options||{},{maxChoices:0,minChoices:0}),maxChoice=parseInt(interaction.attr("maxChoices")||options.maxChoices,10),minChoice=0,maxChoice&&minChoice&&maxChoice<minChoice)return 0;if("MATCH_CORRECT"===template)max=maxChoice&&_.isArray(responseDeclaration.correctResponse)&&(responseDeclaration.correctResponse.length>maxChoice||responseDeclaration.correctResponse.length<minChoice)?0:responseDeclaration.correctResponse&&(!_.isArray(responseDeclaration.correctResponse)||responseDeclaration.correctResponse.length)?1:0;else if("MAP_RESPONSE"===template){if(!responseDeclaration.mapEntries||!_.size(responseDeclaration.mapEntries))return 0;requiredChoiceCount=minChoice,totalAnswerableResponse=0===maxChoice?1/0:maxChoice,scoreMaps=_.values(responseDeclaration.mapEntries),sortedMapEntries=_(scoreMaps).map(function(v){return parseFloat(v)}).sortBy().reverse().first(totalAnswerableResponse),missingMapsCount=minChoice-sortedMapEntries.size(),_.times(missingMapsCount,function(){sortedMapEntries.push(mapDefault)}),mapDefault&&0<mapDefault&&(missingMapsCount=maxChoice?maxChoice-sortedMapEntries.size():_.size(interaction.getChoices())-sortedMapEntries.size(),0<missingMapsCount&&_.times(missingMapsCount,function(){sortedMapEntries.push(mapDefault)})),max=sortedMapEntries.reduce(function(acc,v){var score=v;return 0>score&&0>=requiredChoiceCount&&(score=0),requiredChoiceCount--,gamp.add(acc,score)},0),responseDeclaration.mappingAttributes.upperBound&&(max=_Mathmin(max,parseFloat(responseDeclaration.mappingAttributes.upperBound||0)))}else"MAP_RESPONSE_POINT"===template&&(max=0);return max},orderInteractionBased:function(interaction){var maxChoice=parseInt(interaction.attr("maxChoices")||0,10),responseDeclaration=interaction.getResponseDeclaration(),template=responseHelper.getTemplateNameFromUri(responseDeclaration.template),max;return maxChoice&&0&&0>maxChoice?0:("MATCH_CORRECT"===template?_.isArray(responseDeclaration.correctResponse)&&maxChoice&&responseDeclaration.correctResponse.length>maxChoice||0?max=0:responseDeclaration.correctResponse&&(!_.isArray(responseDeclaration.correctResponse)||responseDeclaration.correctResponse.length)?max=1:max=0:("MAP_RESPONSE"===template||"MAP_RESPONSE_POINT"===template)&&(max=0),max)},associateInteractionBased:function(interaction,options){var responseDeclaration=interaction.getResponseDeclaration(),template=responseHelper.getTemplateNameFromUri(responseDeclaration.template),maxAssoc=parseInt(interaction.attr("maxAssociations")||0,10),minAssoc=0,mapDefault=parseFloat(responseDeclaration.mappingAttributes.defaultValue||0),max,requiredAssoc,totalAnswerableResponse,usedChoices,choicesIdentifiers,sortedMapEntries,i,allPossibleMapEntries,infiniteScoringPair;if(options=_.defaults(options||{},{possiblePairs:[],checkInfinitePair:!1}),maxAssoc&&minAssoc&&maxAssoc<minAssoc)return 0;if("MATCH_CORRECT"===template)!responseDeclaration.correctResponse||_.isArray(responseDeclaration.correctResponse)&&(!responseDeclaration.correctResponse.length||maxAssoc&&responseDeclaration.correctResponse.length>maxAssoc||minAssoc)?max=0:(max=1,choicesIdentifiers=[],_.forEach(responseDeclaration.correctResponse,function(pair){var choices;_.isString(pair)&&(choices=pair.trim().split(" "),_.isArray(choices)&&2===choices.length&&(choicesIdentifiers.push(choices[0].trim()),choicesIdentifiers.push(choices[1].trim())))}),_.forEach(_.countBy(choicesIdentifiers),function(count,identifier){var choice=interaction.getChoiceByIdentifier(identifier),matchMax;return choice?(matchMax=parseInt(choice.attr("matchMax"),10),matchMax&&matchMax<count)?(max=0,!1):void 0:(max=0,!1)}));else if("MAP_RESPONSE"===template){if(requiredAssoc=minAssoc,totalAnswerableResponse=0===maxAssoc?1/0:maxAssoc,usedChoices={},!responseDeclaration.mapEntries||!_.size(responseDeclaration.mapEntries))return 0;if(allPossibleMapEntries=_.clone(responseDeclaration.mapEntries),mapDefault&&0<mapDefault&&_.forEachRight(options.possiblePairs,function(pair){pairExists(allPossibleMapEntries,pair)||(allPossibleMapEntries[pair[0]+" "+pair[1]]=mapDefault)}),sortedMapEntries=_(allPossibleMapEntries).map(function(score,pair){return{score:parseFloat(score),pair:pair}}).sortBy("score").reverse().filter(function(mapEntry){var pair=mapEntry.pair,choices,choiceId,choice,_usedChoices;if(!_.isString(pair))return!1;if(choices=pair.trim().split(" "),_.isArray(choices)&&2===choices.length){for(_usedChoices=_.cloneDeep(usedChoices),i=0;2>i;i++){if(choiceId=choices[i],!_usedChoices[choiceId]){if(choice=interaction.getChoiceByIdentifier(choiceId),!choice)return!1;_usedChoices[choiceId]={used:0,max:parseInt(choice.attr("matchMax"),10)}}if(_usedChoices[choiceId].max&&_usedChoices[choiceId].used===_usedChoices[choiceId].max)return!1;_usedChoices[choiceId].used++}return infiniteScoringPair=infiniteScoringPair||options.checkInfinitePair&&0<mapEntry.score&&0===_usedChoices[choices[0]].max&&0===_usedChoices[choices[1]].max,_.assign(usedChoices,_usedChoices),!0}return!1}).first(totalAnswerableResponse),infiniteScoringPair)return!1;max=sortedMapEntries.reduce(function(acc,v){var score=v.score;return 0>v.score&&0>=requiredAssoc&&(score=0),requiredAssoc--,gamp.add(acc,score)},0),responseDeclaration.mappingAttributes.upperBound&&(max=_Mathmin(max,parseFloat(responseDeclaration.mappingAttributes.upperBound||0)))}else"MAP_RESPONSE_POINT"===template&&(max=0);return max},gapMatchInteractionBased:function(interaction){var responseDeclaration=interaction.getResponseDeclaration(),template=responseHelper.getTemplateNameFromUri(responseDeclaration.template),mapDefault=parseFloat(responseDeclaration.mappingAttributes.defaultValue||0),getMatchMaxOrderedChoices=function(choiceCollection){return _(choiceCollection).map(function(choice){return{matchMax:0===choice.attr("matchMax")?1/0:choice.attr("matchMax")||0,id:choice.id()}}).sortBy("matchMax").reverse().valueOf()},calculatePossiblePairs=function(gapMatchInteraction){var pairs=[],matchSet1=getMatchMaxOrderedChoices(gapMatchInteraction.getChoices()),matchSet2=getMatchMaxOrderedChoices(gapMatchInteraction.getGaps());return _.forEach(matchSet1,function(choice1){_.forEach(matchSet2,function(choice2){pairs.push([choice1.id,choice2.id])})}),pairs},max,skippableWrongResponse,totalAnswerableResponse,usedChoices,usedGaps,group1,group2,allPossibleMapEntries;if("MATCH_CORRECT"===template)responseDeclaration.correctResponse&&(!_.isArray(responseDeclaration.correctResponse)||responseDeclaration.correctResponse.length)?(max=1,group1=[],group2=[],_.forEach(responseDeclaration.correctResponse,function(pair){var choices;_.isString(pair)&&(choices=pair.trim().split(" "),_.isArray(choices)&&2===choices.length&&(group1.push(choices[0].trim()),group2.push(choices[1].trim())))}),_.forEach(_.countBy(group1),function(count,identifier){var choice=interaction.getChoiceByIdentifier(identifier),matchMax=parseInt(choice.attr("matchMax"),10);if(matchMax&&matchMax<count)return max=0,!1}),_.forEach(_.countBy(group2),function(count){if(1<count)return max=0,!1})):max=0;else if("MAP_RESPONSE"===template){if(skippableWrongResponse=1/0,totalAnswerableResponse=1/0,usedChoices={},usedGaps={},!responseDeclaration.mapEntries||!_.size(responseDeclaration.mapEntries))return 0;allPossibleMapEntries=_.clone(responseDeclaration.mapEntries),mapDefault&&0<mapDefault&&_.forEachRight(calculatePossiblePairs(interaction),function(pair){pairExists(allPossibleMapEntries,pair)||(allPossibleMapEntries[pair[0]+" "+pair[1]]=mapDefault)}),max=_(allPossibleMapEntries).map(function(score,pair){return{score:parseFloat(score),pair:pair}}).sortBy("score").reverse().filter(function(mapEntry){var pair=mapEntry.pair,_usedChoices=_.cloneDeep(usedChoices),choices,choiceId,gapId,choice;if(!_.isString(pair))return!1;if(choices=pair.trim().split(" "),_.isArray(choices)&&2===choices.length){if(choiceId=choices[0],gapId=choices[1],!_usedChoices[choiceId]){if(choice=interaction.getChoiceByIdentifier(choiceId),!choice)return!1;_usedChoices[choiceId]={used:0,max:parseInt(choice.attr("matchMax"),10)}}return!(_usedChoices[choiceId].max&&_usedChoices[choiceId].used===_usedChoices[choiceId].max)&&(_usedChoices[choiceId].used++,usedGaps[gapId]||(usedGaps[gapId]={used:0,max:1}),!(usedGaps[gapId].max&&usedGaps[gapId].used===usedGaps[gapId].max))&&(usedGaps[gapId].used++,_.assign(usedChoices,_usedChoices),!0)}return!1}).first(totalAnswerableResponse).reduce(function(acc,v){var score=v.score;return 0<=score?acc+score:0<skippableWrongResponse?(skippableWrongResponse--,acc):acc+score},0),responseDeclaration.mappingAttributes.upperBound&&(max=_Mathmin(max,parseFloat(responseDeclaration.mappingAttributes.upperBound||0)))}else"MAP_RESPONSE_POINT"===template&&(max=!1);return max},selectPointInteractionBased:function(interaction){var maxChoice=parseInt(interaction.attr("maxChoices"),10),responseDeclaration=interaction.getResponseDeclaration(),template=responseHelper.getTemplateNameFromUri(responseDeclaration.template),max,skippableWrongResponse,totalAnswerableResponse;return"MATCH_CORRECT"===template||"MAP_RESPONSE"===template?0:("MAP_RESPONSE_POINT"===template&&(skippableWrongResponse=1/0,totalAnswerableResponse=0===maxChoice?1/0:maxChoice,max=_(responseDeclaration.mapEntries).map(function(v){return parseFloat(v.mappedValue)}).sortBy().reverse().first(totalAnswerableResponse).reduce(function(acc,v){return 0<=v?acc+v:0<skippableWrongResponse?(skippableWrongResponse--,acc):acc+v},0),max=parseFloat(max),responseDeclaration.mappingAttributes.upperBound&&(max=_Mathmin(max,parseFloat(responseDeclaration.mappingAttributes.upperBound||0)))),max)},sliderInteractionBased:function(interaction){var responseDeclaration=interaction.getResponseDeclaration(),template=responseHelper.getTemplateNameFromUri(responseDeclaration.template),max,scoreMaps;if("MATCH_CORRECT"===template)max=responseDeclaration.correctResponse&&(!_.isArray(responseDeclaration.correctResponse)||responseDeclaration.correctResponse.length)?1:0;else if("MAP_RESPONSE"===template){if(!responseDeclaration.mapEntries||!_.size(responseDeclaration.mapEntries))return 0;scoreMaps=_.values(responseDeclaration.mapEntries),max=_(scoreMaps).map(function(v){return parseFloat(v)}).max(),max=parseFloat(max),responseDeclaration.mappingAttributes.upperBound&&(max=_Mathmin(max,parseFloat(responseDeclaration.mappingAttributes.upperBound||0)))}else"MAP_RESPONSE_POINT"===template&&(max=0);return max},textEntryInteractionBased:function(interaction){var responseDeclaration=interaction.getResponseDeclaration(),template=responseHelper.getTemplateNameFromUri(responseDeclaration.template),isPossibleResponse=function(value){var patternMask=interaction.attr("patternMask");return!patternMask||!!value.match(new RegExp(patternMask))},max,scoreMaps;if("MATCH_CORRECT"===template)max=responseDeclaration.correctResponse&&(!_.isArray(responseDeclaration.correctResponse)||responseDeclaration.correctResponse.length)?isPossibleResponse(responseDeclaration.correctResponse[0])?1:0:0;else if("MAP_RESPONSE"===template){if(!responseDeclaration.mapEntries||!_.size(responseDeclaration.mapEntries))return 0;scoreMaps=_.values(_.filter(responseDeclaration.mapEntries,function(score,key){return isPossibleResponse(key)})),max=_(scoreMaps).map(function(v){return parseFloat(v)}).max(),max=parseFloat(max),responseDeclaration.mappingAttributes.upperBound&&(max=_Mathmin(max,parseFloat(responseDeclaration.mappingAttributes.upperBound||0)))}else"MAP_RESPONSE_POINT"===template&&(max=0);return max}}}),define("taoQtiItem/qtiXmlRenderer/renderers/RendererPerInteractionRP",["taoQtiItem/qtiRunner/core/Renderer","taoQtiItem/qtiXmlRenderer/renderers/config"],function(Renderer,config){'use strict';return Renderer.build(Object.assign({},config.locations,{responseProcessing:"taoQtiItem/qtiXmlRenderer/renderers/ResponseProcessingPerInteractionRP"}),config.name,config.options)}),define("taoQtiItem/qtiCreator/helper/xmlRenderer",["core/logger","taoQtiItem/qtiXmlRenderer/renderers/Renderer","taoQtiItem/qtiItem/helper/maxScore","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiXmlRenderer/renderers/RendererPerInteractionRP"],function(loggerFactory,XmlRenderer,maxScore,Element,XmlRendererPerInteractionRP){'use strict';var logger=loggerFactory("taoQtiItem/qtiCreator/helper/xmlRenderer"),xmlRendererProviders={default:new XmlRenderer({shuffleChoices:!1}).load(),perInteractionRP:new XmlRendererPerInteractionRP({shuffleChoices:!1}).load()},xmlRenderer=xmlRendererProviders.default,_render=function(element,options){var xml="";try{element instanceof Element&&(element.is("assessmentItem")&&(maxScore.setNormalMaximum(element),maxScore.setMaxScore(element)),xml=element.render(xmlRenderer,options))}catch(e){logger.error(e)}return xml};return{render:_render,get:function get(){return xmlRenderer},setProvider:function setProvider(providerName){if(!xmlRendererProviders[providerName])throw new Error("Unknown xml renderer provider");xmlRenderer=xmlRendererProviders[providerName]}}}),define("taoQtiItem/qtiCreator/model/ResponseProcessing",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/ResponseProcessing","taoQtiItem/qtiCreator/helper/xmlRenderer"],function(_,editable,ResponseProcessing,xmlRenderer){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{}},setProcessingType:function setProcessingType(processingType,xml){this.processingType!==processingType&&("custom"===this.processingType&&_.forEach(this.getRootElement().getResponses(),function(r){r.setTemplate("MATCH_CORRECT")}),"custom"===processingType&&(this.xml=xml||xmlRenderer.render(this.getRootElement().responseProcessing,{notAllowTemplate:!0}),_.forEach(this.getRootElement().getResponses(),function(r){r.setTemplate("CUSTOM")})),this.processingType=processingType)}}),ResponseProcessing.extend(methods)}),define("taoQtiItem/qtiCreator/model/variables/OutcomeDeclaration",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/variables/OutcomeDeclaration"],function(_,editable,OutcomeDeclaration){"use strict";var methods={};return _.extend(methods,editable),OutcomeDeclaration.extend(methods)}),define("taoQtiItem/qtiItem/core/feedbacks/ModalFeedback",["taoQtiItem/qtiItem/core/IdentifiedElement","taoQtiItem/qtiItem/mixin/Container"],function(IdentifiedElement,Container){'use strict';IdentifiedElement=IdentifiedElement&&Object.prototype.hasOwnProperty.call(IdentifiedElement,"default")?IdentifiedElement["default"]:IdentifiedElement,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container;var ModalFeedback=IdentifiedElement.extend({qtiClass:"modalFeedback",is:function is(qtiClass){return"feedback"===qtiClass||this._super(qtiClass)}});return Container.augment(ModalFeedback),ModalFeedback}),define("taoQtiItem/qtiCreator/model/feedbacks/ModalFeedback",["lodash","i18n","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/feedbacks/ModalFeedback"],function(_,__,editable,ModalFeedback){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{title:__("modal feedback title"),showHide:"show"}}}),ModalFeedback.extend(methods)}),define("taoQtiItem/qtiCreator/model/Item",["lodash","context","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableContainer","taoQtiItem/qtiItem/core/Item","taoQtiItem/qtiCreator/model/Stylesheet","taoQtiItem/qtiCreator/model/ResponseProcessing","taoQtiItem/qtiCreator/model/variables/OutcomeDeclaration","taoQtiItem/qtiCreator/model/feedbacks/ModalFeedback"],function(_,context,editable,editableContainer,Item,Stylesheet,ResponseProcessing,OutcomeDeclaration,ModalFeedback){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableContainer),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{identifier:"myItem_1",title:"Item title",adaptive:!1,timeDependent:!1,"xml:lang":context.base_authoring_lang||"en-US"}},createResponseProcessing:function createResponseProcessing(){var rp=new ResponseProcessing;return rp.processingType="templateDriven",this.setResponseProcessing(rp),rp},createStyleSheet:function createStyleSheet(href){if(href&&_.isString(href)){var stylesheet=new Stylesheet({href:href});return stylesheet.setRenderer(this.getRenderer()),this.addStylesheet(stylesheet),stylesheet}throw"missing or invalid type for the required arg \"href\""},createOutcomeDeclaration:function createOutcomeDeclaration(attributes){var identifier=attributes.identifier||"";delete attributes.identifier;var outcome=new OutcomeDeclaration(attributes);return this.addOutcomeDeclaration(outcome),outcome.buildIdentifier(identifier),outcome},getOutcomeDeclaration:function(identifier){var found;return _.forEach(this.outcomes,function(outcome){if(outcome.id()===identifier)return found=outcome,!1}),found},removeOutcome:function(identifier){var outcome=this.getOutcomeDeclaration(identifier);outcome&&(this.outcomes=_.omit(this.outcomes,outcome.getSerial()))},createModalFeedback:function createModalFeedback(attributes,response){var identifier=attributes.identifier||"";delete attributes.identifier;var modalFeedback=new ModalFeedback(attributes);return this.addModalFeedback(modalFeedback),modalFeedback.buildIdentifier(identifier),modalFeedback.body("Some feedback text."),response&&"responseDeclaration"===response.qtiClass&&modalFeedback.data("relatedResponse",response),modalFeedback},deleteResponseDeclaration:function deleteResponseDeclaration(response){var self=this,serial;return _.isString(response)?serial=response:response&&"responseDeclaration"===response.qtiClass&&(serial=response.getSerial()),this.responses[serial]&&(_.each(this.responses[serial].feedbackRules,function(rule){var feedbacks=[];rule.feedbackThen&&rule.feedbackThen.is("modalFeedback")&&feedbacks.push(rule.feedbackThen.serial),rule.feedbackElse&&rule.feedbackElse.is("modalFeedback")&&feedbacks.push(rule.feedbackElse.serial),self.modalFeedbacks=_.omit(self.modalFeedbacks,feedbacks),rule.feedbackOutcome&&rule.feedbackOutcome.is("outcomeDeclaration")&&(self.outcomes=_.omit(self.outcomes,rule.feedbackOutcome.serial))}),this.responses=_.omit(this.responses,serial)),this}}),Item.extend(methods)}),define("taoQtiItem/qtiCreator/helper/itemLoader",["jquery","lodash","taoQtiItem/qtiItem/core/Loader","taoQtiItem/qtiCreator/model/Item","taoQtiItem/qtiCreator/model/qtiClasses","taoQtiItem/qtiItem/helper/itemScore","util/url","core/dataProvider/request"],function($,_,Loader,Item,qtiClasses,itemScoreHelper,urlUtil,request){"use strict";var _generateIdentifier=function(uri){var pos=uri.lastIndexOf("#");return uri.substr(pos+1)},decodeHtml=function(str){var map={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":"\"","&#039;":"'"};return str.replace(/&amp;|&lt;|&gt;|&quot;|&#039;/g,function(m){return map[m]})},qtiNamespace="http://www.imsglobal.org/xsd/imsqti_v2p2",qtiSchemaLocation={"http://www.imsglobal.org/xsd/imsqti_v2p2":"http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2.xsd"},languagesUrl=urlUtil.route("index","Languages","tao");return{loadItem:function(config,callback){if(config.uri){var langList=request(languagesUrl),itemRdf=request(config.itemDataUrl,{uri:config.uri}).catch(function(d){return d});Promise.all([langList,itemRdf]).then(function(_ref6){var _ref7=_slicedToArray(_ref6,2),languagesList=_ref7[0],data=_ref7[1],loader,itemData,newItem;if(data.itemData)for(var response in data.itemData.responses){var newObject={};for(var mapKey in data.itemData.responses[response].mapping)newObject[decodeHtml(mapKey)]=data.itemData.responses[response].mapping[mapKey];data.itemData.responses[response].mapping=newObject}data.itemData&&"assessmentItem"===data.itemData.qtiClass?(loader=new Loader().setClassesLocation(qtiClasses),itemData=data.itemData,loader.loadItemData(itemData,function(loadedItem){var namespaces;loadedItem.isEmpty()&&loadedItem.body(""),namespaces=loadedItem.getNamespaces(),namespaces[""]=qtiNamespace,loadedItem.setNamespaces(namespaces),loadedItem.setSchemaLocations(qtiSchemaLocation),languagesList&&loadedItem.data("languagesList",languagesList);var _loadedItem$responseP=loadedItem.responseProcessing;_loadedItem$responseP=void 0===_loadedItem$responseP?{}:_loadedItem$responseP;var processingType=_loadedItem$responseP.processingType;if(!config.perInteractionRp&&"templateDriven"===processingType){var _itemData=itemData,_itemData$responses=_itemData.responses,responses=void 0===_itemData$responses?{}:_itemData$responses,_itemData$responsePro=_itemData.responseProcessing;_itemData$responsePro=void 0===_itemData$responsePro?{}:_itemData$responsePro;var _data=_itemData$responsePro.data,_itemData$responsePro2=_itemData$responsePro.responseRules,responseRules=void 0===_itemData$responsePro2?[]:_itemData$responsePro2,responseIdentifiers=[];_.forOwn(responses,function(_ref8){var identifier=_ref8.identifier;responseIdentifiers.push(identifier)});var itemScoreRP=itemScoreHelper(responseIdentifiers);responseRules.some(function(responseRule){return _.isEqual(responseRule,itemScoreRP)})&&loadedItem.responseProcessing.setProcessingType("custom",_data)}callback(loadedItem,this.getLoadedClasses())})):(newItem=new Item().id(_generateIdentifier(config.uri)).attr("title",config.label),newItem.createResponseProcessing(),newItem.setNamespaces({"":qtiNamespace,xsi:"http://www.w3.org/2001/XMLSchema-instance",m:"http://www.w3.org/1998/Math/MathML"}),newItem.setSchemaLocations(qtiSchemaLocation),newItem.data("new",!0),languagesList&&newItem.data("languagesList",languagesList),callback(newItem))})}}}}),define("taoQtiItem/portableElementRegistry/assetManager/portableAssetStrategy",["taoQtiItem/portableElementRegistry/ciRegistry","taoQtiItem/portableElementRegistry/icRegistry"],function(ciRegistry,icRegistry){'use strict';function getBaseUrlByIdentifier(typeIdentifier){return ciRegistry.get(typeIdentifier)?ciRegistry.getBaseUrl(typeIdentifier):icRegistry.get(typeIdentifier)?icRegistry.getBaseUrl(typeIdentifier):typeIdentifier}return{name:"portableElementLocation",handle:function(url){if(url.file===url.path)return getBaseUrlByIdentifier(url.file);return url.source===url.relative?url.relative.replace(/^(\.\/)?([a-z_0-9]+)\/(.*)/i,function(fullmatch,$1,typeIdentifier,relPath){var runtimeLocation=getBaseUrlByIdentifier(typeIdentifier);return runtimeLocation?runtimeLocation+"/"+relPath:fullmatch}):void 0}}}),define("taoQtiItem/qtiCommonRenderer/renderers/config",["lodash","context","ui/themes","taoItems/assets/manager","taoItems/assets/strategies","module","taoQtiItem/portableElementRegistry/assetManager/portableAssetStrategy"],function(_,context,themes,assetManagerFactory,assetStrategies,module,portableAssetStrategy){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,context=context&&Object.prototype.hasOwnProperty.call(context,"default")?context["default"]:context,themes=themes&&Object.prototype.hasOwnProperty.call(themes,"default")?themes["default"]:themes,assetManagerFactory=assetManagerFactory&&Object.prototype.hasOwnProperty.call(assetManagerFactory,"default")?assetManagerFactory["default"]:assetManagerFactory,assetStrategies=assetStrategies&&Object.prototype.hasOwnProperty.call(assetStrategies,"default")?assetStrategies["default"]:assetStrategies,module=module&&Object.prototype.hasOwnProperty.call(module,"default")?module["default"]:module,portableAssetStrategy=portableAssetStrategy&&Object.prototype.hasOwnProperty.call(portableAssetStrategy,"default")?portableAssetStrategy["default"]:portableAssetStrategy;var itemThemes=themes.get("items"),moduleConfig=module.config(),assetManager=assetManagerFactory([{name:"theme",handle:function(url){if(itemThemes&&url.path&&(url.path===itemThemes.base||_.contains(_.pluck(itemThemes.available,"path"),url.path)))return context.root_url+url.toString()}},assetStrategies.taomedia,assetStrategies.external,assetStrategies.base64,assetStrategies.itemCssNoCache,assetStrategies.baseUrl,portableAssetStrategy],{baseUrl:""}),config={name:"commonRenderer",locations:{assessmentItem:"taoQtiItem/qtiCommonRenderer/renderers/Item",_container:"taoQtiItem/qtiCommonRenderer/renderers/Container",_simpleFeedbackRule:!1,_tooltip:"taoQtiItem/qtiCommonRenderer/renderers/Tooltip",stylesheet:"taoQtiItem/qtiCommonRenderer/renderers/Stylesheet",outcomeDeclaration:!1,responseDeclaration:!1,responseProcessing:!1,img:"taoQtiItem/qtiCommonRenderer/renderers/Img",math:"taoQtiItem/qtiCommonRenderer/renderers/Math",object:"taoQtiItem/qtiCommonRenderer/renderers/Object",table:"taoQtiItem/qtiCommonRenderer/renderers/Table",printedVariable:"taoQtiItem/qtiCommonRenderer/renderers/PrintedVariable",rubricBlock:"taoQtiItem/qtiCommonRenderer/renderers/RubricBlock",modalFeedback:"taoQtiItem/qtiCommonRenderer/renderers/ModalFeedback",prompt:"taoQtiItem/qtiCommonRenderer/renderers/interactions/Prompt",choiceInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/ChoiceInteraction",extendedTextInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/ExtendedTextInteraction",orderInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/OrderInteraction",associateInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/AssociateInteraction",matchInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/MatchInteraction",textEntryInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/TextEntryInteraction",sliderInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/SliderInteraction",inlineChoiceInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/InlineChoiceInteraction","simpleChoice.choiceInteraction":"taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleChoice.ChoiceInteraction","simpleChoice.orderInteraction":"taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleChoice.OrderInteraction",hottext:"taoQtiItem/qtiCommonRenderer/renderers/choices/Hottext",gap:"taoQtiItem/qtiCommonRenderer/renderers/choices/Gap",gapText:"taoQtiItem/qtiCommonRenderer/renderers/choices/GapText","simpleAssociableChoice.matchInteraction":"taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleAssociableChoice.MatchInteraction","simpleAssociableChoice.associateInteraction":"taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleAssociableChoice.AssociateInteraction",inlineChoice:"taoQtiItem/qtiCommonRenderer/renderers/choices/InlineChoice",hottextInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/HottextInteraction",hotspotInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/HotspotInteraction",hotspotChoice:!1,gapMatchInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/GapMatchInteraction",selectPointInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/SelectPointInteraction",graphicOrderInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicOrderInteraction",mediaInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/MediaInteraction",uploadInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/UploadInteraction",graphicGapMatchInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicGapMatchInteraction",gapImg:"taoQtiItem/qtiCommonRenderer/renderers/choices/GapImg",graphicAssociateInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicAssociateInteraction",associableHotspot:!1,customInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/PortableCustomInteraction",infoControl:"taoQtiItem/qtiCommonRenderer/renderers/PortableInfoControl",include:"taoQtiItem/qtiCommonRenderer/renderers/Include",endAttemptInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/EndAttemptInteraction"},options:{assetManager:assetManager,themes:itemThemes,enableDragAndDrop:{associate:!!moduleConfig.associateDragAndDrop,gapMatch:!!moduleConfig.gapMatchDragAndDrop,graphicGapMatch:!!moduleConfig.graphicGapMatchDragAndDrop,order:!!moduleConfig.orderDragAndDrop},messages:moduleConfig.messages}};return config}),define("taoQtiItem/qtiCreator/renderers/config",["lodash","context","taoQtiItem/qtiCommonRenderer/renderers/config","taoItems/assets/manager","taoItems/assets/strategies"],function(_,context,commonRenderConfig,assetManagerFactory,assetStrategies){'use strict';var assetManager=assetManagerFactory([assetStrategies.taomedia,assetStrategies.external,assetStrategies.base64,assetStrategies.baseUrl],{baseUrl:""}),locations=_.defaults({_container:"taoQtiItem/qtiCreator/renderers/Container",_tooltip:"taoQtiItem/qtiCreator/renderers/Tooltip",assessmentItem:"taoQtiItem/qtiCreator/renderers/Item",rubricBlock:"taoQtiItem/qtiCreator/renderers/RubricBlock",img:"taoQtiItem/qtiCreator/renderers/Img",math:"taoQtiItem/qtiCreator/renderers/Math",object:"taoQtiItem/qtiCreator/renderers/Object",table:"taoQtiItem/qtiCreator/renderers/Table",modalFeedback:"taoQtiItem/qtiCreator/renderers/ModalFeedback",choiceInteraction:"taoQtiItem/qtiCreator/renderers/interactions/ChoiceInteraction",orderInteraction:"taoQtiItem/qtiCreator/renderers/interactions/OrderInteraction",matchInteraction:"taoQtiItem/qtiCreator/renderers/interactions/MatchInteraction",associateInteraction:"taoQtiItem/qtiCreator/renderers/interactions/AssociateInteraction",inlineChoiceInteraction:"taoQtiItem/qtiCreator/renderers/interactions/InlineChoiceInteraction",textEntryInteraction:"taoQtiItem/qtiCreator/renderers/interactions/TextEntryInteraction",hotspotInteraction:"taoQtiItem/qtiCreator/renderers/interactions/HotspotInteraction",selectPointInteraction:"taoQtiItem/qtiCreator/renderers/interactions/SelectPointInteraction",graphicOrderInteraction:"taoQtiItem/qtiCreator/renderers/interactions/GraphicOrderInteraction",graphicAssociateInteraction:"taoQtiItem/qtiCreator/renderers/interactions/GraphicAssociateInteraction",graphicGapMatchInteraction:"taoQtiItem/qtiCreator/renderers/interactions/GraphicGapMatchInteraction",mediaInteraction:"taoQtiItem/qtiCreator/renderers/interactions/MediaInteraction",uploadInteraction:"taoQtiItem/qtiCreator/renderers/interactions/UploadInteraction",sliderInteraction:"taoQtiItem/qtiCreator/renderers/interactions/SliderInteraction",extendedTextInteraction:"taoQtiItem/qtiCreator/renderers/interactions/ExtendedTextInteraction","simpleChoice.choiceInteraction":"taoQtiItem/qtiCreator/renderers/choices/SimpleChoice.ChoiceInteraction","simpleChoice.orderInteraction":"taoQtiItem/qtiCreator/renderers/choices/SimpleChoice.OrderInteraction","simpleAssociableChoice.associateInteraction":"taoQtiItem/qtiCreator/renderers/choices/SimpleAssociableChoice.AssociateInteraction","simpleAssociableChoice.matchInteraction":"taoQtiItem/qtiCreator/renderers/choices/SimpleAssociableChoice.MatchInteraction",gapMatchInteraction:"taoQtiItem/qtiCreator/renderers/interactions/GapMatchInteraction",hottextInteraction:"taoQtiItem/qtiCreator/renderers/interactions/HottextInteraction",customInteraction:"taoQtiItem/qtiCreator/renderers/interactions/PortableCustomInteraction",endAttemptInteraction:"taoQtiItem/qtiCreator/renderers/interactions/EndAttemptInteraction",infoControl:"taoQtiItem/qtiCreator/renderers/PortableInfoControl",include:"taoQtiItem/qtiCreator/renderers/Include",gap:"taoQtiItem/qtiCreator/renderers/choices/Gap",gapText:"taoQtiItem/qtiCreator/renderers/choices/GapText",hottext:"taoQtiItem/qtiCreator/renderers/choices/Hottext",printedVariable:"taoQtiItem/qtiCreator/renderers/PrintedVariable"},commonRenderConfig.locations);return{name:"creatorRenderer",locations:locations,options:{assetManager:assetManager}}}),define("taoQtiItem/qtiCreator/renderers/Renderer",["taoQtiItem/qtiRunner/core/Renderer","taoQtiItem/qtiCreator/renderers/config"],function(Renderer,config){'use strict';return Renderer.build(config.locations,config.name,config.options)}),define("taoQtiItem/qtiCreator/helper/creatorRenderer",["jquery","lodash","taoQtiItem/qtiCreator/renderers/Renderer","taoItems/assets/manager","taoItems/assets/strategies","util/dom"],function($,_,Renderer,assetManagerFactory,assetStrategies,dom){"use strict";var _creatorRenderer=null,_configurableInteractions=["endAttempt"],_extractInteractionsConfig=function(config){var ret={};return config&&config.properties&&_.each(_configurableInteractions,function(interactionName){config.properties[interactionName]&&(ret[interactionName]=config.properties[interactionName])}),ret},get=function(reset,config,areaBroker){var $bodyEltForm;return config=config||{},config.properties=config.properties||{},(!_creatorRenderer||reset)&&($bodyEltForm=_creatorRenderer?_creatorRenderer.getOption("bodyElementOptionForm"):null,(reset||!$bodyEltForm||!$bodyEltForm.length||!dom.contains($bodyEltForm))&&(_creatorRenderer=new Renderer({lang:"",uri:"",shuffleChoices:!1,itemOptionForm:$("#item-editor-item-property-bar .panel"),interactionOptionForm:$("#item-editor-interaction-property-bar .panel"),choiceOptionForm:$("#item-editor-choice-property-bar .panel"),responseOptionForm:$("#item-editor-response-property-bar .panel"),bodyElementOptionForm:areaBroker.getElementPropertyPanelArea(),textOptionForm:$("#item-editor-text-property-bar .panel"),modalFeedbackOptionForm:$("#item-editor-modal-feedback-property-bar .panel"),mediaManager:{appendContainer:"#mediaManager",browseUrl:config.properties.getFilesUrl,uploadUrl:config.properties.fileUploadUrl,deleteUrl:config.properties.fileDeleteUrl,downloadUrl:config.properties.fileDownloadUrl,fileExistsUrl:config.properties.fileExistsUrl,mediaSourcesUrl:config.properties.mediaSourcesUrl},interactions:_extractInteractionsConfig(config),qtiCreatorContext:config.qtiCreatorContext}),_creatorRenderer.getAssetManager().setData({baseUrl:config.properties.baseUrl||""}),_creatorRenderer.setAreaBroker(areaBroker),_.assign(_creatorRenderer,{getCreatorContext:function(){return this.getOption("qtiCreatorContext")}}))),_creatorRenderer};return{get:get,setOption:function setOption(name,value){return get().setOption(name,value)},setOptions:function setOptions(options){return get().setOptions(options)},load:function load(qtiClasses,done){return get().load(function(){_.isFunction(done)&&done.apply(this,arguments)},qtiClasses)}}}),define("taoQtiItem/qtiCommonRenderer/renderers/Renderer",["taoQtiItem/qtiRunner/core/Renderer","taoQtiItem/qtiCommonRenderer/renderers/config"],function(Renderer$1,config){'use strict';Renderer$1=Renderer$1&&Object.prototype.hasOwnProperty.call(Renderer$1,"default")?Renderer$1["default"]:Renderer$1,config=config&&Object.prototype.hasOwnProperty.call(config,"default")?config["default"]:config;var Renderer=Renderer$1.build(config.locations,config.name,config.options);return Renderer}),define("taoQtiItem/qtiCommonRenderer/helpers/container",["lodash","jquery","taoQtiItem/qtiItem/core/Element"],function(_,$,Element){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element;var _containers={},_$containerContext=$(),_getSelector=function(element){var serial=element.getSerial(),selector="[data-serial=".concat(serial,"]");return Element.isA(element,"choice")?selector=".qti-choice".concat(selector):Element.isA(element,"interaction")&&(selector=".qti-interaction".concat(selector)),selector};return{setContext:function setContext($scope){_$containerContext=$scope},getContext:function getContext(){return _$containerContext},get:function get(element,$scope){var serial=element.getSerial();return $scope instanceof $&&$scope.length?$scope.find(_getSelector(element)):_$containerContext instanceof $&&_$containerContext.length?_$containerContext.find(_getSelector(element)):(_containers[serial]&&_containers[serial].length||(_containers[serial]=$(_getSelector(element))),_containers[serial])},reset:function reset(element){element instanceof Element&&_containers[element.getSerial()]&&(_containers=_.omit(_containers,element.getSerial()))},clear:function clear(){_containers={},_$containerContext=$()},trigger:function trigger(eventType,element,data){eventType&&(data&&!_.isArray(data)&&(data=[data]),this.get(element).trigger(eventType,data))},triggerResponseChangeEvent:function triggerResponseChangeEvent(interaction,extraData){this.trigger("responseChange",interaction,[{interaction:interaction,response:interaction.getResponse()},extraData])},targetBlank:function targetBlank($container){$container.on("click","a",function(e){e.preventDefault();var href=$(this).attr("href");href&&href.match(/^http/i)&&window.open(href,"_blank")})}}}),define("taoQtiItem/qtiCreator/helper/commonRenderer",["lodash","taoQtiItem/qtiCommonRenderer/renderers/Renderer","taoQtiItem/qtiCommonRenderer/helpers/container"],function(_,Renderer,containerHelper){"use strict";var _$previousContext=null,commonRenderer={render:function render(item,$container){return commonRenderer.setContext($container),_renderer.load(function(){$container.append(item.render(this)),item.postRender({},"",this)},item.getUsedClasses())},get:function get(reset,config){return(!_renderer||reset)&&(_renderer=new Renderer({shuffleChoices:!0}),config&&_renderer.getAssetManager().setData({baseUrl:config.properties.baseUrl||""})),_renderer},getOption:function getOption(name){return _renderer.getOption(name)},setOption:function setOption(name,value){return _renderer.setOption(name,value)},setOptions:function setOptions(options){return _renderer.setOptions(options)},setContext:function setContext($context){return _$previousContext=$context,containerHelper.setContext($context)},restoreContext:function restoreContext(){containerHelper.setContext(_$previousContext),_$previousContext=null},load:function load(qtiClasses,done){var renderer=_renderer||this.get();return renderer.load(function(){_.isFunction(done)&&done.apply(this,arguments)},qtiClasses)}},_renderer;return commonRenderer}),define("taoQtiItem/qtiItem/helper/simpleParser",["lodash","jquery","taoQtiItem/qtiItem/helper/util","taoQtiItem/qtiItem/core/Loader"],function(_,$,util,Loader){'use strict';function _getElementSelector(qtiClass,ns){return ns?ns+"\\:"+qtiClass+","+qtiClass:qtiClass}function getQtiClassFromXmlDom($node){var qtiClass=$node.prop("tagName").toLowerCase();return qtiClass=qtiClass.replace(/.*:/,""),_qtiClassNames[qtiClass]?_qtiClassNames[qtiClass]:qtiClass}function buildElement($elt){var qtiClass=getQtiClassFromXmlDom($elt),elt={qtiClass:qtiClass,serial:util.buildSerial(qtiClass+"_"),attributes:{}};return $.each($elt[0].attributes,function(){var attrName;this.specified&&(attrName=_qtiAttributesNames[this.name]||this.name,elt.attributes[attrName]=this.value)}),elt}function buildMath($elt,options){var elt=buildElement($elt);return elt.annotations={},$elt.find(_getElementSelector("annotation",options.ns.math)).each(function(){var $annotation=$(this),encoding=$annotation.attr("encoding");encoding&&(elt.annotations[encoding]=_.unescape($annotation.html())),$annotation.remove()}),elt.mathML=$elt.html(),elt.ns={name:"m",uri:"http://www.w3.org/1998/Math/MathML"},elt}function buildTooltip(targetHtml,contentId,contentHtml){return{elements:{},qtiClass:"_tooltip",serial:util.buildSerial("_tooltip_"),attributes:{"aria-describedby":contentId},content:contentHtml,body:{elements:{},serial:util.buildSerial("container"),body:targetHtml}}}function parseTable($elt,elt,options){elt.body={body:"",elements:{}};var $parsedTable=parseContainer($elt,options);return elt.body.body=$parsedTable.body,elt.body.elements=$parsedTable.elements,elt}function parseContainer($container,options){var ret={serial:util.buildSerial("_container_"),body:"",elements:{}};return $container.find("table").each(function(){var $qtiElement=$(this),element=buildElement($qtiElement);element=parseTable($qtiElement,element,options),ret.elements[element.serial]=element,$qtiElement.replaceWith(_placeholder(element))}),$container.find(_getElementSelector("math",options.ns.math)).each(function(){var $qtiElement=$(this),element=buildMath($qtiElement,options);ret.elements[element.serial]=element,$qtiElement.replaceWith(_placeholder(element))}),$container.find(_getElementSelector("include",options.ns.include)).each(function(){var $qtiElement=$(this),element=buildElement($qtiElement);ret.elements[element.serial]=element,$qtiElement.replaceWith(_placeholder(element))}),$container.find("[data-role=\"tooltip-target\"]").each(function(){var $target=$(this),contentId=$target.attr("aria-describedBy"),element,$content,contentHtml;contentId&&($content=$container.find("#"+contentId),$content.length&&(contentHtml=$content.html(),element=buildTooltip($target.html(),contentId,contentHtml),ret.elements[element.serial]=element,$target.replaceWith(_placeholder(element)),$content.remove()))}),_.each(_parsableElements,function(qtiClass){$container.find(qtiClass).each(function(){var $qtiElement=$(this),element=buildElement($qtiElement);ret.elements[element.serial]=element,$qtiElement.replaceWith(_placeholder(element))})}),ret.body=$container.html(),ret}function _placeholder(element){return"{{"+element.serial+"}}"}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,util=util&&Object.prototype.hasOwnProperty.call(util,"default")?util["default"]:util,Loader=Loader&&Object.prototype.hasOwnProperty.call(Loader,"default")?Loader["default"]:Loader;var _parsableElements=["img","object","printedVariable"],_qtiClassNames={rubricblock:"rubricBlock",printedvariable:"printedVariable"},_qtiAttributesNames={powerform:"powerForm",mappingindicator:"mappingIndicator"},_defaultOptions={ns:{math:"",include:"xi",table:"table",image:"img",object:""},loaded:null,model:null},parser;parser={parse:function parse(xmlStr,opts){var options=_.merge(_.clone(_defaultOptions),opts||{}),$container=$(xmlStr),element=buildElement($container),data=parseContainer($container,options),loader;return _.isUndefined(data.body)||(element.body=data),_.isFunction(options.loaded)&&options.model&&(loader=new Loader().setClassesLocation(options.model),loader.loadAndBuildElement(element,options.loaded)),element}};var parser$1=parser;return parser$1}),define("taoQtiItem/qtiItem/helper/xincludeLoader",["jquery","lodash","taoQtiItem/qtiItem/helper/simpleParser","taoQtiItem/qtiItem/core/Loader"],function($,_,simpleParser,Loader){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,simpleParser=simpleParser&&Object.prototype.hasOwnProperty.call(simpleParser,"default")?simpleParser["default"]:simpleParser,Loader=Loader&&Object.prototype.hasOwnProperty.call(Loader,"default")?Loader["default"]:Loader;return{load:function(xinclude,baseUrl,callback){var href=xinclude.attr("href");href&&baseUrl&&require(["text!".concat(baseUrl).concat(href)],function(stimulusXml){var $wrapper=$.parseXML(stimulusXml),$sampleXMLrootNode=$wrapper.children,$stimulus=$("<include>").append($sampleXMLrootNode),data=simpleParser.parse($stimulus,{ns:{math:"m"}});new Loader().loadElement(xinclude,data,function(){if(_.isFunction(callback)){var loadedClasses=this.getLoadedClasses();loadedClasses.push("_container"),callback(xinclude,data,loadedClasses)}})},function(){callback(xinclude,!1,[])})}}}),define("taoQtiItem/qtiCreator/helper/xincludeRenderer",["lodash","taoQtiItem/qtiCreator/helper/commonRenderer","taoQtiItem/qtiItem/helper/xincludeLoader"],function(_,commonRenderer,xincludeLoader){'use strict';return{render:function(xincludeWidget,baseUrl,newHref){var xinclude=xincludeWidget.element;newHref&&xinclude.attr("href",newHref),xincludeLoader.load(xinclude,baseUrl,function(xi,data,loadedClasses){data?commonRenderer.get().load(function(){_.each(xinclude.getComposingElements(),function(elt){elt.setRenderer(commonRenderer.get())}),xincludeWidget.refresh()},loadedClasses):xinclude.removeAttr("href")})}}}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/insertInteractionButton",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n data-sub-group=\"",(helper=helpers.subGroup)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.subGroup,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n",buffer}function program5(depth0,data){var buffer="",stack1,helper;return buffer+="\n title=\"",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n",buffer}function program7(depth0,data){var buffer="",stack1,helper;return buffer+="\n <span class=\"icon ",(helper=helpers.icon)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.icon,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"></span>\n ",buffer}function program9(depth0,data){var buffer="",stack1,helper;return buffer+="\n <img class=\"icon\" src=\"",(helper=helpers.icon)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.icon,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<li\n",stack1=helpers["if"].call(depth0,depth0&&depth0.subGroup,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n data-qti-class=\"",(helper=helpers.qtiClass)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.qtiClass,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n\n",stack1=helpers["if"].call(depth0,depth0&&depth0.disabled,{hash:{},inverse:self.program(5,program5,data),fn:self.program(3,function(){return"\n class=\"disabled\"\n title=\"element available in the final release\"\n"},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n>\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.iconFont,{hash:{},inverse:self.program(9,program9,data),fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n <div class=\"truncate\">",(helper=helpers.short)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.short,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</div>\n</li>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/insertInteractionGroup",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<section class=\"tool-group\" id=\"",(helper=helpers.id)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.id,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <h2>",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</h2>\n <div class=\"panel clearfix\">\n <ul class=\"tool-list plain\"></ul>\n </div>\n</section>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/tooltip",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<div>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n ",(helper=helpers.message)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.message,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/editor/interactionsToolbar",["jquery","lodash","i18n","ui/hider","tpl!taoQtiItem/qtiCreator/tpl/toolbars/insertInteractionButton","tpl!taoQtiItem/qtiCreator/tpl/toolbars/insertInteractionGroup","tpl!taoQtiItem/qtiCreator/tpl/toolbars/tooltip","ui/tooltip"],function($,_,__,hider,insertInteractionTpl,insertSectionTpl,tooltipTpl,tooltip){'use strict';function getGroupId(groupId){return groupId.replace(/\W+/g,"-").toLowerCase()}function getGroupSectionId(groupId){return"sidebar-left-section-"+getGroupId(groupId)}function addGroup($sidebar,groupId,groupLabel){var groupSectionId=getGroupSectionId(groupId),$section=$(insertSectionTpl({id:groupSectionId,label:groupLabel}));return $sidebar.append($section),$section}function getGroup($sidebar,groupId){var groupSectionId=getGroupSectionId(groupId);return $sidebar.find("#"+groupSectionId)}function isReady($sidebar){return!!$sidebar.data("interaction-toolbar-ready")}function exists($sidebar,interactionClass){return!!$sidebar.find("li[data-qti-class=\""+interactionClass+"\"]").length}function add($sidebar,interactionAuthoringData){if(exists($sidebar,interactionAuthoringData.qtiClass))throw"the interaction is already in the sidebar";var groupId=interactionAuthoringData.group,groupLabel=interactionAuthoringData.tags[0]||"",subGroupId=interactionAuthoringData.tags[1],tplData={qtiClass:interactionAuthoringData.qtiClass,disabled:!!interactionAuthoringData.disabled,title:interactionAuthoringData.description,iconFont:/^icon-/.test(interactionAuthoringData.icon),icon:interactionAuthoringData.icon,short:interactionAuthoringData.short,dev:!1},$group=getGroup($sidebar,groupId);subGroupId&&_subgroups[subGroupId]&&(tplData.subGroup=subGroupId),$group.length||($group=addGroup($sidebar,groupId,groupLabel)),subGroupId&&_subgroups[subGroupId]&&(tplData.subGroup=subGroupId),$group.length||($group=addGroup($sidebar,groupId,groupLabel));var $interaction=$(insertInteractionTpl(tplData));return $group.find(".tool-list").append($interaction),$interaction}function buildSubGroups($sidebar){$sidebar.find("[data-sub-group]").each(function(){var $element=$(this),$section=$element.parents("section"),subGroup=$element.data("sub-group"),$subGroupPanel,$subGroupList,$cover;subGroup&&($subGroupPanel=$section.find(".sub-group."+subGroup),$subGroupList=$subGroupPanel.find(".tool-list"),!$subGroupPanel.length&&($subGroupPanel=$("<div>",{class:"panel clearfix sub-group "+subGroup}),$subGroupList=$("<ul>",{class:"tool-list plain clearfix"}),$subGroupPanel.append($subGroupList),$section.append($subGroupPanel),$cover=$("<div>",{class:"sub-group-cover blocking"}),$subGroupPanel.append($cover),$subGroupPanel.data("cover",$cover)),$subGroupList.append($element))}),addInlineInteractionTooltip()}function addInlineInteractionTooltip(){var $inlineInteractionsPanel=$("#sidebar-left-section-inline-interactions .inline-interactions"),$tooltip=$(tooltipTpl({message:__("Inline interactions need to be inserted into a text block.")})),timer;$inlineInteractionsPanel.append($tooltip),tooltip.lookup($inlineInteractionsPanel),$tooltip.css({position:"absolute",zIndex:11,top:0,right:10}),$inlineInteractionsPanel.on("mouseenter",".sub-group-cover",function(){timer=setTimeout(function(){$tooltip.find("[data-tooltip]").data("$tooltip").show()},300)}).on("mouseleave",".sub-group-cover",function(){$tooltip.find("[data-tooltip]").data("$tooltip").hide(),clearTimeout(timer)})}var _subgroups={"inline-interactions":"Inline Interactions"},_events={interactiontoolbarready:"interactiontoolbarready.qti-widget"};return{create:function($sidebar,interactions){_.each(interactions,function(interactionAuthoringData){add($sidebar,interactionAuthoringData)}),buildSubGroups($sidebar),$sidebar.data("interaction-toolbar-ready",!0),$sidebar.trigger(_events.interactiontoolbarready)},add:add,exists:exists,addGroup:addGroup,getGroupId:getGroupId,getGroupSectionId:getGroupSectionId,getGroup:getGroup,isReady:isReady,whenReady:function($sidebar){return new Promise(function(resolve){isReady($sidebar)?resolve():$sidebar.on(_events.interactiontoolbarready,function(){resolve()})})},remove:function($sidebar,interactionClass){$sidebar.find("li[data-qti-class=\""+interactionClass+"\"]").remove()},disable:function($sidebar,interactionClass){hider.hide($sidebar.find("li[data-qti-class=\""+interactionClass+"\"]"))},enable:function($sidebar,interactionClass){hider.show($sidebar.find("li[data-qti-class=\""+interactionClass+"\"]"))},getCustomInteractionTag:function getCustomInteractionTag(){return"Custom Interactions"}}}),define("taoQtiItem/qtiCreator/helper/panel",["jquery","lodash","taoQtiItem/qtiItem/core/Element"],function($,_,Element){"use strict";var _getItemContainer=function(){return $("#item-editor-panel")},showPanel=function($panel,$fold){$panel.show(),openSections($panel.children("section")),$fold&&$fold.length&&closeSections($fold.children("section"))},toggleInlineInteractionGroup=function(){var $itemContainer=_getItemContainer();$itemContainer.find(".widget-textBlock").length?enableSubGroup("inline-interactions"):disableSubGroup("inline-interactions")},heading="h2",section="section",panel="hr, .panel",closed="closed",ns="accordion",_toggleSections=function(sections,preserveOthers,state){sections.each(function(){$(this).find(heading).trigger("click",{preserveOthers:preserveOthers,forceState:state})})},closeSections=function(sections,preserveOthers){_toggleSections(sections,!!preserveOthers,"close")},openSections=function(sections,preserveOthers){_toggleSections(sections,!!preserveOthers,"open")},_toggleSubGroup=function(subGroup,state){if(subGroup=$("."+subGroup),subGroup.length){var fn="disable"===state?"addClass":"removeClass";subGroup.data("cover")[fn]("blocking")}},enableSubGroup=function(subGroup){_toggleSubGroup(subGroup,"enable")},disableSubGroup=function(subGroup){_toggleSubGroup(subGroup,"disable")};return{initFormVisibilityListener:function initFormVisibilityListener(){$(document).off(".panel");var $itemContainer=_getItemContainer(),_staticElements={_tooltip:"Tooltip",img:"Image",object:"Media",rubricBlock:"Rubric Block",math:"Math",table:"Table",include:"Shared Stimulus",infoControl:"Student Tool"},$formInteractionPanel=$("#item-editor-interaction-property-bar"),$formChoicePanel=$("#item-editor-choice-property-bar"),$formResponsePanel=$("#item-editor-response-property-bar"),$formItemPanel=$("#item-editor-item-property-bar"),$formBodyElementPanel=$("#item-editor-body-element-property-bar"),$formTextBlockPanel=$("#item-editor-text-property-bar"),$formModalFeedbackPanel=$("#item-editor-modal-feedback-property-bar"),$formStylePanel=$("#item-style-editor-bar"),$appearanceToggler=$("#appearance-trigger"),$menuLabel=$appearanceToggler.find(".menu-label"),$itemIcon=$appearanceToggler.find(".icon-item"),$styleIcon=$appearanceToggler.find(".icon-style"),_toggleAppearanceEditor=function(active){active?($appearanceToggler.addClass("active"),$formStylePanel.show(),$formItemPanel.hide(),$itemContainer.trigger("styleedit"),showPanel($formStylePanel),$menuLabel.text($menuLabel.data("item")),$itemIcon.show(),$styleIcon.hide()):($appearanceToggler.removeClass("active"),$formStylePanel.hide(),showPanel($formItemPanel),$menuLabel.text($menuLabel.data("style")),$itemIcon.hide(),$styleIcon.show())};$appearanceToggler.on("click",function(){$appearanceToggler.hasClass("active")?_toggleAppearanceEditor(!1):_toggleAppearanceEditor(!0)}),_.delay(function(){showPanel($formItemPanel)},200),$(document).on("afterStateInit.qti-widget.panel",function(e,element,state){switch(state.name){case"active":_toggleAppearanceEditor(!1),Element.isA(element,"assessmentItem")||$formItemPanel.hide();var label=_staticElements[element.qtiClass];label?($formBodyElementPanel.find("h2").html(label+" Properties"),showPanel($formBodyElementPanel)):"_container"===element.qtiClass&&showPanel($formTextBlockPanel),"modalFeedback"===element.qtiClass&&(showPanel($formModalFeedbackPanel),$formResponsePanel.hide());break;case"question":showPanel($formInteractionPanel);break;case"answer":showPanel($formResponsePanel);break;case"choice":showPanel($formChoicePanel,$formInteractionPanel);break;case"sleep":_staticElements[element.qtiClass]?$formBodyElementPanel.hide():"_container"===element.qtiClass&&$formTextBlockPanel.hide(),Element.isA(element,"choice")||$itemContainer.find(".widget-box.edit-active").length||showPanel($formItemPanel);}}).on("afterStateExit.qti-widget.panel",function(e,element,state){switch(state.name){case"active":"modalFeedback"===element.qtiClass&&(showPanel($formResponsePanel),$formModalFeedbackPanel.hide());break;case"question":element.is("interaction")&&($formChoicePanel.hide(),$formInteractionPanel.hide());break;case"choice":$formChoicePanel.hide(),showPanel($formInteractionPanel);break;case"answer":$formResponsePanel.hide();}}).on("elementCreated.qti-widget.panel",function(e,data){"_container"===data.element.qtiClass&&enableSubGroup("inline-interactions")}).on("deleted.qti-widget.panel",function(e,data){"_container"===data.element.qtiClass&&toggleInlineInteractionGroup()})},showPanel:showPanel,toggleInlineInteractionGroup:toggleInlineInteractionGroup,initSidebarAccordion:function initSidebarAccordion($sidebar){var $sections=$sidebar.find(section),$allPanels=$sidebar.children(panel).hide(),$allTriggers=$sidebar.find(heading);return!(0!==$allTriggers.length)||void($allTriggers.each(function(){var $heading=$(this),$section=$heading.parents(section),$panel=$section.children(panel),$closer=$("<span>",{class:"icon-up"}),$opener=$("<span>",{class:"icon-down"}),action=$panel.is(":visible")?"open":"close";($heading.append($closer).append($opener).addClass(closed),!$heading.hasClass("_accordion"))&&($heading.addClass("_accordion"),$panel.on("panelclose."+ns+" panelopen."+ns,function(e,args){var fn="panelclose"===e.type?"add":"remove";args.heading[fn+"Class"](closed)}),$panel.trigger("panel"+action+"."+ns,{heading:$heading}))}),$sections.each(function(){$(this).find(heading).on("click",function(e,args){var $heading=$(this),$panel=$heading.parents(section).children(panel),preserveOthers=!!(args&&args.preserveOthers),forceState=!!(args&&args.forceState)&&args.forceState,action,classFn;forceState&&(classFn="open"===forceState?"addClass":"removeClass",$heading[classFn](closed)),action=$heading.hasClass(closed)?"open":"close",!1,$panel.trigger("panel"+action+"."+ns,{heading:$heading})[{close:"hide",open:"fadeIn"}[action]]()})}))},openSections:openSections,closeSections:closeSections,enableSubGroup:enableSubGroup,disableSubGroup:disableSubGroup}}),define("taoQtiItem/qtiCreator/editor/interactionsPanel",["lodash","taoQtiItem/qtiCreator/editor/interactionsToolbar","taoQtiItem/qtiCreator/helper/panel","taoQtiItem/qtiCreator/helper/qtiElements","taoQtiItem/portableElementRegistry/ciRegistry"],function(_,interactionsToolbar,panel,qtiElements,ciRegistry){'use strict';return function($container){var interactions=qtiElements.getAvailableAuthoringElements();_.forIn(ciRegistry.getAllVersions(),function(versions,typeId){var data=ciRegistry.getAuthoringData(typeId,{enabledOnly:!0});data&&data.tags&&data.tags[0]===interactionsToolbar.getCustomInteractionTag()&&(interactions[data.qtiClass]=data)}),interactionsToolbar.create($container,interactions),panel.initSidebarAccordion($container),panel.closeSections($container.find("section")),panel.openSections($container.find("#sidebar-left-section-common-interactions"),!1),panel.toggleInlineInteractionGroup()}}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/cssToggler",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<li data-css-res=\"",(helper=helpers.path)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.path,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"icon-preview style-sheet-toggler\" title=\"",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"></span>\n <span class=\"file-label truncate\" title=\"",(helper=helpers.editLabelTxt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.editLabelTxt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span>\n <input type=\"text\" class=\"style-sheet-label-editor\" value=\"",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"icon-bin\" title=\"",(helper=helpers.deleteTxt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.deleteTxt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-role=\"css-delete\"></span>\n <span class=\"icon-download\" title=\"",(helper=helpers.downloadTxt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.downloadTxt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-role=\"css-download\"></span>\n</li>",buffer})}),define("taoQtiItem/qtiCreator/editor/styleEditor/styleEditor",["jquery","lodash","i18n","util/urlParser","core/promise","tpl!taoQtiItem/qtiCreator/tpl/toolbars/cssToggler","jquery.fileDownload"],function($,_,__,UrlParser,Promise,cssTpl){'use strict';var _getUri=function(action){return globalConfig["".concat(action,"CssUrl")]},_basename=function(path){return path.substring(path.lastIndexOf("/")+1)},style={},$styleElem=function(){var styleElem=$("#item-editor-user-styles");return styleElem.length?styleElem.empty():(styleElem=$("<style>",{id:"item-editor-user-styles"}),$("head").append(styleElem)),styleElem}(),common={title:__("Disable this stylesheet temporarily"),deleteTxt:__("Remove this stylesheet"),editLabelTxt:__("Edit stylesheet label"),downloadTxt:__("Download this stylesheet"),preparingMessageHtml:__("Preparing CSS, please wait\u2026"),failMessageHtml:__("There was a problem downloading your CSS, please try again."),isInValidLocalTxt:__("This stylesheet has not been found on the server. you may want to delete this reference")},customStylesheet=null,customStylesheetHref="style/custom/tao-user-styles.css",erase=function(){return style={},$styleElem.text(""),!1},create=function(dontAppend){var css="",key1,key2,mSelector,mProp;if(_.isEmpty(style))return erase();for(key1 in style)if(Object.prototype.hasOwnProperty.call(style,key1)){for(key2 in css+="".concat(key1,"{"),style[key1])if(Object.prototype.hasOwnProperty.call(style[key1],key2))if(_.isPlainObject(style[key1][key2]))for(mSelector in style[key1][key2]){for(mProp in css+="".concat(key2,"{"),style[key1][key2])css+="".concat(mProp,":").concat(style[key1][key2][mSelector],";");css+="}"}else css+="".concat(key2,":").concat(style[key1][key2],";");css+="}\n"}return dontAppend||$styleElem.text(css),css},apply=function(selector,property,value){style[selector]=style[selector]||{},value?style[selector][property]=value:(delete style[selector][property],0===_.size(style[selector])&&delete style[selector]),create(),$(document).trigger("stylechange.qti-creator")},verifyInit=function(){if(!itemConfig)throw new Error("Missing itemConfig, did you call styleEditor.init()?");return!0},download=function(uri){verifyInit(),$.fileDownload(_getUri("download"),{preparingMessageHtml:common.preparingMessageHtml,failMessageHtml:common.failMessageHtml,successCallback:function successCallback(){},httpMethod:"POST",data:_.extend({},itemConfig,{stylesheetUri:uri})})},addStylesheet=function(stylesheet){var loadStylesheet=function(link,stylesheetLoad,isLocal,isValid){var isInvalidLocal=isLocal&&!isValid,tplData={path:stylesheetLoad.attr("href"),label:stylesheetLoad.attr("title")||fileName,title:common.title,deleteTxt:common.deleteTxt,downloadTxt:common.downloadTxt,editLabelTxt:isInvalidLocal?common.isInValidLocalTxt:common.editLabelTxt};return listEntry=$(cssTpl(tplData)),listEntry.data("stylesheetObj",stylesheetLoad),$("#style-sheet-toggler").append(listEntry),isInvalidLocal?(listEntry.addClass("not-available"),void listEntry.find("[data-role=\"css-download\"], .style-sheet-toggler").css("visibility","hidden")):void($styleElem.before(link),setTimeout(function(){var isInit=!1;$(document).trigger("customcssloaded.styleeditor",[style]),$(window).trigger("resize"),currentItem.pendingStylesheetsInit&&(isInit=!0,currentItem.pendingStylesheetsInit--),$(document).trigger("stylechange.qti-creator",[{initializing:isInit}])},isLocal?500:3500))},listEntry,fileName;_.isString(stylesheet)&&(stylesheet=currentItem.createStyleSheet(stylesheet)),fileName=_basename(stylesheet.attr("href"));var link=function(){var _link=$(stylesheet.render()),_href=_link.attr("href"),_sep=-1<_href.indexOf("?")?"&":"?";return _link.attr("href",_href+_sep+new Date().getTime().toString()),_link}(),parser=new UrlParser(link.attr("href"));parser.checkCORS()?$.when($.ajax(link.attr("href"))).then(function(){loadStylesheet(link,stylesheet,!0,!0)},function(){loadStylesheet(link,stylesheet,!0,!1)}):loadStylesheet(link,stylesheet,!1)},addItemStylesheets=function(){var key,currentStylesheet;for(key in currentItem.pendingStylesheetsInit=_.size(currentItem.stylesheets),currentItem.stylesheets)if(Object.prototype.hasOwnProperty.call(currentItem.stylesheets,key)){if(currentStylesheet=currentItem.stylesheets[key],"tao-user-styles.css"===_basename(currentStylesheet.attr("href"))){customStylesheet=currentStylesheet;continue}addStylesheet(currentItem.stylesheets[key])}},removeOrphanedStylesheets=function(){$("link[data-serial]").remove(),customStylesheet=null,erase()},getItem=function(){return currentItem},init=function(item,config){var resizerTarget,href;globalConfig=config,currentItem=item,itemConfig={uri:config.uri,lang:config.lang,baseUrl:config.baseUrl},removeOrphanedStylesheets(),addItemStylesheets(),resizerTarget=$("#item-editor-item-resizer").data("target"),currentItem.data("responsive",!0),customStylesheet&&(href=customStylesheet.attr("href"),$.when($.getJSON(_getUri("load"),_.extend({},itemConfig,{stylesheetUri:href}))).then(function(_style){style=_style,create(),style.length&&currentItem.data("responsive",!!(style[resizerTarget]&&style[resizerTarget].width)),$(document).trigger("customcssloaded.styleeditor",[style])}))},getStyle=function(){return style},itemConfig,globalConfig,currentItem;return{apply:apply,save:function(){return new Promise(function(resolve,reject){verifyInit();var isStyles=0<_.size(style);return isStyles||customStylesheet?void(isStyles&&!customStylesheet&&(customStylesheet=currentItem.createStyleSheet(customStylesheetHref)),!isStyles&&customStylesheet&&(currentItem.removeStyleSheet(customStylesheet),customStylesheet=null),$.post(_getUri("save"),_.extend({},itemConfig,{cssJson:JSON.stringify(style),stylesheetUri:customStylesheetHref})).done(resolve).fail(function(xhr,status,err){reject(err)})):resolve()})},download:download,erase:erase,init:init,create:create,getItem:getItem,getStyle:getStyle,addStylesheet:addStylesheet,cleanCache:function cleanCache(){removeOrphanedStylesheets()}}}),define("tpl!taoQtiItem/qtiCreator/tpl/notifications/genericFeedbackPopup",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"feedback-",(helper=helpers.type)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.type,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+" popup\">\n <span class=\"icon-",(helper=helpers.type)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.type,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"></span>\n ",(helper=helpers.message)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.message,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <span title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove Message",options):helperMissing.call(depth0,"__","Remove Message",options)))+"\" class=\"icon-close close-trigger\"></span>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/editor/styleEditor/styleSheetToggler",["jquery","taoQtiItem/qtiCreator/editor/styleEditor/styleEditor","i18n","lodash","taoQtiItem/qtiCreator/model/Stylesheet","tpl!taoQtiItem/qtiCreator/tpl/notifications/genericFeedbackPopup","ui/resourcemgr"],function($,styleEditor,__,_,Stylesheet,genericFeedbackPopup){'use strict';var $doc=$(document),styleSheetToggler=function(){var _createInfoBox=function(data){var $messageBox=$(genericFeedbackPopup(data)),closeTrigger=$messageBox.find(".close-trigger");return $("body").append($messageBox),closeTrigger.on("click",function(){$messageBox.fadeOut(function(){$(this).remove()})}),setTimeout(function(){closeTrigger.trigger("click")},4523),$messageBox};return{init:function init(itemConfig){var cssToggler=$("#style-sheet-toggler"),uploader=$("#stylesheet-uploader"),customCssToggler=$("[data-custom-css]"),getContext=function(trigger){trigger=$(trigger);var li=trigger.closest("li"),stylesheetObj=li.data("stylesheetObj")||new Stylesheet({href:li.data("css-res")}),input=li.find(".style-sheet-label-editor"),labelBox=input.prev(".file-label"),label=input.val();return{li:li,input:input,label:label,labelBox:labelBox,isCustomCss:!!li.data("custom-css"),isDisabled:li.find(".icon-preview").hasClass("disabled"),stylesheetObj:stylesheetObj,cssUri:stylesheetObj.attr("href")}};uploader.on("click",function(){uploader.resourcemgr({appendContainer:"#mediaManager",path:"/",root:"local",browseUrl:itemConfig.getFilesUrl,uploadUrl:itemConfig.fileUploadUrl,deleteUrl:itemConfig.fileDeleteUrl,downloadUrl:itemConfig.fileDownloadUrl,fileExistsUrl:itemConfig.fileExistsUrl,params:{uri:itemConfig.uri,lang:itemConfig.lang,filters:"text/css"},pathParam:"path",select:function select(e,files){var l=files.length,i;for(i=0;i<l;i++)styleEditor.addStylesheet(files[i].file)}})});var deleteStylesheet=function(trigger){var context=getContext(trigger),attr=context.isDisabled?"disabled-href":"href",cssLinks=$("head link");styleEditor.getItem().removeStyleSheet(context.stylesheetObj),cssLinks.filter("["+attr+"*=\""+context.cssUri+"\"]").remove(),context.li.remove(),$(".feedback-info").hide(),_createInfoBox({message:__("Style Sheet <b>%s</b> removed<br> Click <i>Add Style Sheet</i> to re-apply.").replace("%s",context.label),type:"info"}),$doc.trigger("customcssloaded.styleeditor",[styleEditor.getStyle()])},initLabelEditor=function(trigger){var context=getContext(trigger);context.labelBox.hide(),context.input.show()},downloadStylesheet=function(trigger){styleEditor.download(getContext(trigger).cssUri)},saveLabel=function(trigger){var context=getContext(trigger),title=$.trim(context.input.val());return title?void(context.stylesheetObj.attr("title",title),context.input.hide(),context.labelBox.html(title).show()):(context.stylesheetObj.attr("title",""),!1)},handleAvailability=function(trigger){var context=getContext(trigger),attrTo="disabled-href",attrFrom="href",link;context.isCustomCss?context.isDisabled?(styleEditor.create(),customCssToggler.removeClass("not-available")):(styleEditor.erase(),customCssToggler.addClass("not-available")):(context.isDisabled&&(attrTo="href",attrFrom="disabled-href"),link=$("link["+attrFrom+"$=\""+context.cssUri+"\"]"),link.attr(attrTo,link.attr(attrFrom)).removeAttr(attrFrom)),$(trigger).toggleClass("disabled")};cssToggler.on("click",function(e){var target=e.target,className=target.className;-1<className.indexOf("icon-bin")?deleteStylesheet(e.target):-1<className.indexOf("file-label")?initLabelEditor(e.target):-1<className.indexOf("icon-preview")?handleAvailability(e.target):-1<className.indexOf("icon-download")&&downloadStylesheet(e.target)}),cssToggler.on("keydown","input",function(e){13===e.keyCode&&$(e.target).trigger("blur")}),cssToggler.on("blur","input",function(e){saveLabel(e.target)})}}}();return styleSheetToggler}),define("json!taoQtiItem/qtiCreator/editor/resources/font-stacks.json",function(){return{"sans-serif":["Arial, \"Helvetica Neue\", Helvetica, sans-serif","\"Avant Garde\", Avantgarde, \"Century Gothic\", CenturyGothic, \"AppleGothic\", sans-serif","Calibri, Candara, Segoe, \"Segoe UI\", Optima, Arial, sans-serif","Candara, Calibri, Segoe, \"Segoe UI\", Optima, Arial, sans-serif","\"Century Gothic\", CenturyGothic, AppleGothic, sans-serif","Corbel, \"Lucida Grande\", \"Lucida Sans Unicode\", \"Lucida Sans\", \"DejaVu Sans\", \"Bitstream Vera Sans\", \"Liberation Sans\", Verdana, \"Verdana Ref\", sans-serif","\"Franklin Gothic Medium\", \"Franklin Gothic\", \"ITC Franklin Gothic\", Arial, sans-serif","Frutiger, \"Frutiger Linotype\", Univers, Calibri, \"Gill Sans\", \"Gill Sans MT\", \"Myriad Pro\", Myriad, \"DejaVu Sans Condensed\", \"Liberation Sans\", \"Nimbus Sans L\", Tahoma, Geneva, \"Helvetica Neue\", Helvetica, Arial, sans-serif","Futura, \"Century Gothic\", AppleGothic, \"Trebuchet MS\", sans-serif","Geneva, Verdana, \"Lucida Sans\", \"Lucida Grande\", \"Lucida Sans Unicode\", sans-serif","\"Gill Sans\", \"Gill Sans MT\", Calibri, sans-serif","\"Helvetica Neue\", Helvetica, Arial, sans-serif","Impact, Haettenschweiler, \"Franklin Gothic Bold\", Charcoal, \"Helvetica Inserat\", \"Bitstream Vera Sans Bold\", \"Arial Black\", sans-serif","\"Lucida Grande\", \"Lucida Sans Unicode\", \"Lucida Sans\", Geneva, Verdana, sans-serif","Optima, Segoe, \"Segoe UI\", Candara, Calibri, Arial, sans-serif","\"Segoe UI\", Candara, \"Bitstream Vera Sans\", \"DejaVu Sans\", \"Bitstream Vera Sans\", \"Trebuchet MS\", Verdana, \"Verdana Ref\", sans-serif","Tahoma, Verdana, Segoe, sans-serif","\"Trebuchet MS\", \"Lucida Grande\", \"Lucida Sans Unicode\", \"Lucida Sans\", Tahoma, sans-serif","Verdana, Geneva, Tahoma, sans-serif"],serif:["Baskerville, \"Baskerville Old Face\", \"Hoefler Text\", Garamond, \"Times New Roman\", serif","\"Big Caslon\", \"Book Antiqua\", \"Palatino Linotype\", Georgia, serif","\"Bodoni MT\", Didot, \"Didot LT STD\", \"Hoefler Text\", Garamond, \"Times New Roman\", serif","\"Book Antiqua\", Palatino, \"Palatino Linotype\", \"Palatino LT STD\", Georgia, serif","\"Calisto MT\", \"Bookman Old Style\", Bookman, \"Goudy Old Style\", Garamond, \"Hoefler Text\", \"Bitstream Charter\", Georgia, serif","Cambria, \"Hoefler Text\", Utopia, \"Liberation Serif\", \"Nimbus Roman No9 L Regular\", Times, \"Times New Roman\", serif","Constantia, \"Lucida Bright\", Lucidabright, \"Lucida Serif\", Lucida, \"DejaVu Serif\", \"Bitstream Vera Serif\", \"Liberation Serif\", Georgia, serif","Didot, \"Didot LT STD\", \"Hoefler Text\", Garamond, \"Times New Roman\", serif","Garamond, Baskerville, \"Baskerville Old Face\", \"Hoefler Text\", \"Times New Roman\", serif","Georgia, Palatino,\" Palatino Linotype\", Times, \"Times New Roman\", serif","\"Goudy Old Style\", Garamond, \"Big Caslon\", \"Times New Roman\", serif","\"Hoefler Text\", \"Baskerville old face\", Garamond, \"Times New Roman\", serif","\"Lucida Bright\", Georgia, serif","\"Palatino Linotype\", Palatino, Palladio, \"URW Palladio L\", \"Book Antiqua\", Baskerville, \"Bookman Old Style\", \"Bitstream Charter\", \"Nimbus Roman No9 L\", Garamond, \"Apple Garamond\", \"ITC Garamond Narrow\", \"New Century Schoolbook\", \"Century Schoolbook\", \"Century Schoolbook L\", Georgia, serif","Perpetua, Baskerville, \"Big Caslon\", \"Palatino Linotype\", Palatino, \"URW Palladio L\", \"Nimbus Roman No9 L\", serif","Rockwell, \"Courier Bold\", Courier, Georgia, Times, \"Times New Roman\", serif","\"Times New Roman\", TimesNewRoman, Times, Baskerville, Georgia, serif"],monospace:["\"Andale Mono\", AndaleMono, monospace","Consolas, \"Andale Mono WT\", \"Andale Mono\", \"Lucida Console\", \"Lucida Sans Typewriter\", \"DejaVu Sans Mono\", \"Bitstream Vera Sans Mono\", \"Liberation Mono\", \"Nimbus Mono L\", Monaco, \"Courier New\", Courier, monospace","\"Courier New\", Courier, \"Lucida Sans Typewriter\", \"Lucida Typewriter\", monospace","\"Lucida Console\", \"Lucida Sans Typewriter\", Monaco, \"Bitstream Vera Sans Mono\", monospace","Monaco, Consolas, \"Lucida Console\", monospace","\"Rockwell Extra Bold\", \"Rockwell Bold\", monospace"]}}),define("taoQtiItem/qtiCreator/editor/styleEditor/fontSelector",["jquery","json!taoQtiItem/qtiCreator/editor/resources/font-stacks.json","taoQtiItem/qtiCreator/editor/styleEditor/styleEditor","i18n","select2"],function($,fontStacks,styleEditor,__){'use strict';function fontSelector(){var fontSelector=$("select#item-editor-font-selector"),target=fontSelector.data("target"),$target=$(target),normalize=function(font){return font.replace(/"/g,"'").replace(/, /g,",")},clean=function(font){return font.substring(0,font.indexOf(",")).replace(/'/g,"")},resetButton=fontSelector.parent().find("[data-role=\"font-selector-reset\"]"),i=0,toLabel=function(font){return font=font.replace(/-/g," "),(font+"").replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,function($1){return $1.toUpperCase()})},format=function(state){var originalOption=state.element;return state.id?"<span style=\"font-size: 12px;"+$(originalOption).attr("style")+"\">"+state.text+"</span>":state.text},generic,optGroup,option,l;for(generic in fontSelector.append("<option value=\"\">"+__("Default")+"</option>"),fontStacks)if(fontStacks.hasOwnProperty(generic)){for(optGroup=$("<optgroup>",{label:toLabel(generic)}),l=fontStacks[generic].length,i=0;i<l;i++){fontStacks[generic][i]=normalize(fontStacks[generic][i]);var value=fontStacks[generic][i],cleanValue=clean(value);option=$("<option>",{value:value,text:cleanValue}).css({fontFamily:value}),optGroup.append(option)}fontSelector.append(optGroup)}resetButton.on("click",function reset(){styleEditor.apply(target,"font-family"),fontSelector.select2("val","")}),fontSelector.select2({formatResult:format,formatSelection:format,width:"resolve"}),$(document).on("customcssloaded.styleeditor",function(e,style){style[target]&&style[target]["font-family"]&&(fontSelector.select2("val",style[target]["font-family"]),$("".concat("select#item-editor-font-selector"," option:selected")).first().attr("selected","selected"))}),fontSelector.on("change",function(){styleEditor.apply(target,"font-family",$(this).val()),$("".concat("select#item-editor-font-selector"," option:selected")).first().attr("selected","selected")})}return fontSelector}),define("taoQtiItem/qtiCreator/helper/popup",["jquery","lodash","core/dataattrhandler"],function($,_,dataAttrHandler){'use strict';return{init:function init($trigger,options){options=_.assign({top:null,right:2,title:null},options||{});var open=function($trigger,$popup){var $container=$popup.parents(".sidebar-popup-parent"),$actionBar=$(".item-editor-action-bar"),baseOffsetTop=$actionBar.offset().top-$actionBar.height(),maxHeight=$(window).height()-baseOffsetTop,top=_.isNull(options.top)?$trigger.offset().top-baseOffsetTop-$popup.height()/2:options.top,$titleArea=$popup.find(".sidebar-popup-title"),$title=$titleArea.find("h3");$titleArea.length&&(maxHeight-=$titleArea.height()),$trigger.trigger("beforeopen.popup",{popup:$popup,trigger:$trigger}),$popup.show(),$popup.css({top:Math.max(baseOffsetTop,top),right:$container.hasClass("item-editor-sidebar-wrapper")?$container.width()+options.right:options.right}),options.title&&$title.text(options.title),$popup.find(".sidebar-popup-content").css({maxHeight:maxHeight}),$trigger.trigger("open.popup",{popup:$popup,trigger:$trigger})},close=function($trigger,$popup){$trigger.trigger("beforeclose.popup",{popup:$popup,trigger:$trigger}),$popup.hide(),$trigger.trigger("close.popup",{popup:$popup,trigger:$trigger})};$trigger.each(function(){var _trigger=$(this),$popup=options.popup||function(){return dataAttrHandler.getTarget("popup",_trigger)}(),$closer=$popup.find(".closer"),$dragger=$popup.find(".sidebar-popup-title").not($closer);if(!$popup||!$popup.length)throw new Error("No popup found");$closer.length&&$closer.on("click",function(){close(_trigger,$popup)}),$dragger.length&&$popup.draggable({handle:$dragger}),_trigger.prop("popup",$popup)}),$trigger.on("click",function(e){var _trigger=$(e.target),$popup=_trigger.prop("popup");e.preventDefault(),$popup.is(":visible")?close(_trigger,$popup):open(_trigger,$popup)})},reorderZindex:function(){}}}),define("taoQtiItem/qtiCreator/editor/styleEditor/colorSelector",["jquery","lodash","i18n","taoQtiItem/qtiCreator/editor/styleEditor/styleEditor","taoQtiItem/qtiCreator/helper/popup","lib/farbtastic/farbtastic"],function($,_,__,styleEditor){'use strict';function rgbToHex(color){function toHexPair(inp){return("0"+parseInt(inp,10).toString(16)).slice(-2)}if(!_.isString(color))return color;var rgbArr=/rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/i.exec(color);return _.isArray(rgbArr)&&4===rgbArr.length?"#"+toHexPair(rgbArr[1])+toHexPair(rgbArr[2])+toHexPair(rgbArr[3]):color}return function colorSelector(){var colorPicker=$(".item-editor-color-picker"),widget=colorPicker.find(".color-picker"),widgetBox=colorPicker.find(".color-picker-container"),titleElement=colorPicker.find("#color-picker-title"),input=colorPicker.find("#color-picker-input"),resetButtons=colorPicker.find(".reset-button"),colorTriggers=colorPicker.find(".color-trigger"),colorTriggerLabels=colorPicker.find("label"),currentProperty="color",$doc=$(document),setTitle=function(property,trigger){titleElement.text(trigger.parent().find("label").text())},setTriggerColor=function(){colorTriggers.each(function(){var $trigger=$(this),target=$trigger.data("target"),$target=$(target),style=styleEditor.getStyle()||{},value;style[target]&&style[target][$trigger.data("value")]?(value=style[target][$trigger.data("value")],$trigger.css("background-color",value),$trigger.attr("title",rgbToHex(value))):$target.css($trigger.data("value"))?(value=$target.css($trigger.data("value")),$trigger.css("background-color",value),$trigger.attr("title",rgbToHex(value))):($trigger.css("background-color",""),$trigger.attr("title",__("No value set")))})},widgetObj;widgetObj=$.farbtastic(widget).linkTo(input),widget.on("colorchange.farbtastic",function(e,color){styleEditor.apply(widget.prop("target"),currentProperty,color),setTriggerColor()}),setTriggerColor(),colorTriggers.add(colorTriggerLabels).on("click",function(){var $tmpTrigger=$(this),$trigger="label"===this.nodeName.toLowerCase()?$tmpTrigger.parent().find(".color-trigger"):$tmpTrigger,value=$trigger.css("background-color");widget.prop("target",$trigger.data("target")),widgetBox.hide(),currentProperty=$trigger.data("value"),setTitle(currentProperty,$trigger),widgetObj.setColor(rgbToHex($trigger.css("background-color"))),widgetBox.show()}),$doc.on("mouseup",function(e){return $(e.target).hasClass("closer")?(widgetBox.hide(),!1):widgetBox.is(e.target)||0!==widgetBox.has(e.target).length?void 0:(widgetBox.hide(),!1)}),$doc.on("keyup",function(e){if(27===e.keyCode)return widgetBox.hide(),!1}),resetButtons.on("click",function(){var $this=$(this),$colorTrigger=$this.parent().find(".color-trigger"),target=$colorTrigger.data("target"),value=$colorTrigger.data("value");styleEditor.apply(target,value),setTriggerColor()}),$doc.on("customcssloaded.styleeditor",setTriggerColor)}}),define("taoQtiItem/qtiCreator/editor/styleEditor/fontSizeChanger",["jquery","lodash","taoQtiItem/qtiCreator/editor/styleEditor/styleEditor"],function($,_,styleEditor){'use strict';return function fontSizeChanger(){var $fontSizeChanger=$("#item-editor-font-size-changer"),itemSelector=$fontSizeChanger.data("target"),$item=$(itemSelector),itemFontSize=parseInt($item.css("font-size"),10),$resetBtn=$fontSizeChanger.parents(".reset-group").find("[data-role=\"font-size-reset\"]"),$input=$("#item-editor-font-size-text"),resizeFont=function(){styleEditor.apply(itemSelector+" *","font-size",itemFontSize.toString()+"px")};$fontSizeChanger.find("a").on("click",function(e){if(e.preventDefault(),"reduce"===$(this).data("action")){if(10>=itemFontSize)return;itemFontSize--}else itemFontSize++;resizeFont(),$input.val(itemFontSize),$(this).parent().blur()}),$input.on("keydown",function(e){var c=e.keyCode;return _.contains([8,37,39,46],c)||48<=c&&57>=c||96<=c&&105>=c}),$input.on("blur",function(){itemFontSize=parseInt(this.value,10),resizeFont()}),$input.on("keydown",function(e){var c=e.keyCode;13===c&&$input.trigger("blur")}),$resetBtn.on("click",function(){$input.val(""),styleEditor.apply(itemSelector+" *","font-size"),itemFontSize=parseInt($item.css("font-size"),10)}),$(document).on("customcssloaded.styleeditor",function(e,style){style[itemSelector+" *"]&&style[itemSelector+" *"]["font-size"]?($input.val(parseInt(style[itemSelector+" *"]["font-size"],10)),$input.trigger("blur")):$input.val(parseInt($item.css("font-size"),10))})}}),define("taoQtiItem/qtiCreator/editor/styleEditor/itemResizer",["jquery","lodash","taoQtiItem/qtiCreator/editor/styleEditor/styleEditor","nouislider"],function($,_,styleEditor){'use strict';return function(item){var itemResizer=$("#item-editor-item-resizer"),target=itemResizer.data("target"),$target=$(target),targetWidth=$target.innerWidth(),itemWidthPrompt=itemResizer.find("[name=\"item-width-prompt\"]"),sliderBox=itemResizer.find(".slider-box"),slider=itemResizer.find("#item-editor-item-resizer-slider"),input=$("#item-editor-item-resizer-text"),resetButton=itemResizer.find("[data-role=\"item-width-reset\"]"),sliderSettings={range:{min:Math.min(768,targetWidth),max:Math.max(1200,targetWidth)},start:targetWidth},resizeItem=function(val){val?(val=parseInt(val).toString()+"px",styleEditor.apply(target,"width",val),styleEditor.apply(target,"max-width","none")):(styleEditor.apply(target,"width"),styleEditor.apply(target,"max-width")),item.data("widget").$container.trigger("resize.itemResizer")};itemWidthPrompt.on("click",function(){"slider"===this.value?(input.val($target.width()),slider.val($target.width()).trigger("slide"),sliderBox.slideDown(),item.data("responsive",!1),resizeItem($target.width())):(input.val(""),slider.val(sliderSettings.start),sliderBox.slideUp(),item.data("responsive",!0),resizeItem())}),slider.noUiSlider(sliderSettings),slider.on("slide",function(){var value=Math.round(slider.val());input.val(value),resizeItem(value)}),input.on("keydown",function(e){var c=e.keyCode;return _.contains([8,37,39,46],c)||48<=c&&57>=c||96<=c&&105>=c}),input.on("blur",function(){resizeItem(this.value)}),resetButton.on("click",function reset(){itemResizer.find("[value=\"no-slider\"]").trigger("click")}),$(document).on("customcssloaded.styleeditor",function(e,style){var width;style[target]&&style[target].width?(width=parseInt(style[target].width,10),input.val(width),slider.val(width),itemResizer.find("[value=\"slider\"]").trigger("click")):input.val($target.width())})}}),define("taoQtiItem/qtiCreator/editor/propertiesPanel",["lodash","taoQtiItem/qtiCreator/helper/panel","taoQtiItem/qtiCreator/editor/styleEditor/styleEditor","taoQtiItem/qtiCreator/editor/styleEditor/styleSheetToggler","taoQtiItem/qtiCreator/editor/styleEditor/fontSelector","taoQtiItem/qtiCreator/editor/styleEditor/colorSelector","taoQtiItem/qtiCreator/editor/styleEditor/fontSizeChanger","taoQtiItem/qtiCreator/editor/styleEditor/itemResizer"],function(_,panel,styleEditor,styleSheetToggler,fontSelector,colorSelector,fontSizeChanger,itemResizer){'use strict';return function($container,widget,config){panel.initSidebarAccordion($container),panel.initFormVisibilityListener(),styleEditor.init(widget.element,config),styleSheetToggler.init(config),fontSelector(),colorSelector(),fontSizeChanger(),itemResizer(widget.element)}}),define("taoQtiItem/qtiCreator/itemCreator",["jquery","lodash","i18n","module","core/eventifier","core/promise","taoQtiItem/portableElementRegistry/ciRegistry","taoQtiItem/portableElementRegistry/icRegistry","taoQtiItem/qtiCreator/context/qtiCreatorContext","taoQtiItem/qtiCreator/helper/itemLoader","taoQtiItem/qtiCreator/helper/creatorRenderer","taoQtiItem/qtiCreator/helper/commonRenderer","taoQtiItem/qtiCreator/helper/xincludeRenderer","taoQtiItem/qtiCreator/editor/interactionsPanel","taoQtiItem/qtiCreator/editor/propertiesPanel","taoQtiItem/qtiCreator/model/helper/event","taoQtiItem/qtiCreator/editor/styleEditor/styleEditor"],function($,_,__,module,eventifier,Promise,ciRegistry,icRegistry,qtiCreatorContextFactory,itemLoader,creatorRenderer,commonRenderer,xincludeRenderer,interactionPanel,propertiesPanel,eventHelper,styleEditor){'use strict';var loadItem=function(uri,label,itemDataUrl,perInteractionRp){return new Promise(function(resolve,reject){itemLoader.loadItem({uri:uri,label:label,itemDataUrl:itemDataUrl,perInteractionRp:perInteractionRp},function(item){item||reject(new Error("Unable to load the item")),item.data("uri",uri),resolve(item)})})},loadCustomInteractions=function(interactionsIds){return ciRegistry.loadCreators({include:interactionsIds})},loadInfoControls=function(){return icRegistry.loadCreators()};return function(config,areaBroker,pluginFactories){var qtiCreatorContext=qtiCreatorContextFactory(),plugins={},pluginRun=function(method){var execStack=[];return _.forEach(plugins,function(plugin){_.isFunction(plugin[method])&&execStack.push(plugin[method]())}),Promise.all(execStack)},itemCreator;if(!_.isPlainObject(config))throw new TypeError("The item creator configuration is required");if(!config.properties||_.isEmpty(config.properties.uri)||_.isEmpty(config.properties.label)||_.isEmpty(config.properties.baseUrl))throw new TypeError("The creator configuration must contains the required properties triples: uri, label and baseUrl");if(!areaBroker)throw new TypeError("Without an areaBroker there are no chance to see something you know");return itemCreator=eventifier({init:function(){var self=this;_.forEach(pluginFactories,function(pluginFactory){var plugin=pluginFactory(self,areaBroker);plugins[plugin.getName()]=plugin}),$(document).off(".qti-widget"),this.on("save",function(silent){var item=this.getItem(),itemWidget=item.data("widget"),invalidElements=item.data("invalid")||{};if(_.size(invalidElements)){var reasons=[];return Object.keys(invalidElements).forEach(function(serial){Object.keys(invalidElements[serial]).forEach(function(key){reasons.push(invalidElements[serial][key].message)})}),void self.trigger("error",new Error("".concat(__("Item cannot be saved.")," ").concat(reasons.join(", "),".")))}return this.beforeSaveProcess.then(function(){return styleEditor.save()}).then(function(){return itemWidget.save()}).then(function(){silent||self.trigger("success",__("Your item has been saved")),self.trigger("saved")}).catch(function(err){self.trigger("error",err)})}),this.on("exit",function(){$(".item-editor-item",areaBroker.getItemPanelArea()).empty(),styleEditor.cleanCache()});var usedCustomInteractionIds=[];return loadItem(config.properties.uri,config.properties.label,config.properties.itemDataUrl,config.properties.perInteractionRp).then(function(item){return _.isObject(item)?(_.forEach(item.getComposingElements(),function(element){element.is("customInteraction")&&usedCustomInteractionIds.push(element.typeIdentifier)}),self.item=item,!0):void self.trigger("error",new Error("Unable to load the item ".concat(config.properties.label)))}).then(function(){var item=self.item;if("templateDriven"===item.responseProcessing.processingType&&config.properties.perInteractionRp){var responseIdentifiers=Object.keys(item.responses||{}).map(function(responseKey){return item.responses[responseKey].attributes.identifier});_.forEach(responseIdentifiers,function(responseIdentifier){var outcomeIdentifier="SCORE_".concat(responseIdentifier);item.getOutcomeDeclaration(outcomeIdentifier)||item.createOutcomeDeclaration({cardinality:"single",baseType:"float"}).attr("identifier",outcomeIdentifier)})}}).then(function(){return Promise.all([loadCustomInteractions(usedCustomInteractionIds),loadInfoControls()])}).then(function(){return pluginRun("init").then(function(){self.trigger("init",self.item)})}).then(function(){return qtiCreatorContext.on("error",function(err){self.trigger("error",err)}),self.beforeSaveProcess=Promise.resolve(),qtiCreatorContext.on("registerBeforeSaveProcess",function(beforeSaveProcess){self.beforeSaveProcess=Promise.all([self.beforeSaveProcess,beforeSaveProcess])}),qtiCreatorContext.init()}).catch(function(err){self.trigger("error",err)}),this},render:function(){var self=this,item=this.getItem();return item&&_.isFunction(item.getUsedClasses)?(commonRenderer.setContext(areaBroker.getItemPanelArea()),commonRenderer.get(!0,config).setOption("baseUrl",config.properties.baseUrl),interactionPanel(areaBroker.getInteractionPanelArea()),$(document).on("ready.qti-widget",function(e,elt){"assessmentItem"===elt.element.qtiClass&&self.trigger("ready")}),config.qtiCreatorContext=qtiCreatorContext,creatorRenderer.get(!0,config,areaBroker).setOptions(config.properties).load(function(){var widget;item.setRenderer(this),areaBroker.getItemPanelArea().append(item.render()),Promise.all(item.postRender(_.clone(config.properties))).then(function(){return areaBroker.getContainer().data("widget",item),widget=item.data("widget"),_.each(item.getComposingElements(),function(element){"include"===element.qtiClass&&xincludeRenderer.render(element.data("widget"),config.properties.baseUrl)}),propertiesPanel(areaBroker.getPropertyPanelArea(),widget,config.properties),eventHelper.initElementToWidgetListeners(),pluginRun("render").then(function(){self.trigger("render")})}).catch(function(err){self.trigger("error",err)})},item.getUsedClasses()),this):this.trigger("error",new Error("We need an item to render."))},destroy:function(){var _this9=this;return $(document).off(".qti-widget"),pluginRun("destroy").then(function(){return qtiCreatorContext.destroy()}).then(function(){_this9.trigger("destroy")}).catch(function(err){_this9.trigger("error",err)}),this},getItem:function(){return this.item},isEmpty:function(){var item=this.item.bdy.bdy;return""===item||"\n "===item},getConfig:function(){return config}}),itemCreator}}),define("taoQtiItem/qtiCreator/editor/areaBroker",["lodash","ui/areaBroker"],function(_,areaBroker){'use strict';return _.partial(areaBroker,["menu","menuLeft","menuRight","editorBar","title","toolbar","interactionPanel","itemPanel","contentCreatorPanel","propertyPanel","itemPropertyPanel","elementPropertyPanel","itemStylePanel","modalContainer"])}),define("tpl!taoQtiItem/qtiCreator/plugins/button",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+=" data-testid=\"",(helper=helpers.testId)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.testId,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<li class=\"btn-info small ",(helper=helpers.cssClass)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.cssClass,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" title=\"",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,depth0&&depth0.testId,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <span class=\"li-inner\"><span class=\"icon-",(helper=helpers.icon)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.icon,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"></span>",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span>\n</li>",buffer})}),define("taoQtiItem/qtiCreator/plugins/menu/save",["jquery","i18n","core/plugin","ui/hider","tpl!taoQtiItem/qtiCreator/plugins/button"],function($,__,pluginFactory,hider,buttonTpl){'use strict';return pluginFactory({name:"save",init:function(){var _this10=this,itemCreator=this.getHost();this.$element=$(buttonTpl({icon:"save",title:__("Save the item"),text:__("Save"),cssClass:"save-trigger",testId:"save-the-item"})).on("click",function(e){e.preventDefault(),_this10.disable(),$("#item-editor-panel").trigger("beforesave.qti-creator"),_.defer(function(){itemCreator.trigger("save")})}),this.hide(),this.disable(),itemCreator.on("ready saved error",function(){_this10.enable()})},render:function(){var $container=this.getAreaBroker().getMenuArea();$container.append(this.$element),this.show()},destroy:function(){this.$element.remove()},enable:function(){this.$element.removeProp("disabled").removeClass("disabled")},disable:function(){this.$element.prop("disabled",!0).addClass("disabled")},show:function(){hider.show(this.$element)},hide:function(){hider.hide(this.$element)}})}),define("taoQtiItem/qtiCreator/plugins/menu/preview",["module","jquery","i18n","core/plugin","ui/hider","taoItems/previewer/factory","tpl!taoQtiItem/qtiCreator/plugins/button"],function(module,$,__,pluginFactory,hider,previewerFactory,buttonTpl){'use strict';function previewHandler(e,plugin){if(!plugin.$element.hasClass("disabled")){var itemCreator=plugin.getHost();$(document).trigger("open-preview.qti-item"),e.preventDefault(),plugin.disable(),itemCreator.trigger("preview",itemCreator.getItem().data("uri")),plugin.enable()}}function enablePreviewIfNotEmpty(plugin){plugin.getHost().isEmpty()||plugin.enable()}function disablePreviewIfEmpty(plugin){plugin.getHost().isEmpty()&&plugin.disable()}return pluginFactory({name:"preview",init:function(){var _this11=this,itemCreator=this.getHost();itemCreator.on("preview",function(uri){var config=module.config(),type=config.provider||"qtiItem";this.isEmpty()||previewerFactory(type,uri,{},{readOnly:!1,fullPage:!0})}),itemCreator.on("saved",function(){return enablePreviewIfNotEmpty(_this11)}),this.$element=$(buttonTpl({icon:"preview",title:__("Preview the item"),text:__("Preview"),cssClass:"preview-trigger",testId:"preview-the-item"})).on("click",function(e){return previewHandler(e,_this11)}),this.getAreaBroker().getItemPanelArea().on("item.deleted",function(){return disablePreviewIfEmpty(_this11)})},render:function(){var $container=this.getAreaBroker().getMenuArea();this.getHost().isEmpty()&&this.disable(),$container.append(this.$element)},destroy:function(){this.$element.remove()},enable:function(){this.$element.removeProp("disabled").removeClass("disabled")},disable:function(){this.$element.prop("disabled",!0).addClass("disabled")},show:function(){hider.show(this.$element)},hide:function(){hider.hide(this.$element)}})}),define("taoQtiItem/qtiCreator/plugins/menu/print",["jquery","i18n","core/plugin","ui/hider","tpl!taoQtiItem/qtiCreator/plugins/button"],function($,__,pluginFactory,hider,buttonTpl){'use strict';var spreadClass=function($container,cssClass){$container.parents().each(function(){$(this).siblings().addClass(cssClass)})};return pluginFactory({name:"print",init:function(){var self=this,itemCreator=this.getHost();spreadClass(this.getAreaBroker().getItemPanelArea(),"item-no-print"),this.$element=$(buttonTpl({icon:"print",title:__("Print the item"),text:__("Print"),cssClass:"print-trigger"})).on("click",function(e){e.preventDefault(),window.print()}),this.hide(),this.disable(),itemCreator.on("ready",function(){self.enable()})},render:function(){var $container=this.getAreaBroker().getMenuArea();$container.append(this.$element),this.show()},destroy:function(){this.$element.remove()},enable:function(){this.$element.removeProp("disabled").removeClass("disabled")},disable:function(){this.$element.prop("disabled",!0).addClass("disabled")},show:function(){hider.show(this.$element)},hide:function(){hider.hide(this.$element)}})}),define("taoQtiItem/qtiCreator/plugins/content/title",["jquery","lodash","i18n","core/plugin"],function($,_,__,pluginFactory){'use strict';return pluginFactory({name:"title",init:function(){var config=this.getHost().getConfig(),item=this.getHost().getItem();item&&!_.isEmpty(item.attr("title"))?this.title=item.attr("title"):config&&config.properties&&config.properties.label&&(this.title=config.properties.label)},render:function(){this.title&&this.getAreaBroker().getTitleArea().text(this.title)}})}),define("taoQtiItem/qtiCreator/helper/saveChanges",["jquery"],function($){'use strict';return function(itemCreator){return new Promise(function(resolve,reject){$("#item-editor-panel").trigger("beforesave.qti-creator"),itemCreator.on("saved.saveChanges",function(){itemCreator.off(".saveChanges"),resolve()}).on("error.saveChanges",function(err){itemCreator.off(".saveChanges"),reject(err)}).trigger("save",!0)})}}),define("taoQtiItem/qtiCreator/helper/changeTracker",["jquery","lodash","i18n","lib/uuid","core/eventifier","ui/dialog","taoQtiItem/qtiCreator/helper/saveChanges"],function($,_,__,uuid,eventifier,dialog,saveChanges){'use strict';var messages={preview:__("The item needs to be saved before it can be previewed"),leave:__("The item has unsaved changes, are you sure you want to leave ?"),exit:__("The item has unsaved changes, would you like to save it ?")};return function(container,itemCreator){var wrapperSelector=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"body",eventNS=".ct-".concat(uuid(8,16)),styleChanges=!1,asking=!1,onStyleChange=function(e,detail){detail&&detail.initializing||(styleChanges=!0,changeTracker.trigger("stylechange"))},changeTracker,originalItem;return changeTracker=eventifier({init:function init(){return originalItem=this.getSerializedItem(),styleChanges=!1,this},install:function install(){var _this12=this;return this.init(),asking=!1,$(window.document).one("customcssloaded.styleeditor",function(){return _this12.init()}).on("stylechange.qti-creator",onStyleChange),$(window).on("beforeunload".concat(eventNS),function(){if(!asking&&_this12.hasChanged())return messages.leave}).on("popstate",function(){return _this12.uninstall()}),$(wrapperSelector).on("click".concat(eventNS),function(e){$.contains(container,e.target)||$(e.target).parents("#feedback-box").length||$(e.target).hasClass("icon-close")||!_this12.hasChanged()||(e.stopImmediatePropagation(),e.preventDefault(),_this12.confirmBefore("exit").then(function(){_this12.uninstall(),e.target.click()}).catch(function(){}))}),itemCreator.on("ready".concat(eventNS," saved").concat(eventNS),function(){return _this12.init()}).before("exit".concat(eventNS),function(){return _this12.confirmBefore("exit").then(function(){return _this12.uninstall()})}).before("preview".concat(eventNS),function(){return _this12.confirmBefore("preview")}),this},uninstall:function uninstall(){return $(window.document).off(eventNS).off("stylechange.qti-creator",onStyleChange),$(window).off(eventNS),$(wrapperSelector).off(eventNS),itemCreator.off(eventNS),this},confirmBefore:function confirmBefore(message){var _this13=this;return message=messages[message]||message,new Promise(function(resolve,reject){if(asking)return reject();if(!_this13.hasChanged())return resolve();asking=!0;var confirmDlg=dialog({message:message,buttons:[{id:"dontsave",type:"regular",label:__("Don't save"),close:!0},{id:"cancel",type:"regular",label:__("Cancel"),close:!0},{id:"save",type:"info",label:__("Save"),close:!0}],autoRender:!0,autoDestroy:!0,onSaveBtn:function onSaveBtn(){return saveChanges(itemCreator).then(resolve).catch(reject)},onDontsaveBtn:resolve,onCancelBtn:function onCancelBtn(){confirmDlg.hide(),reject({cancel:!0})}}).on("closed.modal",function(){return asking=!1})})},hasChanged:function hasChanged(){if(styleChanges)return!0;var currentItem=this.getSerializedItem();return originalItem!==currentItem||null===currentItem&&null===originalItem},getSerializedItem:function getSerializedItem(){var serialized="";try{serialized=JSON.stringify(itemCreator.getItem().toArray()),serialized=serialized.replace(/ {2,}/g," ")}catch(err){serialized=null}return serialized}}),changeTracker.install()}}),define("taoQtiItem/qtiCreator/plugins/content/changeTracker",["core/plugin","taoQtiItem/qtiCreator/helper/changeTracker"],function(pluginFactory,changeTrackerFactory){'use strict';return pluginFactory({name:"changeTracker",init:function init(){var itemCreator=this.getHost(),$container=this.getAreaBroker().getContainer();this.changeTracker=changeTrackerFactory($container.get(0),itemCreator,".content-wrap")},destroy:function destroy(){this.changeTracker&&(this.changeTracker.uninstall(),this.changeTracker=null)}})}),define("taoQtiItem/qtiCreator/widgets/helpers/validators",["ui/validator/validators","lodash","i18n","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/model/helper/invalidator"],function(validators,_,__,Element,invalidator){'use strict';var typeToMessage={item:__("Invalid identifier"),response:__("Invalid response identifier"),outcome:__("Invalid Outcome Declaration")},invalidIdentifier=__("Identifiers must start with a letter or an underscore and contain only letters, numbers, underscores ( _ ), or hyphens ( - )."),validateIdentifier=function(value,callback,options,type){if("function"==typeof callback){var valid=/^[A-Z_a-z][\x2D0-9A-Z_a-z]*$/.test(value);if(options&&options.serial){var element=Element.getElementBySerial(options.serial);valid?invalidator.valid(element,"invalidIdentifier"):invalidator.invalid(element,"invalidIdentifier",typeToMessage[type])}callback(valid)}},qtiValidators=[{name:"qtiIdentifier",message:"<b>".concat(typeToMessage.item,"</b></br>").concat(invalidIdentifier),validate:function(value,callback,options){validateIdentifier(value,callback,options,"item")}},{name:"qtiResponseIdentifier",message:"<b>".concat(typeToMessage.response,"</b></br>").concat(invalidIdentifier),validate:function(value,callback,options){validateIdentifier(value,callback,options,"response")}},{name:"qtiOutcomeIdentifier",message:"<b>".concat(typeToMessage.outcome,"</b></br>").concat(invalidIdentifier),validate:function(value,callback,options){validateIdentifier(value,callback,options,"outcome")}},{name:"availableIdentifier",message:__("This identifier must not be used by any other response or item variable."),validate:function(value,callback,options){if(options.serial){var element=Element.getElementBySerial(options.serial);if(element&&"function"==typeof callback){var ids=element.getRootElement().getUsedIdentifiers(),available=!ids[value]||ids[value].serial===element.serial;callback(available)}}else throw new Error("missing required option \"serial\"")}},{name:"availableVariableIdentifier",message:__("identifier already taken"),validate:function(value,callback,options){if(options.serial){var element=Element.getElementBySerial(options.serial);if(element&&"function"==typeof callback){var ids=element.getRootElement().getUsedIdentifiers(),available=!ids[value]||ids[value].serial===element.serial||!ids[value].is("variableDeclaration");callback(available)}}else throw new Error("missing required option \"serial\"")}},{name:"isValidUrl",message:__("Invalid URL"),validate:function(value,callback){if(value)try{callback(new URL(value))}catch(error){callback(!1)}else callback(!0)}}];return _.each(qtiValidators,function(rule){validators.register(rule.name,rule)}),validators}),define("taoQtiItem/qtiCreator/widgets/helpers/formElement",["jquery","lodash","i18n","taoQtiItem/qtiItem/core/Element","util/dom","ui/incrementer","ui/tooltip","ui/selecter","ui/inplacer","ui/groupvalidator","taoQtiItem/qtiCreator/widgets/helpers/validators"],function($,_,__,Element,dom,spinner,tooltip,select2){'use strict';function updateResponseDeclaration(interaction,maxChoice,updateCardinality){var correct=[],responseDeclaration;if(!Element.isA(interaction,"interaction"))throw new Error("The first argument must be an interaction, the current element is ".concat(interaction.qtiClass));updateCardinality=!("undefined"!=typeof updateCardinality)||!!updateCardinality,responseDeclaration=interaction.getResponseDeclaration(),updateCardinality&&responseDeclaration.attr("cardinality",1===maxChoice?"single":"multiple"),maxChoice&&(_.forEach(responseDeclaration.getCorrect(),function(c){return!!(correct.length<maxChoice)&&void correct.push(c)}),responseDeclaration.setCorrect(correct))}function createTooltip($input){var formElementTooltip=tooltip.error($input," ",{trigger:"manual"});$input.data("$tooltip")&&($input.data("$tooltip").dispose(),$input.removeData("$tooltip")),$input.siblings(".tooltip.tooltip-red").remove(),$input.data("$tooltip",formElementTooltip),$input.attr("data-has-tooltip",!0)}function validationCallback(valid,results,validatorOptions){var $input=$(this),rule;dom.contains($input)&&(createTooltip($input,validatorOptions),valid?$input.data("$tooltip").hide():(rule=_.where(results,{type:"failure"})[0],rule&&rule.data.message&&!$("#mediaManager").children(".opened").length&&($input.data("$tooltip").updateTitleContent(rule.data.message),$input.data("$tooltip").show())))}function getAttrsOptions(options){return _.defaults(options||{},{allowNull:!1,updateCardinality:!0,attrMethodNames:{remove:"removeAttr",set:"attr"},floatVal:!1,callback:_.noop})}function minCallback(element,value,name,options){var numericValue=options.floatVal?parseFloat(value):parseInt(value,10),isActualNumber=!isNaN(numericValue);options.allowNull||0!==numericValue&&isActualNumber?isActualNumber&&element[options.attrMethodNames.set](name,numericValue):element[options.attrMethodNames.remove](name),options.callback(element,numericValue,name)}return{initWidget:function($form){spinner($form),tooltip.lookup($form),select2($form)},setChangeCallbacks:function setChangeCallbacks($form,element,attributes,options){var applyCallback=function(name,value,$elt){var cb=attributes&&attributes[name];_.isFunction(cb)&&cb.call($elt[0],element,value,name)},callbackSimple=function(){var $elt=$(this),name=$elt.attr("name");$elt.is(":checkbox")?applyCallback(name,$elt.prop("checked"),$elt):applyCallback(name,$elt.val(),$elt)},callbackWithValidation=function(e,valid,elt){var $elt,name;"group"===e.namespace&&($elt=$(elt),name=$elt.attr("name"),(valid||options.saveInvalid)&&applyCallback(name,$elt.val(),$elt),options.invalidate&&element.data("widget").isValid(name,valid))};options=_.defaults(options||{},{validateOnInit:!1,invalidate:!1}),$form.off(".databinding"),$form.on("change.databinding keyup.databinding",":checkbox, :radio, select, :text:not([data-validate]), :hidden:not([data-validate])",callbackSimple),$form.on("keyup.databinding input.databinding propertychange.databinding","textarea",callbackSimple),$form.on("validated.group.databinding",callbackWithValidation),_.defer(function(){$form.groupValidator({validateOnInit:options.validateOnInit,events:["change","blur",{type:"keyup",length:0}],callback:validationCallback})})},removeChangeCallback:function removeChangeCallback($form){$form.off(".databinding"),$form.find(":input[data-has-tooltip]").data("$tooltip").dispose(),$form.find(":input[data-has-tooltip]").removeAttr("data-has-tooltip").removeData("$tooltip"),$form.find(".tooltip.tooltip-red").remove()},getAttributeChangeCallback:function getAttributeChangeCallback(allowEmpty){return function(element,value,name){allowEmpty||""!==value?element.attr(name,value):element.removeAttr(name)}},getMinMaxAttributeCallbacks:function getMinMaxAttributeCallbacks(attributeNameMin,attributeNameMax,options){var callbacks={};return options=getAttrsOptions(options),callbacks[attributeNameMin]=function(element,value,name){minCallback(element,value,name,options)},callbacks[attributeNameMax]=function(element,value,name){value=options.floatVal?parseFloat(value):parseInt(value,10)||0,element.is("interaction")&&updateResponseDeclaration(element,value,options.updateCardinality),!value&&(element.is("orderInteraction")||element.is("graphicOrderInteraction"))?element[options.attrMethodNames.remove](name):element[options.attrMethodNames.set](name,value),options.callback(element,value,name)},callbacks},getLowerUpperAttributeCallbacks:function getLowerUpperAttributeCallbacks(attributeNameLower,attributeNameUpper,options){var callbacks={};return options=getAttrsOptions(options),callbacks[attributeNameLower]=function(element,value,name){minCallback(element,value,name,options)},callbacks[attributeNameUpper]=function(element,value,name){value=options.floatVal?parseFloat(value):parseInt(value,10)||0,element.is("interaction")&&updateResponseDeclaration(element,value,options.updateCardinality),this.disabled?element[options.attrMethodNames.remove](name):element[options.attrMethodNames.set](name,value),options.callback(element,value,name)},callbacks}}}),define("tpl!taoQtiItem/qtiCreator/tpl/outcomeEditor/panel",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"qti-outcome-editor panel\">\n <hr/>\n <h3 class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Outcome Declarations",options):helperMissing.call(depth0,"__","Outcome Declarations",options)))+"</h3>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Here you can provide scoring aspects for manual scoring/marking, e.g. CONTENT, GRAMMAR, SPELLING",options):helperMissing.call(depth0,"__","Here you can provide scoring aspects for manual scoring/marking, e.g. CONTENT, GRAMMAR, SPELLING",options)))+"</span>\n <div class=\"outcomes\">\n ",(helper=helpers.listing)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.listing,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </div>\n <a href=\"#\" class=\"adder feedbackRule-add\" data-testid=\"add-an-outcome\">Add an outcome</a>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/outcomeEditor/listing",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n<div class=\"outcome-container panel subpanel",stack1=helpers["if"].call(depth0,depth0&&depth0.readonly,{hash:{},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <div class=\"identifier-label\" title=\"",(helper=helpers.interpretation)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.interpretation,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"label\">",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span>\n <input class=\"identifier\"\n name=\"identifier\"\n value=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n type=\"text\"\n placeholder=\"e.g. CONTENT\"\n data-validate=\"$notEmpty; $qtiOutcomeIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"); $availableVariableIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n </div>\n <span class=\"trigger icon-bin\" title=\"",(helper=helpers.titleDelete)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.titleDelete,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-role=\"delete\"></span>\n <span class=\"trigger icon-edit sidebar-popup-trigger\" data-popup=\"~ .sidebar-popup\" title=\"",(helper=helpers.titleEdit)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.titleEdit,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-role=\"edit\"></span>\n <div class=\"outcome-properties-form\">\n <div class=\"panel\">\n <label for=\"interpretation\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Interpretation",options):helperMissing.call(depth0,"__","Interpretation",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"A human interpretation of the variable's value.",options):helperMissing.call(depth0,"__","A human interpretation of the variable's value.",options)))+"</div>\n <input name=\"interpretation\" value=\"",(helper=helpers.interpretation)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.interpretation,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\">\n </div>\n <div class=\"panel longinterpretation\">\n <label for=\"longInterpretation\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Long interpretation",options):helperMissing.call(depth0,"__","Long interpretation",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"An optional link to an extended interpretation of the outcome variable.",options):helperMissing.call(depth0,"__","An optional link to an extended interpretation of the outcome variable.",options)))+"</div>\n <input name=\"longInterpretation\"\n placeholder=\"https://www.example.com/doc.pdf\"\n value=\"",(helper=helpers.longInterpretation)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.longInterpretation,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n type=\"text\"\n data-validate=\"$isValidUrl;\">\n </div>\n <div class=\"panel externalscored\">\n <label for=\"externalScored\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"External Scored",options):helperMissing.call(depth0,"__","External Scored",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select if you want the outcome declaration to be processed by an external system or human scorer. This is typically the case for items asking candidates to write an essay.",options):helperMissing.call(depth0,"__","Select if you want the outcome declaration to be processed by an external system or human scorer. This is typically the case for items asking candidates to write an essay.",options)))+"</div>\n <select name=\"externalScored\" class=\"select2\" data-has-search=\"false\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.externalScored,{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n </div>\n <div class=\"panel minimum-maximum\">\n <label class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Value",options):helperMissing.call(depth0,"__","Value",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Defines the maximum magnitude of numeric outcome variables, the maximum must be a positive value and the minimum may be negative.",options):helperMissing.call(depth0,"__","Defines the maximum magnitude of numeric outcome variables, the maximum must be a positive value and the minimum may be negative.",options)))+"</div>\n <input name=\"normalMinimum\" value=\"",(helper=helpers.normalMinimum)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.normalMinimum,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-increment=\"1\" type=\"text\" />\n <label for=\"normalMaximum\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"to",options):helperMissing.call(depth0,"__","to",options)))+"</label>\n <input name=\"normalMaximum\" value=\"",(helper=helpers.normalMaximum)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.normalMaximum,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-increment=\"1\" data-min=\"0\" type=\"text\" />\n </div>\n </div>\n</div>\n",buffer}function program2(){return" readonly"}function program4(){return" editable deletable"}function program6(depth0,data){var buffer="",stack1,helper;return buffer+="\n <option value=\""+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n ",buffer}function program7(){return"selected=\"selected\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1;return stack1=helpers.each.call(depth0,depth0&&depth0.outcomes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),stack1||0===stack1?stack1:""})}),define("taoQtiItem/qtiCreator/plugins/panel/outcomeEditor",["jquery","lodash","i18n","core/plugin","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/helper/popup","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/model/variables/OutcomeDeclaration","taoQtiItem/qtiCreator/helper/xmlRenderer","ui/tooltip","tpl!taoQtiItem/qtiCreator/tpl/outcomeEditor/panel","tpl!taoQtiItem/qtiCreator/tpl/outcomeEditor/listing"],function($,_,__,pluginFactory,Element,popup,formElement,OutcomeDeclaration,xmlRenderer,tooltip,panelTpl,listingTpl){'use strict';function getRpUsedVariables(item){var rpXml=xmlRenderer.render(item.responseProcessing),variables=["SCORE","MAXSCORE"],$rp=$(rpXml);return $rp.find("variable,setOutcomeValue").each(function(){var id=$(this).attr("identifier");variables.push(id)}),_.uniq(variables)}function renderListing(item,$outcomeEditorPanel){var rpVariables=getRpUsedVariables(item),outcomesData=_.map(item.outcomes,function(outcome){var readonly=0<=rpVariables.indexOf(outcome.id()),externalScored={none:{label:__("None"),selected:!outcome.attr("externalScored")},human:{label:__("Human"),selected:outcome.attr("externalScored")===externalScoredOptions.human},externalMachine:{label:__("External Machine"),selected:outcome.attr("externalScored")===externalScoredOptions.externalMachine}};return{serial:outcome.serial,identifier:outcome.id(),interpretation:outcome.attr("interpretation"),longInterpretation:outcome.attr("longInterpretation"),externalScored:externalScored,normalMaximum:outcome.attr("normalMaximum"),normalMinimum:outcome.attr("normalMinimum"),titleDelete:readonly?__("Cannot delete a variable currently used in response processing"):__("Delete"),titleEdit:readonly?__("Cannot edit a variable currently used in response processing"):__("Edit"),readonly:readonly}});$outcomeEditorPanel.find(".outcomes").html(listingTpl({outcomes:outcomesData})),formElement.initWidget($outcomeEditorPanel)}function isValidScoringTrait(value){return 0==value%1&&"undefined"!=typeof value}var externalScoredOptions={none:"none",human:"human",externalMachine:"externalMachine"},attachScoringTraitWarningTooltip=function($field){var widgetTooltip;$field.data("$tooltip")||(widgetTooltip=tooltip.warning($field,__("This value does not follow scoring traits guidelines. It won't be compatible with TAO Manual Scoring"),{trigger:"manual",placement:"left-start"}),$field.data("$tooltip",widgetTooltip))},removeScoringTraitWarningTooltip=function($field){$field.data("$tooltip")&&($field.data("$tooltip").dispose(),$field.removeData("$tooltip"))};return pluginFactory({name:"outcomeEditor",init:function(){var item=this.getHost().getItem(),$container=this.getAreaBroker().getContainer(),$responsePanel=$container.find("#sidebar-right-response-properties"),$outcomeEditorPanel;$container.on("initResponseForm".concat(".outcome-editor"),function(){$responsePanel.find(".qti-outcome-editor").remove(),$outcomeEditorPanel=$(panelTpl()),$outcomeEditorPanel.on("click".concat(".outcome-editor"),".editable [data-role=\"edit\"]",function(){var $outcomeContainer=$(this).closest(".outcome-container"),serial=$outcomeContainer.data("serial"),outcomeElement=Element.getElementBySerial(serial),$labelContainer=$outcomeContainer.find(".identifier-label"),$identifierLabel=$labelContainer.find(".label"),$identifierInput=$labelContainer.find(".identifier"),isScoringTraitValidationEnabled=outcomeElement.attr("externalScored")===externalScoredOptions.human;$outcomeContainer.addClass("editing"),$outcomeContainer.removeClass("editable"),$identifierInput.focus(),$identifierInput.val(""),$identifierInput.val(outcomeElement.id());var $outcomeValueContainer=$outcomeContainer.find("div.minimum-maximum"),showScoringTraitWarningOnInvalidValue=function(){isValidScoringTrait(outcomeElement.attr("normalMinimum"))&&isValidScoringTrait(outcomeElement.attr("normalMaximum"))?$outcomeValueContainer.data("$tooltip").hide():$outcomeValueContainer.data("$tooltip").show()};isScoringTraitValidationEnabled&&(attachScoringTraitWarningTooltip($outcomeValueContainer),showScoringTraitWarningOnInvalidValue()),formElement.setChangeCallbacks($outcomeContainer,outcomeElement,_.assign({identifier:function identifier(outcome,value){$identifierLabel.html(value),outcome.id(value)},interpretation:function interpretation(outcome,value){$labelContainer.attr("title",value),outcome.attr("interpretation",value)},longInterpretation:function longInterpretation(outcome,value){$labelContainer.attr("title",value),outcome.attr("longInterpretation",value)},externalScored:function externalScored(outcome,value){isScoringTraitValidationEnabled=value===externalScoredOptions.human,value===externalScoredOptions.human?(attachScoringTraitWarningTooltip($outcomeValueContainer),showScoringTraitWarningOnInvalidValue()):removeScoringTraitWarningTooltip($outcomeValueContainer),value===externalScoredOptions.none?outcome.removeAttr("externalScored"):outcome.attr("externalScored",value)}},formElement.getMinMaxAttributeCallbacks("normalMinimum","normalMaximum",{allowNull:!0,floatVal:!0,callback:function callback(outcome,value,attr){isScoringTraitValidationEnabled&&showScoringTraitWarningOnInvalidValue(),isNaN(value)?outcome.removeAttr(attr):(value=Math.round(value),outcome.attr(attr,value),$outcomeValueContainer.find("[name=\"".concat(attr,"\"]")).val(value),"normalMinimum"===attr&&outcome.attr("normalMaximum")<value?(outcome.attr("normalMaximum",value),$outcomeValueContainer.find("[name=\"normalMaximum\"]").val(value)):"normalMaximum"==attr&&outcome.attr("normalMinimum")>value&&(outcome.attr("normalMinimum",value),$outcomeValueContainer.find("[name=\"normalMinimum\"]").val(value)))}})),{saveInvalid:!0,validateOnInit:!0})}).on("click".concat(".outcome-editor"),".editing [data-role=\"edit\"]",function(){var $outcomeContainer=$(this).closest(".outcome-container");$outcomeContainer.removeClass("editing"),$outcomeContainer.addClass("editable"),formElement.removeChangeCallback($outcomeContainer)}).on("click".concat(".outcome-editor"),".deletable [data-role=\"delete\"]",function(){var $outcomeContainer=$(this).closest(".outcome-container");$outcomeContainer.remove(),item.remove("outcomes",$outcomeContainer.data("serial"))}).on("click".concat(".outcome-editor"),".adder",function(){var newOutcome=new OutcomeDeclaration({cardinality:"single",baseType:"float",normalMinimum:0,normalMaximum:1});item.addOutcomeDeclaration(newOutcome),newOutcome.buildIdentifier("OUTCOME"),renderListing(item,$outcomeEditorPanel)}),$responsePanel.append($outcomeEditorPanel),renderListing(item,$outcomeEditorPanel)})}})}),define("taoQtiItem/qtiCreator/plugins/loader",["core/pluginLoader","taoQtiItem/qtiCreator/plugins/menu/save","taoQtiItem/qtiCreator/plugins/menu/preview","taoQtiItem/qtiCreator/plugins/menu/print","taoQtiItem/qtiCreator/plugins/content/title","taoQtiItem/qtiCreator/plugins/content/changeTracker","taoQtiItem/qtiCreator/plugins/panel/outcomeEditor"],function(pluginLoader,save,preview,print,title,changeTracker,outcomeEditor){'use strict';return pluginLoader({menu:[save,preview,print],content:[title,changeTracker],panel:[outcomeEditor]})}),define("taoQtiItem/controller/creator/index",["jquery","lodash","module","core/logger","core/promise","ui/feedback","layout/loading-bar","taoQtiItem/qtiCreator/itemCreator","taoQtiItem/qtiCreator/editor/areaBroker","taoQtiItem/qtiCreator/plugins/loader"],function($,_,module,loggerFactory,Promise,feedback,loadingBar,itemCreatorFactory,areaBrokerFactory,pluginLoader){'use strict';var loadAreaBroker=function(){var $container=$("#item-editor-scope");return areaBrokerFactory($container,{menu:$(".menu",$container),menuLeft:$(".menu-left",$container),menuRight:$(".menu-right",$container),contentCreatorPanel:$("#item-editor-panel",$container),editorBar:$("#item-editor-panel .item-editor-bar",$container),title:$("#item-editor-panel .item-editor-bar h1",$container),toolbar:$("#item-editor-panel .item-editor-bar #toolbar-top",$container),interactionPanel:$("#item-editor-interaction-bar",$container),propertyPanel:$("#item-editor-item-widget-bar",$container),itemPanel:$("#item-editor-scroll-inner",$container),itemPropertyPanel:$("#sidebar-right-item-properties",$container),itemStylePanel:$("#item-style-editor-bar",$container),modalContainer:$("#modal-container",$container),elementPropertyPanel:$("#item-editor-body-element-property-bar .panel",$container)})};return{start:function start(){var config=module.config(),logger=loggerFactory("controller/creator"),reportError=function(err){loadingBar.stop(),logger.error(err),err instanceof Error&&feedback().error(err.message)};loadingBar.start(),config&&(config.plugins&&(config.properties.allowCustomTemplate=config.plugins.some(function(_ref9){var name=_ref9.name;return"xmlResponseProcessing"===name}),_.forEach(config.plugins,function(plugin){plugin&&plugin.module&&pluginLoader.add(plugin)})),config.contextPlugins&&_.forEach(config.contextPlugins,function(plugin){plugin&&plugin.module&&(plugin.exclude?pluginLoader.remove(plugin.module):pluginLoader.add(plugin))})),pluginLoader.load().then(function(){itemCreatorFactory(config,loadAreaBroker(),pluginLoader.getPlugins()).on("error",reportError).on("success",function(message){return feedback().success(message)}).on("init",function(){this.render()}).on("ready",function(){return loadingBar.stop()}).init()}).catch(reportError)}}}),define("taoQtiItem/controller/routes",[],function(){'use strict';return{QtiPreview:{actions:{index:"taoItems/controller/preview/itemRunner"}},QtiCreator:{actions:{index:"controller/creator/index"}}}}),define("taoQtiItem/mathRenderer/mathRenderer",["mathJax"],function(MathJax){return{render:function($container){$container.find("math").each(function(){var $math=$(this);$math.wrap($("<span>",{class:"math-renderer"}));var $wrap=$math.parent(".math-renderer");MathJax.Hub.Queue(["Typeset",MathJax.Hub,$wrap[0]])})}}}),define("taoQtiItem/portableElementRegistry/provider/localManifestProvider",["lodash","context","core/promise"],function(_,context,Promise){'use strict';function setPortableElementPrefix(obj,prefix){var ret;return _.isArray(obj)?ret=_.map(obj,function(v){return setPortableElementPrefix(v,prefix)}):_.isPlainObject(obj)?(ret={},_.forIn(obj,function(v,k){ret[k]=setPortableElementPrefix(v,prefix)})):_.isString(obj)&&(ret=obj.replace("./",prefix+"/")),ret}function useSource(manifest){var runtimeModules,runtimeSrc;return"IMSPCI"===manifest.model?(runtimeModules=(manifest.runtime||{}).modules,runtimeSrc=(manifest.runtime||{}).src||[],runtimeSrc.length&&_.forOwn(runtimeModules,function(allModulesFiles,moduleKey){moduleKey.indexOf(".min")===moduleKey.length-4&&(runtimeModules[moduleKey]=allModulesFiles.map(function(filePath){return filePath.replace(".min.js",".js")}))})):(manifest.runtime&&_.isArray(manifest.runtime.src)&&(delete manifest.runtime.hook,manifest.runtime.libraries=manifest.runtime.src),manifest.creator&&_.isArray(manifest.creator.src)&&(delete manifest.creator.hook,manifest.creator.libraries=manifest.creator.src)),manifest}var _portableElementManifests={},_registry={};return{addManifestPath:function(id,pathToManifest){return _portableElementManifests[id]=pathToManifest,this},getModuleName:function(){return"taoQtiItem/portableElementRegistry/provider/localManifestProvider"},load:function(){return new Promise(function(resolve,reject){var _requiredManifests=_.map(_portableElementManifests,function(manifest){return"json!"+manifest});require(_requiredManifests,function(){var ok=!0;_.each([].slice.call(arguments),function(manifest){var id;if(manifest&&manifest.typeIdentifier){if(id=manifest.typeIdentifier,!_portableElementManifests[id])return reject("typeIdentifier mismatch"),ok=!1,!1;manifest=useSource(manifest),manifest.baseUrl=window.location.origin+"/"+_portableElementManifests[id].replace(/^([a-zA-Z]*)\/(.*)\/([a-zA-Z]*)(Creator.json$)/,"$1/views/js/$2"),_registry[id]=[setPortableElementPrefix(manifest,id)]}}),ok&&resolve(_registry)},reject)})}}}),define("taoQtiItem/portableElementRegistry/provider/sideLoadingProviderFactory",[],function(){'use strict';return function(portableElements){var _registry=portableElements;return{add:function(id,portableElement){return _registry[id]=portableElement,this},load:function(){return _registry}}}}),define("taoQtiItem/qtiCommonRenderer/helpers/ckConfigurator",["ui/ckeditor/ckConfigurator"],function(ckConfigurator$1){'use strict';ckConfigurator$1=ckConfigurator$1&&Object.prototype.hasOwnProperty.call(ckConfigurator$1,"default")?ckConfigurator$1["default"]:ckConfigurator$1;var getConfig=function(editor,toolbarType,options){return options=options||{},options.underline=!0,ckConfigurator$1.getConfig(editor,toolbarType,options)};return{getConfig:getConfig}}),define("taoQtiItem/qtiCommonRenderer/helpers/Graphic",["jquery","lodash","raphael","scale.raphael"],function($,_,raphael,scaleRaphael){'use strict';var _Mathround=Math.round,_Mathfloor2=Math.floor;$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,raphael=raphael&&Object.prototype.hasOwnProperty.call(raphael,"default")?raphael["default"]:raphael,scaleRaphael=scaleRaphael&&Object.prototype.hasOwnProperty.call(scaleRaphael,"default")?scaleRaphael["default"]:scaleRaphael;var gstyle={basic:{stroke:"#8D949E","stroke-width":2,"stroke-dasharray":"","stroke-linejoin":"round",fill:"#cccccc","fill-opacity":.5,cursor:"pointer"},hover:{stroke:"#3E7DA7",fill:"#0E5D91","fill-opacity":.3},selectable:{"stroke-dasharray":"-",stroke:"#3E7DA7",fill:"#cccccc","fill-opacity":.5},active:{stroke:"#3E7DA7","stroke-dasharray":"",fill:"#0E5D91","fill-opacity":.5},error:{stroke:"#C74155","stroke-dasharray":"","fill-opacity":.5,fill:"#661728"},success:{stroke:"#C74155","stroke-dasharray":"",fill:"#0E914B","fill-opacity":.5},layer:{fill:"#ffffff",opacity:0,cursor:"pointer"},creator:{"fill-opacity":.5,stroke:"#3E7DA7","stroke-dasharray":"",fill:"#0E5D91",cursor:"pointer"},"imageset-rect-stroke":{fill:"#ffffff",stroke:"#666666","stroke-width":1,"stroke-linejoin":"round",cursor:"pointer"},"imageset-rect-no-stroke":{fill:"#ffffff",stroke:"#ffffff","stroke-width":2,"stroke-linejoin":"round",cursor:"pointer"},"imageset-img":{cursor:"pointer"},"order-text":{fill:"#ffffff",stroke:"#000000","stroke-width":.7,"font-family":"sans-serif","font-weight":"bold","font-size":22,cursor:"pointer"},"score-text-default":{stroke:"#444444","stroke-width":.5,"font-family":"sans-serif","font-weight":"normal","font-size":20,cursor:"pointer"},"score-text":{stroke:"#000000","stroke-width":.5,"font-family":"sans-serif","font-weight":"normal","font-size":20,cursor:"pointer"},"small-text":{stroke:"#000000","stroke-width":.5,"font-family":"sans-serif","font-weight":"normal","font-size":16,cursor:"pointer"},"layer-pos-text":{stroke:"#333","stroke-width":.5,"font-family":"sans-serif","font-weight":"normal","font-size":14},target:{path:"m 18,8.4143672 -1.882582,0 C 15.801891,4.9747852 13.071059,2.2344961 9.63508,1.9026738 L 9.63508,0 8.2305176,0 l 0,1.9026387 C 4.7947148,2.2343027 2.0637246,4.9746621 1.7481973,8.4143672 l -1.7481973,0 0,1.4045625 1.754877,0 c 0.3460429,3.4066753 3.0632871,6.1119843 6.4756406,6.4413813 l 0,1.739689 1.4045624,0 0,-1.739725 c 3.412547,-0.329537 6.129633,-3.034793 6.475641,-6.4413453 l 1.889279,0 z m -8.36492,6.5188648 0,-4.064673 -1.4045624,0 0,4.063882 C 5.5511016,14.612555 3.4232695,12.494619 3.0864551,9.8189297 l 4.0449512,0 0,-1.4045625 -4.0546368,0 C 3.3788672,5.6984941 5.5228887,3.5393379 8.2305176,3.2161113 l 0,3.9153125 1.4045624,0 0,-3.9160859 c 2.711162,0.3203965 4.858576,2.4808887 5.160955,5.1990293 l -3.927441,0 0,1.4045625 3.917773,0 C 14.449289,12.496957 12.318363,14.616158 9.63508,14.933232 z",fill:"#0E914B",width:1,"stroke-width":0,cursor:"pointer"},"target-hover":{fill:"#3E7DA7","fill-opacity":1},"target-success":{fill:"#0E914B","fill-opacity":1},assoc:{"stroke-width":2,"stroke-linecap":"round",cursor:"pointer"},"assoc-layer":{"stroke-width":12,cursor:"pointer","stroke-opacity":0},"assoc-bullet":{fill:"#000000"},close:{path:"m 8.9997236,18.000001 c -4.9703918,0 -8.99972284217367,-4.02901 -8.99972284217367,-9 C 7.5782633e-7,4.029011 4.0293108,9.8531742e-7 8.9997236,9.8531742e-7 13.970691,9.8531742e-7 18.000001,4.029011 18.000001,9.000001 c 0,4.97099 -4.02931,9 -9.0002774,9 z m 0.0045,-16.37151 c -4.06191,0 -7.35492,3.29635 -7.35492,7.36251 0,4.06562 3.292989,7.36255 7.35492,7.36255 4.0630384,0 7.3554334,-3.29693 7.3554334,-7.36255 0,-4.06614 -3.292969,-7.36251 -7.3554334,-7.36251 v 0 z m 3.1314894,9.31167 -1.953823,-1.94014 1.953843,-1.94018 c 0.08964,-0.089 0.134622,-0.19099 0.135073,-0.30584 4.31e-4,-0.11488 -0.04383,-0.21712 -0.132838,-0.30681 l -0.54267,-0.54685 c -0.08898,-0.0897 -0.190903,-0.13473 -0.305719,-0.13514 -0.114837,-4.4e-4 -0.217064,0.0439 -0.306703,0.1329 l -1.9623724,1.94865 -1.962395,-1.94865 c -0.08964,-0.089 -0.191845,-0.13336 -0.306702,-0.1329 -0.114837,4.3e-4 -0.216736,0.0455 -0.305719,0.13514 l -0.54265,0.54685 c -0.08902,0.0897 -0.133269,0.19193 -0.132838,0.30681 4.3e-4,0.11485 0.04543,0.21681 0.135073,0.30584 l 1.953823,1.94018 -1.953782,1.94014 c -0.0896,0.089 -0.134684,0.19094 -0.135114,0.3058 -4.31e-4,0.11486 0.04386,0.21716 0.132838,0.30681 l 0.542671,0.54687 c 0.08896,0.0897 0.190923,0.13467 0.305718,0.13516 0.114857,3.9e-4 0.217105,-0.0439 0.306724,-0.13288 l 1.962332,-1.94863 1.9623324,1.94863 c 0.08962,0.089 0.191886,0.13323 0.306744,0.13288 0.114836,-4.5e-4 0.216736,-0.0455 0.305698,-0.13516 l 0.542691,-0.54687 c 0.089,-0.0897 0.133227,-0.19193 0.132838,-0.30681 -3.9e-4,-0.1149 -0.0455,-0.21683 -0.135073,-0.3058 z",fill:"#0E5D91",width:1,opacity:0,"stroke-width":0,cursor:"pointer"},"close-bg":{fill:"#ffffff",stroke:"none",cursor:"pointer",opacity:0},"touch-circle":{fill:"none",stroke:"#3E7DA7","stroke-width":2}},shapeMap={default:"rect",poly:"path"},coordsValidator={rect:4,ellipse:4,circle:3,poly:6,default:0},qti2raphCoordsMapper={rect:function rect(coords){return[coords[0],coords[1],coords[2]-coords[0],coords[3]-coords[1]]},default:function _default(paper){return[0,0,paper.width,paper.height]},poly:function poly(coords){var size=coords.length,a;for(coords[0]!==coords[size-2]&&coords[1]!==coords[size-1]&&(coords.push(coords[0]),coords.push(coords[1])),coords[0]="M"+coords[0],a=1;a<size;a++)0==a%2&&(coords[a]="L"+coords[a]);return[coords.join(" ")]}},raph2qtiCoordsMapper={rect:function rect(attr){return[attr.x,attr.y,attr.x+attr.width,attr.y+attr.height]},circle:function circle(attr){return[attr.cx,attr.cy,attr.r]},ellipse:function ellipse(attr){return[attr.cx,attr.cy,attr.rx,attr.ry]},default:function _default(attr){return this.rect(attr)},path:function path(attr){var poly=[],i;if(_.isArray(attr.path))for(i=1;i<attr.path.length;i++)3===attr.path[i].length&&(poly.push(attr.path[i][1]),poly.push(attr.path[i][2]));return poly}};return{_style:gstyle,setStyle:function setStyle(element,name){element&&gstyle[name]&&element.attr(gstyle[name])},responsivePaper:function responsivePaper(id,serial,options){function resizePaper(e,givenWidth){var diff,maxWidth,containerWidth,containerHeight,factor;e&&e.stopPropagation(),diff=$editor.outerWidth()-$editor.width()+($container.outerWidth()-$container.width())+1,maxWidth=$body.width(),containerWidth=$container.innerWidth(),(0<containerWidth||0<givenWidth)&&(givenWidth<containerWidth&&givenWidth<maxWidth?containerWidth=givenWidth-diff:containerWidth>maxWidth?containerWidth=maxWidth-diff:containerWidth-=diff,factor=containerWidth/imgWidth,containerHeight=imgHeight*factor,0<containerWidth&&paper.changeSize(containerWidth,containerHeight,!1,!1),"function"==typeof options.resize&&options.resize(containerWidth,factor),$container.trigger("resized.qti-widget"))}var $container=options.container||$("#"+id).parent(),$editor=$(".image-editor",$container),$body=$container.closest(".qti-itemBody"),resizer=_.throttle(resizePaper,10),imgWidth=options.width||$container.innerWidth(),imgHeight=options.height||$container.innerHeight(),paper,image;return paper=scaleRaphael(id,imgWidth,imgHeight),image=paper.image(options.img,0,0,imgWidth,imgHeight),image.id=options.imgId||image.id,paper.setViewBox(0,0,imgWidth,imgHeight),resizer(),$(image.node).attr("externalResourcesRequired","true").on("load",resizer),"SVG"===raphael.type?($(window).on("resize.qti-widget."+serial,resizer),$container.on("resize.qti-widget."+serial,resizer),$(document).on("customcssloaded.styleeditor",resizer)):($container.find(".main-image-box").width(imgWidth),"function"==typeof options.resize&&options.resize(imgWidth,1)),paper},createElement:function createElement(paper,type,coords,options){var self=this,shaper=shapeMap[type]?paper[shapeMap[type]]:paper[type],shapeCoords=!1===options.qtiCoords?coords:self.raphaelCoords(paper,type,coords),element;if("function"==typeof shaper)element=shaper.apply(paper,shapeCoords),element&&(options.id&&(element.id=options.id),options.title&&element.attr("title",options.title),element.attr(gstyle[options.style||"basic"]).toFront(),$(element.node).removeAttr("stroke-dasharray"),!1!==options.hover&&element.hover(function(){element.flashing||self.updateElementState(this,"hover")},function(){element.flashing||self.updateElementState(this,this.active?"active":this.selectable?"selectable":"basic")}),!1!==options.touchEffect&&element.touchstart(function(){self.createTouchCircle(paper,element.getBBox())}));else throw new Error("Unable to find method "+type+" on paper");return element},createTarget:function(paper,options){var baseSize,count,factor,half,hover,layer,point,self,tBBox,targetSize,x,y,target;return options=options||{},self=this,point=options.point||{x:0,y:0},factor=0===paper.w?1:paper.width/paper.w,hover="undefined"==typeof options.hover||!!options.hover,baseSize=18,half=baseSize/2,x=point.x-half,y=point.y-half,targetSize=0===factor?2:2/factor,target=paper.path(gstyle.target.path).transform("t"+x+","+y+"s"+targetSize).attr(gstyle.target).attr("title",_("Click again to remove")),options.id?target.id=options.id:(count=0,paper.forEach(function(element){element.data("target")&&count++}),target.id="target-"+count),tBBox=target.getBBox(),layer=paper.rect(tBBox.x,tBBox.y,tBBox.width,tBBox.height).attr(gstyle.layer).click(function(){var id=target.id,p=this.data("point");_.isFunction(options.select)&&options.select(target,p,this),_.isFunction(options.remove)&&(this.remove(),target.remove(),options.remove(id,p))}),hover&&layer.hover(function(){target.flashing||self.setStyle(target,"target-hover")},function(){target.flashing||self.setStyle(target,"target-success")}),layer.id="layer-"+target.id,layer.data("point",point),target.data("target",point),_.isFunction(options.create)&&options.create(target),target},raphaelCoords:function(paper,type,coords){var shapeCoords;if(_.isString(coords)&&(coords=_.map(coords.split(","),function(coord){return parseInt(coord,10)})),!_.isArray(coords)||coords.length<coordsValidator[type])throw new Error("Invalid coords "+JSON.stringify(coords)+" for type "+type);return shapeCoords="rect"===type?qti2raphCoordsMapper.rect(coords):"default"===type?qti2raphCoordsMapper["default"].call(null,paper):"poly"===type?qti2raphCoordsMapper.poly(coords):coords,shapeCoords},qtiCoords:function(element){var mapper=raph2qtiCoordsMapper[element.type],result="";return _.isFunction(mapper)&&(result=_.map(mapper.call(raph2qtiCoordsMapper,element.attr()),function(coord){return _.parseInt(coord)}).join(",")),result},createTouchCircle:function createTouchCircle(paper,bbox){var radius=bbox.width>bbox.height?bbox.width:bbox.height,tCircle=paper.circle(bbox.x+bbox.width/2,bbox.y+bbox.height/2,radius);tCircle.attr(gstyle["touch-circle"]),_.defer(function(){tCircle.animate({r:radius+5,opacity:.7},300,function(){tCircle.remove()})})},createText:function createText(paper,options){var top=options.top||0,left=options.left||0,content=options.content||"",style=options.style||"small-text",title=options.title||"",factor=1,fontSize,scaledFontSize,text;return paper.width&&paper.w&&(factor=paper.width/paper.w),text=paper.text(left,top,content).toFront(),options.id&&(text.id=options.id),options.hide&&text.hide(),text.attr(gstyle[style]),"undefined"!=typeof factor&&1!==factor&&(fontSize=parseInt(text.attr("font-size"),10),scaledFontSize=_Mathfloor2(fontSize/factor)+1,text.attr("font-size",scaledFontSize)),title&&this.updateTitle(text,title),text},createShapeText:function createShapeText(paper,shape,options){var self=this,bbox=shape.getBBox(),text=this.createText(paper,_.merge({left:bbox.x+bbox.width/2,top:bbox.y+bbox.height/2},options));return options.shapeClick&&text.click(function(){self.trigger(shape,"click")}),text},createBorderedImage:function createBorderedImage(paper,options){var padding=0<=options.padding?options.padding:6,halfPad=padding/2,rx=options.left,ry=options.top,rw=options.width+padding,rh=options.height+padding,ix=options.left+halfPad,iy=options.top+halfPad,iw=options.width,ih=options.height,set=paper.set(),rect=paper.rect(rx,ry,rw,rh).attr(options.border?gstyle["imageset-rect-stroke"]:gstyle["imageset-rect-no-stroke"]),image=paper.image(options.url,ix,iy,iw,ih).attr(gstyle["imageset-img"]);return options.shadow&&set.push(rect.glow({width:2,offsetx:1,offsety:1})),set.push(rect,image),set.move=function(x,y,duration){var animation=raphael.animation({x:x,y:y},duration||400),elt=rect.animate(animation);return image.animateWith(elt,animation,{x:x+halfPad,y:y+halfPad},duration||400),set},set},updateElementState:function updateElementState(element,state,title){element&&element.animate&&(element.animate(gstyle[state],200,"linear",function(){element.attr(gstyle[state]),$(element.node).removeAttr("stroke-dasharray")}),title&&this.updateTitle(element,title))},updateTitle:function updateTitle(element,title){element&&element.node&&(_.forEach(element.node.children,function(child){"title"===child.nodeName.toLowerCase()&&element.node.removeChild(child)}),element.attr("title",title))},highlightError:function highlightError(element,restoredState){var self=this;element&&(element.flashing=!0,self.updateElementState(element,"error"),_.delay(function(){self.updateElementState(element,restoredState||"basic"),element.flashing=!1},800))},trigger:function trigger(element,event){var evt=_.where(element.events,{name:event});evt.length&&evt[0]&&"function"==typeof evt[0].f&&evt[0].f.apply(element,Array.prototype.slice.call(arguments,2))},getPoint:function(event,paper,$container){var point=this.clickPoint($container,event),rect=$container.get(0).getBoundingClientRect(),factor=paper.w/rect.width;return point.x=_Mathround(point.x*factor),point.y=_Mathround(point.y*factor),point},position:function position($container,paper){var pw=parseInt(paper.w||paper.width,10),cw=parseInt($container.width(),10),ph=parseInt(paper.w||paper.width,10),ch=parseInt($container.height(),10);return{left:(cw-pw)/2,top:(ch-ph)/2}},clickPoint:function clickPoint($container,event){var offset=$container.offset(),x,y;return event.pageX||event.pageY?(x=event.pageX-offset.left,y=event.pageY-offset.top):(event.clientX||event.clientY)&&(x=event.clientX+document.body.scrollLeft+document.documentElement.scrollLeft-offset.left,y=event.clientY+document.body.scrollTop+document.documentElement.scrollTop-offset.top),{x:x,y:y}}}}),define("taoQtiItem/qtiCommonRenderer/helpers/instructions/Instruction",["lodash","taoQtiItem/qtiItem/helper/util","handlebars","i18n","lib/dompurify/purify"],function(_,util,Handlebars,__,DOMPurify){'use strict';function instructionTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,util=util&&Object.prototype.hasOwnProperty.call(util,"default")?util["default"]:util,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div id=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" class=\"small feedback-info item-instruction\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <span class=\"icon-info icon\"></span><span class=\"instruction-message\">",(helper=helpers.message)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.message,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span>\n</div>",buffer}),_notificationLevels=["info","warning","error","success"],Instruction=function(interaction,message,callback){this.interaction=interaction,this.defaultMessage=message||"",this.currentMessage="",this.level="info",this.serial=util.buildSerial("instruction_"),this.callback=callback,this.$dom=null,this.state=!1};return Instruction.isValidLevel=function(level){return 0<=_.indexOf(_notificationLevels,level)},Instruction.prototype.setState=function(state){this.state=state},Instruction.prototype.checkState=function(state){return this.state===state},Instruction.prototype.getId=function(){return this.serial},Instruction.prototype.create=function($container){$container.append(instructionTpl({message:this.defaultMessage,serial:this.serial})),this.$dom=$container.find("#"+this.serial)},Instruction.prototype.update=function(options){var level=options&&options.level?options.level:"",message=options&&options.message?options.message:"",timeout=options&&options.timeout?options.timeout:0,start=options&&"function"==typeof options.start?options.start:null,stop=options&&"function"==typeof options.stop?options.stop:null;if(level&&Instruction.isValidLevel(level)&&(this.$dom.removeClass("feedback-"+this.level).addClass("feedback-"+level),this.$dom.find(".icon").removeClass("icon-"+this.level).addClass("icon-"+level),this.level=level),message&&(this.$dom.find(".instruction-message").html(message),this.currentMessage=message),timeout){var _this=this;start&&start.call(_this),_this.timer=setTimeout(function(){stop&&stop.call(_this),_this.timer=null},timeout)}},Instruction.prototype.setLevel=function(level,timeout){var options={level:level};timeout&&(options.timeout=parseInt(timeout),options.stop=function(){this.setLevel("info")}),this.update(options)},Instruction.prototype.getLevel=function(){return this.level},Instruction.prototype.setMessage=function(message,timeout){this.update({message:message,timeout:timeout})},Instruction.prototype.reset=function(){this.update({level:"info",message:this.defaultMessage}),this.state=!1},Instruction.prototype.validate=function(data){"function"==typeof this.callback&&this.callback.call(this,data)},Instruction}),define("taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager",["lodash","jquery","i18n","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/Instruction","handlebars","lib/dompurify/purify"],function(_,$$1,__,containerHelper,Instruction,Handlebars,DOMPurify){'use strict';function notifTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,Instruction=Instruction&&Object.prototype.hasOwnProperty.call(Instruction,"default")?Instruction["default"]:Instruction,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"small feedback-",(helper=helpers.level)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.level,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+" item-notification\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <span class=\"icon-",(helper=helpers.level)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.level,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"></span><span class=\"feedback-message\">",(helper=helpers.message)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.message,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span>\n <span title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove Message",options):helperMissing.call(depth0,"__","Remove Message",options)))+"\" class=\"icon-close close-trigger\"></span>\n</div>\n",buffer}),_instructions={};return{validateInstructions:function validateInstructions(element,data){var serial=element.getSerial();_instructions[serial]&&_.each(_instructions[serial],function(instruction){instruction.validate(data||{})})},appendInstruction:function appendInstruction(element,message,validateCallback){var serial=element.getSerial(),instruction=new Instruction(element,message,validateCallback);return _instructions[serial]||(_instructions[serial]={}),_instructions[serial][instruction.getId()]=instruction,instruction.create($$1(".instruction-container",containerHelper.get(element))),instruction},removeInstructions:function removeInstructions(element){_instructions[element.getSerial()]={},containerHelper.get(element).find(".instruction-container").empty()},resetInstructions:function resetInstructions(element){var serial=element.getSerial();_instructions[serial]&&_.each(_instructions[serial],function(instruction){instruction.reset()})},minMaxChoiceInstructions:function minMaxChoiceInstructions(interaction,options){var self=this,min=options.min||0,max=options.max||0,getResponse=options.getResponse,onError=options.onError||_.noop(),choiceCount=!1!==options.choiceCount&&_.size(interaction.getChoices()),minInstructionSet=!1,msg;if(!_.isFunction(getResponse))throw"invalid parameter getResponse";0<max&&(!1===choiceCount||max<choiceCount)&&(max===min?(minInstructionSet=!0,msg=1>=max?__("You must select exactly %d choice",max):__("You must select exactly %d choices",max),self.appendInstruction(interaction,msg,function(data){getResponse(interaction).length>=max?(this.setLevel("success"),this.checkState("fulfilled")&&this.update({level:"warning",message:__("Maximum choices reached"),timeout:2e3,start:function start(){onError(data)},stop:function stop(){this.update({level:"success",message:msg})}}),this.setState("fulfilled")):this.reset()})):max>min&&(msg=1>=max?__("You can select maximum %d choice",max):__("You can select maximum %d choices",max),self.appendInstruction(interaction,msg,function(data){getResponse(interaction).length>=max?(this.setLevel("success"),this.setMessage(__("Maximum choices reached")),this.checkState("fulfilled")&&this.update({level:"warning",timeout:2e3,start:function start(){onError(data)},stop:function stop(){this.setLevel("info")}}),this.setState("fulfilled")):this.reset()}))),!minInstructionSet&&0<min&&(!1===choiceCount||min<choiceCount)&&(msg=1>=min?__("You must select at least %d choice",min):__("You must select at least %d choices",min),self.appendInstruction(interaction,msg,function(){getResponse(interaction).length>=min?this.setLevel("success"):this.reset()}))},appendNotification:function appendNotification(element,message,level){if(level=level||"info",Instruction.isValidLevel(level)){var $container=containerHelper.get(element);$container.find(".notification-container").prepend(notifTpl({level:level,message:message}));var $notif=$container.find(".item-notification:first"),_remove=function(){$notif.fadeOut()};return $notif.find(".close-trigger").on("click",_remove),setTimeout(_remove,2e3),$notif}},removeNotifications:function removeNotifications(element){containerHelper.get(element).find(".item-notification").remove()}}}),define("taoQtiItem/qtiCommonRenderer/helpers/itemStylesheetHandler",["jquery","lodash"],function($,_){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;var informLoaded=_.throttle(function(){$(document).trigger("customcssloaded.styleeditor",[{}])},10,{leading:!1}),attach=function(stylesheets){var $head=$("head");$head.length||($head=$("body")),_(stylesheets).forEach(function(stylesheet){var $link,href;stylesheet.attr("href")&&($link=$(stylesheet.render()),href=$link.attr("href"),$link.removeAttr("href").attr("href",href),$link.one("load",informLoaded).appendTo($head))})},detach=function(stylesheets){_(stylesheets).forEach(function(stylesheet){stylesheet.serial&&$("link[data-serial=\""+stylesheet.serial+"\"]").remove()})};return{attach:attach,detach:detach}}),define("taoQtiItem/qtiCommonRenderer/helpers/patternMask",[],function(){'use strict';return{parsePattern:function(pattern,type){if(pattern===void 0||null===pattern)return null;if("words"===type){var result=pattern.match(/\^\(\?\:\(\?\:\[\^\\s\\:\\!\\\?\\\;\\\…\\\€\]\+\)\[\\s\\:\\!\\\?\\;\\\…\\\€\]\*\)\{\d+\,(\d+)\}\$/);return null!==result&&1<result.length?result[1]:null}if("chars"===type){var result=pattern.match(/\^\[\\s\\S\]\{\d+\,(\d+)\}\$/);return null!==result&&1<result.length?result[1]:null}return null},createMaxWordPattern:function(max){return"^(?:(?:[^\\s\\:\\!\\?\\;\\\u2026\\\u20AC]+)[\\s\\:\\!\\?\\;\\\u2026\\\u20AC]*){0,"+max.toString()+"}$"},createMaxCharPattern:function(max){return"^[\\s\\S]{0,"+max.toString()+"}$"}}}),define("taoQtiItem/qtiCommonRenderer/helpers/PciPrettyPrint",["lodash"],function(_){'use strict';function printBase(value,withType){var print="",base=value.base;if(withType="undefined"==typeof withType||withType,base)return _.forIn(_formatters,function(formatter,baseType){if(void 0!==base[baseType])return print+=withType?"("+baseType+") ":"",print+=formatter(base[baseType]),!1}),print}function printList(value,withType){var print="",list=value.list;if(withType="undefined"==typeof withType||withType,list)return _.forIn(_formatters,function(formatter,baseType){if(void 0!==list[baseType])return print+=withType?"("+baseType+") ":"",print+="[",_.each(list[baseType],function(value){print+=formatter(value)+", "}),_.size(list[baseType])&&(print=print.substring(0,print.length-2)),print+="]",!1}),print}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;var _formatters={boolean:function boolean(value){return value?"true":"false"},integer:function integer(value){return value},float:function float(value){return value},string:function string(value){return""===value?"NULL":"\""+value+"\""},point:function point(value){return"["+value[0]+", "+value[1]+"]"},pair:function pair(value){return"["+value[0]+", "+value[1]+"]"},directedPair:function directedPair(value){return"["+value[0]+", "+value[1]+"]"},duration:function duration(value){return value},file:function file(){return"binary data"},uri:function uri(value){return value},intOrIdentifier:function intOrIdentifier(value){return value},identifier:function identifier(value){return value}};return{printBase:printBase,printList:printList,printRecord:function(value){return value&&value.record?"(record) "+JSON.stringify(value.record):""}}}),define("taoQtiItem/qtiCommonRenderer/helpers/PciResponse",["lodash","taoQtiItem/qtiCommonRenderer/helpers/PciPrettyPrint"],function(_,pciPrettyPrint){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,pciPrettyPrint=pciPrettyPrint&&Object.prototype.hasOwnProperty.call(pciPrettyPrint,"default")?pciPrettyPrint["default"]:pciPrettyPrint;var _qtiModelPciResponseCardinalities={single:"base",multiple:"list",ordered:"list",record:"record"};return{unserialize:function unserialize(response,interaction){var ret=[],responseDeclaration=interaction.getResponseDeclaration(),baseType=responseDeclaration.attr("baseType"),cardinality=responseDeclaration.attr("cardinality"),mappedCardinality;if(_qtiModelPciResponseCardinalities[cardinality]){mappedCardinality=_qtiModelPciResponseCardinalities[cardinality];var responseValues=response[mappedCardinality];if(null===responseValues)ret=[];else if(!_.isObject(responseValues))throw"invalid response cardinality, expected "+cardinality+" ("+mappedCardinality+")";else if(void 0!==responseValues[baseType])ret=responseValues[baseType],ret=_.isArray(ret)?ret:[ret];else throw"invalid response baseType"}else throw"unknown cardinality in the responseDeclaration of the interaction";return ret},serialize:function serialize(responseValues,interaction){if(!_.isArray(responseValues))throw"invalid argument : responseValues must be an Array";var response={},responseDeclaration=interaction.getResponseDeclaration(),baseType=responseDeclaration.attr("baseType"),cardinality=responseDeclaration.attr("cardinality"),mappedCardinality;if(responseValues=_.map(responseValues||[],function(v){return"boolean"===baseType?!0===v||"true"===v:v}),_qtiModelPciResponseCardinalities[cardinality])mappedCardinality=_qtiModelPciResponseCardinalities[cardinality],"base"===mappedCardinality?0===responseValues.length?response.base=null:(response.base={},response.base[baseType]=responseValues[0]):(response[mappedCardinality]={},response[mappedCardinality][baseType]=responseValues);else throw"unknown cardinality in the responseDeclaration of the interaction";return response},isEmpty:function isEmpty(response){return null===response||_.isEmpty(response)||null===response.base||_.isArray(response.list)&&_.isEmpty(response.list)||_.isArray(response.record)&&_.isEmpty(response.record)},prettyPrint:function prettyPrint(response){var print="";if("undefined"!=typeof response.base)print+=pciPrettyPrint.printBase(response,!0);else if("undefined"!=typeof response.list)print+=pciPrettyPrint.printList(response,!0);else if("undefined"!=typeof response.record)print+=pciPrettyPrint.printRecord(response,!0);else throw"Not a valid PCI JSON Response";return print}}}),define("taoQtiItem/qtiCommonRenderer/helpers/PortableElement",[],function(){'use strict';return{fixMarkupMediaSources:function(html,renderer){return html=html||"",html.replace(/(<img[^>]*src=["'])([^"']+)(["'])/gi,function(substr,$1,$2,$3){var resolved=renderer.resolveUrl($2)||$2;return $1+resolved+$3})}}}),define("taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter",["jquery","util/adaptSize","ui/waitForMedia"],function($,_adaptSize){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_adaptSize=_adaptSize&&Object.prototype.hasOwnProperty.call(_adaptSize,"default")?_adaptSize["default"]:_adaptSize;return{adaptSize:function adaptSize(target){var $elements,$container;switch(!0){case"undefined"!=typeof target.$container:$elements=target.$container.find(".add-option, .result-area .target, .choice-area .qti-choice"),$container=target.$container;break;default:$elements=target,$container=$($elements).first().parent();}$container.waitForMedia(function(){_adaptSize.height($elements),document.addEventListener("load",function(e){e.target&&"stylesheet"===e.target.rel&&_adaptSize.height($elements)},!0)})}}}),define("taoQtiItem/qtiCommonRenderer/helpers/uploadMime",["lodash","i18n","core/mimetype/definitions"],function(_,__,mimeTypes){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,mimeTypes=mimeTypes&&Object.prototype.hasOwnProperty.call(mimeTypes,"default")?mimeTypes["default"]:mimeTypes;var uploadMime={getMimeTypes:function(){return mimeTypes.getList(__)},setExpectedTypes:function(interaction,types){var classes=interaction.attr("class")||"";classes=classes.replace(/x-tao-upload-type-[-_a-zA-Z+.0-9]*/g,"").trim(),interaction.attr("class",classes),interaction.removeAttr("type");types&&(1===types.length?"any/kind"!==types[0]&&interaction.attr("type",types[0]):(interaction.attr("class",_.reduce(types,function(acc,selectedType){return acc+" x-tao-upload-type-"+selectedType.replace("/","_")},classes).trim()),interaction.attr("type",types.join(" "))))},getExpectedTypes:function(interaction,includeEquivalents){var equivalents=[],types=[],mimes;return interaction.attr("type")&&(types=interaction.attr("type").split(" ")),!0===includeEquivalents&&(mimes=uploadMime.getMimeTypes(),_.forEach(types,function(mime){var mimeData=_.find(mimes,{mime:mime});mimeData&&_.isArray(mimeData.equivalent)&&(equivalents=_.union(equivalents,mimeData.equivalent))})),_.union(types,equivalents)}};return uploadMime}),define("taoQtiItem/qtiCommonRenderer/renderers/choices/Gap",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<span class=\"qti-choice qti-gap\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\r\n <span data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" class=\"gapmatch-content\">&nbsp;</span>\r\n</span>",buffer}),Gap={qtiClass:"gap",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return Gap}),define("taoQtiItem/qtiCommonRenderer/renderers/choices/GapImg",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+="alt=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.objetLabel),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<li class=\"qti-choice qti-gapImg selectable\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <img src=\""+escapeExpression((stack1=(stack1=(stack1=depth0&&depth0.object,null==stack1||!1===stack1?stack1:stack1.attributes),null==stack1||!1===stack1?stack1:stack1.data),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" \n width=\""+escapeExpression((stack1=(stack1=(stack1=depth0&&depth0.object,null==stack1||!1===stack1?stack1:stack1.attributes),null==stack1||!1===stack1?stack1:stack1.width),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n height=\""+escapeExpression((stack1=(stack1=(stack1=depth0&&depth0.object,null==stack1||!1===stack1?stack1:stack1.attributes),null==stack1||!1===stack1?stack1:stack1.height),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.objectLabel),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n />\n</li>",buffer}),GapImg={qtiClass:"gapImg",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return GapImg}),define("taoQtiItem/qtiCommonRenderer/renderers/choices/GapText",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<li class=\"qti-choice\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</li>",buffer}),GapText={qtiClass:"gapText",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return GapText}),define("taoQtiItem/qtiCommonRenderer/renderers/choices/Hottext",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<span class=\"qti-choice qti-hottext hottext\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\r\n <label class=\"hottext-checkmark\">\r\n <input type=\"checkbox\" value=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\r\n <span class=\"icon-checkbox small\"></span>\r\n </label>\r\n <span class=\"hottext-content\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</span>\r\n</span>",buffer}),Hottext={qtiClass:"hottext",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return Hottext}),define("taoQtiItem/qtiCommonRenderer/renderers/choices/InlineChoice",["lodash","handlebars","i18n","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(_,Handlebars,__,DOMPurify,containerHelper){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<option data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" value=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n</option>",buffer}),InlineChoice={qtiClass:"inlineChoice",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getData:function(choice,data){return data.body=_.unescape(data.body),data}};return InlineChoice}),define("taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleAssociableChoice.AssociateInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<li class=\"qti-choice\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</li>",buffer}),SimpleAssociableChoice_AssociateInteraction={qtiClass:"simpleAssociableChoice.associateInteraction",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return SimpleAssociableChoice_AssociateInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleAssociableChoice.MatchInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<th class=\"qti-choice qti-associableChoice qti-simpleAssociableChoice\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</th>",buffer}),SimpleAssociableChoice_MatchInteraction={qtiClass:"simpleAssociableChoice.matchInteraction",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return SimpleAssociableChoice_MatchInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleChoice.ChoiceInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+="\n <input\n type=\"radio\"\n name=\"response-"+escapeExpression((stack1=(stack1=depth0&&depth0.interaction,null==stack1||!1===stack1?stack1:stack1.serial),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n value=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n tabindex=\"1\"\n >\n <span class=\"icon-radio\"></span>\n ",buffer}function program5(depth0){var buffer="",stack1;return buffer+="\n <input\n type=\"checkbox\"\n name=\"response-"+escapeExpression((stack1=(stack1=depth0&&depth0.interaction,null==stack1||!1===stack1?stack1:stack1.serial),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n value=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n tabindex=\"1\"\n >\n <span class=\"icon-checkbox\"></span>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<li class=\"qti-choice qti-simpleChoice\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <div class=\"pseudo-label-box\">\n <label class=\"real-label\">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.unique,{hash:{},inverse:self.program(5,program5,data),fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </label>\n <div class=\"label-box\">\n <div class=\"label-content clear\" contenteditable=\"false\" id=\"choice-"+escapeExpression((stack1=(stack1=depth0&&depth0.interaction,null==stack1||!1===stack1?stack1:stack1.serial),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <svg class=\"overlay-answer-eliminator\">\n <line x1=\"0\" y1=\"100%\" x2=\"100%\" y2=\"0\"/>\n <line x1=\"0\" y1=\"0\" x2=\"100%\" y2=\"100%\"/>\n </svg>\n </div>\n </div>\n </div>\n <label data-eliminable=\"container\" data-label=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Eliminate",options):helperMissing.call(depth0,"__","Eliminate",options)))+"\">\n <span data-eliminable=\"trigger\" class=\"icon-checkbox\"></span>\n </label>\n</li>\n",buffer}),SimpleChoice_ChoiceInteraction={qtiClass:"simpleChoice.choiceInteraction",getContainer:containerHelper.get,getData:function getData(choice,data){return data.unique=1===parseInt(data.interaction.attributes.maxChoices),data},template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return SimpleChoice_ChoiceInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleChoice.OrderInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<li class=\"qti-choice\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</li>",buffer}),SimpleChoice_OrderInteraction={qtiClass:"simpleChoice.orderInteraction",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return SimpleChoice_OrderInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/Container",["handlebars","i18n","lodash","lib/dompurify/purify"],function(Handlebars,__,_,DOMPurify){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="<div class=\"qti-block\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>",buffer}function program2(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program4(depth0,data){var buffer="",stack1,helper;return(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return stack1=(helper=helpers.equal||depth0&&depth0.equal,options={hash:{},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),data:data},helper?helper.call(depth0,depth0&&depth0.contentModel,"blockStatic",options):helperMissing.call(depth0,"equal",depth0&&depth0.contentModel,"blockStatic",options)),stack1||0===stack1?stack1:""});return{qtiClass:"_container",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}}}),define("taoQtiItem/qtiCommonRenderer/renderers/Img",["ui/waitForMedia","handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(waitForMedia,Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+="class=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program5(depth0){var buffer="",stack1;return buffer+="height=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.height),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",buffer}function program7(depth0){var buffer="",stack1;return buffer+="width=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.width),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",buffer}function program9(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program11(depth0){var buffer="",stack1;return buffer+=" aria-describedby=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-describedby"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program13(depth0){var buffer="",stack1;return buffer+=" aria-hidden=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-hidden"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program15(depth0){var buffer="",stack1;return buffer+=" aria-label=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-label"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program17(depth0){var buffer="",stack1;return buffer+=" aria-labelledby=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-labelledby"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program19(depth0){var buffer="",stack1;return buffer+=" aria-live=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-live"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program21(depth0){var buffer="",stack1;return buffer+=" role=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.role),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<img\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-qti-class=\"img\"\n src=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.src),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n alt=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.alt),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.height),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.width),{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-describedby"]),{hash:{},inverse:self.noop,fn:self.program(11,program11,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-hidden"]),{hash:{},inverse:self.noop,fn:self.program(13,program13,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-label"]),{hash:{},inverse:self.noop,fn:self.program(15,program15,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-labelledby"]),{hash:{},inverse:self.noop,fn:self.program(17,program17,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-live"]),{hash:{},inverse:self.noop,fn:self.program(19,program19,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.role),{hash:{},inverse:self.noop,fn:self.program(21,program21,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n />\n",buffer}),Img={qtiClass:"img",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getContainer:containerHelper.get,render:function(img){return new Promise(function(resolve){containerHelper.get(img).waitForMedia(resolve)})}};return Img}),define("taoQtiItem/qtiCommonRenderer/renderers/Include",["handlebars","i18n","lodash","lib/dompurify/purify"],function(Handlebars,__,_,DOMPurify){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<div class=\"qti-include\" data-href=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.href),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</div>",buffer});return{qtiClass:"include",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}}}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/AssociateInteraction",["jquery","lodash","i18n","ui/hider","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter","interact","ui/interactUtils"],function($$1,_,__,hider,Handlebars,DOMPurify,containerHelper,instructionMgr,pciResponse,sizeAdapter,interact,interactUtils){'use strict';function pairTpl(data,options,asString){var html=Template$1(data,options);return asString||!0?html:$(html)}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,hider=hider&&Object.prototype.hasOwnProperty.call(hider,"default")?hider["default"]:hider,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,sizeAdapter=sizeAdapter&&Object.prototype.hasOwnProperty.call(sizeAdapter,"default")?sizeAdapter["default"]:sizeAdapter,interact=interact&&Object.prototype.hasOwnProperty.call(interact,"default")?interact["default"]:interact,interactUtils=interactUtils&&Object.prototype.hasOwnProperty.call(interactUtils,"default")?interactUtils["default"]:interactUtils;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program9(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<div\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n class=\"qti-interaction qti-blockInteraction qti-associateInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-qti-class=\"associateInteraction\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n>\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <ul class=\"choice-area clearfix none block-listing solid horizontal source\">\n ",options={hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data},(helper=helpers.choices)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.choices,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.choices||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </ul>\n <ul class=\"result-area none target clearfix\">\n </ul>\n <div class=\"notification-container\"></div>\n</div>\n",buffer});Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template$1=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program3(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1;return buffer+="<li class=\"",stack1=helpers["if"].call(depth0,depth0&&depth0.empty,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"hidden incomplete-pair"},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <div class=\"target lft\"></div>\n <div class=\"target rgt\"></div>\n</li>\n",buffer}),setChoice=function(interaction,$choice,$target){var $container=containerHelper.get(interaction),choiceSerial=$choice.data("serial"),usage=$choice.data("usage")||0,choice=interaction.getChoice(choiceSerial);if(!choiceSerial)throw"empty choice serial";usage++,$choice.data("usage",usage);var _setChoice=function(){$target.data("serial",choiceSerial).html($choice.html()).addClass("filled"),!interaction.responseMappingMode&&choice.attr("matchMax")&&usage>=choice.attr("matchMax")&&$choice.addClass("deactivated")};if($target.siblings("div").hasClass("filled")){var $resultArea=$$1(".result-area",$container),$pair=$target.parent(),thisPairSerial=[$target.siblings("div").data("serial"),choiceSerial],$otherRepeatedPair=$$1();$resultArea.children().not($pair).each(function(){var $otherPair=$$1(this).children(".filled");if(2===$otherPair.length){var otherPairSerial=[$$1($otherPair[0]).data("serial"),$$1($otherPair[1]).data("serial")];if(2===_.intersection(thisPairSerial,otherPairSerial).length)return $otherRepeatedPair=$otherPair,!1}}),0===$otherRepeatedPair.length?(_setChoice(),containerHelper.triggerResponseChangeEvent(interaction,{type:"added",$pair:$pair,choices:thisPairSerial}),instructionMgr.validateInstructions(interaction,{choice:$choice,target:$target}),(interaction.responseMappingMode||0===parseInt(interaction.attr("maxAssociations")))&&($pair.removeClass("incomplete-pair"),!$resultArea.children(".incomplete-pair").length&&($resultArea.append(pairTpl({empty:!0})),$resultArea.children(".incomplete-pair").fadeIn(600,function(){hider.show(this)})))):($otherRepeatedPair.css("border","1px solid orange"),$target.html(__("identical pair already exists")).css({color:"orange",border:"1px solid orange"}),setTimeout(function(){$otherRepeatedPair.removeAttr("style"),$target.empty().css({color:"",border:""})},2e3))}else _setChoice()},unsetChoice=function(interaction,$filledChoice,animate,triggerChange){var $container=containerHelper.get(interaction),choiceSerial=$filledChoice.data("serial"),$choice=$container.find(".choice-area [data-serial="+choiceSerial+"]"),usage=$choice.data("usage")||0,$parent=$filledChoice.parent(),$sibling=$container.find(".choice-area [data-serial="+$filledChoice.siblings(".target").data("serial")+"]"),isNumberOfMaxAssociationsZero=0===parseInt(interaction.attr("maxAssociations"));usage--,$choice.data("usage",usage).removeClass("deactivated"),$filledChoice.removeClass("filled").removeData("serial").empty(),interaction.swapping||(!1!==triggerChange&&(containerHelper.triggerResponseChangeEvent(interaction,{type:"removed",$pair:$filledChoice.parent()}),instructionMgr.validateInstructions(interaction,{choice:$choice})),isNumberOfMaxAssociationsZero&&$sibling.data("usage",$sibling.data("usage")-1).removeClass("deactivated"),!$choice.siblings("div").hasClass("filled")&&(isNumberOfMaxAssociationsZero||interaction.responseMappingMode)&&!$parent.hasClass("incomplete-pair")&&(animate?$parent.addClass("removing").fadeOut(500,function(){$$1(this).remove()}):$parent.remove()))},getChoice=function(interaction,identifier){var $container=containerHelper.get(interaction),choice=interaction.getChoiceByIdentifier(identifier);if(!choice)throw new Error("cannot find a choice with the identifier : "+identifier);return $$1(".choice-area [data-serial="+choice.getSerial()+"]",$container)},renderEmptyPairs=function(interaction){var $container=containerHelper.get(interaction),max=parseInt(interaction.attr("maxAssociations")),$resultArea=$$1(".result-area",$container);if(interaction.responseMappingMode||0===max)$resultArea.append(pairTpl({empty:!0})),hider.show($resultArea.children(".incomplete-pair"));else for(var i=0;i<max;i++)$resultArea.append(pairTpl())},scrollObserverFactory=function($scrollContainer){function resetScrollObserver(){currentDraggable=null,beforeY=0,beforeX=0,afterY=0,afterX=0}function onScrollCb(){var x,y;currentDraggable&&(beforeY=afterY,beforeX=afterX,0===afterY&&0===beforeY&&(beforeY=this.scrollTop),0===afterX&&0===beforeX&&(beforeX=this.scrollLeft),afterY=this.scrollTop,afterX=this.scrollLeft,y=(parseInt(currentDraggable.getAttribute("data-y"),10)||0)+(afterY-beforeY),x=(parseInt(currentDraggable.getAttribute("data-x"),10)||0)+(afterX-beforeX),currentDraggable.style.webkitTransform=currentDraggable.style.transform="translate("+x+"px, "+y+"px)",currentDraggable.setAttribute("data-x",x),currentDraggable.setAttribute("data-y",y))}var currentDraggable=null,beforeY=0,beforeX=0,afterY=0,afterX=0;return $scrollContainer.parents().each(function(){var $el=$$1(this),ovf=$el.css("overflow");if("hidden"!==ovf&&"visible"!==ovf)return $scrollContainer=$el,!1}),interact.dynamicDrop(!0),{getScrollContainer:function(){return $scrollContainer},start:function(draggedElement){resetScrollObserver(),currentDraggable=draggedElement instanceof $$1?draggedElement.get(0):draggedElement,$scrollContainer.on("scroll.scrollObserver",_.throttle(onScrollCb,50))},stop:function(){$scrollContainer.off(".scrollObserver"),resetScrollObserver()}}},_setInstructions=function(interaction){var min=parseInt(interaction.attr("minAssociations"),10),max=parseInt(interaction.attr("maxAssociations"),10);if(0===min)0===max&&instructionMgr.appendInstruction(interaction,__("You may make as many association pairs as you want."));else{0===max&&instructionMgr.appendInstruction(interaction,__("The maximum number of association is unlimited."));var msg=__("You need to make")+" ";msg+=1<min?__("at least")+" "+min+" "+__("association pairs"):__("one association pair"),instructionMgr.appendInstruction(interaction,msg,function(){_getRawResponse(interaction).length>=min?this.setLevel("success"):this.reset()})}},resetResponse=function(interaction){var $container=containerHelper.get(interaction);$container.find(".result-area .active").each(function(){interactUtils.tapOn(this)}),$$1(".result-area>li>div",$container).each(function(){unsetChoice(interaction,$$1(this),!1,!1)}),containerHelper.triggerResponseChangeEvent(interaction),instructionMgr.validateInstructions(interaction)},_setPairs=function(interaction,pairs){var $container=containerHelper.get(interaction),addedPairs=0,$emptyPair=$$1(".result-area>li:first",$container);return pairs&&"single"===interaction.getResponseDeclaration().attr("cardinality")&&pairs.length&&(pairs=[pairs]),_.each(pairs,function(pair){if($emptyPair.length){var $divs=$emptyPair.children("div");setChoice(interaction,getChoice(interaction,pair[0]),$$1($divs[0])),setChoice(interaction,getChoice(interaction,pair[1]),$$1($divs[1])),addedPairs++,$emptyPair=$emptyPair.next("li")}else return!1}),addedPairs},setResponse=function(interaction,response){_setPairs(interaction,pciResponse.unserialize(response,interaction))},_getRawResponse=function(interaction){var response=[],$container=containerHelper.get(interaction);return $$1(".result-area>li",$container).each(function(){var pair=[];$$1(this).find("div").each(function(){var serial=$$1(this).data("serial");serial&&pair.push(interaction.getChoice(serial).id())}),2===pair.length&&response.push(pair)}),response},getResponse=function(interaction){return pciResponse.serialize(_getRawResponse(interaction),interaction)},destroy=function(interaction){var $container=containerHelper.get(interaction);interact($container.selector).unset(),interact($container.find(".choice-area").selector+" >li").unset(),interact($container.find(".result-area").selector+" >li>div").unset(),interact($container.find(".remove-choice").selector).unset(),instructionMgr.removeInstructions(interaction),$$1(".result-area",$container).empty(),containerHelper.reset(interaction)},setState=function(interaction,state){var $container;_.isObject(state)&&(state.response&&(interaction.resetResponse(),interaction.setResponse(state.response)),_.isArray(state.order)&&state.order.length===_.size(interaction.getChoices())&&($container=containerHelper.get(interaction),$$1(".choice-area .qti-choice",$container).sort(function(a,b){var aIndex=_.indexOf(state.order,$$1(a).data("identifier")),bIndex=_.indexOf(state.order,$$1(b).data("identifier"));return aIndex>bIndex?1:aIndex<bIndex?-1:0}).detach().appendTo($$1(".choice-area",$container))))},getState=function(interaction){var state={},response=interaction.getResponse(),$container;return response&&(state.response=response),!0===interaction.attr("shuffle")&&($container=containerHelper.get(interaction),state.order=[],$$1(".choice-area .qti-choice",$container).each(function(){state.order.push($$1(this).data("identifier"))})),state},AssociateInteraction={qtiClass:"associateInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:function render(interaction){var self=this;return new Promise(function(resolve){function _iFrameDragFix(draggableSelector,target){interactUtils.iFrameDragFixOn(function(){var $activeDrop=$$1(resultSelector+".dropzone");$activeDrop.length&&interact(resultSelector).fire({type:"drop",target:$activeDrop.eq(0),relatedTarget:target}),$activeDrop=$$1(choiceSelector+".dropzone"),$activeDrop.length&&interact(choiceSelector+".empty").fire({type:"drop",target:$activeDrop.eq(0),relatedTarget:target}),interact(draggableSelector).fire({type:"dragend",target:target})})}var $container=containerHelper.get(interaction),$choiceArea=$container.find(".choice-area"),$resultArea=$container.find(".result-area"),$activeChoice=null,scrollObserver=null,$bin=$$1("<span>",{class:"icon-undo remove-choice",title:__("remove")}),choiceSelector=$choiceArea.selector+" >li",resultSelector=$resultArea.selector+" >li>div",binSelector=$container.selector+" .remove-choice",_getChoice=function(serial){return $choiceArea.find("[data-serial="+serial+"]")},_setChoice=function($choice,$target){setChoice(interaction,$choice,$target),sizeAdapter.adaptSize($$1(".result-area .target, .choice-area .qti-choice",containerHelper.get(interaction)))},_resetSelection=function(){$activeChoice&&($resultArea.find(".remove-choice").remove(),$activeChoice.removeClass("active"),$container.find(".empty").removeClass("empty"),$activeChoice=null)},_unsetChoice=function($choice){unsetChoice(interaction,$choice,!0),sizeAdapter.adaptSize($$1(".result-area .target, .choice-area .qti-choice",containerHelper.get(interaction)))},_isInsertionMode=function(){return $activeChoice&&$activeChoice.data("identifier")},_isModeEditing=function(){return $activeChoice&&!$activeChoice.data("identifier")},_handleChoiceActivate=function($target){$target.hasClass("deactivated")||(_isModeEditing()?(interaction.swapping=!0,_unsetChoice($activeChoice),_setChoice($target,$activeChoice),_resetSelection(),interaction.swapping=!1):$target.hasClass("active")?_resetSelection():_activateChoice($target))},_activateChoice=function($choice){_resetSelection(),$activeChoice=$choice,$choice.addClass("active"),$resultArea.find(">li>.target").addClass("empty")},_handleResultActivate=function($target){var targetSerial=$target.data("serial"),choiceSerial;_isInsertionMode()?(choiceSerial=$activeChoice.data("serial"),targetSerial!==choiceSerial&&($target.hasClass("filled")&&(interaction.swapping=!0),targetSerial&&_unsetChoice($target),_setChoice($activeChoice,$target),interaction.swapping=!1),_resetSelection()):_isModeEditing()?(choiceSerial=$activeChoice.data("serial"),targetSerial!==choiceSerial&&(($target.hasClass("filled")||$activeChoice.siblings("div")[0]===$target[0])&&(interaction.swapping=!0),_unsetChoice($activeChoice),targetSerial&&(_unsetChoice($target),_setChoice(_getChoice(targetSerial),$activeChoice)),_setChoice(_getChoice(choiceSerial),$target),interaction.swapping=!1),_resetSelection()):targetSerial&&(_activateResult($target),$target.append($bin))},_activateResult=function($target){var targetSerial=$target.data("serial");$activeChoice=$target,$activeChoice.addClass("active"),$resultArea.find(">li>.target").filter(function(){return $$1(this).data("serial")!==targetSerial}).addClass("empty"),$choiceArea.find(">li:not(.deactivated)").filter(function(){return $$1(this).data("serial")!==targetSerial}).addClass("empty")},isDragAndDropEnabled,dragOptions,dropOptions,scaleX,scaleY;interact($container.selector).on("tap",function(e){$$1(e.currentTarget).closest(".qti-item").hasClass("prevent-click-handler")||_resetSelection()}),interact($choiceArea.selector+" >li").on("tap",function(e){var $target=$$1(e.currentTarget);$target.closest(".qti-item").hasClass("prevent-click-handler")||(e.stopPropagation(),_handleChoiceActivate($target),e.preventDefault())}),interact($resultArea.selector+" >li>div").on("tap",function(e){var $target=$$1(e.currentTarget);$target.closest(".qti-item").hasClass("prevent-click-handler")||(e.stopPropagation(),_handleResultActivate($target),e.preventDefault())}),interact(binSelector).on("tap",function(e){$$1(e.currentTarget).closest(".qti-item").hasClass("prevent-click-handler")||(e.stopPropagation(),_unsetChoice($activeChoice),_resetSelection(),e.preventDefault())}),interaction.responseMappingMode||_setInstructions(interaction),self.getOption&&self.getOption("enableDragAndDrop")&&self.getOption("enableDragAndDrop").associate&&(isDragAndDropEnabled=self.getOption("enableDragAndDrop").associate),isDragAndDropEnabled&&(scrollObserver=scrollObserverFactory($container),dragOptions={inertia:!1,autoScroll:{container:scrollObserver.getScrollContainer().get(0)},restrict:{restriction:".qti-interaction",endOnly:!1,elementRect:{top:0,left:0,bottom:1,right:1}}},interact(choiceSelector+":not(.deactivated)").draggable(_.defaults({onstart:function onstart(e){var $target=$$1(e.target),scale;$target.addClass("dragged"),_activateChoice($target),_iFrameDragFix(choiceSelector+":not(.deactivated)",e.target),scale=interactUtils.calculateScale(e.target),scaleX=scale[0],scaleY=scale[1],scrollObserver.start($activeChoice)},onmove:function onmove(e){interactUtils.moveElement(e.target,e.dx/scaleX,e.dy/scaleY)},onend:function onend(e){var $target=$$1(e.target);$target.removeClass("dragged"),_.delay(function(){_resetSelection()}),interactUtils.restoreOriginalPosition($target),interactUtils.iFrameDragFixOff(),scrollObserver.stop()}},dragOptions)).styleCursor(!1),interact(resultSelector+".filled").draggable(_.defaults({onstart:function onstart(e){var $target=$$1(e.target),scale;$target.addClass("dragged"),_resetSelection(),_activateResult($target),_iFrameDragFix(resultSelector+".filled",e.target),scale=interactUtils.calculateScale(e.target),scaleX=scale[0],scaleY=scale[1],scrollObserver.start($activeChoice)},onmove:function onmove(e){interactUtils.moveElement(e.target,e.dx/scaleX,e.dy/scaleY)},onend:function onend(e){var $target=$$1(e.target);$target.removeClass("dragged"),interactUtils.restoreOriginalPosition($target),$activeChoice&&_unsetChoice($activeChoice),_resetSelection(),interactUtils.iFrameDragFixOff(),scrollObserver.stop()}},dragOptions)).styleCursor(!1),dropOptions={overlap:.15,ondragenter:function ondragenter(e){$$1(e.target).addClass("dropzone"),$$1(e.relatedTarget).addClass("droppable")},ondragleave:function ondragleave(e){$$1(e.target).removeClass("dropzone"),$$1(e.relatedTarget).removeClass("droppable")}},interact(resultSelector).dropzone(_.defaults({ondrop:function ondrop(e){this.ondragleave(e),_handleResultActivate($$1(e.target))}},dropOptions)),interact(choiceSelector+".empty").dropzone(_.defaults({ondrop:function ondrop(e){this.ondragleave(e),_handleChoiceActivate($$1(e.target))}},dropOptions))),renderEmptyPairs(interaction),sizeAdapter.adaptSize($$1(".result-area .target, .choice-area .qti-choice",$container)),resolve()})},getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:destroy,setState:setState,getState:getState,renderEmptyPairs:renderEmptyPairs};return AssociateInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/ChoiceInteraction",["lodash","jquery","i18n","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter","util/adaptSize"],function(_,$$1,__,Handlebars,DOMPurify,containerHelper,instructionMgr,pciResponse,sizeAdapter,adaptSize){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,sizeAdapter=sizeAdapter&&Object.prototype.hasOwnProperty.call(sizeAdapter,"default")?sizeAdapter["default"]:sizeAdapter,adaptSize=adaptSize&&Object.prototype.hasOwnProperty.call(adaptSize,"default")?adaptSize["default"]:adaptSize;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program11(depth0,data){var stack1,helper;return(helper=helpers.listStyle)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.listStyle,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program13(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<div\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n class=\"qti-interaction qti-blockInteraction qti-choiceInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-qti-class=\"choiceInteraction\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n>\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <ol\n class=\"plain block-listing solid choice-area",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.noop,fn:self.program(9,function(){return" horizontal"},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" ",stack1=helpers["if"].call(depth0,depth0&&depth0.listStyle,{hash:{},inverse:self.noop,fn:self.program(11,program11,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n aria-labelledby=\"",(helper=helpers.promptId)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.promptId,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n >\n ",options={hash:{},inverse:self.noop,fn:self.program(13,program13,data),data:data},(helper=helpers.choices)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.choices,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.choices||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(13,program13,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </ol>\n <div class=\"notification-container\"></div>\n</div>\n",buffer}),_triggerInput=function($choiceBox,state){var $input=$choiceBox.find("input:radio,input:checkbox").not("[disabled]").not(".disabled"),$choiceBoxes=$choiceBox.add($choiceBox.siblings());$input.length&&(!_.isBoolean(state)&&(state=!$input.prop("checked")),$input.prop("checked",state),$input.trigger("change"),$choiceBoxes.removeClass("user-selected"),$choiceBoxes.find("input:checked").not("[disabled]").not(".disabled").parents(".qti-choice").addClass("user-selected"))},_pseudoLabel=function(interaction,$container){$container.off(".commonRenderer"),$container.on("keydown.commonRenderer.keyNavigation",".qti-choice input:radio:not([disabled]):not(.disabled), .qti-choice input:checkbox:not([disabled]):not(.disabled)",function(e){var $qtiChoice=$$1(this).closest(".qti-choice"),keyCode=e.keyCode?e.keyCode:e.charCode;keyCode===38||keyCode===37?(e.preventDefault(),e.stopPropagation(),$qtiChoice.prev(".qti-choice").find("input:radio,input:checkbox").not("[disabled]").not(".disabled").focus()):(keyCode===40||keyCode===39)&&(e.preventDefault(),e.stopPropagation(),$qtiChoice.next(".qti-choice").find("input:radio,input:checkbox").not("[disabled]").not(".disabled").focus())}).on("keyup.commonRenderer.keyNavigation",".qti-choice input:radio:not([disabled]):not(.disabled), .qti-choice input:checkbox:not([disabled]):not(.disabled)",function(e){var keyCode=e.keyCode?e.keyCode:e.charCode;(keyCode===32||keyCode===13)&&(e.preventDefault(),e.stopPropagation(),_triggerInput($$1(this).closest(".qti-choice")))}),$container.on("click.commonRenderer",".qti-choice",function(e){var $choiceBox=$$1(this),eliminator=e.target.dataset&&e.target.dataset.eliminable,input=this.querySelector(".real-label > input"),state;e.originalEvent&&$$1(e.originalEvent.target).is("input")||$choiceBox.closest(".qti-item").hasClass("prevent-click-handler")||(e.preventDefault(),e.stopPropagation(),!_.isUndefined(eliminator)&&(state=!1,"trigger"===eliminator&&this.classList.toggle("eliminated")),_triggerInput($choiceBox,state),this.classList.contains("eliminated")?input.setAttribute("disabled","disabled"):input.removeAttribute("disabled"),instructionMgr.validateInstructions(interaction,{choice:$choiceBox}),containerHelper.triggerResponseChangeEvent(interaction),$$1(input).focus())})},_getRawResponse=function(interaction){var values=[],$container=containerHelper.get(interaction);return $$1(".real-label > input[name=response-"+interaction.getSerial()+"]:checked",$container).each(function(){values.push($$1(this).val())}),values},_setInstructions=function(interaction){var min=interaction.attr("minChoices"),max=interaction.attr("maxChoices"),choiceCount=_.size(interaction.getChoices()),minInstructionSet=!1,highlightInvalidInput=function($choice){var $input=$choice.find(".real-label > input"),$li=$choice.css("color","#BA122B"),$icon=$choice.find(".real-label > span").css("color","#BA122B").addClass("cross error"),timeout=interaction.data("__instructionTimeout");timeout&&clearTimeout(timeout),timeout=setTimeout(function(){$input.prop("checked",!1),$li.removeAttr("style"),$icon.removeAttr("style").removeClass("cross"),$li.toggleClass("user-selected",!1),containerHelper.triggerResponseChangeEvent(interaction)},150),interaction.data("__instructionTimeout",timeout)},msg;1<max&&max<choiceCount&&(max===min?(minInstructionSet=!0,msg=__("You must select exactly %s choices",max),instructionMgr.appendInstruction(interaction,msg,function(data){_getRawResponse(interaction).length>=max?(this.setLevel("success"),this.checkState("fulfilled")&&this.update({level:"warning",message:__("Maximum choices reached"),timeout:2e3,start:function start(){data&&data.choice&&highlightInvalidInput(data.choice)},stop:function stop(){this.update({level:"success",message:msg})}}),this.setState("fulfilled")):this.reset()})):max>min&&(msg=1===max?__("You can select maximum of 1 choice"):__("You can select maximum of %s choices",max),instructionMgr.appendInstruction(interaction,msg,function(data){_getRawResponse(interaction).length>=max?(this.setMessage(__("Maximum choices reached")),this.checkState("fulfilled")&&this.update({level:"warning",timeout:2e3,start:function start(){data&&data.choice&&highlightInvalidInput(data.choice)},stop:function stop(){this.setLevel("info")}}),this.setState("fulfilled")):this.reset()}))),!minInstructionSet&&0<min&&min<choiceCount&&(msg=1===min?__("You must select at least 1 choice"):__("You must select at least %s choices",min),instructionMgr.appendInstruction(interaction,msg,function(){_getRawResponse(interaction).length>=min?this.setLevel("success"):this.reset()}))},render=function(interaction){var $container=containerHelper.get(interaction);if(_pseudoLabel(interaction,$container),_setInstructions(interaction),"horizontal"===interaction.attr("orientation")){var $elements=$$1(".add-option, .result-area .target, .choice-area .qti-choice",$container);sizeAdapter.adaptSize($elements),$$1(document).on("themeapplied.choiceInteraction",function(){return adaptSize.height($elements)})}},resetResponse=function(interaction){var $container=containerHelper.get(interaction);$$1(".real-label > input",$container).prop("checked",!1)},setResponse=function(interaction,response){var $container=containerHelper.get(interaction);try{_.forEach(pciResponse.unserialize(response,interaction),function(identifier){var $input=$container.find(".real-label > input[value=\""+identifier+"\"]").prop("checked",!0);$input.closest(".qti-choice").toggleClass("user-selected",!0)}),instructionMgr.validateInstructions(interaction)}catch(e){throw new Error("wrong response format in argument : "+e)}},getResponse=function(interaction){return pciResponse.serialize(_getRawResponse(interaction),interaction)},isEliminable=function(interaction){return /\beliminable\b/.test(interaction.attr("class"))},getCustomData=function(interaction,data){var listStyles=(interaction.attr("class")||"").match(/\blist-style-[\w-]+/)||[];return _.merge(data||{},{horizontal:"horizontal"===interaction.attr("orientation"),listStyle:listStyles.pop(),eliminable:isEliminable(interaction)})},destroy=function(interaction){var $container=containerHelper.get(interaction),timeout=interaction.data("__instructionTimeout");timeout&&clearTimeout(timeout),$container.off(".commonRenderer"),$$1(document).off(".commonRenderer").off(".choiceInteraction"),instructionMgr.removeInstructions(interaction),containerHelper.reset(interaction)},setState=function(interaction,state){var $container;_.isObject(state)&&(state.response&&(interaction.resetResponse(),interaction.setResponse(state.response)),$container=containerHelper.get(interaction),_.isArray(state.order)&&state.order.length===_.size(interaction.getChoices())&&$$1(".qti-simpleChoice",$container).sort(function(a,b){var aIndex=_.indexOf(state.order,$$1(a).data("identifier")),bIndex=_.indexOf(state.order,$$1(b).data("identifier"));return aIndex>bIndex?1:aIndex<bIndex?-1:0}).detach().appendTo($$1(".choice-area",$container)),isEliminable(interaction)&&_.isArray(state.eliminated)&&state.eliminated.length&&_.forEach(state.eliminated,function(identifier){$container.find(".qti-simpleChoice[data-identifier=\""+identifier+"\"]").addClass("eliminated")}))},getState=function(interaction){var $container=containerHelper.get(interaction),state={},response=interaction.getResponse();return response&&(state.response=response),!0===interaction.attr("shuffle")&&(state.order=[],$$1(".qti-simpleChoice",$container).each(function(){state.order.push($$1(this).data("identifier"))})),isEliminable(interaction)&&(state.eliminated=[],$container.find(".qti-simpleChoice.eliminated").each(function(){state.eliminated.push($$1(this).data("identifier"))})),state},ChoiceInteraction={qtiClass:"choiceInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getData:getCustomData,render:render,getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:destroy,setState:setState,getState:getState};return ChoiceInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/EndAttemptInteraction",["lodash","handlebars","i18n","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/PciResponse"],function(_,Handlebars,__,DOMPurify,containerHelper,pciResponse){'use strict';function render(interaction){var $container=containerHelper.get(interaction);$container.on("click.commonRenderer",function(e){$(e.currentTarget).closest(".qti-item").hasClass("prevent-click-handler")||($container.val(!0),containerHelper.triggerResponseChangeEvent(interaction),$container.trigger("endattempt",[interaction.attr("responseIdentifier")]))})}function setResponse(interaction,response){_setVal(interaction,pciResponse.unserialize(response,interaction)[0])}function getResponse(interaction){var val=containerHelper.get(interaction).val();return val=val&&"false"!==val&&"0"!==val,pciResponse.serialize([val],interaction)}function setState(interaction,state){_.isObject(state)&&state.response&&(interaction.resetResponse(),interaction.setResponse(state.response))}function _setVal(interaction,val){containerHelper.get(interaction).val(val).change()}function destroy(interaction){containerHelper.get(interaction).off(".commonRenderer")}function getCustomData(interaction,data){return data.attributes.title||(data.attributes.title=__("End Attempt")),data}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<a class=\"qti-interaction qti-inlineInteraction qti-endAttemptInteraction btn small btn-info\"\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n data-qti-class=\"endAttemptInteraction\"\n value=\"false\"\n tabindex=\"0\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.title),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\n</a>\n",buffer}),EndAttemptInteraction={qtiClass:"endAttemptInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getData:getCustomData,render:render,getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:function(interaction){_setVal(interaction,!1)},destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state}};return EndAttemptInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/ExtendedTextInteraction",["jquery","lodash","i18n","util/strLimiter","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","ckeditor","taoQtiItem/qtiCommonRenderer/helpers/ckConfigurator","taoQtiItem/qtiCommonRenderer/helpers/patternMask","ui/tooltip","core/logger"],function($$1,_,__,strLimiter,Handlebars,DOMPurify,containerHelper,instructionMgr,ckEditor,ckConfigurator,patternMaskHelper,tooltip,loggerFactory){'use strict';function inputLimiter(interaction){var $container=containerHelper.get(interaction),expectedLength=interaction.attr("expectedLength"),expectedLines=interaction.attr("expectedLines"),patternMask=interaction.attr("patternMask"),enabled=!1,patternRegEx,$textarea,$charsCounter,$wordsCounter,maxWords,maxLength,$maxLengthCounter,$maxWordsCounter;(expectedLength||expectedLines||patternMask)&&(enabled=!0,$textarea=$$1(".text-container",$container),$charsCounter=$$1(".count-chars",$container),$wordsCounter=$$1(".count-words",$container),$maxLengthCounter=$$1(".count-max-length",$container),$maxWordsCounter=$$1(".count-max-words",$container),""!==patternMask&&(maxWords=patternMaskHelper.parsePattern(patternMask,"words"),maxLength=patternMaskHelper.parsePattern(patternMask,"chars"),maxWords=_.isNaN(maxWords)?0:maxWords,maxLength=_.isNaN(maxLength)?0:maxLength,!maxLength&&!maxWords&&(patternRegEx=new RegExp(patternMask)),$maxLengthCounter.text(maxLength),$maxWordsCounter.text(maxWords)));var limiter={enabled:enabled,listenTextInput:function(){var _this14=this,ignoreKeyCodes=[8,13,16,17,46,37,38,39,40,35,36,1114177,3342401,1114181,3342405,2228232,2228261,4456485,2228262,2228263,4456487,2228264,2228237,1114120,1114177,1114202,1114200],triggerKeyCodes=[32,13,2228237],invalidToolip=tooltip.error($container,__("This is not a valid answer"),{position:"bottom",trigger:"manual"}),patternHandler=function(e){var isCke="xhtml"===_getFormat(interaction),newValue;if(patternRegEx){if(newValue=isCke?this.getData():e.currentTarget.value,!newValue)return!1;_.debounce(function(){patternRegEx.test(newValue)?($container.removeClass("invalid"),invalidToolip.dispose()):($container.addClass("invalid"),$container.show(),invalidToolip.show(),containerHelper.triggerResponseChangeEvent(interaction))},400)()}},keyLimitHandler=function(e){var keyCode=e&&e.data?e.data.keyCode:e.which;return!_.contains(ignoreKeyCodes,keyCode)&&(maxWords&&_this14.getWordsCount()>=maxWords&&_.contains(triggerKeyCodes,keyCode)||maxLength&&_this14.getCharsCount()>=maxLength)?(e.cancel?e.cancel():(e.preventDefault(),e.stopImmediatePropagation()),!1):void _.defer(function(){return _this14.updateCounter()})},nonKeyLimitHandler=function(e){var isCke="xhtml"===_getFormat(interaction),newValue;if(newValue="string"==typeof $$1(e.target).attr("data-clipboard")?$$1(e.target).attr("data-clipboard"):isCke?e.data.dataValue:e.originalEvent.clipboardData?e.originalEvent.clipboardData.getData("text"):e.originalEvent.dataTransfer.getData("text")||e.originalEvent.dataTransfer.getData("text/plain")||"",e.cancel?e.cancel():(e.preventDefault(),e.stopImmediatePropagation()),!newValue)return!1;if(_.isNull(maxWords)?!_.isNull(maxLength)&&(newValue=strLimiter.limitByCharCount(newValue,maxLength-_this14.getCharsCount())):newValue=strLimiter.limitByWordCount(newValue,maxWords-_this14.getWordsCount()),isCke)_getCKEditor(interaction).insertHtml(newValue);else{var elements=containerHelper.get(interaction).find("textarea"),el=elements[0],start=el.selectionStart,end=el.selectionEnd,text=el.value;elements.val(text.substring(0,start)+newValue+text.substring(end,text.length)),el.focus(),el.selectionStart=start+newValue.length,el.selectionEnd=el.selectionStart}_.defer(function(){return _this14.updateCounter()})},cke;"xhtml"===_getFormat(interaction)?(cke=_getCKEditor(interaction),cke.on("key",keyLimitHandler),cke.on("change",patternHandler),cke.on("paste",nonKeyLimitHandler)):$textarea.on("keyup.commonRenderer",patternHandler).on("keydown.commonRenderer",keyLimitHandler).on("paste.commonRenderer drop.commonRenderer",nonKeyLimitHandler)},getWordsCount:function(){var value=_getTextareaValue(interaction)||"";return _.isEmpty(value)?0:value.trim().replace(/\s+/gi," ").split(" ").length},getCharsCount:function(){var value=_getTextareaValue(interaction)||"";return value.replace(/[\r\n]{1}\xA0[\r\n]{1}/gm,"\r").replace(/[\r\n]+/gm,"").length},updateCounter:function(){$charsCounter.text(this.getCharsCount()),$wordsCounter.text(this.getWordsCount())}};return limiter}function _getTextareaValue(interaction,raw){return"xhtml"===_getFormat(interaction)?_ckEditorData(interaction,raw):containerHelper.get(interaction).find("textarea").val()}function _setPattern($element,pattern){var patt=new RegExp(pattern);$element.on("keyup.commonRenderer",function(){$element.removeClass("field-error"),patt.test($element.val())||$element.addClass("field-error")})}function _isMultiple(interaction){var attributes=interaction.getAttributes(),response=interaction.getResponseDeclaration();return!!(attributes.maxStrings&&("multiple"===response.attr("cardinality")||"ordered"===response.attr("cardinality")))}function _setUpCKEditor(interaction,options){var $container=containerHelper.get(interaction),editor=ckEditor.replace($container.find(".text-container")[0],options||{});if(editor)return $container.data("editor",editor.name),editor}function _destroyCkEditor(interaction){var $container=containerHelper.get(interaction),name=$container.data("editor"),editor;name&&(editor=ckEditor.instances[name]),editor&&(editor.destroy(),$container.removeData("editor"))}function _getCKEditor(interaction){var $container=containerHelper.get(interaction),name=$container.data("editor");return ckEditor.instances[name]}function _ckEditorData(interaction,raw){var editor=_getCKEditor(interaction),data=editor&&editor.getData()||"";return raw||(data=_stripTags(data)),data}function _stripTags(str){var tempNode=document.createElement("div");return tempNode.innerHTML=str,tempNode.textContent}function _getFormat(interaction){var format=interaction.attr("format");return _.contains(["plain","xhtml","preformatted"],format)?format:"plain"}function enable(interaction){var $container=containerHelper.get(interaction),editor;$container.find("input, textarea").removeAttr("disabled"),"xhtml"===_getFormat(interaction)&&(editor=_getCKEditor(interaction),editor&&("ready"===editor.status?editor.setReadOnly(!1):editor.readOnly=!1))}function disable(interaction){var $container=containerHelper.get(interaction),editor;$container.find("input, textarea").attr("disabled","disabled"),"xhtml"===_getFormat(interaction)&&(editor=_getCKEditor(interaction),editor&&("ready"===editor.status?editor.setReadOnly(!0):editor.readOnly=!0))}function setText(interaction,text){var limiter=inputLimiter(interaction);if("xhtml"===_getFormat(interaction))try{_getCKEditor(interaction).setData(text,function(){limiter.enabled&&limiter.updateCounter()})}catch(e){logger.warn("setText error ".concat(e,"!"))}else containerHelper.get(interaction).find("textarea").val(text),limiter.enabled&&limiter.updateCounter()}function destroy(interaction){var $container=containerHelper.get(interaction),$el=$container.find("input, textarea");"xhtml"===_getFormat(interaction)&&_destroyCkEditor(interaction),$el.off(".commonRenderer"),$$1(document).off(".commonRenderer"),instructionMgr.removeInstructions(interaction),containerHelper.reset(interaction)}function setState(interaction,state){if(_.isObject(state)&&state.response)try{interaction.setResponse(state.response)}catch(e){throw interaction.resetResponse(),e}}function getCustomData(interaction,data){var pattern=interaction.attr("patternMask"),maxWords=parseInt(patternMaskHelper.parsePattern(pattern,"words")),maxLength=parseInt(patternMaskHelper.parsePattern(pattern,"chars")),expectedLength=parseInt(interaction.attr("expectedLines"),10);return _.merge(data||{},{maxWords:isNaN(maxWords)?0:maxWords,maxLength:isNaN(maxLength)?0:maxLength,attributes:isNaN(expectedLength)?void 0:{expectedLength:72*expectedLength}})}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,strLimiter=strLimiter&&Object.prototype.hasOwnProperty.call(strLimiter,"default")?strLimiter["default"]:strLimiter,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr,ckEditor=ckEditor&&Object.prototype.hasOwnProperty.call(ckEditor,"default")?ckEditor["default"]:ckEditor,ckConfigurator=ckConfigurator&&Object.prototype.hasOwnProperty.call(ckConfigurator,"default")?ckConfigurator["default"]:ckConfigurator,patternMaskHelper=patternMaskHelper&&Object.prototype.hasOwnProperty.call(patternMaskHelper,"default")?patternMaskHelper["default"]:patternMaskHelper,tooltip=tooltip&&Object.prototype.hasOwnProperty.call(tooltip,"default")?tooltip["default"]:tooltip,loggerFactory=loggerFactory&&Object.prototype.hasOwnProperty.call(loggerFactory,"default")?loggerFactory["default"]:loggerFactory;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program9(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n ",stack1=(helper=helpers.equal||depth0&&depth0.equal,options={hash:{},inverse:self.program(14,program14,data),fn:self.program(10,program10,data),data:data},helper?helper.call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"xhtml",options):helperMissing.call(depth0,"equal",(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"xhtml",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program10(depth0,data){var buffer="",stack1;return buffer+="\n ",stack1=helpers.each.call(depth0,depth0&&depth0.maxStringLoop,{hash:{},inverse:self.noop,fn:self.program(11,program11,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program11(depth0,data){var buffer="",stack1;return buffer+="\n <div class=\"text-container text-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+" solid",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" name=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"_"+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\" contenteditable></div>\n ",buffer}function program12(){return" attributes.class"}function program14(depth0,data){var buffer="",stack1;return buffer+="\n ",stack1=helpers.each.call(depth0,depth0&&depth0.maxStringLoop,{hash:{},inverse:self.noop,fn:self.program(15,program15,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program15(depth0,data){var buffer="",stack1,helper;return buffer+="\n <textarea\n class=\"text-container text-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+" solid",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n name=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"_"+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.patternMask),{hash:{},inverse:self.noop,fn:self.program(16,program16,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n aria-labelledby=\"",(helper=helpers.promptId)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.promptId,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n ></textarea>\n ",buffer}function program16(depth0){var buffer="",stack1;return buffer+="pattern=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.patternMask),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program18(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n ",stack1=(helper=helpers.equal||depth0&&depth0.equal,options={hash:{},inverse:self.program(21,program21,data),fn:self.program(19,program19,data),data:data},helper?helper.call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),depth0&&depth0.xhtml,options):helperMissing.call(depth0,"equal",(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),depth0&&depth0.xhtml,options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program19(depth0,data){var buffer="",stack1;return buffer+="\n <div class=\"text-container text-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+" solid",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" contenteditable></div>\n ",buffer}function program21(depth0,data){var buffer="",stack1,helper;return buffer+="\n <textarea\n class=\"text-container text-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+" solid",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.patternMask),{hash:{},inverse:self.noop,fn:self.program(16,program16,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n aria-labelledby=\"",(helper=helpers.promptId)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.promptId,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n ></textarea>\n ",buffer}function program23(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <span class=\"count-chars\">0</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"of",options):helperMissing.call(depth0,"__","of",options)))+" <span class=\"count-expected-length\">"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.expectedLength),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"characters",options):helperMissing.call(depth0,"__","characters",options)))+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"recommended",options):helperMissing.call(depth0,"__","recommended",options)))+".\n ",buffer}function program25(depth0,data){var buffer="",stack1;return buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.maxLength,{hash:{},inverse:self.program(28,program28,data),fn:self.program(26,program26,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.maxWords,{hash:{},inverse:self.program(32,program32,data),fn:self.program(30,program30,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program26(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <span class=\"text-counter-chars\"><span class=\"count-chars\">0</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"of",options):helperMissing.call(depth0,"__","of",options)))+" <span class=\"count-max-length\">",(helper=helpers.maxLength)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxLength,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"characters",options):helperMissing.call(depth0,"__","characters",options)))+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"maximum",options):helperMissing.call(depth0,"__","maximum",options)))+".</span>\n ",buffer}function program28(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <span class=\"text-counter-chars\" style=\"display: none\"><span class=\"count-chars\">0</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"of",options):helperMissing.call(depth0,"__","of",options)))+" <span class=\"count-max-length\">",(helper=helpers.maxLength)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxLength,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"characters",options):helperMissing.call(depth0,"__","characters",options)))+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"maximum",options):helperMissing.call(depth0,"__","maximum",options)))+".</span>\n ",buffer}function program30(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <span class=\"text-counter-words\"><span class=\"count-words\">0</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"of",options):helperMissing.call(depth0,"__","of",options)))+" <span class=\"count-max-words\">",(helper=helpers.maxWords)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxWords,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"words",options):helperMissing.call(depth0,"__","words",options)))+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"maximum",options):helperMissing.call(depth0,"__","maximum",options)))+".</span>\n ",buffer}function program32(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <span class=\"text-counter-words\" style=\"display: none\"><span class=\"count-words\">0</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"of",options):helperMissing.call(depth0,"__","of",options)))+" <span class=\"count-max-words\">",(helper=helpers.maxWords)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxWords,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"words",options):helperMissing.call(depth0,"__","words",options)))+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"maximum",options):helperMissing.call(depth0,"__","maximum",options)))+".</span>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-extendedTextInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"extendedTextInteraction\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.multiple,{hash:{},inverse:self.program(18,program18,data),fn:self.program(9,program9,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"text-counter\">\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.expectedLength),{hash:{},inverse:self.program(25,program25,data),fn:self.program(23,program23,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </div>\n</div>\n",buffer}),logger=loggerFactory("taoQtiItem/qtiCommonRenderer/renderers/interactions/ExtendedTextInteraction.js"),resetResponse=function(interaction){"xhtml"===_getFormat(interaction)?_getCKEditor(interaction).setData(""):containerHelper.get(interaction).find("input, textarea").val("")},getResponse=function(interaction){var $container=containerHelper.get(interaction),attributes=interaction.getAttributes(),responseDeclaration=interaction.getResponseDeclaration(),baseType=responseDeclaration.attr("baseType"),numericBase=attributes.base||10,multiple=!!(attributes.maxStrings&&("multiple"===responseDeclaration.attr("cardinality")||"ordered"===responseDeclaration.attr("cardinality"))),ret=multiple?{list:{}}:{base:{}},value="",values;return multiple?(values=[],$container.find("input").each(function(i){var $el=$$1(this);attributes.placeholderText&&$el.val()===attributes.placeholderText?values[i]="":"integer"===baseType?(values[i]=parseInt($el.val(),numericBase),values[i]=isNaN(values[i])?"":values[i]):"float"===baseType?(values[i]=parseFloat($el.val()),values[i]=isNaN(values[i])?"":values[i]):"string"===baseType&&(values[i]=$el.val())}),ret.list[baseType]=values):(attributes.placeholderText&&_getTextareaValue(interaction)===attributes.placeholderText?value="":"integer"===baseType?value=parseInt(_getTextareaValue(interaction),numericBase):"float"===baseType?value=parseFloat(_getTextareaValue(interaction)):"string"===baseType&&(value=_getTextareaValue(interaction,!0)),ret.base[baseType]=isNaN(value)&&"number"==typeof value?"":value),ret},ExtendedTextInteraction={qtiClass:"extendedTextInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:function(interaction){return new Promise(function(resolve,reject){var $container=containerHelper.get(interaction),multiple=_isMultiple(interaction),limiter=inputLimiter(interaction),placeholderText=interaction.attr("placeholderText"),ckOptions={resize_enabled:!0,secure:"https:"===location.protocol,forceCustomDomain:!0,language:function getItemLanguage(){var itemLang=$container.closest(".qti-item").attr("lang"),itemLocale=itemLang&&itemLang.split("-")[0];return itemLocale||(itemLang=window.document.documentElement.getAttribute("lang"),itemLocale=itemLang&&itemLang.split("-")[0]),itemLocale}()},$el,expectedLength,minStrings,patternMask,placeholderType,editor,_styleUpdater,themeLoaded,_getNumStrings;multiple?($el=$container.find("input"),minStrings=interaction.attr("minStrings"),expectedLength=interaction.attr("expectedLength"),patternMask=interaction.attr("patternMask"),minStrings&&(_getNumStrings=function($element){var num=0;return $element.each(function(){""!==$$1(this).val()&&num++}),num},minStrings=parseInt(minStrings,10),0<minStrings&&$el.on("blur.commonRenderer",function(){setTimeout(function(){!$el.is(":focus")&&_getNumStrings($el)<minStrings&&instructionMgr.appendNotification(interaction,"".concat(__("The minimum number of answers is ")," : ").concat(minStrings),"warning")},100)})),expectedLength&&(expectedLength=parseInt(expectedLength,10),0<expectedLength&&$el.each(function(){$$1(this).css("width","".concat(expectedLength,"em"))})),patternMask&&$el.each(function(){_setPattern($$1(this),patternMask)}),placeholderText&&(placeholderType="first","multiple"===placeholderType?$el.each(function(){$$1(this).attr("placeholder",placeholderText)}):"first"==placeholderType&&$el.first().attr("placeholder",placeholderText)),resolve()):($el=$container.find("textarea"),placeholderText&&$el.attr("placeholder",placeholderText),"xhtml"===_getFormat(interaction)?(_styleUpdater=function(){var qtiItemStyle,$editorBody,qtiItem;editor.document&&(qtiItem=$$1(".qti-item").get(0),qtiItemStyle=qtiItem.currentStyle||window.getComputedStyle(qtiItem),$editorBody=editor.document.$&&editor.document.$.body?$$1(editor.document.$.body):$$1(editor.document.getBody().$),$editorBody.css({"background-color":"transparent",color:qtiItemStyle.color}))},themeLoaded=function(){_styleUpdater()},editor=_setUpCKEditor(interaction,ckOptions),!editor&&reject("Unable to instantiate ckEditor"),editor.on("instanceReady",function(){_styleUpdater(),editor.container&&editor.container.$&&$$1(editor.container.$).addClass("no-key-navigation"),_.delay(resolve,300)}),("ready"===editor.status||"loaded"===editor.status)&&_.defer(resolve),editor.on("configLoaded",function(){editor.config=ckConfigurator.getConfig(editor,"extendedText",ckOptions),limiter.enabled&&limiter.listenTextInput()}),editor.on("change",function(){containerHelper.triggerResponseChangeEvent(interaction,{})}),$$1(document).on("themechange.themeloader",themeLoaded)):($el.on("keyup.commonRenderer change.commonRenderer",function(){containerHelper.triggerResponseChangeEvent(interaction,{})}),limiter.enabled&&limiter.listenTextInput(),resolve()))})},getContainer:containerHelper.get,setResponse:function setResponse(interaction,response){var _setMultipleVal=function(identifier,value){interaction.getContainer().find("#".concat(identifier)).val(value)},baseType=interaction.getResponseDeclaration().attr("baseType");if(null===response.base&&1===Object.keys(response).length&&(response={base:{string:""}}),response.base&&"undefined"!=typeof response.base[baseType])setText(interaction,response.base[baseType]);else if(response.list&&response.list[baseType])for(var i in response.list[baseType]){var serial="undefined"==typeof response.list.serial?"":response.list.serial[i];_setMultipleVal("".concat(serial,"_").concat(i),response.list[baseType][i])}else throw new Error("wrong response format in argument.")},getResponse:getResponse,getData:getCustomData,resetResponse:resetResponse,destroy:destroy,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state},setState:setState,enable:enable,disable:disable,clearText:function(interaction){setText(interaction,"")},setText:setText,inputLimiter:inputLimiter};return ExtendedTextInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/GapMatchInteraction",["lodash","i18n","jquery","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","interact","ui/interactUtils"],function(_,__,$$1,Handlebars,DOMPurify,containerHelper,pciResponse,interact,interactUtils){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,interact=interact&&Object.prototype.hasOwnProperty.call(interact,"default")?interact["default"]:interact,interactUtils=interactUtils&&Object.prototype.hasOwnProperty.call(interactUtils,"default")?interactUtils["default"]:interactUtils;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program9(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-gapMatchInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"gapMatchInteraction\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <ul class=\"choice-area none block-listing solid horizontal source\">\n ",options={hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data},(helper=helpers.choices)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.choices,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.choices||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </ul>\n <div class=\"instruction-container\"></div>\n <div class=\"qti-flow-container\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>\n</div>\n",buffer}),_choiceUsages={},setChoice=function(interaction,$choice,$target){var choiceSerial=$choice.data("serial"),choice=interaction.getChoice(choiceSerial);_choiceUsages[choiceSerial]||(_choiceUsages[choiceSerial]=0),_choiceUsages[choiceSerial]++,$target.data("serial",choiceSerial).html($choice.html()).addClass("filled"),!interaction.responseMappingMode&&choice.attr("matchMax")&&_choiceUsages[choiceSerial]>=choice.attr("matchMax")&&$choice.attr("class","deactivated"),containerHelper.triggerResponseChangeEvent(interaction)},unsetChoice=function(interaction,$choice){var serial=$choice.data("serial"),$container=containerHelper.get(interaction);$container.find(".choice-area [data-serial="+serial+"]").removeClass().addClass("qti-choice"),_choiceUsages[serial]--,$choice.removeClass("filled").removeData("serial").empty(),interaction.swapping||containerHelper.triggerResponseChangeEvent(interaction)},getChoice=function(interaction,identifier){var $container=containerHelper.get(interaction);return $$1(".choice-area [data-identifier=\""+identifier+"\"]",$container)},getGap=function(interaction,identifier){var $container=containerHelper.get(interaction);return $$1(".qti-flow-container [data-identifier=\""+identifier+"\"]",$container)},render=function(interaction){function _iFrameDragFix(draggableSelector,target){interactUtils.iFrameDragFixOn(function(){$activeDrop&&interact(gapSelector).fire({type:"drop",target:$activeDrop.eq(0),relatedTarget:target}),interact(draggableSelector).fire({type:"dragend",target:target})})}function _handleChoiceSelect($target){$activeChoice&&$target.hasClass("active")||$target.hasClass("deactivated")||(_resetSelection(),$activeChoice=$target.addClass("active"),$$1(gapSelector).addClass("empty"))}function _handleFilledGapSelect($target){$activeChoice=$target,$$1(gapSelector).addClass("active")}function _handleGapSelect($target){var choiceSerial,targetSerial;_isInsertionMode()?(choiceSerial=$activeChoice.data("serial"),targetSerial=$target.data("serial"),targetSerial!==choiceSerial&&(targetSerial&&_unsetChoice($target),_setChoice($activeChoice,$target)),$activeChoice.removeClass("active"),$container.find(".empty").removeClass("empty"),$activeChoice=null):_isModeEditing()?(choiceSerial=$activeChoice.data("serial"),targetSerial=$target.data("serial"),targetSerial!==choiceSerial&&(_unsetChoice($activeChoice),targetSerial&&(_unsetChoice($target),_setChoice(_getChoice(targetSerial),$activeChoice)),_setChoice(_getChoice(choiceSerial),$target)),_resetSelection()):$target.data("serial")&&$target.hasClass("filled")&&(targetSerial=$target.data("serial"),$activeChoice=$target,$activeChoice.addClass("active"),$flowContainer.find(">li>div").filter(function(){return $target.data("serial")!==targetSerial}).addClass("empty"),$choiceArea.find(">li:not(.deactivated)").filter(function(){return $target.data("serial")!==targetSerial}).addClass("empty"),$target.append($bin))}var $container=containerHelper.get(interaction),$choiceArea=$container.find(".choice-area"),$flowContainer=$container.find(".qti-flow-container"),$activeChoice=null,$activeDrop=null,$bin=$$1("<span>",{class:"icon-undo remove-choice",title:__("remove")}),choiceSelector=$choiceArea.selector+" .qti-choice",gapSelector=$flowContainer.selector+" .gapmatch-content",filledGapSelector=gapSelector+".filled",binSelector=$container.selector+" .remove-choice",_getChoice=function(serial){return $choiceArea.find("[data-serial="+serial+"]")},_setChoice=function($choice,$target){return setChoice(interaction,$choice,$target)},_resetSelection=function(){$activeChoice&&($flowContainer.find(".remove-choice").remove(),$activeChoice.removeClass("deactivated active"),$container.find(".empty").removeClass("empty"),$activeChoice=null)},_unsetChoice=function($choice){return unsetChoice(interaction,$choice)},_isInsertionMode=function(){return $activeChoice&&!$activeChoice.hasClass("filled")},_isModeEditing=function(){return $activeChoice&&$activeChoice.hasClass("filled")},isDragAndDropEnabled,dragOptions,scaleX,scaleY;this.getOption&&this.getOption("enableDragAndDrop")&&this.getOption("enableDragAndDrop").gapMatch&&(isDragAndDropEnabled=this.getOption("enableDragAndDrop").gapMatch),isDragAndDropEnabled&&(dragOptions={inertia:!1,autoScroll:!0,restrict:{restriction:".qti-interaction",endOnly:!1,elementRect:{top:0,left:1,bottom:1,right:1}}},interact(choiceSelector).draggable(_.assign({},dragOptions,{onstart:function onstart(e){var $target=$$1(e.target),scale;$target.addClass("dragged"),_handleChoiceSelect($target),_iFrameDragFix(choiceSelector,e.target),scale=interactUtils.calculateScale(e.target),scaleX=scale[0],scaleY=scale[1]},onmove:function onmove(e){interactUtils.moveElement(e.target,e.dx/scaleX,e.dy/scaleY)},onend:function onend(e){var $target=$$1(e.target);$target.removeClass("dragged"),interactUtils.restoreOriginalPosition($target),interactUtils.iFrameDragFixOff()}})).styleCursor(!1),interact(filledGapSelector).draggable(_.assign({},dragOptions,{onstart:function onstart(e){var $target=$$1(e.target),scale;$target.addClass("dragged"),_handleFilledGapSelect($target),_iFrameDragFix(filledGapSelector,e.target),scale=interactUtils.calculateScale(e.target),scaleX=scale[0],scaleY=scale[1]},onmove:function onmove(e){interactUtils.moveElement(e.target,e.dx/scaleX,e.dy/scaleY)},onend:function onend(e){var $target=$$1(e.target);$target.removeClass("dragged"),interactUtils.restoreOriginalPosition($target),$activeChoice&&(_unsetChoice($activeChoice),_resetSelection()),interactUtils.iFrameDragFixOff()}})).styleCursor(!1),interact(gapSelector).dropzone({overlap:.05,ondragenter:function ondragenter(e){var $target=$$1(e.target),$dragged=$$1(e.relatedTarget);$activeDrop=$target,$target.addClass("dropzone"),$dragged.addClass("droppable")},ondrop:function ondrop(e){_handleGapSelect($$1(e.target)),this.ondragleave(e)},ondragleave:function ondragleave(e){var $target=$$1(e.target),$dragged=$$1(e.relatedTarget);$target.removeClass("dropzone"),$dragged.removeClass("droppable"),$activeDrop=null}})),interact($container.selector).on("tap",function(e){e.stopPropagation(),_resetSelection()}),interact(choiceSelector).on("tap",function(e){e.stopPropagation(),_handleChoiceSelect($$1(e.currentTarget)),e.preventDefault()}),interact(gapSelector).on("tap",function(e){e.stopPropagation(),_handleGapSelect($$1(e.currentTarget)),e.preventDefault()}),interact(binSelector).on("tap",function(e){e.stopPropagation(),_unsetChoice($activeChoice),_resetSelection(),e.preventDefault()})},resetResponse=function(interaction){var $container=containerHelper.get(interaction);$$1(".gapmatch-content.active",$container).removeClass("active"),$$1(".gapmatch-content",$container).each(function(){unsetChoice(interaction,$$1(this))})},_setPairs=function(interaction,pair){pair&&pair.length&&setChoice(interaction,getChoice(interaction,pair[0]),getGap(interaction,pair[1]).find(".gapmatch-content"))},setResponse=function(interaction,response){resetResponse(interaction);var pairs=pciResponse.unserialize(response,interaction);_.isArray(pairs)&&_.isArray(pairs[0])?_.forEach(pairs,function(pair){return _setPairs(interaction,pair)}):_setPairs(interaction,pairs)},_getRawResponse=function(interaction){var response=[],$container=containerHelper.get(interaction);return $$1(".gapmatch-content",$container).each(function(){var choiceSerial=$$1(this).data("serial"),pair=[];choiceSerial&&pair.push(interaction.getChoice(choiceSerial).attr("identifier")),pair.push($$1(this).data("identifier")),2===pair.length&&response.push(pair)}),response},getResponse=function(interaction){return pciResponse.serialize(_getRawResponse(interaction),interaction)},destroy=function(interaction){var $container=containerHelper.get(interaction);interact($container.selector).unset(),interact($container.find(".choice-area").selector+" .qti-choice").unset(),interact($container.find(".qti-flow-container").selector+" .gapmatch-content").unset(),interact($container.find(".remove-choice").selector).unset(),$container.find(".gapmatch-content").empty(),$container.find(".active").removeClass("active"),$container.find(".remove-choice").remove(),$container.find(".empty").removeClass("empty"),containerHelper.reset(interaction)},setState=function(interaction,state){var $container;_.isObject(state)&&(state.response&&(interaction.resetResponse(),interaction.setResponse(state.response)),_.isArray(state.order)&&state.order.length===_.size(interaction.getChoices())&&($container=containerHelper.get(interaction),$$1(".choice-area .qti-choice",$container).sort(function(a,b){var aIndex=_.indexOf(state.order,$$1(a).data("identifier")),bIndex=_.indexOf(state.order,$$1(b).data("identifier"));return aIndex>bIndex?1:aIndex<bIndex?-1:0}).detach().appendTo($$1(".choice-area",$container))))},getState=function(interaction){var state={},response=interaction.getResponse(),$container;return response&&(state.response=response),!0===interaction.attr("shuffle")&&($container=containerHelper.get(interaction),state.order=[],$$1(".choice-area .qti-choice",$container).each(function(){state.order.push($$1(this).data("identifier"))})),state},GapMatchInteraction={qtiClass:"gapMatchInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:render,getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:destroy,setState:setState,getState:getState};return GapMatchInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicAssociateInteraction",["jquery","lodash","i18n","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager"],function($$1,_,__,Handlebars,DOMPurify,graphic,pciResponse,containerHelper,instructionMgr){'use strict';$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,graphic=graphic&&Object.prototype.hasOwnProperty.call(graphic,"default")?graphic["default"]:graphic,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-graphicInteraction qti-graphicAssociateInteraction clearfix",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"image-editor solid\">\n <div id='graphic-paper-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"' class=\"main-image-box\"></div>\n </div>\n</div>\n",buffer}),_renderChoice=function(interaction,choice){var shape=choice.attr("shape"),coords=choice.attr("coords"),maxAssociations=interaction.attr("maxAssociations"),rElement=graphic.createElement(interaction.paper,shape,coords,{id:choice.serial,title:__("Select this area to start an association")}).data("max",choice.attr("matchMax")).data("matching",0).removeData("assocs").click(function(){var self=this,active,assocs;return 0<maxAssociations&&_getRawResponse(interaction).length>=maxAssociations?(_shapesUnSelectable(interaction),void instructionMgr.validateInstructions(interaction,{choice:choice,target:this})):void(active=_getActiveElement(interaction),this.selectable?(active&&(active.data("matching",active.data("matching")+1),this.data("matching",this.data("matching")+1),assocs=active.data("assocs")||[],assocs.push(choice.id()),active.data("assocs",assocs),_createPath(interaction,active,this,function(){active.data("matching",active.data("matching")-1),self.data("matching",self.data("matching")-1),active.data("assocs",_.pull(active.data("assocs")||[],choice.id())),containerHelper.triggerResponseChangeEvent(interaction),instructionMgr.validateInstructions(interaction,{choice:choice,target:self})})),_shapesUnSelectable(interaction)):this.active?_shapesUnSelectable(interaction):_isMatchable(this)&&(active&&_shapesUnSelectable(interaction),graphic.updateElementState(this,"active",__("Select this area to start an association")),this.active=!0,_shapesSelectable(interaction,this)),containerHelper.triggerResponseChangeEvent(interaction),instructionMgr.validateInstructions(interaction,{choice:choice,target:this}))})},_paperUnSelect=function(interaction){var $container=containerHelper.get(interaction),image=interaction.paper.getById("bg-image-"+interaction.serial);image&&image.click(function(){_shapesUnSelectable(interaction),$container.trigger("unselect.graphicassociate")})},_getActiveElement=function(interaction){var active;return _.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);if(element&&!0===element.active)return active=element,!1}),active},_createPath=function(interaction,srcElement,destElement,onRemove){function showCloser(){closerBg.toFront().animate({opacity:.8},300).click(removeSet),closer.toFront().animate({opacity:1},300).click(removeSet)}function hideCloser(){closerBg&&closerBg.type&&(closerBg.animate({opacity:0},300,function(){closerBg.toBack()}).unclick(),closer.animate({opacity:0},300,function(){closer.toBack()}).unclick())}function removeSet(){_.invoke(vset,"remove"),interaction._vsets=_.without(interaction._vsets,vset),"function"==typeof onRemove&&onRemove()}var $container=containerHelper.get(interaction),vset=[],src=srcElement.getBBox(),sx=src.x+src.width/2,sy=src.y+src.height/2,dest=destElement.getBBox(),dx=dest.x+dest.width/2,dy=dest.y+dest.height/2,srcBullet=interaction.paper.circle(sx,sy,3).attr(graphic._style["assoc-bullet"]),destBullet=interaction.paper.circle(dx,dy,3).attr(graphic._style["assoc-bullet"]),path=interaction.paper.path("M"+sx+","+sy+"L"+sx+","+sy).attr(graphic._style.assoc).animate({path:"M"+sx+","+sy+"L"+dx+","+dy},300),layer=interaction.paper.path("M"+sx+","+sy+"L"+dx+","+dy).attr(graphic._style["assoc-layer"]),midPath=layer.getPointAtLength(layer.getTotalLength()/2),closerBg=interaction.paper.circle(midPath.x,midPath.y,9).attr(graphic._style["close-bg"]).toBack(),closer=interaction.paper.path(graphic._style.close.path).attr(graphic._style.close).transform("T"+(midPath.x-9)+","+(midPath.y-9)).attr("title",_("Click again to remove")).toBack();srcElement.toFront(),destElement.toFront(),vset=[srcBullet,path,destBullet,layer,closerBg,closer],interaction._vsets.push(vset),_.invoke(vset,"data","assoc-path",!0),layer.click(function(){0===closer.attrs.opacity?showCloser():hideCloser()}),$container.on("unselect.graphicassociate",function(){hideCloser()})},_shapesSelectable=function(interaction,active){var assocs=active.data("assocs")||[],choices=interaction.getChoices(),activeChoice=choices[active.id];_.forEach(choices,function(choice){var element,assocsElement;_.contains(assocs,choice.id())||(element=interaction.paper.getById(choice.serial),assocsElement=element.data("assocs")||[],!element.active&&element.id!==active.id&&_isMatchable(element)&&!_.contains(assocsElement,activeChoice.id())&&(element.selectable=!0,graphic.updateElementState(element,"selectable")))})},_shapesUnSelectable=function(interaction){_.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);element&&(element.selectable=!1,element.active=!1,graphic.updateElementState(element,"basic"))})},_isMatchable=function(element){var matchable=!1,matching,matchMax;return element&&(matchMax=element.data("max")||0,matching=element.data("matching")||0,matchable=0===matchMax||matchMax>matching),matchable},_getRawResponse=function(interaction){var responses=[];return _.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial),assocs=element.data("assocs");element&&assocs&&(responses=responses.concat(_.map(assocs,function(id){return[choice.id(),id]})))}),responses},setResponse=function(interaction,response){var responseValues,map;if(response&&interaction.paper){try{responseValues=pciResponse.unserialize(response,interaction),2!==responseValues.length||Array.isArray(responseValues[0])||Array.isArray(responseValues[1])||(responseValues=[responseValues])}catch(e){}_.isArray(responseValues)&&(map=_.transform(interaction.getChoices(),function(res,choice){res[choice.id()]=interaction.paper.getById(choice.serial)}),_.forEach(responseValues,function(responseValue){var el1,el2;_.isArray(responseValue)&&2===responseValue.length&&(el1=map[responseValue[0]],el2=map[responseValue[1]],el1&&el2&&(graphic.trigger(el1,"click"),graphic.trigger(el2,"click")))}))}},resetResponse=function(interaction){var toRemove=[];_.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);element&&element.data({max:choice.attr("matchMax"),matching:0,assocs:[]})}),interaction&&interaction.paper&&interaction.paper.forEach(function(elt){elt.data("assoc-path")&&toRemove.push(elt)}),_.invoke(toRemove,"remove")},getResponse=function(interaction){var raw=_getRawResponse(interaction),response=pciResponse.serialize(raw,interaction);return response},destroy=function(interaction){var $container;interaction.paper&&($container=containerHelper.get(interaction),$$1(window).off("resize.qti-widget."+interaction.serial),$container.off("resize.qti-widget."+interaction.serial),interaction.paper.clear(),instructionMgr.removeInstructions(interaction),$container.off(".graphicassociate"),$$1(".main-image-box",$container).empty().removeAttr("style"),$$1(".image-editor",$container).removeAttr("style"),$$1("ul",$container).empty()),containerHelper.reset(interaction)},setState=function(interaction,state){_.isObject(state)&&state.response&&(interaction.resetResponse(),interaction.setResponse(state.response))},GraphicAssociateInteraction={qtiClass:"graphicAssociateInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:function(interaction){var self=this;return new Promise(function(resolve){var $container=containerHelper.get(interaction),background=interaction.object.attributes;interaction._vsets=[],$container.off("resized.qti-widget.resolve").one("resized.qti-widget.resolve",resolve),interaction.paper=graphic.responsivePaper("graphic-paper-"+interaction.serial,interaction.serial,{width:background.width,height:background.height,img:self.resolveUrl(background.data),imgId:"bg-image-"+interaction.serial,container:$container}),_.forEach(interaction.getChoices(),_.partial(_renderChoice,interaction)),_paperUnSelect(interaction),instructionMgr.minMaxChoiceInstructions(interaction,{min:interaction.attr("minAssociations"),max:interaction.attr("maxAssociations"),getResponse:_getRawResponse,onError:function onError(data){data&&data.target&&graphic.highlightError(data.target)}})})},getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state}};return GraphicAssociateInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicGapMatchInteraction",["jquery","lodash","i18n","module","core/mouseEvent","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","interact","ui/interactUtils"],function($$1,_,__,module,mouseEvent,Handlebars,DOMPurify,graphic,pciResponse,containerHelper,instructionMgr,interact,interactUtils){'use strict';$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,module=module&&Object.prototype.hasOwnProperty.call(module,"default")?module["default"]:module,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,graphic=graphic&&Object.prototype.hasOwnProperty.call(graphic,"default")?graphic["default"]:graphic,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr,interact=interact&&Object.prototype.hasOwnProperty.call(interact,"default")?interact["default"]:interact,interactUtils=interactUtils&&Object.prototype.hasOwnProperty.call(interactUtils,"default")?interactUtils["default"]:interactUtils;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program9(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-graphicInteraction qti-graphicGapMatchInteraction clearfix",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"image-editor solid\">\n <div id='graphic-paper-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"' class=\"main-image-box\"></div>\n <div class=\"clearfix\"></div>\n <ul class=\"none block-listing horizontal source\">\n ",options={hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data},(helper=helpers.gapImgs)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.gapImgs,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.gapImgs||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </ul>\n </div>\n</div>\n",buffer}),activeDrop=null,_choiceUsages={},isDirectedPairFlipped=module.config().flipDirectedPair,_isMatchable=function(element){var matchable=!1,matching,matchMax;return element&&(matchMax=element.data("max")||0,matching=element.data("matching")||[],matchable=0===matchMax||matchMax>matching.length),matchable},_shapesSelectable=function(interaction){var tooltip=__("Select the area to add an image");_.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);_isMatchable(element)&&(element.selectable=!0,graphic.setStyle(element,"selectable"),graphic.updateTitle(element,tooltip))}),_.forEach(interaction.gapFillers,function(gapFiller){gapFiller.forEach(function(element){graphic.updateTitle(element,tooltip)})})},_shapesUnSelectable=function(interaction){_.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);element&&(element.selectable=!1,graphic.setStyle(element,"basic"),graphic.updateTitle(element,__("Select an image first")))}),_.forEach(interaction.gapFillers,function(gapFiller){gapFiller.forEach(function(element){graphic.updateTitle(element,__("Remove"))})})},_paperUnSelect=function(interaction){var $container=containerHelper.get(interaction),$gapImages=$$1("ul > li",$container),bgImage=interaction.paper.getById("bg-image-"+interaction.serial);bgImage&&interact(bgImage.node).on("tap",function(){_shapesUnSelectable(interaction),$gapImages.removeClass("active")})},_setChoice=function(interaction,$choice){var choiceSerial=$choice.data("serial"),choice=interaction.getGapImg(choiceSerial),matchMax,usages;_choiceUsages[choiceSerial]||(_choiceUsages[choiceSerial]=0),_choiceUsages[choiceSerial]++,!interaction.responseMappingMode&&choice.attr("matchMax")&&(matchMax=+choice.attr("matchMax"),usages=+_choiceUsages[choiceSerial],0!==matchMax&&matchMax<=usages&&(interact($choice.get(0)).draggable(!1),$choice.addClass("disabled"),$choice.removeClass("selectable")))},_unsetChoice=function(interaction,$choice){var choiceSerial=$choice.data("serial");_choiceUsages[choiceSerial]--,$choice.removeClass("disabled"),$choice.addClass("selectable"),interact($choice.get(0)).draggable(!0)},_selectShape=function(interaction,element){var $container=containerHelper.get(interaction),$gapList=$$1("ul",$container),$active=$gapList.find(".active:first"),$imageBox=$$1(".main-image-box",$container),boxOffset=$imageBox.offset(),$img,$clone,gapFiller,id,bbox,shapeOffset,activeOffset,matching,currentCount;$active.length&&(id=$active.data("identifier"),matching=element.data("matching")||[],matching.push(id),element.data("matching",matching),currentCount=matching.length,$img=$active.find("img"),_shapesUnSelectable(interaction),$gapList.children().removeClass("active"),_setChoice(interaction,$active),$clone=$img.clone(),shapeOffset=$$1(element.node).offset(),activeOffset=$active.offset(),$clone.css({position:"absolute",display:"block","z-index":1e4,opacity:.8,top:activeOffset.top-boxOffset.top,left:activeOffset.left-boxOffset.left}),$clone.appendTo($imageBox),$clone.animate({top:shapeOffset.top-boxOffset.top,left:shapeOffset.left-boxOffset.left},200,function(){var gapFillerImage;$clone.remove(),bbox=element.getBBox(),gapFiller=graphic.createBorderedImage(interaction.paper,{url:$img.attr("src"),left:bbox.x+8*(currentCount-1),top:bbox.y+8*(currentCount-1),width:parseInt($img.attr("width"),10),height:parseInt($img.attr("height"),10),padding:0,border:!1,shadow:!0}).data("identifier",id).toFront(),gapFillerImage=gapFiller[2].node,interact(gapFillerImage).on("tap",function(e){var target=e.currentTarget,rElement=interaction.paper.getById(target.raphaelid);e.preventDefault(),e.stopPropagation(),0<$gapList.find(".active").length?interactUtils.tapOn(element.node):(element.data("matching",_.without(element.data("matching")||[],rElement.data("identifier"))),interaction.gapFillers=_.without(interaction.gapFillers,gapFiller),gapFiller.remove(),_unsetChoice(interaction,$active),containerHelper.triggerResponseChangeEvent(interaction))}),interaction.gapFillers.push(gapFiller),containerHelper.triggerResponseChangeEvent(interaction)}))},_renderChoice=function(interaction,choice){function handleShapeSelect(){_isMatchable(rElement)&&!0===rElement.selectable&&_selectShape(interaction,rElement)}var rElement=graphic.createElement(interaction.paper,choice.attr("shape"),choice.attr("coords"),{id:choice.serial,title:__("Select an image first"),hover:!1}).data("max",choice.attr("matchMax")).data("matching",[]);interact(rElement.node).on("tap",function(){handleShapeSelect()}),isDragAndDropEnabled&&interact(rElement.node).dropzone({overlap:.15,ondragenter:function ondragenter(){_isMatchable(rElement)&&(graphic.setStyle(rElement,"hover"),activeDrop=rElement.node)},ondrop:function ondrop(){_isMatchable(rElement)&&(graphic.setStyle(rElement,"selectable"),handleShapeSelect(),activeDrop=null)},ondragleave:function ondragleave(){_isMatchable(rElement)&&(graphic.setStyle(rElement,"selectable"),activeDrop=null)}})},_iFrameDragFix=function(draggableSelector,target){interactUtils.iFrameDragFixOn(function(){activeDrop&&interact(activeDrop).fire({type:"drop",target:activeDrop,relatedTarget:target}),interact(draggableSelector).fire({type:"dragend",target:target})})},_renderGapList=function(interaction,$gapList){function toggleActiveGapState($target){$target.hasClass("disabled")||($target.hasClass("active")?_setInactiveGapState($target):_setActiveGapState($target))}function _setActiveGapState($target){$gapList.children("li").removeClass("active"),$target.addClass("active"),_shapesSelectable(interaction)}function _setInactiveGapState($target){$target.removeClass("active"),_shapesUnSelectable(interaction)}var gapFillersSelector=$gapList.selector+" li",dragOptions,scaleX,scaleY;interact(gapFillersSelector).on("tap",function(e){e.stopPropagation(),e.preventDefault(),toggleActiveGapState($$1(e.currentTarget))}),isDragAndDropEnabled&&(dragOptions={inertia:!1,autoScroll:!0,restrict:{restriction:".qti-interaction",endOnly:!1,elementRect:{top:0,left:0,bottom:1,right:1}}},$$1(gapFillersSelector).each(function(index,gap){interact(gap).draggable(_.assign({},dragOptions,{onstart:function onstart(e){var $target=$$1(e.target),scale;_setActiveGapState($target),$target.addClass("dragged"),_iFrameDragFix(gapFillersSelector,e.target),scale=interactUtils.calculateScale(e.target),scaleX=scale[0],scaleY=scale[1]},onmove:function onmove(e){interactUtils.moveElement(e.target,e.dx/scaleX,e.dy/scaleY)},onend:function onend(e){_.defer(function(){var $target=$$1(e.target);_setInactiveGapState($target),$target.removeClass("dragged"),interactUtils.restoreOriginalPosition($target),interactUtils.iFrameDragFixOff()})}})).styleCursor(!1)}))},_getRawResponse=function(interaction){var pairs=[];return _.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);element&&_.isArray(element.data("matching"))&&_.forEach(element.data("matching"),function(gapImg){isDirectedPairFlipped?pairs.push([choice.id(),gapImg]):pairs.push([gapImg,choice.id()])})}),_.sortBy(pairs,[0,1])},setResponse=function(interaction,response){var $container=containerHelper.get(interaction),responseValues;if(response&&interaction.paper){try{responseValues=pciResponse.unserialize(response,interaction)}catch(e){responseValues=null}_.isArray(responseValues)&&_.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);element&&_.forEach(responseValues,function(pair){var responseChoice,responseGap;2===pair.length&&(responseChoice=isDirectedPairFlipped?pair[0]:pair[1],responseGap=isDirectedPairFlipped?pair[1]:pair[0],responseChoice===choice.id()&&($$1("[data-identifier=\""+responseGap+"\"]",$container).addClass("active"),_selectShape(interaction,element)))})})}},resetResponse=function(interaction){_shapesUnSelectable(interaction),_.forEach(interaction.gapFillers,function(gapFiller){interactUtils.tapOn(gapFiller.items[2][0])})},getResponse=function(interaction){var raw=_getRawResponse(interaction);return pciResponse.serialize(raw,interaction)},destroy=function(interaction){var $container;interaction.paper&&($container=containerHelper.get(interaction),$$1(window).off("resize.qti-widget."+interaction.serial),$container.off("resize.qti-widget."+interaction.serial),interaction.paper.clear(),instructionMgr.removeInstructions(interaction),$$1(".main-image-box",$container).empty().removeAttr("style"),$$1(".image-editor",$container).removeAttr("style"),$$1("ul",$container).empty(),interact($container.find("ul.source li").selector).unset(),interact($container.find(".main-image-box rect").selector).unset()),containerHelper.reset(interaction)},setState=function(interaction,state){_.isObject(state)&&state.response&&(interaction.resetResponse(),interaction.setResponse(state.response))},GraphicGapMatchInteraction={qtiClass:"graphicGapMatchInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:function(interaction){var self=this;return new Promise(function(resolve){var $container=containerHelper.get(interaction),$gapList=$$1("ul.source",$container),background=interaction.object.attributes;interaction.gapFillers=[],self.getOption&&self.getOption("enableDragAndDrop")&&self.getOption("enableDragAndDrop").graphicGapMatch&&(isDragAndDropEnabled=self.getOption("enableDragAndDrop").graphicGapMatch),$container.off("resized.qti-widget.resolve").one("resized.qti-widget.resolve",resolve),interaction.paper=graphic.responsivePaper("graphic-paper-"+interaction.serial,interaction.serial,{width:background.width,height:background.height,img:self.resolveUrl(background.data),imgId:"bg-image-"+interaction.serial,container:$container,resize:function resize(newSize,factor){$gapList.css("max-width",newSize+"px"),1!==factor&&$gapList.find("img").each(function(){var $img=$$1(this);$img.width($img.attr("width")*factor),$img.height($img.attr("height")*factor)})}}),_.forEach(interaction.getChoices(),_.partial(_renderChoice,interaction)),_renderGapList(interaction,$gapList),_paperUnSelect(interaction)})},getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state},isDirectedPairFlipped:isDirectedPairFlipped},isDragAndDropEnabled;return GraphicGapMatchInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicOrderInteraction",["jquery","lodash","i18n","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager"],function($$1,_,__,Handlebars,DOMPurify,graphic,pciResponse,containerHelper,instructionMgr){'use strict';$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,graphic=graphic&&Object.prototype.hasOwnProperty.call(graphic,"default")?graphic["default"]:graphic,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-graphicInteraction qti-graphicOrderInteraction clearfix",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"image-editor solid\">\n <div id='graphic-paper-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"' class=\"main-image-box\"></div>\n <div class=\"clearfix\"></div>\n <ul class=\"none block-listing horizontal ordinals\"></ul>\n </div>\n</div>\n",buffer}),_renderChoice=function(interaction,$orderList,choice){graphic.createElement(interaction.paper,choice.attr("shape"),choice.attr("coords"),{id:choice.serial,title:__("Select this area")}).click(function(e){$$1(e.currentTarget).closest(".qti-item").hasClass("prevent-click-handler")||(this.active?_unselectShape(interaction.paper,this,$orderList):_selectShape(interaction.paper,this,$orderList),containerHelper.triggerResponseChangeEvent(interaction),instructionMgr.validateInstructions(interaction,{choice:choice}))})},_renderOrderList=function(interaction,$orderList){var size=_.size(interaction.getChoices()),min=interaction.attr("minChoices"),max=interaction.attr("maxChoices"),$orderers;0<max&&max<=size?size=max:0<min&&min<=size&&(size=min),_.times(size,function(index){var position=index+1,$orderer=$$1("<li class=\"selectable\" data-number=\""+position+"\">"+position+"</li>");0===index&&$orderer.addClass("active"),$orderList.append($orderer)}),_createTexts(interaction.paper,size),$orderers=$orderList.children("li"),$orderers.click(function(e){e.preventDefault();var $orderer=$$1(this);$orderer.hasClass("active")||$orderer.hasClass("disabled")||($orderers.removeClass("active"),$orderer.addClass("active"))})},_selectShape=function(paper,element,$orderList){var $active=$orderList.find(".active:first");$active.length&&0<$active.data("number")&&(element.data("number",$active.data("number")),element.active=!0,_showText(paper,element),graphic.updateElementState(element,"active"),$active.toggleClass("active disabled").siblings(":not(.disabled)").first().toggleClass("active"))},_unselectShape=function(paper,element,$orderList){var number=element.data("number");element.active=!1,_hideText(paper,element),element.removeData("number"),graphic.updateElementState(element,"basic"),$orderList.children().removeClass("active").filter("[data-number="+number+"]").removeClass("disabled").addClass("active")},_createTexts=function(paper,size){var texts=[];return _.times(size,function(index){var number=index+1,text=graphic.createText(paper,{id:"text-"+number,content:number,title:__("Remove"),style:"order-text",hide:!0});text.click(function(){paper.forEach(function(element){if(element.data("number")===number&&element.events){var evt=_.where(element.events,{name:"click"});evt.length&&evt[0]&&"function"==typeof evt[0].f&&evt[0].f.call(element)}})}),texts.push(text)}),texts},_showText=function(paper,element){var bbox=element.getBBox(),text=paper.getById("text-"+element.data("number")),transf;text&&(transf="T"+(bbox.x+bbox.width/2)+","+(bbox.y+bbox.height/2),text.transform(transf).show().toFront())},_hideText=function(paper,element){var text=paper.getById("text-"+element.data("number"));text&&text.hide()},_getRawResponse=function(interaction){var response=[];return _.forEach(interaction.getChoices(),function(choice){var elt=interaction.paper.getById(choice.serial);elt&&elt.data("number")&&response.push({index:elt.data("number"),id:choice.id()})}),_(response).sortBy("index").map("id").value()},setResponse=function(interaction,response){var $container=containerHelper.get(interaction),$orderList=$$1("ul",$container),responseValues;if(response&&interaction.paper){try{responseValues=pciResponse.unserialize(response,interaction)}catch(e){}_.isArray(responseValues)&&_.forEach(responseValues,function(responseValue,index){var choice=_(interaction.getChoices()).where({attributes:{identifier:responseValue}}).first(),element;choice&&(element=interaction.paper.getById(choice.serial),element&&($orderList.children("[data-number="+(index+1)+"]").addClass("active"),_selectShape(interaction.paper,element,$orderList)))})}},resetResponse=function(interaction){var $container=containerHelper.get(interaction),$orderList=$$1("ul",$container);_.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);element&&_unselectShape(interaction.paper,element,$orderList)}),$orderList.children("li").removeClass("active disabled").first().addClass("active")},getResponse=function(interaction){return pciResponse.serialize(_getRawResponse(interaction),interaction)},destroy=function(interaction){var $container;interaction.paper&&($container=containerHelper.get(interaction),$$1(window).off("resize.qti-widget."+interaction.serial),$container.off("resize.qti-widget."+interaction.serial),interaction.paper.clear(),instructionMgr.removeInstructions(interaction),$$1(".main-image-box",$container).empty().removeAttr("style"),$$1(".image-editor",$container).removeAttr("style"),$$1("ul",$container).empty()),containerHelper.reset(interaction)},setState=function(interaction,state){_.isObject(state)&&state.response&&(interaction.resetResponse(),interaction.setResponse(state.response))},GraphicOrderInteraction={qtiClass:"graphicOrderInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:function(interaction){var self=this;return new Promise(function(resolve){var $container=containerHelper.get(interaction),$orderList=$$1("ul",$container),background=interaction.object.attributes;$container.off("resized.qti-widget.resolve").one("resized.qti-widget.resolve",resolve),interaction.paper=graphic.responsivePaper("graphic-paper-"+interaction.serial,interaction.serial,{width:background.width,height:background.height,img:self.resolveUrl(background.data),imgId:"bg-image-"+interaction.serial,container:$container}),_renderOrderList(interaction,$orderList),_.forEach(interaction.getChoices(),_.partial(_renderChoice,interaction,$orderList)),instructionMgr.minMaxChoiceInstructions(interaction,{min:interaction.attr("minChoices"),max:interaction.attr("maxChoices"),getResponse:_getRawResponse,onError:function onError(data){graphic.highlightError(data.target)}})})},getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state}};return GraphicOrderInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/HotspotInteraction",["jquery","lodash","i18n","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager"],function($$1,_,__,Handlebars,DOMPurify,graphic,pciResponse,containerHelper,instructionMgr){'use strict';$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,graphic=graphic&&Object.prototype.hasOwnProperty.call(graphic,"default")?graphic["default"]:graphic,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-graphicInteraction qti-hotspotInteraction clearfix",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"image-editor solid\">\n <div id='graphic-paper-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"' class=\"main-image-box\"></div>\n </div>\n</div>\n",buffer}),_renderChoice=function(interaction,choice){var $container=containerHelper.get(interaction),rElement=graphic.createElement(interaction.paper,choice.attr("shape"),choice.attr("coords"),{id:choice.serial,title:__("Select this area")}).click(function(){this.active?(graphic.updateElementState(this,"basic",__("Select this area")),this.active=!1,$container.trigger("inactiveChoice.qti-widget",[choice,this])):(graphic.updateElementState(this,"active",__("Click again to remove")),this.active=!0,$container.trigger("activeChoice.qti-widget",[choice,this])),containerHelper.triggerResponseChangeEvent(interaction),instructionMgr.validateInstructions(interaction,{choice:choice,target:this})})},_getRawResponse=function(interaction){return _(interaction.getChoices()).map(function(choice){var rElement=interaction.paper.getById(choice.serial);return!!(rElement&&!0===rElement.active)&&choice.id()}).filter(_.isString).value()},setResponse=function(interaction,response){var responseValues;if(response&&interaction.paper){try{responseValues=pciResponse.unserialize(response,interaction)}catch(e){}_.isArray(responseValues)&&_.forEach(interaction.getChoices(),function(choice){var rElement;_.contains(responseValues,choice.attributes.identifier)&&(rElement=interaction.paper.getById(choice.serial),rElement&&(rElement.active=!0,graphic.updateElementState(rElement,"active",__("Click again to remove")),instructionMgr.validateInstructions(interaction,{choice:choice,target:rElement})))})}},resetResponse=function(interaction){_.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);element&&(element.active=!1,graphic.updateElementState(element,"basic"))}),instructionMgr.resetInstructions(interaction)},getResponse=function(interaction){var raw=_getRawResponse(interaction),response=pciResponse.serialize(_getRawResponse(interaction),interaction);return response},destroy=function(interaction){var $container;interaction.paper&&($container=containerHelper.get(interaction),$$1(window).off("resize.qti-widget."+interaction.serial),$container.off("resize.qti-widget."+interaction.serial),interaction.paper.clear(),instructionMgr.removeInstructions(interaction),$$1(".main-image-box",$container).empty().removeAttr("style"),$$1(".image-editor",$container).removeAttr("style")),containerHelper.reset(interaction)},setState=function(interaction,state){_.isObject(state)&&state.response&&(interaction.resetResponse(),interaction.setResponse(state.response))},HotspotInteraction={qtiClass:"hotspotInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:function(interaction){var self=this;return new Promise(function(resolve){var $container=containerHelper.get(interaction),background=interaction.object.attributes;$container.off("resized.qti-widget.resolve").one("resized.qti-widget.resolve",resolve),interaction.paper=graphic.responsivePaper("graphic-paper-"+interaction.serial,interaction.serial,{width:background.width,height:background.height,img:self.resolveUrl(background.data),container:$container}),_.forEach(interaction.getChoices(),_.partial(_renderChoice,interaction)),instructionMgr.minMaxChoiceInstructions(interaction,{min:interaction.attr("minChoices"),max:interaction.attr("maxChoices"),getResponse:_getRawResponse,onError:function onError(data){data.target.active&&(data.target.active=!1,graphic.updateElementState(this,"basic",__("Select this area")),graphic.highlightError(data.target),containerHelper.triggerResponseChangeEvent(interaction),$container.trigger("inactiveChoice.qti-widget",[data.choice,data.target]))}})})},getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state}};return HotspotInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/HottextInteraction",["jquery","lodash","handlebars","i18n","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse"],function($$1,_,Handlebars,__,DOMPurify,containerHelper,instructionMgr,pciResponse){'use strict';$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-hottextInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"hottextInteraction\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"qti-flow-container\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>\n</div>\n",buffer}),pseudoLabel=function(interaction){var $container=containerHelper.get(interaction),setChoice=function($choice,interaction){var $inupt=$choice.find("input");if($inupt.prop("checked")||$inupt.hasClass("disabled"))$inupt.prop("checked",!1);else{var maxChoices=parseInt(interaction.attr("maxChoices")),currentChoices=_.values(_getRawResponse(interaction)).length;(currentChoices<maxChoices||0===maxChoices)&&$inupt.prop("checked",!0)}containerHelper.triggerResponseChangeEvent(interaction),instructionMgr.validateInstructions(interaction,{choice:$choice})};$$1(".hottext",$container).on("click",function(e){e.preventDefault(),setChoice($$1(this),interaction)})},render=function(interaction){pseudoLabel(interaction),instructionMgr.minMaxChoiceInstructions(interaction,{min:interaction.attr("minChoices"),max:interaction.attr("maxChoices"),getResponse:_getRawResponse,onError:function onError(data){var $input,$choice,$icon;data.choice&&data.choice.length&&($choice=data.choice.addClass("error"),$input=$choice.find("input"),$icon=$choice.find(" > label > span").addClass("error cross"),setTimeout(function(){$input.prop("checked",!1),$choice.removeClass("error"),$icon.removeClass("error cross")},350))}})},resetResponse=function(interaction){var $container=containerHelper.get(interaction);$$1("input",$container).prop("checked",!1)},setResponse=function(interaction,response){var $container=containerHelper.get(interaction);try{_.each(pciResponse.unserialize(response,interaction),function(identifier){$container.find("input[value=\""+identifier+"\"]").prop("checked",!0)}),instructionMgr.validateInstructions(interaction)}catch(e){throw new Error("wrong response format in argument : "+e)}},_getRawResponse=function(interaction){var values=[],$container=containerHelper.get(interaction);return $$1("input:checked",$container).each(function(){values.push($$1(this).val())}),values},getResponse=function(interaction){return pciResponse.serialize(_getRawResponse(interaction),interaction)},destroy=function(interaction){var $container=containerHelper.get(interaction);$container.find(".hottext").off("click"),containerHelper.reset(interaction)},setState=function(interaction,state){_.isObject(state)&&state.response&&(interaction.resetResponse(),interaction.setResponse(state.response))},HottextInteraction={qtiClass:"hottextInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:render,getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state}};return HottextInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/InlineChoiceInteraction",["jquery","lodash","i18n","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","ui/tooltip","select2"],function($$1,_,__,Handlebars,DOMPurify,containerHelper,instructionMgr,pciResponse,tooltip){'use strict';$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,tooltip=tooltip&&Object.prototype.hasOwnProperty.call(tooltip,"default")?tooltip["default"]:tooltip;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<select ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-inlineInteraction qti-inlineChoiceInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-qti-class=\"inlineChoiceInteraction\"\n data-has-search=\"false\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n>\n <option></option> \n <option value=\"empty\"></option>\n ",options={hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data},(helper=helpers.choices)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.choices,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.choices||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</select>\n",buffer}),_emptyValue="empty",_defaultOptions={allowEmpty:!0,placeholderText:__("select a choice")},render=function(interaction,options){var opts=_.clone(_defaultOptions),required=!!interaction.attr("required"),$container=containerHelper.get(interaction),choiceTooltip;_.extend(opts,options),opts.allowEmpty&&!required?$container.find("option[value="+_emptyValue+"]").text("--- "+__("leave empty")+" ---"):$container.find("option[value="+_emptyValue+"]").remove(),$container.select2({width:"element",placeholder:opts.placeholderText,minimumResultsForSearch:-1,dropdownCssClass:"qti-inlineChoiceInteraction-dropdown"});var $el=$container.select2("container");required&&(choiceTooltip=tooltip.warning($el,__("A choice must be selected")),""===$container.val()&&choiceTooltip.show()),$container.on("change",function(e){if($$1(e.currentTarget).closest(".qti-item").hasClass("prevent-click-handler")){var $selectedIndex=$$1(e.currentTarget)[0].options.selectedIndex?$$1(e.currentTarget)[0].options.selectedIndex:null;$container.find("option").one("click",function(e){e.stopPropagation()}),$container.find("option").eq($selectedIndex).trigger("click")}required&&""!==$container.val()&&choiceTooltip.hide(),containerHelper.triggerResponseChangeEvent(interaction)}).on("select2-open",function(){required&&choiceTooltip.hide()}).on("select2-close",function(){required&&""===$container.val()&&choiceTooltip.show()})},_setVal=function(interaction,choiceIdentifier){containerHelper.get(interaction).val(choiceIdentifier).select2("val",choiceIdentifier)},setResponse=function(interaction,response){_setVal(interaction,pciResponse.unserialize(response,interaction)[0])},_getRawResponse=function(interaction){var value=containerHelper.get(interaction).val();return value&&value!==_emptyValue?[value]:[]},getResponse=function(interaction){return pciResponse.serialize(_getRawResponse(interaction),interaction)},destroy=function(interaction){var $container=containerHelper.get(interaction);$$1(document).off(".commonRenderer"),$container.select2("destroy"),instructionMgr.removeInstructions(interaction),containerHelper.reset(interaction)},setState=function(interaction,state){var $container;_.isObject(state)&&(state.response&&(interaction.resetResponse(),interaction.setResponse(state.response)),_.isArray(state.order)&&state.order.length===_.size(interaction.getChoices())&&($container=containerHelper.get(interaction),$container.select2("disable").select2("close"),$$1("option[data-identifier]",$container).sort(function(a,b){var aIndex=_.indexOf(state.order,$$1(a).data("identifier")),bIndex=_.indexOf(state.order,$$1(b).data("identifier"));return aIndex>bIndex?1:aIndex<bIndex?-1:0}).detach().appendTo($container),$container.select2("enable")))},getState=function(interaction){var state={},response=interaction.getResponse(),$container;return response&&(state.response=response),!0===interaction.attr("shuffle")&&($container=containerHelper.get(interaction),state.order=[],$$1("option[data-identifier]",$container).each(function(){state.order.push($$1(this).data("identifier"))})),state},InlineChoiceInteraction={qtiClass:"inlineChoiceInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:render,getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:function resetResponse(interaction){_setVal(interaction,_emptyValue)},destroy:destroy,setState:setState,getState:getState};return InlineChoiceInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/MatchInteraction",["jquery","lodash","i18n","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse"],function($$1,_,__,Handlebars,DOMPurify,containerHelper,instructionMgr,pciResponse){'use strict';$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program9(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}function program11(depth0,data,depth1){var buffer="",stack1;return buffer+="\n <tr>\n ",stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers.each.call(depth0,depth1&&depth1.matchSet1,{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </tr>\n ",buffer}function program12(){return"\n <td>\n <label>\n <input type=\"checkbox\" >\n <span class=\"icon-checkbox cross\"></span>\n </label>\n </td>\n "}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-matchInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"matchInteraction\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"match-interaction-area\">\n <table class=\"matrix\">\n <thead>\n <tr>\n <th> </th>\n ",options={hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data},(helper=helpers.matchSet1)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.matchSet1,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.matchSet1||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </tr>\n </thead>\n <tbody>\n ",options={hash:{},inverse:self.noop,fn:self.programWithDepth(11,program11,data,depth0),data:data},(helper=helpers.matchSet2)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.matchSet2,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.matchSet2||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.programWithDepth(11,program11,data,depth0),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </tbody>\n </table>\n </div>\n <div class=\"notification-container\"></div>\n</div>\n",buffer}),inWarning=!1,render=function(interaction){var $container=containerHelper.get(interaction);_setInstructions(interaction),$container.on("click.commonRenderer","input[type=checkbox]",function(e){_onCheckboxSelected(interaction,e)}),instructionMgr.validateInstructions(interaction)},setResponse=function(interaction,response){var $container=containerHelper.get(interaction);response=_filterResponse(response),"undefined"!=typeof response.list&&"undefined"!=typeof response.list.directedPair&&_(response.list.directedPair).forEach(function(directedPair){var x=$$1("th[data-identifier=\""+directedPair[0]+"\"]",$container).index()-1,y=$$1("th[data-identifier=\""+directedPair[1]+"\"]",$container).parent().index();$$1(".matrix > tbody tr",$container).eq(y).find("input[type=checkbox]").eq(x).prop("checked",!0)}),instructionMgr.validateInstructions(interaction)},getResponse=function(interaction){var response=pciResponse.serialize(_getRawResponse(interaction),interaction);return response},resetResponse=function(interaction){var $container=containerHelper.get(interaction);$$1("input[type=checkbox]:checked",$container).each(function(){$$1(this).prop("checked",!1)}),instructionMgr.validateInstructions(interaction)},_filterResponse=function(response){if("undefined"==typeof response.list){if("undefined"==typeof response.base)throw"The given response is not compliant with PCI JSON representation.";else{if(null===response.base)return{list:{directedPair:[]}};if("undefined"==typeof response.base.directedPair)throw"The matchInteraction only accepts directedPair values as responses.";else return{list:{directedPair:[response.base.directedPair]}}}}else if("undefined"==typeof response.list.directedPair)throw"The matchInteraction only accept directedPair values as responses.";else return response},_getRawResponse=function(interaction){var $container=containerHelper.get(interaction),values=[];return $container.find("input[type=checkbox]:checked").each(function(){values.push(_inferValue(this))}),values},_inferValue=function(element){var $element=$$1(element),$container=$element.closest(".match-interaction-area"),y=$element.closest("tr").index(),x=$element.closest("td").index(),firstId=$$1(".matrix > thead th",$container).eq(x).data("identifier"),secondId=$$1(".matrix > tbody th",$container).eq(y).data("identifier");return[firstId,secondId]},_onCheckboxSelected=function(interaction,e){var currentResponse=_getRawResponse(interaction),minAssociations=interaction.attr("minAssociations"),maxAssociations=interaction.attr("maxAssociations"),choice;0===maxAssociations&&(maxAssociations=_countChoices(interaction)),_.size(currentResponse)>maxAssociations?(e.preventDefault(),instructionMgr.validateInstructions(interaction)):!1===(choice=_maxMatchReached(interaction,e.target))?(containerHelper.triggerResponseChangeEvent(interaction,{}),instructionMgr.validateInstructions(interaction)):(e.preventDefault(),instructionMgr.validateInstructions(interaction,choice))},_maxMatchReached=function(interaction,input){var association=_inferValue(input),overflow=!1;return _(association).forEach(function(identifier){var choice=_getChoiceDefinitionByIdentifier(interaction,identifier),matchMin=choice.attributes.matchMin,matchMax=choice.attributes.matchMax,assoc=_countAssociations(interaction,choice);0<matchMax&&assoc>matchMax&&(overflow=choice)}),overflow},_countAssociations=function(interaction,choice){var rawResponse=_getRawResponse(interaction),count=0;return _(rawResponse).forEach(function(response){(response[0]===choice.attributes.identifier||response[1]===choice.attributes.identifier)&&count++}),count},_countChoices=function(interaction){var $container=containerHelper.get(interaction);return $container.find("input[type=checkbox]").length},_getChoiceDefinitionByIdentifier=function(interaction,identifier){var rawChoices=_getRawChoices(interaction);return rawChoices[identifier]},_getRawChoices=function(interaction){var rawChoices={};return _(interaction.choices).forEach(function(matchset){_(matchset).forEach(function(choice){rawChoices[choice.attributes.identifier]=choice})}),rawChoices},_setInstructions=function(interaction){var minAssociations=interaction.attr("minAssociations"),maxAssociations=interaction.attr("maxAssociations"),choiceCount=_countChoices(interaction),superClosure=function(){var onMaxChoicesReached=function(report,msg){!1===inWarning&&(inWarning=!0,report.update({level:"warning",message:__("Maximum number of choices reached."),timeout:2e3,stop:function stop(){report.update({level:"success",message:msg}),inWarning=!1}}))},onMatchMaxReached=function(interaction,choice,report,msg,level){var $container=containerHelper.get(interaction);if(!1===inWarning){inWarning=!0;var $choice=$container.find(".qti-simpleAssociableChoice[data-identifier=\""+choice.attributes.identifier+"\"]"),originalBackgroundColor=$choice.css("background-color"),originalColor=$choice.css("color");report.update({level:"warning",message:__("The highlighted choice cannot be associated more than %d time(s).").replace("%d",choice.attributes.matchMax),timeout:3e3,start:function start(){$choice.animate({backgroundColor:"#fff",color:"#ba122b"},250,function(){$choice.animate({backgroundColor:"#ba122b",color:"#fff"},250)})},stop:function stop(){$choice.animate({backgroundColor:originalBackgroundColor,color:originalColor},500),report.update({level:level,message:msg}),inWarning=!1}})}};0===minAssociations&&0<maxAssociations?(msg=__("You must select 0 to %d choices.").replace("%d",maxAssociations),instructionMgr.appendInstruction(interaction,msg,function(choice){var responseCount=_.size(_getRawResponse(interaction));choice&&choice.attributes&&0<choice.attributes.matchMax&&_countAssociations(interaction,choice)>choice.attributes.matchMax?onMatchMaxReached(interaction,choice,this,msg,this.getLevel()):responseCount<=maxAssociations?this.setLevel("success"):responseCount>maxAssociations?onMaxChoicesReached(this,msg):this.reset()})):0===minAssociations&&0===maxAssociations?(msg=__("You must select 0 to %d choices.").replace("%d",choiceCount),instructionMgr.appendInstruction(interaction,msg,function(choice){choice&&choice.attributes&&0<choice.attributes.matchMax&&_countAssociations(interaction,choice)>choice.attributes.matchMax?onMatchMaxReached(interaction,choice,this,msg,this.getLevel()):this.setLevel("success")})):0<minAssociations&&0===maxAssociations?(msg=__("You must select %1$d to %2$d choices."),msg=msg.replace("%1$d",minAssociations),msg=msg.replace("%2$d",choiceCount),instructionMgr.appendInstruction(interaction,msg,function(choice){var responseCount=_.size(_getRawResponse(interaction));choice&&choice.attributes&&0<choice.attributes.matchMax&&_countAssociations(interaction,choice)>choice.attributes.matchMax?onMatchMaxReached(interaction,choice,this,msg,this.getLevel()):responseCount<minAssociations?this.setLevel("info"):responseCount>choiceCount?onMaxChoicesReached(this,msg):this.setLevel("success")})):0<minAssociations&&0<maxAssociations&&(minAssociations===maxAssociations?(msg=__("You must select exactly %d choice(s)."),msg=msg.replace("%d",minAssociations)):(msg=__("You must select %1$d to %2$d choices."),msg=msg.replace("%1$d",minAssociations),msg=msg.replace("%2$d",maxAssociations)),instructionMgr.appendInstruction(interaction,msg,function(choice){var responseCount=_.size(_getRawResponse(interaction));choice&&choice.attributes&&0<choice.attributes.matchMax&&_countAssociations(interaction,choice)>choice.attributes.matchMax?onMatchMaxReached(interaction,choice,this,msg,this.getLevel()):responseCount<minAssociations?this.setLevel("info"):responseCount>maxAssociations?onMaxChoicesReached(this,msg):responseCount>=minAssociations&&responseCount<=maxAssociations&&this.setLevel("success")}))},msg;superClosure()},destroy=function(interaction){var $container=containerHelper.get(interaction);$container.off(".commonRenderer"),instructionMgr.removeInstructions(interaction),containerHelper.reset(interaction)},setState=function(interaction,state){var $container;_.isObject(state)&&(_.isArray(state.order)&&2===state.order.length&&($container=containerHelper.get(interaction),$$1("thead .qti-choice",$container).sort(function(a,b){var aIndex=_.indexOf(state.order[0],$$1(a).data("identifier")),bIndex=_.indexOf(state.order[0],$$1(b).data("identifier"));return aIndex>bIndex?1:aIndex<bIndex?-1:0}).detach().appendTo($$1("thead tr",$container)),$$1("tbody .qti-choice",$container).sort(function(a,b){var aIndex=_.indexOf(state.order[1],$$1(a).data("identifier")),bIndex=_.indexOf(state.order[1],$$1(b).data("identifier"));return aIndex>bIndex?1:aIndex<bIndex?-1:0}).detach().each(function(index,elt){$$1(elt).prependTo($$1("tbody tr",$container).eq(index))})),state.response&&(interaction.resetResponse(),interaction.setResponse(state.response)))},getState=function(interaction){var state={},response=interaction.getResponse(),$container;return response&&(state.response=response),!0===interaction.attr("shuffle")&&($container=containerHelper.get(interaction),state.order=[[],[]],$$1("thead .qti-choice",$container).each(function(){state.order[0].push($$1(this).data("identifier"))}),$$1("tbody .qti-choice",$container).each(function(){state.order[1].push($$1(this).data("identifier"))})),state},MatchInteraction={qtiClass:"matchInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:render,getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:destroy,setState:setState,getState:getState,inferValue:_inferValue};return MatchInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/MediaInteraction",["jquery","lodash","handlebars","i18n","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCommonRenderer/helpers/container","ui/mediaplayer"],function($$1,_,Handlebars,__,DOMPurify,pciResponse,containerHelper,mediaplayer){'use strict';function canPreviewMedia(type,url){var firefox=reFirefoxVersion.exec(navigator.userAgent),webm=reWebM.test(url);return!(webm&&firefox&&87<=parseFloat(firefox[1]))}function destroy(interaction){var $container=getContainer(interaction);interaction.mediaElement&&(interaction.mediaElement.destroy(),interaction.mediaElement=null),$$1(".instruction-container",$container).empty(),$$1(".media-container",$container).empty(),$container.removeData("timesPlayed"),$$1(window).off("resize.video"),containerHelper.reset(interaction)}function _getRawResponse(interaction){return[getContainer(interaction).data("timesPlayed")||0]}function setResponse(interaction,response){if(response)try{var maxPlays=parseInt(interaction.attr("maxPlays"),10)||0,responseValues=pciResponse.unserialize(response,interaction),timesPlayed=parseInt(responseValues[0],10);getContainer(interaction).data("timesPlayed",timesPlayed),interaction.mediaElement&&(0!==maxPlays&&maxPlays<=timesPlayed?interaction.mediaElement.disable():interaction.mediaElement.is("disabled")&&interaction.mediaElement.enable())}catch(e){}}function getResponse(interaction){return pciResponse.serialize(_getRawResponse(interaction),interaction)}function setState(interaction,state){var restorePlayerState=function(playerState){playerState&&interaction.mediaElement&&(_.isNumber(playerState.volume)&&interaction.mediaElement.setVolume(playerState.volume),_.isBoolean(playerState.muted)&&(interaction.mediaElement.mute(playerState.muted),interaction.mediaElement.startMuted=playerState.muted),playerState.position&&0<playerState.position&&(interaction.mediaElement.seek(playerState.position),!interaction.attr("autostart")&&interaction.mediaElement.pause()))};_.isObject(state)&&(state.response&&(interaction.resetResponse(),interaction.setResponse(state.response)),_.isPlainObject(state.player)&&interaction.mediaElement&&(interaction.mediaElement.is("ready")?restorePlayerState(state.player):interaction.mediaElement.on("ready.state",function(){interaction.mediaElement.off("ready.state"),restorePlayerState(state.player)})))}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,mediaplayer=mediaplayer&&Object.prototype.hasOwnProperty.call(mediaplayer,"default")?mediaplayer["default"]:mediaplayer;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-mediaInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"media-container\"></div>\n</div>\n",buffer}),getContainer=containerHelper.get,defaults={type:"video/mp4"},reWebM=/.*\.webm/i,reFirefoxVersion=/firefox\/([0-9]+\.*[0-9]*)/i;return{qtiClass:"mediaInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:function(interaction){var _this15=this;return new Promise(function(resolve){var $container=getContainer(interaction),media=interaction.object,$item=$container.parents(".qti-item"),maxPlays=parseInt(interaction.attr("maxPlays"),10)||0,canBePlayed=function(){return 0===maxPlays||maxPlays>parseInt($container.data("timesPlayed"),10)},resize=_.debounce(function(){if(interaction.mediaElement){var height=$container.find(".media-container").height(),width=$container.find(".media-container").width();interaction.mediaElement.resize(width,height)}},200),initMediaPlayer=function(){if(!interaction.mediaElement){var type=media.attr("type")||defaults.type,mediaUrl=media.attr("data")||"",url=mediaUrl&&_this15.resolveUrl(mediaUrl),preview=canPreviewMedia(type,url);interaction.mediaElement=mediaplayer({url:url,type:type,preview:preview,canPause:$container.hasClass("pause"),maxPlays:maxPlays,canSeek:!maxPlays,width:media.attr("width"),height:media.attr("height"),volume:100,autoStart:!!interaction.attr("autostart")&&canBePlayed(),loop:!!interaction.attr("loop"),renderTo:$$1(".media-container",$container)}).on("render",function(){media.attr("width")&&!/%/.test(media.attr("width"))&&(resize(),$$1(window).off("resize.mediaInteraction").on("resize.mediaInteraction",resize),$item.off("resize.gridEdit").on("resize.gridEdit",resize)),$container.trigger("playerrendered")}).on("ready",function(){$container.trigger("playerready"),canBePlayed()||this.disable(),resolve()}).on("update",_.throttle(function(){return containerHelper.triggerResponseChangeEvent(interaction)},1e3)).on("ended",function(){$container.data("timesPlayed",$container.data("timesPlayed")+1),containerHelper.triggerResponseChangeEvent(interaction),canBePlayed()||this.disable()})}};$container.data("timesPlayed")||$container.data("timesPlayed",0),$container.on("responseSet",initMediaPlayer),initMediaPlayer()})},getContainer:getContainer,setResponse:setResponse,getResponse:getResponse,resetResponse:function(interaction){getContainer(interaction).data("timesPlayed",0)},destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),interaction.mediaElement&&(state.player={position:interaction.mediaElement.getPosition(),muted:interaction.mediaElement.is("muted"),volume:interaction.mediaElement.getVolume()}),state}}}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/OrderInteraction",["lodash","jquery","i18n","core/mouseEvent","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","interact","ui/interactUtils"],function(_,$$1,__,mouseEvent,Handlebars,DOMPurify,containerHelper,instructionMgr,pciResponse,interact,interactUtils){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,interact=interact&&Object.prototype.hasOwnProperty.call(interact,"default")?interact["default"]:interact,interactUtils=interactUtils&&Object.prototype.hasOwnProperty.call(interactUtils,"default")?interactUtils["default"]:interactUtils;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program9(){return"horizontal"}function program13(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program15(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program17(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}function program19(){return"icon-down"}function program21(){return"icon-right"}function program23(){return"icon-up"}function program25(){return"icon-left"}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-orderInteraction",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.program(5,function(){return" qti-vertical"},data),fn:self.program(3,function(){return" qti-horizontal"},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-qti-class=\"orderInteraction\"\n data-orientation=\"",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.program(11,function(){return"vertical"},data),fn:self.program(9,program9,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(13,program13,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(15,program15,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"order-interaction-area\">\n <ul class=\"choice-area square source solid block-listing ",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\">\n ",options={hash:{},inverse:self.noop,fn:self.program(17,program17,data),data:data},(helper=helpers.choices)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.choices,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.choices||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(17,program17,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </ul>\n <div class=\"arrow-bar middle\">\n <span class=\"icon-add-to-selection ",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.program(21,program21,data),fn:self.program(19,program19,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"></span>\n <span class=\"icon-remove-from-selection ",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.program(25,program25,data),fn:self.program(23,program23,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" inactive\"></span>\n </div>\n <ul class=\"drag-container block-listing\"></ul>\n <ul class=\"result-area decimal target solid block-listing ",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\">\n </ul>\n <div class=\"arrow-bar\">\n <span class=\"icon-move-before ",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.program(23,program23,data),fn:self.program(25,program25,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" inactive\"></span>\n <span class=\"icon-move-after ",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.program(19,program19,data),fn:self.program(21,program21,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" inactive\"></span>\n </div>\n </div>\n <div class=\"notification-container\"></div>\n</div>\n",buffer}),_freezeSize=function($container){var $orderArea=$container.find(".order-interaction-area");$orderArea.height($orderArea.height())},_setInstructions=function(interaction){var $container=containerHelper.get(interaction),$choiceArea=$$1(".choice-area",$container),$resultArea=$$1(".result-area",$container),min=parseInt(interaction.attr("minChoices"),10),max=parseInt(interaction.attr("maxChoices"),10);if(min&&instructionMgr.appendInstruction(interaction,__("You must use at least %d choices",min),function(){$resultArea.find(">li").length>=min?this.setLevel("success"):this.reset()}),max&&max<_.size(interaction.getChoices())){var instructionMax=instructionMgr.appendInstruction(interaction,__("You can use maximum %d choices",max),function(){$resultArea.find(">li").length>=max?($choiceArea.find(">li").addClass("deactivated"),this.setMessage(__("Maximum choices reached"))):($choiceArea.find(">li").removeClass("deactivated"),this.reset())});interact("".concat($choiceArea.selector," >li.deactivated")).on("tap",function(e){var $target=$$1(e.currentTarget);$target.addClass("brd-error"),instructionMax.setLevel("warning",2e3),setTimeout(function(){$target.removeClass("brd-error")},150)}),interact("".concat($choiceArea.selector," >li.deactivated")).draggable({onstart:function onstart(e){var $target=$$1(e.target);$target.addClass("brd-error"),instructionMax.setLevel("warning")},onend:function onend(e){var $target=$$1(e.target);$target.removeClass("brd-error"),instructionMax.setLevel("info")}}).styleCursor(!1)}},resetResponse=function(interaction){var $container=containerHelper.get(interaction),initialOrder=_.keys(interaction.getChoices()),$choiceArea=$$1(".choice-area",$container).append($$1(".result-area>li",$container)),$choices=$choiceArea.children(".qti-choice");$container.find(".qti-choice.active").each(function(){interactUtils.tapOn(this)}),$choices.detach().sort(function(choice1,choice2){return _.indexOf(initialOrder,$$1(choice1).data("serial"))-_.indexOf(initialOrder,$$1(choice2).data("serial"))}),$choiceArea.prepend($choices)},render=function(interaction){function _iFrameDragFix(draggableSelector,target){interactUtils.iFrameDragFixOn(function(){_isDropzoneVisible()&&interact($resultArea.selector).fire({type:"drop",target:$dropzoneElement.eq(0),relatedTarget:target}),interact(draggableSelector).fire({type:"dragend",target:target})})}function _isDropzoneVisible(){return $$1.contains($container.get(0),$dropzoneElement.get(0))}function _insertDropzone($dragged){var draggedMiddle=_getMiddleOf($dragged),previousMiddle={x:0,y:0},insertPosition;$$1(resultSelector).each(function(index){var currentMiddle=_getMiddleOf($$1(this));if("horizontal"!==orientation){if(draggedMiddle.y>previousMiddle.y&&draggedMiddle.y<currentMiddle.y)return insertPosition=index,!1;previousMiddle.y=currentMiddle.y}else{if(draggedMiddle.x>previousMiddle.x&&draggedMiddle.x<currentMiddle.x)return insertPosition=index,!1;previousMiddle.x=currentMiddle.x}}),"undefined"==typeof insertPosition?$resultArea.append($dropzoneElement):$$1(resultSelector).eq(insertPosition).before($dropzoneElement),$dropzoneElement.height($dragged.height()),$dropzoneElement.find("div").text($dragged.text())}function _adjustDropzonePosition($dragged){var draggedBox=$dragged.get(0).getBoundingClientRect(),$prevResult=$dropzoneElement.prev(".qti-choice"),$nextResult=$dropzoneElement.next(".qti-choice"),prevMiddle=!!(0<$prevResult.length)&&_getMiddleOf($prevResult),nextMiddle=!!(0<$nextResult.length)&&_getMiddleOf($nextResult);"horizontal"===orientation?(prevMiddle&&draggedBox.left<prevMiddle.x&&$prevResult.before($dropzoneElement),nextMiddle&&draggedBox.right>nextMiddle.x&&$nextResult.after($dropzoneElement)):(prevMiddle&&draggedBox.top<prevMiddle.y&&$prevResult.before($dropzoneElement),nextMiddle&&draggedBox.bottom>nextMiddle.y&&$nextResult.after($dropzoneElement))}function _getMiddleOf($element){var elementBox=$element.get(0).getBoundingClientRect();return{x:elementBox.left+elementBox.width/2,y:elementBox.top+elementBox.height/2}}var $container=containerHelper.get(interaction),$choiceArea=$container.find(".choice-area"),$resultArea=$container.find(".result-area"),$iconAdd=$container.find(".icon-add-to-selection"),$iconRemove=$container.find(".icon-remove-from-selection"),$iconBefore=$container.find(".icon-move-before"),$iconAfter=$container.find(".icon-move-after"),choiceSelector="".concat($choiceArea.selector," >li:not(.deactivated)"),resultSelector="".concat($resultArea.selector," >li"),$dragContainer=$container.find(".drag-container"),orientation=interaction.attr("orientation")?interaction.attr("orientation"):"vertical",$activeChoice=null,_activeControls=function(){$iconAdd.addClass("inactive"),$iconRemove.removeClass("inactive").addClass("active"),$iconBefore.removeClass("inactive").addClass("active"),$iconAfter.removeClass("inactive").addClass("active")},_resetControls=function(){$iconAdd.removeClass("inactive"),$iconRemove.removeClass("active").addClass("inactive"),$iconBefore.removeClass("active").addClass("inactive"),$iconAfter.removeClass("active").addClass("inactive")},_setSelection=function($choice){$activeChoice&&$activeChoice.removeClass("active"),$activeChoice=$choice,$activeChoice.addClass("active")},_resetSelection=function(){$activeChoice&&($activeChoice.removeClass("active"),$activeChoice=null),_resetControls()},_addChoiceToSelection=function($target,position){var $results=$$1(resultSelector);_resetSelection(),"undefined"!=typeof position&&position<$results.length?$results.eq(position).before($target):$resultArea.append($target),containerHelper.triggerResponseChangeEvent(interaction),instructionMgr.validateInstructions(interaction)},_toggleResultSelection=function($target){$target.hasClass("active")?_resetSelection():(_setSelection($target),_activeControls())},_removeChoice=function(){$activeChoice&&($choiceArea.append($activeChoice),containerHelper.triggerResponseChangeEvent(interaction),instructionMgr.validateInstructions(interaction)),_resetSelection()},_moveResultBefore=function(){var $prev=$activeChoice.prev();$prev.length&&($prev.before($activeChoice),containerHelper.triggerResponseChangeEvent(interaction))},_moveResultAfter=function(){var $next=$activeChoice.next();$next.length&&($next.after($activeChoice),containerHelper.triggerResponseChangeEvent(interaction))},scaleX,scaleY,isDragAndDropEnabled,dragOptions,$dropzoneElement;interact($container.selector).on("tap",function(){_resetSelection()}),interact(choiceSelector).on("tap",function(e){var $target=$$1(e.currentTarget);$target.closest(".qti-item").hasClass("prevent-click-handler")||(e.stopPropagation(),$iconAdd.addClass("triggered"),setTimeout(function(){$iconAdd.removeClass("triggered")},150),_addChoiceToSelection($target))}),interact(resultSelector).on("tap",function(e){var $target=$$1(e.currentTarget);$target.closest(".qti-item").hasClass("prevent-click-handler")||(e.stopPropagation(),_toggleResultSelection($target))}),interact($iconRemove.selector).on("tap",function(e){$$1(e.currentTarget).closest(".qti-item").hasClass("prevent-click-handler")||(e.stopPropagation(),_removeChoice())}),interact($iconBefore.selector).on("tap",function(e){$$1(e.currentTarget).closest(".qti-item").hasClass("prevent-click-handler")||(e.stopPropagation(),_moveResultBefore())}),interact($iconAfter.selector).on("tap",function(e){$$1(e.currentTarget).closest(".qti-item").hasClass("prevent-click-handler")||(e.stopPropagation(),_moveResultAfter())}),this.getOption&&this.getOption("enableDragAndDrop")&&this.getOption("enableDragAndDrop").order&&(isDragAndDropEnabled=this.getOption("enableDragAndDrop").order),isDragAndDropEnabled&&($dropzoneElement=$$1("<li>",{class:"dropzone qti-choice"}),$$1("<div>",{class:"qti-block"}).appendTo($dropzoneElement),dragOptions={inertia:!1,autoScroll:!0,restrict:{restriction:".qti-interaction",endOnly:!1,elementRect:{top:0,left:0,bottom:1,right:1}}},interact(choiceSelector).draggable(_.assign({},dragOptions,{onstart:function onstart(e){var $target=$$1(e.target),scale;$target.addClass("dragged"),_iFrameDragFix(choiceSelector,e.target),scale=interactUtils.calculateScale(e.target),scaleX=scale[0],scaleY=scale[1]},onmove:function onmove(e){var $target=$$1(e.target);interactUtils.moveElement(e.target,e.dx/scaleX,e.dy/scaleY),_isDropzoneVisible()&&_adjustDropzonePosition($target)},onend:function onend(e){var $target=$$1(e.target);$target.removeClass("dragged"),interactUtils.restoreOriginalPosition($target),interactUtils.iFrameDragFixOff()}})).styleCursor(!1),interact(resultSelector).draggable(_.assign({},dragOptions,{onstart:function onstart(e){var $target=$$1(e.target),scale;$target.addClass("dragged"),_setSelection($target),$dragContainer.show(),$dragContainer.offset($target.offset()),"horizontal"===orientation?$dragContainer.width($$1(e.currentTarget).width()):$dragContainer.width($target.parent().width()),$dragContainer.append($target),_iFrameDragFix(resultSelector,e.target),scale=interactUtils.calculateScale(e.target),scaleX=scale[0],scaleY=scale[1]},onmove:function onmove(e){var $target=$$1(e.target);interactUtils.moveElement(e.target,e.dx/scaleX,e.dy/scaleY),_isDropzoneVisible()&&_adjustDropzonePosition($target)},onend:function onend(e){var $target=$$1(e.target),hasBeenDroppedInResultArea=$target.parent===$resultArea;$target.removeClass("dragged"),$dragContainer.hide(),hasBeenDroppedInResultArea||_removeChoice(),interactUtils.restoreOriginalPosition($target),interactUtils.iFrameDragFixOff()}})).styleCursor(!1),interact($resultArea.selector).dropzone({overlap:.5,ondragenter:function ondragenter(e){var $dragged=$$1(e.relatedTarget);_insertDropzone($dragged),$dragged.addClass("droppable")},ondrop:function ondrop(e){var $dragged=$$1(e.relatedTarget),dropzoneIndex=$$1(resultSelector).index($dropzoneElement);this.ondragleave(e),_addChoiceToSelection($dragged,dropzoneIndex),interactUtils.restoreOriginalPosition($dragged)},ondragleave:function ondragleave(e){var $dragged=$$1(e.relatedTarget);$dropzoneElement.remove(),$dragged.removeClass("droppable")}})),_setInstructions(interaction),$$1(document).on("attributeChange.qti-widget.commonRenderer",function(e,data){data.element.getSerial()===interaction.getSerial()&&("maxChoices"===data.key||"minChoices"===data.key)&&(instructionMgr.removeInstructions(interaction),_setInstructions(interaction),instructionMgr.validateInstructions(interaction))}),_freezeSize($container)},setResponse=function(interaction,response){var $container=containerHelper.get(interaction),$choiceArea=$$1(".choice-area",$container),$resultArea=$$1(".result-area",$container);if(null===response||_.isEmpty(response))resetResponse(interaction);else try{_.each(pciResponse.unserialize(response,interaction),function(identifier){$resultArea.append($choiceArea.find("[data-identifier=\"".concat(identifier,"\"]")))})}catch(e){throw new Error("wrong response format in argument : ".concat(e))}instructionMgr.validateInstructions(interaction)},_getRawResponse=function(interaction){var $container=containerHelper.get(interaction),response=[];return $$1(".result-area>li",$container).each(function(){response.push($$1(this).data("identifier"))}),response},getResponse=function(interaction){return pciResponse.serialize(_getRawResponse(interaction),interaction)},getCustomData=function(interaction,data){return _.merge(data||{},{horizontal:"horizontal"===interaction.attr("orientation")})},destroy=function(interaction){var $container=containerHelper.get(interaction);[".choice-area >li:not(.deactivated)",".result-area >li",".icon-add-to-selection",".icon-remove-from-selection",".icon-move-before",".icon-move-after"].forEach(function(selector){interact($container.find(selector).selector).unset()}),$$1(document).off(".commonRenderer"),$container.find(".order-interaction-area").removeAttr("style"),instructionMgr.removeInstructions(interaction),containerHelper.reset(interaction)},setState=function(interaction,state){if(_.isObject(state)&&(state.response&&(interaction.resetResponse(),interaction.setResponse(state.response)),_.isArray(state.order)&&state.order.length===_.size(interaction.getChoices()))){var $container=containerHelper.get(interaction);$$1(".choice-area .qti-choice",$container).sort(function(a,b){var aIndex=_.indexOf(state.order,$$1(a).data("identifier")),bIndex=_.indexOf(state.order,$$1(b).data("identifier"));return aIndex>bIndex?1:aIndex<bIndex?-1:0}).detach().appendTo($$1(".choice-area",$container))}},getState=function(interaction){var state={},response=interaction.getResponse();if(response&&(state.response=response),!0===interaction.attr("shuffle")){var $container=containerHelper.get(interaction);state.order=[],$$1(".choice-area .qti-choice",$container).each(function(){state.order.push($$1(this).data("identifier"))})}return state},OrderInteraction={qtiClass:"orderInteraction",getData:getCustomData,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:render,getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:destroy,setState:setState,getState:getState};return OrderInteraction}),define("qtiCustomInteractionContext",["lodash"],function(_){'use strict';return window._pciHooks=window._pciHooks||{},{register:function register(pciHook){var typeIdentifier="function"==typeof pciHook.getTypeIdentifier?pciHook.getTypeIdentifier():pciHook.typeIdentifier;if(typeIdentifier)window._pciHooks[typeIdentifier]=pciHook;else throw new Error("invalid PCI hook")},notifyReady:function notifyReady(){},notifyDone:function notifyDone(){},onready:function onready(){},ondone:function ondone(){},createPciInstance:function createPciInstance(pciTypeIdentifier){var registeredPCI=window._pciHooks[pciTypeIdentifier];if(!registeredPCI)throw new Error("no portable custom interaction hook found with the id "+pciTypeIdentifier);return _.cloneDeep(registeredPCI)}}}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/pci/instanciator",["qtiCustomInteractionContext"],function(qtiCustomInteractionContext){'use strict';qtiCustomInteractionContext=qtiCustomInteractionContext&&Object.prototype.hasOwnProperty.call(qtiCustomInteractionContext,"default")?qtiCustomInteractionContext["default"]:qtiCustomInteractionContext;return{getPci:function getPci(interaction){var pci=interaction.data("pci"),pciTypeIdentifier;if(!pci)if(pciTypeIdentifier=interaction.typeIdentifier,pci=qtiCustomInteractionContext.createPciInstance(pciTypeIdentifier),pci)interaction.data("pci",pci),pci._taoCustomInteraction=interaction;else throw new Error("no custom interaction hook found for the type "+pciTypeIdentifier);return pci},setPci:function setPci(interaction,instance){interaction.data("pci",instance)}}}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/pci/common",["lodash","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/renderers/interactions/pci/instanciator"],function(_,containerHelper,instanciator){'use strict';return _=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instanciator=instanciator&&Object.prototype.hasOwnProperty.call(instanciator,"default")?instanciator["default"]:instanciator,function(runtime){return{getRequiredModules:function(){var requireEntries=[];return runtime.hook&&requireEntries.push(runtime.hook.replace(/\.js$/,"")),_.forEach(runtime.libraries,function(lib){requireEntries.push(lib.replace(/\.js$/,""))}),_.forEach(runtime.stylesheets,function(stylesheet){requireEntries.push("css!"+stylesheet.replace(/\.css$/,""))}),requireEntries},createInstance:function createInstance(interaction,context){var id=interaction.attr("responseIdentifier"),pci=instanciator.getPci(interaction),properties=_.clone(interaction.properties),assetManager=context.assetManager;return pci.initialize(id,containerHelper.get(interaction).children().get(0),properties,{resolve:function(url){var resolved=assetManager.resolveBy("portableElementLocation",url);return resolved===url||_.isUndefined(resolved)?assetManager.resolve(url):resolved}}),Promise.resolve(pci)},destroy:function(interaction){return instanciator.getPci(interaction).destroy()},setState:function(interaction,state){instanciator.getPci(interaction).setSerializedState(state)},getState:function(interaction){return instanciator.getPci(interaction).getSerializedState()}}}}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/pci/ims",["lodash","core/logger","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/renderers/interactions/pci/instanciator"],function(_,loggerFactory,containerHelper,instanciator){'use strict';function defaultPciRenderer(runtime){return{getRequiredModules:function getRequiredModules(){var requireEntries=[];return _.forEach(runtime.modules,function(module,name){requireEntries.push(name)}),requireEntries},setPCIConstructor:function setPCIConstructor(interaction,pciConstructor){interaction.data("pciConstructor",pciConstructor)},getPCIConstructor:function getPCIConstructor(interaction){return interaction.data("pciConstructor")},createInstance:function createInstance(interaction,context){var pciConstructor=this.getPCIConstructor(interaction),properties=_.clone(interaction.properties);pciConstructor||(pciConstructor=instanciator.getPci(interaction),this.setPCIConstructor(interaction,pciConstructor)),_.forOwn(properties,function(propVal,propKey){properties[propKey]=_.isArray(propVal)||_.isObject(propVal)?JSON.stringify(propVal):propVal});var readyPromise=new Promise(function(resolve){pciReadyCallback=resolve}),config={properties:properties,templateVariables:{},boundTo:context.response||{},onready:pciReadyCallback,ondone:pciDoneCallback,status:"interacting"},pciReadyCallback;return pciConstructor.getInstance(containerHelper.get(interaction).get(0),config,context.state),readyPromise.then(function(instance){return instanciator.setPci(interaction,instance),instance})},destroy:function(interaction){instanciator.getPci(interaction).oncompleted()},setReviewState:function setReviewState(interaction,state){return this.destroy(interaction),this.createInstance(interaction,{response:{RESPONSE:state.response}})},setState:_.noop,getState:function getState(interaction){return instanciator.getPci(interaction).getState()}}}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,loggerFactory=loggerFactory&&Object.prototype.hasOwnProperty.call(loggerFactory,"default")?loggerFactory["default"]:loggerFactory,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instanciator=instanciator&&Object.prototype.hasOwnProperty.call(instanciator,"default")?instanciator["default"]:instanciator;var logger=loggerFactory("taoQtiItem/qtiCommonRenderer/renderers/interactions/pci/ims"),pciDoneCallback=function(pci){logger.info("pciDoneCallback called on PCI "+pci.typeIdentifier)};return defaultPciRenderer}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/PortableCustomInteraction",["lodash","handlebars","i18n","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/PortableElement","taoQtiItem/qtiCommonRenderer/renderers/interactions/pci/instanciator","taoQtiItem/qtiCommonRenderer/renderers/interactions/pci/common","taoQtiItem/qtiCommonRenderer/renderers/interactions/pci/ims","taoQtiItem/qtiItem/helper/util","taoQtiItem/portableElementRegistry/ciRegistry"],function(_,Handlebars,__,DOMPurify,containerHelper,PortableElement,instanciator,commonPciRenderer,imsPciRenderer,util,ciRegistry){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,PortableElement=PortableElement&&Object.prototype.hasOwnProperty.call(PortableElement,"default")?PortableElement["default"]:PortableElement,instanciator=instanciator&&Object.prototype.hasOwnProperty.call(instanciator,"default")?instanciator["default"]:instanciator,commonPciRenderer=commonPciRenderer&&Object.prototype.hasOwnProperty.call(commonPciRenderer,"default")?commonPciRenderer["default"]:commonPciRenderer,imsPciRenderer=imsPciRenderer&&Object.prototype.hasOwnProperty.call(imsPciRenderer,"default")?imsPciRenderer["default"]:imsPciRenderer,util=util&&Object.prototype.hasOwnProperty.call(util,"default")?util["default"]:util,ciRegistry=ciRegistry&&Object.prototype.hasOwnProperty.call(ciRegistry,"default")?ciRegistry["default"]:ciRegistry;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="\n lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div class=\"qti-interaction qti-customInteraction\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.markup)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.markup,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</div>",buffer}),_setPciModel=function(interaction,runtime){var pciRenderer;pciRenderer="IMSPCI"===runtime.model?imsPciRenderer(runtime):commonPciRenderer(runtime),interaction.data("pci-model",runtime.model),interaction.data("pci-renderer",pciRenderer)},_getPciRenderer=function(interaction){return interaction.data("pci-renderer")},setResponse=function(interaction,response){instanciator.getPci(interaction).setResponse(response)},getResponse=function(interaction){return instanciator.getPci(interaction).getResponse()},resetResponse=function(interaction){instanciator.getPci(interaction).resetResponse()},getData=function(customInteraction,data){var markup=data.markup;return markup=util.removeMarkupNamespaces(markup),markup=PortableElement.fixMarkupMediaSources(markup,this),data.markup=markup,data},PortableCustomInteraction={qtiClass:"customInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getData:getData,render:function(interaction,options){var self=this;return options=options||{},new Promise(function(resolve,reject){var id=interaction.attr("responseIdentifier"),typeIdentifier=interaction.typeIdentifier,assetManager=self.getAssetManager(),response={},state;options.state&&options.state[id]&&(state=options.state[id]),response[id]={base:null},ciRegistry.loadRuntimes({include:[typeIdentifier]}).then(function(){var runtime=ciRegistry.getRuntime(typeIdentifier),pciRenderer;return runtime?void(_setPciModel(interaction,runtime),pciRenderer=_getPciRenderer(interaction),window.require(pciRenderer.getRequiredModules(),function(){var pci=instanciator.getPci(interaction);pci?pciRenderer.createInstance(interaction,{response:response,state:state,assetManager:assetManager}).then(function(instance){_.isFunction(instance.on)&&interaction.onPci("responseChange",function(){containerHelper.triggerResponseChangeEvent(interaction)}),resolve()}):reject("Unable to initialize pci \""+id+"\"")},reject)):reject("The runtime for the pci cannot be found : "+typeIdentifier)}).catch(function(error){reject("Error loading runtime \""+id+"\": "+error)})})},getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:resetResponse,destroy:function(interaction){return _getPciRenderer(interaction).destroy(interaction)},getState:function(interaction){return _getPciRenderer(interaction).getState(interaction)},setState:function(interaction,serializedState){_getPciRenderer(interaction).setState(interaction,serializedState)}};return PortableCustomInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/Prompt",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div\n class=\"qti-prompt-container\"\n data-html-editable-container",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n>\n <div class=\"qti-prompt\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-html-editable id=\"prompt-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>\n</div>\n",buffer}),Prompt={qtiClass:"prompt",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getContainer:containerHelper.get};return Prompt}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/SelectPointInteraction",["jquery","lodash","handlebars","i18n","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager"],function($$1,_,Handlebars,__,DOMPurify,graphic,pciResponse,containerHelper,instructionMgr){'use strict';$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,graphic=graphic&&Object.prototype.hasOwnProperty.call(graphic,"default")?graphic["default"]:graphic,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-graphicInteraction qti-selectPointInteraction clearfix",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"image-editor solid\">\n <div id='graphic-paper-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"' class=\"main-image-box\"></div>\n </div>\n</div>\n",buffer}),getRawResponse=function(interaction){return interaction&&interaction.paper&&_.isArray(interaction.paper.points)?_.map(interaction.paper.points,function(point){return[point.x,point.y]}):[]},addPoint=function(interaction,point){var maxChoices=interaction.attr("maxChoices"),pointChange=function(){containerHelper.triggerResponseChangeEvent(interaction),instructionMgr.validateInstructions(interaction)};0<maxChoices&&getRawResponse(interaction).length>=maxChoices?instructionMgr.validateInstructions(interaction):(!_.isArray(interaction.paper.points)&&(interaction.paper.points=[]),graphic.createTarget(interaction.paper,{point:point,create:function(target){interaction.isTouch&&target&&target.getBBox&&graphic.createTouchCircle(interaction.paper,target.getBBox()),interaction.paper.points.push(point),pointChange()},remove:function(){_.remove(interaction.paper.points,point),pointChange()}}))},enableSelection=function(interaction){var $container=containerHelper.get(interaction),$imageBox=$container.find(".main-image-box"),isResponsive=$container.hasClass("responsive"),image=interaction.paper.getById("bg-image-"+interaction.serial);interaction.paper.isTouch=!1,image.touchstart(function(){interaction.paper.isTouch=!0,image.untouchstart()}),image.click(function(event){addPoint(interaction,graphic.getPoint(event,interaction.paper,$imageBox,isResponsive))})},setResponse=function(interaction,response){var responseValues;if(response&&interaction.paper)try{responseValues=pciResponse.unserialize(response,interaction),"single"===interaction.getResponseDeclaration().attr("cardinality")&&(responseValues=[responseValues]),_(responseValues).filter(function(point){return _.isArray(point)&&2===point.length}).forEach(function(point){addPoint(interaction,{x:point[0],y:point[1]})})}catch(err){}},getResponse=function(interaction){return pciResponse.serialize(getRawResponse(interaction),interaction)},destroy=function(interaction){var $container;interaction.paper&&($container=containerHelper.get(interaction),$$1(window).off("resize.qti-widget."+interaction.serial),$container.off("resize.qti-widget."+interaction.serial),interaction.paper.clear(),instructionMgr.removeInstructions(interaction),$$1(".main-image-box",$container).empty().removeAttr("style"),$$1(".image-editor",$container).removeAttr("style")),containerHelper.reset(interaction)},setState=function(interaction,state){_.isObject(state)&&state.response&&(interaction.resetResponse(),interaction.setResponse(state.response))},SelectPointInteraction={qtiClass:"selectPointInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:function(interaction){var self=this;return new Promise(function(resolve){var $container=containerHelper.get(interaction),background=interaction.object.attributes;$container.off("resized.qti-widget.resolve").one("resized.qti-widget.resolve",resolve),interaction.paper=graphic.responsivePaper("graphic-paper-"+interaction.serial,interaction.serial,{width:background.width,height:background.height,img:self.resolveUrl(background.data),imgId:"bg-image-"+interaction.serial,container:$container}),enableSelection(interaction),instructionMgr.minMaxChoiceInstructions(interaction,{min:interaction.attr("minChoices"),max:interaction.attr("maxChoices"),choiceCount:!1,getResponse:getRawResponse,onError:function onError(data){data&&graphic.highlightError(data.target,"success")}})})},getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:function(interaction){interaction&&interaction.paper&&(interaction.paper.points=[],interaction.paper.forEach(function(element){var point=element.data("point");"object"===_typeof(point)&&graphic.trigger(element,"click")}))},destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state}};return SelectPointInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/SliderInteraction",["jquery","lodash","i18n","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","nouislider"],function($$1,_,__,Handlebars,DOMPurify,containerHelper,pciResponse){'use strict';$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-sliderInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"sliderInteraction\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" >\r\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\r\n <div class=\"instruction-container\"></div>\r\n</div>\r\n",buffer}),_slideTo=function(options){options.sliderCurrentValue.find(".qti-slider-cur-value").text(options.value),options.sliderValue.val(options.value)},render=function(interaction){var attributes=interaction.getAttributes(),$container=interaction.getContainer(),$el=$$1("<div />").attr({id:"".concat(attributes.responseIdentifier,"-qti-slider"),class:"qti-slider"}),$sliderLabels=$$1("<div />").attr({class:"qti-slider-values"}),$sliderCurrentValue=$$1("<div />").attr({id:"".concat(attributes.responseIdentifier,"-qti-slider-cur-value"),class:"qti-slider-cur-value"}),$sliderValue=$$1("<input />").attr({type:"hidden",id:"".concat(attributes.responseIdentifier,"-qti-slider-value"),class:"qti-slider-value"}),orientation="horizontal",reverse=!!("undefined"!=typeof attributes.reverse&&attributes.reverse),min=parseInt(attributes.lowerBound),max=parseInt(attributes.upperBound),step="undefined"!=typeof attributes.step&&attributes.step?parseInt(attributes.step):1,steps=(max-min)/step;$sliderCurrentValue.append("<span class=\"qti-slider-cur-value-text\">".concat(__("Current value:"),"</span>")).append("<span class=\"qti-slider-cur-value\"></span>"),$sliderLabels.append("<span class=\"slider-min\">".concat(reverse?max:min,"</span>")).append("<span class=\"slider-max\">".concat(reverse?min:max,"</span>")),interaction.getContainer().append($el).append($sliderLabels).append($sliderCurrentValue).append($sliderValue),"undefined"!=typeof attributes.orientation&&-1<$$1.inArray(attributes.orientation,["horizontal","vertical"])&&(orientation=attributes.orientation);var sliderSize=0;if("horizontal"===orientation)$container.addClass("qti-slider-horizontal");else{sliderSize=20*steps,sliderSize>300&&(sliderSize=300),$container.addClass("qti-slider-vertical"),$el.height("".concat(sliderSize,"px")),$sliderLabels.height("".concat(sliderSize,"px"))}if("undefined"!=typeof attributes.stepLabel&&attributes.stepLabel){var middleStep=parseInt(steps/2),leftOffset=100/steps*middleStep,middleValue=reverse?max-middleStep*step:min+middleStep*step;"horizontal"===orientation?$sliderLabels.find(".slider-min").after("<span class=\"slider-middle\" style=\"left:'".concat(leftOffset,"%\">").concat(middleValue,"</span>")):$sliderLabels.find(".slider-min").after("<span class=\"slider-middle\" style=\"top:".concat(leftOffset,"%\">").concat(middleValue,"</span>"))}$el.noUiSlider({start:reverse?max:min,range:{min:min,max:max},step:step,orientation:orientation}).on("slide",function(){var val=parseInt($$1(this).val());interaction.attr("reverse")&&(val=max+min-val),val=Math.round(1e3*val)/1e3,_slideTo({value:val,sliderValue:$sliderValue,sliderCurrentValue:$sliderCurrentValue}),containerHelper.triggerResponseChangeEvent(interaction)}),_slideTo({value:min,sliderValue:$sliderValue,sliderCurrentValue:$sliderCurrentValue}),$$1(document).on("attributeChange.qti-widget.commonRenderer",function(e,data){if(data.element.getSerial()===interaction.getSerial()&&"responseIdentifier"===data.key&&data.value){var attributesNew=interaction.getAttributes();$container.find(".qti-slider").attr({id:"".concat(attributesNew.responseIdentifier,"-qti-slider")}),$container.find(".qti-slider-cur-value").attr({id:"".concat(attributesNew.responseIdentifier,"-qti-slider-cur-value")}),$container.find(".qti-slider-value").attr({id:"".concat(attributesNew.responseIdentifier,"-qti-slider-value")})}})},setResponse=function(interaction,response){var attributes=interaction.getAttributes(),$container=interaction.getContainer(),$sliderValue=$container.find("#".concat(attributes.responseIdentifier,"-qti-slider-value")),$sliderCurrentValue=$container.find("#".concat(attributes.responseIdentifier,"-qti-slider-cur-value")),$el=$container.find("#".concat(attributes.responseIdentifier,"-qti-slider")),min=parseInt(attributes.lowerBound),max=parseInt(attributes.upperBound),value;value=pciResponse.unserialize(response,interaction)[0],_slideTo({value:value,sliderValue:$sliderValue,sliderCurrentValue:$sliderCurrentValue}),$el.val(interaction.attr("reverse")?max+min-value:value)},_getRawResponse=function(interaction){var attributes=interaction.getAttributes(),baseType=interaction.getResponseDeclaration().attr("baseType"),min=parseInt(attributes.lowerBound),$container=interaction.getContainer(),$sliderValue=$container.find("#".concat(attributes.responseIdentifier,"-qti-slider-value")),value;return"integer"===baseType?value=parseInt($sliderValue.val()):"float"===baseType&&(value=parseFloat($sliderValue.val())),isNaN(value)?min:value},getResponse=function(interaction){return pciResponse.serialize([_getRawResponse(interaction)],interaction)},destroy=function(interaction){var $container=interaction.getContainer();$container.empty(),containerHelper.reset(interaction)},setState=function(interaction,state){_.isObject(state)&&state.response&&(interaction.resetResponse(),interaction.setResponse(state.response))},SliderInteraction={qtiClass:"sliderInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:render,getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:function resetResponse(interaction){var attributes=interaction.getAttributes(),$container=interaction.getContainer(),$el=$container.find("#".concat(attributes.responseIdentifier,"-qti-slider")),$sliderValue=$container.find("#".concat(attributes.responseIdentifier,"-qti-slider-value")),$sliderCurrentValue=$container.find("#".concat(attributes.responseIdentifier,"-qti-slider-cur-value")),min=parseInt(attributes.lowerBound),max=parseInt(attributes.upperBound),reverse=!!("undefined"!=typeof attributes.reverse&&attributes.reverse),startValue=reverse?max:min;_slideTo({value:min,sliderValue:$sliderValue,sliderCurrentValue:$sliderCurrentValue}),$el.val(startValue)},destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state}};return SliderInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/TextEntryInteraction",["jquery","lodash","i18n","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCommonRenderer/helpers/patternMask","util/locale","ui/tooltip"],function($$1,_,__,Handlebars,DOMPurify,containerHelper,instructionMgr,pciResponse,patternMaskHelper,locale,tooltip){'use strict';$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,patternMaskHelper=patternMaskHelper&&Object.prototype.hasOwnProperty.call(patternMaskHelper,"default")?patternMaskHelper["default"]:patternMaskHelper,locale=locale&&Object.prototype.hasOwnProperty.call(locale,"default")?locale["default"]:locale,tooltip=tooltip&&Object.prototype.hasOwnProperty.call(tooltip,"default")?tooltip["default"]:tooltip;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<input\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n class=\"qti-interaction qti-inlineInteraction qti-textEntryInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-qti-class=\"textEntryInteraction\"\n type=\"text\"\n>",buffer}),hideTooltip=function($input){$input.data("$tooltip")&&$input.data("$tooltip").hide()},showTooltip=function($input,theme,message){if($input.data("$tooltip"))$input.data("$tooltip").updateTitleContent(message);else{var textEntryTooltip=tooltip.create($input,message,{theme:theme,trigger:"manual"});$input.data("$tooltip",textEntryTooltip)}$input.data("$tooltip").show()},render=function(interaction){var attributes=interaction.getAttributes(),baseType=interaction.getResponseDeclaration().attr("baseType"),$input=interaction.getContainer(),patternMask=interaction.attr("patternMask"),maxChars=parseInt(patternMaskHelper.parsePattern(patternMask,"chars"),10),expectedLength,updateMaxCharsTooltip,updatePatternMaskTooltip;"integer"===baseType?$input.attr("inputmode","numeric"):"float"===baseType?$input.attr("inputmode","decimal"):$input.attr("inputmode","text");attributes.expectedLength&&(expectedLength=parseInt(attributes.expectedLength)+2,$input.css("width",expectedLength+"ch"),$input.css("min-width",expectedLength+"ch")),attributes.placeholderText&&$input.attr("placeholder",attributes.placeholderText),maxChars?(updateMaxCharsTooltip=function(){var count=$input.val().length,message,messageType;message=count?__("%d/%d",count,maxChars):__("%d characters allowed",maxChars),count>=maxChars?($input.addClass("maxed"),messageType="warning"):($input.removeClass("maxed"),messageType="info"),showTooltip($input,messageType,message),count&&"warning"===messageType&&hideTooltip($input)},$input.attr("maxlength",maxChars).on("focus.commonRenderer",function(){updateMaxCharsTooltip()}).on("keyup.commonRenderer",function(){updateMaxCharsTooltip(),containerHelper.triggerResponseChangeEvent(interaction)}).on("blur.commonRenderer",function(){hideTooltip($input)})):attributes.patternMask?(updatePatternMaskTooltip=function(){var regex=new RegExp(attributes.patternMask);hideTooltip($input),$input.val()&&(regex.test($input.val())?$input.removeClass("invalid"):($input.addClass("invalid"),showTooltip($input,"error",__("This is not a valid answer"))))},$input.on("focus.commonRenderer",function(){updatePatternMaskTooltip()}).on("keyup.commonRenderer",function(){updatePatternMaskTooltip(),containerHelper.triggerResponseChangeEvent(interaction)}).on("blur.commonRenderer",function(){hideTooltip($input)})):$input.on("keyup.commonRenderer",function(){containerHelper.triggerResponseChangeEvent(interaction)})},setResponse=function(interaction,response){var responseValue;try{responseValue=pciResponse.unserialize(response,interaction)}catch(e){}responseValue&&responseValue.length&&interaction.getContainer().val(responseValue[0])},getResponse=function(interaction){var ret={base:{}},$input=interaction.getContainer(),attributes=interaction.getAttributes(),baseType=interaction.getResponseDeclaration().attr("baseType"),numericBase=attributes.base||10,value;return $input.hasClass("invalid")||attributes.placeholderText&&$input.val()===attributes.placeholderText?value="":"integer"===baseType?value=locale.parseInt($input.val(),numericBase):"float"===baseType?value=locale.parseFloat($input.val()):"string"===baseType&&(value=$input.val()),ret.base[baseType]=isNaN(value)&&"number"==typeof value?"":value,ret},destroy=function(interaction){$$1("input.qti-textEntryInteraction").each(function(index,el){var $input=$$1(el);$input.data("$tooltip")&&($input.data("$tooltip").dispose(),$input.removeData("$tooltip"))}),$$1(document).off(".commonRenderer"),containerHelper.get(interaction).off(".commonRenderer"),instructionMgr.removeInstructions(interaction),containerHelper.reset(interaction)},setState=function(interaction,state){_.isObject(state)&&state.response&&(interaction.resetResponse(),interaction.setResponse(state.response))},TextEntryInteraction={qtiClass:"textEntryInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:render,getContainer:containerHelper.get,setResponse:setResponse,getResponse:getResponse,resetResponse:function(interaction){interaction.getContainer().val("")},destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state}};return TextEntryInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/interactions/UploadInteraction",["jquery","lodash","i18n","core/mimetype","handlebars","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/uploadMime","ui/progressbar","ui/previewer","ui/modal","ui/waitForMedia"],function($$1,_,__,mimetype,Handlebars,DOMPurify,containerHelper,instructionMgr,uploadHelper){'use strict';var _Mathround2=Math.round,_Mathmin2=Math.min;function resetGui(interaction){var $container=containerHelper.get(interaction);$container.find(".file-name").text(__("No file selected")),$container.find(".btn-info").text(__("Browse..."))}function callResetGui(interaction){var renderer=interaction.getRenderer();_.isFunction(renderer.resetGui)&&renderer.resetGui(interaction)}function render(interaction){var self=this,$container=containerHelper.get(interaction),changeListener,$input;if(callResetGui(interaction),instructionMgr.appendInstruction(interaction,_initialInstructions),interaction.data("_response",{base:null}),changeListener=function(e){var file=e.target.files[0];"undefined"!=typeof file&&_handleSelectedFiles(interaction,file,self.getCustomMessage("upload","wrongType"))},$input=$container.find("input"),$container.find(".progressbar").progressbar(),!window.FileReader)throw new Error("FileReader API not supported! Please use a compliant browser!");$input.bind("change",changeListener),$input.bind("mousedown",function(e){return e.preventDefault(),$$1(this).blur(),!1})}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,mimetype=mimetype&&Object.prototype.hasOwnProperty.call(mimetype,"default")?mimetype["default"]:mimetype,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,instructionMgr=instructionMgr&&Object.prototype.hasOwnProperty.call(instructionMgr,"default")?instructionMgr["default"]:instructionMgr,uploadHelper=uploadHelper&&Object.prototype.hasOwnProperty.call(uploadHelper,"default")?uploadHelper["default"]:uploadHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program5(depth0,data){var buffer="",stack1,helper;return buffer+="accept=\"",(helper=helpers.accept)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.accept,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"qti-interaction qti-blockInteraction qti-uploadInteraction\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n\t",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\t<div class=\"instruction-container\"></div>\n <div class=\"file-upload fixed-grid-row lft\">\n <div class=\"progressbar\"></div>\n <span class=\"btn-info small col-4\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Browse...",options):helperMissing.call(depth0,"__","Browse...",options)))+"</span>\n <span class=\"file-name placeholder col-8 truncate\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"No file selected",options):helperMissing.call(depth0,"__","No file selected",options)))+"</span>\n <input type=\"file\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.accept,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n </div>\n <div class=\"file-upload-preview lft visible-file-upload-preview runtime-visible-file-upload-preview\">\n <p class=\"nopreview\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"No preview available",options):helperMissing.call(depth0,"__","No preview available",options)))+"</p>\n </div>\n <div class=\"file-upload-preview-popup modal\">\n <div class=\"modal-body\">\n </div>\n </div>\n</div>\n",buffer}),_initialInstructions=__("Browse your computer and select the appropriate file."),_readyInstructions=__("The selected file is ready to be sent."),validateFileType=function(file,interaction){var expectedTypes=uploadHelper.getExpectedTypes(interaction,!0),filetype=mimetype.getMimeType(file);return!expectedTypes.length||0<=_.indexOf(expectedTypes,filetype)},getMessageWrongType=function(interaction,userSelectedType,messageWrongType){var types=uploadHelper.getExpectedTypes(interaction),expectedTypeLabels=_.map(_.uniq(types),function(type){var mime=_.find(uploadHelper.getMimeTypes(),{mime:type});return mime?mime.label:type});return messageWrongType&&_.isFunction(messageWrongType)?messageWrongType({userSelectedType:userSelectedType,types:expectedTypeLabels}):__("Wrong type of file. Expected %s. The selected file has the mimetype \"%s\".",expectedTypeLabels.join(__(" or ")),userSelectedType)},_handleSelectedFiles=function(interaction,file,messageWrongType){var $container=containerHelper.get(interaction),filename=file.name,filetype=mimetype.getMimeType(file),reader;return instructionMgr.removeInstructions(interaction),instructionMgr.appendInstruction(interaction,_initialInstructions),validateFileType(file,interaction)?void($container.find(".file-name").empty().append(filename),reader=new FileReader,reader.onload=function(e){var base64Data,commaPosition,base64Raw,$previewArea;instructionMgr.removeInstructions(interaction),instructionMgr.appendInstruction(interaction,_readyInstructions,function(){this.setLevel("success")}),instructionMgr.validateInstructions(interaction),$container.find(".progressbar").progressbar("value",100),base64Data=e.target.result,commaPosition=base64Data.indexOf(","),base64Raw=base64Data.substring(commaPosition+1),interaction.data("_response",{base:{file:{data:base64Raw,mime:filetype,name:filename}}}),$previewArea=$container.find(".file-upload-preview"),$previewArea.previewer({url:base64Data,name:filename,mime:filetype}),$previewArea.waitForMedia(function(){var $originalImg=$previewArea.find("img"),$largeDisplay=$$1(".file-upload-preview-popup"),$item=$$1(".qti-item"),itemWidth=$item.width(),winWidth=$$1(window).width()-80,fullHeight=$$1("body").height(),imgNaturalWidth,isOversized,modalWidth;$originalImg.length&&(imgNaturalWidth=$originalImg[0].naturalWidth,isOversized=imgNaturalWidth>itemWidth,modalWidth=_Mathmin2(winWidth,imgNaturalWidth),$previewArea.toggleClass("clickable",isOversized),isOversized&&$previewArea.on("click",function(){var $modalBody;$$1(".upload-ia-modal-bg").remove(),$modalBody=$largeDisplay.find(".modal-body"),$modalBody.empty().append($originalImg.clone()),$largeDisplay.on("opened.modal",function(){$$1(".tao-item-scope.tao-preview-scope").css("overflow","hidden"),$largeDisplay.css({width:modalWidth,height:fullHeight,left:(modalWidth-itemWidth-40)/-2})}).on("closed.modal",function(){$$1(".tao-item-scope.tao-preview-scope").css("overflow","auto")}).modal({modalOverlayClass:"modal-bg upload-ia-modal-bg"})}))})},reader.onloadstart=function(){instructionMgr.removeInstructions(interaction),$container.find(".progressbar").progressbar("value",0)},reader.onprogress=function(e){var _Mathceil=Math.ceil,percentProgress=_Mathceil(100*(_Mathround2(e.loaded)/_Mathround2(e.total)));$container.find(".progressbar").progressbar("value",percentProgress)},reader.readAsDataURL(file)):(instructionMgr.removeInstructions(interaction),instructionMgr.appendInstruction(interaction,getMessageWrongType(interaction,filetype,messageWrongType),function(){this.setLevel("error")}),void instructionMgr.validateInstructions(interaction))},setResponse=function(interaction,response){var $container=containerHelper.get(interaction),filename;null!==response.base&&(filename="undefined"==typeof response.base.file.name?"previously-uploaded-file":response.base.file.name,$container.find(".file-name").empty().text(filename)),interaction.data("_response",response)},destroy=function(interaction){$$1(document).off(".commonRenderer"),containerHelper.get(interaction).off(".commonRenderer"),instructionMgr.removeInstructions(interaction),containerHelper.reset(interaction)},setState=function(interaction,state){_.isObject(state)&&state.response&&(interaction.resetResponse(),interaction.setResponse(state.response))},getCustomData=function(interaction,data){return _.merge(data||{},{accept:uploadHelper.getExpectedTypes(interaction,!0).join(",")})},UploadInteraction={qtiClass:"uploadInteraction",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:render,getContainer:containerHelper.get,setResponse:setResponse,getResponse:function(interaction){return interaction.data("_response")},resetResponse:function(interaction){callResetGui(interaction)},destroy:destroy,setState:setState,getState:function(interaction){var state={},response=interaction.getResponse();return response&&(state.response=response),state},getData:getCustomData,resetGui:resetGui};return UploadInteraction}),define("taoQtiItem/qtiCommonRenderer/renderers/Item",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/itemStylesheetHandler"],function(Handlebars,__,_,DOMPurify,containerHelper,itemStylesheetHandler){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,itemStylesheetHandler=itemStylesheetHandler&&Object.prototype.hasOwnProperty.call(itemStylesheetHandler,"default")?itemStylesheetHandler["default"]:itemStylesheetHandler;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program5(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div class=\"qti-item tao-scope runtime\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <div",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-itemBody ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>\n <div id=\"modalFeedbacks\"></div>\n</div>\n",buffer}),Item={qtiClass:"assessmentItem",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getContainer:containerHelper.get,render:function(item){containerHelper.targetBlank(containerHelper.get(item)),itemStylesheetHandler.attach(item.stylesheets)},destroy:function(item){containerHelper.clear(),item.stylesheets&&itemStylesheetHandler.detach(item.stylesheets)}};return Item}),define("taoQtiItem/qtiCommonRenderer/renderers/Math",["lodash","handlebars","i18n","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","mathJax"],function(_,Handlebars,__,DOMPurify,containerHelper,MathJax){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,MathJax=MathJax&&Object.prototype.hasOwnProperty.call(MathJax,"default")?MathJax["default"]:MathJax;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="<span data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"math\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="><math display=\"block\">",(helper=helpers.raw)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.raw,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</math></span>",buffer}function program2(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program4(depth0,data){var buffer="",stack1,helper;return buffer+="<span data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"math\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="><math>",(helper=helpers.raw)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.raw,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</math></span>",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var escapeExpression=this.escapeExpression,self=this,stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.block,{hash:{},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),data:data}),stack1||0===stack1?stack1:""});"undefined"!=typeof MathJax&&MathJax&&(MathJax.Hub.processSectionDelay=0);var _Math={qtiClass:"math",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getContainer:containerHelper.get,render:function(math){return new Promise(function(resolve){var $item=containerHelper.get(math).closest(".qti-item");"undefined"!=typeof MathJax&&MathJax?(!window.MathJax&&(window.MathJax=MathJax),$item.length?(MathJax.Hub.Queue(["Typeset",MathJax.Hub,$item[0]]),MathJax.Hub.Queue(resolve)):resolve()):resolve()})}};return _Math}),define("taoQtiItem/qtiItem/helper/container",["lodash","jquery"],function(_,$){'use strict';function _checkContainerType(element){if(_.isFunction(element.initContainer)&&_.isFunction(element.body))return!0;throw"the element is not of a container type"}function _getBodyDom(element){if(_checkContainerType(element))return $("<div>").html(element.body()).find(".x-tao-wrapper")}function _setBodyDomClass(element,newClass,oldClass){if(_checkContainerType(element)&&(oldClass||newClass)){var $wrapper=$("<div>").html(element.body());_setDomClass($wrapper,newClass,oldClass),element.body($wrapper.html())}}function _setDomClass($wrapper,newClass,oldClass){var $bodyDom=$wrapper.find(".x-tao-wrapper");$bodyDom.length||($wrapper.wrapInner("<div class=\"x-tao-wrapper\">"),$bodyDom=$wrapper.find(".x-tao-wrapper")),oldClass&&$bodyDom.removeClass(oldClass),newClass&&$bodyDom.addClass(newClass)}function _getEncodedDataString(dataName,value){return dataName&&value?"x-tao-"+dataName+"-"+value:""}function getEncodedData(element,dataName){var $body=_getBodyDom(element),regex,matches;if(dataName&&$body&&$body.length&&$body.attr("class")&&(regex=new RegExp("x-tao-"+dataName+"-([a-zA-Z0-9-._]*)"),matches=$body.attr("class").match(regex),matches))return matches[1]}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$;return{setEncodedData:function(element,dataName,newValue){var oldValue=getEncodedData(element,dataName);return _setBodyDomClass(element,_getEncodedDataString(dataName,newValue),_getEncodedDataString(dataName,oldValue))},hasEncodedData:function(element,dataName,value){var $body=_getBodyDom(element);return!!($body&&$body.length&&dataName&&value)&&$body.hasClass(_getEncodedDataString(dataName,value))},getEncodedData:getEncodedData,removeEncodedData:function(element,dataName){var oldValue=getEncodedData(element,dataName);dataName&&oldValue&&_setBodyDomClass(element,"",_getEncodedDataString(dataName,oldValue))},setEncodedDataToDom:function($wrapper,dataName,newValue,oldValue){_setDomClass($wrapper,_getEncodedDataString(dataName,newValue),_getEncodedDataString(dataName,oldValue))}}}),define("taoQtiItem/qtiCommonRenderer/renderers/ModalFeedback",["lodash","handlebars","i18n","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiItem/helper/container","ui/waitForMedia","ui/modal"],function(_,Handlebars,__,DOMPurify,containerHelper,coreContainerHelper){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,coreContainerHelper=coreContainerHelper&&Object.prototype.hasOwnProperty.call(coreContainerHelper,"default")?coreContainerHelper["default"]:coreContainerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program3(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program5(depth0){var buffer="",stack1;return buffer+="<h2 class=\"qti-title modal-title\">"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.title),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</h2>",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div id=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" class=\"",stack1=helpers.unless.call(depth0,depth0&&depth0.inline,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"modal "},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="qti-modalFeedback ",(helper=helpers.feedbackStyle)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.feedbackStyle,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.title),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"modal-body\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>\n</div>",buffer}),modalFeedbackRenderer={qtiClass:"modalFeedback",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getContainer:containerHelper.get,width:600,getData:function getData(fb,data){return data.feedbackStyle=coreContainerHelper.getEncodedData(fb,"modalFeedback"),data},render:function render(modalFeedback,data){var $modal=containerHelper.get(modalFeedback);$modal.waitForMedia(function(){$modal.on("opened.modal",function(){var $itemBody=containerHelper.get(modalFeedback.getRootElement()).children(".qti-itemBody"),requiredHeight=$modal.outerHeight()+parseInt($modal.css("top"));requiredHeight>$itemBody.height()&&$itemBody.height(requiredHeight)}).on("closed.modal",function(){data=data||{},_.isFunction(data.callback)&&data.callback.call(this)}).modal({startClosed:!1,minHeight:modalFeedbackRenderer.minHeight,width:modalFeedbackRenderer.width})})}};return modalFeedbackRenderer}),define("taoQtiItem/qtiCommonRenderer/renderers/Object",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","ui/previewer"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div class=\"qti-object-container\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" >\n</div>\n",buffer}),_Object={qtiClass:"object",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getContainer:containerHelper.get,render:function render(obj){var $container=containerHelper.get(obj),previewOptions={url:obj.renderer.resolveUrl(obj.attr("data")),mime:obj.attr("type")};obj.attr("height")&&(previewOptions.height=obj.attr("height")),obj.attr("width")&&(previewOptions.width=obj.attr("width")),previewOptions.url&&previewOptions.mime&&$container.previewer(previewOptions)}};return _Object}),define("qtiInfoControlContext",[],function(){window._picHooks=window._picHooks||{};return{register:function register(picHook){window._picHooks[picHook.getTypeIdentifier()]=picHook},notifyReady:function notifyReady(){},createPciInstance:function createPciInstance(typeIdentifier){if(window._picHooks[typeIdentifier]){var instance={},proto=window._picHooks[typeIdentifier];for(var name in proto)instance[name]="function"==typeof proto[name]?proto[name]:null!==proto[name]&&"object"===_typeof(proto[name])?proto[name].constructor():proto[name];return instance}throw"no portable info control hook found with the id "+typeIdentifier}}}),define("taoQtiItem/qtiCommonRenderer/renderers/PortableInfoControl",["lodash","handlebars","i18n","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/PortableElement","qtiInfoControlContext","taoQtiItem/qtiItem/helper/util","taoQtiItem/portableElementRegistry/icRegistry"],function(_,Handlebars,__,DOMPurify,containerHelper,PortableElement,qtiInfoControlContext,util,icRegistry){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,PortableElement=PortableElement&&Object.prototype.hasOwnProperty.call(PortableElement,"default")?PortableElement["default"]:PortableElement,qtiInfoControlContext=qtiInfoControlContext&&Object.prototype.hasOwnProperty.call(qtiInfoControlContext,"default")?qtiInfoControlContext["default"]:qtiInfoControlContext,util=util&&Object.prototype.hasOwnProperty.call(util,"default")?util["default"]:util,icRegistry=icRegistry&&Object.prototype.hasOwnProperty.call(icRegistry,"default")?icRegistry["default"]:icRegistry;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program3(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div class=\"qti-infoControl",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.markup)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.markup,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</div>",buffer}),_getPic=function(infoControl){var pic=infoControl.data("pic")||void 0,typeIdentifier;if(!pic)if(typeIdentifier=infoControl.typeIdentifier,pic=qtiInfoControlContext.createPciInstance(typeIdentifier),pic)infoControl.data("pic",pic),pic._taoInfoControl=infoControl;else throw"no custom infoControl hook found for the type "+typeIdentifier;return pic},PortableInfoControl={qtiClass:"infoControl",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getData:function getData(infoControl,data){var markup=data.markup;return markup=util.removeMarkupNamespaces(markup),markup=PortableElement.fixMarkupMediaSources(markup,this),data.markup=markup,data},render:function render(infoControl){var self=this;return new Promise(function(resolve,reject){var state={},id=infoControl.attr("id"),typeIdentifier=infoControl.typeIdentifier,config=infoControl.properties,$dom=containerHelper.get(infoControl).children(),assetManager=self.getAssetManager();icRegistry.loadRuntimes().then(function(){var requireEntries=[],runtime=icRegistry.getRuntime(typeIdentifier);return runtime?void(runtime.hook&&requireEntries.push(runtime.hook.replace(/\.js$/,"")),_.forEach(runtime.libraries,function(module){requireEntries.push(module.replace(/\.js$/,""))}),_.forEach(runtime.stylesheets,function(stylesheet){requireEntries.push("css!"+stylesheet.replace(/\.css$/,""))}),window.require(requireEntries,function(){var pic=_getPic(infoControl);return pic?(pic.initialize(id,$dom[0],config,{resolve:function(url){var resolved=assetManager.resolveBy("portableElementLocation",url);return resolved===url?assetManager.resolveBy("baseUrl",url):resolved}}),pic.setSerializedState(state),resolve()):reject("Unable to initialize pic : "+id)},reject)):reject("The runtime for the pic cannot be found : "+typeIdentifier)}).catch(function(){reject("Error loading runtime : "+id)})})},getContainer:containerHelper.get,destroy:function(infoControl){_getPic(infoControl).destroy()},getState:function(infoControl){return _getPic(infoControl).getSerializedState()},setState:function(infoControl,state){_getPic(infoControl).setSerializedState(state)}};return PortableInfoControl}),define("taoQtiItem/qtiCommonRenderer/renderers/PrintedVariable",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<span data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"printedVariable\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n</span>",buffer}),PrintedVariable={qtiClass:"printedVariable",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getContainer:containerHelper.get};return PrintedVariable}),define("taoQtiItem/qtiCommonRenderer/renderers/rendererProvider",["taoQtiItem/qtiCommonRenderer/renderers/Renderer"],function(QtiRenderer){'use strict';QtiRenderer=QtiRenderer&&Object.prototype.hasOwnProperty.call(QtiRenderer,"default")?QtiRenderer["default"]:QtiRenderer;return{name:"commonRenderer",init:function init(){},getRenderer:function getRenderer(){return QtiRenderer}}}),define("taoQtiItem/qtiCommonRenderer/renderers/RubricBlock",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n<div class=\"grid-row qti-rubricBlock\" data-use=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.use),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"rubricBlock\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <div class=\"col-12\">\n <div class=\"qti-rubricBlock-body\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>\n </div>\n</div>\n",buffer}function program2(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var escapeExpression=this.escapeExpression,self=this,stack1;return stack1=helpers.unless.call(depth0,depth0&&depth0.empty,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),stack1||0===stack1?stack1:""}),RubricBlock={qtiClass:"rubricBlock",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getData:function(rubric,data){return rubric.isEmpty()&&(data.empty=!0),data}};return RubricBlock}),define("taoQtiItem/qtiCommonRenderer/renderers/Stylesheet",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="media=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.media),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<link \n href=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.href),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" \n type=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.type),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" \n rel=\"stylesheet\" \n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.media),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n />",buffer}),Stylesheet={qtiClass:"stylesheet",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getContainer:containerHelper.get};return Stylesheet}),define("taoQtiItem/qtiCommonRenderer/renderers/Table",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program3(depth0){var buffer="",stack1;return buffer+="summary=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.summary),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<table\n class=\"qti-table",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n data-qti-class=\"table\"\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.summary),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n >\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</table>\n",buffer}),Table={qtiClass:"table",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return Table}),define("taoQtiItem/qtiCommonRenderer/renderers/Tooltip",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","ui/tooltip"],function(Handlebars,__,_,DOMPurify,containerHelper,tooltip){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,tooltip=tooltip&&Object.prototype.hasOwnProperty.call(tooltip,"default")?tooltip["default"]:tooltip;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<span\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-qti-class=\"_tooltip\"\n data-role=\"tooltip-target\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n>\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</span>\n",buffer}),Tooltip={qtiClass:"_tooltip",template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getContainer:containerHelper.get,render:function(tooltipDOM){var $container=containerHelper.get(tooltipDOM),renderedTooltip=tooltip.create($container,tooltipDOM.content(),{theme:"default",placement:"top"});$container.data("$tooltip")&&($container.data("$tooltip").dispose(),$container.removeData("$tooltip")),$container.data("$tooltip",renderedTooltip)}};return Tooltip}),define("taoQtiItem/reviewRenderer/helpers/pci",["exports"],function(exports){'use strict';var interactablePcis=["textReaderInteraction","audioRecordingInteraction"];exports.isInteractionDisabledForPci=function isInteractionDisabledForPci(pciType){return-1===interactablePcis.indexOf(pciType)},Object.defineProperty(exports,"__esModule",{value:!0})}),define("taoQtiItem/reviewRenderer/renderers/choices/Hottext",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<span style=\"pointer-events: none;\" class=\"qti-choice qti-hottext hottext\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\r\n <label class=\"hottext-checkmark\">\r\n <input disabled type=\"checkbox\" value=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\r\n <span class=\"icon-checkbox small\"></span>\r\n </label>\r\n <span class=\"hottext-content\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</span>\r\n</span>",buffer}),Hottext={qtiClass:"hottext",getContainer:containerHelper.get,template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return Hottext}),define("taoQtiItem/reviewRenderer/renderers/choices/SimpleChoice.ChoiceInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_,DOMPurify,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+="\n <input\n disabled\n type=\"radio\"\n name=\"response-"+escapeExpression((stack1=(stack1=depth0&&depth0.interaction,null==stack1||!1===stack1?stack1:stack1.serial),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n value=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n tabindex=\"1\"\n aria-labelledby=\"choice-"+escapeExpression((stack1=(stack1=depth0&&depth0.interaction,null==stack1||!1===stack1?stack1:stack1.serial),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n >\n <span class=\"icon-radio\"></span>\n ",buffer}function program5(depth0){var buffer="",stack1;return buffer+="\n <input\n disabled\n type=\"checkbox\"\n name=\"response-"+escapeExpression((stack1=(stack1=depth0&&depth0.interaction,null==stack1||!1===stack1?stack1:stack1.serial),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n value=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n tabindex=\"1\"\n aria-labelledby=\"choice-"+escapeExpression((stack1=(stack1=depth0&&depth0.interaction,null==stack1||!1===stack1?stack1:stack1.serial),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n >\n <span class=\"icon-checkbox\"></span>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<li class=\"qti-choice qti-simpleChoice\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <div class=\"pseudo-label-box\">\n <label class=\"real-label\">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.unique,{hash:{},inverse:self.program(5,program5,data),fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </label>\n <div class=\"label-box\">\n <div class=\"label-content clear\" contenteditable=\"false\" id=\"choice-"+escapeExpression((stack1=(stack1=depth0&&depth0.interaction,null==stack1||!1===stack1?stack1:stack1.serial),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <svg class=\"overlay-answer-eliminator\">\n <line x1=\"0\" y1=\"100%\" x2=\"100%\" y2=\"0\"/>\n <line x1=\"0\" y1=\"0\" x2=\"100%\" y2=\"100%\"/>\n </svg>\n </div>\n </div>\n </div>\n <label data-eliminable=\"container\" data-label=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Eliminate",options):helperMissing.call(depth0,"__","Eliminate",options)))+"\">\n <span data-eliminable=\"trigger\" class=\"icon-checkbox\"></span>\n </label>\n</li>\n",buffer}),SimpleChoice_ChoiceInteraction={qtiClass:"simpleChoice.choiceInteraction",getContainer:containerHelper.get,getData:function getData(choice,data){return Object.assign(data,{unique:1===parseInt(data.interaction.attributes.maxChoices)})},template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}};return SimpleChoice_ChoiceInteraction}),define("taoQtiItem/reviewRenderer/renderers/config",["lodash","context","ui/themes","taoItems/assets/manager","taoItems/assets/strategies","module","taoQtiItem/portableElementRegistry/assetManager/portableAssetStrategy"],function(_,context,themes,assetManagerFactory,assetStrategies,module,portableAssetStrategy){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,context=context&&Object.prototype.hasOwnProperty.call(context,"default")?context["default"]:context,themes=themes&&Object.prototype.hasOwnProperty.call(themes,"default")?themes["default"]:themes,assetManagerFactory=assetManagerFactory&&Object.prototype.hasOwnProperty.call(assetManagerFactory,"default")?assetManagerFactory["default"]:assetManagerFactory,assetStrategies=assetStrategies&&Object.prototype.hasOwnProperty.call(assetStrategies,"default")?assetStrategies["default"]:assetStrategies,module=module&&Object.prototype.hasOwnProperty.call(module,"default")?module["default"]:module,portableAssetStrategy=portableAssetStrategy&&Object.prototype.hasOwnProperty.call(portableAssetStrategy,"default")?portableAssetStrategy["default"]:portableAssetStrategy;var itemThemes=themes.get("items"),moduleConfig=module.config(),assetManager=assetManagerFactory([{name:"theme",handle:function handle(url){if(itemThemes&&url.path&&(url.path===itemThemes.base||_.contains(_.pluck(itemThemes.available,"path"),url.path)))return context.root_url+url.toString()}},assetStrategies.taomedia,assetStrategies.external,assetStrategies.base64,assetStrategies.itemCssNoCache,assetStrategies.baseUrl,portableAssetStrategy],{baseUrl:""}),config={name:"reviewRenderer",locations:{assessmentItem:"taoQtiItem/qtiCommonRenderer/renderers/Item",_container:"taoQtiItem/qtiCommonRenderer/renderers/Container",_simpleFeedbackRule:!1,_tooltip:"taoQtiItem/qtiCommonRenderer/renderers/Tooltip",stylesheet:"taoQtiItem/qtiCommonRenderer/renderers/Stylesheet",outcomeDeclaration:!1,responseDeclaration:!1,responseProcessing:!1,img:"taoQtiItem/qtiCommonRenderer/renderers/Img",math:"taoQtiItem/qtiCommonRenderer/renderers/Math",object:"taoQtiItem/qtiCommonRenderer/renderers/Object",table:"taoQtiItem/qtiCommonRenderer/renderers/Table",printedVariable:"taoQtiItem/qtiCommonRenderer/renderers/PrintedVariable",rubricBlock:"taoQtiItem/qtiCommonRenderer/renderers/RubricBlock",modalFeedback:"taoQtiItem/qtiCommonRenderer/renderers/ModalFeedback",prompt:"taoQtiItem/qtiCommonRenderer/renderers/interactions/Prompt",infoControl:"taoQtiItem/qtiCommonRenderer/renderers/PortableInfoControl",include:"taoQtiItem/qtiCommonRenderer/renderers/Include",choiceInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/ChoiceInteraction",extendedTextInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/ExtendedTextInteraction",orderInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/OrderInteraction",associateInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/AssociateInteraction",matchInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/MatchInteraction",textEntryInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/TextEntryInteraction",sliderInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/SliderInteraction",inlineChoiceInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/InlineChoiceInteraction","simpleChoice.choiceInteraction":"taoQtiItem/reviewRenderer/renderers/choices/SimpleChoice.ChoiceInteraction",hottext:"taoQtiItem/reviewRenderer/renderers/choices/Hottext",inlineChoice:"taoQtiItem/qtiCommonRenderer/renderers/choices/InlineChoice",hottextInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/HottextInteraction",hotspotInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/HotspotInteraction",hotspotChoice:!1,associableHotspot:!1,gapMatchInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/GapMatchInteraction",selectPointInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/SelectPointInteraction",graphicOrderInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/GraphicOrderInteraction",graphicAssociateInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/GraphicAssociateInteraction",graphicGapMatchInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/GraphicGapMatchInteraction",uploadInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/UploadInteraction",customInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/PortableCustomInteraction",mediaInteraction:"taoQtiItem/reviewRenderer/renderers/interactions/MediaInteraction",gap:"taoQtiItem/qtiCommonRenderer/renderers/choices/Gap",gapText:"taoQtiItem/qtiCommonRenderer/renderers/choices/GapText","simpleChoice.orderInteraction":"taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleChoice.OrderInteraction","simpleAssociableChoice.matchInteraction":"taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleAssociableChoice.MatchInteraction","simpleAssociableChoice.associateInteraction":"taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleAssociableChoice.AssociateInteraction",gapImg:"taoQtiItem/qtiCommonRenderer/renderers/choices/GapImg",endAttemptInteraction:"taoQtiItem/qtiCommonRenderer/renderers/interactions/EndAttemptInteraction"},options:{assetManager:assetManager,themes:itemThemes,enableDragAndDrop:{associate:!!moduleConfig.associateDragAndDrop,gapMatch:!!moduleConfig.gapMatchDragAndDrop,graphicGapMatch:!!moduleConfig.graphicGapMatchDragAndDrop,order:!!moduleConfig.orderDragAndDrop},messages:moduleConfig.messages}};return config}),define("taoQtiItem/reviewRenderer/renderers/interactions/AssociateInteraction",["taoQtiItem/qtiCommonRenderer/renderers/interactions/AssociateInteraction"],function(associateInteraction){'use strict';associateInteraction=associateInteraction&&Object.prototype.hasOwnProperty.call(associateInteraction,"default")?associateInteraction["default"]:associateInteraction;var render=function(interaction){return Promise.resolve(associateInteraction.renderEmptyPairs(interaction))},AssociateInteraction=Object.assign({},associateInteraction,{render:render});return AssociateInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/ChoiceInteraction",["jquery","taoQtiItem/qtiCommonRenderer/renderers/interactions/ChoiceInteraction","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter"],function($,choiceInteraction,containerHelper,sizeAdapter){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,choiceInteraction=choiceInteraction&&Object.prototype.hasOwnProperty.call(choiceInteraction,"default")?choiceInteraction["default"]:choiceInteraction,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,sizeAdapter=sizeAdapter&&Object.prototype.hasOwnProperty.call(sizeAdapter,"default")?sizeAdapter["default"]:sizeAdapter;var render=function(interaction){var $container=containerHelper.get(interaction);"horizontal"===interaction.attr("orientation")&&sizeAdapter.adaptSize($(".add-option, .result-area .target, .choice-area .qti-choice",$container))},ChoiceInteraction=Object.assign({},choiceInteraction,{render:render});return ChoiceInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/ExtendedTextInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/patternMask","taoQtiItem/qtiCommonRenderer/renderers/interactions/ExtendedTextInteraction","taoQtiItem/qtiCommonRenderer/helpers/container"],function(Handlebars,__,_$1,DOMPurify,patternMaskHelper,extendedTextInteraction,containerHelper){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_$1=_$1&&Object.prototype.hasOwnProperty.call(_$1,"default")?_$1["default"]:_$1,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,patternMaskHelper=patternMaskHelper&&Object.prototype.hasOwnProperty.call(patternMaskHelper,"default")?patternMaskHelper["default"]:patternMaskHelper,extendedTextInteraction=extendedTextInteraction&&Object.prototype.hasOwnProperty.call(extendedTextInteraction,"default")?extendedTextInteraction["default"]:extendedTextInteraction,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_$1.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_$1.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_$1.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_$1.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program9(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n ",stack1=(helper=helpers.equal||depth0&&depth0.equal,options={hash:{},inverse:self.program(14,program14,data),fn:self.program(10,program10,data),data:data},helper?helper.call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"xhtml",options):helperMissing.call(depth0,"equal",(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"xhtml",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program10(depth0,data){var buffer="",stack1;return buffer+="\n ",stack1=helpers.each.call(depth0,depth0&&depth0.maxStringLoop,{hash:{},inverse:self.noop,fn:self.program(11,program11,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program11(depth0,data){var buffer="",stack1;return buffer+="\n <div class=\"text-container text-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+" solid",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" name=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"_"+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\"></div>\n ",buffer}function program12(){return" attributes.class"}function program14(depth0,data){var buffer="",stack1;return buffer+="\n ",stack1=helpers.each.call(depth0,depth0&&depth0.maxStringLoop,{hash:{},inverse:self.noop,fn:self.program(15,program15,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program15(depth0,data){var buffer="",stack1,helper;return buffer+="\n <pre class=\"text-container text-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+" solid",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n name=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"_"+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\" ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.patternMask),{hash:{},inverse:self.noop,fn:self.program(16,program16,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" aria-labelledby=\"",(helper=helpers.promptId)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.promptId,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"></pre>\n ",buffer}function program16(depth0){var buffer="",stack1;return buffer+="pattern=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.patternMask),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n ",buffer}function program18(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n ",stack1=(helper=helpers.equal||depth0&&depth0.equal,options={hash:{},inverse:self.program(21,program21,data),fn:self.program(19,program19,data),data:data},helper?helper.call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"xhtml",options):helperMissing.call(depth0,"equal",(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"xhtml",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program19(depth0,data){var buffer="",stack1;return buffer+="\n <div class=\"text-container text-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+" solid",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"></div>\n ",buffer}function program21(depth0,data){var buffer="",stack1,helper;return buffer+="\n <pre class=\"text-container text-"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.format),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+" solid",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n name=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"_"+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\" ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.patternMask),{hash:{},inverse:self.noop,fn:self.program(16,program16,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" aria-labelledby=\"",(helper=helpers.promptId)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.promptId,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"></pre>\n ",buffer}function program23(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <span class=\"count-chars\">0</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"of",options):helperMissing.call(depth0,"__","of",options)))+" <span class=\"count-expected-length\">"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.expectedLength),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"chars",options):helperMissing.call(depth0,"__","chars",options)))+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"recommended",options):helperMissing.call(depth0,"__","recommended",options)))+".\n ",buffer}function program25(depth0,data){var buffer="",stack1;return buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.maxLength,{hash:{},inverse:self.program(28,program28,data),fn:self.program(26,program26,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.maxWords,{hash:{},inverse:self.program(32,program32,data),fn:self.program(30,program30,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program26(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <span class=\"text-counter-chars\"><span class=\"count-chars\">0</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"of",options):helperMissing.call(depth0,"__","of",options)))+" <span class=\"count-max-length\">",(helper=helpers.maxLength)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxLength,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"chars",options):helperMissing.call(depth0,"__","chars",options)))+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"maximum",options):helperMissing.call(depth0,"__","maximum",options)))+".</span>\n ",buffer}function program28(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <span class=\"text-counter-chars\" style=\"display: none\"><span class=\"count-chars\">0</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"of",options):helperMissing.call(depth0,"__","of",options)))+" <span class=\"count-max-length\">",(helper=helpers.maxLength)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxLength,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"chars",options):helperMissing.call(depth0,"__","chars",options)))+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"maximum",options):helperMissing.call(depth0,"__","maximum",options)))+".</span>\n ",buffer}function program30(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <span class=\"text-counter-words\"><span class=\"count-words\">0</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"of",options):helperMissing.call(depth0,"__","of",options)))+" <span class=\"count-max-words\">",(helper=helpers.maxWords)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxWords,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"words",options):helperMissing.call(depth0,"__","words",options)))+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"maximum",options):helperMissing.call(depth0,"__","maximum",options)))+".</span>\n ",buffer}function program32(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <span class=\"text-counter-words\" style=\"display: none\"><span class=\"count-words\">0</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"of",options):helperMissing.call(depth0,"__","of",options)))+" <span class=\"count-max-words\">",(helper=helpers.maxWords)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxWords,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"words",options):helperMissing.call(depth0,"__","words",options)))+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"maximum",options):helperMissing.call(depth0,"__","maximum",options)))+".</span>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-extendedTextInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"extendedTextInteraction\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.multiple,{hash:{},inverse:self.program(18,program18,data),fn:self.program(9,program9,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"text-counter\">\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.expectedLength),{hash:{},inverse:self.program(25,program25,data),fn:self.program(23,program23,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </div>\n</div>",buffer}),_getFormat=function(interaction){var format=interaction.attr("format");return _.contains(["plain","xhtml","preformatted"],format)?format:"plain"},_getTextContainerValue=function(interaction){return"xhtml"===_getFormat(interaction)?containerHelper.get(interaction).find(".text-container")[0].innerHTML:containerHelper.get(interaction).find(".text-container")[0].innerText},_isMultiple=function(interaction){var attributes=interaction.getAttributes(),response=interaction.getResponseDeclaration();return!!(attributes.maxStrings&&("multiple"===response.attr("cardinality")||"ordered"===response.attr("cardinality")))},inputLimiter=function(interaction){var $container=containerHelper.get(interaction),expectedLength=interaction.attr("expectedLength"),expectedLines=interaction.attr("expectedLines"),patternMask=interaction.attr("patternMask"),enabled=!1,$textarea,$charsCounter,$wordsCounter,maxWords,maxLength,$maxLengthCounter,$maxWordsCounter;(expectedLength||expectedLines||patternMask)&&(enabled=!0,$textarea=$(".text-container",$container),$charsCounter=$(".count-chars",$container),$wordsCounter=$(".count-words",$container),$maxLengthCounter=$(".count-max-length",$container),$maxWordsCounter=$(".count-max-words",$container),""!==patternMask&&(maxWords=patternMaskHelper.parsePattern(patternMask,"words"),maxLength=patternMaskHelper.parsePattern(patternMask,"chars"),maxWords=_.isNaN(maxWords)?0:maxWords,maxLength=_.isNaN(maxLength)?0:maxLength,$maxLengthCounter.text(maxLength),$maxWordsCounter.text(maxWords)));var limiter={enabled:enabled,getWordsCount:function getWordsCount(){var value=_getTextContainerValue(interaction)||"";return _.isEmpty(value)?0:value.trim().replace(/\s+/gi," ").split(" ").length},getCharsCount:function getCharsCount(){var value=_getTextContainerValue(interaction)||"";if("xhtml"===_getFormat(interaction)){var div=document.createElement("div");div.innerHTML=value,value=div.textContent||div.innerText||""}return value.replace(/[\r\n]{1}\xA0[\r\n]{1}/gm,"\r").replace(/[\r\n]+/gm,"").length},updateCounter:function(){$charsCounter.text(this.getCharsCount()),$wordsCounter.text(this.getWordsCount())}};return limiter},resetResponse=function(interaction){containerHelper.get(interaction).find(".text-container")[0].innerText=""},setText=function(interaction,text){var limiter=inputLimiter(interaction);containerHelper.get(interaction).find(".text-container")[0].innerHTML=text,limiter.enabled&&limiter.updateCounter()},getResponse=function(interaction){var $container=containerHelper.get(interaction),attributes=interaction.getAttributes(),responseDeclaration=interaction.getResponseDeclaration(),baseType=responseDeclaration.attr("baseType"),numericBase=attributes.base||10,multiple=_isMultiple(interaction),ret=multiple?{list:{}}:{base:{}},value="",values;return multiple?(values=[],$container.find(".text-container").each(function(i){var $el=$(void 0);attributes.placeholderText&&$el.innerText===attributes.placeholderText?values[i]="":"integer"===baseType?(values[i]=parseInt($el.innerText,numericBase),values[i]=isNaN(values[i])?"":values[i]):"float"===baseType?(values[i]=parseFloat($el.innerText),values[i]=isNaN(values[i])?"":values[i]):"string"===baseType&&(values[i]=$el.innerText)}),ret.list[baseType]=values):(attributes.placeholderText&&_getTextContainerValue(interaction)===attributes.placeholderText?value="":"integer"===baseType?value=parseInt(_getTextContainerValue(interaction),numericBase):"float"===baseType?value=parseFloat(_getTextContainerValue(interaction)):"string"===baseType&&(value=_getTextContainerValue(interaction)),ret.base[baseType]=isNaN(value)&&"number"==typeof value?"":value),ret},ExtendedTextInteraction=Object.assign({},extendedTextInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:function render(interaction){return new Promise(function(resolve){var $container=containerHelper.get(interaction),multiple=_isMultiple(interaction),placeholderText=interaction.attr("placeholderText"),$el,expectedLength,minStrings,patternMask,placeholderType;multiple?($el=$container.find(".text-container"),minStrings=interaction.attr("minStrings"),expectedLength=interaction.attr("expectedLength"),patternMask=interaction.attr("patternMask"),expectedLength&&(expectedLength=parseInt(expectedLength,10),0<expectedLength&&$el.each(function(){$(void 0).css("width",expectedLength+"em")})),placeholderText&&(placeholderType="first","multiple"===placeholderType?$el.each(function(){$(void 0).attr("placeholder",placeholderText)}):"first"==placeholderType&&$el.first().attr("placeholder",placeholderText)),resolve()):($el=$container.find(".text-container"),placeholderText&&$el.attr("placeholder",placeholderText),$el.on("keyup.commonRenderer change.commonRenderer",function(){containerHelper.triggerResponseChangeEvent(interaction,{})}),resolve())})},getResponse:getResponse,setResponse:function setResponse(interaction,response){var _setMultipleVal=function(identifier,value){interaction.getContainer().find("#".concat(identifier))[0].innerHTML=value},baseType=interaction.getResponseDeclaration().attr("baseType");if(null===response.base&&1===Object.keys(response).length&&(response={base:{string:""}}),response.base&&"undefined"!=typeof response.base[baseType])setText(interaction,response.base[baseType]);else if(response.list&&response.list[baseType])for(var i in response.list[baseType]){var serial="undefined"==typeof response.list.serial?"":response.list.serial[i];_setMultipleVal("".concat(serial,"_").concat(i),response.list[baseType][i])}else throw new Error("wrong response format in argument.")},resetResponse:resetResponse,setText:setText,inputLimiter:inputLimiter});return ExtendedTextInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/GapMatchInteraction",["taoQtiItem/qtiCommonRenderer/renderers/interactions/GapMatchInteraction"],function(gapMatchInteraction){'use strict';gapMatchInteraction=gapMatchInteraction&&Object.prototype.hasOwnProperty.call(gapMatchInteraction,"default")?gapMatchInteraction["default"]:gapMatchInteraction;var GapMatchInteraction=Object.assign({},gapMatchInteraction,{render:function render(){return null}});return GapMatchInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/GraphicAssociateInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicAssociateInteraction"],function(Handlebars,__,_,DOMPurify,graphicAssociateInteraction){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,graphicAssociateInteraction=graphicAssociateInteraction&&Object.prototype.hasOwnProperty.call(graphicAssociateInteraction,"default")?graphicAssociateInteraction["default"]:graphicAssociateInteraction;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div style=\"pointer-events: none;\" ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-graphicInteraction qti-graphicAssociateInteraction clearfix",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"image-editor solid\">\n <div id='graphic-paper-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"' class=\"main-image-box\"></div>\n </div>\n</div>\n",buffer}),GraphicAssociateInteraction=Object.assign({},graphicAssociateInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}});return GraphicAssociateInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/GraphicGapMatchInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicGapMatchInteraction"],function(Handlebars,__,_,DOMPurify,graphicGapMatchInteraction){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,graphicGapMatchInteraction=graphicGapMatchInteraction&&Object.prototype.hasOwnProperty.call(graphicGapMatchInteraction,"default")?graphicGapMatchInteraction["default"]:graphicGapMatchInteraction;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program9(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<div style=\"pointer-events: none;\" ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-graphicInteraction qti-graphicGapMatchInteraction clearfix",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"image-editor solid\">\n <div id='graphic-paper-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"' class=\"main-image-box\"></div>\n <div class=\"clearfix\"></div>\n <ul class=\"none block-listing horizontal source\">\n ",options={hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data},(helper=helpers.gapImgs)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.gapImgs,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.gapImgs||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </ul>\n </div>\n</div>\n",buffer}),GraphicGapMatchInteraction=Object.assign({},graphicGapMatchInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}});return GraphicGapMatchInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/GraphicOrderInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicOrderInteraction"],function(Handlebars,__,_,DOMPurify,graphicOrderInteraction){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,graphicOrderInteraction=graphicOrderInteraction&&Object.prototype.hasOwnProperty.call(graphicOrderInteraction,"default")?graphicOrderInteraction["default"]:graphicOrderInteraction;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div style=\"pointer-events: none;\" ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-graphicInteraction qti-graphicOrderInteraction clearfix",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"image-editor solid\">\n <div id='graphic-paper-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"' class=\"main-image-box\"></div>\n <div class=\"clearfix\"></div>\n <ul class=\"none block-listing horizontal ordinals\"></ul>\n </div>\n</div>\n",buffer}),GraphicOrderInteraction=Object.assign({},graphicOrderInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}});return GraphicOrderInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/HotspotInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/renderers/interactions/HotspotInteraction"],function(Handlebars,__,_,DOMPurify,hotspotInteraction){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,hotspotInteraction=hotspotInteraction&&Object.prototype.hasOwnProperty.call(hotspotInteraction,"default")?hotspotInteraction["default"]:hotspotInteraction;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div style=\"pointer-events: none;\" ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-graphicInteraction qti-hotspotInteraction clearfix",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"image-editor solid\">\n <div id='graphic-paper-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"' class=\"main-image-box\"></div>\n </div>\n</div>\n",buffer}),HotspotInteraction=Object.assign({},hotspotInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}});return HotspotInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/InlineChoiceInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/renderers/interactions/InlineChoiceInteraction"],function(Handlebars,__,_,DOMPurify,inlineChoiceInteraction){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,inlineChoiceInteraction=inlineChoiceInteraction&&Object.prototype.hasOwnProperty.call(inlineChoiceInteraction,"default")?inlineChoiceInteraction["default"]:inlineChoiceInteraction;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<select disabled ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-inlineInteraction qti-inlineChoiceInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-qti-class=\"inlineChoiceInteraction\"\n data-has-search=\"false\"\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n>\n <option></option> \n <option value=\"empty\"></option>\n ",options={hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data},(helper=helpers.choices)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.choices,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.choices||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</select>\n",buffer}),InlineChoiceInteraction=Object.assign({},inlineChoiceInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}});return InlineChoiceInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/MatchInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/renderers/interactions/MatchInteraction"],function(Handlebars,__,_,DOMPurify,containerHelper,matchInteraction){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,matchInteraction=matchInteraction&&Object.prototype.hasOwnProperty.call(matchInteraction,"default")?matchInteraction["default"]:matchInteraction;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program9(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}function program11(depth0,data,depth1){var buffer="",stack1;return buffer+="\n <tr>\n ",stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers.each.call(depth0,depth1&&depth1.matchSet1,{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </tr>\n ",buffer}function program12(){return"\n <td>\n <label>\n <input disabled type=\"checkbox\" >\n <span class=\"icon-checkbox cross\"></span>\n </label>\n </td>\n "}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<div ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-matchInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"matchInteraction\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"match-interaction-area\">\n <table class=\"matrix\">\n <thead>\n <tr>\n <th> </th>\n ",options={hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data},(helper=helpers.matchSet1)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.matchSet1,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.matchSet1||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </tr>\n </thead>\n <tbody>\n ",options={hash:{},inverse:self.noop,fn:self.programWithDepth(11,program11,data,depth0),data:data},(helper=helpers.matchSet2)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.matchSet2,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.matchSet2||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.programWithDepth(11,program11,data,depth0),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </tbody>\n </table>\n </div>\n <div class=\"notification-container\"></div>\n</div>\n",buffer}),render=function(interaction){var $container=containerHelper.get(interaction);$container.on("click.commonRenderer","input[type=checkbox]",function(e){return e.preventDefault()})},MatchInteraction=Object.assign({},matchInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:render});return MatchInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/MediaInteraction",["jquery","lodash","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCommonRenderer/renderers/interactions/MediaInteraction","ui/mediaplayer"],function($,_,containerHelper,pciResponse,mediaInteraction,mediaplayer){'use strict';function setResponse(interaction,response){if(response)try{var responseValues=pciResponse.unserialize(response,interaction),timesPlayed=parseInt(responseValues[0],10);containerHelper.get(interaction).data("timesPlayed",timesPlayed)}catch(e){}}$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,mediaInteraction=mediaInteraction&&Object.prototype.hasOwnProperty.call(mediaInteraction,"default")?mediaInteraction["default"]:mediaInteraction,mediaplayer=mediaplayer&&Object.prototype.hasOwnProperty.call(mediaplayer,"default")?mediaplayer["default"]:mediaplayer;var defaults={type:"video/mp4",video:{height:270}},MediaInteraction=Object.assign({},mediaInteraction,{render:function(interaction){var _this16=this;return new Promise(function(resolve){var $container=containerHelper.get(interaction),media=interaction.object,$item=$container.parents(".qti-item"),url=media.attr("data")||"",resize=_.debounce(function(){if(interaction.mediaElement){var height=$container.find(".media-container").height(),width=$container.find(".media-container").width();interaction.mediaElement.resize(width,height)}},200),initMediaPlayer=function(){interaction.mediaElement||(interaction.mediaElement=mediaplayer({url:url&&_this16.resolveUrl(url),type:media.attr("type")||defaults.type,canPause:!0,canSeek:!0,width:media.attr("width"),height:media.attr("height"),autoStart:!1,loop:!1,renderTo:$(".media-container",$container)}).on("render",function(){resize(),$(window).off("resize.mediaInteraction").on("resize.mediaInteraction",resize),$item.off("resize.gridEdit").on("resize.gridEdit",resize),$container.trigger("playerrendered")}).on("ready",function(){$container.trigger("playerready"),resolve()}).on("update",_.throttle(function(){containerHelper.triggerResponseChangeEvent(interaction)},1e3)).on("ended",function(){containerHelper.triggerResponseChangeEvent(interaction)}))};0===_.size(media.attributes)&&(media.attr("type",defaults.type),media.attr("width",$container.innerWidth()),media.attr("height",defaults.video.height),media.attr("data","")),$container.on("responseSet",function(){initMediaPlayer()}),initMediaPlayer()})},setResponse:setResponse});return MediaInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/OrderInteraction",["jquery","core/mouseEvent","taoQtiItem/qtiCommonRenderer/renderers/interactions/OrderInteraction","taoQtiItem/qtiCommonRenderer/helpers/container"],function($,mouseEvent,orderInteraction,containerHelper){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,orderInteraction=orderInteraction&&Object.prototype.hasOwnProperty.call(orderInteraction,"default")?orderInteraction["default"]:orderInteraction,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var _freezeSize=function($container){var $orderArea=$container.find(".order-interaction-area");$orderArea.height($orderArea.height())},render=function(interaction){var $container=containerHelper.get(interaction);$(document).on("attributeChange.qti-widget.commonRenderer",function(e){return e.preventDefault()}),_freezeSize($container)},OrderInteraction=Object.assign({},orderInteraction,{render:render});return OrderInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/PortableCustomInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/renderers/interactions/PortableCustomInteraction","taoQtiItem/qtiItem/helper/util","taoQtiItem/qtiCommonRenderer/helpers/PortableElement","taoQtiItem/reviewRenderer/helpers/pci"],function(Handlebars,__,_,DOMPurify,portableCustomInteraction,util,PortableElement,pci){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,portableCustomInteraction=portableCustomInteraction&&Object.prototype.hasOwnProperty.call(portableCustomInteraction,"default")?portableCustomInteraction["default"]:portableCustomInteraction,util=util&&Object.prototype.hasOwnProperty.call(util,"default")?util["default"]:util,PortableElement=PortableElement&&Object.prototype.hasOwnProperty.call(PortableElement,"default")?PortableElement["default"]:PortableElement;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program3(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div ",stack1=helpers["if"].call(depth0,depth0&&depth0.isInteractionDisabled,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"style=\"pointer-events: none;\" "},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-customInteraction\"\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.markup)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.markup,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</div>",buffer}),getData=function(customInteraction,data){var markup=data.markup,isInteractionDisabled=pci.isInteractionDisabledForPci(data.typeIdentifier);return customInteraction.properties.isReviewMode=!0,markup=util.removeMarkupNamespaces(markup),markup=PortableElement.fixMarkupMediaSources(markup,void 0),Object.assign({},data,{markup:markup,isInteractionDisabled:isInteractionDisabled})},PortableCustomInteraction=Object.assign({},portableCustomInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},getData:getData,setState:function setState(interaction,serializedState){var pciRenderer=interaction.data("pci-renderer");"function"==typeof pciRenderer.setReviewState?pciRenderer.setReviewState(interaction,serializedState):pciRenderer.setState(interaction,serializedState)}});return PortableCustomInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/SelectPointInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/renderers/interactions/SelectPointInteraction"],function(Handlebars,__,_,DOMPurify,selectPointInteraction){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,selectPointInteraction=selectPointInteraction&&Object.prototype.hasOwnProperty.call(selectPointInteraction,"default")?selectPointInteraction["default"]:selectPointInteraction;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div style=\"pointer-events: none;\" ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-graphicInteraction qti-selectPointInteraction clearfix",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"instruction-container\"></div>\n <div class=\"image-editor solid\">\n <div id='graphic-paper-",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"' class=\"main-image-box\"></div>\n </div>\n</div>\n",buffer}),SelectPointInteraction=Object.assign({},selectPointInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}});return SelectPointInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/SliderInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/renderers/interactions/SliderInteraction"],function(Handlebars,__,_,DOMPurify,sliderInteraction){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,sliderInteraction=sliderInteraction&&Object.prototype.hasOwnProperty.call(sliderInteraction,"default")?sliderInteraction["default"]:sliderInteraction;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}function program5(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program7(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div style=\"pointer-events: none;\" ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-interaction qti-blockInteraction qti-sliderInteraction",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"sliderInteraction\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" >\r\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\r\n <div class=\"instruction-container\"></div>\r\n</div>\r\n",buffer}),SliderInteraction=Object.assign({},sliderInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}});return SliderInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/TextEntryInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/renderers/interactions/TextEntryInteraction","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","util/locale"],function(Handlebars,__,_,DOMPurify,textEntryInteraction,containerHelper,pciResponse,locale){'use strict';Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,textEntryInteraction=textEntryInteraction&&Object.prototype.hasOwnProperty.call(textEntryInteraction,"default")?textEntryInteraction["default"]:textEntryInteraction,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,pciResponse=pciResponse&&Object.prototype.hasOwnProperty.call(pciResponse,"default")?pciResponse["default"]:pciResponse,locale=locale&&Object.prototype.hasOwnProperty.call(locale,"default")?locale["default"]:locale;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<span ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\tclass=\"qti-interaction qti-inlineInteraction qti-textEntryInteraction review-text-container\"\n\tdata-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"textEntryInteraction\">\n</span>",buffer}),setResponse=function(interaction,response){var responseValue;try{responseValue=pciResponse.unserialize(response,interaction)}catch(e){console.error(e.message)}responseValue&&responseValue.length&&interaction.getContainer().text(responseValue[0])},getResponse=function(interaction){var $input=interaction.getContainer(),attributes=interaction.getAttributes(),baseType=interaction.getResponseDeclaration().attr("baseType"),numericBase=attributes.base||10,value;return $input.hasClass("invalid")||attributes.placeholderText&&$input.text()===attributes.placeholderText?value="":"integer"===baseType?value=locale.parseInt($input.text(),numericBase):"float"===baseType?value=locale.parseFloat($input.text()):"string"===baseType&&(value=$input.text()),{base:_defineProperty({},baseType,isNaN(value)&&"number"==typeof value?"":value)}},destroy=function(interaction){containerHelper.reset(interaction)},TextEntryInteraction=Object.assign({},textEntryInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},render:function render(interaction){var attributes=interaction.getAttributes();if(attributes.expectedLength)interaction.getContainer()},getResponse:getResponse,setResponse:setResponse,resetResponse:function resetResponse(interaction){interaction.getContainer().text("")},destroy:destroy});return TextEntryInteraction}),define("taoQtiItem/reviewRenderer/renderers/interactions/UploadInteraction",["handlebars","i18n","lodash","lib/dompurify/purify","taoQtiItem/qtiCommonRenderer/renderers/interactions/UploadInteraction","taoQtiItem/qtiCommonRenderer/helpers/container","ui/previewer"],function(Handlebars,__,_$1,DOMPurify,uploadInteraction,containerHelper){'use strict';function setResponse(interaction,response){var $container=containerHelper.get(interaction),$previewArea=$container.find(".file-upload-preview");if(response.base&&response.base.file){var downloadLink=document.createElement("a"),_response$base$file=response.base.file,filename=_response$base$file.name,mime=_response$base$file.mime,data=_response$base$file.data,downloadUrl=data?"data:".concat(mime,";base64,").concat(response.base.file.data):"";$container.find(".file-name").empty().text(filename),$container.find("[data-control=\"download\"]").on("click",function(e){e.preventDefault(),downloadLink.href=downloadUrl,downloadLink.download=filename,downloadLink.click()}),$previewArea.previewer({url:downloadUrl,name:filename,mime:mime})}else $container.find(".file-upload").hide(),$previewArea.css({"min-width":"300px","min-height":"200px"});interaction.data("_response",response)}function callResetGui(interaction){var renderer=interaction.getRenderer();_.isFunction(renderer.resetGui)&&renderer.resetGui(interaction)}Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,_$1=_$1&&Object.prototype.hasOwnProperty.call(_$1,"default")?_$1["default"]:_$1,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,uploadInteraction=uploadInteraction&&Object.prototype.hasOwnProperty.call(uploadInteraction,"default")?uploadInteraction["default"]:uploadInteraction,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_$1.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_$1.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_$1.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_$1.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" lang=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"qti-interaction qti-blockInteraction qti-uploadInteraction\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["xml:lang"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n\t",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"file-upload fixed-grid-row lft\">\n <span class=\"file-name placeholder col-8 truncate\"></span>\n <button type=\"button\" data-control=\"download\" class=\"btn-info small\"><span class=\"icon-download\"></span> "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Download",options):helperMissing.call(depth0,"__","Download",options)))+"</button>\n </div>\n <div class=\"file-upload-preview lft visible-file-upload-preview runtime-visible-file-upload-preview\">\n <p class=\"nopreview\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"No uploaded file",options):helperMissing.call(depth0,"__","No uploaded file",options)))+"</p>\n </div>\n</div>\n",buffer}),UploadInteraction=Object.assign({},uploadInteraction,{template:function(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)},setResponse:setResponse,render:function(interaction){callResetGui(interaction),interaction.data("_response",{base:null})}});return UploadInteraction}),define("taoQtiItem/reviewRenderer/renderers/Renderer",["taoQtiItem/qtiRunner/core/Renderer","taoQtiItem/reviewRenderer/renderers/config"],function(Renderer$1,config){'use strict';Renderer$1=Renderer$1&&Object.prototype.hasOwnProperty.call(Renderer$1,"default")?Renderer$1["default"]:Renderer$1,config=config&&Object.prototype.hasOwnProperty.call(config,"default")?config["default"]:config;var Renderer=Renderer$1.build(config.locations,config.name,config.options);return Renderer}),define("taoQtiItem/reviewRenderer/renderers/rendererProvider",["taoQtiItem/reviewRenderer/renderers/Renderer"],function(ReviewRenderer){'use strict';ReviewRenderer=ReviewRenderer&&Object.prototype.hasOwnProperty.call(ReviewRenderer,"default")?ReviewRenderer["default"]:ReviewRenderer;return{name:"reviewRenderer",init:function init(){},getRenderer:function getRenderer(){return ReviewRenderer}}}),define("tpl!taoQtiItem/qtiCreator/component/tpl/itemAuthoring",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="<div id=\"item-editor-scope\" data-content-target=\"wide\">\n\n <nav class=\"action-bar plain content-action-bar horizontal-action-bar\">\n <ul class=\"menu-left action-group plain item-editor-menu\"></ul>\n\n <ul class=\"menu action-group plain item-editor-menu\"></ul>\n\n <ul class=\"menu-right action-group plain item-editor-menu\">\n <li id=\"appearance-trigger\" class=\"btn-info small rgt\">\n <span class=\"li-inner\">\n <span class=\"icon-item\"></span>\n <span class=\"icon-style\"></span>\n <span class=\"menu-label\" data-item=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Item properties",options):helperMissing.call(depth0,"__","Item properties",options)))+"\"\n data-style=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Style Editor",options):helperMissing.call(depth0,"__","Style Editor",options)))+"\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Style Editor",options):helperMissing.call(depth0,"__","Style Editor",options)))+"</span>\n </span>\n </li>\n </ul>\n </nav>\n <div class=\"wrapper clearfix content sidebar-popup-parent\" id=\"item-editor-wrapper\">\n\n <!-- interaction panel -->\n <div class=\"item-editor-sidebar-wrapper left-bar\">\n <form class=\"item-editor-sidebar\" id=\"item-editor-interaction-bar\" autocomplete=\"off\"></form>\n </div>\n\n <!-- item panel -->\n <main id=\"item-editor-panel\" class=\"clearfix\">\n\n <div class=\"item-editor-bar\">\n <h1 class=\"truncate\"></h1>\n <div id=\"toolbar-top\"></div>\n </div>\n\n <div id=\"item-editor-scoll-container\">\n <div id=\"item-editor-scroll-outer\">\n <div id=\"item-editor-scroll-inner\">\n <!-- item goes here -->\n </div>\n </div>\n </div>\n\n </main>\n\n <!-- properties panel -->\n <div class=\"item-editor-sidebar-wrapper right-bar sidebar-popup-parent\">\n <div class=\"item-editor-sidebar\" id=\"item-editor-item-widget-bar\">\n <div class=\"item-editor-item-related sidebar-right-section-box\" id=\"item-style-editor-bar\">\n <section class=\"tool-group clearfix\" id=\"sidebar-right-css-manager\">\n\n <h2>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Style Sheet Manager",options):helperMissing.call(depth0,"__","Style Sheet Manager",options)))+"</h2>\n\n <div class=\"panel\">\n\n <ul class=\"none\" id=\"style-sheet-toggler\">\n <!-- TAO style sheet -->\n <li data-css-res=\"taoQtiItem/views/css/themes/default.css\">\n <span class=\"icon-preview style-sheet-toggler\"\n title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Disable this stylesheet temporarily",options):helperMissing.call(depth0,"__","Disable this stylesheet temporarily",options)))+"\"></span>\n <span>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"TAO default styles",options):helperMissing.call(depth0,"__","TAO default styles",options)))+"</span>\n </li>\n\n </ul>\n <button id=\"stylesheet-uploader\"\n class=\"btn-info small block\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Add Style Sheet",options):helperMissing.call(depth0,"__","Add Style Sheet",options)))+"</button>\n </div>\n </section>\n\n <section class=\"tool-group clearfix\" id=\"sidebar-right-style-editor\">\n\n <h2>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Style Editor",options):helperMissing.call(depth0,"__","Style Editor",options)))+"</h2>\n\n <div class=\"panel color-picker-panel\">\n <div class=\"item-editor-color-picker sidebar-popup-container-box\">\n <div class=\"color-picker-container sidebar-popup\">\n <div class=\"sidebar-popup-title\">\n <h3 id=\"color-picker-title\"></h3>\n <a class=\"closer\" href=\"#\" data-close=\"#color-picker-container\"></a>\n </div>\n <div class=\"sidebar-popup-content\">\n <div class=\"color-picker\"></div>\n <input id=\"color-picker-input\" type=\"text\" value=\"#000000\">\n </div>\n </div>\n <div class=\"reset-group\">\n <div class=\"clearfix\">\n <label for=\"initial-bg\" class=\"truncate\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Background color",options):helperMissing.call(depth0,"__","Background color",options)))+"</label>\n <span class=\"icon-eraser reset-button\" data-value=\"background-color\"\n title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove custom background color",options):helperMissing.call(depth0,"__","Remove custom background color",options)))+"\"></span>\n <span class=\"color-trigger\" id=\"initial-bg\" data-value=\"background-color\"\n data-target=\"body div.qti-item, body div.qti-item .qti-associateInteraction .result-area > li > .target\"></span>\n </div>\n <div class=\"clearfix\">\n <label for=\"initial-color\" class=\"truncate\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Text color",options):helperMissing.call(depth0,"__","Text color",options)))+"</label>\n <span class=\"icon-eraser reset-button\" data-value=\"color\"\n title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove custom text color",options):helperMissing.call(depth0,"__","Remove custom text color",options)))+"\"></span>\n <span class=\"color-trigger\" id=\"initial-color\" data-value=\"color\"\n data-target=\"body div.qti-item\"></span>\n </div>\n <div class=\"clearfix\">\n <label for=\"initial-color\" class=\"truncate\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Border color",options):helperMissing.call(depth0,"__","Border color",options)))+"</label>\n <span class=\"icon-eraser reset-button\" data-value=\"color\"\n title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove custom border color",options):helperMissing.call(depth0,"__","Remove custom border color",options)))+"\"></span>\n <span class=\"color-trigger\" id=\"initial-color\" data-value=\"border-color\"\n data-target=\"body div.qti-item .solid,body div.qti-item .matrix, body div.qti-item table.matrix th, body div.qti-item table.matrix td\"></span>\n </div>\n <div class=\"clearfix\">\n <label for=\"initial-color\" class=\"truncate\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Table headings",options):helperMissing.call(depth0,"__","Table headings",options)))+"</label>\n <span class=\"icon-eraser reset-button\" data-value=\"color\"\n title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove custom background color",options):helperMissing.call(depth0,"__","Remove custom background color",options)))+"\"></span>\n <span class=\"color-trigger\" id=\"initial-color\" data-value=\"background-color\"\n data-target=\"body div.qti-item .matrix th\"></span>\n </div>\n </div>\n </div>\n </div>\n <hr>\n <div class=\"panel\">\n\n <div>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Font family",options):helperMissing.call(depth0,"__","Font family",options)))+"</div>\n\n <div class=\"reset-group\">\n <select\n data-target=\"body div.qti-item\"\n id=\"item-editor-font-selector\"\n data-has-search=\"false\"\n data-placeholder=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Default",options):helperMissing.call(depth0,"__","Default",options)))+"\"\n class=\"select2 has-icon\"\n data-role=\"font-selector\"></select>\n <span class=\"icon-eraser reset-button\" data-role=\"font-selector-reset\"\n title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove custom font family",options):helperMissing.call(depth0,"__","Remove custom font family",options)))+"\"></span>\n </div>\n\n </div>\n <div class=\"panel\">\n <div>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Font size",options):helperMissing.call(depth0,"__","Font size",options)))+"</div>\n <div class=\"reset-group\">\n <span id=\"item-editor-font-size-changer\" data-target=\"body div.qti-item\">\n <a href=\"#\" data-action=\"reduce\" title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Reduce font size",options):helperMissing.call(depth0,"__","Reduce font size",options)))+"\"\n class=\"icon-smaller\"></a>\n <a href=\"#\" data-action=\"enlarge\" title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Enlarge font size",options):helperMissing.call(depth0,"__","Enlarge font size",options)))+"\"\n class=\"icon-larger\"></a>\n </span>\n\n <span id=\"item-editor-font-size-manual-input\" class=\"item-editor-unit-input-box\">\n <input type=\"text\" id=\"item-editor-font-size-text\" class=\"has-icon\"\n placeholder=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"e.g. 13",options):helperMissing.call(depth0,"__","e.g. 13",options)))+"\">\n <span class=\"unit-indicator\">px</span>\n </span>\n <span class=\"icon-eraser reset-button\" data-role=\"font-size-reset\"\n title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove custom font size",options):helperMissing.call(depth0,"__","Remove custom font size",options)))+"\"></span>\n </div>\n\n </div>\n <hr>\n <div class=\"panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Item width",options):helperMissing.call(depth0,"__","Item width",options)))+"</h3>\n <span class=\"icon-help tooltipstered\" data-tooltip-theme=\"info\"\n data-tooltip=\"~ .tooltip-content:first\"></span>\n\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Change the width of the item. By default the item has a width of 100% and adapts to the size of any screen. The maximal width is by default 1024px - this will also change when you set a custom with.",options):helperMissing.call(depth0,"__","Change the width of the item. By default the item has a width of 100% and adapts to the size of any screen. The maximal width is by default 1024px - this will also change when you set a custom with.",options)))+"\n </div>\n <div id=\"item-editor-item-resizer\" data-target=\"body div.qti-item\">\n <label class=\"smaller-prompt\">\n <input type=\"radio\" name=\"item-width-prompt\" checked value=\"no-slider\">\n <span class=\"icon-radio\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Adapt to screen size",options):helperMissing.call(depth0,"__","Adapt to screen size",options)))+"\n </label>\n <label class=\"smaller-prompt\">\n <input type=\"radio\" name=\"item-width-prompt\" value=\"slider\">\n <span class=\"icon-radio\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Defined width",options):helperMissing.call(depth0,"__","Defined width",options)))+"\n </label>\n\n <div class=\"reset-group slider-box\">\n <p id=\"item-editor-item-resizer-slider\"></p>\n <span id=\"item-editor-item-resizer-manual-input\" class=\"item-editor-unit-input-box\">\n <input type=\"text\" id=\"item-editor-item-resizer-text\" class=\"has-icon\"\n placeholder=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"e.g. 960",options):helperMissing.call(depth0,"__","e.g. 960",options)))+"\">\n <span class=\"unit-indicator\">px</span>\n </span>\n <span class=\"icon-eraser reset-button\" data-role=\"item-width-reset\"\n title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove custom item width",options):helperMissing.call(depth0,"__","Remove custom item width",options)))+"\"></span>\n </div>\n </div>\n\n </div>\n\n </section>\n\n </div>\n <div class=\"item-editor-item-related sidebar-right-section-box\" id=\"item-editor-item-property-bar\">\n <section class=\"tool-group clearfix\" id=\"sidebar-right-item-properties\">\n <h2>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Item Properties",options):helperMissing.call(depth0,"__","Item Properties",options)))+"</h2>\n\n <div class=\"panel\"></div>\n </section>\n </div>\n <div class=\"item-editor-item-related sidebar-right-section-box\" id=\"item-editor-text-property-bar\">\n <section class=\"tool-group clearfix\" id=\"sidebar-right-text-block-properties\">\n <h2>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Text Block Properties",options):helperMissing.call(depth0,"__","Text Block Properties",options)))+"</h2>\n\n <div class=\"panel\"></div>\n </section>\n </div>\n <div class=\"item-editor-interaction-related sidebar-right-section-box\"\n id=\"item-editor-interaction-property-bar\">\n <section class=\"tool-group clearfix\" id=\"sidebar-right-interaction-properties\">\n <h2>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Interaction Properties",options):helperMissing.call(depth0,"__","Interaction Properties",options)))+"</h2>\n\n <div class=\"panel\"></div>\n </section>\n </div>\n <div class=\"item-editor-choice-related sidebar-right-section-box\" id=\"item-editor-choice-property-bar\">\n <section class=\"tool-group clearfix\" id=\"sidebar-right-choice-properties\">\n <h2>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Choice Properties",options):helperMissing.call(depth0,"__","Choice Properties",options)))+"</h2>\n\n <div class=\"panel\"></div>\n </section>\n </div>\n <div class=\"item-editor-response-related sidebar-right-section-box\"\n id=\"item-editor-response-property-bar\">\n <section class=\"tool-group clearfix\" id=\"sidebar-right-response-properties\">\n <h2>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Response Properties",options):helperMissing.call(depth0,"__","Response Properties",options)))+"</h2>\n\n <div class=\"panel\"></div>\n </section>\n </div>\n <div class=\"item-editor-modal-feedback-related sidebar-right-section-box\"\n id=\"item-editor-modal-feedback-property-bar\">\n <section class=\"tool-group clearfix\" id=\"sidebar-right-response-properties\">\n <h2>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Modal Feedback Prop.",options):helperMissing.call(depth0,"__","Modal Feedback Prop.",options)))+"</h2>\n\n <div class=\"panel\"></div>\n </section>\n </div>\n <div class=\"item-editor-body-element-related sidebar-right-section-box\"\n id=\"item-editor-body-element-property-bar\">\n <section class=\"tool-group clearfix\" id=\"sidebar-right-body-element-properties\">\n <h2>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Element Properties",options):helperMissing.call(depth0,"__","Element Properties",options)))+"</h2>\n\n <div class=\"panel\"></div>\n </section>\n </div>\n </div>\n </div>\n <!-- /properties panel -->\n\n\n </div>\n <!-- preview: item may needed to be saved before -->\n <div class=\"preview-modal-feedback modal\">\n <div class=\"modal-body clearfix\">\n <p>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The item needs to be saved before it can be previewed",options):helperMissing.call(depth0,"__","The item needs to be saved before it can be previewed",options)))+"</p>\n\n <div class=\"rgt\">\n <button class=\"btn-regular small cancel\" type=\"button\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Cancel",options):helperMissing.call(depth0,"__","Cancel",options)))+"</button>\n <button class=\"btn-info small save\" type=\"button\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Save",options):helperMissing.call(depth0,"__","Save",options)))+"</button>\n </div>\n </div>\n </div>\n\n <div id=\"mediaManager\"></div>\n <div id=\"modal-container\"></div>\n</div>",buffer})}),define("css!taoQtiItemCss/qti-runner",[],function(){}),define("css!taoQtiItemCss/themes/default",[],function(){}),define("css!taoQtiItemCss/item-creator",[],function(){}),define("taoQtiItem/qtiCreator/component/itemAuthoring",["lodash","ui/component","core/pluginLoader","taoQtiItem/qtiCreator/itemCreator","taoQtiItem/qtiCreator/editor/areaBroker","tpl!taoQtiItem/qtiCreator/component/tpl/itemAuthoring","css!taoQtiItemCss/qti-runner.css","css!taoQtiItemCss/themes/default.css","css!taoQtiItemCss/item-creator.css"],function(_,componentFactory,pluginLoaderFactory,itemCreatorFactory,areaBrokerFactory,componentTpl){'use strict';return function(container,config){var pluginLoader=pluginLoaderFactory(),itemAuthoring=componentFactory({getItemCreator:function getItemCreator(){return itemCreator},getAreaBroker:function getAreaBroker(){return areaBroker}}).setTemplate(componentTpl).on("init",function(){var _this17=this;_.forEach(this.getConfig().plugins,function(plugin){plugin&&plugin.module&&(plugin.exclude?pluginLoader.remove(plugin.module):pluginLoader.add(plugin))}),pluginLoader.load().then(function(){return _this17.render(container)}).catch(function(err){return _this17.trigger("error",err)})}).on("render",function(){var $container=this.getElement();areaBroker=areaBrokerFactory($container,{menu:$container.find(".menu"),menuLeft:$container.find(".menu-left"),menuRight:$container.find(".menu-right"),contentCreatorPanel:$container.find("#item-editor-panel"),editorBar:$container.find("#item-editor-panel .item-editor-bar"),title:$container.find("#item-editor-panel .item-editor-bar h1"),toolbar:$container.find("#item-editor-panel .item-editor-bar #toolbar-top"),interactionPanel:$container.find("#item-editor-interaction-bar"),propertyPanel:$container.find("#item-editor-item-widget-bar"),itemPanel:$container.find("#item-editor-scroll-inner"),itemPropertyPanel:$container.find("#sidebar-right-item-properties"),itemStylePanel:$container.find("#item-style-editor-bar"),modalContainer:$container.find("#modal-container"),elementPropertyPanel:$container.find("#item-editor-body-element-property-bar .panel")}),itemCreator=itemCreatorFactory(this.getConfig(),areaBroker,pluginLoader.getPlugins()).spread(this,"error success ready").on("init",function(){this.render()}).init()}).on("destroy",function(){itemCreator&&itemCreator.destroy(),itemCreator=null,areaBroker=null}),areaBroker,itemCreator;return _.defer(function(){return itemAuthoring.init(config)}),itemAuthoring}}),define("tpl!taoQtiItem/qtiCreator/editor/blockAdder/tpl/addColumnRow",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{},"<div class=\"add-block-element\">\n <div class=\"line\"></div>\n <div class=\"circle\" title=\"Insert block below\"><span>+</span></div>\n</div>"})}),define("taoQtiItem/qtiCreator/editor/gridEditor/config",[],function(){"use strict";return{min:{interaction:2,text:1,rubricBlock:12},throttle:{resize:100}}}),define("taoQtiItem/qtiCreator/editor/gridEditor/helper",[],function(){"use strict";var helpers={getColUnits:function($elt){var cssClasses=$elt.attr("class");if(!cssClasses)throw new Error("the element has no css class");var colMatch=cssClasses.match(/col-([\d]+)/);if(colMatch&&colMatch.length)return parseInt(colMatch.pop());throw"the element has no col-* class"},setUnitsFromClass:function($el){var units=helpers.getColUnits($el);return $el.attr("data-units",units),units}};return helpers}),define("taoQtiItem/lib/jqueryui_dragdrop",["jquery"],function(jQuery){var _Mathabs=Math.abs,_Mathround3=Math.round,_Mathmax=Math.max;(function(e,t){function i(t,n){var u=t.nodeName.toLowerCase(),r,i,o;return"area"===u?(r=t.parentNode,i=r.name,!!(t.href&&i&&"map"===r.nodeName.toLowerCase())&&(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var n=0;e.ui=e.ui||{};e.ui.version||(e.extend(e.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function focus(t,n){return"number"==typeof t?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function scrollParent(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return /(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return /(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function zIndex(n){if(n!==t)return this.css("zIndex",n);if(this.length)for(var r=e(this[0]),i,s;r.length&&r[0]!==document;){if(i=r.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(r.css("zIndex"),10),!isNaN(s)&&0!==s))return s;r=r.parent()}return 0},uniqueId:function uniqueId(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function removeUniqueId(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function focusable(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function tabbable(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||0<=n)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=100===n.offsetHeight,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i="Width"===r?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return"number"==typeof t?this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")}):o["outer"+r].call(this,t)}}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=!!t.length,e.ui.ie6=6===parseFloat(t[1],10)}(),e.fn.extend({disableSelection:function disableSelection(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function enableSelection(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function add(t,n,r){var s=e.ui[t].prototype,i;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function call(e,t,n){var i=e.plugins[t],r;if(i&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},contains:e.contains,hasScroll:function hasScroll(t,n){if("hidden"===e(t).css("overflow"))return!1;var r=n&&"left"===n?"scrollLeft":"scrollTop",i=!1;return!!(0<t[r])||(t[r]=1,i=0<t[r],t[r]=0,i)},isOverAxis:function isOverAxis(e,t,n){return e>t&&e<t+n},isOver:function isOver(t,n,r,i,s,o){return e.ui.isOverAxis(t,r,s)&&e.ui.isOverAxis(n,i,o)}}))})(jQuery),function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var r=_Mathmax,i=_Mathabs,s=_Mathround3,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position,n;e.position={scrollbarWidth:function scrollbarWidth(){if(n!==t)return n;var s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0],r,i;return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function getScrollInfo(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i="scroll"===n||"auto"===n&&t.width<t.element[0].scrollWidth,s="scroll"===r||"auto"===r&&t.height<t.element[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function getWithinInfo(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var g=e(t.of),y=e.position.getWithinInfo(t.within),b=e.position.getScrollInfo(y),w=g[0],E=(t.collision||"flip").split(" "),S={},n,l,d,v,m;return 9===w.nodeType?(l=g.width(),d=g.height(),v={top:0,left:0}):e.isWindow(w)?(l=g.width(),d=g.height(),v={top:g.scrollTop(),left:g.scrollLeft()}):w.preventDefault?(t.at="left top",l=d=0,v={top:w.pageY,left:w.pageX}):(l=g.outerWidth(),d=g.outerHeight(),v=g.offset()),m=e.extend({},v),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;1===e.length&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),S[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),1===E.length&&(E[1]=E[0]),"right"===t.at[0]?m.left+=l:"center"===t.at[0]&&(m.left+=l/2),"bottom"===t.at[1]?m.top+=d:"center"===t.at[1]&&(m.top+=d/2),n=h(S.at,l,d),m.left+=n[0],m.top+=n[1],this.each(function(){var a=e(this),f=a.outerWidth(),c=a.outerHeight(),w=p(this,"marginLeft"),x=p(this,"marginTop"),T=f+w+p(this,"marginRight")+b.width,N=c+x+p(this,"marginBottom")+b.height,C=e.extend({},m),k=h(S.my,a.outerWidth(),a.outerHeight()),o,u;"right"===t.my[0]?C.left-=f:"center"===t.my[0]&&(C.left-=f/2),"bottom"===t.my[1]?C.top-=c:"center"===t.my[1]&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:w,marginTop:x},e.each(["left","top"],function(r,i){e.ui.position[E[r]]&&e.ui.position[E[r]][i](C,{targetWidth:l,targetHeight:d,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:y,elem:a})}),e.fn.bgiframe&&a.bgiframe(),t.using&&(u=function(e){var n=v.left-C.left,s=n+l-f,o=v.top-C.top,u=o+d-c,h={target:{element:g,left:v.left,top:v.top,width:l,height:d},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:0>s?"left":0<n?"right":"center",vertical:0>u?"top":0<o?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),d<c&&i(o+u)<d&&(h.vertical="middle"),h.important=r(i(n),i(s))>r(i(o),i(u))?"horizontal":"vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function left(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?0<u&&0>=a?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):0<a&&0>=u?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:0<u?e.left+=u:0<a?e.left-=a:e.left=r(e.left-o,e.left)},top:function top(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?0<u&&0>=a?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):0<a&&0>=u?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:0<u?e.top+=u:0<a?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function left(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,c="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,h=-2*t.offset[0],p,d;0>a?(p=e.left+l+c+h+t.collisionWidth-s-r,(0>p||p<i(a))&&(e.left+=l+c+h)):0<f&&(d=e.left-t.collisionPosition.marginLeft+l+c+h-o,(0<d||i(d)<f)&&(e.left+=l+c+h))},top:function top(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l="top"===t.my[1],c=l?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,h="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,p=-2*t.offset[1],d,v;0>a?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(0>v||v<i(a))&&(e.top+=c+h+p)):0<f&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(0<d||i(d)<f)&&(e.top+=c+h+p))}},flipfit:{left:function left(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function top(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var o=document.getElementsByTagName("body")[0],u=document.createElement("div"),t,n,r,i,s;for(s in t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"}),r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=10<i&&11>i,t.innerHTML="",n.removeChild(t)}(),!1!==e.uiBackCompat&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return 1===i.length&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),1===s.length&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)}(jQuery),function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;null!=(r=t[n]);n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var a=t.split(".")[0],i,s,o,u;t=t.split(".")[1],i=a+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[a]=e[a]||{},s=e[a][t],o=e[a][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new o(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,i){e.isFunction(i)&&(r[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},r=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=r,s=i.apply(this,arguments),this._super=t,this._superApply=n,s}}())}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix:t},r,{constructor:o,namespace:a,widgetName:t,widgetBaseClass:i,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){for(var i=r.call(arguments,1),s=0,o=i.length,u,a;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName||n;e.fn[n]=function(o){var u="string"==typeof o,a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var i=e.data(this,s),r;return i?e.isFunction(i[o])&&"_"!==o.charAt(0)?(r=i[o].apply(i,a),r!==i&&r!==t)?(f=r&&r.jquery?f.pushStack(r.get()):r,!1):void 0:e.error("no such method '"+o+"' for "+n+" widget instance"):e.error("cannot call methods on "+n+" prior to initialization; attempted to call method '"+o+"'")}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():e.data(this,s,new i(o,this))}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function _createWidget(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function remove(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function destroy(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function widget(){return this.element},option:function option(n,r){var i=n,s,o,u;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof n)if(i={},s=n.split("."),n=s.shift(),s.length){for(o=i[n]=e.widget.extend({},this.options[n]),u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];if(n=s.pop(),r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}return this._setOptions(i),this},_setOptions:function _setOptions(e){for(var t in e)this._setOption(t,e[t]);return this},_setOption:function _setOption(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function enable(){return this._setOption("disabled",!1)},disable:function disable(){return this._setOption("disabled",!0)},_on:function _on(t,n,r){var s=this,i;"boolean"!=typeof t&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){return!t&&(!0===s.options.disabled||e(this).hasClass("ui-state-disabled"))?void 0:("string"==typeof o?s[o]:o).apply(s,arguments)}"string"!=typeof o&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^(\w+)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function _off(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function _delay(e,t){var r=this;return setTimeout(function(){return("string"==typeof e?r[e]:e).apply(r,arguments)},t||0)},_hoverable:function _hoverable(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function mouseenter(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function mouseleave(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function _focusable(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function focusin(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function focusout(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function _trigger(t,n,r){var o=this.options[t],i,s;if(r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent,s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&!1===o.apply(this.element[0],[n].concat(r))||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){"string"==typeof i&&(i={effect:i});var u=i?!0===i||"number"==typeof i?n:i.effect||n:t,o;i=i||{},"number"==typeof i&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&(e.effects.effect[u]||!1!==e.uiBackCompat&&e.effects[u])?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),!1!==e.uiBackCompat&&(e.Widget.prototype._getCreateOptions=function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})}(jQuery),function(e){var n=!1;e(document).mouseup(function(){n=!1}),e.widget("ui.mouse",{version:"1.9.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function _mouseInit(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function _mouseDestroy(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function _mouseDown(t){if(!n){this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=1===t.which,s=!!("string"==typeof this.options.cancel&&t.target.nodeName)&&e(t.target).closest(this.options.cancel).length;return!(i&&!s&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0))}},_mouseMove:function _mouseMove(t){return e.ui.ie&&!(9<=document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function _mouseUp(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function _mouseDistanceMet(e){return _Mathmax(_Mathabs(this._mouseDownEvent.pageX-e.pageX),_Mathabs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function _mouseDelayMet(){return this.mouseDelayMet},_mouseStart:function _mouseStart(){},_mouseDrag:function _mouseDrag(){},_mouseStop:function _mouseStop(){},_mouseCapture:function _mouseCapture(){return!0}})}(jQuery),function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function _create(){"original"!=this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function _destroy(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function _mouseCapture(t){var n=this.options;return!(this.helper||n.disabled||e(t.target).is(".ui-resizable-handle"))&&(this.handle=this._getHandle(t),!!this.handle&&(e(!0===n.iframeFix?"iframe":n.iframeFix).each(function(){e("<div class=\"ui-draggable-iframeFix\" style=\"background: #fff;\"></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0))},_mouseStart:function _mouseStart(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function _mouseDrag(t,n){if(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!n){var r=this._uiHash();if(!1===this._trigger("drag",t,r))return this._mouseUp({}),!1;this.position=r.position}return this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px"),(e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1)},_mouseStop:function _mouseStop(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);for(var r=this.element[0],i=!1;r&&(r=r.parentNode);)r==document&&(i=!0);if(!i&&"original"===this.options.helper)return!1;if("invalid"==this.options.revert&&!n||"valid"==this.options.revert&&n||!0===this.options.revert||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==s._trigger("stop",t)&&s._clear()})}else!1!==this._trigger("stop",t)&&this._clear();return!1},_mouseUp:function _mouseUp(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function cancel(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function _getHandle(t){var n=!(this.options.handle&&e(this.options.handle,this.element).length);return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function _createHelper(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):"clone"==n.helper?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo("parent"==n.appendTo?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function _adjustOffsetFromHelper(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function _getParentOffset(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function _getRelativeOffset(){if("relative"==this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function _cacheMargins(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function _cacheHelperProportions(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function _setContainment(){var t=this.options;if("parent"==t.containment&&(t.containment=this.helper[0].parentNode),("document"==t.containment||"window"==t.containment)&&(this.containment=["document"==t.containment?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"==t.containment?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"==t.containment?0:e(window).scrollLeft())+e("document"==t.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"==t.containment?0:e(window).scrollTop())+(e("document"==t.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s="hidden"!=e(r).css("overflow");this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?_Mathmax(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?_Mathmax(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function _convertPositionTo(t,n){n||(n=this.position);var r="absolute"==t?1:-1,i=this.options,s="absolute"==this.cssPosition&&(this.scrollParent[0]==document||!e.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function _generatePosition(t){var n=this.options,r="absolute"==this.cssPosition&&(this.scrollParent[0]==document||!e.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+_Mathround3((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.top<u[1]||f-this.offset.click.top>u[3]?f-this.offset.click.top<u[1]?f+n.grid[1]:f-n.grid[1]:f:f;var l=n.grid[0]?this.originalPageX+_Mathround3((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?l-this.offset.click.left<u[0]||l-this.offset.click.left>u[2]?l-this.offset.click.left<u[0]?l+n.grid[0]:l-n.grid[0]:l:l}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"==this.cssPosition?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_clear:function _clear(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]==this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function _trigger(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),"drag"==t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function _uiHash(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function start(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function stop(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"==r.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function drag(t,n){var r=e(this).data("draggable"),i=this;e.each(r.sortables,function(){var o=!1,u=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!=u&&this.instance._intersectsWith(this.instance.containerCache)&&e.ui.contains(u.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function start(){var r=e("body"),i=e(this).data("draggable").options;r.css("cursor")&&(i._cursor=r.css("cursor")),r.css("cursor",i.cursor)},stop:function stop(){var r=e(this).data("draggable").options;r._cursor&&e("body").css("cursor",r._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function start(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function stop(t,n){var r=e(this).data("draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function start(){var r=e(this).data("draggable");r.scrollParent[0]!=document&&"HTML"!=r.scrollParent[0].tagName&&(r.overflowOffset=r.scrollParent.offset())},drag:function drag(t){var r=e(this).data("draggable"),i=r.options,s=!1;r.scrollParent[0]!=document&&"HTML"!=r.scrollParent[0].tagName?((!i.axis||"x"!=i.axis)&&(r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop-i.scrollSpeed)),(!i.axis||"y"!=i.axis)&&(r.overflowOffset.left+r.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft-i.scrollSpeed))):((!i.axis||"x"!=i.axis)&&(t.pageY-e(document).scrollTop()<i.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<i.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+i.scrollSpeed))),(!i.axis||"y"!=i.axis)&&(t.pageX-e(document).scrollLeft()<i.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<i.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+i.scrollSpeed)))),!1!==s&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function start(){var r=e(this).data("draggable"),i=r.options;r.snapElements=[],e(i.snap.constructor==String?i.snap:i.snap.items||":data(draggable)").each(function(){var t=e(this),n=t.offset();this!=r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function drag(t,n){for(var r=e(this).data("draggable"),i=r.options,s=i.snapTolerance,o=n.offset.left,u=o+r.helperProportions.width,a=n.offset.top,f=a+r.helperProportions.height,l=r.snapElements.length-1;0<=l;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s<o&&o<h+s&&p-s<a&&a<d+s||c-s<o&&o<h+s&&p-s<f&&f<d+s||c-s<u&&u<h+s&&p-s<a&&a<d+s||c-s<u&&u<h+s&&p-s<f&&f<d+s)){r.snapElements[l].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=!1;continue}if("inner"!=i.snapMode){var v=_Mathabs(p-f)<=s,m=_Mathabs(d-a)<=s,g=_Mathabs(c-u)<=s,y=_Mathabs(h-o)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p-r.helperProportions.height,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h}).left-r.margins.left)}var b=v||m||g||y;if("outer"!=i.snapMode){var v=_Mathabs(p-a)<=s,m=_Mathabs(d-f)<=s,g=_Mathabs(c-o)<=s,y=_Mathabs(h-u)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d-r.helperProportions.height,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h-r.helperProportions.width}).left-r.margins.left)}!r.snapElements[l].snapping&&(v||m||g||y||b)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=v||m||g||y||b}}}),e.ui.plugin.add("draggable","stack",{start:function start(){var r=e(this).data("draggable").options,i=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(i.length){var s=parseInt(i[0].style.zIndex)||0;e(i).each(function(e){this.style.zIndex=s+e}),this[0].style.zIndex=s+i.length}}}),e.ui.plugin.add("draggable","zIndex",{start:function start(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function stop(t,n){var r=e(this).data("draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})}(jQuery),function(e){e.widget("ui.droppable",{version:"1.9.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function _create(){var t=this.options,n=t.accept;this.isover=0,this.isout=1,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function _destroy(){for(var t=e.ui.ddmanager.droppables[this.options.scope],n=0;n<t.length;n++)t[n]==this&&t.splice(n,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function _setOption(t,n){"accept"==t&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function _activate(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function _deactivate(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function _over(t){var n=e.ui.ddmanager.current;!n||(n.currentItem||n.element)[0]==this.element[0]||this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function _out(t){var n=e.ui.ddmanager.current;!n||(n.currentItem||n.element)[0]==this.element[0]||this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function _drop(t,n){var r=n||e.ui.ddmanager.current;if(!r||(r.currentItem||r.element)[0]==this.element[0])return!1;var i=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope==r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return i=!0,!1}),!i&&!!this.accept.call(this.element[0],r.currentItem||r.element)&&(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element)},ui:function ui(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(t,n,r){if(!n.offset)return!1;var i=(t.positionAbs||t.position.absolute).left,s=i+t.helperProportions.width,o=(t.positionAbs||t.position.absolute).top,u=o+t.helperProportions.height,a=n.offset.left,f=a+n.proportions.width,l=n.offset.top,c=l+n.proportions.height;switch(r){case"fit":return a<=i&&s<=f&&l<=o&&u<=c;case"intersect":return a<i+t.helperProportions.width/2&&s-t.helperProportions.width/2<f&&l<o+t.helperProportions.height/2&&u-t.helperProportions.height/2<c;case"pointer":var h=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,p=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,d=e.ui.isOver(p,h,l,a,n.proportions.height,n.proportions.width);return d;case"touch":return(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c)&&(i>=a&&i<=f||s>=a&&s<=f||i<a&&s>f);default:return!1;}},e.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function prepareOffsets(t,n){var r=e.ui.ddmanager.droppables[t.options.scope]||[],i=n?n.type:null,s=(t.currentItem||t.element).find(":data(droppable)").andSelf();e:for(var o=0;o<r.length;o++)if(!(r[o].options.disabled||t&&!r[o].accept.call(r[o].element[0],t.currentItem||t.element))){for(var u=0;u<s.length;u++)if(s[u]==r[o].element[0]){r[o].proportions.height=0;continue e}r[o].visible="none"!=r[o].element.css("display"),r[o].visible&&("mousedown"==i&&r[o]._activate.call(r[o],n),r[o].offset=r[o].element.offset(),r[o].proportions={width:r[o].element[0].offsetWidth,height:r[o].element[0].offsetHeight})}},drop:function drop(t,n){var r=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,n)))}),r},dragStart:function dragStart(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function drag(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var r=e.ui.intersect(t,this,this.options.tolerance),i=r||1!=this.isover?r&&0==this.isover?"isover":null:"isout";if(i){var s;if(this.options.greedy){var o=this.options.scope,u=this.element.parents(":data(droppable)").filter(function(){return e.data(this,"droppable").options.scope===o});u.length&&(s=e.data(u[0],"droppable"),s.greedyChild="isover"==i?1:0)}s&&"isover"==i&&(s.isover=0,s.isout=1,s._out.call(s,n)),this[i]=1,this["isout"==i?"isover":"isout"]=0,this["isover"==i?"_over":"_out"].call(this,n),s&&"isout"==i&&(s.isout=0,s.isover=1,s._over.call(s,n))}}})},dragStop:function dragStop(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}}(jQuery)}),define("taoQtiItem/qtiCreator/editor/gridEditor/resizable",["lodash","jquery","taoQtiItem/qtiCreator/editor/gridEditor/config","taoQtiItem/qtiCreator/editor/gridEditor/helper","taoQtiItem/qtiCreator/helper/qtiElements","taoQtiItem/lib/jqueryui_dragdrop"],function(_,$,config,helper,qtiElements){"use strict";var _syncHandleHeight=function($row){var h=$row.height()-parseFloat($row.children("[class^=\"col-\"], [class*=\" col-\"]").css("margin-bottom"));$row.find(".grid-edit-resizable-zone").height(h)},_createResizables=function($el){var marginWidth=parseFloat($el.find("[class^=\"col-\"]:last, [class*=\" col-\"]:last").css("margin-left"));$el.find("[class^=\"col-\"], [class*=\" col-\"]").each(function(){var $col=$(this);if($col.parent().hasClass("fixed-grid-row"))return!0;if($col.children(".grid-edit-resizable-zone").length)return!0;var $nextCol=$col.next(),$row=$col.parent(".grid-row"),offset=$col.offset(),min=qtiElements.is($col.data("qti-class"),"interaction")?config.min.interaction:config.min.text,nextMin=qtiElements.is($nextCol.data("qti-class"),"interaction")?config.min.interaction:config.min.text,unitWidth=$row.width()/12,activeHeight=$row.height()-parseFloat($col.css("margin-bottom")),$activeZone=$("<div>",{class:"grid-edit-resizable-zone grid-edit-resizable-zone-active"}).css({top:0,right:-(marginWidth+(20-marginWidth)/2),width:20,height:activeHeight}),$handle=$("<span>",{class:"grid-edit-resizable-handle"});$activeZone.append($handle),$col.append($activeZone);var _syncOutlineHeight=function(){var h=$row.height()-parseFloat($col.css("margin-bottom"));$col.find(".grid-edit-resizable-outline").height(h),$activeZone.height(h)};$activeZone.draggable({containment:$nextCol.length?[offset.left+min*unitWidth-2*marginWidth+10,offset.top,offset.left+$col.outerWidth()+marginWidth+$nextCol.outerWidth()-nextMin*unitWidth-10-10,offset.top+$col.height()]:[offset.left+min*unitWidth-marginWidth-10-10,offset.top,$row.offset().left+$row.outerWidth()-marginWidth-10-12,offset.top+$col.height()],axis:"x",cursor:"col-resize",start:function start(){$col.trigger("resizestart.gridEdit");var $overlay=$("<div>",{class:"grid-edit-resizable-outline"});$nextCol.length?$overlay.width(parseFloat($col.outerWidth())+marginWidth+parseFloat($nextCol.outerWidth())):$overlay.css({width:"100%","border-right-width":0}),$(this).data("overlay",$overlay),$col.append($overlay),$handle.addClass("grid-edit-resizable-active"),$el.find(".grid-edit-resizable-zone-active").removeClass("grid-edit-resizable-zone-active"),_syncOutlineHeight()},drag:_.throttle(function(){var width=$(this).offset().left+10-offset.left,units=helper.getColUnits($col),nextUnits=$nextCol.length?helper.getColUnits($nextCol):0;$nextCol.length||$col.find(".grid-edit-resizable-outline").width($handle.offset().left-offset.left),width+0*marginWidth<(units-1)*unitWidth?(units--,_setColUnits($col,units),$nextCol.length&&(nextUnits++,_setColUnits($nextCol,nextUnits)),_syncOutlineHeight(),$col.trigger("resize.gridEdit")):width+marginWidth+20>(units+1)*unitWidth&&(units++,_setColUnits($col,units),$nextCol.length&&(nextUnits--,_setColUnits($nextCol,nextUnits)),_syncOutlineHeight(),$col.trigger("resize.gridEdit"))},config.throttle.resize),stop:function stop(){$col.find(".grid-edit-resizable-outline").remove(),_deleteResizables($el),_createResizables($el),$col.trigger("resizestop.gridEdit")}}).css("position","absolute")}),$el.off(".gridEdit.resizable").on("dragoverstart.gridEdit.resizable",function(){_deleteResizables($el)}).on("dragoverstop.gridEdit.resizable",function(){_createResizables($el)}).on("contentChange.gridEdit.resizable",".grid-row",function(){_deleteResizables($el),_createResizables($el)})},_deleteResizables=function($el){$el.find(".grid-edit-resizable-zone").remove()},_setColUnits=function($elt,newUnits){if($elt.attr("class").match(/col-([\d]+)/)){var oldUnits=$elt.attr("data-units"),$parentRow=$elt.parent(".grid-row"),totalUnits=$parentRow.attr("data-units");$parentRow.attr("data-units",totalUnits-oldUnits+newUnits),$elt.attr("data-units",newUnits),$elt.removeClass("col-"+oldUnits).addClass("col-"+newUnits)}else throw $.error("the element is not a grid column")};return{create:function create($element){_createResizables($element),$(window).off("resize.qtiEdit.resizable").on("resize.qtiEdit.resizable",function(){_deleteResizables($element),_createResizables($element)})},destroy:function destroy($element,preserveGlobalEvents){_deleteResizables($element),preserveGlobalEvents||$(window).off("resize.qtiEdit.resizable")},syncHandleHeight:function syncHandleHeight($row){$row.hasClass("grid-row")?_syncHandleHeight($row):$row.find(".grid-row").each(function(){_syncHandleHeight($(this))})}}}),define("taoQtiItem/qtiCreator/widgets/helpers/textWrapper",["jquery"],function($){function getSelection(){var selection;return window.getSelection?selection=window.getSelection():document.selection&&(selection=document.selection.createRange()),selection}function containElement(selection,range){if(1===range.commonAncestorContainer.nodeType)for(var selectedChildNodes=range.cloneContents().childNodes,i=0;i<selectedChildNodes.length;i++)if(selectedChildNodes[i].className&&-1<selectedChildNodes[i].className.indexOf("qti-choice"))return!0;return!1}function wrapSelection(wrap){var sel=getSelection();if(sel.rangeCount){var range=sel.getRangeAt(0).cloneRange();if(range.startOffset!==range.endOffset&&range.toString().trim()&&!containElement(sel,range))return range.surroundContents(wrap),sel.removeAllRanges(),sel.addRange(range),!0}return!1}function unwrapSelection($editable){var $wrapper=$editable.find("#selection-wrapper");$editable.trigger("beforeunwrap"),$wrapper.find("[data-role]").remove(),$wrapper.replaceWith(function(){return $(this).html()}),$editable.trigger("unwrapped")}var textWrapper={create:function create($editable){textWrapper.destroy($editable),$editable.on("mouseup.textwrapper",function(e){var $target=$(e.target);if(!($target.hasClass("html-editable-shield")||$target.hasClass("widget-box"))){var $wrapper=$("<span>",{id:"selection-wrapper",class:"inline-text-wrapper"});if(wrapSelection($wrapper[0])){var wrappedText=$wrapper.text().trim();$editable.trigger("wrapped",[$wrapper,wrappedText])}}}).on("mousedown.textwrapper",function(){unwrapSelection($editable)})},destroy:function destroy($editable){unwrapSelection($editable),$editable.off(".textwrapper")},unwrap:function unwrap($editable){unwrapSelection($editable)}};return textWrapper}),define("taoQtiItem/qtiCreator/editor/gridEditor/content",["jquery","lodash","taoQtiItem/qtiCreator/editor/gridEditor/resizable","taoQtiItem/qtiCreator/widgets/helpers/textWrapper"],function($,_,resizable,textWrapper){"use strict";var contentHelper={};return contentHelper.getContent=function(element,opts){var options=_.defaults({inner:!0},opts),$body=options.inner?$(element).clone():$("<div>",{class:"col-fictive content-helper-wrapper"}).append($(element).clone());return contentHelper.destroyGridWidgets($body,!0),contentHelper.serializeElements($body),$body.html()},contentHelper.getChangeCallback=function(container){return _.throttle(function(data){var $pseudoContainer=$("<div>").html(data),newBody=contentHelper.getContent($pseudoContainer);container.body(newBody)},800)},contentHelper.getChangeCallbackForBlockStatic=function(container){return _.throttle(function(data){var $pseudoContainer=$("<div>").html(data);$pseudoContainer.contents().each(function(){if(3===this.nodeType&&this.nodeValue.trim())return $pseudoContainer.wrapInner("<p>"),$pseudoContainer=$("<div>").html($pseudoContainer.html()),!1}),textWrapper.unwrap($pseudoContainer),container.body(contentHelper.getContent($pseudoContainer))},800)},contentHelper.serializeElements=function($el){var existingElements=[];return $el.find(".widget-box:not(.widget-box *)").each(function(){var $qtiElementWidget=$(this);if($qtiElementWidget.data("serial")){var serial=$qtiElementWidget.data("serial");$qtiElementWidget.replaceWith("{{"+serial+"}}"),existingElements.push(serial)}else if($qtiElementWidget.data("new")&&$qtiElementWidget.data("qti-class")){var qtiClass=$qtiElementWidget.data("qti-class");$qtiElementWidget.replaceWith("{{"+qtiClass+":new}}")}else throw"unknown qti-widget type"}),existingElements},contentHelper.destroyGridWidgets=function($elt,inClone){$elt.removeData("qti-grid-options"),$elt.find(".grid-row, [class*=\" col-\"], [class^=\"col-\"]").removeAttr("style").removeAttr("data-active").removeAttr("data-units"),$elt.children(".ui-draggable-dragging").remove(),resizable.destroy($elt,inClone),$elt.find(".contextual-popup").remove()},contentHelper}),define("tpl!taoQtiItem/qtiCreator/editor/elementSelector/tpl/popup",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"contextual-popup\" style=\"top:"+escapeExpression((stack1=(stack1=depth0&&depth0.popup,null==stack1||!1===stack1?stack1:stack1.top),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"px; left:"+escapeExpression((stack1=(stack1=depth0&&depth0.popup,null==stack1||!1===stack1?stack1:stack1.left),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"px\" dir=\"ltr\">\n <div class=\"arrow\" style=\"left:"+escapeExpression((stack1=(stack1=depth0&&depth0.arrow,null==stack1||!1===stack1?stack1:stack1.left),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"px\"></div>\n <div class=\"arrow-cover\" style=\"left:"+escapeExpression((stack1=(stack1=depth0&&depth0.arrow,null==stack1||!1===stack1?stack1:stack1.leftCover),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"px\"></div>\n <div class=\"popup-content\">",(helper=helpers.content)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.content,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>\n <div class=\"footer\">\n <button class=\"btn btn-info small done\">done</button>\n <a href=\"#\" class=\"btn cancel\" title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"cancel",options):helperMissing.call(depth0,"__","cancel",options)))+"\">cancel</a>\n </div>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/editor/elementSelector/tpl/content",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n <li data-group-name=\"",(helper=helpers.name)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.name,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"><a href=\"#\" class=\"group-selector\">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</a></li>\n ",buffer}function program3(depth0,data){var buffer="",stack1,helper;return buffer+="\n <div class=\"element-group\" data-group-name=\"",(helper=helpers.name)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.name,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <ul class=\"element-list plain\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.elements,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </ul>\n </div>\n ",buffer}function program4(depth0,data){var buffer="",stack1,helper;return buffer+="\n <li data-qti-class=\"",(helper=helpers.qtiClass)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.qtiClass,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" title=\"",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.iconFont,{hash:{},inverse:self.program(7,program7,data),fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <span class=\"label truncate\">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span>\n </li>\n ",buffer}function program5(depth0,data){var buffer="",stack1,helper;return buffer+="\n <span class=\"icon ",(helper=helpers.icon)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.icon,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"></span>\n ",buffer}function program7(depth0,data){var buffer="",stack1,helper;return buffer+="\n <img class=\"icon\" src=\"",(helper=helpers.icon)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.icon,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"/>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1;return buffer+="<div class=\"elementSelector\">\n\n <ul class=\"group-list plain\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.groups,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </ul>\n\n <div class=\"element-group-container\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.groups,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </div>\n\n</div>",buffer})}),define("taoQtiItem/qtiCreator/editor/elementSelector/selector",["jquery","lodash","tpl!taoQtiItem/qtiCreator/editor/elementSelector/tpl/popup","tpl!taoQtiItem/qtiCreator/editor/elementSelector/tpl/content"],function($,_,popupTpl,contentTpl){function _done($element){$element.hide(),$element.trigger("done.element-selector")}function _cancel($element){$element.hide(),$element.trigger("cancel.element-selector")}function _activatePanel2($container,groupName){var $trigger=$container.find(".group-list li[data-group-name=\""+groupName+"\"]");_activatePanel($container,$trigger)}function _activatePanel($container,$trigger){if(!$trigger.hasClass("active")){$trigger.addClass("active").siblings(".active").removeClass("active");var group=$trigger.data("group-name"),$group=$container.find(".element-group[data-group-name=\""+group+"\"]");$group.show().siblings(".element-group").hide()}}function _activateElement2($container,qtiClass){var $trigger=$container.find(".element-list li[data-qti-class=\""+qtiClass+"\"]");_activateElement($container,$trigger)}function _activateElement($container,$trigger){var qtiClass=$trigger.data("qti-class");$trigger.hasClass("active")||($container.find(".element-list li").removeClass("active"),$trigger.addClass("active"),$container.trigger("selected.element-selector",[qtiClass,$trigger]))}function _computePosition($anchor,$container){var arrowWidth=6,marginLeft=15,_anchor={top:$anchor.offset().top,left:$anchor.offset().left,w:$anchor.innerWidth(),h:$anchor.innerHeight()},_container={top:$container.offset().top,left:$container.offset().left,w:$container.innerWidth()},_popup={top:_anchor.h+15,left:-250+_anchor.w/2,w:500},offset=_anchor.left-_container.left;offset+marginLeft+_anchor.w/2<_popup.w/2?_popup.left=-offset+marginLeft:_container.w-(offset+_anchor.w/2+marginLeft)<_popup.w/2&&(_popup.left=-offset+_container.w-marginLeft-_popup.w);var _arrow={left:-_popup.left+_anchor.w/2-arrowWidth,leftCover:-_popup.left+_anchor.w/2-arrowWidth-6};return{popup:_popup,arrow:_arrow}}function _filterInteractions(interactions){var filtered=_.filter(interactions,function(interaction){var tags=interaction.tags;return"_container"===interaction.qtiClass?(block=interaction,interaction.tags[0]="Text Block",!1):!!(tags&&"Inline Interactions"!==tags[0])}),block;return block.tags[0]="Text Block",filtered.unshift(block),filtered}function _renderContent(interactions){var groups=[];return _.each(_filterInteractions(interactions),function(interaction){var groupName=interaction.tags[0],panel=_.find(groups,{name:groupName});panel||(panel={name:groupName,label:groupName.replace(/\sInteractions$/,""),elements:[]},groups.push(panel)),panel.elements.push({qtiClass:interaction.qtiClass,disabled:!!interaction.disabled,title:interaction.description,iconFont:/^icon-/.test(interaction.icon),icon:interaction.icon,label:interaction.label})}),contentTpl({groups:groups})}return{create:function($anchor,$container,interactions){var positions=_computePosition($anchor,$container),$element=$(popupTpl({popup:positions.popup,arrow:positions.arrow,content:_renderContent(interactions)}));return $anchor.find(".contextual-popup").remove(),$anchor.append($element),$element.off(".element-selector").on("click.element-selector",".group-list li",function(){var $trigger=$(this);_activatePanel($element,$trigger)}).on("click.element-selector",".element-list li",function(){_activateElement($element,$(this))}).on("click.element-selector",".done",function(){_done($element)}).on("click.element-selector",".cancel",function(){_cancel($element)}),{getPopup:function getPopup(){return $element},reposition:function reposition(){var pos=_computePosition($anchor,$container);$element.css({top:pos.popup.top,left:pos.popup.left}),$element.children(".arrow").css("left",pos.arrow.left),$element.children(".arrow-cover").css("left",pos.arrow.leftCover)},activatePanel:function activatePanel(groupName){_activatePanel2($element,groupName)},activateElement:function activateElement(qtiClass){_activateElement2($element,qtiClass)},done:function done(){_done($element)},cancel:function cancel(){_cancel($element)},show:function show(){$element.show()},destroy:function destroy(){$element.remove()}}},activateElement:_activateElement2,activatePanel:_activatePanel2}}),define("taoQtiItem/qtiCreator/widgets/Widget",["lodash","jquery","core/promise","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/model/helper/invalidator","core/logger"],function(_,$,Promise,Element,invalidator,loggerFactory){'use strict';var _pushState=function(widget,stateName){var currentState=new widget.registeredStates[stateName](widget);widget.stateStack.push(currentState),currentState.init()},_popState=function(widget){var state=widget.stateStack.pop();state&&state.exit()},createEventName=function(widget,name,ns){var eventName="".concat(name,".qti-widget.").concat(widget.serial);return ns?"".concat(eventName,".").concat(ns):eventName},logger=loggerFactory("taoQtiItem/qtiCreator/widget");return{init:function init(element,$original,$form,options){var _this18=this;if(element instanceof Element)options=options||{},this.element=element,this.serial=element.getSerial(),this.$original=$original,this.$form=$form,this.stateStack=[],this.registeredStates={},this.buildContainer(),this.$original.data("widget",this),this.$container.data("widget",this),this.element.data("widget",this),this.offEvents(),_.each(this.getRequiredOptions(),function(opt){if(!options[opt])throw new Error("missing required option for image creator : ".concat(opt))}),this.options=options,Promise.resolve(this.initCreator(options)).then(function(){_.isFunction(_this18.options.ready)&&_this18.options.ready.call(_this18,_this18),_this18.$container.trigger("ready.qti-widget",[_this18])}),this.options.state?this.changeState(this.options.state):this.changeState("sleep");else throw new Error("element is not a QTI Element");return this},getAreaBroker:function(){var element=this.element,renderer=element.getRenderer();if(renderer)return renderer.getAreaBroker()},getCreatorContext:function(){var element=this.element,renderer=element.getRenderer();if(renderer)return renderer.getCreatorContext()},getRequiredOptions:function getRequiredOptions(){return[]},buildContainer:function buildContainer(){throw new Error("method buildContainer must be implemented")},build:function build(element,$container,$form,options){return this.clone().init(element,$container,$form,options)},clone:function clone(){return _.clone(this)},initCreator:function initCreator(){var $interaction=this.$container.find(".qti-interaction"),serial=$interaction.data("serial");this.$container.on("resize.itemResizer",function(){$(window).trigger("resize.qti-widget.".concat(serial))})},getCurrentState:function getCurrentState(){return _.last(this.stateStack)},changeState:function changeState(stateName){var _this19=this,currentState=this.getCurrentState(),state,superStateName,exitedStates,enteredStates,i;if(logger.info("changing state of ".concat(this.serial,": ").concat((currentState||{}).name," => ").concat(stateName)),this.registeredStates[stateName])state=new this.registeredStates[stateName];else throw new Error("unknown target state : ".concat(stateName));if(currentState){if("map"===currentState.name&&"map"!==state.name&&this.$container.find("[data-has-tooltip]").each(function(j,el){$(el).data("$tooltip").hide()}),currentState.name===state.name)return this;if(0<=_.indexOf(state.superState,currentState.name))for(i=_.indexOf(state.superState,currentState.name)-1;0<=i;i--)superStateName=state.superState[i],_pushState(this,superStateName);else{if(0<=_.indexOf(currentState.superState,state.name)){for(i=0;i<=_.indexOf(currentState.superState,state.name);i++)_popState(this);return this}_popState(this),exitedStates=_.difference(currentState.superState,state.superState),_.each(exitedStates,function(){_popState(_this19)}),enteredStates=_.difference(state.superState,currentState.superState),_.eachRight(enteredStates,function(_superStateName){_pushState(_this19,_superStateName)})}}else _.eachRight(state.superState,function(_superStateName){_pushState(_this19,_superStateName)});return _pushState(this,stateName),this},registerState:function registerState(name,State){if(name&&State)this.registeredStates[name]=State;else throw new Error("missing required arguments in state registration")},registerStates:function registerStates(states){var _this20=this;_.forIn(states,function(State,name){_this20.registerState(name,State)})},afterStateInit:function afterStateInit(callback,ns){$(document).on(createEventName(this,"afterStateInit",ns),callback)},beforeStateInit:function beforeStateInit(callback,ns){$(document).on(createEventName(this,"beforeStateInit",ns),callback)},afterStateExit:function afterStateExit(callback,ns){$(document).on(createEventName(this,"afterStateExit",ns),callback)},beforeStateExit:function beforeStateExit(callback,ns){$(document).on(createEventName(this,"beforeStateExit",ns),callback)},offEvents:function offEvents(ns){$(document).off(createEventName(this,"",ns)),this.$container.off("resize.itemResizer")},destroy:function destroy(){logger.info("destroying widget ".concat(this.serial)),this.changeState("sleep"),this.$container.find("[data-edit]").remove(),$("[data-widget-component=".concat(this.serial,"]")).remove(),this.offEvents()},rebuild:function rebuild(options){var element,postRenderOpts,$container,renderer;if(options=options||{},element=this.element,postRenderOpts={},_.isFunction(options.ready)&&(postRenderOpts.ready=options.ready),$container=null,$container=options.context&&options.context.length?options.context.find(".widget-box[data-serial=".concat(element.serial,"]")):this.$container.length&&$.contains(document,this.$container[0])?this.$container:$(".widget-box[data-serial=".concat(element.serial,"]")),this.destroy(),renderer=element.getRenderer(),renderer&&renderer.isRenderer){if("creatorRenderer"===renderer.name)return element.render($container),element.postRender(postRenderOpts),element.data("widget");throw new Error("The renderer is no longer the creatorRenderer")}else throw new Error("No renderer found to rebuild the widget")},refresh:function refresh(){var currentState=this.getCurrentState().name;this.rebuild({ready:function ready(widget){widget.changeState(currentState)}})},on:function on(qtiElementEventName,callback,live){var _this21=this,eventNames=qtiElementEventName.replace(/\s+/g," ").split(" "),$document=$(document);return _.each(eventNames,function(eventName){var eventNameToken=[eventName,"qti-widget",_this21.serial];live||eventNameToken.push(_this21.getCurrentState().name),$document.on(eventNameToken.join("."),function(e,data){callback.call(_this21,data)})}),this},isValid:function isValid(what,valid,why){var element=this.element;return"undefined"==typeof what?invalidator.isValid(element):void(valid?invalidator.valid(element,what):invalidator.invalid(element,what,why,this.getCurrentState().name))}}}),define("taoQtiItem/qtiCreator/helper/classTitles",["i18n"],function(__){var classTitles={choiceInteraction:__("Choice Interaction"),orderInteraction:__("Order Interaction"),associateInteraction:__("Associate Interaction"),matchInteraction:__("Match Interaction"),hottextInteraction:__("Hottext Interaction"),gapMatchInteraction:__("Gap Match Interaction"),sliderInteraction:__("Slider Interaction"),extendedTextInteraction:__("Extended Text Interaction"),uploadInteraction:__("File Upload Interaction"),mediaInteraction:__("Media Interaction"),hotspotInteraction:__("Hotspot Interaction"),graphicOrderInteraction:__("Graphic Order Interaction"),graphicAssociateInteraction:__("Graphic Associate Interaction"),graphicGapMatchInteraction:__("Graphic Gap Match Interaction"),selectPointInteraction:__("Select Point Interaction")};return function(qtiClass){return classTitles[qtiClass]||qtiClass}}),define("taoQtiItem/qtiCreator/editor/widgetToolbar",["jquery","i18n","../helper/classTitles"],function($,__,getQtiClassTitle){'use strict';var defaultConfig=[[{title:"Question",class:"question-trigger",status:"off",fn:function fn(){var target=arguments[1],toolbar=arguments[2],responseButton=toolbar.find(".answer-trigger a"),answerEditors=target.find("[data-edit=\"answer\"]"),questionEditors=target.find("[data-edit=\"question\"]");responseButton.removeClass("tlb-text-button-on").addClass("tlb-text-button-off"),questionEditors.show(),answerEditors.hide(),target.data("mode","question")}},{title:"Answer",class:"answer-trigger",fn:function fn(){var target=arguments[1],toolbar=arguments[2],contentButton=toolbar.find(".question-trigger a"),answerEditors=target.find("[data-edit=\"answer\"]"),questionEditors=target.find("[data-edit=\"question\"]");contentButton.removeClass("tlb-text-button-on").addClass("tlb-text-button-off"),answerEditors.show(),questionEditors.hide(),target.data("mode","answer"),target.find("[contenteditable]").attr("contenteditable",!1),$(document).trigger("widgetBlur")}}],"spacer",[{icon:"bin",title:"Delete",fn:function fn(){var target=arguments[1],toolbar=arguments[2],msg=$("<span>",{text:__("You have deleted an element.")+" "}),undo=$("<a>",{text:__("Undo"),href:"#"}),icon=$("<span>",{class:"icon-info"}),closer=$("<span>",{title:"Remove Message",class:"icon-close close-trigger"}),feedback=$("<div>",{class:"feedback-info"}).hide();closer.on("click",function(){feedback.fadeOut(function(){feedback.remove(),target.remove(),toolbar.remove()})}),undo.on("click",function(e){e.preventDefault(),feedback.remove(),target.removeClass("deleted").fadeIn()}),feedback.append(icon),feedback.append(msg),feedback.append(undo),feedback.append(closer),target.before(feedback),toolbar.hide(),target.hide().addClass("deleted"),feedback.fadeIn(function(){setTimeout(function(){closer.trigger("click")},6500)})}}]],structure=function(type){return"/"===type?type="break":"-"===type?type="separator":" "===type?type="spacer":void 0,$("<span>",{class:"tlb-"+type})},bar=function(items,target,toolbar){var bar=$("<div>",{class:"tlb-bar"}),isTextButton=!items[0].icon,l=items.length,group,i;if(bar.append(structure("start")),isTextButton)for(i=0;i<l;i++)"string"===$.type(items[i])?bar.append(structure(items[i])):(items[i].target=target,items[i].toolbar=toolbar,bar.append(button(items[i],isTextButton)));else for(group=$("<div>",{class:"tlb-group"}),bar.append(group),i=0;i<l;i++)"string"===$.type(items[i])?group.append(structure(items[i])):(items[i].target=target,items[i].toolbar=toolbar,group.append(button(items[i],isTextButton)));return bar.append(structure("end")),bar},button=function(config,isTextButton){var status=config.status||"off",fn=config.fn||function(){},target=config.target||$(),toolbar=config.toolbar||$(),a,span,button,icon,text;return delete config.status,delete config.fn,delete config.target,delete config.toolbar,isTextButton?(text=__(config.title),delete config.title,config["class"]=config["class"]?config["class"]+" tlb-text-button-box":"tlb-text-button-box",button=$("<span>",config),a=$("<a>",{class:"tlb-text-button-"+status}),span=$("<span>",{class:"tlb-text",text:text}),button.append(a),a.append(span)):(icon="icon-"+config.icon.replace("icon-",""),delete config.icon,config["class"]=config["class"]?config["class"]+" tlb-button-"+status:"tlb-button-"+status,button=$("<a>",config),span=$("<span>",{class:icon}),button.append(span)),button.on("click.toolbar",function(e){return!(button.hasClass("tlb-text-button-disabled")||button.hasClass("tlb-button-disabled"))&&void(isTextButton?button.find("a").toggleClass("tlb-text-button-off").toggleClass("tlb-text-button-on"):button.toggleClass("tlb-button-off").toggleClass("tlb-button-on"),fn.apply(this,[e,target,toolbar]))}),button},handleConfig=function(config,extendDefaultConfig){return $.isArray(config)&&!config.length&&(config=!1),config?extendDefaultConfig&&(config=$.extend(defaultConfig,config)):config=defaultConfig,config},buildToolbar=function(config,target,tlbWrapper){var tlb=$("<div>",{class:"tlb"}),top=$("<div>",{class:"tlb-top"}),box=$("<div>",{class:"tlb-box"}),ic=config.length,i;for(top.append(box),tlb.append(top),i=0;i<ic;i++)"string"===$.type(config[i])?box.append(structure(config[i])):box.append(bar(config[i],target,tlbWrapper));return tlb.data("edit","toolbar"),tlb};return function(){return{attach:function attach(buttonConfig,barConfig){var defaultBarConfig={offsetTop:-2,title:"",extendDefaultConfig:!1,target:$()},target=$(barConfig.target),tlbWrapper=target.prop("tlb")||$("<div>",{class:"tlb-wrapper"}),toolbar,title,top;return target.prop("tlb")||(buttonConfig=handleConfig(buttonConfig,barConfig.extendDefaultConfig),barConfig=$.extend(defaultBarConfig,barConfig||{}),toolbar=buildToolbar(buttonConfig,target,tlbWrapper),barConfig.title&&(title=$("<span>",{text:getQtiClassTitle(barConfig.title),class:"tlb-title",title:getQtiClassTitle(barConfig.title)}),tlbWrapper.append(title)),tlbWrapper.append(toolbar),target.prop("tlb",tlbWrapper),target.append(tlbWrapper),tlbWrapper.css("position","absolute"),tlbWrapper.css("display","none"),tlbWrapper.css("width","100%"),top=defaultBarConfig.offsetTop-tlbWrapper.height(),tlbWrapper.css("top",top)),tlbWrapper.fadeIn(),tlbWrapper}}}()}),define("taoQtiItem/qtiCreator/widgets/static/Widget",["jquery","taoQtiItem/qtiCreator/widgets/Widget","taoQtiItem/qtiCreator/editor/widgetToolbar"],function($,Widget){"use strict";var StaticWidget=Widget.clone();return StaticWidget.initCreator=function(){Widget.initCreator.call(this),this.createToolbar()},StaticWidget.buildContainer=function(){var $wrap=$("<div>",{"data-serial":this.element.serial,class:"widget-box"});this.$original.wrap($wrap),this.$container=this.$original.parent()},StaticWidget.createToolbar=function(){return this},StaticWidget.getAssetManager=function(){if(!this.options||!this.options.assetManager)throw new Error("Asset Manager has not been set.");return this.options.assetManager},StaticWidget.createOkButton=function(){var _this=this;this.$container.append($("<button>",{class:"btn-info small",type:"button",text:"OK","data-edit":"active"}).css({margin:"5px 10px",display:"none"}).on("click.qti-widget",function(e){e.stopPropagation(),_this.changeState("sleep")}))},StaticWidget}),define("taoQtiItem/qtiCreator/widgets/states/factory",["jquery","lodash"],function($,_){var _isValidStateDefinition=function(state){return!!_.isFunction(state)&&!!(state.prototype.name&&state.prototype.superState)&&!!(_.isFunction(state.prototype.init)&&_.isFunction(state.prototype.exit))},_create=function(name,superStates,init,exit){var State=function(widget){this.widget=widget};return State.prototype.name=name,State.prototype.superState=superStates||[],init&&exit&&(State.prototype.init=function(){var $container=this.widget.$container;$container.data("edit")===name&&$container.show();var $editableWidgets=$container.find("[data-edit=\""+name+"\"]").filter(function(){var $parentWidget=$(this).closest(".widget-box");return!!($parentWidget.length&&$parentWidget[0]===$container[0])});$editableWidgets.show(),this.widget.$container.addClass("edit-"+name),$(document).trigger("beforeStateInit.qti-widget",[this.widget.element,this]),init.call(this),$(document).trigger("afterStateInit.qti-widget",[this.widget.element,this])},State.init=init,State.prototype.exit=function(){this.widget.$container.data("edit")===name&&this.widget.$container.hide(),this.widget.$container.find("[data-edit=\""+name+"\"]").hide(),this.widget.$container.removeClass("edit-"+name),$(document).trigger("beforeStateExit.qti-widget",[this.widget.element,this]),$(document).off([".qti-widget",name,this.widget.serial].join(".")),exit.call(this),$(document).trigger("afterStateExit.qti-widget",[this.widget.element,this])},State.exit=exit),State};return{create:function create(){var State,name,superStates,init,exit;if(_.isString(arguments[0])){if(name=arguments[0],_.isArray(arguments[1])){if(superStates=arguments[1],_.isFunction(arguments[2])&&_.isFunction(arguments[3]))init=arguments[2],exit=arguments[3],State=_create(name,superStates,init,exit);else throw new Error("the third and fourth arguments are expected to be functions: init() & exit()");}else if(superStates=[],_.isFunction(arguments[1])&&_.isFunction(arguments[2]))init=arguments[1],exit=arguments[2],State=_create(name,superStates,init,exit);else throw new Error("the second and third arguments are expected to be functions: init() & exit()");}else if(!_isValidStateDefinition(arguments[0]))throw new Error("invalid first argument : expected the state name (string) or a State (function)");else if(name=arguments[0].prototype.name,superStates=arguments[0].prototype.superState,_.isFunction(arguments[1])&&_.isFunction(arguments[2]))init=arguments[1],exit=arguments[2],State=_create(name,superStates,init,exit);else throw new Error("the second and third arguments are expected to be functions: init() & exit()");return State},extend:function extend(State,init,exit){var Clone=null,initFn,exitFn;if(_isValidStateDefinition(State))_.isFunction(init)&&(initFn=function(){State.init.call(this),init.call(this)}),_.isFunction(exit)&&(exitFn=function(){exit.call(this),State.exit.call(this)}),Clone=_create(State.prototype.name,State.prototype.superState,initFn,exitFn),_.forIn(State.prototype,function(prop,name){if(_.isFunction(prop)){if(initFn&&"init"===name||exitFn&&"exit"===name)return!0;Clone.prototype[name]=prop,Clone[name]=prop}});else throw new Error("invalid state to be cloned");return Clone},createBundle:function createBundle(){var stateBundle={},newStates=[],excluded=[];return 2<=arguments.length?(stateBundle=_.clone(arguments[0]),newStates=arguments[1],excluded=arguments[2]||excluded):newStates=arguments[0],_.each(newStates,function(state){_isValidStateDefinition(state)&&(stateBundle[state.prototype.name]=state)}),_.each(excluded,function(state){delete stateBundle[state]}),stateBundle},throwMissingRequiredImplementationError:function throwMissingRequiredImplementationError(functionName){throw new Error("Missing required implementation of the function "+functionName+"()")}}}),define("taoQtiItem/qtiCreator/widgets/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory"],function(stateFactory){'use strict';return stateFactory.create("sleep",function(){var widget=this.widget,$container=this.widget.$container;$container.on("mouseenter.sleep",function(e){e.stopPropagation(),$container.addClass("hover"),$container.parent().trigger("mouseleave")}).on("mouseleave.sleep",function(){$container.removeClass("hover"),$container.parent().trigger("mouseenter")}),widget.isValid()||widget.changeState("invalid")},function(){this.widget.$container.removeClass("hover").off(".sleep")})}),define("taoQtiItem/qtiCreator/widgets/static/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Sleep"],function(stateFactory,SleepState){var StaticStateSleep=stateFactory.extend(SleepState,function(){var _widget=this.widget;_widget.$container.on("click.qti-widget.sleep",function(e){e.stopPropagation(),_widget.changeState("active")})},function(){var _widget=this.widget;_widget.$container.off(".sleep")});return StaticStateSleep}),define("taoQtiItem/qtiCreator/widgets/helpers/content",["jquery","lodash","taoQtiItem/qtiCreator/helper/creatorRenderer","taoQtiItem/qtiCreator/model/helper/container","taoQtiItem/qtiCreator/editor/gridEditor/content"],function($,_,creatorRenderer,containerHelper,gridContentHelper){'use strict';return{createElements:function(container,$container,data,callback){var $dummy=$("<div>").html(data);containerHelper.createElements(container,gridContentHelper.getContent($dummy),function(newElts){creatorRenderer.get().load(function(){var serial,elt,$placeholder,$widget,widget;for(serial in newElts)elt=newElts[serial],$placeholder=$container.find(".widget-box[data-new][data-qti-class="+elt.qtiClass+"]"),elt.setRenderer(this),elt.render($placeholder),elt.postRender(),widget=elt.data("widget"),$widget=widget.$original,$widget.trigger("contentChange.gridEdit"),_.isFunction(callback)&&callback(widget)},this.getUsedClasses())})},changeInnerWidgetState:function(outerWidget,state){var selector=[];_.each(["img","math","object","include"],function(qtiClass){selector.push("[data-html-editable] .widget-"+qtiClass)}),outerWidget.$container.find(selector.join(",")).each(function(){var innerWidget=$(this).data("widget");innerWidget&&innerWidget.changeState(state)})}}}),define("taoQtiItem/qtiCreator/widgets/states/Active",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/helpers/content"],function($,stateFactory,contentHelper){'use strict';return stateFactory.create("active",function(){function checkIfWidgetShouldSleep(e){return container!==e.target&&!$.contains(container,e.target)&&$.contains(outerContainer,e.target)&&(!areaBroker||!areaBroker.getEditorBarArea||!$.contains(areaBroker.getEditorBarArea().get(0),e.target))&&(!$modalFeedbacksArea.length||!$.contains($modalFeedbacksArea[0],e.target))&&"restore"!==$(e.target).data("role")&&!$(e.target).closest(".widget-popup").length}var _widget=this.widget,container=_widget.$container[0],item=_widget.element.getRootElement(),areaBroker=_widget.getAreaBroker(),$modalFeedbacksArea=$("#modalFeedbacks"),outerContainer=document.querySelector("#item-editor-scroll-outer");areaBroker.getContentCreatorPanelArea().on("mousedown.active."+_widget.serial,function(e){checkIfWidgetShouldSleep(e)&&_widget.changeState("sleep")}).on("beforesave.qti-creator.active",function(){_widget.changeState("sleep")}).on("styleedit.active",function(){_widget.changeState("sleep")}),$(document).on("open-preview.qti-item",function(){_widget.changeState("sleep")}),item&&item.data("widget")&&item.data("widget").$container.on("resizestart.gridEdit.active beforedragoverstart.gridEdit.active",function(){_widget.changeState("sleep")})},function(){var areaBroker=this.widget.getAreaBroker(),item;contentHelper.changeInnerWidgetState(this.widget,"sleep"),this.widget.$container.off(".active"),areaBroker.getContentCreatorPanelArea().off(".active."+this.widget.serial);var item=this.widget.element.getRootElement();item&&item.data("widget")&&item.data("widget").$container.off(".active")})}),define("taoQtiItem/qtiCreator/widgets/static/states/Active",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Active"],function($,stateFactory,Active){'use strict';return stateFactory.extend(Active,function(){var _widget=this.widget,$container=_widget.$container;_widget.beforeStateInit(function(e,element,state){var serial=element.getSerial(),composingElts;("active"===state.name&&serial!==_widget.serial||"choice"===state.name)&&("rubricBlock"===_widget.element.qtiClass?(composingElts=_widget.element.getComposingElements(),!composingElts[element.serial]&&_widget.changeState("sleep")):_widget.changeState("sleep"))},"otherActive"),$container.on("mouseenter.active",function(e){e.stopPropagation(),$container.parent().trigger("mouseleave.sleep")}).on("mouseleave.active",function(e){e.stopPropagation(),$container.parent().trigger("mouseenter.sleep")}).on("click.active",function(e){e.stopPropagation()})},function(){var _widget=this.widget,areaBroker=_widget.getAreaBroker();_widget.$container.off(".active"),areaBroker.getContentCreatorPanelArea().off(".active."+_widget.serial),_widget.offEvents("otherActive")})}),define("taoQtiItem/qtiCreator/widgets/states/Inactive",["taoQtiItem/qtiCreator/widgets/states/factory"],function(stateFactory){return stateFactory.create("inactive",function(){},function(){})}),define("tpl!taoQtiItem/qtiCreator/tpl/notifications/deletingInfoBox",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",helper,options;return buffer+="\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"You have deleted an element",options):helperMissing.call(depth0,"__","You have deleted an element",options)))+".\n ",buffer}function program3(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"You have deleted",options):helperMissing.call(depth0,"__","You have deleted",options)))+" ",(helper=helpers.count)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.count,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+" "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"elements",options):helperMissing.call(depth0,"__","elements",options)))+".\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper,options;return buffer+="<div class=\"feedback-info popup\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"icon-info\"></span>\n ",stack1=(helper=helpers.equal||depth0&&depth0.equal,options={hash:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),data:data},helper?helper.call(depth0,depth0&&depth0.count,1,options):helperMissing.call(depth0,"equal",depth0&&depth0.count,1,options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <a class=\"undo\" href=\"#\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"undo",options):helperMissing.call(depth0,"__","undo",options)))+"</a>\n <span title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove Message",options):helperMissing.call(depth0,"__","Remove Message",options)))+"\" class=\"icon-close close-trigger\"></span>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/helpers/deletingState",["lodash","jquery","tpl!taoQtiItem/qtiCreator/tpl/notifications/deletingInfoBox"],function(_,$,deletingInfoTpl){'use strict';var undoDeleting=!1,_destroy=function($messageBox){$("body").off(".deleting"),$messageBox.remove(),undoDeleting=!1},undo=function($messageBox){undoDeleting=!0,$messageBox.trigger("undo.deleting"),_destroy($messageBox)},_confirmDeletion=function($messageBox,fadeDelay){!undoDeleting&&$messageBox.length&&$.contains(document,$messageBox[0])&&($messageBox.trigger("confirm.deleting"),$messageBox.fadeOut(fadeDelay,function(){_destroy($messageBox)}))},_bindEvents=function($messageBox){$("body").on("mousedown.deleting keydown.deleting",function(e){return e.ctrlKey||e.metaKey?(90===e.keyCode&&undo($messageBox),void e.preventDefault()):void(e.target!==$messageBox[0]&&!$.contains($messageBox[0],e.target)&&_confirmDeletion($messageBox,400))}),$messageBox.find("a.undo").on("click",function(e){e.preventDefault(),undo($messageBox)}),$messageBox.find(".close-trigger").on("click",function(e){e.preventDefault(),_confirmDeletion($messageBox,0)}),setTimeout(function(){_confirmDeletion($messageBox,1e3)},10000)};return{createInfoBox:function createInfoBox(widgets){var $messageBox=$(deletingInfoTpl({serial:"widgets",count:widgets.length}));return $("body").append($messageBox),$messageBox.css({display:"block",position:"fixed",top:"50px",left:"50%","margin-left":"-200px",width:"400px",zIndex:999999}),_bindEvents($messageBox),$messageBox},confirmDeletion:function confirmDeletion($messageBox){_confirmDeletion($messageBox,0)}}}),define("taoQtiItem/qtiCreator/helper/gridUnits",["lodash"],function(_){"use strict";var _Mathround4=Math.round;function distributeUnits(cols,min,max){max=max||12;var totalUnits=0,size=0,_cols={},ret={},minimized=[],decimals=[];for(var i in cols)_cols[i]=_.clone(cols[i]),totalUnits+=cols[i].units,size++;var avg=totalUnits/size;if(_cols[size+1]={elt:"middle",units:avg,min:min},totalUnits+_Mathround4(avg)>max){var refactoredTotalUnits=0;for(var i in _cols){var col=_cols[i],refactoredUnits=col.units*max/(max+avg);decimals[i]=_Mathround4(100*(refactoredUnits%1)),col.refactoredUnits=_Mathround4(refactoredUnits),col.min&&col.refactoredUnits<col.min&&(col.refactoredUnits=col.min,minimized[i]=!0),refactoredTotalUnits+=col.refactoredUnits}if(refactoredTotalUnits>max)for(var i,col;i<size+1&&(col=_cols[i],50<col.decimal&&col.refactoredUnits-1>col.min&&(col.refactoredUnits--,refactoredTotalUnits--),refactoredTotalUnits!==max);i++);var middleUnitValue=_cols[size+1].refactoredUnits,lastUnitValue=refactoredTotalUnits>max?max:middleUnitValue;delete _cols[size+1],ret={last:lastUnitValue,middle:middleUnitValue,cols:_cols,refactoredTotalUnits:refactoredTotalUnits}}else{var last=max-totalUnits;ret={last:last,middle:last,cols:{}}}return ret}function redistributeUnits(cols,max){max=max||12;var totalUnits=0,_cols=[],totalRefactoredUnits=0,negative=[],positive=[],ret=[];if(_.each(cols,function(col){_cols.push(col),totalUnits+=col.units}),totalUnits>max)throw"the total number of units exceed the maximum of "+max;return _.each(_cols,function(col){var refactoredUnits=col.units*max/totalUnits,rounded=_Mathround4(refactoredUnits);totalRefactoredUnits+=rounded,col.refactoredUnits=rounded,rounded>refactoredUnits?positive.push(col):negative.push(col)}),positive=_.sortBy(positive,"refactoredUnits"),negative=_.sortBy(negative,"refactoredUnits"),totalRefactoredUnits>max?_.eachRight(positive,function(col){if(col.refactoredUnits--,totalRefactoredUnits--,totalRefactoredUnits===max)return!1}):totalRefactoredUnits<max&&_.each(negative,function(col){if(col.refactoredUnits++,totalRefactoredUnits++,totalRefactoredUnits===max)return!1}),_.each(negative,function(col){ret.push(col)}),_.each(positive,function(col){ret.push(col)}),_cols}return{distribute:function distribute(cols,min,max){return distributeUnits(cols,min,max)},redistribute:function redistribute(cols,max){return redistributeUnits(cols,max)}}}),define("taoQtiItem/qtiCreator/widgets/states/Deleting",["lodash","jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/helpers/deletingState","taoQtiItem/qtiCreator/helper/gridUnits","taoQtiItem/qtiCreator/editor/gridEditor/helper","taoQtiItem/qtiCreator/editor/gridEditor/content"],function(_,$,stateFactory,deletingHelper,gridUnits,gridHelper,contentHelper){var DeletingState=stateFactory.create("deleting",function(){var element=this.widget.element;this.refactoredUnits=[],this.updateBody=!1,this.$elementToRemove=this.getElementToRemove(),this.hideWidget(),this.showMessage(element),element.data("deleting",!0),this.updateBody&&(this.item=element.getRootElement(),this.$item=this.item.data("widget").$container.find(".qti-itemBody"),this.$item.trigger("resize.qti-widget"))},function(){this.showWidget(),deletingHelper.confirmDeletion(this.messageBox),this.widget.element.data("deleting",!1),$("body").off(".deleting"),this.updateBody&&this.$item.trigger("resize.qti-widget")});DeletingState.prototype.getElementToRemove=function(){var $container=this.widget.$container;if($container.hasClass("qti-choice"))if("TH"===$container.prop("tagName")){if("THEAD"===$container.parent().parent().prop("tagName")){var $tbody=$container.closest("table.matrix").children("tbody"),$tds=$tbody.children("tr").find("td:last");return $container.add($tds)}if("TBODY"===$container.parent().parent().prop("tagName"))return $container.parent()}else return $container;if($container.hasClass("widget-inline"))return $container.add(this.widget.$original);var $col=$container.parent(),$subCol=$container.parent(".colrow");if($subCol.length){this.updateBody=!0;var $colMulti=$subCol.parent();if(1===$colMulti.find(".colrow").length)$col=$colMulti;else return $subCol}var $row=$col.parent(".grid-row");return $row.length?(this.updateBody=!0,1===$row.children().length?$row:$col):$container.hasClass("grid-row")?(this.updateBody=!0,$container):$container.hasClass("widget-block")||$container.hasClass("widget-blockInteraction")?$container:void 0};var _isCol=function($col){var attrClass=$col.attr("class");return attrClass&&/col-([\d]+)/.test(attrClass)},_redistributeUnits=function($col){var $otherCols=$col.siblings(),cols=[];return $otherCols.each(function(){var $thisCol=$(this),units=$col.data("units");cols.push({elt:$thisCol,units:units})}),cols=gridUnits.redistribute(cols),_.each(cols,function(col){col.elt.removeClass("col-".concat(col.units)).addClass("col-".concat(col.refactoredUnits)),gridHelper.setUnitsFromClass(col.elt)}),$col.data("redistributedUnits",cols),cols};return DeletingState.prototype.hideWidget=function(){var $elt=this.$elementToRemove;$elt.length&&($elt.hide(),_isCol($elt)&&(this.refactoredUnits=_redistributeUnits($elt)))},DeletingState.prototype.showWidget=function(){var $elt=this.$elementToRemove;$elt.length&&$.contains(document,$elt[0])&&($elt.show(),_isCol($elt)&&_.each(this.refactoredUnits,function(col){col.elt.removeClass("col-".concat(col.refactoredUnits)).addClass("col-".concat(col.units)),gridHelper.setUnitsFromClass(col.elt)}))},DeletingState.prototype.showMessage=function(){var _this22=this,$messageBox=deletingHelper.createInfoBox([this.widget]);$messageBox.on("confirm.deleting",function(){_this22.deleteElement()}).on("undo.deleting",function(){try{_this22.widget.changeState("question")}catch(e){_this22.widget.changeState("active")}}),this.messageBox=$messageBox},DeletingState.prototype.deleteElement=function(){this.refactoredUnits=[];var container=this.widget.element;container.getBody&&container.getBody().elements&&_.each(_.values(container.getBody().elements),function(elt){if(elt.metaData&&elt.metaData.widget){var widget=elt.metaData.widget;widget.destroy(),widget.element.remove()}}),this.$elementToRemove.remove(),this.widget.destroy(),this.widget.element.remove(),this.updateBody&&this.item.body(contentHelper.getContent(this.$item)),this.$item&&this.$item.trigger("item.deleted")},DeletingState}),define("taoQtiItem/qtiCreator/widgets/static/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Sleep","taoQtiItem/qtiCreator/widgets/static/states/Active","taoQtiItem/qtiCreator/widgets/states/Inactive","taoQtiItem/qtiCreator/widgets/states/Deleting"],function(factory){return factory.createBundle(arguments)}),define("taoQtiItem/qtiCreator/widgets/static/text/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Sleep","taoQtiItem/qtiCreator/editor/gridEditor/content"],function(stateFactory,SleepState,contentHelper){var TextBlockStateSleep=stateFactory.extend(SleepState,function(){var widget=this.widget;widget.afterStateExit(function(e,element,state){var serial=element.getSerial();if("active"===state.name&&serial!==widget.serial&&"include"===element.qtiClass){var composingElts=widget.element.getComposingElements();if(composingElts[serial]){var $pseudoContainer=$("<div>").html(widget.$container.find("[data-html-editable=\"true\"]").html()),newBody=contentHelper.getContent($pseudoContainer),container=widget.element;container.body(newBody)}}},"question")},function(){this.widget.offEvents("question")});return TextBlockStateSleep}),define("taoQtiItem/qtiCreator/helper/ckConfigurator",["lodash","ui/ckeditor/ckConfigurator","mathJax"],function(_,ckConfigurator,mathJax){'use strict';var _defaults={qtiImage:!0,qtiMedia:!0,qtiInclude:!0,underline:!0,mathJax:!!mathJax};return{getConfig:function getConfig(editor,toolbarType,options){return ckConfigurator.getConfig(editor,toolbarType,_.defaults(options||{},_defaults))}}}),define("taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor",["lodash","i18n","jquery","ckeditor","core/promise","taoQtiItem/qtiCreator/helper/ckConfigurator","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/widgets/helpers/content","taoQtiItem/qtiCreator/widgets/helpers/deletingState"],function(_,__,$,CKEditor,Promise,ckConfigurator,Element,contentHelper,deletingHelper){"use strict";function _buildEditor($editable,$editableContainer,options){var widget=(options.data||{}).widget,areaBroker=widget&&widget.getAreaBroker&&widget.getAreaBroker(),$toolbarArea=areaBroker&&areaBroker.getToolbarArea&&areaBroker.getToolbarArea(),ckConfig;if(options=_.defaults(options,_defaults),!($editable instanceof $)||!$editable.length)throw new Error("invalid jquery element for $editable");if(!($editableContainer instanceof $)||!$editableContainer.length)throw new Error("invalid jquery element for $editableContainer");return options.placeholder&&""!==options.placeholder&&($editable.is("input")?$editable.attr("placeholder",options.placeholder):$editable.attr("data-placeholder",options.placeholder)),ckConfig={dtdMode:"qti",autoParagraph:!1,removePlugins:options.removePlugins||"",enterMode:options.enterMode||CKEditor.ENTER_P,floatSpaceDockedOffsetY:10,sharedSpaces:{top:$toolbarArea&&$toolbarArea.attr("id")||"toolbar-top"},taoQtiItem:{insert:function insert(tempWidget){var $newContent=$(tempWidget).clone();options.data&&options.data.container&&options.data.widget&&contentHelper.createElements(options.data.container,$editable,_htmlEncode(this.getData()),function(createdWidget){var createdElement=createdWidget.element;_.isFunction(createdElement.initContainer)&&(createdElement.body($newContent.html()),createdWidget.rebuild(),createdWidget=createdElement.data("widget")),_activateInnerWidget(options.data.widget,createdWidget)})}},on:{instanceReady:function instanceReady(e){var widgets={},editor=e.editor;$editable.data("editor",editor),$editable.data("editor-options",options),editor.on("change",_.debounce(function(){_detectWidgetDeletion($editable,widgets,editor),_.isFunction(options.change)&&options.change.call(editor,_htmlEncode(editor.getData()))},100,{leading:!0})),managePlaceholder($editable,editor),options.data&&options.data.container&&($editable.data("qti-container",options.data.container),widgets=_rebuildWidgets(options.data.container,$editable,{restoreState:!0}),options.shieldInnerContent&&_shieldInnerContent($editable,options.data.widget)),options.autofocus&&_focus(editor),$editable.trigger("editorready",[editor]),$(".qti-item").trigger("toolbarchange")},blur:function blur(){$toolbarArea&&$toolbarArea.hide()},focus:function focus(){$toolbarArea&&$toolbarArea.show(),_.isFunction(options.focus)&&options.focus.call(this,_htmlEncode(this.getData())),$editable.trigger("editorfocus"),$(".qti-item").trigger("toolbarchange")},configLoaded:function configLoaded(e){var toolbarType="";options.toolbar&&_.isArray(options.toolbar)?ckConfig.toolbar=options.toolbar:toolbarType=getTooltypeFromContainer($editableContainer),"undefined"!=typeof options.qtiMedia&&(ckConfig.qtiMedia=options.qtiMedia),"undefined"!=typeof options.qtiImage&&(ckConfig.qtiImage=options.qtiImage),"undefined"!=typeof options.qtiInclude&&(ckConfig.qtiInclude=options.qtiInclude),"undefined"!=typeof options.highlight&&(ckConfig.highlight=options.highlight),e.editor.config=ckConfigurator.getConfig(e.editor,toolbarType,ckConfig)},afterPaste:function afterPaste(){}}},CKEditor.inline($editable[0],ckConfig)}function managePlaceholder($editable,editor){$editable.is("input")||(togglePlaceholder($editable),editor.on("change",function(){togglePlaceholder($editable)}))}function togglePlaceholder($editable){""!==$editable.text().trim()||$editable.find(["img","table","math","object","printedVariable",".tooltip-target"].join(",")).length?removePlaceholder($editable):$editable.addClass("cke-placeholder")}function removePlaceholder($editable){$editable.removeClass("cke-placeholder")}function getTooltypeFromContainer($editableContainer){var toolbarType="qtiFlow";return $editableContainer.hasClass("widget-blockInteraction")||$editableContainer.hasClass("widget-textBlock")||$editableContainer.hasClass("widget-rubricBlock")?toolbarType="qtiBlock":($editableContainer.hasClass("qti-prompt-container")||$editableContainer.hasClass("widget-hottext"))&&(toolbarType="qtiInline"),toolbarType}function _find($container,dataAttribute){var $collection;return $collection=$container.data(dataAttribute)?$container:$container.find("[data-"+dataAttribute+"=true]"),$collection}function _rebuildWidgets(container,$container,options){var widgets={};return options=options||{},_.each(_.values(container.elements),function(elt){var widget=elt.data("widget"),currentState=widget.getCurrentState().name;widgets[elt.serial]=widget.rebuild({context:$container,ready:function ready(widget){options.restoreState&&widget.changeState(currentState)}})}),$container.trigger("widgetCreated",[widgets,container]),widgets}function _findWidgetContainer($container,serial){return $($container.selector).find(".widget-box[data-serial="+serial+"]")}function _detectWidgetDeletion($container,widgets,editor){var deleted=[],container=$container.data("qti-container"),$widget;if(_.each(widgets,function(w){w.element.data("removed")||($widget=_findWidgetContainer($container,w.serial),!$widget.length&&deleted.push(w))}),deleted.length){var undoCmd=editor.getCommand("undo"),$messageBox=deletingHelper.createInfoBox(deleted);$messageBox.on("confirm.deleting",function(){_.each(deleted,function(w){w.element.remove(),w.destroy()}),editor.resetUndo()}).on("undo.deleting",function(){editor.undoManager.undo(),_rebuildWidgets(container,$container,{restoreState:!0}),_shieldInnerContent($container,container.data("widget"))}),undoCmd&&undoCmd.on("afterUndo",function(){$messageBox.find("a.undo").click()})}}function addShield($widget){var $shield=$("<button>",{class:"html-editable-shield"});return $widget.attr("contenteditable",!1),$widget.append($shield),$shield}function _shieldInnerContent($container,containerWidget){$container.find(".widget-box").each(function(){var $widget=$(this);addShield($widget).on("click",function(e){var innerWidget;e.stopPropagation(),innerWidget=$widget.data("widget"),_activateInnerWidget(containerWidget,innerWidget)})})}function _activateInnerWidget(containerWidget,innerWidget){var listenToWidgetCreation;containerWidget&&containerWidget.element&&containerWidget.element.qtiClass?(listenToWidgetCreation=function(){containerWidget.$container.on("widgetCreated."+innerWidget.serial,function(e,widgets){var targetWidget=widgets[innerWidget.serial];targetWidget&&(containerWidget.$container.off("widgetCreated."+innerWidget.serial),_.delay(function(){Element.isA(targetWidget.element,"interaction")?targetWidget.changeState("question"):targetWidget.changeState("active")},100))})},Element.isA(containerWidget.element,"_container")&&!containerWidget.element.data("stateless")?(listenToWidgetCreation(),containerWidget.changeState("sleep")):Element.isA(containerWidget.element,"interaction")?(listenToWidgetCreation(),containerWidget.changeState("sleep")):Element.isA(containerWidget.element,"choice")?(listenToWidgetCreation(),containerWidget.changeState("question")):Element.isA(containerWidget.element,"table")?(listenToWidgetCreation(),containerWidget.changeState("sleep")):Element.isA(innerWidget.element,"choice")?innerWidget.changeState("choice"):innerWidget.changeState("active")):innerWidget.changeState("active")}function _htmlEncode(encodedStr){return encodedStr}function _focus(editor){var range;editor.editable()&&editor.editable().$.parentNode&&(editor.focus(),range=editor.createRange(),range.moveToElementEditablePosition(editor.editable(),!0),editor.getSelection().selectRanges([range]))}var _defaults={placeholder:__("some text ..."),shieldInnerContent:!0,passthroughInnerContent:!1,autofocus:!0},editorFactory;return CKEditor.disableAutoInline=!0,editorFactory={hasEditor:function($container){var hasEditor=!1;return _find($container,"html-editable").each(function(){return hasEditor=!!$(this).data("editor"),hasEditor}),hasEditor},buildEditor:function buildEditor($container,editorOptions){var buildTasks=[];return _find($container,"html-editable-container").each(function(){var $editableContainer=$(this),$editable=$editableContainer.find("[data-html-editable]");buildTasks.push(new Promise(function(resolve){$editable.attr("contenteditable",!0),_buildEditor($editable,$editableContainer,editorOptions),$editable.on("editorready",resolve)}))}),Promise.all(buildTasks)},destroyEditor:function destroyEditor($container){var destructTasks=[];return _find($container,"html-editable-container").each(function(){var $editableContainer=$(this),$editable=$editableContainer.find("[data-html-editable]"),editor,options;$editable.removeAttr("contenteditable"),$editable.data("editor")&&destructTasks.push(new Promise(function(resolve){editor=$editable.data("editor"),options=$editable.data("editor-options"),_.isFunction(options.change)&&options.change.call(editor,_htmlEncode(editor.getData())),removePlaceholder($editable),editor.on("destroy",function(){$editable.removeData("editor").removeData("editor-options"),$editable.data("qti-container")&&_rebuildWidgets($editable.data("qti-container"),$editable),$editable.trigger("editordestroyed"),resolve()}),editor.focusManager.blur(!0),editor.destroy()}))}),Promise.all(destructTasks)},getData:function getData($editable){var editor=$editable.data("editor");if(editor)return _htmlEncode(editor.getData());throw new Error("no editor attached to the DOM element")},setData:function setData($editable,data){var editor=$editable.data("editor");if(editor)_.isString(data)&&editor.setData(_.escape(data));else throw new Error("no editor attached to the DOM element")},focus:function focus($editable){_find($editable,"html-editable").each(function(){var editor=$(this).data("editor");editor&&_focus(editor)})}},editorFactory}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/text",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program3(depth0,data){var buffer="",stack1,helper;return buffer+="\n <option value=\"",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.name)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.name,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n ",buffer}function program4(){return"selected=\"selected\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"textBlockCssClass\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Text Block CSS Class",options):helperMissing.call(depth0,"__","Text Block CSS Class",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Set a CSS class name in order to customize the display style.",options):helperMissing.call(depth0,"__","Set a CSS class name in order to customize the display style.",options)))+"</div>\n <input type=\"text\" name=\"textBlockCssClass\" value=\"",(helper=helpers.textBlockCssClass)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.textBlockCssClass,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n</div>\n\n<div class=\"panel\">\n <label>\n <input name=\"scrolling\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.scrolling,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Enable Scrolling",options):helperMissing.call(depth0,"__","Enable Scrolling",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Enable/disable scrolling.",options):helperMissing.call(depth0,"__","Enable/disable scrolling.",options)))+"\n </span>\n</div>\n\n<div class=\"panel scrollingSelect\">\n <label for=\"scrollingHeight\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Block height (%)",options):helperMissing.call(depth0,"__","Block height (%)",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select height of text block base of conatainer height",options):helperMissing.call(depth0,"__","Select height of text block base of conatainer height",options)))+"</span>\n <select name=\"scrollingHeight\" class=\"select2\" data-has-search=\"false\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.scrollingHeights,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/helpers/itemScrollingMethods",["jquery","util/typeCaster"],function($,typeCaster){'use strict';var wrapperIncludeCls="custom-include-box",wrapperFocusCls="key-navigation-focusable",newUIclass="tao-overflow-y",_options=[{value:"100",name:"Full height",class:"tao-full-height"},{value:"75",name:"3/4 of height",class:"tao-three-quarters-height"},{value:"66.6666",name:"2/3 of height",class:"tao-two-thirds-height"},{value:"50",name:"Half height",class:"tao-half-height"},{value:"33.3333",name:"1/3 of height",class:"tao-third-height"},{value:"25",name:"1/4 of height",class:"tao-quarter-height"}];return{options:function options(){return _options},isScrolling:function isScrolling($wrapper){return typeCaster.strToBool(0<$wrapper.length?$wrapper.attr("data-scrolling"):"false")},selectedHeight:function selectedHeight($wrapper){return $wrapper.attr("data-scrolling-height")},initSelect:function initSelect($form,isScroll,height){isScroll?$form.find(".scrollingSelect").show():$form.find(".scrollingSelect").hide(),height&&$form.find(".scrollingSelect select").val(height).change()},wrapContent:function wrapContent(widget,value,wrapType){var $form=widget.$form,$wrapper="inner"===wrapType?widget.$container.find("[data-html-editable]").children(".".concat("custom-text-box")):widget.$container.parent(".".concat(wrapperIncludeCls));$wrapper.length||($wrapper="inner"===wrapType?widget.$container.find("[data-html-editable]").wrapInner("<div class=\"".concat("custom-text-box","\" />")).children():widget.$container.wrap("<div class=\"".concat(wrapperIncludeCls,"\" />")).parent()),$wrapper.attr("data-scrolling",value),value?($form.find(".scrollingSelect").show(),$wrapper.addClass(wrapperFocusCls),$wrapper.addClass("".concat(newUIclass," ").concat(_options[0].class))):($form.find(".scrollingSelect").hide(),$wrapper.removeClass(wrapperFocusCls),$wrapper.removeClass(newUIclass),_options.forEach(function(opt){$wrapper.removeClass(opt.class)}))},setScrollingHeight:function setScrollingHeight($wrapper,value){$wrapper.attr("data-scrolling-height",value),_options.forEach(function(opt){$wrapper.removeClass(opt.class)});var opt=_options.find(function(opt){return opt.value===value});$wrapper.addClass(opt.class)},cutScrollClasses:function cutScrollClasses(classes){var clearClasses=classes.replace(wrapperFocusCls,"").replace(newUIclass,"");return _options.forEach(function(opt){clearClasses=clearClasses.replace(opt.class,"")}),clearClasses}}}),define("taoQtiItem/qtiCreator/widgets/static/text/states/Active",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Active","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiCreator/widgets/helpers/formElement","tpl!taoQtiItem/qtiCreator/tpl/forms/static/text","taoQtiItem/qtiCreator/widgets/static/helpers/itemScrollingMethods"],function(stateFactory,Active,htmlEditor,content,formElement,formTpl,itemScrollingMethods){'use strict';var TextActive=stateFactory.extend(Active,function(){this.buildEditor(),this.initForm()},function(){this.destroyEditor(),this.widget.$form.empty()});TextActive.prototype.buildEditor=function(){var widget=this.widget,$editableContainer=widget.$container,container=widget.element,changeCallback=content.getChangeCallback(container);$editableContainer.attr("data-html-editable-container",!0),htmlEditor.hasEditor($editableContainer)||htmlEditor.buildEditor($editableContainer,{change:function change(data){changeCallback.call(this,data),data||widget.$form.find("[name=\"textBlockCssClass\"]").val("")},blur:function blur(){widget.changeState("sleep")},data:{widget:widget,container:container}})},TextActive.prototype.destroyEditor=function(){htmlEditor.destroyEditor(this.widget.$container)},TextActive.prototype.initForm=function(){var widget=this.widget,$form=widget.$form,$wrap=widget.$container.find(".".concat("custom-text-box")),blockCls=itemScrollingMethods.cutScrollClasses($wrap.attr("class")||""),isScrolling=itemScrollingMethods.isScrolling($wrap),selectedHeight=itemScrollingMethods.selectedHeight($wrap);$form.html(formTpl({textBlockCssClass:blockCls.replace("custom-text-box","").trim(),scrolling:isScrolling,scrollingHeights:itemScrollingMethods.options()})),formElement.initWidget($form),formElement.setChangeCallbacks($form,widget.element,changeCallbacks(widget)),itemScrollingMethods.initSelect($form,isScrolling,selectedHeight)};var changeCallbacks=function(widget){return{textBlockCssClass:function textBlockCssClass(element,value){var $wrap=widget.$container.find(".".concat("custom-text-box"));value=value.trim(),value==="custom-text-box"&&(value=""),$wrap.length||($wrap=widget.$container.find("[data-html-editable=\"true\"]").wrapInner("<div />").children()),$wrap.attr("class","custom-text-box "+value)},scrolling:function scrolling(element,value){itemScrollingMethods.wrapContent(widget,value,"inner")},scrollingHeight:function scrollingHeight(element,value){itemScrollingMethods.setScrollingHeight(widget.$container.find(".".concat("custom-text-box")),value)}}};return TextActive}),define("taoQtiItem/qtiCreator/widgets/static/text/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states","taoQtiItem/qtiCreator/widgets/static/text/states/Sleep","taoQtiItem/qtiCreator/widgets/static/text/states/Active"],function(factory,states){return factory.createBundle(states,arguments)}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/textBlock",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<div class=\"mini-tlb\" data-edit=\"",(helper=helpers.state)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.state,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <div class=\"rgt tlb-button\" title=\"Delete\" data-role=\"delete\">\n <span class=\"icon-bin\"></span>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/text/Widget",["jquery","taoQtiItem/qtiCreator/widgets/static/Widget","taoQtiItem/qtiCreator/widgets/static/text/states/states","tpl!taoQtiItem/qtiCreator/tpl/toolbars/textBlock"],function($,Widget,states,toolbarTpl){var TextWidget=Widget.clone();return TextWidget.initCreator=function(){Widget.initCreator.call(this),this.registerStates(states)},TextWidget.buildContainer=function(){var $wrap=$("<div>",{"data-serial":this.element.serial,"data-qti-class":"_container",class:"widget-box widget-block widget-textBlock"}).append($("<div>",{"data-html-editable":!0}));this.$original.wrapInner($wrap),this.$container=this.$original.children(".widget-box")},TextWidget.createToolbar=function(){var _this=this,$tlb=$(toolbarTpl({serial:this.serial,state:"active"}));return this.$container.append($tlb),$tlb.find("[data-role=\"delete\"]").on("click.widget-box",function(e){e.stopPropagation(),_this.changeState("deleting")}),this},TextWidget}),define("taoQtiItem/qtiCreator/editor/blockAdder/blockAdder",["jquery","lodash","tpl!taoQtiItem/qtiCreator/editor/blockAdder/tpl/addColumnRow","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/helper/creatorRenderer","taoQtiItem/qtiCreator/model/helper/container","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiCreator/editor/elementSelector/selector","taoQtiItem/qtiCreator/widgets/static/text/Widget"],function($,_,adderTpl,Element,creatorRenderer,containerHelper,contentHelper,elementSelector,TextWidget){'use strict';function _insertElement(qtiClass,$placeholder){$placeholder.removeAttr("id"),"rubricBlock"===qtiClass&&($placeholder=$placeholder.parent(".col-12").parent(".grid-row")),$placeholder.addClass("widget-box"),$placeholder.attr({"data-new":!0,"data-qti-class":qtiClass});var $widget=$placeholder.parent().closest(".widget-box, .qti-item"),$editable=$placeholder.closest("[data-html-editable], .qti-itemBody"),widget=$widget.data("widget"),element=widget.element,container=Element.isA(element,"_container")?element:element.getBody();if(!element||!$editable.length)throw new Error("cannot create new element");containerHelper.createElements(container,contentHelper.getContent($editable),function(newElts){var creator=creatorRenderer.get();creator.load(function(){for(var serial in newElts){var elt=newElts[serial],$widgetElem=void 0,widgetElem=void 0,$colParent=$placeholder.parent();if(elt.setRenderer(this),Element.isA(elt,"_container")){$placeholder.replaceWith("<div class=\"text-block\"></div>");var $textBlock=$colParent.find(".text-block");$textBlock.html(elt.render()),widgetElem=TextWidget.build(elt,$textBlock,creator.getOption("textOptionForm"),{ready:function ready(){this.$container.parent(".text-block").length&&this.$container.unwrap()}}),$widgetElem=widgetElem.$container}else elt.render($placeholder),elt.postRender(),widgetElem=elt.data("widget"),$widgetElem=Element.isA(elt,"blockInteraction")?widget.$container:widget.$original;$widgetElem.trigger("contentChange.gridEdit"),$widgetElem.trigger("resize.gridEdit")}},this.getUsedClasses())})}return{create:function(item,$editorPanel,interactions){function _getItemBody(){return $editorPanel.find(".qti-itemBody")}function _initInsertion($widget){var $wrap=$("<div class=\"colrow\"></div>"),$colRow=$widget.parent(".colrow");$itemEditorPanel.trigger("beforesave.qti-creator.active"),$colRow.length||($widget.wrap("<div class=\"colrow\"></div>"),$colRow=$widget.parent(".colrow")),$colRow.after($wrap),selector=elementSelector.create($wrap,$editorPanel,interactions),$editorPanel.off(".element-selector").on("selected.element-selector",function(e,qtiClass){var $placeholder=$("<div class=\"placeholder\">");widget&&(widget.element.remove(),widget=null,$wrap.find(".widget-box").remove()),$wrap.addClass("tmp").prepend($placeholder),_insertElement(qtiClass,$placeholder),selector.reposition()}).on("done.element-selector",function(){_done($wrap)}).on("cancel.element-selector",function(){_cancel($wrap)}),$editorPanel.on("ready.qti-widget",function(){$itemEditorPanel.off("click".concat(".block-adder"," mousedown").concat(".block-adder")).on("click".concat(".block-adder"," mousedown").concat(".block-adder"),function(e){if(selector){var popup=selector.getPopup()[0];widget&&widget.element&&popup!==e.target&&!$.contains(popup,e.target)&&_done($wrap)}})}),selector.activateElement("_container"),selector.activatePanel("Text Block"),_getItemBody().addClass("edit-inserting")}function _endInsertion(){selector.destroy(),selector=null,widget=null,$editorPanel.off(".element-selector"),_getItemBody().removeClass("edit-inserting"),item.body(contentHelper.getContent(_getItemBody())),$itemEditorPanel.off(".block-adder")}function _done($wrap){$wrap.removeClass("tmp"),_appendButton(widget.$container),_.defer(function(){widget&&(widget.elemen&&widget.element.is("interaction")?widget.changeState("question"):widget.changeState("active"),_endInsertion())})}function _cancel($wrap){widget.element.remove(),$wrap.remove(),_endInsertion()}function _appendButton($widget){if(!$widget.children(".add-block-element").length&&!$widget.parent(".colrow.tmp").length){var $adder=$(adderTpl());$widget.append($adder),$adder.on("click",function(e){e.preventDefault(),e.stopPropagation();var $widgetParent=$(this).parents(".widget-box");_initInsertion($widgetParent)})}}var $itemEditorPanel=$("#item-editor-panel"),selector,widget;$editorPanel.find(".widget-block, .widget-blockInteraction").each(function(){_appendButton($(this))}),$editorPanel.on("ready.qti-widget",function(e,_widget){var qtiElement=_widget.element;(qtiElement.is("blockInteraction")||qtiElement.is("_container")||qtiElement.is("customInteraction"))&&(_appendButton(_widget.$container),selector&&_widget.$container.parent(".colrow.tmp").length&&(qtiElement.is("customInteraction")&&qtiElement.onPciReady(function(){selector.reposition()}),selector.reposition(),widget=_widget))})}}}),define("taoQtiItem/qtiCreator/editor/ckEditor/ckProtector",["jquery","i18n"],function($,__){'use strict';var ckeProtector=function(){var selector=".widget-box",observeContentChanges=function($context){var contextDomNode=$context[0],MutationObserver=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(!MutationObserver)contextDomNode.addEventListener("DOMCharacterDataModified",function(){$context.trigger("contentchange.protector")},!1);else{var observer=new MutationObserver(function(mutations){mutations.forEach(function(){$context.trigger("contentchange.protector")})});observer.observe(contextDomNode,{subtree:!0,characterData:!0})}},getSelector=function(){return selector},protect=function(context,selectorParam){selectorParam&&(selector=selectorParam),context.find(selector).each(function(){var widget=$(this),iWidth=widget.outerWidth(),iHeight=widget.outerHeight(),cover=$("<button class=\"cke-cover-up\">"),getProtectedWidgetBySerial=function(serial){return $("[data-serial=\""+serial+"\"]").each(function(){var widget=$(this);if(widget.parent().hasClass("cke-qti-wrapper"))return!1}),widget.length?widget:$()},positionCover=function(cover){var wrapper=getProtectedWidgetBySerial(cover.prop("serial")).parent(".cke-qti-wrapper"),iOffset=wrapper.offset();cover.css({left:iOffset.left,top:iOffset.top})},wrapper;return!widget.parent(".cke-qti-wrapper").length&&void(widget.find("*").each(function(){this.innerHTML||(this.innerHTML="&#8203;")}),widget.wrap($("<span class=\"cke-qti-wrapper\" />")),wrapper=widget.parent(),cover.css({width:iWidth,height:iHeight}),$("body").append(cover),wrapper.css({width:iWidth,height:iHeight}),wrapper.attr("contenteditable",!1),wrapper.prop("cover",cover),cover.prop("serial",widget.data("serial")),positionCover(cover),cover.attr("title",__("Click to display interaction widget")),cover.on("click",function(){var widget=getProtectedWidgetBySerial($(this).prop("serial"));$(document).trigger("removeprotection.ckprotector",{context:context,widget:widget})}),observeContentChanges(context),context.on("contentchange.protector",function(){positionCover(cover)}))})};return{protect:protect,unprotect:function unprotect(widget){widget.each(function(){var widget=$(this),wrapper=widget.parent(".cke-qti-wrapper");wrapper.length&&(wrapper.prop("cover").remove(),widget.unwrap())})},getSelector:getSelector}}();return ckeProtector}),define("taoQtiItem/qtiCreator/editor/ckEditor/groupToggler",["lodash","core/eventifier"],function(_,eventifier){'use strict';return function(){var _registry=[];return eventifier({register:function($trigger){var self=this,id=_.uniqueId("group-toggler-");return $trigger&&$trigger.length?($trigger.data("group-toggler-id")||($trigger.data("group-toggler-id",id).on("show.grouptoggler",function(){self.trigger("show",id)}),_registry.push({id:id,dom:$trigger})),this):(this.trigger("error","trigger does not exist"),this)}}).on("show",function(id){_.each(_registry,function(element){element.id!==id&&element.dom.trigger("showanother.grouptoggler",id)})})}}),define("tpl!taoQtiItem/qtiCreator/editor/colorPicker/tpl/popup",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{},"<div class=\"color-picker-container sidebar-popup\">\n <div class=\"sidebar-popup-title\">\n <h3 style=\"font-size:13px;margin:0\"></h3>\n <a class=\"closer\" href=\"#\"></a>\n </div>\n <div class=\"sidebar-popup-content\">\n <div class=\"color-picker\"></div>\n <input class=\"color-picker-input\" type=\"text\" value=\"#000000\">\n </div>\n</div>"})}),define("taoQtiItem/qtiCreator/editor/colorPicker/colorPicker",["jquery","lodash","i18n","taoQtiItem/qtiCreator/helper/popup","tpl!taoQtiItem/qtiCreator/editor/colorPicker/tpl/popup","lib/farbtastic/farbtastic"],function($,_,__,popup,popupTpl){'use strict';var _defaults={title:__("Color Picker"),offsetTop:-40};return{create:function($colorTrigger,config){config=_.defaults(config||{},_defaults);var $input=$colorTrigger.siblings("input"),color;config.color?(color=config.color,$input.val(color)):color=$input.val(),$colorTrigger.css("background-color",color);var $popup=$(popupTpl());$colorTrigger.data("color-picker",$popup),$("#item-editor-wrapper").append($popup),popup.init($colorTrigger,{popup:$popup}),$colorTrigger.on("open.popup",function(e,params){var $trigger=$(this),$container=$trigger.parents(".sidebar-popup"),color=$input.val(),$colorPicker=params.popup.find(".color-picker"),$colorPickerInput=params.popup.find(".color-picker-input"),title;params.popup.css({right:$(window).width()-$container.offset().left+2,top:$trigger.offset().top+config.offsetTop-$("#item-editor-wrapper").offset().top}),_.isFunction(config.title)?title=config.title.call(this):_.isString(config.title)&&(title=config.title),params.popup.find("h3").text(title),$colorPicker.farbtastic($colorPickerInput),$colorPickerInput.val(color).trigger("keyup"),config.color=color,params.popup.find(".closer").off("click").on("click",function(){params.popup.hide(),$colorPicker.off(".farbtastic")}),$colorPicker.off(".farbtastic").on("colorchange.farbtastic",function(e,color){$colorTrigger.css("background-color",color),$input.val(color).trigger("change")})}),$colorTrigger.on("close.popup",function(e,params){params.popup.find(".color-picker").off(".farbtastic")})},destroy:function($colorTrigger){$colorTrigger.off(".color-picker"),$colorTrigger.removeAttr("data-color-picker");var $popup=$colorTrigger.data("color-picker");$popup instanceof $&&$popup.remove()}}}),define("taoQtiItem/qtiCreator/model/Container",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/Container"],function(_,editable,Container){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{afterCreate:function afterCreate(){this.body("<p>Lorem ipsum dolor sit amet, consectetur adipisicing ...</p>")},beforeRemove:function beforeRemove(){_.each(this.getComposingElements(),function(element){_.isFunction(element.beforeRemove)&&element.beforeRemove()})}}),Container.extend(methods)}),define("taoQtiItem/qtiCreator/editor/containerEditor",["lodash","jquery","core/promise","taoQtiItem/qtiItem/core/Loader","taoQtiItem/qtiCreator/model/Container","taoQtiItem/qtiCreator/model/Item","taoQtiItem/qtiCreator/model/helper/event","taoQtiItem/qtiCreator/model/qtiClasses","taoQtiItem/qtiCreator/helper/commonRenderer","taoQtiItem/qtiCreator/helper/xmlRenderer","taoQtiItem/qtiItem/helper/simpleParser","taoQtiItem/qtiCreator/helper/creatorRenderer","taoQtiItem/qtiCreator/helper/xincludeRenderer","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content","lib/dompurify/purify"],function(_,$,Promise,Loader,Container,Item,event,allQtiClasses,commonRenderer,xmlRenderer,simpleParser,creatorRenderer,xincludeRenderer,content,htmlEditor,contentHelper,DOMPurify){"use strict";function parser($container){var data=simpleParser.parse($container.clone(),{ns:{math:"m"}});if(data.body)return data.body;throw new Error("invalid content for qti container")}function buildContainer($container){$container.wrapInner($("<div>",{class:"container-editor","data-html-editable":!0}))}function cleanup($container){var container=$container.data("container");return new Promise(function(resolve){container?($(document).off("."+container.serial),commonRenderer.load(["img","object","math","include","_container","printedVariable","_tooltip"],function(){var newBody=contentHelper.getContent($container.find(".container-editor"));newBody&&container.body(DOMPurify.sanitize(newBody)),$container.html(container.render(this)),resolve()}),$container.removeData("container")):resolve()})}function createFakeWidget($editableContainer,container,options){var widget={$container:$editableContainer,element:container,changeState:_.noop,getAreaBroker:function(){return options.areaBroker}};return container.data("widget",widget),widget}function buildEditor($editableContainer,container,options){$editableContainer.attr("data-html-editable-container",!0),htmlEditor.hasEditor($editableContainer)||htmlEditor.buildEditor($editableContainer,_.defaults(options||{},{shieldInnerContent:!1,passthroughInnerContent:!1,change:content.getChangeCallback(container),data:{widget:createFakeWidget($editableContainer,container,options),container:container}}))}function extractHtmlFromMarkup(markupStr,selector){var $found=$("<div>").html(markupStr).find(selector),ret=[];return $found.each(function(){ret.push($(this).html())}),ret}var _defaults={change:_.noop,markup:"",markupSelector:"",qtiMedia:!1};return event.initElementToWidgetListeners(),{create:function($container,options){var html,htmls,data,loader;options=_.defaults(options||{},_defaults),options.markup&&(html=options.markup,options.markupSelector&&(htmls=extractHtmlFromMarkup(html,options.markupSelector),html=htmls[0]||""),$container.html(html)),data=parser($container),loader=new Loader().setClassesLocation(allQtiClasses),loader.loadRequiredClasses(data,function(){var container=new Container,item,containerEditors,renderer;container.data("stateless",!0),$container.data("container",container),item=new Item().setElement(container),container.setRootElement(item),options.metadata&&_.each(options.metadata,function(value,name){item.data(name,value)}),options.related&&(containerEditors=options.related.data("container-editors")||[],containerEditors.push(container),options.related.data("container-editors",containerEditors)),this.loadContainer(container,data),renderer=creatorRenderer.get(options.resetRenderer,{},options.areaBroker),renderer.load(function(){var baseUrl=this.getOption("baseUrl");container.setRenderer(this),$container.html(container.render()),container.postRender(),_.each(container.getComposingElements(),function(element){"include"===element.qtiClass&&xincludeRenderer.render(element.data("widget"),baseUrl)}),buildContainer($container),buildEditor($container,container,{placeholder:options.placeholder||void 0,toolbar:options.toolbar||void 0,qtiMedia:options.qtiMedia,highlight:options.highlight,removePlugins:options.removePlugins||"",areaBroker:options.areaBroker,autofocus:options.autofocus||!1}),$container.off(".containereditor").on(event.getList("containereditor"+event.getNs()+event.getNsModel()).join(" "),_.throttle(function(){var editorContent=container.render(xmlRenderer.get());$container.trigger("containerchange.containereditor",[editorContent]),_.isFunction(options.change)&&options.change(editorContent)},600)),$container.trigger("editorready.containereditor")},["img","object","math","include","printedVariable","_container","_tooltip"])})},destroy:function($editableContainer){return htmlEditor.destroyEditor($editableContainer).then(function(){return $editableContainer.removeAttr("data-html-editable-container"),cleanup($editableContainer)})}}}),define("taoQtiItem/qtiCreator/editor/customInteractionRegistry",["taoQtiItem/portableElementRegistry/ciRegistry"],function(ciRegistry){"use strict";return console.warn("deprected use of \"taoQtiItem/qtiCreator/editor/customInteractionRegistry\", please use \"taoQtiItem/portableElementRegistry/ciRegistry\" now"),{get:function(id){var portableElement={};return console.warn("deprected use of \"taoQtiItem/qtiCreator/editor/customInteractionRegistry::get()\", please use \"taoQtiItem/portableElementRegistry/ciRegistry::get()\" now"),portableElement.manifest=ciRegistry.get(id),portableElement},getBaseUrl:function(id){return console.warn("deprected use of \"taoQtiItem/qtiCreator/editor/customInteractionRegistry::getBaseUrl()\", please use \"taoQtiItem/portableElementRegistry/ciRegistry::getBaseUrl()\" now"),this.get(id).manifest.baseUrl}}}),define("taoQtiItem/qtiCreator/editor/gridEditor/arrow",["jquery","lodash"],function($,_){"use strict";var _removeArrows=function($col){$col.find(".grid-edit-insert-box").remove()},_arrowFall=function($insert,callback){var interval=null;$insert.on("mouseenter",function(e){var relY=e.pageY-$(this).offset().top-parseInt($(this).find(".grid-edit-insert-triangle").outerHeight())-parseInt($(this).find(".grid-edit-insert-square").outerHeight()),$arrow=$(this).find(".grid-edit-insert-triangle, .grid-edit-insert-square"),t=0;interval=setInterval(function(){var top=9.81*.5*Math.pow(t,2)/100;$arrow.css("top",top),top>relY&&(clearInterval(interval),callback()),t++},10)}).on("mouseleave",function(){$(this).find(".grid-edit-insert-triangle, .grid-edit-insert-square").css("top",0),clearInterval(interval)})};return{create:function($col,options){options=_.extend({insertZoneWidth:20,marginWidth:0},options);var $insertRight=$("<div>",{class:"grid-edit-insert-box"}).css({top:0,width:options.insertZoneWidth,right:-(options.marginWidth+(options.insertZoneWidth-options.marginWidth)/2),height:$col.parent(".grid-row").height()-parseFloat($col.css("margin-bottom"))}).append($("<div>",{class:"grid-edit-insert-square"})).append($("<div>",{class:"grid-edit-insert-triangle"})).append($("<div>",{class:"grid-edit-insert-line"})).on("mouseenter",".grid-edit-insert-triangle, .grid-edit-insert-square",function(){$col.trigger("arrowenter.gridEdit.gridDragDrop",["right"]),_removeArrows($col)}),$insertLeft=$insertRight.clone().css({left:-(options.marginWidth+5),right:"auto"}).on("mouseenter",".grid-edit-insert-triangle, .grid-edit-insert-square",function(){$col.trigger("arrowenter.gridEdit.gridDragDrop",["left"]),_removeArrows($col)});$col.append($insertRight).append($insertLeft),_arrowFall($insertRight,function(){$col.trigger("arrowenter.gridEdit.gridDragDrop",["right"]),_removeArrows($col)}),_arrowFall($insertLeft,function(){$col.trigger("arrowenter.gridEdit.gridDragDrop",["left"]),_removeArrows($col)})}}}),define("taoQtiItem/qtiCreator/editor/targetFinder",["jquery","lodash","ui/ckeditor/dtdHandler","taoQtiItem/qtiCreator/helper/qtiElements"],function($,_,dtdHandler,qtiElements){'use strict';var _qtiHtmlEditableTypes={itemBody:".widget-textBlock > [data-html-editable], .widget-textBlock .widget-table table[data-html-editable]",prompt:".qti-prompt[data-html-editable]",choice:".qti-choice [data-html-editable]"},targetFinder=function($,_,dh){var inheritedFunctions=function(){var fns={},fn;for(fn in dh)dh.hasOwnProperty(fn)&&dh[fn]instanceof Function&&(fns[fn]=dh[fn]);return fns}();return _.extend(inheritedFunctions,{getTargetsFor:function getTargetsFor(qtiClass,context){var $targets=$(),child,$qtiContainers;context=context||document.body,context=$(context),qtiElements.is(qtiClass,"inlineInteraction")?($qtiContainers=context.find(_qtiHtmlEditableTypes.itemBody),child="object"):($qtiContainers=context.find(_.values(_qtiHtmlEditableTypes).join(",")),$qtiContainers=context.find(_qtiHtmlEditableTypes.itemBody),child="math"===qtiClass?"object":"object.audio"===qtiClass||"object.video"===qtiClass?"object":qtiClass);var parents=dh.getParentsOf(child),parentSelector=parents.join(",");return $qtiContainers.each(function(){var $qtiContainer=$(this),$widget=$qtiContainer.closest(".widget-box");$qtiContainer.is(parentSelector)&&($targets=$targets.add($qtiContainer)),$targets=$targets.add($qtiContainer.find(parentSelector).not(function(){var $closest=$(this).closest(".widget-box");return $closest.length&&$closest[0]!==$widget[0]}))}),$targets}})}($,_,dtdHandler);return targetFinder}),define("taoQtiItem/qtiCreator/editor/gridEditor/droppable",["jquery","lodash","taoQtiItem/qtiCreator/helper/gridUnits","taoQtiItem/qtiCreator/helper/qtiElements","taoQtiItem/qtiCreator/editor/gridEditor/helper","taoQtiItem/qtiCreator/editor/gridEditor/arrow","taoQtiItem/qtiCreator/editor/targetFinder"],function($,_,gridUnits,qtiElements,helper,arrow,targetFinder){"use strict";var _Mathmax2=Math.max;function _destroyDroppableInlines($el){$el.off(".gridEdit.gridDragDrop"),$el.find("span.qti-word-wrap").replaceWith(function(){return _.escape($(this).text())}),$el.find(".drop-target").removeClass("drop-target")}function _destroyDroppableBlocks($el){$el.off(".gridEdit.gridDragDrop");$el.removeClass("dropping").off(".gridEdit.gridDragDrop"),$el.find("[class^=\"col-\"], [class*=\" col-\"]").removeAttr("style"),_restoreTmpCol($el),$el.find(["#qti-block-element-placeholder",".new-col",".grid-row-new",".grid-edit-insert-box"].join(",")).remove()}function _getNewRow(){return $("<div>",{class:"grid-row grid-row-new","data-units":0})}function _getNewCol(){return $("<div>",{class:"new-col"})}function _restoreTmpCol($el){$el.find(".grid-row").each(function(){var $row=$(this),$children;$row.children(".new-col").attr("class","new-col").removeAttr("style"),$row.hasClass("grid-row-new")&&($children=$row.children(),1<$children.length&&($row.prev().append($children),$row.append($children.first()))),$row.children(":not(.new-col)").each(function(){var $col=$(this),originalClasses=$col.attr("data-original-class");originalClasses&&$col.attr("class",originalClasses).removeAttr("data-original-class")}),$row.removeAttr("data-active")})}var droppableGridEditor={createDroppableBlocks:function(qtiClass,$el,options){options=options||{};var minUnits="string"==typeof options.min?options.min:0,$colInitial=options.initialPosition instanceof $?options.initialPosition:null,ns=options.namespace?"."+options.namespace:"",data=options.data||{},$placeholder=$("<div>",{id:"qti-block-element-placeholder",class:"qti-droppable-block-hover"}),marginWidth=parseFloat($el.find("[class^=\"col-\"], [class*=\" col-\"]").last().css("margin-left")),isEmpty=0===$el.children(".grid-row").length;$el.addClass("dropping"),isEmpty?$el.append(_getNewRow().append(_getNewCol().addClass("col-12"))):$el.find(".grid-row").each(function(){var $row=$(this),cols=[],maxHeight=0,$cols=$row.children(":not(.new-col)").each(function(){$(this).before(_getNewCol().attr("data-index",$(this).index()/2)),maxHeight=_Mathmax2($(this).height(),maxHeight),cols.push({elt:$(this),units:parseInt($(this).attr("data-units"))})});$cols.last().after(_getNewCol().attr("data-index","last")),$cols.height(maxHeight),$row.data("distributed-units",gridUnits.distribute(cols,minUnits,12)),$row.before(_getNewRow().append(_getNewCol()))}).last().after(_getNewRow().append(_getNewCol()));var _appendPlaceholder=function($col){$col.length&&($placeholder.data("dropped",!0).show().parent().removeClass("col-12").parent().removeData("active"),$col.append($placeholder))},_resetPlaceholder=function(){$placeholder.parent().parent().removeData("active"),$placeholder.removeData("dropped").hide(),$el.append($placeholder)},_insertBetween=function($col,location){if("left"===location||"right"===location){_restoreTmpCol($el);var $row=$col.parent().attr("data-active",!0);$row.children(":not(.new-col)").each(function(){$(this).attr("data-original-class",$(this).attr("class"))});var distributedUnits=$row.data("distributed-units"),$newCol="left"===location?$col.prev():$col.next();if(_appendPlaceholder($newCol),12<distributedUnits.refactoredTotalUnits){var newUnit=$newCol.is(":last-child")&&distributedUnits.last?distributedUnits.last:distributedUnits.middle;$newCol.attr("class","new-col col-"+newUnit);var cumulatedUnits=0,index=$newCol.data("index"),_appendToNextRow=function($row,$newCol){$row.next().attr("data-active",!0).append($newCol)};if("last"===index)_appendToNextRow($row,$newCol);else for(var i in distributedUnits.cols){i==index&&(12<cumulatedUnits+newUnit&&_appendToNextRow($row,$newCol),cumulatedUnits+=newUnit);var col=distributedUnits.cols[i];12<cumulatedUnits+col.refactoredUnits&&_appendToNextRow($row,col.elt),col.elt.attr("class","col-"+col.refactoredUnits),cumulatedUnits+=col.refactoredUnits}}else $newCol.is(":last-child")&&distributedUnits.last?$newCol.attr("class","new-col col-"+distributedUnits.last):$newCol.attr("class","new-col col-"+distributedUnits.middle),_.each(distributedUnits.cols,function(col){col.elt.attr("class","col-"+col.refactoredUnits)});var h=_resetColsHeight($col);$placeholder.css("height","100%").parent().height(h)}},_resetColsHeight=function($col,self){var maxHeight=0;void 0===self&&(self=!0),$placeholder.css("height","auto").parent().removeAttr("style");var $cols=$col.siblings("[class^=\"col-\"]:not(.new-col), [class*=\" col-\"]:not(.new-col)").addBack();return $cols.removeAttr("style"),$cols.each(function(){maxHeight=_Mathmax2($(this).height(),maxHeight)}),$cols.height(maxHeight),self||$col.removeAttr("style"),maxHeight};if(_resetPlaceholder(),$colInitial&&$colInitial.length){var $prev=$colInitial.prevAll("[class^=\"col-\"], [class*=\" col-\"]").first(),$next=$colInitial.nextAll("[class^=\"col-\"], [class*=\" col-\"]").first();$prev.length?_insertBetween($prev,"right"):$next.length&&_insertBetween($next,"left")}$el.on("mouseover.gridEdit.gridDragDrop",function(){var $previousCol=$placeholder.parent(".new-col");_restoreTmpCol($el),_resetColsHeight($previousCol,!1);var $newCol=$el.find(".new-col:last").css("background","1px solid red");_appendPlaceholder($newCol),$newCol.addClass("col-12")}).on("mouseover.gridEdit.gridDragDrop",".grid-row",function(e){e.stopPropagation()}).on("mouseenter.gridEdit.gridDragDrop","[class^=\"col-\"]:not(.new-col), [class*=\" col-\"]:not(.new-col)",function(){var $col=$(this),$previousCol=$placeholder.parent(".new-col");_resetPlaceholder(),_restoreTmpCol($el),_resetColsHeight($previousCol,!1),_resetColsHeight($col),arrow.create($col,{marginWidth:marginWidth})}).on("arrowenter.gridEdit.gridDragDrop","[class^=\"col-\"]:not(.new-col), [class*=\" col-\"]:not(.new-col)",function(e,position){_insertBetween($(this),position)}).on("mousemove.gridEdit.gridDragDrop","[class^=\"col-\"]:not(.new-col), [class*=\" col-\"]:not(.new-col)",function(e){var $col=$(this),h=$col.height(),relY=e.pageY-$col.offset().top,$newRow=relY<h/2?$col.parent().prev():$col.parent().next();if(!$newRow.find("#qti-block-element-placeholder").length){var $newCol=$newRow.attr("data-active",!0).children(".new-col").addClass("col-12");$newCol.length?_appendPlaceholder($newCol):console.log("insert form col failure ",$col,$newRow)}}).on("mouseleave.gridEdit.gridDragDrop","[class^=\"col-\"], [class*=\" col-\"]",function(){$(this).find(".grid-edit-insert-box").remove()}).on("mouseleave.gridEdit.gridDragDrop",function(e){e.stopPropagation(),$placeholder.hide(),_resetPlaceholder(),_restoreTmpCol($el)}),$el.one("dragoverstop.gridEdit",function(){var $selectedCol,dropped;$el.off(".gridEdit.gridDragDrop"),$selectedCol=$placeholder.parent(".new-col"),dropped=!!$selectedCol.length,dropped&&($placeholder.removeAttr("id").removeClass("qti-droppable-block-hover"),$selectedCol.data("qti-class",qtiClass).removeClass("new-col").removeAttr("data-index"),helper.setUnitsFromClass($selectedCol),$selectedCol.parent(".grid-row-new").removeClass("grid-row-new"),$el.find(".grid-row[data-active=true]").each(function(){var $row=$(this);$row.removeClass("grid-row-new"),$row.children(":not(.new-col)").removeAttr("data-original-class").each(function(){helper.setUnitsFromClass($(this))})})),_destroyDroppableBlocks($el),dropped&&$placeholder.data("dropped")&&$el.trigger("dropped.gridEdit"+ns,[qtiClass,$placeholder,data])})}},_pulseTimer=null,_pulse=function($el){_pulseTimer&&clearInterval(_pulseTimer),setInterval(function(){$el.animate({opacity:.1},500,function(){$el.animate({opacity:.9},500)})},1000)};return droppableGridEditor.createDroppableInlines=function(qtiClass,$el,options){var ns=options.namespace?"."+options.namespace:"",data=options.data||{},$targets=targetFinder.getTargetsFor(qtiClass,$el),dropped=!1,_resetPlaceholder=function(){$placeholder.detach(),dropped=!1},_showPlaceholder=function(){return dropped=!0,$placeholder},$placeholder;$targets.addClass("drop-target"),$targets.contents().each(function(){3!==this.nodeType||this.nodeValue.match(/^\s+$/)||$(this).replaceWith($.map(this.nodeValue.split(/(\S+)/),function(w){return w.match(/^\s*$/)?document.createTextNode(w):$("<span>",{text:w,class:"qti-word-wrap"}).get()}))}),$placeholder=$("<span>",{id:"qti-inline-element-placeholder","data-inline":!0}),$placeholder.append($("<span>",{class:"cursor-h"})).append($("<span>",{class:"cursor-v"})),_pulse($placeholder),_resetPlaceholder($el),$el.on("mousemove.gridEdit.gridDragDrop","span.qti-word-wrap",function(e){var w=$(this).width(),parentOffset=$(this).offset(),relX=e.pageX-parentOffset.left;$placeholder,relX<w/2?$(this).before(_showPlaceholder()):$(this).after(_showPlaceholder())}).on("mouseover.gridEdit.gridDragDrop",function(e){var $target;e.stopPropagation(),$target=$(e.target),$target.hasClass("drop-target")&&!$target.find($placeholder).length?$target.append(_showPlaceholder()):$target[0]!==$placeholder[0]&&!$target.hasClass("qti-word-wrap")&&!$target.children(".qti-word-wrap").length&&_resetPlaceholder($el)}),$el.one("dragoverstop.gridEdit",function(){dropped&&$placeholder.removeAttr("id").removeAttr("class"),_destroyDroppableInlines($el),dropped?$el.trigger("dropped.gridEdit"+ns,[qtiClass,$placeholder,data]):($placeholder.remove(),$placeholder=null)})},droppableGridEditor.destroyDroppables=function($el){_destroyDroppableInlines($el),_destroyDroppableBlocks($el)},droppableGridEditor}),define("taoQtiItem/qtiCreator/editor/gridEditor/draggable",["jquery","lodash","taoQtiItem/qtiCreator/helper/qtiElements","taoQtiItem/qtiCreator/editor/gridEditor/droppable","taoQtiItem/lib/jqueryui_dragdrop"],function($,_,QtiElements,droppable){"use strict";var _insertableDefaultsOptions={helper:function helper(){return $(this).clone()}},_createInsertable=function($el,$to,opts){var options=_.defaults(opts,_insertableDefaultsOptions);createDraggable($el,$to,{helper:options.helper,namespace:"insertable"})},createDraggable=function($el,$to,opts){var options=_.defaults(opts,{distance:1,helper:"original"});$el.draggable({distance:parseInt(options.distance),helper:options.helper,appendTo:$(document.body),opacity:1,scroll:!1,cursor:"crosshair",cursorAt:{left:-5,bottom:-5},create:function create(){$(this).addClass("grid-draggable")},start:function start(e,ui){var qtiClass=$(this).data("qti-class");if($to.trigger("beforedragoverstart.gridEdit"),"function"==typeof options.start&&options.start.call(this,e,ui),$(this).removeClass("grid-draggable-active"),QtiElements.isInline(qtiClass))droppable.createDroppableInlines(qtiClass,$to,options);else if(QtiElements.isBlock(qtiClass))droppable.createDroppableBlocks(qtiClass,$to,options);else throw"undefined qti class";$to.trigger("dragoverstart.gridEdit")},stop:function stop(e,ui){$("body").css("cursor","auto"),ui.helper.remove(),"function"==typeof options.stop&&options.stop.call(this,e,ui),$to.trigger("dragoverstop.gridEdit")}}),$el.on("mousedown.gridDraggable.gridEdit",function(){$(this).addClass("grid-draggable-active")}).on("mouseup.gridDraggable.gridEdit",function(){$(this).removeClass("grid-draggable-active")})},_createMovable=function($el,$to){var $parent=$el.parent("[class^=\"col-\"], [class*=\" col-\"]");createDraggable($el,$to,{distance:5,initialPosition:$el.parent(),namespace:"movable",start:function start(){$el.hide(),$parent.data({"initial-position":!0,"initial-class":$parent.attr("class")}).attr("class","new-col")},helper:function helper(){return $(this).clone().addClass("grid-draggable-helper").css({height:$(this).height(),width:$(this).width()})},stop:function stop(){$el.data("grid-element-dropped")||$parent.attr("class",$parent.data("initial-class")),$el.data("grid-element-dropped",!1),$el.show()},data:{widget:$el.data("widget")}})};return{createInsertable:function createInsertable($el,$to,opts){_createInsertable($el,$to,opts)},createMovable:function createMovable($el,$to,opts){_createMovable($el,$to,opts)},destroy:function($el){$el.draggable("destroy"),$el.removeClass("grid-draggable"),$el.off(".gridDraggable")}}}),define("taoQtiItem/qtiCreator/editor/infoControlRegistry",["taoQtiItem/portableElementRegistry/icRegistry"],function(icRegistry){"use strict";return console.warn("deprected use of \"taoQtiItem/qtiCreator/editor/infoControlRegistry\", please use \"taoQtiItem/portableElementRegistry/icRegistry\" now"),{get:function(id){var portableElement={manifest:icRegistry.get(id)};return portableElement}}}),define("taoQtiItem/qtiCreator/editor/jquery.gridEditor",["jquery","taoQtiItem/qtiCreator/editor/gridEditor/helper","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiCreator/editor/gridEditor/draggable","taoQtiItem/qtiCreator/editor/gridEditor/resizable"],function($,helper,contentHelper,draggable,_resizable){'use strict';function isCreated($elt){return"object"===_typeof($elt.data("qti-grid-options"))}function create($elt,options){$elt.data("qti-grid-options",options),$elt.find(".grid-row").each(function(){$(this).children("[class*=\" col-\"], [class^=\"col-\"]").each(function(){helper.setUnitsFromClass($(this))})})}function _destroy2($elt){contentHelper.destroyGridWidgets($elt)}function _getContent($el){return contentHelper.getContent($el)}$.fn.gridEditor=function(options){var opts={},method="",args=[],ret=void 0;return"object"===_typeof(options)?opts=$.extend({},$.fn.gridEditor.defaults,options):void 0===options?opts=$.extend({},$.fn.gridEditor.defaults):"string"==typeof options&&"function"==typeof methods[options]&&(method=options,args=Array.prototype.slice.call(arguments,1)),this.each(function(){var $this=$(this);method?isCreated($this)?ret=methods[method].apply($(this),args):$.error("call of method of gridEditor while it has not been initialized"):!isCreated($this)&&"object"===_typeof(opts)&&create($this,opts)}),void 0===ret?this:ret},$.fn.gridEditor.defaults={elementClass:"itemBody"};var methods={addInsertables:function addInsertables($elts,options){var $grid=$(this);$elts.each(function(){draggable.createInsertable($(this),$grid,options)})},createMovables:function createMovables($elts){var $grid=$(this);$elts.each(function(){draggable.createMovable($(this),$grid)})},destroy:function destroy(){_destroy2($(this))},getContent:function getContent(){return _getContent($(this))},setContent:function(_setContent){function setContent(){return _setContent.apply(this,arguments)}return setContent.toString=function(){return _setContent.toString()},setContent}(function(content){content&&setContent($(this),content)}),resizable:function resizable(){_resizable.create($(this))}}}),define("taoQtiItem/qtiCreator/editor/MathEditor",["lodash","jquery","mathJax","ui/feedback"],function(_,$,MathJax,feedback){"use strict";var MathEditor=function(config){if(config=config||{},this.setMathML(config.mathML||""),this.tex=config.tex||"",this.display=config.display||"inline",this.processing=!1,this.$target=config.target||$(),config.buffer&&config.buffer instanceof $&&config.buffer.length)this.$buffer=config.buffer;else throw"missing required element in config \"buffer\""};MathEditor.prototype.setMathML=function(mathMLstr){return mathMLstr=_stripMathTags(mathMLstr),mathMLstr=_stripComments(mathMLstr),this.mathML=mathMLstr,this},MathEditor.prototype.setTex=function(texStr){return this.tex=texStr,this};var _processArguments=function(mathEditor,args){var ret={target:null,callback:null};if(_.each(args,function(arg){_.isFunction(arg)?ret.callback=arg:arg instanceof $&&(ret.target=arg)}),!ret.target)if(mathEditor.$target)ret.target=mathEditor.$target;else throw"no target defined for rendering";return ret};MathEditor.prototype.renderFromMathML=function(){var args=_processArguments(this,arguments);if("undefined"!=typeof MathJax){if(this.processing)return;var jaxQueue=MathJax.Hub.queue,mathStr=_wrapMathTags(this.mathML,"block"===this.display);this.$buffer.html(mathStr);var _this=this;jaxQueue.Push(["Typeset",MathJax.Hub,this.$buffer[0]],function(){var $script=_this.$buffer.find("script");_this.processing=!1,args.target.html(_this.$buffer.html()),$script.length&&(_this.mathML=_stripMathTags($script.html())),_this.$buffer.empty()}),args.callback&&jaxQueue.Push(args.callback)}},MathEditor.prototype.renderFromTex=function(){var args=_processArguments(this,arguments),_this=this,jaxQueue=MathJax.Hub.queue;"undefined"!=typeof MathJax&&("block"===this.display?_this.$buffer.text("\\[\\displaystyle{"+_this.tex+"}\\]"):_this.$buffer.text("\\(\\displaystyle{"+_this.tex+"}\\)"),jaxQueue.Push(["Typeset",MathJax.Hub,_this.$buffer[0]],function(){var texJax;try{args.target.html(_this.$buffer.html()),texJax=_getJaxByElement(_this.$buffer),_this.$buffer.empty(),"undefined"!=typeof texJax&&_this.texToMathML(texJax,function(mathML){_this.setMathML(_stripMathTags(mathML))})}catch(err){feedback().error("Mathjax error: "+err.message)}}),args.callback&&jaxQueue.Push(args.callback))};var _stripMathTags=function(mathMLstr){return mathMLstr=mathMLstr.replace(/<(\/)?math[^>]*>/g,""),mathMLstr=mathMLstr.replace(/^\s*[\r\n]/gm,""),mathMLstr=mathMLstr.replace(/\s*[\r\n]$/gm,""),mathMLstr},_stripComments=function(mathMLstr){return mathMLstr=mathMLstr.replace(/<!--.*?-->/g,""),mathMLstr=mathMLstr.replace(/&lt;!--.*?--&gt;/g,""),mathMLstr},_getJaxByElement=function($element){if($element instanceof $&&$element.length){var $script=$element.find("script");if($script.length&&$script[0].MathJax&&$script[0].MathJax.elementJax)return $script[0].MathJax.elementJax}},_wrapMathTags=function(mathMLstr,displayBlock){if(!mathMLstr.match(/<math[^>]*>/)){var display=displayBlock?" display=\"block\"":"";mathMLstr="<math"+display+">"+mathMLstr}return mathMLstr.match(/<\/math[^>]*>/)||(mathMLstr+="</math>"),mathMLstr};return MathEditor.prototype.texToMathML=function(texJax,callback){var _this=this,mathML="";try{mathML=_stripComments(texJax.root.toMathML(""))}catch(err){if(!err.restart)throw err;return MathJax.Callback.After(function(){_this.texToMathML(texJax,callback)},err.restart)}MathJax.Callback(callback)(mathML)},MathEditor}),define("taoQtiItem/lib/mathquill/mathquill",["jquery"],function(jQuery){var _Mathround5=Math.round;function noop(){}function variadic(fn){var numFixedArgs=fn.length-1;return function(){var args=__slice.call(arguments,0,numFixedArgs),varArg=__slice.call(arguments,numFixedArgs);return fn.apply(this,args.concat([varArg]))}}function iterator(generator){return variadic(function(fn,args){"function"!=typeof fn&&(fn=send(fn));var yield_=function(obj){return fn.apply(obj,[obj].concat(args))};return generator.call(this,yield_)})}function bind(cons){var args=__slice.call(arguments,1);return function(){return cons.apply(this,args)}}function pray(message,cond){if(!cond)throw new Error("prayer failed: "+message)}function prayDirection(dir){pray("a direction was passed",dir===-1||dir===1)}function prayWellFormed(parent,leftward,rightward){pray("a parent is always present",parent),pray("leftward is properly set up",function(){return leftward?leftward[1]===rightward&&leftward.parent===parent:parent.ends[-1]===rightward}()),pray("rightward is properly set up",function(){return rightward?rightward[-1]===leftward&&rightward.parent===parent:parent.ends[1]===leftward}())}function insistOnInterVer(){window.console&&console.warn("You are using the MathQuill API without specifying an interface version, which will fail in v1.0.0. You can fix this easily by doing this before doing anything else:\n\n MathQuill = MathQuill.getInterface(1);\n // now MathQuill.MathField() works like it used to\n\nSee also the \"`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide\" at\n https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide")}function MathQuill(el){return insistOnInterVer(),MQ1(el)}function getInterface(v){function MQ(el){if(!el||!el.nodeType)return null;var blockId=$(el).children(".mq-root-block").attr("mathquill-block-id"),ctrlr=blockId&&Node.byId[blockId].controller;return ctrlr?APIClasses[ctrlr.KIND_OF_MQ](ctrlr):null}function config(currentOptions,newOptions){for(var name in newOptions&&newOptions.handlers&&(newOptions.handlers={fns:newOptions.handlers,APIClasses:APIClasses}),newOptions)if(newOptions.hasOwnProperty(name)){var value=newOptions[name],processor=optionProcessors[name];currentOptions[name]=processor?processor(value):value}}if(!(MIN<=v&&v<=MAX))throw"Only interface versions between "+MIN+" and "+MAX+" supported. You specified: "+v;var APIClasses={};MQ.L=-1,MQ.R=1,MQ.config=function(opts){return config(Options.p,opts),this},MQ.registerEmbed=function(name,options){if(!/^[a-z][a-z0-9]*$/i.test(name))throw"Embed name must start with letter and be only letters and digits";EMBEDS[name]=options};var AbstractMathQuill=APIClasses.AbstractMathQuill=P(Progenote,function(_){_.init=function(ctrlr){this.__controller=ctrlr,this.__options=ctrlr.options,this.id=ctrlr.id,this.data=ctrlr.data},_.__mathquillify=function(classNames){var ctrlr=this.__controller,root=ctrlr.root,el=ctrlr.container;ctrlr.createTextarea();var contents=el.addClass(classNames).contents().detach();root.jQ=$("<span class=\"mq-root-block\"/>").attr("mathquill-block-id",root.id).appendTo(el),this.latex(contents.text()),this.revert=function(){return el.empty().unbind(".mathquill").removeClass("mq-editable-field mq-math-mode mq-text-mode").append(contents)}},_.config=function(opts){return config(this.__options,opts),this},_.el=function(){return this.__controller.container[0]},_.text=function(){return this.__controller.exportText()},_.latex=function(latex){return 0<arguments.length?(this.__controller.renderLatexMath(latex),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()},_.html=function(){return this.__controller.root.jQ.html().replace(/ mathquill-(?:command|block)-id="?\d+"?/g,"").replace(/<span class="?mq-cursor( mq-blink)?"?>.?<\/span>/i,"").replace(/ mq-hasCursor|mq-hasCursor ?/,"").replace(/ class=(""|(?= |>))/g,"")},_.reflow=function(){return this.__controller.root.postOrder("reflow"),this}});for(var kind in MQ.prototype=AbstractMathQuill.prototype,APIClasses.EditableField=P(AbstractMathQuill,function(_,super_){_.__mathquillify=function(){return super_.__mathquillify.apply(this,arguments),this.__controller.editable=!0,this.__controller.delegateMouseEvents(),this.__controller.editablesTextareaEvents(),this},_.focus=function(){return this.__controller.textarea.focus(),this},_.blur=function(){return this.__controller.textarea.blur(),this},_.write=function(latex){return this.__controller.writeLatex(latex),this.__controller.scrollHoriz(),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this},_.cmd=function(cmd){var ctrlr=this.__controller.notify(),cursor=ctrlr.cursor;if(/^\\[a-z]+$/i.test(cmd)){cmd=cmd.slice(1);var klass=LatexCmds[cmd];if(klass)cmd=klass(cmd),cursor.selection&&cmd.replaces(cursor.replaceSelection()),cmd.createLeftOf(cursor.show()),this.__controller.scrollHoriz();else;}else cursor.parent.write(cursor,cmd);return ctrlr.blurred&&cursor.hide().parent.blur(),this},_.select=function(){var ctrlr=this.__controller;for(ctrlr.notify("move").cursor.insAtRightEnd(ctrlr.root);ctrlr.cursor[-1];)ctrlr.selectLeft();return this},_.clearSelection=function(){return this.__controller.cursor.clearSelection(),this},_.moveToDirEnd=function(dir){return this.__controller.notify("move").cursor.insAtDirEnd(dir,this.__controller.root),this},_.moveToLeftEnd=function(){return this.moveToDirEnd(-1)},_.moveToRightEnd=function(){return this.moveToDirEnd(1)},_.keystroke=function(keys){for(var keys=keys.replace(/^\s+|\s+$/g,"").split(/\s+/),i=0;i<keys.length;i+=1)this.__controller.keystroke(keys[i],{preventDefault:noop});return this},_.typedText=function(text){for(var i=0;i<text.length;i+=1)this.__controller.typedText(text.charAt(i));return this},_.dropEmbedded=function(pageX,pageY,options){var clientX=pageX-$(window).scrollLeft(),clientY=pageY-$(window).scrollTop(),el=document.elementFromPoint(clientX,clientY);this.__controller.seek($(el),pageX,pageY);var cmd=Embed().setOptions(options);cmd.createLeftOf(this.__controller.cursor)}}),MQ.EditableField=function(){throw"wtf don't call me, I'm 'abstract'"},MQ.EditableField.prototype=APIClasses.EditableField.prototype,API)(function(kind,defAPIClass){var APIClass=APIClasses[kind]=defAPIClass(APIClasses);MQ[kind]=function(el,opts){var mq=MQ(el);if(mq instanceof APIClass||!el||!el.nodeType)return mq;var ctrlr=Controller(APIClass.RootBlock(),$(el),Options());return ctrlr.KIND_OF_MQ=kind,APIClass(ctrlr).__mathquillify(opts,v)},MQ[kind].prototype=APIClass.prototype})(kind,API[kind]);return MQ}function RootBlockMixin(_){for(var names=["moveOutOf","deleteOutOf","selectOutOf","upOutOf","downOutOf"],i=0;i<names.length;i+=1)(function(name){_[name]=function(dir){this.controller.handle(name,dir)}})(names[i]);_.reflow=function(){this.controller.handle("reflow"),this.controller.handle("edited"),this.controller.handle("edit")}}function makeTextBlock(latex,tagName,attrs){return P(TextBlock,{ctrlSeq:latex,htmlTemplate:"<"+tagName+" "+attrs+">&0</"+tagName+">"})}function insLeftOfMeUnlessAtEnd(cursor){var cmd=this.parent,ancestorCmd=cursor;do{if(ancestorCmd[1])return cursor.insLeftOf(cmd);ancestorCmd=ancestorCmd.parent.parent}while(ancestorCmd!==cmd);cursor.insRightOf(cmd)}function DelimsMixin(_,super_){_.jQadd=function(){super_.jQadd.apply(this,arguments),this.delimjQs=this.jQ.children(":first").add(this.jQ.children(":last")),this.contentjQ=this.jQ.children(":eq(1)")},_.reflow=function(){var height=this.contentjQ.outerHeight()/parseFloat(this.contentjQ.css("fontSize"));scale(this.delimjQs,min(1+.2*(height-1),1.2),1.2*height)}}function bindCharBracketPair(open,ctrlSeq){var ctrlSeq=ctrlSeq||open,close=OPP_BRACKS[open],end=OPP_BRACKS[ctrlSeq];CharCmds[open]=bind(Bracket,-1,open,close,ctrlSeq,end),CharCmds[close]=bind(Bracket,1,open,close,ctrlSeq,end)}var min=Math.min,max=Math.max,__slice=[].slice,send=variadic(function(method,args){return variadic(function(obj,moreArgs){if(method in obj)return obj[method].apply(obj,args.concat(moreArgs))})}),P=function(prototype,ownProperty){function isObject(o){return"object"===_typeof(o)}function isFunction(f){return"function"==typeof f}function SuperclassBare(){}return function P(_superclass,definition){function C(){var self=new Bare;return isFunction(self.init)&&self.init.apply(self,arguments),self}function Bare(){}void 0===definition&&(definition=_superclass,_superclass=Object),C.Bare=Bare;var _super=SuperclassBare[prototype]=_superclass[prototype],proto=Bare[prototype]=C[prototype]=C.p=new SuperclassBare,extensions;return proto.constructor=C,C.mixin=function(def){return Bare[prototype]=C[prototype]=P(C,def)[prototype],C},(C.open=function(def){if(extensions={},isFunction(def)?extensions=def.call(C,proto,_super,C,_superclass):isObject(def)&&(extensions=def),isObject(extensions))for(var ext in extensions)ownProperty.call(extensions,ext)&&(proto[ext]=extensions[ext]);return isFunction(proto.init)||(proto.init=_superclass),C})(definition)}}("prototype",{}.hasOwnProperty),L=-1,R=1,$=P(jQuery,function(_){_.insDirOf=function(dir,el){return dir===L?this.insertBefore(el.first()):this.insertAfter(el.last())},_.insAtDirEnd=function(dir,el){return dir===L?this.prependTo(el):this.appendTo(el)}}),Point=P(function(_){_.parent=0,_[L]=0,_[R]=0,_.init=function(parent,leftward,rightward){this.parent=parent,this[L]=leftward,this[R]=rightward},this.copy=function(pt){return Point(pt.parent,pt[L],pt[R])}}),Node=P(function(_){function uniqueNodeId(){return id+=1}_[L]=0,_[R]=0,_.parent=0;var id=0;this.byId={},_.init=function(){this.id=uniqueNodeId(),Node.byId[this.id]=this,this.ends={},this.ends[L]=0,this.ends[R]=0},_.dispose=function(){delete Node.byId[this.id]},_.toString=function(){return"{{ MathQuill Node #"+this.id+" }}"},_.jQ=$(),_.jQadd=function(jQ){return this.jQ=this.jQ.add(jQ)},_.jQize=function(jQ){function jQadd(el){if(el.getAttribute){var cmdId=el.getAttribute("mathquill-command-id"),blockId=el.getAttribute("mathquill-block-id");cmdId&&Node.byId[cmdId].jQadd(el),blockId&&Node.byId[blockId].jQadd(el)}for(el=el.firstChild;el;el=el.nextSibling)jQadd(el)}for(var jQ=$(jQ||this.html()),i=0;i<jQ.length;i+=1)jQadd(jQ[i]);return jQ},_.createDir=function(dir,cursor){prayDirection(dir);var node=this;return node.jQize(),node.jQ.insDirOf(dir,cursor.jQ),cursor[dir]=node.adopt(cursor.parent,cursor[L],cursor[R]),node},_.createLeftOf=function(el){return this.createDir(L,el)},_.selectChildren=function(leftEnd,rightEnd){return Selection(leftEnd,rightEnd)},_.bubble=iterator(function(yield_){for(var ancestor=this,result;ancestor&&(result=yield_(ancestor),!1!==result);ancestor=ancestor.parent);return this}),_.postOrder=iterator(function(yield_){return function recurse(descendant){descendant.eachChild(recurse),yield_(descendant)}(this),this}),_.isEmpty=function(){return 0===this.ends[L]&&0===this.ends[R]},_.children=function(){return Fragment(this.ends[L],this.ends[R])},_.eachChild=function(){var children=this.children();return children.each.apply(children,arguments),this},_.foldChildren=function(fold,fn){return this.children().fold(fold,fn)},_.withDirAdopt=function(dir,parent,withDir,oppDir){return Fragment(this,this).withDirAdopt(dir,parent,withDir,oppDir),this},_.adopt=function(parent,leftward,rightward){return Fragment(this,this).adopt(parent,leftward,rightward),this},_.disown=function(){return Fragment(this,this).disown(),this},_.remove=function(){return this.jQ.remove(),this.postOrder("dispose"),this.disown()}}),Fragment=P(function(_){_.init=function(withDir,oppDir,dir){if(void 0===dir&&(dir=L),prayDirection(dir),pray("no half-empty fragments",!withDir==!oppDir),this.ends={},!!withDir){pray("withDir is passed to Fragment",withDir instanceof Node),pray("oppDir is passed to Fragment",oppDir instanceof Node),pray("withDir and oppDir have the same parent",withDir.parent===oppDir.parent),this.ends[dir]=withDir,this.ends[-dir]=oppDir;var accum=this.fold([],function(accum,el){return accum.push.apply(accum,el.jQ.get()),accum});this.jQ=this.jQ.add(accum)}},_.jQ=$(),_.withDirAdopt=function(dir,parent,withDir,oppDir){return dir===L?this.adopt(parent,withDir,oppDir):this.adopt(parent,oppDir,withDir)},_.adopt=function(parent,leftward,rightward){prayWellFormed(parent,leftward,rightward);var self=this;self.disowned=!1;var leftEnd=self.ends[L];if(!leftEnd)return this;var rightEnd=self.ends[R];return leftward||(parent.ends[L]=leftEnd),rightward?rightward[L]=rightEnd:parent.ends[R]=rightEnd,self.ends[R][R]=rightward,self.each(function(el){el[L]=leftward,el.parent=parent,leftward&&(leftward[R]=el),leftward=el}),self},_.disown=function(){var self=this,leftEnd=self.ends[L];if(!leftEnd||self.disowned)return self;self.disowned=!0;var rightEnd=self.ends[R],parent=leftEnd.parent;return prayWellFormed(parent,leftEnd[L],leftEnd),prayWellFormed(parent,rightEnd,rightEnd[R]),leftEnd[L]?leftEnd[L][R]=rightEnd[R]:parent.ends[L]=rightEnd[R],rightEnd[R]?rightEnd[R][L]=leftEnd[L]:parent.ends[R]=leftEnd[L],self},_.remove=function(){return this.jQ.remove(),this.each("postOrder","dispose"),this.disown()},_.each=iterator(function(yield_){var self=this,el=self.ends[L];if(!el)return self;for(;el!==self.ends[R][R];el=el[R]){var result=yield_(el);if(!1===result)break}return self}),_.fold=function(fold,fn){return this.each(function(el){fold=fn.call(this,fold,el)}),fold}}),LatexCmds={},CharCmds={},Cursor=P(Point,function(_){_.init=function(initParent,options){this.parent=initParent,this.options=options;var jQ=this.jQ=this._jQ=$("<span class=\"mq-cursor\">&#8203;</span>");this.blink=function(){jQ.toggleClass("mq-blink")},this.upDownCache={}},_.show=function(){return this.jQ=this._jQ.removeClass("mq-blink"),"intervalId"in this?clearInterval(this.intervalId):(this[R]?this.selection&&this.selection.ends[L][L]===this[L]?this.jQ.insertBefore(this.selection.jQ):this.jQ.insertBefore(this[R].jQ.first()):this.jQ.appendTo(this.parent.jQ),this.parent.focus()),this.intervalId=setInterval(this.blink,500),this},_.hide=function(){return"intervalId"in this&&clearInterval(this.intervalId),delete this.intervalId,this.jQ.detach(),this.jQ=$(),this},_.withDirInsertAt=function(dir,parent,withDir,oppDir){var oldParent=this.parent;this.parent=parent,this[dir]=withDir,this[-dir]=oppDir,oldParent!==parent&&oldParent.blur&&oldParent.blur()},_.insDirOf=function(dir,el){return prayDirection(dir),this.jQ.insDirOf(dir,el.jQ),this.withDirInsertAt(dir,el.parent,el[dir],el),this.parent.jQ.addClass("mq-hasCursor"),this},_.insLeftOf=function(el){return this.insDirOf(L,el)},_.insRightOf=function(el){return this.insDirOf(R,el)},_.insAtDirEnd=function(dir,el){return prayDirection(dir),this.jQ.insAtDirEnd(dir,el.jQ),this.withDirInsertAt(dir,el,0,el.ends[dir]),el.focus(),this},_.insAtLeftEnd=function(el){return this.insAtDirEnd(L,el)},_.insAtRightEnd=function(el){return this.insAtDirEnd(R,el)},_.jumpUpDown=function(from,to){var self=this;self.upDownCache[from.id]=Point.copy(self);var cached=self.upDownCache[to.id];if(cached)cached[R]?self.insLeftOf(cached[R]):self.insAtRightEnd(cached.parent);else{var pageX=self.offset().left;to.seek(pageX,self)}},_.offset=function(){var self=this,offset=self.jQ.removeClass("mq-cursor").offset();return self.jQ.addClass("mq-cursor"),offset},_.unwrapGramp=function(){var gramp=this.parent.parent,greatgramp=gramp.parent,rightward=gramp[R],cursor=this,leftward=gramp[L];if(gramp.disown().eachChild(function(uncle){uncle.isEmpty()||(uncle.children().adopt(greatgramp,leftward,rightward).each(function(cousin){cousin.jQ.insertBefore(gramp.jQ.first())}),leftward=uncle.ends[R])}),!this[R])if(this[L])this[R]=this[L][R];else for(;!this[R];)if(this.parent=this.parent[R],this.parent)this[R]=this.parent.ends[L];else{this[R]=gramp[R],this.parent=greatgramp;break}this[R]?this.insLeftOf(this[R]):this.insAtRightEnd(greatgramp),gramp.jQ.remove(),gramp[L].siblingDeleted&&gramp[L].siblingDeleted(cursor.options,R),gramp[R].siblingDeleted&&gramp[R].siblingDeleted(cursor.options,L)},_.startSelection=function(){for(var anticursor=this.anticursor=Point.copy(this),ancestors=anticursor.ancestors={},ancestor=anticursor;ancestor.parent;ancestor=ancestor.parent)ancestors[ancestor.parent.id]=ancestor},_.endSelection=function(){delete this.anticursor},_.select=function(){var anticursor=this.anticursor;if(this[L]===anticursor[L]&&this.parent===anticursor.parent)return!1;for(var ancestor=this;ancestor.parent;ancestor=ancestor.parent)if(ancestor.parent.id in anticursor.ancestors){var lca=ancestor.parent;break}pray("cursor and anticursor in the same tree",lca);var antiAncestor=anticursor.ancestors[lca.id],dir=R,leftEnd,rightEnd;if(ancestor[L]!==antiAncestor)for(var rightward=ancestor;rightward;rightward=rightward[R])if(rightward[R]===antiAncestor[R]){dir=L,leftEnd=ancestor,rightEnd=antiAncestor;break}return dir===R&&(leftEnd=antiAncestor,rightEnd=ancestor),leftEnd instanceof Point&&(leftEnd=leftEnd[R]),rightEnd instanceof Point&&(rightEnd=rightEnd[L]),this.hide().selection=lca.selectChildren(leftEnd,rightEnd),this.insDirOf(dir,this.selection.ends[dir]),this.selectionChanged(),!0},_.clearSelection=function(){return this.selection&&(this.selection.clear(),delete this.selection,this.selectionChanged()),this},_.deleteSelection=function(){this.selection&&(this[L]=this.selection.ends[L][L],this[R]=this.selection.ends[R][R],this.selection.remove(),this.selectionChanged(),delete this.selection)},_.replaceSelection=function(){var seln=this.selection;return seln&&(this[L]=seln.ends[L][L],this[R]=seln.ends[R][R],delete this.selection),seln}}),Selection=P(Fragment,function(_,super_){_.init=function(){super_.init.apply(this,arguments),this.jQ=this.jQ.wrapAll("<span class=\"mq-selection\"></span>").parent()},_.adopt=function(){return this.jQ.replaceWith(this.jQ=this.jQ.children()),super_.adopt.apply(this,arguments)},_.clear=function(){return this.jQ.replaceWith(this.jQ[0].childNodes),this},_.join=function(methodName){return this.fold("",function(fold,child){return fold+child[methodName]()})}}),Controller=P(function(_){_.init=function(root,container,options){this.id=root.id,this.data={},this.root=root,this.container=container,this.options=options,root.controller=this,this.cursor=root.cursor=Cursor(root,options)},_.handle=function(name,dir){var handlers=this.options.handlers;if(handlers&&handlers.fns[name]){var mq=handlers.APIClasses[this.KIND_OF_MQ](this);dir===L||dir===R?handlers.fns[name](dir,mq):handlers.fns[name](mq)}};var notifyees=[];this.onNotify=function(f){notifyees.push(f)},_.notify=function(){for(var i=0;i<notifyees.length;i+=1)notifyees[i].apply(this.cursor,arguments);return this}}),API={},Options=P(),optionProcessors={},Progenote=P(),EMBEDS={};MathQuill.prototype=Progenote.p,MathQuill.interfaceVersion=function(v){if(1!==v)throw"Only interface version 1 supported. You specified: "+v;return insistOnInterVer=function(){window.console&&console.warn("You called MathQuill.interfaceVersion(1); to specify the interface version, which will fail in v1.0.0. You can fix this easily by doing this before doing anything else:\n\n MathQuill = MathQuill.getInterface(1);\n // now MathQuill.MathField() works like it used to\n\nSee also the \"`dev` branch (2014\u20132015) \u2192 v0.10.0 Migration Guide\" at\n https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide")},insistOnInterVer(),MathQuill},MathQuill.getInterface=getInterface;var MIN=getInterface.MIN=1,MAX=getInterface.MAX=2;MathQuill.noConflict=function(){return window.MathQuill=origMathQuill,MathQuill};var origMathQuill=window.MathQuill;window.MathQuill=MathQuill;var Parser=P(function(_,super_,Parser){function parseError(stream,message){throw stream=stream?"'"+stream+"'":"EOF","Parse Error: "+message+" at "+stream}_.init=function(body){this._=body},_.parse=function(stream){return this.skip(eof)._(""+stream,function(stream,result){return result},parseError)},_.or=function(alternative){pray("or is passed a parser",alternative instanceof Parser);var self=this;return Parser(function(stream,onSuccess,onFailure){return self._(stream,onSuccess,function(){return alternative._(stream,onSuccess,onFailure)})})},_.then=function(next){var self=this;return Parser(function(stream,onSuccess,onFailure){return self._(stream,function(newStream,result){var nextParser=next instanceof Parser?next:next(result);return pray("a parser is returned",nextParser instanceof Parser),nextParser._(newStream,onSuccess,onFailure)},onFailure)})},_.many=function(){var self=this;return Parser(function(stream,onSuccess){function success(newStream,x){return stream=newStream,xs.push(x),!0}function failure(){return!1}for(var xs=[];self._(stream,success,failure););return onSuccess(stream,xs)})},_.times=function(min,max){2>arguments.length&&(max=min);var self=this;return Parser(function(stream,onSuccess,onFailure){function success(newStream,x){return xs.push(x),stream=newStream,!0}function firstFailure(newStream,msg){return failure=msg,stream=newStream,!1}function secondFailure(){return!1}for(var xs=[],result=!0,i=0,failure;i<min;i+=1)if(result=self._(stream,success,firstFailure),!result)return onFailure(stream,failure);for(;i<max&&result;i+=1)result=self._(stream,success,secondFailure);return onSuccess(stream,xs)})},_.result=function(res){return this.then(succeed(res))},_.atMost=function(n){return this.times(0,n)},_.atLeast=function(n){var self=this;return self.times(n).then(function(start){return self.many().map(function(end){return start.concat(end)})})},_.map=function(fn){return this.then(function(result){return succeed(fn(result))})},_.skip=function(two){return this.then(function(result){return two.result(result)})};var string=this.string=function(str){var len=str.length;return Parser(function(stream,onSuccess,onFailure){var head=stream.slice(0,len);return head===str?onSuccess(stream.slice(len),head):onFailure(stream,"expected '"+str+"'")})},regex=this.regex=function(re){pray("regexp parser is anchored","^"===re.toString().charAt(1));return Parser(function(stream,onSuccess,onFailure){var match=re.exec(stream);if(match){var result=match[0];return onSuccess(stream.slice(result.length),result)}return onFailure(stream,"expected "+re)})},succeed=Parser.succeed=function(result){return Parser(function(stream,onSuccess){return onSuccess(stream,result)})},fail=Parser.fail=function(msg){return Parser(function(stream,_,onFailure){return onFailure(stream,msg)})},letter=Parser.letter=regex(/^[a-z]/i),letters=Parser.letters=regex(/^[a-z]*/i),digit=Parser.digit=regex(/^[0-9]/),digits=Parser.digits=regex(/^[0-9]*/),whitespace=Parser.whitespace=regex(/^\s+/),optWhitespace=Parser.optWhitespace=regex(/^\s*/),any=Parser.any=Parser(function(stream,onSuccess,onFailure){return stream?onSuccess(stream.slice(1),stream.charAt(0)):onFailure(stream,"expected any character")}),all=Parser.all=Parser(function(stream,onSuccess){return onSuccess("",stream)}),eof=Parser.eof=Parser(function(stream,onSuccess,onFailure){return stream?onFailure(stream,"expected EOF"):onSuccess(stream,stream)})}),saneKeyboardEvents=function(){function stringify(evt){var _StringfromCharCode=String.fromCharCode,which=evt.which||evt.keyCode,keyVal=KEY_VALUES[which],modifiers=[],key;return(evt.ctrlKey&&modifiers.push("Ctrl"),evt.originalEvent&&evt.originalEvent.metaKey&&modifiers.push("Meta"),evt.altKey&&modifiers.push("Alt"),evt.shiftKey&&modifiers.push("Shift"),key=keyVal||_StringfromCharCode(which),!modifiers.length&&!keyVal)?key:(modifiers.push(key),modifiers.join("-"))}var KEY_VALUES={8:"Backspace",9:"Tab",10:"Enter",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Esc",32:"Spacebar",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Del",144:"NumLock"};return function(el,handlers){function checkTextareaFor(checker){checkTextarea=checker,clearTimeout(timeoutId),timeoutId=setTimeout(checker)}function select(text){checkTextarea(),checkTextarea=noop,clearTimeout(timeoutId),textarea.val(text),text&&textarea[0].select&&textarea[0].select(),shouldBeSelected=!!text}function hasSelection(){var dom=textarea[0];return!!("selectionStart"in dom)&&dom.selectionStart!==dom.selectionEnd}function handleKey(){handlers.keystroke(stringify(keydown),keydown)}function onKeydown(e){keydown=e,keypress=null,shouldBeSelected&&checkTextareaFor(function(e){!(e&&"focusout"===e.type)&&textarea[0].select&&textarea[0].select(),checkTextarea=noop,clearTimeout(timeoutId)}),handleKey()}function onKeypress(e){keydown&&keypress&&handleKey(),keypress=e,checkTextareaFor(typedText)}function typedText(){if(!hasSelection()){var text=textarea.val();1===text.length?(textarea.val(""),handlers.typedText(text)):text&&textarea[0].select&&textarea[0].select()}}function pastedText(){var text=textarea.val();textarea.val(""),text&&handlers.paste(text)}var keydown=null,keypress=null,textarea=jQuery(el),target=jQuery(handlers.container||textarea),checkTextarea=noop,timeoutId;target.bind("keydown keypress input keyup focusout paste",function(e){checkTextarea(e)});var shouldBeSelected=!1;return target.bind({keydown:onKeydown,keypress:onKeypress,focusout:function(){keydown=keypress=null},paste:function(){textarea.focus(),checkTextareaFor(pastedText)}}),{select:select}}}();Controller.open(function(_){_.exportText=function(){return this.root.foldChildren("",function(text,child){return text+child.text()})}}),Controller.open(function(_){_.focusBlurEvents=function(){function windowBlur(){clearTimeout(blurTimeout),cursor.selection&&cursor.selection.jQ.addClass("mq-blur"),blur()}function blur(){cursor.hide().parent.blur(),ctrlr.container.removeClass("mq-focused"),$(window).off("blur",windowBlur)}var ctrlr=this,root=ctrlr.root,cursor=ctrlr.cursor,blurTimeout;ctrlr.textarea.focus(function(){ctrlr.blurred=!1,clearTimeout(blurTimeout),ctrlr.container.addClass("mq-focused"),cursor.parent||cursor.insAtRightEnd(root),cursor.selection?(cursor.selection.jQ.removeClass("mq-blur"),ctrlr.selectionChanged()):cursor.show()}).blur(function(){ctrlr.blurred=!0,blurTimeout=setTimeout(function(){root.postOrder("intentionalBlur"),cursor.clearSelection().endSelection(),blur()}),$(window).on("blur",windowBlur)}),ctrlr.blurred=!0,cursor.hide().parent.blur()}}),Controller.open(function(_){_.keystroke=function(key,evt){this.cursor.parent.keystroke(key,evt,this)}}),Node.open(function(_){_.keystroke=function(key,e,ctrlr){var cursor=ctrlr.cursor;switch(key){case"Ctrl-Shift-Backspace":case"Ctrl-Backspace":ctrlr.ctrlDeleteDir(L);break;case"Shift-Backspace":case"Backspace":ctrlr.backspace();break;case"Esc":case"Tab":return void ctrlr.escapeDir(R,key,e);case"Shift-Tab":case"Shift-Esc":return void ctrlr.escapeDir(L,key,e);case"End":ctrlr.notify("move").cursor.insAtRightEnd(cursor.parent);break;case"Ctrl-End":ctrlr.notify("move").cursor.insAtRightEnd(ctrlr.root);break;case"Shift-End":for(;cursor[R];)ctrlr.selectRight();break;case"Ctrl-Shift-End":for(;cursor[R]||cursor.parent!==ctrlr.root;)ctrlr.selectRight();break;case"Home":ctrlr.notify("move").cursor.insAtLeftEnd(cursor.parent);break;case"Ctrl-Home":ctrlr.notify("move").cursor.insAtLeftEnd(ctrlr.root);break;case"Shift-Home":for(;cursor[L];)ctrlr.selectLeft();break;case"Ctrl-Shift-Home":for(;cursor[L]||cursor.parent!==ctrlr.root;)ctrlr.selectLeft();break;case"Left":ctrlr.moveLeft();break;case"Shift-Left":ctrlr.selectLeft();break;case"Ctrl-Left":break;case"Right":ctrlr.moveRight();break;case"Shift-Right":ctrlr.selectRight();break;case"Ctrl-Right":break;case"Up":ctrlr.moveUp();break;case"Down":ctrlr.moveDown();break;case"Shift-Up":if(cursor[L])for(;cursor[L];)ctrlr.selectLeft();else ctrlr.selectLeft();case"Shift-Down":if(cursor[R])for(;cursor[R];)ctrlr.selectRight();else ctrlr.selectRight();case"Ctrl-Up":break;case"Ctrl-Down":break;case"Ctrl-Shift-Del":case"Ctrl-Del":ctrlr.ctrlDeleteDir(R);break;case"Shift-Del":case"Del":ctrlr.deleteForward();break;case"Meta-A":case"Ctrl-A":for(ctrlr.notify("move").cursor.insAtRightEnd(ctrlr.root);cursor[L];)ctrlr.selectLeft();break;default:return;}e.preventDefault(),ctrlr.scrollHoriz()},_.moveOutOf=_.moveTowards=_.deleteOutOf=_.deleteTowards=_.unselectInto=_.selectOutOf=_.selectTowards=function(){pray("overridden or never called on this node")}}),Controller.open(function(_){function moveUpDown(self,dir){var cursor=self.notify("upDown").cursor,dirInto=dir+"Into",dirOutOf=dir+"OutOf";return cursor[R][dirInto]?cursor.insAtLeftEnd(cursor[R][dirInto]):cursor[L][dirInto]?cursor.insAtRightEnd(cursor[L][dirInto]):cursor.parent.bubble(function(ancestor){var prop=ancestor[dirOutOf];if(prop&&("function"==typeof prop&&(prop=ancestor[dirOutOf](cursor)),prop instanceof Node&&cursor.jumpUpDown(ancestor,prop),!0!==prop))return!1}),self}this.onNotify(function(e){("move"===e||"upDown"===e)&&this.show().clearSelection()}),_.escapeDir=function(dir,key,e){prayDirection(dir);var cursor=this.cursor;if(cursor.parent!==this.root&&e.preventDefault(),cursor.parent!==this.root)return cursor.parent.moveOutOf(dir,cursor),this.notify("move")},optionProcessors.leftRightIntoCmdGoes=function(updown){if(updown&&"up"!==updown&&"down"!==updown)throw"\"up\" or \"down\" required for leftRightIntoCmdGoes option, got \""+updown+"\"";return updown},_.moveDir=function(dir){prayDirection(dir);var cursor=this.cursor,updown=cursor.options.leftRightIntoCmdGoes;return cursor.selection?cursor.insDirOf(dir,cursor.selection.ends[dir]):cursor[dir]?cursor[dir].moveTowards(dir,cursor,updown):cursor.parent.moveOutOf(dir,cursor,updown),this.notify("move")},_.moveLeft=function(){return this.moveDir(L)},_.moveRight=function(){return this.moveDir(R)},_.moveUp=function(){return moveUpDown(this,"up")},_.moveDown=function(){return moveUpDown(this,"down")},this.onNotify(function(e){"upDown"!==e&&(this.upDownCache={})}),this.onNotify(function(e){"edit"===e&&this.show().deleteSelection()}),_.deleteDir=function(dir){prayDirection(dir);var cursor=this.cursor,hadSelection=cursor.selection;return this.notify("edit"),hadSelection||(cursor[dir]?cursor[dir].deleteTowards(dir,cursor):cursor.parent.deleteOutOf(dir,cursor)),cursor[L].siblingDeleted&&cursor[L].siblingDeleted(cursor.options,R),cursor[R].siblingDeleted&&cursor[R].siblingDeleted(cursor.options,L),cursor.parent.bubble("reflow"),this},_.ctrlDeleteDir=function(dir){prayDirection(dir);var cursor=this.cursor;return!cursor[L]||cursor.selection?ctrlr.deleteDir():(this.notify("edit"),Fragment(cursor.parent.ends[L],cursor[L]).remove(),cursor.insAtDirEnd(L,cursor.parent),cursor[L].siblingDeleted&&cursor[L].siblingDeleted(cursor.options,R),cursor[R].siblingDeleted&&cursor[R].siblingDeleted(cursor.options,L),cursor.parent.bubble("reflow"),this)},_.backspace=function(){return this.deleteDir(L)},_.deleteForward=function(){return this.deleteDir(R)},this.onNotify(function(e){"select"!==e&&this.endSelection()}),_.selectDir=function(dir){var cursor=this.notify("select").cursor,seln=cursor.selection;prayDirection(dir),cursor.anticursor||cursor.startSelection();var node=cursor[dir];node?seln&&seln.ends[dir]===node&&cursor.anticursor[-dir]!==node?node.unselectInto(dir,cursor):node.selectTowards(dir,cursor):cursor.parent.selectOutOf(dir,cursor),cursor.clearSelection(),cursor.select()||cursor.show()},_.selectLeft=function(){return this.selectDir(L)},_.selectRight=function(){return this.selectDir(R)}});var latexMathParser=function(){function joinBlocks(blocks){for(var firstBlock=blocks[0]||MathBlock(),i=1;i<blocks.length;i+=1)blocks[i].children().adopt(firstBlock,firstBlock.ends[R],0);return firstBlock}var string=Parser.string,regex=Parser.regex,letter=Parser.letter,any=Parser.any,optWhitespace=Parser.optWhitespace,succeed=Parser.succeed,fail=Parser.fail,variable=letter.map(function(c){return Letter(c)}),symbol=regex(/^[^${}\\_^]/).map(function(c){return VanillaSymbol(c)}),controlSequence=regex(/^[^\\a-eg-zA-Z]/).or(string("\\").then(regex(/^[a-z]+/i).or(regex(/^\s+/).result(" ")).or(any))).then(function(ctrlSeq){var cmdKlass=LatexCmds[ctrlSeq];return cmdKlass?cmdKlass(ctrlSeq).parser():fail("unknown command: \\"+ctrlSeq)}),command=controlSequence.or(variable).or(symbol),mathGroup=string("{").then(function(){return mathSequence}).skip(string("}")),mathBlock=optWhitespace.then(mathGroup.or(command.map(function(cmd){var block=MathBlock();return cmd.adopt(block,0,0),block}))),mathSequence=mathBlock.many().map(joinBlocks).skip(optWhitespace),optMathBlock=string("[").then(mathBlock.then(function(block){return"]"===block.join("latex")?fail():succeed(block)}).many().map(joinBlocks).skip(optWhitespace)).skip(string("]")),latexMath=mathSequence;return latexMath.block=mathBlock,latexMath.optBlock=optMathBlock,latexMath}();Controller.open(function(_){_.exportLatex=function(){return this.root.latex().replace(/(\\[a-z]+) (?![a-z])/ig,"$1")},_.writeLatex=function(latex){var cursor=this.notify("edit").cursor,all=Parser.all,eof=Parser.eof,block=latexMathParser.skip(eof).or(all.result(!1)).parse(latex);if(block&&!block.isEmpty()){block.children().adopt(cursor.parent,cursor[L],cursor[R]);var jQ=block.jQize();jQ.insertBefore(cursor.jQ),cursor[L]=block.ends[R],block.finalizeInsert(cursor.options,cursor),block.ends[R][R].siblingCreated&&block.ends[R][R].siblingCreated(cursor.options,L),block.ends[L][L].siblingCreated&&block.ends[L][L].siblingCreated(cursor.options,R),cursor.parent.bubble("reflow")}return this},_.renderLatexMath=function(latex){var root=this.root,cursor=this.cursor,all=Parser.all,eof=Parser.eof,block=latexMathParser.skip(eof).or(all.result(!1)).parse(latex);root.eachChild("postOrder","dispose"),root.ends[L]=root.ends[R]=0,block&&block.children().adopt(root,0,0);var jQ=root.jQ;if(block){var html=block.join("html");jQ.html(html),root.jQize(jQ.children()),root.finalizeInsert(cursor.options)}else jQ.empty();delete cursor.selection,cursor.insAtRightEnd(root)},_.renderLatexText=function(latex){var root=this.root,cursor=this.cursor;root.jQ.children().slice(1).remove(),root.eachChild("postOrder","dispose"),root.ends[L]=root.ends[R]=0,delete cursor.selection,cursor.show().insAtRightEnd(root);var regex=Parser.regex,string=Parser.string,eof=Parser.eof,all=Parser.all,mathMode=string("$").then(latexMathParser).skip(string("$").or(eof)).map(function(block){var rootMathCommand=RootMathCommand(cursor);rootMathCommand.createBlocks();var rootMathBlock=rootMathCommand.ends[L];return block.children().adopt(rootMathBlock,0,0),rootMathCommand}),escapedDollar=string("\\$").result("$"),textChar=escapedDollar.or(regex(/^[^$]/)).map(VanillaSymbol),latexText=mathMode.or(textChar).many(),commands=latexText.skip(eof).or(all.result(!1)).parse(latex);if(commands){for(var i=0;i<commands.length;i+=1)commands[i].adopt(root,root.ends[R],0);root.jQize().appendTo(root.jQ),root.finalizeInsert(cursor.options)}}}),Controller.open(function(_){_.delegateMouseEvents=function(){var ultimateRootjQ=this.root.jQ;this.container.bind("mousedown.mathquill",function(e){function mousemove(e){target=$(e.target)}function docmousemove(e){cursor.anticursor||cursor.startSelection(),ctrlr.seek(target,e.pageX,e.pageY).cursor.select(),target=void 0}function mouseup(e){cursor.blink=blink,cursor.selection||(ctrlr.editable?cursor.show():textareaSpan.detach()),rootjQ.unbind("mousemove",mousemove),$(e.target.ownerDocument).unbind("mousemove",docmousemove).unbind("mouseup",mouseup)}var rootjQ=$(e.target).closest(".mq-root-block"),root=Node.byId[rootjQ.attr("mathquill-block-id")||ultimateRootjQ.attr("mathquill-block-id")],ctrlr=root.controller,cursor=ctrlr.cursor,blink=cursor.blink,textareaSpan=ctrlr.textareaSpan,textarea=ctrlr.textarea,target;ctrlr.blurred&&(!ctrlr.editable&&rootjQ.prepend(textareaSpan),textarea.focus()),e.preventDefault(),e.target.unselectable=!0,cursor.blink=noop,ctrlr.seek($(e.target),e.pageX,e.pageY).cursor.startSelection(),rootjQ.mousemove(mousemove),$(e.target.ownerDocument).mousemove(docmousemove).mouseup(mouseup)})}}),Controller.open(function(_){_.seek=function(target,pageX){var cursor=this.notify("select").cursor;if(target){var nodeId=target.attr("mathquill-block-id")||target.attr("mathquill-command-id");if(!nodeId){var targetParent=target.parent();nodeId=targetParent.attr("mathquill-block-id")||targetParent.attr("mathquill-command-id")}}var node=nodeId?Node.byId[nodeId]:this.root;return pray("nodeId is the id of some Node that exists",node),cursor.clearSelection().show(),node.seek(pageX,cursor),this.scrollHoriz(),this}}),Controller.open(function(_){_.scrollHoriz=function(){var cursor=this.cursor,seln=cursor.selection,rootRect=this.root.jQ[0].getBoundingClientRect();if(!seln){var x=cursor.jQ[0].getBoundingClientRect().left;if(x>rootRect.right-20)var scrollBy=x-(rootRect.right-20);else if(x<rootRect.left+20)var scrollBy=x-(rootRect.left+20);else return}else{var rect=seln.jQ[0].getBoundingClientRect(),overLeft=rect.left-(rootRect.left+20),overRight=rect.right-(rootRect.right-20);if(seln.ends[L]===cursor[R]){if(0>overLeft)var scrollBy=overLeft;else{if(!(0<overRight))return;if(rect.left-overRight<rootRect.left+20)var scrollBy=overLeft;else var scrollBy=overRight}}else if(0<overRight)var scrollBy=overRight;else{if(!(0>overLeft))return;if(rect.right-overLeft>rootRect.right-20)var scrollBy=overRight;else var scrollBy=overLeft}}this.root.jQ.stop().animate({scrollLeft:"+="+scrollBy},100)}}),Controller.open(function(_){Options.p.substituteTextarea=function(){return $("<textarea autocapitalize=off autocomplete=off autocorrect=off spellcheck=false x-palm-disable-ste-all=true />")[0]},_.createTextarea=function(){var textareaSpan=this.textareaSpan=$("<span class=\"mq-textarea\"></span>"),textarea=this.options.substituteTextarea();if(!textarea.nodeType)throw"substituteTextarea() must return a DOM element, got "+textarea;textarea=this.textarea=$(textarea).appendTo(textareaSpan);var ctrlr=this;ctrlr.cursor.selectionChanged=function(){ctrlr.selectionChanged()},ctrlr.container.bind("copy",function(){ctrlr.setTextareaSelection()})},_.selectionChanged=function(){var ctrlr=this;forceIERedraw(ctrlr.container[0]),ctrlr.textareaSelectionTimeout===void 0&&(ctrlr.textareaSelectionTimeout=setTimeout(function(){ctrlr.setTextareaSelection()}))},_.setTextareaSelection=function(){this.textareaSelectionTimeout=void 0;var latex="";this.cursor.selection&&(latex=this.cursor.selection.join("latex"),this.options.statelessClipboard&&(latex="$"+latex+"$")),this.selectFn(latex)},_.staticMathTextareaEvents=function(){function detach(){textareaSpan.detach(),ctrlr.blurred=!0}var ctrlr=this,root=ctrlr.root,cursor=ctrlr.cursor,textarea=ctrlr.textarea,textareaSpan=ctrlr.textareaSpan;this.container.prepend("<span class=\"mq-selectable\">$"+ctrlr.exportLatex()+"$</span>"),ctrlr.blurred=!0,textarea.bind("cut paste",!1).focus(function(){ctrlr.blurred=!1}).blur(function(){cursor.selection&&cursor.selection.clear(),setTimeout(detach)}),ctrlr.selectFn=function(text){textarea.val(text),text&&textarea.select()}},_.editablesTextareaEvents=function(){var ctrlr=this,root=ctrlr.root,cursor=ctrlr.cursor,textarea=ctrlr.textarea,textareaSpan=ctrlr.textareaSpan,keyboardEventsShim=saneKeyboardEvents(textarea,this);this.selectFn=function(text){keyboardEventsShim.select(text)},this.container.prepend(textareaSpan).on("cut",function(){cursor.selection&&setTimeout(function(){ctrlr.notify("edit"),cursor.parent.bubble("reflow")})}),this.focusBlurEvents()},_.typedText=function(ch){if("\n"===ch)return this.handle("enter");var cursor=this.notify().cursor;cursor.parent.write(cursor,ch),this.scrollHoriz()},_.paste=function(text){this.options.statelessClipboard&&("$"===text.slice(0,1)&&"$"===text.slice(-1)?text=text.slice(1,-1):text="\\text{"+text+"}"),this.writeLatex(text).cursor.show()}});var MathElement=P(Node,function(_){_.finalizeInsert=function(options,cursor){var self=this;self.postOrder("finalizeTree",options),self.postOrder("contactWeld",cursor),self.postOrder("blur"),self.postOrder("reflow"),self[R].siblingCreated&&self[R].siblingCreated(options,L),self[L].siblingCreated&&self[L].siblingCreated(options,R),self.bubble("reflow")}}),MathCommand=P(MathElement,function(_,super_){_.init=function(ctrlSeq,htmlTemplate,textTemplate){var cmd=this;super_.init.call(cmd),cmd.ctrlSeq||(cmd.ctrlSeq=ctrlSeq),htmlTemplate&&(cmd.htmlTemplate=htmlTemplate),textTemplate&&(cmd.textTemplate=textTemplate)},_.replaces=function(replacedFragment){replacedFragment.disown(),this.replacedFragment=replacedFragment},_.isEmpty=function(){return this.foldChildren(!0,function(isEmpty,child){return isEmpty&&child.isEmpty()})},_.parser=function(){var block=latexMathParser.block,self=this;return block.times(self.numBlocks()).map(function(blocks){self.blocks=blocks;for(var i=0;i<blocks.length;i+=1)blocks[i].adopt(self,self.ends[R],0);return self})},_.createLeftOf=function(cursor){var cmd=this,replacedFragment=cmd.replacedFragment;cmd.createBlocks(),super_.createLeftOf.call(cmd,cursor),replacedFragment&&(replacedFragment.adopt(cmd.ends[L],0,0),replacedFragment.jQ.appendTo(cmd.ends[L].jQ)),cmd.finalizeInsert(cursor.options),cmd.placeCursor(cursor)},_.createBlocks=function(){for(var cmd=this,numBlocks=cmd.numBlocks(),blocks=cmd.blocks=Array(numBlocks),i=0,newBlock;i<numBlocks;i+=1)newBlock=blocks[i]=MathBlock(),newBlock.adopt(cmd,cmd.ends[R],0)},_.placeCursor=function(cursor){cursor.insAtRightEnd(this.foldChildren(this.ends[L],function(leftward,child){return leftward.isEmpty()?leftward:child}))},_.moveTowards=function(dir,cursor,updown){var updownInto=updown&&this[updown+"Into"];cursor.insAtDirEnd(-dir,updownInto||this.ends[-dir])},_.deleteTowards=function(dir,cursor){this.isEmpty()?cursor[dir]=this.remove()[dir]:this.moveTowards(dir,cursor,null)},_.selectTowards=function(dir,cursor){cursor[-dir]=this,cursor[dir]=this[dir]},_.selectChildren=function(){return Selection(this,this)},_.unselectInto=function(dir,cursor){cursor.insAtDirEnd(-dir,cursor.anticursor.ancestors[this.id])},_.seek=function(pageX,cursor){function getBounds(node){var bounds={};return bounds[L]=node.jQ.offset().left,bounds[R]=bounds[L]+node.jQ.outerWidth(),bounds}var cmd=this,cmdBounds=getBounds(cmd);if(pageX<cmdBounds[L])return cursor.insLeftOf(cmd);if(pageX>cmdBounds[R])return cursor.insRightOf(cmd);var leftLeftBound=cmdBounds[L];cmd.eachChild(function(block){var blockBounds=getBounds(block);return pageX<blockBounds[L]?(pageX-leftLeftBound<blockBounds[L]-pageX?block[L]?cursor.insAtRightEnd(block[L]):cursor.insLeftOf(cmd):cursor.insAtLeftEnd(block),!1):pageX>blockBounds[R]?void(block[R]?leftLeftBound=blockBounds[R]:cmdBounds[R]-pageX<pageX-blockBounds[R]?cursor.insRightOf(cmd):cursor.insAtRightEnd(block)):(block.seek(pageX,cursor),!1)})},_.numBlocks=function(){var matches=this.htmlTemplate.match(/&\d+/g);return matches?matches.length:0},_.html=function(){var cmd=this,blocks=cmd.blocks,cmdId=" mathquill-command-id="+cmd.id,tokens=cmd.htmlTemplate.match(/<[^<>]+>|[^<>]+/g);pray("no unmatched angle brackets",tokens.join("")===this.htmlTemplate);for(var i=0,token=tokens[0];token;i+=1,token=tokens[i])if("/>"===token.slice(-2))tokens[i]=token.slice(0,-2)+cmdId+"/>";else if("<"===token.charAt(0)){pray("not an unmatched top-level close tag","/"!==token.charAt(1)),tokens[i]=token.slice(0,-1)+cmdId+">";var nesting=1;do i+=1,token=tokens[i],pray("no missing close tags",token),"</"===token.slice(0,2)?nesting-=1:"<"===token.charAt(0)&&"/>"!==token.slice(-2)&&(nesting+=1);while(0<nesting)}return tokens.join("").replace(/>&(\d+)/g,function($0,$1){return" mathquill-block-id="+blocks[$1].id+">"+blocks[$1].join("html")})},_.latex=function(){return this.foldChildren(this.ctrlSeq,function(latex,child){return latex+"{"+(child.latex()||" ")+"}"})},_.textTemplate=[""],_.text=function(){var cmd=this,i=0;return cmd.foldChildren(cmd.textTemplate[i],function(text,child){i+=1;var child_text=child.text();return text&&"("===cmd.textTemplate[i]&&"("===child_text[0]&&")"===child_text.slice(-1)?text+child_text.slice(1,-1)+cmd.textTemplate[i]:text+child.text()+(cmd.textTemplate[i]||"")})}}),_Symbol=P(MathCommand,function(_,super_){_.init=function(ctrlSeq,html,text){text||(text=ctrlSeq&&1<ctrlSeq.length?ctrlSeq.slice(1):ctrlSeq),super_.init.call(this,ctrlSeq,html,[text])},_.parser=function(){return Parser.succeed(this)},_.numBlocks=function(){return 0},_.replaces=function(replacedFragment){replacedFragment.remove()},_.createBlocks=noop,_.moveTowards=function(dir,cursor){cursor.jQ.insDirOf(dir,this.jQ),cursor[-dir]=this,cursor[dir]=this[dir]},_.deleteTowards=function(dir,cursor){cursor[dir]=this.remove()[dir]},_.seek=function(pageX,cursor){pageX-this.jQ.offset().left<this.jQ.outerWidth()/2?cursor.insLeftOf(this):cursor.insRightOf(this)},_.latex=function(){return this.ctrlSeq},_.text=function(){return this.textTemplate},_.placeCursor=noop,_.isEmpty=function(){return!0}}),VanillaSymbol=P(_Symbol,function(_,super_){_.init=function(ch,html){super_.init.call(this,ch,"<span>"+(html||ch)+"</span>")}}),BinaryOperator=P(_Symbol,function(_,super_){_.init=function(ctrlSeq,html,text){super_.init.call(this,ctrlSeq,"<span class=\"mq-binary-operator\">"+html+"</span>",text)}}),MathBlock=P(MathElement,function(_,super_){_.join=function(methodName){return this.foldChildren("",function(fold,child){return fold+child[methodName]()})},_.html=function(){return this.join("html")},_.latex=function(){return this.join("latex")},_.text=function(){return this.ends[L]===this.ends[R]&&0!==this.ends[L]?this.ends[L].text():this.join("text")},_.keystroke=function(key,e,ctrlr){return ctrlr.options.spaceBehavesLikeTab&&("Spacebar"===key||"Shift-Spacebar"===key)?(e.preventDefault(),void ctrlr.escapeDir("Shift-Spacebar"===key?L:R,key,e)):super_.keystroke.apply(this,arguments)},_.moveOutOf=function(dir,cursor,updown){var updownInto=updown&&this.parent[updown+"Into"];!updownInto&&this[dir]?cursor.insAtDirEnd(-dir,this[dir]):cursor.insDirOf(dir,this.parent)},_.selectOutOf=function(dir,cursor){cursor.insDirOf(dir,this.parent)},_.deleteOutOf=function(dir,cursor){cursor.unwrapGramp()},_.seek=function(pageX,cursor){var node=this.ends[R];if(!node||node.jQ.offset().left+node.jQ.outerWidth()<pageX)return cursor.insAtRightEnd(this);if(pageX<this.ends[L].jQ.offset().left)return cursor.insAtLeftEnd(this);for(;pageX<node.jQ.offset().left;)node=node[L];return node.seek(pageX,cursor)},_.chToCmd=function(ch){var cons;return ch.match(/^[a-eg-zA-Z]$/)?Letter(ch):/^\d$/.test(ch)?Digit(ch):(cons=CharCmds[ch]||LatexCmds[ch])?cons(ch):VanillaSymbol(ch)},_.write=function(cursor,ch){var cmd=this.chToCmd(ch);cursor.selection&&cmd.replaces(cursor.replaceSelection()),cmd.createLeftOf(cursor.show())},_.focus=function(){return this.jQ.addClass("mq-hasCursor"),this.jQ.removeClass("mq-empty"),this},_.blur=function(){return this.jQ.removeClass("mq-hasCursor"),this.isEmpty()&&this.jQ.addClass("mq-empty"),this}});API.StaticMath=function(APIClasses){return P(APIClasses.AbstractMathQuill,function(_,super_){this.RootBlock=MathBlock,_.__mathquillify=function(){return super_.__mathquillify.call(this,"mq-math-mode"),this.__controller.delegateMouseEvents(),this.__controller.staticMathTextareaEvents(),this},_.init=function(){super_.init.apply(this,arguments),this.__controller.root.postOrder("registerInnerField",this.innerFields=[],APIClasses.MathField)},_.latex=function(){var returned=super_.latex.apply(this,arguments);return 0<arguments.length&&this.__controller.root.postOrder("registerInnerField",this.innerFields=[],APIClasses.MathField),returned}})};var RootMathBlock=P(MathBlock,RootBlockMixin);API.MathField=function(APIClasses){return P(APIClasses.EditableField,function(_,super_){this.RootBlock=RootMathBlock,_.__mathquillify=function(opts,interfaceVersion){return this.config(opts),1<interfaceVersion&&(this.__controller.root.reflow=noop),super_.__mathquillify.call(this,"mq-editable-field mq-math-mode"),delete this.__controller.root.reflow,this}})};var TextBlock=P(Node,function(_,super_){function fuseChildren(self){self.jQ[0].normalize();var textPcDom=self.jQ[0].firstChild;pray("only node in TextBlock span is Text node",3===textPcDom.nodeType);var textPc=TextPiece(textPcDom.data);return textPc.jQadd(textPcDom),self.children().disown(),textPc.adopt(self,0,0)}_.ctrlSeq="\\text",_.replaces=function(replacedText){replacedText instanceof Fragment?this.replacedText=replacedText.remove().jQ.text():"string"==typeof replacedText&&(this.replacedText=replacedText)},_.jQadd=function(jQ){super_.jQadd.call(this,jQ),this.ends[L]&&this.ends[L].jQadd(this.jQ[0].firstChild)},_.createLeftOf=function(cursor){var textBlock=this;if(super_.createLeftOf.call(this,cursor),textBlock[R].siblingCreated&&textBlock[R].siblingCreated(cursor.options,L),textBlock[L].siblingCreated&&textBlock[L].siblingCreated(cursor.options,R),textBlock.bubble("reflow"),cursor.insAtRightEnd(textBlock),textBlock.replacedText)for(var i=0;i<textBlock.replacedText.length;i+=1)textBlock.write(cursor,textBlock.replacedText.charAt(i))},_.parser=function(){var textBlock=this,string=Parser.string,regex=Parser.regex,optWhitespace=Parser.optWhitespace;return optWhitespace.then(string("{")).then(regex(/^[^}]*/)).skip(string("}")).map(function(text){return TextPiece(text).adopt(textBlock,0,0),textBlock})},_.textContents=function(){return this.foldChildren("",function(text,child){return text+child.text})},_.text=function(){return"\""+this.textContents()+"\""},_.latex=function(){return"\\text{"+this.textContents()+"}"},_.html=function(){return"<span class=\"mq-text-mode\" mathquill-command-id="+this.id+">"+this.textContents()+"</span>"},_.moveTowards=function(dir,cursor){cursor.insAtDirEnd(-dir,this)},_.moveOutOf=function(dir,cursor){cursor.insDirOf(dir,this)},_.unselectInto=_.moveTowards,_.selectTowards=MathCommand.prototype.selectTowards,_.deleteTowards=MathCommand.prototype.deleteTowards,_.selectOutOf=function(dir,cursor){cursor.insDirOf(dir,this)},_.deleteOutOf=function(dir,cursor){this.isEmpty()&&cursor.insRightOf(this)},_.write=function(cursor,ch){if(cursor.show().deleteSelection(),"$"!==ch)cursor[L]?cursor[L].appendText(ch):TextPiece(ch).createLeftOf(cursor);else if(this.isEmpty())cursor.insRightOf(this),VanillaSymbol("\\$","$").createLeftOf(cursor);else if(!cursor[R])cursor.insRightOf(this);else if(!cursor[L])cursor.insLeftOf(this);else{var leftBlock=TextBlock(),leftPc=this.ends[L];leftPc.disown(),leftPc.adopt(leftBlock,0,0),cursor.insLeftOf(this),super_.createLeftOf.call(leftBlock,cursor)}},_.seek=function(pageX,cursor){cursor.hide();var textPc=fuseChildren(this),avgChWidth=this.jQ.width()/this.text.length,approxPosition=_Mathround5((pageX-this.jQ.offset().left)/avgChWidth);0>=approxPosition?cursor.insAtLeftEnd(this):approxPosition>=textPc.text.length?cursor.insAtRightEnd(this):cursor.insLeftOf(textPc.splitRight(approxPosition));for(var displ=pageX-cursor.show().offset().left,dir=displ&&0>displ?L:R,prevDispl=dir;cursor[dir]&&0<displ*prevDispl;)cursor[dir].moveTowards(dir,cursor),prevDispl=displ,displ=pageX-cursor.offset().left;if(dir*displ<-dir*prevDispl&&cursor[-dir].moveTowards(-dir,cursor),!cursor.anticursor)this.anticursorPosition=cursor[L]&&cursor[L].text.length;else if(cursor.anticursor.parent===this){var cursorPosition=cursor[L]&&cursor[L].text.length;if(this.anticursorPosition===cursorPosition)cursor.anticursor=Point.copy(cursor);else{if(this.anticursorPosition<cursorPosition){var newTextPc=cursor[L].splitRight(this.anticursorPosition);cursor[L]=newTextPc}else var newTextPc=cursor[R].splitRight(this.anticursorPosition-cursorPosition);cursor.anticursor=Point(this,newTextPc[L],newTextPc)}}},_.blur=function(){MathBlock.prototype.blur.call(this),fuseChildren(this)},_.focus=MathBlock.prototype.focus}),TextPiece=P(Node,function(_,super_){function endChar(dir,text){return text.charAt(dir===L?0:-1+text.length)}_.init=function(text){super_.init.call(this),this.text=text},_.jQadd=function(dom){this.dom=dom,this.jQ=$(dom)},_.jQize=function(){return this.jQadd(document.createTextNode(this.text))},_.appendText=function(text){this.text+=text,this.dom.appendData(text)},_.prependText=function(text){this.text=text+this.text,this.dom.insertData(0,text)},_.insTextAtDirEnd=function(text,dir){prayDirection(dir),dir===R?this.appendText(text):this.prependText(text)},_.splitRight=function(i){var newPc=TextPiece(this.text.slice(i)).adopt(this.parent,this,this[R]);return newPc.jQadd(this.dom.splitText(i)),this.text=this.text.slice(0,i),newPc},_.moveTowards=function(dir,cursor){prayDirection(dir);var ch=endChar(-dir,this.text),from=this[-dir];return from?from.insTextAtDirEnd(ch,dir):TextPiece(ch).createDir(-dir,cursor),this.deleteTowards(dir,cursor)},_.latex=function(){return this.text},_.deleteTowards=function(dir,cursor){1<this.text.length?dir===R?(this.dom.deleteData(0,1),this.text=this.text.slice(1)):(this.dom.deleteData(-1+this.text.length,1),this.text=this.text.slice(0,-1)):(this.remove(),this.jQ.remove(),cursor[dir]=this[dir])},_.selectTowards=function(dir,cursor){prayDirection(dir);var anticursor=cursor.anticursor,ch=endChar(-dir,this.text);if(anticursor[dir]===this){var newPc=TextPiece(ch).createDir(dir,cursor);anticursor[dir]=newPc,cursor.insDirOf(dir,newPc)}else{var from=this[-dir];if(from)from.insTextAtDirEnd(ch,dir);else{var newPc=TextPiece(ch).createDir(-dir,cursor);newPc.jQ.insDirOf(-dir,cursor.selection.jQ)}1===this.text.length&&anticursor[-dir]===this&&(anticursor[-dir]=this[-dir])}return this.deleteTowards(dir,cursor)}});CharCmds.$=LatexCmds.text=LatexCmds.textnormal=LatexCmds.textrm=LatexCmds.textup=LatexCmds.textmd=TextBlock,LatexCmds.em=LatexCmds.italic=LatexCmds.italics=LatexCmds.emph=LatexCmds.textit=LatexCmds.textsl=makeTextBlock("\\textit","i","class=\"mq-text-mode\""),LatexCmds.strong=LatexCmds.bold=LatexCmds.textbf=makeTextBlock("\\textbf","b","class=\"mq-text-mode\""),LatexCmds.sf=LatexCmds.textsf=makeTextBlock("\\textsf","span","class=\"mq-sans-serif mq-text-mode\""),LatexCmds.tt=LatexCmds.texttt=makeTextBlock("\\texttt","span","class=\"mq-monospace mq-text-mode\""),LatexCmds.textsc=makeTextBlock("\\textsc","span","style=\"font-variant:small-caps\" class=\"mq-text-mode\""),LatexCmds.uppercase=makeTextBlock("\\uppercase","span","style=\"text-transform:uppercase\" class=\"mq-text-mode\""),LatexCmds.lowercase=makeTextBlock("\\lowercase","span","style=\"text-transform:lowercase\" class=\"mq-text-mode\"");var RootMathCommand=P(MathCommand,function(_,super_){_.init=function(cursor){super_.init.call(this,"$"),this.cursor=cursor},_.htmlTemplate="<span class=\"mq-math-mode\">&0</span>",_.createBlocks=function(){super_.createBlocks.call(this),this.ends[L].cursor=this.cursor,this.ends[L].write=function(cursor,ch){"$"===ch?this.isEmpty()?(cursor.insRightOf(this.parent),this.parent.deleteTowards(dir,cursor),VanillaSymbol("\\$","$").createLeftOf(cursor.show())):cursor[R]?cursor[L]?MathBlock.prototype.write.call(this,cursor,ch):cursor.insLeftOf(this.parent):cursor.insRightOf(this.parent):MathBlock.prototype.write.call(this,cursor,ch)}},_.latex=function(){return"$"+this.ends[L].latex()+"$"}}),RootTextBlock=P(RootMathBlock,function(_,super_){_.keystroke=function(key){return"Spacebar"===key||"Shift-Spacebar"===key?void 0:super_.keystroke.apply(this,arguments)},_.write=function(cursor,ch){if(cursor.show().deleteSelection(),"$"===ch)RootMathCommand(cursor).createLeftOf(cursor);else{var html;"<"===ch?html="&lt;":">"==ch&&(html="&gt;"),VanillaSymbol(ch,html).createLeftOf(cursor)}}});API.TextField=function(APIClasses){return P(APIClasses.EditableField,function(_,super_){this.RootBlock=RootTextBlock,_.__mathquillify=function(){return super_.__mathquillify.call(this,"mq-editable-field mq-text-mode")},_.latex=function(latex){return 0<arguments.length?(this.__controller.renderLatexText(latex),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()}})};CharCmds["\\"]=P(MathCommand,function(_,super_){_.ctrlSeq="\\",_.replaces=function(replacedFragment){this._replacedFragment=replacedFragment.disown(),this.isEmpty=function(){return!1}},_.htmlTemplate="<span class=\"mq-latex-command-input mq-non-leaf\">\\<span>&0</span></span>",_.textTemplate=["\\"],_.createBlocks=function(){super_.createBlocks.call(this),this.ends[L].focus=function(){return this.parent.jQ.addClass("mq-hasCursor"),this.isEmpty()&&this.parent.jQ.removeClass("mq-empty"),this},this.ends[L].blur=function(){return this.parent.jQ.removeClass("mq-hasCursor"),this.isEmpty()&&this.parent.jQ.addClass("mq-empty"),this},this.ends[L].write=function(cursor,ch){cursor.show().deleteSelection(),ch.match(/[a-z]/i)?VanillaSymbol(ch).createLeftOf(cursor):(this.parent.renderCommand(cursor),("\\"!==ch||!this.isEmpty())&&this.parent.parent.write(cursor,ch))},this.ends[L].keystroke=function(key,e,ctrlr){return"Tab"===key||"Enter"===key||"Spacebar"===key?(this.parent.renderCommand(ctrlr.cursor),void e.preventDefault()):super_.keystroke.apply(this,arguments)}},_.createLeftOf=function(cursor){if(super_.createLeftOf.call(this,cursor),this._replacedFragment){var el=this.jQ[0];this.jQ=this._replacedFragment.jQ.addClass("mq-blur").bind("mousedown mousemove",function(e){return $(e.target=el).trigger(e),!1}).insertBefore(this.jQ).add(this.jQ)}},_.latex=function(){return"\\"+this.ends[L].latex()+" "},_.renderCommand=function(cursor){this.jQ=this.jQ.last(),this.remove(),this[R]?cursor.insLeftOf(this[R]):cursor.insAtRightEnd(this.parent);var latex=this.ends[L].latex();latex||(latex=" ");var cmd=LatexCmds[latex];cmd?(cmd=cmd(latex),this._replacedFragment&&cmd.replaces(this._replacedFragment),cmd.createLeftOf(cursor)):(cmd=TextBlock(),cmd.replaces(latex),cmd.createLeftOf(cursor),cursor.insRightOf(cmd),this._replacedFragment&&this._replacedFragment.remove())}});LatexCmds.notin=LatexCmds.cong=LatexCmds.equiv=LatexCmds.oplus=LatexCmds.otimes=P(BinaryOperator,function(_,super_){_.init=function(latex){super_.init.call(this,"\\"+latex+" ","&"+latex+";")}}),LatexCmds["\u2260"]=LatexCmds.ne=LatexCmds.neq=bind(BinaryOperator,"\\ne ","&ne;"),LatexCmds.ast=LatexCmds.star=LatexCmds.loast=LatexCmds.lowast=bind(BinaryOperator,"\\ast ","&lowast;"),LatexCmds.therefor=LatexCmds.therefore=bind(BinaryOperator,"\\therefore ","&there4;"),LatexCmds.cuz=LatexCmds.because=bind(BinaryOperator,"\\because ","&#8757;"),LatexCmds.prop=LatexCmds.propto=bind(BinaryOperator,"\\propto ","&prop;"),LatexCmds["\u2248"]=LatexCmds.asymp=LatexCmds.approx=bind(BinaryOperator,"\\approx ","&asymp;"),LatexCmds.isin=LatexCmds["in"]=bind(BinaryOperator,"\\in ","&isin;"),LatexCmds.ni=LatexCmds.contains=bind(BinaryOperator,"\\ni ","&ni;"),LatexCmds.notni=LatexCmds.niton=LatexCmds.notcontains=LatexCmds.doesnotcontain=bind(BinaryOperator,"\\not\\ni ","&#8716;"),LatexCmds.sub=LatexCmds.subset=bind(BinaryOperator,"\\subset ","&sub;"),LatexCmds.sup=LatexCmds.supset=LatexCmds.superset=bind(BinaryOperator,"\\supset ","&sup;"),LatexCmds.nsub=LatexCmds.notsub=LatexCmds.nsubset=LatexCmds.notsubset=bind(BinaryOperator,"\\not\\subset ","&#8836;"),LatexCmds.nsup=LatexCmds.notsup=LatexCmds.nsupset=LatexCmds.notsupset=LatexCmds.nsuperset=LatexCmds.notsuperset=bind(BinaryOperator,"\\not\\supset ","&#8837;"),LatexCmds.sube=LatexCmds.subeq=LatexCmds.subsete=LatexCmds.subseteq=bind(BinaryOperator,"\\subseteq ","&sube;"),LatexCmds.supe=LatexCmds.supeq=LatexCmds.supsete=LatexCmds.supseteq=LatexCmds.supersete=LatexCmds.superseteq=bind(BinaryOperator,"\\supseteq ","&supe;"),LatexCmds.nsube=LatexCmds.nsubeq=LatexCmds.notsube=LatexCmds.notsubeq=LatexCmds.nsubsete=LatexCmds.nsubseteq=LatexCmds.notsubsete=LatexCmds.notsubseteq=bind(BinaryOperator,"\\not\\subseteq ","&#8840;"),LatexCmds.nsupe=LatexCmds.nsupeq=LatexCmds.notsupe=LatexCmds.notsupeq=LatexCmds.nsupsete=LatexCmds.nsupseteq=LatexCmds.notsupsete=LatexCmds.notsupseteq=LatexCmds.nsupersete=LatexCmds.nsuperseteq=LatexCmds.notsupersete=LatexCmds.notsuperseteq=bind(BinaryOperator,"\\not\\supseteq ","&#8841;"),LatexCmds.N=LatexCmds.naturals=LatexCmds.Naturals=bind(VanillaSymbol,"\\mathbb{N}","&#8469;"),LatexCmds.P=LatexCmds.primes=LatexCmds.Primes=LatexCmds.projective=LatexCmds.Projective=LatexCmds.probability=LatexCmds.Probability=bind(VanillaSymbol,"\\mathbb{P}","&#8473;"),LatexCmds.Z=LatexCmds.integers=LatexCmds.Integers=bind(VanillaSymbol,"\\mathbb{Z}","&#8484;"),LatexCmds.Q=LatexCmds.rationals=LatexCmds.Rationals=bind(VanillaSymbol,"\\mathbb{Q}","&#8474;"),LatexCmds.R=LatexCmds.reals=LatexCmds.Reals=bind(VanillaSymbol,"\\mathbb{R}","&#8477;"),LatexCmds.C=LatexCmds.complex=LatexCmds.Complex=LatexCmds.complexes=LatexCmds.Complexes=LatexCmds.complexplane=LatexCmds.Complexplane=LatexCmds.ComplexPlane=bind(VanillaSymbol,"\\mathbb{C}","&#8450;"),LatexCmds.H=LatexCmds.Hamiltonian=LatexCmds.quaternions=LatexCmds.Quaternions=bind(VanillaSymbol,"\\mathbb{H}","&#8461;"),LatexCmds.quad=LatexCmds.emsp=bind(VanillaSymbol,"\\quad "," "),LatexCmds.qquad=bind(VanillaSymbol,"\\qquad "," "),LatexCmds.diamond=bind(VanillaSymbol,"\\diamond ","&#9671;"),LatexCmds.bigtriangleup=bind(VanillaSymbol,"\\bigtriangleup ","&#9651;"),LatexCmds.ominus=bind(VanillaSymbol,"\\ominus ","&#8854;"),LatexCmds.uplus=bind(VanillaSymbol,"\\uplus ","&#8846;"),LatexCmds.bigtriangledown=bind(VanillaSymbol,"\\bigtriangledown ","&#9661;"),LatexCmds.sqcap=bind(VanillaSymbol,"\\sqcap ","&#8851;"),LatexCmds.triangleleft=bind(VanillaSymbol,"\\triangleleft ","&#8882;"),LatexCmds.sqcup=bind(VanillaSymbol,"\\sqcup ","&#8852;"),LatexCmds.triangleright=bind(VanillaSymbol,"\\triangleright ","&#8883;"),LatexCmds.odot=LatexCmds.circledot=bind(VanillaSymbol,"\\odot ","&#8857;"),LatexCmds.bigcirc=bind(VanillaSymbol,"\\bigcirc ","&#9711;"),LatexCmds.dagger=bind(VanillaSymbol,"\\dagger ","&#0134;"),LatexCmds.ddagger=bind(VanillaSymbol,"\\ddagger ","&#135;"),LatexCmds.wr=bind(VanillaSymbol,"\\wr ","&#8768;"),LatexCmds.amalg=bind(VanillaSymbol,"\\amalg ","&#8720;"),LatexCmds.models=bind(VanillaSymbol,"\\models ","&#8872;"),LatexCmds.prec=bind(VanillaSymbol,"\\prec ","&#8826;"),LatexCmds.succ=bind(VanillaSymbol,"\\succ ","&#8827;"),LatexCmds.preceq=bind(VanillaSymbol,"\\preceq ","&#8828;"),LatexCmds.succeq=bind(VanillaSymbol,"\\succeq ","&#8829;"),LatexCmds.simeq=bind(VanillaSymbol,"\\simeq ","&#8771;"),LatexCmds.mid=bind(VanillaSymbol,"\\mid ","&#8739;"),LatexCmds.ll=bind(VanillaSymbol,"\\ll ","&#8810;"),LatexCmds.gg=bind(VanillaSymbol,"\\gg ","&#8811;"),LatexCmds.parallel=bind(VanillaSymbol,"\\parallel ","&#8741;"),LatexCmds.nparallel=bind(VanillaSymbol,"\\nparallel ","&#8742;"),LatexCmds.bowtie=bind(VanillaSymbol,"\\bowtie ","&#8904;"),LatexCmds.sqsubset=bind(VanillaSymbol,"\\sqsubset ","&#8847;"),LatexCmds.sqsupset=bind(VanillaSymbol,"\\sqsupset ","&#8848;"),LatexCmds.smile=bind(VanillaSymbol,"\\smile ","&#8995;"),LatexCmds.sqsubseteq=bind(VanillaSymbol,"\\sqsubseteq ","&#8849;"),LatexCmds.sqsupseteq=bind(VanillaSymbol,"\\sqsupseteq ","&#8850;"),LatexCmds.doteq=bind(VanillaSymbol,"\\doteq ","&#8784;"),LatexCmds.frown=bind(VanillaSymbol,"\\frown ","&#8994;"),LatexCmds.vdash=bind(VanillaSymbol,"\\vdash ","&#8870;"),LatexCmds.dashv=bind(VanillaSymbol,"\\dashv ","&#8867;"),LatexCmds.nless=bind(VanillaSymbol,"\\nless ","&#8814;"),LatexCmds.ngtr=bind(VanillaSymbol,"\\ngtr ","&#8815;"),LatexCmds.longleftarrow=bind(VanillaSymbol,"\\longleftarrow ","&#8592;"),LatexCmds.longrightarrow=bind(VanillaSymbol,"\\longrightarrow ","&#8594;"),LatexCmds.Longleftarrow=bind(VanillaSymbol,"\\Longleftarrow ","&#8656;"),LatexCmds.Longrightarrow=bind(VanillaSymbol,"\\Longrightarrow ","&#8658;"),LatexCmds.longleftrightarrow=bind(VanillaSymbol,"\\longleftrightarrow ","&#8596;"),LatexCmds.updownarrow=bind(VanillaSymbol,"\\updownarrow ","&#8597;"),LatexCmds.Longleftrightarrow=bind(VanillaSymbol,"\\Longleftrightarrow ","&#8660;"),LatexCmds.Updownarrow=bind(VanillaSymbol,"\\Updownarrow ","&#8661;"),LatexCmds.mapsto=bind(VanillaSymbol,"\\mapsto ","&#8614;"),LatexCmds.nearrow=bind(VanillaSymbol,"\\nearrow ","&#8599;"),LatexCmds.hookleftarrow=bind(VanillaSymbol,"\\hookleftarrow ","&#8617;"),LatexCmds.hookrightarrow=bind(VanillaSymbol,"\\hookrightarrow ","&#8618;"),LatexCmds.searrow=bind(VanillaSymbol,"\\searrow ","&#8600;"),LatexCmds.leftharpoonup=bind(VanillaSymbol,"\\leftharpoonup ","&#8636;"),LatexCmds.rightharpoonup=bind(VanillaSymbol,"\\rightharpoonup ","&#8640;"),LatexCmds.swarrow=bind(VanillaSymbol,"\\swarrow ","&#8601;"),LatexCmds.leftharpoondown=bind(VanillaSymbol,"\\leftharpoondown ","&#8637;"),LatexCmds.rightharpoondown=bind(VanillaSymbol,"\\rightharpoondown ","&#8641;"),LatexCmds.nwarrow=bind(VanillaSymbol,"\\nwarrow ","&#8598;"),LatexCmds.ldots=bind(VanillaSymbol,"\\ldots ","&#8230;"),LatexCmds.cdots=bind(VanillaSymbol,"\\cdots ","&#8943;"),LatexCmds.vdots=bind(VanillaSymbol,"\\vdots ","&#8942;"),LatexCmds.ddots=bind(VanillaSymbol,"\\ddots ","&#8945;"),LatexCmds.surd=bind(VanillaSymbol,"\\surd ","&#8730;"),LatexCmds.triangle=bind(VanillaSymbol,"\\triangle ","&#9651;"),LatexCmds.ell=bind(VanillaSymbol,"\\ell ","&#8467;"),LatexCmds.top=bind(VanillaSymbol,"\\top ","&#8868;"),LatexCmds.flat=bind(VanillaSymbol,"\\flat ","&#9837;"),LatexCmds.natural=bind(VanillaSymbol,"\\natural ","&#9838;"),LatexCmds.sharp=bind(VanillaSymbol,"\\sharp ","&#9839;"),LatexCmds.wp=bind(VanillaSymbol,"\\wp ","&#8472;"),LatexCmds.bot=bind(VanillaSymbol,"\\bot ","&#8869;"),LatexCmds.clubsuit=bind(VanillaSymbol,"\\clubsuit ","&#9827;"),LatexCmds.diamondsuit=bind(VanillaSymbol,"\\diamondsuit ","&#9826;"),LatexCmds.heartsuit=bind(VanillaSymbol,"\\heartsuit ","&#9825;"),LatexCmds.spadesuit=bind(VanillaSymbol,"\\spadesuit ","&#9824;"),LatexCmds.parallelogram=bind(VanillaSymbol,"\\parallelogram ","&#9649;"),LatexCmds.square=bind(VanillaSymbol,"\\square ","&#11036;"),LatexCmds.oint=bind(VanillaSymbol,"\\oint ","&#8750;"),LatexCmds.bigcap=bind(VanillaSymbol,"\\bigcap ","&#8745;"),LatexCmds.bigcup=bind(VanillaSymbol,"\\bigcup ","&#8746;"),LatexCmds.bigsqcup=bind(VanillaSymbol,"\\bigsqcup ","&#8852;"),LatexCmds.bigvee=bind(VanillaSymbol,"\\bigvee ","&#8744;"),LatexCmds.bigwedge=bind(VanillaSymbol,"\\bigwedge ","&#8743;"),LatexCmds.bigodot=bind(VanillaSymbol,"\\bigodot ","&#8857;"),LatexCmds.bigotimes=bind(VanillaSymbol,"\\bigotimes ","&#8855;"),LatexCmds.bigoplus=bind(VanillaSymbol,"\\bigoplus ","&#8853;"),LatexCmds.biguplus=bind(VanillaSymbol,"\\biguplus ","&#8846;"),LatexCmds.lfloor=bind(VanillaSymbol,"\\lfloor ","&#8970;"),LatexCmds.rfloor=bind(VanillaSymbol,"\\rfloor ","&#8971;"),LatexCmds.lceil=bind(VanillaSymbol,"\\lceil ","&#8968;"),LatexCmds.rceil=bind(VanillaSymbol,"\\rceil ","&#8969;"),LatexCmds.opencurlybrace=LatexCmds.lbrace=bind(VanillaSymbol,"\\lbrace ","{"),LatexCmds.closecurlybrace=LatexCmds.rbrace=bind(VanillaSymbol,"\\rbrace ","}"),LatexCmds.lbrack=bind(VanillaSymbol,"["),LatexCmds.rbrack=bind(VanillaSymbol,"]"),LatexCmds["\u222B"]=LatexCmds.int=LatexCmds.integral=bind(_Symbol,"\\int ","<big>&int;</big>"),LatexCmds.slash=bind(VanillaSymbol,"/"),LatexCmds.vert=bind(VanillaSymbol,"|"),LatexCmds.perp=LatexCmds.perpendicular=bind(VanillaSymbol,"\\perp ","&perp;"),LatexCmds.nabla=LatexCmds.del=bind(VanillaSymbol,"\\nabla ","&nabla;"),LatexCmds.hbar=bind(VanillaSymbol,"\\hbar ","&#8463;"),LatexCmds.AA=LatexCmds.Angstrom=LatexCmds.angstrom=bind(VanillaSymbol,"\\text\\AA ","&#8491;"),LatexCmds.ring=LatexCmds.circ=LatexCmds.circle=bind(VanillaSymbol,"\\circ ","&#8728;"),LatexCmds.bull=LatexCmds.bullet=bind(VanillaSymbol,"\\bullet ","&bull;"),LatexCmds.setminus=LatexCmds.smallsetminus=bind(VanillaSymbol,"\\setminus ","&#8726;"),LatexCmds.not=LatexCmds["\xAC"]=LatexCmds.neg=bind(VanillaSymbol,"\\neg ","&not;"),LatexCmds["\u2026"]=LatexCmds.dots=LatexCmds.ellip=LatexCmds.hellip=LatexCmds.ellipsis=LatexCmds.hellipsis=bind(VanillaSymbol,"\\dots ","&hellip;"),LatexCmds.converges=LatexCmds.darr=LatexCmds.dnarr=LatexCmds.dnarrow=LatexCmds.downarrow=bind(VanillaSymbol,"\\downarrow ","&darr;"),LatexCmds.dArr=LatexCmds.dnArr=LatexCmds.dnArrow=LatexCmds.Downarrow=bind(VanillaSymbol,"\\Downarrow ","&dArr;"),LatexCmds.diverges=LatexCmds.uarr=LatexCmds.uparrow=bind(VanillaSymbol,"\\uparrow ","&uarr;"),LatexCmds.uArr=LatexCmds.Uparrow=bind(VanillaSymbol,"\\Uparrow ","&uArr;"),LatexCmds.to=bind(BinaryOperator,"\\to ","&rarr;"),LatexCmds.rarr=LatexCmds.rightarrow=bind(VanillaSymbol,"\\rightarrow ","&rarr;"),LatexCmds.implies=bind(BinaryOperator,"\\Rightarrow ","&rArr;"),LatexCmds.rArr=LatexCmds.Rightarrow=bind(VanillaSymbol,"\\Rightarrow ","&rArr;"),LatexCmds.gets=bind(BinaryOperator,"\\gets ","&larr;"),LatexCmds.larr=LatexCmds.leftarrow=bind(VanillaSymbol,"\\leftarrow ","&larr;"),LatexCmds.impliedby=bind(BinaryOperator,"\\Leftarrow ","&lArr;"),LatexCmds.lArr=LatexCmds.Leftarrow=bind(VanillaSymbol,"\\Leftarrow ","&lArr;"),LatexCmds.harr=LatexCmds.lrarr=LatexCmds.leftrightarrow=bind(VanillaSymbol,"\\leftrightarrow ","&harr;"),LatexCmds.iff=bind(BinaryOperator,"\\Leftrightarrow ","&hArr;"),LatexCmds.hArr=LatexCmds.lrArr=LatexCmds.Leftrightarrow=bind(VanillaSymbol,"\\Leftrightarrow ","&hArr;"),LatexCmds.Re=LatexCmds.Real=LatexCmds.real=bind(VanillaSymbol,"\\Re ","&real;"),LatexCmds.Im=LatexCmds.imag=LatexCmds.image=LatexCmds.imagin=LatexCmds.imaginary=LatexCmds.Imaginary=bind(VanillaSymbol,"\\Im ","&image;"),LatexCmds.part=LatexCmds.partial=bind(VanillaSymbol,"\\partial ","&part;"),LatexCmds.infty=LatexCmds.infin=LatexCmds.infinity=bind(VanillaSymbol,"\\infty ","&infin;"),LatexCmds.alef=LatexCmds.alefsym=LatexCmds.aleph=LatexCmds.alephsym=bind(VanillaSymbol,"\\aleph ","&alefsym;"),LatexCmds.xist=LatexCmds.xists=LatexCmds.exist=LatexCmds.exists=bind(VanillaSymbol,"\\exists ","&exist;"),LatexCmds.and=LatexCmds.land=LatexCmds.wedge=bind(VanillaSymbol,"\\wedge ","&and;"),LatexCmds.or=LatexCmds.lor=LatexCmds.vee=bind(VanillaSymbol,"\\vee ","&or;"),LatexCmds.o=LatexCmds.O=LatexCmds.empty=LatexCmds.emptyset=LatexCmds.oslash=LatexCmds.Oslash=LatexCmds.nothing=LatexCmds.varnothing=bind(BinaryOperator,"\\varnothing ","&empty;"),LatexCmds.cup=LatexCmds.union=bind(BinaryOperator,"\\cup ","&cup;"),LatexCmds.cap=LatexCmds.intersect=LatexCmds.intersection=bind(BinaryOperator,"\\cap ","&cap;"),LatexCmds.deg=LatexCmds.degree=bind(VanillaSymbol,"\\degree ","&deg;"),LatexCmds.ang=LatexCmds.angle=bind(VanillaSymbol,"\\angle ","&ang;"),LatexCmds.measuredangle=bind(VanillaSymbol,"\\measuredangle ","&#8737;");var Digit=P(VanillaSymbol,function(_,super_){_.createLeftOf=function(cursor){cursor.options.autoSubscriptNumerals&&cursor.parent!==cursor.parent.parent.sub&&(cursor[L]instanceof Variable&&!1!==cursor[L].isItalic||cursor[L]instanceof SupSub&&cursor[L][L]instanceof Variable&&!1!==cursor[L][L].isItalic)?(LatexCmds._().createLeftOf(cursor),super_.createLeftOf.call(this,cursor),cursor.insRightOf(cursor.parent.parent)):super_.createLeftOf.call(this,cursor)}}),Variable=P(_Symbol,function(_,super_){_.init=function(ch,html){super_.init.call(this,ch,"<var>"+(html||ch)+"</var>")},_.text=function(){var text=this.ctrlSeq;return!this[L]||this[L]instanceof Variable||this[L]instanceof BinaryOperator||"\\ "===this[L].ctrlSeq||(text="*"+text),!this[R]||this[R]instanceof BinaryOperator||this[R]instanceof SupSub||(text+="*"),text}});Options.p.autoCommands={_maxLength:0},optionProcessors.autoCommands=function(cmds){if(!/^[a-z]+(?: [a-z]+)*$/i.test(cmds))throw"\""+cmds+"\" not a space-delimited list of only letters";for(var list=cmds.split(" "),dict={},maxLength=0,i=0,cmd;i<list.length;i+=1){if(cmd=list[i],2>cmd.length)throw"autocommand \""+cmd+"\" not minimum length of 2";if(LatexCmds[cmd]===OperatorName)throw"\""+cmd+"\" is a built-in operator name";dict[cmd]=1,maxLength=max(maxLength,cmd.length)}return dict._maxLength=maxLength,dict};var Letter=P(Variable,function(_,super_){function nonOperatorSymbol(node){return node instanceof _Symbol&&!(node instanceof BinaryOperator)}_.init=function(ch){return super_.init.call(this,this.letter=ch)},_.createLeftOf=function(cursor){var autoCmds=cursor.options.autoCommands,maxLength=autoCmds._maxLength;if(0<maxLength){for(var str=this.letter,l=cursor[L],i=1;l instanceof Letter&&i<maxLength;)str=l.letter+str,l=l[L],i+=1;for(;str.length;){if(autoCmds.hasOwnProperty(str)){for(var i=2,l=cursor[L];i<str.length;i+=1,l=l[L]);return Fragment(l,cursor[L]).remove(),cursor[L]=l[L],LatexCmds[str](str).createLeftOf(cursor)}str=str.slice(1)}}super_.createLeftOf.apply(this,arguments)},_.italicize=function(bool){return this.isItalic=bool,this.jQ.toggleClass("mq-operator-name",!bool),this},_.finalizeTree=_.siblingDeleted=_.siblingCreated=function(opts,dir){dir!==L&&this[R]instanceof Letter||this.autoUnItalicize(opts)},_.autoUnItalicize=function(opts){var autoOps=opts.autoOperatorNames;if(0!==autoOps._maxLength){for(var str=this.letter,l=this[L];l instanceof Letter;l=l[L])str=l.letter+str;for(var r=this[R];r instanceof Letter;r=r[R])str+=r.letter;Fragment(l[R]||this.parent.ends[L],r[L]||this.parent.ends[R]).each(function(el){el.italicize(!0).jQ.removeClass("mq-first mq-last"),el.ctrlSeq=el.letter});outer:for(var i=0,first=l[R]||this.parent.ends[L];i<str.length;i+=1,first=first[R])for(var len=min(autoOps._maxLength,str.length-i),word;0<len;len-=1)if(word=str.slice(i,i+len),autoOps.hasOwnProperty(word)){for(var j=0,letter=first;j<len;j+=1,letter=letter[R]){letter.italicize(!1);var last=letter}var isBuiltIn=BuiltInOpNames.hasOwnProperty(word);first.ctrlSeq=(isBuiltIn?"\\":"\\operatorname{")+first.ctrlSeq,last.ctrlSeq+=isBuiltIn?" ":"}",TwoWordOpNames.hasOwnProperty(word)&&last[L][L][L].jQ.addClass("mq-last"),nonOperatorSymbol(first[L])&&first.jQ.addClass("mq-first"),nonOperatorSymbol(last[R])&&last.jQ.addClass("mq-last"),i+=len-1,first=last;continue outer}}}}),BuiltInOpNames={},AutoOpNames=Options.p.autoOperatorNames={_maxLength:9},TwoWordOpNames={limsup:1,liminf:1,projlim:1,injlim:1};(function(){for(var mostOps="arg deg det dim exp gcd hom inf ker lg lim ln log max min sup limsup liminf injlim projlim Pr".split(" "),i=0;i<mostOps.length;i+=1)BuiltInOpNames[mostOps[i]]=AutoOpNames[mostOps[i]]=1;for(var builtInTrigs=["sin","cos","tan","arcsin","arccos","arctan","sinh","cosh","tanh","sec","csc","cot","coth"],i=0;i<builtInTrigs.length;i+=1)BuiltInOpNames[builtInTrigs[i]]=1;for(var autoTrigs=["sin","cos","tan","sec","cosec","csc","cotan","cot","ctg"],i=0;i<autoTrigs.length;i+=1)AutoOpNames[autoTrigs[i]]=AutoOpNames["arc"+autoTrigs[i]]=AutoOpNames[autoTrigs[i]+"h"]=AutoOpNames["ar"+autoTrigs[i]+"h"]=AutoOpNames["arc"+autoTrigs[i]+"h"]=1;for(var moreNonstandardOps=["gcf","hcf","lcm","proj","span"],i=0;i<moreNonstandardOps.length;i+=1)AutoOpNames[moreNonstandardOps[i]]=1})(),optionProcessors.autoOperatorNames=function(cmds){if(!/^[a-z]+(?: [a-z]+)*$/i.test(cmds))throw"\""+cmds+"\" not a space-delimited list of only letters";for(var list=cmds.split(" "),dict={},maxLength=0,i=0,cmd;i<list.length;i+=1){if(cmd=list[i],2>cmd.length)throw"\""+cmd+"\" not minimum length of 2";dict[cmd]=1,maxLength=max(maxLength,cmd.length)}return dict._maxLength=maxLength,dict};var OperatorName=P(_Symbol,function(_){_.init=function(fn){this.ctrlSeq=fn},_.createLeftOf=function(cursor){for(var fn=this.ctrlSeq,i=0;i<fn.length;i+=1)Letter(fn.charAt(i)).createLeftOf(cursor)},_.parser=function(){for(var fn=this.ctrlSeq,block=MathBlock(),i=0;i<fn.length;i+=1)Letter(fn.charAt(i)).adopt(block,block.ends[R],0);return Parser.succeed(block.children())}});for(var fn in AutoOpNames)AutoOpNames.hasOwnProperty(fn)&&(LatexCmds[fn]=OperatorName);LatexCmds.operatorname=P(MathCommand,function(_){_.createLeftOf=noop,_.numBlocks=function(){return 1},_.parser=function(){return latexMathParser.block.map(function(b){return b.children()})}}),LatexCmds.f=P(Letter,function(_,super_){_.init=function(){_Symbol.p.init.call(this,this.letter="f","<var class=\"mq-f\">f</var>")},_.italicize=function(bool){return this.jQ.html("f").toggleClass("mq-f",bool),super_.italicize.apply(this,arguments)}}),LatexCmds[" "]=LatexCmds.space=bind(VanillaSymbol,"\\ ","&nbsp;"),LatexCmds["'"]=LatexCmds.prime=bind(VanillaSymbol,"'","&prime;"),LatexCmds.backslash=bind(VanillaSymbol,"\\backslash ","\\"),CharCmds["\\"]||(CharCmds["\\"]=LatexCmds.backslash),LatexCmds.$=bind(VanillaSymbol,"\\$","$");var NonSymbolaSymbol=P(_Symbol,function(_,super_){_.init=function(ch,html){super_.init.call(this,ch,"<span class=\"mq-nonSymbola\">"+(html||ch)+"</span>")}});LatexCmds["@"]=NonSymbolaSymbol,LatexCmds["&"]=bind(NonSymbolaSymbol,"\\&","&amp;"),LatexCmds["%"]=bind(NonSymbolaSymbol,"\\%","%"),LatexCmds.alpha=LatexCmds.beta=LatexCmds.gamma=LatexCmds.delta=LatexCmds.zeta=LatexCmds.eta=LatexCmds.theta=LatexCmds.iota=LatexCmds.kappa=LatexCmds.mu=LatexCmds.nu=LatexCmds.xi=LatexCmds.rho=LatexCmds.sigma=LatexCmds.tau=LatexCmds.chi=LatexCmds.psi=LatexCmds.omega=P(Variable,function(_,super_){_.init=function(latex){super_.init.call(this,"\\"+latex+" ","&"+latex+";")}}),LatexCmds.phi=bind(Variable,"\\phi ","&#981;"),LatexCmds.phiv=LatexCmds.varphi=bind(Variable,"\\varphi ","&phi;"),LatexCmds.epsilon=bind(Variable,"\\epsilon ","&#1013;"),LatexCmds.epsiv=LatexCmds.varepsilon=bind(Variable,"\\varepsilon ","&epsilon;"),LatexCmds.piv=LatexCmds.varpi=bind(Variable,"\\varpi ","&piv;"),LatexCmds.sigmaf=LatexCmds.sigmav=LatexCmds.varsigma=bind(Variable,"\\varsigma ","&sigmaf;"),LatexCmds.thetav=LatexCmds.vartheta=LatexCmds.thetasym=bind(Variable,"\\vartheta ","&thetasym;"),LatexCmds.upsilon=LatexCmds.upsi=bind(Variable,"\\upsilon ","&upsilon;"),LatexCmds.gammad=LatexCmds.Gammad=LatexCmds.digamma=bind(Variable,"\\digamma ","&#989;"),LatexCmds.kappav=LatexCmds.varkappa=bind(Variable,"\\varkappa ","&#1008;"),LatexCmds.rhov=LatexCmds.varrho=bind(Variable,"\\varrho ","&#1009;"),LatexCmds.pi=LatexCmds.π=bind(NonSymbolaSymbol,"\\pi ","&pi;"),LatexCmds.lambda=bind(NonSymbolaSymbol,"\\lambda ","&lambda;"),LatexCmds.Upsilon=LatexCmds.Upsi=LatexCmds.upsih=LatexCmds.Upsih=bind(_Symbol,"\\Upsilon ","<var style=\"font-family: serif\">&upsih;</var>"),LatexCmds.Gamma=LatexCmds.Delta=LatexCmds.Theta=LatexCmds.Lambda=LatexCmds.Xi=LatexCmds.Pi=LatexCmds.Sigma=LatexCmds.Phi=LatexCmds.Psi=LatexCmds.Omega=LatexCmds.forall=P(VanillaSymbol,function(_,super_){_.init=function(latex){super_.init.call(this,"\\"+latex+" ","&"+latex+";")}});var LatexFragment=P(MathCommand,function(_){_.init=function(latex){this.latex=latex},_.createLeftOf=function(cursor){var block=latexMathParser.parse(this.latex);block.children().adopt(cursor.parent,cursor[L],cursor[R]),cursor[L]=block.ends[R],block.jQize().insertBefore(cursor.jQ),block.finalizeInsert(cursor.options,cursor),block.ends[R][R].siblingCreated&&block.ends[R][R].siblingCreated(cursor.options,L),block.ends[L][L].siblingCreated&&block.ends[L][L].siblingCreated(cursor.options,R),cursor.parent.bubble("reflow")},_.parser=function(){var frag=latexMathParser.parse(this.latex).children();return Parser.succeed(frag)}});LatexCmds["\xB9"]=bind(LatexFragment,"^1"),LatexCmds["\xB2"]=bind(LatexFragment,"^2"),LatexCmds["\xB3"]=bind(LatexFragment,"^3"),LatexCmds["\xBC"]=bind(LatexFragment,"\\frac14"),LatexCmds["\xBD"]=bind(LatexFragment,"\\frac12"),LatexCmds["\xBE"]=bind(LatexFragment,"\\frac34");var PlusMinus=P(BinaryOperator,function(_){_.init=VanillaSymbol.prototype.init,_.contactWeld=_.siblingCreated=_.siblingDeleted=function(opts,dir){if(dir!==R)return this.jQ[0].className=!this[L]||this[L]instanceof BinaryOperator?"":"mq-binary-operator",this}});LatexCmds["+"]=bind(PlusMinus,"+","+"),LatexCmds["\u2013"]=LatexCmds["-"]=bind(PlusMinus,"-","&minus;"),LatexCmds["\xB1"]=LatexCmds.pm=LatexCmds.plusmn=LatexCmds.plusminus=bind(PlusMinus,"\\pm ","&plusmn;"),LatexCmds.mp=LatexCmds.mnplus=LatexCmds.minusplus=bind(PlusMinus,"\\mp ","&#8723;"),CharCmds["*"]=LatexCmds.sdot=LatexCmds.cdot=bind(BinaryOperator,"\\cdot ","&middot;","*");var Inequality=P(BinaryOperator,function(_,super_){_.init=function(data,strict){this.data=data,this.strict=strict;var strictness=strict?"Strict":"";super_.init.call(this,data["ctrlSeq"+strictness],data["html"+strictness],data["text"+strictness])},_.swap=function(strict){this.strict=strict;var strictness=strict?"Strict":"";this.ctrlSeq=this.data["ctrlSeq"+strictness],this.jQ.html(this.data["html"+strictness]),this.textTemplate=[this.data["text"+strictness]]},_.deleteTowards=function(dir){return dir!==L||this.strict?void super_.deleteTowards.apply(this,arguments):(this.swap(!0),void this.bubble("reflow"))}}),less={ctrlSeq:"\\le ",html:"&le;",text:"\u2264",ctrlSeqStrict:"<",htmlStrict:"&lt;",textStrict:"<"},greater={ctrlSeq:"\\ge ",html:"&ge;",text:"\u2265",ctrlSeqStrict:">",htmlStrict:"&gt;",textStrict:">"};LatexCmds["<"]=LatexCmds.lt=bind(Inequality,less,!0),LatexCmds[">"]=LatexCmds.gt=bind(Inequality,greater,!0),LatexCmds["\u2264"]=LatexCmds.le=LatexCmds.leq=bind(Inequality,less,!1),LatexCmds["\u2265"]=LatexCmds.ge=LatexCmds.geq=bind(Inequality,greater,!1);var Equality=P(BinaryOperator,function(_,super_){_.init=function(){super_.init.call(this,"=","=")},_.createLeftOf=function(cursor){return cursor[L]instanceof Inequality&&cursor[L].strict?(cursor[L].swap(!1),void cursor[L].bubble("reflow")):void super_.createLeftOf.apply(this,arguments)}});LatexCmds["="]=Equality,LatexCmds["\xD7"]=LatexCmds.times=bind(BinaryOperator,"\\times ","&times;","[x]"),LatexCmds["\xF7"]=LatexCmds.div=LatexCmds.divide=LatexCmds.divides=bind(BinaryOperator,"\\div ","&divide;","[/]"),CharCmds["~"]=LatexCmds.sim=bind(BinaryOperator,"\\sim ","~","~");var forceIERedraw=noop,div=document.createElement("div"),div_style=div.style,transformPropNames={transform:1,WebkitTransform:1,MozTransform:1,OTransform:1,msTransform:1},scale,transformPropName;for(var prop in transformPropNames)if(prop in div_style){transformPropName=prop;break}transformPropName?scale=function(jQ,x,y){jQ.css(transformPropName,"scale("+x+","+y+")")}:"filter"in div_style?(forceIERedraw=function(el){el.className=el.className},scale=function(jQ,x,y){function calculateMarginRight(){jQ.css("marginRight",(innerjQ.width()-1)*(x-1)/x+"px")}x/=1+(y-1)/2,jQ.css("fontSize",y+"em"),jQ.hasClass("mq-matrixed-container")||jQ.addClass("mq-matrixed-container").wrapInner("<span class=\"mq-matrixed\"></span>");var innerjQ=jQ.children().css("filter","progid:DXImageTransform.Microsoft.Matrix(M11="+x+",SizingMethod='auto expand')");calculateMarginRight();var intervalId=setInterval(calculateMarginRight);$(window).load(function(){clearTimeout(intervalId),calculateMarginRight()})}):scale=function(jQ,x,y){jQ.css("fontSize",y+"em")};var Style=P(MathCommand,function(_,super_){_.init=function(ctrlSeq,tagName,attrs){super_.init.call(this,ctrlSeq,"<"+tagName+" "+attrs+">&0</"+tagName+">")}});LatexCmds.mathrm=bind(Style,"\\mathrm","span","class=\"mq-roman mq-font\""),LatexCmds.mathit=bind(Style,"\\mathit","i","class=\"mq-font\""),LatexCmds.mathbf=bind(Style,"\\mathbf","b","class=\"mq-font\""),LatexCmds.mathsf=bind(Style,"\\mathsf","span","class=\"mq-sans-serif mq-font\""),LatexCmds.mathtt=bind(Style,"\\mathtt","span","class=\"mq-monospace mq-font\""),LatexCmds.underline=bind(Style,"\\underline","span","class=\"mq-non-leaf mq-underline\""),LatexCmds.overline=LatexCmds.bar=bind(Style,"\\overline","span","class=\"mq-non-leaf mq-overline\""),LatexCmds.overrightarrow=bind(Style,"\\overrightarrow","span","class=\"mq-non-leaf mq-overarrow mq-arrow-right\""),LatexCmds.overleftarrow=bind(Style,"\\overleftarrow","span","class=\"mq-non-leaf mq-overarrow mq-arrow-left\"");var TextColor=LatexCmds.textcolor=P(MathCommand,function(_,super_){_.setColor=function(color){this.color=color,this.htmlTemplate="<span class=\"mq-textcolor\" style=\"color:"+color+"\">&0</span>"},_.latex=function(){return"\\textcolor{"+this.color+"}{"+this.blocks[0].latex()+"}"},_.parser=function(){var self=this,optWhitespace=Parser.optWhitespace,string=Parser.string,regex=Parser.regex;return optWhitespace.then(string("{")).then(regex(/^[#\w\s.,()%-]*/)).skip(string("}")).then(function(color){return self.setColor(color),super_.parser.call(self)})}}),Class=LatexCmds["class"]=P(MathCommand,function(_,super_){_.parser=function(){var self=this,string=Parser.string,regex=Parser.regex;return Parser.optWhitespace.then(string("{")).then(regex(/^[-\w\s\\\xA0-\xFF]*/)).skip(string("}")).then(function(cls){return self.htmlTemplate="<span class=\"mq-class "+cls+"\">&0</span>",super_.parser.call(self)})}}),SupSub=P(MathCommand,function(_,super_){_.ctrlSeq="_{...}^{...}",_.createLeftOf=function(cursor){return!cursor[L]&&cursor.options.supSubsRequireOperand?void 0:super_.createLeftOf.apply(this,arguments)},_.contactWeld=function(cursor){for(var dir=L;dir;dir=!(dir!==L)&&R)if(this[dir]instanceof SupSub){for(var supsub="sub";supsub;supsub=!("sub"!==supsub)&&"sup"){var src=this[supsub],dest=this[dir][supsub];if(src){if(!dest)this[dir].addBlock(src.disown());else if(!src.isEmpty()){src.jQ.children().insAtDirEnd(-dir,dest.jQ);var children=src.children().disown(),pt=Point(dest,children.ends[R],dest.ends[L]);dir===L?children.adopt(dest,dest.ends[R],0):children.adopt(dest,0,dest.ends[L])}else var pt=Point(dest,0,dest.ends[L]);this.placeCursor=function(dest,src){return function(cursor){cursor.insAtDirEnd(-dir,dest||src)}}(dest,src)}}this.remove(),cursor&&cursor[L]===this&&(dir===R&&pt?pt[L]?cursor.insRightOf(pt[L]):cursor.insAtLeftEnd(pt.parent):cursor.insRightOf(this[dir]));break}this.respace()},Options.p.charsThatBreakOutOfSupSub="",_.finalizeTree=function(){this.ends[L].write=function(cursor,ch){if(cursor.options.autoSubscriptNumerals&&this===this.parent.sub){if("_"===ch)return;var cmd=this.chToCmd(ch);return cmd instanceof _Symbol?cursor.deleteSelection():cursor.clearSelection().insRightOf(this.parent),cmd.createLeftOf(cursor.show())}cursor[L]&&!cursor[R]&&!cursor.selection&&-1<cursor.options.charsThatBreakOutOfSupSub.indexOf(ch)&&cursor.insRightOf(this.parent),MathBlock.p.write.apply(this,arguments)}},_.moveTowards=function(dir,cursor){cursor.options.autoSubscriptNumerals&&!this.sup?cursor.insDirOf(dir,this):super_.moveTowards.apply(this,arguments)},_.deleteTowards=function(dir,cursor){if(cursor.options.autoSubscriptNumerals&&this.sub){var cmd=this.sub.ends[-dir];cmd instanceof _Symbol?cmd.remove():cmd&&cmd.deleteTowards(dir,cursor.insAtDirEnd(-dir,this.sub)),this.sub.isEmpty()&&(this.sub.deleteOutOf(L,cursor.insAtLeftEnd(this.sub)),this.sup&&cursor.insDirOf(-dir,this))}else super_.deleteTowards.apply(this,arguments)},_.latex=function(){function latex(prefix,block){var l=block&&block.latex();return block?prefix+(1===l.length?l:"{"+(l||" ")+"}"):""}return latex("_",this.sub)+latex("^",this.sup)},_.respace=_.siblingCreated=_.siblingDeleted=function(opts,dir){dir===R||this.jQ.toggleClass("mq-limit","\\int "===this[L].ctrlSeq)},_.addBlock=function(block){"sub"===this.supsub?(this.sup=this.upInto=this.sub.upOutOf=block,block.adopt(this,this.sub,0).downOutOf=this.sub,block.jQ=$("<span class=\"mq-sup\"/>").append(block.jQ.children()).attr("mathquill-block-id",block.id).prependTo(this.jQ)):(this.sub=this.downInto=this.sup.downOutOf=block,block.adopt(this,0,this.sup).upOutOf=this.sup,block.jQ=$("<span class=\"mq-sub\"></span>").append(block.jQ.children()).attr("mathquill-block-id",block.id).appendTo(this.jQ.removeClass("mq-sup-only")),this.jQ.append("<span style=\"display:inline-block;width:0\">&#8203;</span>"));for(var i=0;2>i;i+=1)(function(cmd,supsub,oppositeSupsub,updown){cmd[supsub].deleteOutOf=function(dir,cursor){if(cursor.insDirOf(this[dir]?-dir:dir,this.parent),!this.isEmpty()){var end=this.ends[dir];this.children().disown().withDirAdopt(dir,cursor.parent,cursor[dir],cursor[-dir]).jQ.insDirOf(-dir,cursor.jQ),cursor[-dir]=end}cmd.supsub=oppositeSupsub,delete cmd[supsub],delete cmd[updown+"Into"],cmd[oppositeSupsub][updown+"OutOf"]=insLeftOfMeUnlessAtEnd,delete cmd[oppositeSupsub].deleteOutOf,"sub"===supsub&&$(cmd.jQ.addClass("mq-sup-only")[0].lastChild).remove(),this.remove()}})(this,["sub","sup"][i],["sup","sub"][i],["down","up"][i])}});LatexCmds.subscript=LatexCmds._=P(SupSub,function(_,super_){_.supsub="sub",_.htmlTemplate="<span class=\"mq-supsub mq-non-leaf\"><span class=\"mq-sub\">&0</span><span style=\"display:inline-block;width:0\">&#8203;</span></span>",_.textTemplate=["_"],_.finalizeTree=function(){this.downInto=this.sub=this.ends[L],this.sub.upOutOf=insLeftOfMeUnlessAtEnd,super_.finalizeTree.call(this)}}),LatexCmds.superscript=LatexCmds.supscript=LatexCmds["^"]=P(SupSub,function(_,super_){_.supsub="sup",_.htmlTemplate="<span class=\"mq-supsub mq-non-leaf mq-sup-only\"><span class=\"mq-sup\">&0</span></span>",_.textTemplate=["^"],_.finalizeTree=function(){this.upInto=this.sup=this.ends[R],this.sup.downOutOf=insLeftOfMeUnlessAtEnd,super_.finalizeTree.call(this)}});var SummationNotation=P(MathCommand,function(_,super_){_.init=function(ch,html){_Symbol.prototype.init.call(this,ch,"<span class=\"mq-large-operator mq-non-leaf\"><span class=\"mq-to\"><span>&1</span></span><big>"+html+"</big><span class=\"mq-from\"><span>&0</span></span></span>")},_.createLeftOf=function(cursor){super_.createLeftOf.apply(this,arguments),cursor.options.sumStartsWithNEquals&&(Letter("n").createLeftOf(cursor),Equality().createLeftOf(cursor))},_.latex=function(){function simplify(latex){return 1===latex.length?latex:"{"+(latex||" ")+"}"}return this.ctrlSeq+"_"+simplify(this.ends[L].latex())+"^"+simplify(this.ends[R].latex())},_.parser=function(){for(var string=Parser.string,optWhitespace=Parser.optWhitespace,succeed=Parser.succeed,block=latexMathParser.block,self=this,blocks=self.blocks=[MathBlock(),MathBlock()],i=0;i<blocks.length;i+=1)blocks[i].adopt(self,self.ends[R],0);return optWhitespace.then(string("_").or(string("^"))).then(function(supOrSub){var child=blocks["_"===supOrSub?0:1];return block.then(function(block){return block.children().adopt(child,child.ends[R],0),succeed(self)})}).many().result(self)},_.finalizeTree=function(){this.downInto=this.ends[L],this.upInto=this.ends[R],this.ends[L].upOutOf=this.ends[R],this.ends[R].downOutOf=this.ends[L]}});LatexCmds["\u2211"]=LatexCmds.sum=LatexCmds.summation=bind(SummationNotation,"\\sum ","&sum;"),LatexCmds["\u220F"]=LatexCmds.prod=LatexCmds.product=bind(SummationNotation,"\\prod ","&prod;"),LatexCmds.coprod=LatexCmds.coproduct=bind(SummationNotation,"\\coprod ","&#8720;");var Fraction=LatexCmds.frac=LatexCmds.dfrac=LatexCmds.cfrac=LatexCmds.fraction=P(MathCommand,function(_){_.ctrlSeq="\\frac",_.htmlTemplate="<span class=\"mq-fraction mq-non-leaf\"><span class=\"mq-numerator\">&0</span><span class=\"mq-denominator\">&1</span><span style=\"display:inline-block;width:0\">&#8203;</span></span>",_.textTemplate=["(",")/(",")"],_.finalizeTree=function(){this.upInto=this.ends[R].upOutOf=this.ends[L],this.downInto=this.ends[L].downOutOf=this.ends[R]}}),LiveFraction=LatexCmds.over=CharCmds["/"]=P(Fraction,function(_,super_){_.createLeftOf=function(cursor){if(!this.replacedFragment){for(var leftward=cursor[L];leftward&&!(leftward instanceof BinaryOperator||leftward instanceof(LatexCmds.text||noop)||leftward instanceof SummationNotation||"\\ "===leftward.ctrlSeq||/^[,;:]$/.test(leftward.ctrlSeq));)leftward=leftward[L];leftward instanceof SummationNotation&&leftward[R]instanceof SupSub&&(leftward=leftward[R],leftward[R]instanceof SupSub&&leftward[R].ctrlSeq!=leftward.ctrlSeq&&(leftward=leftward[R])),leftward!==cursor[L]&&(this.replaces(Fragment(leftward[R]||cursor.parent.ends[L],cursor[L])),cursor[L]=leftward)}super_.createLeftOf.call(this,cursor)}}),SquareRoot=LatexCmds.sqrt=LatexCmds["\u221A"]=P(MathCommand,function(_,super_){_.ctrlSeq="\\sqrt",_.htmlTemplate="<span class=\"mq-non-leaf\"><span class=\"mq-scaled mq-sqrt-prefix\">&radic;</span><span class=\"mq-non-leaf mq-sqrt-stem\">&0</span></span>",_.textTemplate=["sqrt(",")"],_.parser=function(){return latexMathParser.optBlock.then(function(optBlock){return latexMathParser.block.map(function(block){var nthroot=NthRoot();return nthroot.blocks=[optBlock,block],optBlock.adopt(nthroot,0,0),block.adopt(nthroot,optBlock,0),nthroot})}).or(super_.parser.call(this))},_.reflow=function(){var block=this.ends[R].jQ;scale(block.prev(),1,block.innerHeight()/+block.css("fontSize").slice(0,-2)-.1)}}),Vec=LatexCmds.vec=P(MathCommand,function(_){_.ctrlSeq="\\vec",_.htmlTemplate="<span class=\"mq-non-leaf\"><span class=\"mq-vector-prefix\">&rarr;</span><span class=\"mq-vector-stem\">&0</span></span>",_.textTemplate=["vec(",")"]}),NthRoot=LatexCmds.nthroot=P(SquareRoot,function(_){_.htmlTemplate="<sup class=\"mq-nthroot mq-non-leaf\">&0</sup><span class=\"mq-scaled\"><span class=\"mq-sqrt-prefix mq-scaled\">&radic;</span><span class=\"mq-sqrt-stem mq-non-leaf\">&1</span></span>",_.textTemplate=["sqrt[","](",")"],_.latex=function(){return"\\sqrt["+this.ends[L].latex()+"]{"+this.ends[R].latex()+"}"}}),Bracket=P(P(MathCommand,DelimsMixin),function(_,super_){_.init=function(side,open,close,ctrlSeq,end){super_.init.call(this,"\\left"+ctrlSeq,void 0,[open,close]),this.side=side,this.sides={},this.sides[L]={ch:open,ctrlSeq:ctrlSeq},this.sides[R]={ch:close,ctrlSeq:end}},_.numBlocks=function(){return 1},_.html=function(){return this.htmlTemplate="<span class=\"mq-non-leaf\"><span class=\"mq-scaled mq-paren"+(this.side===R?" mq-ghost":"")+"\">"+this.sides[L].ch+"</span><span class=\"mq-non-leaf\">&0</span><span class=\"mq-scaled mq-paren"+(this.side===L?" mq-ghost":"")+"\">"+this.sides[R].ch+"</span></span>",super_.html.call(this)},_.latex=function(){return"\\left"+this.sides[L].ctrlSeq+this.ends[L].latex()+"\\right"+this.sides[R].ctrlSeq},_.oppBrack=function(opts,node,expectedSide){return node instanceof Bracket&&node.side&&node.side!==-expectedSide&&("|"===this.sides[this.side].ch||node.side===-this.side)&&(!opts.restrictMismatchedBrackets||OPP_BRACKS[this.sides[this.side].ch]===node.sides[node.side].ch||{"(":"]","[":")"}[this.sides[L].ch]===node.sides[R].ch)&&node},_.closeOpposing=function(brack){brack.side=0,brack.sides[this.side]=this.sides[this.side],brack.delimjQs.eq(this.side===L?0:1).removeClass("mq-ghost").html(this.sides[this.side].ch)},_.createLeftOf=function(cursor){if(!this.replacedFragment)var opts=cursor.options,brack=this.oppBrack(opts,cursor[L],L)||this.oppBrack(opts,cursor[R],R)||this.oppBrack(opts,cursor.parent.parent);if(brack){var side=this.side=-brack.side;this.closeOpposing(brack),brack===cursor.parent.parent&&cursor[side]&&(Fragment(cursor[side],cursor.parent.ends[side],-side).disown().withDirAdopt(-side,brack.parent,brack,brack[side]).jQ.insDirOf(side,brack.jQ),brack.bubble("reflow"))}else brack=this,side=brack.side,brack.replacedFragment?brack.side=0:cursor[-side]&&(brack.replaces(Fragment(cursor[-side],cursor.parent.ends[-side],side)),cursor[-side]=0),super_.createLeftOf.call(brack,cursor);side===L?cursor.insAtLeftEnd(brack.ends[L]):cursor.insRightOf(brack)},_.placeCursor=noop,_.unwrap=function(){this.ends[L].children().disown().adopt(this.parent,this,this[R]).jQ.insertAfter(this.jQ),this.remove()},_.deleteSide=function(side,outward,cursor){var parent=this.parent,sib=this[side],farEnd=parent.ends[side];if(side===this.side)return this.unwrap(),void(sib?cursor.insDirOf(-side,sib):cursor.insAtDirEnd(side,parent));var opts=cursor.options,wasSolid=!this.side;if(this.side=-side,this.oppBrack(opts,this.ends[L].ends[this.side],side)){this.closeOpposing(this.ends[L].ends[this.side]);var origEnd=this.ends[L].ends[side];this.unwrap(),origEnd.siblingCreated&&origEnd.siblingCreated(cursor.options,side),sib?cursor.insDirOf(-side,sib):cursor.insAtDirEnd(side,parent)}else{if(this.oppBrack(opts,this.parent.parent,side))this.parent.parent.closeOpposing(this),this.parent.parent.unwrap();else{if(outward&&wasSolid)return this.unwrap(),void(sib?cursor.insDirOf(-side,sib):cursor.insAtDirEnd(side,parent));this.sides[side]={ch:OPP_BRACKS[this.sides[this.side].ch],ctrlSeq:OPP_BRACKS[this.sides[this.side].ctrlSeq]},this.delimjQs.removeClass("mq-ghost").eq(side===L?0:1).addClass("mq-ghost").html(this.sides[side].ch)}if(sib){var origEnd=this.ends[L].ends[side];Fragment(sib,farEnd,-side).disown().withDirAdopt(-side,this.ends[L],origEnd,0).jQ.insAtDirEnd(side,this.ends[L].jQ.removeClass("mq-empty")),origEnd.siblingCreated&&origEnd.siblingCreated(cursor.options,side),cursor.insDirOf(-side,sib)}else outward?cursor.insDirOf(side,this):cursor.insAtDirEnd(side,this.ends[L])}},_.deleteTowards=function(dir,cursor){this.deleteSide(-dir,!1,cursor)},_.finalizeTree=function(){this.ends[L].deleteOutOf=function(dir,cursor){this.parent.deleteSide(dir,!0,cursor)},this.finalizeTree=this.intentionalBlur=function(){this.delimjQs.eq(this.side===L?1:0).removeClass("mq-ghost"),this.side=0}},_.siblingCreated=function(opts,dir){dir===-this.side&&this.finalizeTree()}}),OPP_BRACKS={"(":")",")":"(","[":"]","]":"[","{":"}","}":"{","\\{":"\\}","\\}":"\\{","&lang;":"&rang;","&rang;":"&lang;","\\langle ":"\\rangle ","\\rangle ":"\\langle ","|":"|"};bindCharBracketPair("("),bindCharBracketPair("["),bindCharBracketPair("{","\\{"),LatexCmds.langle=bind(Bracket,L,"&lang;","&rang;","\\langle ","\\rangle "),LatexCmds.rangle=bind(Bracket,R,"&lang;","&rang;","\\langle ","\\rangle "),CharCmds["|"]=bind(Bracket,L,"|","|","|","|"),LatexCmds.left=P(MathCommand,function(_){_.parser=function(){var regex=Parser.regex,string=Parser.string,succeed=Parser.succeed,optWhitespace=Parser.optWhitespace;return optWhitespace.then(regex(/^(?:[([|]|\\\{)/)).then(function(ctrlSeq){var open="\\"===ctrlSeq.charAt(0)?ctrlSeq.slice(1):ctrlSeq;return latexMathParser.then(function(block){return string("\\right").skip(optWhitespace).then(regex(/^(?:[\])|]|\\\})/)).map(function(end){var close="\\"===end.charAt(0)?end.slice(1):end,cmd=Bracket(0,open,close,ctrlSeq,end);return cmd.blocks=[block],block.adopt(cmd,0,0),cmd})})})}}),LatexCmds.right=P(MathCommand,function(_){_.parser=function(){return Parser.fail("unmatched \\right")}});var Binomial=LatexCmds.binom=LatexCmds.binomial=P(P(MathCommand,DelimsMixin),function(_){_.ctrlSeq="\\binom",_.htmlTemplate="<span class=\"mq-non-leaf\"><span class=\"mq-paren mq-scaled\">(</span><span class=\"mq-non-leaf\"><span class=\"mq-array mq-non-leaf\"><span>&0</span><span>&1</span></span></span><span class=\"mq-paren mq-scaled\">)</span></span>",_.textTemplate=["choose(",",",")"]}),Choose=LatexCmds.choose=P(Binomial,function(_){_.createLeftOf=LiveFraction.prototype.createLeftOf});LatexCmds.editable=LatexCmds.MathQuillMathField=P(MathCommand,function(_,super_){_.ctrlSeq="\\MathQuillMathField",_.htmlTemplate="<span class=\"mq-editable-field\"><span class=\"mq-root-block\">&0</span></span>",_.parser=function(){var self=this,string=Parser.string,regex=Parser.regex,succeed=Parser.succeed;return string("[").then(regex(/^[a-z][a-z0-9]*/i)).skip(string("]")).map(function(name){self.name=name}).or(succeed()).then(super_.parser.call(self))},_.finalizeTree=function(){var ctrlr=Controller(this.ends[L],this.jQ,Options());ctrlr.KIND_OF_MQ="MathField",ctrlr.editable=!0,ctrlr.createTextarea(),ctrlr.editablesTextareaEvents(),ctrlr.cursor.insAtRightEnd(ctrlr.root),RootBlockMixin(ctrlr.root)},_.registerInnerField=function(innerFields,MathField){innerFields.push(innerFields[this.name]=MathField(this.ends[L].controller))},_.latex=function(){return this.ends[L].latex()},_.text=function(){return this.ends[L].text()}});var Embed=LatexCmds.embed=P(_Symbol,function(_){_.setOptions=function(options){function noop(){return""}return this.text=options.text||noop,this.htmlTemplate=options.htmlString||"",this.latex=options.latex||noop,this},_.parser=function(){var self=this;return string=Parser.string,regex=Parser.regex,succeed=Parser.succeed,string("{").then(regex(/^[a-z][a-z0-9]*/i)).skip(string("}")).then(function(name){return string("[").then(regex(/^[-\w\s]*/)).skip(string("]")).or(succeed()).map(function(data){return self.setOptions(EMBEDS[name](data))})})}}),MQ1=getInterface(1);for(var key in MQ1)(function(key,val){"function"==typeof val?(MathQuill[key]=function(){return insistOnInterVer(),val.apply(this,arguments)},MathQuill[key].prototype=val.prototype):MathQuill[key]=val})(key,MQ1[key]);return MathQuill}),define("tpl!taoQtiItem/qtiCreator/editor/mathInput/tpl/mathInput",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{},"<div class=\"math-input\">\n <div class=\"math-input-toolbar\"></div>\n <div class=\"math-input-form\">\n <span class=\"math-input-mathquill\"></span>\n </div>\n</div>"})}),define("css!taoQtiItem/lib/mathquill/mathquill",[],function(){}),define("taoQtiItem/qtiCreator/editor/mathInput/mathInput",["lodash","i18n","jquery","ui/component","taoQtiItem/lib/mathquill/mathquill","tpl!taoQtiItem/qtiCreator/editor/mathInput/tpl/mathInput","css!taoQtiItem/lib/mathquill/mathquill"],function(_,__,$,componentFactory,MathQuill,layoutTpl){'use strict';function createToolbar($container,mathField){$container.empty(),_.forOwn(allToolGroups,function(toolGroup){$container.append(createToolGroup(toolGroup.tools,toolGroup.id))}),$container.off("mousedown.mathInputWysiwyg").on("mousedown.mathInputWysiwyg",function(e){var $target=$(e.target),fn=$target.data("fn"),latex=$target.data("latex");e.stopPropagation(),e.preventDefault();"cmd"===fn?mathField.cmd(latex):"write"===fn?mathField.write(latex):void 0;mathField.focus()})}function createToolGroup(toolGroup,toolGroupId){var $toolGroup=$("<div>",{class:"math-input-toolgroup","data-identifier":toolGroupId});return toolGroup.forEach(function(toolId){var toolConfig=allTools[toolId];toolConfig.id=toolId,$toolGroup.append(createTool(toolConfig))}),$toolGroup}function createTool(config){return $("<button>",{class:"small btn-info math-input-tool","data-identifier":config.id,"data-latex":config.latex,"data-fn":config.fn,title:config.desc,html:config.label})}var allTools={frac:{label:"x/y",latex:"\\frac",fn:"cmd",desc:__("Fraction")},sqrt:{label:"&radic;",latex:"\\sqrt",fn:"cmd",desc:__("Square root")},exp:{label:"x&#8319;",latex:"^",fn:"cmd",desc:__("Exponent")},log:{label:"log",latex:"\\log",fn:"cmd",desc:__("Log")},ln:{label:"ln",latex:"\\ln",fn:"cmd",desc:__("Ln")},e:{label:"&#8494;",latex:"\\mathrm{e}",fn:"write",desc:__("Euler's constant")},infinity:{label:"&#8734;",latex:"\\infty",fn:"cmd",desc:__("Infinity")},lbrack:{label:"[",latex:"\\lbrack",fn:"cmd",desc:__("Left bracket")},rbrack:{label:"]",latex:"\\rbrack",fn:"cmd",desc:__("Right bracket")},pi:{label:"&pi;",latex:"\\pi",fn:"cmd",desc:__("Pi")},cos:{label:"cos",latex:"\\cos",fn:"cmd",desc:__("Cosinus")},sin:{label:"sin",latex:"\\sin",fn:"cmd",desc:__("Sinus")},lte:{label:"&le;",latex:"\\le",fn:"cmd",desc:__("Lower than or equal")},gte:{label:"&ge;",latex:"\\ge",fn:"cmd",desc:__("Greater than or equal")},times:{label:"&times;",latex:"\\times",fn:"cmd",desc:__("Multiply")},divide:{label:"&divide;",latex:"\\div",fn:"cmd",desc:__("Divide")},plusminus:{label:"&#177;",latex:"\\pm",fn:"cmd",desc:__("Plus/minus")}},allToolGroups=[{id:"functions",tools:["sqrt","frac","exp","log","ln"]},{id:"symbols",tools:["e","infinity","lbrack","rbrack"]},{id:"trigo",tools:["pi","sin","cos"]},{id:"comparison",tools:["lte","gte"]},{id:"operands",tools:["times","divide","plusminus"]}];return function(){return componentFactory({setLatex:function(latexString){this.mathField&&this.mathField.latex(latexString)},getLatex:function(){if(this.mathField)return this.mathField.latex()},_initMathQuill:function($element){var self=this,MQ=MathQuill.getInterface(2);this.mathField=MQ.MathField($element.get(0),{spaceBehavesLikeTab:!0,handlers:{edit:function(){self.trigger("change",self.mathField.latex())}}})}}).setTemplate(layoutTpl).on("render",function(){var $component=this.getElement(),$toolbar=$component.find(".math-input-toolbar"),$inputField=$component.find(".math-input-mathquill");this._initMathQuill($inputField),createToolbar($toolbar,this.mathField),$inputField.on("mousedown.mathInputWysiwyg",function(e){e.stopPropagation()})}).on("destroy",function(){var $component=this.getElement(),$toolbar=$component.find(".math-input-toolbar"),$inputField=$component.find(".math-input-mathquill");$toolbar.off(".mathInputWysiwyg"),$inputField.off(".mathInputWysiwyg"),this.mathField&&(this.mathField.revert().html(),this.mathField=null)})}}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/choiceSelector",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program3(depth0,data){var buffer="",stack1,helper;return buffer+="\n <option value=\"",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" title=\"",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n ",buffer}function program4(){return"selected=\"selected\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"choices-selector\">\n <select ",stack1=helpers["if"].call(depth0,depth0&&depth0.multiple,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"multiple=\"multiple\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" placeholder=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Enter choices\u2026",options):helperMissing.call(depth0,"__","Enter choices\u2026",options)))+"\" data-has-search=\"false\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.options,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n\n </select>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/editor/response/choiceSelector",["jquery","lodash","i18n","ui/component","tpl!taoQtiItem/qtiCreator/tpl/toolbars/choiceSelector","select2"],function($,_,__,component,choiceSelectorTpl){'use strict';function formatOption(state){var title=$(state.element).attr("title");return title?"<span title=\""+title+"\">"+state.text+"</span>":state.text}function createOptionTitle(content,threshold){var fullText=$("<div>",{html:content}).text().trim().replace(/\s+/g," "),shortText=fullText.substr(0,threshold);return 5>=fullText.length-shortText.length?fullText:shortText+"\u2026"}var _defaults={titleLength:0},init=function(){var selected=_.map(this.config.choices||[],function(c){return c.id()}),choices=this.config.interaction.getChoices(),response=this.config.interaction.getResponseDeclaration(),config=_.defaults(this.config||{},_defaults);config.multiple=response.isCardinality(["multiple","ordered"]),config.options=[],_.each(choices,function(choice){var id=choice.id(),choiceText="",option={value:id,label:id,selected:-1<selected.indexOf(id)};if(choice.is("containerChoice"))choiceText=choice.body();else if(choice.is("textVariableChoice"))choiceText=choice.val();else return;config.titleLength&&(option.title=createOptionTitle(choiceText,config.titleLength)),config.options.push(option)})},destroy=function(){this.$component.find("select").select2("destroy")},render=function(){var self=this,$selectBox=this.$component.find("select");$selectBox.select2({dropdownAutoWidth:!0,placeholder:$selectBox.attr("placeholder"),minimumResultsForSearch:-1,formatResult:formatOption,formatSelection:formatOption}).on("change",function(){var selection=$selectBox.select2("val");self.setSelectedChoices(_.isArray(selection)?selection:[selection]),self.trigger("change",self.getSelectedChoices())})};return function(config){var _selectedChoices={},choices={};_.each(config.interaction.getChoices(),function(choice){choices[choice.id()]=choice});return component({getSelectedChoices:function getSelectedChoices(){return _selectedChoices},setSelectedChoices:function setSelectedChoices(choicesId){_selectedChoices=_.map(choicesId,function(id){return choices[id]})}}).on("init",init).on("destroy",destroy).on("render",render).setTemplate(choiceSelectorTpl).init(config)}}),define("taoQtiItem/qtiCreator/editor/simpleContentEditableElement",["jquery","lodash"],function($,_){"use strict";return{create:function($container,selector,callback){function _init($elt){$elt.attr("contenteditable",!0).addClass("simple-editable")}_init($container.find(selector)),$container.on("mouseenter.simpleeditable",selector,_.throttle(function(){var $elt=$(this);$elt.attr("contenteditable")||_init($elt)},200)).on("keyup.simpleeditable",selector,_.throttle(function(){callback($(this).text())},200)).on("keydown.simpleeditable",selector,function(e){13===e.which&&(e.preventDefault(),$(this).blur())})},destroy:function($container){$container.find(".simple-editable").removeClass("simple-editable").removeAttr("contenteditable"),$container.off(".simpleeditable")}}}),define("taoQtiItem/qtiCreator/helper/devTools",["lodash","jquery","taoQtiItem/qtiCreator/helper/xmlRenderer","taoQtiItem/qtiCreator/model/helper/event"],function(_,$,xmlRenderer,event){"use strict";var _formatXml=function(xml){return vkbeautify.xml(xml,"\t")},_printXml=function(rawXml,$destination){var $code=$(),xml=_formatXml(rawXml);xml=xml.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"),$destination.hasClass("language-markup")?$code=$destination:($code=$destination.find("code.language-markup"),!$code.length&&($code=$("<code>",{class:"language-markup"}),$destination.addClass("line-numbers").html($code))),$code.length&&($code.html(xml),Prism.highlightElement($code[0]))};return{listenStateChange:function(){$(document).on("afterStateInit.qti-widget",function(e,element,state){console.log("->state : "+state.name+" : "+element.serial)}).on("afterStateExit.qti-widget",function(e,element,state){console.log("<-state : "+state.name+" : "+element.serial)})},getStates:function(item){var states={},elements=item.getComposingElements();return _.each(elements,function(element){var widget=element.data("widget");widget&&(states[element.getSerial()]=widget.getCurrentState().name)}),states},liveXmlPreview:function(item,$destination){$(document).on(event.getList().join(" "),_.throttle(function(){var rawXml=xmlRenderer.render(item);_printXml(rawXml,$destination)},200))}}}),define("taoQtiItem/qtiCreator/helper/dummyElement",["jquery","lodash"],function($,_){'use strict';var dummyElement=function(){var types={maths:{icon:"maths",css:{width:40,height:24}},image:{icon:"image",css:{width:50,height:35}},video:{icon:"video",css:{width:200,height:150}},media:{icon:"media",css:{width:150,height:100}},include:{icon:"shared-file",css:{width:"100%",height:100}},printedVariable:{icon:"variable",css:{width:40,height:16}},_tooltip:{icon:"tooltip",css:{width:40,height:24}}};return{get:function get(arg){var options={element:"span",class:"dummy-element",css:{width:80,height:22}},element,$element,$icon,css,finalOptions;return arg&&($.isPlainObject(arg)?(arg.class&&(options.class+=" "+arg.class,delete arg.class),options=$.extend(!0,{},options,arg)):types[arg]&&(options=$.extend({},options,types[arg]))),$icon=!!options.icon&&$("<span>",{class:"icon-"+options.icon.replace("icon-","")}),element="<"+options.element+">",css=_.cloneDeep(options.css),css["font-size"]=css.height&&!css["font-size"]?.8*css.height:14,css["line-height"]=(css["font-size"]+2).toString()+"px",30<css.height&&(css["padding-top"]=.9*((css.height-css["font-size"])/2)),css.height&&100<css.height&&(css["background-size"]="auto"),finalOptions=_.cloneDeep(options),delete finalOptions.icon,delete finalOptions.element,delete finalOptions.css,$element=$(element,finalOptions).css(css),$icon&&$element.append($icon),$element}}}();return dummyElement}),define("taoQtiItem/qtiCreator/helper/windowPopup",["lodash","jquery","ui/component","ui/component/draggable","ui/component/resizable","ui/component/stackable","ui/component/windowed"],function(_,$,componentFactory,makeDraggable,makeResizable,makeStackable,makeWindowed){'use strict';var defaultConfig={draggable:!0,resizable:!0};return function(specs,config){var windowPopup;return config=_.defaults(config||{},defaultConfig),windowPopup=componentFactory(specs,config),config.draggable&&makeDraggable(windowPopup),config.resizable&&makeResizable(windowPopup),makeStackable(windowPopup,{stackingScope:"qti-creator"}),makeWindowed(windowPopup),windowPopup.on("render",function(){var $component=this.getElement();$component.addClass("window-popup")}),windowPopup}}),define("taoQtiItem/qtiItem/core/choices/Choice",["taoQtiItem/qtiItem/core/IdentifiedElement"],function(IdentifiedElement){'use strict';IdentifiedElement=IdentifiedElement&&Object.prototype.hasOwnProperty.call(IdentifiedElement,"default")?IdentifiedElement["default"]:IdentifiedElement;var Choice=IdentifiedElement.extend({init:function init(serial,attributes){this._super(serial,attributes)},is:function is(qtiClass){return"choice"===qtiClass||this._super(qtiClass)},getInteraction:function getInteraction(){var ret=null,item=this.getRootElement(),found;return item&&(found=item.find(this.serial),found&&(ret=found.parent)),ret}});return Choice}),define("taoQtiItem/qtiItem/core/choices/Hotspot",["taoQtiItem/qtiItem/core/choices/Choice"],function(QtiChoice){'use strict';QtiChoice=QtiChoice&&Object.prototype.hasOwnProperty.call(QtiChoice,"default")?QtiChoice["default"]:QtiChoice;var QtiHotspot=QtiChoice.extend({});return QtiHotspot}),define("taoQtiItem/qtiItem/core/choices/AssociableHotspot",["taoQtiItem/qtiItem/core/choices/Hotspot"],function(QtiHotspot){'use strict';QtiHotspot=QtiHotspot&&Object.prototype.hasOwnProperty.call(QtiHotspot,"default")?QtiHotspot["default"]:QtiHotspot;var QtiAssociableHotspot=QtiHotspot.extend({qtiClass:"associableHotspot"});return QtiAssociableHotspot}),define("taoQtiItem/qtiCreator/model/choices/AssociableHotspot",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/choices/AssociableHotspot"],function(_,editable,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{matchMax:0,matchMin:0}}}),Choice.extend(methods)}),define("taoQtiItem/qtiItem/core/choices/Gap",["taoQtiItem/qtiItem/core/choices/Choice"],function(QtiChoice){'use strict';QtiChoice=QtiChoice&&Object.prototype.hasOwnProperty.call(QtiChoice,"default")?QtiChoice["default"]:QtiChoice;var QtiGap=QtiChoice.extend({qtiClass:"gap"});return QtiGap}),define("taoQtiItem/qtiCreator/model/choices/Gap",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/choices/Gap"],function(_,editable,Gap){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{required:!1}}}),Gap.extend(methods)}),define("taoQtiItem/qtiItem/core/Object",["taoQtiItem/qtiItem/core/Element","lodash","taoQtiItem/qtiItem/helper/rendererConfig"],function(Element,_,rendererConfig){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var QtiObject=Element.extend({qtiClass:"object",getMediaType:function getMediaType(){var type="undefined",mimetype=this.attr("type");return mimetype&&(0===mimetype.indexOf("video")?type="video":0===mimetype.indexOf("audio")?type="audio":0===mimetype.indexOf("image")?type="image":0===mimetype.indexOf("text/html")?type="html":type="object"),type},render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={};switch(this.getMediaType()){case"video":defaultData.video=!0;break;case"audio":defaultData.audio=!0;break;case"html":defaultData.html=!0;break;case"image":default:defaultData.object=!0;}return defaultData.attributes={data:renderer.resolveUrl(this.attr("data"))},defaultData.body=this._alt,this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)},isEmpty:function isEmpty(){return!this.attr("data")}});return QtiObject}),define("taoQtiItem/qtiItem/core/choices/GapImg",["taoQtiItem/qtiItem/core/choices/Choice","taoQtiItem/qtiItem/core/Object"],function(QtiChoice,QtiObject){'use strict';QtiChoice=QtiChoice&&Object.prototype.hasOwnProperty.call(QtiChoice,"default")?QtiChoice["default"]:QtiChoice,QtiObject=QtiObject&&Object.prototype.hasOwnProperty.call(QtiObject,"default")?QtiObject["default"]:QtiObject;var QtiGapImg=QtiChoice.extend({qtiClass:"gapImg",initObject:function initObject(object){this.object=object||new QtiObject},getObject:function getObject(){return this.object}});return QtiGapImg}),define("taoQtiItem/qtiCreator/model/choices/GapImg",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/choices/GapImg"],function(_,editable,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{matchMin:0,matchMax:0}}}),Choice.extend(methods)}),define("taoQtiItem/qtiItem/core/choices/ContainerChoice",["taoQtiItem/qtiItem/core/choices/Choice","taoQtiItem/qtiItem/mixin/Container"],function(Choice,Container){'use strict';Choice=Choice&&Object.prototype.hasOwnProperty.call(Choice,"default")?Choice["default"]:Choice,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container;var ContainerChoice=Choice.extend({init:function init(serial,attributes){this._super(serial,attributes)},is:function is(qtiClass){return"containerChoice"===qtiClass||this._super(qtiClass)}});return Container.augment(ContainerChoice),ContainerChoice}),define("taoQtiItem/qtiItem/core/choices/GapText",["taoQtiItem/qtiItem/core/choices/ContainerChoice"],function(QtiContainerChoice){'use strict';QtiContainerChoice=QtiContainerChoice&&Object.prototype.hasOwnProperty.call(QtiContainerChoice,"default")?QtiContainerChoice["default"]:QtiContainerChoice;var QtiGapText=QtiContainerChoice.extend({qtiClass:"gapText"});return QtiGapText}),define("taoQtiItem/qtiCreator/model/choices/GapText",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/choices/GapText"],function(_,editable,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{fixed:!1,matchMax:1,matchMin:0}}}),Choice.extend(methods)}),define("taoQtiItem/qtiItem/core/choices/HotspotChoice",["taoQtiItem/qtiItem/core/choices/Hotspot"],function(QtiHotspot){'use strict';QtiHotspot=QtiHotspot&&Object.prototype.hasOwnProperty.call(QtiHotspot,"default")?QtiHotspot["default"]:QtiHotspot;var QtiHotspotChoice=QtiHotspot.extend({qtiClass:"hotspotChoice"});return QtiHotspotChoice}),define("taoQtiItem/qtiCreator/model/choices/HotspotChoice",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/choices/HotspotChoice"],function(_,editable,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{}}}),Choice.extend(methods)}),define("taoQtiItem/qtiItem/mixin/ContainerInline",["taoQtiItem/qtiItem/mixin/Mixin","taoQtiItem/qtiItem/mixin/Container","lodash"],function(Mixin,Container,_){'use strict';Mixin=Mixin&&Object.prototype.hasOwnProperty.call(Mixin,"default")?Mixin["default"]:Mixin,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;var methods={};_.extend(methods,Container.methods),_.extend(methods,{initContainer:function initContainer(body){Container.methods.initContainer.call(this,body),this.bdy.contentModel="inlineStatic"}});return{augment:function augment(targetClass){Mixin.augment(targetClass,methods)},methods:methods}}),define("taoQtiItem/qtiItem/core/choices/Hottext",["taoQtiItem/qtiItem/core/choices/Choice","taoQtiItem/qtiItem/mixin/ContainerInline"],function(Choice,Container){'use strict';Choice=Choice&&Object.prototype.hasOwnProperty.call(Choice,"default")?Choice["default"]:Choice,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container;var Hottext=Choice.extend({qtiClass:"hottext"});return Container.augment(Hottext),Hottext}),define("taoQtiItem/qtiCreator/model/choices/Hottext",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/choices/Hottext"],function(_,editable,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{fixed:!1}}}),Choice.extend(methods)}),define("taoQtiItem/qtiItem/core/choices/TextVariableChoice",["jquery","lodash","taoQtiItem/qtiItem/core/choices/Choice","taoQtiItem/qtiItem/helper/rendererConfig"],function($,_,QtiChoice,rendererConfig){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,QtiChoice=QtiChoice&&Object.prototype.hasOwnProperty.call(QtiChoice,"default")?QtiChoice["default"]:QtiChoice,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var QtiTextVariableChoice=QtiChoice.extend({init:function init(serial,attributes,text){this._super(serial,attributes),this.val(text||"")},is:function is(qtiClass){return"textVariableChoice"===qtiClass||this._super(qtiClass)},val:function val(text){if("undefined"==typeof text)return this.text;if("string"==typeof text)this.text=text,$(document).trigger("choiceTextChange",{choice:this,text:text});else throw"text must be a string";return this},render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={body:this.text};return this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)}});return QtiTextVariableChoice}),define("taoQtiItem/qtiItem/core/choices/InlineChoice",["taoQtiItem/qtiItem/core/choices/TextVariableChoice"],function(QtiTextVariableChoice){'use strict';QtiTextVariableChoice=QtiTextVariableChoice&&Object.prototype.hasOwnProperty.call(QtiTextVariableChoice,"default")?QtiTextVariableChoice["default"]:QtiTextVariableChoice;var QtiInlineChoice=QtiTextVariableChoice.extend({qtiClass:"inlineChoice"});return QtiInlineChoice}),define("taoQtiItem/qtiCreator/model/choices/InlineChoice",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/choices/InlineChoice"],function(_,editable,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{fixed:!1,showHide:"show"}}}),Choice.extend(methods)}),define("taoQtiItem/qtiItem/core/choices/SimpleAssociableChoice",["taoQtiItem/qtiItem/core/choices/ContainerChoice"],function(QtiContainerChoice){'use strict';QtiContainerChoice=QtiContainerChoice&&Object.prototype.hasOwnProperty.call(QtiContainerChoice,"default")?QtiContainerChoice["default"]:QtiContainerChoice;var QtiSimpleAssociableChoice=QtiContainerChoice.extend({qtiClass:"simpleAssociableChoice"});return QtiSimpleAssociableChoice}),define("taoQtiItem/qtiCreator/model/choices/SimpleAssociableChoice",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/choices/SimpleAssociableChoice"],function(_,editable,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{fixed:!1,showHide:"show",matchMax:0,matchMin:0}}}),Choice.extend(methods)}),define("taoQtiItem/qtiItem/core/choices/SimpleChoice",["taoQtiItem/qtiItem/core/choices/ContainerChoice"],function(QtiContainerChoice){'use strict';QtiContainerChoice=QtiContainerChoice&&Object.prototype.hasOwnProperty.call(QtiContainerChoice,"default")?QtiContainerChoice["default"]:QtiContainerChoice;var QtiSimpleChoice=QtiContainerChoice.extend({qtiClass:"simpleChoice"});return QtiSimpleChoice}),define("taoQtiItem/qtiCreator/model/choices/SimpleChoice",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/choices/SimpleChoice"],function(_,editable,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{fixed:!1,showHide:"show"}}}),Choice.extend(methods)}),define("taoQtiItem/qtiCreator/model/helper/portableElement",["lodash","jquery","taoQtiItem/qtiItem/helper/util"],function(_,$,util){'use strict';return{getDefaultMethods:function(registry){return{getDefaultAttributes:function getDefaultAttributes(){return{}},getDefaultProperties:function getDefaultProperties(){var creator=registry.getCreator(this.typeIdentifier);return creator&&creator.module&&_.isFunction(creator.module.getDefaultProperties)?creator.getDefaultProperties(this):{}},afterCreate:function afterCreate(){var typeId=this.typeIdentifier,self=this,afterCreatePromise=registry.loadCreators({include:[typeId]}).then(function(){var creator=registry.getCreator(typeId),creatorModule=creator.module,response;creatorModule.getMarkupTemplate(),self.properties=creatorModule.getDefaultProperties(),creator.response&&_.size(creator.response)?(response=self.createResponse({cardinality:creator.response.cardinality}),creator.response.baseType&&response.attr("baseType",creator.response.baseType)):(self.attr("title",creator.label),!self.attr("id")&&self.attr("id",util.buildId(self.getRootElement(),typeId))),self.markup=self.renderMarkup(),self.setNamespace(creator.model,creator.xmlns),_.isFunction(creatorModule.afterCreate)&&creatorModule.afterCreate(self)});return afterCreatePromise},renderMarkup:function renderMarkup(){var creatorModule=registry.getCreator(this.typeIdentifier).module,markupTpl=creatorModule.getMarkupTemplate(),markupData=this.getDefaultMarkupTemplateData();return _.isFunction(creatorModule.getMarkupData)&&(markupData=creatorModule.getMarkupData(this,markupData)),markupTpl(markupData)},updateMarkup:function updateMarkup(){this.markup=this.renderMarkup()}}}}}),define("taoQtiItem/qtiCreator/model/helper/response",["lodash"],function(_){"use strict";return{removeChoice:function removeChoice(response,choice){var escapedIdentifier=choice.id().replace(/([.-])/g,"\\$1"),regex=new RegExp("([^a-z_-d.]*)("+escapedIdentifier+")([^a-z_-d.]*)");_.remove(response.correctResponse,function(entry){return entry.match(regex)});var mapEntries={};_.forIn(response.mapEntries,function(value,mapKey){mapKey.match(regex)||(mapEntries[mapKey]=value)}),response.mapEntries=mapEntries}}}),define("taoQtiItem/qtiItem/core/Img",["taoQtiItem/qtiItem/core/Element","lodash","taoQtiItem/qtiItem/helper/rendererConfig"],function(Element,_,rendererConfig){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var Img=Element.extend({qtiClass:"img",render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={};return defaultData.attributes={src:renderer.resolveUrl(this.attr("src"))},this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)},isEmpty:function isEmpty(){return!this.attr("src")}});return Img}),define("taoQtiItem/qtiCreator/model/Img",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/Img"],function(_,editable,Img){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{src:"",alt:""}},afterCreate:function afterCreate(){this.data("responsive",!0)}}),Img.extend(methods)}),define("taoQtiItem/qtiItem/mixin/NamespacedElement",["taoQtiItem/qtiItem/mixin/Mixin","lodash"],function(Mixin,_){'use strict';Mixin=Mixin&&Object.prototype.hasOwnProperty.call(Mixin,"default")?Mixin["default"]:Mixin,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;var methods={getNamespace:function getNamespace(){var relatedItem,namespaces,ns;if(this.ns&&(this.ns.name||this.ns.uri))return _.clone(this.ns);if(relatedItem=this.getRootElement(),relatedItem){for(ns in namespaces=relatedItem.getNamespaces(),namespaces)if(0<namespaces[ns].indexOf(this.nsUriFragment))return{name:ns,uri:namespaces[ns]};return relatedItem.namespaces[this.defaultNsName]=this.defaultNsUri,{name:this.defaultNsName,uri:this.defaultNsUri}}return{}},setNamespace:function setNamespace(name,uri){this.ns={name:name,uri:uri}}};return{augment:function augment(targetClass){Mixin.augment(targetClass,methods)},methods:methods}}),define("taoQtiItem/qtiItem/core/Include",["taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/mixin/ContainerInline","taoQtiItem/qtiItem/mixin/NamespacedElement"],function(Element,Container,NamespacedElement){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container,NamespacedElement=NamespacedElement&&Object.prototype.hasOwnProperty.call(NamespacedElement,"default")?NamespacedElement["default"]:NamespacedElement;var Include=Element.extend({qtiClass:"include",defaultNsName:"xi",defaultNsUri:"http://www.w3.org/2001/XInclude",nsUriFragment:"XInclude",isEmpty:function isEmpty(){return!this.attr("href")||this.getBody().isEmpty()}});return Container.augment(Include),NamespacedElement.augment(Include),Include}),define("taoQtiItem/qtiCreator/model/Include",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/Include"],function(_,editable,Include){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{}},afterCreate:function afterCreate(){this.getNamespace()}}),Include.extend(methods)}),define("taoQtiItem/qtiItem/core/variables/ResponseDeclaration",["taoQtiItem/qtiItem/core/variables/VariableDeclaration","lodash"],function(VariableDeclaration,_){'use strict';VariableDeclaration=VariableDeclaration&&Object.prototype.hasOwnProperty.call(VariableDeclaration,"default")?VariableDeclaration["default"]:VariableDeclaration,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;var ResponseDeclaration=VariableDeclaration.extend({qtiClass:"responseDeclaration",init:function init(serial,attributes){this._super(serial,attributes),this.template="",this.mappingAttributes={},this.mapEntries={},this.correctResponse=null,this.feedbackRules={}},getFeedbackRules:function getFeedbackRules(){return _.values(this.feedbackRules)},getComposingElements:function getComposingElements(){var elts=this._super();return elts=_.extend(elts,this.feedbackRules),elts},toArray:function toArray(){var arr=this._super();return arr.howMatch=this.template,arr.correctResponses=this.correctResponse,arr.mapping=this.mapEntries,arr.mappingAttributes=this.mappingAttributes,arr.feedbackRules=_.map(this.feedbackRules,function(rule){return rule.toArray()}),arr},getInteraction:function getInteraction(){var interaction=null,responseId=this.id(),item=this.getRootElement(),interactions=item.getInteractions();return _.each(interactions,function(i){if(i.attributes.responseIdentifier===responseId)return interaction=i,!1}),interaction},isCardinality:function isCardinality(cardinalities){var comparison;if(_.isArray(cardinalities))comparison=cardinalities;else if(_.isString(cardinalities))cardinalities=[cardinalities];else return!1;return 0<=_.indexOf(comparison,this.attr("cardinality"))}});return ResponseDeclaration}),define("taoQtiItem/qtiItem/core/response/SimpleFeedbackRule",["taoQtiItem/qtiItem/core/Element","lodash"],function(Element,_){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;var SimpleFeedbackRule=Element.extend({qtiClass:"_simpleFeedbackRule",serial:"",rootElement:null,init:function init(serial,feedbackOutcome,feedbackThen,feedbackElse){this._super(serial,{}),this.condition="correct",this.comparedOutcome=null,this.comparedValue=0,this.feedbackOutcome=feedbackOutcome,this.feedbackThen=Element.isA(feedbackThen,"feedback")?feedbackThen:null,this.feedbackElse=Element.isA(feedbackElse,"feedback")?feedbackThen:null},setCondition:function setCondition(comparedOutcome,condition,comparedValue){var _comparedValues=[];if(Element.isA(comparedOutcome,"variableDeclaration"))switch(condition){case"correct":case"incorrect":if(Element.isA(comparedOutcome,"responseDeclaration"))this.comparedOutcome=comparedOutcome,this.condition=condition;else throw"invalid outcome type: must be a responseDeclaration";break;case"lt":case"lte":case"equal":case"gte":case"gt":if(null!==comparedValue&&void 0!==comparedValue)this.comparedOutcome=comparedOutcome,this.condition=condition,this.comparedValue=comparedValue;else throw"compared value must not be null";break;case"choices":if(Element.isA(comparedOutcome,"responseDeclaration")&&null!==comparedValue&&_.isArray(comparedValue)){var choices=_.values(comparedOutcome.getInteraction().getChoices());this.comparedOutcome=comparedOutcome,this.condition=condition,_.each(comparedValue,function(v){v instanceof Element?_comparedValues.push(v):_.isString(v)&&_.each(choices,function(c){if(c.attr("identifier")===v)return _comparedValues.push(c),!1})}),this.comparedValue=_comparedValues}else throw"compared value must not be null";break;default:throw"unknown condition type : ".condition;}else throw"invalid outcome type: must be a variableDeclaration";return this},setFeedbackElse:function setFeedbackElse(feedback){Element.isA(feedback,"feedback")&&(this.feedbackElse=feedback)},toArray:function toArray(){var val=this.comparedValue,_toString=function(){return val instanceof Element?val.attr("identifier"):val+""};return val=_.isArray(val)?_.map(val,_toString):_toString(),{condition:this.condition,comparedOutcome:this.comparedOutcome.id(),comparedValue:val}}});return SimpleFeedbackRule}),define("taoQtiItem/qtiCreator/model/variables/ResponseDeclaration",["jquery","lodash","ui/hider","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/core/variables/ResponseDeclaration","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/response/SimpleFeedbackRule","taoQtiItem/qtiItem/helper/response"],function($,_,hider,Element,ResponseDeclaration,editable,SimpleFeedbackRule,responseHelper){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{setTemplate:function setTemplate(template){var templateUri=responseHelper.getTemplateUriFromName(template)||null;return this.template!==templateUri&&(this.template=templateUri,$(document).trigger("responseTemplateChange.qti-widget",{element:this,value:template})),this},getTemplate:function getTemplate(){return this.template},resetCorrect:function resetCorrect(){return this.correctResponse=null,$(document).trigger("correctResponseChange.qti-widget",{element:this,value:null}),this},setCorrect:function setCorrect(value){return _.isString(value)&&(value=[value]),this.correctResponse=value,$(document).trigger("correctResponseChange.qti-widget",{element:this,value:value}),this},getCorrect:function getCorrect(){return _.clone(this.correctResponse)},setMappingAttribute:function setMappingAttribute(name,value){this.mappingAttributes[name]=value,$(document).trigger("mappingAttributeChange.qti-widget",{element:this,key:name,value:value})},removeMappingAttribute:function removeMappingAttribute(name){delete this.mappingAttributes[name],$(document).trigger("mappingAttributeChange.qti-widget",{element:this,key:name,value:null})},getMappingAttribute:function getMappingAttribute(name){return this.mappingAttributes[name]},toggleMappingForm:function(){var mappingDisabled=_.isEmpty(this.mapEntries),$panel=this.renderer.getAreaBroker().getPropertyPanelArea();$(".response-mapping-attributes input",$panel).each(function(){$(this).attr("disabled",mappingDisabled)}),hider.toggle($(".response-mapping-attributes",$panel),!mappingDisabled),hider.toggle($(".response-mapping-info",$panel),mappingDisabled)},setMapEntry:function setMapEntry(mapKey,mappedValue,caseSensitive){if(mappedValue=parseFloat(mappedValue),caseSensitive=!!caseSensitive,!!isNaN(mappedValue))this.mapEntries[mapKey]=0;else if("multiple"===this.attr("cardinality")&&"pair"===this.attr("baseType")){var mapKeys=mapKey.split(" "),mapKeysReverse=mapKeys[1]+" "+mapKeys[0];this.mapEntries[mapKeysReverse]?this.mapEntries[mapKeysReverse]=mappedValue:this.mapEntries[mapKey]=mappedValue}else this.mapEntries[mapKey]=mappedValue;return this.toggleMappingForm(),$(document).trigger("mapEntryChange.qti-widget",{element:this,mapKey:mapKey,mappedValue:mappedValue,caseSensitive:caseSensitive}),this},removeMapEntry:function removeMapEntry(mapKey,canBeEmpty){if("undefined"==typeof canBeEmpty&&(canBeEmpty=!1),mapKey||canBeEmpty){if("multiple"===this.attr("cardinality")&&"pair"===this.attr("baseType")){var mapKeys=mapKey.split(" "),mapKeysReverse=mapKeys[1]+" "+mapKeys[0];delete this.mapEntries[mapKeysReverse]}delete this.mapEntries[mapKey],this.toggleMappingForm(),$(document).trigger("mapEntryRemove.qti-widget",{element:this,mapKey:mapKey})}return this},getMapEntries:function getMapEntries(){return _.clone(this.mapEntries)},removeMapEntries:function removeMapEntries(){_(this.mapEntries).keys().forEach(this.removeMapEntry,this)},createFeedbackRule:function createFeedbackRule(){var item=this.getRootElement(),outcome=item.createOutcomeDeclaration({identifier:"FEEDBACK",cardinality:"single",baseType:"identifier"}),modalFeedback=item.createModalFeedback({identifier:"feedbackModal",outcomeIdentifier:outcome.id()},this),rule=new SimpleFeedbackRule("",outcome,modalFeedback);rule.setCondition(this,"correct"),this.feedbackRules[rule.getSerial()]=rule;var renderer=this.getRenderer();return renderer&&(rule.setRenderer(renderer),modalFeedback.setRenderer(renderer)),$(document).trigger("feedbackRuleCreated.qti-widget",{element:this,rule:rule}),rule},getFeedbackRule:function getFeedbackRule(serial){return this.feedbackRules[serial]},getFeedbackRules:function getFeedbackRules(){return _.clone(this.feedbackRules)},setCondition:function setCondition(rule,condition,value){rule.setCondition(this,condition,value),$(document).trigger("feedbackRuleConditionChange.qti-widget",{element:this,rule:rule,condition:condition,value:value})},deleteFeedbackRule:function deleteFeedbackRule(rule){var item=this.getRootElement(),ret;return item.remove("outcomes",rule.feedbackOutcome),item.remove("modalFeedbacks",rule.feedbackThen),item.remove("modalFeedbacks",rule.feedbackElse||""),ret=this.remove("feedbackRules",rule),$(document).trigger("feedbackRuleRemoved.qti-widget",{element:this,rule:rule}),ret},createFeedbackElse:function createFeedbackElse(rule){var modalFeedback;if(Element.isA(rule,"_simpleFeedbackRule")){modalFeedback=this.getRootElement().createModalFeedback({identifier:"feedbackModal",outcomeIdentifier:rule.feedbackOutcome.id()},this),rule.setFeedbackElse(modalFeedback);var renderer=this.getRenderer();renderer&&modalFeedback.setRenderer(renderer),$(document).trigger("feedbackRuleElseCreated.qti-widget",{element:this,rule:rule,modalFeedback:modalFeedback})}return modalFeedback},deleteFeedbackElse:function deleteFeedbackElse(rule){this.getRootElement().remove("modalFeedbacks",rule.feedbackElse),rule.feedbackElse=null,$(document).trigger("feedbackRuleElseRemoved.qti-widget",{element:this,rule:rule})},getDefaultAttributes:function getDefaultAttributes(){return{}}}),ResponseDeclaration.extend(methods)}),define("taoQtiItem/qtiCreator/model/mixin/editableInteraction",["lodash","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/model/variables/ResponseDeclaration","taoQtiItem/qtiCreator/model/helper/event","taoQtiItem/qtiCreator/model/helper/response"],function(_,Element,ResponseDeclaration,event,responseHelper){'use strict';return{removeChoice:function(choice){var serial="",c;return"string"==typeof choice?serial=choice:Element.isA(choice,"choice")&&(serial=choice.getSerial()),this.choices[serial]&&(c=this.choices[serial],delete this.choices[serial],responseHelper.removeChoice(this.getResponseDeclaration(),c),event.choiceDeleted(c,this)),this},createOutcomeDeclarationIfNotExists:function createOutcomeDeclarationIfNotExists(outcomeIdentifier,buildIdentifier){var item=this.getRootElement(),outcome=item.getOutcomeDeclaration(outcomeIdentifier);outcome||(outcome=item.createOutcomeDeclaration({cardinality:"single",baseType:"float"}),buildIdentifier?outcome.buildIdentifier(outcomeIdentifier,!1):outcome.attr("identifier",outcomeIdentifier))},createResponse:function(attrs,template){var response=new ResponseDeclaration,responseProcessing=this.rootElement.responseProcessing,processingType=responseProcessing&&responseProcessing.processingType,item,renderer;attrs&&response.attr(attrs),item=this.getRootElement(),item.addResponseDeclaration(response);var perInteractionRp=item.metaData.widget.options.perInteractionRp;if(response.buildIdentifier("RESPONSE",!1),response.setTemplate("custom"===processingType?"CUSTOM":template||"MATCH_CORRECT"),this.attr("responseIdentifier",response.id()),this.createOutcomeDeclarationIfNotExists("SCORE",!0),perInteractionRp){var outcomeIdentifier="SCORE_".concat(response.attributes.identifier);this.createOutcomeDeclarationIfNotExists(outcomeIdentifier)}return response.mappingAttributes.defaultValue=0,renderer=this.getRenderer(),renderer&&response.setRenderer(renderer),response},deleteResponse:function(){var response=this.getResponseDeclaration();return response&&this.getRootElement().deleteResponseDeclaration(response),this.removeAttr("responseIdentifier"),this},beforeRemove:function(){var _this23=this,item=this.getRootElement(),serial=this.serial,interactions=item.getInteractions(),perInteractionRp=item.metaData.widget.options.perInteractionRp;perInteractionRp&&this.attributes.responseIdentifier&&item.removeOutcome("SCORE_".concat(this.attributes.responseIdentifier)),this.deleteResponse(),2===_.size(interactions)&&_.forEach(interactions,function(interaction){var response=interaction.getResponseDeclaration();response&&interaction.serial!==serial&&"endAttemptInteraction"!==interaction.qtiClass&&(perInteractionRp&&(item.removeOutcome("SCORE_".concat(interaction.attributes.responseIdentifier)),_this23.createOutcomeDeclarationIfNotExists("SCORE_RESPONSE")),interaction.attr("responseIdentifier","RESPONSE"),response.id("RESPONSE"))})}}}),define("taoQtiItem/qtiItem/core/interactions/Interaction",["taoQtiItem/qtiItem/core/Element","lodash","taoQtiItem/qtiItem/helper/rendererConfig","taoQtiItem/qtiItem/helper/util"],function(Element,_,rendererConfig,util){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig,util=util&&Object.prototype.hasOwnProperty.call(util,"default")?util["default"]:util;var QtiInteraction=Element.extend({init:function init(serial,attributes){this._super(serial,attributes),this.choices={}},is:function is(qtiClass){return"interaction"===qtiClass||this._super(qtiClass)},addChoice:function addChoice(choice){return choice.setRootElement(this.getRootElement()||null),this.choices[choice.getSerial()]=choice,this},getChoices:function getChoices(){var choices={};for(var i in this.choices)choices[i]=this.choices[i];return choices},getChoice:function getChoice(serial){var ret=null;return this.choices[serial]&&(ret=this.choices[serial]),ret},getChoiceByIdentifier:function getChoiceByIdentifier(identifier){for(var i in this.choices)if(this.choices[i].id()===identifier)return this.choices[i];return null},getComposingElements:function getComposingElements(){var elts=this._super();for(var serial in this.choices)Element.isA(this.choices[serial],"choice")&&(elts[serial]=this.choices[serial],elts=_.extend(elts,this.choices[serial].getComposingElements()));return elts},find:function find(serial){var found=this._super(serial);return found||(found=util.findInCollection(this,"choices",serial)),found},getResponseDeclaration:function getResponseDeclaration(){var response=null,responseId=this.attr("responseIdentifier");if(responseId){var item=this.getRootElement();if(item)response=item.getResponseDeclaration(responseId);else throw"cannot get response of an interaction out of its item context"}return response},render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={_type:this.qtiClass.replace(/([A-Z])/g,function($1){return"_"+$1.toLowerCase()}),choices:[],choiceShuffle:!0};if(!renderer)throw"no renderer found for the interaction "+this.qtiClass;var choices=this.attr("shuffle")&&renderer.getOption("shuffleChoices")?renderer.getShuffledChoices(this):this.getChoices(),interactionData={interaction:{serial:this.serial,attributes:this.attributes}},_this=this;_.each(choices,function(choice){if(Element.isA(choice,"choice"))try{var renderedChoice=choice.render(_.clone(interactionData,!0),null,choice.qtiClass+"."+_this.qtiClass,renderer);defaultData.choices.push(renderedChoice)}catch(e){}});var tplName=args.subclass?this.qtiClass+"."+args.subclass:this.qtiClass;return this._super(_.merge(defaultData,args.data),args.placeholder,tplName,renderer)},postRender:function postRender(data,altClassName,renderer){var self=this;return renderer=renderer||this.getRenderer(),_(this.getChoices()).filter(function(elt){return Element.isA(elt,"choice")}).map(function(choice){return choice.postRender({},choice.qtiClass+"."+self.qtiClass,renderer)}).value().concat(this._super(data,altClassName,renderer))},setResponse:function setResponse(values){var ret=null,renderer=this.getRenderer();if(renderer)ret=renderer.setResponse(this,values);else throw"no renderer found for the interaction "+this.qtiClass;return ret},getResponse:function getResponse(){var ret=null,renderer=this.getRenderer();if(renderer)ret=renderer.getResponse(this);else throw"no renderer found for the interaction "+this.qtiClass;return ret},resetResponse:function resetResponse(){var ret=null,renderer=this.getRenderer();if(renderer)ret=renderer.resetResponse(this);else throw"no renderer found for the interaction "+this.qtiClass;return ret},getState:function getState(){var ret=null,renderer=this.getRenderer();if(renderer)_.isFunction(renderer.getState)&&(ret=renderer.getState(this));else throw"no renderer found for the interaction "+this.qtiClass;return ret},setState:function setState(state){var renderer=this.getRenderer();if(renderer)_.isFunction(renderer.setState)&&renderer.setState(this,state);else throw"no renderer found for the interaction "+this.qtiClass},clear:function clear(){var renderer=this.getRenderer();if(renderer&&_.isFunction(renderer.destroy))return renderer.destroy(this)},toArray:function toArray(){var arr=this._super();for(var serial in arr.choices={},this.choices)Element.isA(this.choices[serial],"choice")&&(arr.choices[serial]=this.choices[serial].toArray());return arr},getNormalMaximum:function(){return!1}});return QtiInteraction}),define("taoQtiItem/qtiItem/core/interactions/Prompt",["taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/mixin/ContainerInline"],function(Element,Container){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container;var Prompt=Element.extend({qtiClass:"prompt"});return Container.augment(Prompt),Prompt}),define("taoQtiItem/qtiItem/core/interactions/BlockInteraction",["taoQtiItem/qtiItem/core/interactions/Interaction","taoQtiItem/qtiItem/core/interactions/Prompt","lodash","taoQtiItem/qtiItem/helper/rendererConfig"],function(Interaction,Prompt,_,rendererConfig){'use strict';Interaction=Interaction&&Object.prototype.hasOwnProperty.call(Interaction,"default")?Interaction["default"]:Interaction,Prompt=Prompt&&Object.prototype.hasOwnProperty.call(Prompt,"default")?Prompt["default"]:Prompt,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var BlockInteraction=Interaction.extend({init:function init(serial,attributes){this._super(serial,attributes),this.prompt=new Prompt("")},is:function is(qtiClass){return"blockInteraction"===qtiClass||this._super(qtiClass)},getComposingElements:function getComposingElements(){var elts=this._super();return elts=_.extend(elts,this.prompt.getComposingElements()),elts[this.prompt.getSerial()]=this.prompt,elts},find:function find(serial){return this._super(serial)||this.prompt.find(serial)},render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={promptId:"prompt-".concat(this.prompt.getSerial()),prompt:this.prompt.render(renderer)};return this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)},postRender:function postRender(data,altClassName,renderer){return renderer=renderer||this.getRenderer(),[].concat(this.prompt.postRender({},"",renderer)).concat(this._super(data,altClassName,renderer))},toArray:function toArray(){var arr=this._super();return arr.prompt=this.prompt.toArray(),arr}});return BlockInteraction}),define("taoQtiItem/qtiItem/core/interactions/AssociateInteraction",["taoQtiItem/qtiItem/core/interactions/BlockInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(BlockInteraction,maxScore){'use strict';BlockInteraction=BlockInteraction&&Object.prototype.hasOwnProperty.call(BlockInteraction,"default")?BlockInteraction["default"]:BlockInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var AssociateInteraction=BlockInteraction.extend({qtiClass:"associateInteraction",getNormalMaximum:function(){var calculatePossiblePairs=function(associateInteraction){var pairs=[],choices=maxScore.getMatchMaxOrderedChoices(associateInteraction.getChoices()),i,j;for(i=0;i<choices.length;i++)for(j=i;j<choices.length;j++)pairs.push([choices[i].id,choices[j].id]);return pairs};return maxScore.associateInteractionBased(this,{possiblePairs:calculatePossiblePairs(this)})}});return AssociateInteraction}),define("taoQtiItem/qtiCreator/model/interactions/AssociateInteraction",["jquery","lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/AssociateInteraction","taoQtiItem/qtiCreator/model/choices/SimpleAssociableChoice"],function($,_,editable,editableInteraction,Interaction,Choice){var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{shuffle:!1,maxAssociations:0,minAssociations:0}},afterCreate:function afterCreate(){this.createChoice(),this.createChoice(),this.createResponse({baseType:"pair",cardinality:"multiple"})},createChoice:function createChoice(){var choice=new Choice;this.addChoice(choice);var rank=_.size(this.getChoices());return choice.body("choice #"+rank).buildIdentifier("choice"),this.getRenderer()&&choice.setRenderer(this.getRenderer()),$(document).trigger("choiceCreated.qti-widget",{choice:choice,interaction:this}),choice}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/ChoiceInteraction",["taoQtiItem/qtiItem/core/interactions/BlockInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(BlockInteraction,maxScore){'use strict';BlockInteraction=BlockInteraction&&Object.prototype.hasOwnProperty.call(BlockInteraction,"default")?BlockInteraction["default"]:BlockInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var ChoiceInteraction=BlockInteraction.extend({qtiClass:"choiceInteraction",getNormalMaximum:function(){return maxScore.choiceInteractionBased(this)}});return ChoiceInteraction}),define("taoQtiItem/qtiCreator/model/interactions/ChoiceInteraction",["jquery","lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/ChoiceInteraction","taoQtiItem/qtiCreator/model/choices/SimpleChoice"],function($,_,editable,editableInteraction,Interaction,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{shuffle:!1,maxChoices:0,minChoices:0,orientation:"vertical"}},afterCreate:function afterCreate(){this.createChoice(),this.createChoice(),this.createChoice(),this.createResponse({baseType:"identifier",cardinality:"multiple"})},createChoice:function createChoice(){var choice=new Choice;this.addChoice(choice);var rank=_.size(this.getChoices());return choice.body("choice #"+rank).buildIdentifier("choice"),this.getRenderer()&&choice.setRenderer(this.getRenderer()),$(document).trigger("choiceCreated.qti-widget",{choice:choice,interaction:this}),choice}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/InlineInteraction",["taoQtiItem/qtiItem/core/interactions/Interaction"],function(Interaction){'use strict';Interaction=Interaction&&Object.prototype.hasOwnProperty.call(Interaction,"default")?Interaction["default"]:Interaction;var InlineInteraction=Interaction.extend({is:function is(qtiClass){return"inlineInteraction"===qtiClass||this._super(qtiClass)}});return InlineInteraction}),define("taoQtiItem/qtiItem/core/interactions/EndAttemptInteraction",["taoQtiItem/qtiItem/core/interactions/InlineInteraction"],function(InlineInteraction){'use strict';InlineInteraction=InlineInteraction&&Object.prototype.hasOwnProperty.call(InlineInteraction,"default")?InlineInteraction["default"]:InlineInteraction;var EndAttemptInteraction=InlineInteraction.extend({qtiClass:"endAttemptInteraction"});return EndAttemptInteraction}),define("taoQtiItem/qtiCreator/model/interactions/EndAttemptInteraction",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/EndAttemptInteraction","i18n"],function(_,editable,editableInteraction,Interaction,__){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{title:__("End Attempt")}},afterCreate:function afterCreate(){this.createResponse({baseType:"boolean",cardinality:"single"})},createChoice:function createChoice(){throw new Error("end attempt interaction has no choice")}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/ExtendedTextInteraction",["lodash","taoQtiItem/qtiItem/core/interactions/BlockInteraction","taoQtiItem/qtiItem/helper/rendererConfig","taoQtiItem/qtiItem/helper/maxScore"],function(_,BlockInteraction,rendererConfig,maxScore){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,BlockInteraction=BlockInteraction&&Object.prototype.hasOwnProperty.call(BlockInteraction,"default")?BlockInteraction["default"]:BlockInteraction,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var ExtendedTextInteraction=BlockInteraction.extend({qtiClass:"extendedTextInteraction",render:function(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={multiple:!1,maxStringLoop:[]},response=this.getResponseDeclaration(),i;if(this.attr("maxStrings")&&("multiple"===response.attr("cardinality")||"ordered"===response.attr("cardinality")))for(defaultData.multiple=!0,i=0;i<this.attr("maxStrings");i++)defaultData.maxStringLoop.push(i+"");return this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)},getNormalMaximum:function(){return maxScore.textEntryInteractionBased(this)}});return ExtendedTextInteraction}),define("taoQtiItem/qtiCreator/model/interactions/ExtendedTextInteraction",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/ExtendedTextInteraction"],function(_,editable,editableInteraction,Interaction){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{format:"plain"}},afterCreate:function afterCreate(){this.createResponse({baseType:"string",cardinality:"single"})},createChoice:function createChoice(){throw"extendedTextInteraction does not have any choices"}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/ContainerInteraction",["taoQtiItem/qtiItem/core/interactions/BlockInteraction","taoQtiItem/qtiItem/mixin/Container"],function(BlockInteraction,Container){'use strict';BlockInteraction=BlockInteraction&&Object.prototype.hasOwnProperty.call(BlockInteraction,"default")?BlockInteraction["default"]:BlockInteraction,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container;var ContainerInteraction=BlockInteraction.extend({});return Container.augment(ContainerInteraction),ContainerInteraction}),define("taoQtiItem/qtiItem/core/interactions/GapMatchInteraction",["taoQtiItem/qtiItem/core/interactions/ContainerInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(ContainerInteraction,maxScore){'use strict';ContainerInteraction=ContainerInteraction&&Object.prototype.hasOwnProperty.call(ContainerInteraction,"default")?ContainerInteraction["default"]:ContainerInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var GapMatchInteraction=ContainerInteraction.extend({qtiClass:"gapMatchInteraction",getGaps:function(){return this.getBody().getElements("gap")},getNormalMaximum:function(){return maxScore.gapMatchInteractionBased(this)}});return GapMatchInteraction}),define("taoQtiItem/qtiCreator/model/interactions/GapMatchInteraction",["lodash","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/GapMatchInteraction","taoQtiItem/qtiCreator/model/choices/GapText","taoQtiItem/qtiCreator/model/helper/event","taoQtiItem/qtiCreator/model/helper/response"],function(_,Element,editable,editableInteraction,Interaction,Choice,event,responseHelper){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{shuffle:!1}},afterCreate:function afterCreate(){this.body("<p>Lorem ipsum dolor sit amet, consectetur adipisicing ...</p>"),this.createChoice(),this.createResponse({baseType:"directedPair",cardinality:"multiple"})},getNextPlaceholder:function(){for(var allChoices=this.getChoices(),existingChoicesLabels=_.map(allChoices,function(choice){var choiceBody=choice.getBody()||{};return choiceBody.bdy}),placeHolderIndex=1,placeHolder="choice #"+placeHolderIndex;-1!==existingChoicesLabels.indexOf(placeHolder);)placeHolderIndex++,placeHolder="choice #"+placeHolderIndex;return placeHolder},createChoice:function createChoice(text){var choice=new Choice;return this.addChoice(choice),choice.body(text||this.getNextPlaceholder()).buildIdentifier("choice"),this.getRenderer()&&choice.setRenderer(this.getRenderer()),event.choiceCreated(choice,this),choice},createGap:function createGap(attr,body){var choice=new Choice("",attr);return this.addChoice(choice),choice.buildIdentifier("gap"),choice.body(body),this.getRenderer()&&choice.setRenderer(this.getRenderer()),event.choiceCreated(choice,this),choice},removeChoice:function removeChoice(element){var serial="",$serialElt,choice;return"string"==typeof element?serial=element:Element.isA(element,"gap")?serial=element.serial:Element.isA(element,"gapText")&&(serial=element.serial),$serialElt=this.getBody().getElement(serial),choice=this.getChoice(serial),$serialElt?(this.getBody().removeElement($serialElt),responseHelper.removeChoice(this.getResponseDeclaration(),$serialElt),event.deleted($serialElt,this)):choice&&(delete this.choices[serial],responseHelper.removeChoice(this.getResponseDeclaration(),choice),event.deleted(choice,this)),this}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/ObjectInteraction",["taoQtiItem/qtiItem/core/interactions/BlockInteraction","taoQtiItem/qtiItem/core/Object"],function(QtiBlockInteraction,QtiObject){'use strict';QtiBlockInteraction=QtiBlockInteraction&&Object.prototype.hasOwnProperty.call(QtiBlockInteraction,"default")?QtiBlockInteraction["default"]:QtiBlockInteraction,QtiObject=QtiObject&&Object.prototype.hasOwnProperty.call(QtiObject,"default")?QtiObject["default"]:QtiObject;var QtiObjectInteraction=QtiBlockInteraction.extend({initObject:function initObject(object){this.object=object||new QtiObject},getObject:function getObject(){return this.object}});return QtiObjectInteraction}),define("taoQtiItem/qtiItem/core/interactions/GraphicInteraction",["taoQtiItem/qtiItem/core/interactions/ObjectInteraction","lodash","taoQtiItem/qtiItem/helper/rendererConfig"],function(QtiObjectInteraction,_,rendererConfig){'use strict';QtiObjectInteraction=QtiObjectInteraction&&Object.prototype.hasOwnProperty.call(QtiObjectInteraction,"default")?QtiObjectInteraction["default"]:QtiObjectInteraction,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var QtiGraphicInteraction=QtiObjectInteraction.extend({render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={backgroundImage:this.object.getAttributes(),object:this.object.render(renderer)};return this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)}});return QtiGraphicInteraction}),define("taoQtiItem/qtiItem/core/interactions/GraphicAssociateInteraction",["taoQtiItem/qtiItem/core/interactions/GraphicInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(GraphicInteraction,maxScore){'use strict';GraphicInteraction=GraphicInteraction&&Object.prototype.hasOwnProperty.call(GraphicInteraction,"default")?GraphicInteraction["default"]:GraphicInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var GraphicAssociateInteraction=GraphicInteraction.extend({qtiClass:"graphicAssociateInteraction",getNormalMaximum:function(){var calculatePossiblePairs=function(associateInteraction){var pairs=[],choices=maxScore.getMatchMaxOrderedChoices(associateInteraction.getChoices()),i,j;for(i=0;i<choices.length;i++)for(j=i;j<choices.length;j++)i!==j&&pairs.push([choices[i].id,choices[j].id]);return pairs};return maxScore.associateInteractionBased(this,{possiblePairs:calculatePossiblePairs(this)})}});return GraphicAssociateInteraction}),define("taoQtiItem/qtiCreator/model/interactions/GraphicAssociateInteraction",["jquery","lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/GraphicAssociateInteraction","taoQtiItem/qtiCreator/model/choices/AssociableHotspot"],function($,_,editable,editableInteraction,Interaction,AssociableHotspot){'use strict';var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{maxAssociations:0,minAssociations:0}},afterCreate:function afterCreate(){var relatedItem=this.getRootElement(),isResponsive=relatedItem.data("responsive");!0===isResponsive&&this.addClass("responsive"),this.createResponse({baseType:"pair",cardinality:"multiple"})},createChoice:function createChoice(attr){var choice=new AssociableHotspot("",attr);return this.addChoice(choice),choice.buildIdentifier("associablehotspot"),this.getRenderer()&&choice.setRenderer(this.getRenderer()),$(document).trigger("choiceCreated.qti-widget",{choice:choice,interaction:this}),choice}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/GraphicGapMatchInteraction",["taoQtiItem/qtiItem/core/interactions/GraphicInteraction","taoQtiItem/qtiItem/core/Element","lodash","taoQtiItem/qtiItem/helper/rendererConfig","taoQtiItem/qtiItem/helper/maxScore"],function(GraphicInteraction,Element,_,rendererConfig,maxScore){'use strict';GraphicInteraction=GraphicInteraction&&Object.prototype.hasOwnProperty.call(GraphicInteraction,"default")?GraphicInteraction["default"]:GraphicInteraction,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var GraphicGapMatchInteraction=GraphicInteraction.extend({qtiClass:"graphicGapMatchInteraction",init:function(serial,attributes){this._super(serial,attributes),this.gapImgs={}},addGapImg:function(gapImg){Element.isA(gapImg,"gapImg")&&(gapImg.setRootElement(this.getRootElement()||null),this.gapImgs[gapImg.getSerial()]=gapImg)},removeGapImg:function(gapImg){var serial="";return"string"==typeof gapImg?serial=gapImg:Element.isA(gapImg,"gapImg")&&(serial=gapImg.getSerial()),delete this.gapImgs[serial],this},getGapImgs:function(){return _.clone(this.gapImgs)},getGapImg:function(serial){return this.gapImgs[serial]},getChoiceByIdentifier:function(identifier){var choice=this._super(identifier);return choice||(choice=_.find(this.gapImgs,function(elt){return elt&&elt.id()===identifier})),choice},getComposingElements:function(){var elts=this._super(),serial;for(serial in this.gapImgs)elts[serial]=this.gapImgs[serial],elts=_.extend(elts,this.gapImgs[serial].getComposingElements());return elts},find:function(serial){var found=this._super(serial);return!found&&this.gapImgs[serial]&&(found={parent:this,element:this.gapImgs[serial]}),found},render:function(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={gapImgs:[]},gapImgs=this.getGapImgs(),serial;for(serial in gapImgs)Element.isA(gapImgs[serial],"choice")&&defaultData.gapImgs.push(gapImgs[serial].render({},null,"",renderer));return this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)},toArray:function(){var arr=this._super(),serial,gapImgs;for(serial in arr.gapImgs={},gapImgs=this.getGapImgs(),gapImgs)arr.gapImgs[serial]=gapImgs[serial].toArray();return arr},getNormalMaximum:function(){var calculatePossiblePairs=function(graphicGapInteraction){var pairs=[],matchSet1=maxScore.getMatchMaxOrderedChoices(graphicGapInteraction.getGapImgs()),matchSet2=maxScore.getMatchMaxOrderedChoices(graphicGapInteraction.getChoices());return _.forEach(matchSet1,function(choice1){_.forEach(matchSet2,function(choice2){pairs.push([choice1.id,choice2.id])})}),pairs};return maxScore.associateInteractionBased(this,{possiblePairs:calculatePossiblePairs(this),checkInfinitePair:!0})}});return GraphicGapMatchInteraction}),define("taoQtiItem/qtiCreator/model/interactions/GraphicGapMatchInteraction",["jquery","lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/GraphicGapMatchInteraction","taoQtiItem/qtiCreator/model/choices/GapImg","taoQtiItem/qtiCreator/model/choices/AssociableHotspot"],function($,_,editable,editableInteraction,Interaction,GapImg,AssociableHotspot){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{afterCreate:function afterCreate(){var relatedItem=this.getRootElement(),isResponsive=relatedItem.data("responsive");!0===isResponsive&&this.addClass("responsive"),this.createResponse({baseType:"directedPair",cardinality:"multiple"})},createGapImg:function createGapImg(object,label){var gapImg=new GapImg;return gapImg.object.attributes=object,label&&gapImg.attr("objectLabel",label),this.gapImgs||(this.gapImgs=[]),this.addGapImg(gapImg),gapImg.buildIdentifier("gapimg"),this.getRenderer()&&gapImg.setRenderer(this.getRenderer()),$(document).trigger("choiceCreated.qti-widget",{choice:gapImg,interaction:this}),gapImg},createChoice:function createChoice(attr){var choice=new AssociableHotspot("",attr);return this.addChoice(choice),choice.buildIdentifier("associablehotspot"),this.getRenderer()&&choice.setRenderer(this.getRenderer()),$(document).trigger("choiceCreated.qti-widget",{choice:choice,interaction:this}),choice}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/GraphicOrderInteraction",["taoQtiItem/qtiItem/core/interactions/GraphicInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(GraphicInteraction,maxScore){'use strict';GraphicInteraction=GraphicInteraction&&Object.prototype.hasOwnProperty.call(GraphicInteraction,"default")?GraphicInteraction["default"]:GraphicInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var GraphicOrderInteraction=GraphicInteraction.extend({qtiClass:"graphicOrderInteraction",getNormalMaximum:function(){return maxScore.orderInteractionBased(this)}});return GraphicOrderInteraction}),define("taoQtiItem/qtiCreator/model/interactions/GraphicOrderInteraction",["jquery","lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/GraphicOrderInteraction","taoQtiItem/qtiCreator/model/choices/HotspotChoice"],function($,_,editable,editableInteraction,Interaction,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{}},afterCreate:function afterCreate(){var relatedItem=this.getRootElement(),isResponsive=relatedItem.data("responsive");!0===isResponsive&&this.addClass("responsive"),this.createResponse({baseType:"identifier",cardinality:"ordered"})},createChoice:function createChoice(attr){var choice=new Choice("",attr);return this.addChoice(choice),choice.buildIdentifier("hotspot"),this.getRenderer()&&choice.setRenderer(this.getRenderer()),$(document).trigger("choiceCreated.qti-widget",{choice:choice,interaction:this}),choice}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/HotspotInteraction",["taoQtiItem/qtiItem/core/interactions/GraphicInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(GraphicInteraction,maxScore){'use strict';GraphicInteraction=GraphicInteraction&&Object.prototype.hasOwnProperty.call(GraphicInteraction,"default")?GraphicInteraction["default"]:GraphicInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var HotspotInteraction=GraphicInteraction.extend({qtiClass:"hotspotInteraction",getNormalMaximum:function(){return maxScore.choiceInteractionBased(this)}});return HotspotInteraction}),define("taoQtiItem/qtiCreator/model/interactions/HotspotInteraction",["jquery","lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/HotspotInteraction","taoQtiItem/qtiCreator/model/choices/HotspotChoice"],function($,_,editable,editableInteraction,Interaction,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{maxChoices:0,minChoices:0}},afterCreate:function afterCreate(){var relatedItem=this.getRootElement(),isResponsive=relatedItem.data("responsive");!0===isResponsive&&this.addClass("responsive"),this.createResponse({baseType:"identifier",cardinality:"single"})},createChoice:function createChoice(attr){var choice=new Choice("",attr);return this.addChoice(choice),choice.buildIdentifier("hotspot"),this.getRenderer()&&choice.setRenderer(this.getRenderer()),$(document).trigger("choiceCreated.qti-widget",{choice:choice,interaction:this}),choice}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/HottextInteraction",["taoQtiItem/qtiItem/core/interactions/ContainerInteraction","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/helper/maxScore"],function(ContainerInteraction,Element,maxScore){'use strict';ContainerInteraction=ContainerInteraction&&Object.prototype.hasOwnProperty.call(ContainerInteraction,"default")?ContainerInteraction["default"]:ContainerInteraction,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var HottextInteraction=ContainerInteraction.extend({qtiClass:"hottextInteraction",getChoices:function getChoices(){return this.getBody().getElements("hottext")},getChoice:function getChoice(serial){var element=this.getBody().getElement(serial);return Element.isA(element,"choice")?element:null},getNormalMaximum:function(){return maxScore.choiceInteractionBased(this)}});return HottextInteraction}),define("taoQtiItem/qtiCreator/model/interactions/HottextInteraction",["lodash","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/HottextInteraction","taoQtiItem/qtiCreator/model/choices/Hottext","taoQtiItem/qtiCreator/model/helper/event","taoQtiItem/qtiCreator/model/helper/response"],function(_,Element,editable,editableInteraction,Interaction,Choice,event,responseHelper){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{maxChoices:0,minChoices:0}},afterCreate:function afterCreate(){this.body("<p>Lorem ipsum dolor sit amet, consectetur adipisicing ...</p>"),this.createResponse({baseType:"identifier",cardinality:"multiple"})},createChoice:function createChoice(attr,body){var choice=new Choice("",attr);return this.addChoice(choice),choice.buildIdentifier("hottext"),choice.body(body),this.getRenderer()&&choice.setRenderer(this.getRenderer()),event.choiceCreated(choice,this),choice},removeChoice:function removeChoice(hottext){var serial="",c;return"string"==typeof hottext?serial=hottext:Element.isA(hottext,"hottext")&&(serial=hottext.getSerial()),c=this.getBody().getElement(serial),c&&(this.getBody().removeElement(c),responseHelper.removeChoice(this.getResponseDeclaration(),c),event.deleted(c,this),$(document).trigger("choiceDeleted.qti-widget",{interaction:this})),this}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/InlineChoiceInteraction",["taoQtiItem/qtiItem/core/interactions/InlineInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(InlineInteraction,maxScore){'use strict';InlineInteraction=InlineInteraction&&Object.prototype.hasOwnProperty.call(InlineInteraction,"default")?InlineInteraction["default"]:InlineInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var InlineChoiceInteraction=InlineInteraction.extend({qtiClass:"inlineChoiceInteraction",getNormalMaximum:function(){return maxScore.choiceInteractionBased(this,{maxChoices:1})}});return InlineChoiceInteraction}),define("taoQtiItem/qtiCreator/model/interactions/InlineChoiceInteraction",["jquery","lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/InlineChoiceInteraction","taoQtiItem/qtiCreator/model/choices/InlineChoice"],function($,_,editable,editableInteraction,Interaction,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{shuffle:!1,required:!1}},afterCreate:function afterCreate(){this.createChoice(),this.createChoice(),this.createChoice(),this.createResponse({baseType:"identifier",cardinality:"single"})},createChoice:function createChoice(){var choice=new Choice;this.addChoice(choice);var rank=_.size(this.getChoices());return choice.val("choice #"+rank).buildIdentifier("choice"),this.getRenderer()&&choice.setRenderer(this.getRenderer()),$(document).trigger("choiceCreated.qti-widget",{choice:choice,interaction:this}),choice}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/MatchInteraction",["taoQtiItem/qtiItem/core/interactions/BlockInteraction","taoQtiItem/qtiItem/core/choices/SimpleAssociableChoice","lodash","taoQtiItem/qtiItem/helper/rendererConfig","taoQtiItem/qtiItem/helper/util","taoQtiItem/qtiItem/helper/maxScore"],function(BlockInteraction,SimpleAssociableChoice,_,rendererConfig,util,maxScore){'use strict';BlockInteraction=BlockInteraction&&Object.prototype.hasOwnProperty.call(BlockInteraction,"default")?BlockInteraction["default"]:BlockInteraction,SimpleAssociableChoice=SimpleAssociableChoice&&Object.prototype.hasOwnProperty.call(SimpleAssociableChoice,"default")?SimpleAssociableChoice["default"]:SimpleAssociableChoice,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig,util=util&&Object.prototype.hasOwnProperty.call(util,"default")?util["default"]:util,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var MatchInteraction=BlockInteraction.extend({qtiClass:"matchInteraction",init:function(serial,attributes){this._super(serial,attributes),this.choices=[{},{}]},addChoice:function(choice,matchSet){matchSet=parseInt(matchSet),this.choices[matchSet]&&(choice.setRootElement(this.getRootElement()||null),this.choices[matchSet][choice.getSerial()]=choice)},getChoices:function(matchSet){return matchSet=parseInt(matchSet),this.choices[matchSet]?_.clone(this.choices[matchSet]):_.clone(this.choices)},getChoice:function(serial){return this.choices[0][serial]||this.choices[1][serial]||null},getChoiceByIdentifier:function(identifier){var i,matchSet,serial;for(i=0;2>i;i++)for(serial in matchSet=this.getChoices(i),matchSet)if(matchSet[serial]instanceof SimpleAssociableChoice&&matchSet[serial].id()===identifier)return matchSet[serial];return null},getComposingElements:function(){var elts=this._super(),i,matchSet,serial;for(i=0;2>i;i++)for(serial in matchSet=this.getChoices(i),matchSet)matchSet[serial]instanceof SimpleAssociableChoice&&(elts[serial]=matchSet[serial],elts=_.extend(elts,matchSet[serial].getComposingElements()));return elts},find:function(serial){var found=this._super(serial);return found||(found=util.findInCollection(this,["choices.0","choices.1"],serial)),found},render:function(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={matchSet1:[],matchSet2:[]},interactionData={interaction:{serial:this.serial,attributes:this.attributes}},choices,i,matchSet,serial;if(!renderer)throw"no renderer found for the interaction "+this.qtiClass;for(choices=this.attr("shuffle")&&renderer.getOption("shuffleChoices")?renderer.getShuffledChoices(this):this.getChoices(),i=0;2>i;i++)for(serial in matchSet=choices[i],matchSet)matchSet[serial]instanceof SimpleAssociableChoice&&defaultData["matchSet"+(i+1)].push(matchSet[serial].render(_.clone(interactionData,!0),null,"simpleAssociableChoice.matchInteraction",renderer));return this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)},postRender:function(data,altClassName,renderer){return renderer=renderer||this.getRenderer(),_(this.getChoices()).map(function(choices){return _(choices).filter(function(choice){return choice instanceof SimpleAssociableChoice}).map(function(choice){return choice.postRender({},"simpleAssociableChoice.matchInteraction",renderer)}).value()}).flatten(!0).value().concat(this._super(data,altClassName,renderer))},toArray:function(){var arr=this._super(),i,matchSet,serial;for(arr.choices={0:{},1:{}},i=0;2>i;i++)for(serial in matchSet=this.getChoices(i),matchSet)matchSet[serial]instanceof SimpleAssociableChoice&&(arr.choices[i][serial]=matchSet[serial].toArray());return arr},getNormalMaximum:function(){var calculatePossiblePairs=function(matchInteraction){var pairs=[],matchSet1=maxScore.getMatchMaxOrderedChoices(matchInteraction.getChoices(0)),matchSet2=maxScore.getMatchMaxOrderedChoices(matchInteraction.getChoices(1));return _.forEach(matchSet1,function(choice1){_.forEach(matchSet2,function(choice2){pairs.push([choice1.id,choice2.id])})}),pairs};return maxScore.associateInteractionBased(this,{possiblePairs:calculatePossiblePairs(this)})}});return MatchInteraction}),define("taoQtiItem/qtiCreator/model/interactions/MatchInteraction",["lodash","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/MatchInteraction","taoQtiItem/qtiCreator/model/choices/SimpleAssociableChoice","taoQtiItem/qtiCreator/model/helper/event","taoQtiItem/qtiCreator/model/helper/response"],function(_,Element,editable,editableInteraction,Interaction,Choice,event,responseHelper){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{shuffle:!1,maxAssociations:1,minAssociations:0}},afterCreate:function afterCreate(){this.createChoice(0),this.createChoice(0),this.createChoice(1),this.createChoice(1),this.createResponse({baseType:"directedPair",cardinality:"multiple"})},createChoice:function createChoice(matchSet,attr){var choice=new Choice("",attr);this.addChoice(choice,matchSet);var rank=_.size(this.getChoices(matchSet));return choice.body("choice #"+rank).buildIdentifier("choice"),this.getRenderer()&&choice.setRenderer(this.getRenderer()),event.choiceCreated(choice,this),choice},removeChoice:function removeChoice(choice){var serial="",c;return"string"==typeof choice?serial=choice:Element.isA(choice,"choice")&&(serial=choice.getSerial()),c=this.choices[0][serial]||this.choices[1][serial]||null,c&&(delete this.choices[0][serial],delete this.choices[1][serial],responseHelper.removeChoice(this.getResponseDeclaration(),c),event.deleted(c,this)),this}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/MediaInteraction",["lodash","taoQtiItem/qtiItem/core/interactions/ObjectInteraction","taoQtiItem/qtiItem/helper/rendererConfig"],function(_,ObjectInteraction,rendererConfig){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,ObjectInteraction=ObjectInteraction&&Object.prototype.hasOwnProperty.call(ObjectInteraction,"default")?ObjectInteraction["default"]:ObjectInteraction,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var MediaInteraction=ObjectInteraction.extend({qtiClass:"mediaInteraction",render:function(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={object:this.object.render({},null,"",renderer)};return this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)},getNormalMaximum:function(){return 0}});return MediaInteraction}),define("taoQtiItem/qtiCreator/model/interactions/MediaInteraction",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/MediaInteraction"],function(_,editable,editableInteraction,Interaction){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{autostart:!1,minPlays:0,maxPlays:0,loop:!1}},afterCreate:function afterCreate(){this.createResponse({baseType:"integer",cardinality:"single"})},createChoice:function createChoice(){throw"mediaInteraction does not have any choices"}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/OrderInteraction",["taoQtiItem/qtiItem/core/interactions/BlockInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(BlockInteraction,maxScore){'use strict';BlockInteraction=BlockInteraction&&Object.prototype.hasOwnProperty.call(BlockInteraction,"default")?BlockInteraction["default"]:BlockInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var OrderInteraction=BlockInteraction.extend({qtiClass:"orderInteraction",getNormalMaximum:function(){return maxScore.orderInteractionBased(this)}});return OrderInteraction}),define("taoQtiItem/qtiCreator/model/interactions/OrderInteraction",["jquery","lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/OrderInteraction","taoQtiItem/qtiCreator/model/choices/SimpleChoice"],function($,_,editable,editableInteraction,Interaction,Choice){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{shuffle:!1,orientation:"vertical"}},afterCreate:function afterCreate(){this.createChoice(),this.createChoice(),this.createChoice(),this.createResponse({baseType:"identifier",cardinality:"ordered"})},createChoice:function createChoice(){var choice=new Choice;this.addChoice(choice);var rank=_.size(this.getChoices());return choice.body("choice #"+rank).buildIdentifier("choice"),this.getRenderer()&&choice.setRenderer(this.getRenderer()),$(document).trigger("choiceCreated.qti-widget",{choice:choice,interaction:this}),choice}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/mixin/CustomElement",["taoQtiItem/qtiItem/mixin/Mixin","lodash"],function(Mixin,_){'use strict';Mixin=Mixin&&Object.prototype.hasOwnProperty.call(Mixin,"default")?Mixin["default"]:Mixin,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;var methods={prop:function(name,value){if(name)if(void 0!==value)this.properties[name]=value;else if("object"===_typeof(name))for(var prop in name)this.prop(prop,name[prop]);else if("string"==typeof name)return void 0===this.properties[name]?void 0:this.properties[name];return this},removeProp:function removeProp(propNames){var _this=this;return"string"==typeof propNames&&(propNames=[propNames]),_.each(propNames,function(propName){delete _this.attributes[propName]}),this},getProperties:function getProperties(){return _.clone(this.properties)},getMarkupNamespace:function getMarkupNamespace(){if(this.markupNs&&this.markupNs.name&&this.markupNs.uri)return _.clone(this.markupNs);var relatedItem=this.getRootElement();return relatedItem?(relatedItem.namespaces[this.defaultMarkupNsName]=this.defaultMarkupNsUri,{name:this.defaultMarkupNsName,uri:this.defaultMarkupNsUri}):{}},setMarkupNamespace:function setMarkupNamespace(name,uri){this.markupNs={name:name,uri:uri}}};return{augment:function augment(targetClass){Mixin.augment(targetClass,methods)},methods:methods}}),define("taoQtiItem/qtiItem/core/interactions/CustomInteraction",["lodash","taoQtiItem/qtiItem/core/interactions/Interaction","taoQtiItem/qtiItem/mixin/CustomElement","taoQtiItem/qtiItem/mixin/NamespacedElement","taoQtiItem/qtiItem/helper/rendererConfig"],function(_,Interaction,CustomElement,NamespacedElement,rendererConfig){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Interaction=Interaction&&Object.prototype.hasOwnProperty.call(Interaction,"default")?Interaction["default"]:Interaction,CustomElement=CustomElement&&Object.prototype.hasOwnProperty.call(CustomElement,"default")?CustomElement["default"]:CustomElement,NamespacedElement=NamespacedElement&&Object.prototype.hasOwnProperty.call(NamespacedElement,"default")?NamespacedElement["default"]:NamespacedElement,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var CustomInteraction=Interaction.extend({qtiClass:"customInteraction",defaultNsName:"pci",defaultNsUri:"http://www.imsglobal.org/xsd/portableCustomInteraction",nsUriFragment:"portableCustomInteraction",defaultMarkupNsName:"html5",defaultMarkupNsUri:"html5",init:function init(serial,attributes){this._super(serial,attributes),this.typeIdentifier="",this.markup="",this.properties={},this.libraries=[],this.entryPoint="",this.markupNs={},this.pciReadyCallbacks=[]},is:function is(qtiClass){return"customInteraction"===qtiClass||this._super(qtiClass)},render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={typeIdentifier:this.typeIdentifier,markup:this.markup,properties:this.properties,libraries:this.libraries,entryPoint:this.entryPoint,ns:{pci:this.getNamespace().name+":"}};return this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)},toArray:function toArray(){var arr=this._super();return arr.markup=this.markup,arr.properties=this.properties,arr},getMarkupNamespace:function getMarkupNamespace(){if(this.markupNs&&this.markupNs.name&&this.markupNs.uri)return _.clone(this.markupNs);var relatedItem=this.getRootElement();return relatedItem?(relatedItem.namespaces[this.defaultMarkupNsName]=this.defaultMarkupNsUri,{name:this.defaultMarkupNsName,uri:this.defaultMarkupNsUri}):{}},setMarkupNamespace:function setMarkupNamespace(name,uri){this.markupNs={name:name,uri:uri}},onPciReady:function onPciReady(callback){this.pciReadyCallbacks.push(callback),this.data("pci")&&this.triggerPciReady()},triggerPciReady:function triggerPciReady(){var _this=this,pci=this.data("pci");if(pci)_.each(this.pciReadyCallbacks,function(fn){fn.call(_this,pci)}),this.pciReadyCallbacks=[],this.data("pciReady",!0);else throw"cannot trigger pci ready when no pci is actually attached to the interaction"},onPci:function onPci(event,callback){return this.onPciReady(function(pci){if(_.isFunction(pci.on))pci.on(event,callback);else throw"the pci does not implement on() function"}),this},offPci:function offPci(event){return this.onPciReady(function(pci){if(_.isFunction(pci.off))pci.off(event);else throw"the pci does not implement off() function"}),this},triggerPci:function triggerPci(event,args){return this.onPciReady(function(pci){if(_.isFunction(pci.off))pci.trigger(event,args);else throw"the pci does not implement off() function"}),this}});return CustomElement.augment(CustomInteraction),NamespacedElement.augment(CustomInteraction),CustomInteraction}),define("taoQtiItem/qtiCreator/model/interactions/PortableCustomInteraction",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiCreator/model/helper/portableElement","taoQtiItem/portableElementRegistry/ciRegistry","taoQtiItem/qtiItem/core/interactions/CustomInteraction"],function(_,editable,editableInteraction,portableElement,ciRegistry,Interaction){"use strict";var _throwMissingImplementationError=function(pci,fnName){throw fnName+" not available for pci of type "+pci.typeIdentifier},methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,portableElement.getDefaultMethods(ciRegistry)),_.extend(methods,{createChoice:function createChoice(){var creator=ciRegistry.getCreator(this.typeIdentifier);return _.isFunction(creator.createChoice)?creator.createChoice(this):void _throwMissingImplementationError(this,"createChoice")},getDefaultMarkupTemplateData:function getDefaultMarkupTemplateData(){return{responseIdentifier:this.attr("responseIdentifier")}}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/SelectPointInteraction",["taoQtiItem/qtiItem/core/interactions/GraphicInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(GraphicInteraction,maxScore){'use strict';GraphicInteraction=GraphicInteraction&&Object.prototype.hasOwnProperty.call(GraphicInteraction,"default")?GraphicInteraction["default"]:GraphicInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var SelectPointInteraction=GraphicInteraction.extend({qtiClass:"selectPointInteraction",getNormalMaximum:function(){return maxScore.selectPointInteractionBased(this)}});return SelectPointInteraction}),define("taoQtiItem/qtiCreator/model/interactions/SelectPointInteraction",["jquery","lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/SelectPointInteraction"],function($,_,editable,editableInteraction,Interaction){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{maxChoices:0,minChoices:0}},afterCreate:function afterCreate(){var relatedItem=this.getRootElement(),isResponsive=relatedItem.data("responsive");!0===isResponsive&&this.addClass("responsive"),this.createResponse({baseType:"point",cardinality:"multiple"},"MAP_RESPONSE_POINT")}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/SliderInteraction",["taoQtiItem/qtiItem/core/interactions/BlockInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(BlockInteraction,maxScore){'use strict';BlockInteraction=BlockInteraction&&Object.prototype.hasOwnProperty.call(BlockInteraction,"default")?BlockInteraction["default"]:BlockInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var SliderInteraction=BlockInteraction.extend({qtiClass:"sliderInteraction",getNormalMaximum:function(){return maxScore.sliderInteractionBased(this)}});return SliderInteraction}),define("taoQtiItem/qtiCreator/model/interactions/SliderInteraction",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/SliderInteraction"],function(_,editable,editableInteraction,Interaction){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{lowerBound:0,upperBound:100,orientation:"horizontal",reverse:!1,step:1,stepLabel:!1}},afterCreate:function afterCreate(){this.createResponse({baseType:"integer",cardinality:"single"})},createChoice:function createChoice(){throw"sliderInteraction does not have any choices"}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/TextEntryInteraction",["taoQtiItem/qtiItem/core/interactions/InlineInteraction","taoQtiItem/qtiItem/helper/maxScore"],function(InlineInteraction,maxScore){'use strict';InlineInteraction=InlineInteraction&&Object.prototype.hasOwnProperty.call(InlineInteraction,"default")?InlineInteraction["default"]:InlineInteraction,maxScore=maxScore&&Object.prototype.hasOwnProperty.call(maxScore,"default")?maxScore["default"]:maxScore;var TextEntryInteraction=InlineInteraction.extend({qtiClass:"textEntryInteraction",getNormalMaximum:function(){return maxScore.textEntryInteractionBased(this)}});return TextEntryInteraction}),define("taoQtiItem/qtiCreator/model/interactions/TextEntryInteraction",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/TextEntryInteraction"],function(_,editable,editableInteraction,Interaction){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{base:10,placeholderText:""}},afterCreate:function afterCreate(){this.createResponse({baseType:"string",cardinality:"single"})},createChoice:function createChoice(){throw new Error("text entry interaction has no choice")}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/interactions/UploadInteraction",["taoQtiItem/qtiItem/core/interactions/BlockInteraction"],function(InlineInteraction){'use strict';InlineInteraction=InlineInteraction&&Object.prototype.hasOwnProperty.call(InlineInteraction,"default")?InlineInteraction["default"]:InlineInteraction;var UploadInteraction=InlineInteraction.extend({qtiClass:"uploadInteraction"});return UploadInteraction}),define("taoQtiItem/qtiCreator/model/interactions/UploadInteraction",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/mixin/editableInteraction","taoQtiItem/qtiItem/core/interactions/UploadInteraction"],function(_,editable,editableInteraction,Interaction){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,editableInteraction),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{}},afterCreate:function afterCreate(){this.createResponse({baseType:"file",cardinality:"single"})},createChoice:function createChoice(){throw"uploadInteraction does not have any choices"}}),Interaction.extend(methods)}),define("taoQtiItem/qtiItem/core/Math",["jquery","lodash","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/helper/rendererConfig","taoQtiItem/qtiItem/mixin/NamespacedElement"],function($,_,Element,rendererConfig,NamespacedElement){'use strict';function _stripMathTags(mathML,nsName){var regex=new RegExp("<(/)?"+(nsName?nsName+":":"")+"math[^>]*>","g");return mathML.replace(regex,"").replace(/^\s*[\r\n]/gm,"").replace(/\s*[\r\n]$/gm,"")}function _stripNamespace(mathML,nsName){var regex=new RegExp("<(/)?"+(nsName?nsName+":":""),"g");return mathML.replace(regex,"<$1")}function _isEmptyMathML(mathStr){var hasContent=!1,$math,mathText;return mathStr&&mathStr.trim()&&($math=$($.parseHTML(mathStr)),mathText=$math.text(),hasContent=_.isString(mathText)&&!!mathText.trim()),!hasContent}$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig,NamespacedElement=NamespacedElement&&Object.prototype.hasOwnProperty.call(NamespacedElement,"default")?NamespacedElement["default"]:NamespacedElement;var Math;Math=Element.extend({qtiClass:"math",defaultNsName:"m",defaultNsUri:"http://www.w3.org/1998/Math/MathML",nsUriFragment:"MathML",init:function init(serial,attributes){this._super(serial,attributes),this.ns=null,this.mathML="",this.annotations={}},setAnnotation:function setAnnotation(encoding,value){this.annotations[encoding]=_.unescape(value)},getAnnotation:function getAnnotation(encoding){return this.annotations[encoding]},removeAnnotation:function removeAnnotation(encoding){delete this.annotations[encoding]},setMathML:function setMathML(mathML){var ns=this.getNamespace(),nsName=ns.name&&ns.uri?ns.name:"";mathML=_stripMathTags(mathML,nsName),ns&&(mathML=_stripNamespace(mathML,nsName)),this.mathML=mathML},getMathML:function getMathML(){return this.mathML},render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),tag=this.qtiClass,raw=this.mathML,body=raw,ns=this.getNamespace(),annotations="",encoding,defaultData;for(encoding in this.annotations)annotations+="<annotation encoding=\""+encoding+"\">"+_.escape(this.annotations[encoding])+"</annotation>";return annotations&&(0<raw.indexOf("</semantics>")?raw=raw.replace("</semantics>",annotations+"</semantics>"):raw="<semantics>"+raw+annotations+"</semantics>"),ns&&ns.name&&(body=raw.replace(/<(\/)?([^!<])/g,"<$1"+ns.name+":$2"),tag=ns.name+":"+tag),body=body.replace(/<!--.*?-->/g,""),body=body.replace(/&lt;!--.*?--&gt;/g,""),defaultData={block:"block"===this.attr("display"),body:body,raw:raw,tag:tag,ns:ns},this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)},isEmpty:function isEmpty(){return _isEmptyMathML(this.mathML)&&(!this.annotations.latex||!this.annotations.latex.trim())}}),NamespacedElement.augment(Math);var Math$1=Math;return Math$1}),define("taoQtiItem/qtiCreator/model/Math",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/Math"],function(_,editable,mathModel){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{}},afterCreate:function afterCreate(){this.getNamespace()}}),mathModel.extend(methods)}),define("taoQtiItem/qtiCreator/model/Object",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/Object"],function(_,editable,Object){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{data:"",type:""}}}),Object.extend(methods)}),define("taoQtiItem/qtiCreator/model/pciCreatorContext",["lodash"],function(_){"use strict";var _pciModels={};return{register:function register(pciModel){_pciModels[pciModel.getTypeIdentifier()]=pciModel},createPciInstance:function createPciInstance(pciTypeIdentifier){if(_pciModels[pciTypeIdentifier])return _.cloneDeep(_pciModels[pciTypeIdentifier])}}}),define("taoQtiItem/qtiItem/core/PortableInfoControl",["lodash","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/mixin/CustomElement","taoQtiItem/qtiItem/mixin/NamespacedElement","taoQtiItem/qtiItem/helper/rendererConfig"],function(_,Element,CustomElement,NamespacedElement,rendererConfig){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,CustomElement=CustomElement&&Object.prototype.hasOwnProperty.call(CustomElement,"default")?CustomElement["default"]:CustomElement,NamespacedElement=NamespacedElement&&Object.prototype.hasOwnProperty.call(NamespacedElement,"default")?NamespacedElement["default"]:NamespacedElement,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var PortableInfoControl=Element.extend({qtiClass:"infoControl",defaultNsName:"pic",defaultNsUri:"http://www.imsglobal.org/xsd/portableInfoControl",nsUriFragment:"portableInfoControl",defaultMarkupNsName:"html5",defaultMarkupNsUri:"html5",init:function init(serial,attributes){this._super(serial,attributes),this.typeIdentifier="",this.markup="",this.properties={},this.libraries=[],this.entryPoint="",this.markupNs={},this.readyStack=[]},is:function is(qtiClass){return"infoControl"===qtiClass||this._super(qtiClass)},render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={typeIdentifier:this.typeIdentifier,markup:this.markup,properties:this.properties,libraries:this.libraries,entryPoint:this.entryPoint,ns:{pic:this.getNamespace().name+":"}};return this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)},getState:function(){var ret=null,renderer=this.getRenderer();return renderer&&_.isFunction(renderer.getState)&&(ret=renderer.getState(this)),ret},setState:function(state){var renderer=this.getRenderer();renderer&&_.isFunction(renderer.getState)&&renderer.setState(this,state)},toArray:function toArray(){var arr=this._super();return arr.markup=this.markup,arr.properties=this.properties,arr},onReady:function(cb){this.readyStack.push(cb),this.data("_ready")&&this.data("pic")&&this.triggerReady()},triggerReady:function(){var self=this;_.forEach(this.readyStack,function(cb){cb.call(self,self.data("pic"))}),this.readyStack=[],this.data("_ready",!0)}});return CustomElement.augment(PortableInfoControl),NamespacedElement.augment(PortableInfoControl),PortableInfoControl}),define("taoQtiItem/qtiCreator/model/PortableInfoControl",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiCreator/model/helper/portableElement","taoQtiItem/portableElementRegistry/icRegistry","taoQtiItem/qtiItem/core/PortableInfoControl"],function(_,editable,portableElement,icRegistry,PortableInfoControl){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,portableElement.getDefaultMethods(icRegistry)),_.extend(methods,{getDefaultMarkupTemplateData:function getDefaultMarkupTemplateData(){return{}}}),PortableInfoControl.extend(methods)}),define("taoQtiItem/qtiItem/core/PrintedVariable",["taoQtiItem/qtiItem/core/Element"],function(Element){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element;var PrintedVariable=Element.extend({qtiClass:"printedVariable"});return PrintedVariable}),define("taoQtiItem/qtiCreator/model/PrintedVariable",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/PrintedVariable"],function(_,editable,PrintedVariable){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{format:"%2g",powerForm:!1,base:10,index:-1,delimiter:";",field:"",mappingIndicator:"="}},isEmpty:function(){return!this.attr("identifier")}}),PrintedVariable.extend(methods)}),define("taoQtiItem/qtiItem/core/RubricBlock",["taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/mixin/Container"],function(Element,Container){'use strict';Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container;var RubricBlock=Element.extend({qtiClass:"rubricBlock",isEmpty:function(){return!(this.bdy&&this.bdy.body())}});return Container.augment(RubricBlock),RubricBlock}),define("taoQtiItem/qtiCreator/model/RubricBlock",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/RubricBlock"],function(_,editable,RubricBlock){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{getDefaultAttributes:function getDefaultAttributes(){return{view:["candidate"],use:""}}}),RubricBlock.extend(methods)}),define("taoQtiItem/qtiItem/mixin/ContainerTable",["taoQtiItem/qtiItem/mixin/Mixin","taoQtiItem/qtiItem/mixin/Container","lodash"],function(Mixin,Container,_){'use strict';Mixin=Mixin&&Object.prototype.hasOwnProperty.call(Mixin,"default")?Mixin["default"]:Mixin,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;var methods={};_.extend(methods,Container.methods),_.extend(methods,{initContainer:function initContainer(body){Container.methods.initContainer.call(this,body),this.bdy.contentModel="table"}});return{augment:function augment(targetClass){Mixin.augment(targetClass,methods)},methods:methods}}),define("taoQtiItem/qtiItem/core/Table",["lodash","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/mixin/ContainerTable"],function(_,Element,Container){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,Container=Container&&Object.prototype.hasOwnProperty.call(Container,"default")?Container["default"]:Container;var Table=Element.extend({qtiClass:"table"});Container.augment(Table),Table=Table.extend({body:function body(newBody){return _.isString(newBody)&&(newBody=newBody.replace("<table>","").replace("</table>","")),this._super(newBody)}});var Table$1=Table;return Table$1}),define("taoQtiItem/qtiCreator/model/Table",["lodash","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/Table"],function(_,editable,Table){"use strict";var methods={};return _.extend(methods,editable),Table.extend(methods)}),define("taoQtiItem/qtiItem/core/Tooltip",["lodash","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiItem/mixin/ContainerInline","taoQtiItem/qtiItem/helper/rendererConfig"],function(_,Element,ContainerInline,rendererConfig){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Element=Element&&Object.prototype.hasOwnProperty.call(Element,"default")?Element["default"]:Element,ContainerInline=ContainerInline&&Object.prototype.hasOwnProperty.call(ContainerInline,"default")?ContainerInline["default"]:ContainerInline,rendererConfig=rendererConfig&&Object.prototype.hasOwnProperty.call(rendererConfig,"default")?rendererConfig["default"]:rendererConfig;var Tooltip=Element.extend({qtiClass:"_tooltip",init:function init(serial,attributes,newContent){this._super(serial,attributes),this.content(newContent||"")},content:function(newContent){if("undefined"==typeof newContent)return this.tooltipContent;if("string"==typeof newContent)this.tooltipContent=newContent;else throw new Error("newContent must be a string");return this},render:function render(){var args=rendererConfig.getOptionsFromArguments(arguments),renderer=args.renderer||this.getRenderer(),defaultData={content:this.tooltipContent};return this._super(_.merge(defaultData,args.data),args.placeholder,args.subclass,renderer)}});return ContainerInline.augment(Tooltip),Tooltip}),define("taoQtiItem/qtiCreator/model/Tooltip",["lodash","taoQtiItem/qtiItem/helper/util","taoQtiItem/qtiCreator/model/mixin/editable","taoQtiItem/qtiItem/core/Tooltip"],function(_,util,editable,PrintedVariable){"use strict";var methods={};return _.extend(methods,editable),_.extend(methods,{init:function init(serial,attributes,newContent){this._super(serial,attributes,newContent)},isEmpty:function(){return!this.body()||!this.bdy},afterCreate:function afterCreate(){var tooltipContentId=util.buildSerial(this.qtiClass+"-");this.attr("aria-describedby",tooltipContentId)},body:function body(newBody){return"&nbsp;"===newBody&&(newBody=""),this._super(newBody)}}),PrintedVariable.extend(methods)}),define("taoQtiItem/qtiCreator/plugins/content/blockAdder",["lodash","core/plugin","taoQtiItem/qtiCreator/editor/blockAdder/blockAdder","taoQtiItem/qtiCreator/helper/qtiElements","taoQtiItem/portableElementRegistry/ciRegistry"],function(_,pluginFactory,blockAdder,qtiElements,ciRegistry){'use strict';return pluginFactory({name:"blockAdder",init:function(){var interactions=qtiElements.getAvailableAuthoringElements()||{};_.forIn(ciRegistry.getAllVersions(),function(versions,typeId){var data=ciRegistry.getAuthoringData(typeId,{enabledOnly:!0});data&&data.tags&&(interactions[data.qtiClass]=data)}),this.interations=interactions},render:function(){blockAdder.create(this.getHost().getItem(),this.getAreaBroker().getItemPanelArea(),this.interations)}})}),define("taoQtiItem/qtiCreator/plugins/navigation/back",["jquery","i18n","core/plugin","ui/hider","tpl!taoQtiItem/qtiCreator/plugins/button"],function($,__,pluginFactory,hider,buttonTpl){'use strict';return pluginFactory({name:"back",init:function(){var itemCreator=this.getHost();itemCreator.on("exit",function(){window.history.back()}),this.$element=$(buttonTpl({icon:"left",title:__("Back to Manage Items"),text:__("Manage Items"),cssClass:"back-action",testId:"manage-items"})).on("click",function(e){e.preventDefault(),itemCreator.trigger("exit")}),this.hide()},render:function(){var $container=this.getAreaBroker().getMenuLeftArea();$container.append(this.$element),this.show()},destroy:function(){this.$element.remove()},enable:function(){this.$element.removeProp("disabled").removeClass("disabled")},disable:function(){this.$element.prop("disabled",!0).addClass("disabled")},show:function(){hider.show(this.$element)},hide:function(){hider.hide(this.$element)}})}),define("tpl!taoQtiItem/qtiCreator/tpl/layoutEditor/panel",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="<hr>\n<div class=\"panel\" id=\"item-editor-layout-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Layout",options):helperMissing.call(depth0,"__","Layout",options)))+"</h3>\n <span class=\"icon-help tooltipstered\" data-tooltip-theme=\"info\" data-tooltip=\"~ .tooltip-content:first\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The scrollable multi-column layout configuration is optimized for items with a single row of content only. Both columns will scroll independently and fit the available page height.",options):helperMissing.call(depth0,"__","The scrollable multi-column layout configuration is optimized for items with a single row of content only. Both columns will scroll independently and fit the available page height.",options)))+"\n </div>\n <div id=\"item-editor-scrollable-multi-column\" data-target=\"body div.grid-row\">\n <label>\n <input name=\"scrollable-multi-column\" type=\"checkbox\"/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Scrollable multi-column",options):helperMissing.call(depth0,"__","Scrollable multi-column",options)))+"\n </label>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/plugins/panel/layoutEditor",["jquery","core/plugin","ui/tooltip","tpl!taoQtiItem/qtiCreator/tpl/layoutEditor/panel","taoQtiItem/qtiCreator/editor/gridEditor/content"],function($,pluginFactory,tooltip,panelTpl,contentHelper){'use strict';return pluginFactory({name:"layoutEditor",init:function(){function _getItemBody(){return $itemEditorPanel.find(".qti-itemBody")}function setMultiColCheckbox(){var $target=$(target);$target.hasClass("dual-column-layout")&&$scrollableMultiCol.prop("checked",!0)}function setMultiColCssClass(){var checked=0<arguments.length&&arguments[0]!==void 0?arguments[0]:isMultiColChecked(),$target=$(target);checked?addClassToTarget($target,"dual-column-layout"):removeClassFromTarget($target,"dual-column-layout")}function isMultiColChecked(){return $scrollableMultiCol.prop("checked")}function addClassToTarget($target,cssClass){$target.addClass(cssClass),item.body(contentHelper.getContent(_getItemBody()))}function removeClassFromTarget($target,cssClass){$target.removeClass(cssClass),item.body(contentHelper.getContent(_getItemBody()))}var item=this.getHost().getItem(),$container=this.getAreaBroker().getContainer(),$stylePanel=$container.find("#sidebar-right-style-editor");$stylePanel.find("#item-editor-layout-panel").remove();var $layoutEditorPanel=$(panelTpl());$stylePanel.append($layoutEditorPanel),tooltip.lookup($layoutEditorPanel);var selector=$("#item-editor-scrollable-multi-column"),target=selector.data("target"),$scrollableMultiCol=selector.find("[name=\"scrollable-multi-column\"]"),$itemEditorPanel=$("#item-editor-panel");$scrollableMultiCol.on("click",function(){setMultiColCssClass(this.checked)}),$(document).on("ready.qti-widget",function(){setMultiColCheckbox(),setMultiColCssClass()})}})}),define("taoQtiItem/qtiCreator/widgets/choices/Widget",["taoQtiItem/qtiCreator/widgets/Widget"],function(Widget){var ChoiceWidget=Widget.clone();return ChoiceWidget.buildContainer=function(){this.$container=this.$original},ChoiceWidget.initCreator=function(){if(Widget.initCreator.call(this),this.interaction=this.element.getInteraction(),!this.interaction)throw new Error("cannot find related interaction");this.listenToInteractionStates()},ChoiceWidget.listenToInteractionStates=function(){var _this=this;this.beforeStateInit(function(e,element,state){if(element.is("interaction")&&element.getSerial()===_this.interaction.getSerial()&&state.name!==_this.getCurrentState().name)switch(state.name){case"answer":case"sleep":case"question":_this.changeState(state.name);break;case"delete":_this.changeState("sleep");}}),this.beforeStateExit(function(e,element,state){element.is("interaction")&&element.getSerial()===_this.interaction.getSerial()&&"choice"===state.name&&_this.changeState("question")})},ChoiceWidget}),define("taoQtiItem/qtiCreator/widgets/states/Answer",["taoQtiItem/qtiCreator/widgets/states/factory"],function(stateFactory){return stateFactory.create("answer",["active"],function(){throw new Error("state \"answer\" prototype init method must be implemented")},function(){throw new Error("state \"answer\" prototype exit method must be implemented")})}),define("taoQtiItem/qtiCreator/widgets/states/Choice",["taoQtiItem/qtiCreator/widgets/states/factory"],function(stateFactory){'use strict';return stateFactory.create("choice",["question","active"],function(){throw new Error("state \"choice\" prototype init method must be implemented")},function(){throw new Error("state \"choice\" prototype exit method must be implemented")})}),define("taoQtiItem/qtiCreator/widgets/states/Correct",["taoQtiItem/qtiCreator/widgets/states/factory"],function(stateFactory){return stateFactory.create("correct",["answer","active"],function(){throw new Error("state \"correct\" prototype init method must be implemented")},function(){throw new Error("state \"correct\" prototype exit method must be implemented")})}),define("taoQtiItem/qtiCreator/widgets/states/Map",["taoQtiItem/qtiCreator/widgets/states/factory"],function(stateFactory){return stateFactory.create("map",["answer","active"],function(){throw new Error("state \"map\" prototype init method must be implemented")},function(){throw new Error("state \"map\" prototype exit method must be implemented")})}),define("taoQtiItem/qtiCreator/widgets/states/NoRp",["taoQtiItem/qtiCreator/widgets/states/factory"],function(stateFactory){'use strict';return stateFactory.create("norp",["answer","active"],function(){throw new Error("state \"norp\" prototype init method must be implemented")},function(){throw new Error("state \"norp\" prototype exit method must be implemented")})}),define("taoQtiItem/qtiCreator/widgets/states/Question",["taoQtiItem/qtiCreator/widgets/states/factory"],function(stateFactory){return stateFactory.create("question",["active"],function(){throw new Error("state \"question\" prototype init method must be implemented")},function(){throw new Error("state \"question\" prototype exit method must be implemented")})}),define("tpl!taoQtiItem/qtiCreator/tpl/notifications/invalidInfoBox",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"invalid-info-box\" data-widget-component=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"icon-warning\"></span>\n <span class=\"message\">\n ",stack1=(helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"There is an incomplete element in your item: please click on it to complete it.",options):helperMissing.call(depth0,"__","There is an incomplete element in your item: please click on it to complete it.",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </span>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/states/Invalid",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","tpl!taoQtiItem/qtiCreator/tpl/notifications/invalidInfoBox"],function($,stateFactory,invalidInfoBoxTpl){return stateFactory.create("invalid",["sleep"],function(){this.widget.$container.addClass("invalid"),this.$messageBox=$(invalidInfoBoxTpl({serial:this.widget.serial}));var $itemEditorBar=$(".item-editor-bar");$itemEditorBar.append(this.$messageBox)},function(){this.widget.$container.removeClass("invalid"),this.$messageBox.remove()})}),define("taoQtiItem/qtiCreator/widgets/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Active","taoQtiItem/qtiCreator/widgets/states/Answer","taoQtiItem/qtiCreator/widgets/states/Choice","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCreator/widgets/states/Deleting","taoQtiItem/qtiCreator/widgets/states/Inactive","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCreator/widgets/states/NoRp","taoQtiItem/qtiCreator/widgets/states/Question","taoQtiItem/qtiCreator/widgets/states/Sleep","taoQtiItem/qtiCreator/widgets/states/Invalid"],function(factory){'use strict';return factory.createBundle(arguments)}),define("taoQtiItem/qtiCreator/widgets/choices/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Sleep"],function(stateFactory,Sleep){var ChoiceStateSleep=stateFactory.create(Sleep,function(){},function(){});return ChoiceStateSleep}),define("taoQtiItem/qtiCreator/widgets/choices/states/Active",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Active"],function(stateFactory,Active){var ChoiceStateActive=stateFactory.create(Active,function(){},function(){});return ChoiceStateActive}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/simpleChoice.content",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div class=\"mini-tlb\" data-edit=\"question\" data-for=\"",(helper=helpers.choiceSerial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.choiceSerial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <div class=\"rgt tlb-button\" title=\"Delete\" data-role=\"delete\">\n <span class=\"icon-bin\"></span>\n </div>\n <div class=\"rgt tlb-button\" data-role=\"shuffle-pin\" title=\"Shuffle/Pin\" style=\"",stack1=helpers["if"].call(depth0,depth0&&depth0.interactionShuffle,{hash:{},inverse:self.program(3,function(){return"display:none;"},data),fn:self.program(1,function(){return""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\">\n <span class=\"",stack1=helpers["if"].call(depth0,depth0&&depth0.fixed,{hash:{},inverse:self.program(7,function(){return"icon-shuffle"},data),fn:self.program(5,function(){return"icon-pin"},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"></span>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/choices/helpers/formElement",["jquery"],function($){return{initShufflePinToggle:function initShufflePinToggle(widget){var $container=widget.$container,choice=widget.element,interaction=choice.getInteraction(),$shuffleToggle=$container.find("[data-role=\"shuffle-pin\"]"),toggleVisibility=function(show){"true"===show?$shuffleToggle.show():$shuffleToggle.hide(),$(".qti-item").trigger("toolbarchange",{callee:"formElementHelper"})};$shuffleToggle.off("mousedown").on("mousedown",function(e){var $icon=$(this).children();e.stopPropagation(),0===$icon.length&&($icon=$(this)),$icon.hasClass("icon-shuffle")?($icon.removeClass("icon-shuffle").addClass("icon-pin"),choice.attr("fixed",!0)):($icon.removeClass("icon-pin").addClass("icon-shuffle"),choice.attr("fixed",!1))}),toggleVisibility(interaction.attr("shuffle")),widget.on("attributeChange",function(data){data.element.serial===interaction.serial&&"shuffle"===data.key&&toggleVisibility(data.value)})},initDelete:function initDelete(widget){var $container=widget.$container;$container.find("[data-role=\"delete\"]").on("mousedown",function(e){($container.hasClass("edit-choice")||$(e.target).closest(".mini-tlb").data("for")===widget.element.serial)&&(e.stopPropagation(),widget.changeState("deleting"))})}}}),define("taoQtiItem/qtiCreator/widgets/choices/states/Question",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Question","tpl!taoQtiItem/qtiCreator/tpl/toolbars/simpleChoice.content","taoQtiItem/qtiCreator/widgets/choices/helpers/formElement"],function($,stateFactory,QuestionState,contentToolbarTpl,formElement){var ChoiceStateQuestion=stateFactory.create(QuestionState,function(){var _widget=this.widget;_widget.$container.on("click.question",function(){_widget.changeState("choice")}).on("mouseenter.question",function(){$(this).addClass("hover")}).on("mouseleave.question",function(){$(this).removeClass("hover")}),this.createToolbar().show()},function(){this.removeToolbar(),this.widget.$container.off(".question")});return ChoiceStateQuestion.prototype.createToolbar=function(){var _widget=this.widget,$container=_widget.$container,choice=_widget.element,$toolbar=$container.find(".mini-tlb").not("[data-html-editable] *"),interaction;return $toolbar.length||(interaction=choice.getInteraction(),$toolbar=$(contentToolbarTpl({choiceSerial:choice.getSerial(),interactionSerial:interaction.getSerial(),fixed:choice.attr("fixed"),interactionShuffle:interaction.attr("shuffle")})),$container.append($toolbar),formElement.initShufflePinToggle(_widget),formElement.initDelete(_widget)),$toolbar},ChoiceStateQuestion.prototype.removeToolbar=function(){this.widget.$container.find(".mini-tlb[data-edit=question]").remove()},ChoiceStateQuestion}),define("taoQtiItem/qtiCreator/widgets/choices/states/Answer",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Answer"],function(stateFactory,Answer){var ChoiceStateAnswer=stateFactory.create(Answer,function(){},function(){});return ChoiceStateAnswer}),define("taoQtiItem/qtiCreator/widgets/choices/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/states","taoQtiItem/qtiCreator/widgets/choices/states/Sleep","taoQtiItem/qtiCreator/widgets/choices/states/Active","taoQtiItem/qtiCreator/widgets/choices/states/Question","taoQtiItem/qtiCreator/widgets/choices/states/Answer"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/choices/states/Choice",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Choice","taoQtiItem/qtiItem/core/Element"],function(stateFactory,Choice,Element){var ChoiceStateChoice=stateFactory.create(Choice,function(){var _widget=this.widget;_widget.beforeStateInit(function(e,element,state){Element.isA(element,"choice")&&_widget.interaction.getChoice(element.serial)?"choice"===state.name&&element.serial!==_widget.serial?_widget.changeState("question"):"active"===state.name&&_widget.changeState("question"):(element.is("img")||element.is("math")||element.is("object"))&&"active"===state.name&&_widget.changeState("question")},"otherActive"),this.initForm(),this.widget.$form.show()},function(){this.widget.$form.empty().hide(),this.widget.offEvents("otherActive")});return ChoiceStateChoice.prototype.initForm=function(){stateFactory.throwMissingRequiredImplementationError("initForm")},ChoiceStateChoice}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/choices/gap",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Identifier",options):helperMissing.call(depth0,"__","Identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options):helperMissing.call(depth0,"__","The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options)))+"</div>\n\n <input type=\"text\"\n name=\"identifier\"\n value=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n placeholder=\"e.g. my-choice_1\"\n data-validate=\"$notEmpty; $qtiIdentifier; $availableIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n</div>\n\n<div class=\"panel\">\n <label>\n <input name=\"required\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.required,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"required",options):helperMissing.call(depth0,"__","required",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Define whether a choice must be selected by the candidate in order to form a valid response to the interaction.",options):helperMissing.call(depth0,"__","Define whether a choice must be selected by the candidate in order to form a valid response to the interaction.",options)))+"\n </span>\n</div>\n\n<h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Shape position",options):helperMissing.call(depth0,"__","Shape position",options)))+"</h3>\n\n<div class=\"panel\">\n <label for=\"x\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Left",options):helperMissing.call(depth0,"__","Left",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The left position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The left position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"x\" value=\"",(helper=helpers.x)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.x,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n</div>\n\n<div class=\"panel\">\n <label for=\"y\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Top",options):helperMissing.call(depth0,"__","Top",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The top position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The top position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"y\" value=\"",(helper=helpers.y)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.y,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n</div>\n\n<div class=\"panel\">\n <label for=\"width\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Width",options):helperMissing.call(depth0,"__","Width",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The shape width in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The shape width in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"width\" value=\"",(helper=helpers.width)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.width,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n</div>\n\n<div class=\"panel\">\n <label for=\"height\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Height",options):helperMissing.call(depth0,"__","Height",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The shape height in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The shape height in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"height\" value=\"",(helper=helpers.height)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.height,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/helpers/identifier",["lodash"],function(_){var _updateChoiceIdentifierInResponse=function(response,oldId,newId){var escapedOldId=oldId.replace(/([.-])/g,"\\$1"),regex=new RegExp("([^\\s]*\\s+|^)("+escapedOldId+")(\\s+[^\\s]*|$)");for(var i in response.correctResponse)response.correctResponse[i]=response.correctResponse[i].replace(regex,"$1"+newId+"$3");var mapEntries={};_.forIn(response.mapEntries,function(value,mapKey){mapKey=mapKey.replace(regex,"$1"+newId+"$3"),mapEntries[mapKey]=value}),response.mapEntries=mapEntries},_updateChoiceIdentifier=_.throttle(function(choice,newId,response){var oldId=choice.id();if(oldId!==newId){_updateChoiceIdentifierInResponse(response,oldId,newId),choice.id(newId);var interaction=_get("interactionFromChoice",choice,function(){return choice.getInteraction()});try{var $choiceContainer=choice.getContainer(null,choice.qtiClass+"."+interaction.qtiClass);$choiceContainer.attr("data-identifier",choice.id()),$choiceContainer.find("input").val(choice.id())}catch(ex){}}},500),_cache=[],_setCache=function(cache,element,value){_cache[cache]||(_cache[cache]={}),_cache[cache][element.getSerial()]=value},_getCache=function(cache,element){var serial=element.getSerial();return serial&&_cache[cache]&&_cache[cache][serial]?_cache[cache][serial]:null},_get=function(cache,element,callback){var ret=_getCache(cache,element);return ret||(ret=callback.call(element),_setCache(cache,element,ret)),ret};return{updateChoiceIdentifier:function updateChoiceIdentifier(choice,value){if(value=value.trim(),value){var response=_get("responseFromChoice",choice,function(){var interaction=_get("interactionFromChoice",choice,function(){return choice.getInteraction()});return interaction.getResponseDeclaration()});_updateChoiceIdentifier(choice,value,response)}},updateResponseIdentifier:function updateResponseIdentifier(){throw"to be implemented"}}}),define("taoQtiItem/qtiCreator/widgets/choices/gap/states/Choice",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Choice","tpl!taoQtiItem/qtiCreator/tpl/forms/choices/gap","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/helpers/identifier","taoQtiItem/qtiItem/core/Element"],function(stateFactory,Choice,formTpl,formElement,identifierHelper,Element){var GapStateChoice=stateFactory.extend(Choice,function(){var _widget=this.widget;_widget.beforeStateInit(function(e,element,state){Element.isA(element,"gap")&&_widget.interaction.getBody().getElement(element.serial)&&("choice"===state.name&&element.serial!==_widget.serial?_widget.changeState("question"):"active"===state.name&&_widget.changeState("question"))},"otherActive")},function(){this.widget.offEvents("otherActive")});return GapStateChoice.prototype.initForm=function(){var $form=this.widget.$form,interaction=this.widget.element;$form.html(formTpl({serial:interaction.getSerial(),identifier:interaction.id(),required:!!interaction.attr("required")})),formElement.initWidget($form),formElement.setChangeCallbacks($form,interaction,{identifier:identifierHelper.updateChoiceIdentifier,required:formElement.getAttributeChangeCallback()})},GapStateChoice}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/gap",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<span class=\"mini-tlb\" data-edit=\"",(helper=helpers.state)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.state,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"rgt tlb-button\" title=\"Delete\" data-role=\"delete\">\n <span class=\"icon-bin\"></span>\n </span>\n</span>",buffer})}),define("taoQtiItem/qtiCreator/widgets/choices/gap/states/Question",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Question","tpl!taoQtiItem/qtiCreator/tpl/toolbars/gap","taoQtiItem/qtiCreator/widgets/choices/helpers/formElement"],function($,stateFactory,QuestionState,gapTpl,formElement){var GapStateQuestion=stateFactory.extend(QuestionState);return GapStateQuestion.prototype.createToolbar=function(){var _widget=this.widget,$container=_widget.$container,gap=_widget.element,$toolbar=$container.find(".mini-tlb").not("[data-html-editable] *");return $toolbar.length||($toolbar=$(gapTpl({serial:gap.getSerial(),state:"question"})),$container.append($toolbar),formElement.initDelete(_widget)),$toolbar},GapStateQuestion}),define("taoQtiItem/qtiCreator/widgets/choices/gap/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/states","taoQtiItem/qtiCreator/widgets/choices/gap/states/Choice","taoQtiItem/qtiCreator/widgets/choices/gap/states/Question"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/choices/gap/Widget",["taoQtiItem/qtiCreator/widgets/choices/Widget","taoQtiItem/qtiCreator/widgets/choices/gap/states/states"],function(Widget,states){var GapWidget=Widget.clone();return GapWidget.initCreator=function(){Widget.initCreator.call(this),this.registerStates(states)},GapWidget.buildContainer=function(){this.$container=this.$original.addClass("widget-box"),this.$container.attr("contenteditable",!1)},GapWidget}),define("taoQtiItem/qtiCreator/renderers/choices/Gap",["lodash","taoQtiItem/qtiCommonRenderer/renderers/choices/Gap","taoQtiItem/qtiCreator/widgets/choices/gap/Widget"],function(_,Gap,GapWidget){'use strict';var CreatorGap=_.clone(Gap);return CreatorGap.render=function(choice,options){GapWidget.build(choice,Gap.getContainer(choice),this.getOption("choiceOptionForm"),options)},CreatorGap}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/choices/simpleAssociableChoice",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Identifier",options):helperMissing.call(depth0,"__","Identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options):helperMissing.call(depth0,"__","The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options)))+"</div>\n\n <input type=\"text\"\n name=\"identifier\"\n value=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n placeholder=\"e.g. my-choice_1\"\n data-validate=\"$notEmpty; $qtiIdentifier; $availableIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n</div>\n\n<div class=\"panel\">\n <h3 class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Allowed number of uses",options):helperMissing.call(depth0,"__","Allowed number of uses",options)))+"\n </h3>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The maximum number of choices this choice may be associated with. If matchMax is 0 there is no restriction.",options):helperMissing.call(depth0,"__","The maximum number of choices this choice may be associated with. If matchMax is 0 there is no restriction.",options)))+"\n </span>\n\n <!--not supported yet-->\n <div style=\"display:none;\">\n <label for=\"matchMin\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Min",options):helperMissing.call(depth0,"__","Min",options)))+"</label>\n <input name=\"matchMin\" value=\"",(helper=helpers.matchMin)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.matchMin,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-increment=\"1\" data-min=\"0\" data-max=\"100\" type=\"text\" />\n </div>\n\n <div>\n <label for=\"matchMax\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Max",options):helperMissing.call(depth0,"__","Max",options)))+"</label>\n <input name=\"matchMax\" value=\"",(helper=helpers.matchMax)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.matchMax,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-increment=\"1\" data-min=\"0\" data-max=\"100\" type=\"text\" />\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/choices/simpleAssociableChoice/states/Choice",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Choice","tpl!taoQtiItem/qtiCreator/tpl/forms/choices/simpleAssociableChoice","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/helpers/identifier","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content"],function(stateFactory,Choice,formTpl,formElement,identifierHelper,htmlEditor,contentHelper){'use strict';var SimpleAssociableChoiceStateChoice=stateFactory.extend(Choice,function(){this.buildEditor()},function(){this.destroyEditor()});return SimpleAssociableChoiceStateChoice.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,choice=_widget.element,callbacks;$form.html(formTpl({serial:choice.getSerial(),identifier:choice.id(),matchMin:choice.attr("matchMin"),matchMax:choice.attr("matchMax")})),formElement.initWidget($form),callbacks=formElement.getMinMaxAttributeCallbacks("matchMin","matchMax"),callbacks.identifier=identifierHelper.updateChoiceIdentifier,formElement.setChangeCallbacks($form,choice,callbacks)},SimpleAssociableChoiceStateChoice.prototype.buildEditor=function(){var _widget=this.widget,container=_widget.element.getBody(),$editableContainer=_widget.$container;$editableContainer.attr("data-html-editable-container",!0),htmlEditor.hasEditor($editableContainer)||htmlEditor.buildEditor($editableContainer,{change:contentHelper.getChangeCallback(container),data:{container:container,widget:_widget}})},SimpleAssociableChoiceStateChoice.prototype.destroyEditor=function(){htmlEditor.destroyEditor(this.widget.$container)},SimpleAssociableChoiceStateChoice}),define("taoQtiItem/qtiCreator/widgets/choices/gapText/states/Choice",["jquery","lodash","ckeditor","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Choice","taoQtiItem/qtiCreator/widgets/choices/simpleAssociableChoice/states/Choice","taoQtiItem/qtiItem/core/Element"],function($,_,CKEditor,stateFactory,Choice,SimpleAssociableChoice,Element){'use strict';var GapTextStateChoice=stateFactory.extend(Choice,function(){var _widget=this.widget;_widget.beforeStateInit(function(e,element,state){Element.isA(element,"choice")&&_widget.interaction.getBody().getElement(element.serial)&&"choice"===state.name&&element.serial!==_widget.serial&&_widget.changeState("question")},"otherActive")},function(){this.widget.offEvents("otherActive")});return GapTextStateChoice.prototype.initForm=function(){SimpleAssociableChoice.prototype.initForm.call(this)},GapTextStateChoice}),define("taoQtiItem/qtiCreator/widgets/choices/gapText/states/Question",["jquery","lodash","ckeditor","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Question","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content"],function($,_,CKEditor,stateFactory,Question,Element,htmlEditor,contentHelper){'use strict';var GapTextStateQuestion=stateFactory.extend(Question,function(){this.buildEditor()},function(){this.destroyEditor()});return GapTextStateQuestion.prototype.initForm=_.noop(),GapTextStateQuestion.prototype.buildEditor=function(){var _widget=this.widget,container=_widget.element.getBody(),$editableContainer=_widget.$container;$editableContainer.attr("data-html-editable-container",!0),htmlEditor.hasEditor($editableContainer)||htmlEditor.buildEditor($editableContainer,{change:contentHelper.getChangeCallback(container),data:{container:container,widget:_widget},toolbar:[{name:"basicstyles",items:["Bold","Italic","Subscript","Superscript"]},{name:"insert",items:["SpecialChar"]}],qtiMedia:!1,qtiInclude:!1,enterMode:CKEditor.ENTER_BR}),$editableContainer.on("keypress.qti-widget",function(e){13===e.which&&(e.preventDefault(),$(this).blur())})},GapTextStateQuestion.prototype.destroyEditor=function(){var _widget=this.widget,interaction=_widget.interaction,$editableContainer=_widget.$container,$editable=$editableContainer.find("[data-html-editable]");if(htmlEditor.hasEditor($editableContainer)){if($editable.data("editor")&&(!htmlEditor.getData($editable)||""===htmlEditor.getData($editable))){var placeholder=interaction.getNextPlaceholder();htmlEditor.setData($editable,placeholder)}$editableContainer.off(".qti-widget"),htmlEditor.destroyEditor(this.widget.$container)}},GapTextStateQuestion}),define("taoQtiItem/qtiCreator/widgets/choices/gapText/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/states","taoQtiItem/qtiCreator/widgets/choices/gapText/states/Choice","taoQtiItem/qtiCreator/widgets/choices/gapText/states/Question"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/choices/gapText/Widget",["taoQtiItem/qtiCreator/widgets/choices/Widget","taoQtiItem/qtiCreator/widgets/choices/gapText/states/states"],function(Widget,states){var GapTextWidget=Widget.clone();return GapTextWidget.initCreator=function(){Widget.initCreator.call(this),this.registerStates(states)},GapTextWidget}),define("taoQtiItem/qtiCreator/renderers/choices/GapText",["lodash","taoQtiItem/qtiCommonRenderer/renderers/choices/GapText","taoQtiItem/qtiCreator/widgets/choices/gapText/Widget"],function(_,GapText,GapTextWidget){'use strict';var CreatorGapText=_.clone(GapText);return CreatorGapText.render=function(choice,options){GapTextWidget.build(choice,GapText.getContainer(choice),this.getOption("choiceOptionForm"),options)},CreatorGapText}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/choices/choice",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Identifier",options):helperMissing.call(depth0,"__","Identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options):helperMissing.call(depth0,"__","The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options)))+"</div>\n\n <input type=\"text\"\n name=\"identifier\"\n value=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n placeholder=\"e.g. my-choice_1\"\n data-validate=\"$notEmpty; $qtiIdentifier; $availableIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/choices/simpleChoice/states/Choice",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Choice","tpl!taoQtiItem/qtiCreator/tpl/forms/choices/choice","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/helpers/identifier","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content"],function(stateFactory,Choice,formTpl,formElement,identifierHelper,htmlEditor,contentHelper){'use strict';var SimpleChoiceStateChoice=stateFactory.extend(Choice,function(){this.buildEditor()},function(){this.destroyEditor()});return SimpleChoiceStateChoice.prototype.initForm=function(){var _widget=this.widget;_widget.$form.html(formTpl({serial:_widget.element.getSerial(),identifier:_widget.element.id()})),formElement.initWidget(_widget.$form),formElement.setChangeCallbacks(_widget.$form,_widget.element,{identifier:identifierHelper.updateChoiceIdentifier})},SimpleChoiceStateChoice.prototype.buildEditor=function(){var _widget=this.widget,container=_widget.element.getBody(),$editableContainer=_widget.$container;$editableContainer.attr("data-html-editable-container",!0),htmlEditor.hasEditor($editableContainer)||htmlEditor.buildEditor($editableContainer,{change:contentHelper.getChangeCallback(container),data:{container:container,widget:_widget}})},SimpleChoiceStateChoice.prototype.destroyEditor=function(){htmlEditor.destroyEditor(this.widget.$container)},SimpleChoiceStateChoice}),define("taoQtiItem/qtiCreator/widgets/choices/hottext/states/Choice",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Choice","taoQtiItem/qtiCreator/widgets/choices/simpleChoice/states/Choice"],function(stateFactory,Choice,SimpleChoice){var HottextStateChoice=stateFactory.extend(Choice);return HottextStateChoice.prototype.initForm=function(){SimpleChoice.prototype.initForm.call(this)},HottextStateChoice}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/hottext",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<span class=\"mini-tlb\" data-edit=\"",(helper=helpers.state)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.state,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"tlb-button\" title=\"Restore\" data-role=\"restore\">\n <span class=\"icon-undo\" data-role=\"restore\"></span>\n </span>\n</span>",buffer})}),define("taoQtiItem/qtiCreator/widgets/choices/hottext/states/Question",["lodash","jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Question","tpl!taoQtiItem/qtiCreator/tpl/toolbars/hottext"],function(_,$,stateFactory,QuestionState,gapTpl){'use strict';var HottextStateQuestion=stateFactory.extend(QuestionState);return HottextStateQuestion.prototype.createToolbar=function(){var _widget=this.widget,$container=_widget.$container,hottext=_widget.element,$toolbar=$container.find(".mini-tlb").not("[data-html-editable] *");return $toolbar.length||($toolbar=$(gapTpl({serial:hottext.getSerial(),state:"question"})),$container.append($toolbar),$toolbar.find("[data-role=restore]").on("mousedown.question",function(){var inlineStaticElements=hottext.getElements(),parent=hottext.parent(),newBody=parent.body().replace(hottext.placeholder(),hottext.body()),hottextHtmlReplacement=_.reduce(inlineStaticElements,function(hottextBody,elt){return parent.setElement(elt),hottext.removeElement(elt),hottextBody.replace(elt.placeholder(),elt.render())},hottext.body());_widget.destroy(),hottext.remove(),parent.body(newBody),$container.replaceWith(hottextHtmlReplacement),_.each(inlineStaticElements,function(elt){elt.postRender()})})),$toolbar},HottextStateQuestion}),define("taoQtiItem/qtiCreator/widgets/choices/hottext/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/states","taoQtiItem/qtiCreator/widgets/choices/hottext/states/Choice","taoQtiItem/qtiCreator/widgets/choices/hottext/states/Question"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/choices/hottext/Widget",["taoQtiItem/qtiCreator/widgets/choices/Widget","taoQtiItem/qtiCreator/widgets/choices/hottext/states/states"],function(Widget,states){var HottextWidget=Widget.clone();return HottextWidget.initCreator=function(){Widget.initCreator.call(this),this.registerStates(states)},HottextWidget.buildContainer=function(){this.$container=this.$original.addClass("widget-box"),this.$container.attr("contenteditable",!1),this.$original.find(".hottext-checkmark > input").prop("disabled","disabled")},HottextWidget}),define("taoQtiItem/qtiCreator/renderers/choices/Hottext",["lodash","taoQtiItem/qtiCommonRenderer/renderers/choices/Hottext","taoQtiItem/qtiCreator/widgets/choices/hottext/Widget"],function(_,Hottext,HottextWidget){'use strict';var CreatorHottext=_.clone(Hottext);return CreatorHottext.render=function(choice,options){HottextWidget.build(choice,Hottext.getContainer(choice),this.getOption("choiceOptionForm"),options)},CreatorHottext});define("taoQtiItem/qtiCreator/renderers/choices/InlineChoice",function(){}),define("taoQtiItem/qtiCreator/widgets/choices/simpleAssociableChoice/states/Question",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Question","tpl!taoQtiItem/qtiCreator/tpl/toolbars/simpleChoice.content","taoQtiItem/qtiCreator/widgets/choices/helpers/formElement"],function($,stateFactory,QuestionState,contentToolbarTpl,formElement){'use strict';var SimpleAssociableChoiceStateQuestion=stateFactory.extend(QuestionState);return SimpleAssociableChoiceStateQuestion.prototype.createToolbar=function(){var _widget=this.widget,$container=_widget.$container,choice=_widget.element,$toolbar=$container.find(".mini-tlb").not("[data-html-editable] *"),interaction;return $toolbar.length||(interaction=choice.getInteraction(),$toolbar=$(contentToolbarTpl({choiceSerial:choice.getSerial(),interactionSerial:interaction.getSerial(),fixed:choice.attr("fixed"),interactionShuffle:interaction.attr("shuffle")})),$container.children(".inner-wrapper").append($toolbar),formElement.initShufflePinToggle(_widget),formElement.initDelete(_widget)),$toolbar},SimpleAssociableChoiceStateQuestion}),define("taoQtiItem/qtiCreator/widgets/choices/simpleAssociableChoice/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/states","taoQtiItem/qtiCreator/widgets/choices/simpleAssociableChoice/states/Question","taoQtiItem/qtiCreator/widgets/choices/simpleAssociableChoice/states/Choice"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/choices/simpleAssociableChoice/Widget",["jquery","taoQtiItem/qtiCreator/widgets/choices/Widget","taoQtiItem/qtiCreator/widgets/choices/simpleAssociableChoice/states/states"],function($,Widget,states){var SimpleAssociableChoiceWidget=Widget.clone();return SimpleAssociableChoiceWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this),this.$container.wrapInner($("<div>",{class:"inner-wrapper"})),this.$container.closest("table.matrix").find("input[type=checkbox]:enabled").prop("disabled","disabled")},SimpleAssociableChoiceWidget}),define("taoQtiItem/qtiCreator/renderers/choices/SimpleAssociableChoice.AssociateInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleAssociableChoice.AssociateInteraction","taoQtiItem/qtiCreator/widgets/choices/simpleAssociableChoice/Widget"],function(_,SimpleAssociableChoice,SimpleChoiceWidget){'use strict';var CreatorSimpleChoice=_.clone(SimpleAssociableChoice);return CreatorSimpleChoice.render=function(choice,options){SimpleChoiceWidget.build(choice,SimpleAssociableChoice.getContainer(choice),this.getOption("choiceOptionForm"),options)},CreatorSimpleChoice}),define("taoQtiItem/qtiCreator/renderers/choices/SimpleAssociableChoice.MatchInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleAssociableChoice.MatchInteraction","taoQtiItem/qtiCreator/widgets/choices/simpleAssociableChoice/Widget"],function(_,SimpleAssociableChoice,SimpleAssociableChoiceWidget){'use strict';var CreatorSimpleAssociableChoice=_.clone(SimpleAssociableChoice);return CreatorSimpleAssociableChoice.render=function(choice,options){SimpleAssociableChoiceWidget.build(choice,SimpleAssociableChoice.getContainer(choice),this.getOption("choiceOptionForm"),options)},CreatorSimpleAssociableChoice}),define("taoQtiItem/qtiCreator/widgets/choices/simpleChoice/states/Question",["lodash","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Question","tpl!taoQtiItem/qtiCreator/tpl/forms/choices/choice","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/helpers/identifier","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content"],function(_,stateFactory,Question){'use strict';var SimpleChoiceStateQuestion=stateFactory.extend(Question);return SimpleChoiceStateQuestion.prototype.initForm=_.noop(),SimpleChoiceStateQuestion}),define("taoQtiItem/qtiCreator/widgets/choices/simpleChoice/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/states","taoQtiItem/qtiCreator/widgets/choices/simpleChoice/states/Question","taoQtiItem/qtiCreator/widgets/choices/simpleChoice/states/Choice"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/choices/simpleChoice/Widget",["taoQtiItem/qtiCreator/widgets/choices/Widget","taoQtiItem/qtiCreator/widgets/choices/simpleChoice/states/states"],function(Widget,states){var SimpleChoiceWidget=Widget.clone();return SimpleChoiceWidget.initCreator=function(){Widget.initCreator.call(this),this.registerStates(states);var $realLabel=this.$container.find(".real-label");$realLabel.children("input").attr("disabled","disabled")},SimpleChoiceWidget}),define("taoQtiItem/qtiCreator/renderers/choices/SimpleChoice.ChoiceInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleChoice.ChoiceInteraction","taoQtiItem/qtiCreator/widgets/choices/simpleChoice/Widget"],function(_,SimpleChoice,SimpleChoiceWidget){'use strict';var CreatorSimpleChoice=_.clone(SimpleChoice);return CreatorSimpleChoice.render=function(choice,options){SimpleChoiceWidget.build(choice,SimpleChoice.getContainer(choice),this.getOption("choiceOptionForm"),options)},CreatorSimpleChoice}),define("taoQtiItem/qtiCreator/renderers/choices/SimpleChoice.OrderInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/choices/SimpleChoice.OrderInteraction","taoQtiItem/qtiCreator/widgets/choices/simpleChoice/Widget"],function(_,SimpleChoice,SimpleChoiceWidget){'use strict';var CreatorSimpleChoice=_.clone(SimpleChoice);return CreatorSimpleChoice.render=function(choice,options){SimpleChoiceWidget.build(choice,SimpleChoice.getContainer(choice),this.getOption("choiceOptionForm"),options)},CreatorSimpleChoice}),define("tpl!taoQtiItem/qtiCreator/tpl/container",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="<div data-html-editable=\"true\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>",buffer}function program3(depth0,data){var buffer="",stack1,helper;return(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return stack1=(helper=helpers.equal||depth0&&depth0.equal,options={hash:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),data:data},helper?helper.call(depth0,depth0&&depth0.contentModel,"blockStatic",options):helperMissing.call(depth0,"equal",depth0&&depth0.contentModel,"blockStatic",options)),stack1||0===stack1?stack1:""})}),define("taoQtiItem/qtiCreator/renderers/Container",["tpl!taoQtiItem/qtiCreator/tpl/container"],function(tpl){'use strict';return{qtiClass:"_container",template:tpl}}),define("taoQtiItem/qtiCreator/widgets/static/img/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Sleep"],function(stateFactory,SleepState){var ImgStateSleep=stateFactory.extend(SleepState,function(){},function(){});return ImgStateSleep}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/img",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"src\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"File",options):helperMissing.call(depth0,"__","File",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The file path to the image.",options):helperMissing.call(depth0,"__","The file path to the image.",options)))+"</div>\n <input type=\"text\" name=\"src\" value=\"",(helper=helpers.src)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.src,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty; $fileExists(baseUrl=",(helper=helpers.baseUrl)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.baseUrl,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+")\"/>\n <button class=\"btn-info small block\" data-role=\"upload-trigger\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select image",options):helperMissing.call(depth0,"__","Select image",options)))+"</button>\n</div>\n\n<div class=\"panel\">\n <label for=\"alt\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Alt Text",options):helperMissing.call(depth0,"__","Alt Text",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The text to be displayed if the image is not available.",options):helperMissing.call(depth0,"__","The text to be displayed if the image is not available.",options)))+"</div>\n <input type=\"text\" name=\"alt\" value=\"",(helper=helpers.alt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.alt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" placeholder=\"e.g. House with a garden\"/>\n</div>\n\n<div class=\"change-alt-modal-feedback modal\">\n <div class=\"modal-body clearfix\">\n <p>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Would you like to replace the alt text",options):helperMissing.call(depth0,"__","Would you like to replace the alt text",options)))+"</p>\n <p class=\"alt-text\"></p>\n\n <div class=\"rgt\">\n <button class=\"btn-regular small cancel\" type=\"button\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"No",options):helperMissing.call(depth0,"__","No",options)))+"</button>\n <button class=\"btn-info small save\" type=\"button\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Yes",options):helperMissing.call(depth0,"__","Yes",options)))+"</button>\n </div>\n </div>\n</div>\n\n<div data-role=\"advanced\" style=\"display:none\">\n \n <hr/>\n \n<!--\n <div class=\"panel\">\n\n <label for=\"align\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Alignment",options):helperMissing.call(depth0,"__","Alignment",options)))+"</label>\n <select name=\"align\" class=\"select2\" data-has-search=\"false\">\n <option value=\"default\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"default",options):helperMissing.call(depth0,"__","default",options)))+"</option>\n <option value=\"left\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"left",options):helperMissing.call(depth0,"__","left",options)))+"</option>\n <option value=\"right\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"right",options):helperMissing.call(depth0,"__","right",options)))+"</option>\n </select>\n </div>-->\n \n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Size and position",options):helperMissing.call(depth0,"__","Size and position",options)))+"</h3>\n <div class=\"panel img-resizer\"></div>\n \n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/helpers/inline",["lodash","taoQtiItem/qtiCreator/helper/dummyElement","ui/validator/validators"],function(_,dummyElement,validators){var _qtiClassToDummies={math:"maths",img:"image",object:"media"},inlineHelper={checkFileExists:function checkFileExists(widget,fileSrcAttrName,baseUrl){var element=widget.element;validators.validators.fileExists.validate(element.attr(fileSrcAttrName),function(fileExists){fileExists||(element.attr(fileSrcAttrName,""),inlineHelper.togglePlaceholder(widget))},{baseUrl:baseUrl||""})},togglePlaceholder:function togglePlaceholder(widget,opts){var options=_.defaults(opts||{},{container:widget.$original,type:widget.element.qtiClass}),$container=options.container,$placeholder=$container.siblings(".dummy-element");if(widget.element.isEmpty()){$container.hide();var type=_qtiClassToDummies[options.type]||options.type;$placeholder.length||($placeholder=dummyElement.get(type),$container.after($placeholder)),$placeholder.show()}else $container.show(),$placeholder.hide();widget.$container.trigger("contentChange.qti-widget")},positionFloat:function positionFloat(widget,position){var $container=widget.$container,elt=widget.element;$container.removeClass("rgt lft"),elt.removeClass("rgt"),elt.removeClass("lft");"right"===position?($container.addClass("rgt"),elt.addClass("rgt")):"left"===position?($container.addClass("lft"),elt.addClass("lft")):void 0}};return inlineHelper}),define("taoQtiItem/qtiCreator/widgets/static/img/states/Active",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Active","tpl!taoQtiItem/qtiCreator/tpl/forms/static/img","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/static/helpers/inline","ui/image/ImgStateActive"],function(stateFactory,ActiveState,formTpl,formElement,inlineHelper,ImgStateActive){'use strict';return ImgStateActive(stateFactory,ActiveState,formTpl,formElement,inlineHelper)}),define("taoQtiItem/qtiCreator/widgets/static/img/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states","taoQtiItem/qtiCreator/widgets/static/img/states/Sleep","taoQtiItem/qtiCreator/widgets/static/img/states/Active"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/static/helpers/widget",["jquery","lodash"],function($,_){'use strict';return{buildInlineContainer:function buildInlineContainer(widget){var float="",$wrap;widget.element.hasClass("lft")?float=" lft":widget.element.hasClass("rgt")&&(float=" rgt"),$wrap=$("<span>",{"data-serial":widget.element.serial,class:"widget-box widget-inline widget-"+widget.element.qtiClass+float,"data-qti-class":widget.element.qtiClass,contenteditable:"false"}),widget.$container=widget.$original.wrap($wrap).parent()},buildBlockContainer:function buildBlockContainer(widget){var $wrap=$("<div>",{"data-serial":widget.element.serial,class:"widget-box widget-block widget-"+widget.element.qtiClass,"data-qti-class":widget.element.qtiClass});widget.$container=widget.$original.wrap($wrap).parent()},createToolbar:function createToolbar(widget,toolbarTpl){var $tlb;if(_.isFunction(toolbarTpl))$tlb=$(toolbarTpl({serial:widget.serial,state:"active"})),widget.$container.append($tlb),$tlb.find("[data-role=\"delete\"]").on("click.widget-box",function(e){e.stopPropagation(),widget.changeState("deleting")});else throw new Error("the toolbarTpl must be a handlebars function")}}}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/media",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<span class=\"mini-tlb\" data-edit=\"",(helper=helpers.state)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.state,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"rgt tlb-button\" title=\"Delete\" data-role=\"delete\">\n <span class=\"icon-bin\"></span>\n </span>\n</span>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/img/Widget",["jquery","taoQtiItem/qtiCreator/widgets/static/Widget","taoQtiItem/qtiCreator/widgets/static/img/states/states","taoQtiItem/qtiCreator/widgets/static/helpers/widget","tpl!taoQtiItem/qtiCreator/tpl/toolbars/media","taoQtiItem/qtiCreator/widgets/static/helpers/inline","ui/mediaEditor/plugins/mediaAlignment/helper"],function($,Widget,states,helper,toolbarTpl,inlineHelper,alignmentHelper){'use strict';var ImgWidget=Widget.clone();return ImgWidget.initCreator=function(options){var self=this,img=this.element;this.registerStates(states),Widget.initCreator.call(this),inlineHelper.togglePlaceholder(this),alignmentHelper.initAlignment(this),inlineHelper.checkFileExists(this,"src",options.baseUrl),$("#item-editor-scope").on("filedelete.resourcemgr."+this.element.serial,function(e,src){self.getAssetManager().resolve(img.attr("src"))===self.getAssetManager().resolve(src)&&(img.attr("src",""),inlineHelper.togglePlaceholder(self))})},ImgWidget.destroy=function(){$("#item-editor-scope").off("."+this.element.serial)},ImgWidget.getRequiredOptions=function(){return["baseUrl","uri","lang","mediaManager","assetManager"]},ImgWidget.buildContainer=function(){return helper.buildInlineContainer(this),this.$container.css({width:this.element.attr("width"),height:this.element.attr("height")}),this.$original[0]&&(this.$original[0].setAttribute("width","100%"),this.$original[0].removeAttribute("height")),this},ImgWidget.createToolbar=function(){return helper.createToolbar(this,toolbarTpl),this},ImgWidget}),define("taoQtiItem/qtiCreator/renderers/Img",["lodash","taoQtiItem/qtiCommonRenderer/renderers/Img","taoQtiItem/qtiCreator/widgets/static/img/Widget"],function(_,Renderer,Widget){'use strict';var CreatorImg=_.clone(Renderer);return CreatorImg.render=function(img,options){options=options||{},options.baseUrl=this.getOption("baseUrl"),options.uri=this.getOption("uri"),options.lang=this.getOption("lang"),options.mediaManager=this.getOption("mediaManager"),options.assetManager=this.getAssetManager(),options.state=img.metaData.widget&&img.metaData.widget.getCurrentState().name,Widget.build(img,Renderer.getContainer(img),this.getOption("bodyElementOptionForm"),options)},CreatorImg}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/include",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program3(depth0,data){var buffer="",stack1,helper;return buffer+="\n <option value=\"",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.name)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.name,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n ",buffer}function program4(){return"selected=\"selected\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"href\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"File",options):helperMissing.call(depth0,"__","File",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The file path to the shared stimulus.",options):helperMissing.call(depth0,"__","The file path to the shared stimulus.",options)))+"</div>\n <input type=\"text\" name=\"href\" value=\"",(helper=helpers.href)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.href,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty;\" readonly/>\n <button class=\"btn-info small block\" data-role=\"upload-trigger\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select shared stimulus",options):helperMissing.call(depth0,"__","Select shared stimulus",options)))+"</button>\n</div>\n\n<div class=\"panel\">\n <label>\n <input name=\"scrolling\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.scrolling,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Enable Scrolling",options):helperMissing.call(depth0,"__","Enable Scrolling",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Enable/disable scrolling.",options):helperMissing.call(depth0,"__","Enable/disable scrolling.",options)))+"\n </span>\n</div>\n\n<div class=\"panel scrollingSelect\">\n <label for=\"scrollingHeight\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Block height (%)",options):helperMissing.call(depth0,"__","Block height (%)",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select height of passage base of conatainer height",options):helperMissing.call(depth0,"__","Select height of passage base of conatainer height",options)))+"</span>\n <select name=\"scrollingHeight\" class=\"select2\" data-has-search=\"false\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.scrollingHeights,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/include/states/Active",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Active","tpl!taoQtiItem/qtiCreator/tpl/forms/static/include","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/helper/xincludeRenderer","taoQtiItem/qtiCreator/widgets/static/helpers/itemScrollingMethods","ui/resourcemgr","ui/tooltip"],function($,_,__,stateFactory,Active,formTpl,formElement,xincludeRenderer,itemScrollingMethods){'use strict';var IncludeStateActive=stateFactory.extend(Active,function(){this.initForm()},function(){this.widget.$form.empty(),this.widget.$container.find(".mini-tlb").remove()});IncludeStateActive.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,include=_widget.element,baseUrl=_widget.options.baseUrl,$wrap=_widget.$container.parent(".".concat("custom-include-box")),isScrolling=itemScrollingMethods.isScrolling($wrap),selectedHeight=itemScrollingMethods.selectedHeight($wrap);$form.html(formTpl({baseUrl:baseUrl||"",href:include.attr("href"),scrolling:isScrolling,scrollingHeights:itemScrollingMethods.options(),selectedHeight:selectedHeight})),_initUpload(_widget),formElement.initWidget($form),formElement.setChangeCallbacks($form,_widget.element,changeCallbacks(_widget)),itemScrollingMethods.initSelect($form,isScrolling,selectedHeight)};var changeCallbacks=function(widget){return{scrolling:function scrolling(element,value){itemScrollingMethods.wrapContent(widget,value,"outer")},scrollingHeight:function scrollingHeight(element,value){itemScrollingMethods.setScrollingHeight(widget.$container.parent(".".concat("custom-include-box")),value)}}},_initUpload=function(widget){var $form=widget.$form,options=widget.options,$uploadTrigger=$form.find("[data-role=\"upload-trigger\"]"),$href=$form.find("input[name=href]"),_openResourceMgr=function(){$uploadTrigger.resourcemgr({title:__("Please select a shared stimulus file from the resource manager."),appendContainer:options.mediaManager.appendContainer,mediaSourcesUrl:options.mediaManager.mediaSourcesUrl+"?exclude=local",browseUrl:options.mediaManager.browseUrl,uploadUrl:options.mediaManager.uploadUrl,deleteUrl:options.mediaManager.deleteUrl,downloadUrl:options.mediaManager.downloadUrl,fileExistsUrl:options.mediaManager.fileExistsUrl,disableUpload:!0,params:{uri:options.uri,lang:options.lang,filters:"application/qti+xml"},pathParam:"path",select:function select(e,files){var file;files&&files.length&&(file=files[0].file,$href.val(file),xincludeRenderer.render(widget,options.baseUrl,file),_.defer(function(){$href.trigger("change")}))},open:function open(){$href.data("$tooltip")&&$href.blur().data("$tooltip").hide()},close:function close(){$href.blur()}})};$uploadTrigger.on("click",_openResourceMgr),$href.on("click",_openResourceMgr),$href.val()||_openResourceMgr()};return IncludeStateActive}),define("taoQtiItem/qtiCreator/widgets/static/include/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states","taoQtiItem/qtiCreator/widgets/static/include/states/Active"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/static/include/Widget",["jquery","taoQtiItem/qtiCreator/widgets/static/Widget","taoQtiItem/qtiCreator/widgets/static/include/states/states","taoQtiItem/qtiCreator/widgets/static/helpers/widget","tpl!taoQtiItem/qtiCreator/tpl/toolbars/media","taoQtiItem/qtiCreator/widgets/static/helpers/inline"],function($,Widget,states,helper,toolbarTpl,inlineHelper){'use strict';var IncludeWidget=Widget.clone();return IncludeWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this),inlineHelper.togglePlaceholder(this)},IncludeWidget.destroy=function(){$("#item-editor-scope").off("."+this.element.serial)},IncludeWidget.getRequiredOptions=function(){return["baseUrl","uri","lang","mediaManager"]},IncludeWidget.buildContainer=function(){return helper.buildBlockContainer(this),this.$container.css({width:this.element.attr("width"),height:this.element.attr("height")}),this.$original.removeAttr("data-serial"),this.$original[0].setAttribute("width","100%"),this.$original[0].setAttribute("height","100%"),this},IncludeWidget.createToolbar=function(){return helper.createToolbar(this,toolbarTpl),this},IncludeWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/include",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<div class=\"qti-include\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</div>",buffer})}),define("taoQtiItem/qtiCreator/renderers/Include",["lodash","taoQtiItem/qtiCommonRenderer/renderers/Include","taoQtiItem/qtiCommonRenderer/helpers/container","taoQtiItem/qtiCreator/widgets/static/include/Widget","tpl!taoQtiItem/qtiCreator/tpl/include"],function(_,Renderer,containerHelper,Widget,tpl){'use strict';var CreatorXInclude=_.clone(Renderer);return CreatorXInclude.template=tpl,CreatorXInclude.getContainer=containerHelper.get,CreatorXInclude.render=function(include,options){options=options||{},options.baseUrl=this.getOption("baseUrl"),options.uri=this.getOption("uri"),options.lang=this.getOption("lang"),options.mediaManager=this.getOption("mediaManager"),options.assetManager=this.getAssetManager(),Widget.build(include,containerHelper.get(include),this.getOption("bodyElementOptionForm"),options)},CreatorXInclude}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/grip",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<span class=\"common-tlb\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"tlb-button\" title=\"move\" data-role=\"move\">\n <span class=\"icon-grip\"></span>\n </span>\n</span>",buffer})}),define("taoQtiItem/qtiCreator/widgets/helpers/movable",["jquery","taoQtiItem/qtiCreator/editor/gridEditor/draggable","tpl!taoQtiItem/qtiCreator/tpl/toolbars/grip"],function($,draggable,gripTpl){return{create:function create(widget){var item=widget.element.getRootElement(),$container=widget.$container,$grip=$(gripTpl({serial:widget.serial})),$itemBody;$container.append($grip),$grip.on("mouseenter.qti-widget",function(){$itemBody&&$itemBody.length||($itemBody=item.data("widget").$container),draggable.createMovable($container,$itemBody)}).on("mouseleave.qti-widget",function(){draggable.destroy($container)})}}}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/interaction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",helper,options;return buffer+="\n <div class=\"state-switcher\">\n <span class=\"selected\" data-state=\"question\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Question",options):helperMissing.call(depth0,"__","Question",options)))+"</span>\n <span class=\"separator\"> | </span>\n <span class=\"link\" data-state=\"answer\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Response",options):helperMissing.call(depth0,"__","Response",options)))+"</span>\n </div>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper,options;return buffer+="<div class=\"tlb-wrapper\" style=\"\" data-edit=\"active\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"tlb-title\" title=\"",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span>\n <div class=\"tlb\">\n <div class=\"rgt tlb-button\" data-role=\"delete\" title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"delete",options):helperMissing.call(depth0,"__","delete",options)))+"\">\n <span class=\"icon-bin\"></span>\n </div>\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.switcher,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </div>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/okButton",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="<button class=\"btn-info small widget-ok\" data-edit=\"active\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"done",options):helperMissing.call(depth0,"__","done",options)))+"</button>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/Widget",["lodash","jquery","taoQtiItem/qtiCreator/widgets/Widget","taoQtiItem/qtiCreator/widgets/helpers/movable","tpl!taoQtiItem/qtiCreator/tpl/toolbars/interaction","tpl!taoQtiItem/qtiCreator/tpl/toolbars/okButton","taoQtiItem/qtiCreator/editor/gridEditor/content","../../helper/classTitles"],function(_,$,Widget,movable,toolbarTpl,okButtonTpl,contentHelper,getQtiClassTitle){function _convertToTitle(str){return str=str.replace(/[A-Z]/g,function(match){return" "+match.toUpperCase()}),str.charAt(0).toUpperCase()+str.substr(1)}var InteractionWidget=Widget.clone();return InteractionWidget.init=function(element,$container,$form,$responseForm,options){return Widget.init.call(this,element,$container,$form,options),this.$responseForm=$responseForm,this},InteractionWidget.build=function(element,$container,$form,$responseForm,options){return this.clone().init(element,$container,$form,$responseForm,options)},InteractionWidget.initCreator=function(){Widget.initCreator.call(this),this.createToolbar({}),this.createOkButton(),this.listenToChoiceStates(),this.listenToIncludeStates()},InteractionWidget.buildContainer=function(){var $wrap=$("<div>",{"data-serial":this.element.serial,class:"widget-box widget-blockInteraction clearfix","data-qti-class":this.element.qtiClass}),$interactionContainer=this.$original.wrap($wrap);return this.$container=$interactionContainer.parent(),this},InteractionWidget.createToolbar=function(options){var _this24=this;options=_.defaults(options||{},{title:_convertToTitle(getQtiClassTitle(this.element.qtiClass))});var $toolbar=$(toolbarTpl({title:options.title,serial:this.element.serial,switcher:!!this.registeredStates.answer}));return this.$container.append($toolbar),$toolbar.hide(),$toolbar.find("[data-role=\"delete\"]").click(function(e){e.stopPropagation(),_this24.changeState("deleting")}),this.registeredStates.answer&&($toolbar.on("click",".link",function(e){var $link=$(e.target),state=$link.data("state");$link.siblings(".selected").removeClass("selected").addClass("link"),$link.removeClass("link").addClass("selected"),_this24.changeState(state)}),this.beforeStateInit(function(e,element,state){if(element.getSerial()===_this24.serial){var $link=$toolbar.find(".link[data-state=\""+state.name+"\"]");$link.length&&($link.siblings(".selected").removeClass("selected").addClass("link"),$link.removeClass("link").addClass("selected"))}})),this},InteractionWidget.createOkButton=function(){var _this25=this,$ok=$(okButtonTpl()).on("click.qti-widget",function(e){e.stopPropagation(),_this25.changeState("sleep")});this.$container.append($ok)},InteractionWidget.listenToChoiceStates=function(){var _this26=this;this.afterStateInit(function(e,element,state){var currentState=_this26.getCurrentState();if(element.is("choice")&&_this26.element.getChoice(element.getSerial())&&currentState&&state.name!==currentState.name)switch(state.name){case"choice":_this26.changeState(state.name);}})},InteractionWidget.listenToIncludeStates=function(){var _this27=this;this.afterStateExit(function(e,element,state){var serial=element.getSerial();if("active"===state.name&&"include"===element.qtiClass){var container=_this27.element,composingElts=_this27.element.getComposingElements();if(composingElts[serial]){var $editableContainer=element.metaData.widget.$container.closest("[data-html-editable=\"true\"]");container=Object.values(composingElts).find(function(el){return el.elements&&el.elements[serial]})||container;var editableContent=$editableContainer.wrap($("<div>")),newBody=contentHelper.getContent(editableContent);container.body(newBody)}}})},InteractionWidget}),define("taoQtiItem/qtiCreator/widgets/interactions/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Sleep"],function(stateFactory,SleepState){var InteractionStateSleep=stateFactory.extend(SleepState,function(){var _widget=this.widget;_widget.$container.on("click.qti-widget.sleep",function(e){e.stopPropagation(),_widget.changeState("question")})},function(){var _widget=this.widget;_widget.$container.off(".sleep")});return InteractionStateSleep}),define("taoQtiItem/qtiCreator/widgets/interactions/states/Active",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Active","lodash"],function(stateFactory,Active,_){var _containsInModalFeedbackElts=function(response,searchSerial){var found=!1,modalFeedbacks=[];return _.each(response.feedbackRules,function(rule){rule.feedbackThen&&"modalFeedback"===rule.feedbackThen.qtiClass&&modalFeedbacks.push(rule.feedbackThen),rule.feedbackElse&&"modalFeedback"===rule.feedbackElse.qtiClass&&modalFeedbacks.push(rule.feedbackElse)}),_.each(modalFeedbacks,function(fb){var elt=fb.getBody().getElement(searchSerial);if(elt)return found=!0,!1}),found},InteractionStateActive=stateFactory.extend(Active,function(){var _widget=this.widget,$container=_widget.$container,interaction=_widget.element,response=interaction.getResponseDeclaration();$container.attr("contenteditable",!1),_widget.beforeStateInit(function(e,element,state){var serial=element.getSerial();if("modalFeedback"===element.qtiClass)return!1;if("active"===state.name&&serial!==_widget.serial){var composingElts=interaction.getComposingElements(),inModalFeedback=_containsInModalFeedbackElts(response,serial);composingElts[serial]||inModalFeedback||_widget.changeState("sleep")}},"otherActive"),$container.on("mouseenter.active",function(e){e.stopPropagation(),$container.parent().trigger("mouseleave.sleep")}).on("mouseleave.active",function(e){e.stopPropagation(),$container.parent().trigger("mouseenter.sleep")}).on("click.active",function(e){e.stopPropagation()})},function(){this.widget.offEvents("otherActive")});return InteractionStateActive}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/addChoice",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<li class=\"add-option\" data-edit=\"question\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-role=\"add-option\">\n <span class=\"icon-add\"></span>\n ",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n</li>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/states/Question",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Question","tpl!taoQtiItem/qtiCreator/tpl/toolbars/addChoice","i18n"],function($,stateFactory,Question,addChoiceTpl,__){var InteractionStateQuestion=stateFactory.create(Question,function(){this.initForm(),this.widget.$form.show(),this.addNewChoiceButton(this.widget)},function(){this.widget.$form.empty().hide()});return InteractionStateQuestion.prototype.addNewChoiceButton=function(){var widget=this.widget,$choiceArea=widget.$container.find(".choice-area"),interaction=widget.element;$choiceArea.length&&!$choiceArea.children(".add-option").length&&($choiceArea.append(addChoiceTpl({serial:this.serial,text:__("Add choice")})),$choiceArea.children(".add-option").show().on("click.qti-widget",function(e){e.stopPropagation();var choice=interaction.createChoice(),$newChoicePlaceholder=$("<li>"),qtiChoiceClassName=choice.qtiClass+"."+interaction.qtiClass,tplData={interaction:{serial:interaction.serial,attributes:interaction.attributes}};$(this).before($newChoicePlaceholder),choice.render(tplData,$newChoicePlaceholder,qtiChoiceClassName),choice.postRender({ready:function ready(widget){widget.changeState("choice")}},qtiChoiceClassName)}))},InteractionStateQuestion.prototype.initForm=function(){stateFactory.throwMissingRequiredImplementationError("initForm")},InteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/states/Choice",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Choice","taoQtiItem/qtiCreator/widgets/helpers/content"],function($,stateFactory,Choice,contentHelper){var InteractionStateChoice=stateFactory.create(Choice,function(){var _widget=this.widget;_widget.$container.on("click.choice",function(e){$(e.target).closest(".qti-choice").length||_widget.changeState("question")}),contentHelper.changeInnerWidgetState(this.widget,"sleep")},function(){this.widget.$container.off(".choice")});return InteractionStateChoice}),define("tpl!taoQtiItem/qtiCreator/widgets/component/minMax/minMax",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="\n <label>\n <input type=\"checkbox\" name=\""+escapeExpression((stack1=(stack1=depth0&&depth0.min,null==stack1||!1===stack1?stack1:stack1.fieldName),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"-toggler\" />\n <span class=\"icon-checkbox\"></span>\n </label>\n ",buffer}function program3(depth0){var buffer="",stack1;return buffer+="\n <label>\n <input type=\"checkbox\" name=\""+escapeExpression((stack1=(stack1=depth0&&depth0.max,null==stack1||!1===stack1?stack1:stack1.fieldName),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"-toggler\" />\n <span class=\"icon-checkbox\"></span>\n </label>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,self=this,stack1,helper,options;return buffer+="<div class=\"min-max\">\n <div>\n <label for=\""+escapeExpression((stack1=(stack1=depth0&&depth0.min,null==stack1||!1===stack1?stack1:stack1.fieldName),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" class=\"spinner\" >"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Min",options):helperMissing.call(depth0,"__","Min",options)))+"</label>\n\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.min,null==stack1||!1===stack1?stack1:stack1.toggler),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\n <input\n type=\"text\"\n name=\""+escapeExpression((stack1=(stack1=depth0&&depth0.min,null==stack1||!1===stack1?stack1:stack1.fieldName),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n value=\""+escapeExpression((stack1=(stack1=depth0&&depth0.min,null==stack1||!1===stack1?stack1:stack1.value),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n data-increment=\"1\"\n data-min=\"",(helper=helpers.lowerThreshold)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.lowerThreshold,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-max=\"",(helper=helpers.upperThreshold)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.upperThreshold,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n />\n\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((stack1=(stack1=depth0&&depth0.min,null==stack1||!1===stack1?stack1:stack1.helpMessage),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</span>\n </div>\n <div>\n <label for=\""+escapeExpression((stack1=(stack1=depth0&&depth0.max,null==stack1||!1===stack1?stack1:stack1.fieldName),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" class=\"spinner\" >"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Max",options):helperMissing.call(depth0,"__","Max",options)))+"</label>\n\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.max,null==stack1||!1===stack1?stack1:stack1.toggler),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\n <input\n type=\"text\"\n name=\""+escapeExpression((stack1=(stack1=depth0&&depth0.max,null==stack1||!1===stack1?stack1:stack1.fieldName),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n value=\""+escapeExpression((stack1=(stack1=depth0&&depth0.max,null==stack1||!1===stack1?stack1:stack1.value),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"\n data-increment=\"1\"\n data-min=\"",(helper=helpers.lowerThreshold)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.lowerThreshold,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-max=\"",(helper=helpers.upperThreshold)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.upperThreshold,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n />\n\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((stack1=(stack1=depth0&&depth0.max,null==stack1||!1===stack1?stack1:stack1.helpMessage),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</span>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/component/minMax/minMax",["jquery","lodash","i18n","ui/component","ui/incrementer","ui/tooltip","tpl!taoQtiItem/qtiCreator/widgets/component/minMax/minMax"],function($,_,__,component,incrementer,tooltip,minMaxTpl){'use strict';var _Mathmax3=Math.max,defaultConfig={min:{fieldName:"minChoices",value:0,toggler:!0,helpMessage:__("The minimum number of choices that the candidate is required to select to form a valid response.")},max:{fieldName:"maxChoices",value:0,toggler:!0,helpMessage:__("The maximum number of choices that the candidate is required to select to form a valid response.")},lowerThreshold:1,upperThreshold:4,syncValues:!0,allowDecimal:!1};return function(container,setUpConfig){var controls={min:{},max:{}},fields={min:"min",max:"max"},isFieldSupported=function(field){if(!_.contains(fields,field))throw new TypeError("Unknown field \""+field+"\". Please set \"min\" or \"max\"");return!0},minMax=component({getFields:function(){return fields},getValue:function(field){var config=this.getConfig();if(isFieldSupported(field))return this.is("rendered")?_.parseInt(controls[field].input.val()):config[field].value},getMinValue:function(){return this.getValue(fields.min)},getMaxValue:function(){return this.getValue(fields.max)},setValue:function(field,value){var config=this.getConfig(),intValue=_.parseInt(value);if(isFieldSupported(field)&&_.isNumber(intValue)&&intValue>=config.lowerThreshold&&intValue<=config.upperThreshold){if(this.is("rendered")&&controls[field].input.val()!=="".concat(intValue))return controls[field].input.val(intValue).trigger("change");config[field].value=intValue}return this},setMinValue:function(value){return this.setValue(fields.min,value)},setMaxValue:function(value){return this.setValue(fields.max,value)},updateThresholds:function(lower,upper){var config=this.getConfig(),fieldOptions;return _.isNumber(lower)&&_.isNumber(upper)&&upper>=lower&&(config.lowerThreshold=_.parseInt(lower),config.upperThreshold=_.parseInt(upper),this.is("rendered")&&(fieldOptions={min:config.lowerThreshold,max:config.upperThreshold},controls.min.input.incrementer("options",fieldOptions),this.isFieldEnabled("min")&&controls.min.input.keyup(),controls.max.input.incrementer("options",fieldOptions),this.isFieldEnabled("max")&&controls.max.input.keyup())),this},isFieldEnabled:function(field){var config=this.getConfig();return!!isFieldSupported(field)&&(!0!==config[field].toggler||0<this.getValue(field))},enableField:function(field,initialValue){return isFieldSupported(field)&&this.is("rendered")&&!this.isFieldEnabled(field)&&(controls[field].input.val(1<initialValue?initialValue:1).incrementer("enable").trigger("change"),this.trigger("enable"+field),this.syncValues()),this},disableField:function(field){var config=this.getConfig();return isFieldSupported(field)&&this.is("rendered")&&!0===config[field].toggler&&this.isFieldEnabled(field)&&(controls[field].input.val(0).incrementer("disable").trigger("change"),this.trigger("disable"+field)),this},syncValues:function(fromField){var config=this.getConfig(),minValue,maxValue;return fromField=fromField||fields.min,isFieldSupported(fromField)&&this.is("rendered")&&config.syncValues&&(minValue=this.getMinValue(),maxValue=this.getMaxValue(),0<minValue&&0<maxValue?(fromField===fields.max&&minValue>maxValue&&this.setMinValue(maxValue),fromField===fields.min&&minValue>maxValue&&this.setMaxValue(minValue)):0===minValue&&0<maxValue&&(document.querySelector(".edit-active > .qti-orderInteraction")||document.querySelector(".edit-active > .qti-graphicOrderInteraction"))&&(this.enableField(fields.min,1),controls.min.toggler.prop("checked",!0))),this},convertToNumber:function(fromField){return isFieldSupported(fromField)&&this.is("rendered")&&(fromField===fields.max?this.setMaxValue(parseInt(this.getMaxValue())):this.setMinValue(parseInt(this.getMinValue()))),this}},defaultConfig).setTemplate(minMaxTpl).on("init",function(){container&&this.render(container)}).on("render",function(){var self=this,$element=this.getElement(),config=this.getConfig(),setUpFieldListener=function(field){var fieldConfig,fieldControl;isFieldSupported(field)&&(fieldConfig=config[field],fieldControl=controls[field],fieldControl.input=$("[name="+fieldConfig.fieldName+"]",$element),fieldConfig.toggler&&(fieldControl.toggler=$("[name="+fieldConfig.fieldName+"-toggler]",$element),0<fieldConfig.value?fieldControl.toggler.prop("checked",!0):self.disableField(field),fieldControl.toggler.on("change",function(){$(this).prop("checked")?self.enableField(field,_Mathmax3(1,self.getMinValue())):self.disableField(field),self.trigger("change")})),fieldControl.input.on("change",function(){self.syncValues(field),config.allowDecimal||self.convertToNumber(field),self.trigger("change")}))};incrementer($element),tooltip.lookup($element),setUpFieldListener(fields.min),setUpFieldListener(fields.max),this.syncValues()});return _.defer(function(){var deepConfig=_.cloneDeep(setUpConfig||{});deepConfig.min&&(deepConfig.min=_.defaults(setUpConfig.min,defaultConfig.min)),deepConfig.max&&(deepConfig.max=_.defaults(setUpConfig.max,defaultConfig.max)),minMax.init(deepConfig)}),minMax}}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/response/responseForm",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1;return buffer+="\n <option value=\""+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">"+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"</option>\n ",buffer}function program3(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n<div class=\"panel\">\n <label for=\"responseBaseType\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Response base type",options):helperMissing.call(depth0,"__","Response base type",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select the expected input value type that will define the way the response of your interaction will be processed.",options):helperMissing.call(depth0,"__","Select the expected input value type that will define the way the response of your interaction will be processed.",options)))+"</div>\n\n <select id=\"responseBaseType\" name=\"listOfBaseType\" class=\"select2\" data-has-search=\"false\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.listOfBaseTypes,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n</div>\n",buffer}function program4(depth0,data){var buffer="",stack1,helper;return buffer+="\n <option value=\"",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n ",buffer}function program5(){return"selected=\"selected\""}function program7(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n<hr/>\n\n<div class=\"response-mapping-attributes",stack1=helpers["if"].call(depth0,depth0&&depth0.mappingDisabled,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\">\n <div class=\"panel min-max-panel\" data-editx=\"map\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Score range",options):helperMissing.call(depth0,"__","Score range",options)))+"</h3>\n </div>\n\n <div class=\"panel\" data-editx=\"map\">\n <label for=\"defaultValue\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Mapping default",options):helperMissing.call(depth0,"__","Mapping default",options)))+"</label>\n <input name=\"defaultValue\" value=\"",(helper=helpers.defaultValue)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.defaultValue,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,depth0&&depth0.mappingDisabled,{hash:{},inverse:self.noop,fn:self.program(10,program10,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"score\" type=\"text\" data-validate=\"$notEmpty; $numeric;\" data-validate-option=\"$lazy; $event(type=keyup)\" />\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The default value from the target set to be used when no explicit mapping for a source value is given.",options):helperMissing.call(depth0,"__","The default value from the target set to be used when no explicit mapping for a source value is given.",options)))+"</span>\n </div>\n</div>\n<div class=\"response-mapping-info",stack1=helpers.unless.call(depth0,depth0&&depth0.mappingDisabled,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\">\n <p class=\"feedback-info\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The mapping options are available when at least one map entry is defined.",options):helperMissing.call(depth0,"__","The mapping options are available when at least one map entry is defined.",options)))+"</p>\n</div>\n\n<div class=\"panel\" data-editx=\"map\">\n <label>\n <input name=\"defineCorrect\" type=\"checkbox\" data-role=\"defineCorrect\"",stack1=helpers["if"].call(depth0,depth0&&depth0.defineCorrect,{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Define correct response",options):helperMissing.call(depth0,"__","Define correct response",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Define the correct response.",options):helperMissing.call(depth0,"__","Define the correct response.",options)))+"</span>\n</div>\n",buffer}function program8(){return" hidden"}function program10(){return" disabled=\"true\""}function program12(){return" checked=\"checked\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"responseIdentifier\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Response identifier",options):helperMissing.call(depth0,"__","Response identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The identifier of the choice. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options):helperMissing.call(depth0,"__","The identifier of the choice. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options)))+"</div>\n\n <input id=\"responseIdentifier\"\n type=\"text\"\n name=\"identifier\"\n value=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n placeholder=\"e.g. RESPONSE\"\n data-validate=\"$notEmpty; $qtiResponseIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"); $availableIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n</div>\n\n<div class=\"panel\">\n <label for=\"responseProcessing\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Response processing",options):helperMissing.call(depth0,"__","Response processing",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select the way the response of your interaction should be processed",options):helperMissing.call(depth0,"__","Select the way the response of your interaction should be processed",options)))+"</div>\n\n <select id=\"responseProcessing\" name=\"template\" class=\"select2\" data-has-search=\"false\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.templates,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n</div>\n\n",stack1=helpers["if"].call(depth0,depth0&&depth0.textEntryInteraction,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\n",stack1=helpers["if"].call(depth0,depth0&&depth0.editMapping,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\n",stack1=helpers["if"].call(depth0,depth0&&depth0.editFeedbacks,{hash:{},inverse:self.noop,fn:self.program(14,function(){return"\n<hr/>\n\n<div class=\"panel feedbackRule-panel\"></div>\n"},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/modalFeedback/rule",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data,depth1){var buffer="",stack1,helper,options;return buffer+="\n <option value=\"",(helper=helpers.name)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.name,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" ",stack1=(helper=helpers.equal||depth0&&depth0.equal,options={hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data},helper?helper.call(depth0,depth0&&depth0.name,depth1&&depth1.condition,options):helperMissing.call(depth0,"equal",depth0&&depth0.name,depth1&&depth1.condition,options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n ",buffer}function program2(){return"selected=\"selected\""}function program6(depth0,data){var buffer="",helper,options;return buffer+="\n <a title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Add else feedback",options):helperMissing.call(depth0,"__","Add else feedback",options)))+"\" href=\"#\" class=\"adder feedbackRule-add-else\">else</a>\n ",buffer}function program8(depth0,data){var buffer="",helper,options;return buffer+="\n <div class=\"feedbackRule-then-else\">\n <span class=\"feedbackRule-desc i\">else</span>\n <button class=\"btn-info small\" type=\"button\" data-feedback=\"else\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Feedback",options):helperMissing.call(depth0,"__","Feedback",options)))+"</button>\n <span class=\"feedbackRule-button-delete icon-bin\" title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Delete else statement",options):helperMissing.call(depth0,"__","Delete else statement",options)))+"\" data-role=\"else\"></span>\n </div>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"feedbackRule-container\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <div class=\"feedbackRule-rule-if\">\n <span class=\"feedbackRule-desc i\">if</span>\n <select class=\"feedbackRule-condition select2\" data-has-search=\"false\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.availableConditions,{hash:{},inverse:self.noop,fn:self.programWithDepth(1,program1,data,depth0),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n <input class=\"feedbackRule-compared-value score\" type=\"text\" value=\"",(helper=helpers.comparedValue)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.comparedValue,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.hideScore,{hash:{},inverse:self.noop,fn:self.program(4,function(){return"style=\"display:none\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n </div>\n <div class=\"feedbackRule-then-else\">\n <span class=\"feedbackRule-desc i\">then</span>\n <button class=\"btn-info small\" type=\"button\" data-feedback=\"then\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Feedback",options):helperMissing.call(depth0,"__","Feedback",options)))+"</button>\n </div>\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.addElse,{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.feedbackElse,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <span class=\"feedbackRule-button-delete icon-bin\" title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Delete this modal feedback",options):helperMissing.call(depth0,"__","Delete this modal feedback",options)))+"\" data-role=\"rule\"></span>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/modalFeedback/panel",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="<h3 class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Modal Feedbacks",options):helperMissing.call(depth0,"__","Modal Feedbacks",options)))+"</h3>\n<span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n<span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Modal feedback is shown to the candidate directly following response processing.",options):helperMissing.call(depth0,"__","Modal feedback is shown to the candidate directly following response processing.",options)))+"</span>\n<div class=\"feedbackRules\">\n <p><i>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"None defined yet.",options):helperMissing.call(depth0,"__","None defined yet.",options)))+"</i></p>\n</div>\n<a href=\"#\" class=\"adder feedbackRule-add\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Add a modal feedback",options):helperMissing.call(depth0,"__","Add a modal feedback",options)))+"</a>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/formElement",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiItem/core/Element","ui/tooltip"],function($,_,__,formElement,Element,tooltip){'use strict';var _scoreTooltipContent={required:__("This is required"),invalid:__("The score format is not numeric")};return{init:function(widget){formElement.initWidget(widget.$form)},syncMaxChoices:function(widget,attributeNameMin,attributeNameMax,getMax){var _syncMaxChoices=function(){var newOptions={max:getMax(widget.element.getChoices())};$min.incrementer("options",newOptions).keyup(),$max.incrementer("options",newOptions).keyup()},$min,$max;attributeNameMin=attributeNameMin||"minChoices",attributeNameMax=attributeNameMax||"maxChoices",getMax=getMax||_.size,$min=widget.$form.find("input[name="+attributeNameMin+"]"),$max=widget.$form.find("input[name="+attributeNameMax+"]"),widget.on("choiceCreated",function(data){data.interaction.serial===widget.element.serial&&_syncMaxChoices()}).on("deleted",function(data){data.parent.serial===widget.element.serial&&Element.isA(data.element,"choice")&&_syncMaxChoices()})},setScore:function($scoreInput,options){var value,score,key,formElementTooltip;options=_.defaults(options||{},{required:!1,empty:function empty(){},set:function set(){},key:function(){return $(this).attr("name")},tooltipContent:_scoreTooltipContent}),"undefined"==typeof $scoreInput.data("$tooltip")&&(formElementTooltip=tooltip.error($scoreInput," ",{trigger:"manual"}),$scoreInput.data("$tooltip",formElementTooltip)),value=$scoreInput.val(),score=parseFloat(value),key=options.key.call($scoreInput[0]),""===value?options.required?($scoreInput.data("$tooltip").updateTitleContent(options.tooltipContent.required),$scoreInput.data("$tooltip").show()):($scoreInput.data("$tooltip").hide(),options.empty(key)):isNaN(score)?($scoreInput.data("$tooltip").updateTitleContent(options.tooltipContent.invalid),$scoreInput.data("$tooltip").show()):($scoreInput.data("$tooltip").hide(),options.set(key,score))}}}),define("taoQtiItem/qtiCreator/widgets/helpers/modalFeedbackConditions",["lodash","i18n","jquery","taoQtiItem/qtiCreator/widgets/interactions/helpers/formElement","taoQtiItem/qtiCreator/editor/response/choiceSelector"],function(_,__,$,formElement,choiceSelector){'use strict';function _resetScore(fbRule,$select){$select.siblings(".feedbackRule-compared-value").val("0")}function onSetScore(fbRule,$select){var response=fbRule.comparedOutcome,condition=this.name,$comparedValue=$select.siblings(".feedbackRule-compared-value");formElement.setScore($comparedValue,{required:!0,set:function set(key,value){response.setCondition(fbRule,condition,value)}})}function onUnsetCorrect(fbRule,$select){_resetScore(fbRule,$select)}function initCompare(fbRule,$select){var response=fbRule.comparedOutcome;$select.siblings(".feedbackRule-compared-value").show().off("keyup.modal-feedback-condition").on("keyup.modal-feedback-condition",function(){var fbRule=response.getFeedbackRule($(this).parents(".feedbackRule-container").data("serial"));formElement.setScore($(this),{required:!0,set:function set(key,value){response.setCondition(fbRule,fbRule.condition,value)}})})}function hideScore(fbRule,$select){$select.siblings(".feedbackRule-compared-value").hide()}var _availableConditions=[{name:"correct",label:__("correct"),init:hideScore,onSet:onSetScore,onUnset:onUnsetCorrect},{name:"incorrect",label:__("incorrect"),init:hideScore,onSet:onSetScore,onUnset:onUnsetCorrect},{name:"choices",label:__("choices"),init:function(fbRule,$select){hideScore(fbRule,$select);var condition=this.name,response=fbRule.comparedOutcome,interaction=response.getInteraction(),$choiceSelectorContainer=$("<div>",{class:"choiceSelectorContainer"}).insertAfter($select),cSelector=choiceSelector({renderTo:$choiceSelectorContainer,interaction:interaction,choices:fbRule.comparedValue||[],titleLength:30});$choiceSelectorContainer.data("choice-selector",cSelector),cSelector.on("change",function(selectedChoices){response.setCondition(fbRule,condition,selectedChoices||[])})},onSet:function(fbRule){var response=fbRule.comparedOutcome,interaction=response.getInteraction(),intialValue=[],choice;response.isCardinality(["multiple","ordered"])||(choice=_.head(_.values(interaction.getChoices())),choice&&(intialValue=[choice])),fbRule.comparedOutcome.setCondition(fbRule,this.name,intialValue)},onUnset:function(fbRule,$select){_resetScore(fbRule,$select),this.destroy($select)},destroy:function destroy($select){var $cContainer=$select.next(".choiceSelectorContainer"),choiceSelector=$cContainer.data("choice-selector");choiceSelector&&(choiceSelector.destroy(),$cContainer.remove())},filter:function(response){var interaction=response.getInteraction();return interaction.is("choiceInteraction")||interaction.is("inlineChoiceInteraction")}},{name:"lt",label:"<",init:initCompare,onSet:onSetScore},{name:"lte",label:"<=",init:initCompare,onSet:onSetScore},{name:"equal",label:"=",init:initCompare,onSet:onSetScore},{name:"gte",label:">=",init:initCompare,onSet:onSetScore},{name:"gt",label:">",init:initCompare,onSet:onSetScore}];return{get:function(response){return _.filter(_availableConditions,function(condition){return!_.isFunction(condition.filter)||condition.filter(response)})}}}),define("taoQtiItem/qtiCreator/widgets/helpers/modalFeedbackRule",["lodash","jquery","ui/selecter","tpl!taoQtiItem/qtiCreator/tpl/modalFeedback/rule","tpl!taoQtiItem/qtiCreator/tpl/modalFeedback/panel","taoQtiItem/qtiCreator/widgets/helpers/modalFeedbackConditions"],function(_,$,selecter,ruleTpl,panelTpl,modalFeedbackConditions){'use strict';var _renderFeedbackRule=function(feedbackRule){var feedbackElse=feedbackRule.feedbackElse,feedbackElseSerial;feedbackElse&&(feedbackElseSerial=feedbackElse.serial);var availableConditions=modalFeedbackConditions.get(feedbackRule.comparedOutcome),rule=ruleTpl({availableConditions:availableConditions,serial:feedbackRule.serial,condition:feedbackRule.condition,comparedValue:feedbackRule.comparedValue,feedbackThen:feedbackRule.feedbackThen.serial,feedbackElse:feedbackElseSerial,addElse:!feedbackElse,hideScore:"correct"===feedbackRule.condition||"incorrect"===feedbackRule.condition||"choices"===feedbackRule.condition}),$rule=$(rule);selecter($rule);var condition=_.find(availableConditions,{name:feedbackRule.condition});return condition.init(feedbackRule,$rule.find("select.feedbackRule-condition")),$rule},_initFeedbackEventListener=function($feedbacksPanel,response){var $feedbacks=$feedbacksPanel.find(".feedbackRules");$feedbacksPanel.on("click",".feedbackRule-add",function(e){e.preventDefault();var feedbackRule=response.createFeedbackRule(),$lastRule=$feedbacks.children(".feedbackRule-container:last");$lastRule.length?$lastRule.after(_renderFeedbackRule(feedbackRule)):$feedbacks.html(_renderFeedbackRule(feedbackRule))}).on("click",".feedbackRule-add-else",function(e){e.preventDefault();var $fbContainer=$(this).parents(".feedbackRule-container"),fbSerial=$fbContainer.data("serial"),fbRule=response.getFeedbackRule(fbSerial),fbModal=response.createFeedbackElse(fbRule);$fbContainer.replaceWith(_renderFeedbackRule(fbRule))}).on("click",".feedbackRule-button-delete",function(){var $deleteButton=$(this),$fbContainer=$deleteButton.parents(".feedbackRule-container"),fbSerial=$fbContainer.data("serial"),fbRule=response.getFeedbackRule(fbSerial);switch($deleteButton.data("role")){case"rule":response.deleteFeedbackRule(fbRule),$fbContainer.remove();break;case"else":response.deleteFeedbackElse(fbRule),$fbContainer.replaceWith(_renderFeedbackRule(fbRule));}}).on("change",".feedbackRule-condition",function(){var $select=$(this),condition=$select.val(),availableConditions=modalFeedbackConditions.get(response),fbRule=response.getFeedbackRule($(this).parents(".feedbackRule-container").data("serial")),newCondition=_.find(availableConditions,{name:condition}),oldCondition=_.find(availableConditions,{name:fbRule.condition});oldCondition&&_.isFunction(oldCondition.onUnset)&&oldCondition.onUnset(fbRule,$select),newCondition&&_.isFunction(newCondition.onSet)&&newCondition.onSet(fbRule,$select),newCondition.init(fbRule,$select)}).on("click","[data-feedback]",function(){var $btn=$(this),fbRule=response.getFeedbackRule($btn.parents(".feedbackRule-container").data("serial")),modalFeedback,modalFeedbackWidget;switch($btn.data("feedback")){case"then":modalFeedback=fbRule.feedbackThen;break;case"else":modalFeedback=fbRule.feedbackElse;}modalFeedback&&(modalFeedbackWidget=_getModalFeedbackWidget(modalFeedback),modalFeedbackWidget.changeState("active"))})},_widgets={},_getModalFeedbackWidget=function(modalFeedback){var $feedbacksContainer=$("#modalFeedbacks");return _widgets[modalFeedback.serial]||($feedbacksContainer.append(modalFeedback.render()),modalFeedback.postRender(),_widgets[modalFeedback.serial]=modalFeedback.data("widget")),_widgets[modalFeedback.serial]};return{initFeedbacksPanel:function initFeedbacksPanel($feedbacksPanel,response){$feedbacksPanel.html(panelTpl());var $feedbackRules=$feedbacksPanel.find(".feedbackRules"),feedbackRules=response.getFeedbackRules();feedbackRules&&_.size(feedbackRules)&&($feedbackRules.empty(),_.each(feedbackRules,function(feedbackRule){$feedbackRules.append(_renderFeedbackRule(feedbackRule))})),_initFeedbackEventListener($feedbacksPanel,response)},renderFeedbackRule:_renderFeedbackRule}}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/answerState",["jquery","lodash","i18n","taoQtiItem/qtiItem/helper/response","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/component/minMax/minMax","tpl!taoQtiItem/qtiCreator/tpl/forms/response/responseForm","taoQtiItem/qtiCreator/widgets/helpers/modalFeedbackRule","taoQtiItem/qtiCreator/helper/qtiElements"],function($,_,__,responseHelper,formElement,minMaxComponentFactory,responseFormTpl,modalFeedbackRule,qtiElements){'use strict';var _saveCallbacks={mappingAttr:function(response,value,key){""===value?response.removeMappingAttribute(key):response.setMappingAttribute(key,value)}},getAvailableTemplates=function(){return{CUSTOM:__("custom"),MATCH_CORRECT:__("match correct"),MAP_RESPONSE:__("map response"),MAP_RESPONSE_POINT:__("map response"),NONE:__("none")}},_getAvailableListOfBaseTypes=function(listOfBaseType){return[{label:"string",value:"string",selected:"string"===listOfBaseType},{label:"integer",value:"integer",selected:"integer"===listOfBaseType},{label:"float",value:"float",selected:"float"===listOfBaseType}]},_getAvailableRpTemplates=function(interaction,filteredTemplates,allowCustomTemplate){var rp=interaction.getRootElement().responseProcessing,allTemplates=getAvailableTemplates(),templates={};switch(_.isEmpty(filteredTemplates)?templates=allTemplates:_.forEach(filteredTemplates,function(templateName){allTemplates[templateName]&&(templates[templateName]=allTemplates[templateName])}),interaction.qtiClass){case"orderInteraction":case"graphicOrderInteraction":case"extendedTextInteraction":case"sliderInteraction":case"uploadInteraction":case"mediaInteraction":case"endAttemptInteraction":delete templates.MAP_RESPONSE,delete templates.MAP_RESPONSE_POINT;break;case"selectPointInteraction":delete templates.MATCH_CORRECT,delete templates.MAP_RESPONSE;break;default:delete templates.MAP_RESPONSE_POINT;}switch(interaction.typeIdentifier){case"liquidsInteraction":delete templates.MAP_RESPONSE_POINT,delete templates.MAP_RESPONSE;}return"templateDriven"!==rp.processingType||allowCustomTemplate||delete templates.CUSTOM,templates},answerStateHelper={forward:function(widget){var response=widget.element.getResponseDeclaration();responseHelper.isUsingTemplate(response,"MATCH_CORRECT")?widget.changeState("correct"):responseHelper.isUsingTemplate(response,"MAP_RESPONSE")||responseHelper.isUsingTemplate(response,"MAP_RESPONSE_POINT")?widget.changeState("map"):responseHelper.isUsingTemplate(response,"NONE")?widget.changeState("norp"):widget.changeState("custom")},defineCorrect:function(response,newDefineCorrectActive){var defineCorrectActive=!1,template=responseHelper.getTemplateNameFromUri(response.template),corrects=response.getCorrect();return _.isUndefined(newDefineCorrectActive)?"MAP_RESPONSE"===template||"MAP_RESPONSE_POINT"===template?_.isUndefined(response.data("defineCorrect"))?(defineCorrectActive=corrects&&_.size(corrects),response.data("defineCorrect",defineCorrectActive)):defineCorrectActive=!!response.data("defineCorrect"):"MATCH_CORRECT"===template&&(defineCorrectActive=!0):(!newDefineCorrectActive&&(response.correctResponse=[]),response.data("defineCorrect",newDefineCorrectActive)),defineCorrectActive},initResponseForm:function(widget,options){var perInteractionRP=widget.options.perInteractionRp,interaction=widget.element,item=interaction.getRootElement(),rp=item.responseProcessing,response=interaction.getResponseDeclaration(),template=responseHelper.getTemplateNameFromUri(response.template),listOfBaseType=response.attributes.baseType,editMapping=0<=_.indexOf(["MAP_RESPONSE","MAP_RESPONSE_POINT"],template),defineCorrect=answerStateHelper.defineCorrect(response),allQtiElements=qtiElements.getAvailableAuthoringElements(),outcome=item.getOutcomeDeclaration("SCORE_".concat(response.id())),_toggleCorrectWidgets=function(show){var $correctWidgets=widget.$container.find("[data-edit=correct]");show?$correctWidgets.show():$correctWidgets.hide()};options=_.defaults(options||{},{rpTemplates:[]}),template&&"custom"!==rp.processingType||(template="CUSTOM"),widget.$responseForm.html(responseFormTpl({identifier:response.id(),serial:response.getSerial(),defineCorrect:defineCorrect,editMapping:editMapping,editFeedbacks:"CUSTOM"!==template,mappingDisabled:_.isEmpty(response.mapEntries),template:template,templates:_getAvailableRpTemplates(interaction,options.rpTemplates,widget.options.allowCustomTemplate),listOfBaseType:listOfBaseType,listOfBaseTypes:_getAvailableListOfBaseTypes(listOfBaseType),textEntryInteraction:interaction.qtiClass===allQtiElements.textEntryInteraction.qtiClass,defaultValue:response.getMappingAttribute("defaultValue")})),widget.$responseForm.find("select[name=template]").val(template),editMapping&&_toggleCorrectWidgets(defineCorrect),minMaxComponentFactory(widget.$responseForm.find(".response-mapping-attributes > .min-max-panel"),{min:{fieldName:"lowerBound",value:_.parseInt(response.getMappingAttribute("lowerBound"))||0,helpMessage:__("Minimal score for this interaction.")},max:{fieldName:"upperBound",value:_.parseInt(response.getMappingAttribute("upperBound"))||0,helpMessage:__("Maximal score for this interaction.")},upperThreshold:Number.MAX_SAFE_INTEGER,syncValues:!0});var formChangeCallbacks={identifier:function identifier(res,value){response.id(value),interaction.attr("responseIdentifier",value),perInteractionRP&&outcome&&(outcome.attr("identifier","SCORE_".concat(value)),answerStateHelper.initResponseForm(widget))},defaultValue:_saveCallbacks.mappingAttr,template:function(res,value){rp.setProcessingType("CUSTOM"===value?"custom":"templateDriven"),response.setTemplate(value),answerStateHelper.forward(widget),answerStateHelper.initResponseForm(widget)},listOfBaseType:function(res,value){response.attributes.baseType=value,answerStateHelper.initResponseForm(widget)},defineCorrect:function(res,value){_toggleCorrectWidgets(value),answerStateHelper.defineCorrect(response,!!value)}};formChangeCallbacks.identifier=_.debounce(formChangeCallbacks.identifier,500),_.assign(formChangeCallbacks,formElement.getLowerUpperAttributeCallbacks("lowerBound","upperBound",{attrMethodNames:{set:"setMappingAttribute",remove:"removeMappingAttribute"}})),formElement.setChangeCallbacks(widget.$responseForm,response,formChangeCallbacks,{saveInvalid:!0,validateOnInit:!0}),modalFeedbackRule.initFeedbacksPanel($(".feedbackRule-panel",widget.$responseForm),response),widget.$responseForm.trigger("initResponseForm"),formElement.initWidget(widget.$responseForm)},isCorrectDefined:function(widget){var response=widget.element.getResponseDeclaration();return!!_.size(response.getCorrect())}};return answerStateHelper}),define("taoQtiItem/qtiCreator/widgets/interactions/states/Answer",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Answer","taoQtiItem/qtiCreator/widgets/interactions/helpers/answerState","taoQtiItem/qtiCreator/widgets/helpers/content"],function(stateFactory,Answer,answerStateHelper,contentHelper){'use strict';var InteractionStateAnswer=stateFactory.create(Answer,function(){this.widget.$container.addClass("runtime"),this.initResponseForm(),answerStateHelper.forward(this.widget),this.widget.$responseForm.show(),contentHelper.changeInnerWidgetState(this.widget,"inactive")},function(){this.widget.$container.removeClass("runtime"),this.widget.$responseForm.empty().hide(),contentHelper.changeInnerWidgetState(this.widget,"sleep")});return InteractionStateAnswer.prototype.initResponseForm=function(){answerStateHelper.initResponseForm(this.widget)},InteractionStateAnswer}),define("taoQtiItem/qtiCreator/widgets/interactions/states/Correct",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct"],function(stateFactory,Correct){var InteractionStateCorrect=stateFactory.create(Correct,function(){},function(){});return InteractionStateCorrect}),define("taoQtiItem/qtiCreator/widgets/interactions/states/Map",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCreator/widgets/interactions/helpers/answerState"],function(stateFactory,Map,answerState){'use strict';var InteractionStateMap=stateFactory.create(Map,function(){var $correctWidgets=this.widget.$container.find("[data-edit=\"correct\"]");answerState.isCorrectDefined(this.widget)?$correctWidgets.show():$correctWidgets.hide()},function(){this.widget.$container.find("[data-edit=\"correct\"]").hide()});return InteractionStateMap}),define("taoQtiItem/qtiCreator/widgets/interactions/states/NoRp",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/NoRp","taoQtiItem/qtiCreator/helper/xmlRenderer"],function(stateFactory,NoRp,xmlRenderer){'use strict';return stateFactory.create(NoRp,function(){var interaction=this.widget.element,item=interaction.getRootElement(),rp=item.responseProcessing,rpXml=xmlRenderer.render(rp);rpXml.trim()||(item.removeOutcome("SCORE"),item.removeOutcome("MAXSCORE"))},function(){var interaction=this.widget.element,item=interaction.getRootElement(),outcomeScore=item.getOutcomeDeclaration("SCORE"),rp=item.responseProcessing,rpXml=xmlRenderer.render(rp);rpXml&&!outcomeScore&&(outcomeScore=item.createOutcomeDeclaration({cardinality:"single",baseType:"float"}),outcomeScore.buildIdentifier("SCORE",!1))})}),define("taoQtiItem/qtiCreator/widgets/states/Custom",["taoQtiItem/qtiCreator/widgets/states/factory"],function(stateFactory){return stateFactory.create("custom",["answer","active"],function(){throw new Error("state \"custom\" prototype init method must be implemented")},function(){throw new Error("state \"custom\" prototype exit method must be implemented")})}),define("tpl!taoQtiItem/qtiCreator/tpl/notifications/widgetOverlay",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="<span class=\"message\">",(helper=helpers.message)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.message,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</span>",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1;return buffer+="<span class=\"overlay\">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.message,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</span>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/states/Custom",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Custom","tpl!taoQtiItem/qtiCreator/tpl/notifications/widgetOverlay","i18n","taoQtiItem/qtiCreator/helper/xmlRenderer"],function(stateFactory,Custom,overlayTpl,__,xmlRenderer){var InteractionStateCustom=stateFactory.create(Custom,function(){this.widget.$container.append(overlayTpl({message:__("Custom Response Processing Mode")}));this.widget.$container.find("[data-edit=map], [data-edit=correct]").hide()},function(){var interaction=this.widget.element,item=interaction.getRootElement(),outcomeScore=item.getOutcomeDeclaration("SCORE"),rp=item.responseProcessing,rpXml=xmlRenderer.render(rp);rpXml&&!outcomeScore&&(outcomeScore=item.createOutcomeDeclaration({cardinality:"single",baseType:"float"}),outcomeScore.buildIdentifier("SCORE",!1)),this.widget.$container.children(".overlay").remove()});return InteractionStateCustom}),define("taoQtiItem/qtiCreator/widgets/interactions/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/states","taoQtiItem/qtiCreator/widgets/interactions/states/Sleep","taoQtiItem/qtiCreator/widgets/interactions/states/Active","taoQtiItem/qtiCreator/widgets/interactions/states/Question","taoQtiItem/qtiCreator/widgets/interactions/states/Choice","taoQtiItem/qtiCreator/widgets/interactions/states/Answer","taoQtiItem/qtiCreator/widgets/interactions/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/states/Map","taoQtiItem/qtiCreator/widgets/interactions/states/NoRp","taoQtiItem/qtiCreator/widgets/interactions/states/Custom"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Question","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content","i18n"],function($,stateFactory,Question,htmlEditor,contentHelper,__){'use strict';var BlockInteractionStateQuestion=stateFactory.extend(Question,function(){this.buildPromptEditor()},function(){this.destroyPromptEditor()});return BlockInteractionStateQuestion.prototype.buildPromptEditor=function(){var _widget=this.widget,$editableContainer=_widget.$container.find(".qti-prompt-container"),$editable=$editableContainer.find(".qti-prompt"),container=_widget.element.prompt.getBody();$editableContainer.attr("data-html-editable-container",!0),$editable.attr("data-html-editable",!0),htmlEditor.hasEditor($editableContainer)||htmlEditor.buildEditor($editableContainer,{placeholder:__("define prompt"),change:contentHelper.getChangeCallback(container),data:{container:container,widget:_widget}})},BlockInteractionStateQuestion.prototype.destroyPromptEditor=function(){var $editableContainer=this.widget.$container.find(".qti-prompt-container");htmlEditor.destroyEditor($editableContainer)},BlockInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/states","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/associate",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",self=this,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label>\n <input name=\"shuffle\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.shuffle,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Shuffle choices",options):helperMissing.call(depth0,"__","Shuffle choices",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"If the shuffle attribute is true then the delivery engine will randomize the order in which the choices are initially presented.\n However each choice may be \u201Cshuffled\u201D of \u201Cfixed\u201D individually.",options):helperMissing.call(depth0,"__","If the shuffle attribute is true then the delivery engine will randomize the order in which the choices are initially presented.\n However each choice may be \u201Cshuffled\u201D of \u201Cfixed\u201D individually.",options)))+"\n </span>\n</div>\n\n<div class=\"panel min-max-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Number of associations",options):helperMissing.call(depth0,"__","Number of associations",options)))+"</h3>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/Question",["lodash","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/component/minMax/minMax","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/associate","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter"],function(_,stateFactory,Question,formElement,minMaxComponentFactory,formTpl,sizeAdapter){'use strict';var AssociateInteractionStateQuestion=stateFactory.extend(Question);return AssociateInteractionStateQuestion.prototype.initForm=function(){var widget=this.widget,$form=this.widget.$form,interaction=this.widget.element;$form.html(formTpl({shuffle:!!interaction.attr("shuffle")})),minMaxComponentFactory($form.find(".min-max-panel"),{min:{fieldName:"minAssociations",value:_.parseInt(interaction.attr("minAssociations"))||0,toggler:!1},max:{fieldName:"maxAssociations",value:_.parseInt(interaction.attr("maxAssociations"))||0,toggler:!1},lowerThreshold:0,upperThreshold:100}).on("change",function(){}),formElement.initWidget($form);var callbacks=formElement.getMinMaxAttributeCallbacks("minAssociations","maxAssociations");callbacks.shuffle=formElement.getAttributeChangeCallback(),formElement.setChangeCallbacks($form,interaction,callbacks),sizeAdapter.adaptSize(widget),widget.on("choiceCreated",function(){sizeAdapter.adaptSize(widget)})},AssociateInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/Choice",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Choice","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter"],function(stateFactory,Choice,sizeAdapter){'use strict';var AssociateInteractionStateChoice=stateFactory.extend(Choice,function(){var widget=this.widget;widget.on("containerBodyChange contentChange choiceCreated",function(){sizeAdapter.adaptSize(widget)})},function(){});return AssociateInteractionStateChoice}),define("taoQtiItem/qtiCreator/widgets/helpers/placeholder",["jquery"],function($){'use strict';function setPlaceholder(el,value){return value="undefined"==typeof value?"":""+value,$(el).attr("placeholder",value)}function getResponseDeclaration(widget){var interaction=widget.element;return interaction&&interaction.getResponseDeclaration()}return{score:function(widget,value){var response=getResponseDeclaration(widget);response&&"undefined"==typeof value&&(value=response.getMappingAttribute("defaultValue")),widget&&widget.$container&&setPlaceholder(widget.$container.find(".score"),value)}}}),define("taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/ResponseWidget",["lodash","i18n","taoQtiItem/qtiCommonRenderer/renderers/interactions/AssociateInteraction","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCreator/widgets/helpers/placeholder"],function(_,__,commonRenderer,sizeAdapter,instructionMgr,placeholder){'use strict';var ResponseWidget={create:function create(widget,responseMappingMode){var interaction=widget.element;commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),responseMappingMode?(instructionMgr.appendInstruction(widget.element,__("Please define association pairs and their scores below.")),interaction.responseMappingMode=!0,widget.on("mappingAttributeChange",function(data){"defaultValue"===data.key&&placeholder.score(widget,data.value)}),placeholder.score(widget)):instructionMgr.appendInstruction(widget.element,__("Please define the correct association pairs below.")),commonRenderer.render(interaction),sizeAdapter.adaptSize(widget)},setResponse:function setResponse(interaction,response){var responseDeclaration=interaction.getResponseDeclaration();commonRenderer.setResponse(interaction,ResponseWidget.formatResponse(response,responseDeclaration.attr("cardinality"))),sizeAdapter.adaptSize(interaction.data("widget"))},destroy:function destroy(widget){var interaction=widget.element;commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),delete interaction.responseMappingMode,commonRenderer.renderEmptyPairs(interaction),sizeAdapter.adaptSize(widget)},getResponseSummary:function getResponseSummary(responseDeclaration){var pairs=[],correctResponse=_.values(responseDeclaration.getCorrect()),mapEntries=responseDeclaration.getMapEntries();return _.each(correctResponse,function(pair){var sortedIdPair=pair.split(" ").sort(),sortedIdPairKey=sortedIdPair.join(" ");pairs[sortedIdPairKey]={pair:sortedIdPair,correct:!0,score:void 0}}),_.forIn(mapEntries,function(score,pair){var sortedIdPair=pair.split(" ").sort(),sortedIdPairKey=sortedIdPair.join(" ");pairs[sortedIdPairKey]?pairs[sortedIdPairKey].score=score:pairs[sortedIdPairKey]={pair:sortedIdPair,correct:!1,score:score}}),pairs},formatResponse:function formatResponse(response,cardinality){var formatedRes;return formatedRes="single"===cardinality?{base:{pair:[]}}:{list:{pair:[]}},_.each(response,function(pairString){var pair=pairString.split(" ");"single"===cardinality?formatedRes.base.pair=pair:formatedRes.list.pair.push(pair)}),formatedRes},unformatResponse:function unformatResponse(formatedResponse){var res=[];return formatedResponse.list&&formatedResponse.list.pair?_.each(formatedResponse.list.pair,function(pair){res.push(pair.join(" "))}):formatedResponse.base&&formatedResponse.base.pair&&res.push(formatedResponse.base.pair.join(" ")),res}};return ResponseWidget}),define("taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/Correct",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/ResponseWidget","lodash"],function(stateFactory,Correct,responseWidget,_){var AssociateInteractionStateCorrect=stateFactory.create(Correct,function(){var interaction=this.widget.element,response=interaction.getResponseDeclaration();responseWidget.create(this.widget,!1),responseWidget.setResponse(interaction,_.values(response.getCorrect())),this.widget.$container.on("responseChange.qti-widget",function(e,data){response.setCorrect(responseWidget.unformatResponse(data.response))})},function(){this.widget.$container.off("responseChange.qti-widget"),responseWidget.destroy(this.widget)});return AssociateInteractionStateCorrect}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/associableChoice.answer",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div class=\"mini-tlb\" data-edit=\"answer\" data-for=\"",(helper=helpers.choiceSerial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.choiceSerial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <label class=\"tlb-button right\" title=\"This answer is correct\" data-edit=\"correct\">\n <input \n type=\"checkbox\" \n data-role=\"correct\"\n name=\"correct_",(helper=helpers.interactionSerial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.interactionSerial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"[]\" \n value=\"",(helper=helpers.choiceIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.choiceIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.correct,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n </label>\n <label class=\"tlb-button right\" title=\"Score of this answer\" data-edit=\"map\">\n <input value=\"",(helper=helpers.score)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.score,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" data-role=\"score\" data-for=\"",(helper=helpers.choiceIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.choiceIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" name=\"score\" class=\"score\" data-validate=\"$numeric\" data-validate-option=\"$allowEmpty; $event(type=keyup)\" />\n </label>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/Map",["jquery","lodash","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/ResponseWidget","taoQtiItem/qtiCreator/widgets/helpers/placeholder","tpl!taoQtiItem/qtiCreator/tpl/toolbars/associableChoice.answer"],function($,_,stateFactory,Map,responseWidget,placeholder,responseToolbarTpl){'use strict';var AssociateInteractionStateCorrect=stateFactory.create(Map,function(){var _widget=this.widget,interaction=_widget.element,response=interaction.getResponseDeclaration();responseWidget.create(_widget,!0),this.bindResponseChangeListener(),responseWidget.setResponse(interaction,_.keys(responseWidget.getResponseSummary(response))),placeholder.score(_widget)},function(){this.widget.$container.off("responseChange.qti-widget"),responseWidget.destroy(this.widget),this.widget.$container.find(".mini-tlb").remove()});return AssociateInteractionStateCorrect.prototype.bindResponseChangeListener=function(){var _widget=this.widget,interaction=_widget.element,response=interaction.getResponseDeclaration(),_saveCorrect=function(){var correct=[];$("input[name=\"correct_"+_widget.serial+"[]\"]:checked").each(function(){correct.push($(this).data("pairIdentifier"))}),response.setCorrect(correct)};_widget.$container.on("responseChange.qti-widget",function(e,data,extraData){var $miniToolbar;if("added"===extraData.type){var pair=[],pairs=[],$filled=extraData.$pair.children(".filled");if(2===$filled.length){pairs=responseWidget.getResponseSummary(response),$filled.each(function(){var serial=$(this).data("serial"),choice=interaction.getChoice(serial);pair.push(choice.id())}),pair.sort();var pairIdentifier=pair.join(" ");$miniToolbar=extraData.$pair.children(".mini-tlb"),$miniToolbar.length||(extraData.$pair.append(responseToolbarTpl({interactionSerial:interaction.getSerial(),choiceSerial:"n/a",choiceIdentifier:"n/a"})),$miniToolbar=extraData.$pair.children(".mini-tlb")),$miniToolbar.show(),$miniToolbar.data("pairIdentifier",pairIdentifier);var $correct=$miniToolbar.find("[data-role=correct]").data("pairIdentifier",pairIdentifier);pairs[pairIdentifier]&&pairs[pairIdentifier].correct?$correct.prop("checked",!0):$correct.prop("checked",!1);var $score=$miniToolbar.find("[data-role=score]").data("pairIdentifier",pairIdentifier);pairs[pairIdentifier]&&pairs[pairIdentifier].score&&$score.val(pairs[pairIdentifier].score)}}else $miniToolbar=extraData.$pair.children(".mini-tlb"),$miniToolbar.hide(),response.removeMapEntry($miniToolbar.data("pairIdentifier")),$miniToolbar.removeData("pairIdentifier"),$miniToolbar.find("[data-role=correct]").prop("checked",!1).removeData("pairIdentifier"),$miniToolbar.find("[data-role=score]").val("").removeData("pairIdentifier"),_saveCorrect();placeholder.score(_widget)}),placeholder.score(_widget),_widget.$container.find(".result-area").on("change","[data-role=correct]",_saveCorrect).on("keyup","[data-role=score]",function(){var $score=$(this);response.setMapEntry($score.data("pairIdentifier"),$score.val())})},AssociateInteractionStateCorrect}),define("taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/Choice","taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/Map"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/states","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter"],function(Widget,states,sizeAdapter){'use strict';var AssociateInteractionWidget=Widget.clone();return AssociateInteractionWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this),sizeAdapter.adaptSize(this)},AssociateInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/AssociateInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/AssociateInteraction","taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/Widget"],function(_,AssociateInteraction,AssociateInteractionWidget){'use strict';var CreatorAssociateInteraction=_.clone(AssociateInteraction);return CreatorAssociateInteraction.render=function(interaction,options){AssociateInteraction.renderEmptyPairs(interaction),AssociateInteractionWidget.build(interaction,AssociateInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorAssociateInteraction}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/choice",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(){return"checked=\"checked\""}function program3(){return"checked"}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",self=this,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label>\n <input name=\"shuffle\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.shuffle,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Shuffle choices",options):helperMissing.call(depth0,"__","Shuffle choices",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"If the shuffle attribute is true then the delivery engine will randomize the order in which the choices are initially presented.\n However each choice may be \"shuffled\" of \"fixed\" individually.",options):helperMissing.call(depth0,"__","If the shuffle attribute is true then the delivery engine will randomize the order in which the choices are initially presented.\n However each choice may be \"shuffled\" of \"fixed\" individually.",options)))+"\n </span>\n</div>\n\n<hr/>\n<div class=\"panel min-max-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Allowed choices",options):helperMissing.call(depth0,"__","Allowed choices",options)))+"</h3>\n</div>\n<hr/>\n<div class=\"panel\">\n <label>\n <input name=\"eliminable\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.eliminable,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Allow elimination",options):helperMissing.call(depth0,"__","Allow elimination",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"If this box is checked the student will be able to eliminate choices.",options):helperMissing.call(depth0,"__","If this box is checked the student will be able to eliminate choices.",options)))+"\n </span>\n</div>\n\n<hr/>\n\n\n<div class=\"panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"List Style",options):helperMissing.call(depth0,"__","List Style",options)))+"</h3>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Use this if you want the list of choices to be prefixed (e.g. 1,2,3 a,b,c)",options):helperMissing.call(depth0,"__","Use this if you want the list of choices to be prefixed (e.g. 1,2,3 a,b,c)",options)))+"\n </span>\n\n <select data-list-style/>\n</div>\n\n\n<hr/>\n<div class=\"panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Orientation",options):helperMissing.call(depth0,"__","Orientation",options)))+"</h3>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Display the choices either horizontally or vertically",options):helperMissing.call(depth0,"__","Display the choices either horizontally or vertically",options)))+"\n </span>\n <div>\n <label class=\"smaller-prompt\">\n <input type=\"radio\" name=\"orientation\" value=\"vertical\" ",stack1=helpers.unless.call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\n <span class=\"icon-radio\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Vertical",options):helperMissing.call(depth0,"__","Vertical",options)))+"\n </label>\n <br>\n <label class=\"smaller-prompt\">\n <input type=\"radio\" name=\"orientation\" value=\"horizontal\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\n <span class=\"icon-radio\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Horizontal",options):helperMissing.call(depth0,"__","Horizontal",options)))+"\n </label>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/states/Question",["lodash","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/component/minMax/minMax","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/choice","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter","ui/liststyler"],function(_,stateFactory,Question,formElement,minMaxComponentFactory,formTpl,sizeAdapter){'use strict';function getListStyle(interaction){var className=interaction.attr("class")||"",listStyle=className.match(/\blist-style-[\w-]+/);return _.isNull(listStyle)?null:listStyle.pop().replace("list-style-","")}var ChoiceInteractionStateQuestion=stateFactory.extend(Question),listStylePrefix="list-style-";return ChoiceInteractionStateQuestion.prototype.initForm=function(updateCardinality){var widget=this.widget,$form=widget.$form,interaction=widget.element,currListStyle=getListStyle(interaction),$choiceArea=widget.$container.find(".choice-area"),callbacks;$form.html(formTpl({shuffle:!!interaction.attr("shuffle"),horizontal:"horizontal"===interaction.attr("orientation"),eliminable:/\beliminable\b/.test(interaction.attr("class"))})),minMaxComponentFactory($form.find(".min-max-panel"),{min:{value:_.parseInt(interaction.attr("minChoices"))||0},max:{value:_.parseInt(interaction.attr("maxChoices"))||0},upperThreshold:_.size(interaction.getChoices())}).on("render",function(){var self=this;widget.on("choiceCreated choiceDeleted",function(data){data.interaction.serial===interaction.serial&&self.updateThresholds(1,_.size(interaction.getChoices()))})}),$form.find("[data-list-style]").liststyler({selected:currListStyle}).on("stylechange.liststyler",function(e,data){interaction.removeClass(listStylePrefix+data.oldStyle),$choiceArea.removeClass(listStylePrefix+data.oldStyle),"none"!==data.newStyle&&(interaction.addClass(listStylePrefix+data.newStyle),$choiceArea.addClass(listStylePrefix+data.newStyle))}),$form.find("[name=\"eliminable\"]").on("change.eliminable",function(){interaction.toggleClass("eliminable",this.checked),widget.$original.toggleClass("eliminable",this.checked),this.checked||widget.$original.find(".eliminated").removeClass("eliminated"),interaction.toggleClass("eliminability-deselected",!this.checked)}),formElement.initWidget($form),callbacks=formElement.getMinMaxAttributeCallbacks("minChoices","maxChoices",{updateCardinality:updateCardinality}),callbacks.shuffle=formElement.getAttributeChangeCallback(),callbacks.orientation=function(interaction,value){interaction.attr("orientation",value),"horizontal"===value?$choiceArea.addClass("horizontal"):$choiceArea.removeClass("horizontal")},formElement.setChangeCallbacks($form,interaction,callbacks),widget.on("attributeChange",function(data){var $checkboxIcons=widget.$container.find(".real-label > span");data.element.serial===interaction.serial&&"maxChoices"===data.key&&(1===parseInt(data.value)?$checkboxIcons.removeClass("icon-checkbox").addClass("icon-radio"):$checkboxIcons.removeClass("icon-radio").addClass("icon-checkbox"))}),"horizontal"===interaction.attr("orientation")&&sizeAdapter.adaptSize(widget),widget.on("choiceCreated",function(){"horizontal"===interaction.attr("orientation")&&sizeAdapter.adaptSize(widget)})},ChoiceInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/states/Choice",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Choice","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter"],function(stateFactory,Choice,sizeAdapter){'use strict';var ChoiceInteractionStateChoice=stateFactory.extend(Choice,function(){var widget=this.widget;widget.on("containerBodyChange contentChange choiceCreated",function(){"horizontal"===widget.element.attr("orientation")&&sizeAdapter.adaptSize(widget)})},function(){});return ChoiceInteractionStateChoice}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/simpleChoice.score",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<div class=\"mini-tlb\" data-edit=\"answer\" data-for=\"",(helper=helpers.choiceSerial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.choiceSerial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <label class=\"tlb-button right\" title=\"Score of this answer\" data-edit=\"map\">\n <input value=\"",(helper=helpers.score)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.score,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n type=\"text\" \n data-for=\"",(helper=helpers.choiceIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.choiceIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n name=\"score\" \n class=\"score\" \n placeholder = \"",(helper=helpers.placeholder)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.placeholder,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-validate=\"$numeric\" \n data-validate-option=\"$allowEmpty; $event(type=keyup)\" />\n </label>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/simpleChoice.label",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",self=this,escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<div class=\"mini-tlb-label\" data-edit=\"answer\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.show,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"style=\"display:block;\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <label class=\"right\">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</label>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/ResponseWidget",["jquery","lodash","i18n","taoQtiItem/qtiCommonRenderer/renderers/interactions/ChoiceInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/interactions/helpers/answerState","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter","tpl!taoQtiItem/qtiCreator/tpl/toolbars/simpleChoice.score","tpl!taoQtiItem/qtiCreator/tpl/toolbars/simpleChoice.label"],function($,_,__,commonRenderer,instructionMgr,pciResponse,formElement,answerStateHelper,sizeAdapter,scoreTpl,labelTpl){'use strict';var _fixInputs=function(widget){1===widget.element.attr("maxChoices")?widget.$container.find(".real-label > :checkbox").replaceWith(function(){var $checkbox=$(this);return $("<input>",{type:"radio",value:$checkbox.attr("value"),name:$checkbox.attr("name")})}):widget.$container.find(".real-label > :radio").replaceWith(function(){var $radio=$(this);return $("<input>",{type:"checkbox",value:$radio.attr("value"),name:$radio.attr("name")})})},ResponseWidget={create:function create(widget,responseMappingMode){var interaction=widget.element;commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),_fixInputs(widget),responseMappingMode?(instructionMgr.appendInstruction(widget.element,__("Please define the correct response and the score below.")),interaction.data("responseMappingMode",!0),ResponseWidget.createScoreWidgets(widget),ResponseWidget.createCorrectWidgets(widget)):(instructionMgr.appendInstruction(widget.element,__("Please define the correct response below.")),ResponseWidget.createCorrectWidgets(widget)),commonRenderer.render(interaction),"horizontal"===interaction.attr("orientation")&&sizeAdapter.adaptSize(widget)},setResponse:function setResponse(interaction,response){commonRenderer.setResponse(interaction,pciResponse.serialize(_.values(response),interaction)),"horizontal"===interaction.attr("orientation")&&sizeAdapter.adaptSize(interaction.data("widget"))},destroy:function destroy(widget){var interaction=widget.element;commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),interaction.removeData("responseMappingMode"),widget.$container.off("responseChange.qti-widget"),widget.$container.find(".real-label > input").attr("disabled","disabled"),widget.$container.find(".mini-tlb-label[data-edit=answer], .mini-tlb[data-edit=answer]").remove(),"horizontal"===interaction.attr("orientation")&&sizeAdapter.adaptSize(widget)},createScoreWidgets:function createScoreWidgets(widget){var $container=widget.$container,interaction=widget.element,response=interaction.getResponseDeclaration(),mapEntries=response.getMapEntries(),defaultValue=response.getMappingAttribute("defaultValue"),$label=$(labelTpl({label:__("score"),show:!0})).css({right:3,left:"auto"});$container.find(".qti-choice:first .pseudo-label-box").append($label),$container.find(".qti-choice").each(function(){var $choice=$(this),id=$choice.data("identifier"),serial=$choice.data("serial"),$score;$score=$(scoreTpl({serial:interaction.getSerial(),choiceSerial:serial,choiceIdentifier:id,score:mapEntries[id]?mapEntries[id]:"",placeholder:defaultValue})),$choice.find(".pseudo-label-box").append($score),$score.show().on("click",function(e){e.stopPropagation(),e.preventDefault()})});var $scores=$container.find(".score");widget.on("mappingAttributeChange",function(data){"defaultValue"===data.key&&$scores.attr("placeholder",data.value)}),formElement.setChangeCallbacks($container,response,{score:function score(response,value){var key=$(this).data("for");""===value?response.removeMapEntry(key):response.setMapEntry(key,value,!0)}})},createCorrectWidgets:function createCorrectWidgets(widget){var $container=widget.$container,interaction=widget.element,response=interaction.getResponseDeclaration(),$corrects=$container.find(".real-label > input");$container.find(".qti-choice:first .pseudo-label-box").append(labelTpl({label:__("correct"),show:!1})),$container.on("responseChange.qti-widget",function(e,data){response.setCorrect(pciResponse.unserialize(data.response,interaction))});var _toggleCorrectInputs=function(show){show?$corrects.removeAttr("disabled"):$corrects.attr("disabled","disabled").prop("checked",!1)};_toggleCorrectInputs(answerStateHelper.defineCorrect(response)),widget.on("metaChange",function(data){data.element.serial===response.serial&&"defineCorrect"===data.key&&_toggleCorrectInputs(data.value)})},formatResponse:function formatResponse(response){return pciResponse.serialize(_.values(response))},unformatResponse:function unformatResponse(formatedResponse){return pciResponse.unserialize(formatedResponse)}};return ResponseWidget}),define("taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/states/Correct",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/ResponseWidget","lodash"],function(stateFactory,Correct,responseWidget,_){var ChoiceInteractionStateCorrect=stateFactory.create(Correct,function(){var _widget=this.widget,interaction=_widget.element,response=interaction.getResponseDeclaration();responseWidget.create(_widget),responseWidget.setResponse(interaction,_.values(response.getCorrect()))},function(){responseWidget.destroy(this.widget)});return ChoiceInteractionStateCorrect}),define("taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/states/Map",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/ResponseWidget","lodash"],function(stateFactory,Map,responseWidget,_){'use strict';var ChoiceInteractionStateMap=stateFactory.create(Map,function(){var _widget=this.widget,interaction=_widget.element,response=interaction.getResponseDeclaration();responseWidget.create(_widget,!0),responseWidget.setResponse(interaction,_.values(response.getCorrect()))},function(){responseWidget.destroy(this.widget)});return ChoiceInteractionStateMap}),define("taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/states/Choice","taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/states/Map"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/states/states","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter"],function(Widget,states,sizeAdapter){'use strict';var ChoiceInteractionWidget=Widget.clone();return ChoiceInteractionWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this),"horizontal"===this.element.attr("orientation")&&sizeAdapter.adaptSize(this)},ChoiceInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/ChoiceInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/ChoiceInteraction","taoQtiItem/qtiCreator/widgets/interactions/choiceInteraction/Widget"],function(_,ChoiceInteraction,ChoiceInteractionWidget){'use strict';var CreatorChoiceInteraction=_.clone(ChoiceInteraction);return CreatorChoiceInteraction.render=function(interaction,options){ChoiceInteractionWidget.build(interaction,ChoiceInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorChoiceInteraction}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget"],function(Widget){var InlineInteractionWidget=Widget.clone();return InlineInteractionWidget.destroy=function(){this.$original.off(".qti-widget"),this.$container.remove(),this.offEvents()},InlineInteractionWidget}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Sleep"],function(stateFactory,SleepState){var InlineInteractionStateSleep=stateFactory.create(SleepState,function(){var _widget=this.widget,$container=this.widget.$original;$container.on("click.qti-widget.sleep",function(e){e.stopPropagation(),_widget.changeState("question")}),$container.on("mouseenter.sleep",function(){$container.addClass("hover"),$container.parent().trigger("mouseleave.sleep")}).on("mouseleave.sleep",function(){$container.removeClass("hover"),$container.parent().trigger("mouseenter.sleep")})},function(){this.widget.$original.removeClass("hover").off(".sleep")});return InlineInteractionStateSleep}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/states/Active",["jquery","lodash","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Active"],function($,_,stateFactory,Active){var InteractionStateActive=stateFactory.extend(Active,function(){var _this=this;$(window).on("resize.active",_.throttle(function(){_this.positionWidget()},200)),this.positionWidget()},function(){$(window).off(".active"),this.widget.$container.hide()});return InteractionStateActive.prototype.positionWidget=function(){var _widget=this.widget,itemOffset=_widget.$itemContainer.offset(),originalOffset=_widget.$original.offset();_widget.$container.show().css({position:"absolute",top:originalOffset.top-itemOffset.top-22,left:originalOffset.left-itemOffset.left-32})},InteractionStateActive}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/states","taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/states/Sleep","taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/states/Active"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/endAttempt",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n<div class=\"panel\">\n <label for=\"restrictedIdentifier\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Response identifier",options):helperMissing.call(depth0,"__","Response identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select a response identifier from the list.",options):helperMissing.call(depth0,"__","Select a response identifier from the list.",options)))+"</span>\n <select name=\"restrictedIdentifier\" class=\"select2\" data-has-search=\"false\">\n \t",stack1=helpers.each.call(depth0,depth0&&depth0.restrictedIdentifiers,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n</div>\n",buffer}function program2(depth0,data){var buffer="",stack1,helper;return buffer+="\n \t\t<option value=\""+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n \t",buffer}function program3(){return"selected=\"selected\""}function program5(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n<div class=\"panel\">\n <label for=\"\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Response identifier",options):helperMissing.call(depth0,"__","Response identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The identifier of the response identifier. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options):helperMissing.call(depth0,"__","The identifier of the response identifier. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options)))+"</div>\n\n <input type=\"text\" \n name=\"responseIdentifier\" \n value=\"",(helper=helpers.responseIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.responseIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n placeholder=\"e.g. END_ATTEMPT\" \n data-validate=\"$notEmpty; $qtiIdentifier; $availableIdentifier(serial=",(helper=helpers.responseSerial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.responseSerial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n</div>\n",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return stack1=helpers["if"].call(depth0,depth0&&depth0.hasRestrictedIdentifier,{hash:{},inverse:self.program(5,program5,data),fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\n<div class=\"panel\">\n <label for=\"\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Label",options):helperMissing.call(depth0,"__","Label",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The button label.",options):helperMissing.call(depth0,"__","The button label.",options)))+"</div>\n\n <input type=\"text\" \n name=\"title\" \n value=\"",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n placeholder=\"e.g. End Attempt\" \n data-validate=\"$notEmpty;\">\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/endAttemptInteraction/states/Question",["lodash","jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Question","taoQtiItem/qtiCreator/widgets/helpers/formElement","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/endAttempt"],function(_,$,stateFactory,Question,formElement,formTpl){'use strict';function _prepareRestrictedIdentifier(widget){var ret={},interaction=widget.element,response=interaction.getResponseDeclaration(),responseIdentifier=interaction.attr("responseIdentifier"),config=widget.options.config,defaultIdentifier="",isset="",i=0;return config&&config.responseIdentifiers&&(_.forIn(config.responseIdentifiers,function(title,identifier){i||(defaultIdentifier=identifier);var selected=responseIdentifier.match(new RegExp("^("+identifier+")(_[0-9]*)?$"));ret[identifier]={identifier:identifier,title:title,selected:selected},selected&&(isset=!0),i++}),!isset&&(response.buildIdentifier(defaultIdentifier,!1),interaction.attr("responseIdentifier",response.id()))),ret}var EndAttemptInteractionStateQuestion=stateFactory.extend(Question,function(){var $mainOption=this.widget.$container.find(".main-option"),$original=this.widget.$original;$(document).on("choiceTextChange.qti-widget.question",function(){$original.width($mainOption.width())})},function(){$(document).off(".qti-widget.question")});return EndAttemptInteractionStateQuestion.prototype.addNewChoiceButton=function(){},EndAttemptInteractionStateQuestion.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,$title=_widget.$container.find(".endAttemptInteraction-placeholder"),interaction=_widget.element,response=interaction.getResponseDeclaration(),restrictedIdentifiers=_prepareRestrictedIdentifier(_widget),hasRestrictedIdentifier=!!_.size(restrictedIdentifiers);$form.html(formTpl({hasRestrictedIdentifier:hasRestrictedIdentifier,restrictedIdentifiers:restrictedIdentifiers,responseSerial:response.serial,responseIdentifier:interaction.attr("responseIdentifier"),title:interaction.attr("title")})),formElement.initWidget($form),formElement.setChangeCallbacks($form,interaction,{title:function title(interaction,_title){interaction.attr("title",_title),$title.html(_title),_widget.$original.html(_title)},responseIdentifier:function responseIdentifier(interaction,identifier){response.id(identifier),interaction.attr("responseIdentifier",identifier)},restrictedIdentifier:function restrictedIdentifier(interaction,identifier){response.buildIdentifier(identifier,!1),interaction.attr("responseIdentifier",response.id())}})},EndAttemptInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/endAttemptInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/endAttemptInteraction/states/Question"],function(factory,states){'use strict';return factory.createBundle(states,arguments,["map"])}),define("tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/endAttemptInteraction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<div class=\"widget-box widget-inline widget-endAttemptInteraction qti-interaction\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-edit=\"active\">\r\n <span class=\"btn small btn-info endAttemptInteraction-placeholder\">\r\n "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.title),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\r\n </span>\r\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/endAttemptInteraction/Widget",["lodash","taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/Widget","taoQtiItem/qtiCreator/widgets/interactions/endAttemptInteraction/states/states","tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/endAttemptInteraction"],function(_,InteractionWidget,states,interactionTpl){'use strict';var EndAttemptInteractionWidget=InteractionWidget.clone();return EndAttemptInteractionWidget.initCreator=function(){this.registerStates(states),InteractionWidget.initCreator.call(this),this.$container.find(".tlb-title").remove()},EndAttemptInteractionWidget.renderInteraction=function(){var interaction=this.element,tplData={tag:interaction.qtiClass,serial:interaction.serial,attributes:interaction.attributes};return interactionTpl(tplData)},EndAttemptInteractionWidget.buildContainer=function(){var previous,next;this.$original.length&&(previous=this.$original[0].previousSibling,next=this.$original[0].nextSibling,(!previous||3===previous.nodeType&&""===previous.nodeValue||3!==previous.nodeType)&&this.$original.before("&nbsp;"),(!next||3===next.nodeType&&""===next.nodeValue||3!==next.nodeType)&&this.$original.after("&nbsp;")),this.$itemContainer=this.$original.parents(".item-editor-item"),this.$itemContainer.append(this.renderInteraction()),this.$container=this.$itemContainer.find(".widget-endAttemptInteraction[data-serial="+this.element.getSerial()+"]")},EndAttemptInteractionWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/endAttemptInteraction.placeholder",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<span class=\"widget-box btn small btn-info endAttemptInteraction-placeholder\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"endAttemptInteraction\">\n "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.title),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\n</span>",buffer})}),define("taoQtiItem/qtiCreator/renderers/interactions/EndAttemptInteraction",["jquery","lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/EndAttemptInteraction","taoQtiItem/qtiCreator/widgets/interactions/endAttemptInteraction/Widget","tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/endAttemptInteraction.placeholder"],function($,_,EndAttemptInteraction,EndAttemptInteractionWidget,tpl){'use strict';var CreatorEndAttemptInteraction=_.clone(EndAttemptInteraction);return CreatorEndAttemptInteraction.template=tpl,CreatorEndAttemptInteraction.render=function(interaction,options){options=options||{};var interactionsConfig=this.getOption("interactions");interactionsConfig.endAttempt&&(options.config=interactionsConfig.endAttempt),EndAttemptInteractionWidget.build(interaction,$(".endAttemptInteraction-placeholder[data-serial=\""+interaction.serial+"\"]"),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorEndAttemptInteraction}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/extendedText",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n \t\t<option value=\""+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n \t",buffer}function program2(){return"selected=\"selected\""}function program4(depth0,data){var buffer="",stack1,helper;return buffer+="\n <option value=\""+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n ",buffer}function program6(){return"style=\"display:none\""}function program8(depth0,data){var stack1,helper;return(helper=helpers.patternMask)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.patternMask,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),escapeExpression(stack1)}function program10(depth0,data){var buffer="",stack1,helper;return buffer+="value=\"",(helper=helpers.maxLength)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxLength,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}function program12(depth0,data){var buffer="",stack1,helper;return buffer+="value=\"",(helper=helpers.maxWords)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxWords,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}function program14(depth0,data){var stack1,helper;return(helper=helpers.expectedLength)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.expectedLength,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),escapeExpression(stack1)}function program16(depth0,data){var stack1,helper;return(helper=helpers.expectedLines)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.expectedLines,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),escapeExpression(stack1)}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"format\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Format",options):helperMissing.call(depth0,"__","Format",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Used to control the format of the text entered by the candidate.",options):helperMissing.call(depth0,"__","Used to control the format of the text entered by the candidate.",options)))+"</span>\n <select name=\"format\" class=\"select2\" data-has-search=\"false\">\n \t",stack1=helpers.each.call(depth0,depth0&&depth0.formats,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n</div>\n<hr>\n<div class=\"panel\">\n <h3 class=\"full-width\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Constraints",options):helperMissing.call(depth0,"__","Constraints",options)))+"</h3>\n <select name=\"constraint\" class=\"select2\" data-has-search=\"false\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.constraints,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n</div>\n<div class=\"panel extendedText\">\n \n <div class=\"constraint constraint-pattern\" ",stack1=helpers.unless.call(depth0,(stack1=(stack1=depth0&&depth0.constraints,null==stack1||!1===stack1?stack1:stack1.pattern),null==stack1||!1===stack1?stack1:stack1.selected),{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <label>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Pattern",options):helperMissing.call(depth0,"__","Pattern",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"If given, the pattern mask specifies a regular expression that the candidate's response must match in order to be considered valid",options):helperMissing.call(depth0,"__","If given, the pattern mask specifies a regular expression that the candidate's response must match in order to be considered valid",options)))+"</span>\n <input type=\"text\" name=\"patternMask\" value=\"",stack1=helpers["if"].call(depth0,depth0&&depth0.patternMask,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"/>\n </div>\n \n <div class=\"constraint constraint-maxLength\" ",stack1=helpers.unless.call(depth0,(stack1=(stack1=depth0&&depth0.constraints,null==stack1||!1===stack1?stack1:stack1.maxLength),null==stack1||!1===stack1?stack1:stack1.selected),{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <label class=\"spinner\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Max length",options):helperMissing.call(depth0,"__","Max length",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"We will use the patternMask to do this, to be compliant with the IMS standard",options):helperMissing.call(depth0,"__","We will use the patternMask to do this, to be compliant with the IMS standard",options)))+"</span>\n <input type=\"text\" data-min=\"0\" data-increment=\"1\" class=\"incrementer\" name=\"maxLength\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.maxLength,{hash:{},inverse:self.noop,fn:self.program(10,program10,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\n </div>\n \n <div class=\"constraint constraint-maxWords\" ",stack1=helpers.unless.call(depth0,(stack1=(stack1=depth0&&depth0.constraints,null==stack1||!1===stack1?stack1:stack1.maxWords),null==stack1||!1===stack1?stack1:stack1.selected),{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <label class=\"spinner\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Max words",options):helperMissing.call(depth0,"__","Max words",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"We will use the patternMask to do this, to be compliant with the IMS standard",options):helperMissing.call(depth0,"__","We will use the patternMask to do this, to be compliant with the IMS standard",options)))+"</span>\n <input type=\"text\" data-min=\"0\" data-increment=\"1\" class=\"incrementer\" name=\"maxWords\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.maxWords,{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n </div>\n</div>\n<hr>\n<div class=\"panel extendedText\">\n <h3 class=\"full-width\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Recommendations",options):helperMissing.call(depth0,"__","Recommendations",options)))+"</h3>\n <label class=\"spinner\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Length",options):helperMissing.call(depth0,"__","Length",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Provides a hint to the candidate as to the expected overall length of the desired response measured in number of characters.",options):helperMissing.call(depth0,"__","Provides a hint to the candidate as to the expected overall length of the desired response measured in number of characters.",options)))+"</span>\n <input type=\"text\" data-min=\"0\" data-increment=\"1\" class=\"incrementer\" name=\"expectedLength\" value=\"",stack1=helpers["if"].call(depth0,depth0&&depth0.expectedLength,{hash:{},inverse:self.noop,fn:self.program(14,program14,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"/>\n <label for=\"\" class=\"spinner\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Lines",options):helperMissing.call(depth0,"__","Lines",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Provides a hint to the candidate as to the expected number of lines of input required. A line is expected to have about 72 characters.",options):helperMissing.call(depth0,"__","Provides a hint to the candidate as to the expected number of lines of input required. A line is expected to have about 72 characters.",options)))+"</span>\n <input type=\"text\" class=\"incrementer\" data-min=\"0\" data-increment=\"1\" name=\"expectedLines\" value=\"",stack1=helpers["if"].call(depth0,depth0&&depth0.expectedLines,{hash:{},inverse:self.noop,fn:self.program(16,program16,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\">\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/states/Question",["jquery","lodash","i18n","module","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCommonRenderer/renderers/interactions/ExtendedTextInteraction","taoQtiItem/qtiCommonRenderer/helpers/patternMask","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/extendedText"],function($,_,__,module,stateFactory,Question,formElement,renderer,patternMaskHelper,formTpl){'use strict';var config=module.config(),ExtendedTextInteractionStateQuestion=stateFactory.extend(Question,function(){renderer.disable(this.widget.element)},function(){renderer.enable(this.widget.element)});return ExtendedTextInteractionStateQuestion.prototype.initForm=function(){function setAttributes(attribute,interaction,attrValue){var newValue=parseInt(attrValue,10);isNaN(newValue)?interaction.removeAttr(attribute):interaction.attr(attribute,attrValue)}var _widget=this.widget,$form=_widget.$form,$original=_widget.$original,interaction=_widget.element,isMathEntry="true"===interaction.attr("data-math-entry"),format=interaction.attr("format"),patternMask=interaction.attr("patternMask"),expectedLength=parseInt(interaction.attr("expectedLength"),10),expectedLines=parseInt(interaction.attr("expectedLines"),10),maxWords=parseInt(patternMaskHelper.parsePattern(patternMask,"words"),10),maxChars=parseInt(patternMaskHelper.parsePattern(patternMask,"chars"),10),$counterMaxWords=$(".text-counter-words > .count-max-words",$original),$counterMaxLength=$(".text-counter-chars > .count-max-length",$original),formats={plain:{label:__("Plain text"),selected:!1},preformatted:{label:__("Pre-formatted text"),selected:!1},xhtml:{label:__("Rich text"),selected:!1}},$inputs;config.hasMath&&(formats.math={label:__("Rich text + math"),selected:!1});var constraints={none:{label:__("None"),selected:!0},maxLength:{label:__("Max Length"),selected:!1},maxWords:{label:__("Max Words"),selected:!1},pattern:{label:__("Pattern"),selected:!1}};!isNaN(maxWords)&&0<maxWords?(constraints.none.selected=!1,constraints.maxWords.selected=!0):!isNaN(maxChars)&&0<maxChars?(constraints.none.selected=!1,constraints.maxLength.selected=!0):null!==patternMask&&void 0!==patternMask&&""!==patternMask&&(constraints.none.selected=!1,constraints.pattern.selected=!0),"xhtml"===format&&isMathEntry&&(format="math"),formats[format]&&(formats[format].selected=!0),$form.html(formTpl({formats:formats,patternMask:patternMask,maxWords:maxWords,maxLength:maxChars,expectedLength:expectedLength,expectedLines:expectedLines,constraints:constraints})),maxWords||maxChars||$(".text-counter",$original).hide(),formElement.initWidget($form),$inputs={maxLength:$form.find("[name=\"maxLength\"]"),maxWords:$form.find("[name=\"maxWords\"]"),patternMask:$form.find("[name=\"patternMask\"]")};var callbacks={};callbacks.format=function(interaction,attrValue){var response=interaction.getResponseDeclaration(),correctResponse=_.values(response.getCorrect()),previousFormat=interaction.attr("format"),isMath="math"===attrValue,format=isMath?"xhtml":attrValue;renderer.destroy(interaction),interaction.attr("format",format),interaction.attr("data-math-entry",isMath?"true":"false"),renderer.render(interaction),"xhtml"!==format&&"xhtml"===previousFormat&&"undefined"!=typeof correctResponse[0]&&response.setCorrect($("<p>"+correctResponse[0]+"</p>").text())},callbacks.constraint=function(interaction,attrValue){$(".constraint",$form).hide("500"),$(".constraint-"+attrValue,$form).show("1000"),$counterMaxWords.text(0),$inputs.maxWords.val(0),$counterMaxLength.text(0),$inputs.maxLength.val(0),"none"===attrValue||"pattern"===attrValue?($(".text-counter",$original).hide(),"none"===attrValue&&($("input",$form).val(""),interaction.attr("patternMask",null))):("maxLength"===attrValue||"maxWords"===attrValue)&&("maxLength"===attrValue?($(".text-counter-words",$original).hide(),$(".text-counter-chars",$original).show()):($(".text-counter-chars",$original).hide(),$(".text-counter-words",$original).show()),$(".text-counter",$original).show())},callbacks.maxWords=function(interaction,attrValue){var newValue=parseInt(attrValue,10);isNaN(newValue)||interaction.attr("patternMask",patternMaskHelper.createMaxWordPattern(newValue)),$counterMaxWords.text(newValue),$inputs.patternMask.val(interaction.attr("patternMask"))},callbacks.maxLength=function(interaction,attrValue){var newValue=parseInt(attrValue,10);isNaN(newValue)||interaction.attr("patternMask",patternMaskHelper.createMaxCharPattern(newValue)),$counterMaxLength.text(newValue),$inputs.patternMask.val(interaction.attr("patternMask"))},callbacks.patternMask=function(interaction,attrValue){interaction.attr("patternMask",attrValue)},callbacks.expectedLength=setAttributes.bind(null,"expectedLength"),callbacks.expectedLines=setAttributes.bind(null,"expectedLines"),formElement.setChangeCallbacks($form,interaction,callbacks)},ExtendedTextInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/states/Correct",["lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCommonRenderer/renderers/interactions/ExtendedTextInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager"],function(_,__,stateFactory,Correct,renderer,instructionMgr){'use strict';var _createResponseWidget=function(widget){var interaction=widget.element,response=interaction.getResponseDeclaration(),correctResponse=_.values(response.getCorrect());renderer.enable(interaction),renderer.setText(interaction,correctResponse[0]),instructionMgr.appendInstruction(interaction,__("Please type the correct response below.")),widget.$container.on("responseChange.qti-widget",function(){renderer.getResponse(interaction).base.string?response.setCorrect([renderer.getResponse(interaction).base.string]):response.resetCorrect()})},_destroyResponseWidget=function(widget){var interaction=widget.element;renderer.clearText(interaction),instructionMgr.removeInstructions(widget.element),widget.$container.off("responseChange.qti-widget")},ExtendedTextInteractionStateCorrect=stateFactory.create(Correct,function(){_createResponseWidget(this.widget)},function(){_destroyResponseWidget(this.widget)});return ExtendedTextInteractionStateCorrect}),define("taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Sleep","taoQtiItem/qtiCommonRenderer/renderers/interactions/ExtendedTextInteraction"],function(stateFactory,Sleep,renderer){'use strict';var ExtendedTextInteractionStateSleep=stateFactory.extend(Sleep,function(){renderer.disable(this.widget.element)},function(){});return ExtendedTextInteractionStateSleep}),define("taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/states/NoRp",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/NoRp","taoQtiItem/qtiCommonRenderer/renderers/interactions/ExtendedTextInteraction"],function(stateFactory,NoRp,renderer){'use strict';return stateFactory.extend(NoRp,function(){renderer.disable(this.widget.element)},function(){renderer.enable(this.widget.element)})}),define("taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/states/Sleep","taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/states/NoRp"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/states/states"],function(Widget,states){'use strict';var ExtendedTextInteractionWidget=Widget.clone();return ExtendedTextInteractionWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this)},ExtendedTextInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/ExtendedTextInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/ExtendedTextInteraction","taoQtiItem/qtiCreator/widgets/interactions/extendedTextInteraction/Widget"],function(_,ExtendedTextInteraction,ExtendedTextInteractionWidget){'use strict';var CreatorExtendedTextInteraction=_.clone(ExtendedTextInteraction);return CreatorExtendedTextInteraction.render=function(interaction,options){ExtendedTextInteraction.render(interaction),ExtendedTextInteractionWidget.build(interaction,ExtendedTextInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorExtendedTextInteraction}),define("taoQtiItem/qtiCreator/widgets/helpers/selectionWrapper",["jquery"],function($){'use strict';return function(options){function searchQtiElement(rootNode){var childNodes=rootNode.childNodes,currentNode,i;for(i=0;i<childNodes.length;i++)currentNode=childNodes[i],!containForbiddenQtiElement&&isElement(currentNode)&&(isQtiElement(currentNode)&&!isQtiClassFromWhiteList(currentNode)?containForbiddenQtiElement=!0:searchQtiElement(currentNode))}function isElement(node){return node.nodeType===window.Node.ELEMENT_NODE}function isQtiElement(node){return node.className&&-1<node.className.indexOf("qti-choice")||node.dataset&&node.dataset.qtiClass}function isQtiClassFromWhiteList(node){return whiteListQtiClasses.includes(node.dataset&&node.dataset.qtiClass)}function isRangeValid(range){return $.contains($container.get(0),range.commonAncestorContainer)||$container.get(0).isSameNode(range.commonAncestorContainer)}var $container=options.$container,allowQtiElements=options.allowQtiElements,whiteListQtiClasses=options.whiteListQtiClasses||[],selection=window.getSelection(),containForbiddenQtiElement;return{canWrap:function(){var range=!selection.isCollapsed&&selection.getRangeAt(0);return!!range&&(containForbiddenQtiElement=!1,allowQtiElements||searchQtiElement(range.cloneContents()),""!==range.toString().trim()&&isRangeValid(range)&&!containForbiddenQtiElement)},wrapWith:function($wrapper){var range=selection.getRangeAt(0);if(this.canWrap())try{return range.surroundContents($wrapper[0]),selection.removeAllRanges(),!0}catch(err){}return!1},wrapHTMLWith:function($wrapper){var range=selection.getRangeAt(0);if(this.canWrap())try{return $wrapper[0].appendChild(range.extractContents()),range.insertNode($wrapper[0]),selection.removeAllRanges(),!0}catch(err){}return!1},getCloneOfContents:function(){var range=selection.getRangeAt(0);return $("<span>").append(range.cloneContents())}}}}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/gapMatch",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",self=this,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label>\n <input name=\"shuffle\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.shuffle,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Shuffle choices",options):helperMissing.call(depth0,"__","Shuffle choices",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"If the shuffle attribute is true then the delivery engine will randomize the order in which the choices are initially presented.\n However each choice may be \"shuffled\" of \"fixed\" individually.",options):helperMissing.call(depth0,"__","If the shuffle attribute is true then the delivery engine will randomize the order in which the choices are initially presented.\n However each choice may be \"shuffled\" of \"fixed\" individually.",options)))+"\n </span>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/gap-create",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="<div class=\"rgt tlb-button\" title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Create gap",options):helperMissing.call(depth0,"__","Create gap",options)))+"\" data-role=\"create-gap\">\n <span class=\"icon-magicwand\"></span>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/htmlEditorTrigger",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<div class=\"mini-tlb\" data-edit=\"",(helper=helpers.state)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.state,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-role=\"cke-launcher-tlb\"></div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/states/Question",["jquery","lodash","i18n","ui/feedback","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/helpers/content","taoQtiItem/qtiCreator/widgets/helpers/selectionWrapper","taoQtiItem/qtiCreator/model/choices/GapText","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/gapMatch","tpl!taoQtiItem/qtiCreator/tpl/toolbars/gap-create","tpl!taoQtiItem/qtiCreator/tpl/toolbars/htmlEditorTrigger"],function($,_,__,feedback,stateFactory,Question,htmlEditor,gridContentHelper,formElement,htmlContentHelper,selectionWrapper,Choice,formTpl,newGapTpl,toolbarTpl){'use strict';var GapMatchInteractionStateQuestion=stateFactory.extend(Question,function(){this.buildEditor(),this.syncCardinality(),this.preventSingleChoiceDeletion()},function(){this.destroyEditor(),this.widget.offEvents("question")});return GapMatchInteractionStateQuestion.prototype.buildEditor=function(){var self=this,_widget=this.widget,container=_widget.element.getBody(),$container=_widget.$container,$editableContainer=$container.find(".qti-flow-container"),$bodyTlb;$editableContainer.attr("data-html-editable-container",!0),htmlEditor.hasEditor($editableContainer)||($bodyTlb=$(toolbarTpl({serial:_widget.serial,state:"question"})),$editableContainer.append($bodyTlb),$bodyTlb.show(),self.initGapCreator(),$container.find(".gapmatch-content").html("..."),htmlEditor.buildEditor($editableContainer,{shieldInnerContent:!1,change:gridContentHelper.getChangeCallbackForBlockStatic(container),data:{container:container,widget:_widget}}),$container.find(".gapmatch-content").empty())},GapMatchInteractionStateQuestion.prototype.destroyEditor=function(){var $container=this.widget.$container,$flowContainer=$container.find(".qti-flow-container"),$editable=$container.find(".qti-flow-container [data-html-editable]");$container.find(".gapmatch-content").html("..."),htmlEditor.destroyEditor($flowContainer),$container.find(".gapmatch-content").empty(),$flowContainer.find(".mini-tlb[data-role=cke-launcher-tlb]").remove(),$editable.off("gapcreator")},GapMatchInteractionStateQuestion.prototype.initGapCreator=function(){var self=this,interactionWidget=this.widget,$editable=interactionWidget.$container.find(".qti-flow-container [data-html-editable]"),$flowContainer=interactionWidget.$container.find(".qti-flow-container"),$toolbar=$flowContainer.find(".mini-tlb[data-role=cke-launcher-tlb]"),$newGapBtn=$(newGapTpl()),$newGap=$("<span>",{class:"widget-box","data-new":!0,"data-qti-class":"gap"}),wrapper=selectionWrapper({$container:$editable,allowQtiElements:!1});$toolbar.append($newGapBtn),$newGapBtn.hide(),$editable.on("mouseup.gapcreator",function(){wrapper.canWrap()?$newGapBtn.show():$newGapBtn.hide()}).on("blur.gapcreator",function(){$newGapBtn.hide()}),$newGapBtn.on("mousedown.gapcreator",function(){$newGapBtn.hide(),wrapper.wrapWith($newGap)?(self.createChoiceFromSelection($newGap),self.replaceSelectionWithGap()):feedback().error(__("Cannot create gap from this selection. Please check that you do not have partially selected elements."))})},GapMatchInteractionStateQuestion.prototype.createChoiceFromSelection=function($newChoiceContent){var interactionWidget=this.widget,interaction=interactionWidget.element,$addChoiceBtn=interactionWidget.$container.find(".choice-area .add-option"),$nestedWidgets,nestedElts,newChoiceElt,newChoiceBody,newChoiceWidget,serial;for($nestedWidgets=$newChoiceContent.find("[class^=\"widget-\"],[class*=\" widget-\"]"),$nestedWidgets&&0<$nestedWidgets.length&&$nestedWidgets.each(function(){var eltSerial=$(this).data("serial"),elt=interaction.getElement(eltSerial),eltWidget=elt.data("widget");$(this).replaceWith(elt.placeholder()),eltWidget.destroy()}),newChoiceBody=$newChoiceContent.html(),newChoiceElt=interaction.createChoice(newChoiceBody);null!==(nestedElts=/{{(\w+?)}}/gm.exec(newChoiceBody));)serial=nestedElts[1],newChoiceElt.setElement(interaction.getElement(serial)),interaction.removeElement(serial);$addChoiceBtn.before(newChoiceElt.render()),newChoiceElt.postRender(),newChoiceWidget=newChoiceElt.data("widget"),newChoiceWidget.changeState("choice")},GapMatchInteractionStateQuestion.prototype.replaceSelectionWithGap=function(){var interactionWidget=this.widget,interaction=interactionWidget.element,$editable=interactionWidget.$container.find(".qti-flow-container [data-html-editable]"),newGapElt;htmlContentHelper.createElements(interaction.getBody(),$editable,htmlEditor.getData($editable),function(newGapWidget){newGapElt=newGapWidget.element,newGapElt.render(newGapElt.getContainer()),newGapElt.postRender(),interaction.setElement(newGapElt),newGapWidget.destroy(),newGapWidget=newGapElt.data("widget"),newGapWidget.changeState("choice")})},GapMatchInteractionStateQuestion.prototype.syncCardinality=function(){var interaction=this.widget.element,response=interaction.getResponseDeclaration(),updateCardinality=function(data){var choice=data.element||data.choice,cardinality;"gap"===choice.qtiClass&&(cardinality=1===_.size(interaction.getGaps())?"single":"multiple",response.attr("cardinality",cardinality))};this.widget.on("elementCreated",updateCardinality).on("deleted",updateCardinality)},GapMatchInteractionStateQuestion.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,interaction=_widget.element;$form.html(formTpl({shuffle:!!interaction.attr("shuffle")})),formElement.initWidget($form),formElement.setChangeCallbacks($form,interaction,{shuffle:formElement.getAttributeChangeCallback()})},GapMatchInteractionStateQuestion.prototype.preventSingleChoiceDeletion=function(){var interaction=this.widget.element,$container=this.widget.$container,_toggleDeleteButtonVisibility=function(){var choiceCount=0,$deleteButtons=$container.find(".choice-area .qti-choice [data-role=delete]");_.each(interaction.getChoices(),function(choice){choice.data("deleting")||choiceCount++}),1>=choiceCount?$deleteButtons.hide():$deleteButtons.show()};_toggleDeleteButtonVisibility(),this.widget.on("deleted",_toggleDeleteButtonVisibility).on("choiceCreated",_toggleDeleteButtonVisibility),this.widget.afterStateInit(function(e,element,state){"deleting"===state.name&&element.is("gapText")&&_toggleDeleteButtonVisibility()},"question"),this.widget.afterStateExit(function(e,element,state){"deleting"===state.name&&element.is("gapText")&&_toggleDeleteButtonVisibility()},"question")},GapMatchInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/states/Correct",["lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCommonRenderer/renderers/interactions/GapMatchInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse"],function(_,__,stateFactory,Correct,commonRenderer,instructionMgr,PciResponse){var GapMatchInteractionStateCorrect=stateFactory.create(Correct,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration(),corrects=_.values(response.getCorrect()),bodyLength=0,numberOfGaps=0,instruction;interaction&&interaction.bdy&&interaction.bdy.bdy&&(bodyLength=interaction.bdy.bdy.length),interaction&&interaction.bdy&&interaction.bdy.elements&&(numberOfGaps=Object.keys(interaction.bdy.elements).length),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instruction=0===bodyLength?__("This interaction has no text defined in question mode."):0===numberOfGaps?__("Please add one or more gaps to the text in question mode."):__("Please fill the gap with the correct choices."),instructionMgr.appendInstruction(interaction,instruction),commonRenderer.render.call(interaction.getRenderer(),interaction),commonRenderer.setResponse(interaction,PciResponse.serialize(_.invoke(corrects,String.prototype.split," "),interaction)),widget.$container.on("responseChange.qti-widget",function(e,data){var type="single"===response.attr("cardinality")?"base":"list";data.response&&data.response[type]?"base"===type?response.setCorrect(data.response.base.directedPair.join(" ")):response.setCorrect(_.map(data.response.list.directedPair,function(pair){return pair.join(" ")})):response.setCorrect([])})},function(){var widget=this.widget,interaction=this.widget.element;widget.$container.off("responseChange.qti-widget"),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction)});return GapMatchInteractionStateCorrect}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/response/pairScoreMappingForm",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n <option value=\"",(helper=helpers.id)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.id,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</option> \n ",buffer}function program5(depth0){var buffer="",stack1;return buffer+="\n ",stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,self=this,stack1,helper,options;return buffer+="<div class=\"form-container\">\n <h1>",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</h1>\n\n <hr />\n <div class=\"panel grid-row\">\n <h2>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Add new pairs",options):helperMissing.call(depth0,"__","Add new pairs",options)))+":</h2>\n </div> \n <div class=\"panel grid-row\">\n <div class=\"col-4\">\n <select class=\"select2 new-pair-left\" data-placeholder=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select a ",options):helperMissing.call(depth0,"__","Select a ",options))),(helper=helpers.leftTitle)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.leftTitle,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <option></option>\n ",stack1=helpers.each.call(depth0,depth0&&depth0.pairLeft,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n </div>\n <div class=\"col-4\">\n <select class=\"select2 new-pair-right\" data-placeholder=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select a ",options):helperMissing.call(depth0,"__","Select a ",options))),(helper=helpers.rightTitle)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.rightTitle,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <option></option>\n ",stack1=helpers.each.call(depth0,depth0&&depth0.pairRight,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n </div>\n <div class=\"col-1\">\n &nbsp;\n </div>\n <div class=\"col-2\">\n <button class=\"pair-adder btn-info small\"><span class=\"icon-add\"></span>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Add",options):helperMissing.call(depth0,"__","Add",options)))+"</button>\n </div> \n </div>\n <hr />\n <div class=\"panel grid-row heading\">\n <div class=\"col-4\">",(helper=helpers.leftTitle)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.leftTitle,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</div>\n <div class=\"col-3\">",(helper=helpers.rightTitle)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.rightTitle,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</div>\n \n <div class=\"col-2\" data-edit=\"correct\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.defineCorrect,{hash:{},inverse:self.noop,fn:self.program(3,function(){return"style=\"display:block\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <span>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Correct",options):helperMissing.call(depth0,"__","Correct",options)))+"</span>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Is this pair the correct response?",options):helperMissing.call(depth0,"__","Is this pair the correct response?",options)))+"</span>\n </div>\n\n <div class=\"col-2\">\n <span>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Score",options):helperMissing.call(depth0,"__","Score",options)))+"</span>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Set the score for this response",options):helperMissing.call(depth0,"__","Set the score for this response",options)))+"</span>\n </div>\n <div class=\"col-1\"></div>\n </div>\n\n <div class=\"panel pairs\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.pairs,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </div>\n\n <hr />\n\n <span class=\"arrow\"></span>\n <span class=\"arrow-cover\"></span>\n </div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/response/pairScoreForm",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",self=this,escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"grid-row\">\n <div class=\"col-4\">\n ",(helper=helpers.left)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.left,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </div>\n <div class=\"col-3\">\n ",(helper=helpers.right)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.right,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </div>\n \n <div class=\"col-2\" data-edit=\"correct\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.defineCorrect,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"style=\"display:block\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <label>\n <input name=\"",(helper=helpers.id)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.id,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"-correct\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.correct,{hash:{},inverse:self.noop,fn:self.program(3,function(){return" checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\n <span class=\"icon-checkbox\"></span>\n </label>\n </div>\n\n <div class=\"col-2\">\n <input type=\"text\" \n value=\"",(helper=helpers.score)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.score,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n name=\"",(helper=helpers.id)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.id,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"-score\" \n class=\"score\" \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.defaultScore,{hash:{},inverse:self.noop,fn:self.program(5,function(){return"data-default=\"true\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" \n data-validate=\"$numeric\" \n data-validate-option=\"$allowEmpty; $event(type=keyup)\" \n />\n </div>\n <div class=\"col-1\">\n <a href=\"#\" class=\"pair-deleter\" id=\"",(helper=helpers.id)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.id,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"-delete\" title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove pair",options):helperMissing.call(depth0,"__","Remove pair",options)))+"\"><span class=\"icon-bin\"></span></a>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/pairScoringForm",["jquery","lodash","i18n","tpl!taoQtiItem/qtiCreator/tpl/forms/response/pairScoreMappingForm","tpl!taoQtiItem/qtiCreator/tpl/forms/response/pairScoreForm","taoQtiItem/qtiCreator/widgets/interactions/helpers/answerState","taoQtiItem/qtiCreator/widgets/helpers/formElement","ui/tooltip","ui/selecter"],function($,_,__,formTpl,pairTpl,answerStateHelper,formElementHelper,tooltip,selecter){'use strict';function createPopup($container){var $element=$("<div class=\"mapping-editor arrow-top-left\"></div>"),width=$container.innerWidth(),height=$container.innerHeight();return $(".mapping-editor",$container).remove(),$element.css({top:height-30,width:width-100}).appendTo($container),$element}var separator={html:"::",qti:" "};return function(widget,options){function adder($container){var $adder=$(".pair-adder",$container),$left=$(".new-pair-left",$container),$right=$(".new-pair-right",$container),$options=$(".select2 > option",$container);$left.on("change",function(){var currentLeft=$left.select2("val"),currentRight=$right.select2("val");$options.removeProp("disabled"),_(pairs).where({leftId:currentLeft}).forEach(function(pair){$right.find("option[value=\""+pair.rightId+"\"]").prop("disabled",!0)}),_(pairs).where({rightId:currentRight}).forEach(function(pair){$left.find("option[value=\""+pair.leftId+"\"]").prop("disabled",!0)}),"pair"===options.type&&_(pairs).where({rightId:currentLeft}).forEach(function(pair){$right.find("option[value=\""+pair.leftId+"\"]").prop("disabled",!0)})}),$right.on("change",function(){var currentRight=$right.select2("val"),currentLeft=$left.select2("val");$options.removeProp("disabled"),_(pairs).where({rightId:currentRight}).forEach(function(pair){$left.find("option[value=\""+pair.leftId+"\"]").prop("disabled",!0)}),_(pairs).where({leftId:currentLeft}).forEach(function(pair){$right.find("option[value=\""+pair.rightId+"\"]").prop("disabled",!0)}),"pair"===options.type&&_(pairs).where({leftId:currentRight}).forEach(function(pair){$left.find("option[value=\""+pair.rightId+"\"]").prop("disabled",!0)})}),$adder.on("click",function(e){var lval=$left.select2("val"),rval=$right.select2("val"),key;$options.removeProp("disabled"),e.preventDefault(),lval&&rval&&(key=options.isDirectedPairFlipped?rval+separator.qti+lval:lval+separator.qti+rval,pairScoringForm.addPair(key),$left.select2("val",""),$right.select2("val",""))})}function deleter($container){$container.off("click",".pair-deleter").on("click",".pair-deleter",function(e){var $elt,key;e.preventDefault(),$elt=$(this),key=$elt.attr("id").replace(/-delete$/,"").replace(separator.html,separator.qti),pairScoringForm.removePair(key),$elt.closest(".grid-row").remove()})}function preparePairs(entries){var defaultScore=parseFloat(response.mappingAttributes.defaultValue);return _.map(entries,function(value,key){return formatPair(value,key,parseFloat(value)===defaultScore)})}function formatPair(score,key,defaultScore){var pair=key.split(separator.qti),choice=options.isDirectedPairFlipped?pair[0]:pair[1],gap=options.isDirectedPairFlipped?pair[1]:pair[0];return{id:key.replace(separator.qti,separator.html),score:score,defaultScore:!!defaultScore,leftId:gap,rightId:choice,left:_.isFunction(options.formatLeft)?options.formatLeft(gap):gap,right:_.isFunction(options.formatRight)?options.formatRight(choice):choice,defineCorrect:answerStateHelper.defineCorrect(response),correct:_.contains(_.values(response.getCorrect()),key)}}function updateFormBindings(){var callbacks={},corrects=_.values(response.getCorrect());$form.length&&(widget.on("mappingAttributeChange",function(data){"defaultValue"===data.key&&_.forEach(pairs,function(pair){var $score=$("[name=\""+pair.id+"-score\"]",$form);$score.data("default")&&($score.val(data.value),response.setMapEntry(pair.id.replace(separator.html,separator.qti),data.value))})}),_.forEach(pairs,function(pair){var id=pair.id.replace(separator.html,separator.qti);callbacks[pair.id+"-score"]=function(response,value){$("[name=\""+pair.id+"-score\"]",$form).removeAttr("data-default").removeData("default"),response.setMapEntry(id,value)},callbacks[pair.id+"-correct"]=function(response,value){!0===value?!_.contains(corrects,id)&&corrects.push(id):corrects=_.without(corrects,id),response.setCorrect(corrects)}}),formElementHelper.setChangeCallbacks($form,response,callbacks))}var $container=widget.$container,interaction=widget.element,response=interaction.getResponseDeclaration(),$popup=[],pairs=[],pairScoringForm={load:function(){var mapEntries=response.getMapEntries();return $popup.length?$popup.empty():$popup=createPopup($container),options&&(options.entries?(pairs=preparePairs(options.entries),response.removeMapEntries(),_.forEach(pairs,function(pair){("undefined"==typeof pair.score||null===pair.score)&&(pair.score=response.mappingAttributes.defaultValue||0),response.setMapEntry(pair.id.replace(separator.html,separator.qti),pair.score)})):pairs=preparePairs(mapEntries),$form=$(formTpl({title:options.title||__("Pair scoring"),leftTitle:options.leftTitle||__("Choices"),rightTitle:options.rightTitle||__("Gap"),defineCorrect:answerStateHelper.defineCorrect(response),scoreMin:response.getMappingAttribute("lowerBound"),scoreMax:response.getMappingAttribute("upperBound"),pairs:_.map(pairs,pairTpl),pairLeft:_.isFunction(options.pairLeft)?options.pairLeft():_.values(interaction.getChoices()),pairRight:_.isFunction(options.pairRight)?options.pairRight():_.values(interaction.getGapImgs())})),updateFormBindings(),$popup.append($form),selecter($popup),tooltip.lookup($popup),deleter($popup),adder($popup)),this},addPair:function(key){var score=response.mappingAttributes.defaultValue,pair=formatPair(score,key,!0);return pairs.push(pair),response.setMapEntry(key,score),$(".pairs",$popup).append(pairTpl(pair)),updateFormBindings(),_.isFunction(options.add)&&options.add(key),this},removePair:function(key){return _.remove(pairs,{id:key.replace(separator.qti,separator.html)}),response.removeMapEntry(key),_.isFunction(options.remove)&&options.remove(key),this},destroy:function destroy(){$popup.length&&$popup.remove(),$("#item-editor-panel").css("overflow","")}},$form;return pairScoringForm.load()}}),define("taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/states/Map",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCommonRenderer/renderers/interactions/GapMatchInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCreator/widgets/interactions/helpers/pairScoringForm"],function($,_,__,stateFactory,Map,commonRenderer,instructionMgr,PciResponse,scoringFormFactory){function displayGaps($container){$(".gapmatch-content",$container).removeClass("filled").addClass("gap-info").each(function(){var $elt=$(this);$elt.text($elt.data("identifier"))})}function updateForm(widget,entries){var interaction=widget.element,response=interaction.getResponseDeclaration(),mapEntries=response.getMapEntries(),formatedChoices=_.transform(interaction.getChoices(),function(acc,choice){acc[choice.id()]=choice.id()},{}),options={leftTitle:__("Choice"),rightTitle:__("Gap"),type:"directedPair",pairLeft:function pairLeft(){return _.map(interaction.getChoices(),function(choice){return{id:choice.id(),value:choice.id()}})},pairRight:function pairRight(){return _.map(interaction.getGaps(),function(gap){return{id:gap.id(),value:gap.id()}})},formatLeft:function formatLeft(value){return formatedChoices[value]||value}};entries&&(options.entries=_.transform(entries,function(result,value){result[value]=mapEntries[value]===void 0?response.mappingAttributes.defaultValue:mapEntries[value]},{})),interaction.pairScoringForm=scoringFormFactory(widget,options)}return stateFactory.create(Map,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration(),corrects=_.values(response.getCorrect()),currentResponses=0===_.size(response.getMapEntries())?corrects:_.keys(response.getMapEntries());commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.appendInstruction(interaction,__("Please fill the gap with the texts below, then edit the score for each pair.")),interaction.responseMappingMode=!0,commonRenderer.render.call(interaction.getRenderer(),interaction),displayGaps(widget.$container),0===_.size(response.getMapEntries())?updateForm(widget,corrects):updateForm(widget),widget.$container.on("responseChange.qti-widget",function(e,data){var type="single"===response.attr("cardinality")?"base":"list",pairs,entries;data&&data.response&&data.response[type]&&(pairs=_.invoke(data.response[type].directedPair,Array.prototype.join," "),entries=_.keys(response.getMapEntries()),_(pairs).difference(entries).forEach(interaction.pairScoringForm.addPair,interaction.pairScoringForm)),displayGaps(widget.$container)})},function(){var widget=this.widget,interaction=widget.element;widget.$container.off("responseChange.qti-widget"),interaction.pairScoringForm&&interaction.pairScoringForm.destroy(),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction)})}),define("taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/states/Map"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/states/states"],function(Widget,states){var GapMatchInteractionWidget=Widget.clone();return GapMatchInteractionWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this)},GapMatchInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/GapMatchInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/GapMatchInteraction","taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/Widget"],function(_,GapMatchInteraction,GapMatchInteractionWidget){'use strict';var CreatorGapMatchInteraction=_.clone(GapMatchInteraction);return CreatorGapMatchInteraction.render=function(interaction,options){GapMatchInteractionWidget.build(interaction,GapMatchInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorGapMatchInteraction}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicInteraction/Widget",["jquery","lodash","i18n","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCreator/helper/dummyElement"],function($,_,__,graphic,dummyElement){'use strict';return{createPaper:function createPaper(_resize){var $container=this.$original,$item=$container.parents(".qti-item"),background=this.element.object.attributes,serial=this.element.serial,paper;return background.data?(paper=graphic.responsivePaper("graphic-paper-"+serial,serial,{width:background.width,height:background.height,img:this.options.assetManager.resolve(background.data),imgId:"bg-image-"+serial,container:$container,resize:function resize(){"function"==typeof _resize&&_resize.apply(this,arguments)}}),$item.on("resize.gridEdit."+serial,function(){$container.trigger("resize.qti-widget."+serial)})):this._createPlaceholder(),paper},_createPlaceholder:function _createPlaceholder(){var self=this,$container=this.$original,$imageBox=$container.find(".main-image-box"),$editor=$container.find(".image-editor"),diff=$editor.outerWidth()-$editor.width()+($container.outerWidth()-$container.width())+1;dummyElement.get({icon:"image",css:{width:$container.innerWidth()-diff,height:200},title:__("Select an image first.")}).click(function(){var $upload=$("[data-role=\"upload-trigger\"]",self.$form);$upload.length&&$upload.trigger("click")}).appendTo($imageBox)},createChoices:function createChoices(){_.forEach(this.element.getChoices(),this._currentChoices,this)},_currentChoices:function _currentChoices(choice){graphic.createElement(this.element.paper,choice.attr("shape"),choice.attr("coords"),{id:choice.serial,touchEffect:!1})}}}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Sleep"],function(stateFactory,SleepState){'use strict';return stateFactory.extend(SleepState,function(){var widget=this.widget,interaction=widget.element;widget.on("metaChange",function(data){"responsive"===data.key&&(!0===data.value?interaction.addClass("responsive"):interaction.removeClass("responsive"),widget.rebuild())})},function(){$(".image-editor.solid, .block-listing.source",this.widget.$container).css("min-width",0)})}),define("tpl!taoQtiItem/qtiCreator/tpl/graphicInteraction/sidebar",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",helper,options;return buffer+="\n <li class=\"separator\"></li>\n <li data-type=\"target\"><span title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Drop the target to select a point",options):helperMissing.call(depth0,"__","Drop the target to select a point",options)))+"\" class=\"icon-target\"></span></li>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper,options;return buffer+="<div class=\"image-sidebar\">\n <ul class=\"none forms\">\n <li data-type=\"rect\"><span title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Draw a rectangle on the image",options):helperMissing.call(depth0,"__","Draw a rectangle on the image",options)))+"\" class=\"icon-rectangle\"></span></li>\n <li data-type=\"circle\"><span title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Draw a circle on the image",options):helperMissing.call(depth0,"__","Draw a circle on the image",options)))+"\" class=\"icon-circle\"></span></li>\n <li data-type=\"ellipse\"><span title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Draw an ellipsis on the image",options):helperMissing.call(depth0,"__","Draw an ellipsis on the image",options)))+"\" class=\"icon-ellipsis\"></span></li>\n <li data-type=\"path\"><span title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Draw a free form on the image",options):helperMissing.call(depth0,"__","Draw a free form on the image",options)))+"\" class=\"icon-free-form\"></span></li>\n \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.showTarget,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\n <li class=\"separator\"></li>\n <li class=\"bin disabled\"><span title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Remove the selected shape",options):helperMissing.call(depth0,"__","Remove the selected shape",options)))+"\" class=\"icon-bin\"></span></li>\n </ul>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeSideBar",["jquery","lodash","tpl!taoQtiItem/qtiCreator/tpl/graphicInteraction/sidebar"],function($,_,sidebarTmpl){'use strict';return{create:function($container,showTarget){var $imageEditor=$container.find(".image-editor"),serial=$container.data("serial"),$sideBar=$(sidebarTmpl({showTarget:!!showTarget}));$imageEditor.prepend($sideBar);var $forms=$("li[data-type]",$sideBar),$bin=$("li.bin",$sideBar),activate=function($form){$forms.filter(".active").each(function(){deactivate($(this))}),$form.addClass("active"),$sideBar.trigger("shapeactive.qti-widget",[$form,$form.data("type")])},deactivate=function($form){$form.removeClass("active"),$sideBar.trigger("shapedeactive.qti-widget",[$form,$form.data("type")])};return $sideBar.on("enablebin.qti-widget",function(){$bin.removeClass("disabled").on("click",function(e){e.preventDefault(),$sideBar.trigger("bin.qti-widget")})}),$sideBar.on("disablebin.qti-widget",function(){$bin.addClass("disabled").off("click")}),$forms.click(function(e){e.preventDefault();var $form=$(this);$form.hasClass("active")?deactivate($form):activate($form)}),$sideBar},remove:function($container){var $sideBar=$(".image-sidebar",$container);$sideBar.length&&($sideBar.remove(),$container.off("resize.qti-widget.sidebar"))}}}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeHandlers",["jquery","lodash","raphael"],function($,_,Raphael){return function shapeHandlers(paper,element){return _.map(function(element){var scaleFactor=paper.w<paper.width?1:paper.w/paper.width,bbox=element.getBBox(),size=(25<bbox.width?6:4)*scaleFactor,half=size/2,halfWidth=bbox.width/2,halfHeight=bbox.height/2,coords;switch(element.type){case"circle":coords={midTop:[bbox.x+halfWidth-half,bbox.y-size,size,size],midRight:[bbox.x+bbox.width,bbox.y+halfHeight-half,size,size],midBot:[bbox.x+halfWidth-half,bbox.y+bbox.height,size,size],midLeft:[bbox.x-size,bbox.y+halfHeight-half,size,size]};break;case"path":coords={},_.forEach(Raphael.parsePathString(element.attr("path")),function(segment,index){3===segment.length&&(coords["point"+index]=segment.slice(1).concat(half))});break;case"rect":case"ellipse":coords={topLeft:[bbox.x-size,bbox.y-size,size,size],midTop:[bbox.x+halfWidth-half,bbox.y-size,size,size],topRight:[bbox.x+bbox.width,bbox.y-size,size,size],midRight:[bbox.x+bbox.width,bbox.y+halfHeight-half,size,size],botRight:[bbox.x+bbox.width,bbox.y+bbox.height,size,size],midBot:[bbox.x+halfWidth-half,bbox.y+bbox.height,size,size],botLeft:[bbox.x-size,bbox.y+bbox.height,size,size],midLeft:[bbox.x-size,bbox.y+halfHeight-half,size,size]};}return coords}(element),function(handlerCoords,name){var cursor,constraints,hshape;return"path"===element.type?(cursor="move",hshape="circle"):(hshape="rect","topLeft"===name?(cursor="nw-resize",constraints={ix:!0,iy:!0}):"midTop"===name?(cursor="ns-resize",constraints={iy:!0}):"topRight"===name?(cursor="ne-resize",constraints={x:!0,iy:!0}):"midRight"===name?(cursor="ew-resize",constraints={x:!0}):"botRight"===name?cursor="se-resize":"midBot"===name?(cursor="ns-resize",constraints={y:!0}):"botLeft"===name?(cursor="sw-resize",constraints={ix:!0,y:!0}):"midLeft"===name?(cursor="ew-resize",constraints={ix:!0}):void 0),paper[hshape].apply(paper,handlerCoords).attr({fill:"#eeeeee",cursor:cursor}).data("constraints",constraints)})}}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeResizer",["jquery","lodash","taoQtiItem/qtiCommonRenderer/helpers/Graphic"],function($,_){var _Mathpow=Math.pow,shapeResizer={rect:function(options){var start=options.start,stop=options.stop,constraints=options.constraints,dest={};return(!constraints||constraints.x)&&(dest.width=stop.x-start.x,0>dest.width&&(dest.x=stop.x,dest.width*=-1)),(!constraints||constraints.y)&&(dest.height=stop.y-start.y,0>dest.height&&(dest.y=stop.y,dest.height*=-1)),constraints&&constraints.ix&&(dest.x=stop.x,dest.width=start.width-(stop.x-start.x),0>dest.width&&(dest.x=stop.x,dest.width*=-1)),constraints&&constraints.iy&&(dest.y=stop.y,dest.height=start.height-(stop.y-start.y),0>dest.height&&(dest.y=stop.y,dest.height*=-1)),10>dest.width&&(dest.width=10),10>dest.height&&(dest.height=10),dest},circle:function(options){var start=options.start,stop=options.stop,rw=stop.x>start.x?stop.x-start.x:start.x-stop.x,rh=stop.y>start.y?stop.y-start.y:start.y-stop.y,r=Math.floor(Math.sqrt(_Mathpow(rw,2)+_Mathpow(rh,2)));return{r:5>r?5:r}},ellipse:function(options){var dest={},boxDest=this.rect(options);return boxDest.x&&(dest.x=boxDest.x),boxDest.y&&(dest.y=boxDest.y),boxDest.width&&(dest.rx=boxDest.width/2),boxDest.height&&(dest.ry=boxDest.height/2),dest},path:function(options){var dest={};return options.path&&options.start&&(dest.path="",_.forEach(options.path,function(point,index){dest.path+=point[0],3===point.length&&(index===options.pointIndex||0===options.pointIndex&&1===index?dest.path+=options.stop.x+" "+options.stop.y:dest.path+=point[1]+" "+point[2])})),dest}};return function(element,options){var resizer;element&&element.type&&options.stop&&(resizer=_.bind(shapeResizer[element.type],shapeResizer),!options.start&&(options.start=function(){var startPoint;switch(element.type){case"circle":startPoint={x:element.attrs.cx,y:element.attrs.cy};break;case"ellipse":case"rect":startPoint=element.getBBox();}return startPoint}(element)),_.isFunction(resizer)&&(element.attr(resizer(options)),_.isFunction(options.resized)&&options.resized.call(element)))}}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeMover",["jquery","lodash"],function($,_){var _Mathmax4=Math.max,_Mathmin3=Math.min,shapeMover={rect:function(start,stop,element){var max={x:element.paper.w-element.attrs.width,y:element.paper.h-element.attrs.height},x=_Mathmin3(stop.x-start.x,max.x),y=_Mathmin3(stop.y-start.y,max.y);return{x:_Mathmax4(x,0),y:_Mathmax4(y,0)}},circle:function(start,stop,element){var max={x:element.paper.w,y:element.paper.h},x=_Mathmin3(stop.x,max.x),y=_Mathmin3(stop.y,max.y);return{cx:_Mathmax4(x,0),cy:_Mathmax4(y,0)}},ellipse:function(start,stop,element){var max={x:element.paper.w,y:element.paper.h},x=_Mathmin3(stop.x,max.x),y=_Mathmin3(stop.y,max.y);return{cx:_Mathmax4(x,0),cy:_Mathmax4(y,0)}},path:function(start,stop,element){var x=stop.x-start.x,y=stop.y-start.y,clientShift=_.reduce(start.path,function(result,point){if(3!==point.length)return result;var pointX=point[1]+x,pointY=point[2]+y;return{minX:_Mathmin3(result.minX,pointX),maxX:_Mathmin3(result.maxX,element.paper.w-pointX),minY:_Mathmin3(result.minY,pointY),maxY:_Mathmin3(result.maxY,element.paper.h-pointY)}},{minX:0,minY:0,maxX:0,maxY:0}),path=_.reduce(start.path,function(result,point){var item=point[0];if(3!==point.length)return result+item;var pointX=point[1]+x-clientShift.minX+clientShift.maxX,pointY=point[2]+y-clientShift.minY+clientShift.maxY;return item+=pointX+","+pointY,result+item},"");return{path:path}}};return function(element,start,stop){var mover;element&&element.type&&(mover=_.bind(shapeMover[element.type],shapeMover),_.isFunction(mover)&&element.animate(mover(start,stop,element)))}}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/pathBuilder",["jquery","lodash","taoQtiItem/qtiCommonRenderer/helpers/Graphic"],function($,_,graphicHelper){return function pathBuilder(paper){return{_path:null,closed:!1,set:null,points:[],getPath:function getPath(){return this._path},start:function start(point){return this.points=[],this.add(point)},add:function add(point){var self=this,scaleFactor=paper.w<paper.width?1:paper.w/paper.width,stop;return stop=paper.circle(point.x,point.y,3*scaleFactor).attr({stroke:"black","stroke-width":1,fill:"white",opacity:.7,cursor:"pointer"}).click(function(e){e.preventDefault(),e.stopPropagation(),2<self.points.length&&(this.attr("fill","green"),self.close())}),0===this.points.length&&(stop.attr("fill","red"),this.set=paper.set(),this._path=paper.path("M"+point.x+","+point.y).attr(graphicHelper._style.active).attr("opacity",.3),this.set.push(this._path)),this.points.push(point),this.set.push(stop),this._path.animate({path:this._path.attr("path")+"L"+point.x+","+point.y}),this},close:function close(){return this._path.attr({path:this._path.attr("path")+"Z"}).attr(graphicHelper._style.active).attr("opacity",1),this.set.forEach(function(elt){"circle"===elt.type&&elt.remove()}),this.closed=!0,_.isFunction(this.closeCb)&&this.closeCb(),this},onClose:function onClose(closeCb){return this.closeCb=closeCb,this}}}}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeFactory",["jquery","lodash","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeHandlers","taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeResizer","taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeMover","taoQtiItem/qtiCreator/widgets/interactions/helpers/pathBuilder"],function($,_,graphicHelper,shapeHandlers,shapeResizer,shapeMover,pathBuilder){return function(options){var paper=options.paper,background=options.background,$container=options.$container,isResponsive=options.isResponsive||!1,type=options.type||"rect";return{states:{drawing:!1},_events:{},on:function(eventName,cb){_.isFunction(cb)&&(this._events[eventName]=cb)},is:function(state){return!0===this.states[state]},setState:function(state,value){this.states[state]=value},start:function start(){switch(type){case"path":this.startDrawingPath();break;case"target":this.startPositionTarget();break;default:this.startWithMouse();}},startPositionTarget:function(){var self=this;self.setState("drawing",!0),background.click(function(e){e.preventDefault(),e.stopPropagation();var point=graphicHelper.getPoint(e,paper,$container,isResponsive);graphicHelper.createTarget(paper,{point:point,create:function(target){self.setState("drawing",!1),background.unclick(),self._events["created.qti-widget"]&&self._events["created.qti-widget"].call(this,target)},remove:!1,hover:!1})})},startDrawingPath:function(){var self=this,builder=pathBuilder(paper);self.setState("drawing",!0),builder.onClose(function(){self.setState("drawing",!1),background.unclick(),self._events["created.qti-widget"]&&self._events["created.qti-widget"].call(this,builder.getPath())}),background.click(function(e){e.preventDefault(),e.stopPropagation(),self.is("drawing")&&builder.add(graphicHelper.getPoint(e,paper,$container,isResponsive))})},startWithMouse:function(){function created(){self.setState("drawing",!1),background.unmousedown().unmousemove().unmouseup(),shape.unmousedown().unmouseup().unmousemove(),self._events["created.qti-widget"]&&self._events["created.qti-widget"].call(this,shape)}function resize(event){self.is("drawing")&&shapeResizer(shape,{start:startPoint,stop:graphicHelper.getPoint(event,paper,$container,isResponsive)})}var self=this,smoothResize=_.throttle(resize,10),startPoint,shape;background.mousedown(function(event){event.preventDefault(),self.is("drawing")||(self.setState("drawing",!0),startPoint=graphicHelper.getPoint(event,paper,$container,isResponsive),shape=graphicHelper.createElement(paper,type,[startPoint.x,startPoint.y,25,25],{style:"creator",hover:!1,touchEffect:!1,qtiCoords:!1}),shape.mouseup(created),background.mouseup(created),shape.mousemove(smoothResize),background.mousemove(smoothResize))})},stop:function stop(){background.unmousedown().unmousemove().unmouseup().unclick()}}}}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeEditor",["jquery","lodash","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeHandlers","taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeResizer","taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeMover","taoQtiItem/qtiCreator/widgets/interactions/helpers/pathBuilder"],function($,_,graphicHelper,shapeHandlers,shapeResizer,shapeMover){return function shapeEditor(shape,options){var paper=options.paper,background=options.background,$container=options.$container,isResponsive=options.isResponsive||!1;return{shape:null,handlers:[],states:{drawing:!1,handling:!1,resizing:!1,moving:!1},_events:{},on:function(eventName,cb){return _.isFunction(cb)&&(this._events[eventName]=cb),this},trigger:function trigger(eventName){return _.isFunction(this._events[eventName])&&this._events[eventName].apply(this,Array.prototype.slice.call(arguments,1)),this},is:function(state){return!0===this.states[state]},setState:function(state,value){return this.states[state]=value,this},_init:function _init(shape){var self=this;return shape&&shape.type&&(self.shape=shape,background.click(function(){!self.is("resizing")&&self.is("handling")&&self.quitHandling()}),self.shape.click(function(){self.is("resizing")||(self.is("handling")?self.quitHandling():self.enterHandling())})),this},enterHandling:function(){function startResize(){var handler=this,bbox;self.setState("resizing",!0).trigger("shapechanging.qti-widget"),self.layer=self.shape.clone(),self.layer.attr(graphicHelper._style.basic),self.layer.attr("cursor",handler.attrs.cursor),bbox=self.layer.getBBox(),self.layerTxt=graphicHelper.createShapeText(paper,self.layer,{style:"layer-pos-text",content:parseInt(bbox.width,10)+" x "+parseInt(bbox.height,10)}),"path"===self.shape.type&&_.forEach(self.shape.attr("path"),function(point,index){if(3===point.length&&point[1]===this.attr("cx")&&point[2]===this.attr("cy"))return this.pointIndex=index,!1},handler),_.invoke(_.reject(_.clone(self.handlers),function(elt){return elt===handler}),"hide")}function resize(dx,dy,x,y,event){var stopPoint,options;self.is("resizing")&&(stopPoint=graphicHelper.getPoint(event,paper,$container,isResponsive),options={stop:stopPoint,constraints:this.data("constraints"),resized:_.throttle(function(){var bbox=this.getBBox();self.layerTxt.attr("text",parseInt(bbox.width,10)+" x "+parseInt(bbox.height,10))},100)},"path"===self.shape.type&&(options.start=_.pick(this.attrs,["cx","cy"]),options.path=self.layer.attr("path"),options.pointIndex=this.pointIndex),shapeResizer(self.layer,options),"circle"===this.type?this.animate({cx:stopPoint.x,cy:stopPoint.y}):this.animate(stopPoint))}function resized(){self.shape.animate(_.pick(self.layer.attrs,["x","y","cx","cy","r","rx","ry","width","height","path"]),200,function(){self.setState("resizing",!1).trigger("shapechange.qti-widget")}),self.layer.remove(),self.layerTxt.remove(),_.invoke(self.handlers,"remove"),self.handlers=[]}function keyResize(code){var attr,stop,start;if(!self.is("moving")){switch(self.setState("moving",!0).trigger("shapechanging.qti-widget"),self.shape.attr("cursor","move"),background.attr("cursor","move"),_.invoke(self.handlers,"remove"),attr=shape.attr(),self.shape.type){case"rect":start={x:0,y:0},stop={x:39===code?attr.x+1:37===code?attr.x-1:attr.x,y:40===code?attr.y+1:38===code?attr.y-1:attr.y};break;case"ellipse":case"circle":start={x:0,y:0},stop={x:39===code?attr.cx+1:37===code?attr.cx-1:attr.cx,y:40===code?attr.cy+1:38===code?attr.cy-1:attr.cy};break;case"path":start={path:attr.path},stop={};}shapeMover(self.shape,start,stop),self.shape.attr("cursor","pointer"),background.attr("cursor","default"),self.setState("moving",!1).trigger("shapechange.qti-widget")}}function startMove(x,y,event){self.setState("moving",!0).trigger("shapechanging.qti-widget");var mousePoint=graphicHelper.getPoint(event,paper,$container,isResponsive);this.startPoint={x:mousePoint.x-this.attr("x"),y:mousePoint.y-this.attr("y")},"path"===this.type&&(this.startPoint.path=this.attr("path")),self.shape.attr("cursor","move"),background.attr("cursor","move"),_.invoke(self.handlers,"remove")}function move(dx,dy,x,y,event){self.is("moving")&&shapeMover(this,this.startPoint,graphicHelper.getPoint(event,paper,$container,isResponsive))}function moved(){delete this.startPoint,self.shape.attr("cursor","pointer"),background.attr("cursor","default"),self.setState("moving",!1).trigger("shapechange.qti-widget")}var self=this;if(self.setState("handling",!0).trigger("enterhandling.qti-widget"),"set"!==self.shape.type){self.handlers=shapeHandlers(paper,self.shape),_.forEach(self.handlers,function(handler){handler.drag(resize,startResize,resized)}),self.shape.drag(move,startMove,moved);var keyResizer=_.throttle(keyResize,20);return $(document).on("keydown.qti-widget",function(e){var code=e.which;37<=code&&40>=code&&(e.preventDefault(),keyResizer(code))}),this}},quitHandling:function(){return $(document).off("keydown.qti-widget"),this.shape.undrag(),_.invoke(this.handlers,"remove"),this.handlers=[],this.setState("moving",!1).setState("resizing",!1).setState("handling",!1).trigger("quithandling.qti-widget"),this},removeShape:function(){var id,data;return this.shape&&(this.quitHandling(),id=this.shape.id,data=this.shape.data,this.shape.remove(),this.trigger("remove.qti-widget",id,data)),this},destroy:function(){return this.is("handling")&&this.quitHandling(),this.shape&&(this.shape.unclick(),background.unclick()),this.shape=null,this.handlers=[],this._events={},this}}._init(shape)}}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/graphicInteractionShapeEditor",["jquery","lodash","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeSideBar","taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeFactory","taoQtiItem/qtiCreator/widgets/interactions/helpers/shapeEditor"],function($,_,GraphicHelper,shapeSideBar,shapeFactory,shapeEditor){return function(widget,options){return{editors:[],create:function create(){function editShape(shape,enterHandling){var editor=shapeEditor(shape,shapeOptions);editor.on("enterhandling.qti-widget",function(){_.invoke(_.reject(editors,editor),"quitHandling"),$sideBar.trigger("enablebin.qti-widget").on("bin.qti-widget",function(){editor.removeShape(),editor.destroy(),editors=_.reject(editors,editor),editor=void 0}),_.isFunction(options.enterHandling)&&options.enterHandling(shape)}).on("shapechanging.qti-widget",function(){_.isFunction(options.shapeChanging)&&options.shapeChanging(shape)}).on("shapechange.qti-widget",function(){_.isFunction(options.shapeChange)&&options.shapeChange(shape)}).on("quithandling.qti-widget",function(){_.isFunction(options.quitHandling)&&options.quitHandling(shape),$sideBar.trigger("disablebin.qti-widget").off("click").off("bin.qti-widget")}).on("remove.qti-widget",function(id,data){_.isFunction(options.shapeRemoved)&&options.shapeRemoved(id,data),_.remove(currents,id)}),editors.push(editor),enterHandling&&editor.enterHandling()}function createShape(type,created){var factory=factories[type];factories[type]||(factory=shapeFactory(_.merge({type:type},shapeOptions)),factories[type]=factory),factory.on("created.qti-widget",created),factory.start()}function editCreatedShape(type,shape,enterHandling){var layer,set;"target"===type?(layer=paper.getById("layer-"+shape.id),set=paper.set(shape,layer),set.id=shape.id,set.data=shape.data(),editShape(set,enterHandling)):editShape(shape,enterHandling)}var editors=this.editors,factories={},$container=widget.$container,$original=widget.$original,interaction=widget.element,paper=interaction.paper,image=paper.getById("bg-image-"+interaction.serial),currents=options.currents||_.pluck(interaction.getChoices(),"serial"),shapeOptions={paper:interaction.paper,background:image,$container:$container.find(".main-image-box"),isResponsive:$original.hasClass("responsive")},$sideBar=shapeSideBar.create($original,!!options.target);$sideBar.on("shapeactive.qti-widget",function(e,$form,type){createShape(type,function(shape){_.isFunction(options.shapeCreated)&&options.shapeCreated(shape,type),$form.removeClass("active"),editCreatedShape(type,shape)})}),$sideBar.on("shapedeactive.qti-widget",function(e,$form,type){factories&&factories[type]&&factories[type].stop()}),_.forEach(currents,function(id){var element=paper.getById(id);element&&(element.attr(GraphicHelper._style.creator).unmouseover().unmouseout(),/^target/.test(element.id)?editCreatedShape("target",element):editCreatedShape(element.type,element,!1))})},destroy:function destroy(){var $container=widget.$original,interaction=widget.element,paper=interaction.paper,currents=options.currents||_.pluck(interaction.getChoices(),"serial");shapeSideBar.remove($container),_.invoke(this.editors,"destroy"),_.forEach(currents,function(id){var element=paper.getById(id);element&&element.attr(GraphicHelper._style.basic).hover(function(){element.flashing||GraphicHelper.updateElementState(this,"hover")},function(){element.flashing||GraphicHelper.updateElementState(this,this.active?"active":this.selectable?"selectable":"basic")})})}}}}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/resourceManager",["jquery","lodash","i18n","util/image","ui/resourcemgr"],function($,_,__,imageUtil){'use strict';return function($element,options){$element.resourcemgr({title:options.title,appendContainer:options.mediaManager.appendContainer,mediaSourcesUrl:options.mediaManager.mediaSourcesUrl,browseUrl:options.mediaManager.browseUrl,uploadUrl:options.mediaManager.uploadUrl,deleteUrl:options.mediaManager.deleteUrl,downloadUrl:options.mediaManager.downloadUrl,fileExistsUrl:options.mediaManager.fileExistsUrl,params:{uri:options.uri,lang:options.lang,filters:"image/jpeg,image/png,image/gif,image/svg+xml"},pathParam:"path",select:function select(e,files){var selected;0<files.length&&(selected=files[0],imageUtil.getSize(options.baseUrl+encodeURIComponent(files[0].file),function(size){$element.trigger("selected.upload",{selected:selected,size:size})}))}})}}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/imageSelector",["jquery","lodash","i18n","util/image","taoQtiItem/qtiCreator/widgets/interactions/helpers/resourceManager","ui/resourcemgr","ui/tooltip"],function($,_,__,imageUtil,resourceManager){'use strict';return function($form,options){var $upload=$("[data-role=\"upload-trigger\"]",$form),$src=$("input[name=data]",$form),$width=$("input[name=width]",$form),$height=$("input[name=height]",$form),$type=$("input[name=type]",$form);options.title=options.title?options.title:__("Please select a background picture for your interaction from the resource manager. You can add new files from your computer with the button \"Add file(s)\".");var _openResourceMgr=function(){$upload.on("selected.upload",function(e,args){args.size&&0<=args.size.width&&($width.val(args.size.width).trigger("change"),$height.val(args.size.height).trigger("change")),$type.val(args.selected.mime).trigger("change"),_.defer(function(){$src.val(args.selected.file).trigger("change")})}).on("open",function(){$src.trigger("open..imageSelector"),$src.data("$tooltip")&&$src.blur().data("$tooltip").hide()}).on("close",function(){$src.trigger("close..imageSelector")}),resourceManager($upload,options)};$upload.on("click",_openResourceMgr),$src.val()||_openResourceMgr()}}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/graphicAssociate",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Interaction Background",options):helperMissing.call(depth0,"__","Interaction Background",options)))+"</h3>\n\n <div class=\"panel\">\n <label for=\"data\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"File",options):helperMissing.call(depth0,"__","File",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The file path to the image.",options):helperMissing.call(depth0,"__","The file path to the image.",options)))+"</div>\n <input type=\"text\" name=\"data\" value=\"",(helper=helpers.data)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.data,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty; $fileExists(baseUrl=",(helper=helpers.baseUrl)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.baseUrl,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+")\"/>\n <button class=\"btn-info small block\" data-role=\"upload-trigger\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select image",options):helperMissing.call(depth0,"__","Select image",options)))+"</button>\n </div>\n\n <div class=\"panel media-sizer-panel\">\n <!-- media sizer goes here -->\n </div>\n <input name=\"width\" value=\"",(helper=helpers.width)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.width,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" />\n <input name=\"height\" value=\"",(helper=helpers.height)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.height,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" />\n\n\n <input name=\"type\" value=\"",(helper=helpers.type)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.type,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" readonly />\n\n</div>\n<div class=\"panel min-max-panel\">\n\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Allowed associations",options):helperMissing.call(depth0,"__","Allowed associations",options)))+"</h3>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/choices/associableHotspot",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"identifier",options):helperMissing.call(depth0,"__","identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options):helperMissing.call(depth0,"__","The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options)))+"</div>\n\n <input type=\"text\"\n name=\"identifier\"\n value=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n placeholder=\"e.g. my-hotspot_1\"\n data-validate=\"$notEmpty; $qtiIdentifier; $availableIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n</div>\n<div class=\"panel min-max-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Allowed number of matches",options):helperMissing.call(depth0,"__","Allowed number of matches",options)))+"</h3>\n</div>\n\n<div class=\"panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Shape position",options):helperMissing.call(depth0,"__","Shape position",options)))+"</h3>\n\n <div class=\"panel\">\n <label for=\"x\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Left",options):helperMissing.call(depth0,"__","Left",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The left position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The left position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"x\" value=\"",(helper=helpers.x)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.x,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n </div>\n\n <div class=\"panel\">\n <label for=\"y\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Top",options):helperMissing.call(depth0,"__","Top",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The top position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The top position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"y\" value=\"",(helper=helpers.y)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.y,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n </div>\n\n <div class=\"panel\">\n <label for=\"width\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Width",options):helperMissing.call(depth0,"__","Width",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The shape width in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The shape width in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"width\" value=\"",(helper=helpers.width)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.width,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n </div>\n\n <div class=\"panel\">\n <label for=\"height\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Height",options):helperMissing.call(depth0,"__","Height",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The shape height in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The shape height in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"height\" value=\"",(helper=helpers.height)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.height,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/bgImage",["util/url","util/image","ui/mediasizer"],function(url,imageUtil){'use strict';function setupMediaSizer(widget){var $mediaSizer=widget.$form.find(".media-sizer-panel");return $mediaSizer.empty().mediasizer({target:widget.$original.find(".svggroup svg image"),showResponsiveToggle:!1,showSync:!1,responsive:!1,parentSelector:widget.$original.attr("id"),applyToMedium:!1,maxWidth:parseInt(widget.element.object.attr("width"),10)}),$mediaSizer.on("sizechange.mediasizer",function(e,params){var width=parseInt(params.width,10),height=parseInt(params.height,10);widget.element.object.attr("width",width),widget.element.object.attr("height",height),widget.$original.trigger("resize.qti-widget."+widget.serial,[width,height])}),$mediaSizer}return{setupImage:function(widget){var $bgImage=widget.$original.find(".svggroup svg image");widget.$original.hasClass("responsive")||!!$bgImage.length&&setupMediaSizer(widget)},setChangeCallbacks:function(widget,formElement,callbacks){callbacks=callbacks||{},callbacks.data=function(interaction,value){interaction.object.attr("data",url.encodeAsXmlAttr(value)),imageUtil.getSize(widget.options.assetManager.resolve(value),function(size){size&&(interaction.object.attr("width",size.width),interaction.object.attr("height",size.height)),widget.rebuild({ready:function ready(widgetReady){widgetReady.changeState("question")}})})},callbacks.width=function(interaction,value){interaction.object.attr("width",parseInt(value,10))},callbacks.height=function(interaction,value){interaction.object.attr("height",parseInt(value,10))},callbacks.type=function(interaction,value){value&&""!==value?interaction.object.attr("type",value):interaction.object.removeAttr("type")},formElement.setChangeCallbacks(widget.$form,widget.element,callbacks,{validateOnInit:!1})}}}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/states/Question",["jquery","lodash","i18n","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/helpers/graphicInteractionShapeEditor","taoQtiItem/qtiCreator/widgets/interactions/helpers/imageSelector","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/component/minMax/minMax","taoQtiItem/qtiCreator/widgets/helpers/identifier","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/graphicAssociate","tpl!taoQtiItem/qtiCreator/tpl/forms/choices/associableHotspot","taoQtiItem/qtiCreator/helper/panel","taoQtiItem/qtiCreator/widgets/interactions/helpers/bgImage"],function($,_,__,GraphicHelper,stateFactory,Question,shapeEditor,imageSelector,formElement,minMaxComponentFactory,identifierHelper,formTpl,choiceFormTpl,panel,bgImage){'use strict';var _Mathround6=Math.round,GraphicAssociateInteractionStateQuestion=stateFactory.extend(Question,function(){function enterChoiceForm(serial){var choice=interaction.getChoice(serial),element,bbox;if(choice){element=interaction.paper.getById(serial),bbox=element.getBBox(),$choiceForm.empty().html(choiceFormTpl({identifier:choice.id(),fixed:choice.attr("fixed"),serial:serial,x:parseInt(bbox.x,10),y:parseInt(bbox.y,10),width:parseInt(bbox.width,10),height:parseInt(bbox.height,10)})),minMaxComponentFactory($choiceForm.find(".min-max-panel"),{min:{fieldName:"matchMin",value:_.parseInt(choice.attr("matchMin"))||0,helpMessage:__("The minimum number of choices this choice must be associated with to form a valid response.")},max:{fieldName:"matchMax",value:_.parseInt(choice.attr("matchMax"))||0,helpMessage:__("The maximum number of choices this choice may be associated with.")},upperThreshold:_.size(interaction.getChoices())}).on("render",function(){var self=this;widget.on("choiceCreated choiceDeleted",function(data){data.interaction.serial===interaction.serial&&self.updateThresholds(1,_.size(interaction.getChoices()))})}),formElement.initWidget($choiceForm);var callbacks=formElement.getMinMaxAttributeCallbacks("matchMin","matchMax");callbacks.identifier=identifierHelper.updateChoiceIdentifier,callbacks.fixed=formElement.getAttributeChangeCallback(),formElement.setChangeCallbacks($choiceForm,choice,callbacks),$formChoicePanel.show(),panel.openSections($formChoicePanel.children("section")),panel.closeSections($formInteractionPanel.children("section")),$left=$("input[name=x]",$choiceForm),$top=$("input[name=y]",$choiceForm),$width=$("input[name=width]",$choiceForm),$height=$("input[name=height]",$choiceForm)}}function leaveChoiceForm(){"none"!==$formChoicePanel.css("display")&&(panel.openSections($formInteractionPanel.children("section")),$formChoicePanel.hide(),$choiceForm.empty())}var widget=this.widget,interaction=widget.element,paper=interaction.paper,$choiceForm=widget.choiceForm,$formInteractionPanel=$("#item-editor-interaction-property-bar"),$formChoicePanel=$("#item-editor-choice-property-bar"),$left,$top,$width,$height;paper&&(widget._editor=shapeEditor(widget,{shapeCreated:function shapeCreated(shape,type){var newChoice=interaction.createChoice({shape:"path"===type?"poly":type,coords:GraphicHelper.qtiCoords(shape)});shape.id=newChoice.serial},shapeRemoved:function shapeRemoved(id){interaction.removeChoice(id)},enterHandling:function enterHandling(shape){enterChoiceForm(shape.id)},quitHandling:function quitHandling(){leaveChoiceForm()},shapeChange:function shapeChange(shape){var choice=interaction.getChoice(shape.id),bbox;choice&&(choice.attr("coords",GraphicHelper.qtiCoords(shape)),$left&&$left.length&&(bbox=shape.getBBox(),$left.val(parseInt(bbox.x,10)),$top.val(parseInt(bbox.y,10)),$width.val(parseInt(bbox.width,10)),$height.val(parseInt(bbox.height,10))))}}),widget._editor.create())},function(){var widget=this.widget,interaction=widget.element,paper=interaction.paper,valid=!!interaction.object.attr("data")&&!_.isEmpty(interaction.choices);widget.isValid("graphicAssociateInteraction",valid),paper&&($(window).off("resize.changestate"),widget._editor&&widget._editor.destroy(),$(".image-editor.solid, .block-listing.source",this.widget.$container).css("min-width",0))});return GraphicAssociateInteractionStateQuestion.prototype.initForm=function(){var widget=this.widget,options=widget.options,interaction=widget.element,$form=widget.$form,getMaxPairs=function(choices){return 0<choices?_Mathround6(choices*(choices-1)/2):0};$form.html(formTpl({baseUrl:options.baseUrl,data:interaction.object.attr("data"),width:interaction.object.attr("width"),height:interaction.object.attr("height"),type:interaction.object.attr("type")})),minMaxComponentFactory($form.find(".min-max-panel"),{min:{fieldName:"minAssociations",value:_.parseInt(interaction.attr("minAssociations"))||0,helpMessage:__("The minimum number of associations that the candidate is required to make to form a valid response.")},max:{fieldName:"maxAssociations",value:_.parseInt(interaction.attr("maxAssociations"))||0,helpMessage:__("The maximum number of associations that the candidate is allowed to make.")},upperThreshold:getMaxPairs(_.size(interaction.getChoices()))}).on("render",function(){var self=this;widget.on("choiceCreated choiceDeleted",function(data){data.interaction.serial===interaction.serial&&self.updateThresholds(1,getMaxPairs(_.size(interaction.getChoices())))})}),imageSelector($form,options),formElement.initWidget($form),bgImage.setupImage(widget),bgImage.setChangeCallbacks(widget,formElement,formElement.getMinMaxAttributeCallbacks("minAssociations","maxAssociations"))},GraphicAssociateInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/states/Correct",["lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicAssociateInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse"],function(_,__,stateFactory,Correct,commonRenderer,instructionMgr,PciResponse){'use strict';return stateFactory.create(Correct,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration(),corrects=_.values(response.getCorrect());commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction);interaction.paper&&(instructionMgr.appendInstruction(interaction,__("Please set the correct associations by linking the choices.")),commonRenderer.render.call(interaction.getRenderer(),interaction),commonRenderer.setResponse(interaction,PciResponse.serialize(_.invoke(corrects,String.prototype.split," "),interaction)),widget.$container.on("responseChange.qti-widget",function(e,data){data.response&&data.response.list&&response.setCorrect(_.map(data.response.list.pair,function(pair){return pair.join(" ")}))}))},function(){var widget=this.widget,interaction=widget.element;interaction.paper&&(widget.$container.off("responseChange.qti-widget"),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction),interaction.paper=widget.createPaper(),widget.createChoices())})}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/states/Map",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicAssociateInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCreator/widgets/interactions/helpers/pairScoringForm"],function($,_,__,stateFactory,Map,commonRenderer,instructionMgr,graphicHelper,PciResponse,scoringFormFactory){'use strict';function removePaths(interaction){_.delay(function(){_.forEach(interaction._vsets,function(vset){_.invoke(vset,"remove")}),interaction._vsets=[]},500)}function showChoicesId(interaction){_.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);element&&graphicHelper.createShapeText(interaction.paper,element,{shapeClick:!0,content:choice.id()}).transform("t0,-10").toFront()})}function updateForm(widget,entries){var interaction=widget.element,response=interaction.getResponseDeclaration(),mapEntries=response.getMapEntries(),getPairValues=function(){return _.map(interaction.getChoices(),function(choice){return{id:choice.id(),value:choice.id()}})},options={leftTitle:__("left"),rightTitle:__("right"),type:"pair",pairLeft:getPairValues,pairRight:getPairValues};entries&&(options.entries=_.transform(entries,function(result,value){result[value]=mapEntries[value]===void 0?response.mappingAttributes.defaultValue:mapEntries[value]},{})),interaction.pairScoringForm=scoringFormFactory(widget,options)}return stateFactory.create(Map,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration(),corrects=_.values(response.getCorrect()),currentResponses=0===_.size(response.getMapEntries())?corrects:_.keys(response.getMapEntries());commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction);interaction.paper&&(instructionMgr.appendInstruction(interaction,__("Create assocations and fill the score in the form below")),interaction.responseMappingMode=!0,commonRenderer.render.call(interaction.getRenderer(),interaction),showChoicesId(interaction),0===_.size(response.getMapEntries())?updateForm(widget,corrects):updateForm(widget),widget.$container.on("responseChange.qti-widget",function(e,data){var type="single"===response.attr("cardinality")?"base":"list",pairs,entries;data&&data.response&&data.response[type]&&(pairs=_.invoke(data.response[type].pair,Array.prototype.join," "),entries=_.keys(response.getMapEntries()),_(pairs).difference(entries).forEach(interaction.pairScoringForm.addPair,interaction.pairScoringForm),removePaths(interaction))}))},function(){var widget=this.widget,interaction=widget.element;interaction.paper&&(widget.$container.off("responseChange.qti-widget"),interaction.pairScoringForm&&interaction.pairScoringForm.destroy(),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction),interaction.paper=widget.createPaper(),widget.createChoices())})}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/states/Sleep","taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/states/Map"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/Widget",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/graphicInteraction/Widget","taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/states/states"],function($,_,__,Widget,GraphicWidget,states){'use strict';var GraphicAssociateInteractionWidget=_.extend(Widget.clone(),GraphicWidget,{initCreator:function initCreator(options){var paper;this.baseUrl=options.baseUrl,this.choiceForm=options.choiceForm,this.registerStates(states),Widget.initCreator.call(this),paper=this.createPaper(),paper&&(this.element.paper=paper,this.createChoices())},destroy:function destroy(){var $container=this.$original,$item=$container.parents(".qti-item");$item.off("resize.gridEdit."+this.element.serial),$(window).off("resize.qti-widget."+this.element.serial),$container.off("resize.qti-widget."+this.element.serial),Widget.destroy.call(this)}});return GraphicAssociateInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/GraphicAssociateInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicAssociateInteraction","taoQtiItem/qtiCreator/widgets/interactions/graphicAssociateInteraction/Widget"],function(_,GraphicAssociateInteraction,GraphicAssociateInteractionWidget){'use strict';var CreatorGraphicAssociateInteraction=_.clone(GraphicAssociateInteraction);return CreatorGraphicAssociateInteraction.render=function(interaction,options){options=options||{},options.baseUrl=this.getOption("baseUrl"),options.choiceForm=this.getOption("choiceOptionForm"),options.uri=this.getOption("uri"),options.lang=this.getOption("lang"),options.mediaManager=this.getOption("mediaManager"),options.assetManager=this.getAssetManager(),GraphicAssociateInteractionWidget.build(interaction,GraphicAssociateInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorGraphicAssociateInteraction}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Sleep"],function(stateFactory,SleepState){'use strict';return stateFactory.extend(SleepState,function(){var widget=this.widget,interaction=widget.element;widget.on("metaChange",function(data){"responsive"===data.key&&(!0===data.value?interaction.addClass("responsive"):interaction.removeClass("responsive"),widget.rebuild())})},function(){var widget=this.widget;$(".image-editor.solid, .block-listing.source",widget.$container).css("min-width",0)})}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/graphicGapMatch",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n\n\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Interaction Background",options):helperMissing.call(depth0,"__","Interaction Background",options)))+"</h3>\n\n <div class=\"panel\">\n <label for=\"data\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"File",options):helperMissing.call(depth0,"__","File",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The file path to the image.",options):helperMissing.call(depth0,"__","The file path to the image.",options)))+"</div>\n <input type=\"text\" name=\"data\" value=\"",(helper=helpers.data)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.data,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty; $fileExists(baseUrl=",(helper=helpers.baseUrl)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.baseUrl,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+")\"/>\n <button class=\"btn-info small block\" data-role=\"upload-trigger\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select image",options):helperMissing.call(depth0,"__","Select image",options)))+"</button>\n </div>\n\n <div class=\"panel media-sizer-panel\">\n <!-- media sizer goes here -->\n </div>\n<input name=\"width\" value=\"",(helper=helpers.width)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.width,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" />\n<input name=\"height\" value=\"",(helper=helpers.height)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.height,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" />\n\n <input type=\"hidden\" name=\"type\" value=\"",(helper=helpers.type)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.type,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/choices/gapImg",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"identifier",options):helperMissing.call(depth0,"__","identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options):helperMissing.call(depth0,"__","The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options)))+"</div>\n\n <input type=\"text\"\n name=\"identifier\"\n value=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n placeholder=\"e.g. my-hotspot_1\"\n data-validate=\"$notEmpty; $qtiIdentifier; $availableIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n</div>\n<div class=\"panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Choice Image",options):helperMissing.call(depth0,"__","Choice Image",options)))+"</h3>\n\n <div class=\"panel\">\n <label for=\"data\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"File",options):helperMissing.call(depth0,"__","File",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The file path to the image.",options):helperMissing.call(depth0,"__","The file path to the image.",options)))+"</div>\n <input type=\"text\" name=\"data\" value=\"",(helper=helpers.data)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.data,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty; $fileExists(baseUrl=",(helper=helpers.baseUrl)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.baseUrl,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+")\"/>\n <button class=\"btn-info small block\" data-role=\"upload-trigger\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select image",options):helperMissing.call(depth0,"__","Select image",options)))+"</button>\n </div>\n\n <div class=\"panel media-sizer-panel\">\n <!-- media sizer goes here -->\n </div>\n\n <input name=\"type\" type=\"hidden\" value=\"",(helper=helpers.type)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.type,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" />\n</div>\n<div class=\"panel min-max-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Max. number of matches",options):helperMissing.call(depth0,"__","Max. number of matches",options)))+" </h3>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/states/Question",["jquery","lodash","i18n","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/helpers/graphicInteractionShapeEditor","taoQtiItem/qtiCreator/widgets/interactions/helpers/imageSelector","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/helpers/identifier","taoQtiItem/qtiCreator/widgets/component/minMax/minMax","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/graphicGapMatch","tpl!taoQtiItem/qtiCreator/tpl/forms/choices/associableHotspot","tpl!taoQtiItem/qtiCreator/tpl/forms/choices/gapImg","tpl!taoQtiItem/qtiCreator/tpl/toolbars/media","taoQtiItem/qtiCreator/helper/panel","taoQtiItem/qtiCreator/widgets/interactions/helpers/resourceManager","taoQtiItem/qtiCreator/widgets/interactions/helpers/bgImage","ui/mediasizer"],function($,_,__,GraphicHelper,stateFactory,Question,shapeEditor,imageSelector,formElement,identifierHelper,minMaxComponentFactory,formTpl,choiceFormTpl,gapImgFormTpl,mediaTlbTpl,panel,resourceManager,bgImage){"use strict";function applyMediasizerValues(params,factor,naturalHeight,naturalWidth){factor=factor||1;var width=params.width,height=params.height;width&&height||(width=naturalWidth,height=naturalHeight),params.$target.css({width:width*factor,height:height*factor}).attr("width",width).attr("height",height)}var GraphicGapMatchInteractionStateQuestion;return GraphicGapMatchInteractionStateQuestion=stateFactory.extend(Question,function(){function setUpGapImg(gapImgObj){var $gapList=$("ul.source",widget.$original),$addOption=$(".empty",$gapList),$deleteBtn=$(mediaTlbTpl()),$gapImgBox=$("[data-serial=\"".concat(gapImgObj.serial,"\"]"),$gapList);$gapImgBox.length||($gapImgBox=$(gapImgObj.render()).insertBefore($addOption)),$deleteBtn.appendTo($gapImgBox).show().click(function(e){e.preventDefault(),e.stopPropagation(),$gapImgBox.remove(),interaction.removeGapImg(gapImgObj)}),enterGapImgForm(gapImgObj.serial),$gapImgBox.off("click").on("click",function(){$gapImgBox.hasClass("active")?($gapImgBox.removeClass("active"),leaveChoiceForm()):($(".active",$gapList).removeClass("active"),$gapImgBox.addClass("active"),enterGapImgForm(gapImgObj.serial))})}function enterChoiceForm(serial){var choice=interaction.getChoice(serial),element,bbox,callbacks;choice&&(element=interaction.paper.getById(serial),bbox=element.getBBox(),$choiceForm.empty().html(choiceFormTpl({identifier:choice.id(),fixed:choice.attr("fixed"),serial:serial,x:parseInt(bbox.x,10),y:parseInt(bbox.y,10),width:parseInt(bbox.width,10),height:parseInt(bbox.height,10)})),minMaxComponentFactory($choiceForm.find(".min-max-panel"),{min:{fieldName:"matchMin",value:_.parseInt(choice.attr("matchMin"))||0,helpMessage:__("The minimum number of choices this choice must be associated with to form a valid response.")},max:{fieldName:"matchMax",value:_.parseInt(choice.attr("matchMax"))||0,helpMessage:__("The maximum number of choices this choice may be associated with.")},upperThreshold:_.size(interaction.getChoices())}).on("render",function(){var self=this;widget.on("choiceCreated choiceDeleted",function(data){data.interaction.serial===interaction.serial&&self.updateThresholds(1,_.size(interaction.getChoices()))})}),formElement.initWidget($choiceForm),callbacks=formElement.getMinMaxAttributeCallbacks("matchMin","matchMax"),callbacks.identifier=identifierHelper.updateChoiceIdentifier,callbacks.fixed=formElement.getAttributeChangeCallback(),formElement.setChangeCallbacks($choiceForm,choice,callbacks),$formChoicePanel.show(),panel.openSections($formChoicePanel.children("section")),panel.closeSections($formInteractionPanel.children("section")),$left=$("input[name=x]",$choiceForm),$top=$("input[name=y]",$choiceForm),$width=$("input[name=width]",$choiceForm),$height=$("input[name=height]",$choiceForm))}function leaveChoiceForm(){"none"!==$formChoicePanel.css("display")&&(panel.openSections($formInteractionPanel.children("section")),$formChoicePanel.hide(),$choiceForm.empty())}function enterGapImgForm(serial){var gapImg=interaction.getGapImg(serial),callbacks,initMediasizer,$gapImgBox,$gapImgElem,$mediaSizer;gapImg&&($choiceForm.empty().html(gapImgFormTpl({identifier:gapImg.id(),fixed:gapImg.attr("fixed"),serial:serial,baseUrl:options.baseUrl,data:gapImg.object.attr("data"),width:gapImg.object.attr("width"),height:gapImg.object.attr("height"),type:gapImg.object.attr("type")})),minMaxComponentFactory($choiceForm.find(".min-max-panel"),{min:{fieldName:"matchMin",value:_.parseInt(gapImg.attr("matchMin"))||0,helpMessage:__("The minimum number of choices this choice must be associated with to form a valid response.")},max:{fieldName:"matchMax",value:_.parseInt(gapImg.attr("matchMax"))||0,helpMessage:__("The maximum number of choices this choice may be associated with.")},upperThreshold:_.size(interaction.getChoices())}).on("render",function(){var self=this;widget.on("choiceCreated choiceDeleted",function(data){data.interaction.serial===interaction.serial&&self.updateThresholds(1,_.size(interaction.getChoices()))})}),$gapImgBox=$("li[data-serial=\"".concat(gapImg.serial,"\"]")),$gapImgElem=$gapImgBox.find("img"),$mediaSizer=$choiceForm.find(".media-sizer-panel").on("create.mediasizer",function(e,params){params.width=$gapImgElem.attr("width"),params.height=$gapImgElem.attr("height"),applyMediasizerValues(params,widget.$original.data("factor"),$gapImgElem.get(0).naturalHeight,$gapImgElem.get(0).naturalWidth)}),initMediasizer=function(){$gapImgElem.width($gapImgElem.attr("width")),$gapImgElem.height($gapImgElem.attr("height")),$mediaSizer.empty().mediasizer({target:$gapImgElem,showResponsiveToggle:!1,showSync:!1,responsive:!1,parentSelector:$gapImgBox,applyToMedium:!1,maxWidth:interaction.object.attr("width")})},$gapImgElem.get(0)&&$gapImgElem.get(0).complete?initMediasizer():$gapImgElem.one("load",initMediasizer),imageSelector($choiceForm,gapImgSelectorOptions),formElement.initWidget($choiceForm),callbacks=formElement.getMinMaxAttributeCallbacks("matchMin","matchMax"),callbacks.identifier=identifierHelper.updateChoiceIdentifier,callbacks.fixed=formElement.getAttributeChangeCallback(),callbacks.data=function(element,value){gapImg.object.attr("data",value),setUpGapImg(gapImg)},$mediaSizer.on("sizechange.mediasizer",function(e,params){applyMediasizerValues(params,widget.$original.data("factor"),$gapImgElem.get(0).naturalHeight,$gapImgElem.get(0).naturalWidth),gapImg.object.attr("width",params.width),gapImg.object.attr("height",params.height)}),callbacks.type=function(element,value){value&&""!==value?gapImg.object.attr("type",value):interaction.object.removeAttr("type")},formElement.setChangeCallbacks($choiceForm,gapImg,callbacks),$formChoicePanel.show(),panel.openSections($formChoicePanel.children("section")),panel.closeSections($formInteractionPanel.children("section")),"function"==typeof window.scroll&&window.scroll(0,$choiceForm.offset().top))}var widget=this.widget,interaction=widget.element,options=widget.options,paper=interaction.paper,gapImgSelectorOptions=_.clone(options),$choiceForm,$formChoicePanel,$formInteractionPanel,$left,$top,$width,$height;gapImgSelectorOptions.title=gapImgSelectorOptions.title?gapImgSelectorOptions.title:__("Please select a choice picture for your interaction from the resource manager. You can add new files from your computer with the button \"Add file(s)\"."),paper&&($choiceForm=widget.choiceForm,$formInteractionPanel=$("#item-editor-interaction-property-bar"),$formChoicePanel=$("#item-editor-choice-property-bar"),widget._editor=shapeEditor(widget,{shapeCreated:function shapeCreated(shape,type){var newChoice=interaction.createChoice({shape:"path"===type?"poly":type,coords:GraphicHelper.qtiCoords(shape)});shape.id=newChoice.serial},shapeRemoved:function shapeRemoved(id){interaction.removeChoice(id)},enterHandling:function enterHandling(shape){enterChoiceForm(shape.id)},quitHandling:function quitHandling(){leaveChoiceForm()},shapeChange:function shapeChange(shape){var choice=interaction.getChoice(shape.id),bbox;choice&&(choice.attr("coords",GraphicHelper.qtiCoords(shape)),$left&&$left.length&&(bbox=shape.getBBox(),$left.val(parseInt(bbox.x,10)),$top.val(parseInt(bbox.y,10)),$width.val(parseInt(bbox.width,10)),$height.val(parseInt(bbox.height,10))))}}),widget._editor.create(),_.forEach(interaction.getGapImgs(),setUpGapImg),function(){var $gapList=$("ul.source",widget.$original),$addOption=$("<li class=\"empty add-option\"><div><span class=\"icon-add\"></span></div></li>");$addOption.on("click",function(){var gapImgObj=interaction.createGapImg({});gapImgObj.object.removeAttr("type"),$addOption.on("selected.upload",function(e,args){$addOption.off("selected.upload");var size=args.size,height,width;size&&(height=args.size.height,width=args.size.width),gapImgObj.object.attr("data",args.selected.file),gapImgObj.object.attr("type",args.selected.mime),gapImgObj.object.attr("width",width),gapImgObj.object.attr("height",height),setUpGapImg(gapImgObj)}),resourceManager($addOption,gapImgSelectorOptions)}),$addOption.appendTo($gapList)}(),$(window).on("resize.changestate",function(){widget.changeState("sleep")}))},function(){var widget=this.widget,interaction=widget.element,paper=interaction.paper,valid=!!interaction.object.attr("data")&&!_.isEmpty(interaction.choices);widget.isValid("graphicGapMatchInteraction",valid),paper&&($(window).off("resize.changestate"),widget._editor&&widget._editor.destroy(),$("ul.source .empty",widget.$original).remove(),widget.$container.find(".qti-gapImg").removeClass("active").find(".mini-tlb").remove(),$(".image-editor.solid, .block-listing.source",widget.$container).css("min-width",0))}),GraphicGapMatchInteractionStateQuestion.prototype.initForm=function(){var widget=this.widget,options=widget.options,interaction=widget.element,$form=widget.$form;$form.html(formTpl({baseUrl:options.baseUrl,data:interaction.object.attr("data"),width:interaction.object.attr("width"),height:interaction.object.attr("height"),type:interaction.object.attr("type")})),imageSelector($form,options),formElement.initWidget($form),bgImage.setupImage(widget),bgImage.setChangeCallbacks(widget,formElement)},GraphicGapMatchInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/states/Correct",["lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicGapMatchInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse"],function(_,__,stateFactory,Correct,commonRenderer,instructionMgr,PciResponse){'use strict';return stateFactory.create(Correct,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration(),corrects=_.values(response.getCorrect());commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction);interaction.paper&&(instructionMgr.appendInstruction(interaction,__("Please fill the gap with the correct choices below.")),widget.createGapImgs(),commonRenderer.render.call(interaction.getRenderer(),interaction),commonRenderer.setResponse(interaction,PciResponse.serialize(_.invoke(corrects,String.prototype.split," "),interaction)),widget.$container.on("responseChange.qti-widget",function(e,data){data.response&&data.response.list&&response.setCorrect(_.map(data.response.list.directedPair,function(pair){return pair.join(" ")}))}))},function(){var widget=this.widget,interaction=widget.element;interaction.paper&&(widget.$container.off("responseChange.qti-widget"),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction),interaction.paper=widget.createPaper(_.bind(widget.scaleGapList,widget)),widget.createChoices(),widget.createGapImgs())})}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/states/Map",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicGapMatchInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCreator/widgets/interactions/helpers/pairScoringForm"],function($,_,__,stateFactory,Map,commonRenderer,instructionMgr,graphicHelper,PciResponse,scoringFormFactory){'use strict';var removeGapFillers=function(interaction){_.forEach(interaction.gapFillers,function(gapFiller){gapFiller.remove()}),interaction.gapFillers=[]},showChoicesId=function(interaction){_.forEach(interaction.getChoices(),function(choice){var element=interaction.paper.getById(choice.serial);element&&graphicHelper.createShapeText(interaction.paper,element,{shapeClick:!0,content:choice.id()})})},updateForm=function(widget,entries){var interaction=widget.element,response=interaction.getResponseDeclaration(),mapEntries=response.getMapEntries(),gapSrcs=_.transform(interaction.getGapImgs(),function(acc,gapImg){gapImg.object&&gapImg.object.attr("data")&&(acc[gapImg.id()]=widget.options.baseUrl+gapImg.object.attr("data"))},{}),options={leftTitle:__("Gap"),rightTitle:__("Choice"),type:"directedPair",pairLeft:function pairLeft(){return _.map(interaction.getGapImgs(),function(gap){return{id:gap.id(),value:gap.id()}})},formatLeft:function formatLeft(id){var formated="";return gapSrcs[id]&&(formated+="<img height='1em' src='"+gapSrcs[id]+"' /> "),formated+=id,formated},pairRight:function pairRight(){return _.map(interaction.getChoices(),function(choice){return{id:choice.id(),value:choice.id()}})},isDirectedPairFlipped:commonRenderer.isDirectedPairFlipped};entries&&(options.entries=_.transform(entries,function(result,value){result[value]="undefined"==typeof mapEntries[value]?response.mappingAttributes.defaultValue:mapEntries[value]},{})),interaction.pairScoringForm=scoringFormFactory(widget,options)};return stateFactory.create(Map,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration(),corrects=_.values(response.getCorrect());commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction);interaction.paper&&(instructionMgr.appendInstruction(interaction,__("Please fill the gap with the images below, then edit the score for each gap/image pair.")),interaction.responseMappingMode=!0,widget.createGapImgs(),commonRenderer.render.call(interaction.getRenderer(),interaction),showChoicesId(interaction),0===_.size(response.getMapEntries())?updateForm(widget,corrects):updateForm(widget),widget.$container.on("responseChange.qti-widget",function(e,data){var type="single"===response.attr("cardinality")?"base":"list",pairs,entries;data&&data.response&&data.response[type]&&(pairs=_.map(data.response[type].directedPair,function(pair){return commonRenderer.isDirectedPairFlipped?pair.reverse().join(" "):pair.join(" ")}),entries=_.keys(response.getMapEntries()),_(pairs).difference(entries).forEach(interaction.pairScoringForm.addPair,interaction.pairScoringForm)),removeGapFillers(interaction)}))},function(){var widget=this.widget,interaction=widget.element;interaction.paper&&(widget.$container.off("responseChange.qti-widget"),interaction.pairScoringForm&&interaction.pairScoringForm.destroy(),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction),interaction.paper=widget.createPaper(_.bind(widget.scaleGapList,widget)),widget.createChoices(),widget.createGapImgs())})}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/states/Sleep","taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/states/Map"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/Widget",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/graphicInteraction/Widget","taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/states/states"],function($,_,__,Widget,GraphicWidget,states){'use strict';var GraphicGapMatchInteractionWidget=_.extend(Widget.clone(),GraphicWidget,{initCreator:function initCreator(options){var paper;this.baseUrl=options.baseUrl,this.choiceForm=options.choiceForm,this.registerStates(states),Widget.initCreator.call(this),paper=this.createPaper(_.bind(this.scaleGapList,this)),paper&&(this.element.paper=paper,this.createChoices(),this.createGapImgs())},destroy:function destroy(){var $container=this.$original,$item=$container.parents(".qti-item");$item.off("resize.gridEdit."+this.element.serial),$(window).off("resize.qti-widget."+this.element.serial),$container.off("resize.qti-widget."+this.element.serial),Widget.destroy.call(this)},scaleGapList:function scaleGapList(newSize,factor){var $container=this.$original,$gapList=$("ul.source",$container);$gapList.css("max-width",newSize+"px"),factor&&1!==factor&&($gapList.find("img").each(function(){var $img=$(this);$img.width($img.attr("width")*factor),$img.height($img.attr("height")*factor)}),$container.data("factor",factor))},createGapImgs:function createGapImgs(){var interaction=this.element,$container=this.$original,$gapList=$("ul.source",$container);$gapList.empty(),_.forEach(interaction.gapImgs,function(gapImg){$gapList.append(gapImg.render())})}});return GraphicGapMatchInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/GraphicGapMatchInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicGapMatchInteraction","taoQtiItem/qtiCreator/widgets/interactions/graphicGapMatchInteraction/Widget"],function(_,GraphicGapMatchInteraction,GraphicGapMatchInteractionWidget){'use strict';var CreatorGraphicGapMatchInteraction=_.clone(GraphicGapMatchInteraction);return CreatorGraphicGapMatchInteraction.render=function(interaction,options){options=options||{},options.baseUrl=this.getOption("baseUrl"),options.choiceForm=this.getOption("choiceOptionForm"),options.uri=this.getOption("uri"),options.lang=this.getOption("lang"),options.mediaManager=this.getOption("mediaManager"),options.assetManager=this.getAssetManager(),GraphicGapMatchInteractionWidget.build(interaction,GraphicGapMatchInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorGraphicGapMatchInteraction}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicOrderInteraction/states/Sleep",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Sleep"],function($,stateFactory,SleepState){'use strict';return stateFactory.extend(SleepState,function(){var widget=this.widget,interaction=widget.element;widget.on("metaChange",function(data){"responsive"===data.key&&(!0===data.value?interaction.addClass("responsive"):interaction.removeClass("responsive"),widget.rebuild())})},function(){$(".image-editor.solid, .block-listing.source",this.widget.$container).css("min-width",0)})}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/graphicOrder",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Interaction Background",options):helperMissing.call(depth0,"__","Interaction Background",options)))+"</h3>\n\n <div class=\"panel\">\n <label for=\"data\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"File",options):helperMissing.call(depth0,"__","File",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The file path to the image.",options):helperMissing.call(depth0,"__","The file path to the image.",options)))+"</div>\n <input type=\"text\" name=\"data\" value=\"",(helper=helpers.data)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.data,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty; $fileExists(baseUrl=",(helper=helpers.baseUrl)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.baseUrl,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+")\"/>\n <button class=\"btn-info small block\" data-role=\"upload-trigger\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select image",options):helperMissing.call(depth0,"__","Select image",options)))+"</button>\n </div>\n\n <div class=\"panel media-sizer-panel\">\n <!-- media sizer goes here -->\n </div>\n <input name=\"width\" value=\"",(helper=helpers.width)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.width,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" />\n <input name=\"height\" value=\"",(helper=helpers.height)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.height,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" />\n\n\n <input name=\"type\" value=\"",(helper=helpers.type)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.type,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" readonly />\n\n</div>\n<div class=\"panel min-max-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Allowed choices",options):helperMissing.call(depth0,"__","Allowed choices",options)))+"</h3>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/choices/hotspot",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"identifier",options):helperMissing.call(depth0,"__","identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options):helperMissing.call(depth0,"__","The identifier of the choice. This identifier must not be used by any other choice or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options)))+"</div>\n\n <input type=\"text\"\n name=\"identifier\"\n value=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n placeholder=\"e.g. my-hotspot_1\"\n data-validate=\"$notEmpty; $qtiIdentifier; $availableIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n</div>\n\n<h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Shape position",options):helperMissing.call(depth0,"__","Shape position",options)))+"</h3>\n\n<div class=\"panel\">\n <label for=\"x\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Left",options):helperMissing.call(depth0,"__","Left",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The left position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The left position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"x\" value=\"",(helper=helpers.x)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.x,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n</div>\n\n<div class=\"panel\">\n <label for=\"y\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Top",options):helperMissing.call(depth0,"__","Top",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The top position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The top position of the shape relative to the top left corner of the background in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"y\" value=\"",(helper=helpers.y)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.y,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n</div>\n\n<div class=\"panel\">\n <label for=\"width\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Width",options):helperMissing.call(depth0,"__","Width",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The shape width in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The shape width in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"width\" value=\"",(helper=helpers.width)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.width,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n</div>\n\n<div class=\"panel\">\n <label for=\"height\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Height",options):helperMissing.call(depth0,"__","Height",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The shape height in pixels. This value may be scaled when the background image size is adapted to it's container",options):helperMissing.call(depth0,"__","The shape height in pixels. This value may be scaled when the background image size is adapted to it's container",options)))+"</div>\n <input name=\"height\" value=\"",(helper=helpers.height)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.height,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" readonly />\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicOrderInteraction/states/Question",["jquery","lodash","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/helpers/graphicInteractionShapeEditor","taoQtiItem/qtiCreator/widgets/interactions/helpers/imageSelector","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/component/minMax/minMax","taoQtiItem/qtiCreator/widgets/helpers/identifier","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/graphicOrder","tpl!taoQtiItem/qtiCreator/tpl/forms/choices/hotspot","taoQtiItem/qtiCreator/helper/panel","taoQtiItem/qtiCreator/widgets/interactions/helpers/bgImage"],function($,_,GraphicHelper,stateFactory,Question,shapeEditor,imageSelector,formElement,minMaxComponentFactory,identifierHelper,formTpl,choiceFormTpl,panel,bgImage){'use strict';var GraphicOrderInteractionStateQuestion=stateFactory.extend(Question,function(){function enterChoiceForm(serial){var choice=interaction.getChoice(serial),element,bbox;choice&&(element=interaction.paper.getById(serial),bbox=element.getBBox(),$choiceForm.empty().html(choiceFormTpl({identifier:choice.id(),fixed:choice.attr("fixed"),serial:serial,x:parseInt(bbox.x,10),y:parseInt(bbox.y,10),width:parseInt(bbox.width,10),height:parseInt(bbox.height,10)})),formElement.initWidget($choiceForm),formElement.setChangeCallbacks($choiceForm,choice,{identifier:identifierHelper.updateChoiceIdentifier,fixed:formElement.getAttributeChangeCallback()}),$formChoicePanel.show(),panel.openSections($formChoicePanel.children("section")),panel.closeSections($formInteractionPanel.children("section")),$left=$("input[name=x]",$choiceForm),$top=$("input[name=y]",$choiceForm),$width=$("input[name=width]",$choiceForm),$height=$("input[name=height]",$choiceForm))}function leaveChoiceForm(){"none"!==$formChoicePanel.css("display")&&(panel.openSections($formInteractionPanel.children("section")),$formChoicePanel.hide(),$choiceForm.empty())}var widget=this.widget,interaction=widget.element,paper=interaction.paper,$choiceForm=widget.choiceForm,$formInteractionPanel=$("#item-editor-interaction-property-bar"),$formChoicePanel=$("#item-editor-choice-property-bar"),$left,$top,$width,$height;paper&&(widget._editor=shapeEditor(widget,{shapeCreated:function shapeCreated(shape,type){var newChoice=interaction.createChoice({shape:"path"===type?"poly":type,coords:GraphicHelper.qtiCoords(shape)});shape.id=newChoice.serial},shapeRemoved:function shapeRemoved(id){interaction.removeChoice(id)},enterHandling:function enterHandling(shape){enterChoiceForm(shape.id)},quitHandling:function quitHandling(){leaveChoiceForm()},shapeChange:function shapeChange(shape){var choice=interaction.getChoice(shape.id),bbox;choice&&(choice.attr("coords",GraphicHelper.qtiCoords(shape)),$left&&$left.length&&(bbox=shape.getBBox(),$left.val(parseInt(bbox.x,10)),$top.val(parseInt(bbox.y,10)),$width.val(parseInt(bbox.width,10)),$height.val(parseInt(bbox.height,10))))}}),widget._editor.create(),$(window).on("resize.changestate",function(){widget.changeState("sleep")}),widget.on("attributeChange",function(data){"maxChoices"===data.key&&widget.renderOrderList()}))},function(){var widget=this.widget,interaction=widget.element,paper=interaction.paper,valid=!!interaction.object.attr("data")&&!_.isEmpty(interaction.choices);widget.isValid("graphicOrderInteraction",valid),paper&&($(window).off("resize.changestate"),widget._editor&&widget._editor.destroy(),$(".image-editor.solid, .block-listing.source",this.widget.$container).css("min-width",0))});return GraphicOrderInteractionStateQuestion.prototype.initForm=function(){var widget=this.widget,options=widget.options,interaction=widget.element,$form=widget.$form;$form.html(formTpl({baseUrl:options.baseUrl,data:interaction.object.attr("data"),width:interaction.object.attr("width"),height:interaction.object.attr("height"),type:interaction.object.attr("type")})),minMaxComponentFactory($form.find(".min-max-panel"),{min:{value:_.parseInt(interaction.attr("minChoices"))||0},max:{value:_.parseInt(interaction.attr("maxChoices"))||0},upperThreshold:_.size(interaction.getChoices())}).on("render",function(){var self=this;widget.on("choiceCreated choiceDeleted",function(data){data.interaction.serial===interaction.serial&&self.updateThresholds(1,_.size(interaction.getChoices()))})}),imageSelector($form,options),formElement.initWidget($form),bgImage.setupImage(widget),bgImage.setChangeCallbacks(widget,formElement,formElement.getMinMaxAttributeCallbacks("minChoices","maxChoices",{updateCardinality:!1}))},GraphicOrderInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicOrderInteraction/states/Correct",["lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicOrderInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse"],function(_,__,stateFactory,Correct,commonRenderer,instructionMgr,PciResponse){'use strict';return stateFactory.create(Correct,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration();commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction);interaction.paper&&(instructionMgr.appendInstruction(interaction,__("Please order the choices below to set the correct answer")),commonRenderer.render.call(interaction.getRenderer(),interaction),commonRenderer.setResponse(interaction,PciResponse.serialize(_.values(response.getCorrect()),interaction)),widget.$container.on("responseChange.qti-widget",function(e,data){response.setCorrect(PciResponse.unserialize(data.response,interaction))}))},function(){var widget=this.widget,interaction=widget.element;interaction.paper&&(widget.$container.off("responseChange.qti-widget"),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction),interaction.paper=widget.createPaper(_.bind(widget.scaleOrderList,widget)),widget.createChoices(),widget.renderOrderList())})}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicOrderInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/graphicOrderInteraction/states/Sleep","taoQtiItem/qtiCreator/widgets/interactions/graphicOrderInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/graphicOrderInteraction/states/Correct"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/graphicOrderInteraction/Widget",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/graphicInteraction/Widget","taoQtiItem/qtiCreator/widgets/interactions/graphicOrderInteraction/states/states"],function($,_,__,Widget,GraphicWidget,states){var GraphicOrderInteractionWidget=_.extend(Widget.clone(),GraphicWidget,{initCreator:function initCreator(options){var paper;this.baseUrl=options.baseUrl,this.choiceForm=options.choiceForm,this.registerStates(states),Widget.initCreator.call(this),paper=this.createPaper(_.bind(this.scaleOrderList,this)),paper&&(this.element.paper=paper,this.createChoices(),this.renderOrderList())},destroy:function destroy(){var $container=this.$original,$item=$container.parents(".qti-item");$item.off("resize.gridEdit."+this.element.serial),$(window).off("resize.qti-widget."+this.element.serial),$container.off("resize.qti-widget."+this.element.serial),Widget.destroy.call(this)},scaleOrderList:function scaleOrderList(newSize){$("ul.block-listing",this.$original).css("max-width",newSize+"px")},renderOrderList:function(){var interaction=this.element,size=_.size(interaction.getChoices()),min=interaction.attr("minChoices"),max=interaction.attr("maxChoices"),$orderList=$("ul.block-listing",this.$original);0<max&&max<=size?size=max:0<min&&min<=size&&(size=min),$orderList.empty(),_.times(size,function(index){var position=index+1,$orderer=$("<li class=\"selectable\" data-number=\""+position+"\">"+position+"</li>");0===index&&$orderer.addClass("active"),$orderList.append($orderer)})}});return GraphicOrderInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/GraphicOrderInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/GraphicOrderInteraction","taoQtiItem/qtiCreator/widgets/interactions/graphicOrderInteraction/Widget"],function(_,GraphicOrderInteraction,GraphicOrderInteractionWidget){'use strict';var CreatorGraphicOrderInteraction=_.clone(GraphicOrderInteraction);return CreatorGraphicOrderInteraction.render=function(interaction,options){options=options||{},options.baseUrl=this.getOption("baseUrl"),options.choiceForm=this.getOption("choiceOptionForm"),options.uri=this.getOption("uri"),options.lang=this.getOption("lang"),options.mediaManager=this.getOption("mediaManager"),options.assetManager=this.getAssetManager(),GraphicOrderInteractionWidget.build(interaction,GraphicOrderInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorGraphicOrderInteraction}),define("taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/states/Sleep",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Sleep"],function($,stateFactory,SleepState){'use strict';return stateFactory.extend(SleepState,function(){var widget=this.widget,interaction=widget.element;widget.on("metaChange",function(data){"responsive"===data.key&&(!0===data.value?interaction.addClass("responsive"):interaction.removeClass("responsive"),widget.rebuild())})},function(){$(".image-editor.solid, .block-listing.source",this.widget.$container).css("min-width",0)})}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/hotspot",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Interaction Background",options):helperMissing.call(depth0,"__","Interaction Background",options)))+"</h3>\n\n <div class=\"panel\">\n <label for=\"data\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"File",options):helperMissing.call(depth0,"__","File",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The file path to the image.",options):helperMissing.call(depth0,"__","The file path to the image.",options)))+"</div>\n <input type=\"text\" name=\"data\" value=\"",(helper=helpers.data)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.data,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty; $fileExists(baseUrl=",(helper=helpers.baseUrl)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.baseUrl,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+")\"/>\n <button class=\"btn-info small block\" data-role=\"upload-trigger\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select image",options):helperMissing.call(depth0,"__","Select image",options)))+"</button>\n </div>\n\n <div class=\"panel media-sizer-panel\">\n <!-- media sizer goes here -->\n </div>\n <input name=\"width\" value=\"",(helper=helpers.width)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.width,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" />\n <input name=\"height\" value=\"",(helper=helpers.height)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.height,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" />\n\n\n <input name=\"type\" value=\"",(helper=helpers.type)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.type,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" readonly />\n\n</div>\n<div class=\"panel min-max-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Allowed choices",options):helperMissing.call(depth0,"__","Allowed choices",options)))+"</h3>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/states/Question",["jquery","lodash","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/helpers/graphicInteractionShapeEditor","taoQtiItem/qtiCreator/widgets/interactions/helpers/imageSelector","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/component/minMax/minMax","taoQtiItem/qtiCreator/widgets/helpers/identifier","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/hotspot","tpl!taoQtiItem/qtiCreator/tpl/forms/choices/hotspot","taoQtiItem/qtiCreator/helper/panel","taoQtiItem/qtiCreator/widgets/interactions/helpers/bgImage"],function($,_,GraphicHelper,stateFactory,Question,shapeEditor,imageSelector,formElement,minMaxComponentFactory,identifierHelper,formTpl,choiceFormTpl,panel,bgImage){'use strict';var HotspotInteractionStateQuestion=stateFactory.extend(Question,function(){function enterChoiceForm(serial){var choice=interaction.getChoice(serial),element,bbox;choice&&(element=interaction.paper.getById(serial),bbox=element.getBBox(),$choiceForm.empty().html(choiceFormTpl({identifier:choice.id(),fixed:choice.attr("fixed"),serial:serial,x:parseInt(bbox.x,10),y:parseInt(bbox.y,10),width:parseInt(bbox.width,10),height:parseInt(bbox.height,10)})),formElement.initWidget($choiceForm),formElement.setChangeCallbacks($choiceForm,choice,{identifier:identifierHelper.updateChoiceIdentifier,fixed:formElement.getAttributeChangeCallback()}),$formChoicePanel.show(),panel.openSections($formChoicePanel.children("section")),panel.closeSections($formInteractionPanel.children("section")),$left=$("input[name=x]",$choiceForm),$top=$("input[name=y]",$choiceForm),$width=$("input[name=width]",$choiceForm),$height=$("input[name=height]",$choiceForm))}function leaveChoiceForm(){"none"!==$formChoicePanel.css("display")&&(panel.openSections($formInteractionPanel.children("section")),$formChoicePanel.hide(),$choiceForm.empty())}var widget=this.widget,interaction=widget.element,paper=interaction.paper,$choiceForm=widget.choiceForm,$formInteractionPanel=$("#item-editor-interaction-property-bar"),$formChoicePanel=$("#item-editor-choice-property-bar"),$left,$top,$width,$height;paper&&(widget._editor=shapeEditor(widget,{shapeCreated:function shapeCreated(shape,type){var newChoice=interaction.createChoice({shape:"path"===type?"poly":type,coords:GraphicHelper.qtiCoords(shape)});shape.id=newChoice.serial},shapeRemoved:function shapeRemoved(id){interaction.removeChoice(id)},enterHandling:function enterHandling(shape){enterChoiceForm(shape.id)},quitHandling:function quitHandling(){leaveChoiceForm()},shapeChange:function shapeChange(shape){var choice=interaction.getChoice(shape.id),bbox;choice&&(choice.attr("coords",GraphicHelper.qtiCoords(shape)),$left&&$left.length&&(bbox=shape.getBBox(),$left.val(parseInt(bbox.x,10)),$top.val(parseInt(bbox.y,10)),$width.val(parseInt(bbox.width,10)),$height.val(parseInt(bbox.height,10))))}}),widget._editor.create(),$(window).on("resize.changestate",function(){widget.changeState("sleep")}))},function(){var widget=this.widget,interaction=widget.element,paper=interaction.paper,valid=!!interaction.object.attr("data")&&!_.isEmpty(interaction.choices);widget.isValid("hotspotInteraction",valid),paper&&($(window).off("resize.changestate"),widget._editor&&widget._editor.destroy(),$(".image-editor.solid, .block-listing.source",widget.$container).css("min-width",0))});return HotspotInteractionStateQuestion.prototype.initForm=function(){var widget=this.widget,options=widget.options,interaction=widget.element,$form=widget.$form;$form.html(formTpl({baseUrl:options.baseUrl,data:interaction.object.attr("data"),width:interaction.object.attr("width"),height:interaction.object.attr("height"),type:interaction.object.attr("type")})),minMaxComponentFactory($form.find(".min-max-panel"),{min:{value:_.parseInt(interaction.attr("minChoices"))||0},max:{value:_.parseInt(interaction.attr("maxChoices"))||0},upperThreshold:_.size(interaction.getChoices())}).on("render",function(){var self=this;widget.on("choiceCreated choiceDeleted",function(data){data.interaction.serial===interaction.serial&&self.updateThresholds(1,_.size(interaction.getChoices()))})}),imageSelector($form,options),formElement.initWidget($form),bgImage.setupImage(widget),bgImage.setChangeCallbacks(widget,formElement,formElement.getMinMaxAttributeCallbacks("minChoices","maxChoices"))},HotspotInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/states/Correct",["lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCommonRenderer/renderers/interactions/HotspotInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse"],function(_,__,stateFactory,Correct,commonRenderer,instructionMgr,PciResponse){'use strict';return stateFactory.create(Correct,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration();commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction);interaction.paper&&(instructionMgr.appendInstruction(interaction,__("Please select the correct hotspot choices below.")),commonRenderer.render.call(interaction.getRenderer(),interaction),commonRenderer.setResponse(interaction,PciResponse.serialize(_.values(response.getCorrect()),interaction)),widget.$container.on("responseChange.qti-widget",function(e,data){response.setCorrect(PciResponse.unserialize(data.response,interaction))}))},function(){var widget=this.widget,interaction=widget.element;interaction.paper&&(widget.$container.off("responseChange.qti-widget"),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction),interaction.paper=widget.createPaper(),widget.createChoices())})}),define("taoQtiItem/qtiCreator/widgets/interactions/helpers/graphicScorePopup",["jquery","lodash"],function($){var _Mathround7=Math.round;return function(paper,shape,$container,isResponsive){var margin=10,$shape=$(shape.node),$element=$("<div class=\"mapping-editor arrow-left-top\"></div>"),boxOffset=$container.offset(),offset=$shape.offset(),bbox=shape.getBBox(),width=bbox.width,wfactor;return isResponsive&&(wfactor=paper.w/paper.width,width=_Mathround7(width*(2-wfactor))),$element.css({top:offset.top-boxOffset.top-margin,left:offset.left-boxOffset.left+width+margin}).appendTo($container),$element}}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/response/graphicScoreMappingForm",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <div class=\"panel\" data-edit=\"correct\">\n <label>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Correct",options):helperMissing.call(depth0,"__","Correct",options)))+"\n <input name=\"correct\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.correct,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\n <span class=\"icon-checkbox\"></span>\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Is this choice the correct response?",options):helperMissing.call(depth0,"__","Is this choice the correct response?",options)))+"</span>\n </div>\n",buffer}function program2(){return" checked=\"checked\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper,options;return buffer+="<a class=\"closer\" href=\"#\" data-close=\":parent .mapping-editor\"></a>\n <div class=\"form-container\">\n <h2>",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</h2>\n\n",stack1=helpers.unless.call(depth0,depth0&&depth0.noCorrect,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <div class=\"panel\">\n <label for=\"score\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Score",options):helperMissing.call(depth0,"__","Score",options)))+"</label>\n <input value=\"",(helper=helpers.score)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.score,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" data-for=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" name=\"score\" class=\"score\" data-validate=\"$numeric\" data-validate-option=\"$allowEmpty; $event(type=keyup)\" />\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Set the score for this response",options):helperMissing.call(depth0,"__","Set the score for this response",options)))+"</span>\n </div>\n <span class=\"arrow\"></span>\n <span class=\"arrow-cover\"></span>\n </div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/states/Map",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCommonRenderer/renderers/interactions/HotspotInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCreator/widgets/interactions/helpers/answerState","taoQtiItem/qtiCreator/widgets/interactions/helpers/graphicScorePopup","tpl!taoQtiItem/qtiCreator/tpl/forms/response/graphicScoreMappingForm","taoQtiItem/qtiCreator/widgets/helpers/formElement","ui/deleter","ui/tooltip"],function($,_,__,stateFactory,Map,commonRenderer,instructionMgr,graphicHelper,PciResponse,answerStateHelper,grahicScorePopup,mappingFormTpl,formElement,deleter,tooltip){'use strict';function initResponseMapping(widget){var scoreTexts={},interaction=widget.element,$container=widget.$original,isResponsive=$container.hasClass("responsive"),$imageBox=$(".main-image-box",$container),response=interaction.getResponseDeclaration(),mapEntries=response.getMapEntries(),corrects=_.values(response.getCorrect());_.forEach(interaction.getChoices(),function(choice){var shape=interaction.paper.getById(choice.serial),$popup=grahicScorePopup(interaction.paper,shape,$imageBox,isResponsive),score=mapEntries[choice.id()]||response.mappingAttributes.defaultValue||"0";scoreTexts[choice.serial]=graphicHelper.createShapeText(interaction.paper,shape,{id:"score-"+choice.serial,content:score,style:"score-text-default",shapeClick:!0}).data("default",!0);var $form=$(mappingFormTpl({identifier:choice.id(),correctDefined:answerStateHelper.isCorrectDefined(widget),correct:_.contains(response.getCorrect(),choice.id()),score:score,scoreMin:response.getMappingAttribute("lowerBound"),scoreMax:response.getMappingAttribute("upperBound")}));formElement.setChangeCallbacks($form,response,{score:function(response,value){var scoreText=scoreTexts[choice.serial];""===value?(response.removeMapEntry(choice.id()),scoreText.attr({text:response.mappingAttributes.defaultValue}).data("default",!0)):(response.setMapEntry(choice.id(),value,!0),scoreText.attr({text:value}).data("default",!1))},correct:function correct(response,value){!0===value?!_.contains(corrects,choice.id())&&(corrects.push(choice.id()),shape.active=!0,graphicHelper.updateElementState(shape,"active")):(corrects=_.without(corrects,choice.id()),shape.active=!1,graphicHelper.updateElementState(shape,"basic")),response.setCorrect(corrects)}}),shape.click(function(){$(".mapping-editor",$container).hide(),$popup.show()}),$popup.append($form)}),deleter($container),tooltip.lookup($container),interaction.paper.getById("bg-image-"+interaction.serial).click(function(){$(".mapping-editor",$container).hide()}),$(".mapping-editor",$container).on("click",".closer",function(){$(this).parent(".mapping-editor").hide()}),widget.on("mappingAttributeChange",function(data){"defaultValue"===data.key&&_.forEach(scoreTexts,function(scoreText){!0===scoreText.data("default")&&scoreText.attr({text:data.value})})})}return stateFactory.create(Map,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration();commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction);interaction.paper&&(instructionMgr.appendInstruction(interaction,__("Please the score of each hotspot choice.")),interaction.responseMappingMode=!0,interaction.paper=widget.createPaper(),widget.createChoices(),initResponseMapping(widget),commonRenderer.setResponse(interaction,PciResponse.serialize(_.values(response.getCorrect()),interaction)))},function(){var widget=this.widget,interaction=widget.element;interaction.paper&&(commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction),interaction.paper=widget.createPaper(),widget.createChoices())})}),define("taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/states/Sleep","taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/states/Map"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/Widget",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/graphicInteraction/Widget","taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/states/states"],function($,_,__,Widget,GraphicWidget,states){'use strict';var HotspotInteractionWidget=_.extend(Widget.clone(),GraphicWidget,{initCreator:function initCreator(options){var paper;this.baseUrl=options.baseUrl,this.choiceForm=options.choiceForm,this.registerStates(states),Widget.initCreator.call(this),paper=this.createPaper(),paper&&(this.element.paper=paper,this.createChoices())},destroy:function destroy(){var $container=this.$original,$item=$container.parents(".qti-item");$item.off("resize.gridEdit."+this.element.serial),$(window).off("resize.qti-widget."+this.element.serial),$container.off("resize.qti-widget."+this.element.serial),Widget.destroy.call(this)}});return HotspotInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/HotspotInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/HotspotInteraction","taoQtiItem/qtiCreator/widgets/interactions/hotspotInteraction/Widget"],function(_,HotspotInteraction,HotspotInteractionWidget){'use strict';var CreatorHotspotInteraction=_.clone(HotspotInteraction);return CreatorHotspotInteraction.render=function(interaction,options){options=options||{},options.baseUrl=this.getOption("baseUrl"),options.choiceForm=this.getOption("choiceOptionForm"),options.uri=this.getOption("uri"),options.lang=this.getOption("lang"),options.mediaManager=this.getOption("mediaManager"),options.assetManager=this.getAssetManager(),HotspotInteractionWidget.build(interaction,HotspotInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorHotspotInteraction}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/hottext",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="<div class=\"panel min-max-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Allowed choices",options):helperMissing.call(depth0,"__","Allowed choices",options)))+"</h3>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/hottext-create",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="<div class=\"rgt tlb-button\" title=\""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Create hottext",options):helperMissing.call(depth0,"__","Create hottext",options)))+"\" data-role=\"create-hottext\">\n <span class=\"icon-magicwand\"></span>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/hottextInteraction/states/Question",["jquery","lodash","module","i18n","ui/feedback","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiCreator/widgets/helpers/content","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/component/minMax/minMax","taoQtiItem/qtiCreator/widgets/helpers/selectionWrapper","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/hottext","tpl!taoQtiItem/qtiCreator/tpl/toolbars/htmlEditorTrigger","tpl!taoQtiItem/qtiCreator/tpl/toolbars/hottext-create"],function($,_,module,__,feedback,stateFactory,Question,htmlEditor,gridContentHelper,htmlContentHelper,formElement,minMaxComponentFactory,selectionWrapper,formTpl,toolbarTpl,newHottextBtnTpl){'use strict';var config=module.config(),allowedInlineStaticElts=["math"],HottextInteractionStateQuestion=stateFactory.extend(Question,function(){this.buildEditor()},function(){this.destroyEditor()});return HottextInteractionStateQuestion.prototype.buildEditor=function(){var _widget=this.widget,container=_widget.element.getBody(),$container=_widget.$container,$editableContainer=$container.find(".qti-flow-container"),$bodyTlb;$editableContainer.attr("data-html-editable-container",!0),htmlEditor.hasEditor($editableContainer)||($bodyTlb=$(toolbarTpl({serial:_widget.serial,state:"question"})),$editableContainer.append($bodyTlb),$bodyTlb.show(),this.initHottextCreator(),htmlEditor.buildEditor($editableContainer,{shieldInnerContent:!1,change:gridContentHelper.getChangeCallbackForBlockStatic(container),data:{container:container,widget:_widget},qtiInclude:!1}))},HottextInteractionStateQuestion.prototype.destroyEditor=function(){var $container=this.widget.$container,$flowContainer=$container.find(".qti-flow-container"),$editable=$container.find(".qti-flow-container [data-html-editable]");$editable.off("hottextcreator"),htmlEditor.destroyEditor($flowContainer),$flowContainer.find(".mini-tlb[data-role=cke-launcher-tlb]").remove()},HottextInteractionStateQuestion.prototype.initForm=function(){var widget=this.widget,$form=widget.$form,interaction=widget.element,callbacks;$form.html(formTpl()),minMaxComponentFactory($form.find(".min-max-panel"),{min:{value:_.parseInt(interaction.attr("minChoices"))||0},max:{value:_.parseInt(interaction.attr("maxChoices"))||0},upperThreshold:_.size(interaction.getChoices())}).on("render",function(){var _this28=this;widget.on("choiceCreated choiceDeleted",function(data){data.interaction.serial===interaction.serial&&_this28.updateThresholds(1,_.size(interaction.getChoices()))})}),formElement.initWidget($form),callbacks=formElement.getMinMaxAttributeCallbacks("minChoices","maxChoices"),formElement.setChangeCallbacks($form,interaction,callbacks)},HottextInteractionStateQuestion.prototype.initHottextCreator=function(){var _this29=this,interactionWidget=this.widget,$editable=interactionWidget.$container.find(".qti-flow-container [data-html-editable]"),$flowContainer=interactionWidget.$container.find(".qti-flow-container"),$toolbar=$flowContainer.find(".mini-tlb[data-role=cke-launcher-tlb]"),$newHottextBtn=$(newHottextBtnTpl()),$newHottext=$("<span>",{class:"widget-box","data-new":!0,"data-qti-class":"hottext"}),wrapper=selectionWrapper({$container:$editable,allowQtiElements:!1,whiteListQtiClasses:config.disallowHTMLInHottext?[]:allowedInlineStaticElts});$toolbar.append($newHottextBtn),$newHottextBtn.hide(),$editable.on("mouseup.hottextcreator",function(){wrapper.canWrap()?$newHottextBtn.show():$newHottextBtn.hide()}).on("blur.hottextcreator",function(){$newHottextBtn.hide()}),$newHottextBtn.on("mousedown.hottextcreator",function(){$newHottextBtn.hide();var $newHottextClone=$newHottext.clone(),$cloneContent=wrapper.getCloneOfContents();return $cloneContent.find("p").length?void feedback().error(__("Cannot create hottext from this selection. Please make sure the selection does not contain multiple lines.")):void(config.disallowHTMLInHottext?$cloneContent.text()===$cloneContent.html()&&wrapper.wrapWith($newHottextClone)?_this29.createNewHottext($newHottextClone):feedback().error(__("Cannot create hottext from this selection. Please make sure the selection does not contain both formatted and unformatted words.")):wrapper.wrapHTMLWith($newHottextClone)?_this29.createNewHottext($newHottextClone):feedback().error(__("Cannot create hottext from this selection.")))})},HottextInteractionStateQuestion.prototype.createNewHottext=function($hottextContent){var interactionWidget=this.widget,interaction=interactionWidget.element,$editable=interactionWidget.$container.find(".qti-flow-container [data-html-editable]"),$inlineStaticWidgets,newHottextElt,newHottextBody;htmlContentHelper.createElements(interaction.getBody(),$editable,htmlEditor.getData($editable),function(newHottextWidget){newHottextElt=newHottextWidget.element,$inlineStaticWidgets=$hottextContent.find(allowedInlineStaticElts.map(function(qtiClass){return".widget-".concat(qtiClass)}).join(",")),$inlineStaticWidgets&&0<$inlineStaticWidgets.length&&$inlineStaticWidgets.each(function(){var serial=$(this).data("serial"),elt=interaction.getElement(serial),eltWidget=elt.data("widget");interaction.removeElement(elt),newHottextElt.setElement(elt),$(this).replaceWith(elt.placeholder()),eltWidget.destroy()}),newHottextBody=config.disallowHTMLInHottext?_.escape($hottextContent.text()):$hottextContent.html(),""!==newHottextBody.trim()&&(newHottextElt.body(newHottextBody),newHottextElt.render(newHottextElt.getContainer()),newHottextElt.postRender(),newHottextWidget.destroy(),newHottextWidget=newHottextElt.data("widget"),newHottextWidget.changeState("choice"),$(document).trigger("choiceCreated.qti-widget",{interaction:interaction}))})},HottextInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/hottextInteraction/states/Correct",["lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCommonRenderer/renderers/interactions/HottextInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/PciResponse"],function(_,__,stateFactory,Correct,commonRenderer,instructionMgr,PciResponse){'use strict';return stateFactory.create(Correct,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration();this.widget.$original.find(".hottext-checkmark > input").removeProp("disabled"),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.appendInstruction(interaction,__("Please select the correct hottext choices below.")),commonRenderer.render.call(interaction.getRenderer(),interaction),commonRenderer.setResponse(interaction,PciResponse.serialize(_.values(response.getCorrect()),interaction)),widget.$container.on("responseChange.qti-widget",function(e,data){response.setCorrect(PciResponse.unserialize(data.response,interaction))})},function(){var widget=this.widget,interaction=widget.element;this.widget.$original.find(".hottext-checkmark > input").prop("disabled","disabled"),widget.$container.off("responseChange.qti-widget"),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction)})}),define("tpl!taoQtiItem/qtiCreator/tpl/interactions/hottextInteraction.score",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<input type=\"text\"\n name=\"",(helper=helpers.id)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.id,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n class=\"score\"\n data-validate=\"$numeric\"\n data-validate-option=\"$allowEmpty; $event(type=keyup)\"\n value=\"",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/hottextInteraction/states/Map",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCommonRenderer/renderers/interactions/HottextInteraction","taoQtiItem/qtiCreator/widgets/interactions/helpers/answerState","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/helpers/placeholder","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","tpl!taoQtiItem/qtiCreator/tpl/interactions/hottextInteraction.score"],function($,_,__,stateFactory,Map,commonRenderer,answerStateHelper,instructionMgr,formElement,placeholder,PciResponse,scoreTpl){'use strict';function toggleCorrectState($container,enable){enable?$(".hottext-checkmark > input",$container).removeProp("disabled").removeClass("disabled"):$(".hottext-checkmark > input",$container).prop("disabled",!0).prop("checked",!1).addClass("disabled")}function createScoreForm(interaction,$container){var callbacks={},response=interaction.getResponseDeclaration(),mapEntries=response.getMapEntries();$(".hottext",$container).on("click",function(e){($(e.target).hasClass("score")||!1===answerStateHelper.defineCorrect(response))&&(e.preventDefault(),e.stopImmediatePropagation())}),_.forEach(interaction.getChoices(),function(choice){var id=choice.serial+"-score",inputVal="undefined"==typeof mapEntries[choice.id()]?"":mapEntries[choice.id()],$hottext=$("[data-serial=\""+choice.serial+"\"]",$container);$hottext.length&&($hottext.append(scoreTpl({id:id,value:inputVal})),callbacks[id]=function(res,value){""===value?res.removeMapEntry(choice.id()):res.setMapEntry(choice.id(),value,!0)})}),formElement.setChangeCallbacks($container,response,callbacks)}return stateFactory.create(Map,function(){var widget=this.widget,interaction=widget.element,response=interaction.getResponseDeclaration(),corrects=_.values(response.getCorrect());commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.appendInstruction(interaction,__("Please enter the score for the given hottexts.")),interaction.responseMappingMode=!0,createScoreForm(interaction,widget.$container),commonRenderer.render.call(interaction.getRenderer(),interaction),commonRenderer.setResponse(interaction,PciResponse.serialize(corrects,interaction)),widget.$container.on("responseChange.qti-widget",function(e,data){var type="single"===response.attr("cardinality")?"base":"list";data&&data.response&&data.response[type]&&response.setCorrect(data.response[type].identifier)}),widget.on("metaChange",function(meta){"defineCorrect"===meta.key&&(toggleCorrectState(widget.$container,meta.value),!1===meta.value&&response.setCorrect([]))}),toggleCorrectState(widget.$container,answerStateHelper.defineCorrect(response)),widget.on("mappingAttributeChange",function(data){"defaultValue"===data.key&&placeholder.score(widget,data.value)}),placeholder.score(widget)},function(){var widget=this.widget,interaction=widget.element,$container=widget.$container;$container.off("responseChange.qti-widget"),$(".score",$container).remove(),toggleCorrectState($container,!0),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction),this.widget.$original.find(".hottext-checkmark > input").prop("disabled","disabled")})}),define("taoQtiItem/qtiCreator/widgets/interactions/hottextInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/hottextInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/hottextInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/hottextInteraction/states/Map"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/hottextInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/hottextInteraction/states/states"],function(Widget,states){var HottextInteractionWidget=Widget.clone();return HottextInteractionWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this)},HottextInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/HottextInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/HottextInteraction","taoQtiItem/qtiCreator/widgets/interactions/hottextInteraction/Widget"],function(_,HottextInteraction,HottextInteractionWidget){'use strict';var CreatorHottextInteraction=_.clone(HottextInteraction);return CreatorHottextInteraction.render=function(interaction,options){HottextInteractionWidget.build(interaction,HottextInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorHottextInteraction}),define("taoQtiItem/qtiCreator/widgets/choices/inlineChoice/states/Question",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Question","taoQtiItem/qtiCreator/widgets/choices/helpers/formElement","lodash"],function($,stateFactory,QuestionState,formElement,_){'use strict';var ChoiceStateQuestion=stateFactory.extend(QuestionState,function(){this.buildEditor()},function(){this.destroyEditor()});return ChoiceStateQuestion.prototype.createToolbar=function(){var _widget=this.widget,$toolbar=_widget.$container.find("td:last");return formElement.initShufflePinToggle(_widget),formElement.initDelete(_widget),$toolbar},ChoiceStateQuestion.prototype.buildEditor=function(){var _widget=this.widget;_widget.$container.find(".editable-content").attr("contentEditable",!0).on("keyup.qti-widget",_.throttle(function(){_widget.element.val(_.escape($(this).text())),_widget.$original.width($(this).width())},200)).on("focus.qti-widget",function(){_widget.changeState("choice")}).on("keypress.qti-widget",function(e){13===e.which&&(e.preventDefault(),$(this).blur(),_widget.changeState("question"))})},ChoiceStateQuestion.prototype.destroyEditor=function(){this.widget.$container.find(".editable-content").removeAttr("contentEditable").off("keyup.qti-widget")},ChoiceStateQuestion}),define("taoQtiItem/qtiCreator/widgets/choices/inlineChoice/states/Choice",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/Choice","tpl!taoQtiItem/qtiCreator/tpl/forms/choices/choice","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/helpers/identifier"],function(stateFactory,Choice,formTpl,formElement,identifierHelper){var InlineChoiceStateChoice=stateFactory.extend(Choice);return InlineChoiceStateChoice.prototype.initForm=function(){var _widget=this.widget;_widget.$form.html(formTpl({serial:_widget.element.getSerial(),identifier:_widget.element.id()})),formElement.setChangeCallbacks(_widget.$form,_widget.element,{identifier:identifierHelper.updateChoiceIdentifier})},InlineChoiceStateChoice}),define("taoQtiItem/qtiCreator/widgets/choices/inlineChoice/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/choices/states/states","taoQtiItem/qtiCreator/widgets/choices/inlineChoice/states/Question","taoQtiItem/qtiCreator/widgets/choices/inlineChoice/states/Choice"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/choices/inlineChoice/Widget",["taoQtiItem/qtiCreator/widgets/choices/Widget","taoQtiItem/qtiCreator/widgets/choices/inlineChoice/states/states"],function(Widget,states){var InlineChoiceWidget=Widget.clone();return InlineChoiceWidget.initCreator=function(){Widget.initCreator.call(this),this.registerStates(states)},InlineChoiceWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/inlineChoice",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(){return"checked=\"checked\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",self=this,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label>\n <input name=\"shuffle\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.shuffle,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Shuffle choices",options):helperMissing.call(depth0,"__","Shuffle choices",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"If the shuffle attribute is true then the delivery engine will randomize the order in which the choices are initially presented.\n However each choice may be \u201Cshuffled\u201D of \u201Cfixed\u201D individually.",options):helperMissing.call(depth0,"__","If the shuffle attribute is true then the delivery engine will randomize the order in which the choices are initially presented.\n However each choice may be \u201Cshuffled\u201D of \u201Cfixed\u201D individually.",options)))+"\n </span>\n</div>\n<div class=\"panel\">\n <label>\n <input name=\"required\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.required,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"required",options):helperMissing.call(depth0,"__","required",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Define whether a choice must be selected by the candidate in order to form a valid response to the interaction.",options):helperMissing.call(depth0,"__","Define whether a choice must be selected by the candidate in order to form a valid response to the interaction.",options)))+"\n </span>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/states/Question",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Question","taoQtiItem/qtiCreator/widgets/helpers/formElement","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/inlineChoice"],function($,stateFactory,Question,formElement,formTpl){var InlineChoiceInteractionStateQuestion=stateFactory.extend(Question,function(){var $mainOption=this.widget.$container.find(".main-option"),$original=this.widget.$original;$(document).on("choiceTextChange.qti-widget.question",function(){$original.width($mainOption.width())})},function(){$(document).off(".qti-widget.question")});return InlineChoiceInteractionStateQuestion.prototype.addNewChoiceButton=function(){var _widget=this.widget,$addChoice=_widget.$container.find(".add-option"),interaction=_widget.element;$addChoice.data("initialized")||($addChoice.on("click.qti-widget",function(e){e.stopPropagation();var choice=interaction.createChoice();$(this).closest("tr").before(_widget.renderChoice(choice)),_widget.buildChoice(choice,{ready:function ready(widget){widget.changeState("question")}})}),$addChoice.data("initialized",!0))},InlineChoiceInteractionStateQuestion.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,interaction=_widget.element;$form.html(formTpl({shuffle:!!interaction.attr("shuffle"),required:!!interaction.attr("required")})),formElement.initWidget($form),formElement.setChangeCallbacks($form,interaction,{shuffle:formElement.getAttributeChangeCallback(),required:formElement.getAttributeChangeCallback()})},InlineChoiceInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/ResponseWidget",["jquery","lodash","i18n","taoQtiItem/qtiCommonRenderer/renderers/Renderer","taoQtiItem/qtiCreator/widgets/helpers/placeholder"],function($,_,__,CommonRenderer,placeholder){'use strict';return{create:function create(widget,responseMappingMode,callback){var self=this,interaction=widget.element,$placeholder=$("<select>"),$responseWidget=widget.$container.find(".widget-response").append($placeholder);this.commonRenderer=new CommonRenderer({shuffleChoices:!1,themes:!1}),responseMappingMode&&(widget.on("mappingAttributeChange",function(data){"defaultValue"===data.key&&placeholder.score(widget,data.value)}),placeholder.score(widget)),this.commonRenderer.load(function(){interaction.render({},$placeholder,"",this),interaction.postRender({allowEmpty:!1,placeholderText:__("select correct choice")},"",this),callback.call(self,this),$responseWidget.siblings(".padding").width($responseWidget.width()+50)},["inlineChoice","inlineChoiceInteraction"])},setResponse:function setResponse(widget,response){this.commonRenderer.setResponse(widget.element,this.formatResponse(response))},destroy:function destroy(widget){widget.$container.find(".widget-response").empty(),widget.$container.find(".padding").removeAttr("style")},formatResponse:function formatResponse(response){return _.isString(response)||(response=_.values(response),response&&response.length&&(response=response[0])),{base:{identifier:response}}},unformatResponse:function unformatResponse(formatedResponse){var response=[];return formatedResponse.base&&formatedResponse.base.identifier&&response.push(formatedResponse.base.identifier),response}}}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/states/Correct",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/ResponseWidget","lodash"],function(stateFactory,Correct,responseWidget,_){var InlineChoiceInteractionStateCorrect=stateFactory.create(Correct,function(){var _widget=this.widget,response=this.widget.element.getResponseDeclaration();_widget.$container.find("table").hide(),responseWidget.create(_widget,!1,function(){responseWidget.setResponse(_widget,_.values(response.getCorrect())),_widget.$container.on("responseChange.qti-widget",function(e,data){response.setCorrect(responseWidget.unformatResponse(data.response))})})},function(){var $container=this.widget.$container;$container.find("table").show(),$container.off("responseChange.qti-widget"),responseWidget.destroy(this.widget)});return InlineChoiceInteractionStateCorrect}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/states/Map",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/ResponseWidget","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiItem/helper/interactionHelper","lodash"],function($,stateFactory,Map,responseWidget,formElement,interactionHelper,_){var AssociateInteractionStateCorrect=stateFactory.create(Map,function(){var _widget=this.widget,$container=_widget.$container,interaction=_widget.element,response=interaction.getResponseDeclaration();$container.find("[data-edit=map]").show();var correct=_.values(response.getCorrect());if(correct.length){var selectedChoice=interaction.getChoiceByIdentifier(correct.pop());selectedChoice&&$container.find("input[name=correct][value=\""+selectedChoice.serial+"\"]").prop("checked",!0)}_.forEach(response.getMapEntries(),function(score,choice){var element=interaction.getChoiceByIdentifier(choice);element&&$container.find("input[name=score][data-for=\""+element.serial+"\"]").val(score)}),formElement.setChangeCallbacks($container,response,{correct:function(response,value){response.setCorrect(interactionHelper.serialToIdentifier(interaction,value))},score:function(response,value){var score=parseFloat(value);isNaN(score)||response.setMapEntry(interactionHelper.serialToIdentifier(interaction,$(this).data("for")),score)}}),responseWidget.create(_widget,!0,function(){responseWidget.setResponse(_widget,_.values(response.getCorrect())),_widget.$container.on("responseChange.qti-widget",function(e,data){response.setCorrect(responseWidget.unformatResponse(data.response))})})},function(){var $container=this.widget.$container;$container.find("table").show(),$container.off("responseChange.qti-widget"),responseWidget.destroy(this.widget)});return AssociateInteractionStateCorrect}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/states/NoRp",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/NoRp"],function(stateFactory,NoRp){'use strict';return stateFactory.extend(NoRp,function(){this.widget.$container.find(".qti-choice").hide()},function(){this.widget.$container.find(".qti-choice").show()})}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/states/Map","taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/states/NoRp"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/inlineChoiceInteraction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<div class=\"widget-box widget-inline widget-inlineChoiceInteraction\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-edit=\"active\">\n <div class=\"qti-interaction qti-inlineChoiceInteraction\">\n <table>\n <colgroup>\n <col class=\"text\">\n <col class=\"icon\">\n <col class=\"icon\">\n </colgroup>\n <tbody>\n <tr>\n <td class=\"main-option\"><div>-- "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"edit choices",options):helperMissing.call(depth0,"__","edit choices",options)))+" --<span class=\"icon-down\"></span></div></td>\n <td class=\"icon-title\" data-edit=\"map\">correct</td>\n <td class=\"icon-title\" data-edit=\"map\">score</td>\n </tr>\n ",options={hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data},(helper=helpers.choices)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.choices,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.choices||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <tr data-edit=\"question\">\n <td>\n <div class=\"add-option\">\n <span class=\"icon-add\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Add choice",options):helperMissing.call(depth0,"__","Add choice",options)))+"\n </div>\n </td>\n <td colspan=\"2\"></td>\n </tr>\n </tbody>\n </table>\n <div>\n <div class=\"widget-response\" data-edit=\"correct\"></div>\n <div class=\"padding\"></div>\n </div>\n </div>\n</div>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/inlineChoice",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<tr class=\"widget-box widget-inlineChoice qti-choice\" data-edit=\"active\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <td class=\"option\"><div class=\"editable-content\" contenteditable=\"true\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</div></td>\n <td class=\"mini-tlb\">\n <span data-edit=\"question\" class=\"tlb-button\">\n <span class=\"icon-",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.fixed),{hash:{},inverse:self.program(3,function(){return"shuffle"},data),fn:self.program(1,function(){return"pin"},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-role=\"shuffle-pin\" style=\"",stack1=helpers["if"].call(depth0,depth0&&depth0.interactionShuffle,{hash:{},inverse:self.program(7,function(){return"display:none;"},data),fn:self.program(5,function(){return""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"></span>\n </span>\n <label data-edit=\"map\">\n <input name=\"correct\" type=\"radio\" value=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <span class=\"icon-radio\"></span>\n </label>\n </td>\n <td class=\"mini-tlb\">\n <span data-edit=\"question\" class=\"icon-bin\" data-role=\"delete\"></span>\n <input class=\"score\" name=\"score\" data-edit=\"map\" value=\"",(helper=helpers.score)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.score,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$numeric\" data-validate-option=\"$allowEmpty; $event(type=keyup)\"/>\n </td>\n</tr>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/Widget",["lodash","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/Widget","taoQtiItem/qtiCreator/widgets/choices/inlineChoice/Widget","taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/states/states","tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/inlineChoiceInteraction","tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/inlineChoice"],function(_,Element,InteractionWidget,ChoiceWidget,states,inlineChoiceInteractionTpl,inlineChoiceTpl){var InlineChoiceInteractionWidget=InteractionWidget.clone();return InlineChoiceInteractionWidget.initCreator=function(options){var _this=this;this.registerStates(states),InteractionWidget.initCreator.call(this),this.$choiceOptionForm=options.choiceOptionForm,_.each(this.element.getChoices(),function(choice){_this.buildChoice(choice)}),this.$container.find(".tlb-title").remove()},InlineChoiceInteractionWidget.renderChoice=function(choice,shuffleChoice){var tplData={tag:choice.qtiClass,serial:choice.serial,attributes:choice.attributes,body:_.unescape(choice.text),interactionShuffle:shuffleChoice};return inlineChoiceTpl(tplData)},InlineChoiceInteractionWidget.renderInteraction=function(){var _this=this,interaction=this.element,shuffleChoice=interaction.attr("shuffle"),tplData={tag:interaction.qtiClass,serial:interaction.serial,attributes:interaction.attributes,choices:[]};return _.each(interaction.getChoices(),function(choice){Element.isA(choice,"choice")&&tplData.choices.push(_this.renderChoice(choice,shuffleChoice))}),inlineChoiceInteractionTpl(tplData)},InlineChoiceInteractionWidget.buildChoice=function(choice,options){ChoiceWidget.build(choice,this.$container.find(".widget-inlineChoice[data-serial=\""+choice.serial+"\"]"),this.$choiceOptionForm,options)},InlineChoiceInteractionWidget.buildContainer=function(){var previous,next;this.$original.length&&(previous=this.$original[0].previousSibling,next=this.$original[0].nextSibling,(!previous||3===previous.nodeType&&""===previous.nodeValue||3!==previous.nodeType)&&this.$original.before("&nbsp;"),(!next||3===next.nodeType&&""===next.nodeValue||3!==next.nodeType)&&this.$original.after("&nbsp;")),this.$itemContainer=this.$original.parents(".item-editor-item"),this.$itemContainer.append(this.renderInteraction()),this.$container=this.$itemContainer.find(".widget-inlineChoiceInteraction[data-serial="+this.element.getSerial()+"]")},InlineChoiceInteractionWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/inlineChoiceInteraction.placeholder",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<span class=\"widget-box inlineChoiceInteraction-placeholder\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"inlineChoiceInteraction\">\n <label>-- "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"edit choices",options):helperMissing.call(depth0,"__","edit choices",options)))+" --</label>\n <span class=\"icon-down\"></span>\n</span>",buffer})}),define("taoQtiItem/qtiCreator/renderers/interactions/InlineChoiceInteraction",["jquery","lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/InlineChoiceInteraction","taoQtiItem/qtiCreator/widgets/interactions/inlineChoiceInteraction/Widget","tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/inlineChoiceInteraction.placeholder"],function($,_,InlineChoiceInteraction,InlineChoiceInteractionWidget,tpl){'use strict';var CreatorInlineChoiceInteraction=_.clone(InlineChoiceInteraction);return CreatorInlineChoiceInteraction.template=tpl,CreatorInlineChoiceInteraction.render=function(interaction,options){options=options||{},options.choiceOptionForm=this.getOption("choiceOptionForm"),InlineChoiceInteractionWidget.build(interaction,$(".inlineChoiceInteraction-placeholder[data-serial=\""+interaction.serial+"\"]"),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorInlineChoiceInteraction}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/matchInteraction.adder",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{},"<div class=\"clearfix add-options\" data-edit=\"question\">\n <div class=\"rgt\">\n <span class=\"add-option\" data-role=\"add-row\"><span class=\"icon-add\"></span>Add new row</span>\n <span class=\"add-option\" data-role=\"add-col\"><span class=\"icon-add\"></span>Add new column</span>\n </div>\n</div>"})}),define("tpl!taoQtiItem/qtiCreator/tpl/interactions/matchInteraction.row",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<tr>\n ",(helper=helpers.choice)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.choice,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=(helper=helpers["for"]||depth0&&depth0["for"],options={hash:{},inverse:self.noop,fn:self.program(1,function(){return"\n <td>\n <label>\n <input type=\"checkbox\" >\n <span class=\"icon-checkbox cross\"></span>\n </label>\n </td>\n "},data),data:data},helper?helper.call(depth0,0,depth0&&depth0.otherMatchSetCount,1,options):helperMissing.call(depth0,"for",0,depth0&&depth0.otherMatchSetCount,1,options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</tr>",buffer})}),define("tpl!taoQtiItem/qtiCreator/tpl/interactions/matchInteraction.cell",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{},"<td>\n <label>\n <input type=\"checkbox\" >\n <span class=\"icon-checkbox cross\"></span>\n </label>\n</td>"})}),define("taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/states/Question",["jquery","lodash","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/associateInteraction/states/Question","tpl!taoQtiItem/qtiCreator/tpl/toolbars/matchInteraction.adder","tpl!taoQtiItem/qtiCreator/tpl/interactions/matchInteraction.row","tpl!taoQtiItem/qtiCreator/tpl/interactions/matchInteraction.cell","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter"],function($,_,stateFactory,Question,AssociateInteractionQuestionState,adderTpl,rowTpl,cellTpl,sizeAdapter){'use strict';var MatchInteractionStateQuestion=stateFactory.extend(Question);return MatchInteractionStateQuestion.prototype.initForm=AssociateInteractionQuestionState.prototype.initForm,MatchInteractionStateQuestion.prototype.addNewChoiceButton=function(){var widget=this.widget,interaction=widget.element,$matchArea=widget.$container.find(".match-interaction-area"),_postRender=function(choice){choice.postRender({ready:function ready(widget){widget.changeState("question")}},"simpleAssociableChoice.matchInteraction")};$matchArea.find(".add-option").length||($matchArea.append(adderTpl()),$matchArea.find(".add-options").show(),$matchArea.find(".add-option[data-role=add-col]").on("click",function(){var choice=interaction.createChoice(0);$matchArea.find("thead > tr").append(choice.render("simpleAssociableChoice.matchInteraction")),$matchArea.find("tbody > tr").append(cellTpl({})),_postRender(choice)}),$matchArea.find(".add-option[data-role=add-row]").on("click",function(){var choice=interaction.createChoice(1);$matchArea.find("tbody").append(rowTpl({choice:choice.render("simpleAssociableChoice.matchInteraction"),otherMatchSetCount:_.size(interaction.choices[0])})),_postRender(choice)})),$matchArea.find("tr ").each(function(){var $elements=$(this).find("[data-html-editable=\"true\"]");widget.on("containerBodyChange",function(){sizeAdapter.adaptSize($elements)})})},MatchInteractionStateQuestion}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/matchInteraction.score",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<input value=\"",(helper=helpers.score)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.score,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n type=\"text\" \n data-for=\"",(helper=helpers.choiceIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.choiceIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n name=\"score\" \n class=\"score\" \n placeholder = \"",(helper=helpers.placeholder)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.placeholder,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-validate=\"$numeric\" \n data-validate-option=\"$allowEmpty; $event(type=keyup)\" />",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/ResponseWidget",["jquery","taoQtiItem/qtiCommonRenderer/renderers/interactions/MatchInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCreator/widgets/helpers/formElement","tpl!taoQtiItem/qtiCreator/tpl/toolbars/matchInteraction.score","lodash","i18n"],function($,commonRenderer,instructionMgr,formElement,scoreTpl,_,__){'use strict';var ResponseWidget={create:function create(widget,responseMappingMode){var interaction=widget.element;commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),responseMappingMode?(instructionMgr.appendInstruction(widget.element,__("Please define the correct response and the score below.")),interaction.data("responseMappingMode",!0),ResponseWidget.createScoreWidgets(widget),ResponseWidget.createCorrectWidgets(widget)):(instructionMgr.appendInstruction(widget.element,__("Please define the correct response below.")),ResponseWidget.createCorrectWidgets(widget)),commonRenderer.render(interaction),widget.$container.find("table.matrix input[type=checkbox]").removeProp("disabled").attr("data-edit","correct").attr("data-role","correct")},setResponse:function setResponse(interaction,response){commonRenderer.setResponse(interaction,ResponseWidget.formatResponse(response))},destroy:function destroy(widget){var interaction=widget.element;interaction.removeData("responseMappingMode"),widget.$container.find("table.matrix input[type=checkbox]").prop("disabled","disabled"),widget.$container.find("table.matrix .score").remove(),widget.$container.off("responseChange.qti-widget"),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction)},createScoreWidgets:function createScoreWidgets(widget){var $container=widget.$container,interaction=widget.element,response=interaction.getResponseDeclaration(),mapEntries=response.getMapEntries(),defaultValue=response.getMappingAttribute("defaultValue");$container.find("table.matrix td>label").each(function(){var pairId=commonRenderer.inferValue(this).join(" ");$(this).append(scoreTpl({serial:interaction.getSerial(),choiceIdentifier:pairId,score:mapEntries[pairId]?mapEntries[pairId]:"",placeholder:defaultValue}))});var $scores=$container.find("table.matrix .score");$scores.on("click",function(e){e.stopPropagation(),e.preventDefault()}),widget.on("mappingAttributeChange",function(data){"defaultValue"===data.key&&$scores.attr("placeholder",data.value)}),formElement.setChangeCallbacks($container,response,{score:function score(response,value){var key=$(this).data("for");""===value?response.removeMapEntry(key):response.setMapEntry(key,value,!0)}})},createCorrectWidgets:function createCorrectWidgets(widget){var interaction=widget.element,response=interaction.getResponseDeclaration();widget.$container.on("responseChange.qti-widget",function(e,data){response.setCorrect(ResponseWidget.unformatResponse(data.response))})},formatResponse:function formatResponse(response){var formatedRes={list:{directedPair:[]}};if(1===_.size(response)){var pair=_.values(response).pop().split(" ");formatedRes={base:{directedPair:pair}}}else formatedRes={list:{directedPair:[]}},_.each(response,function(pairString){var pair=pairString.split(" ");formatedRes.list.directedPair.push(pair)});return formatedRes},unformatResponse:function unformatResponse(formatedResponse){var res=[];return formatedResponse.list&&formatedResponse.list.directedPair?_.each(formatedResponse.list.directedPair,function(pair){res.push(pair.join(" "))}):formatedResponse.base&&formatedResponse.base.directedPair&&res.push(formatedResponse.base.directedPair.join(" ")),res}};return ResponseWidget}),define("taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/states/Correct",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/ResponseWidget","lodash"],function(stateFactory,Correct,responseWidget,_){var MatchInteractionStateCorrect=stateFactory.create(Correct,function(){var _widget=this.widget,interaction=_widget.element,response=interaction.getResponseDeclaration();responseWidget.create(_widget),responseWidget.setResponse(interaction,_.values(response.getCorrect()))},function(){responseWidget.destroy(this.widget)});return MatchInteractionStateCorrect}),define("taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/states/Map",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/ResponseWidget","lodash"],function($,stateFactory,Map,responseWidget,_){return stateFactory.create(Map,function(){var interactionContainer=this.widget,interaction=interactionContainer.element,response=interaction.getResponseDeclaration(),matchInteractionArea=$(".match-interaction-area input[type=\"checkbox\"]",interactionContainer.$container);responseWidget.create(interactionContainer,!0),responseWidget.setResponse(interaction,_.values(response.getCorrect())),interactionContainer.on("metaChange",function(meta){"defineCorrect"===meta.key&&(meta.value?matchInteractionArea.removeProp("disabled").removeClass("disabled"):(matchInteractionArea.prop("disabled",!0).prop("checked",!1).addClass("disabled"),response.setCorrect([])))})},function(){$(".match-interaction-area input[type=\"checkbox\"]",this.widget.$container).removeProp("disabled").removeClass("disabled"),responseWidget.destroy(this.widget)})}),define("taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/states/Map"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/states/states"],function(Widget,states){var MatchInteractionWidget=Widget.clone();return MatchInteractionWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this)},MatchInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/MatchInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/MatchInteraction","taoQtiItem/qtiCreator/widgets/interactions/matchInteraction/Widget"],function(_,MatchInteraction,MatchInteractionWidget){'use strict';var CreatorMatchInteraction=_.clone(MatchInteraction);return CreatorMatchInteraction.render=function(interaction,options){MatchInteractionWidget.build(interaction,MatchInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorMatchInteraction}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/media",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(){return"checked=\"checked\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper,options;return buffer+="<div class=\"panel\">\n\n <div>\n <label>\n <div>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Media file path or YouTube video address",options):helperMissing.call(depth0,"__","Media file path or YouTube video address",options)))+"</div>\n <input type=\"text\" name=\"data\" placeholder=\"Please select media file\" value=\"",(helper=helpers.data)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.data,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty;\"/>\n <div><button class='selectMediaFile btn-info small block'>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select media file",options):helperMissing.call(depth0,"__","Select media file",options)))+"</button></div>\n </label>\n </div>\n\n <h3 class=\"media-sizer-panel-label\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Size and position",options):helperMissing.call(depth0,"__","Size and position",options)))+"</h3>\n <div class=\"panel media-sizer-panel\">\n <!-- mediaEditorComponent goes here -->\n </div>\n\n</div>\n\n<div class=\"panel\">\n <label>\n <input name=\"autostart\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.autostart,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Autostart",options):helperMissing.call(depth0,"__","Autostart",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The autostart attribute determines if the media object should begin as soon as the candidate starts the attempt (checked) or if the media object should be started under the control of the candidate (unchecked).",options):helperMissing.call(depth0,"__","The autostart attribute determines if the media object should begin as soon as the candidate starts the attempt (checked) or if the media object should be started under the control of the candidate (unchecked).",options)))+"\n </span>\n</div>\n\n<div class=\"panel\">\n <label>\n <input name=\"loop\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.loop,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Loop",options):helperMissing.call(depth0,"__","Loop",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The loop attribute is used to set continuous play mode. In continuous play mode, once the media object has started to play it should play continuously (subject to maxPlays).",options):helperMissing.call(depth0,"__","The loop attribute is used to set continuous play mode. In continuous play mode, once the media object has started to play it should play continuously (subject to maxPlays).",options)))+"\n </span>\n</div>\n\n<div class=\"panel\">\n <label>\n <input name=\"pause\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.pause,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Pause",options):helperMissing.call(depth0,"__","Pause",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Enable the test taker to pause and restart the playing.",options):helperMissing.call(depth0,"__","Enable the test taker to pause and restart the playing.",options)))+"\n </span>\n</div>\n\n<div class=\"panel\">\n <div>\n <label for=\"maxPlays\" class=\"spinner\">Max plays count</label>\n <input name=\"maxPlays\" value=\"",(helper=helpers.maxPlays)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxPlays,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" class=\"large\" data-increment=\"1\" data-min=\"0\" data-max=\"1000\" type=\"text\" />\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The maxPlays attribute indicates that the media object can be played at most maxPlays times - it must not be possible for the candidate to play the media object more than maxPlay times. A value of 0 (the default) indicates that there is no limit.",options):helperMissing.call(depth0,"__","The maxPlays attribute indicates that the media object can be played at most maxPlays times - it must not be possible for the candidate to play the media object more than maxPlay times. A value of 0 (the default) indicates that there is no limit.",options)))+"\n </span>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/mediaInteraction/states/Question",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/helpers/formElement","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/media","ui/mediaEditor/mediaEditorComponent","ui/resourcemgr","ui/tooltip","url-polyfill"],function($,_,__,stateFactory,Question,formElement,formTpl,mediaEditorComponent){'use strict';var _Mathround8=Math.round,_Mathmax5=Math.max,_Mathmin4=Math.min,mediaEditor=null,MediaInteractionStateQuestion=stateFactory.extend(Question,function(){this.widget.renderInteraction()},function(){this.widget.destroyInteraction()});return MediaInteractionStateQuestion.prototype.initForm=function(){var widget=this.widget,$form=widget.$form,$container=widget.$original,options=widget.options,interaction=widget.element,isAudio=!1,reRender=_.debounce(function(){interaction.attr("responseIdentifier",interaction.attr("responseIdentifier")),widget.destroyInteraction(),widget.renderInteraction()},1e3),switchToAudio=function(){isAudio=!0,$heightContainer.hide(),$mediaSizerLabel.hide(),interaction.object.attr("height",30),mediaEditor&&mediaEditor.destroy()},videoResponsiveWidth=function(){var originalSize=interaction.mediaElement.getMediaOriginalSize();if(!originalSize.width)return 0;var width=interaction.object.attr("width"),height=interaction.object.attr("height"),containerWidth=$container.find(".media-container").width();if(!width)width=_Mathround8(100/(containerWidth/originalSize.width));else if(height){var scaleWidth=width/originalSize.width,scale=scaleWidth;if(!/youtube/.test(interaction.object.attr("type"))){var scaleHeight=(_Mathmax5(height,200)-$container.find(".media-container .controls").height())/originalSize.height;scale=_Mathmin4(scaleHeight,scaleWidth)}width=_Mathround8(100/(containerWidth/(scale*originalSize.width)))}return width},createMediaEditor=function($panel,width,height,onChange){mediaEditor&&mediaEditor.destroy(),mediaEditor=mediaEditorComponent($panel,{$node:$container.find(".media-container .media"),$container:$container,type:interaction.object.attr("type"),width:width,height:height,responsive:!0},{mediaDimension:{active:!0,showResponsiveToggle:!1}}).on("change",onChange)},switchToVideo=function(){isAudio&&(isAudio=!1,interaction.object.attr("height",270),$heightContainer.show(),$mediaSizerLabel.show()),$container.off("playerready").on("playerready",function(){var width=interaction.object.attr("width"),height=interaction.object.attr("height");if(!/%/.test(width)){if(width=videoResponsiveWidth(widget),!width)return;height=0,interaction.object.removeAttr("height")}var onChange=_.debounce(function(nMedia){if(interaction.object.attr("width")!=="".concat(nMedia.width,"%")){var newWidth="".concat(_Mathround8(nMedia.width),"%");interaction.object.attr("width",newWidth),interaction.mediaElement.resize(newWidth,"auto")}},200);createMediaEditor($form.find(".media-sizer-panel"),width,height,onChange)})},callbacks,$heightContainer,$mediaSizerLabel;$form.html(formTpl({autostart:!!interaction.attr("autostart"),loop:!!interaction.attr("loop"),maxPlays:parseInt(interaction.attr("maxPlays"),10),pause:interaction.hasClass("pause"),data:interaction.object.attr("data"),type:interaction.object.attr("type")})),formElement.initWidget($form),$heightContainer=$(".height-container",$form),$mediaSizerLabel=$(".media-sizer-panel-label",$form),function(){/audio/.test(interaction.object.attr("type"))?switchToAudio():switchToVideo()}(),callbacks={autostart:function(boundInteraction,attrValue,attrName){interaction.attr(attrName,attrValue),reRender()},loop:function(boundInteraction,attrValue,attrName){interaction.attr(attrName,attrValue),reRender()},maxPlays:function(boundInteraction,attrValue,attrName){interaction.attr(attrName,attrValue),reRender()},pause:function(boundInteraction,attrValue){attrValue?!$container.hasClass("pause")&&($container.addClass("pause"),interaction.addClass("pause")):($container.removeClass("pause"),interaction.removeClass("pause"))},data:function(boundInteraction,attrValue,attrName){var value,youTubeUrl,parsedUrl;interaction.object.attr(attrName)!==attrValue&&(interaction.object.attr(attrName,attrValue),interaction.object.removeAttr("width"),interaction.object.removeAttr("height"),value=$.trim(attrValue).toLowerCase(),/^http(s)?:\/\/(www\.)?youtu/.test(value)?(attrValue.indexOf(!1)&&(youTubeUrl=new URL(attrValue),parsedUrl=new URL(youTubeUrl.origin+youTubeUrl.pathname),parsedUrl.searchParams.append("v",youTubeUrl.searchParams.get("v")),this.value=parsedUrl.toString()),interaction.object.attr("type","video/youtube"),switchToVideo()):/audio/.test(interaction.object.attr("type"))?switchToAudio():switchToVideo(),reRender())}},formElement.setChangeCallbacks($form,interaction,callbacks,{invalidate:!0}),function(){var $src=$form.find("input[name=data]"),$uploadTrigger=$form.find(".selectMediaFile"),openResourceMgr=function(){$uploadTrigger.resourcemgr({title:__("Please select a media file (video or audio) from the resource manager. You can add files from your computer with the button \"Add file(s)\"."),appendContainer:options.mediaManager.appendContainer,mediaSourcesUrl:options.mediaManager.mediaSourcesUrl,browseUrl:options.mediaManager.browseUrl,uploadUrl:options.mediaManager.uploadUrl,deleteUrl:options.mediaManager.deleteUrl,downloadUrl:options.mediaManager.downloadUrl,fileExistsUrl:options.mediaManager.fileExistsUrl,params:{uri:options.uri,lang:options.lang,filters:"video/mp4,video/avi,video/ogv,video/mpeg,video/ogg,video/quicktime,video/webm,video/x-ms-wmv,video/x-flv,audio/mp3,audio/vnd.wav,audio/ogg,audio/vorbis,audio/webm,audio/mpeg,application/ogg,audio/aac,audio/wav,audio/flac"},pathParam:"path",select:function select(e,files){files&&files.length?(interaction.object.attr("type",files[0].mime),$src.val(files[0].file).trigger("change")):$src.trigger("noselection")},open:function open(){$src.data("$tooltip")&&$src.blur().data("$tooltip").hide()},close:function close(){$src.blur()}})};$uploadTrigger.on("click",openResourceMgr),$src.val()||openResourceMgr()}()},MediaInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/mediaInteraction/states/Answer",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Answer"],function($,_,__,stateFactory,Answer){'use strict';return stateFactory.extend(Answer,function(){this.widget.renderInteraction()},function(){this.widget.destroyInteraction()})}),define("taoQtiItem/qtiCreator/widgets/interactions/mediaInteraction/states/Sleep",["lodash","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Sleep"],function(_,stateFactory,SleepState){return stateFactory.extend(SleepState,function(){this.widget.renderInteraction(),this.widget.$original.append("<div class=\"overlay\"></div>")},function(){this.widget.destroyInteraction(),this.widget.$original.children(".overlay").remove()})}),define("taoQtiItem/qtiCreator/widgets/interactions/mediaInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/mediaInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/mediaInteraction/states/Answer","taoQtiItem/qtiCreator/widgets/interactions/mediaInteraction/states/Sleep"],function(factory,states){'use strict';return factory.createBundle(states,arguments,["map"])}),define("taoQtiItem/qtiCreator/widgets/interactions/mediaInteraction/Widget",["jquery","lodash","taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/mediaInteraction/states/states","taoQtiItem/qtiCommonRenderer/renderers/interactions/MediaInteraction"],function($,_,Widget,states,commonRenderer){var MediaInteractionWidget=_.extend(Widget.clone(),{initCreator:function initCreator(){var self=this,$container=this.$original,$item=$container.parents(".qti-item");this.registerStates(states),Widget.initCreator.call(this),$item.off("."+this.element.serial).on("resize."+this.element.serial,_.throttle(function(){var width=$container.innerWidth();0<width&&(self.element.object.attr("width",$container.innerWidth()),self.destroyInteraction(),self.renderInteraction())},100))},destroy:function destroy(){var $container=this.$original,$item=$container.parents(".qti-item");$item.off("resize."+this.element.serial),Widget.destroy.call(this)},renderInteraction:function renderInteraction(){var $container=this.$original,interaction=this.element,autostart=interaction.attributes.autostart;interaction.attributes.autostart=!1,commonRenderer.render.call(interaction.getRenderer(),interaction,{features:"full",controlPlaying:!1}),interaction.attributes.autostart=autostart},destroyInteraction:function destroyInteraction(){var interaction=this.element;commonRenderer.resetResponse.call(interaction.getRenderer(),interaction),commonRenderer.destroy.call(interaction.getRenderer(),interaction)}});return MediaInteractionWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/interactions/mediaInteraction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div class=\"qti-interaction qti-blockInteraction qti-mediaInteraction\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n\t",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\t<div class=\"instruction-container\"></div>\n <div class=\"media-container\"></div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/renderers/interactions/MediaInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/MediaInteraction","taoQtiItem/qtiCreator/widgets/interactions/mediaInteraction/Widget","tpl!taoQtiItem/qtiCreator/tpl/interactions/mediaInteraction"],function(_,MediaInteraction,MediaInteractionWidget,tpl){'use strict';return MediaInteraction=_.clone(MediaInteraction),MediaInteraction.template=tpl,MediaInteraction.render=function(interaction,options){options=options||{},options.baseUrl=this.getOption("baseUrl"),options.uri=this.getOption("uri"),options.lang=this.getOption("lang"),options.mediaManager=this.getOption("mediaManager"),options.assetManager=this.getAssetManager(),MediaInteractionWidget.build(interaction,MediaInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options),$(document).on("open-preview.qti-item",function(){interaction.mediaElement.execute("stop")})},MediaInteraction}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/order",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program3(){return"checked"}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",self=this,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label>\n <input name=\"shuffle\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.shuffle,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Shuffle choices",options):helperMissing.call(depth0,"__","Shuffle choices",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"If the shuffle attribute is true then the delivery engine will randomize the order in which the choices are initially presented.\n However each choice may be \"shuffled\" of \"fixed\" individually.",options):helperMissing.call(depth0,"__","If the shuffle attribute is true then the delivery engine will randomize the order in which the choices are initially presented.\n However each choice may be \"shuffled\" of \"fixed\" individually.",options)))+"\n </span>\n</div>\n\n<hr/>\n<div class=\"panel min-max-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Allowed choices",options):helperMissing.call(depth0,"__","Allowed choices",options)))+"</h3>\n</div>\n<hr/>\n\n<div class=\"panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Orientation",options):helperMissing.call(depth0,"__","Orientation",options)))+"</h3>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Display the choices either horizontally or vertically",options):helperMissing.call(depth0,"__","Display the choices either horizontally or vertically",options)))+"\n </span>\n <div>\n <label class=\"smaller-prompt\">\n <input type=\"radio\" name=\"orientation\" value=\"vertical\" ",stack1=helpers.unless.call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\n <span class=\"icon-radio\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Vertical",options):helperMissing.call(depth0,"__","Vertical",options)))+"\n </label>\n <br>\n <label class=\"smaller-prompt\">\n <input type=\"radio\" name=\"orientation\" value=\"horizontal\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.horizontal,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\n <span class=\"icon-radio\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Horizontal",options):helperMissing.call(depth0,"__","Horizontal",options)))+"\n </label>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/orderInteraction/states/Question",["lodash","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/component/minMax/minMax","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/order","taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter","ui/liststyler"],function(_,stateFactory,Question,formElement,minMaxComponentFactory,formTpl,sizeAdapter){'use strict';var OrderInteractionStateQuestion=stateFactory.extend(Question);return OrderInteractionStateQuestion.prototype.initForm=function(){var widget=this.widget,$form=this.widget.$form,interaction=this.widget.element,$choiceArea=this.widget.$container.find(".choice-area"),$resultArea=this.widget.$container.find(".result-area"),$interaction=this.widget.$container.find(".qti-interaction"),$iconAdd=this.widget.$container.find(".icon-add-to-selection"),$iconRemove=this.widget.$container.find(".icon-remove-from-selection"),callbacks;$form.html(formTpl({shuffle:!!interaction.attr("shuffle"),horizontal:"horizontal"===interaction.attr("orientation")})),minMaxComponentFactory($form.find(".min-max-panel"),{min:{value:_.parseInt(interaction.attr("minChoices"))||0},max:{value:_.parseInt(interaction.attr("maxChoices"))||0},upperThreshold:_.size(interaction.getChoices())}).on("render",function(){var self=this;widget.on("choiceCreated choiceDeleted",function(data){data.interaction.serial===interaction.serial&&self.updateThresholds(1,_.size(interaction.getChoices()))})}),formElement.initWidget($form),callbacks=formElement.getMinMaxAttributeCallbacks("minChoices","maxChoices",{updateCardinality:!1}),callbacks.shuffle=formElement.getAttributeChangeCallback(),callbacks.orientation=function(interaction,value){interaction.attr("orientation",value),$interaction.attr("data-orientation",value),"horizontal"===value?($choiceArea.addClass("horizontal").removeClass("vertical"),$resultArea.addClass("horizontal").removeClass("vertical"),$interaction.addClass("qti-horizontal").removeClass("qti-vertical"),$iconAdd.addClass("icon-down").removeClass("icon-right"),$iconRemove.addClass("icon-up").removeClass("icon-left")):($choiceArea.addClass("vertical").removeClass("horizontal"),$resultArea.addClass("vertical").removeClass("horizontal"),$interaction.addClass("qti-vertical").removeClass("qti-horizontal"),$iconAdd.addClass("icon-right").removeClass("icon-down"),$iconRemove.addClass("icon-left").removeClass("icon-up"))},formElement.setChangeCallbacks($form,interaction,callbacks),"horizontal"===interaction.attr("orientation")&&sizeAdapter.adaptSize(widget),widget.on("choiceCreated",function(){"horizontal"===interaction.attr("orientation")&&sizeAdapter.adaptSize(widget)})},OrderInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/orderInteraction/states/Correct",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCommonRenderer/renderers/interactions/OrderInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","lodash","i18n"],function(stateFactory,Correct,commonRenderer,instructionMgr,_,__){var InlineChoiceInteractionStateCorrect=stateFactory.create(Correct,function(){_createResponseWidget(this.widget)},function(){_destroyResponseWidget(this.widget)}),_createResponseWidget=function(widget){var interaction=widget.element,response=interaction.getResponseDeclaration(),correctResponse=_.values(response.getCorrect());instructionMgr.appendInstruction(widget.element,__("Please define the correct order in the box to the right.")),commonRenderer.render(widget.element),commonRenderer.setResponse(interaction,_formatResponse(correctResponse)),widget.$container.on("responseChange.qti-widget",function(e,data){response.setCorrect(_unformatResponse(data.response))})},_destroyResponseWidget=function(widget){widget.$container.off("responseChange.qti-widget"),commonRenderer.resetResponse(widget.element),commonRenderer.destroy(widget.element)},_formatResponse=function(response){return{list:{identifier:response}}},_unformatResponse=function(formatedResponse){var res=[];return formatedResponse.list&&formatedResponse.list.identifier&&(res=formatedResponse.list.identifier),res};return InlineChoiceInteractionStateCorrect}),define("taoQtiItem/qtiCreator/widgets/interactions/orderInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/orderInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/orderInteraction/states/Correct"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/orderInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/orderInteraction/states/states"],function(Widget,states){var OrderInteractionWidget=Widget.clone();return OrderInteractionWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this)},OrderInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/OrderInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/OrderInteraction","taoQtiItem/qtiCreator/widgets/interactions/orderInteraction/Widget"],function(_,OrderInteraction,OrderInteractionWidget){'use strict';var CreatorOrderInteraction=_.clone(OrderInteraction);return CreatorOrderInteraction.render=function(interaction,options){OrderInteractionWidget.build(interaction,OrderInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorOrderInteraction}),define("taoQtiItem/qtiCreator/renderers/interactions/PortableCustomInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/PortableCustomInteraction","taoQtiItem/portableElementRegistry/ciRegistry","taoQtiItem/qtiCreator/helper/commonRenderer"],function(_,Renderer,ciRegistry,commonRenderer){'use strict';var CreatorCustomInteraction=_.clone(Renderer);return CreatorCustomInteraction.render=function(interaction,options){var pciCreator=ciRegistry.getCreator(interaction.typeIdentifier).module;options=options||{},options.baseUrl=this.getOption("baseUrl"),options.mediaManager=this.getOption("mediaManager"),options.uri=this.getOption("uri"),options.lang=this.getOption("lang"),Renderer.render.call(commonRenderer.get(),interaction),pciCreator&&pciCreator.getWidget().build(interaction,Renderer.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorCustomInteraction}),define("taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Sleep"],function(stateFactory,SleepState){'use strict';return stateFactory.extend(SleepState,function(){var widget=this.widget,interaction=widget.element;widget.on("metaChange",function(data){"responsive"===data.key&&(!0===data.value?interaction.addClass("responsive"):interaction.removeClass("responsive"))})},function(){$(".image-editor.solid, .block-listing.source",this.widget.$container).css("min-width",0)})}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/selectPoint",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n\n\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Interaction Background",options):helperMissing.call(depth0,"__","Interaction Background",options)))+"</h3>\n\n <div class=\"panel\">\n <label for=\"data\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"File",options):helperMissing.call(depth0,"__","File",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The file path to the image.",options):helperMissing.call(depth0,"__","The file path to the image.",options)))+"</div>\n <input type=\"text\" name=\"data\" value=\"",(helper=helpers.data)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.data,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty; $fileExists(baseUrl=",(helper=helpers.baseUrl)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.baseUrl,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+")\"/>\n <button class=\"btn-info small block\" data-role=\"upload-trigger\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select image",options):helperMissing.call(depth0,"__","Select image",options)))+"</button>\n </div>\n\n <div class=\"panel media-sizer-panel\">\n <!-- media sizer goes here -->\n </div>\n <input name=\"width\" value=\"",(helper=helpers.width)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.width,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" />\n <input name=\"height\" value=\"",(helper=helpers.height)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.height,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" />\n\n\n <input name=\"type\" value=\"",(helper=helpers.type)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.type,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"hidden\" readonly />\n</div>\n<div class=\"panel min-max-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Allowed choices",options):helperMissing.call(depth0,"__","Allowed choices",options)))+"</h3>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/states/Question",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/helpers/imageSelector","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/component/minMax/minMax","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/selectPoint","taoQtiItem/qtiCreator/widgets/interactions/helpers/bgImage","ui/mediasizer"],function($,_,__,stateFactory,Question,imageSelector,formElement,minMaxComponentFactory,formTpl,bgImage){'use strict';var SelectPointInteractionStateQuestion=stateFactory.extend(Question,function(){},function(){var widget=this.widget,interaction=widget.element,valid=!!interaction.object.attr("data");widget.isValid("selectPointInteraction",valid)});return SelectPointInteractionStateQuestion.prototype.initForm=function(){var widget=this.widget,options=widget.options,interaction=widget.element,$form=widget.$form;$form.html(formTpl({baseUrl:options.baseUrl,data:interaction.object.attr("data"),width:interaction.object.attr("width"),height:interaction.object.attr("height"),type:interaction.object.attr("type")})),minMaxComponentFactory($form.find(".min-max-panel"),{min:{value:_.parseInt(interaction.attr("minChoices"))||0,helpMessage:__("The minimum number of choices that the candidate is required to select to form a valid response.")},max:{value:_.parseInt(interaction.attr("maxChoices"))||0,helpMessage:__("The maximum number of choices that the candidate is allowed to select.")},upperThreshold:1/0}),imageSelector($form,options),formElement.initWidget($form),bgImage.setupImage(widget),bgImage.setChangeCallbacks(widget,formElement,formElement.getMinMaxAttributeCallbacks("minChoices","maxChoices"))},SelectPointInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/states/Map",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCommonRenderer/renderers/interactions/SelectPointInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","taoQtiItem/qtiCommonRenderer/helpers/Graphic","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/qtiCreator/widgets/interactions/helpers/answerState","taoQtiItem/qtiCreator/widgets/interactions/helpers/graphicInteractionShapeEditor","taoQtiItem/qtiCreator/widgets/interactions/helpers/graphicScorePopup","tpl!taoQtiItem/qtiCreator/tpl/forms/response/graphicScoreMappingForm","taoQtiItem/qtiCreator/widgets/helpers/formElement","ui/incrementer","ui/tooltip"],function($,_,__,stateFactory,Map,commonRenderer,instructionMgr,graphicHelper,PciResponse,answerStateHelper,shapeEditor,grahicScorePopup,mappingFormTpl,formElement,incrementer,tooltip){var _Mathround9=Math.round;function areaId(area){return area.shape+"-"+area.coords.replace(/,*/g,"-")}function getAreaIndex(response,id){var found=!1;return _.forEach(response.mapEntries,function(area,index){if(areaId(area)===id)return found=index,!1}),found}function setCurrentResponses(widget){var interaction=widget.element,$container=widget.$original,response=interaction.getResponseDeclaration(),corrects=_.values(response.getCorrect());_.forEach(response.mapEntries,function(area){var shape=widget.createResponseArea(area.shape,area.coords);setUpScoringArea(widget,area,shape,!1)}),answerStateHelper.defineCorrect(response)&&corrects.length&&_.forEach(corrects,function(correct){var point=correct.split(" ");if(2<=point.length){var target=graphicHelper.createTarget(interaction.paper,{point:{x:point[0],y:point[1]}});widget._targets.push(target.id)}}),interaction.paper.getById("bg-image-"+interaction.serial).click(function(){$(".-mapping-editor",$container).hide()})}function declareScoreInputControls($scorePopup){var $scoreInput=$(".score",$scorePopup),caretTo=function(el,index){if(el.createTextRange){var range=el.createTextRange();range.move("character",index),range.select()}else null!=el.selectionStart&&(el.focus(),el.setSelectionRange(index,index))};$scoreInput.off("focus").on("focus",function(){$scoreInput.off("keydown").on("keydown",function(e){if([37,38,39,40].includes(e.keyCode)){e.preventDefault(),e.stopPropagation();var pos=e.target.selectionStart;if(39===e.keyCode||40===e.keyCode){pos++;var len=$scoreInput.val().length;pos=pos<=len?pos:len}else pos--,pos=0<=pos?pos:0;caretTo($scoreInput[0],pos)}})})}function createEditor(widget){var interaction=widget.element,response=interaction.getResponseDeclaration(),$container=widget.$original,editor=shapeEditor(widget,{currents:response.mapEntries.map(areaId).concat(widget._targets),target:!0,shapeCreated:function shapeCreated(shape,type){var point,corrects,area;"target"===type?(point=shape.data("target"),corrects=response.getCorrect()||[],corrects.push(qtiPoint(point)),response.setCorrect(corrects)):(area={shape:"path"===type?"poly":type,coords:graphicHelper.qtiCoords(shape),mappedValue:response.mappingAttributes.defaultValue||"0"},setUpScoringArea(widget,area,shape,!0),response.mapEntries.push(area))},shapeRemoved:function shapeRemoved(id,data){var scoreElt;/^target/.test(id)&&data.target?response.setCorrect(_.without(response.getCorrect(),qtiPoint(data.target))):(scoreElt=interaction.paper.getById("score-"+id),scoreElt&&scoreElt.remove(),$("#score-popup-"+id).remove(),_.remove(response.mapEntries,function(area){return id&&areaId(area)===id}))},enterHandling:function enterHandling(shape){var $scorePopup=$("#score-popup-"+shape.id),$reference=$(".icon-help",$scorePopup);"set"===shape.type?shape.forEach(function(setElt){if("path"===setElt.type)return void setElt.attr(graphicHelper._style["target-hover"])}):(shape.toFront(),$scorePopup.show(),declareScoreInputControls($scorePopup),$(".mapping-editor",$container).on("click",".closer",function(){$scorePopup.hide()}),!$reference.data("$tooltip")&&tooltip.lookup($scorePopup))},quitHandling:function quitHandling(shape){if("set"===shape.type)shape.forEach(function(setElt){if("path"===setElt.type)return void setElt.attr(graphicHelper._style["target-success"])});else{var scoreElt=interaction.paper.getById("score-"+shape.id);scoreElt&&scoreElt.show().toFront(),$("#score-popup-"+shape.id).hide()}},shapeChanging:function shapeChanging(shape){var scoreElt=interaction.paper.getById("score-"+shape.id);scoreElt&&scoreElt.remove(),$("#score-popup-"+shape.id).remove()},shapeChange:function shapeChange(shape){var index=getAreaIndex(response,shape.id),mapEntry;!1!==index&&(mapEntry=response.mapEntries[index],response.mapEntries[index].coords=graphicHelper.qtiCoords(shape),setUpScoringArea(widget,mapEntry,shape,mapEntry.mappedValue===response.mappingAttributes.defaultValue),shape.id=areaId(mapEntry))}});return editor.create(),editor}function qtiPoint(point){return _Mathround9(point.x)+" "+_Mathround9(point.y)}function setUpScoringArea(widget,area,shape,defaults){var interaction=widget.element,$container=widget.$original,isResponsive=$container.hasClass("responsive"),response=interaction.getResponseDeclaration(),id=areaId(area),$imageBox=$(".main-image-box",$container),$popup=grahicScorePopup(interaction.paper,shape,$imageBox,isResponsive),score=area.mappedValue||response.mappingAttributes.defaultValue||"0",scoreElt=graphicHelper.createShapeText(interaction.paper,shape,{id:"score-"+id,content:area.mappedValue+"",style:"score-text-default",title:__("Score value"),shapeClick:!0});scoreElt.data("default",!!defaults),shape.id=id,$popup.attr("id","score-popup-"+id);var $form=$(mappingFormTpl({score:area.mappedValue,scoreMin:response.getMappingAttribute("lowerBound"),scoreMax:response.getMappingAttribute("upperBound"),noCorrect:!0}));formElement.setChangeCallbacks($form,response,{score:function(response,value){""===value?scoreElt.attr({text:response.mappingAttributes.defaultValue}).data("default",!0):scoreElt.attr({text:value}).data("default",!1),area.mappedValue=parseFloat(value)}}),$form.appendTo($popup)}function listenResponseAttrChange(widget){var interaction=widget.element,$container=widget.$container,$target=$container.find("[data-type=\"target\"]"),$separator=$target.prev(".separator");widget.on("mappingAttributeChange",function(data){"defaultValue"===data.key&&interaction.paper.forEach(function(element){/^score/.test(element.id)&&!0===element.data("default")&&element.attr({text:data.value})})}),widget.on("metaChange",function(data){"defineCorrect"===data.key&&(data.value?($target.show(),$separator.show()):($target.hide(),$separator.hide(),_.forEach(widget._targets,function(targetId){var target=interaction.paper.getById(targetId),layer=interaction.paper.getById("layer-"+targetId);target.remove(),layer.remove()})))})}return stateFactory.create(Map,function(){var widget=this.widget,interaction=widget.element,$container=widget.$original,response=interaction.getResponseDeclaration();widget._targets=[];interaction.paper&&(commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.appendInstruction(interaction,__("Please create areas that correspond to the response and associate them a score.\nYou can also position the target to the exact point as the correct response.")),interaction.responseMappingMode=!0,_.isPlainObject(response.mapEntries)&&(response.mapEntries=_.values(response.mapEntries)),interaction.paper=widget.createPaper(),setCurrentResponses(widget),widget._editor=createEditor(widget),listenResponseAttrChange(widget))},function(){var widget=this.widget,interaction=widget.element;interaction.paper&&(widget._editor&&widget._editor.destroy(),commonRenderer.resetResponse(interaction),commonRenderer.destroy(interaction),instructionMgr.removeInstructions(interaction),interaction.paper=this.widget.createPaper())})}),define("taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/states/Sleep","taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/states/Map"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/Widget",["jquery","lodash","i18n","taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/graphicInteraction/Widget","taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/states/states","taoQtiItem/qtiCommonRenderer/helpers/Graphic"],function($,_,__,Widget,GraphicWidget,states,graphicHelper){var SelectPointInteractionWidget=_.extend(Widget.clone(),GraphicWidget,{initCreator:function initCreator(options){var paper;this.baseUrl=options.baseUrl,this.choiceForm=options.choiceForm,this.registerStates(states),Widget.initCreator.call(this),paper=this.createPaper(),paper&&(this.element.paper=paper)},destroy:function destroy(){var $container=this.$original,$item=$container.parents(".qti-item");$item.off("resize.gridEdit."+this.element.serial),$(window).off("resize.qti-widget."+this.element.serial),$container.off("resize.qti-widget."+this.element.serial),Widget.destroy.call(this)},createResponseArea:function createResponseArea(shapeType,coords){return graphicHelper.createElement(this.element.paper,shapeType,coords,{touchEffect:!1})}});return SelectPointInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/SelectPointInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/SelectPointInteraction","taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/Widget"],function(_,SelectPointInteraction,SelectPointInteractionWidget){'use strict';var CreatorSelectPointInteraction=_.clone(SelectPointInteraction);return CreatorSelectPointInteraction.render=function(interaction,options){options=options||{},options.baseUrl=this.getOption("baseUrl"),options.choiceForm=this.getOption("choiceOptionForm"),options.uri=this.getOption("uri"),options.lang=this.getOption("lang"),options.mediaManager=this.getOption("mediaManager"),options.assetManager=this.getAssetManager(),SelectPointInteractionWidget.build(interaction,SelectPointInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorSelectPointInteraction}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/slider",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <div>\n <label for=\"lowerBound\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Lower Bound",options):helperMissing.call(depth0,"__","Lower Bound",options)))+"</label>\n <input name=\"lowerBound\" value=\"",(helper=helpers.lowerBound)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.lowerBound,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-increment=\"1\" data-min=\"0\" type=\"text\" />\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content lower-bound-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The lower bound of the slider",options):helperMissing.call(depth0,"__","The lower bound of the slider",options)))+"</span>\n </div>\n <div>\n <label for=\"upperBound\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Upper Bound",options):helperMissing.call(depth0,"__","Upper Bound",options)))+"</label>\n <input name=\"upperBound\" value=\"",(helper=helpers.upperBound)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.upperBound,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-increment=\"1\" data-min=\"0\" type=\"text\" />\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content upper-bound-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The upper bound of the slider",options):helperMissing.call(depth0,"__","The upper bound of the slider",options)))+"</span>\n </div>\n</div>\n\n<div class=\"panel\">\n <label for=\"step\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Step",options):helperMissing.call(depth0,"__","Step",options)))+"</label>\n <input name=\"step\" value=\"",(helper=helpers.step)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.step,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-increment=\"1\" data-min=\"0\" data-max=\"",(helper=helpers.upperBound)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.upperBound,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" />\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The number of units corresponding to a step on the slider",options):helperMissing.call(depth0,"__","The number of units corresponding to a step on the slider",options)))+"</span>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/Helper",["i18n","ui/feedback","ui/dialog/confirm"],function(__){return{responseManager:function(interaction,currentResponse){var lowerBound=interaction.attributes.lowerBound,upperBound=interaction.attributes.upperBound;return{isValid:function isValid(){return lowerBound<=upperBound&&currentResponse>=lowerBound&&currentResponse<=upperBound},getErrorMessage:function getErrorMessage(){var msg="";return lowerBound>upperBound?msg=__("Lower bound is bigger than upper bound."):lowerBound===upperBound&&currentResponse!==lowerBound?msg=__("Response [\"%s\"] should be the only possible value \"%s\".",currentResponse,lowerBound):currentResponse>upperBound?msg=__("Response [\"%s\"] is bigger than the upper bound value \"%s\".",currentResponse,upperBound):currentResponse<lowerBound&&(msg=__("Response [\"%s\"] is lower than the lower bound value \"%s\".",currentResponse,lowerBound)),msg}}}}}),define("taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/states/Question",["lodash","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/helpers/formElement","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/slider","taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/Helper"],function(_,stateFactory,Question,formElement,formTpl,sliderInteractionHelper){'use strict';var SliderInteractionStateQuestion=stateFactory.extend(Question,function initQuestionState(){},function(){var _widget=this.widget,interaction=_widget.element,responseDeclaration=interaction.getResponseDeclaration(),currentResponse=_.values(responseDeclaration.getCorrect()),responseManager=sliderInteractionHelper.responseManager(interaction,currentResponse);_widget.isValid("sliderInteraction",responseManager.isValid(),responseManager.getErrorMessage())});return SliderInteractionStateQuestion.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,interaction=_widget.element;$form.html(formTpl({lowerBound:parseFloat(interaction.attr("lowerBound")),upperBound:parseFloat(interaction.attr("upperBound")),orientation:interaction.attr("orientation"),reverse:!!interaction.attr("reverse"),step:parseInt(interaction.attr("step")),stepLabel:!!interaction.attr("stepLabel")})),formElement.initWidget($form);var callbacks={};callbacks.lowerBound=function(interaction,attrValue){var lowerBound=parseInt(attrValue,10);(isNaN(lowerBound)||0>lowerBound)&&(lowerBound=0),interaction.attr("lowerBound",lowerBound);var upperBound=interaction.attr("upperBound"),sliderLength=upperBound-lowerBound,step=interaction.attr("step"),reverse=!!interaction.attr("reverse");lowerBound>upperBound&&(upperBound=lowerBound,$form.find("input[name=\"upperBound\"]").val(upperBound),callbacks.upperBound(interaction,upperBound)),sliderLength<step&&0<=sliderLength&&(step=sliderLength,$form.find("input[name=\"step\"]").val(step)),callbacks.step(interaction,step);var $container=_widget.$container,$lowerBoundLabel=".slider-min";reverse&&($lowerBoundLabel=".slider-max"),$container.find($lowerBoundLabel).text(lowerBound),$container.find("span.qti-slider-cur-value").text(lowerBound);var $qtiSlider=$container.find(".qti-slider");$qtiSlider.noUiSlider({range:{min:lowerBound,max:upperBound}},!0),$qtiSlider.val(lowerBound)},callbacks.upperBound=function(interaction,attrValue){var upperBound=parseInt(attrValue,10);(isNaN(upperBound)||0>upperBound)&&(upperBound=0),interaction.attr("upperBound",upperBound);var lowerBound=interaction.attr("lowerBound"),sliderLength=upperBound-lowerBound,step=interaction.attr("step"),reverse=!!interaction.attr("reverse");upperBound<lowerBound&&(lowerBound=upperBound,$form.find("input[name=\"lowerBound\"]").val(lowerBound),callbacks.lowerBound(interaction,lowerBound)),sliderLength<step&&0<=sliderLength&&(step=sliderLength,$form.find("input[name=\"step\"]").val(step)),callbacks.step(interaction,step),$form.find("input[name=\"step\"]").incrementer("options",{max:upperBound});var $container=_widget.$container,$upperBoundLabel=".slider-max";reverse&&($upperBoundLabel=".slider-min"),$container.find($upperBoundLabel).text(upperBound),$container.find(".qti-slider").noUiSlider({range:{min:lowerBound,max:upperBound}},!0)},callbacks.orientation=function(interaction,attrValue){interaction.attr("orientation",attrValue);var orientation=interaction.attr("orientation")?interaction.attr("orientation"):"horizontal",reverse=interaction.attr("reverse");_widget.$container.find(".qti-slider").noUiSlider({orientation:interaction.attr("orientation")},!0)},callbacks.reverse=function(interaction,attrValue){interaction.attr("reverse",!!attrValue);var reverse=interaction.attr("reverse"),lowerBound=parseInt(interaction.attr("lowerBound")),upperBound=parseInt(interaction.attr("upperBound")),$sliderElt=_widget.$container.find(".qti-slider"),start=reverse?upperBound:lowerBound;$sliderElt.noUiSlider({start:start},!0),_widget.$container.find("span.qti-slider-cur-value").text(lowerBound),_widget.$container.find(".slider-min").text(reverse?upperBound:lowerBound),_widget.$container.find(".slider-max").text(reverse?lowerBound:upperBound)},callbacks.step=function(interaction,attrValue){var step=parseInt(attrValue);(isNaN(step)||0>step)&&(step=0);var lowerBound=interaction.attr("lowerBound"),upperBound=interaction.attr("upperBound"),sliderLength=upperBound-lowerBound;interaction.attr("step",step),sliderLength>=step&&(_widget.$container.find(".qti-slider").noUiSlider({step:step},!0),$form.find("input[name=\"step\"]").incrementer("options",{max:sliderLength}))},callbacks.stepLabel=function(interaction,attrValue){if(interaction.attr("stepLabel",!!attrValue),_widget.$container.find("span.slider-middle").remove(),interaction.attr("stepLabel")){var upperBound=interaction.attr("upperBound"),lowerBound=interaction.attr("lowerBound"),step=interaction.attr("step"),reverse=interaction.attr("reverse"),steps=parseInt((upperBound-lowerBound)/step),middleStep=parseInt(steps/2),middleValue=reverse?upperBound-middleStep*step:lowerBound+middleStep*step;_widget.$container.find(".slider-min").after("<span class=\"slider-middle\" style=\"left:"+100/steps*middleStep+"%\">"+middleValue+"</span>")}},formElement.setChangeCallbacks($form,interaction,callbacks)},SliderInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/states/Correct",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCommonRenderer/renderers/interactions/SliderInteraction","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","lodash","i18n","taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/Helper"],function(stateFactory,Correct,commonRenderer,instructionMgr,_,__,sliderInteractionHelper){var SliderInteractionStateCorrect=stateFactory.create(Correct,function(){_createResponseWidget(this.widget)},function(){_destroyResponseWidget(this.widget)}),_createResponseWidget=function(widget){var interaction=widget.element,response=interaction.getResponseDeclaration(),correctResponse=_.values(response.getCorrect());response.setCorrect(correctResponse),commonRenderer.setResponse(interaction,_formatResponse(correctResponse));var $sliderElt=widget.$container.find(".qti-slider");$sliderElt.removeAttr("disabled"),instructionMgr.appendInstruction(interaction,__("Please define the correct response using the slider.")),widget.$container.on("responseChange.qti-widget",function(e,data){response.setCorrect([data.response.base.integer])})},_destroyResponseWidget=function(widget){var $sliderElt=widget.$container.find(".qti-slider"),lowerBound=widget.element.attributes.lowerBound,interaction=widget.element,responseDeclaration=interaction.getResponseDeclaration(),currentResponse=_.values(responseDeclaration.getCorrect()),responseManager=sliderInteractionHelper.responseManager(interaction,currentResponse);widget.isValid("sliderInteraction",responseManager.isValid(),responseManager.getErrorMessage()),$sliderElt.attr("disabled","disabled"),$sliderElt.val(lowerBound),widget.$container.find("span.qti-slider-cur-value").text(""+lowerBound),instructionMgr.removeInstructions(widget.element),widget.$container.off("responseChange.qti-widget")},_formatResponse=function(response){return{base:{integer:response}}};return SliderInteractionStateCorrect}),define("taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/states/Correct"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/states/states"],function(Widget,states){var SliderInteractionWidget=Widget.clone();return SliderInteractionWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this),this.$container.find(".qti-slider").attr("disabled","disabled")},SliderInteractionWidget}),define("taoQtiItem/qtiCreator/renderers/interactions/SliderInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/SliderInteraction","taoQtiItem/qtiCreator/widgets/interactions/sliderInteraction/Widget"],function(_,SliderInteraction,SliderInteractionWidget){'use strict';var CreatorSliderInteraction=_.clone(SliderInteraction);return CreatorSliderInteraction.render=function(interaction,options){SliderInteraction.render(interaction),SliderInteractionWidget.build(interaction,SliderInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorSliderInteraction}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/textEntry",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\r\n <option value=\""+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\r\n ",buffer}function program2(){return"selected=\"selected\""}function program4(){return"style=\"display:none\""}function program6(depth0,data){var stack1,helper;return(helper=helpers.patternMask)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.patternMask,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),escapeExpression(stack1)}function program8(depth0,data){var buffer="",stack1,helper;return buffer+="value=\"",(helper=helpers.maxLength)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxLength,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}function program10(depth0,data){var stack1,helper;return(helper=helpers.expectedLength)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.expectedLength,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),escapeExpression(stack1)}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"panel\">\r\n <label for=\"base\" class=\"spinner\">Base</label>\r\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\r\n <input name=\"base\" value=\"",(helper=helpers.base)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.base,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-increment=\"1\" data-min=\"1\" data-max=\"100\" type=\"text\" />\r\n <span class=\"tooltip-content\">\r\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"If the string interaction is bound to a numeric response variable then the base attribute must be used to set the number base in which to interpret the value entered by the candidate.",options):helperMissing.call(depth0,"__","If the string interaction is bound to a numeric response variable then the base attribute must be used to set the number base in which to interpret the value entered by the candidate.",options)))+"\r\n </span>\r\n</div>\r\n\r\n<div class=\"panel\">\r\n <label for=\"placeholderText\" class=\"spinner\">Placeholder Text</label>\r\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\r\n <input name=\"placeholderText\" value=\"",(helper=helpers.placeholderText)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.placeholderText,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" />\r\n <span class=\"tooltip-content\">\r\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"In visual environments, string interactions are typically represented by empty boxes into which the candidate writes or types. Delivery engines should use the value of this attribute (if provided) instead of their default placeholder text when this is required.",options):helperMissing.call(depth0,"__","In visual environments, string interactions are typically represented by empty boxes into which the candidate writes or types. Delivery engines should use the value of this attribute (if provided) instead of their default placeholder text when this is required.",options)))+"\r\n </span>\r\n</div>\r\n\r\n<hr>\r\n\r\n<div class=\"panel\">\r\n <h3 class=\"full-width\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Constraints",options):helperMissing.call(depth0,"__","Constraints",options)))+"</h3>\r\n <select name=\"constraint\" class=\"select2\" data-has-search=\"false\">\r\n ",stack1=helpers.each.call(depth0,depth0&&depth0.constraints,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\r\n </select>\r\n</div>\r\n\r\n<div class=\"panel extendedText\">\r\n \r\n <div class=\"constraint constraint-pattern\" ",stack1=helpers.unless.call(depth0,(stack1=(stack1=depth0&&depth0.constraints,null==stack1||!1===stack1?stack1:stack1.pattern),null==stack1||!1===stack1?stack1:stack1.selected),{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\r\n <label>\r\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Pattern",options):helperMissing.call(depth0,"__","Pattern",options)))+"\r\n </label>\r\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\r\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"If given, the pattern mask specifies a regular expression that the candidate's response must match in order to be considered valid",options):helperMissing.call(depth0,"__","If given, the pattern mask specifies a regular expression that the candidate's response must match in order to be considered valid",options)))+"</span>\r\n <input type=\"text\" name=\"patternMask\" value=\"",stack1=helpers["if"].call(depth0,depth0&&depth0.patternMask,{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\"/>\r\n </div>\r\n \r\n <div class=\"constraint constraint-maxLength\" ",stack1=helpers.unless.call(depth0,(stack1=(stack1=depth0&&depth0.constraints,null==stack1||!1===stack1?stack1:stack1.maxLength),null==stack1||!1===stack1?stack1:stack1.selected),{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\r\n <label class=\"spinner\">\r\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Max length",options):helperMissing.call(depth0,"__","Max length",options)))+"\r\n </label>\r\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\r\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"We will use the patternMask to do this, to be compliant with the IMS standard",options):helperMissing.call(depth0,"__","We will use the patternMask to do this, to be compliant with the IMS standard",options)))+"</span>\r\n <input type=\"text\" data-min=\"0\" data-increment=\"1\" class=\"incrementer\" name=\"maxLength\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.maxLength,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\r\n </div>\r\n</div>\r\n\r\n<hr>\r\n\r\n<div class=\"panel extendedText\">\r\n <h3 class=\"full-width\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Recommendations",options):helperMissing.call(depth0,"__","Recommendations",options)))+"</h3>\r\n <div class=\"panel\">\r\n <label for=\"expectedLength\" class=\"spinner\">Length</label>\r\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\r\n <input name=\"expectedLength\" value=\"",stack1=helpers["if"].call(depth0,depth0&&depth0.expectedLength,{hash:{},inverse:self.noop,fn:self.program(10,program10,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\" data-increment=\"1\" data-min=\"1\" data-max=\"100\" type=\"text\" />\r\n <span class=\"tooltip-content\">\r\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Provides a hint to the candidate as to the expected overall length of the desired response measured in number of characters. This is not a validity constraint.",options):helperMissing.call(depth0,"__","Provides a hint to the candidate as to the expected overall length of the desired response measured in number of characters. This is not a validity constraint.",options)))+"\r\n </span>\r\n </div>\r\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/textEntryInteraction/states/Question",["jquery","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Question","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCommonRenderer/helpers/patternMask","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/textEntry"],function($,__,stateFactory,Question,formElement,patternMaskHelper,formTpl){'use strict';var TextEntryInteractionStateQuestion=stateFactory.extend(Question);return TextEntryInteractionStateQuestion.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,interaction=_widget.element,patternMask=interaction.attr("patternMask"),maxChars=parseInt(patternMaskHelper.parsePattern(patternMask,"chars"),10),constraints={none:{label:__("None"),selected:!0},maxLength:{label:__("Max Length"),selected:!1},pattern:{label:__("Pattern"),selected:!1}},$inputs;!isNaN(maxChars)&&0<maxChars?(constraints.none.selected=!1,constraints.maxLength.selected=!0):null!==patternMask&&void 0!==patternMask&&""!==patternMask&&(constraints.none.selected=!1,constraints.pattern.selected=!0),$form.html(formTpl({base:parseInt(interaction.attr("base")),placeholderText:interaction.attr("placeholderText"),expectedLength:parseInt(interaction.attr("expectedLength")),constraints:constraints,patternMask:patternMask,maxLength:maxChars})),formElement.initWidget($form),$inputs={maxLength:$form.find("[name=\"maxLength\"]"),patternMask:$form.find("[name=\"patternMask\"]")},formElement.setChangeCallbacks($form,interaction,{base:formElement.getAttributeChangeCallback(),placeholderText:formElement.getAttributeChangeCallback(),expectedLength:function(interaction,attrValue){interaction.attr("expectedLength",isNaN(parseInt(attrValue,10))?0:attrValue)},constraint:function(interaction,attrValue){$(".constraint",$form).hide("500"),$(".constraint-"+attrValue,$form).show("1000"),"none"===attrValue&&($("input",$form).val(""),interaction.attr("patternMask",null))},patternMask:function(interaction,attrValue){interaction.attr("patternMask",attrValue),$inputs.maxLength.val("")},maxLength:function(interaction,attrValue){var newValue=parseInt(attrValue,10);isNaN(newValue)||interaction.attr("patternMask",patternMaskHelper.createMaxCharPattern(newValue)),$inputs.patternMask.val(interaction.attr("patternMask"))}})},TextEntryInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/textEntryInteraction/states/Correct",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Correct","taoQtiItem/qtiCommonRenderer/helpers/instructions/instructionManager","lodash","i18n"],function($,stateFactory,Correct,instructionMgr,_,__){'use strict';var TextEntryInteractionStateCorrect=stateFactory.create(Correct,function(){var $container=this.widget.$container,response=this.widget.element.getResponseDeclaration(),correct=_.values(response.getCorrect()).pop()||"";$container.find("tr[data-edit=correct] input[name=correct]").focus().val(correct),$container.on("keyup.correct","tr[data-edit=correct] input[name=correct]",function(){var value=$(this).val();value?response.setCorrect(value):response.resetCorrect()}),instructionMgr.appendInstruction(this.widget.element,__("Please type the correct response in the box below."))},function(){this.widget.$container.off(".correct"),instructionMgr.removeInstructions(this.widget.element)});return TextEntryInteractionStateCorrect}),define("tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/textEntry",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<tr class=\"\" data-edit=\"map\">\r\n <td data-text><input type=\"text\" name=\"text\" value=\"",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-old-text=\"",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"/></td>\r\n <td class=\"mini-tlb\" colspan=\"2\">\r\n <label>\r\n <input name=\"correct\" type=\"radio\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.correct,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\r\n <span class=\"icon-radio\"></span>\r\n </label>\r\n <input name=\"score\" class=\"score\" value=\"",(helper=helpers.score)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.score,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$numeric\" data-validate-option=\"$allowEmpty; $event(type=keyup)\"/>\r\n <span class=\"icon-bin\" data-role=\"delete-option\"></span>\r\n </td>\r\n</tr>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/textEntryInteraction/states/Map",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Map","taoQtiItem/qtiCreator/widgets/helpers/formElement","tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/textEntry","lodash"],function($,stateFactory,Map,formElement,optionTpl,_){var _getRelatedTextKey=function($elt){return $elt.closest("tr").find("input[name=text]").val()},TextEntryInteractionStateMap=stateFactory.create(Map,function(){this.initMapEntries(),this.initFormCallbacks(),this.hideCorrectInput()},function(){this.widget.$container.off(".map"),this.widget.$container.find("tr[data-edit=map]:not([data-add-option])").remove()});return TextEntryInteractionStateMap.prototype.hideCorrectInput=function(){var $correct=this.widget.$container.find("tr[data-edit=correct]");this.widget.on("metaChange",function(data){"defineCorrect"===data.key&&$correct.hide()}),$correct.hide(),_.delay(function(){$correct.hide()},200)},TextEntryInteractionStateMap.prototype.initFormCallbacks=function(){var $container=this.widget.$container,response=this.widget.element.getResponseDeclaration();formElement.setChangeCallbacks($container,response,{text:_.throttle(function(response,value){var $text=$(this),oldText=$text.data("old-text"),$tr=$text.closest("tr"),correct=!!$tr.find("input[name=correct]:checked").length,score=parseInt($tr.find(".score").val());isNaN(score)||response.mapEntries.hasOwnProperty(value)||(response.removeMapEntry(oldText,!0),response.setMapEntry(value,score),$text.data("old-text",value),correct&&response.setCorrect(value))},600),correct:function correct(response){var text=_getRelatedTextKey($(this));response.setCorrect(text)},score:function(response,value){var text=_getRelatedTextKey($(this)),score=parseFloat(value);isNaN(score)||response.setMapEntry(text,score)}})},TextEntryInteractionStateMap.prototype.initMapEntries=function(){var _this=this,response=this.widget.element.getResponseDeclaration(),correctValue=_.values(response.getCorrect()).pop(),$container=this.widget.$container,$addOption=$container.find("tr[data-add-option]"),appendOption=function(text,score){var $newOption=$(optionTpl({text:text||"",score:score||0,correct:text===correctValue}));$newOption.show(),$addOption.before($newOption),preventNullMapEntries()},preventNullMapEntries=function(){var $deleteButtons=$container.find("tbody [data-role=delete-option]");1===$deleteButtons.length?$deleteButtons.css("visibility","hidden"):$deleteButtons.css("visibility","visible")};_.size(response.mapEntries)||(response.mapEntries={"":0}),_.forIn(response.mapEntries,function(score,text){appendOption(text,score)}),$container.on("click.map","[data-role=delete-option]",function(){var $del=$(this),text=_getRelatedTextKey($del),correct=!!$del.closest("tr").find("input[name=correct]:checked").length;response.removeMapEntry(text,!0),$del.closest("tr").remove(),preventNullMapEntries(),correct&&response.resetCorrect()}).on("click.map",".add-option",function(){appendOption("",0),_this.initFormCallbacks()})},TextEntryInteractionStateMap}),define("taoQtiItem/qtiCreator/widgets/interactions/textEntryInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/textEntryInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/textEntryInteraction/states/Correct","taoQtiItem/qtiCreator/widgets/interactions/textEntryInteraction/states/Map"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/textEntryInteraction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"widget-box widget-inline widget-textEntryInteraction qti-interaction\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-edit=\"active\">\r\n <div class=\"qti-interaction qti-textEntryInteraction\">\r\n <table>\r\n <colgroup>\r\n <col class=\"text\">\r\n <col class=\"icon\">\r\n <col class=\"icon\">\r\n </colgroup>\r\n <tbody>\r\n <tr data-edit=\"question\">\r\n <td class=\"main-option\"></td>\r\n <td colspan=\"2\"></td>\r\n </tr>\r\n <tr data-edit=\"correct\">\r\n <td data-text>\r\n <div class=\"instruction-container\"></div>\r\n <input type=\"text\" name=\"correct\" value=\"",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" /></td>\r\n <td class=\"mini-tlb\" colspan=\"2\">\r\n </td>\r\n </tr>\r\n <tr data-add-option data-edit=\"map\">\r\n <td>\r\n <div class=\"add-option\">\r\n <span class=\"icon-add\"></span>\r\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Add another option",options):helperMissing.call(depth0,"__","Add another option",options)))+"\r\n </div>\r\n </td>\r\n <td colspan=\"2\"></td>\r\n </tr>\r\n <tr data-edit=\"custom\">\r\n <td colspan=\"3\">\r\n <!-- Input solely provides visual in response state -->\r\n <input type=\"text\" />\r\n </td>\r\n </tr>\r\n <tr data-edit=\"norp\">\r\n <td colspan=\"3\">\r\n <!-- Input solely provides visual in response state -->\r\n <input type=\"text\" disabled=\"disabled\"/>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n\r\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/textEntryInteraction/Widget",["lodash","taoQtiItem/qtiCreator/widgets/interactions/inlineInteraction/Widget","taoQtiItem/qtiCreator/widgets/interactions/textEntryInteraction/states/states","tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/textEntryInteraction"],function(_,InteractionWidget,states,interactionTpl){var TextEntryInteractionWidget=InteractionWidget.clone();return TextEntryInteractionWidget.initCreator=function(){this.registerStates(states),InteractionWidget.initCreator.call(this),this.$container.find(".tlb-title").remove()},TextEntryInteractionWidget.renderInteraction=function(){var interaction=this.element,tplData={tag:interaction.qtiClass,serial:interaction.serial,attributes:interaction.attributes};return interactionTpl(tplData)},TextEntryInteractionWidget.buildContainer=function(){var previous,next;this.$original.length&&(previous=this.$original[0].previousSibling,next=this.$original[0].nextSibling,(!previous||3===previous.nodeType&&""===previous.nodeValue||3!==previous.nodeType)&&this.$original.before("&nbsp;"),(!next||3===next.nodeType&&""===next.nodeValue||3!==next.nodeType)&&this.$original.after("&nbsp;")),this.$itemContainer=this.$original.parents(".item-editor-item"),this.$itemContainer.append(this.renderInteraction()),this.$container=this.$itemContainer.find(".widget-textEntryInteraction[data-serial="+this.element.getSerial()+"]")},TextEntryInteractionWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/textEntryInteraction.placeholder",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<span class=\"widget-box textEntryInteraction-placeholder\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"textEntryInteraction\">\r\n <label>&nbsp;</label>\r\n</span>",buffer})}),define("taoQtiItem/qtiCreator/renderers/interactions/TextEntryInteraction",["jquery","lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/TextEntryInteraction","taoQtiItem/qtiCreator/widgets/interactions/textEntryInteraction/Widget","tpl!taoQtiItem/qtiCreator/tpl/inlineInteraction/textEntryInteraction.placeholder"],function($,_,TextEntryInteraction,TextEntryInteractionWidget,tpl){'use strict';var CreatorTextEntryInteraction=_.clone(TextEntryInteraction);return CreatorTextEntryInteraction.template=tpl,CreatorTextEntryInteraction.render=function(interaction,options){options=options||{},TextEntryInteractionWidget.build(interaction,$(".textEntryInteraction-placeholder[data-serial=\""+interaction.serial+"\"]"),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},CreatorTextEntryInteraction}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/upload",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n \t\t<option value=\"",(helper=helpers.mime)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.mime,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n \t",buffer}function program2(){return"selected=\"selected\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"MIME-type",options):helperMissing.call(depth0,"__","MIME-type",options)))+"</h3>\n<span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n<div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The MIME-type attribute describes which kind of file may be uploaded.",options):helperMissing.call(depth0,"__","The MIME-type attribute describes which kind of file may be uploaded.",options)))+"</div>\n\n<div class=\"reset-group\">\n <select name=\"type\" class=\"select2\" multiple data-has-search=\"false\">\n \t",stack1=helpers.each.call(depth0,depth0&&depth0.types,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/interactions/uploadInteraction/states/Question",["module","lodash","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/Question","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCommonRenderer/helpers/uploadMime","tpl!taoQtiItem/qtiCreator/tpl/forms/interactions/upload"],function(module,_,__,stateFactory,Question,formElement,uploadHelper,formTpl){'use strict';var UploadInteractionStateQuestion=stateFactory.extend(Question);return UploadInteractionStateQuestion.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,interaction=_widget.element,callbacks={},types=uploadHelper.getMimeTypes(),preselected=uploadHelper.getExpectedTypes(interaction),config=module.config();for(var i in 0===preselected.length&&config.defaultList&&0<config.defaultList.length&&(preselected=preselected.concat(config.defaultList),uploadHelper.setExpectedTypes(interaction,config.defaultList)),types.unshift({mime:"any/kind",label:__("-- Any kind of file --")}),""===interaction.attr("type")&&delete interaction.attributes.type,types)0<=_.indexOf(preselected,types[i].mime)&&(types[i].selected=!0);$form.html(formTpl({types:types})),formElement.initWidget($form);var $select=$form.find("[name=\"type\"]");$select.select2({width:"100%",formatNoMatches:function formatNoMatches(){return __("Enter a select MIME-type")}}),callbacks.type=function(interactionChanged,attrValue){uploadHelper.setExpectedTypes(interactionChanged,attrValue)},formElement.setChangeCallbacks($form,interaction,callbacks)},UploadInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/uploadInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/blockInteraction/states/states","taoQtiItem/qtiCreator/widgets/interactions/uploadInteraction/states/Question"],function(factory,states){'use strict';return factory.createBundle(states,arguments,["map"])}),define("taoQtiItem/qtiCreator/widgets/interactions/uploadInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/qtiCreator/widgets/interactions/uploadInteraction/states/states"],function(Widget,states){var UploadInteractionWidget=Widget.clone();return UploadInteractionWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this)},UploadInteractionWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/interactions/uploadInteraction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program3(depth0,data){var stack1,helper;return(helper=helpers["visible-file-upload-preview"])?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0["visible-file-upload-preview"],stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"qti-interaction qti-blockInteraction qti-uploadInteraction\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n\t",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\t<div class=\"instruction-container\"></div>\n <div class=\"fixed-grid-row file-upload lft\">\n <span class=\"btn-info small col-4\"></span>\n <span class=\"file-name placeholder col-8 truncate\"></span>\n </div>\n <div class=\"file-upload-preview lft ",stack1=helpers["if"].call(depth0,depth0&&depth0.isPreviewable,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\">\n <p class=\"nopreview\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"No preview available",options):helperMissing.call(depth0,"__","No preview available",options)))+"</p>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/renderers/interactions/UploadInteraction",["lodash","taoQtiItem/qtiCommonRenderer/renderers/interactions/UploadInteraction","taoQtiItem/qtiCreator/widgets/interactions/uploadInteraction/Widget","tpl!taoQtiItem/qtiCreator/tpl/interactions/uploadInteraction"],function(_,UploadInteraction,UploadInteractionWidget,tpl){'use strict';return UploadInteraction=_.clone(UploadInteraction),UploadInteraction.template=tpl,UploadInteraction.render=function(interaction,options){UploadInteraction.resetGui(interaction),UploadInteractionWidget.build(interaction,UploadInteraction.getContainer(interaction),this.getOption("interactionOptionForm"),this.getOption("responseOptionForm"),options)},UploadInteraction}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/item",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program3(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n <div class=\"panel\">\n <label for=\"xml:lang\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Language",options):helperMissing.call(depth0,"__","Language",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Define item language.",options):helperMissing.call(depth0,"__","Define item language.",options)))+"\n </span>\n <select name=\"xml:lang\" data-has-search=\"false\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.languagesList,{hash:{},inverse:self.noop,fn:self.programWithDepth(4,program4,data,depth0),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n </div>\n",buffer}function program4(depth0,data,depth1){var buffer="",stack1,helper,options;return buffer+="\n <option value=\""+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",stack1=(helper=helpers.equal||depth1&&depth1.equal,options={hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data},helper?helper.call(depth0,null==data||!1===data?data:data.key,depth1&&depth1["xml:lang"],options):helperMissing.call(depth0,"equal",null==data||!1===data?data:data.key,depth1&&depth1["xml:lang"],options)),(stack1||0===stack1)&&(buffer+=stack1),stack1=(helper=helpers.includes||depth1&&depth1.includes,options={hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data},helper?helper.call(depth0,depth1&&depth1.rtl,null==data||!1===data?data:data.key,options):helperMissing.call(depth0,"includes",depth1&&depth1.rtl,null==data||!1===data?data:data.key,options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">"+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"</option>\n ",buffer}function program5(){return" selected=\"selected\""}function program7(){return" class=\"rtl-lang\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Identifier",options):helperMissing.call(depth0,"__","Identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The principle identifier of the item. This identifier must have a corresponding entry in the item's metadata.",options):helperMissing.call(depth0,"__","The principle identifier of the item. This identifier must have a corresponding entry in the item's metadata.",options)))+"</div>\n\n <input type=\"text\" \n name=\"identifier\" \n value=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n placeholder=\"e.g. my-item_123456\" \n data-validate=\"$notEmpty; $qtiIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"); $availableIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n \n</div>\n\n<div class=\"panel\">\n <label for=\"\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Title",options):helperMissing.call(depth0,"__","Title",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The item of the qti item. It is currently used as a meta data only. It is required by the QTI standard.",options):helperMissing.call(depth0,"__","The item of the qti item. It is currently used as a meta data only. It is required by the QTI standard.",options)))+"</div>\n\n <input type=\"text\" \n name=\"title\" \n value=\"",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n placeholder=\"e.g. My Item A\" \n data-validate=\"$notEmpty;\">\n \n</div>\n\n<div class=\"panel\">\n <label>\n <input name=\"timeDependent\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.timeDependent,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Time dependent",options):helperMissing.call(depth0,"__","Time dependent",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Define whether the item should be time dependent on delivery.",options):helperMissing.call(depth0,"__","Define whether the item should be time dependent on delivery.",options)))+"\n </span>\n</div>\n\n",stack1=helpers["if"].call(depth0,depth0&&depth0.languagesList,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer})}),define("taoQtiItem/qtiCreator/widgets/item/states/Active",["lodash","util/locale","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Active","tpl!taoQtiItem/qtiCreator/tpl/forms/item","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/editor/gridEditor/content","select2"],function(_,locale,stateFactory,Active,formTpl,formElement,contentHelper){'use strict';var ItemStateActive=stateFactory.create(Active,function(){var _widget=this.widget,item=_widget.element,$form=_widget.$form,areaBroker=this.widget.getAreaBroker(),rtl=locale.getConfig().rtl||[];$form.html(formTpl({serial:item.getSerial(),identifier:item.id(),title:item.attr("title"),timeDependent:!!item.attr("timeDependent"),"xml:lang":item.attr("xml:lang"),languagesList:item.data("languagesList"),rtl:rtl})),formElement.initWidget($form),formElement.setChangeCallbacks($form,item,{identifier:formElement.getAttributeChangeCallback(),title:function(i,title){item.attr("title",title),areaBroker.getTitleArea().text(item.attr("title"))},timeDependent:formElement.getAttributeChangeCallback(),"xml:lang":function(i,lang){item.attr("xml:lang",lang);var $itemBody=_widget.$container.find(".qti-itemBody");rtl.includes(lang)?(item.attr("dir","rtl"),$itemBody.find(".grid-row").attr("dir","rtl")):(item.attr("dir","ltr"),$itemBody.find(".grid-row").attr("dir","ltr")),item.body(contentHelper.getContent($itemBody))}});var $selectBox=$form.find("select");$selectBox.select2({dropdownAutoWidth:!0,width:"resolve",minimumResultsForSearch:-1,formatSelection:function formatSelection(data){return data.css?"<span class=\"".concat(data.css,"\">").concat(data.text,"</span>"):data.text}}),rtl.includes(item.attr("xml:lang"))&&item.attr("dir","rtl")},_.noop);return ItemStateActive}),define("taoQtiItem/qtiCreator/widgets/item/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/item/states/Active"],function(factory){return factory.createBundle(arguments)}),define("taoQtiItem/qtiCreator/widgets/item/Widget",["lodash","i18n","jquery","core/promise","util/url","taoQtiItem/qtiCreator/widgets/Widget","taoQtiItem/qtiCreator/widgets/item/states/states","taoQtiItem/qtiItem/core/Element","taoQtiItem/qtiCreator/helper/creatorRenderer","taoQtiItem/qtiCreator/model/helper/container","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiCreator/helper/xmlRenderer","taoQtiItem/qtiCreator/helper/devTools","taoQtiItem/qtiCreator/widgets/static/text/Widget","taoQtiItem/qtiItem/helper/xmlNsHandler","taoQtiItem/qtiCreator/editor/jquery.gridEditor"],function(_,__,$,Promise,urlUtil,Widget,states,Element,creatorRenderer,containerHelper,contentHelper,xmlRenderer,devTools,TextWidget,xmlNsHandler){'use strict';function hasUnsupportedInteraction(xml){var $qti=$(xml);return 0<$qti.find("div.qti-interaction.qti-customInteraction[data-serial]").length}var ItemWidget=Widget.clone(),_detachElements=function(container,elements){var containerElements={};return _.each(elements,function(elementSerial){containerElements[elementSerial]=container.elements[elementSerial],delete container.elements[elementSerial]}),containerElements};return ItemWidget.initCreator=function(config){var _this30=this;if(this.registerStates(states),Widget.initCreator.call(this),!config||!config.uri)throw new Error("missing required config parameter uri in item widget initialization");return this.saveItemUrl=config.saveItemUrl,this.renderer=config.renderer,this.itemUri=config.uri,config.perInteractionRp&&xmlRenderer.setProvider("perInteractionRP"),new Promise(function(resolve){_this30.initTextWidgets(function(){_this30.initGridEditor(),_this30.debug({state:!1,xml:!1}),resolve()})})},ItemWidget.buildContainer=function(){this.$container=this.$original},ItemWidget.save=function(){var _this31=this;return new Promise(function(resolve,reject){function rejectError(err){"Error"===err.type&&(err=new Error(__("The item has not been saved!")+(err.message?"\n".concat(err.message):""))),reject(err)}var xml=xmlNsHandler.restoreNs(xmlRenderer.render(_this31.element),_this31.element.getNamespaces());return hasUnsupportedInteraction(xml)?reject(new Error(__("The item cannot be saved because it contains an unsupported custom interaction."))):void $.ajax({url:urlUtil.build(_this31.saveItemUrl,{uri:_this31.itemUri}),type:"POST",contentType:"text/xml",dataType:"json",data:xml}).done(function(data){!data||data.success?resolve(data):rejectError(data)}).fail(rejectError)})},ItemWidget.initUiComponents=function(){var element=this.element,$saveBtn=$("#save-trigger");this.on("metaChange",function(data){if(data.element.getSerial()===element.getSerial()&&"invalid"===data.key){var invalid=element.data("invalid");_.size(invalid)?$saveBtn.addClass("disabled"):$saveBtn.removeClass("disabled")}},!0)},ItemWidget.initGridEditor=function(){var _this=this,item=this.element,$itemBody=this.$container.find(".qti-itemBody"),$itemEditorPanel=$("#item-editor-panel");$itemBody.gridEditor(),$itemBody.gridEditor("resizable"),$itemBody.gridEditor("addInsertables",$(".tool-list > [data-qti-class]:not(.disabled)"),{helper:function helper(){return $(this).find(".icon").clone().addClass("dragging")}}),$itemBody.on("beforedragoverstart.gridEdit",function(){$itemEditorPanel.addClass("dragging"),$itemBody.removeClass("hoverable").addClass("inserting")}).on("dragoverstop.gridEdit",function(){$itemEditorPanel.removeClass("dragging"),$itemBody.addClass("hoverable").removeClass("inserting")}).on("dropped.gridEdit.insertable",function(e,qtiClass,$placeholder){$placeholder.removeAttr("id"),"rubricBlock"===qtiClass&&($placeholder=$placeholder.parent(".col-12").parent(".grid-row")),$placeholder.addClass("widget-box"),$placeholder.attr({"data-new":!0,"data-qti-class":qtiClass});var $widget=$placeholder.parent().closest(".widget-box, .qti-item"),$editable=$placeholder.closest("[data-html-editable], .qti-itemBody"),itemWidget=$widget.data("widget"),element=itemWidget.element,container=Element.isA(element,"_container")?element:element.getBody();if("rtl"===element.attr("dir")&&$placeholder.parent(".col-12").parent(".grid-row").attr("dir","rtl"),!element||!$editable.length)throw new Error("cannot create new element");containerHelper.createElements(container,contentHelper.getContent($editable),function(newElts){creatorRenderer.get().load(function(){var _this32=this;_.forEach(newElts,function(elt){var $colParent=$placeholder.parent(),$widgetNewElem,widget;elt.setRenderer(_this32),Element.isA(elt,"_container")?($colParent.empty(),$colParent.html(elt.render()),widget=_this.initTextWidget(elt,$colParent),$widgetNewElem=widget.$container):(elt.render($placeholder),elt.postRender(itemWidget.options),widget=elt.data("widget"),$widgetNewElem=Element.isA(elt,"blockInteraction")?widget.$container:widget.$original),$widgetNewElem.trigger("contentChange.gridEdit"),$widgetNewElem.trigger("resize.gridEdit"),Element.isA(elt,"interaction")?widget.changeState("question"):widget.changeState("active")})},this.getUsedClasses())})}).on("resizestop.gridEdit",function(){item.body($itemBody.gridEditor("getContent"))})},ItemWidget.initTextWidgets=function(callback){var _this33=this,item=this.element,$originalContainer=this.$container,subContainers=[],i=1;callback=callback||_.noop,$originalContainer.find(".qti-itemBody > .grid-row").each(function(){var $row=$(this);$row.hasClass("widget-box")||$row.children().each(function(){var $col=$(this),isTextBlock=!1;$col.contents().each(function(){if(3===this.nodeType&&this.nodeValue&&this.nodeValue.trim())return isTextBlock=!0,!1});var $widget=$col.children();(1<$widget.length||!$widget.hasClass("widget-blockInteraction"))&&($widget.hasClass("colrow")?$widget.each(function(){var $subElement=$(this),$subWidget=$subElement.children();(1<$subWidget.length||!$subWidget.hasClass("widget-blockInteraction"))&&($subElement.attr("data-text-block-id","text-block-".concat(i)),i++)}):0===$widget.find(".widget-blockInteraction").length&&(isTextBlock=!0)),isTextBlock&&($col.attr("data-text-block-id","text-block-".concat(i)),i++)})});var $clonedContainer=$originalContainer.clone();$clonedContainer.find(".qti-itemBody > .grid-row [data-text-block-id]").each(function(){var $originalTextBlock=$(this),textBlockId=$originalTextBlock.data("text-block-id"),$subContainer=$originalTextBlock.clone(),subContainerElements=contentHelper.serializeElements($subContainer),subContainerBody=$subContainer.html();$originalTextBlock.removeAttr("data-text-block-id").html("{{_container:new}}"),subContainers.push({body:subContainerBody,elements:subContainerElements,$original:$originalContainer.find("[data-text-block-id=\"".concat(textBlockId,"\"]")).removeAttr("data-text-block-id")})}),contentHelper.serializeElements($clonedContainer);var serializedItemBody=$clonedContainer.find(".qti-itemBody").html(),itemBody=item.getBody();subContainers.length?containerHelper.createElements(itemBody,serializedItemBody,function(newElts){if(_.size(newElts)!==subContainers.length)throw new Error("number of sub-containers mismatch");else _.each(newElts,function(container){var containerData=subContainers.shift(),containerElements=_detachElements(itemBody,containerData.elements);container.setElements(containerElements,containerData.body),_this33.initTextWidget(container,containerData.$original)}),_.defer(function(){callback.call(this)})}):callback.call(this)},ItemWidget.initTextWidget=function(container,$col){return TextWidget.build(container,$col,this.renderer.getOption("textOptionForm"),{})},ItemWidget.debug=function(options){if(options=options||{},options.state&&devTools.listenStateChange(),options.xml){var $code=$("<code>",{class:"language-markup"}),$pre=$("<pre>",{class:"line-numbers"}).append($code);$("#item-editor-wrapper").append($pre),devTools.liveXmlPreview(this.element,$code)}},ItemWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/item",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}function program3(depth0){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1)),buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div class=\"tao-scope qti-item item-editor-item clearfix\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n <div id=\"modalFeedbacks\"></div>\n <div",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.id),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" class=\"qti-itemBody item-editor-drop-area hoverable",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["class"]),{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/renderers/Item",["jquery","lodash","taoQtiItem/qtiCommonRenderer/renderers/Item","taoQtiItem/qtiCreator/widgets/item/Widget","tpl!taoQtiItem/qtiCreator/tpl/item"],function($,_,CommonRenderer,Widget,tpl){'use strict';var CreatorItem=_.clone(CommonRenderer),_normalizeItemBody=function($itemBody){return $itemBody.children().each(function(){var $child=$(this);$child.hasClass("grid-row")||$child.hasClass("qti-infoControl")||$child.wrap("<div class=\"grid-row\"><div class=\"col-12\"></div></div>")}),$itemBody};return CreatorItem.template=tpl,CreatorItem.render=function(item,options){var $itemContainer=CommonRenderer.getContainer(item);return _normalizeItemBody($itemContainer.find(".qti-itemBody")),options=options||{},options.state="active",options.renderer=this,Widget.build(item,$itemContainer,this.getOption("itemOptionForm"),options)},CreatorItem}),define("taoQtiItem/qtiCreator/widgets/static/math/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Sleep"],function(stateFactory,SleepState){var MathStateSleep=stateFactory.extend(SleepState,function(){},function(){});return MathStateSleep}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/math",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n\n<div class=\"panel\">\n <label for=\"display\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Display",options):helperMissing.call(depth0,"__","Display",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"How the math expression should be displayed.",options):helperMissing.call(depth0,"__","How the math expression should be displayed.",options)))+"</div>\n\n <select name=\"display\" class=\"select2\" data-has-search=\"false\">\n <option value=\"inline\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"inline",options):helperMissing.call(depth0,"__","inline",options)))+"</option>\n <option value=\"block\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"block",options):helperMissing.call(depth0,"__","block",options)))+"</option>\n </select>\n</div>\n\n<div class=\"panel\">\n <label for=\"editMode\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Editing Mode",options):helperMissing.call(depth0,"__","Editing Mode",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"How the math expression should be edited",options):helperMissing.call(depth0,"__","How the math expression should be edited",options)))+".</div>\n\n <select name=\"editMode\" class=\"select2\" data-has-search=\"false\">\n <option value=\"latex\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"LaTeX",options):helperMissing.call(depth0,"__","LaTeX",options)))+"</option>\n <option value=\"mathml\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"MathML",options):helperMissing.call(depth0,"__","MathML",options)))+"</option>\n </select>\n\n</div>\n\n<div class=\"panel\" data-role=\"latex\" style=\"display:none;\">\n <label for=\"sidebar-latex-field\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Latex",options):helperMissing.call(depth0,"__","Latex",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Edit math expression using LaTex type setting system, e.g. e^{i \\pi} = -1",options):helperMissing.call(depth0,"__","Edit math expression using LaTex type setting system, e.g. e^{i \\pi} = -1",options)))+"</div>\n\n <input id=\"sidebar-latex-field\" type=\"text\" name=\"latex\" value=\"",(helper=helpers.latex)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.latex,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" placeholder=\"e.g. e^{i \\pi} = -1\"/>\n\n <div class=\"panel\">\n <button class=\"btn-info small block popup-btn\" data-control=\"latex\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Large editor",options):helperMissing.call(depth0,"__","Large editor",options)))+"</button>\n <button class=\"btn-info small block popup-btn\" data-control=\"latexWysiwyg\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"WYSIWYG editor",options):helperMissing.call(depth0,"__","WYSIWYG editor",options)))+"</button>\n </div>\n</div>\n\n<div class=\"panel\" data-role=\"mathml\" style=\"display:none;\">\n <label for=\"sidebar-mathml-field\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"MathML",options):helperMissing.call(depth0,"__","MathML",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Edit math expression using MathML",options):helperMissing.call(depth0,"__","Edit math expression using MathML",options)))+"</div>\n\n <textarea id=\"sidebar-mathml-field\" name=\"mathml\">",(helper=helpers.mathml)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.mathml,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</textarea>\n\n <div class=\"panel\">\n <button class=\"btn-info small block popup-btn\" data-control=\"mathml\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Large editor",options):helperMissing.call(depth0,"__","Large editor",options)))+"</button>\n </div>\n\n <div class=\"math-buffer\" style=\"visibility:hidden;\"></div>\n</div>\n\n",buffer}function program3(depth0,data){var buffer="",helper,options;return buffer+="\n<div class=\"panel\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"MathJax is not installed.",options):helperMissing.call(depth0,"__","MathJax is not installed.",options)))+"\n</div>\n",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.mathjax,{hash:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),data:data}),stack1||0===stack1?stack1:""})}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/mathPopup",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<textarea class=\"math-popup-input math-popup-input-",(helper=helpers.popupMode)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.popupMode,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" name=\"",(helper=helpers.popupMode)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.popupMode,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"-large\" placeholder=\"",(helper=helpers.placeholder)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.placeholder,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"></textarea>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/math/states/Active",["jquery","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Active","taoQtiItem/qtiCreator/helper/windowPopup","taoQtiItem/qtiCreator/editor/MathEditor","taoQtiItem/qtiCreator/editor/mathInput/mathInput","tpl!taoQtiItem/qtiCreator/tpl/forms/static/math","tpl!taoQtiItem/qtiCreator/tpl/forms/static/mathPopup","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/static/helpers/inline","ui/dynamicComponent","lodash","i18n","mathJax","ui/tooltip"],function($,stateFactory,Active,windowPopupFactory,MathEditor,mathInputFactory,formTpl,popupFormTpl,formElement,inlineHelper,dynamicComponent,_,__,mathJax,tooltip){'use strict';function _attachMathmlWarning($mathField){var tooltipContent=__("Currently conversion from MathML to LaTeX is not available. Editing MathML here will have the LaTex code discarded."),widgetTooltip;$mathField.data("$tooltip")||(widgetTooltip=tooltip.error($mathField,tooltipContent,{trigger:"manual"}),$mathField.data("$tooltip",widgetTooltip))}var _throttle=300,MathActive;return MathActive=stateFactory.extend(Active,function(){this.initForm()},function(){_.invoke(this.popups,"destroy"),this.popups=null,this.fields&&this.fields.$mathml&&(this.fields.$mathml.data("$tooltip").dispose(),this.fields.$mathml.removeData("$tooltip")),this.fields=null,this.widget.$form.empty()}),MathActive.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,math=_widget.element,mathML=math.mathML||"",tex=math.getAnnotation("latex")||"",display=math.attr("display")||"inline",editMode="latex",areaBroker=this.widget.getAreaBroker(),$popupsContainer;!tex.trim()&&mathML.trim()&&(editMode="mathml"),$form.html(formTpl({mathjax:!!mathJax,editMode:editMode,latex:tex,mathml:mathML})),mathJax&&(this.fields={$mathml:$form.find("textarea[name=mathml]"),$latex:$form.find("input[name=latex]")},_attachMathmlWarning(this.fields.$mathml),$form.find("select[name=editMode]").val(editMode),$form.find("select[name=display]").val(display),this._toggleMode(editMode),$popupsContainer=areaBroker.getContainer(),this.popups={latexWysiwyg:this.createLatexWysiwygPopup(),latex:this.createLargeEditorPopup("latex"),mathml:this.createLargeEditorPopup("mathml")},_.forOwn(this.popups,function(popup){popup.init().render($popupsContainer).center().hide()}),formElement.initWidget($form),this.initFormChangeListener())},MathActive.prototype.initFormChangeListener=function(){var self=this,_widget=this.widget,$container=_widget.$container,$form=_widget.$form,math=_widget.element,mathML=math.mathML,tex=math.getAnnotation("latex"),display=math.attr("display")||"inline",mathEditor;mathEditor=new MathEditor({tex:tex,mathML:mathML,display:display,buffer:$form.find(".math-buffer"),target:_widget.$original}),formElement.setChangeCallbacks($form,math,{display:function(m,value){"block"===value?m.attr("display","block"):m.removeAttr("display"),_widget.rebuild({ready:function ready(widget){widget.changeState("active")}})},editMode:function editMode(m,value){self._toggleMode(value)},latex:_.throttle(function(m,value){mathEditor.setTex(value).renderFromTex(function(){m.setAnnotation("latex",value),self.fields&&self.fields.$mathml.val(mathEditor.mathML),m.setMathML(mathEditor.mathML),inlineHelper.togglePlaceholder(_widget),$container.change()})},_throttle),mathml:_.throttle(function(m,value){var hasChanged=value!==mathEditor.mathML;mathEditor.setMathML(value).renderFromMathML(function(){m.setMathML(mathEditor.mathML),hasChanged&&(self.fields&&self.fields.$latex.val(""),m.removeAnnotation("latex")),inlineHelper.togglePlaceholder(_widget),$container.change()})},_throttle)}),$form.find(".popup-btn").on("click",function(e){var $target=$(e.target),targetPopup=$target.data("control");self.popups[targetPopup]&&self.popups[targetPopup].show()})},MathActive.prototype.createLatexWysiwygPopup=function(){var self=this;return windowPopupFactory({},{windowTitle:"LaTeX (WYSIWYG)",width:640,height:280,minWidth:460,maxWidth:960,minHeight:220,maxHeight:640}).on("render",function(){var $popupContent=this.getBody();this.mathInput=mathInputFactory().init().render($popupContent).on("change",function(latex){self.fields.$latex.val(latex),self.fields.$latex.trigger("keyup")})}).on("show",function(){var currentLatex=self.fields.$latex.val(),mathInput=this.mathInput;_.defer(function(){mathInput.setLatex(currentLatex)}),self._disableForm()}).on("hide",function(){self._enableForm()})},MathActive.prototype.createLargeEditorPopup=function(popupMode){var self=this,popupOptions={windowTitle:"latex"===popupMode?"LaTeX":"MathML",width:640,height:320,minWidth:240,maxWidth:960,minHeight:160,maxHeight:640},smallField=self.fields["$"+popupMode];return windowPopupFactory({},popupOptions).on("render",function(){var $popupContent=this.getBody();this.$popupField=$(popupFormTpl({popupMode:popupMode,placeholder:smallField.attr("placeholder")})),$popupContent.append(this.$popupField),this.$popupField.on("mousedown",function(e){e.stopPropagation()}).on("keyup",function(e){smallField.val($(e.target).val()),smallField.trigger("keyup")})}).on("show",function(){this.$popupField.val(smallField.val()),"mathml"===popupMode&&self.fields.$mathml.data("$tooltip").hide(),self._disableForm()}).on("hide",function(){self._enableForm()})},MathActive.prototype._enableForm=function(){this.widget.$form.find("button,input,select,textarea").prop("disabled",!1)},MathActive.prototype._disableForm=function(){this.widget.$form.find("button,input,select,textarea").prop("disabled",!0)},MathActive.prototype._toggleMode=function(mode){var self=this,_widget=this.widget,$form=_widget.$form,panels={$mathml:$form.children(".panel[data-role=\"mathml\"]"),$latex:$form.children(".panel[data-role=\"latex\"]")};switch(mode){case"latex":{panels.$latex.show(),panels.$mathml.hide(),this.fields.$mathml.data("$tooltip").hide();break}case"mathml":{panels.$latex.hide(),panels.$mathml.show(),this.fields.$latex.val()&&(this.fields.$mathml.data("$tooltip").show(),this.fields.$mathml.on("keyup.mathWarning",function(){self.fields.$mathml.data("$tooltip").hide(),self.fields.$mathml.off(".mathWarning")}));break}}},MathActive}),define("taoQtiItem/qtiCreator/widgets/static/math/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states","taoQtiItem/qtiCreator/widgets/static/math/states/Sleep","taoQtiItem/qtiCreator/widgets/static/math/states/Active"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/static/math/Widget",["taoQtiItem/qtiCreator/widgets/static/Widget","taoQtiItem/qtiCreator/widgets/static/math/states/states","taoQtiItem/qtiCreator/widgets/static/helpers/widget","tpl!taoQtiItem/qtiCreator/tpl/toolbars/media","taoQtiItem/qtiCreator/widgets/static/helpers/inline"],function(Widget,states,helper,toolbarTpl,inlineHelper){var MathWidget=Widget.clone();return MathWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this),inlineHelper.togglePlaceholder(this)},MathWidget.buildContainer=function(){return"block"===this.element.attr("display")?helper.buildBlockContainer(this):helper.buildInlineContainer(this),this},MathWidget.createToolbar=function(){return helper.createToolbar(this,toolbarTpl),this},MathWidget}),define("taoQtiItem/qtiCreator/renderers/Math",["lodash","taoQtiItem/qtiCommonRenderer/renderers/Math","taoQtiItem/qtiCreator/widgets/static/math/Widget","taoQtiItem/qtiItem/core/Element"],function(_,Renderer,Widget,Element){'use strict';function isEditable(element){var parent=element.parent();return!Element.isA(parent,"hottext")}var CreatorMath=_.clone(Renderer);return CreatorMath.render=function(math,options){isEditable(math)&&(Renderer.render(math),Widget.build(math,Renderer.getContainer(math),this.getOption("bodyElementOptionForm"),options))},CreatorMath}),define("taoQtiItem/qtiCreator/widgets/static/modalFeedback/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/states/Sleep"],function(stateFactory,SleepState){return stateFactory.create(SleepState,function(){},function(){})}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/modalFeedback",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n \t\t<option value=\"",(helper=helpers.cssClass)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.cssClass,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n \t",buffer}function program2(){return"selected=\"selected\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Identifier",options):helperMissing.call(depth0,"__","Identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The identifier of the modal feedback. This identifier must not be used by any other modal feedback or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options):helperMissing.call(depth0,"__","The identifier of the modal feedback. This identifier must not be used by any other modal feedback or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options)))+"</div>\n <input type=\"text\" \n name=\"identifier\" \n value=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" \n placeholder=\"e.g. modal-feedback_1\" \n data-validate=\"$notEmpty; $qtiIdentifier; $availableIdentifier(serial=",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+");\">\n</div>\n<div class=\"panel\">\n <label for=\"feedbackStyle\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Feedback Style",options):helperMissing.call(depth0,"__","Feedback Style",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select predefined feedback style from the list.",options):helperMissing.call(depth0,"__","Select predefined feedback style from the list.",options)))+"</span>\n <select name=\"feedbackStyle\" class=\"select2\" data-has-search=\"false\">\n \t",stack1=helpers.each.call(depth0,depth0&&depth0.feedbackStyles,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/modalFeedback/states/Active",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Active","taoQtiItem/qtiCommonRenderer/renderers/ModalFeedback","tpl!taoQtiItem/qtiCreator/tpl/forms/static/modalFeedback","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiItem/helper/container","lodash","i18n","jquery","ui/modal"],function(stateFactory,Active,commonRenderer,formTpl,formElement,htmlEditor,contentHelper,containerHelper,_,__,$){'use strict';function _prepareFeedbackStyles(widget){var styles=[{cssClass:"",title:__("standard")},{cssClass:"positive",title:__("positive")},{cssClass:"negative",title:__("negative")}];return _(styles).filter(function(style){return void 0!==style.cssClass}).map(function(style){return containerHelper.hasEncodedData(widget.element,"modalFeedback",style.cssClass)&&(style.selected=!0),style}).value()}var buildTitleEditor=function($title,element,htmleditor){$title.on("edit.inplacer",function(){htmleditor.setReadOnly(!0)}).on("leave.inplacer",function(){htmleditor.setReadOnly(!1)}).inplacer({target:$("#qti-title")}).attr("title",__("Edit modal feedback title")).on("change",function(){element.attr("title",$(this).text())})},destroyTitleEditor=function($title){$title.inplacer("destroy"),$title.off(".inplacer")},buildBodyEditor=function(widget){var $editableContainer=widget.$container.find(".modal-body"),element=widget.element,container=element.getBody();$editableContainer.attr("data-html-editable-container",!0),$editableContainer.one("editorready",function(e,editor){buildTitleEditor(widget.$original.find(".qti-title"),element,editor)}),htmlEditor.hasEditor($editableContainer)||htmlEditor.buildEditor($editableContainer,{placeholder:__("Edit modal feedback"),change:contentHelper.getChangeCallback(container),data:{container:container,widget:widget}})},destroyBodyEditor=function(widget){htmlEditor.destroyEditor(widget.$container.find(".modal-body")),destroyTitleEditor(widget.$original.find(".qti-title"))},indices=function(){var selectors={sidebar:"#item-editor-item-widget-bar",cke:".cke",ckeBase:".cke_inner",ckeNose:".cke_nose",ckeToolbar:".cke_toolbar"},elements={},selector;return{raise:function raise(baseIndex){var $elem,index;for(selector in baseIndex=parseInt(baseIndex,10),selectors)$elem=$(selectors[selector]),index=parseInt($elem.css("z-index"),10),isNaN(index)&&(index=100),elements[selector]={element:$elem,index:index},$elem.css("z-index",elements[selector].index+baseIndex)},reset:function reset(){if(!1)for(selector in elements)elements[selector].element.css("z-index",elements[selector].index)}}}(),_ckeIsReady=function($editable){var dfd=new $.Deferred,poll=function(){var editor=$editable.data("editor");editor?dfd.resolve():setTimeout(poll,200)};return poll(),dfd.promise()},ModalFeedbackStateActive=stateFactory.extend(Active,function(){var _widget=this.widget,$container=this.widget.$container,$editable=$container.find("[data-html-editable]");$container.modal({startClosed:!0,width:commonRenderer.width,top:200}),$container.modal("open"),$container.css({height:"auto",position:"fixed"}),buildBodyEditor(_widget),$.when(_ckeIsReady($editable)).then(function(){indices.raise($container.css("z-index"))}),$container.on("closed.modal",function(){_widget.changeState("sleep")}),this.widget.offEvents("otherActive"),this.initForm(),this.widget.$form.show()},function(){var $container=this.widget.$container;destroyBodyEditor(this.widget),$container.off("opened.modal").off(".active"),$container.modal("close"),indices.reset(),$container.find(".tlb-button.active[data-role=cke-launcher]").click(),this.widget.$form.empty().hide()});return ModalFeedbackStateActive.prototype.initForm=function(){var _widget=this.widget,$container=_widget.$container,feedbackStyles=_prepareFeedbackStyles(_widget);_widget.$form.html(formTpl({serial:_widget.element.getSerial(),identifier:_widget.element.id(),feedbackStyles:feedbackStyles})),formElement.initWidget(_widget.$form),formElement.setChangeCallbacks(_widget.$form,_widget.element,{identifier:function identifier(fb,value){fb.id(value)},feedbackStyle:function feedbackStyle(fb,newValue){var oldValue=containerHelper.getEncodedData(_widget.element,"modalFeedback");containerHelper.setEncodedData(fb,"modalFeedback",newValue),oldValue&&$container.removeClass(oldValue),$container.addClass(newValue),containerHelper.setEncodedDataToDom($container.find(".cke_editable"),"modalFeedback",newValue,oldValue)}})},ModalFeedbackStateActive}),define("taoQtiItem/qtiCreator/widgets/static/modalFeedback/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states","taoQtiItem/qtiCreator/widgets/static/modalFeedback/states/Sleep","taoQtiItem/qtiCreator/widgets/static/modalFeedback/states/Active"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/static/modalFeedback/Widget",["jquery","taoQtiItem/qtiCreator/widgets/static/Widget","taoQtiItem/qtiCreator/widgets/static/modalFeedback/states/states","tpl!taoQtiItem/qtiCreator/tpl/toolbars/okButton"],function($,Widget,states,okButtonTpl){'use strict';var ModalFeedbackWidget=Widget.clone();return ModalFeedbackWidget.initCreator=function(){Widget.initCreator.call(this),this.registerStates(states),this.createOkButton()},ModalFeedbackWidget.buildContainer=function(){this.$container=this.$original.addClass("widget-box")},ModalFeedbackWidget.createToolbar=function(){return this},ModalFeedbackWidget.createOkButton=function(){var _this=this;this.$container.append($(okButtonTpl()).on("click.qti-widget",function(e){e.stopPropagation(),_this.changeState("sleep")}))},ModalFeedbackWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/modalFeedback/modal",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div id=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" class=\"",stack1=helpers.unless.call(depth0,depth0&&depth0.inline,{hash:{},inverse:self.noop,fn:self.program(1,function(){return"modal "},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="qti-modalFeedback ",(helper=helpers.feedbackStyle)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.feedbackStyle,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <h2 class=\"qti-title modal-title\">"+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.title),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</h2>\n <div class=\"modal-body\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/renderers/ModalFeedback",["lodash","taoQtiItem/qtiCommonRenderer/renderers/ModalFeedback","taoQtiItem/qtiCreator/widgets/static/modalFeedback/Widget","tpl!taoQtiItem/qtiCreator/tpl/modalFeedback/modal"],function(_,Renderer,Widget,modalTpl){'use strict';var ModalFeedback=_.clone(Renderer);return ModalFeedback.template=modalTpl,ModalFeedback.render=function(modalFeedback,options){options=options||{},Widget.build(modalFeedback,Renderer.getContainer(modalFeedback),this.getOption("modalFeedbackOptionForm"),options)},ModalFeedback}),define("taoQtiItem/qtiCreator/widgets/static/object/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Sleep"],function(stateFactory,SleepState){'use strict';var ObjectStateSleep=stateFactory.create(SleepState,function(){},function(){});return ObjectStateSleep}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/object",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<div class=\"panel\">\n <div>\n <label for=\"src\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"File",options):helperMissing.call(depth0,"__","File",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The file path to the object.",options):helperMissing.call(depth0,"__","The file path to the object.",options)))+"</div>\n <input type=\"text\" name=\"src\" value=\"",(helper=helpers.src)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.src,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty; $fileExists(baseUrl=",(helper=helpers.baseUrl)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.baseUrl,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+")\"/>\n <button class=\"btn-info small block\" data-role=\"upload-trigger\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select object",options):helperMissing.call(depth0,"__","Select object",options)))+"</button>\n </div>\n</div>\n\n<div class=\"panel size-panel\">\n <div>\n <label for=\"width\" class=\"spinner\">Width</label>\n <input name=\"width\" value=\"",(helper=helpers.width)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.width,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" class=\"large\" data-increment=\"10\" data-min=\"10\"\n data-max=\"1920\"/>\n </div>\n <div>\n <label for=\"height\" class=\"spinner\">Height</label>\n <input name=\"height\" value=\"",(helper=helpers.height)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.height,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" class=\"large\" data-increment=\"10\" data-min=\"10\"\n data-max=\"1080\"/>\n </div>\n</div>\n\n<div class=\"panel media-size-panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Size and position",options):helperMissing.call(depth0,"__","Size and position",options)))+"</h3>\n <div class=\"media-sizer\">\n <!-- mediaEditorComponent goes here -->\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/object/states/Active",["lodash","jquery","i18n","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Active","tpl!taoQtiItem/qtiCreator/tpl/forms/static/object","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/static/helpers/inline","ui/mediaEditor/mediaEditorComponent","ui/previewer","ui/resourcemgr","ui/tooltip"],function(_,$,__,stateFactory,Active,formTpl,formElement,inlineHelper,mediaEditorComponent){'use strict';var _Mathround10=Math.round,_Mathmax6=Math.max,_Mathmin5=Math.min,mediaEditor=null,$panelObjectSize=null,$panelMediaSize=null,_config={renderingThrottle:1e3,fileFilters:"image/jpeg,image/png,image/gif,image/svg+xml,video/mp4,video/avi,video/ogv,video/mpeg,video/ogg,video/quicktime,video/webm,video/x-ms-wmv,video/x-flv,audio/mp3,audio/vnd.wav,audio/ogg,audio/vorbis,audio/webm,audio/mpeg,application/ogg,audio/aac,application/pdf"},ObjectStateActive=stateFactory.extend(Active,function(){this.initForm()},function(){mediaEditor&&mediaEditor.destroy(),mediaEditor=null,$panelObjectSize=null,$panelMediaSize=null,this.widget.$original.off("playerready"),this.widget.$form.empty()}),refreshRendering=_.throttle(function(widget){var obj=widget.element,$container=widget.$original,previewOptions={url:obj.renderer.resolveUrl(obj.attr("data")),mime:obj.attr("type")};obj.attr("height")&&(previewOptions.height=obj.attr("height")),obj.attr("width")&&(previewOptions.width=obj.attr("width")),previewOptions.url&&previewOptions.mime&&$container.previewer(previewOptions)},_config.renderingThrottle),videoResponsiveWidth=function(widget){var $container=widget.$original,qtiObject=widget.element,mediaplayer=$container.data("player"),originalSize=mediaplayer.getMediaOriginalSize(),width=qtiObject.attr("width"),height=qtiObject.attr("height");if(!originalSize.width)return 0;var containerWidth=$container.closest(".widget-textBlock").width();if(!width)width=_Mathround10(100/(containerWidth/originalSize.width));else if(height){var scaleHeight=(_Mathmax6(height||0,200)-$container.find(".mediaplayer .controls").height())/originalSize.height,scaleWidth=_Mathmax6(width||0,200)/originalSize.width,scale=_Mathmin5(scaleHeight,scaleWidth);width=_Mathround10(100/(containerWidth/(scale*originalSize.width)))}return width},createMediaEditor=function($panel,$container,qtiObject,width,height,onChange){mediaEditor&&mediaEditor.destroy(),mediaEditor=mediaEditorComponent($panel,{$node:$container.find(".mediaplayer .media"),$container:$container,type:qtiObject.attr("type"),width:width,height:height,responsive:!0},{mediaDimension:{active:!0,showResponsiveToggle:!1}}).on("change",onChange)},setMediaSizeEditor=function(widget){var qtiObject=widget.element;if(/video/.test(qtiObject.attr("type"))){var $container=widget.$original,mediaplayer=$container.data("player"),width=qtiObject.attr("width"),height=qtiObject.attr("height");if(!/%/.test(width)){if(width=videoResponsiveWidth(widget),!width)return;height=0,qtiObject.removeAttr("height")}var onChange=_.debounce(function(nMedia){if(qtiObject.attr("width")!=="".concat(nMedia.width,"%")){var newWidth="".concat(_Mathround10(nMedia.width),"%");qtiObject.attr("width",newWidth),mediaplayer.resize(newWidth,"auto")}},200);createMediaEditor($panelMediaSize,$container,qtiObject,width,height,onChange)}},hideShowPanels=function(type){/video/.test(type)?($panelObjectSize.hide(),$panelMediaSize.show()):(mediaEditor&&mediaEditor.destroy(),$panelObjectSize.show(),$panelMediaSize.hide())},_initUpload=function(widget){var $form=widget.$form,options=widget.options,qtiObject=widget.element,$uploadTrigger=$form.find("[data-role=\"upload-trigger\"]"),$src=$form.find("input[name=src]"),_openResourceMgr=function(){$uploadTrigger.resourcemgr({title:__("Please select a media file from the resource manager. You can add files from your computer with the button \"Add file(s)\"."),appendContainer:options.mediaManager.appendContainer,mediaSourcesUrl:options.mediaManager.mediaSourcesUrl,browseUrl:options.mediaManager.browseUrl,uploadUrl:options.mediaManager.uploadUrl,deleteUrl:options.mediaManager.deleteUrl,downloadUrl:options.mediaManager.downloadUrl,fileExistsUrl:options.mediaManager.fileExistsUrl,params:{uri:options.uri,lang:options.lang,filters:_config.fileFilters},pathParam:"path",select:function select(e,files){var file,type;files&&files.length&&(file=files[0].file,type=files[0].mime,qtiObject.attr("type",type),$src.val(file).trigger("change"))},open:function open(){$src.data("$tooltip")&&$src.blur().data("$tooltip").hide()},close:function close(){$src.blur()}})};$uploadTrigger.on("click",_openResourceMgr),$src.val()||_openResourceMgr()};return ObjectStateActive.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,qtiObject=_widget.element,baseUrl=_widget.options.baseUrl,$container=_widget.$original;$form.html(formTpl({baseUrl:baseUrl||"",src:qtiObject.attr("data"),alt:qtiObject.attr("alt"),height:qtiObject.attr("height"),width:qtiObject.attr("width")})),$panelObjectSize=$(".size-panel",$form),$panelMediaSize=$(".media-size-panel",$form),hideShowPanels(qtiObject.attr("type")),_initUpload(_widget),formElement.initWidget($form),$container.off("playerready").on("playerready",function(){setMediaSizeEditor(_widget)}),formElement.setChangeCallbacks($form,qtiObject,{src:function src(object,value){value!==qtiObject.attr("data")&&(qtiObject.attr("data",value),qtiObject.removeAttr("width"),qtiObject.removeAttr("height"),$form.find("input[name=width]").val(""),$form.find("input[name=height]").val(""),$container.removeData("ui.previewer"),hideShowPanels(qtiObject.attr("type")),inlineHelper.togglePlaceholder(_widget),refreshRendering(_widget))},width:function width(object,value){var val=parseInt(value,10);_.isNaN(val)?qtiObject.removeAttr("width"):qtiObject.attr("width",val),refreshRendering(_widget)},height:function height(object,value){var val=parseInt(value,10);_.isNaN(val)?qtiObject.removeAttr("height"):qtiObject.attr("height",val),refreshRendering(_widget)},alt:function alt(object,value){qtiObject.attr("alt",value)},align:function align(object,value){inlineHelper.positionFloat(_widget,value)}})},ObjectStateActive}),define("taoQtiItem/qtiCreator/widgets/static/object/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states","taoQtiItem/qtiCreator/widgets/static/object/states/Sleep","taoQtiItem/qtiCreator/widgets/static/object/states/Active"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/static/object/Widget",["taoQtiItem/qtiCreator/widgets/static/Widget","taoQtiItem/qtiCreator/widgets/static/object/states/states","taoQtiItem/qtiCreator/widgets/static/helpers/widget","tpl!taoQtiItem/qtiCreator/tpl/toolbars/media","taoQtiItem/qtiCreator/widgets/static/helpers/inline","i18n"],function(Widget,states,helper,toolbarTpl,inlineHelper){'use strict';var ObjectWidget=Widget.clone();return ObjectWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this),inlineHelper.togglePlaceholder(this)},ObjectWidget.getRequiredOptions=function(){return["baseUrl","uri","lang","mediaManager"]},ObjectWidget.buildContainer=function(){return helper.buildBlockContainer(this),this},ObjectWidget.createToolbar=function(){return helper.createToolbar(this,toolbarTpl),this},ObjectWidget}),define("taoQtiItem/qtiCreator/renderers/Object",["lodash","taoQtiItem/qtiCommonRenderer/renderers/Object","taoQtiItem/qtiCreator/widgets/static/object/Widget"],function(_,Renderer,Widget){'use strict';var CreatorObject=_.clone(Renderer);return CreatorObject.render=function(object,options){Renderer.render(object),options=options||{},options.baseUrl=this.getOption("baseUrl"),options.uri=this.getOption("uri"),options.lang=this.getOption("lang"),options.mediaManager=this.getOption("mediaManager"),options.assetManager=this.getAssetManager(),Widget.build(object,Renderer.getContainer(object),this.getOption("bodyElementOptionForm"),options)},CreatorObject}),define("taoQtiItem/qtiCreator/renderers/PortableInfoControl",["lodash","taoQtiItem/qtiCommonRenderer/renderers/PortableInfoControl","taoQtiItem/portableElementRegistry/icRegistry","taoQtiItem/qtiCreator/helper/commonRenderer"],function(_,Renderer,icRegistry,commonRenderer){'use strict';var CreatorPortableInfoControl=_.clone(Renderer);return CreatorPortableInfoControl.render=function(infoControl,options){var self=this;return new Promise(function(resolve,reject){Renderer.render.call(commonRenderer.get(),infoControl).then(function(){var picCreator=icRegistry.getCreator(infoControl.typeIdentifier).module;picCreator&&(options=options||{},options.baseUrl=self.getOption("baseUrl"),options.uri=self.getOption("uri"),options.lang=self.getOption("lang"),options.mediaManager=self.getOption("mediaManager"),options.assetManager=self.getAssetManager(),picCreator.getWidget().build(infoControl,Renderer.getContainer(infoControl),self.getOption("bodyElementOptionForm"),options)),resolve()}).catch(function(error){reject("Error initializing the creator : "+error)})})},CreatorPortableInfoControl}),define("taoQtiItem/qtiCreator/widgets/static/printedVariable/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Sleep"],function(stateFactory,SleepState){'use strict';var PrintedVariableStateSleep=stateFactory.extend(SleepState);return PrintedVariableStateSleep}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/printedVariable",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n <option value=\"",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.name)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.name,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n ",buffer}function program2(){return" selected"}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"panel\">\n <h3>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Printed Variable",options):helperMissing.call(depth0,"__","Printed Variable",options)))+"</h3>\n\n <label for=\"identifier\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Identifier",options):helperMissing.call(depth0,"__","Identifier",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select the outcome variable you want to display.",options):helperMissing.call(depth0,"__","Select the outcome variable you want to display.",options)))+".\n </div>\n\n <select name=\"identifier\" class=\"select2\" data-has-search=\"false\">\n <option value=\"\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select",options):helperMissing.call(depth0,"__","Select",options)))+"</option>\n ",stack1=helpers.each.call(depth0,depth0&&depth0.outcomes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n\n</div>\n\n<div class=\"panel\">\n <label for=\"format\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Format",options):helperMissing.call(depth0,"__","Format",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The format conversion specifier to use when converting numerical values to strings. See QTI Number Formatting Rules for details.",options):helperMissing.call(depth0,"__","The format conversion specifier to use when converting numerical values to strings. See QTI Number Formatting Rules for details.",options)))+"\n </div>\n\n <input id=\"format\" type=\"text\" name=\"format\" value=\"",(helper=helpers.format)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.format,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"/>\n</div>\n\n<div class=\"panel\">\n <label for=\"powerForm\" class=\"has-icon\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Power form",options):helperMissing.call(depth0,"__","Power form",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"If the variable value is a float and powerForm is set to 'false', the variable will be rendered using the 'e' or 'E' format. If the powerform is set to 'true', the form 'e+n' is changed to 'x 10n'.",options):helperMissing.call(depth0,"__","If the variable value is a float and powerForm is set to 'false', the variable will be rendered using the 'e' or 'E' format. If the powerform is set to 'true', the form 'e+n' is changed to 'x 10n'.",options)))+"\n </div>\n\n <input id=\"powerForm\" type=\"checkbox\" name=\"powerForm\" value=\"true\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.powerForm,{hash:{},inverse:self.noop,fn:self.program(4,function(){return" checked=\"checked\""},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n</div>\n\n<div class=\"panel\">\n <label for=\"base\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Base",options):helperMissing.call(depth0,"__","Base",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The number base to use when converting integer variables to strings with the i conversion type code.",options):helperMissing.call(depth0,"__","The number base to use when converting integer variables to strings with the i conversion type code.",options)))+"\n </div>\n\n <input name=\"base\" type=\"text\" data-increment=\"1\" data-min=\"0\" value=\"",(helper=helpers.base)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.base,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n</div>\n\n<div class=\"panel\">\n <label for=\"index\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Index",options):helperMissing.call(depth0,"__","Index",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The index to use when displaying a variable of ordered cardinality. If a variable of ordered cardinality is to be displayed and index is not set, all the values in the container are displayed.",options):helperMissing.call(depth0,"__","The index to use when displaying a variable of ordered cardinality. If a variable of ordered cardinality is to be displayed and index is not set, all the values in the container are displayed.",options)))+"\n </div>\n\n <input name=\"index\" type=\"text\" data-increment=\"1\" data-min=\"-1\" value=\"",(helper=helpers.index)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.index,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n</div>\n\n<div class=\"panel\">\n <label for=\"delimiter\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Delimiter",options):helperMissing.call(depth0,"__","Delimiter",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The delimiter to use between values when displaying variables of ordered, multiple or record cardinality. \";\" is default when delimiter is not declared. Implementations can override this default with personal preferences or locale settings.",options):helperMissing.call(depth0,"__","The delimiter to use between values when displaying variables of ordered, multiple or record cardinality. \";\" is default when delimiter is not declared. Implementations can override this default with personal preferences or locale settings.",options)))+"\n </div>\n\n <input name=\"delimiter\" type=\"text\" value=\"",(helper=helpers.delimiter)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.delimiter,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n</div>\n\n<div class=\"panel\">\n <label for=\"field\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Field",options):helperMissing.call(depth0,"__","Field",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The field specifier to use when displaying variables of record cardinality.",options):helperMissing.call(depth0,"__","The field specifier to use when displaying variables of record cardinality.",options)))+"\n </div>\n\n <input name=\"field\" type=\"text\" value=\"",(helper=helpers.field)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.field,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n</div>\n\n<div class=\"panel\">\n <label for=\"mappingIndicator\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Mapping Indicator",options):helperMissing.call(depth0,"__","Mapping Indicator",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The mapping indicator to use between field name and field value when displaying variables of record cardinality. \"=\" is default when mappingIndicator is not declared. Implementations can override this default with personal preferences or locale settings.",options):helperMissing.call(depth0,"__","The mapping indicator to use between field name and field value when displaying variables of record cardinality. \"=\" is default when mappingIndicator is not declared. Implementations can override this default with personal preferences or locale settings.",options)))+"\n </div>\n\n <input name=\"mappingIndicator\" type=\"text\" value=\"",(helper=helpers.mappingIndicator)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.mappingIndicator,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/printedVariable/states/Active",["jquery","lodash","i18n","util/typeCaster","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Active","tpl!taoQtiItem/qtiCreator/tpl/forms/static/printedVariable","taoQtiItem/qtiCreator/widgets/helpers/formElement","taoQtiItem/qtiCreator/widgets/static/helpers/inline"],function($,_,__,typeCaster,stateFactory,Active,formTpl,formElement,inlineHelper){'use strict';var PrintedVariableStateActive=stateFactory.extend(Active,function(){this.initForm()},function(){this.widget.$form.empty()});return PrintedVariableStateActive.prototype.initForm=function(){var _widget=this.widget,printedVarEl=_widget.element,$printedVarDom=_widget.$original,$form=_widget.$form,rootElement=printedVarEl.getRootElement(),outcomes=_.isFunction(rootElement.data("getOutcomes"))&&rootElement.data("getOutcomes")();outcomes=(outcomes||[]).map(function(entry){var selected=printedVarEl.attr("identifier")===entry;return{value:entry,name:entry,selected:selected}}),$form.html(formTpl({outcomes:outcomes,format:printedVarEl.attr("format"),powerForm:typeCaster.strToBool(printedVarEl.attr("powerForm")),base:printedVarEl.attr("base"),index:printedVarEl.attr("index"),delimiter:printedVarEl.attr("delimiter"),field:printedVarEl.attr("field"),mappingIndicator:printedVarEl.attr("mappingIndicator")})),formElement.initWidget($form),formElement.setChangeCallbacks($form,printedVarEl,{identifier:function identifier(pv,value,name){printedVarEl.attr(name,value),$printedVarDom.html(value),inlineHelper.togglePlaceholder(_widget)},format:formElement.getAttributeChangeCallback(),powerForm:formElement.getAttributeChangeCallback(),base:formElement.getAttributeChangeCallback(),index:formElement.getAttributeChangeCallback(),delimiter:formElement.getAttributeChangeCallback(),field:formElement.getAttributeChangeCallback(),mappingIndicator:formElement.getAttributeChangeCallback()})},PrintedVariableStateActive}),define("taoQtiItem/qtiCreator/widgets/static/printedVariable/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states","taoQtiItem/qtiCreator/widgets/static/printedVariable/states/Sleep","taoQtiItem/qtiCreator/widgets/static/printedVariable/states/Active"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/static/printedVariable/Widget",["jquery","taoQtiItem/qtiCreator/widgets/static/Widget","taoQtiItem/qtiCreator/widgets/static/printedVariable/states/states","taoQtiItem/qtiCreator/widgets/static/helpers/widget","tpl!taoQtiItem/qtiCreator/tpl/toolbars/media","taoQtiItem/qtiCreator/widgets/static/helpers/inline"],function($,Widget,states,helper,toolbarTpl,inlineHelper){'use strict';var PrintedVariable=Widget.clone();return PrintedVariable.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this),inlineHelper.togglePlaceholder(this)},PrintedVariable.buildContainer=function(){return helper.buildInlineContainer(this),this},PrintedVariable.createToolbar=function(){return helper.createToolbar(this,toolbarTpl),this},PrintedVariable}),define("tpl!taoQtiItem/qtiCreator/tpl/printedVariable",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var stack1;return escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<span data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"printedVariable\">\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</span>",buffer})}),define("taoQtiItem/qtiCreator/renderers/PrintedVariable",["jquery","lodash","taoQtiItem/qtiCommonRenderer/renderers/PrintedVariable","taoQtiItem/qtiCreator/widgets/static/printedVariable/Widget","tpl!taoQtiItem/qtiCreator/tpl/printedVariable"],function($,_,Renderer,Widget,tpl){'use strict';var CreatorPrintedVariable=_.clone(Renderer);return CreatorPrintedVariable.template=tpl,CreatorPrintedVariable.render=function(printedVariable,options){options=options||{},Widget.build(printedVariable,Renderer.getContainer(printedVariable),this.getOption("bodyElementOptionForm"),null,options)},CreatorPrintedVariable}),define("taoQtiItem/qtiCreator/widgets/static/rubricBlock/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Sleep"],function(stateFactory,SleepState){var RubriBlockStateSleep=stateFactory.extend(SleepState,function(){},function(){});return RubriBlockStateSleep}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/rubricBlock",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,stack1,helper,options;return buffer+="<!--currently only visible to the candidate-->\n<div class=\"panel\">\n <label for=\"view\">Visible by</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"A rubric block identifies part of an assessmentItem's itemBody that represents instructions to one or more of the actors that view the item. Although rubric blocks are defined as simpleBlocks they must not contain interactions.",options):helperMissing.call(depth0,"__","A rubric block identifies part of an assessmentItem's itemBody that represents instructions to one or more of the actors that view the item. Although rubric blocks are defined as simpleBlocks they must not contain interactions.",options)))+"\n </div>\n <select name=\"view\" class=\"select2\" data-has-search=\"false\">\n <option value=\"author\">author</option>\n <option value=\"candidate\">candidate</option>\n <option value=\"proctor\">proctor</option>\n <option value=\"scorer\">scorer</option>\n <option value=\"testConstructor\">test constructor</option>\n <option value=\"tutor\">tutor</option>\n </select>\n</div>\n\n<div class=\"panel\">\n <label for=\"use\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Description",options):helperMissing.call(depth0,"__","Description",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The purpose for which the rubric is intended to be used. As a reading passage for multiple items, or instructions for a particular section, for example.",options):helperMissing.call(depth0,"__","The purpose for which the rubric is intended to be used. As a reading passage for multiple items, or instructions for a particular section, for example.",options)))+"</div>\n <input type=\"text\" name=\"use\" value=\"",(helper=helpers.use)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.use,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/rubricBlock/states/Active",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Active","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content","tpl!taoQtiItem/qtiCreator/tpl/forms/static/rubricBlock","taoQtiItem/qtiCreator/widgets/helpers/formElement"],function(stateFactory,Active,htmlEditor,content,formTpl,formElement){var RubricBlockStateActive=stateFactory.extend(Active,function(){this.buildEditor(),this.initForm()},function(){this.destroyEditor(),this.widget.$form.empty()});return RubricBlockStateActive.prototype.buildEditor=function(){var widget=this.widget,$editableContainer=widget.$container,container=widget.element.getBody();$editableContainer.attr("data-html-editable-container",!0),htmlEditor.hasEditor($editableContainer)||htmlEditor.buildEditor($editableContainer,{change:content.getChangeCallback(container),data:{widget:widget,container:container}})},RubricBlockStateActive.prototype.destroyEditor=function(){htmlEditor.destroyEditor(this.widget.$container)},RubricBlockStateActive.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,interaction=_widget.element;$form.html(formTpl({view:interaction.attr("view"),use:interaction.attr("use")})),formElement.initWidget($form),formElement.setChangeCallbacks($form,interaction,{view:formElement.getAttributeChangeCallback(),use:formElement.getAttributeChangeCallback()})},RubricBlockStateActive}),define("taoQtiItem/qtiCreator/widgets/static/rubricBlock/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states","taoQtiItem/qtiCreator/widgets/static/rubricBlock/states/Sleep","taoQtiItem/qtiCreator/widgets/static/rubricBlock/states/Active"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/static/rubricBlock/Widget",["jquery","taoQtiItem/qtiCreator/widgets/static/Widget","taoQtiItem/qtiCreator/widgets/static/rubricBlock/states/states","tpl!taoQtiItem/qtiCreator/tpl/toolbars/textBlock"],function($,Widget,states,toolbarTpl){var RubricBlockWidget=Widget.clone();return RubricBlockWidget.buildContainer=function(){this.$container=this.$original.addClass("widget-box widget-rubricBlock")},RubricBlockWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this)},RubricBlockWidget.createToolbar=function(){var $tlb=$(toolbarTpl({serial:this.serial,state:"active"})),_this=this;return this.$container.find(".qti-rubricBlock-body").append($tlb),$tlb.find("[data-role=\"delete\"]").on("click.widget-box",function(e){e.stopPropagation(),_this.changeState("deleting")}),this},RubricBlockWidget}),define("taoQtiItem/qtiCreator/renderers/RubricBlock",["lodash","taoQtiItem/qtiCommonRenderer/renderers/RubricBlock","taoQtiItem/qtiCreator/widgets/static/rubricBlock/Widget"],function(_,Renderer,Widget){'use strict';var CreatorRubricBlock=_.clone(Renderer);return CreatorRubricBlock.render=function(rubricBlock,options){Widget.build(rubricBlock,Renderer.getContainer(rubricBlock),this.getOption("bodyElementOptionForm"),options)},CreatorRubricBlock}),define("taoQtiItem/qtiCreator/widgets/static/table/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Sleep"],function(stateFactory,SleepState){'use strict';var TableStateSleep=stateFactory.extend(SleepState,function(){},function(){});return TableStateSleep}),define("tpl!taoQtiItem/qtiCreator/widgets/static/table/components/tableActions",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<div class=\"table-tlb table-col-tlb\">\n <div class=\"rgt tlb-button\" title=\"Insert Row\" data-role=\"insertRow\">\n <span class=\"icon-row\"></span>\n </div>\n <div class=\"rgt tlb-button\" title=\"Insert Column\" data-role=\"insertCol\">\n <span class=\"icon-column\"></span>\n </div>\n <div class=\"rgt tlb-button\" title=\"",(helper=helpers.deleteTitle)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.deleteTitle,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-role=\"colRowDelete\">\n <span class=\"icon-bin\"></span>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/table/components/tableActions",["lodash","jquery","ui/component","ui/component/alignable","tpl!taoQtiItem/qtiCreator/widgets/static/table/components/tableActions"],function(_,$,componentFactory,makeAlignable,tpl){'use strict';function triggerEvent(eventName){var self=this;return function(event){event.stopPropagation(),self.trigger(eventName)}}function mousedown(){return function(event){event.stopPropagation()}}var defaultConfig={delete:!0,insertRow:!1,insertCol:!1,deleteTitle:"Delete"},tableActionsApi={hideDelete:function(){var $component=this.getElement(),$delete=$component.find("[data-role=\"colRowDelete\"]");$delete.hide()},showDelete:function(){var $component=this.getElement(),$delete=$component.find("[data-role=\"colRowDelete\"]");$delete.show()}};return function(config){var tableActionsComponent;return config=_.defaults(config||{},defaultConfig),tableActionsComponent=componentFactory(tableActionsApi,config).setTemplate(tpl).on("render",function(){var self=this,$component=this.getElement(),$delete=$component.find("[data-role=\"colRowDelete\"]"),$insertRow=$component.find("[data-role=\"insertRow\"]"),$insertCol=$component.find("[data-role=\"insertCol\"]");this.config.delete?$delete.on("mousedown",mousedown()).on("click",triggerEvent.call(self,"delete")).on("mouseenter",triggerEvent.call(self,"deleteMouseEnter")).on("mouseleave",triggerEvent.call(self,"deleteMouseLeave")):$delete.hide(),this.config.insertRow?$insertRow.on("mousedown",mousedown()).on("click",triggerEvent.call(self,"insertRow")).on("mouseenter",triggerEvent.call(self,"insertRowMouseEnter")).on("mouseleave",triggerEvent.call(self,"insertRowMouseLeave")):$insertRow.hide(),this.config.insertCol?$insertCol.on("mousedown",mousedown()).on("click",triggerEvent.call(self,"insertCol")).on("mouseenter",triggerEvent.call(self,"insertColMouseEnter")).on("mouseleave",triggerEvent.call(self,"insertColMouseLeave")):$insertCol.hide()}),makeAlignable(tableActionsComponent),tableActionsComponent.init()}}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/table",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n <option value=\"",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,depth0&&depth0.selected,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.name)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.name,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</option>\n ",buffer}function program2(){return" selected=\"selected\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<div class=\"panel\">\n <label for=\"hAlign\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Alignment",options):helperMissing.call(depth0,"__","Alignment",options)))+"</label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <div class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Choose the horizontal alignment for the table.",options):helperMissing.call(depth0,"__","Choose the horizontal alignment for the table.",options)))+"\n </div>\n <select name=\"hAlign\" class=\"select2\" data-has-search=\"false\">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.hAlignOptions,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </select>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/table/states/Active",["lodash","jquery","i18n","ckeditor","ui/tableModel","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Active","taoQtiItem/qtiCreator/widgets/static/table/components/tableActions","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiCreator/widgets/helpers/formElement","tpl!taoQtiItem/qtiCreator/tpl/forms/static/table"],function(_,$,__,ckEditor,tableModelFactory,stateFactory,Active,tableActionsFactory,htmlEditor,contentHelper,formElement,formTpl){'use strict';function getChangeCallback(container){return _.throttle(function(data){var $tableTagContent=$(data).children(),$pseudoContainer=$("<div>").html($tableTagContent),newBody=contentHelper.getContent($pseudoContainer);container.body(newBody)},400)}function addClassOnCurrentRow(editor,className){var currentCellPos=getCurrentCellPos(editor),$currentCol;currentCellPos&&($currentCol=tableModel.getRowCells(currentCellPos.y),$currentCol.addClass(className))}function addClassOnCurrentCol(editor,className){var currentCellPos=getCurrentCellPos(editor),$currentCol;currentCellPos&&($currentCol=tableModel.getColCells(currentCellPos.x),$currentCol.addClass(className))}function clearCellClasses($editable,className){$editable.find("th, td").removeClass(className)}function updateTable(editor,$editableContainer){tableModel.update(),1===tableModel.getRowCount()?rowActions.hideDelete():rowActions.showDelete(),1===tableModel.getColCount()?colActions.hideDelete():colActions.showDelete(),displayTableActions(editor,$editableContainer)}function hideTableActions(){colActions&&colActions.hide(),rowActions&&rowActions.hide()}function displayTableActions(editor,$tableContainer){var selectedCells=getSelection(editor),$currentCell;selectedCells&&1!==selectedCells.length?hideTableActions():($currentCell=$(selectedCells[0].$),colActions.show().hAlignWith($currentCell,"center").vAlignWith($tableContainer,"top"),rowActions.show().hAlignWith($tableContainer,"left").vAlignWith($currentCell,"center"))}function getCurrentCellPos(editor){var selectedCells=getSelection(editor),currentCell;if(selectedCells&&1===selectedCells.length)return currentCell=selectedCells[0].$,{x:currentCell.cellIndex,y:currentCell.parentNode.rowIndex}}function getSelection(editor){var selection=editor.getSelection(),tabletools=window.CKEDITOR.plugins.tabletools;if(selection&&tabletools)return tabletools.getSelectedCells(selection)}var css={deleteColRow:"hoverDelete",insertRowAfter:"insertRowAfter",insertColAfter:"insertColAfter",hAlignCenter:"table-center",hAlignRight:"table-right"},TableStateActive=stateFactory.extend(Active,function(){this.initForm(),this.buildEditor()},function(){this.widget.$form.empty(),this.destroyEditor()}),tableModel,colActions,rowActions;return TableStateActive.prototype.initForm=function(){var _widget=this.widget,$form=_widget.$form,table=_widget.element,$container=_widget.$container,hAlignOptions;hAlignOptions=[{name:__("Left"),value:"left"},{name:__("Center"),value:"center",selected:table.hasClass(css.hAlignCenter)},{name:__("Right"),value:"right",selected:table.hasClass(css.hAlignRight)}],$form.html(formTpl({hAlignOptions:hAlignOptions})),formElement.initWidget($form),formElement.setChangeCallbacks($form,table,{hAlign:function hAlign(t,value){switch(hideTableActions(),t.removeClass(css.hAlignRight),t.removeClass(css.hAlignCenter),$container.removeClass(css.hAlignRight+" "+css.hAlignCenter),value){case"center":{t.addClass(css.hAlignCenter),$container.addClass(css.hAlignCenter);break}case"right":{t.addClass(css.hAlignRight),$container.addClass(css.hAlignRight);break}}}})},TableStateActive.prototype.buildEditor=function(){var _widget=this.widget,container=_widget.element.getBody(),$itemPanel=_widget.getAreaBroker().getItemPanelArea(),$editableContainer=_widget.$container,$editable=$editableContainer.find(".qti-table-container"),$tablePropTrigger=$editableContainer.find("[data-role=\"cke-table-properties\"]");$editableContainer.attr("data-html-editable-container",!0),$editable.attr("data-html-editable",!0),htmlEditor.hasEditor($editableContainer)||htmlEditor.buildEditor($editableContainer,{placeholder:"",change:getChangeCallback(container),removePlugins:"magicline",data:{container:container,widget:_widget},blur:function blur(){_widget.changeState("sleep")}}),$editable.on("editorready.tableActive",function(event,editor){tableModel=tableModelFactory($editable.find("table")),$tablePropTrigger.on("click.tableActive",function(e){e.stopPropagation(),hideTableActions(),editor.execCommand("taoqtitableProperties")}),colActions=tableActionsFactory({insertCol:!0,deleteTitle:"Delete column"}).on("delete",function(){editor.execCommand("columnDelete"),updateTable(editor,$editableContainer),hideTableActions()}).on("deleteMouseEnter",function(){addClassOnCurrentCol(editor,css.deleteColRow)}).on("deleteMouseLeave",function(){clearCellClasses($editable,css.deleteColRow)}).on("insertCol",function(){editor.execCommand("columnInsertAfter"),clearCellClasses($editable,css.insertColAfter),this.trigger("insertColMouseEnter"),updateTable(editor,$editableContainer)}).on("insertColMouseEnter",function(){addClassOnCurrentCol(editor,css.insertColAfter)}).on("insertColMouseLeave",function(){clearCellClasses($editable,css.insertColAfter)}).render($itemPanel).hide(),rowActions=tableActionsFactory({insertRow:!0,deleteTitle:"Delete row"}).on("delete",function(){editor.execCommand("rowDelete"),updateTable(editor,$editableContainer),hideTableActions()}).on("deleteMouseEnter",function(){addClassOnCurrentRow(editor,css.deleteColRow)}).on("deleteMouseLeave",function(){clearCellClasses($editable,css.deleteColRow)}).on("insertRow",function(){editor.execCommand("rowInsertAfter"),clearCellClasses($editable,css.insertRowAfter),this.trigger("insertRowMouseEnter"),updateTable(editor,$editableContainer)}).on("insertRowMouseEnter",function(){addClassOnCurrentRow(editor,css.insertRowAfter)}).on("insertRowMouseLeave",function(){clearCellClasses($editable,css.insertRowAfter)}).render($itemPanel).hide(),$editableContainer.on("keyup.tableActive mouseup.tableActive",function(){displayTableActions(editor,$editableContainer)})}).on("editordestroyed.tableActive",function(){$tablePropTrigger.length&&$tablePropTrigger.off(".tableActive")})},TableStateActive.prototype.destroyEditor=function(){var _widget=this.widget,$editableContainer=_widget.$container,$editable=$editableContainer.find("[data-html-editable=\"true\"]");clearCellClasses($editable,css.insertColAfter),clearCellClasses($editable,css.insertRowAfter),clearCellClasses($editable,css.deleteColRow),htmlEditor.destroyEditor($editableContainer),$editableContainer.off(".tableActive"),$editable.off(".tableActive"),$editable.attr("data-html-editable",!1),$editableContainer.attr("data-html-editable-container",!1),tableModel=null,colActions&&(colActions.destroy(),colActions=null),rowActions&&(rowActions.destroy(),rowActions=null)},TableStateActive}),define("taoQtiItem/qtiCreator/widgets/static/table/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states","taoQtiItem/qtiCreator/widgets/static/table/states/Sleep","taoQtiItem/qtiCreator/widgets/static/table/states/Active"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("tpl!taoQtiItem/qtiCreator/tpl/toolbars/table",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<div class=\"mini-tlb\" data-edit=\"",(helper=helpers.state)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.state,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-for=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <div class=\"rgt tlb-button\" title=\"Delete\" data-role=\"delete\">\n <span class=\"icon-bin\"></span>\n </div>\n <div class=\"rgt tlb-button\" data-role=\"cke-table-properties\" title=\"Table properties\">\n <span class=\"icon-table\"></span>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/table/Widget",["jquery","taoQtiItem/qtiCreator/widgets/static/Widget","taoQtiItem/qtiCreator/widgets/static/table/states/states","taoQtiItem/qtiCreator/widgets/static/helpers/widget","tpl!taoQtiItem/qtiCreator/tpl/toolbars/table"],function($,Widget,states,helper,toolbarTpl){'use strict';var TableWidget=Widget.clone();return TableWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this)},TableWidget.buildContainer=function(){var table=this.element;return helper.buildBlockContainer(this),table.attr("class")&&this.$container.addClass(table.attr("class")),this},TableWidget.createToolbar=function(){var self=this,$tlb=$(toolbarTpl({serial:this.serial,state:"active"}));return this.$container.append($tlb),$tlb.find("[data-role=\"delete\"]").on("click.widget-box",function(e){e.stopPropagation(),self.changeState("deleting")}),this},TableWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/table",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+=" summary=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.summary),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div\n class=\"qti-table-container\"\n data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n data-qti-class=\"table\"\n >\n <table class=\"qti-table\" data-html-editable=\"true\"",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.summary),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </table>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/renderers/Table",["lodash","taoQtiItem/qtiCommonRenderer/renderers/Table","taoQtiItem/qtiCreator/widgets/static/table/Widget","tpl!taoQtiItem/qtiCreator/tpl/table"],function(_,Renderer,Widget,tpl){'use strict';var CreatorTable=_.clone(Renderer);return CreatorTable.template=tpl,CreatorTable.render=function(table,options){Widget.build(table,Renderer.getContainer(table),this.getOption("bodyElementOptionForm"),options||{})},CreatorTable}),define("taoQtiItem/qtiCreator/widgets/static/tooltip/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Sleep"],function(stateFactory,SleepState){'use strict';return stateFactory.extend(SleepState)}),define("tpl!taoQtiItem/qtiCreator/widgets/helpers/widgetPopup/popupControl",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<button title=\"",(helper=helpers.description)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.description,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" class=\"btn-info small widget-popup-control\" data-control=\"",(helper=helpers.id)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.id,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</button>",buffer})}),define("taoQtiItem/qtiCreator/widgets/helpers/widgetPopup/widgetPopup",["lodash","i18n","jquery","ui/component","ui/component/alignable","ui/component/containable","ui/component/windowed","tpl!taoQtiItem/qtiCreator/widgets/helpers/widgetPopup/popupControl"],function(_,__,$,componentFactory,makeAlignable,makeContainable,makeWindowed,popupControlTpl){'use strict';var eventNs=".wigetpopup",defaultConfig={alignable:!1,containable:!1,autoContain:!0,popupControls:{done:!1}},popupControlsPresets={done:{id:"done",event:"done",text:__("done"),description:__("Done")}},widgetPopupApi={renderPopupControls:function(){var self=this,controlsEvents={},$controlsArea=this.$popupControls,control;_.each(this.config.popupControls,function(isActive,controlId){control=popupControlsPresets[controlId],isActive&&control&&($controlsArea.append($(popupControlTpl(control))),controlsEvents[controlId]=control.event)}),$controlsArea.off("click"+eventNs).on("click"+eventNs,function(e){var controlId=$(e.target).data("control");e.stopPropagation(),_.isString(controlsEvents[controlId])&&self.trigger(controlsEvents[controlId])})},autoContain:function(){var $container;if(!this.config.areaBroker)throw new Error("an areaBroker must be given to enable autoContain");$container=this.config.areaBroker.getItemPanelArea(),this.containIn($container,{padding:10,paddingTop:40})}};return function(specs,config){var widgetPopup;return config=_.defaults(config||{},defaultConfig),specs=_.defaults(specs||{},widgetPopupApi),widgetPopup=componentFactory(specs,config),makeWindowed(widgetPopup),config.alignable&&makeAlignable(widgetPopup),config.containable&&makeContainable(widgetPopup),widgetPopup.on("render",function(){var $component=this.getElement();$component.addClass("widget-popup"),this.$popupControls=$("<div>",{class:"widget-popup-controls-area"}),$component.append(this.$popupControls),this.renderPopupControls(),config.containable&&config.autoContain&&this.autoContain()}).on("destroy",function(){var $controlsArea=this.$popupControls;$controlsArea.off(eventNs)}),widgetPopup}}),define("tpl!taoQtiItem/qtiCreator/widgets/static/tooltip/components/editorField",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var stack1,helper;return(helper=helpers.content)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.content,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<div data-html-editable-container=\"true\">\n <div title=\"",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" class=\"",(helper=helpers.className)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.className,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-html-editable=\"true\">",stack1=helpers["if"].call(depth0,depth0&&depth0.content,{hash:{},inverse:self.program(3,function(){return"&nbsp;"},data),fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/tooltip/components/editorField",["lodash","jquery","ckeditor","ui/component","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content","tpl!taoQtiItem/qtiCreator/widgets/static/tooltip/components/editorField"],function(_,$,ckEditor,componentFactory,htmlEditor,contentHelper,tpl){'use strict';var defaultConfig={preventEnter:!1};return function(config){var tooltip,EditorFieldComponent,widget;return config=_.defaults(config||{},defaultConfig),EditorFieldComponent=componentFactory({buildEditor:function(){var self=this,$component=self.getElement(),changeCallback=_.noop;_.isFunction(self.config.change)&&(changeCallback=_.throttle(function(data){self.config.change.call(self,data)},500)),htmlEditor.hasEditor($component)||htmlEditor.buildEditor($component,{placeholder:config.placeholder||"",change:changeCallback,removePlugins:"magicline,taotooltip",data:{container:tooltip,widget:widget},toolbar:[{name:"basicstyles",items:["Bold","Italic","Subscript","Superscript"]}],autofocus:!1,blur:function blur(){widget.changeState("sleep")}}).then(function(){!0===config.focus&&htmlEditor.focus($component)}),config.preventEnter&&$component.on("keypress.editorfield",function(e){13===e.which&&(e.preventDefault(),$(this).blur())})},destroyEditor:function(){var $component=this.getElement();htmlEditor.destroyEditor($component),$component.off(".editorfield")}},config).setTemplate(tpl).on("init",function(){if(!this.config.tooltip)throw new Error("tooltip instance must be given in the config");tooltip=this.config.tooltip,widget=tooltip.data("widget")}).on("render",function(){this.buildEditor()}).on("destroy",function(){this.destroyEditor()}),EditorFieldComponent.init()}}),define("tpl!taoQtiItem/qtiCreator/widgets/static/tooltip/components/tooltipEditor",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{},"<div class=\"qti-tooltip-editor\">\n <div class=\"tooltip-editor-content-container\">\n <div class=\"tooltip-editor-tip\"></div>\n </div>\n <div class=\"tooltip-editor-target-container\"></div>\n</div>"})}),define("taoQtiItem/qtiCreator/widgets/static/tooltip/components/tooltipEditor",["lodash","i18n","jquery","taoQtiItem/qtiCreator/widgets/helpers/widgetPopup/widgetPopup","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiCreator/widgets/static/tooltip/components/editorField","tpl!taoQtiItem/qtiCreator/widgets/static/tooltip/components/tooltipEditor"],function(_,__,$,widgetPopupFactory,contentHelper,editorFieldFactory,tpl){'use strict';var widgetPopupConfig={popupControls:{done:!0},windowTitle:__("Tooltip editor"),alignable:!0,containable:!0,hasCloser:!1,hasBin:!0};return function(config){var tooltip,tooltipEditorComponent;return config=_.defaults(config||{},widgetPopupConfig),tooltipEditorComponent=widgetPopupFactory({},config).on("init",function(){if(!this.config.tooltip)throw new Error("tooltip instance must be given in the config");tooltip=this.config.tooltip,this.config.target=tooltip.body(),this.config.content=tooltip.content()}).on("render",function(){var self=this,$body=self.getBody(),fieldToFocus=tooltip.body()?"content":"target",$targetEditorContainer,$contentEditorContainer,$closeBtn;$body.append($(tpl())),$targetEditorContainer=$body.find(".tooltip-editor-target-container"),$contentEditorContainer=$body.find(".tooltip-editor-content-container"),$closeBtn=$body.find(".widget-ok"),$closeBtn.on("click",function(e){e.stopPropagation(),self.trigger("close")}),self.targetEditor=editorFieldFactory({tooltip:tooltip,title:__("Tooltip Target"),className:"tooltip-editor-target",placeholder:__("Enter tooltip target"),content:tooltip.body(),focus:"target"==fieldToFocus,preventEnter:!0,change:function change(newBody){tooltip.body(newBody)}}).render($targetEditorContainer),self.contentEditor=editorFieldFactory({tooltip:tooltip,title:__("Tooltip Content"),className:"tooltip-editor-content",placeholder:__("Enter tooltip content"),content:tooltip.content(),focus:"content"==fieldToFocus,change:function change(newContent){tooltip.content(newContent)}}).render($contentEditorContainer)}).on("destroy",function(){var self=this,$component=self.getElement(),$closeBtn=$component.find(".widget-ok");$closeBtn.off("click"),this.contentEditor.destroy(),this.targetEditor.destroy()}),tooltipEditorComponent.init()}}),define("tpl!taoQtiItem/qtiCreator/tpl/forms/static/tooltip",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="<div class=\"panel\">\n <em>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"no configuration property needed",options):helperMissing.call(depth0,"__","no configuration property needed",options)))+"</em>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/static/tooltip/states/Active",["lodash","jquery","i18n","ckeditor","taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/Active","taoQtiItem/qtiCreator/editor/ckEditor/htmlEditor","taoQtiItem/qtiCreator/editor/gridEditor/content","taoQtiItem/qtiCreator/widgets/static/helpers/inline","taoQtiItem/qtiCreator/widgets/static/tooltip/components/tooltipEditor","tpl!taoQtiItem/qtiCreator/tpl/forms/static/tooltip"],function(_,$,__,ckEditor,stateFactory,Active,htmlEditor,contentHelper,inlineHelper,tooltipEditorFactory,formTpl){'use strict';var TooltipStateActive=stateFactory.extend(Active,function(){this.initForm(),this.buildEditor()},function(){this.destroyEditor()}),tooltipEditor;return TooltipStateActive.prototype.initForm=function(){this.widget.$form.html(formTpl())},TooltipStateActive.prototype.buildEditor=function(){var self=this,_widget=self.widget,creatorContext=_widget.getCreatorContext(),$itemPanel=_widget.getAreaBroker().getItemPanelArea(),$tooltipContainer=_widget.$container,tooltip=_widget.element;tooltipEditor=tooltipEditorFactory({tooltip:tooltip,areaBroker:_widget.getAreaBroker()}).on("delete",self.destroyTooltip.bind(self)).on("done",function(){_widget.changeState("sleep")}).render($itemPanel).show(),self.alignEditorOn($tooltipContainer),creatorContext.on("resize.tooltipEditor",function(){self.alignEditorOn($tooltipContainer)})},TooltipStateActive.prototype.alignEditorOn=function($tooltipContainer){tooltipEditor&&tooltipEditor.alignWith($tooltipContainer,{hPos:"center",vPos:"bottom",vOrigin:"bottom",hOffset:-5,vOffset:53})},TooltipStateActive.prototype.destroyTooltip=function(){var self=this,_widget=self.widget,tooltip=_widget.element,$tooltipContainer=_widget.$container,parent=tooltip.parent(),newParentBody=parent.body().replace(tooltip.placeholder(),tooltip.body());_widget.destroy(),tooltip.remove(),parent.body(newParentBody),$tooltipContainer.replaceWith(tooltip.body())},TooltipStateActive.prototype.destroyEditor=function(){var _widget=this.widget,creatorContext=_widget.getCreatorContext(),tooltip=_widget.element,$tooltip=_widget.$original;$tooltip.html(tooltip.body()||"&nbsp;"),tooltipEditor&&(tooltipEditor.hide(),tooltipEditor.destroy(),tooltipEditor=null),inlineHelper.togglePlaceholder(_widget),creatorContext.off(".tooltipeditor")},TooltipStateActive}),define("taoQtiItem/qtiCreator/widgets/static/tooltip/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states","taoQtiItem/qtiCreator/widgets/static/tooltip/states/Sleep","taoQtiItem/qtiCreator/widgets/static/tooltip/states/Active"],function(factory,states){'use strict';return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/static/tooltip/Widget",["jquery","taoQtiItem/qtiCreator/widgets/static/Widget","taoQtiItem/qtiCreator/widgets/static/tooltip/states/states","taoQtiItem/qtiCreator/widgets/static/helpers/widget","taoQtiItem/qtiCreator/widgets/static/helpers/inline"],function($,Widget,states,helper,inlineHelper){'use strict';var TooltipWidget=Widget.clone();return TooltipWidget.initCreator=function(){this.registerStates(states),Widget.initCreator.call(this),inlineHelper.togglePlaceholder(this)},TooltipWidget.buildContainer=function(){return helper.buildInlineContainer(this),this},TooltipWidget}),define("tpl!taoQtiItem/qtiCreator/tpl/tooltip",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var stack1,helper;return(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<span data-serial=\"",(helper=helpers.serial)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.serial,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-qti-class=\"_tooltip\" data-role=\"tooltip-target\">",stack1=helpers["if"].call(depth0,depth0&&depth0.body,{hash:{},inverse:self.program(3,function(){return"&nbsp;"},data),fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</span>",buffer})}),define("taoQtiItem/qtiCreator/renderers/Tooltip",["lodash","taoQtiItem/qtiCommonRenderer/renderers/Tooltip","taoQtiItem/qtiCreator/widgets/static/tooltip/Widget","tpl!taoQtiItem/qtiCreator/tpl/tooltip"],function(_,Renderer,Widget,tpl){'use strict';var CreatorTooltip=_.clone(Renderer);return CreatorTooltip.template=tpl,CreatorTooltip.render=function(tooltip,options){Widget.build(tooltip,Renderer.getContainer(tooltip),this.getOption("bodyElementOptionForm"),options||{})},CreatorTooltip}),define("tpl!taoQtiItem/qtiCreator/widgets/helpers/pciMediaManager/propertiesForm",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(){return"checked=\"checked\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,self=this,stack1,helper,options;return buffer+="<div class=\"panel\">\n\n <div>\n <label>\n <input type=\"text\" name=\"uri\" placeholder=\"Please select media file\" value=\"",(helper=helpers.uri)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.uri,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" data-validate=\"$notEmpty;\"/>\n <div><button class='selectMediaFile btn-info small block'>"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Select media file",options):helperMissing.call(depth0,"__","Select media file",options)))+"</button></div>\n </label>\n </div>\n\n <div>\n <label for=\"width\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Width",options):helperMissing.call(depth0,"__","Width",options)))+"</label>\n <input name=\"width\" value=\"",(helper=helpers.width)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.width,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" class=\"large\" data-increment=\"1\" data-min=\"50\" data-max=\"1920\" />\n </div>\n\n <div class=\"height-container\">\n <label for=\"height\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Height",options):helperMissing.call(depth0,"__","Height",options)))+"</label>\n <input name=\"height\" value=\"",(helper=helpers.height)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.height,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" type=\"text\" class=\"large\" data-increment=\"1\" data-min=\"30\" data-max=\"1080\" />\n </div>\n\n</div>\n\n<div class=\"panel\">\n <label>\n <input name=\"autostart\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.autostart,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Autostart",options):helperMissing.call(depth0,"__","Autostart",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The autostart attribute determines if the media object should begin as soon as the candidate starts the attempt (checked) or if the media object should be started under the control of the candidate (unchecked).",options):helperMissing.call(depth0,"__","The autostart attribute determines if the media object should begin as soon as the candidate starts the attempt (checked) or if the media object should be started under the control of the candidate (unchecked).",options)))+"\n </span>\n</div>\n\n<div class=\"panel\">\n <label>\n <input name=\"loop\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.loop,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Loop",options):helperMissing.call(depth0,"__","Loop",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The loop attribute is used to set continuous play mode. In continuous play mode, once the media object has started to play it should play continuously (subject to maxPlays).",options):helperMissing.call(depth0,"__","The loop attribute is used to set continuous play mode. In continuous play mode, once the media object has started to play it should play continuously (subject to maxPlays).",options)))+"\n </span>\n</div>\n\n<div class=\"panel\">\n <label>\n <input name=\"pause\" type=\"checkbox\" ",stack1=helpers["if"].call(depth0,depth0&&depth0.pause,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n <span class=\"icon-checkbox\"></span>\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Pause",options):helperMissing.call(depth0,"__","Pause",options)))+"\n </label>\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content:first\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Enable the test taker to pause and restart the playing.",options):helperMissing.call(depth0,"__","Enable the test taker to pause and restart the playing.",options)))+"\n </span>\n</div>\n\n<div class=\"panel\">\n <div>\n <label for=\"maxPlays\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Max plays count",options):helperMissing.call(depth0,"__","Max plays count",options)))+"</label>\n <input name=\"maxPlays\" value=\"",(helper=helpers.maxPlays)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.maxPlays,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" class=\"large\" data-increment=\"1\" data-min=\"0\" data-max=\"1000\" type=\"text\" />\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The maxPlays attribute indicates that the media object can be played at most maxPlays times - it must not be possible for the candidate to play the media object more than maxPlay times. A value of 0 (the default) indicates that there is no limit.",options):helperMissing.call(depth0,"__","The maxPlays attribute indicates that the media object can be played at most maxPlays times - it must not be possible for the candidate to play the media object more than maxPlay times. A value of 0 (the default) indicates that there is no limit.",options)))+"\n </span>\n </div>\n</div>\n\n<div class=\"panel\">\n <div>\n <label for=\"replayTimeout\" class=\"spinner\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Replay timeout",options):helperMissing.call(depth0,"__","Replay timeout",options)))+"</label>\n <input name=\"replayTimeout\" value=\"",(helper=helpers.replayTimeout)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.replayTimeout,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" class=\"large\" data-increment=\"1\" data-min=\"0\" data-max=\"1000\" type=\"text\" />\n <span class=\"icon-help tooltipstered\" data-tooltip=\"~ .tooltip-content\" data-tooltip-theme=\"info\"></span>\n <span class=\"tooltip-content\">\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"In seconds. Delay during which the replay of the media is allowed. Once reached, the media is disabled and cannot be played anymore.",options):helperMissing.call(depth0,"__","In seconds. Delay during which the replay of the media is allowed. Once reached, the media is disabled and cannot be played anymore.",options)))+"\n </span>\n </div>\n</div>",buffer})}),define("taoQtiItem/qtiCreator/widgets/helpers/pciMediaManager/pciMediaManager",["lodash","i18n","jquery","tpl!taoQtiItem/qtiCreator/widgets/helpers/pciMediaManager/propertiesForm"],function(_,__,$,formTpl){'use strict';return function(widget){function switchToAudio(){isAudio=!0,$heightContainer.hide(),mediaProps.height=30}function switchToVideo(){isAudio&&(isAudio=!1,mediaProps.height=270,$heightContainer.show())}function switchMode(){/audio/.test(mediaProps.type)?switchToAudio():switchToVideo()}function setUpUploader(){var $src=$form.find("input[name=uri]"),$uploadTrigger=$form.find(".selectMediaFile");$uploadTrigger.on("click",function(){$uploadTrigger.resourcemgr({title:__("Please select a media file (video or audio) from the resource manager. You can add files from your computer with the button \"Add file(s)\"."),appendContainer:options.mediaManager.appendContainer,mediaSourcesUrl:options.mediaManager.mediaSourcesUrl,browseUrl:options.mediaManager.browseUrl,uploadUrl:options.mediaManager.uploadUrl,deleteUrl:options.mediaManager.deleteUrl,downloadUrl:options.mediaManager.downloadUrl,fileExistsUrl:options.mediaManager.fileExistsUrl,params:{uri:options.uri,lang:options.lang,filters:"video/mp4,video/avi,video/ogv,video/mpeg,video/ogg,video/quicktime,video/webm,video/x-ms-wmv,video/x-flv,audio/mp3,audio/vnd.wav,audio/ogg,audio/vorbis,audio/webm,audio/mpeg,application/ogg,audio/aac,audio/wav,audio/flac"},pathParam:"path",select:function(e,files){files&&files.length&&(mediaProps.type=files[0].mime,$form.find("input[name=uri]").val(files[0].file).trigger("change"))},open:function(){$src.data("$tooltip")&&$src.blur().data("$tooltip").hide()},close:function(){$src.blur()}})})}var $form=widget.$form,options=widget.options,interaction=widget.element,isAudio=!1,mediaProps=interaction.properties.media||{},configChangeCallback,$heightContainer;return mediaProps=_.defaults(mediaProps,{autostart:!1,loop:!1,maxPlays:2,replayTimeout:5,pause:!1,uri:null,type:null,height:270,width:480}),interaction.properties.media=mediaProps,configChangeCallback=_.debounce(function(boundInteraction,value,name){mediaProps[name]=value,boundInteraction.triggerPci("configChange",[boundInteraction.getProperties()])},500),{init:function(){$heightContainer=$(".height-container",$form),switchMode(),setUpUploader()},getForm:function(){return formTpl({autostart:!!mediaProps.autostart,loop:!!mediaProps.loop,maxPlays:parseInt(mediaProps.maxPlays,10),replayTimeout:parseInt(mediaProps.replayTimeout,10),pause:!!mediaProps.pause,uri:mediaProps.uri,type:mediaProps.type,width:mediaProps.width,height:mediaProps.height})},getChangeCallbacks:function(){return{autostart:configChangeCallback,loop:configChangeCallback,maxPlays:configChangeCallback,replayTimeout:configChangeCallback,pause:configChangeCallback,width:configChangeCallback,height:function(boundInteraction,value,name){isAudio||configChangeCallback(boundInteraction,value,name)},uri:function(boundInteraction,value){mediaProps.uri!==value&&(mediaProps.uri=value,value=$.trim(value).toLowerCase(),/^http(s)?:\/\/(www\.)?youtu/.test(value)?(mediaProps.type="video/youtube",switchToVideo()):/audio/.test(mediaProps.type)?switchToAudio():switchToVideo(),mediaProps&&(!mediaProps.width||0>=parseInt(mediaProps.width,10))&&(mediaProps.width=widget.$original.innerWidth()),boundInteraction.triggerPci("configChange",[boundInteraction.getProperties()]))}}}}}}),define("taoQtiItem/qtiCreator/widgets/interactions/customInteraction/states/Question",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Question","jquery","lib/farbtastic/farbtastic"],function(stateFactory,Question,$){var CustomInteractionStateQuestion=stateFactory.extend(Question);return CustomInteractionStateQuestion.prototype.initColorPickers=function(){var $colorTriggers=this.widget.$form.find(".color-trigger:not([data-color-picker=initialized])");$colorTriggers.each(function(){var $colorTrigger=$(this),$input=$colorTrigger.siblings("input"),color=$input.val();$colorTrigger.css("background-color",color)}),$colorTriggers.on("click.color-picker",function(){var $colorTrigger=$(this),$context=$colorTrigger.closest(".item-editor-color-picker"),$container=$context.find(".color-picker-container").show(),$colorPicker=$container.find(".color-picker"),$colorPickerInput=$container.find(".color-picker-input"),$input=$colorTrigger.siblings("input[type=\"hidden\"]"),color=$input.val(),$itemEditorWidgetBar=$("#item-editor-item-widget-bar");$container.css({right:$itemEditorWidgetBar.width()+2,top:$colorTrigger.offset().top-$container.width()/2-$itemEditorWidgetBar.offset().top}),$colorPicker.farbtastic(".color-picker-input",$context),$colorPickerInput.val(color).trigger("keyup"),$container.find(".closer").off("click").on("click",function(){$container.hide(),$colorPicker.off(".farbtastic")}),$colorPicker.off(".farbtastic").on("colorchange.farbtastic",function(e,color){$colorTrigger.css("background-color",color),$input.val(color).trigger("change")})}),$colorTriggers.attr("data-color-picker","initialized")},CustomInteractionStateQuestion.prototype.destroyColorPickers=function(){var $colorTriggers=this.widget.$form.find(".color-trigger");$colorTriggers.off(".color-picker"),$colorTriggers.removeAttr("data-color-picker")},CustomInteractionStateQuestion}),define("taoQtiItem/qtiCreator/widgets/interactions/customInteraction/states/Sleep",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Sleep","tpl!taoQtiItem/qtiCreator/tpl/notifications/widgetOverlay"],function(stateFactory,SleepState,overlayTpl){return stateFactory.extend(SleepState,function(){this.widget.$container.append(overlayTpl())},function(){this.widget.$container.children(".overlay").remove()})}),define("taoQtiItem/qtiCreator/widgets/interactions/customInteraction/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/states","taoQtiItem/qtiCreator/widgets/interactions/customInteraction/states/Question","taoQtiItem/qtiCreator/widgets/interactions/customInteraction/states/Sleep"],function(factory,states){return factory.createBundle(states,arguments)}),define("taoQtiItem/qtiCreator/widgets/interactions/customInteraction/Widget",["taoQtiItem/qtiCreator/widgets/interactions/Widget","taoQtiItem/portableElementRegistry/ciRegistry","lodash"],function(Widget,ciRegistry,_){var CustomInteractionWidget=Widget.clone();return CustomInteractionWidget.initCreator=function(){Widget.initCreator.call(this)},CustomInteractionWidget.createToolbar=function(options){var creator=ciRegistry.getAuthoringData(this.element.typeIdentifier);return options=_.defaults(options||{},{title:creator.label}),Widget.createToolbar.call(this,options)},CustomInteractionWidget}),define("taoQtiItem/qtiCreator/widgets/interactions/gapMatchInteraction/states/Answer",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Answer","taoQtiItem/qtiCreator/widgets/interactions/helpers/answerState"],function(stateFactory,Answer,answerStateHelper){var GapMatchInteractionStateAnswer=stateFactory.extend(Answer,function(){answerStateHelper.forward(this.widget)},function(){});return GapMatchInteractionStateAnswer}),define("taoQtiItem/qtiCreator/widgets/interactions/selectPointInteraction/states/Answer",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/interactions/states/Answer","taoQtiItem/qtiCreator/widgets/interactions/helpers/answerState"],function(stateFactory,Answer){return stateFactory.extend(Answer,function(){this.widget.changeState("map")},function(){})}),define("taoQtiItem/qtiCreator/widgets/static/portableInfoControl/states/states",["taoQtiItem/qtiCreator/widgets/states/factory","taoQtiItem/qtiCreator/widgets/static/states/states"],function(factory,states){'use strict';return factory.createBundle(states,arguments,["answer","correct","map"])}),define("taoQtiItem/qtiCreator/widgets/static/portableInfoControl/Widget",["taoQtiItem/qtiCreator/widgets/static/Widget"],function(Widget){'use strict';var InfoControlWidget=Widget.clone();return InfoControlWidget.initCreator=function(){Widget.initCreator.call(this)},InfoControlWidget}),define("taoQtiItem/qtiItem/core/choices/TextEntry",["taoQtiItem/qtiItem/core/choices/TextVariableChoice"],function(QtiTextVariableChoice){'use strict';QtiTextVariableChoice=QtiTextVariableChoice&&Object.prototype.hasOwnProperty.call(QtiTextVariableChoice,"default")?QtiTextVariableChoice["default"]:QtiTextVariableChoice;var QtiTextEntry=QtiTextVariableChoice.extend({qtiClass:"textEntry"});return QtiTextEntry}),define("taoQtiItem/qtiItem/core/feedbacks/Feedback",["taoQtiItem/qtiItem/core/IdentifiedElement"],function(IdentifiedElement){'use strict';IdentifiedElement=IdentifiedElement&&Object.prototype.hasOwnProperty.call(IdentifiedElement,"default")?IdentifiedElement["default"]:IdentifiedElement;var Feedback=IdentifiedElement.extend({is:function is(qtiClass){return"feedback"===qtiClass||this._super(qtiClass)}});return Feedback}),define("taoQtiItem/qtiItem/core/feedbacks/FeedbackBlock",["taoQtiItem/qtiItem/core/feedbacks/Feedback"],function(Feedback){'use strict';Feedback=Feedback&&Object.prototype.hasOwnProperty.call(Feedback,"default")?Feedback["default"]:Feedback;var FeedbackBlock=Feedback.extend({});return FeedbackBlock}),define("taoQtiItem/qtiItem/core/feedbacks/FeedbackInline",["taoQtiItem/qtiItem/core/feedbacks/Feedback"],function(Feedback){'use strict';Feedback=Feedback&&Object.prototype.hasOwnProperty.call(Feedback,"default")?Feedback["default"]:Feedback;var FeedbackInline=Feedback.extend({});return FeedbackInline}),define("taoQtiItem/qtiItem/helper/EventMgr",["lodash"],function(_){'use strict';return _=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,function(){var events={};this.get=function(event){return event&&events[event]?_.clone(events[event]):[]},this.on=function(event,callback){var tokens=event.split(".");if(tokens[0]){var name=tokens.shift();events[name]=events[name]||[],events[name].push({ns:tokens,callback:callback})}},this.off=function(event){event&&events[event]&&(events[event]=[])},this.trigger=function(event,data){events[event]&&_.each(events[event],function(e){e.callback.apply({type:event,ns:[]},data)})}}}),define("taoQtiItem/qtiItem/helper/pci",["lodash"],function(_){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;return{getRawValues:function getRawValues(pciVar){if(_.isPlainObject(pciVar)){if(pciVar.base!==void 0)return _.values(pciVar.base);if(pciVar.list)return _.values(pciVar.list)}throw"unsupported type "}}}),define("taoQtiItem/qtiItem/helper/modalFeedback",["jquery","lodash","taoQtiItem/qtiItem/helper/pci","taoQtiItem/qtiItem/helper/container"],function($,_,pci,containerHelper){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,pci=pci&&Object.prototype.hasOwnProperty.call(pci,"default")?pci["default"]:pci,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper;var getFeedbackMessageSignature=function(feedback){return(""+feedback.body()+feedback.attr("title")).toLowerCase().trim().replace(/x-tao-[a-zA-Z0-9\-._\s]*/g,"")},extractDisplayInfo=function(interaction){var $interactionContainer=interaction.getContainer(),responseIdentifier=interaction.attr("responseIdentifier"),messageGroupId,$displayContainer;return interaction.is("inlineInteraction")?($displayContainer=$interactionContainer.closest("[class*=\" col-\"], [class^=\"col-\"]"),messageGroupId=$displayContainer.attr("data-messageGroupId"),!messageGroupId&&(messageGroupId=_.uniqueId("inline_message_group_"),$displayContainer.attr("data-messageGroupId",messageGroupId))):(messageGroupId=responseIdentifier,$displayContainer=$interactionContainer),{responseIdentifier:responseIdentifier,interactionContainer:$interactionContainer,displayContainer:$displayContainer,messageGroupId:messageGroupId,order:-1}},getInteractionsDisplayInfo=function(item){var interactionsDisplayInfo=[],$itemContainer=item.getContainer(),interactionOrder=0;return _.forEach(item.getComposingElements(),function(element){element.is("interaction")&&interactionsDisplayInfo.push(extractDisplayInfo(element))}),$itemContainer.find(".qti-interaction").each(function(){var self=this;_.forEach(interactionsDisplayInfo,function(_interactionInfo){if(_interactionInfo.interactionContainer[0]===self)return _interactionInfo.order=interactionOrder,!1}),interactionOrder++}),interactionsDisplayInfo=_.sortBy(interactionsDisplayInfo,"order"),interactionsDisplayInfo},getFeedbacks=function(item,itemSession){var messages={},$itemContainer=item.getContainer(),$itemBody=$(".qti-itemBody",$itemContainer),interactionsDisplayInfo=getInteractionsDisplayInfo(item),renderingQueue=[];return _.forEach(item.modalFeedbacks,function(feedback){var outcomeIdentifier=feedback.attr("outcomeIdentifier"),order=-1,feedbackIds,message,$container,comparedOutcome,_currentMessageGroupId,interactionInfo;if(itemSession[outcomeIdentifier]){if(feedbackIds=pci.getRawValues(itemSession[outcomeIdentifier]),!_.contains(feedbackIds,feedback.id()))return!0;if(message=getFeedbackMessageSignature(feedback),comparedOutcome=containerHelper.getEncodedData(feedback,"relatedOutcome"),interactionInfo=_.find(interactionsDisplayInfo,{responseIdentifier:comparedOutcome}),comparedOutcome&&interactionInfo?($container=interactionInfo.displayContainer,_currentMessageGroupId=interactionInfo.messageGroupId,order=interactionInfo.order):($container=$itemBody,_currentMessageGroupId="__item__"),messages[_currentMessageGroupId]||(messages[_currentMessageGroupId]=[]),_.contains(messages[_currentMessageGroupId],message))return!0;messages[_currentMessageGroupId].push(message),renderingQueue.push({feedback:feedback,$container:$container,order:order})}}),renderingQueue=_.sortBy(renderingQueue,"order"),renderingQueue};return{getFeedbacks:getFeedbacks}}),define("taoQtiItem/qtiItem/helper/Parser",["jquery"],function($){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$;return function Parser(){var _$xml=null;this.loadXML=function(xml){_$xml=$.parseXML(xml)},this.getDOM=function(){return _$xml}}}),define("taoQtiItem/qtiRunner/modalFeedback/inlineRenderer",["lodash","jquery","context","taoQtiItem/qtiItem/helper/pci","taoQtiItem/qtiItem/helper/container","handlebars","i18n","lib/dompurify/purify","iframeNotifier"],function(_,$$1,context,pci,containerHelper,Handlebars,__,DOMPurify,iframeNotifier){'use strict';function previewOkBtn(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}function deliveryOkBtn(data,options,asString){var html=Template$1(data,options);return asString||!0?html:$(html)}function showFeedbacks(item,loader,renderer,itemSession,onCloseCallback,onShowCallback){var interactionsDisplayInfo=getInteractionsDisplayInfo(item),messages={},renderedFeebacks=[],renderingQueue=[],$itemContainer=item.getContainer(),$itemBody=$itemContainer.children(".qti-itemBody"),firstFeedback;return _.each(item.modalFeedbacks,function(feedback){var outcomeIdentifier=feedback.attr("outcomeIdentifier"),order=-1,feedbackIds,message,$container,comparedOutcome,_currentMessageGroupId,interactionInfo;if(itemSession[outcomeIdentifier]){if(feedbackIds=pci.getRawValues(itemSession[outcomeIdentifier]),-1===_.indexOf(feedbackIds,feedback.id()))return!0;if(message=getFeedbackMessageSignature(feedback),comparedOutcome=containerHelper.getEncodedData(feedback,"relatedOutcome"),interactionInfo=_.find(interactionsDisplayInfo,{responseIdentifier:comparedOutcome}),comparedOutcome&&interactionInfo?($container=interactionInfo.displayContainer,_currentMessageGroupId=interactionInfo.messageGroupId,order=interactionInfo.order):($container=$itemBody,_currentMessageGroupId="__item__"),messages[_currentMessageGroupId]||(messages[_currentMessageGroupId]=[]),0<=_.indexOf(messages[_currentMessageGroupId],message))return!0;messages[_currentMessageGroupId].push(message),renderingQueue.push({feedback:feedback,$container:$container,order:order})}}),renderingQueue.length&&(renderingQueue=_.sortBy(renderingQueue,"order"),clearModalFeedbacks($itemContainer),_.each(renderingQueue,function(renderingToken){renderModalFeedback(renderingToken.feedback,loader,renderer,renderingToken.$container,$itemContainer,function(renderingData){firstFeedback||(firstFeedback=$$1(renderingData.dom)),$$1("img",renderingData.dom).on("load",function(){iframeNotifier.parent("itemcontentchange")}),renderedFeebacks.push(renderingData),renderedFeebacks.length===renderingQueue.length&&(iframeNotifier.parent("itemcontentchange"),firstFeedback&&autoscroll(firstFeedback),_.isFunction(onShowCallback)&&onShowCallback())})}),replaceControl(renderedFeebacks,$itemContainer,onCloseCallback)),renderingQueue.length}function getQtiContainer(){for(var me=window,$container=null,max=10;me&&me.__knownParent__&&max--;)if(me=me.parent,me&&me.$&&($container=me.$("#qti-content"),$container.length))return $container;return null}function autoscroll(element){var $element=$$1(element),$container=getQtiContainer(),currentScrollTop,minScrollTop,maxScrollTop,scrollTop;$element.length&&$container&&(currentScrollTop=$container.scrollTop(),maxScrollTop=$element.offset().top,minScrollTop=maxScrollTop-$container.height()+$element.outerHeight(),scrollTop=Math.max(Math.min(maxScrollTop,currentScrollTop),minScrollTop),scrollTop!==currentScrollTop&&$container.animate({scrollTop:scrollTop}))}function extractDisplayInfo(interaction){var $interactionContainer=interaction.getContainer(),responseIdentifier=interaction.attr("responseIdentifier"),messageGroupId,$displayContainer;return interaction.is("inlineInteraction")?($displayContainer=$interactionContainer.closest("[class*=\" col-\"], [class^=\"col-\"]"),messageGroupId=$displayContainer.attr("data-messageGroupId"),!messageGroupId&&(messageGroupId=_.uniqueId("inline_message_group_"),$displayContainer.attr("data-messageGroupId",messageGroupId))):(messageGroupId=responseIdentifier,$displayContainer=$interactionContainer),{responseIdentifier:responseIdentifier,interactionContainer:$interactionContainer,displayContainer:$displayContainer,messageGroupId:messageGroupId,order:-1}}function getInteractionsDisplayInfo(item){var interactionsDisplayInfo=[],$itemContainer=item.getContainer(),interactionOrder=0;return _.each(item.getComposingElements(),function(element){var responseIdentifier;element.is("interaction")&&(responseIdentifier=element.attr("responseIdentifier"),interactionsDisplayInfo.push(extractDisplayInfo(element)))}),$itemContainer.find(".qti-interaction").each(function(){var interactionContainer=this;_.each(interactionsDisplayInfo,function(_interactionInfo){if(_interactionInfo.interactionContainer[0]===interactionContainer)return _interactionInfo.order=interactionOrder,!1}),interactionOrder++}),interactionsDisplayInfo=_.sortBy(interactionsDisplayInfo,"order"),interactionsDisplayInfo}function clearModalFeedbacks($itemContainer){$itemContainer.find(".qti-modalFeedback").remove()}function renderModalFeedback(feedback,loader,renderer,$container,$itemContainer,renderedCallback){renderer.load(function(){var $modalFeedback=$$1(feedback.render({inline:!0})),done=function(){renderedCallback({identifier:feedback.id(),serial:feedback.getSerial(),dom:$modalFeedback})};$container.append($modalFeedback),Promise.race([Promise.all(_.map(feedback.getComposingElements(),function(elt){return elt.postRender({},"",renderer).pop()})),new Promise(function(resolve,reject){_.delay(reject,timeout,new Error("Post rendering ran out of time."))})]).then(done).catch(function(err){throw done(),new Error("Error in post rendering : "+err)})},loader.getLoadedClasses())}function replaceControl(renderedFeebacks,$itemContainer,callback){var $scope,$controls,$toggleContainer;window.parent&&window.parent.parent&&window.parent.parent.$?$itemContainer.parents(".tao-preview-scope").length?($scope=window.parent.parent.$("#preview-console"),$controls=$scope.find(".preview-console-header .action-bar li:visible"),$toggleContainer=$scope.find(".console-button-action-bar"),initControlToggle(renderedFeebacks,$itemContainer,$controls,$toggleContainer,previewOkBtn,callback)):($scope=window.parent.parent.$("body.qti-test-scope .bottom-action-bar"),$controls=$scope.find("li:visible"),$toggleContainer=$scope.find(".navi-box-list"),initControlToggle(renderedFeebacks,$itemContainer,$controls,$toggleContainer,deliveryOkBtn,callback)):($scope=$itemContainer.find("#modalFeedbacks"),initControlToggle(renderedFeebacks,$itemContainer,$$1(),$scope,previewOkBtn,callback))}function initControlToggle(renderedFeebacks,$itemContainer,$controls,$toggleContainer,toggleButtonTemplate,callback){var $ok=$$1(toggleButtonTemplate()).click(function(){_.each(renderedFeebacks,function(fb){fb.dom.hide()}),uncover([$itemContainer]),$ok.remove(),$controls.show(),callback()});$controls.hide(),$toggleContainer.append($ok),cover([$itemContainer])}function cover(interactionContainers){var $cover=$$1("<div class=\"interaction-cover modal-bg\">");_.each(interactionContainers,function($interaction){$interaction.append($cover)})}function uncover(interactionContainers){_.each(interactionContainers,function($interaction){$interaction.find(".interaction-cover").remove()})}function getFeedbackMessageSignature(feedback){return(""+feedback.body()+feedback.attr("title")).toLowerCase().trim().replace(/x-tao-[a-zA-Z0-9\-._\s]*/g,"")}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,context=context&&Object.prototype.hasOwnProperty.call(context,"default")?context["default"]:context,pci=pci&&Object.prototype.hasOwnProperty.call(pci,"default")?pci["default"]:pci,containerHelper=containerHelper&&Object.prototype.hasOwnProperty.call(containerHelper,"default")?containerHelper["default"]:containerHelper,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,DOMPurify=DOMPurify&&Object.prototype.hasOwnProperty.call(DOMPurify,"default")?DOMPurify["default"]:DOMPurify,iframeNotifier=iframeNotifier&&Object.prototype.hasOwnProperty.call(iframeNotifier,"default")?iframeNotifier["default"]:iframeNotifier;var Helpers0=function(hb){hb.registerHelper("__",function(key){return __(key)}),hb.registerHelper("dompurify",function(context){return DOMPurify.sanitize(context)}),hb.registerHelper("join",function(arr,keyValueGlue,fragmentGlue,wrapper){var fragments=[];return keyValueGlue="string"==typeof keyValueGlue?keyValueGlue:void 0,fragmentGlue="string"==typeof fragmentGlue?fragmentGlue:" ",wrapper="string"==typeof wrapper?wrapper:"\"",_.forIn(arr,function(value,key){var fragment="";null!==value||void 0!==value?"boolean"==typeof value?value=value?"true":"false":"object"===_typeof(value)&&(value=_.values(value).join(" ")):value="",void 0!==keyValueGlue&&(fragment+=key+keyValueGlue),fragment+=wrapper+value+wrapper,fragments.push(fragment)}),fragments.join(fragmentGlue)}),hb.registerHelper("for",function(startIndex,stopIndex,increment,options){var ret="";startIndex=parseInt(startIndex),stopIndex=parseInt(stopIndex),increment=parseInt(increment);for(var i=startIndex;i<stopIndex;i+=increment)ret+=options.fn(_.extend({},this,{i:i}));return ret}),hb.registerHelper("equal",function(var1,var2,options){return var1==var2?options.fn(this):options.inverse(this)}),hb.registerHelper("property",function(name,context){return context[name]||""}),hb.registerHelper("includes",function(haystack,needle,options){if(_.contains(haystack,needle))return options.fn(this)})};Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="<li class=\"small btn-info action action-button rgt\" id=\"preview-feedback-ok-button\">\n <a class=\"li-inner\" href=\"#\">\n <span class=\"label\">"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"OK",options):helperMissing.call(depth0,"__","OK",options)))+"</span>\n </a>\n</li>",buffer});Helpers0.__initialized||(Helpers0(Handlebars),Helpers0.__initialized=!0);var Template$1=Handlebars.template(function(Handlebars,depth0,helpers){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),"<li data-control=\"feedback-ok\" class=\"small btn-info action forward\" title=\"Feedback ok and ready to proceed.\">\n <a class=\"li-inner\" href=\"#\">\n <span class=\"icon-result-ok\"></span>\n <span class=\"text\">OK</span>\n </a>\n</li>"}),timeout=1e3*(0<context.timeout?context.timeout+1:30);return{showFeedbacks:showFeedbacks}}),define("taoQtiItem/qtiRunner/modalFeedback/modalRenderer",["lodash","jquery","async","taoQtiItem/qtiItem/helper/pci"],function(_,$,async,pci){'use strict';function showFeedbacks(item,loader,renderer,itemSession,onCloseCallback,onShowCallback){var messages=[],feedbacksToBeDisplayed=[],count;if(_.each(item.modalFeedbacks,function(feedback){var outcomeIdentifier=feedback.attr("outcomeIdentifier"),feedbackIds,message;itemSession[outcomeIdentifier]&&(feedbackIds=pci.getRawValues(itemSession[outcomeIdentifier]),message=getFeedbackMessageSignature(feedback),0<=_.indexOf(feedbackIds,feedback.id())&&-1===_.indexOf(messages,message)&&(feedbacksToBeDisplayed.push(feedback),messages.push(message)))}),count=feedbacksToBeDisplayed.length,count){var callstack=[];_.eachRight(feedbacksToBeDisplayed,function(feedback){var endCallback;0===callstack.length&&(endCallback=function(){onCloseCallback()}),callstack.push(function(cb){renderModalFeedback(feedback,loader,renderer,function(){cb(null)},endCallback)})}),async.series(callstack,function(){_.isFunction(onShowCallback)&&onShowCallback()})}return count}function renderModalFeedback(feedback,loader,renderer,renderedCallback,closeCallback){var $feedbackBox=$("#modalFeedbacks"),$feedback;feedback.is("modalFeedback")&&renderer.load(function(){$feedback=$feedbackBox.find("#"+feedback.getSerial()),$feedback.length?$feedback.modal():($feedback=feedback.render(),$feedbackBox.append($feedback)),renderedCallback(),feedback.postRender({callback:closeCallback})},loader.getLoadedClasses())}function getFeedbackMessageSignature(feedback){return(""+feedback.body()+feedback.attr("title")).toLowerCase().trim().replace(/x-tao-[a-zA-Z0-9\-._\s]*/g,"")}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,async=async&&Object.prototype.hasOwnProperty.call(async,"default")?async["default"]:async,pci=pci&&Object.prototype.hasOwnProperty.call(pci,"default")?pci["default"]:pci;return{showFeedbacks:showFeedbacks}}),define("taoQtiItem/qtiRunner/core/QtiRunner",["jquery","lodash","context","module","iframeNotifier","taoQtiItem/qtiItem/core/Loader","taoQtiItem/qtiRunner/modalFeedback/inlineRenderer","taoQtiItem/qtiRunner/modalFeedback/modalRenderer"],function($,_,context,module,iframeNotifier,ItemLoader,modalFeedbackInline,modalFeedbackModal){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,context=context&&Object.prototype.hasOwnProperty.call(context,"default")?context["default"]:context,module=module&&Object.prototype.hasOwnProperty.call(module,"default")?module["default"]:module,iframeNotifier=iframeNotifier&&Object.prototype.hasOwnProperty.call(iframeNotifier,"default")?iframeNotifier["default"]:iframeNotifier,ItemLoader=ItemLoader&&Object.prototype.hasOwnProperty.call(ItemLoader,"default")?ItemLoader["default"]:ItemLoader,modalFeedbackInline=modalFeedbackInline&&Object.prototype.hasOwnProperty.call(modalFeedbackInline,"default")?modalFeedbackInline["default"]:modalFeedbackInline,modalFeedbackModal=modalFeedbackModal&&Object.prototype.hasOwnProperty.call(modalFeedbackModal,"default")?modalFeedbackModal["default"]:modalFeedbackModal;var timeout=1e3*(0<context.timeout?context.timeout+1:30),QtiRunner=function(){this.item=null,this.rpEngine=null,this.renderer=null,this.loader=null,this.itemApi=void 0};return QtiRunner.prototype.updateItemApi=function(){var responses=this.getResponses(),states=this.getStates(),variables=[];for(var key in states){var value=states[key];if(value.response&&"undefined"!=typeof value.response.base)for(var property in value.response.base)if("file"==property){var file=value.response.base.file;value.response={base:{file:{name:file.name,mime:"qti+application/octet-stream",data:"cXRpX2ZpbGVfZGF0YXR5cGVfcGxhY2Vob2xkZXJfZGF0YQ=="}}}}variables[key]=value}this.itemApi.setVariables(variables),this.itemApi.saveResponses(responses),this.itemApi.resultApi.setQtiRunner(this)},QtiRunner.prototype.setItemApi=function(itemApi){this.itemApi=itemApi;var that=this,oldStateVariables=JSON.stringify(itemApi.stateVariables);itemApi.onKill(function(killCallback){that.updateItemApi();var newStateVariables=JSON.stringify(itemApi.stateVariables);oldStateVariables!==newStateVariables||itemApi.serviceApi.getHasBeenPaused()?itemApi.submit(function(){itemApi.serviceApi.setHasBeenPaused(!1),killCallback(0)}):killCallback(0)})},QtiRunner.prototype.setRenderer=function(renderer){if(renderer.isRenderer)this.renderer=renderer;else throw"invalid renderer"},QtiRunner.prototype.getLoader=function(){return this.loader||(this.loader=new ItemLoader),this.loader},QtiRunner.prototype.loadItemData=function(data,callback){var self=this;this.getLoader().loadItemData(data,function(item){self.item=item,callback(self.item)})},QtiRunner.prototype.loadElements=function(elements,callback){if(this.getLoader().item)this.getLoader().loadElements(elements,callback);else throw"QtiRunner : cannot load elements in empty item"},QtiRunner.prototype.renderItem=function(data,done){var self=this;done=_.isFunction(done)?done:_.noop;var render=function(){if(!self.item)throw"cannot render item: empty item";if(self.renderer)self.renderer.load(function(){self.item.setRenderer(self.renderer),self.item.render({},$("#qti_item")),Promise.race([Promise.all(self.item.postRender()),new Promise(function(resolve,reject){_.delay(reject,timeout,new Error("Post rendering ran out of time."))})]).then(function(){self.item.getContainer().on("responseChange",function(e,data){data.interaction&&data.interaction.attr("responseIdentifier")&&data.response&&iframeNotifier.parent("responsechange",[data.interaction.attr("responseIdentifier"),data.response])}),self.initInteractionsResponse(),self.listenForThemeChange(),done()}).catch(function(err){throw done(),new Error("Error in post rendering : "+err)})},self.getLoader().getLoadedClasses());else throw"cannot render item: no rendered set"};"object"===_typeof(data)?this.loadItemData(data,render):render()},QtiRunner.prototype.initInteractionsResponse=function(){var self=this;if(self.item){var interactions=self.item.getInteractions();for(var i in interactions){var interaction=interactions[i],responseId=interaction.attr("responseIdentifier");self.itemApi.getVariable(responseId,function(values){if(values)interaction.setState(values),iframeNotifier.parent("stateready",[responseId,values]);else{var states=self.getStates();_.indexOf(states,responseId)&&(self.itemApi.setVariable(responseId,states[responseId]),interaction.setState(states[responseId]),iframeNotifier.parent("stateready",[responseId,states[responseId]]))}})}}},QtiRunner.prototype.listenForThemeChange=function(){var self=this,$container=this.renderer.getContainer(this.item);$container.length||($container=$(".qti-item")),$container.off("themechange").on("themechange",function(e,themeName){var themeLoader=self.renderer.getThemeLoader();themeName=themeName||e.originalEvent.detail,themeLoader&&themeLoader.change(themeName)})},QtiRunner.prototype.validate=function(){this.updateItemApi(),this.itemApi.finish()},QtiRunner.prototype.getResponses=function(){var responses={},interactions=this.item.getInteractions();return _.forEach(interactions,function(interaction){var response={};try{response=interaction.getResponse()}catch(e){console.error(e)}responses[interaction.attr("responseIdentifier")]=response}),responses},QtiRunner.prototype.getStates=function(){var states={},interactions=this.item.getInteractions();return _.forEach(interactions,function(interaction){var state={};try{state=interaction.getState()}catch(e){console.error(e)}states[interaction.attr("responseIdentifier")]=state}),states},QtiRunner.prototype.setResponseProcessing=function(callback){this.rpEngine=callback},QtiRunner.prototype.showFeedbacks=function(itemSession,callback,onShowCallback){var inlineDisplay=!!module.config().inlineModalFeedback;return inlineDisplay?modalFeedbackInline.showFeedbacks(this.item,this.getLoader(),this.renderer,itemSession,callback,onShowCallback):modalFeedbackModal.showFeedbacks(this.item,this.getLoader(),this.renderer,itemSession,callback,onShowCallback)},QtiRunner}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/portableCustomInteraction/properties",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+=" key=\"",(helper=helpers.key)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.key,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}function program3(depth0,data,depth1){var buffer="",stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.key,{hash:{},inverse:self.program(6,program6,data),fn:self.programWithDepth(4,program4,data,depth1),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program4(depth0,data,depth2){var buffer="",stack1,helper;return buffer+="<"+escapeExpression((stack1=depth2&&depth2.ns,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"entry key=\"",(helper=helpers.key)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.key,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</"+escapeExpression((stack1=depth2&&depth2.ns,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"entry>\n ",buffer}function program6(depth0,data){var buffer="",stack1,helper;return buffer+="\n ",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<",(helper=helpers.ns)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.ns,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"properties",stack1=helpers["if"].call(depth0,depth0&&depth0.key,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.entries,{hash:{},inverse:self.noop,fn:self.programWithDepth(3,program3,data,depth0),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</",(helper=helpers.ns)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.ns,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"properties>",buffer})}),define("taoQtiItem/qtiXmlRenderer/helper/portableElementTpl",["lodash","handlebars","tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/portableCustomInteraction/properties"],function(_,Handlebars,propertiesTpl){'use strict';function renderPortableElementProperties(properties,ns,name){var entries=[];return _.forIn(properties,function(value,key){_.isObject(value)?entries.push({value:renderPortableElementProperties(value,ns,key)}):entries.push({key:key,value:value})}),propertiesTpl({entries:entries,ns:ns,key:name})}function renderImsPortableElementProperties(properties,ns,name){var entries=[];return _.forIn(properties,function(value,key){entries.push({key:key,value:_.isObject(value)||_.isArray(value)?JSON.stringify(value):value})}),propertiesTpl({entries:entries,ns:ns,key:name})}Handlebars.registerHelper("portableElementProperties",function(properties,ns){return renderPortableElementProperties(properties,ns,"")}),Handlebars.registerHelper("imsPortableElementProperties",function(properties,ns){return renderImsPortableElementProperties(properties,ns,"")})}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/match_correct",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<responseCondition>\n <responseIf>\n <match>\n <variable identifier=\"",(helper=helpers.responseIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.responseIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n <correct identifier=\"",(helper=helpers.responseIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.responseIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n </match>\n <setOutcomeValue identifier=\"",(helper=helpers.outcomeIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.outcomeIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <sum>\n <variable identifier=\"",(helper=helpers.outcomeIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.outcomeIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n <baseValue baseType=\"integer\">1</baseValue>\n </sum>\n </setOutcomeValue>\n </responseIf>\n</responseCondition>",buffer})}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/map_response",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<responseCondition>\n <responseIf>\n <not>\n <isNull>\n <variable identifier=\"",(helper=helpers.responseIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.responseIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n </isNull>\n </not>\n <setOutcomeValue identifier=\"",(helper=helpers.outcomeIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.outcomeIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <sum>\n <variable identifier=\"",(helper=helpers.outcomeIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.outcomeIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n <mapResponse identifier=\"",(helper=helpers.responseIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.responseIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n </sum>\n </setOutcomeValue>\n </responseIf>\n</responseCondition>",buffer})}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/map_response_point",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<responseCondition>\n <responseIf>\n <not>\n <isNull>\n <variable identifier=\"",(helper=helpers.responseIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.responseIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n </isNull>\n </not>\n <setOutcomeValue identifier=\"",(helper=helpers.outcomeIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.outcomeIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <sum>\n <variable identifier=\"",(helper=helpers.outcomeIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.outcomeIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n <mapResponsePoint identifier=\"",(helper=helpers.responseIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.responseIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n </sum>\n </setOutcomeValue>\n </responseIf>\n</responseCondition>",buffer})}),define("taoQtiItem/qtiXmlRenderer/helper/responseProcessingTpl",["tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/match_correct","tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/map_response","tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/map_response_point"],function(correctTpl,mapTpl,mapPointTpl){'use strict';var renderRpTpl=function(rpTpl,data){var ret="";switch(rpTpl){case"http://www.imsglobal.org/question/qti_v2p1/rptemplates/match_correct":case"MATCH_CORRECT":ret=correctTpl(data);break;case"http://www.imsglobal.org/question/qti_v2p1/rptemplates/map_response":case"MAP_RESPONSE":ret=mapTpl(data);break;case"http://www.imsglobal.org/question/qti_v2p1/rptemplates/map_response_point":case"MAP_RESPONSE_POINT":ret=mapPointTpl(data);break;case"no_response_processing":case"NONE":ret="";break;default:throw new Error("unknown rp template : "+rpTpl);}return ret};return{renderInteractionRp:function renderInteractionRp(response,outcomeIdentifier){var ret;return response.template&&(ret=renderRpTpl(response.template,{responseIdentifier:response.id(),outcomeIdentifier:outcomeIdentifier})),ret}}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/element",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="<",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+">",buffer}function program2(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program4(depth0,data){var buffer="",stack1,helper;return buffer+="<",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.body,{hash:{},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),data:data}),stack1||0===stack1?stack1:""})}),define("taoQtiItem/qtiXmlRenderer/renderers/choices/AssociableHotspot",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"associableHotspot",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/choices/Gap",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"gap",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/choices/gapImg",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,self=this,stack1,helper;return buffer+="<gapImg",stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.renderedObject)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.renderedObject,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</gapImg>",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/choices/GapImg",["tpl!taoQtiItem/qtiXmlRenderer/tpl/choices/gapImg"],function(tpl){return{qtiClass:"gapImg",template:tpl,getData:function getData(gapImg,data){return data.renderedObject=gapImg.object.render(this),data}}}),define("taoQtiItem/qtiXmlRenderer/renderers/choices/GapText",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"gapText",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/choices/HotspotChoice",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"hotspotChoice",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/choices/Hottext",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"hottext",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/choices/InlineChoice",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"inlineChoice",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/choices/SimpleAssociableChoice",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"simpleAssociableChoice",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/choices/SimpleChoice",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"simpleChoice",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/container",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper;return(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""})}),define("taoQtiItem/qtiXmlRenderer/renderers/Container",["tpl!taoQtiItem/qtiXmlRenderer/tpl/container"],function(tpl){var xhtmlEntities=function(html){return html.replace(/&nbsp;/g,"&#160;")},xhtmlEncode=function(encodedStr){var returnValue="";return encodedStr&&(returnValue=encodedStr,returnValue=returnValue.replace(/<br([^>]*)?>/ig,"<br />"),returnValue=returnValue.replace(/<hr([^>]*)?>/ig,"<hr />"),returnValue=returnValue.replace(/(<img([^>]*)?\s?[^\/]>)+/ig,function($0){return $0.replace(">"," />")})),returnValue};return{qtiClass:"_container",template:tpl,getData:function getData(container,data){return data.body=xhtmlEntities(data.body),data.body=xhtmlEncode(data.body),data}}}),define("taoQtiItem/qtiXmlRenderer/renderers/feedbacks/ModalFeedback",["lodash","tpl!taoQtiItem/qtiXmlRenderer/tpl/element","taoQtiItem/qtiItem/helper/container"],function(_,tpl,containerHelper){'use strict';function encodeOutcomeInfo(fb){var relatedResponse=fb.data("relatedResponse");relatedResponse&&relatedResponse.attr("identifier")&&containerHelper.setEncodedData(fb,"relatedOutcome",relatedResponse.attr("identifier"))}return{qtiClass:"modalFeedback",template:tpl,getData:function(fb,data){return encodeOutcomeInfo(fb),data.body=fb.getBody().render(this),data.attributes.title=_.escape(data.attributes.title),data}}}),define("taoQtiItem/qtiXmlRenderer/renderers/Img",["lodash","tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(_,tpl){'use strict';return{qtiClass:"img",template:tpl,getData:function getData(item,data){return data.attributes=_.mapValues(data.attributes,function(val){return _.isString(val)?_.escape(val):val}),data}}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/include",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/Include",["tpl!taoQtiItem/qtiXmlRenderer/tpl/include"],function(tpl){return{qtiClass:"include",template:tpl,getData:function getData(xi,data){var ns=xi.getNamespace();return ns&&ns.name&&(data.tag=ns.name+":include"),data}}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program3(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program5(depth0,data){var stack1,helper;return(helper=helpers.object)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.object,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program7(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}function program9(depth0,data){var stack1,helper;return(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.object,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),options={hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data},(helper=helpers.choices)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.choices,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.choices||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.body,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+">",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/AssociateInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"associateInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/ChoiceInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"choiceInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/EndAttemptInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"endAttemptInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/ExtendedTextInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"extendedTextInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/GapMatchInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"gapMatchInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/GraphicAssociateInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"graphicAssociateInteraction",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/graphicGapMatchInteraction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program3(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program5(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<graphicGapMatchInteraction",stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",(helper=helpers.object)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.object,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),options={hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data},(helper=helpers.gapImgs)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.gapImgs,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.gapImgs||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),options={hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data},(helper=helpers.choices)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.choices,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.choices||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</graphicGapMatchInteraction>",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/GraphicGapMatchInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/graphicGapMatchInteraction"],function(tpl){return{qtiClass:"graphicGapMatchInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/GraphicOrderInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"graphicOrderInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/HotspotInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"hotspotInteraction",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/hottextInteraction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program3(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program5(depth0,data){var stack1,helper;return(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.body,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+">",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/HottextInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/hottextInteraction"],function(tpl){return{qtiClass:"hottextInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/InlineChoiceInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"inlineChoiceInteraction",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/matchInteraction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program3(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program5(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <simpleMatchSet>\n ",options={hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data},(helper=helpers.matchSet1)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.matchSet1,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.matchSet1||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </simpleMatchSet>\n <simpleMatchSet>\n ",options={hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data},(helper=helpers.matchSet2)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.matchSet2,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.matchSet2||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </simpleMatchSet>\n</",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+">",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/MatchInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/matchInteraction"],function(tpl){return{qtiClass:"matchInteraction",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/mediaInteraction",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program3(depth0,data){var stack1,helper;return(helper=helpers.prompt)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.prompt,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}function program5(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}function program7(depth0,data){var stack1,helper;return(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",stack1=helpers["if"].call(depth0,depth0&&depth0.prompt,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\r\n ",(helper=helpers.object)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.object,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),options={hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data},(helper=helpers.choices)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.choices,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.choices||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.body,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\r\n</",(helper=helpers.tag)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.tag,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+">",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/MediaInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/mediaInteraction"],function(tpl){return{qtiClass:"mediaInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/OrderInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"orderInteraction",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/portableCustomInteraction/main",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<customInteraction ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",(helper=helpers.portableCustomInteraction)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.portableCustomInteraction,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</customInteraction>",buffer})}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/portableCustomInteraction/oat",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="";return buffer+="\n <lib id=\""+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\"/>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<portableCustomInteraction customInteractionTypeIdentifier=\"",(helper=helpers.typeIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.typeIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" hook=\"",(helper=helpers.entryPoint)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.entryPoint,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" xmlns=\"http://www.imsglobal.org/xsd/portableCustomInteraction\">\n <resources>\n <libraries>\n ",stack1=helpers.each.call(depth0,depth0&&depth0.libraries,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </libraries>\n </resources>\n ",stack1=(helper=helpers.portableElementProperties||depth0&&depth0.portableElementProperties,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.properties,"",options):helperMissing.call(depth0,"portableElementProperties",depth0&&depth0.properties,"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <markup xmlns=\"http://www.w3.org/1999/xhtml\">\n ",(helper=helpers.markup)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.markup,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </markup>\n</portableCustomInteraction>",buffer})}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/portableCustomInteraction/ims",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+=" primaryConfiguration=\"",(helper=helpers.primaryConfiguration)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.primaryConfiguration,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}function program3(depth0,data){var buffer="",stack1,helper;return buffer+=" fallbackConfiguration=\"",(helper=helpers.fallbackConfiguration)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.fallbackConfiguration,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}function program5(depth0,data){var buffer="",stack1,helper;return buffer+="\n <module id=\"",(helper=helpers.id)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.id,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",stack1=helpers["if"].call(depth0,depth0&&depth0.primaryPath,{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.fallbackPath,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="/>\n ",buffer}function program6(depth0,data){var buffer="",stack1,helper;return buffer+=" primaryPath=\"",(helper=helpers.primaryPath)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.primaryPath,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}function program8(depth0,data){var buffer="",stack1,helper;return buffer+=" fallbackPath=\"",(helper=helpers.fallbackPath)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.fallbackPath,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<portableCustomInteraction customInteractionTypeIdentifier=\"",(helper=helpers.typeIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.typeIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" xmlns=\"http://www.imsglobal.org/xsd/portableCustomInteraction_v1\">\n ",stack1=(helper=helpers.imsPortableElementProperties||depth0&&depth0.imsPortableElementProperties,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.properties,"",options):helperMissing.call(depth0,"imsPortableElementProperties",depth0&&depth0.properties,"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <modules",stack1=helpers["if"].call(depth0,depth0&&depth0.primaryConfiguration,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.fallbackConfiguration,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers.each.call(depth0,depth0&&depth0.modules,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </modules>\n <markup xmlns=\"http://www.w3.org/1999/xhtml\">\n ",(helper=helpers.markup)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.markup,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </markup>\n</portableCustomInteraction>",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/PortableCustomInteraction",["lodash","tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/portableCustomInteraction/main","tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/portableCustomInteraction/oat","tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/portableCustomInteraction/ims"],function(_,tpl,oatTpl,imsTpl){'use strict';var templates={"http://www.imsglobal.org/xsd/portableCustomInteraction":oatTpl,"http://www.imsglobal.org/xsd/portableCustomInteraction_v1":imsTpl};return{qtiClass:"customInteraction",template:tpl,getData:function(interaction,data){var ns=interaction.getNamespace();return data.markup=interaction.markup,data.portableCustomInteraction=_.isFunction(templates[ns.uri])?templates[ns.uri].call(null,data):"",data}}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/Prompt",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"prompt",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/SelectPointInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"selectPointInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/SliderInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"sliderInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/TextEntryInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"textEntryInteraction",template:tpl}}),define("taoQtiItem/qtiXmlRenderer/renderers/interactions/UploadInteraction",["tpl!taoQtiItem/qtiXmlRenderer/tpl/interactions/blockInteraction"],function(tpl){return{qtiClass:"uploadInteraction",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/item",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1;return stack1=helpers["if"].call(depth0,null==data||!1===data?data:data.key,{hash:{},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" ",buffer}function program2(depth0,data){var buffer="",stack1;return buffer+="xmlns:"+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"=\""+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\"",buffer}function program4(depth0){var buffer="";return buffer+="xmlns=\""+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\"",buffer}function program6(depth0,data){var stack1,helper,options;return stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),stack1||0===stack1?stack1:""}function program8(depth0){var buffer="",stack1;return buffer+="\n ",stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,(stack1||0===stack1)&&(buffer+=stack1),buffer}function program10(depth0,data){var buffer="",stack1,helper;return buffer+=" class=\"",(helper=helpers["class"])?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0["class"],stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}function program12(depth0,data){var buffer="",stack1,helper;return buffer+=" dir=\"",(helper=helpers.dir)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.dir,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"",buffer}function program16(depth0,data){var buffer="",stack1,helper;return buffer+="\n ",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program18(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,blockHelperMissing=helpers.blockHelperMissing,stack1,helper,options;return buffer+="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<assessmentItem \n ",stack1=helpers.each.call(depth0,depth0&&depth0.namespaces,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",(helper=helpers.xsi)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.xsi,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"schemaLocation=\"",(helper=helpers.schemaLocations)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.schemaLocations,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",options={hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data},(helper=helpers.responses)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.responses,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.responses||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),options={hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data},(helper=helpers.outcomes)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.outcomes,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.outcomes||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),options={hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data},(helper=helpers.stylesheets)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.stylesheets,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.stylesheets||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n <itemBody",stack1=helpers["if"].call(depth0,depth0&&depth0["class"],{hash:{},inverse:self.noop,fn:self.program(10,program10,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.dir,{hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.empty,{hash:{},inverse:self.program(16,program16,data),fn:self.program(14,function(){return"\n <div class=\"empty\"></div>\n "},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </itemBody>\n \n ",(helper=helpers.responseProcessing)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.responseProcessing,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),options={hash:{},inverse:self.noop,fn:self.program(18,program18,data),data:data},(helper=helpers.feedbacks)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.feedbacks,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.feedbacks||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(18,program18,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n ",(helper=helpers.apipAccessibility)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.apipAccessibility,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</assessmentItem>",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/Item",["lodash","tpl!taoQtiItem/qtiXmlRenderer/tpl/item"],function(_,tpl){'use strict';return{qtiClass:"assessmentItem",template:tpl,getData:function getData(item,data){var _this34=this,defaultData={class:data.attributes.class||"",dir:data.attributes.dir||"",responses:[],outcomes:[],stylesheets:[],feedbacks:[],namespaces:item.getNamespaces(),schemaLocations:"",xsi:"xsi:",empty:item.isEmpty(),responseProcessing:item.responseProcessing?item.responseProcessing.render(this):"",apipAccessibility:item.getApipAccessibility()||""};return _.forIn(item.getSchemaLocations(),function(url,uri){defaultData.schemaLocations+="".concat(uri," ").concat(url," ")}),defaultData.schemaLocations=defaultData.schemaLocations.trim(),_.forEach(item.responses,function(response){defaultData.responses.push(response.render(_this34))}),_.forEach(item.outcomes,function(outcome){(defaultData.responseProcessing||"SCORE"!==outcome.id())&&defaultData.outcomes.push(outcome.render(_this34))}),_.forEach(item.stylesheets,function(stylesheet){defaultData.stylesheets.push(stylesheet.render(_this34))}),_.forEach(item.modalFeedbacks,function(feedback){defaultData.feedbacks.push(feedback.render(_this34))}),data=_.merge({},data||{},defaultData),delete data.attributes.class,delete data.attributes.dir,data.attributes=_.mapValues(data.attributes,function(val){return _.isString(val)?_.escape(val):val}),data}}}),define("taoQtiItem/qtiXmlRenderer/renderers/Math",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"math",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/object",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="<object",stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</object>",buffer}function program2(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program4(depth0,data){var buffer="",stack1;return buffer+="<object",stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var helperMissing=helpers.helperMissing,self=this,stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.body,{hash:{},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),data:data}),stack1||0===stack1?stack1:""})}),define("taoQtiItem/qtiXmlRenderer/renderers/Object",["tpl!taoQtiItem/qtiXmlRenderer/tpl/object"],function(tpl){'use strict';return{qtiClass:"object",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/outcomeDeclaration",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program5(depth0,data){var buffer="",stack1;return buffer+=">\n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.defaultValue,null==stack1||!1===stack1?stack1:stack1.length),{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</outcomeDeclaration>",buffer}function program6(depth0,data){var buffer="",stack1;return buffer+="<defaultValue>\n ",stack1=helpers.each.call(depth0,depth0&&depth0.defaultValue,{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</defaultValue>\n ",buffer}function program7(depth0){var buffer="";return buffer+="<value>"+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"</value>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1;return buffer+="<outcomeDeclaration",stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.empty,{hash:{},inverse:self.program(5,program5,data),fn:self.program(3,function(){return"/>\n"},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/OutcomeDeclaration",["lodash","tpl!taoQtiItem/qtiXmlRenderer/tpl/outcomeDeclaration"],function(_,tpl){'use strict';return{qtiClass:"outcomeDeclaration",template:tpl,getData:function getData(outcomeDeclaration,data){var defaultValue=[],defaultData;return _.isUndefined(outcomeDeclaration.defaultValue)||("object"===_typeof(outcomeDeclaration.defaultValue)?defaultValue=_.values(outcomeDeclaration.defaultValue):defaultValue=[outcomeDeclaration.defaultValue]),defaultData={empty:!_.size(defaultValue),defaultValue:defaultValue},_.merge(data||{},defaultData)}}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/portableInfoControl",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="";return buffer+="\n <lib id=\""+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\"/>\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,self=this,stack1,helper,options;return buffer+="<infoControl ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">\n <portableInfoControl infoControlTypeIdentifier=\"",(helper=helpers.typeIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.typeIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" hook=\"",(helper=helpers.entryPoint)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.entryPoint,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" xmlns=\"http://www.imsglobal.org/xsd/portableInfoControl\">\n <resources>\n <libraries>\n ",stack1=helpers.each.call(depth0,depth0&&depth0.libraries,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </libraries>\n </resources>\n ",stack1=(helper=helpers.portableElementProperties||depth0&&depth0.portableElementProperties,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.properties,"",options):helperMissing.call(depth0,"portableElementProperties",depth0&&depth0.properties,"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <markup xmlns=\"http://www.w3.org/1999/xhtml\">\n ",(helper=helpers.markup)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.markup,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </markup>\n </portableInfoControl>\n</infoControl>",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/PortableInfoControl",["tpl!taoQtiItem/qtiXmlRenderer/tpl/portableInfoControl","taoQtiItem/qtiItem/helper/util","taoQtiItem/qtiXmlRenderer/helper/portableElementTpl"],function(tpl,util){'use strict';return{qtiClass:"infoControl",template:tpl,getData:function getData(infoControl,data){return data.markup=infoControl.markup,infoControl.attr("id")||infoControl.attr("id",util.buildId(infoControl.getRootElement(),infoControl.typeIdentifier)),data}}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/printedVariable",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1;return buffer+="\n <printedVariable ",stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=" />\n",buffer}function program2(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var helperMissing=helpers.helperMissing,self=this,stack1;return stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1.identifier),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),stack1||0===stack1?stack1:""})}),define("taoQtiItem/qtiXmlRenderer/renderers/PrintedVariable",["tpl!taoQtiItem/qtiXmlRenderer/tpl/printedVariable"],function(tpl){'use strict';return{qtiClass:"printedVariable",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responseDeclaration",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program3(depth0,data){var buffer="",stack1;return buffer+=">",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.defaultValue,null==stack1||!1===stack1?stack1:stack1.length),{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.correctResponse,null==stack1||!1===stack1?stack1:stack1.length),{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.isAreaMapping,{hash:{},inverse:self.program(18,program18,data),fn:self.program(12,program12,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </responseDeclaration>",buffer}function program4(depth0,data){var buffer="",stack1;return buffer+="\n <defaultValue>",stack1=helpers.each.call(depth0,depth0&&depth0.defaultValue,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </defaultValue>\n ",buffer}function program5(depth0){var buffer="",stack1;return buffer+="\n <value><![CDATA[",stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,(stack1||0===stack1)&&(buffer+=stack1),buffer+="]]></value>\n ",buffer}function program7(depth0,data){var buffer="",stack1;return buffer+="\n <correctResponse>",stack1=helpers.each.call(depth0,depth0&&depth0.correctResponse,{hash:{},inverse:self.noop,fn:self.programWithDepth(8,program8,data,depth0),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </correctResponse>\n ",buffer}function program8(depth0,data,depth1){var buffer="",stack1;return stack1=helpers["if"].call(depth0,depth1&&depth1.isRecord,{hash:{},inverse:self.program(5,program5,data),fn:self.program(9,program9,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program9(depth0,data){var buffer="",stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.value,{hash:{},inverse:self.noop,fn:self.program(10,program10,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program10(depth0,data){var buffer="",stack1,helper;return buffer+="\n <value fieldIdentifier=\"",(helper=helpers.fieldIdentifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.fieldIdentifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" baseType=\"",(helper=helpers.baseType)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.baseType,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"><![CDATA[",(helper=helpers.value)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.value,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="]]></value>\n ",buffer}function program12(depth0,data){var buffer="",stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.hasMapEntries,{hash:{},inverse:self.noop,fn:self.program(13,program13,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program13(depth0,data){var buffer="",stack1;return buffer+="<areaMapping",stack1=helpers.each.call(depth0,depth0&&depth0.mappingAttributes,{hash:{},inverse:self.noop,fn:self.program(14,program14,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",stack1=helpers.each.call(depth0,depth0&&depth0.mapEntries,{hash:{},inverse:self.noop,fn:self.program(16,program16,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </areaMapping>\n ",buffer}function program14(depth0,data){var buffer="",stack1;return buffer+=" "+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"=\""+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\"",buffer}function program16(depth0,data){var buffer="",stack1,helper;return buffer+="\n <areaMapEntry shape=\"",(helper=helpers.shape)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.shape,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" coords=\"",(helper=helpers.coords)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.coords,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" mappedValue=\"",(helper=helpers.mappedValue)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.mappedValue,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />",buffer}function program18(depth0,data){var buffer="",stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.hasMapEntries,{hash:{},inverse:self.noop,fn:self.program(19,program19,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",buffer}function program19(depth0,data){var buffer="",stack1;return buffer+="<mapping",stack1=helpers.each.call(depth0,depth0&&depth0.mappingAttributes,{hash:{},inverse:self.noop,fn:self.program(14,program14,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",stack1=helpers.each.call(depth0,depth0&&depth0.mapEntries,{hash:{},inverse:self.noop,fn:self.program(20,program20,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </mapping>\n ",buffer}function program20(depth0,data){var buffer="",stack1;return buffer+="\n <mapEntry mapKey=\""+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\" mappedValue=\""+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\" caseSensitive=\"false\"/>",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",self=this,escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="<responseDeclaration ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.empty,{hash:{},inverse:self.program(3,program3,data),fn:self.program(1,function(){return"/>"},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/ResponseDeclaration",["lodash","tpl!taoQtiItem/qtiXmlRenderer/tpl/responseDeclaration"],function(_,tpl){return{qtiClass:"responseDeclaration",template:tpl,getData:function getData(responseDeclaration,data){var defaultData={empty:!_.size(responseDeclaration.mapEntries)&&!_.size(responseDeclaration.correctResponse)&&!_.size(responseDeclaration.defaultValue),correctResponse:_.values(responseDeclaration.correctResponse),isAreaMapping:"point"===responseDeclaration.attributes.baseType,mappingAttributes:responseDeclaration.mappingAttributes,hasMapEntries:_.size(responseDeclaration.mapEntries),mapEntries:responseDeclaration.mapEntries,defaultValue:responseDeclaration.defaultValue,isRecord:"record"===responseDeclaration.attributes.cardinality};return _.merge(defaultData,data||{})}}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responseProcessing",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return(helper=helpers.xml)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.xml,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program3(depth0,data){var buffer="",stack1,helper;return buffer+="<responseProcessing template=\"",(helper=helpers.template)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.template,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\"/>",buffer}function program5(depth0,data){var buffer="",stack1,helper,options;return buffer+="<responseProcessing>\n ",options={hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data},(helper=helpers.responseRules)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.responseRules,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.responseRules||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",options={hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data},(helper=helpers.feedbackRules)?stack1=helper.call(depth0,options):(helper=depth0&&depth0.feedbackRules,stack1="function"===_typeof(helper)?helper.call(depth0,options):helper),helpers.feedbackRules||(stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data})),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</responseProcessing>",buffer}function program6(depth0){var stack1;return stack1="function"===_typeof(depth0)?depth0.apply(depth0):depth0,stack1||0===stack1?stack1:""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing,stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.custom,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.template,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),stack1=helpers["if"].call(depth0,depth0&&depth0.templateDriven,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/ResponseProcessing",["lodash","tpl!taoQtiItem/qtiXmlRenderer/tpl/responseProcessing","taoQtiItem/qtiXmlRenderer/helper/responseProcessingTpl"],function(_,tpl,responseProcessingTpl){'use strict';var _renderFeedbackRules=function(renderer,response){var ret=[];return _.forEach(response.getFeedbackRules(),function(rule){ret.push(rule.render(renderer))}),ret};return{qtiClass:"responseProcessing",template:tpl,getData:function getData(responseProcessing,data){var defaultData={},self=this,interactions,response;switch(responseProcessing.processingType){case"custom":defaultData.custom=!0,defaultData.xml=responseProcessing.xml;break;case"templateDriven":if(interactions=responseProcessing.getRootElement().getInteractions(),1===interactions.length&&!data.notAllowTemplate&&(response=interactions[0].getResponseDeclaration(),0===_.size(response.getFeedbackRules())&&"RESPONSE"===response.id())){"no_response_processing"!==response.template&&(defaultData.template=response.template);break}defaultData.responseRules=[],_.forEach(interactions,function(interaction){var response=interaction.getResponseDeclaration(),responseRule=responseProcessingTpl.renderInteractionRp(response,"SCORE");_.isString(responseRule)&&responseRule.trim()&&defaultData.responseRules.push(responseRule)}),defaultData.feedbackRules=[],_.forEach(interactions,function(interaction){defaultData.feedbackRules=_.union(defaultData.feedbackRules,_renderFeedbackRules(self,interaction.getResponseDeclaration()))}),(defaultData.responseRules.length||defaultData.feedbackRules.length)&&(defaultData.templateDriven=!0);}return _.merge(data||{},defaultData)}}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/item_score",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="";return buffer+="\n <variable identifier=\""+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"\" />\n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<setOutcomeValue identifier=\"",(helper=helpers.identifier)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.identifier,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\">\n <sum>\n ",stack1=helpers.each.call(depth0,depth0&&depth0.outcomeIdentifiers,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </sum>\n</setOutcomeValue>",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/ResponseProcessingPerInteractionRP",["lodash","tpl!taoQtiItem/qtiXmlRenderer/tpl/responseProcessing","tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/item_score","taoQtiItem/qtiXmlRenderer/helper/responseProcessingTpl"],function(_,tpl,itemScoreTpl,responseProcessingTpl){'use strict';var renderFeedbackRules=function(renderer,response){var ret=[];return _.forEach(response.getFeedbackRules(),function(rule){ret.push(rule.render(renderer))}),ret};return{qtiClass:"responseProcessing",template:tpl,getData:function getData(responseProcessing,data){var _this35=this,defaultData={};if("custom"===responseProcessing.processingType)defaultData.custom=!0,defaultData.xml=responseProcessing.xml;else{var interactions=responseProcessing.getRootElement().getInteractions();defaultData.responseRules=[];var outcomeIdentifiers=[];_.forEach(interactions,function(interaction){var response=interaction.getResponseDeclaration(),outcomeIdentifier="SCORE_".concat(response.id()),responseRule=responseProcessingTpl.renderInteractionRp(response,outcomeIdentifier);_.isString(responseRule)&&responseRule.trim()&&(defaultData.responseRules.push(responseRule),outcomeIdentifiers.push(outcomeIdentifier))}),defaultData.feedbackRules=[],_.forEach(interactions,function(interaction){defaultData.feedbackRules=_.union(defaultData.feedbackRules,renderFeedbackRules(_this35,interaction.getResponseDeclaration()))}),outcomeIdentifiers.length&&defaultData.responseRules.push(itemScoreTpl({identifier:"SCORE",outcomeIdentifiers:outcomeIdentifiers})),(defaultData.responseRules.length||defaultData.feedbackRules.length)&&(defaultData.templateDriven=!0)}return _.merge(data||{},defaultData)}}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/rule",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper;return(helper=helpers.rule)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.rule,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),stack1||0===stack1?stack1:""})}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/rule_condition",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.mapResponsePoint,{hash:{},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer}function program2(depth0,data){var buffer="",stack1,helper;return buffer+="\n <mapResponsePoint identifier=\"",(helper=helpers.response)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.response,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />",buffer}function program4(depth0,data){var buffer="",stack1,helper;return buffer+="\n <mapResponse identifier=\"",(helper=helpers.response)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.response,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />",buffer}function program6(depth0,data){var buffer="",stack1,helper;return buffer+="\n <variable identifier=\"",(helper=helpers.outcome)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.outcome,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />",buffer}function program8(depth0){var buffer="",stack1;return buffer+="\n <responseElse>\n <setOutcomeValue identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.outcome),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n <baseValue baseType=\"identifier\">"+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1["else"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</baseValue>\n </setOutcomeValue>\n </responseElse>",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<responseCondition>\n <responseIf>\n <",(helper=helpers.condition)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.condition,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+">",stack1=helpers["if"].call(depth0,depth0&&depth0.response,{hash:{},inverse:self.program(6,program6,data),fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n <baseValue baseType=\"float\">",(helper=helpers.comparedValue)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.comparedValue,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</baseValue>\n </",(helper=helpers.condition)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.condition,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+">\n <setOutcomeValue identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.outcome),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n <baseValue baseType=\"identifier\">"+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.then),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</baseValue>\n </setOutcomeValue>\n </responseIf>",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1["else"]),{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</responseCondition>",buffer})}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/rule_correct",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="\n <responseElse>\n <setOutcomeValue identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.outcome),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n <baseValue baseType=\"identifier\">"+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1["else"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</baseValue>\n </setOutcomeValue>\n </responseElse>",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<responseCondition>\n <responseIf>\n <match>\n <variable identifier=\"",(helper=helpers.response)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.response,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n <correct identifier=\"",(helper=helpers.response)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.response,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n </match>\n <setOutcomeValue identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.outcome),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n <baseValue baseType=\"identifier\">"+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.then),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</baseValue>\n </setOutcomeValue>\n </responseIf>",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1["else"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</responseCondition>",buffer})}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/rule_incorrect",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="",stack1;return buffer+="\n <responseElse>\n <setOutcomeValue identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.outcome),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n <baseValue baseType=\"identifier\">"+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1["else"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</baseValue>\n </setOutcomeValue>\n </responseElse>",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="<responseCondition>\n <responseIf>\n <not>\n <match>\n <variable identifier=\"",(helper=helpers.response)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.response,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n <correct identifier=\"",(helper=helpers.response)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.response,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n </match>\n </not>\n <setOutcomeValue identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.outcome),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n <baseValue baseType=\"identifier\">"+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.then),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</baseValue>\n </setOutcomeValue>\n </responseIf>",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1["else"]),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</responseCondition>",buffer})}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/rule_choices",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n<responseCondition>\n <responseIf>\n <match>\n <variable identifier=\"",(helper=helpers.response)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.response,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\" />\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.multiple,{hash:{},inverse:self.program(5,program5,data),fn:self.program(2,program2,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </match>\n <setOutcomeValue identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.outcome),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n <baseValue baseType=\"identifier\">"+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.then),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</baseValue>\n </setOutcomeValue>\n </responseIf>",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1["else"]),{hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n</responseCondition>\n",buffer}function program2(depth0,data){var buffer="",stack1;return buffer+="\n <multiple>\n ",stack1=helpers.each.call(depth0,depth0&&depth0.choices,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n </multiple>\n ",buffer}function program3(depth0){var buffer="";return buffer+="\n <baseValue baseType=\"identifier\">"+escapeExpression("function"===_typeof(depth0)?depth0.apply(depth0):depth0)+"</baseValue>\n ",buffer}function program5(depth0,data){var buffer="",stack1,helper;return buffer+="\n <baseValue baseType=\"identifier\">",(helper=helpers.choice)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.choice,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"</baseValue>\n ",buffer}function program7(depth0){var buffer="",stack1;return buffer+="\n <responseElse>\n <setOutcomeValue identifier=\""+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1.outcome),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">\n <baseValue baseType=\"identifier\">"+escapeExpression((stack1=(stack1=depth0&&depth0.feedback,null==stack1||!1===stack1?stack1:stack1["else"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"</baseValue>\n </setOutcomeValue>\n </responseElse>",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var escapeExpression=this.escapeExpression,self=this,stack1;return stack1=helpers.unless.call(depth0,depth0&&depth0.noData,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),stack1||0===stack1?stack1:""})}),define("taoQtiItem/qtiXmlRenderer/renderers/responses/SimpleFeedbackRule",["lodash","tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/rule","tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/rule_condition","tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/rule_correct","tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/rule_incorrect","tpl!taoQtiItem/qtiXmlRenderer/tpl/responses/rule_choices"],function(_,tpl,tplCondition,tplCorrect,tplIncorrect,tplChoices){return{qtiClass:"_simpleFeedbackRule",template:tpl,getData:function getData(rule,data){var template=null,ruleXml="",tplData={response:rule.comparedOutcome.id(),feedback:{outcome:rule.feedbackOutcome.id(),then:rule.feedbackThen.id(),else:rule.feedbackElse?rule.feedbackElse.id():""}},_values;switch(rule.condition){case"correct":template=tplCorrect;break;case"incorrect":template=tplIncorrect;break;case"lt":case"lte":case"equal":case"gte":case"gt":template=tplCondition,tplData.condition=rule.condition,tplData.comparedValue=rule.comparedValue;break;case"choices":template=tplChoices,tplData.condition=rule.condition,tplData.multiple=rule.comparedOutcome.isCardinality(["multiple","ordered"]),_values=[],_.each(rule.comparedValue,function(choice){choice.parent()&&_values.push(choice.id())}),tplData.multiple?tplData.choices=_values:_values.length?tplData.choice=_.head(_values):tplData.noData=!0;break;default:throw new Error("unknown condition in simple feedback rule rendering : "+rule.condition);}return template&&(ruleXml=template(tplData)),_.merge(data||{},{rule:ruleXml})}}}),define("taoQtiItem/qtiXmlRenderer/renderers/RubricBlock",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element","lodash"],function(tpl,_){return{qtiClass:"rubricBlock",template:tpl,getData:function getData(rubricBlock,data){var newData={view:data.attributes.view?_.values(data.attributes.view).join(" "):""};return _.merge(data||{},newData)}}}),define("taoQtiItem/qtiXmlRenderer/renderers/Stylesheet",["tpl!taoQtiItem/qtiXmlRenderer/tpl/element"],function(tpl){return{qtiClass:"stylesheet",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/table",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper,options;return buffer+=" ",stack1=(helper=helpers.join||depth0&&depth0.join,options={hash:{},data:data},helper?helper.call(depth0,depth0&&depth0.attributes,"="," ","\"",options):helperMissing.call(depth0,"join",depth0&&depth0.attributes,"="," ","\"",options)),(stack1||0===stack1)&&(buffer+=stack1),buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,self=this,stack1,helper;return buffer+="<table",stack1=helpers["if"].call(depth0,depth0&&depth0.attributes,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+=">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</table>",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/Table",["tpl!taoQtiItem/qtiXmlRenderer/tpl/table"],function(tpl){'use strict';return{qtiClass:"table",template:tpl}}),define("tpl!taoQtiItem/qtiXmlRenderer/tpl/tooltip",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="<span data-role=\"tooltip-target\" aria-describedby=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-describedby"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">",(helper=helpers.body)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.body,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</span><span data-role=\"tooltip-content\" aria-hidden=\"true\" id=\""+escapeExpression((stack1=(stack1=depth0&&depth0.attributes,null==stack1||!1===stack1?stack1:stack1["aria-describedby"]),"function"===_typeof(stack1)?stack1.apply(depth0):stack1))+"\">",(helper=helpers.content)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.content,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="</span>",buffer})}),define("taoQtiItem/qtiXmlRenderer/renderers/Tooltip",["tpl!taoQtiItem/qtiXmlRenderer/tpl/tooltip"],function(tpl){'use strict';return{qtiClass:"_tooltip",template:tpl}}),function(c){var d=document,s=d.createElement("style");s.type="text/css",d.getElementsByTagName("head")[0].appendChild(s),s.styleSheet?s.styleSheet.cssText=c:s.appendChild(d.createTextNode(c))}(".qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}@font-face{font-family:'tao';src:url(\"../../../tao/views/css/font/tao/tao.ttf?syc5z9\") format(\"truetype\"),url(\"../../../tao/views/css/font/tao/tao.woff?syc5z9\") format(\"woff\"),url(\"../../../tao/views/css/font/tao/tao.svg?syc5z9#tao\") format(\"svg\");font-weight:normal;font-style:normal;font-display:block}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.tooltip .tooltip-inner{-moz-border-radius:4px 4px 0 0;-webkit-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.tooltip-content{display:none}.tooltip-inner .tooltip-content{display:block}.popper,.tooltip[role=\"tooltip\"]{position:absolute;color:black;min-width:100px;max-width:250px;box-shadow:none;padding:2px 5px;text-align:left;font-size:.8em;z-index:2000;word-break:normal;overflow-wrap:break-word;box-sizing:border-box;border-style:solid;border-width:1px;border-radius:5px}.style5 .tooltip{background:#1E252B;color:#FFFFFF;max-width:200px;width:auto;font-size:.8rem;padding:.5em 1em}.popper .popper__arrow,.tooltip .tooltip-arrow{width:0;height:0;border-style:solid;position:absolute;margin:5px}.tooltip .tooltip-arrow::before,.popper .popper__arrow::before{content:'';display:block;width:0;height:0;border-style:solid;position:absolute}.style5 .tooltip .tooltip-arrow{border-color:red !important}.popper[x-placement^=\"top\"],.tooltip[x-placement^=\"top\"]{margin-bottom:5px}.popper[x-placement^=\"top\"] .popper__arrow,.tooltip[x-placement^=\"top\"] .tooltip-arrow{border-width:5px 5px 0 5px;border-left-color:transparent;border-right-color:transparent;border-bottom-color:transparent;bottom:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0}.popper[x-placement^=\"top\"] .popper__arrow::before,.tooltip[x-placement^=\"top\"] .tooltip-arrow::before{border-width:3px 3px 0 3px;border-left-color:transparent;border-right-color:transparent;border-bottom-color:transparent;top:-5px;left:calc(50% - 3px)}.popper[x-placement^=\"bottom\"],.tooltip[x-placement^=\"bottom\"]{margin-top:5px}.tooltip[x-placement^=\"bottom\"] .tooltip-arrow,.popper[x-placement^=\"bottom\"] .popper__arrow{border-width:0 5px 5px 5px;border-left-color:transparent;border-right-color:transparent;border-top-color:transparent;top:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0}.tooltip[x-placement^=\"bottom\"] .tooltip-arrow::before,.popper[x-placement^=\"bottom\"] .popper__arrow::before{border-width:0 3px 3px 3px;border-left-color:transparent;border-right-color:transparent;border-top-color:transparent;bottom:-5px;left:calc(50% - 3px);margin-top:0;margin-bottom:0}.tooltip[x-placement^=\"right\"],.popper[x-placement^=\"right\"]{margin-left:5px}.popper[x-placement^=\"right\"] .popper__arrow,.tooltip[x-placement^=\"right\"] .tooltip-arrow{border-width:5px 5px 5px 0;border-left-color:transparent;border-top-color:transparent;border-bottom-color:transparent;left:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0}.popper[x-placement^=\"right\"] .popper__arrow::before,.tooltip[x-placement^=\"right\"] .tooltip-arrow::before{border-width:3px 3px 3px 0;border-left-color:transparent;border-top-color:transparent;border-bottom-color:transparent;right:-5px;top:calc(50% - 3px);margin-left:0;margin-right:0}.popper[x-placement^=\"left\"],.tooltip[x-placement^=\"left\"]{margin-right:5px}.popper[x-placement^=\"left\"] .popper__arrow,.tooltip[x-placement^=\"left\"] .tooltip-arrow{border-width:5px 0 5px 5px;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;right:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0}.popper[x-placement^=\"left\"] .popper__arrow::before,.tooltip[x-placement^=\"left\"] .tooltip-arrow::before{border-width:3px 0 3px 3px;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;top:calc(50% - 3px);left:-5px;margin-left:0;margin-right:0}.tooltip-plain{background-color:#a4bbc5;border:solid 1px #51717f}.tooltip-plain .tooltip-arrow{border-color:#51717f}.tooltip-plain .tooltip-arrow::before{border-color:#a4bbc5}.tooltip-dark{background-color:#404040;border:solid 1px #000;color:#fff}.tooltip-dark .tooltip-arrow{border-color:#404040}.tooltip-dark .tooltip-arrow::before{border-color:#404040}.tooltip-dark .tooltip-inner{background-color:#404040}.tooltip-dark .tooltip-icon{border-color:#404040}.tooltip-dark .tooltip-inner .ui-state-hover{border-color:#303030}.tooltip-red{color:#222}.tooltip-red .tooltip-arrow{border-color:#c12a40}.tooltip-red .tooltip-arrow::before{border-color:#f1d0d5}.tooltip-red .tooltip-close .tooltip-icon{background-position:-102px 0}.tooltip-red .tooltip-icon{border-color:#222}.tooltip-red .tooltip-inner .ui-state-hover{border-color:#222}/*! Green tooltip style */.tooltip-green{color:#222}.tooltip-green .tooltip-arrow{border-color:#269c5d}.tooltip-green .tooltip-arrow::before{border-color:#cfe9db}.tooltip-green .tooltip-close .tooltip-icon{background-position:-42px 0}/*! Blue tooltip style */.tooltip-blue{color:#222}.tooltip-blue .tooltip-arrow{border-color:#266d9c}.tooltip-blue .tooltip-arrow::before{border-color:#cfdfe9}.tooltip-blue .tooltip-close .tooltip-icon{background-position:-2px 0}/*! Orange tooltip style */.tooltip-orange{color:#222}.tooltip-orange .tooltip-arrow{border-color:#dcb66b}.tooltip-orange .tooltip-arrow::before{border-color:#f7efde}.tooltip-orange .tooltip-close .tooltip-icon{background-position:-102px 0}.tooltip-orange .tooltip-icon{border-color:#222}.tooltip-orange .tooltip-inner .ui-state-hover{border-color:#222}/*! Danger (mix of read and orange) tooltip style */.tooltip-danger{color:#222}.tooltip-danger .tooltip-arrow{border-color:#ce7056}.tooltip-danger .tooltip-arrow::before{border-color:#f4dfd9}.tooltip-danger .tooltip-icon{background-position:-102px 0}.tooltip-danger .tooltip-icon{border-color:#222}.tooltip-danger .tooltip-inner .ui-state-hover{border-color:#222}[class^=\"feedback-\"],[class*=\" feedback-\"]{border:1px transparent solid;position:relative;padding:20px 20px 20px 45px;margin:5px 0 10px 0;border-radius:3px;color:#222 !important}[class^=\"feedback-\"].small,[class*=\" feedback-\"].small{padding:8px 20px 8px 45px}[class^=\"feedback-\"].small>[class^=\"icon-\"],[class^=\"feedback-\"].small>[class*=\" icon-\"],[class*=\" feedback-\"].small>[class^=\"icon-\"],[class*=\" feedback-\"].small>[class*=\" icon-\"]{top:9px;left:10px}[class^=\"feedback-\"]>[class^=\"icon-\"],[class^=\"feedback-\"]>[class*=\" icon-\"],[class*=\" feedback-\"]>[class^=\"icon-\"],[class*=\" feedback-\"]>[class*=\" icon-\"]{font-size:20px;font-size:2rem;position:absolute;top:20px;left:15px}[class^=\"feedback-\"]>[class^=\"icon-\"].icon-close,[class^=\"feedback-\"]>[class^=\"icon-\"].icon-remove,[class^=\"feedback-\"]>[class*=\" icon-\"].icon-close,[class^=\"feedback-\"]>[class*=\" icon-\"].icon-remove,[class*=\" feedback-\"]>[class^=\"icon-\"].icon-close,[class*=\" feedback-\"]>[class^=\"icon-\"].icon-remove,[class*=\" feedback-\"]>[class*=\" icon-\"].icon-close,[class*=\" feedback-\"]>[class*=\" icon-\"].icon-remove{font-size:15px;font-size:1.5rem;color:#999;left:auto;top:5px;cursor:pointer}[class^=\"feedback-\"]>[class^=\"icon-\"].icon-close:hover,[class^=\"feedback-\"]>[class^=\"icon-\"].icon-remove:hover,[class^=\"feedback-\"]>[class*=\" icon-\"].icon-close:hover,[class^=\"feedback-\"]>[class*=\" icon-\"].icon-remove:hover,[class*=\" feedback-\"]>[class^=\"icon-\"].icon-close:hover,[class*=\" feedback-\"]>[class^=\"icon-\"].icon-remove:hover,[class*=\" feedback-\"]>[class*=\" icon-\"].icon-close:hover,[class*=\" feedback-\"]>[class*=\" icon-\"].icon-remove:hover{color:#222}[class^=\"feedback-\"]>[class^=\"icon-\"].icon-remove,[class^=\"feedback-\"]>[class*=\" icon-\"].icon-remove,[class*=\" feedback-\"]>[class^=\"icon-\"].icon-remove,[class*=\" feedback-\"]>[class*=\" icon-\"].icon-remove{right:24px}[class^=\"feedback-\"]>[class^=\"icon-\"].icon-close,[class^=\"feedback-\"]>[class*=\" icon-\"].icon-close,[class*=\" feedback-\"]>[class^=\"icon-\"].icon-close,[class*=\" feedback-\"]>[class*=\" icon-\"].icon-close{right:7px}[class^=\"feedback-\"].popup,[class*=\" feedback-\"].popup{display:block;position:fixed;top:50px;left:50%;margin-left:-200px;width:400px;z-index:999999}.feedback-success,.tooltip-green,.qti-item .tooltip-green{border-color:#269c5d;background-color:#cfe9db}.feedback-success .icon-success,.tooltip-green .icon-success{color:#0e914b !important}.feedback-info,.tooltip-blue,.qti-item .tooltip-blue{border-color:#266d9c;background-color:#cfdfe9}.feedback-info .icon-info,.tooltip-blue .icon-info,.feedback-info .icon-lock,.tooltip-blue .icon-lock{color:#0e5d91 !important}.feedback-info .button-container,.tooltip-blue .button-container{margin-top:20px}.feedback-warning,.tooltip-orange,.qti-item .tooltip-orange{border-color:#dcb66b;background-color:#f7efde}.feedback-warning .icon-warning,.tooltip-orange .icon-warning{color:#d8ae5b !important}.feedback-danger,.tooltip-danger,.qti-item .tooltip-danger{border-color:#ce7056;background-color:#f4dfd9}.feedback-danger .icon-danger,.tooltip-danger .icon-danger{color:#c96043 !important}.feedback-error,.tooltip-red,.qti-item .tooltip-red{border-color:#c12a40;background-color:#f1d0d5}.feedback-error .icon-error,.tooltip-red .icon-error{color:#ba122b !important}.brd-success{border:1px solid #269c5d !important}.brd-info{border:1px solid #266d9c !important}.brd-warning{border:1px solid #dcb66b !important}.brd-danger{border:1px solid #ce7056 !important}.brd-error{border:1px solid #c12a40 !important}.txt-success{color:#0e914b !important}.txt-info{color:#0e5d91 !important}.txt-warning{color:#d8ae5b !important}.txt-danger{color:#c96043 !important}.txt-error{color:#ba122b !important}.bg-success{background-color:#cfe9db}.bg-info{background-color:#cfdfe9}.bg-warning{background-color:#f7efde}.bg-danger{background-color:#f4dfd9}.bg-error{background-color:#f1d0d5}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:62.5%;line-height:1.4;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover}html.fullscreen{width:100%}body{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}::-webkit-scrollbar-corner{background-color:ThreeDHighlight}.qti-item *,.qti-item *:before,.qti-item *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.qti-item,.qti-item body{color:#222;font-family:\"Franklin Gothic\",\"Franklin Gothic Medium\",sans-serif;font-weight:normal;margin:0;padding:0;position:relative;height:100%;z-index:0;line-height:1.4;background:white;border-width:1px;font-size:14px;font-size:1.4rem}.qti-item address,.qti-item article,.qti-item aside,.qti-item audio,.qti-item blockquote,.qti-item dd,.qti-item div,.qti-item dl,.qti-item fieldset,.qti-item figcaption,.qti-item figure,.qti-item footer,.qti-item form,.qti-item h1,.qti-item h2,.qti-item h3,.qti-item h4,.qti-item h5,.qti-item h6,.qti-item header,.qti-item hr,.qti-item noscript,.qti-item ol,.qti-item output,.qti-item p,.qti-item pre,.qti-item section,.qti-item summary,.qti-item ul,.qti-item main{margin-top:0;padding-top:0;padding-bottom:0;white-space:normal}.qti-item h1{font-size:2em;margin:0.67em 0}.qti-item h2{font-size:1.5em;margin:0.83em 0}.qti-item h3{font-size:1.17em;margin:1em 0}.qti-item h4{font-size:1em;margin:1.33em 0}.qti-item h5{font-size:0.83em;margin:1.67em 0}.qti-item h6{font-size:0.67em;margin:2.33em 0}.qti-item blockquote{margin:1em 40px}.qti-item blockquote,.qti-item dd,.qti-item dl,.qti-item fieldset,.qti-item figure,.qti-item h1,.qti-item h2,.qti-item h3,.qti-item h4,.qti-item h5,.qti-item h6,.qti-item hr,.qti-item ol,.qti-item p,.qti-item pre,.qti-item ul{display:block;margin-bottom:10px;white-space:normal}.qti-item h1,.qti-item h2,.qti-item h3,.qti-item h4,.qti-item h5,.qti-item h6{font-weight:normal;font-style:normal}.qti-item iframe{border:none}.qti-item audio,.qti-item canvas,.qti-item video,.qti-item svg{display:inline-block;vertical-align:middle}.qti-item .MathJax svg{display:inline;vertical-align:baseline}.qti-item a{cursor:pointer;background:transparent;text-decoration:none;outline:0;color:#3e7da7}.qti-item a:focus{outline:thin dotted}.qti-item a:hover{text-decoration:underline;color:#0e5d91}.qti-item a:hover:before,.qti-item a:hover:after{text-decoration:none !important}.qti-item a.block{color:#222;text-decoration:none;display:block}.qti-item a[rel=\"external\"] span.icon-external:before{font-size:11px;font-size:1.1rem;padding:0 0 0 4px;position:relative;top:1px}.qti-item b,.qti-item .b,.qti-item strong,.qti-item .strong{font-weight:bold}.qti-item i,.qti-item .i,.qti-item em,.qti-item .em,.qti-item dfn{font-style:italic}.qti-item code,.qti-item pre,.qti-item kdb,.qti-item samp{font-family:Consolas,\"Andale Mono WT\",\"Andale Mono\",\"Lucida Console\",\"Lucida Sans Typewriter\",\"DejaVu Sans Mono\",\"Bitstream Vera Sans Mono\",\"Liberation Mono\",\"Nimbus Mono L\",Monaco,\"Courier New\",Courier,monospace;font-size:14px;font-size:1.4rem}.qti-item pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}.qti-item code{background:#f2f6f7;padding:2px 6px;display:inline-block;margin:0 3px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.qti-item hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}.qti-item q{quotes:\"\\201C\" \"\\201D\" \"\\2018\" \"\\2019\"}.qti-item q:before,.qti-item q:after{content:'';content:none}.qti-item small{font-size:11px;font-size:1.1rem}.qti-item sub,.qti-item sup{font-size:.75rem;line-height:0;position:relative;vertical-align:baseline}.qti-item sup{top:-0.5rem}.qti-item sub{bottom:-0.25rem}.qti-item img{border:0;max-width:100%}.qti-item svg:not(:root){overflow:hidden}.qti-item fieldset{border:0;margin:0;padding:0}.qti-item legend{border:0;padding:0}.qti-item textarea{overflow:auto;vertical-align:top;resize:vertical}.qti-item label,.qti-item button{cursor:pointer}.qti-item button{vertical-align:middle;outline:0;overflow:visible;border:none}.qti-item button::-moz-focus-inner,.qti-item input::-moz-focus-inner{border:0;padding:0}.qti-item button::-ms-clear,.qti-item input::-ms-clear{display:none}.qti-item button::-ms-reveal,.qti-item input::-ms-reveal{display:none}.qti-item button,.qti-item input,.qti-item select,.qti-item textarea{font-family:\"Franklin Gothic\",\"Franklin Gothic Medium\",sans-serif;font-weight:normal;line-height:normal;text-transform:none;vertical-align:baseline}.qti-item button,.qti-item html input[type=\"button\"],.qti-item input[type=\"reset\"],.qti-item input[type=\"submit\"]{-webkit-appearance:button;cursor:pointer}.qti-item input{border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:1px;-webkit-border-radius:1px;border-radius:1px}.qti-item input[type=\"search\"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.qti-item input[type=\"search\"]::-webkit-search-cancel-button,.qti-item input[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}.qti-item input[type=\"checkbox\"],.qti-item input[type=\"radio\"]{box-sizing:border-box;padding:0}.qti-item select{max-width:100%}.qti-item audio:not([controls]),.qti-item [hidden],.qti-item template,.qti-item .hidden,.qti-item .deleted,.qti-item .js,.qti-item .js-hide{display:none !important}.qti-item .visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.qti-item .visuallyhidden.focusable:active,.qti-item .visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.qti-item .invisible{visibility:hidden}.qti-item .viewport-hidden{position:absolute;left:-10000px;top:-10000px}.qti-item .clearfix:before,.qti-item .grid-row:before,.qti-item .fixed-grid-row:before,.qti-item #icon-editor .grid-row:before,.qti-item .block-listing.horizontal:before,.qti-item .qti-associateInteraction .result-area>li:before,.qti-item .clearfix:after,.qti-item .grid-row:after,.qti-item .fixed-grid-row:after,.qti-item #icon-editor .grid-row:after,.qti-item .block-listing.horizontal:after,.qti-item .qti-associateInteraction .result-area>li:after{content:\" \";display:table}.qti-item .clearfix:after,.qti-item .grid-row:after,.qti-item .fixed-grid-row:after,.qti-item #icon-editor .grid-row:after,.qti-item .block-listing.horizontal:after,.qti-item .qti-associateInteraction .result-area>li:after{clear:both}.qti-item .clear{display:block;clear:both}.qti-item .lft,.qti-item .wrap-left{display:inline;float:left}.qti-item .rgt,.qti-item .wrap-right{display:inline;float:right}.qti-item .wrap-left{margin:20px 20px 20px 0}.qti-item .wrap-right{margin:20px 0 20px 20px}.qti-item .txt-ctr{text-align:center}.qti-item .txt-lft{text-align:left}.qti-item .txt-rgt{text-align:right}.qti-item .txt-jty{text-align:justify}.qti-item .txt-underline{text-decoration:underline;font-size:inherit}.qti-item .txt-highlight{padding:0 5px;background:#FF6416;color:white}.qti-item ::-moz-selection{background:#b3d4fc;text-shadow:none}.qti-item ::selection{background:#b3d4fc;text-shadow:none}.qti-item .placeholder{color:#777 !important}.qti-item ::-webkit-input-placeholder{color:#777 !important}.qti-item :-moz-placeholder{color:#777 !important}.qti-item ::-moz-placeholder{color:#777 !important}.qti-item .truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.qti-item .disabled,.qti-item *:disabled{cursor:default;opacity:.7}.qti-item .overlay,.qti-item .ui-widget-overlay{background:rgba(255,255,255,0.9)}.qti-item .ui-widget{font-family:\"Franklin Gothic\",\"Franklin Gothic Medium\",sans-serif;font-size:1.4rem !important}.qti-item .ui-widget .ui-widget{font-size:1.4rem !important}.qti-item .ui-widget input,.qti-item .ui-widget select,.qti-item .ui-widget textarea,.qti-item .ui-widget button{font-family:\"Franklin Gothic\",\"Franklin Gothic Medium\",sans-serif;font-size:1.4rem !important}.qti-item ul,.qti-item ol{padding-left:40px}.qti-item ul.plain,.qti-item ul.none,.qti-item ol.plain,.qti-item ol.none{padding:0;margin:0;list-style:none}.qti-item ul li,.qti-item ol li{vertical-align:text-top !important}.qti-item nav ul{padding:0;margin:0;list-style:none}.qti-item ul.disc,.qti-item ol.disc{list-style-type:disc}.qti-item ul.circle,.qti-item ol.circle{list-style-type:circle}.qti-item ul.square,.qti-item ol.square{list-style-type:square}.qti-item ul.decimal,.qti-item ol.decimal{list-style-type:decimal}.qti-item ul.decimal-leading-zero,.qti-item ol.decimal-leading-zero{list-style-type:decimal-leading-zero}.qti-item ul.lower-roman,.qti-item ol.lower-roman{list-style-type:lower-roman}.qti-item ul.upper-roman,.qti-item ol.upper-roman{list-style-type:upper-roman}.qti-item ul.lower-greek,.qti-item ol.lower-greek{list-style-type:lower-greek}.qti-item ul.lower-latin,.qti-item ol.lower-latin{list-style-type:lower-latin}.qti-item ul.upper-latin,.qti-item ol.upper-latin{list-style-type:upper-latin}.qti-item ul.armenian,.qti-item ol.armenian{list-style-type:armenian}.qti-item ul.georgian,.qti-item ol.georgian{list-style-type:georgian}.qti-item ul.lower-alpha,.qti-item ol.lower-alpha{list-style-type:lower-alpha}.qti-item ul.upper-alpha,.qti-item ol.upper-alpha{list-style-type:upper-alpha}.qti-item ul.none,.qti-item ol.none{list-style-type:none}.qti-item [class^=\"list-style-\"],.qti-item [class*=\" list-style-\"]{counter-reset:custom-counter}.qti-item [class^=\"list-style-\"]>p::before,.qti-item [class^=\"list-style-\"]>div::before,.qti-item [class^=\"list-style-\"]>li::before,.qti-item [class*=\" list-style-\"]>p::before,.qti-item [class*=\" list-style-\"]>div::before,.qti-item [class*=\" list-style-\"]>li::before{counter-increment:custom-counter;width:20px;display:inline-block;text-align:center}.qti-item [class^=\"list-style-\"].list-style-disc>p::before,.qti-item [class^=\"list-style-\"].list-style-disc>div::before,.qti-item [class^=\"list-style-\"].list-style-disc>li::before,.qti-item [class*=\" list-style-\"].list-style-disc>p::before,.qti-item [class*=\" list-style-\"].list-style-disc>div::before,.qti-item [class*=\" list-style-\"].list-style-disc>li::before{content:counter(custom-counter, disc)}.qti-item [class^=\"list-style-\"].list-style-circle>p::before,.qti-item [class^=\"list-style-\"].list-style-circle>div::before,.qti-item [class^=\"list-style-\"].list-style-circle>li::before,.qti-item [class*=\" list-style-\"].list-style-circle>p::before,.qti-item [class*=\" list-style-\"].list-style-circle>div::before,.qti-item [class*=\" list-style-\"].list-style-circle>li::before{content:counter(custom-counter, circle)}.qti-item [class^=\"list-style-\"].list-style-square>p::before,.qti-item [class^=\"list-style-\"].list-style-square>div::before,.qti-item [class^=\"list-style-\"].list-style-square>li::before,.qti-item [class*=\" list-style-\"].list-style-square>p::before,.qti-item [class*=\" list-style-\"].list-style-square>div::before,.qti-item [class*=\" list-style-\"].list-style-square>li::before{content:counter(custom-counter, square)}.qti-item [class^=\"list-style-\"].list-style-decimal>p::before,.qti-item [class^=\"list-style-\"].list-style-decimal>div::before,.qti-item [class^=\"list-style-\"].list-style-decimal>li::before,.qti-item [class*=\" list-style-\"].list-style-decimal>p::before,.qti-item [class*=\" list-style-\"].list-style-decimal>div::before,.qti-item [class*=\" list-style-\"].list-style-decimal>li::before{content:counter(custom-counter, decimal)}.qti-item [class^=\"list-style-\"].list-style-decimal-leading-zero>p::before,.qti-item [class^=\"list-style-\"].list-style-decimal-leading-zero>div::before,.qti-item [class^=\"list-style-\"].list-style-decimal-leading-zero>li::before,.qti-item [class*=\" list-style-\"].list-style-decimal-leading-zero>p::before,.qti-item [class*=\" list-style-\"].list-style-decimal-leading-zero>div::before,.qti-item [class*=\" list-style-\"].list-style-decimal-leading-zero>li::before{content:counter(custom-counter, decimal-leading-zero)}.qti-item [class^=\"list-style-\"].list-style-lower-roman>p::before,.qti-item [class^=\"list-style-\"].list-style-lower-roman>div::before,.qti-item [class^=\"list-style-\"].list-style-lower-roman>li::before,.qti-item [class*=\" list-style-\"].list-style-lower-roman>p::before,.qti-item [class*=\" list-style-\"].list-style-lower-roman>div::before,.qti-item [class*=\" list-style-\"].list-style-lower-roman>li::before{content:counter(custom-counter, lower-roman)}.qti-item [class^=\"list-style-\"].list-style-upper-roman>p::before,.qti-item [class^=\"list-style-\"].list-style-upper-roman>div::before,.qti-item [class^=\"list-style-\"].list-style-upper-roman>li::before,.qti-item [class*=\" list-style-\"].list-style-upper-roman>p::before,.qti-item [class*=\" list-style-\"].list-style-upper-roman>div::before,.qti-item [class*=\" list-style-\"].list-style-upper-roman>li::before{content:counter(custom-counter, upper-roman)}.qti-item [class^=\"list-style-\"].list-style-lower-greek>p::before,.qti-item [class^=\"list-style-\"].list-style-lower-greek>div::before,.qti-item [class^=\"list-style-\"].list-style-lower-greek>li::before,.qti-item [class*=\" list-style-\"].list-style-lower-greek>p::before,.qti-item [class*=\" list-style-\"].list-style-lower-greek>div::before,.qti-item [class*=\" list-style-\"].list-style-lower-greek>li::before{content:counter(custom-counter, lower-greek)}.qti-item [class^=\"list-style-\"].list-style-lower-latin>p::before,.qti-item [class^=\"list-style-\"].list-style-lower-latin>div::before,.qti-item [class^=\"list-style-\"].list-style-lower-latin>li::before,.qti-item [class*=\" list-style-\"].list-style-lower-latin>p::before,.qti-item [class*=\" list-style-\"].list-style-lower-latin>div::before,.qti-item [class*=\" list-style-\"].list-style-lower-latin>li::before{content:counter(custom-counter, lower-latin)}.qti-item [class^=\"list-style-\"].list-style-upper-latin>p::before,.qti-item [class^=\"list-style-\"].list-style-upper-latin>div::before,.qti-item [class^=\"list-style-\"].list-style-upper-latin>li::before,.qti-item [class*=\" list-style-\"].list-style-upper-latin>p::before,.qti-item [class*=\" list-style-\"].list-style-upper-latin>div::before,.qti-item [class*=\" list-style-\"].list-style-upper-latin>li::before{content:counter(custom-counter, upper-latin)}.qti-item [class^=\"list-style-\"].list-style-armenian>p::before,.qti-item [class^=\"list-style-\"].list-style-armenian>div::before,.qti-item [class^=\"list-style-\"].list-style-armenian>li::before,.qti-item [class*=\" list-style-\"].list-style-armenian>p::before,.qti-item [class*=\" list-style-\"].list-style-armenian>div::before,.qti-item [class*=\" list-style-\"].list-style-armenian>li::before{content:counter(custom-counter, armenian)}.qti-item [class^=\"list-style-\"].list-style-georgian>p::before,.qti-item [class^=\"list-style-\"].list-style-georgian>div::before,.qti-item [class^=\"list-style-\"].list-style-georgian>li::before,.qti-item [class*=\" list-style-\"].list-style-georgian>p::before,.qti-item [class*=\" list-style-\"].list-style-georgian>div::before,.qti-item [class*=\" list-style-\"].list-style-georgian>li::before{content:counter(custom-counter, georgian)}.qti-item [class^=\"list-style-\"].list-style-lower-alpha>p::before,.qti-item [class^=\"list-style-\"].list-style-lower-alpha>div::before,.qti-item [class^=\"list-style-\"].list-style-lower-alpha>li::before,.qti-item [class*=\" list-style-\"].list-style-lower-alpha>p::before,.qti-item [class*=\" list-style-\"].list-style-lower-alpha>div::before,.qti-item [class*=\" list-style-\"].list-style-lower-alpha>li::before{content:counter(custom-counter, lower-alpha)}.qti-item [class^=\"list-style-\"].list-style-upper-alpha>p::before,.qti-item [class^=\"list-style-\"].list-style-upper-alpha>div::before,.qti-item [class^=\"list-style-\"].list-style-upper-alpha>li::before,.qti-item [class*=\" list-style-\"].list-style-upper-alpha>p::before,.qti-item [class*=\" list-style-\"].list-style-upper-alpha>div::before,.qti-item [class*=\" list-style-\"].list-style-upper-alpha>li::before{content:counter(custom-counter, upper-alpha)}.qti-item [class^=\"list-style-\"].list-style-none>p::before,.qti-item [class^=\"list-style-\"].list-style-none>div::before,.qti-item [class^=\"list-style-\"].list-style-none>li::before,.qti-item [class*=\" list-style-\"].list-style-none>p::before,.qti-item [class*=\" list-style-\"].list-style-none>div::before,.qti-item [class*=\" list-style-\"].list-style-none>li::before{content:counter(custom-counter, none)}.qti-item table{border-collapse:collapse;border-spacing:0;margin:0;padding:0}.qti-item table.matrix{width:100%;border:6px solid #f9f8f7;margin-bottom:10px}.qti-item table.matrix td,.qti-item table.matrix th{font-weight:normal;padding:3px 5px;border:1px solid #ddd}.qti-item table.matrix th{text-align:left;vertical-align:middle;background:#f9f8f7}.qti-item table.matrix td{background:transparent;text-align:left;padding:2px}.qti-item table.matrix td.numeric{text-align:right}.qti-item table.matrix td label{display:block;margin:0}.qti-item table.matrix tr:nth-child(even){background:white}.qti-item table.matrix tr:nth-child(odd){background:#f4f7f8}.qti-item table.matrix [data-edit],.qti-item table.matrix [data-edit] *{border:none;padding:6px;cursor:pointer}.qti-item table.matrix tbody [data-edit]{width:30px}.qti-item .tbl{display:table;float:none !important}.qti-item .tbl-row{display:table-row;float:none !important}.qti-item .tbl-cell{display:table-cell;vertical-align:top;float:none !important}.qti-item .svg-glyph{fill:currentColor}.qti-item .txt-user-highlight{color:#222 !important;background-color:yellow !important}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.select2-container *{text-decoration:none !important}.select2-drop{font-family:\"Source Sans Pro\",sans-serif;font-weight:400}.select2-drop [data-symbol]:before{content:attr(data-symbol);display:inline-block;width:20px;line-height:20px;margin-right:4px;text-align:center;color:#222}.select2-container{margin:0;position:relative;display:inline-block;zoom:1;*display:inline;vertical-align:middle}.select2-container,.select2-drop,.select2-search,.select2-search input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.select2-container .select2-choice{display:block;height:26px;padding:0 0 0 8px;overflow:hidden;border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:1px;-webkit-border-radius:1px;border-radius:1px;white-space:nowrap;line-height:23px;color:#222;text-decoration:none;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff}.select2-container.select2-allowclear .select2-choice .select2-chosen{margin-right:42px}.select2-container .select2-choice>.select2-chosen{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select2-container .select2-choice abbr{display:none;width:12px;height:12px;position:absolute;right:24px;top:8px;font-size:1px;text-decoration:none;border:0;background-position:right top;cursor:pointer;outline:0}.select2-container.select2-allowclear .select2-choice abbr{display:inline-block;top:5px}.select2-container .select2-choice abbr:hover{background-position:right -11px;cursor:pointer}.select2-drop-mask{border:0;margin:0;padding:0;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:109998;background-color:#f3f1ef;filter:alpha(opacity=0)}.select2-drop{width:100%;margin-top:-1px;position:absolute;z-index:109999;top:100%;background:#fff;color:#222;border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;border-top:0;border-radius:0 0 2px 2px}.select2-drop-auto-width{border-top:1px solid #ddd;width:auto}.select2-drop-auto-width .select2-search{padding-top:4px}.select2-drop.select2-drop-above{margin-top:1px;border-top:1px solid #ddd;border-bottom:0;border-radius:2px 2px 0 0}.select2-drop-active{border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;border-top:none}.select2-container .select2-choice .select2-arrow{display:inline-block;width:18px;height:100%;position:absolute;right:0;top:0;background-clip:padding-box}.select2-container .select2-choice .select2-arrow b{display:block;width:100%;height:100%;font-family:'tao';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;font-size:1.05rem;font-size:10.5px;font-size:1.05rem;line-height:2.3;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.select2-container .select2-choice .select2-arrow b:before{content:\"\\e611\"}.select2-container .select2-choice .select2-arrow b:hover{background-color:#3e7da7;color:#fff}.select2-search{display:inline-block;width:100%;min-height:26px;margin:0;padding:4px 4px 0 4px;position:relative;z-index:100000;white-space:nowrap}.select2-search input{width:100%;height:auto !important;min-height:26px;padding:4px 20px 4px 5px;margin:0;outline:0;font-family:sans-serif;font-size:1em;border:1px solid #ddd;border-radius:0;-webkit-box-shadow:none;box-shadow:none;background-color:#fff;background-position:100% -22px}.select2-drop.select2-drop-above .select2-search input{margin-top:4px}.select2-search input.select2-active{background:#fff}.select2-container-active .select2-choice,.select2-container-active .select2-choices{border:1px solid #a4a9b1;outline:none}.select2-dropdown-open .select2-choice .select2-arrow{background:transparent;border-left:none;filter:none}.select2-dropdown-open .select2-choice .select2-arrow b{background-position:-18px 1px}.select2-results{max-height:200px;padding:0 !important;margin:4px 0 4px 0;position:relative;overflow-x:hidden;overflow-y:auto;font-size:inherit}.select2-results ul.select2-result-sub{margin:0;padding-left:0}.select2-results ul.select2-result-sub>li .select2-result-label{padding-left:20px}.select2-results ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:40px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:60px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:80px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:100px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:110px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:120px}.select2-results li{list-style:none;display:list-item;background-image:none}.select2-results li.select2-result-with-children>.select2-result-label{font-weight:bold}.select2-results .select2-result-label{padding:3px 7px 4px;margin:0;cursor:pointer;min-height:1em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.select2-results .select2-highlighted{background:#3e7da7;color:#fff}.select2-results li em{background:#fff;font-style:normal}.select2-results .select2-highlighted em{background:transparent}.select2-results .select2-highlighted ul{background:#fff;color:#222}.select2-results .select2-no-results,.select2-results .select2-searching,.select2-results .select2-selection-limit{background:#f3f1ef;display:list-item}.select2-results .select2-no-results{padding-left:7px}.select2-hidden-accessible{display:none}.select2-results .select2-disabled.select2-highlighted{color:#999;display:list-item;cursor:default}.select2-results .select2-disabled .select2-result-label{cursor:default}.select2-results .select2-disabled{display:list-item;cursor:default;color:#999}.select2-results .select2-selected{display:none}.select2-more-results.select2-active{background:#f3f1ef url(\"img/select2/select2-spinner.gif\") no-repeat 100%}.select2-more-results{background:#f3f1ef;display:list-item}.select2-container.select2-container-disabled .select2-choice{background-color:#f3f1ef;background-image:none;border:1px solid #ddd;cursor:default}.select2-container.select2-container-disabled .select2-choice .select2-arrow{background-color:#f3f1ef;background-image:none;border-left:0}.select2-container.select2-container-disabled .select2-choice abbr{display:none}.select2-container-multi .select2-choices{height:auto !important;height:1%;margin:0;padding:0;position:relative;border:1px solid #ddd;cursor:text;overflow:hidden;background-color:#fff}.select2-locked{padding:3px 5px 3px 5px !important}.select2-container-multi .select2-choices{min-height:26px}.select2-container-multi.select2-container-active .select2-choices{border:1px solid #ddd;outline:none}.select2-container-multi .select2-choices li{float:left;list-style:none}.select2-container-multi .select2-choices .select2-search-field{margin:0;padding:0;white-space:nowrap}.select2-container-multi .select2-choices .select2-search-field input{padding:5px;margin:1px 0;font-family:sans-serif;font-size:100%;color:#666;outline:0;border:0;-webkit-box-shadow:none;box-shadow:none;background:transparent !important}.select2-container-multi .select2-choices .select2-search-field input.select2-active{background:#fff url(\"img/select2/select2-spinner.gif\") no-repeat 100% !important}.select2-default{color:#999 !important}.select2-container-multi .select2-choices .select2-search-choice{padding:3px 5px 3px 18px;margin:3px 0 3px 5px;position:relative;line-height:13px;color:#222;cursor:default;border:1px solid #ddd;border-radius:1px;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#dbd9d7}.select2-container-multi .select2-choices .select2-search-choice.partial{background-color:#faf9f9}.select2-container-multi .select2-choices .select2-search-choice .select2-chosen{cursor:default}.select2-container-multi .select2-choices .select2-search-choice-focus{background:#d4d4d4}.select2-search-choice-close{display:block;width:12px;height:13px;position:absolute;right:3px;top:4px;font-size:1px;outline:none;background-position:right top}.select2-search-choice-close,.select2-container .select2-choice abbr,.select2-search input{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAAoCAYAAACiu5n/AAACLElEQVR42u3Zz0sUYRzH8bUISoyF1i5iXSooyYgOEXapZNYNojwU/aAfUAT9A4YhUgdxt1To0KFIBCMIvEcUEXntUtivpYuUhYFIdDBMmD69he/hObgsbSnb13ngdZjZhX3eO8/MDrMpSctKErwsg//HUSgU7uNYsB3hHla4CybqEoRPaMJGFCEMewxuxnsIk5iALPqg1yVdj9eQGUdjiuE1eAs+QOYztrsMJqwFk8EyHguW95klD+ZD08gsYvBFCBPYgHXBOT1UNpg3ncQpnAicRbrCCQ3j8SIf5QvYEWxvxnlb0mWDr0MIvcOaCiayC78gRKmlH+WDbaIjkJnDzgq/+VHIvMWqag3ehBkIAxXGdkAIDVRlsE24H9//4ty9hju4Hej710c5m83WYging32HMYjMnwSvx75UlQ+iOiDEaEMLZiA8dPc7TFQDnkGYxQ8Iz9Hs8k4riqIa4l5ApojVbm8tiduPL5CZRs5lMGFH8DNYxo+C5d3tMfgohJeow0qMQujxuqRb0RBsZ3DA2ZIuP5LgJDgJToKr4ZHOWjTOy+fzNa6DiezCFGReod1lMGF3IYzjMm5B5rirYIJyEJ4iHezfjW+YRr2n4EHE2LrAa1cg5DwFj2DWLlKljn67p+B+CIdKPAaOsddTcBOEKbTZvjp0Qvjo8Sp9DjJFfIVMjBsef4f34AHeYAxX0VfqMbDnfw97IXMTta6DLbobcxBa3Qdb9BPE2LZQ8G98530ecQi/2QAAAABJRU5ErkJggg==);background-repeat:no-repeat;min-width:inherit}.select2-container-multi .select2-search-choice-close{left:3px}.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover{background-position:right -11px}.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close{background-position:right -11px}.select2-container-multi.select2-container-disabled .select2-choices{background-color:#f3f1ef;background-image:none;border:1px solid #ddd;cursor:default}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice{padding:3px 5px 3px 5px;border:1px solid #ddd;background-image:none;background-color:#f3f1ef}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close{display:none;background:none}.select2-offscreen,.select2-offscreen:focus{clip:rect(0 0 0 0) !important;width:1px !important;height:1px !important;border:0 !important;margin:0 !important;padding:0 !important;overflow:hidden !important;position:fixed !important;outline:0 !important;left:0px !important;top:0px !important}.select2-display-none{display:none}.select2-measure-scrollbar{position:absolute;top:-10000px;left:-10000px;width:100px;height:100px;overflow:scroll}.form_radlst[disabled] .select2-container{pointer-events:none;cursor:default;color:#222;opacity:.55 !important}.form_radlst[disabled] .select2-container .select2-search-field,.form_radlst[disabled] .select2-container .select2-search-choice-close,.form_radlst[disabled] .select2-container .select2-arrow{display:none}.form_radlst[disabled] .select2-container .select2-search-choice{cursor:default;padding-left:5px}.mejs-offscreen{position:absolute !important;top:-10000px;left:-10000px;overflow:hidden;width:1px;height:1px}.mejs-container{position:relative;background:#000;font-family:Helvetica, Arial;text-align:left;vertical-align:top;text-indent:0}.me-plugin{position:absolute}.mejs-embed,.mejs-embed body{width:100%;height:100%;margin:0;padding:0;background:#000;overflow:hidden}.mejs-fullscreen{overflow:hidden !important}.mejs-container-fullscreen{position:fixed;left:0;top:0;right:0;bottom:0;overflow:hidden;z-index:1000}.mejs-container-fullscreen .mejs-mediaelement,.mejs-container-fullscreen video{width:100%;height:100%}.mejs-clear{clear:both}.mejs-background{position:absolute;top:0;left:0}.mejs-mediaelement{position:absolute;top:0;left:0;width:100%;height:100%}.mejs-poster{position:absolute;top:0;left:0;background-size:contain;background-position:50% 50%;background-repeat:no-repeat}:root .mejs-poster img{display:none}.mejs-poster img{border:0;padding:0;border:0}.mejs-overlay{position:absolute;top:0;left:0}.mejs-overlay-play{cursor:pointer}.mejs-overlay-button{position:absolute;top:50%;left:50%;width:100px;height:100px;margin:-50px 0 0 -50px;background:url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9ImJpZ3BsYXktZ3JhZGllbnQuZnctUGFnZSUyMDEiIHZpZXdCb3g9IjAgMCAxMDAgMjAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEwMHB4IiBoZWlnaHQ9IjIwMHB4Ig0+DQk8ZGVmcz4NCQk8cmFkaWFsR3JhZGllbnQgaWQ9ImdyYWRpZW50MSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNTAlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzIyMjIyMiIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjcwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjMjIyMjIyIiBzdG9wLW9wYWNpdHk9IjAuMDExOCIgb2Zmc2V0PSI3MC4yMDIlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiMzMzMzMzMiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSI4NSUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzMzMzMzMyIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L3JhZGlhbEdyYWRpZW50Pg0JCTxyYWRpYWxHcmFkaWVudCBpZD0iZ3JhZGllbnQyIiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iNzAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNiYmJiYmIiIHN0b3Atb3BhY2l0eT0iMC4wMTE4IiBvZmZzZXQ9IjcwLjIwMiUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2JiYmJiYiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9Ijg1JSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMTAwJSIvPg0JCTwvcmFkaWFsR3JhZGllbnQ+DQkJPGZpbHRlciBpZD0iZmlsdGVyMSIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgIDAgMCAwIDAgMCAgMCAwIDAgMCAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cxIi8+DQkJPC9maWx0ZXI+DQkJPGZpbHRlciBpZD0iZmlsdGVyMiIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwLjg2NjcgMCAgMCAwIDAgMC44NjY3IDAgIDAgMCAwIDAuODY2NyAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cyIi8+DQkJPC9maWx0ZXI+DQk8L2RlZnM+DQk8ZyBpZD0iQmFja2dyb3VuZCI+DQk8L2c+DQk8ZyBpZD0iZGFyayUyMHNoYWRvdyI+DQkJPHBhdGggZD0iTSAyMiA1MCBDIDIyIDM0LjUzNTggMzQuNTM1OCAyMiA1MCAyMiBDIDY1LjQ2NDIgMjIgNzggMzQuNTM1OCA3OCA1MCBDIDc4IDY1LjQ2NDIgNjUuNDY0MiA3OCA1MCA3OCBDIDM0LjUzNTggNzggMjIgNjUuNDY0MiAyMiA1MCBaTSA1IDUwIEMgNSA3NC44NTMxIDI1LjE0NjkgOTUgNTAgOTUgQyA3NC44NTMxIDk1IDk1IDc0Ljg1MzEgOTUgNTAgQyA5NSAyNS4xNDY5IDc0Ljg1MzEgNSA1MCA1IEMgMjUuMTQ2OSA1IDUgMjUuMTQ2OSA1IDUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxKSIvPg0JCTxwYXRoIGQ9Ik0gMjIgMTUwIEMgMjIgMTM0LjUzNTggMzQuNTM1OCAxMjIgNTAgMTIyIEMgNjUuNDY0MiAxMjIgNzggMTM0LjUzNTggNzggMTUwIEMgNzggMTY1LjQ2NDIgNjUuNDY0MiAxNzggNTAgMTc4IEMgMzQuNTM1OCAxNzggMjIgMTY1LjQ2NDIgMjIgMTUwIFpNIDUgMTUwIEMgNSAxNzQuODUzMSAyNS4xNDY5IDE5NSA1MCAxOTUgQyA3NC44NTMxIDE5NSA5NSAxNzQuODUzMSA5NSAxNTAgQyA5NSAxMjUuMTQ2OSA3NC44NTMxIDEwNSA1MCAxMDUgQyAyNS4xNDY5IDEwNSA1IDEyNS4xNDY5IDUgMTUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQyKSIvPg0JPC9nPg0JPGcgaWQ9ImRhcmsiPg0JCTxwYXRoIGlkPSJQb2x5Z29uIiBmaWx0ZXI9InVybCgjZmlsdGVyMSkiIGQ9Ik0gNzIuNSA0OS41IEwgMzguNzUgNjguOTg1NiBMIDM4Ljc1IDMwLjAxNDQgTCA3Mi41IDQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlIiBkPSJNIDEzIDUwLjUgQyAxMyAyOS43ODkxIDI5Ljc4OTEgMTMgNTAuNSAxMyBDIDcxLjIxMDkgMTMgODggMjkuNzg5MSA4OCA1MC41IEMgODggNzEuMjEwOSA3MS4yMTA5IDg4IDUwLjUgODggQyAyOS43ODkxIDg4IDEzIDcxLjIxMDkgMTMgNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg0JPGcgaWQ9ImxpZ2h0Ij4NCQk8cGF0aCBpZD0iUG9seWdvbjIiIGZpbHRlcj0idXJsKCNmaWx0ZXIyKSIgZD0iTSA3Mi41IDE0OS41IEwgMzguNzUgMTY4Ljk4NTYgTCAzOC43NSAxMzAuMDE0NCBMIDcyLjUgMTQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlMiIgZD0iTSAxMyAxNTAuNSBDIDEzIDEyOS43ODkxIDI5Ljc4OTEgMTEzIDUwLjUgMTEzIEMgNzEuMjEwOSAxMTMgODggMTI5Ljc4OTEgODggMTUwLjUgQyA4OCAxNzEuMjExIDcxLjIxMDkgMTg4IDUwLjUgMTg4IEMgMjkuNzg5MSAxODggMTMgMTcxLjIxMSAxMyAxNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg08L3N2Zz4=\") no-repeat}.no-svg .mejs-overlay-button{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAADICAMAAAAp4rTzAAAAA3NCSVQICAjb4U/gAAAA0lBMVEX////MzMwAAADMzMwAAADMzMwAAADW1tbMzMwaGhoQEBAHBwcAAADe3t7W1tZaWlpRUVFKSkpBQUE5OTkzMzMpKSkhISEaGhrm5ube3t58fHxzc3Nra2tmZmZaWlpRUVHv7+/m5uaZmZmUlJSMjIyEhIR8fHzv7+/m5ua1tbWtra2kpKSZmZn39/fv7+/MzMzFxcW+vr61tbX39/fW1tbMzMzFxcX39/fe3t7W1tb////39/fm5ube3t7////39/fv7+/m5ub////39/f////39/eUP7RQAAAARnRSTlMAEREiIjMzREREREREVVVVVVVVVVVVVVVmZmZmZmZmZnd3d3d3d3eIiIiIiIiZmZmZmZmqqqqqu7u7zMzMzN3d3d3u7v//HUUrOgAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAAWdEVYdENyZWF0aW9uIFRpbWUAMTEvMTkvMTAtc7sxAAAJ4klEQVR4nO2ae1sauRrAbUWW5TJHQaqsl122rZzqyooIiFAWZ8bv/5VOLm+SNzNJJhkGn7PPY/5qaSa/vPfkTQ8OPsbHcI7PubF/QtUcvl4tNyrkIEIdDcSpBJFdXyftjNEQ7cyoBgMII0HnlMYgBFuwezdbbxM60iTZrmdf+5JTGqMjfpttkzQzku38SseUFoOscjzZZgEw4u3kmGNKCIMR10sswxtV1xuWZ3mNMYEMjuhJxFuynt1eMEP0L4l9JDqZdQUmgIIYj7BUvJ5cNHXPal3MtyBS8hhMAQb57nIr9nqiua3kXM1gE6/cNN4UyWiCGNvbHooKOfhv3QmflPxoBlAUY8m/vtUANS2L0X85g70s/SmScbbmn/a1DIKHxHR/sqnP3hTB6DNG8lcuSYkhOWRC8wcT5mdfUPwYTc64zCYofdRkMF0xyvrMh0I/VIztiTRGPtlKDKecMEf82WIUt8JAkOYzc8s+cqiaKaAxpscoT61CUYSyJkyOvu60xrTxWQVun1FuCxXGPiAxmCCGKormHKgoJ/SzhGQyJ0QIQreUnIisB0q3plqhsnb7glJeC0QBqzNl3fG5HNL+e3bqxMBObpXCbBAQhEm9bGmQOQ98m2mEClo0KpO+SxQQhHpW0pLBy6w0p0b6ZhdGUI7pBp8cosBEFlZ3kqEgJG9cWzGC8shtbxUFBKFpcXsGLiKCcw4pf66ZRvuY74Y5jV0U2Mt1gp09A0mlaQwJgItCbZ90baIgxSSnwtdzEJKfLswY+L5LN/loixVYjs6ZqASUhxDTGN1Z7GdG1W3RF4h7QwXpqY2YIMQ0JncGUU5iMuPKrC+YQvexRjFrhBCMwZ1xvngw6wtW2yJtHdghZCd5d0ZzX436QtH+9jvahhVCHDVjGuHFV1TSLyZ9wYS7lEV73QeSJhP9vC2KEfWdbyZ95UyiFG2F5DINGOWV/MvcAaFVd+YPyZqmJnPGswUi7H4XAiF7VqapqbpqjBQUihd4E8UQnGk45Cv58R835K0fCCE6+4aqKLiXG5Jo5dMLQkzwH6CwWv+2H0ia/N2WkH7ihtD5u0M8JGkF2ySjrq4HpLer4a/TQsjbza4u/K0AQoPxdtdgpIcJWzC+S1qhkKe0ggRJ1eFKkDTVb5u7pHpyjHSnel60tHN5YNGicy9T61G1uvJLa5K5/OIZux0kWlaTSKN8pyugIh92JGKhSOI9vnQciertX8U+ShzuaoWHO3wDSs7kRsodU384jqk1cfETFbjEgZtt8tR+4FZXh38sp3r31YFOPKV7nNm0JUWhxRPfHcIuQQ90K8fOSxBzQSoKuWGUv845BJGi0OrJElw9+GL6K02wpCBZBdEvS+Wu2I9K1a57vGoWXIQ3C1gnA+cLM4S7CLsAQ0uiLrsehW2PHnzmZOgX5eAGDm9G/VncixKUJ0ZR7a66sRWldbw4Y+bXVavJtkS67SlKUVONt+6WXv1BYRbe5kxkw9/aHqxzxg1jPMvockKkKGesQ5o8ttC7Qi0DUI1O3rWFdmohA7U6n3nS7Ra3bK+gu9v0UpZOeeJJcaI6w9nB2tJf5jGb+NDyZ6BW/R10yB96hi56HdroDzDpLoSBKddrSPHLm8yTAx/NG/HwAeeK8GeHunoTIO48u8gQzr7PxANR8qdIO94M7QGlKx4vyFLr5ePXy+6X1unVX5MlfqRplmDoz03HCkNX5O9z6Id5z1ItfSifZRj0bl9zT3NCuNtu256g/YVhbnQ9X+c4yXpyjUI1HCGFkZh26/v8+ZW/Zibb1+f597O2jijB0DF1kwfraa0UAmHMHFwCyiMOVMlQ9VEbVSB0zv4e/SVmv/99AXHyozqCjVM14WN8jI/xMf6l41Nu7J9QNYevd5gbFXIQ4QgNxKkEkV1fJ+2M0RCNzKgGAwgjQeeUxiAEWzAaTVebmI40jjer6TCSnNIYHXE+3cTZA3e8mQ50TGkxyCqd8cZ8cyCccYdjSgiDEYOFJgNVl/b3xQBjAhkcESlEvJqOzpkhonNiH/X7NBKYAApijGGp+GV8nnUtYieBGQdTgEE1tRF77WhuK/88mMImNtw03hTFADE2owhFhRz8twgmxaMQimIs1NcKcKhlMYxZ+FMkI1rxTyMtg+AhMZ1VIEVncDG0JCWG5NAZIybMKhIUP0bjhTEGmJEvWYcqmAIo9EP20Qq5jDnZSgxkBeaIK64xt8KEIMzmmwg51KEpoDEmYpRpsSiCMc4xbGnjkwpcThkVUtgHoGDBUEXRnAMVpRODGZ0QIQjdUtwRWQ+Ubk21QmUkz7DNFYgCVr9HYnNI417lQCMGdjJSX9ogIAiTWgQWQKYibZhNIx2fOmUcuUQBQahnxSp4mZWmVA9DuzCCwjY4dYgCE5nVpY8gCBFvYMVgvyS2t4qCBGGeBSHOfpzmylNGZ2I3zGnsolgE0SAyo+eFEaKMnFZBiomFIAc5SJq+nJsx8H1ENzm2xQosJ+ZAAspDIPvnMHg/G4u+QNyhJogZQkxjcmcQhTmYxfRIWy8oZo0QgjG4M84X92Z9wWobpK0DO4TsJO/OhfrC0Y5TnBVCHDVjGuHFA6t/wYQRj/YjH4g8bamqeSh9Z2jSFzLJCovqguQyDTLK1AFZpZl4dUPIjjTTqLK6sEDEJkYhEM00hyp/GS2PQvEcb6IYgjMNhww9IFEghLjzEFVRcC83RHMuPwgxQQcorKjsCZLG9w0JiWI3hM7fHeIlSahNSqjrPQyvZ4SyLuyC7D0Y3yWtvFuCHKWZw2xwqm8UpXpetOIdipZ0LvOh6D3KL55RwUHCaBJpFObjSF9hRyKprXPHkeio8Qs+ywYe7g4LD3f4BoTMVu6YOnIcU+UBUAR9iQP32O5bB+osu8ChEnR1ELXEdQtCZ7PylyCm7Y7zEqSuc7J/UfF1TjPdQs+snhfTX16cFsFT0UU58Io9TtOiK7beLDgPbxawq+CqsFnwSU2GlsSR7HoUtj2iuMDquiilGji8GfVHcS8K5wbc7jK3orSOV8e3FWVoeDVsuso01XjrbuHVH5SRy1uQxe3BI84Y6gzPJiRQxrJf62x0jgWjuDmoUaAtvPJo2Q6yLdsiBqLwhBWPFSY7eI8bWun3AQzU4h5Bh/xevflkCY3Ofa6N7sHQHgReIMUvhg3jGIqHDzjkhT87HDXU00a6mWafNqKhetqQCdqboVE64vGCvqEsxsNBFDWiwX/Hixf0SNMowdCfmxAmZa9N+oOTvVr6UD7JMIhG+ac5IKxGrhrgLwwPhelLjhOvxrs9AUphDpW3DqeLDX/NjDebRSWPmTrmyOzCjjoTjDFzcAkojzhQJUPVR21UgdA5+3v0l5j9/vcFxMmP6gg2TtWEj/Ex/l/H/wCKgxtJ/pulSgAAAABJRU5ErkJggg==)}.mejs-overlay:hover .mejs-overlay-button{background-position:0 -100px}.mejs-overlay-loading{position:absolute;top:50%;left:50%;width:80px;height:80px;margin:-40px 0 0 -40px;background:#333;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEhJREFUeNrszzERACAMALEH/25qEBcMvcRBTjUtcFtCRERERERERERERERERERERERERERERERERERERERERERERERE5I8nwABEjQEXuO95jAAAAABJRU5ErkJggg==);background:rgba(0,0,0,0.9);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(50,50,50,0.9)), to(rgba(0,0,0,0.9)));background:-webkit-linear-gradient(top, rgba(50,50,50,0.9), rgba(0,0,0,0.9));background:-moz-linear-gradient(top, rgba(50,50,50,0.9), rgba(0,0,0,0.9));background:-o-linear-gradient(top, rgba(50,50,50,0.9), rgba(0,0,0,0.9));background:-ms-linear-gradient(top, rgba(50,50,50,0.9), rgba(0,0,0,0.9));background:linear-gradient(rgba(50,50,50,0.9), rgba(0,0,0,0.9))}.mejs-overlay-loading span{display:block;width:80px;height:80px;background:transparent url(data:image/gif;base64,R0lGODlhMAAwAPcAAP////7+/v39/fv7+/j4+Pf39/X19e3t7ezs7Ovr6+rq6ujo6Obm5uXl5eTk5OHh4eDg4N/f397e3tzc3NnZ2djY2NbW1tXV1dTU1NPT08zMzMvLy8nJycjIyMfHx8PDw8LCwsDAwL+/v729vby8vLu7u7q6uri4uLOzs7KysrCwsK2traysrKampqSkpKOjo6KioqGhoaCgoJ6enp2dnZubm5qampmZmZeXl5aWlpWVlZSUlJOTk5GRkZCQkI+Pj46Ojo2NjYuLi4qKiomJiYiIiIeHh4WFhYSEhIODg4KCgoGBgYCAgH5+fn19fXx8fHt7e3p6enh4eHd3d3Z2dnV1dXR0dHJycnFxcWxsbGtra2pqamlpaWhoaGZmZmVlZWRkZGNjY19fX15eXl1dXVxcXFtbW1lZWVhYWFdXV1ZWVlVVVVNTU1JSUlFRUU9PT01NTUxMTEtLS0pKSklJSUdHR0ZGRkVFRURERENDQ0JCQkBAQD8/Pz4+Pj09PTw8PDo6Ojg4ODc3NzY2NjQ0NDMzMzIyMjExMTAwMC4uLi0tLSwsLCsrKykpKScnJyUlJSQkJCMjIyEhIR8fHx4eHh0dHRsbGxoaGhkZGRgYGBcXFxUVFRQUFBMTExISEhEREQ8PDw4ODg0NDQwMDAsLCwoKCggICAcHBwYGBgUFBQQEBAICAgEBAf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgCtACwCAAAAKwAtAAAI/wBbCRxIsCDBVZYIEbK0yqDDhxANItpRIUGCCjsQRdzIsRWbBwBCinzApqPJgn8YiFwJgMGfkydNrWDJcoUpmB0RHaC58oBGnANLFUJTho8ngWsE8BQpYA1QgYxuVHDQQEIKOa3IBFgaMgCZp4tENBhL1oIbPAW4AiiAZyArVKk4mrpBtm6DD38yqL2ASWApRn3+SFIVsVAFu3W9YFHKU4AVgaoOyXnzho6kiGkQ1wXyKcZWlgFggBL4yc4bOZP/xH1YRjPZHa08GVnwOcACI0cFdqJzenIfVBD5SHDdgIrAVYq29OihRVHDgagAnT7NKKInFa4tCDrp6Q8dO4ZKbf+UYwGxAyiET57q9Cl9xFVrOlAdWwGKqKcwI3XxoWOKoNX4bbSKe62wEmBHnaxhBBBYIPLcgRtFYkMHG1RYwhkEQojKJ6MY2MooPVQo4gYi9AHhQJnEMYYZgwD3xwcjihgEgAGS0kYXOH6hURgxishCJydKAgaOOL6hCo89bvBjkEMSaeSLSc54oo1E6vhhiDGWeKJAKa7YokASUmghhlsKtGGHBCW4YIMPlgnRgG7GKSdBqWRSiXhzOhSJFDLAUAQgbZokSiSVnNKRJTycoOgJLbyUXxdPRIHGJxyRkcIJKWR6QhF4diRKF0qEygQcHj6UihKYZnppDJacFAkUSjCMwYQSWpASkSpPpKrpDJmcVEkUsc7aRacPyaFCqopOkaEnCuVGECpozKrEE45GJMoUx2LKQyQFOfKEDjo84YhBn8CRRRd/AMeRKHI4kQQZrRJUyhU41IvDFcQeR0q+HKlC40CVBGEvDkFUkidBmxgx8BGbHDwQfDrUq8MageZZyhxUUDEHvw6bctNTAQEAIfkECQoArQAsAgABACsALAAACP8AWwkcSLAgQVKEzJDZ08mgw4cQDTKyUaGBAwkp5ETcyLHVIhENQoq00KajyYKmbIhc2eDDyZetClVkGdJBl4GqKg0aVEnVyVWpCqZhQFPkD4GHdlRIkKACD0McO6kxAuTKIZ+txhAt2kBHKzYPAIgVGwACm4iRbHTQwNYEmqB6InBtQMUPg7F4ATTw83AUD7aANYjg06pTCq4VTK3Im5dFKYd/PgQGHORUqzgzWUI5dIAxXgRQDYKZDJgFp1aq1HDY2qAClFBqPOMVsMbhF9JsTQ+ExKUHjimCTGWVPVYAGYd+JJMOIrzgKoJmCBAHUOCOQ1F/J4vY0xHD9AuXHkL/qsEBcIkzqDpCIR6gSkROaoj4sBq0Y5wXngPA+MRRlWWYnQyhwFgBKFDEaTC9pAoiWfDAgxaJ1GcQKphUQkqCGLYSSRQzxGAEIBJmWBArpzQnUCU8nKDiCS3wJWJBpTDSxx+RpNcKGSicgMKOJxhx4YsCqXKIHG+8QUckraCShI475ihDJUAK9Ekdb8hB5B+nqNIEkzzOEF6UndBRJZF9pBdHCkyqOIWNQKICSJVVKiIQKFKgqSMPj0Q5kCd/0FGHIaMMBEocTRxBBiV6EnRKJ5+widNjiUYq6aSUViqQJzs1hCEqnoiCFUeOOJFDDk80kmAmcYxhxiAmQlTKFTjEm4oDFoGeREobXeT6RSEcVRKErDgEMclLkoCRa65wOOqQJkQAe4QmxBp77BvKGpSarDmsEaJAoUBCCaQHsXHsrh2REscUVMhRK0GRdOFEFGh4YlAmcKjK6kmmgEtQKF0o4S8TcHw6ECqfjCKwiJFAoQQTTCixhSiWDlSJwgwr0cW6lqJiRsNKONFHxAR58kYWXfzRKsiqkPJjggEBACH5BAkKAK0ALAMAAgAtACsAAAj/AFsJHEiw4MBRf8KE+SPKoMOHEB9G6vFhwwYQPiBF3MhxYCcbFkNuuMGpo8mHazqItOhhzcmXA1UZWRnyiKqBnvaQSVOoFExVpwqq+kHTYpBVrVbFUSHBgQMLOBSZFBXnyRIylQheKbrhisA1FhqIHStiEUdRU1ScOJGCh0aBiEjQLIGoVaQOY/M2wOEzohy1KVKsnYJKoCozIkSKOIO0iwO9YysUiqjKCdvAgmdkisknCAsWQfrcbOUD8lgHaCKmQnI58IkYWQmi4sQp1cBVOUyLdUBm4xjBmE8U6btRiu4GEvZsrLRj7doWf0wGqqA7hSeOkKTIgFHkD9KOqJw8/9ZrQY7JVJgsETcZygn1sR/awJxvONCUHT+8/MlDZg2i9fSZ9AkWGRQggAAIsOBHgCd5EoMAAEQoYQNsELSKJpWMwqCFRgQg4YcAQHCIQKWsYYQQWDSyoUCKLADihwHwcNMcOuBgIxSdrLiFhy9KaIElplBho406ELJiDz1+qAAhpkwxJA46DLIiD0lKuGQrcuQw5BPXbZhFlRH+2AopJgZxhSMrtpKIAmDu8N2FlQAYoCpFVPlAXWk+1IkLEILIQIV5QvRJFRYQAEAAB6wQXaAbXXLHGP6ZwuikraBCSSSgBDjbJ7ad9AkaUUDhxVsveQIIHXYgQopJq8DBhBKwdqCR6Umn/PHGrXIwMtpGpGShBBOvPhHJS53QIcexb/QRFEelcPHrq1FQ8tIndryB7B+dcuSHE7AygcayBJESSSQNCVWIHLfSMaxJqPjRhRZwfGJQJm2AAYYblxhUCiN9/CHJriaVQgorBqESRxcIdyGHpAVnm+cnYyTcxRhdUmrQKGZIbEa5FhfEiiBfIPzFIAR3XDAityJSmMkPqQIwfQEBACH5BAkKAK0ALAMAAgAsACsAAAj/AFsJHEiwYEFVpwwqXMiwISg4TZSQqdSwokWCoKSkOHEiBQ9IF0MyjLMRBQqOUhKKXClQVZMTJk2eoIGJJctTRmDGPCGDEkFRfbyA+SNKpCpNlEYZHHNypxFSAyHx+KBBA4geIC2SUkMkCJZGBSvt4MixxZ+BnGpUXavhBieLcXDIxfGkU0FIUmTEMPIn1UA1HNhW9bCmoqkpc3HkGGQw1aVKUAemGiJ4rRFVDQ8nXhwSVY/KVYNgbhh3bl2RVkBruKJVjRGvYEUaIlHZhKGLR5OyVGUmBFsRaEbbFJlqDxAWLIL08Tvc5ilOnFQ2n96qkx4xaQqVoh5SFZwUERo0/6hwQxFBVJQgfeJOUE0F8fAbiFgk0JMZKFC6ZOUOiUP8+DeMosobTChhYBfrcccFA//BVwEhpGShBBMFOvEIez00CJ8DZpTCxYQFRjEJd6rcoKF4DpDRih8RTYjGdtxJcWIDEuzRCip9cLEFHJ6w10ogFJyYQo8ClSKgj62c4gSD/1kgB5ILgfLEeyh+0AaUBpkxxhqIHLYDEF1gSVAcT2BAQAABIMCCH2IW1MkLAMQpJwANsHERKZFEUlR3Q8zpJwS3NZQJG2CA4cYlISGigJ9zBsCDcAahAkcXlHYhhykXZcGonxZQtNAnY1TaxRh2WcTDpnMqwNhCo5QhqhmhXIh0KqpxqsoQK4J8QekXg0AqECqceILKQJrSCkCnDaFiyBtwGIJpQZ4AQkcdiCjViqK0OuqrQqoMa9Apf7whrhyMYKZKn6gCSl0ndMjh7ht9PNuJC5vWyd0ndbzx7h/PtvIJFRYUgKaabJJYiBzi0hGJQZjYseUhMLJXyiJ9/BGJt20uhIp0wwUEACH5BAkKAK0ALAMAAwArAC0AAAj/AFsJHEiwYEFTpgwqXMiQISk5U6jMKdWwosWBq9bkwIFDx5pVF0Mu1GSEI0cjmkSqJFgpiEkcQiopTKVqZSlSIAuWuvISy6iClcYgcSJH1EVUfrhkgfPJoKMnOnRAaVQQ0o4UJ06omGK0oh8nSpQwQYPKoKdBhDoVTCUlawqsKuJULNVFLBMlUSiJxCTjxNu3J57UdKjFrhIokURaguH374klpxqygnM3rBdQIksVaYw1BRmLn9BEedIF0so/LbJm5SHT4ilKkTCvXPWnSIwZU0yv3C2wVKVMZXkLH068oKrBxS+qQnTlh5E1ageyGvUpePJWqsyQ2MC9g43ErVAJ/zIzJk6m6634iODOfkOPn4i+dJnfhlRyVEHas//wR9Wb+fOBAR5xnLCgH3th+AdgFwImV+CB3IXRSnwAutEVcankdyAIf4Q3CHlyXIJeH+vp50NXrIjiSULoqXJGCex5cINu6Cm0CnNBHLEGJzXaSNAqyPUoECqBSJGDD10MKORAoThRQQNQOtDBRxap8kknkYmkihMOQOllAxbI1VAphdhBxx+eiBTIk196qUKaDDEixxtzAmIddolkwUMPWyiS0xRtfinBHgyh0gedc9LBo0CdFKEAAJAGsIARae4QqJcOfLZQKn8g+oYdTbXyiQuQlhppDJ/8cGmUaTQkCR1v0JaJSCoCVSGAqaYKgIUXq4JZSEOqRPJHH4zY18olFuCKawZ/fLAqDhRVlMopyN1BgLKmFpBHGxYEKoIivI2Bba6fyZGCBA44UAEOiwi3RgDjQirAGgJ5sgcZaBQSLW+IHBAvAAggIqQpK/zLwr41/sHAuA34saRAbDyAawAQsPHwQIjsYIECCljAwyEX/2gJIYRYEqRIAQEAIfkECQoArQAsAwADACsALAAACP8AWwkcSLBgwVKkVBlcyLAhQ1R+uGR548mhxYsE+zRRooSJGVQYQzIsxaUjEyVQKIlcSXDUFpMoIbFkyGrUJ5AFVcE5ybHLp4WmTIlEJajMGDiZDHpCE8VJF5kFScWZMiUOKYyGvnTZyubqwUmPfuZUg6MsDjUKHap6s3UrmEgrNRkxi4OIJouo4LTt8nYlpSB0g6i0mLWtG1ErR2Ghi2XURVODzIyRc2lmoyc5cjxpFFJVqE5CZ7bqNGhQJ9GoU6tezbo16lNpCar61OmU64GVxhhpEgfUwFKF6tD5U9E1pB0oTpxIIcV3q0Vy3kQHhHN1KinKUSRPAacVqj7So9P/4dT6kowT2rWfaKLq1J/wb+oUX10pBvr0J5TYjkTnjXRE1alGihH3bUeGQKhE8kcfjDjm2h8tKKccD5UQFFRsraXyhxEy0CAFVLc1RAolmNi2kCqIZMEDD1kggmGIAnUyhAIA1AiAAkOcxhIqqVz0iQs2BgnAC3F0ZogVPQyhBnkNUSGkkE9glIoZJGhgJQc1gFgQJhY8GSQGGO0RgpVkasADYgbZUYCXNhJghmwGnQJEmWR+0MdCYwTAZo0BjNHKKYFIcUMPXIDICQt0kunFQmvouWcAa4DiBAUNVMoAB2i1cmiiVoKx0CEI7AkAAog8wUClqDZQQXenBMEpCH8sjlQKC6KyYEoFqaaawml9iJBoD2ga5EcDbDbgxxS5phqBHq2kgoYJZHpwg5YGsQGBo3xCwEYrOySbqhgCqWLIFUEYsQaTDhnCgwUKKGABD4YIBIS3qKaR04tqVVJaJbF14QC9FRQC40Af0HtDKQML1IYFyYqgSMIDyZGCBA44UMENi0BMkCd7kGEGIQ6yFBAAIfkECQoArQAsAAADAC0AKwAACP8AWwkcSLCgQYGqUh1cyLDhQVSI3rxBZMqhxYsCWQ360qXLl0GqMIpcOMpMx45mRI1cSfDTmJNdxnhi2TBVRYOo4sCMg8ogq1GkVqqK9KfPoqAFM7UBA6ZNJoOf4Gjp4ufmRUl0JMoxpLAgKUmSkBI8hYaJEiVP/GBM9eeNHDlv7HwaWSmKEiZmu4htiKqP27d0OI2M9OSu2SyjLrJiBFfin1MjRXU5exfOKoylDtmhA2jmykhdoERBM1ekqk+detIUFamSapqwRZo6tGbMHUuxV/5ZcUBAgAIXqpTO7ZANAwDIkwuAIZg4Q0QPkksHEMBISOelKmm6vmrH9OkLEjn/d3QlyJE1iStV+C49QBbinp7gmK9DTqtBCdhL70GckI7581FRCn76Jcdfbv4BiAMVpqhXIHVawCcfffap4l2B4Y1XnhFrlCIQdPpVdxl2lWwyokDGfSdADJ45x9Buvf2WARbDuciQKYisQQYef3gBxA5TBNKVjQy58UEDSDZgARSgrJQdJq85JIcFSSbpABSQXbTKH0XEMMMUj1jkSQpVVllBIBgB0sIJbJ7AQyUO8SFBmVVKcVEpRZyQwp56juFQGXRWqcOJqXDCSZYDVQKDnnumcEISiB6EhgOBIukDQnwEwQILQfAxZCYyMMqnE9ctVEgFlTrQRSurnCHCBrBujCDCGdelIgWbfKoQh0Ol3FBpB5G0gkgJscZaAiIDRcKDoyeoMIVKDjEiAp0WrCEQFsUWewVBlpCBlhzQWrTIDag2IIEKclymChDZxgrEkAKlUipGphSSRhl8tLiKEe3CasSJRBK0RgftdmBtwAZ1YkO7NnSC8EGR9PABrB/0EOzDB4niBxhh/JHYSgEBACH5BAkKAK0ALAAAAwAtACsAAAj/AFsJHEiwoEGBp1AdXMiw4UFUkf70WVTKoUWCpQ6tGWMHk8FIdN68kVNI1UWLflggCBCggAUqnwaa+jNSzps6MU8yZNMAgM+fAFx0EmiqT005dIbqPGgIAtCnQ0yqYmRT5J9TD01aVMUjwFOgChAJHIWoDh1AngyaMgTnjSGFDStZ+Po0y0BUnjjBJahq0JcuXb4IYtVwkAK6QHlcDGUGMOAyowofRuxTscVOYxx3GZNzoVzKPu1aNCVHM5y9B7l6RRz25CU3YMCwyWSxKeWoOkVFikTqJE+6L5QuHZ5yZQACGJ7EGb60C5AdU0wh2miG+dI2Hxw02F7hCSjrS+VY/9hOvgEDJ1jBF1Q1quJATynKl6cQSD1BT3C2cOkDd48E+eVJYZ9ApaDBhBJKNOGHQGRoB+B2N2il3iRRKMHEgVxUZIaDD/YwYCuPOGHhgVn0RkgFD5rHxYefdIGghW+YNMoNKXIAyYetQNIFFFCYkZZAi4gAYAVq4CjQJ5BQglorityAYgMRpACHhEYuVEohaYihh3BV6nQKJ5yk1yVDqfQRBAssALFHKmOmhoYIGsSpQQhmUHnRKJRoYidDhpggp5wkGLJUI1gEYYQavVl0xZ9/WqFTJ0/gICkOyzmkShCMytnDkgwNksOkOERnqRGZxjkEmwORUsklqBLkKaiiOoi0hgeZclCkQKn8YUQMMkhxI0GQglqpQ5zckGkNnAz0RwsnNHvCDpUURGgQRCB6EiQ9gBDnBzz82gopRpyAwrjijmEQnnouJcofYHjRhygEUSKDuOOicIIRYrYpECY00EtuE3uOeYoUzZKbwrD6DgQJDyk0m4IU3yVcUCVkJAhHxBIbdErAFwUEADs=) 50% 50% no-repeat}.mejs-container .mejs-controls{position:absolute;list-style-type:none;margin:0;padding:0;bottom:0;left:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEhJREFUeNrszzERACAMALEH/25qEBcMvcRBTjUtcFtCRERERERERERERERERERERERERERERERERERERERERERERERE5I8nwABEjQEXuO95jAAAAABJRU5ErkJggg==);background:rgba(0,0,0,0.7);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(50,50,50,0.7)), to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));background:-moz-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));background:-o-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));background:-ms-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7));height:30px;width:100%}.mejs-container .mejs-controls div{list-style-type:none;background-image:none;display:block;float:left;margin:0;padding:0;width:26px;height:26px;font-size:11px;line-height:11px;font-family:Helvetica, Arial;border:0}.mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9ImNvbnRyb2xzLmZ3LVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgMTQ0IDMyIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE0NHB4IiBoZWlnaHQ9IjMycHgiDT4NCTxkZWZzPg0JCTxyYWRpYWxHcmFkaWVudCBpZD0iZ3JhZGllbnQxIiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMCUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2YyZjJmMiIgc3RvcC1vcGFjaXR5PSIwLjIiIG9mZnNldD0iMTAwJSIvPg0JCTwvcmFkaWFsR3JhZGllbnQ+DQkJPGxpbmVhckdyYWRpZW50IGlkPSJncmFkaWVudDIiIHgxPSI1MCUiIHkxPSItNy44NjUyJSIgeDI9IjUwJSIgeTI9IjI0OS42NjI5JSI+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYzhjOGM4IiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMTAwJSIvPg0JCTwvbGluZWFyR3JhZGllbnQ+DQkJPGxpbmVhckdyYWRpZW50IGlkPSJncmFkaWVudDMiIHgxPSI1MCUiIHkxPSIwJSIgeDI9IjUwJSIgeTI9IjIzOC43NSUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMCUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2M4YzhjOCIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L2xpbmVhckdyYWRpZW50Pg0JCTxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQ0IiB4MT0iNTAlIiB5MT0iMCUiIHgyPSI1MCUiIHkyPSIxMDAlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNjOGM4YzgiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIxMDAlIi8+DQkJPC9saW5lYXJHcmFkaWVudD4NCQk8bGluZWFyR3JhZGllbnQgaWQ9ImdyYWRpZW50NSIgeDE9IjUwJSIgeTE9Ii0zMy4zMzMzJSIgeDI9IjUwJSIgeTI9IjE1Mi4wODMzJSI+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYzhjOGM4IiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMTAwJSIvPg0JCTwvbGluZWFyR3JhZGllbnQ+DQkJPGxpbmVhckdyYWRpZW50IGlkPSJncmFkaWVudDYiIHgxPSI1MCUiIHkxPSIwJSIgeDI9IjUwJSIgeTI9IjEwMCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMCUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2M4YzhjOCIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L2xpbmVhckdyYWRpZW50Pg0JCTxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQ3IiB4MT0iNTAlIiB5MT0iLTMzLjMzMzMlIiB4Mj0iNTAlIiB5Mj0iMTUyLjA4MzMlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNjOGM4YzgiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIxMDAlIi8+DQkJPC9saW5lYXJHcmFkaWVudD4NCQk8bGluZWFyR3JhZGllbnQgaWQ9ImdyYWRpZW50OCIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYzhjOGM4IiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMTAwJSIvPg0JCTwvbGluZWFyR3JhZGllbnQ+DQkJPGxpbmVhckdyYWRpZW50IGlkPSJncmFkaWVudDkiIHgxPSI1MCUiIHkxPSIwJSIgeDI9IjUwJSIgeTI9IjEwMCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMCUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2M4YzhjOCIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L2xpbmVhckdyYWRpZW50Pg0JCTxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQxMCIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYzhjOGM4IiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMTAwJSIvPg0JCTwvbGluZWFyR3JhZGllbnQ+DQkJPGxpbmVhckdyYWRpZW50IGlkPSJncmFkaWVudDExIiB4MT0iNTAlIiB5MT0iMCUiIHgyPSI1MCUiIHkyPSIxMDAlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNjOGM4YzgiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIxMDAlIi8+DQkJPC9saW5lYXJHcmFkaWVudD4NCQk8bGluZWFyR3JhZGllbnQgaWQ9ImdyYWRpZW50MTIiIHgxPSI1MCUiIHkxPSIwJSIgeDI9IjUwJSIgeTI9IjIzOC43NSUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMCUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2M4YzhjOCIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L2xpbmVhckdyYWRpZW50Pg0JCTxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQxMyIgeDE9IjQwJSIgeTE9Ii0xNDAlIiB4Mj0iNDAlIiB5Mj0iOTguNzUlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNjOGM4YzgiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIxMDAlIi8+DQkJPC9saW5lYXJHcmFkaWVudD4NCQk8bGluZWFyR3JhZGllbnQgaWQ9ImdyYWRpZW50MTQiIHgxPSI1MCUiIHkxPSIwJSIgeDI9IjUwJSIgeTI9IjIzOC43NSUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMCUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2M4YzhjOCIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L2xpbmVhckdyYWRpZW50Pg0JCTxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQxNSIgeDE9IjYwJSIgeTE9Ii0xNDAlIiB4Mj0iNjAlIiB5Mj0iOTguNzUlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNjOGM4YzgiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIxMDAlIi8+DQkJPC9saW5lYXJHcmFkaWVudD4NCQk8bGluZWFyR3JhZGllbnQgaWQ9ImdyYWRpZW50MTYiIHgxPSI1MCUiIHkxPSIwJSIgeDI9IjUwJSIgeTI9IjI5OC40Mzc1JSI+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYzhjOGM4IiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMTAwJSIvPg0JCTwvbGluZWFyR3JhZGllbnQ+DQkJPGxpbmVhckdyYWRpZW50IGlkPSJncmFkaWVudDE3IiB4MT0iNTAlIiB5MT0iMCUiIHgyPSI1MCUiIHkyPSIyMzguNzUlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNjOGM4YzgiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIxMDAlIi8+DQkJPC9saW5lYXJHcmFkaWVudD4NCQk8bGluZWFyR3JhZGllbnQgaWQ9ImdyYWRpZW50MTgiIHgxPSI1MCUiIHkxPSItMjAwJSIgeDI9IjUwJSIgeTI9IjEwMCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMCUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2M4YzhjOCIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L2xpbmVhckdyYWRpZW50Pg0JCTxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQxOSIgeDE9IjUwJSIgeTE9Ii0yMDAlIiB4Mj0iNTAlIiB5Mj0iMTEwLjkzNzUlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNjOGM4YzgiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIxMDAlIi8+DQkJPC9saW5lYXJHcmFkaWVudD4NCQk8bGluZWFyR3JhZGllbnQgaWQ9ImdyYWRpZW50MjAiIHgxPSI1NSUiIHkxPSIwJSIgeDI9IjU1JSIgeTI9IjEwMCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iMCUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2M4YzhjOCIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L2xpbmVhckdyYWRpZW50Pg0JCTxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQyMSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSIwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYzhjOGM4IiBzdG9wLW9wYWNpdHk9IjEiIG9mZnNldD0iOTkuNDQ0NCUiLz4NCQk8L2xpbmVhckdyYWRpZW50Pg0JPC9kZWZzPg0JPGcgaWQ9IkJHIj4NCTwvZz4NCTxnIGlkPSJjb250cm9scyI+DQkJPHBhdGggaWQ9IkxpbmUiIGQ9Ik0gOTguNSA3LjUgTCAxMDkuNSA3LjUgIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIvPg0JCTxwYXRoIGlkPSJMaW5lMiIgZD0iTSA5OC41IDMuNSBMIDEwOS41IDMuNSAiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIi8+DQkJPHBhdGggaWQ9IkxpbmUzIiBkPSJNIDk4LjUgMTEuNSBMIDEwOS41IDExLjUgIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlIiBkPSJNIDEwOCAxMS41IEMgMTA4IDEwLjY3MTYgMTA4LjQ0NzcgMTAgMTA5IDEwIEMgMTA5LjU1MjMgMTAgMTEwIDEwLjY3MTYgMTEwIDExLjUgQyAxMTAgMTIuMzI4NCAxMDkuNTUyMyAxMyAxMDkgMTMgQyAxMDguNDQ3NyAxMyAxMDggMTIuMzI4NCAxMDggMTEuNSBaIiBmaWxsPSIjZmZmZmZmIi8+DQkJPHBhdGggaWQ9IkVsbGlwc2UyIiBkPSJNIDEwNCA3LjUgQyAxMDQgNi42NzE2IDEwNC40NDc3IDYgMTA1IDYgQyAxMDUuNTUyMyA2IDEwNiA2LjY3MTYgMTA2IDcuNSBDIDEwNiA4LjMyODQgMTA1LjU1MjMgOSAxMDUgOSBDIDEwNC40NDc3IDkgMTA0IDguMzI4NCAxMDQgNy41IFoiIGZpbGw9IiNmZmZmZmYiLz4NCQk8cGF0aCBpZD0iRWxsaXBzZTMiIGQ9Ik0gMTA4IDMuNSBDIDEwOCAyLjY3MTYgMTA4LjQ0NzcgMiAxMDkgMiBDIDEwOS41NTIzIDIgMTEwIDIuNjcxNiAxMTAgMy41IEMgMTEwIDQuMzI4NCAxMDkuNTUyMyA1IDEwOSA1IEMgMTA4LjQ0NzcgNSAxMDggNC4zMjg0IDEwOCAzLjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JPC9nPg0JPGcgaWQ9ImJhY2tsaWdodCI+DQkJPGcgaWQ9Im9mZiI+DQkJCTxyZWN0IHg9IjgzIiB5PSIyMSIgd2lkdGg9IjEwIiBoZWlnaHQ9IjYiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSIjMzMzMzMzIi8+DQkJPC9nPg0JCTxnIGlkPSJvbiI+DQkJCTxwYXRoIGlkPSJFbGxpcHNlNCIgZD0iTSA4MSA4IEMgODEgNS4yMzg1IDg0LjEzNCAzIDg4IDMgQyA5MS44NjYgMyA5NSA1LjIzODUgOTUgOCBDIDk1IDEwLjc2MTUgOTEuODY2IDEzIDg4IDEzIEMgODQuMTM0IDEzIDgxIDEwLjc2MTUgODEgOCBaIiBmaWxsPSJ1cmwoI2dyYWRpZW50MSkiLz4NCQkJPHJlY3QgeD0iODMiIHk9IjUiIHdpZHRoPSIxMCIgaGVpZ2h0PSI2IiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0iIzMzMzMzMyIvPg0JCTwvZz4NCTwvZz4NCTxnIGlkPSJsb29wIj4NCQk8ZyBpZD0ib24yIj4NCQkJPHBhdGggZD0iTSA3My43OTUgNC4yMDUgQyA3NS4yMTU1IDQuODc4NSA3Ni4yIDYuMzIzNCA3Ni4yIDggQyA3Ni4yIDEwLjMxOTYgNzQuMzE5NiAxMi4yIDcyIDEyLjIgQyA2OS42ODA0IDEyLjIgNjcuOCAxMC4zMTk2IDY3LjggOCBDIDY3LjggNi4zMjM0IDY4Ljc4NDUgNC44Nzg1IDcwLjIwNSA0LjIwNSBMIDY4Ljg3NSAyLjg3NSBDIDY3LjE1MDEgMy45Mjg5IDY2IDUuODMwNiA2NiA4IEMgNjYgMTEuMzEzOCA2OC42ODYyIDE0IDcyIDE0IEMgNzUuMzEzOCAxNCA3OCAxMS4zMTM4IDc4IDggQyA3OCA1LjgzMDYgNzYuODQ5OSAzLjkyODkgNzUuMTI1IDIuODc1IEwgNzMuNzk1IDQuMjA1IFoiIGZpbGw9InVybCgjZ3JhZGllbnQyKSIvPg0JCQk8cGF0aCBkPSJNIDcxIDIgTCA2NiAyIEwgNzEgNyBMIDcxIDIgWiIgZmlsbD0idXJsKCNncmFkaWVudDMpIi8+DQkJPC9nPg0JCTxnIGlkPSJvZmYyIj4NCQkJPHBhdGggZD0iTSA3My43OTUgMjAuMjA1IEMgNzUuMjE1NSAyMC44Nzg1IDc2LjIgMjIuMzIzNCA3Ni4yIDI0IEMgNzYuMiAyNi4zMTk2IDc0LjMxOTYgMjguMiA3MiAyOC4yIEMgNjkuNjgwNCAyOC4yIDY3LjggMjYuMzE5NiA2Ny44IDI0IEMgNjcuOCAyMi4zMjM0IDY4Ljc4NDUgMjAuODc4NSA3MC4yMDUgMjAuMjA1IEwgNjguODc1IDE4Ljg3NSBDIDY3LjE1MDEgMTkuOTI4OSA2NiAyMS44MzA2IDY2IDI0IEMgNjYgMjcuMzEzOCA2OC42ODYyIDMwIDcyIDMwIEMgNzUuMzEzOCAzMCA3OCAyNy4zMTM4IDc4IDI0IEMgNzggMjEuODMwNiA3Ni44NDk5IDE5LjkyODkgNzUuMTI1IDE4Ljg3NSBMIDczLjc5NSAyMC4yMDUgWiIgZmlsbD0iI2E4YThiNyIvPg0JCQk8cGF0aCBkPSJNIDcxIDE4IEwgNjYgMTggTCA3MSAyMyBMIDcxIDE4IFoiIGZpbGw9IiNhOGE4YjciLz4NCQk8L2c+DQk8L2c+DQk8ZyBpZD0iY2MiPg0JCTxyZWN0IHZpc2liaWxpdHk9ImhpZGRlbiIgeD0iNDkiIHk9IjIiIHdpZHRoPSIxNCIgaGVpZ2h0PSIxMiIgc3Ryb2tlPSIjYjBiMGIwIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiLz4NCQk8dGV4dCB2aXNpYmlsaXR5PSJoaWRkZW4iIHg9IjQ5IiB5PSIxNyIgd2lkdGg9IjE0IiBmaWxsPSIjZmZmZmZmIiBzdHlsZT0iZm9udC1zaXplOiAxMHB4OyBjb2xvcjogI2ZmZmZmZjsgZm9udC1mYW1pbHk6IEFyaWFsOyB0ZXh0LWFsaWduOiBjZW50ZXI7ICI+PHRzcGFuPjwhW0NEQVRBW2NjXV0+PC90c3Bhbj48L3RleHQ+DQkJPHBhdGggZD0iTSA1NSA3IEMgNTAuMjgxMyAzLjc4MTMgNTAuMDYzIDEyLjk0MDUgNTUgMTAgIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIvPg0JCTxwYXRoIGQ9Ik0gNjAgNyBDIDU1LjI4MTMgMy43ODEzIDU1LjA2MyAxMi45NDA1IDYwIDEwICIgc3Ryb2tlPSIjZmZmZmZmIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiLz4NCQk8cGF0aCBkPSJNIDUwIDMgTCA2MiAzIEwgNjIgMTMgTCA1MCAxMyBMIDUwIDMgWk0gNDkgMiBMIDQ5IDE0IEwgNjMgMTQgTCA2MyAyIEwgNDkgMiBaIiBmaWxsPSJ1cmwoI2dyYWRpZW50NCkiLz4NCQk8cmVjdCB4PSI0OSIgeT0iMiIgd2lkdGg9IjE0IiBoZWlnaHQ9IjEyIiBmaWxsPSJub25lIi8+DQk8L2c+DQk8ZyBpZD0idm9sdW1lIj4NCQk8ZyBpZD0ibm8lMjBzb3VuZCI+DQkJCTxyZWN0IHg9IjE3IiB5PSI1IiB3aWR0aD0iNSIgaGVpZ2h0PSI2IiBmaWxsPSJ1cmwoI2dyYWRpZW50NSkiLz4NCQkJPHBhdGggZD0iTSAyMSA1IEwgMjUgMiBMIDI1IDE0IEwgMjEgMTEuMDYyNSBMIDIxIDUgWiIgZmlsbD0idXJsKCNncmFkaWVudDYpIi8+DQkJPC9nPg0JCTxnIGlkPSJzb3VuZCUyMGJhcnMiPg0JCQk8cmVjdCB4PSIxNyIgeT0iMjEiIHdpZHRoPSI1IiBoZWlnaHQ9IjYiIGZpbGw9InVybCgjZ3JhZGllbnQ3KSIvPg0JCQk8cGF0aCBkPSJNIDIxIDIxIEwgMjUgMTggTCAyNSAzMCBMIDIxIDI3LjA2MjUgTCAyMSAyMSBaIiBmaWxsPSJ1cmwoI2dyYWRpZW50OCkiLz4NCQkJPHBhdGggZD0iTSAyNyAxOCBDIDI3IDE4IDMwLjA2MjUgMTcuMzc1IDMwIDI0IEMgMjkuOTM3NSAzMC42MjUgMjcgMzAgMjcgMzAgIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIvPg0JCQk8cGF0aCBkPSJNIDI2IDIxLjAwNzkgQyAyNiAyMS4wMDc5IDI4LjA0MSAyMC42OTYyIDI3Ljk5OTQgMjQgQyAyNy45NTc3IDI3LjMwMzggMjYgMjYuOTkyMSAyNiAyNi45OTIxICIgc3Ryb2tlPSIjZmZmZmZmIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiLz4NCQk8L2c+DQk8L2c+DQk8ZyBpZD0icGxheS9wYXVzZSI+DQkJPGcgaWQ9InBsYXkiPg0JCQk8cGF0aCBpZD0iUG9seWdvbiIgZD0iTSAxNCA4LjUgTCAzIDE0IEwgMyAzIEwgMTQgOC41IFoiIGZpbGw9InVybCgjZ3JhZGllbnQ5KSIvPg0JCTwvZz4NCQk8ZyBpZD0icGF1c2UiPg0JCQk8cmVjdCB4PSIzIiB5PSIxOCIgd2lkdGg9IjMiIGhlaWdodD0iMTIiIGZpbGw9InVybCgjZ3JhZGllbnQxMCkiLz4NCQkJPHJlY3QgeD0iMTAiIHk9IjE4IiB3aWR0aD0iMyIgaGVpZ2h0PSIxMiIgZmlsbD0idXJsKCNncmFkaWVudDExKSIvPg0JCTwvZz4NCTwvZz4NCTxnIGlkPSJmdWxsc2NyZWVuIj4NCQk8ZyBpZD0iZW50ZXIlMjAxIj4NCQkJPHBhdGggZD0iTSAzNCAyIEwgMzkgMiBMIDM0IDcgTCAzNCAyIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxMikiLz4NCQkJPHBhdGggZD0iTSAzNCAxNCBMIDM5IDE0IEwgMzQgOSBMIDM0IDE0IFoiIGZpbGw9InVybCgjZ3JhZGllbnQxMykiLz4NCQkJPHBhdGggZD0iTSA0NiAyIEwgNDEgMiBMIDQ2IDcgTCA0NiAyIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxNCkiLz4NCQkJPHBhdGggZD0iTSA0NiAxNCBMIDQxIDE0IEwgNDYgOSBMIDQ2IDE0IFoiIGZpbGw9InVybCgjZ3JhZGllbnQxNSkiLz4NCQk8L2c+DQkJPGcgaWQ9ImV4aXQiPg0JCQk8cGF0aCBkPSJNIDQyIDIyIEwgNDYgMjIgTCA0MiAxOCBMIDQyIDIyIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxNikiLz4NCQkJPHBhdGggZD0iTSAzOCAyMiBMIDM4IDE4IEwgMzQgMjIgTCAzOCAyMiBaIiBmaWxsPSJ1cmwoI2dyYWRpZW50MTcpIi8+DQkJCTxwYXRoIGQ9Ik0gMzggMjYgTCAzNCAyNiBMIDM4IDMwIEwgMzggMjYgWiIgZmlsbD0idXJsKCNncmFkaWVudDE4KSIvPg0JCQk8cGF0aCBkPSJNIDQyIDI2IEwgNDIgMzAgTCA0NiAyNiBMIDQyIDI2IFoiIGZpbGw9InVybCgjZ3JhZGllbnQxOSkiLz4NCQk8L2c+DQk8L2c+DQk8ZyBpZD0ic3RvcCI+DQkJPHJlY3QgeD0iMTE1IiB5PSIzIiB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIGZpbGw9InVybCgjZ3JhZGllbnQyMCkiLz4NCTwvZz4NCTxnIGlkPSJjaG9vc2VyIj4NCQk8cGF0aCBkPSJNIDEzNS4yMzQ2IDYuMTUyMiBDIDEzNi4yNTUxIDUuNzI5NSAxMzcuNDI1MSA2LjIxNDEgMTM3Ljg0NzggNy4yMzQ2IEMgMTM4LjI3MDQgOC4yNTUxIDEzNy43ODU5IDkuNDI1IDEzNi43NjU0IDkuODQ3OCBDIDEzNS43NDQ5IDEwLjI3MDUgMTM0LjU3NDkgOS43ODU5IDEzNC4xNTIyIDguNzY1NCBDIDEzMy43Mjk1IDcuNzQ0OSAxMzQuMjE0MSA2LjU3NDkgMTM1LjIzNDYgNi4xNTIyIFpNIDEzMy4yNzM1IDEuNDE3NiBMIDEzNiA0LjAwNTQgTCAxMzguNzI2NSAxLjQxNzYgTCAxMzguODI0NiA1LjE3NTQgTCAxNDIuNTgyNCA1LjI3MzUgTCAxMzkuOTk0NiA4IEwgMTQyLjU4MjQgMTAuNzI2NSBMIDEzOC44MjQ2IDEwLjgyNDYgTCAxMzguNzI2NSAxNC41ODI0IEwgMTM2IDExLjk5NDYgTCAxMzMuMjczNSAxNC41ODI0IEwgMTMzLjE3NTQgMTAuODI0NiBMIDEyOS40MTc2IDEwLjcyNjUgTCAxMzIuMDA1NCA4IEwgMTI5LjQxNzYgNS4yNzM1IEwgMTMzLjE3NTQgNS4xNzU0IEwgMTMzLjI3MzUgMS40MTc2IFoiIGZpbGw9InVybCgjZ3JhZGllbnQyMSkiLz4NCTwvZz4NPC9zdmc+) no-repeat}.no-svg .mejs-controls .mejs-button button{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAAAgCAMAAADKUgH/AAAAA3NCSVQICAjb4U/gAAAB+1BMVEX////+/v77+/v6+vr5+fn4+Pj39/f29vb19fX09PTy8vLx8fHw8PDv7+/u7u7t7e3s7Ozr6+vq6urp6eno6Ojm5ubk5OTj4+Pi4uLh4eHg4ODf39/e3t7c3Nzb29va2trZ2dnX19fW1tbT09PS0tLR0dHQ0NDOzs7Nzc3Ly8vGxsbFxcXExMTDw8PCwsLBwcHAwMC/v7+9vb24uLi3t7e2tra0tLSysrKvr6+urq6tra2srKyrq6uoqLenp6elpaWkpKSioqKgoKCenqyfn5+dnZ2cnJybm5uampqZmZmXl5eVlZWUlJSUlKGTk5OSkpKPj4+Ojo6MjIyLi4uKioqJiYmJiZWHh4eGhoaEhISDg4OCgoKBgYGAgIB5eXl4eHh3d3d1dYBycnJwcHBubm5tbXdpaXNpaWlnZ2dkZGRjY2NgYGBfX19eXl5dXV1cXFxaWlpYWFhWVlZVVVVTU1NSUlJRUVFPT09OTk5NTU1MTExLS0tKSkpJSUlHR0dGRkZERERDQ0NCQkJAQEA/Pz8+Pj47Ozs5OTk3Nzc2NjY1NTU1NTkzMzMyMjIxMTEwMDAsLCwrKysqKioqKi4pKSkoKCgnJychISEgICAgICIfHx8eHh4dHR0cHBwaGhoZGRkYGBgVFRcVFRUSEhIREREQEBAPDw8LCwsAAAD8LSgfAAAAqXRSTlP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8A+297FgAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMS8xMy8xMqzAOnkAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAEAUlEQVRYhdVWCVsTVxQNJpqqGKONRCMRk0jjVrDuW1RIiIoo1SpIClq1JihGcUFZVNSAG264Aq5Ug/dn+u57d+5MwuQrtfMVer4v797z3p07J2+2Y4MpBttkC5Bo46GgoKGfOLUJVANUYySqA/QFGPq78/p8BRZcMYCYiwX52sZVdM6zc26322sw1ogEqbFOks1qIeZ6SrNv7qRbU61dL/U/ZNBvnNDaOBzxuMPBgux2fzpXz29Op5OJ07lHJXvkpNNYiGTEPR0XRvzT3CM4N9Z/KXUs0Zg4lrr6V25b2iE7Q1uYKcGCfhAIXNAWkc0W4Daza7WsFifF7/NboAEn4o4VNRizKxxxrLpnKyLYroIZZjKQtS8sZixsl4IUCbWrcsznCvDx+yAnnQtta9Ztz8gBsMozo1/V9M/wiHHwVtEjQlH6bv7uIOYwJK1zu92V169XilCndmgeIXwRiHkETP8cnh8CnyBzG4cMYJV+dWX2tEcX1NoDJvfQjwx1WL3HcwPghsdTD0rQAsZWYiUChQSVvA+LUQ6CyCugXwsU1KkLSnWa7VAJQ/GDXu9NgJte70EStIiw8jIQWyzAxx+CnHQxBB5kO57LAbCqZFa3Wu2ehWcYNO7QHbO/VMpQTcXJNvT2bhDhkBLkl6i8osoxLxPg48uOaNkRnCyD3m3rqx7IAXCitnj1GK6OrS6Wt/8t/aZOf8lRQru0lIGsI7yEEe6QggICa3MeiKPBYJBJMHiUZ5EaC5G89bkqxL3SU+Hy4YMHn7tSLfWxXbH6lrMfkI+7h0IMrU1AQqZYsmzZumt5u3ptVTnn5eXlCYwJkSA11knyrNQtUfqMZgcv4Xvo7MO8ptoOhRnaQijU1ETyUNDGrvwjAV7v4HS5QDNAM0aiOmTFuwP++fP9B96NbzNBVGD/ChY0+ejmYYoIMuD/JKgv/eq/08EghwN6UBB+KNO8RXtsqnkwQTIigMmoVYLIBxjsAPmh1i2KxaVVUa7IBCeUoGR02CJBZH4MHgj9UN/FIfBKtld9rdgX5WE0KgWN7o9ELdgjFETmh4LmhzKNO7Mb8f29z+Vy0XqtWYtkpOE07tDXhkhS9eRPx3cKIvNDQfdDVbd/PTWBFtHIC5BKXkSickL/uH6nIDI/FHQ/1HLuj+MTaKHuaEP2rwWRMaGg+6Hfzx/+c1IEkfmhoPuhTY+rzkygRTQyoJIBqy4ZmR8Kmh/qi1fBLxlAF8QLh81aiJv6K0brbmoyPwYPhH7oSU8WirPEMAQCjaYtxGPfIPZooMGyx175HC1IKD90crdiCbkQairQYxhfRAKWvRjJ1mjuRgL90PGfNdbMgylGk0JSNGnZp6MQ7n+04gz/EFPOfnwDzhnRIkQEkOIAAAAASUVORK5CYII=)}.mejs-controls .mejs-button button:focus{outline:dotted 1px #999}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:10px 3px 0 3px;overflow:hidden;text-align:center;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.mejs-container .mejs-controls .mejs-time a{color:#fff;font-size:11px;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto}.mejs-controls .mejs-play button{background-position:0 0}.mejs-controls .mejs-pause button{background-position:0 -16px}.mejs-controls .mejs-stop button{background-position:-112px 0}.mejs-controls div.mejs-time-rail{direction:ltr;width:200px;padding-top:5px}.mejs-controls .mejs-time-rail span,.mejs-controls .mejs-time-rail a{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(30,30,30,0.8)), to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));background:-moz-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));background:-o-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));background:-ms-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8), rgba(60,60,60,0.8))}.mejs-controls .mejs-time-rail .mejs-time-buffering{width:100%;background-image:-o-linear-gradient(-45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:15px 15px;-moz-background-size:15px 15px;-o-background-size:15px 15px;background-size:15px 15px;-webkit-animation:buffering-stripes 2s linear infinite;-moz-animation:buffering-stripes 2s linear infinite;-ms-animation:buffering-stripes 2s linear infinite;-o-animation:buffering-stripes 2s linear infinite;animation:buffering-stripes 2s linear infinite}@-webkit-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@-moz-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@-ms-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@-o-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,0.8);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(44,124,145,0.8)), to(rgba(78,183,212,0.8)));background:-webkit-linear-gradient(top, rgba(44,124,145,0.8), rgba(78,183,212,0.8));background:-moz-linear-gradient(top, rgba(44,124,145,0.8), rgba(78,183,212,0.8));background:-o-linear-gradient(top, rgba(44,124,145,0.8), rgba(78,183,212,0.8));background:-ms-linear-gradient(top, rgba(44,124,145,0.8), rgba(78,183,212,0.8));background:linear-gradient(rgba(44,124,145,0.8), rgba(78,183,212,0.8));width:0}.mejs-controls .mejs-time-rail .mejs-time-current{background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,255,255,0.9)), to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));background:-moz-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));background:-o-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));background:-ms-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9), rgba(200,200,200,0.8));width:0}.mejs-controls .mejs-time-rail .mejs-time-handle{display:none;position:absolute;margin:0;width:10px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;border:solid 2px #333;top:-2px;text-align:center}.mejs-controls .mejs-time-rail .mejs-time-float{position:absolute;display:none;background:#eee;width:36px;height:17px;border:solid 1px #333;top:-26px;margin-left:-18px;text-align:center;color:#111}.mejs-controls .mejs-time-rail .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float{width:48px}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-current{width:44px}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-corner{left:18px}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px}.mejs-controls .mejs-mute button{background-position:-16px -16px}.mejs-controls .mejs-unmute button{background-position:-16px 0}.mejs-controls .mejs-volume-button{position:relative}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9ImJpZ3BsYXktZ3JhZGllbnQuZnctUGFnZSUyMDEiIHZpZXdCb3g9IjAgMCAxMDAgMjAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEwMHB4IiBoZWlnaHQ9IjIwMHB4Ig0+DQk8ZGVmcz4NCQk8cmFkaWFsR3JhZGllbnQgaWQ9ImdyYWRpZW50MSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNTAlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzIyMjIyMiIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjcwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjMjIyMjIyIiBzdG9wLW9wYWNpdHk9IjAuMDExOCIgb2Zmc2V0PSI3MC4yMDIlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiMzMzMzMzMiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSI4NSUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzMzMzMzMyIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L3JhZGlhbEdyYWRpZW50Pg0JCTxyYWRpYWxHcmFkaWVudCBpZD0iZ3JhZGllbnQyIiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iNzAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNiYmJiYmIiIHN0b3Atb3BhY2l0eT0iMC4wMTE4IiBvZmZzZXQ9IjcwLjIwMiUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2JiYmJiYiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9Ijg1JSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMTAwJSIvPg0JCTwvcmFkaWFsR3JhZGllbnQ+DQkJPGZpbHRlciBpZD0iZmlsdGVyMSIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgIDAgMCAwIDAgMCAgMCAwIDAgMCAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cxIi8+DQkJPC9maWx0ZXI+DQkJPGZpbHRlciBpZD0iZmlsdGVyMiIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwLjg2NjcgMCAgMCAwIDAgMC44NjY3IDAgIDAgMCAwIDAuODY2NyAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cyIi8+DQkJPC9maWx0ZXI+DQk8L2RlZnM+DQk8ZyBpZD0iQmFja2dyb3VuZCI+DQk8L2c+DQk8ZyBpZD0iZGFyayUyMHNoYWRvdyI+DQkJPHBhdGggZD0iTSAyMiA1MCBDIDIyIDM0LjUzNTggMzQuNTM1OCAyMiA1MCAyMiBDIDY1LjQ2NDIgMjIgNzggMzQuNTM1OCA3OCA1MCBDIDc4IDY1LjQ2NDIgNjUuNDY0MiA3OCA1MCA3OCBDIDM0LjUzNTggNzggMjIgNjUuNDY0MiAyMiA1MCBaTSA1IDUwIEMgNSA3NC44NTMxIDI1LjE0NjkgOTUgNTAgOTUgQyA3NC44NTMxIDk1IDk1IDc0Ljg1MzEgOTUgNTAgQyA5NSAyNS4xNDY5IDc0Ljg1MzEgNSA1MCA1IEMgMjUuMTQ2OSA1IDUgMjUuMTQ2OSA1IDUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxKSIvPg0JCTxwYXRoIGQ9Ik0gMjIgMTUwIEMgMjIgMTM0LjUzNTggMzQuNTM1OCAxMjIgNTAgMTIyIEMgNjUuNDY0MiAxMjIgNzggMTM0LjUzNTggNzggMTUwIEMgNzggMTY1LjQ2NDIgNjUuNDY0MiAxNzggNTAgMTc4IEMgMzQuNTM1OCAxNzggMjIgMTY1LjQ2NDIgMjIgMTUwIFpNIDUgMTUwIEMgNSAxNzQuODUzMSAyNS4xNDY5IDE5NSA1MCAxOTUgQyA3NC44NTMxIDE5NSA5NSAxNzQuODUzMSA5NSAxNTAgQyA5NSAxMjUuMTQ2OSA3NC44NTMxIDEwNSA1MCAxMDUgQyAyNS4xNDY5IDEwNSA1IDEyNS4xNDY5IDUgMTUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQyKSIvPg0JPC9nPg0JPGcgaWQ9ImRhcmsiPg0JCTxwYXRoIGlkPSJQb2x5Z29uIiBmaWx0ZXI9InVybCgjZmlsdGVyMSkiIGQ9Ik0gNzIuNSA0OS41IEwgMzguNzUgNjguOTg1NiBMIDM4Ljc1IDMwLjAxNDQgTCA3Mi41IDQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlIiBkPSJNIDEzIDUwLjUgQyAxMyAyOS43ODkxIDI5Ljc4OTEgMTMgNTAuNSAxMyBDIDcxLjIxMDkgMTMgODggMjkuNzg5MSA4OCA1MC41IEMgODggNzEuMjEwOSA3MS4yMTA5IDg4IDUwLjUgODggQyAyOS43ODkxIDg4IDEzIDcxLjIxMDkgMTMgNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg0JPGcgaWQ9ImxpZ2h0Ij4NCQk8cGF0aCBpZD0iUG9seWdvbjIiIGZpbHRlcj0idXJsKCNmaWx0ZXIyKSIgZD0iTSA3Mi41IDE0OS41IEwgMzguNzUgMTY4Ljk4NTYgTCAzOC43NSAxMzAuMDE0NCBMIDcyLjUgMTQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlMiIgZD0iTSAxMyAxNTAuNSBDIDEzIDEyOS43ODkxIDI5Ljc4OTEgMTEzIDUwLjUgMTEzIEMgNzEuMjEwOSAxMTMgODggMTI5Ljc4OTEgODggMTUwLjUgQyA4OCAxNzEuMjExIDcxLjIxMDkgMTg4IDUwLjUgMTg4IEMgMjkuNzg5MSAxODggMTMgMTcxLjIxMSAxMyAxNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg08L3N2Zz4=\") no-repeat;background:rgba(50,50,50,0.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.5);margin:0}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.9);margin:0}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,0.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0}.mejs-controls a.mejs-horizontal-volume-slider{height:26px;width:56px;position:relative;display:block;float:left;vertical-align:middle}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(30,30,30,0.8)), to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));background:-moz-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));background:-o-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));background:-ms-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8), rgba(60,60,60,0.8))}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,255,255,0.9)), to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));background:-moz-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));background:-o-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));background:-ms-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9), rgba(200,200,200,0.8))}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle{display:none}.mejs-controls .mejs-captions-button{position:relative}.mejs-controls .mejs-captions-button button{background-position:-48px 0}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-51px;width:85px;height:100px;background:url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9ImJpZ3BsYXktZ3JhZGllbnQuZnctUGFnZSUyMDEiIHZpZXdCb3g9IjAgMCAxMDAgMjAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEwMHB4IiBoZWlnaHQ9IjIwMHB4Ig0+DQk8ZGVmcz4NCQk8cmFkaWFsR3JhZGllbnQgaWQ9ImdyYWRpZW50MSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNTAlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzIyMjIyMiIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjcwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjMjIyMjIyIiBzdG9wLW9wYWNpdHk9IjAuMDExOCIgb2Zmc2V0PSI3MC4yMDIlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiMzMzMzMzMiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSI4NSUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzMzMzMzMyIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L3JhZGlhbEdyYWRpZW50Pg0JCTxyYWRpYWxHcmFkaWVudCBpZD0iZ3JhZGllbnQyIiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iNzAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNiYmJiYmIiIHN0b3Atb3BhY2l0eT0iMC4wMTE4IiBvZmZzZXQ9IjcwLjIwMiUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2JiYmJiYiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9Ijg1JSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMTAwJSIvPg0JCTwvcmFkaWFsR3JhZGllbnQ+DQkJPGZpbHRlciBpZD0iZmlsdGVyMSIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgIDAgMCAwIDAgMCAgMCAwIDAgMCAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cxIi8+DQkJPC9maWx0ZXI+DQkJPGZpbHRlciBpZD0iZmlsdGVyMiIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwLjg2NjcgMCAgMCAwIDAgMC44NjY3IDAgIDAgMCAwIDAuODY2NyAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cyIi8+DQkJPC9maWx0ZXI+DQk8L2RlZnM+DQk8ZyBpZD0iQmFja2dyb3VuZCI+DQk8L2c+DQk8ZyBpZD0iZGFyayUyMHNoYWRvdyI+DQkJPHBhdGggZD0iTSAyMiA1MCBDIDIyIDM0LjUzNTggMzQuNTM1OCAyMiA1MCAyMiBDIDY1LjQ2NDIgMjIgNzggMzQuNTM1OCA3OCA1MCBDIDc4IDY1LjQ2NDIgNjUuNDY0MiA3OCA1MCA3OCBDIDM0LjUzNTggNzggMjIgNjUuNDY0MiAyMiA1MCBaTSA1IDUwIEMgNSA3NC44NTMxIDI1LjE0NjkgOTUgNTAgOTUgQyA3NC44NTMxIDk1IDk1IDc0Ljg1MzEgOTUgNTAgQyA5NSAyNS4xNDY5IDc0Ljg1MzEgNSA1MCA1IEMgMjUuMTQ2OSA1IDUgMjUuMTQ2OSA1IDUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxKSIvPg0JCTxwYXRoIGQ9Ik0gMjIgMTUwIEMgMjIgMTM0LjUzNTggMzQuNTM1OCAxMjIgNTAgMTIyIEMgNjUuNDY0MiAxMjIgNzggMTM0LjUzNTggNzggMTUwIEMgNzggMTY1LjQ2NDIgNjUuNDY0MiAxNzggNTAgMTc4IEMgMzQuNTM1OCAxNzggMjIgMTY1LjQ2NDIgMjIgMTUwIFpNIDUgMTUwIEMgNSAxNzQuODUzMSAyNS4xNDY5IDE5NSA1MCAxOTUgQyA3NC44NTMxIDE5NSA5NSAxNzQuODUzMSA5NSAxNTAgQyA5NSAxMjUuMTQ2OSA3NC44NTMxIDEwNSA1MCAxMDUgQyAyNS4xNDY5IDEwNSA1IDEyNS4xNDY5IDUgMTUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQyKSIvPg0JPC9nPg0JPGcgaWQ9ImRhcmsiPg0JCTxwYXRoIGlkPSJQb2x5Z29uIiBmaWx0ZXI9InVybCgjZmlsdGVyMSkiIGQ9Ik0gNzIuNSA0OS41IEwgMzguNzUgNjguOTg1NiBMIDM4Ljc1IDMwLjAxNDQgTCA3Mi41IDQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlIiBkPSJNIDEzIDUwLjUgQyAxMyAyOS43ODkxIDI5Ljc4OTEgMTMgNTAuNSAxMyBDIDcxLjIxMDkgMTMgODggMjkuNzg5MSA4OCA1MC41IEMgODggNzEuMjEwOSA3MS4yMTA5IDg4IDUwLjUgODggQyAyOS43ODkxIDg4IDEzIDcxLjIxMDkgMTMgNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg0JPGcgaWQ9ImxpZ2h0Ij4NCQk8cGF0aCBpZD0iUG9seWdvbjIiIGZpbHRlcj0idXJsKCNmaWx0ZXIyKSIgZD0iTSA3Mi41IDE0OS41IEwgMzguNzUgMTY4Ljk4NTYgTCAzOC43NSAxMzAuMDE0NCBMIDcyLjUgMTQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlMiIgZD0iTSAxMyAxNTAuNSBDIDEzIDEyOS43ODkxIDI5Ljc4OTEgMTEzIDUwLjUgMTEzIEMgNzEuMjEwOSAxMTMgODggMTI5Ljc4OTEgODggMTUwLjUgQyA4OCAxNzEuMjExIDcxLjIxMDkgMTg4IDUwLjUgMTg4IEMgMjkuNzg5MSAxODggMTMgMTcxLjIxMSAxMyAxNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg08L3N2Zz4=\") no-repeat;background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px 10px 0 10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none !important;overflow:hidden}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none !important;display:block;color:#fff;overflow:hidden}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:55px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica, arial;font-size:10px}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px 0}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;z-index:1}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,0.7);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(50,50,50,0.7)), to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));background:-moz-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));background:-o-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));background:-ms-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#323232,endColorstr=#000000);overflow:hidden;border:0}.mejs-chapters .mejs-chapter .mejs-chapter-block{font-size:11px;color:#fff;padding:5px;display:block;border-right:solid 1px #333;border-bottom:solid 1px #333;cursor:pointer}.mejs-chapters .mejs-chapter .mejs-chapter-block-last{border-right:none}.mejs-chapters .mejs-chapter .mejs-chapter-block:hover{background:#666;background:rgba(102,102,102,0.7);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(102,102,102,0.7)), to(rgba(50,50,50,0.6)));background:-webkit-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6));background:-moz-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6));background:-o-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6));background:-ms-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6));background:linear-gradient(rgba(102,102,102,0.7), rgba(50,50,50,0.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#666666,endColorstr=#323232)}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:bold;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px 0;line-height:12px}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px 0;display:block;white-space:nowrap;text-overflow:ellipsis}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:20px;font-size:16px;color:#fff}.mejs-captions-layer a{color:#fff;text-decoration:underline}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:normal}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0}.mejs-captions-position-hover{bottom:35px}.mejs-captions-text{padding:3px 5px;background:url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9ImJpZ3BsYXktZ3JhZGllbnQuZnctUGFnZSUyMDEiIHZpZXdCb3g9IjAgMCAxMDAgMjAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEwMHB4IiBoZWlnaHQ9IjIwMHB4Ig0+DQk8ZGVmcz4NCQk8cmFkaWFsR3JhZGllbnQgaWQ9ImdyYWRpZW50MSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNTAlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzIyMjIyMiIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjcwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjMjIyMjIyIiBzdG9wLW9wYWNpdHk9IjAuMDExOCIgb2Zmc2V0PSI3MC4yMDIlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiMzMzMzMzMiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSI4NSUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzMzMzMzMyIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L3JhZGlhbEdyYWRpZW50Pg0JCTxyYWRpYWxHcmFkaWVudCBpZD0iZ3JhZGllbnQyIiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iNzAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNiYmJiYmIiIHN0b3Atb3BhY2l0eT0iMC4wMTE4IiBvZmZzZXQ9IjcwLjIwMiUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2JiYmJiYiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9Ijg1JSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMTAwJSIvPg0JCTwvcmFkaWFsR3JhZGllbnQ+DQkJPGZpbHRlciBpZD0iZmlsdGVyMSIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgIDAgMCAwIDAgMCAgMCAwIDAgMCAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cxIi8+DQkJPC9maWx0ZXI+DQkJPGZpbHRlciBpZD0iZmlsdGVyMiIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwLjg2NjcgMCAgMCAwIDAgMC44NjY3IDAgIDAgMCAwIDAuODY2NyAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cyIi8+DQkJPC9maWx0ZXI+DQk8L2RlZnM+DQk8ZyBpZD0iQmFja2dyb3VuZCI+DQk8L2c+DQk8ZyBpZD0iZGFyayUyMHNoYWRvdyI+DQkJPHBhdGggZD0iTSAyMiA1MCBDIDIyIDM0LjUzNTggMzQuNTM1OCAyMiA1MCAyMiBDIDY1LjQ2NDIgMjIgNzggMzQuNTM1OCA3OCA1MCBDIDc4IDY1LjQ2NDIgNjUuNDY0MiA3OCA1MCA3OCBDIDM0LjUzNTggNzggMjIgNjUuNDY0MiAyMiA1MCBaTSA1IDUwIEMgNSA3NC44NTMxIDI1LjE0NjkgOTUgNTAgOTUgQyA3NC44NTMxIDk1IDk1IDc0Ljg1MzEgOTUgNTAgQyA5NSAyNS4xNDY5IDc0Ljg1MzEgNSA1MCA1IEMgMjUuMTQ2OSA1IDUgMjUuMTQ2OSA1IDUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxKSIvPg0JCTxwYXRoIGQ9Ik0gMjIgMTUwIEMgMjIgMTM0LjUzNTggMzQuNTM1OCAxMjIgNTAgMTIyIEMgNjUuNDY0MiAxMjIgNzggMTM0LjUzNTggNzggMTUwIEMgNzggMTY1LjQ2NDIgNjUuNDY0MiAxNzggNTAgMTc4IEMgMzQuNTM1OCAxNzggMjIgMTY1LjQ2NDIgMjIgMTUwIFpNIDUgMTUwIEMgNSAxNzQuODUzMSAyNS4xNDY5IDE5NSA1MCAxOTUgQyA3NC44NTMxIDE5NSA5NSAxNzQuODUzMSA5NSAxNTAgQyA5NSAxMjUuMTQ2OSA3NC44NTMxIDEwNSA1MCAxMDUgQyAyNS4xNDY5IDEwNSA1IDEyNS4xNDY5IDUgMTUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQyKSIvPg0JPC9nPg0JPGcgaWQ9ImRhcmsiPg0JCTxwYXRoIGlkPSJQb2x5Z29uIiBmaWx0ZXI9InVybCgjZmlsdGVyMSkiIGQ9Ik0gNzIuNSA0OS41IEwgMzguNzUgNjguOTg1NiBMIDM4Ljc1IDMwLjAxNDQgTCA3Mi41IDQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlIiBkPSJNIDEzIDUwLjUgQyAxMyAyOS43ODkxIDI5Ljc4OTEgMTMgNTAuNSAxMyBDIDcxLjIxMDkgMTMgODggMjkuNzg5MSA4OCA1MC41IEMgODggNzEuMjEwOSA3MS4yMTA5IDg4IDUwLjUgODggQyAyOS43ODkxIDg4IDEzIDcxLjIxMDkgMTMgNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg0JPGcgaWQ9ImxpZ2h0Ij4NCQk8cGF0aCBpZD0iUG9seWdvbjIiIGZpbHRlcj0idXJsKCNmaWx0ZXIyKSIgZD0iTSA3Mi41IDE0OS41IEwgMzguNzUgMTY4Ljk4NTYgTCAzOC43NSAxMzAuMDE0NCBMIDcyLjUgMTQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlMiIgZD0iTSAxMyAxNTAuNSBDIDEzIDEyOS43ODkxIDI5Ljc4OTEgMTEzIDUwLjUgMTEzIEMgNzEuMjEwOSAxMTMgODggMTI5Ljc4OTEgODggMTUwLjUgQyA4OCAxNzEuMjExIDcxLjIxMDkgMTg4IDUwLjUgMTg4IEMgMjkuNzg5MSAxODggMTMgMTcxLjIxMSAxMyAxNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg08L3N2Zz4=\");background:rgba(20,20,20,0.5);white-space:pre-wrap}.me-cannotplay a{color:#fff;font-weight:bold}.me-cannotplay span{padding:15px;display:block}.mejs-controls .mejs-loop-off button{background-position:-64px -16px}.mejs-controls .mejs-loop-on button{background-position:-64px 0}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px}.mejs-controls .mejs-backlight-on button{background-position:-80px 0}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0}.mejs-contextmenu{position:absolute;width:150px;padding:10px;border-radius:4px;top:0;left:0;background:#fff;border:solid 1px #999;z-index:1001}.mejs-contextmenu .mejs-contextmenu-separator{height:1px;font-size:0;margin:5px 6px;background:#333}.mejs-contextmenu .mejs-contextmenu-item{font-family:Helvetica, Arial;font-size:12px;padding:4px 6px;cursor:pointer;color:#333}.mejs-contextmenu .mejs-contextmenu-item:hover{background:#2C7C91;color:#fff}.mejs-controls .mejs-sourcechooser-button{position:relative}.mejs-controls .mejs-sourcechooser-button button{background-position:-128px 0}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9ImJpZ3BsYXktZ3JhZGllbnQuZnctUGFnZSUyMDEiIHZpZXdCb3g9IjAgMCAxMDAgMjAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEwMHB4IiBoZWlnaHQ9IjIwMHB4Ig0+DQk8ZGVmcz4NCQk8cmFkaWFsR3JhZGllbnQgaWQ9ImdyYWRpZW50MSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNTAlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzIyMjIyMiIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjcwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjMjIyMjIyIiBzdG9wLW9wYWNpdHk9IjAuMDExOCIgb2Zmc2V0PSI3MC4yMDIlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiMzMzMzMzMiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSI4NSUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzMzMzMzMyIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L3JhZGlhbEdyYWRpZW50Pg0JCTxyYWRpYWxHcmFkaWVudCBpZD0iZ3JhZGllbnQyIiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iNzAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNiYmJiYmIiIHN0b3Atb3BhY2l0eT0iMC4wMTE4IiBvZmZzZXQ9IjcwLjIwMiUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2JiYmJiYiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9Ijg1JSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMTAwJSIvPg0JCTwvcmFkaWFsR3JhZGllbnQ+DQkJPGZpbHRlciBpZD0iZmlsdGVyMSIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgIDAgMCAwIDAgMCAgMCAwIDAgMCAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cxIi8+DQkJPC9maWx0ZXI+DQkJPGZpbHRlciBpZD0iZmlsdGVyMiIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwLjg2NjcgMCAgMCAwIDAgMC44NjY3IDAgIDAgMCAwIDAuODY2NyAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cyIi8+DQkJPC9maWx0ZXI+DQk8L2RlZnM+DQk8ZyBpZD0iQmFja2dyb3VuZCI+DQk8L2c+DQk8ZyBpZD0iZGFyayUyMHNoYWRvdyI+DQkJPHBhdGggZD0iTSAyMiA1MCBDIDIyIDM0LjUzNTggMzQuNTM1OCAyMiA1MCAyMiBDIDY1LjQ2NDIgMjIgNzggMzQuNTM1OCA3OCA1MCBDIDc4IDY1LjQ2NDIgNjUuNDY0MiA3OCA1MCA3OCBDIDM0LjUzNTggNzggMjIgNjUuNDY0MiAyMiA1MCBaTSA1IDUwIEMgNSA3NC44NTMxIDI1LjE0NjkgOTUgNTAgOTUgQyA3NC44NTMxIDk1IDk1IDc0Ljg1MzEgOTUgNTAgQyA5NSAyNS4xNDY5IDc0Ljg1MzEgNSA1MCA1IEMgMjUuMTQ2OSA1IDUgMjUuMTQ2OSA1IDUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxKSIvPg0JCTxwYXRoIGQ9Ik0gMjIgMTUwIEMgMjIgMTM0LjUzNTggMzQuNTM1OCAxMjIgNTAgMTIyIEMgNjUuNDY0MiAxMjIgNzggMTM0LjUzNTggNzggMTUwIEMgNzggMTY1LjQ2NDIgNjUuNDY0MiAxNzggNTAgMTc4IEMgMzQuNTM1OCAxNzggMjIgMTY1LjQ2NDIgMjIgMTUwIFpNIDUgMTUwIEMgNSAxNzQuODUzMSAyNS4xNDY5IDE5NSA1MCAxOTUgQyA3NC44NTMxIDE5NSA5NSAxNzQuODUzMSA5NSAxNTAgQyA5NSAxMjUuMTQ2OSA3NC44NTMxIDEwNSA1MCAxMDUgQyAyNS4xNDY5IDEwNSA1IDEyNS4xNDY5IDUgMTUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQyKSIvPg0JPC9nPg0JPGcgaWQ9ImRhcmsiPg0JCTxwYXRoIGlkPSJQb2x5Z29uIiBmaWx0ZXI9InVybCgjZmlsdGVyMSkiIGQ9Ik0gNzIuNSA0OS41IEwgMzguNzUgNjguOTg1NiBMIDM4Ljc1IDMwLjAxNDQgTCA3Mi41IDQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlIiBkPSJNIDEzIDUwLjUgQyAxMyAyOS43ODkxIDI5Ljc4OTEgMTMgNTAuNSAxMyBDIDcxLjIxMDkgMTMgODggMjkuNzg5MSA4OCA1MC41IEMgODggNzEuMjEwOSA3MS4yMTA5IDg4IDUwLjUgODggQyAyOS43ODkxIDg4IDEzIDcxLjIxMDkgMTMgNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg0JPGcgaWQ9ImxpZ2h0Ij4NCQk8cGF0aCBpZD0iUG9seWdvbjIiIGZpbHRlcj0idXJsKCNmaWx0ZXIyKSIgZD0iTSA3Mi41IDE0OS41IEwgMzguNzUgMTY4Ljk4NTYgTCAzOC43NSAxMzAuMDE0NCBMIDcyLjUgMTQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlMiIgZD0iTSAxMyAxNTAuNSBDIDEzIDEyOS43ODkxIDI5Ljc4OTEgMTEzIDUwLjUgMTEzIEMgNzEuMjEwOSAxMTMgODggMTI5Ljc4OTEgODggMTUwLjUgQyA4OCAxNzEuMjExIDcxLjIxMDkgMTg4IDUwLjUgMTg4IEMgMjkuNzg5MSAxODggMTMgMTcxLjIxMSAxMyAxNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg08L3N2Zz4=\") no-repeat;background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul{margin:0;padding:0;display:block;list-style-type:none !important;overflow:hidden}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none !important;display:block;color:#fff;overflow:hidden}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica, arial;font-size:10px}.mejs-postroll-layer{position:absolute;bottom:0;left:0;width:100%;height:100%;background:url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9ImJpZ3BsYXktZ3JhZGllbnQuZnctUGFnZSUyMDEiIHZpZXdCb3g9IjAgMCAxMDAgMjAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEwMHB4IiBoZWlnaHQ9IjIwMHB4Ig0+DQk8ZGVmcz4NCQk8cmFkaWFsR3JhZGllbnQgaWQ9ImdyYWRpZW50MSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNTAlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzIyMjIyMiIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjcwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjMjIyMjIyIiBzdG9wLW9wYWNpdHk9IjAuMDExOCIgb2Zmc2V0PSI3MC4yMDIlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiMzMzMzMzMiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSI4NSUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzMzMzMzMyIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L3JhZGlhbEdyYWRpZW50Pg0JCTxyYWRpYWxHcmFkaWVudCBpZD0iZ3JhZGllbnQyIiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iNzAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNiYmJiYmIiIHN0b3Atb3BhY2l0eT0iMC4wMTE4IiBvZmZzZXQ9IjcwLjIwMiUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2JiYmJiYiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9Ijg1JSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMTAwJSIvPg0JCTwvcmFkaWFsR3JhZGllbnQ+DQkJPGZpbHRlciBpZD0iZmlsdGVyMSIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgIDAgMCAwIDAgMCAgMCAwIDAgMCAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cxIi8+DQkJPC9maWx0ZXI+DQkJPGZpbHRlciBpZD0iZmlsdGVyMiIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwLjg2NjcgMCAgMCAwIDAgMC44NjY3IDAgIDAgMCAwIDAuODY2NyAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cyIi8+DQkJPC9maWx0ZXI+DQk8L2RlZnM+DQk8ZyBpZD0iQmFja2dyb3VuZCI+DQk8L2c+DQk8ZyBpZD0iZGFyayUyMHNoYWRvdyI+DQkJPHBhdGggZD0iTSAyMiA1MCBDIDIyIDM0LjUzNTggMzQuNTM1OCAyMiA1MCAyMiBDIDY1LjQ2NDIgMjIgNzggMzQuNTM1OCA3OCA1MCBDIDc4IDY1LjQ2NDIgNjUuNDY0MiA3OCA1MCA3OCBDIDM0LjUzNTggNzggMjIgNjUuNDY0MiAyMiA1MCBaTSA1IDUwIEMgNSA3NC44NTMxIDI1LjE0NjkgOTUgNTAgOTUgQyA3NC44NTMxIDk1IDk1IDc0Ljg1MzEgOTUgNTAgQyA5NSAyNS4xNDY5IDc0Ljg1MzEgNSA1MCA1IEMgMjUuMTQ2OSA1IDUgMjUuMTQ2OSA1IDUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxKSIvPg0JCTxwYXRoIGQ9Ik0gMjIgMTUwIEMgMjIgMTM0LjUzNTggMzQuNTM1OCAxMjIgNTAgMTIyIEMgNjUuNDY0MiAxMjIgNzggMTM0LjUzNTggNzggMTUwIEMgNzggMTY1LjQ2NDIgNjUuNDY0MiAxNzggNTAgMTc4IEMgMzQuNTM1OCAxNzggMjIgMTY1LjQ2NDIgMjIgMTUwIFpNIDUgMTUwIEMgNSAxNzQuODUzMSAyNS4xNDY5IDE5NSA1MCAxOTUgQyA3NC44NTMxIDE5NSA5NSAxNzQuODUzMSA5NSAxNTAgQyA5NSAxMjUuMTQ2OSA3NC44NTMxIDEwNSA1MCAxMDUgQyAyNS4xNDY5IDEwNSA1IDEyNS4xNDY5IDUgMTUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQyKSIvPg0JPC9nPg0JPGcgaWQ9ImRhcmsiPg0JCTxwYXRoIGlkPSJQb2x5Z29uIiBmaWx0ZXI9InVybCgjZmlsdGVyMSkiIGQ9Ik0gNzIuNSA0OS41IEwgMzguNzUgNjguOTg1NiBMIDM4Ljc1IDMwLjAxNDQgTCA3Mi41IDQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlIiBkPSJNIDEzIDUwLjUgQyAxMyAyOS43ODkxIDI5Ljc4OTEgMTMgNTAuNSAxMyBDIDcxLjIxMDkgMTMgODggMjkuNzg5MSA4OCA1MC41IEMgODggNzEuMjEwOSA3MS4yMTA5IDg4IDUwLjUgODggQyAyOS43ODkxIDg4IDEzIDcxLjIxMDkgMTMgNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg0JPGcgaWQ9ImxpZ2h0Ij4NCQk8cGF0aCBpZD0iUG9seWdvbjIiIGZpbHRlcj0idXJsKCNmaWx0ZXIyKSIgZD0iTSA3Mi41IDE0OS41IEwgMzguNzUgMTY4Ljk4NTYgTCAzOC43NSAxMzAuMDE0NCBMIDcyLjUgMTQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlMiIgZD0iTSAxMyAxNTAuNSBDIDEzIDEyOS43ODkxIDI5Ljc4OTEgMTEzIDUwLjUgMTEzIEMgNzEuMjEwOSAxMTMgODggMTI5Ljc4OTEgODggMTUwLjUgQyA4OCAxNzEuMjExIDcxLjIxMDkgMTg4IDUwLjUgMTg4IEMgMjkuNzg5MSAxODggMTMgMTcxLjIxMSAxMyAxNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg08L3N2Zz4=\") no-repeat;background:rgba(50,50,50,0.7);z-index:1000;overflow:hidden}.mejs-postroll-layer-content{width:100%;height:100%}.mejs-postroll-close{position:absolute;right:0;top:0;background:url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9ImJpZ3BsYXktZ3JhZGllbnQuZnctUGFnZSUyMDEiIHZpZXdCb3g9IjAgMCAxMDAgMjAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEwMHB4IiBoZWlnaHQ9IjIwMHB4Ig0+DQk8ZGVmcz4NCQk8cmFkaWFsR3JhZGllbnQgaWQ9ImdyYWRpZW50MSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNTAlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzIyMjIyMiIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjcwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjMjIyMjIyIiBzdG9wLW9wYWNpdHk9IjAuMDExOCIgb2Zmc2V0PSI3MC4yMDIlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiMzMzMzMzMiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSI4NSUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzMzMzMzMyIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L3JhZGlhbEdyYWRpZW50Pg0JCTxyYWRpYWxHcmFkaWVudCBpZD0iZ3JhZGllbnQyIiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iNzAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNiYmJiYmIiIHN0b3Atb3BhY2l0eT0iMC4wMTE4IiBvZmZzZXQ9IjcwLjIwMiUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2JiYmJiYiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9Ijg1JSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMTAwJSIvPg0JCTwvcmFkaWFsR3JhZGllbnQ+DQkJPGZpbHRlciBpZD0iZmlsdGVyMSIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgIDAgMCAwIDAgMCAgMCAwIDAgMCAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cxIi8+DQkJPC9maWx0ZXI+DQkJPGZpbHRlciBpZD0iZmlsdGVyMiIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwLjg2NjcgMCAgMCAwIDAgMC44NjY3IDAgIDAgMCAwIDAuODY2NyAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cyIi8+DQkJPC9maWx0ZXI+DQk8L2RlZnM+DQk8ZyBpZD0iQmFja2dyb3VuZCI+DQk8L2c+DQk8ZyBpZD0iZGFyayUyMHNoYWRvdyI+DQkJPHBhdGggZD0iTSAyMiA1MCBDIDIyIDM0LjUzNTggMzQuNTM1OCAyMiA1MCAyMiBDIDY1LjQ2NDIgMjIgNzggMzQuNTM1OCA3OCA1MCBDIDc4IDY1LjQ2NDIgNjUuNDY0MiA3OCA1MCA3OCBDIDM0LjUzNTggNzggMjIgNjUuNDY0MiAyMiA1MCBaTSA1IDUwIEMgNSA3NC44NTMxIDI1LjE0NjkgOTUgNTAgOTUgQyA3NC44NTMxIDk1IDk1IDc0Ljg1MzEgOTUgNTAgQyA5NSAyNS4xNDY5IDc0Ljg1MzEgNSA1MCA1IEMgMjUuMTQ2OSA1IDUgMjUuMTQ2OSA1IDUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxKSIvPg0JCTxwYXRoIGQ9Ik0gMjIgMTUwIEMgMjIgMTM0LjUzNTggMzQuNTM1OCAxMjIgNTAgMTIyIEMgNjUuNDY0MiAxMjIgNzggMTM0LjUzNTggNzggMTUwIEMgNzggMTY1LjQ2NDIgNjUuNDY0MiAxNzggNTAgMTc4IEMgMzQuNTM1OCAxNzggMjIgMTY1LjQ2NDIgMjIgMTUwIFpNIDUgMTUwIEMgNSAxNzQuODUzMSAyNS4xNDY5IDE5NSA1MCAxOTUgQyA3NC44NTMxIDE5NSA5NSAxNzQuODUzMSA5NSAxNTAgQyA5NSAxMjUuMTQ2OSA3NC44NTMxIDEwNSA1MCAxMDUgQyAyNS4xNDY5IDEwNSA1IDEyNS4xNDY5IDUgMTUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQyKSIvPg0JPC9nPg0JPGcgaWQ9ImRhcmsiPg0JCTxwYXRoIGlkPSJQb2x5Z29uIiBmaWx0ZXI9InVybCgjZmlsdGVyMSkiIGQ9Ik0gNzIuNSA0OS41IEwgMzguNzUgNjguOTg1NiBMIDM4Ljc1IDMwLjAxNDQgTCA3Mi41IDQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlIiBkPSJNIDEzIDUwLjUgQyAxMyAyOS43ODkxIDI5Ljc4OTEgMTMgNTAuNSAxMyBDIDcxLjIxMDkgMTMgODggMjkuNzg5MSA4OCA1MC41IEMgODggNzEuMjEwOSA3MS4yMTA5IDg4IDUwLjUgODggQyAyOS43ODkxIDg4IDEzIDcxLjIxMDkgMTMgNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg0JPGcgaWQ9ImxpZ2h0Ij4NCQk8cGF0aCBpZD0iUG9seWdvbjIiIGZpbHRlcj0idXJsKCNmaWx0ZXIyKSIgZD0iTSA3Mi41IDE0OS41IEwgMzguNzUgMTY4Ljk4NTYgTCAzOC43NSAxMzAuMDE0NCBMIDcyLjUgMTQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlMiIgZD0iTSAxMyAxNTAuNSBDIDEzIDEyOS43ODkxIDI5Ljc4OTEgMTEzIDUwLjUgMTEzIEMgNzEuMjEwOSAxMTMgODggMTI5Ljc4OTEgODggMTUwLjUgQyA4OCAxNzEuMjExIDcxLjIxMDkgMTg4IDUwLjUgMTg4IEMgMjkuNzg5MSAxODggMTMgMTcxLjIxMSAxMyAxNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg08L3N2Zz4=\") no-repeat;background:rgba(50,50,50,0.7);color:#fff;padding:4px;z-index:100;cursor:pointer}div.mejs-speed-button{width:46px !important;position:relative}.mejs-time span{font-size:1rem !important;line-height:1.1 !important}.mejs-controls .mejs-button.mejs-speed-button button{background:transparent;width:36px;font-size:11px;line-height:normal;color:#ffffff}.mejs-controls .mejs-speed-button .mejs-speed-selector{visibility:hidden;position:absolute;top:-100px;left:-10px;width:60px;height:100px;background:url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9ImJpZ3BsYXktZ3JhZGllbnQuZnctUGFnZSUyMDEiIHZpZXdCb3g9IjAgMCAxMDAgMjAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEwMHB4IiBoZWlnaHQ9IjIwMHB4Ig0+DQk8ZGVmcz4NCQk8cmFkaWFsR3JhZGllbnQgaWQ9ImdyYWRpZW50MSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNTAlIj4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzIyMjIyMiIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjcwJSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjMjIyMjIyIiBzdG9wLW9wYWNpdHk9IjAuMDExOCIgb2Zmc2V0PSI3MC4yMDIlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiMzMzMzMzMiIHN0b3Atb3BhY2l0eT0iMSIgb2Zmc2V0PSI4NSUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iIzMzMzMzMyIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjEwMCUiLz4NCQk8L3JhZGlhbEdyYWRpZW50Pg0JCTxyYWRpYWxHcmFkaWVudCBpZD0iZ3JhZGllbnQyIiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iNzAlIi8+DQkJCTxzdG9wIHN0b3AtY29sb3I9IiNiYmJiYmIiIHN0b3Atb3BhY2l0eT0iMC4wMTE4IiBvZmZzZXQ9IjcwLjIwMiUiLz4NCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2JiYmJiYiIgc3RvcC1vcGFjaXR5PSIxIiBvZmZzZXQ9Ijg1JSIvPg0JCQk8c3RvcCBzdG9wLWNvbG9yPSIjYmJiYmJiIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMTAwJSIvPg0JCTwvcmFkaWFsR3JhZGllbnQ+DQkJPGZpbHRlciBpZD0iZmlsdGVyMSIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgIDAgMCAwIDAgMCAgMCAwIDAgMCAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cxIi8+DQkJPC9maWx0ZXI+DQkJPGZpbHRlciBpZD0iZmlsdGVyMiIgeD0iLTEwMCUiIHk9Ii0xMDAlIiB3aWR0aD0iMzAwJSIgaGVpZ2h0PSIzMDAlIj4NCQkJPCEtLSBHbG93IC0tPg0JCQk8ZmVDb2xvck1hdHJpeCByZXN1bHQ9Im91dCIgaW49IlNvdXJjZUdyYXBoaWMiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwLjg2NjcgMCAgMCAwIDAgMC44NjY3IDAgIDAgMCAwIDAuODY2NyAwICAwIDAgMCAwLjI1MSAwIi8+DQkJCTxmZU1vcnBob2xvZ3kgcmVzdWx0PSJvdXQiIGluPSJvdXQiIG9wZXJhdG9yPSJkaWxhdGUiIHJhZGl1cz0iMyIvPg0JCQk8ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJvdXQiIGluPSJvdXQiIHN0ZERldmlhdGlvbj0iMS41Ii8+DQkJCTxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9Im91dCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9Ikdsb3cyIi8+DQkJPC9maWx0ZXI+DQk8L2RlZnM+DQk8ZyBpZD0iQmFja2dyb3VuZCI+DQk8L2c+DQk8ZyBpZD0iZGFyayUyMHNoYWRvdyI+DQkJPHBhdGggZD0iTSAyMiA1MCBDIDIyIDM0LjUzNTggMzQuNTM1OCAyMiA1MCAyMiBDIDY1LjQ2NDIgMjIgNzggMzQuNTM1OCA3OCA1MCBDIDc4IDY1LjQ2NDIgNjUuNDY0MiA3OCA1MCA3OCBDIDM0LjUzNTggNzggMjIgNjUuNDY0MiAyMiA1MCBaTSA1IDUwIEMgNSA3NC44NTMxIDI1LjE0NjkgOTUgNTAgOTUgQyA3NC44NTMxIDk1IDk1IDc0Ljg1MzEgOTUgNTAgQyA5NSAyNS4xNDY5IDc0Ljg1MzEgNSA1MCA1IEMgMjUuMTQ2OSA1IDUgMjUuMTQ2OSA1IDUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQxKSIvPg0JCTxwYXRoIGQ9Ik0gMjIgMTUwIEMgMjIgMTM0LjUzNTggMzQuNTM1OCAxMjIgNTAgMTIyIEMgNjUuNDY0MiAxMjIgNzggMTM0LjUzNTggNzggMTUwIEMgNzggMTY1LjQ2NDIgNjUuNDY0MiAxNzggNTAgMTc4IEMgMzQuNTM1OCAxNzggMjIgMTY1LjQ2NDIgMjIgMTUwIFpNIDUgMTUwIEMgNSAxNzQuODUzMSAyNS4xNDY5IDE5NSA1MCAxOTUgQyA3NC44NTMxIDE5NSA5NSAxNzQuODUzMSA5NSAxNTAgQyA5NSAxMjUuMTQ2OSA3NC44NTMxIDEwNSA1MCAxMDUgQyAyNS4xNDY5IDEwNSA1IDEyNS4xNDY5IDUgMTUwIFoiIGZpbGw9InVybCgjZ3JhZGllbnQyKSIvPg0JPC9nPg0JPGcgaWQ9ImRhcmsiPg0JCTxwYXRoIGlkPSJQb2x5Z29uIiBmaWx0ZXI9InVybCgjZmlsdGVyMSkiIGQ9Ik0gNzIuNSA0OS41IEwgMzguNzUgNjguOTg1NiBMIDM4Ljc1IDMwLjAxNDQgTCA3Mi41IDQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlIiBkPSJNIDEzIDUwLjUgQyAxMyAyOS43ODkxIDI5Ljc4OTEgMTMgNTAuNSAxMyBDIDcxLjIxMDkgMTMgODggMjkuNzg5MSA4OCA1MC41IEMgODggNzEuMjEwOSA3MS4yMTA5IDg4IDUwLjUgODggQyAyOS43ODkxIDg4IDEzIDcxLjIxMDkgMTMgNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg0JPGcgaWQ9ImxpZ2h0Ij4NCQk8cGF0aCBpZD0iUG9seWdvbjIiIGZpbHRlcj0idXJsKCNmaWx0ZXIyKSIgZD0iTSA3Mi41IDE0OS41IEwgMzguNzUgMTY4Ljk4NTYgTCAzOC43NSAxMzAuMDE0NCBMIDcyLjUgMTQ5LjUgWiIgZmlsbD0iI2ZmZmZmZiIvPg0JCTxwYXRoIGlkPSJFbGxpcHNlMiIgZD0iTSAxMyAxNTAuNSBDIDEzIDEyOS43ODkxIDI5Ljc4OTEgMTEzIDUwLjUgMTEzIEMgNzEuMjEwOSAxMTMgODggMTI5Ljc4OTEgODggMTUwLjUgQyA4OCAxNzEuMjExIDcxLjIxMDkgMTg4IDUwLjUgMTg4IEMgMjkuNzg5MSAxODggMTMgMTcxLjIxMSAxMyAxNTAuNSBaIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNSIgZmlsbD0ibm9uZSIvPg0JPC9nPg08L3N2Zz4=\") no-repeat;background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:0;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mejs-controls .mejs-speed-button:hover>.mejs-speed-selector{visibility:visible}.mejs-controls .mejs-speed-button .mejs-speed-selector ul li label.mejs-speed-selected{color:#21f8f8}.mejs-controls .mejs-speed-button .mejs-speed-selector ul{margin:0;padding:0;display:block;list-style-type:none !important;overflow:hidden}.mejs-controls .mejs-speed-button .mejs-speed-selector ul li{margin:0 0 6px 0;padding:0 10px;list-style-type:none !important;display:block;color:#fff;overflow:hidden}.mejs-controls .mejs-speed-button .mejs-speed-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;display:none}.mejs-controls .mejs-speed-button .mejs-speed-selector ul li label{width:60px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica, arial;font-size:11.5px;color:white;margin-left:5px;cursor:pointer}.mejs-controls .mejs-speed-button .mejs-speed-selector ul li:hover{background-color:#c8c8c8 !important;background-color:rgba(255,255,255,0.4) !important}.mejs-controls .mejs-button.mejs-skip-back-button{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAWCAYAAADAQbwGAAAKQWlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUU9kWh8+9N73QEiIgJfQaegkg0jtIFQRRiUmAUAKGhCZ2RAVGFBEpVmRUwAFHhyJjRRQLg4Ji1wnyEFDGwVFEReXdjGsJ7601896a/cdZ39nnt9fZZ+9917oAUPyCBMJ0WAGANKFYFO7rwVwSE8vE9wIYEAEOWAHA4WZmBEf4RALU/L09mZmoSMaz9u4ugGS72yy/UCZz1v9/kSI3QyQGAApF1TY8fiYX5QKUU7PFGTL/BMr0lSkyhjEyFqEJoqwi48SvbPan5iu7yZiXJuShGlnOGbw0noy7UN6aJeGjjAShXJgl4GejfAdlvVRJmgDl9yjT0/icTAAwFJlfzOcmoWyJMkUUGe6J8gIACJTEObxyDov5OWieAHimZ+SKBIlJYqYR15hp5ejIZvrxs1P5YjErlMNN4Yh4TM/0tAyOMBeAr2+WRQElWW2ZaJHtrRzt7VnW5mj5v9nfHn5T/T3IevtV8Sbsz55BjJ5Z32zsrC+9FgD2JFqbHbO+lVUAtG0GQOXhrE/vIADyBQC03pzzHoZsXpLE4gwnC4vs7GxzAZ9rLivoN/ufgm/Kv4Y595nL7vtWO6YXP4EjSRUzZUXlpqemS0TMzAwOl89k/fcQ/+PAOWnNycMsnJ/AF/GF6FVR6JQJhIlou4U8gViQLmQKhH/V4X8YNicHGX6daxRodV8AfYU5ULhJB8hvPQBDIwMkbj96An3rWxAxCsi+vGitka9zjzJ6/uf6Hwtcim7hTEEiU+b2DI9kciWiLBmj34RswQISkAd0oAo0gS4wAixgDRyAM3AD3iAAhIBIEAOWAy5IAmlABLJBPtgACkEx2AF2g2pwANSBetAEToI2cAZcBFfADXALDIBHQAqGwUswAd6BaQiC8BAVokGqkBakD5lC1hAbWgh5Q0FQOBQDxUOJkBCSQPnQJqgYKoOqoUNQPfQjdBq6CF2D+qAH0CA0Bv0BfYQRmALTYQ3YALaA2bA7HAhHwsvgRHgVnAcXwNvhSrgWPg63whfhG/AALIVfwpMIQMgIA9FGWAgb8URCkFgkAREha5EipAKpRZqQDqQbuY1IkXHkAwaHoWGYGBbGGeOHWYzhYlZh1mJKMNWYY5hWTBfmNmYQM4H5gqVi1bGmWCesP3YJNhGbjS3EVmCPYFuwl7ED2GHsOxwOx8AZ4hxwfrgYXDJuNa4Etw/XjLuA68MN4SbxeLwq3hTvgg/Bc/BifCG+Cn8cfx7fjx/GvyeQCVoEa4IPIZYgJGwkVBAaCOcI/YQRwjRRgahPdCKGEHnEXGIpsY7YQbxJHCZOkxRJhiQXUiQpmbSBVElqIl0mPSa9IZPJOmRHchhZQF5PriSfIF8lD5I/UJQoJhRPShxFQtlOOUq5QHlAeUOlUg2obtRYqpi6nVpPvUR9Sn0vR5Mzl/OX48mtk6uRa5Xrl3slT5TXl3eXXy6fJ18hf0r+pvy4AlHBQMFTgaOwVqFG4bTCPYVJRZqilWKIYppiiWKD4jXFUSW8koGStxJPqUDpsNIlpSEaQtOledK4tE20Otpl2jAdRzek+9OT6cX0H+i99AllJWVb5SjlHOUa5bPKUgbCMGD4M1IZpYyTjLuMj/M05rnP48/bNq9pXv+8KZX5Km4qfJUilWaVAZWPqkxVb9UU1Z2qbapP1DBqJmphatlq+9Uuq43Pp893ns+dXzT/5PyH6rC6iXq4+mr1w+o96pMamhq+GhkaVRqXNMY1GZpumsma5ZrnNMe0aFoLtQRa5VrntV4wlZnuzFRmJbOLOaGtru2nLdE+pN2rPa1jqLNYZ6NOs84TXZIuWzdBt1y3U3dCT0svWC9fr1HvoT5Rn62fpL9Hv1t/ysDQINpgi0GbwaihiqG/YZ5ho+FjI6qRq9Eqo1qjO8Y4Y7ZxivE+41smsImdSZJJjclNU9jU3lRgus+0zwxr5mgmNKs1u8eisNxZWaxG1qA5wzzIfKN5m/krCz2LWIudFt0WXyztLFMt6ywfWSlZBVhttOqw+sPaxJprXWN9x4Zq42Ozzqbd5rWtqS3fdr/tfTuaXbDdFrtOu8/2DvYi+yb7MQc9h3iHvQ732HR2KLuEfdUR6+jhuM7xjOMHJ3snsdNJp9+dWc4pzg3OowsMF/AX1C0YctFx4bgccpEuZC6MX3hwodRV25XjWuv6zE3Xjed2xG3E3dg92f24+ysPSw+RR4vHlKeT5xrPC16Il69XkVevt5L3Yu9q76c+Oj6JPo0+E752vqt9L/hh/QL9dvrd89fw5/rX+08EOASsCegKpARGBFYHPgsyCRIFdQTDwQHBu4IfL9JfJFzUFgJC/EN2hTwJNQxdFfpzGC4sNKwm7Hm4VXh+eHcELWJFREPEu0iPyNLIR4uNFksWd0bJR8VF1UdNRXtFl0VLl1gsWbPkRoxajCCmPRYfGxV7JHZyqffS3UuH4+ziCuPuLjNclrPs2nK15anLz66QX8FZcSoeGx8d3xD/iRPCqeVMrvRfuXflBNeTu4f7kufGK+eN8V34ZfyRBJeEsoTRRJfEXYljSa5JFUnjAk9BteB1sl/ygeSplJCUoykzqdGpzWmEtPi000IlYYqwK10zPSe9L8M0ozBDuspp1e5VE6JA0ZFMKHNZZruYjv5M9UiMJJslg1kLs2qy3mdHZZ/KUcwR5vTkmuRuyx3J88n7fjVmNXd1Z752/ob8wTXuaw6thdauXNu5Tnddwbrh9b7rj20gbUjZ8MtGy41lG99uit7UUaBRsL5gaLPv5sZCuUJR4b0tzlsObMVsFWzt3WazrWrblyJe0fViy+KK4k8l3JLr31l9V/ndzPaE7b2l9qX7d+B2CHfc3em681iZYlle2dCu4F2t5czyovK3u1fsvlZhW3FgD2mPZI+0MqiyvUqvakfVp+qk6oEaj5rmvep7t+2d2sfb17/fbX/TAY0DxQc+HhQcvH/I91BrrUFtxWHc4azDz+ui6rq/Z39ff0TtSPGRz0eFR6XHwo911TvU1zeoN5Q2wo2SxrHjccdv/eD1Q3sTq+lQM6O5+AQ4ITnx4sf4H++eDDzZeYp9qukn/Z/2ttBailqh1tzWibakNml7THvf6YDTnR3OHS0/m/989Iz2mZqzymdLz5HOFZybOZ93fvJCxoXxi4kXhzpXdD66tOTSna6wrt7LgZevXvG5cqnbvfv8VZerZ645XTt9nX297Yb9jdYeu56WX+x+aem172296XCz/ZbjrY6+BX3n+l37L972un3ljv+dGwOLBvruLr57/17cPel93v3RB6kPXj/Mejj9aP1j7OOiJwpPKp6qP6391fjXZqm99Oyg12DPs4hnj4a4Qy//lfmvT8MFz6nPK0a0RupHrUfPjPmM3Xqx9MXwy4yX0+OFvyn+tveV0auffnf7vWdiycTwa9HrmT9K3qi+OfrW9m3nZOjk03dp76anit6rvj/2gf2h+2P0x5Hp7E/4T5WfjT93fAn88ngmbWbm3/eE8/syOll+AAAACXBIWXMAAAsTAAALEwEAmpwYAAAEImlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MTwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPHRpZmY6Q29tcHJlc3Npb24+NTwvdGlmZjpDb21wcmVzc2lvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+NzI8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MjA8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjE8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjIyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgICAgPGRjOnN1YmplY3Q+CiAgICAgICAgICAgIDxyZGY6QmFnLz4KICAgICAgICAgPC9kYzpzdWJqZWN0PgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxNC0wNy0zMVQxNDowNzo3MzwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAzLjI8L3htcDpDcmVhdG9yVG9vbD4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+Cpunxb8AAAHMSURBVDgRpZS7SkNBEIY98QK+gaIxxELF2JjEBKwsJA9gkZcQFXyDYBUEwYfQwsJeGxGt1E470QRUsFHiBQQvid8fZglHs8GDA19mLzP/bvbMbleXxxqNxjRsahrfByWY9YT7hy15Df8Bh5CFc5DN+TPbzJCQgwtlmj3jP10HfwllyEN3G4nWEAGT8AJ/sSeCtiDTUmjTImAMjsDZA40318EfgHbp7JZGsY1Ua4iAAJbhFXSG43AMsnkYgRWogqwGnUUlT1ASStbWIosw45amPQVuIe007eYie5IDWyhFuwIynWlvZLGfCYjoeOqgisj/nI/cRyQOVyArx/iZgDQkoPlXIqreE39iOQUd/iOoeHUGnYvVsxJ56yCrxYiRiHiHOvzLJHhtCv34yDtkV/qyw6ZRkeC+dbL4QWtHcQME5yxhT2eoi647rE+/FEVJseSEy4aBXtgGWQVSFuj94sR0LmwCVDa6PjJdp6Zop90qxmJxzdzw1WOwCLrosiroAUhAjxNW28a8j0PobxGsV2MDhkxEFXAKN9aP4/VAjFr/Dr8aBMGO9X87RDOgM9Uj6jPvAxvaoZNHRfWoMlqAAiRBVgGV2S6csbMvfMi+AaMLVYXh1sqKAAAAAElFTkSuQmCC) no-repeat;background-position:3px 3px}.mejs-controls .mejs-button.mejs-skip-back-button button{background:transparent;font-size:9px;line-height:normal;color:#ffffff}.qti-item.runtime .block-listing>li:hover,.qti-item .qti-associateInteraction .empty:hover,.qti-item .qti-associateInteraction .result-area .filled:hover,.qti-item .qti-graphicGapMatchInteraction ul.source>li:hover,.qti-item .qti-graphicGapMatchInteraction ul.source>li.active.selectable:hover,.qti-item .qti-graphicOrderInteraction ul.ordinals>li:hover,.qti-item .qti-hottextInteraction .qti-hottext:hover,.qti-item .qti-gapMatchInteraction .gapmatch-content:hover{background:#f3f7fa !important;color:#202020 !important;cursor:pointer !important}.qti-item.runtime .block-listing>li.active:hover,.qti-item .qti-associateInteraction .result-area>li>.target.active:hover{background:#e9f0f5 !important;color:#202020 !important}.qti-item.runtime .block-listing>li.dragged,.qti-item.runtime .block-listing>li.dragged:hover,.qti-item .qti-associateInteraction .result-area>li>.target.dragged,.qti-item .qti-associateInteraction .result-area>li>.target.dragged:hover,.qti-item .qti-gapMatchInteraction .gapmatch-content.dragged,.qti-item .qti-gapMatchInteraction .gapmatch-content.dragged:hover{z-index:10;background:#e9f0f5 !important;color:#202020 !important}.qti-item.runtime .block-listing>li.dropzone,.qti-item .qti-associateInteraction .result-area>li>.target.dropzone,.qti-item .qti-gapMatchInteraction .gapmatch-content.dropzone{background:#cfdfe9 !important;color:#202020 !important;border:1px #3e7da7 dashed !important}.qti-item.runtime .block-listing>li.droppable,.qti-item.runtime .block-listing>li.droppable:hover,.qti-item .qti-associateInteraction .result-area>li>.target.droppable,.qti-item .qti-associateInteraction .result-area>li>.target.droppable:hover,.qti-item .qti-gapMatchInteraction .gapmatch-content.droppable,.qti-item .qti-gapMatchInteraction .gapmatch-content.droppable:hover{background:#cfdfe9 !important;color:#202020 !important}.qti-item #modalFeedbacks .qti-modalFeedback,.qti-item .qti-itemBody .qti-modalFeedback{color:#111;margin-top:10px;border:4px solid #266d9c}.qti-item #modalFeedbacks .qti-modalFeedback .qti-title,.qti-item .qti-itemBody .qti-modalFeedback .qti-title{margin-top:0px}.qti-item #modalFeedbacks .positive.qti-modalFeedback,.qti-item .qti-itemBody .positive.qti-modalFeedback{border-color:#269c5d}.qti-item #modalFeedbacks .negative.qti-modalFeedback,.qti-item .qti-itemBody .negative.qti-modalFeedback{border-color:#c12a40}.qti-item{/*! Green tooltip style *//*! Blue tooltip style *//*! Orange tooltip style *//*! Danger (mix of read and orange) tooltip style */overflow-x:visible !important;padding:15px;background:#fff;margin:auto;max-width:1024px}.qti-item [class^=\"icon-\"],.qti-item [class*=\" icon-\"]{font-family:'tao' !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.qti-item .icon-wrap-inline:before{content:\"\\e915\"}.qti-item .icon-wrap-left:before{content:\"\\e916\"}.qti-item .icon-wrap-right:before{content:\"\\e917\"}.qti-item .icon-offline:before{content:\"\\e913\"}.qti-item .icon-online:before{content:\"\\e914\"}.qti-item .icon-tab:before{content:\"\\e90d\"}.qti-item .icon-untab:before{content:\"\\e90e\"}.qti-item .icon-multi-select:before{content:\"\\e90b\"}.qti-item .icon-clipboard:before{content:\"\\e90a\"}.qti-item .icon-filebox:before{content:\"\\e909\"}.qti-item .icon-click-to-speak:before{content:\"\\e907\"}.qti-item .icon-speech-bubble:before{content:\"\\f0e5\"}.qti-item .icon-microphone:before{content:\"\\f130\"}.qti-item .icon-microphone-off:before{content:\"\\f131\"}.qti-item .icon-disconnect:before{content:\"\\e905\"}.qti-item .icon-connect:before{content:\"\\e906\"}.qti-item .icon-eliminate:before{content:\"\\e904\"}.qti-item .icon-wheelchair:before{content:\"\\e903\"}.qti-item .icon-text-marker:before{content:\"\\e902\"}.qti-item .icon-unshield:before{content:\"\\e32a\"}.qti-item .icon-shield:before{content:\"\\e8e8\"}.qti-item .icon-tree:before{content:\"\\e6b4\"}.qti-item .icon-home:before{content:\"\\e6b3\"}.qti-item .icon-shared-file:before{content:\"\\e6b2\"}.qti-item .icon-end-attempt:before{content:\"\\e603\"}.qti-item .icon-icon:before{content:\"\\f1c5\"}.qti-item .icon-radio-bg:before{content:\"\\e600\"}.qti-item .icon-checkbox-bg:before{content:\"\\e601\"}.qti-item .icon-tag:before{content:\"\\e602\"}.qti-item .icon-style:before{content:\"\\e604\"}.qti-item .icon-ownership-transfer:before{content:\"\\e605\"}.qti-item .icon-property-advanced:before{content:\"\\e606\"}.qti-item .icon-property-add:before{content:\"\\e607\"}.qti-item .icon-repository-add:before{content:\"\\e608\"}.qti-item .icon-repository-remove:before{content:\"\\e609\"}.qti-item .icon-repository:before{content:\"\\e60a\"}.qti-item .icon-result-server:before{content:\"\\e60b\"}.qti-item .icon-folder:before{content:\"\\e60c\"}.qti-item .icon-folder-open:before{content:\"\\e60d\"}.qti-item .icon-left:before{content:\"\\e60e\"}.qti-item .icon-right:before{content:\"\\e60f\"}.qti-item .icon-up:before{content:\"\\e610\"}.qti-item .icon-down:before{content:\"\\e611\"}.qti-item .icon-undo:before{content:\"\\e612\"}.qti-item .icon-redo:before{content:\"\\e613\"}.qti-item .icon-screen:before{content:\"\\e614\"}.qti-item .icon-laptop:before{content:\"\\e615\"}.qti-item .icon-tablet:before{content:\"\\e616\"}.qti-item .icon-phone:before{content:\"\\e617\"}.qti-item .icon-move:before{content:\"\\e618\"}.qti-item .icon-bin:before{content:\"\\e619\"}.qti-item .icon-shuffle:before{content:\"\\e61a\"}.qti-item .icon-print:before{content:\"\\e61b\"}.qti-item .icon-tools:before{content:\"\\e61c\"}.qti-item .icon-settings:before{content:\"\\e61d\"}.qti-item .icon-video:before{content:\"\\e61e\"}.qti-item .icon-find:before{content:\"\\e61f\"}.qti-item .icon-image:before{content:\"\\e620\"}.qti-item .icon-edit:before{content:\"\\e621\"}.qti-item .icon-document:before{content:\"\\e622\"}.qti-item .icon-resize-grid:before{content:\"\\e623\"}.qti-item .icon-resize:before{content:\"\\e624\"}.qti-item .icon-help:before{content:\"\\e625\"}.qti-item .icon-mobile-menu:before{content:\"\\e626\"}.qti-item .icon-fix:before{content:\"\\e627\"}.qti-item .icon-unlock:before{content:\"\\e628\"}.qti-item .icon-lock:before{content:\"\\e629\"}.qti-item .icon-ul:before{content:\"\\e62a\"}.qti-item .icon-ol:before{content:\"\\e62b\"}.qti-item .icon-email:before{content:\"\\e62c\"}.qti-item .icon-download:before{content:\"\\e62d\"}.qti-item .icon-logout:before{content:\"\\e62e\"}.qti-item .icon-login:before{content:\"\\e62f\"}.qti-item .icon-spinner:before{content:\"\\e630\"}.qti-item .icon-preview:before{content:\"\\e631\"}.qti-item .icon-external:before{content:\"\\e632\"}.qti-item .icon-time:before{content:\"\\e633\"}.qti-item .icon-save:before{content:\"\\e634\"}.qti-item .icon-warning:before{content:\"\\e635\"}.qti-item .icon-add:before{content:\"\\e636\"}.qti-item .icon-error:before{content:\"\\e900\"}.qti-item .icon-close:before{content:\"\\e637\"}.qti-item .icon-success:before{content:\"\\e638\"}.qti-item .icon-remove:before{content:\"\\e639\"}.qti-item .icon-info:before{content:\"\\e63a\"}.qti-item .icon-danger:before{content:\"\\e63b\"}.qti-item .icon-users:before{content:\"\\e63c\"}.qti-item .icon-user:before{content:\"\\e63d\"}.qti-item .icon-test-taker:before{content:\"\\e63e\"}.qti-item .icon-test-takers:before{content:\"\\e63f\"}.qti-item .icon-item:before{content:\"\\e640\"}.qti-item .icon-test:before{content:\"\\e641\"}.qti-item .icon-delivery:before{content:\"\\e642\"}.qti-item .icon-eye-slash:before{content:\"\\e643\"}.qti-item .icon-result:before{content:\"\\e644\"}.qti-item .icon-delivery-small:before{content:\"\\e645\"}.qti-item .icon-upload:before{content:\"\\e646\"}.qti-item .icon-result-small:before{content:\"\\e647\"}.qti-item .icon-mobile-preview:before{content:\"\\e648\"}.qti-item .icon-extension:before{content:\"\\e649\"}.qti-item .icon-desktop-preview:before{content:\"\\e64a\"}.qti-item .icon-tablet-preview:before{content:\"\\e64b\"}.qti-item .icon-insert-horizontal-line:before{content:\"\\e64c\"}.qti-item .icon-table:before{content:\"\\e64d\"}.qti-item .icon-anchor:before{content:\"\\e64e\"}.qti-item .icon-unlink:before{content:\"\\e64f\"}.qti-item .icon-link:before{content:\"\\e650\"}.qti-item .icon-right-left:before{content:\"\\e651\"}.qti-item .icon-left-right:before{content:\"\\e652\"}.qti-item .icon-special-character:before{content:\"\\e653\"}.qti-item .icon-source:before{content:\"\\e654\"}.qti-item .icon-new-page:before{content:\"\\e655\"}.qti-item .icon-templates:before{content:\"\\e656\"}.qti-item .icon-cut:before{content:\"\\e657\"}.qti-item .icon-replace:before{content:\"\\e658\"}.qti-item .icon-copy:before{content:\"\\e659\"}.qti-item .icon-paste:before{content:\"\\e65a\"}.qti-item .icon-select-all:before{content:\"\\e65b\"}.qti-item .icon-paste-text:before{content:\"\\e65c\"}.qti-item .icon-paste-word:before{content:\"\\e65d\"}.qti-item .icon-bold:before{content:\"\\e65e\"}.qti-item .icon-italic:before{content:\"\\e65f\"}.qti-item .icon-underline:before{content:\"\\e660\"}.qti-item .icon-subscript:before{content:\"\\e661\"}.qti-item .icon-superscript:before{content:\"\\e662\"}.qti-item .icon-strike-through:before{content:\"\\e663\"}.qti-item .icon-decrease-indent:before{content:\"\\e664\"}.qti-item .icon-increase-indent:before{content:\"\\e665\"}.qti-item .icon-block-quote:before{content:\"\\e666\"}.qti-item .icon-div-container:before{content:\"\\e667\"}.qti-item .icon-align-left:before{content:\"\\e668\"}.qti-item .icon-center:before{content:\"\\e669\"}.qti-item .icon-align-right:before{content:\"\\e66a\"}.qti-item .icon-justify:before{content:\"\\e66b\"}.qti-item .icon-choice:before{content:\"\\e66c\"}.qti-item .icon-inline-choice:before{content:\"\\e66d\"}.qti-item .icon-match:before{content:\"\\e66e\"}.qti-item .icon-associate:before{content:\"\\e66f\"}.qti-item .icon-media:before{content:\"\\e670\"}.qti-item .icon-graphic-order:before{content:\"\\e671\"}.qti-item .icon-hotspot:before{content:\"\\e672\"}.qti-item .icon-graphic-gap:before{content:\"\\e673\"}.qti-item .icon-graphic-associate:before{content:\"\\e674\"}.qti-item .icon-select-point:before{content:\"\\e675\"}.qti-item .icon-pin:before{content:\"\\e676\"}.qti-item .icon-import:before{content:\"\\e677\"}.qti-item .icon-export:before{content:\"\\e678\"}.qti-item .icon-move-item:before{content:\"\\e679\"}.qti-item .icon-meta-data:before{content:\"\\e67a\"}.qti-item .icon-slider:before{content:\"\\e67b\"}.qti-item .icon-summary-report:before{content:\"\\e67c\"}.qti-item .icon-text-entry:before{content:\"\\e67d\"}.qti-item .icon-extended-text:before{content:\"\\e67e\"}.qti-item .icon-eraser:before{content:\"\\e67f\"}.qti-item .icon-row:before{content:\"\\e680\"}.qti-item .icon-column:before{content:\"\\e681\"}.qti-item .icon-text-color:before{content:\"\\e682\"}.qti-item .icon-background-color:before{content:\"\\e683\"}.qti-item .icon-spell-check:before{content:\"\\e684\"}.qti-item .icon-polygon:before{content:\"\\e685\"}.qti-item .icon-rectangle:before{content:\"\\e686\"}.qti-item .icon-gap-match:before{content:\"\\e687\"}.qti-item .icon-order:before{content:\"\\e688\"}.qti-item .icon-hottext:before{content:\"\\e689\"}.qti-item .icon-free-form:before{content:\"\\e68a\"}.qti-item .icon-step-backward:before{content:\"\\e68b\"}.qti-item .icon-fast-backward:before{content:\"\\e68c\"}.qti-item .icon-backward:before{content:\"\\e68d\"}.qti-item .icon-play:before{content:\"\\e68e\"}.qti-item .icon-pause:before{content:\"\\e68f\"}.qti-item .icon-stop:before{content:\"\\e690\"}.qti-item .icon-forward:before{content:\"\\e691\"}.qti-item .icon-fast-forward:before{content:\"\\e692\"}.qti-item .icon-step-forward:before{content:\"\\e693\"}.qti-item .icon-ellipsis:before{content:\"\\e694\"}.qti-item .icon-circle:before{content:\"\\e695\"}.qti-item .icon-target:before{content:\"\\e696\"}.qti-item .icon-guide-arrow:before{content:\"\\e697\"}.qti-item .icon-range-slider-right:before{content:\"\\e698\"}.qti-item .icon-range-slider-left:before{content:\"\\e699\"}.qti-item .icon-radio-checked:before{content:\"\\e69a\"}.qti-item .icon-checkbox-indeterminate:before{content:\"\\e901\"}.qti-item .icon-checkbox:before{content:\"\\e69b\"}.qti-item .icon-checkbox-crossed:before{content:\"\\e69c\"}.qti-item .icon-checkbox-checked:before{content:\"\\e69d\"}.qti-item .icon-result-nok:before{content:\"\\e69e\"}.qti-item .icon-result-ok:before{content:\"\\e69f\"}.qti-item .icon-not-evaluated:before{content:\"\\e6a0\"}.qti-item .icon-filter:before{content:\"\\e6a1\"}.qti-item .icon-translate:before{content:\"\\e6a2\"}.qti-item .icon-eject:before{content:\"\\e6a3\"}.qti-item .icon-continue:before{content:\"\\e6a4\"}.qti-item .icon-radio:before{content:\"\\e6a5\"}.qti-item .icon-sphere:before{content:\"\\e6a6\"}.qti-item .icon-reset:before{content:\"\\e6a7\"}.qti-item .icon-smaller:before{content:\"\\e6a8\"}.qti-item .icon-larger:before{content:\"\\e6a9\"}.qti-item .icon-clock:before{content:\"\\e6aa\"}.qti-item .icon-font:before{content:\"\\e6ab\"}.qti-item .icon-maths:before{content:\"\\e6ac\"}.qti-item .icon-grip:before{content:\"\\e6ad\"}.qti-item .icon-rubric:before{content:\"\\e6ae\"}.qti-item .icon-audio:before{content:\"\\e6af\"}.qti-item .icon-grip-h:before{content:\"\\e6b0\"}.qti-item .icon-magicwand:before{content:\"\\e6b1\"}.qti-item .icon-loop:before{content:\"\\ea2e\"}.qti-item .icon-calendar:before{content:\"\\e953\"}.qti-item .icon-reload:before{content:\"\\e984\"}.qti-item .icon-speed:before{content:\"\\e9a6\"}.qti-item .icon-volume:before{content:\"\\ea27\"}.qti-item .icon-contrast:before{content:\"\\e9d5\"}.qti-item .icon-headphones:before{content:\"\\e910\"}.qti-item .icon-compress:before{content:\"\\f066\"}.qti-item .icon-map-o:before{content:\"\\f278\"}.qti-item .icon-variable:before{content:\"\\e908\"}.qti-item .icon-tooltip:before{content:\"\\e90c\"}.qti-item .icon-globe:before{content:\"\\e9c9\"}.qti-item .icon-highlighter:before{content:\"\\e90f\"}.qti-item .icon-eliminate-crossed:before{content:\"\\e911\"}.qti-item .icon-play-from-here:before{content:\"\\e912\"}.qti-item [class^=\"feedback-\"],.qti-item [class*=\" feedback-\"]{border:1px transparent solid;position:relative;padding:20px 20px 20px 45px;margin:5px 0 10px 0;border-radius:3px;color:#222 !important}.qti-item [class^=\"feedback-\"].small,.qti-item [class*=\" feedback-\"].small{padding:8px 20px 8px 45px}.qti-item [class^=\"feedback-\"].small>[class^=\"icon-\"],.qti-item [class^=\"feedback-\"].small>[class*=\" icon-\"],.qti-item [class*=\" feedback-\"].small>[class^=\"icon-\"],.qti-item [class*=\" feedback-\"].small>[class*=\" icon-\"]{top:9px;left:10px}.qti-item [class^=\"feedback-\"]>[class^=\"icon-\"],.qti-item [class^=\"feedback-\"]>[class*=\" icon-\"],.qti-item [class*=\" feedback-\"]>[class^=\"icon-\"],.qti-item [class*=\" feedback-\"]>[class*=\" icon-\"]{font-size:20px;font-size:2rem;position:absolute;top:20px;left:15px}.qti-item [class^=\"feedback-\"]>[class^=\"icon-\"].icon-close,.qti-item [class^=\"feedback-\"]>[class^=\"icon-\"].icon-remove,.qti-item [class^=\"feedback-\"]>[class*=\" icon-\"].icon-close,.qti-item [class^=\"feedback-\"]>[class*=\" icon-\"].icon-remove,.qti-item [class*=\" feedback-\"]>[class^=\"icon-\"].icon-close,.qti-item [class*=\" feedback-\"]>[class^=\"icon-\"].icon-remove,.qti-item [class*=\" feedback-\"]>[class*=\" icon-\"].icon-close,.qti-item [class*=\" feedback-\"]>[class*=\" icon-\"].icon-remove{font-size:15px;font-size:1.5rem;color:#999;left:auto;top:5px;cursor:pointer}.qti-item [class^=\"feedback-\"]>[class^=\"icon-\"].icon-close:hover,.qti-item [class^=\"feedback-\"]>[class^=\"icon-\"].icon-remove:hover,.qti-item [class^=\"feedback-\"]>[class*=\" icon-\"].icon-close:hover,.qti-item [class^=\"feedback-\"]>[class*=\" icon-\"].icon-remove:hover,.qti-item [class*=\" feedback-\"]>[class^=\"icon-\"].icon-close:hover,.qti-item [class*=\" feedback-\"]>[class^=\"icon-\"].icon-remove:hover,.qti-item [class*=\" feedback-\"]>[class*=\" icon-\"].icon-close:hover,.qti-item [class*=\" feedback-\"]>[class*=\" icon-\"].icon-remove:hover{color:#222}.qti-item [class^=\"feedback-\"]>[class^=\"icon-\"].icon-remove,.qti-item [class^=\"feedback-\"]>[class*=\" icon-\"].icon-remove,.qti-item [class*=\" feedback-\"]>[class^=\"icon-\"].icon-remove,.qti-item [class*=\" feedback-\"]>[class*=\" icon-\"].icon-remove{right:24px}.qti-item [class^=\"feedback-\"]>[class^=\"icon-\"].icon-close,.qti-item [class^=\"feedback-\"]>[class*=\" icon-\"].icon-close,.qti-item [class*=\" feedback-\"]>[class^=\"icon-\"].icon-close,.qti-item [class*=\" feedback-\"]>[class*=\" icon-\"].icon-close{right:7px}.qti-item [class^=\"feedback-\"].popup,.qti-item [class*=\" feedback-\"].popup{display:block;position:fixed;top:50px;left:50%;margin-left:-200px;width:400px;z-index:999999}.qti-item .feedback-success,.qti-item .tooltip-green{border-color:#269c5d;background-color:#cfe9db}.qti-item .feedback-success .icon-success,.qti-item .tooltip-green .icon-success{color:#0e914b !important}.qti-item .feedback-info,.qti-item .tooltip-blue{border-color:#266d9c;background-color:#cfdfe9}.qti-item .feedback-info .icon-info,.qti-item .tooltip-blue .icon-info,.qti-item .feedback-info .icon-lock,.qti-item .tooltip-blue .icon-lock{color:#0e5d91 !important}.qti-item .feedback-info .button-container,.qti-item .tooltip-blue .button-container{margin-top:20px}.qti-item .feedback-warning,.qti-item .tooltip-orange{border-color:#dcb66b;background-color:#f7efde}.qti-item .feedback-warning .icon-warning,.qti-item .tooltip-orange .icon-warning{color:#d8ae5b !important}.qti-item .feedback-danger,.qti-item .tooltip-danger{border-color:#ce7056;background-color:#f4dfd9}.qti-item .feedback-danger .icon-danger,.qti-item .tooltip-danger .icon-danger{color:#c96043 !important}.qti-item .feedback-error,.qti-item .tooltip-red{border-color:#c12a40;background-color:#f1d0d5}.qti-item .feedback-error .icon-error,.qti-item .tooltip-red .icon-error{color:#ba122b !important}.qti-item .brd-success{border:1px solid #269c5d !important}.qti-item .brd-info{border:1px solid #266d9c !important}.qti-item .brd-warning{border:1px solid #dcb66b !important}.qti-item .brd-danger{border:1px solid #ce7056 !important}.qti-item .brd-error{border:1px solid #c12a40 !important}.qti-item .txt-success{color:#0e914b !important}.qti-item .txt-info{color:#0e5d91 !important}.qti-item .txt-warning{color:#d8ae5b !important}.qti-item .txt-danger{color:#c96043 !important}.qti-item .txt-error{color:#ba122b !important}.qti-item .bg-success{background-color:#cfe9db}.qti-item .bg-info{background-color:#cfdfe9}.qti-item .bg-warning{background-color:#f7efde}.qti-item .bg-danger{background-color:#f4dfd9}.qti-item .bg-error{background-color:#f1d0d5}.qti-item [class*=\" col-\"],.qti-item [class^=\"col-\"]{float:left;min-height:1rem}.qti-item [class*=\" col-\"]:first-child,.qti-item [class^=\"col-\"]:first-child{margin-left:0}.qti-item [class*=\" col-\"].grid-container,.qti-item [class^=\"col-\"].grid-container{margin-bottom:0}.qti-item .col-12{float:none}.qti-item .grid-container{overflow-x:hidden}.qti-item .grid-row,.qti-item .fixed-grid-row{width:101.428571429%}.qti-item .col-1{margin-left:1.4285714286%;width:6.9047619048%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-2{margin-left:1.4285714286%;width:15.2380952381%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-3{margin-left:1.4285714286%;width:23.5714285714%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-4{margin-left:1.4285714286%;width:31.9047619048%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-5{margin-left:1.4285714286%;width:40.2380952381%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-6{margin-left:1.4285714286%;width:48.5714285714%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-7{margin-left:1.4285714286%;width:56.9047619048%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-8{margin-left:1.4285714286%;width:65.2380952381%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-9{margin-left:1.4285714286%;width:73.5714285714%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-10{margin-left:1.4285714286%;width:81.9047619048%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-11{margin-left:1.4285714286%;width:90.2380952381%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item .col-12{margin-left:1.4285714286%;width:98.5714285714%;margin-bottom:12px}.qti-item .alpha{margin-left:0 !important}.qti-item #icon-editor .grid-row{width:100%}.qti-item #icon-editor .col-1{margin-left:0%;width:8.3333333333%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-2{margin-left:0%;width:16.6666666667%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-3{margin-left:0%;width:25%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-4{margin-left:0%;width:33.3333333333%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-5{margin-left:0%;width:41.6666666667%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-6{margin-left:0%;width:50%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-7{margin-left:0%;width:58.3333333333%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-8{margin-left:0%;width:66.6666666667%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-9{margin-left:0%;width:75%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-10{margin-left:0%;width:83.3333333333%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-11{margin-left:0%;width:91.6666666667%;margin-top:0 !important;margin-bottom:0 !important}.qti-item #icon-editor .col-12{margin-left:0%;width:100%;margin-top:0 !important;margin-bottom:0 !important}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .tooltip .tooltip-inner{-moz-border-radius:4px 4px 0 0;-webkit-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.qti-item .tooltip-content{display:none}.qti-item .tooltip-inner .tooltip-content{display:block}.qti-item .popper,.qti-item .tooltip[role=\"tooltip\"]{position:absolute;color:black;min-width:100px;max-width:250px;box-shadow:none;padding:2px 5px;text-align:left;font-size:.8em;z-index:2000;word-break:normal;overflow-wrap:break-word;box-sizing:border-box;border-style:solid;border-width:1px;border-radius:5px}.qti-item .style5 .tooltip{background:#1E252B;color:#FFFFFF;max-width:200px;width:auto;font-size:.8rem;padding:.5em 1em}.qti-item .popper .popper__arrow,.qti-item .tooltip .tooltip-arrow{width:0;height:0;border-style:solid;position:absolute;margin:5px}.qti-item .tooltip .tooltip-arrow::before,.qti-item .popper .popper__arrow::before{content:'';display:block;width:0;height:0;border-style:solid;position:absolute}.qti-item .style5 .tooltip .tooltip-arrow{border-color:red !important}.qti-item .popper[x-placement^=\"top\"],.qti-item .tooltip[x-placement^=\"top\"]{margin-bottom:5px}.qti-item .popper[x-placement^=\"top\"] .popper__arrow,.qti-item .tooltip[x-placement^=\"top\"] .tooltip-arrow{border-width:5px 5px 0 5px;border-left-color:transparent;border-right-color:transparent;border-bottom-color:transparent;bottom:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0}.qti-item .popper[x-placement^=\"top\"] .popper__arrow::before,.qti-item .tooltip[x-placement^=\"top\"] .tooltip-arrow::before{border-width:3px 3px 0 3px;border-left-color:transparent;border-right-color:transparent;border-bottom-color:transparent;top:-5px;left:calc(50% - 3px)}.qti-item .popper[x-placement^=\"bottom\"],.qti-item .tooltip[x-placement^=\"bottom\"]{margin-top:5px}.qti-item .tooltip[x-placement^=\"bottom\"] .tooltip-arrow,.qti-item .popper[x-placement^=\"bottom\"] .popper__arrow{border-width:0 5px 5px 5px;border-left-color:transparent;border-right-color:transparent;border-top-color:transparent;top:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0}.qti-item .tooltip[x-placement^=\"bottom\"] .tooltip-arrow::before,.qti-item .popper[x-placement^=\"bottom\"] .popper__arrow::before{border-width:0 3px 3px 3px;border-left-color:transparent;border-right-color:transparent;border-top-color:transparent;bottom:-5px;left:calc(50% - 3px);margin-top:0;margin-bottom:0}.qti-item .tooltip[x-placement^=\"right\"],.qti-item .popper[x-placement^=\"right\"]{margin-left:5px}.qti-item .popper[x-placement^=\"right\"] .popper__arrow,.qti-item .tooltip[x-placement^=\"right\"] .tooltip-arrow{border-width:5px 5px 5px 0;border-left-color:transparent;border-top-color:transparent;border-bottom-color:transparent;left:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0}.qti-item .popper[x-placement^=\"right\"] .popper__arrow::before,.qti-item .tooltip[x-placement^=\"right\"] .tooltip-arrow::before{border-width:3px 3px 3px 0;border-left-color:transparent;border-top-color:transparent;border-bottom-color:transparent;right:-5px;top:calc(50% - 3px);margin-left:0;margin-right:0}.qti-item .popper[x-placement^=\"left\"],.qti-item .tooltip[x-placement^=\"left\"]{margin-right:5px}.qti-item .popper[x-placement^=\"left\"] .popper__arrow,.qti-item .tooltip[x-placement^=\"left\"] .tooltip-arrow{border-width:5px 0 5px 5px;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;right:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0}.qti-item .popper[x-placement^=\"left\"] .popper__arrow::before,.qti-item .tooltip[x-placement^=\"left\"] .tooltip-arrow::before{border-width:3px 0 3px 3px;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;top:calc(50% - 3px);left:-5px;margin-left:0;margin-right:0}.qti-item .tooltip-plain{background-color:#a4bbc5;border:solid 1px #51717f}.qti-item .tooltip-plain .tooltip-arrow{border-color:#51717f}.qti-item .tooltip-plain .tooltip-arrow::before{border-color:#a4bbc5}.qti-item .tooltip-dark{background-color:#404040;border:solid 1px #000;color:#fff}.qti-item .tooltip-dark .tooltip-arrow{border-color:#404040}.qti-item .tooltip-dark .tooltip-arrow::before{border-color:#404040}.qti-item .tooltip-dark .tooltip-inner{background-color:#404040}.qti-item .tooltip-dark .tooltip-icon{border-color:#404040}.qti-item .tooltip-dark .tooltip-inner .ui-state-hover{border-color:#303030}.qti-item .tooltip-red{color:#222}.qti-item .tooltip-red .tooltip-arrow{border-color:#c12a40}.qti-item .tooltip-red .tooltip-arrow::before{border-color:#f1d0d5}.qti-item .tooltip-red .tooltip-close .tooltip-icon{background-position:-102px 0}.qti-item .tooltip-red .tooltip-icon{border-color:#222}.qti-item .tooltip-red .tooltip-inner .ui-state-hover{border-color:#222}.qti-item .tooltip-green{color:#222}.qti-item .tooltip-green .tooltip-arrow{border-color:#269c5d}.qti-item .tooltip-green .tooltip-arrow::before{border-color:#cfe9db}.qti-item .tooltip-green .tooltip-close .tooltip-icon{background-position:-42px 0}.qti-item .tooltip-blue{color:#222}.qti-item .tooltip-blue .tooltip-arrow{border-color:#266d9c}.qti-item .tooltip-blue .tooltip-arrow::before{border-color:#cfdfe9}.qti-item .tooltip-blue .tooltip-close .tooltip-icon{background-position:-2px 0}.qti-item .tooltip-orange{color:#222}.qti-item .tooltip-orange .tooltip-arrow{border-color:#dcb66b}.qti-item .tooltip-orange .tooltip-arrow::before{border-color:#f7efde}.qti-item .tooltip-orange .tooltip-close .tooltip-icon{background-position:-102px 0}.qti-item .tooltip-orange .tooltip-icon{border-color:#222}.qti-item .tooltip-orange .tooltip-inner .ui-state-hover{border-color:#222}.qti-item .tooltip-danger{color:#222}.qti-item .tooltip-danger .tooltip-arrow{border-color:#ce7056}.qti-item .tooltip-danger .tooltip-arrow::before{border-color:#f4dfd9}.qti-item .tooltip-danger .tooltip-icon{background-position:-102px 0}.qti-item .tooltip-danger .tooltip-icon{border-color:#222}.qti-item .tooltip-danger .tooltip-inner .ui-state-hover{border-color:#222}.qti-item [class^=\"btn-\"],.qti-item [class*=\" btn-\"],.qti-item .btn-default,.qti-item button,.qti-item input[type=\"submit\"],.qti-item input[type=\"reset\"]{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;font-size:14px !important;font-size:1.4rem !important;cursor:pointer;text-decoration:none !important;vertical-align:middle;outline:0;overflow:visible;border:none;display:inline-block;line-height:2.5;padding:0 15px;font-weight:normal;font-style:normal;text-align:center;height:35px;color:#fff;background-color:#adb2b9;text-shadow:1px 1px 0 #83878e}.qti-item .btn-secondary[class^=\"btn-\"],.qti-item .btn-secondary[class*=\" btn-\"],.qti-item .btn-secondary.btn-default,.qti-item button.btn-secondary,.qti-item input.btn-secondary[type=\"submit\"],.qti-item input.btn-secondary[type=\"reset\"]{color:#adb2b9;border:1px solid #adb2b9;background-color:#fff;text-shadow:none;line-height:2.3}.qti-item .small[class^=\"btn-\"],.qti-item .small[class*=\" btn-\"],.qti-item .small.btn-default,.qti-item button.small,.qti-item input.small[type=\"submit\"],.qti-item input.small[type=\"reset\"]{line-height:1.8;height:25px}.qti-item .small.btn-secondary[class^=\"btn-\"],.qti-item .small.btn-secondary[class*=\" btn-\"],.qti-item .small.btn-secondary.btn-default,.qti-item button.small.btn-secondary,.qti-item input.small.btn-secondary[type=\"submit\"],.qti-item input.small.btn-secondary[type=\"reset\"]{line-height:1.5}.qti-item .small[class^=\"btn-\"] [class^=\"icon-\"],.qti-item .small[class*=\" btn-\"] [class^=\"icon-\"],.qti-item .small.btn-default [class^=\"icon-\"],.qti-item button.small [class^=\"icon-\"],.qti-item input.small[type=\"submit\"] [class^=\"icon-\"],.qti-item input.small[type=\"reset\"] [class^=\"icon-\"],.qti-item .small[class^=\"btn-\"] [class*=\" icon-\"],.qti-item .small[class*=\" btn-\"] [class*=\" icon-\"],.qti-item .small.btn-default [class*=\" icon-\"],.qti-item button.small [class*=\" icon-\"],.qti-item input.small[type=\"submit\"] [class*=\" icon-\"],.qti-item input.small[type=\"reset\"] [class*=\" icon-\"]{font-size:13px;font-size:1.3rem}.qti-item [class^=\"btn-\"] [class^=\"icon-\"],.qti-item [class*=\" btn-\"] [class^=\"icon-\"],.qti-item .btn-default [class^=\"icon-\"],.qti-item button [class^=\"icon-\"],.qti-item input[type=\"submit\"] [class^=\"icon-\"],.qti-item input[type=\"reset\"] [class^=\"icon-\"],.qti-item [class^=\"btn-\"] [class*=\" icon-\"],.qti-item [class*=\" btn-\"] [class*=\" icon-\"],.qti-item .btn-default [class*=\" icon-\"],.qti-item button [class*=\" icon-\"],.qti-item input[type=\"submit\"] [class*=\" icon-\"],.qti-item input[type=\"reset\"] [class*=\" icon-\"]{font:tao !important;font-family:tao;font-size:14px;font-size:1.4rem;line-height:1;padding:0 9px 0 0;position:relative;top:1px;left:-1px;text-shadow:0 1px 0 rgba(0,0,0,0.1)}.qti-item [class^=\"btn-\"] [class^=\"icon-\"].r,.qti-item [class*=\" btn-\"] [class^=\"icon-\"].r,.qti-item .btn-default [class^=\"icon-\"].r,.qti-item button [class^=\"icon-\"].r,.qti-item input[type=\"submit\"] [class^=\"icon-\"].r,.qti-item input[type=\"reset\"] [class^=\"icon-\"].r,.qti-item [class^=\"btn-\"] [class*=\" icon-\"].r,.qti-item [class*=\" btn-\"] [class*=\" icon-\"].r,.qti-item .btn-default [class*=\" icon-\"].r,.qti-item button [class*=\" icon-\"].r,.qti-item input[type=\"submit\"] [class*=\" icon-\"].r,.qti-item input[type=\"reset\"] [class*=\" icon-\"].r{padding:0 0 0 9px}.qti-item :hover[class^=\"btn-\"],.qti-item :hover[class*=\" btn-\"],.qti-item .btn-default:hover,.qti-item button:hover,.qti-item input:hover[type=\"submit\"],.qti-item input:hover[type=\"reset\"]{opacity:.85}.qti-item .btn-info[class^=\"btn-\"],.qti-item .btn-info[class*=\" btn-\"],.qti-item .btn-info.btn-default,.qti-item button.btn-info,.qti-item input.btn-info[type=\"submit\"],.qti-item input.btn-info[type=\"reset\"]{color:#fff;background-color:#266d9c;text-shadow:1px 1px 0 #0b4a74}.qti-item .btn-info.btn-secondary[class^=\"btn-\"],.qti-item .btn-info.btn-secondary[class*=\" btn-\"],.qti-item .btn-info.btn-secondary.btn-default,.qti-item button.btn-info.btn-secondary,.qti-item input.btn-info.btn-secondary[type=\"submit\"],.qti-item input.btn-info.btn-secondary[type=\"reset\"]{color:#266d9c;border:1px solid #266d9c;background-color:#fff;text-shadow:none}.qti-item .btn-error[class^=\"btn-\"],.qti-item .btn-error[class*=\" btn-\"],.qti-item .btn-error.btn-default,.qti-item button.btn-error,.qti-item input.btn-error[type=\"submit\"],.qti-item input.btn-error[type=\"reset\"]{color:#fff;background-color:#c12a40;text-shadow:1px 1px 0 #950e22}.qti-item .btn-error.btn-secondary[class^=\"btn-\"],.qti-item .btn-error.btn-secondary[class*=\" btn-\"],.qti-item .btn-error.btn-secondary.btn-default,.qti-item button.btn-error.btn-secondary,.qti-item input.btn-error.btn-secondary[type=\"submit\"],.qti-item input.btn-error.btn-secondary[type=\"reset\"]{color:#c12a40;border:1px solid #c12a40;background-color:#fff;text-shadow:none}.qti-item .btn-success[class^=\"btn-\"],.qti-item .btn-success[class*=\" btn-\"],.qti-item .btn-success.btn-default,.qti-item button.btn-success,.qti-item input.btn-success[type=\"submit\"],.qti-item input.btn-success[type=\"reset\"]{color:#fff;background-color:#269c5d;text-shadow:1px 1px 0 #0b743c}.qti-item .btn-success.btn-secondary[class^=\"btn-\"],.qti-item .btn-success.btn-secondary[class*=\" btn-\"],.qti-item .btn-success.btn-secondary.btn-default,.qti-item button.btn-success.btn-secondary,.qti-item input.btn-success.btn-secondary[type=\"submit\"],.qti-item input.btn-success.btn-secondary[type=\"reset\"]{color:#269c5d;border:1px solid #269c5d;background-color:#fff;text-shadow:none}.qti-item .btn-warning[class^=\"btn-\"],.qti-item .btn-warning[class*=\" btn-\"],.qti-item .btn-warning.btn-default,.qti-item button.btn-warning,.qti-item input.btn-warning[type=\"submit\"],.qti-item input.btn-warning[type=\"reset\"]{color:#fff;background-color:#dcb66b;text-shadow:1px 1px 0 #ad8b49}.qti-item .btn-warning.btn-secondary[class^=\"btn-\"],.qti-item .btn-warning.btn-secondary[class*=\" btn-\"],.qti-item .btn-warning.btn-secondary.btn-default,.qti-item button.btn-warning.btn-secondary,.qti-item input.btn-warning.btn-secondary[type=\"submit\"],.qti-item input.btn-warning.btn-secondary[type=\"reset\"]{color:#dcb66b;border:1px solid #dcb66b;background-color:#fff;text-shadow:none}.qti-item .disabled,.qti-item button[disabled]{background-color:#afb4bb !important;text-shadow:1px 1px 0 rgba(255,255,255,0.8) !important;cursor:not-allowed !important;opacity:.55 !important;color:#000 !important;border:none !important}.qti-item .ui-button [class^=\"icon-\"],.qti-item .ui-button [class*=\" icon-\"]{font-family:tao !important}.qti-item .noUi-target,.qti-item .noUi-target *{-webkit-touch-callout:none;-webkit-user-select:none;-ms-touch-action:none;-ms-user-select:none;-moz-user-select:none;-moz-box-sizing:border-box;box-sizing:border-box}.qti-item .noUi-base{width:100%;height:100%;position:relative}.qti-item .noUi-origin{position:absolute;right:0;top:0;left:0;bottom:0}.qti-item .noUi-handle{position:relative;z-index:1}.qti-item .noUi-stacking .noUi-handle{z-index:10}.qti-item .noUi-stacking+.noUi-origin{*z-index:-1}.qti-item .noUi-state-drag *{cursor:inherit !important}.qti-item .noUi-horizontal{height:11px}.qti-item .noUi-horizontal .noUi-handle{width:10px;height:17px;left:-5px;top:-4px}.qti-item .noUi-horizontal .noUi-handle:after{border-top:3px solid #a4a9b1;border-left:5px solid transparent;border-right:5px solid transparent;content:\"\";left:0;position:absolute;bottom:-3px;width:0}.qti-item .qti-slider-values{margin-top:6px !important}.qti-item .noUi-horizontal .noUi-handle:hover:after{border-top:3px solid #3e7da7}.qti-item .noUi-horizontal .noUi-handle.noUi-active:after{border-top-color:#3e7da7}.qti-item .noUi-horizontal.noUi-extended{padding:0 15px}.qti-item .noUi-horizontal.noUi-extended .noUi-origin{right:-15px}.qti-item .noUi-vertical{width:11px;height:200px;display:inline-block}.qti-item .noUi-vertical .noUi-handle{width:17px;height:10px;left:-4px;top:-5px}.qti-item .noUi-vertical.noUi-extended{padding:15px 0}.qti-item .noUi-vertical.noUi-extended .noUi-origin{bottom:-15px}.qti-item .noUi-background{background:#fff}.qti-item .noUi-connect{background:#f3f1ef}.qti-item .noUi-target{border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px}.qti-item .noUi-dragable{cursor:w-resize}.qti-item .noUi-vertical .noUi-dragable{cursor:n-resize}.qti-item .noUi-handle{background:#a4a9b1;color:#a4a9b1;cursor:default}.qti-item .noUi-active,.qti-item .noUi-handle:hover{background:#3e7da7;color:#3e7da7}.qti-item .noUi-handle:after{left:17px}.qti-item .noUi-vertical .noUi-handle:before,.qti-item .noUi-vertical .noUi-handle:after{width:14px;height:1px;left:6px;top:14px}.qti-item .noUi-vertical .noUi-handle:after{top:17px}.qti-item [disabled].noUi-connect,.qti-item [disabled] .noUi-connect{background:#B8B8B8}.qti-item [disabled] .noUi-handle{cursor:not-allowed}.qti-item .noUi-horizontal .step-marker{position:relative}.qti-item .noUi-horizontal .step-marker span{font-size:10px;position:relative;display:block;float:left;text-align:center;min-height:10px}.qti-item .noUi-horizontal .step-marker span:before{width:1px;height:5px;position:absolute;content:'';background:#434343;left:50%}.qti-item .noUi-horizontal .step-marker.after{top:5px}.qti-item .noUi-horizontal .step-marker.after span:before{top:-4px}.qti-item .noUi-horizontal .step-marker.before{top:-28px}.qti-item .noUi-horizontal .step-marker.before span:before{top:13px}.qti-item .item-editor-sidebar .noUi-target{margin-left:4px;margin-right:4px}.qti-item .noUi-vertical-wrapper{position:relative;display:inline-block}.qti-item .noUi-vertical-wrapper .step-marker{position:absolute;height:100%;top:0}.qti-item .noUi-vertical-wrapper .step-marker span{font-size:10px;position:relative;display:block}.qti-item .noUi-vertical-wrapper .step-marker span:before{width:5px;height:1px;position:absolute;content:'';background:#434343;top:50%}.qti-item .noUi-vertical-wrapper .step-marker.after{left:20px}.qti-item .noUi-vertical-wrapper .step-marker.after span:before{left:-9px}.qti-item .noUi-vertical-wrapper .step-marker.before span:before{left:-40%}.qti-item .grid-row,.qti-item .fixed-grid-row{width:100%}.qti-item .grid-row [class*=\" col-\"].col-12,.qti-item .grid-row [class^=\"col-\"].col-12,.qti-item .fixed-grid-row [class*=\" col-\"].col-12,.qti-item .fixed-grid-row [class^=\"col-\"].col-12{width:100%}.qti-item .grid-row [class*=\" col-\"]:last-child,.qti-item .grid-row [class^=\"col-\"]:last-child,.qti-item .fixed-grid-row [class*=\" col-\"]:last-child,.qti-item .fixed-grid-row [class^=\"col-\"]:last-child{margin-right:0}.qti-item .grid-container{overflow-x:visible !important}.qti-item.runtime{min-height:100%}.qti-item [class*=\"col-\"] img{max-width:initial}.qti-item #modalFeedbacks{max-height:0}.qti-item .qti-itemBody .qti-modalFeedback{border-width:1px;padding:10px 10px 15px;background:#cfdfe9;position:relative;z-index:100002}.qti-item .qti-itemBody .qti-modalFeedback.positive{background:#cfe9db}.qti-item .qti-itemBody .qti-modalFeedback.negative{background:#f1d0d5}.qti-item .qti-itemBody.highlighter-cursor{cursor:url(\"../img/qtiIconsPng/marker.png\") 0 32,auto}.qti-item .interaction-cover{display:block;opacity:0.05}.qti-item .qti-choice p:last-child,.qti-item .qti-prompt-container p:last-child{margin-bottom:0 !important}.qti-item .prompt,.qti-item .qti-prompt{word-wrap:break-word;overflow-wrap:break-word}.qti-item .MathJax{display:inline-table}.qti-item .MathJax:focus{outline:0}.qti-item .MathJax span{line-height:inherit;font-size:inherit}.qti-item.runtime .block-listing>li.active{border-color:#3e7da7 !important}.qti-item .block-listing>li{border:1px solid #e0e0e0;border-radius:2px;-webkit-border-radius:2px;background:transparent;padding:5px;margin:3px;cursor:pointer;position:relative}.qti-item .block-listing.horizontal{padding-right:3px;padding-left:3px}.qti-item .block-listing.horizontal>li{display:block;float:left}.qti-item [dir=rtl] .block-listing.horizontal>li{float:right}.qti-item .block-listing.solid,.qti-item .block-listing.bordered{padding-top:3px;padding-bottom:3px}.qti-item .block-listing.solid.none,.qti-item .block-listing.bordered.none{padding-left:3px}.qti-item [dir=rtl] .block-listing.solid.none,.qti-item [dir=rtl] .block-listing.bordered.none{padding-left:auto;padding-right:3px}.qti-item .qti-block{border:1px solid transparent}.qti-item .qti-interaction:focus{outline-color:#0E5D91}.qti-item .qti-interaction .text-container{min-height:50px}.qti-item .qti-interaction .text-container.text-preformatted{font-family:Consolas,\"Andale Mono WT\",\"Andale Mono\",\"Lucida Console\",\"Lucida Sans Typewriter\",\"DejaVu Sans Mono\",\"Bitstream Vera Sans Mono\",\"Liberation Mono\",\"Nimbus Mono L\",Monaco,\"Courier New\",Courier,monospace}.qti-item .qti-interaction .solid{border:6px solid #f5f4f2}.qti-item .qti-interaction .bordered{border:1px solid #e0e0e0;border-radius:2px;-webkit-border-radius:2px;background:white}.qti-item .qti-interaction .empty{border:1px #3e7da7 dashed !important;min-height:50px;cursor:default}.qti-item .qti-interaction input[type=\"color\"],.qti-item .qti-interaction input[type=\"date\"],.qti-item .qti-interaction input[type=\"datetime\"],.qti-item .qti-interaction input[type=\"datetime-local\"],.qti-item .qti-interaction input[type=\"email\"],.qti-item .qti-interaction input[type=\"month\"],.qti-item .qti-interaction input[type=\"number\"],.qti-item .qti-interaction input[type=\"range\"],.qti-item .qti-interaction input[type=\"search\"],.qti-item .qti-interaction input[type=\"tel\"],.qti-item .qti-interaction input[type=\"time\"],.qti-item .qti-interaction input[type=\"text\"],.qti-item .qti-interaction input[type=\"password\"],.qti-item .qti-interaction input[type=\"url\"],.qti-item .qti-interaction input[type=\"week\"],.qti-item .qti-interaction textarea,.qti-item .qti-interaction select{border-top-color:#aaa;border-left-color:#aaa}.qti-item .qti-interaction[class^=\"list-style-\"]>p::before,.qti-item .qti-interaction[class^=\"list-style-\"]>div::before,.qti-item .qti-interaction[class^=\"list-style-\"]>li::before,.qti-item .qti-interaction[class*=\" list-style-\"]>p::before,.qti-item .qti-interaction[class*=\" list-style-\"]>div::before,.qti-item .qti-interaction[class*=\" list-style-\"]>li::before{content:normal}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-object-container{display:inline-block;vertical-align:bottom}.qti-item .qti-object-container.previewer{min-width:10px;min-height:10px;max-width:100%}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-choiceInteraction .overlay-answer-eliminator{display:none}.qti-item .qti-choiceInteraction [data-eliminable=\"container\"]{display:none;position:absolute;z-index:3;top:0;min-height:22px;max-height:100%;min-width:20px;margin:5px 0;padding:0;left:50px}.qti-item [dir=rtl] .qti-choiceInteraction [data-eliminable=\"container\"]{left:auto;right:50px}.qti-item .qti-choiceInteraction [data-eliminable=\"container\"]:after{content:\"0\";visibility:hidden;pointer-events:none}.qti-item .qti-choiceInteraction [data-eliminable=\"container\"] [data-eliminable=\"trigger\"]{font-size:1.6rem;z-index:4;cursor:pointer}.qti-item .qti-choiceInteraction [data-eliminable=\"container\"]::before{position:absolute;font:inherit;cursor:default;left:50%;transform:translateX(-50%);bottom:calc(100% + 20px)}.qti-item .qti-choiceInteraction .real-label{left:0;padding-right:10px}.qti-item [dir=rtl] .qti-choiceInteraction .real-label{left:auto;right:0;padding-right:0;padding-left:10px}.qti-item .qti-choiceInteraction .label-box{margin-left:24px}.qti-item [dir=rtl] .qti-choiceInteraction .label-box{margin-left:0;margin-right:24px}.qti-item .qti-choiceInteraction.eliminable .label-box{margin-left:85px}.qti-item [dir=rtl] .qti-choiceInteraction.eliminable .label-box{margin-left:auto;margin-right:85px}.qti-item .qti-choiceInteraction.eliminable .choice-area{margin-top:25px}.qti-item .qti-choiceInteraction.eliminable .choice-area[class^=\"list-style-\"] [data-eliminable=\"container\"],.qti-item .qti-choiceInteraction.eliminable .choice-area[class*=\" list-style-\"] [data-eliminable=\"container\"]{left:73px}.qti-item [dir=rtl] .qti-choiceInteraction.eliminable .choice-area[class^=\"list-style-\"] [data-eliminable=\"container\"],.qti-item [dir=rtl] .qti-choiceInteraction.eliminable .choice-area[class*=\" list-style-\"] [data-eliminable=\"container\"]{left:auto;right:73px}.qti-item .qti-choiceInteraction.eliminable .choice-area [data-eliminable]{display:block}.qti-item .qti-choiceInteraction.eliminable .qti-choice.eliminated .label-box .label-content{position:relative}.qti-item .qti-choiceInteraction.eliminable .qti-choice.eliminated .label-box .label-content .qti-block:after{content:' ';width:100%;position:relative;top:-21px}.qti-item .qti-choiceInteraction.eliminable .qti-choice.eliminated .label-box .label-content .overlay-answer-eliminator{stroke:#000;stroke-width:1;display:inline;height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%}.qti-item .qti-choiceInteraction.eliminable .qti-choice.eliminated:before,.qti-item .qti-choiceInteraction.eliminable .qti-choice.eliminated .pseudo-label-box{opacity:.3}.qti-item .qti-choiceInteraction.eliminable .qti-choice.eliminated:before,.qti-item .qti-choiceInteraction.eliminable .qti-choice.eliminated .label-box{cursor:not-allowed}.qti-item .qti-choiceInteraction.eliminable .qti-choice.eliminated:after{content:\"\";width:100%;height:100%;background:#fff;opacity:.7;display:block;position:absolute;top:0;left:0;cursor:not-allowed}.qti-item .qti-choiceInteraction.eliminable .qti-choice.eliminated [data-eliminable=\"container\"]{cursor:not-allowed}.qti-item .qti-choiceInteraction.eliminable .qti-choice.eliminated [data-eliminable=\"container\"] [data-eliminable=\"trigger\"]:before{content:\"\\e69c\"}.qti-item .qti-choiceInteraction.eliminable .qti-choice:first-child [data-eliminable=\"container\"]::before{content:attr(data-label)}.qti-item .qti-choiceInteraction .qti-choice .real-label{min-height:22px;max-height:100%;display:flex;align-items:center;top:0px;-webkit-tap-highlight-color:transparent}.qti-item .qti-choiceInteraction .qti-choice .real-label:before{content:\"0\";min-width:20px;visibility:hidden;pointer-events:none}.qti-item .qti-choiceInteraction .icon-radio,.qti-item .qti-choiceInteraction .icon-checkbox{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.qti-item [dir=rtl] .qti-choiceInteraction .icon-radio:before,.qti-item [dir=rtl] .qti-choiceInteraction .icon-checkbox:before{right:-1em}.qti-item .qti-choiceInteraction .icon-radio:after,.qti-item .qti-choiceInteraction .icon-checkbox:after{left:-1em}.qti-item [dir=rtl] .qti-choiceInteraction .icon-radio:after,.qti-item [dir=rtl] .qti-choiceInteraction .icon-checkbox:after{left:auto}.qti-item .qti-choiceInteraction .choice-area[class^=\"list-style-\"] .label-content,.qti-item .qti-choiceInteraction .choice-area[class*=\" list-style-\"] .label-content{margin-left:30px}.qti-item [dir=rtl] .qti-choiceInteraction .choice-area[class^=\"list-style-\"] .label-content,.qti-item [dir=rtl] .qti-choiceInteraction .choice-area[class*=\" list-style-\"] .label-content{margin-left:auto;margin-right:30px}.qti-item .qti-choiceInteraction .choice-area[class^=\"list-style-\"] p::before,.qti-item .qti-choiceInteraction .choice-area[class^=\"list-style-\"] div::before,.qti-item .qti-choiceInteraction .choice-area[class^=\"list-style-\"] li::before,.qti-item .qti-choiceInteraction .choice-area[class*=\" list-style-\"] p::before,.qti-item .qti-choiceInteraction .choice-area[class*=\" list-style-\"] div::before,.qti-item .qti-choiceInteraction .choice-area[class*=\" list-style-\"] li::before{position:absolute;top:4px;min-height:22px;max-height:100%;display:flex;align-items:center;left:30px}.qti-item [dir=rtl] .qti-choiceInteraction .choice-area[class^=\"list-style-\"] p::before,.qti-item [dir=rtl] .qti-choiceInteraction .choice-area[class^=\"list-style-\"] div::before,.qti-item [dir=rtl] .qti-choiceInteraction .choice-area[class^=\"list-style-\"] li::before,.qti-item [dir=rtl] .qti-choiceInteraction .choice-area[class*=\" list-style-\"] p::before,.qti-item [dir=rtl] .qti-choiceInteraction .choice-area[class*=\" list-style-\"] div::before,.qti-item [dir=rtl] .qti-choiceInteraction .choice-area[class*=\" list-style-\"] li::before{left:auto;right:30px}.qti-item .qti-choiceInteraction .choice-area[class^=\"list-style-\"] p.add-option:before,.qti-item .qti-choiceInteraction .choice-area[class^=\"list-style-\"] div.add-option:before,.qti-item .qti-choiceInteraction .choice-area[class^=\"list-style-\"] li.add-option:before,.qti-item .qti-choiceInteraction .choice-area[class*=\" list-style-\"] p.add-option:before,.qti-item .qti-choiceInteraction .choice-area[class*=\" list-style-\"] div.add-option:before,.qti-item .qti-choiceInteraction .choice-area[class*=\" list-style-\"] li.add-option:before{content:'';display:inline}.qti-item .qti-choiceInteraction .block-listing>li{margin-top:0;margin-bottom:0;border-top:none;border-bottom:none;-moz-border-radius:0px;-webkit-border-radius:0px;border-radius:0px}.qti-item .qti-choiceInteraction .block-listing>li:first-child{margin-top:3px;border-top:1px solid #eee;-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}.qti-item .qti-choiceInteraction .block-listing>li:last-child{margin-bottom:3px;border-bottom:1px solid #eee;-webkit-border-bottom-right-radius:2px;-webkit-border-bottom-left-radius:2px;-moz-border-radius-bottomright:2px;-moz-border-radius-bottomleft:2px;border-bottom-right-radius:2px;border-bottom-left-radius:2px}.qti-item .qti-choiceInteraction .block-listing.horizontal>li{margin:3px;border:1px solid #eee;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.qti-item .qti-choiceInteraction .label-content [data-html-editable=true],.qti-item .qti-choiceInteraction .label-content{min-height:22px;max-height:100%;display:block}.qti-item .qti-choiceInteraction .checked span.icon-checkbox:before{font-family:'tao' !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\e69d\"}.qti-item .qti-choiceInteraction .checked span.icon-radio:before{font-family:'tao' !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\e69a\"}.qti-item .qti-choiceInteraction .real-label input{opacity:0;left:auto}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-orderInteraction .arrow-bar{text-align:center}.qti-item .qti-orderInteraction .arrow-bar span{margin:3px auto;font-size:25px;font-size:2.5rem;color:#919191;background:#f9f8f7;cursor:default;height:40px}.qti-item .qti-orderInteraction .arrow-bar span.active{background:#f3f1ef;cursor:pointer;color:#222}.qti-item .qti-orderInteraction .arrow-bar span.active:hover{color:#fff;background:#3e7da7}.qti-item .qti-orderInteraction .arrow-bar span.triggered{color:#fff;background:#3e7da7}.qti-item .qti-orderInteraction.qti-vertical .order-interaction-area{display:table;border-collapse:separate;border-spacing:5px 5px 5px 0;width:100%}.qti-item .qti-orderInteraction.qti-vertical ul.source,.qti-item .qti-orderInteraction.qti-vertical ul.target,.qti-item .qti-orderInteraction.qti-vertical ol.source,.qti-item .qti-orderInteraction.qti-vertical ol.target{display:table-cell;width:43%;padding-left:40px;padding-right:3px}.qti-item [dir=rtl] .qti-orderInteraction.qti-vertical ul.source,.qti-item [dir=rtl] .qti-orderInteraction.qti-vertical ul.target,.qti-item [dir=rtl] .qti-orderInteraction.qti-vertical ol.source,.qti-item [dir=rtl] .qti-orderInteraction.qti-vertical ol.target{padding-left:3px;padding-right:40px}.qti-item .qti-orderInteraction.qti-vertical .arrow-bar{display:table-cell;vertical-align:middle;padding:5px}.qti-item .qti-orderInteraction.qti-vertical .arrow-bar .icon-move-before{content:\"\\e610\"}.qti-item .qti-orderInteraction.qti-vertical .arrow-bar .icon-move-behind{content:\"\\e611\"}.qti-item .qti-orderInteraction.qti-vertical .arrow-bar span{padding:8px 0;display:block;width:50px}.qti-item .qti-orderInteraction.qti-vertical .arrow-bar span.inactive{visibility:hidden}.qti-item .qti-orderInteraction.qti-vertical .arrow-bar.middle span.inactive{display:none}.qti-item [dir=rtl] .qti-orderInteraction.qti-vertical .icon-add-to-selection,.qti-item [dir=rtl] .qti-orderInteraction.qti-vertical .icon-remove-from-selection{transform:scale(-1)}.qti-item .qti-orderInteraction.qti-horizontal .block-listing{min-height:38px}.qti-item .qti-orderInteraction.qti-horizontal .arrow-bar{margin-bottom:10px}.qti-item .qti-orderInteraction.qti-horizontal .arrow-bar span{padding:0 15px;display:inline-block;line-height:1.6}.qti-item .qti-orderInteraction.qti-horizontal .arrow-bar span.inactive{visibility:hidden}.qti-item .qti-orderInteraction.qti-horizontal .arrow-bar span.icon-move-before{content:\"\\e610\"}.qti-item .qti-orderInteraction.qti-horizontal .arrow-bar span.icon-move-behind{content:\"\\e611\"}.qti-item [dir=rtl] .qti-orderInteraction.qti-horizontal .icon-move-after,.qti-item [dir=rtl] .qti-orderInteraction.qti-horizontal .icon-move-before{transform:scale(-1)}.qti-item .qti-orderInteraction li.dragged{border-color:#3e7da7 !important;list-style:none}.qti-item .qti-orderInteraction .drag-container{position:absolute;display:none;padding:0;margin:0;z-index:1}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-extendedTextInteraction .text-container{min-height:50px}.qti-item .qti-extendedTextInteraction .text-container.text-preformatted{font-family:Consolas,\"Andale Mono WT\",\"Andale Mono\",\"Lucida Console\",\"Lucida Sans Typewriter\",\"DejaVu Sans Mono\",\"Bitstream Vera Sans Mono\",\"Liberation Mono\",\"Nimbus Mono L\",Monaco,\"Courier New\",Courier,monospace}.qti-item .qti-extendedTextInteraction input{width:100%}.qti-item .qti-extendedTextInteraction pre{font-family:\"Source Sans Pro\",sans-serif}.qti-item .qti-extendedTextInteraction .solid>li,.qti-item .qti-extendedTextInteraction .bordered>li{padding:0;border:none}.qti-item .qti-extendedTextInteraction .solid ~ input,.qti-item .qti-extendedTextInteraction .solid ~ textarea,.qti-item .qti-extendedTextInteraction .solid ~ .cke,.qti-item .qti-extendedTextInteraction .bordered ~ input,.qti-item .qti-extendedTextInteraction .bordered ~ textarea,.qti-item .qti-extendedTextInteraction .bordered ~ .cke{border:6px solid #f5f4f2}.qti-item .qti-extendedTextInteraction .solid ~ input .cke_top,.qti-item .qti-extendedTextInteraction .solid ~ textarea .cke_top,.qti-item .qti-extendedTextInteraction .solid ~ .cke .cke_top,.qti-item .qti-extendedTextInteraction .bordered ~ input .cke_top,.qti-item .qti-extendedTextInteraction .bordered ~ textarea .cke_top,.qti-item .qti-extendedTextInteraction .bordered ~ .cke .cke_top{border:none;margin:3px;width:calc(100% - 6px);-webkit-box-shadow:0 0 0 0 rgba(0,0,0,0);-moz-box-shadow:0 0 0 0 rgba(0,0,0,0);-ms-box-shadow:0 0 0 0 rgba(0,0,0,0);-o-box-shadow:0 0 0 0 rgba(0,0,0,0);box-shadow:0 0 0 0 rgba(0,0,0,0)}.qti-item .qti-extendedTextInteraction .solid ~ input .cke_bottom,.qti-item .qti-extendedTextInteraction .solid ~ textarea .cke_bottom,.qti-item .qti-extendedTextInteraction .solid ~ .cke .cke_bottom,.qti-item .qti-extendedTextInteraction .bordered ~ input .cke_bottom,.qti-item .qti-extendedTextInteraction .bordered ~ textarea .cke_bottom,.qti-item .qti-extendedTextInteraction .bordered ~ .cke .cke_bottom{border:none}.qti-item .qti-extendedTextInteraction .active>input,.qti-item .qti-extendedTextInteraction .active>textarea,.qti-item .qti-extendedTextInteraction .active input.active,.qti-item .qti-extendedTextInteraction .active textarea.active{border-color:#3e7da7}.qti-item .qti-extendedTextInteraction textarea{max-width:100% !important;width:100%;height:150px;resize:none}.qti-item .qti-extendedTextInteraction textarea[disabled=\"disabled\"]{background-color:white;opacity:1 !important}.qti-item .qti-extendedTextInteraction .text-counter{text-align:right}.qti-item .qti-extendedTextInteraction .text-counter .count-words,.qti-item .qti-extendedTextInteraction .text-counter .count-chars{font-weight:bold}.qti-item .item-instruction{padding:8px 20px 8px 45px;text-align:left}.qti-item [dir=rtl] .item-instruction{padding:8px 45px 8px 20px;text-align:right}.qti-item .item-instruction .icon{left:10px}.qti-item [dir=rtl] .item-instruction .icon{left:auto;right:10px}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-associateInteraction .empty{cursor:pointer;min-height:0}.qti-item .qti-associateInteraction .choice-area{margin-bottom:30px}.qti-item .qti-associateInteraction .choice-area .deactivated{opacity:0.2;cursor:default !important}.qti-item .qti-associateInteraction .choice-area>.qti-choice{min-width:100px;min-height:30px;max-width:180px}.qti-item .qti-associateInteraction .choice-area>.qti-choice .qti-block img{display:flex}.qti-item .qti-associateInteraction .result-area{width:40%;min-width:260px;margin:auto}.qti-item .qti-associateInteraction .result-area>li{display:block;margin-bottom:30px;position:relative}.qti-item .qti-associateInteraction .result-area>li:before{border-top:1px solid #87aec8;display:block;width:80%;left:10%;height:1px;position:absolute;z-index:1;top:50%}.qti-item .qti-associateInteraction .result-area>li>.target{background:white;padding:5px;margin:5px;float:right;position:relative;z-index:2;min-width:100px;min-height:30px;max-width:180px;outline:5px #f5f4f2 solid;border:1px solid #eee;border-radius:2px;-webkit-border-radius:2px;overflow:hidden}.qti-item .qti-associateInteraction .result-area>li>.target .qti-block img{display:flex}.qti-item .qti-associateInteraction .result-area>li>.target.active{border-color:#3e7da7}.qti-item .qti-associateInteraction .result-area>li>.target:first-child{float:left}.qti-item .qti-associateInteraction .result-area>li>.target.dragged,.qti-item .qti-associateInteraction .result-area>li>.target.dragged:hover{outline:0}.qti-item .qti-associateInteraction .result-area>li.removing>div{background-color:#eee}.qti-item .qti-associateInteraction .result-area>li.incomplete-pair>div{border:1px dashed #ccc}.qti-item .qti-associateInteraction .result-area .remove-choice{cursor:pointer;position:absolute;right:0;bottom:0;margin:0 2px 2px 0;color:#0e5d91}.qti-item .qti-associateInteraction .result-area .remove-choice:hover{opacity:0.6}.qti-item .result-area>li>div.filled ~ div.filled:before{border-top:1px solid #87c8a5 !important}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-matchInteraction .matrix{table-layout:fixed}.qti-item .qti-matchInteraction .matrix tbody [data-edit]{width:30px}.qti-item .qti-matchInteraction .matrix td,.qti-item .qti-matchInteraction .matrix th{color:#222;text-align:left;position:relative}.qti-item [dir=rtl] .qti-matchInteraction .matrix td,.qti-item [dir=rtl] .qti-matchInteraction .matrix th{text-align:right}.qti-item .qti-matchInteraction .matrix td:not(.qti-choice),.qti-item .qti-matchInteraction .matrix th:not(.qti-choice){position:relative}.qti-item .qti-matchInteraction .matrix td:not(.qti-choice) label,.qti-item .qti-matchInteraction .matrix th:not(.qti-choice) label{top:0;left:0;width:100%;padding:inherit;height:100%}.qti-item .qti-matchInteraction .matrix td:not(.qti-choice) label .icon-checkbox,.qti-item .qti-matchInteraction .matrix th:not(.qti-choice) label .icon-checkbox{position:absolute;top:calc(50% - .8rem)}.qti-item .qti-matchInteraction .matrix td .inner-wrapper,.qti-item .qti-matchInteraction .matrix th .inner-wrapper{position:static}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-mediaInteraction .mejs-container iframe{min-height:inherit}.qti-item .qti-mediaInteraction .overlay{background:#000;z-index:999;position:relative;opacity:0;width:100%;height:100%}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-graphicInteraction .source li>img{display:block}.qti-item .qti-graphicInteraction .active>input,.qti-item .qti-graphicInteraction .active>textarea,.qti-item .qti-graphicInteraction .active input.active,.qti-item .qti-graphicInteraction .active textarea.active{border-color:#3e7da7}.qti-item .qti-graphicInteraction .image-editor{position:relative;float:left;padding:3px}.qti-item .qti-graphicInteraction .image-editor .mapping-editor{display:none;position:absolute;width:150px;height:150px;text-align:left;z-index:10009}.qti-item .qti-graphicInteraction .main-image-box{margin:0 auto;padding:0;text-align:center;overflow:visible}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-graphicGapMatchInteraction ul.source{width:100%;margin:10px auto;padding:3px !important;clear:both;min-height:60px}.qti-item .qti-graphicGapMatchInteraction ul.source>li{background:#fff;border:solid 1px #ddd !important;line-height:60px;min-height:60px;min-width:60px;text-align:center;max-width:100%;font-size:20px;font-size:2rem;margin:0 3px 3px 0 !important;padding:0;cursor:pointer}.qti-item .qti-graphicGapMatchInteraction ul.source>li.active{border:solid 1px #3e7da7 !important;-webkit-transition:background, .1s, ease-out, 0s;-moz-transition:background, .1s, ease-out, 0s;-ms-transition:background, .1s, ease-out, 0s;-o-transition:background, .1s, ease-out, 0s;transition:background, .1s, ease-out, 0s}.qti-item .qti-graphicGapMatchInteraction ul.source>li.active:hover{background:#fff !important;cursor:default !important}.qti-item .qti-graphicGapMatchInteraction ul.source>li.active.selectable:hover{cursor:pointer !important}.qti-item .qti-graphicGapMatchInteraction ul.source>li.dragged{z-index:10}.qti-item .qti-graphicGapMatchInteraction ul.source>li.disabled{border:none;cursor:default !important;color:#333 !important;background-color:transparent !important}.qti-item .qti-graphicGapMatchInteraction ul.source>li img{display:block}.qti-item .qti-graphicGapMatchInteraction .gap-filler{display:block;position:absolute;z-index:20000}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-graphicOrderInteraction ul.ordinals{width:100%;margin:10px auto;padding:0 !important;clear:both;min-height:54px}.qti-item .qti-graphicOrderInteraction ul.ordinals>li{width:30px;line-height:30px;text-align:center;font-size:20px;font-size:2rem;margin:0;background:#fff;font-family:helvetica, arial, sans-serif;margin-right:1px}.qti-item .qti-graphicOrderInteraction ul.ordinals>li:hover{cursor:pointer}.qti-item .qti-graphicOrderInteraction ul.ordinals>li.active{border:solid 1px #3e7da7;-webkit-transition:background, .4s, ease-out, 0s;-moz-transition:background, .4s, ease-out, 0s;-ms-transition:background, .4s, ease-out, 0s;-o-transition:background, .4s, ease-out, 0s;transition:background, .4s, ease-out, 0s}.qti-item .qti-graphicOrderInteraction ul.ordinals>li.active:hover{background:#fff !important;cursor:default !important}.qti-item .qti-graphicOrderInteraction ul.ordinals>li.disabled{border:none;cursor:default !important;color:#666 !important;background-color:transparent !important}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-SelectPointInteraction .txt-success:hover{background:transparent !important}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .runtime:not(.widget-box) .qti-hottextInteraction .qti-hottext{padding:1px;border-width:1px !important}.qti-item .qti-hottextInteraction strong,.qti-item .qti-hottextInteraction em,.qti-item .qti-hottextInteraction sub,.qti-item .qti-hottextInteraction sup{text-decoration:inherit}.qti-item [dir=rtl] .qti-hottextInteraction .qti-flow-container p{display:flex;flex-wrap:wrap}.qti-item .qti-hottextInteraction .qti-hottext{display:inline-block;background:#f3f1ef;color:#222;margin-right:5px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;position:relative;border-width:0px !important;text-decoration:inherit}.qti-item .qti-hottextInteraction .qti-hottext.error{color:#ba122b}.qti-item .qti-hottextInteraction .qti-hottext .hottext-checkmark{padding-left:3px;padding-right:0;width:20px}.qti-item [dir=rtl] .qti-hottextInteraction .qti-hottext .hottext-checkmark{padding-left:0px;padding-right:3px}.qti-item [dir=rtl] .qti-hottextInteraction .qti-hottext .hottext-content{padding-left:3px}.qti-item .qti-hottextInteraction .qti-hottext [class^=\"icon-\"].small,.qti-item .qti-hottextInteraction .qti-hottext [class*=\" icon-\"].small{font-size:12px;font-size:1.2rem;text-shadow:none;line-height:10px;top:1px}.qti-item .qti-hottextInteraction .qti-hottext [class^=\"icon-\"].small:before,.qti-item .qti-hottextInteraction .qti-hottext [class*=\" icon-\"].small:before{right:0em}.qti-item [dir=rtl] .qti-hottextInteraction .qti-hottext [class^=\"icon-\"].small:before,.qti-item [dir=rtl] .qti-hottextInteraction .qti-hottext [class*=\" icon-\"].small:before{right:-1em}.qti-item .qti-hottextInteraction .qti-hottext [class^=\"icon-\"].small:after,.qti-item .qti-hottextInteraction .qti-hottext [class*=\" icon-\"].small:after{left:-1em}.qti-item [dir=rtl] .qti-hottextInteraction .qti-hottext [class^=\"icon-\"].small:after,.qti-item [dir=rtl] .qti-hottextInteraction .qti-hottext [class*=\" icon-\"].small:after{right:0em}.qti-item .qti-hottextInteraction .qti-hottext [class^=\"icon-\"].error,.qti-item .qti-hottextInteraction .qti-hottext [class*=\" icon-\"].error{color:#ba122b}@media all and (-ms-high-contrast: none), (-ms-high-contrast: active){.qti-item .qti-hottextInteraction .qti-hottext [class^=\"icon-\"].small:before,.qti-item .qti-hottextInteraction .qti-hottext [class*=\" icon-\"].small:before{right:0.25em}.qti-item .qti-hottextInteraction .qti-hottext [class^=\"icon-\"].small:after,.qti-item .qti-hottextInteraction .qti-hottext [class*=\" icon-\"].small:after{right:0.5em}.qti-item [dir=rtl] .qti-hottextInteraction .qti-hottext [class^=\"icon-\"].small:before,.qti-item [dir=rtl] .qti-hottextInteraction .qti-hottext [class*=\" icon-\"].small:before{right:-0.25em}}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-gapMatchInteraction .gapmatch-content{border:solid 1px transparent;background:#f3f1ef;color:#222;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;position:relative;top:0px;min-width:45px;min-height:20px;display:inline-block}.qti-item .qti-gapMatchInteraction .gapmatch-content audio,.qti-item .qti-gapMatchInteraction .gapmatch-content canvas,.qti-item .qti-gapMatchInteraction .gapmatch-content img,.qti-item .qti-gapMatchInteraction .gapmatch-content video{vertical-align:baseline}.qti-item .qti-gapMatchInteraction .gapmatch-content.empty{min-height:20px}.qti-item .qti-gapMatchInteraction .gapmatch-content .remove{float:right}.qti-item .qti-gapMatchInteraction .gapmatch-content.filled{top:0 !important}.qti-item .qti-gapMatchInteraction .gapmatch-content .qti-block{display:inline-block}.qti-item .qti-gapMatchInteraction .choice-area .deactivated{cursor:default;opacity:0.2;pointer-events:none}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-sliderInteraction .ui-slider-horizontal{margin:0 20px}.qti-item .qti-sliderInteraction .ui-slider-vertical{margin:0 20px;display:inline-block}.qti-item .qti-sliderInteraction .qti-slider-values{position:relative}.qti-item .qti-sliderInteraction.qti-slider-horizontal .qti-slider-values{height:20px;margin:0 10px}.qti-item .qti-sliderInteraction.qti-slider-horizontal .slider-min,.qti-item .qti-sliderInteraction.qti-slider-horizontal .slider-max,.qti-item .qti-sliderInteraction.qti-slider-horizontal .slider-middle{position:absolute;width:40px;margin-left:-20px;text-align:center;font-size:12px;font-size:1.2rem}.qti-item .qti-sliderInteraction.qti-slider-horizontal .slider-min{left:0%}.qti-item .qti-sliderInteraction.qti-slider-horizontal .slider-max{left:100%}.qti-item .qti-sliderInteraction.qti-slider-vertical .qti-slider-values{width:30px;display:inline-block}.qti-item .qti-sliderInteraction.qti-slider-vertical .slider-min,.qti-item .qti-sliderInteraction.qti-slider-vertical .slider-max,.qti-item .qti-sliderInteraction.qti-slider-vertical .slider-middle{position:absolute}.qti-item .qti-sliderInteraction.qti-slider-vertical .slider-min{bottom:-10px}.qti-item .qti-sliderInteraction.qti-slider-vertical .slider-max{top:-10px}.qti-item .qti-sliderInteraction.qti-slider-vertical .ui-slider-handle{width:17px !important;height:10px !important;margin-left:-4px !important}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item select.qti-inlineChoiceInteraction{min-width:150px;max-width:100%;width:auto;padding-right:20px;font-size:14px}.qti-item .qti-inlineChoiceInteraction .select2-chosen{margin-right:30px}.qti-item .qti-inlineChoiceInteraction .select2-chosen,.qti-item select.qti-inlineChoiceInteraction,.qti-item .qti-inlineChoiceInteraction-dropdown .select2-result-label{font-family:\"Source Sans Pro\",sans-serif !important;font-weight:normal !important}.qti-item .qti-inlineChoiceInteraction.select2-container-active{outline-color:#0E5D91;outline-style:auto;outline-width:5px}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-textEntryInteraction table{border-collapse:separate;border-spacing:2px}.qti-item .qti-textEntryInteraction tr{height:27px;white-space:nowrap}.qti-item .qti-textEntryInteraction .icon-bin,.qti-item .qti-textEntryInteraction .icon-pin,.qti-item .qti-textEntryInteraction .icon-shuffle{text-align:center;padding:0 5px;cursor:pointer;vertical-align:middle}.qti-item .qti-textEntryInteraction .icon-radio,.qti-item .qti-textEntryInteraction .icon-checkbox,.qti-item .qti-textEntryInteraction .icon-radio-checked,.qti-item .qti-textEntryInteraction .icon-checkbox-checked{font-size:13px !important}.qti-item .qti-textEntryInteraction .icon-bin:hover,.qti-item .qti-textEntryInteraction .icon-pin:hover,.qti-item .qti-textEntryInteraction .icon-shuffle:hover{color:#3e7da7}.qti-item .qti-textEntryInteraction td[contenteditable],.qti-item .qti-textEntryInteraction .main-option{padding:0 7px;background:white;border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px}.qti-item .qti-textEntryInteraction .main-option{border-top:1px #ddd solid;border-bottom:1px #ddd solid;padding-right:29px;min-width:180px}.qti-item .qti-textEntryInteraction.review-text-container{line-height:2.5;border:2px solid black;padding:5px;margin:0 5px}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-uploadInteraction{padding:6px 6px 0 6px}.qti-item .qti-uploadInteraction input[type=\"file\"]{height:50px}.qti-item .qti-uploadInteraction .grid-row{margin-bottom:0 !important}.qti-item .qti-uploadInteraction .progressbar{margin-bottom:6px}.qti-item .qti-uploadInteraction .btn-info{padding-top:0 !important}.qti-item .qti-uploadInteraction .file-name{padding:2px 3px !important}.qti-item .qti-uploadInteraction .file-upload{margin-right:20px}.qti-item .qti-uploadInteraction .file-upload-preview{background-color:#f3f1ef;border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;max-width:100%;min-width:300px;min-height:250px;margin:0 20px 20px 0;height:auto;position:relative;overflow:hidden;display:none}.qti-item .qti-uploadInteraction .file-upload-preview img{max-width:100%}.qti-item .qti-uploadInteraction .file-upload-preview.visible-file-upload-preview{display:block}.qti-item .qti-uploadInteraction .file-upload-preview.clickable{cursor:pointer}.qti-item .qti-uploadInteraction .file-upload-preview.runtime-visible-file-upload-preview{min-width:unset;min-height:unset;height:auto;background:transparent}.qti-item .qti-uploadInteraction .file-upload-preview p.nopreview{position:absolute;top:32%;left:0;font-weight:normal;font-family:\"Source Sans Pro\",sans-serif;font-size:20px;font-size:2rem;text-shadow:1px 1px 0 rgba(0,0,0,0.3);color:#ddd;display:block;text-align:center;width:100%}.qti-item .qti-uploadInteraction .file-upload-preview p.nopreview:before{font-size:60px;font-size:6rem;font-family:'tao' !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\e670\";display:block !important}.qti-item .qti-uploadInteraction .file-upload-preview-popup{padding:40px 0 0;max-width:100%}.qti-item .qti-uploadInteraction .file-upload-preview-popup.modal{position:absolute;max-width:unset;height:auto;top:0 !important}.qti-item .qti-uploadInteraction .file-upload-preview-popup.modal .modal-body{overflow:auto;width:100%;height:100%;border-top:1px solid #ddd}.qti-item .qti-uploadInteraction .file-upload-preview-popup.modal img{display:block;margin:auto;max-width:unset}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-rubricBlock .qti-rubricBlock-body{border:1px solid transparent}.qti-item .qti-rubricBlock>.col-12{border:1px solid #DDD !important;background-color:rgba(243,241,239,0.3)}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item .qti-customInteraction{position:relative}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item table.qti-table{border:1px solid #8d949e}.qti-item table.qti-table.table-center{display:table;margin:0 auto}.qti-item table.qti-table.table-right{display:table;margin:0 0 0 auto}.qti-item table.qti-table tr:nth-child(even){background:white}.qti-item table.qti-table tr:nth-child(odd){background:#f2f2f3}.qti-item table.qti-table th{background-color:rgba(64,64,64,0.25);font-weight:bold}.qti-item table.qti-table th,.qti-item table.qti-table td{border:1px solid #8d949e;min-width:30px;padding:3px 5px}.qti-item .qti-uploadInteraction:before,.qti-item .qti-uploadInteraction:after{content:\" \";display:table}.qti-item .qti-uploadInteraction:after{clear:both}.qti-item [data-role=\"tooltip-target\"]{color:#0e5d91;text-decoration:dashed underline #0e5d91;cursor:pointer}.qti-item [data-role=\"tooltip-target\"]:after{font-family:'tao' !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\e63a\";font-size:0.9rem;vertical-align:super;margin-left:2px;text-decoration:none;display:inline-block}.qti-item [data-role=\"tooltip-content\"][aria-hidden=\"true\"]{display:none}.qti-item .qti-item .tooltip{padding:10px}.qti-item .tooltip-active{position:static;border-style:none;padding:0;font-size:1em}.tao-preview-scope{padding-top:20px}\n\n/*# sourceMappingURL=../../../taoQtiItem/views/css/qti-runner.css.map */@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:normal;src:local(\"Source Sans Pro\"),local(\"SourceSansPro-Regular\"),url(../../../../tao/views/css/font/source-sans-pro/source-sans-pro-regular.eot) format(\"embedded-opentype\"),url(../../../../tao/views/css/font/source-sans-pro/source-sans-pro-regular.woff) format(\"woff\")}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:bold;src:local(\"Source Sans Pro Semibold\"),local(\"SourceSansPro-Semibold\"),url(../../../../tao/views/css/font/source-sans-pro/source-sans-pro-semibold.eot) format(\"embedded-opentype\"),url(../../../../tao/views/css/font/source-sans-pro/source-sans-pro-semibold.woff) format(\"woff\")}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:normal;src:local(\"Source Sans Pro Semibold Italic\"),local(\"SourceSansPro-SemiboldIt\"),url(../../../../tao/views/css/font/source-sans-pro/source-sans-pro-italic.eot) format(\"embedded-opentype\"),url(../../../../tao/views/css/font/source-sans-pro/source-sans-pro-italic.woff) format(\"woff\")}.qti-item{font-family:\"Source Sans Pro\"}.qti-inlineChoiceInteraction .select2-chosen,select.qti-inlineChoiceInteraction,.qti-inlineChoiceInteraction-dropdown .select2-result-label{font-family:\"Source Sans Pro\",sans-serif !important;font-weight:normal !important}\n\n/*# sourceMappingURL=../../../taoQtiItem/views/css/themes/default.css.map */#item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .tool-list:after{content:\" \";display:table}#item-editor-interaction-bar .tool-list:after{clear:both}.farbtastic{position:relative;width:160px;height:160px;margin:5px auto}.farbtastic .color,.farbtastic .overlay{top:38.5641025641px;left:38.5641025641px;width:82.8717948718px;height:82.8717948718px}.farbtastic .wheel{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMMAAADDCAYAAAA/f6WqAAAtiUlEQVR42u2deZgdRbnwf1XVZ2Yy2UNC2KNJIMqisui9EBYDCrKIEm6CgIroJ+pF1IuK3IuQiyIX1IjKoixGFkGW75MrQkRAEEVQQARlD0uCQIAEE8gkmcx0V31/nDMzZ3qquqv79JmZTLqep5/Tp7rP0t3vr96l3qqCspSlLGUpS1nKUpaylKUsZXEXUd6C4osBCZOnQmU66K1BT4FocnXTk0GPgmgMRAqiVjCjECZC0oHEoFiLohPFaiQrUaxA8jqKVxAsRbGMF+kUYMq7XcIwHARewDZtMH4HMDtBuDPoHSGaCXoa6DEQAbq2RfS9r9+vvRcGFCCpvvZstveSCMXLSJ5D8RSKxxA8SsCj/I2VovqlZSlhaJrwK/iXbUHPBjMbor0gejuYFqtw9xN8bQHBE4Y0QPrvGxTLkTyA5I8E3IPmYf5UapEShoaFf78pIPeH6P0QvbfW4gu34CdpgAJhyAKIoAPFn5HcgeA2WniMW+kq4ShhSAFgvwDaZgHzQB8MZleIKn6C7wLBdjwBhqKAcAEieQnJb5HcyBru4G7WlmCUMNQAmKcgmg5mHkRHQvQuMNIuyNpD0FOE3lWXBkMRQPSHAiQrUNyC5DrW83txM+tKGDZJ5/dD42HUYaA/AXpf0JX8rb/OCEJOGBoBRaY65csQ/BzFlbzAEnE3YQnDiDeDpu0I4tMQzQM91d3q6wxOcBbTyHGsHgaXcAf9hHdgXc+r7TyXdghi5wm6UfweySJauUlcREcJw4iC4Lg2aNsHopNAHwS6ZaAg64zCnRWOjDDYgAgo3pSSAzRE/fslSC4l4Ep+yGsj3bcQIxuCE9ohOAzMyaDfU40EuQRfe5o/jULgOCcOQxBrweMwqILBkE6/AhQrEVxOwAUs5B8jtR9DjEwIvjwawsOAr4Deo0/Y00wf3SQI0swmBww+PoQvGDaBDzxg6P+6CskiBBfQxgvizJEFhRhZEJzUCm0HAWeA3t0dCcoDgY+jnFSXAksSDFkEPnAIfVZzKVlbrEJwCQHfF2fySgnDsIJggYRoJzBngj4ctHKHRX1afZ1DoLWniVQADEmAZDGl0iJMrte+c5di+AZruF4sZO3GLkdy4wfhW1NAng3yjyCPAKGqjNdvkoF1JBxzbWD/bjk07YrrbwjL30m7DBG7DJ9bKHgLAYvYjFvMOextrkeVMAyRSWT41lzQ94D4Gsix6dKR/nT9AHBJ3DDU+76XLj32629r/3P2Q3AbL/A98222KGEYNAgQhnO3h20uB3k9yB2yQZBnwyL8eb6jCYI9FJsNFskoBF+gwj3mB8w3C2grYWiub9AG5x0PwR9AfgSkcgu/dLzm0Q6+wl0wGFm/pnmC7tYS8TZIMQPJNWzBT82FbFvC0BQQfrANTL4U5KUgp9p0tb9WkA0Kf6Otf0HmVaMWXpZbJBNeB9Yp4CNUuMv8hMPMAoIShkIgmKcMP/4ABHeC+ChImW4WyQzawfYdRTWzOYFI+7jvz8kMgp92C9Nup7S2STMQ3MBbOcdcxMQShoZAuLgdDvwqyP8LanvXHc/WlNnOh8Z9CG+pNkA30AmsrW1vAmtq++uArlrM1f11RZhJ0hFBSjOHhIdT3XduG5IvM4ZfmKuYNdzjDcMUhJ9uAWIhREdX0yiMpb9Ak9yxlqcvwbNfwLmFEUTrIVwPei1EyyB6HsKXIfwnhKsgegP0GujqrJ7PeqBCQCsKhWQMAeNRjCdgEgFTCJhGwAwUm6FoQ9FOQIUAkdi/kKW/or6vQpKtY06m7PdkxsLnUNwm5ltgL2GwgXDNrqAvg2g3t/D79C6nAdBAJ1l10xCug2g1RE9A+CDoJ6D7edBL4ZnlgmIfupnOeCpsh2Q6FWaieAeKd6OYSsBYAiq5O+6yJPcl5TIlA9IB/DdruFAcT2cJgztaJGHngyC8DPRW6cKfRzPkSavo3QyEnRCtgOh+0HdB+Aisf0zwyOohu2/7EdDFTBQ7o9gTxf4opqEYR4BK1BqyASCSNMNArVBfpxFchOF0cQSrSxgGgPBgBZZ9EqJvgxmXDkDEQNOp0bRsFwDROohegOgW0L+BtX8R3LNq2JqY+xFQ4e1UmE2FuUjehWISAcrLhErLgu0R7sADgiSzSXAzhs+KD/JSCUMvCDe1gz61tlXSTaOkfKMkKJLGKA+AoBPC56sARLdAdL/g5o1uWKQBwVxmojgAyVwCdkcxgaAWAE0zlXz9B9t7meg/9NQ/hOCj4kCe2ORhMNw1BjrOBn1idexxIxBkyUa1gqBBr4Tobgivho47BTetYYQUA5Jj2IlWjkQyD8VMFC2Z/QgfEJQXCD0aYgkBR4n38tdNFgbD7eOh+zwwn+g/8KZnMx6mUhoIXtohqplB18KGqwRXPcEIL+ZYxjGGQ1GcgOLdBLSjapEpV+q3zACHLxD1kSbBMezHfUM1ok4MHQi3TgL1I9Dz/cyiLA6zt2aIQD8H0WXQdZXgkuVsYsXMo4WtmIPiiwTsi2S007H2SfP2d6Jt23IkH2cvfjsUQIihAeH28aAuqYJgCgTBe4SaBr0MokWw/jLBRa+wiRdzAhUm8X4kJ9ciUu2ZQVAeMKQD8RoBR4o9uGfEw2D40zjoOh/0x+3mUF6fwSuCZCB6FfTl0HmR4Hv/oCz9n89JtDKeQ2nhq0h2R9X1W/iGWJPMo3RzCQQvoZgvduPeEQuD4TejYfT3wJwwEADjAYBpwDwK14K+EcS3BWf8vRT7lGf1NcYzgY8iORnJW3t7uhuBwQeEPiCWIZkr3slDIw6Gaj9C+E0wp/Q5y8YDhqwpGAMcZl3tFdYLoPOXgjPDUtQzPLdvMwPFAgKORNGeOOdSnr4GOwg9+0/TwsFiFs+NGBiqPcsf/ByY74MO7AA0AoMThDfAXAXrzhF8/aVStHM+v4upsIG5KM5A8TZUrY/Cp0c6r3boA+IeFHPFDqzY6GGoTuX4lw+CuBrMmGTTyOTUCgMcZg3R41Ut9PpvBGeW6xUU8SzPZyta+AYBx6AY5dXPkD2iVJVK1Q+InzOGT4stmzvpwCDA8PhuEC2GaKqfn+ADRFLHW9gJ0Q2gTxOcWDrIzdASrXwUyQIk2/X2TfhGk7L4DX0awiA4l2WcLuY0bw5Y0VwQnp0KG34Neld/s8gHCGdE6TXQ34Cxlwrmd5Wi28RneznvoIUfErA3EuUFQ1YQ+ptLGxB8im25Rojm9EGI5oHwYDuMXQT6qD7h9oUhKxCRAf0YhF8QfOKuUlQHCYirmUwLZ6E4DkVbYo5SHhAGDi1dieQQsRUPNON6ZHNAMBImfgnkPPuVqYx3IfE8DfJOUB8uQRjcIo5lJS/zRSRnIHkjl7Dbp8e3g6SYjOAn5tXmTEfTpGGfLxwA8rTqeGWbVyU87opXUxKCvA7k0YKjny3FcwiA+CIb+CsLEZyE5NXUx6ZSHrNygtATzt0FxXeNoWXYm0mGpVuCvAvMLLdplKXDzWkadddyik4RzO8oxXIYmE23cQiSH6PYNlGg85hJ/c2liIDPMI5FReYwyWJBMBWonAtqVnKAWZBfn0pAbgB1HnR9uQRhGGmJA1mM5GNInkViCo0s9RclheB/WMNOw9hMeu0YUEe75w5JGwHidVfWgfgWdJwumL++FMFhBsT+3I3haBSPo2JAuHqrfc2m/u3pFAIuMIbRw85MMvxzGuh7q2OXTYJZlBRRMimmkd4A0dkgzhbMKdMqhrPJdD+7IrgOyUwkooEe6IGdcP1fv0KF7xURbhXFgGACWH05mGPtEBhPEKIE/yHqAnMuvHxWTx+CMabsWR4iBeA8IETvMfMA7yHg5yimO0a4pcdVRMq+YBWK2UI0Pmy0IBje/DDoG4BgoPCnOc0+zrMJQV8M674imNM7vYgxpms4XP8Q/fZQft4LBgDzMPtT4WokW+TqW3A50rVXI8AIFkuYKwQbhlQYDG9sBuo+MNvbhT+LdrDBEulq6nXn8YK9+41HNsasHcRrFwWcIwb5/xT137z/exwGAPMYR6G4BMW4ulVF/WIqjvlcjeh71aA1HN8quHLIYDAYAV3fBH2aWxPYtIQLiriZFJnq+gv6SMFuA7IWjTGrGhA00QRhFUMISrOuP1OdFQYQPMNJCM7t11Ptqxns2iAuWUu74D3jRP7s1gZh6NwR5H3VeY6STCMfLWHVDs8Ahwp2fNr6+8asyHBNYhAhEYP0+z7nNvv7RMxMkvZnRcBSFhJwYm8uky1TNWGW7x5toIWzif3OGPhaXmda5AfBBMD1oI9IhiDJPEo0mVaBPkbwtlud/8GYlzI+zIYfdk5hExvR9+f5LpEGA4BZyTi6uAHB+/tFmDzMI9NnEg2Qqrr9jhBmTxL8bVBh6MYcLOEmgQmqX5JXK1jTuLtA/yfMOC+ph9EYszTpwRTxcHN8Z5bzRYP/pVm/k/uzSTAAmBeYSSuLUWzvBUHt2+LaIMEA/9UkOEKI7HPcipxaodIFd0rYuyfdvPplhvxOtKn3E66HruMEOyRGB4wxSzIITxEg5BUcUdDxZgm2KKouDQYA8xqHUuFaJGNcfkLMQU4FoU6iQgVzJonss2vkgqETc6iBmyTI/lP1m97X7Bqh9zNLYP37BDNeSL2pxjye8YE3KoAiJ3xFCV6hguvx6nMsOwwGwRrORXByLbViAAgGfxAsUCyeCodn1Q4ij1ZYC3eKmlawr2VRrykyaYi1oI8VbPFLr/9izCM5hEEMkmAV+bkiz3V91qcRSXr1hgHArGICLdyCYs8e/8HlIGcBoVYXGth/a8Efssh25rW23oQDgb3qATB1IFT3RV3Sk6pBUX+mjr0KqqFicTlc+KtMrkv2lqxogckqsHl/K4+Axs81jvfx/frfMSl19Z/3b4Unstqs5WQkv0Yx0VhMoqwQ1NUHGv7TGP4oBLopmsFg1Cq4XcAcnyWFZcx8StYK0dMQ7CcY4z27nTHmvozaIM9rXjPDF7Q83yUy/mff302rcx2vd6AzLYxuDGdpONWAagQES10YwuwZgvubohlWwF4C9nVphfo62e+YqAEh67REP62wAdTXBe1Zp3nsztDSZxHCrIKW5fPeguVxzPf3TUqdT6NpLPfWFBCZ/K6GQzTs6ht7NH5gBMB/GMMxvv0O3jAswEgDJ5tq1whYAKiHwmU6idq+6DvLgFwMLTfmivA2LqRpAusLVtLv54FBZPx+23sT2086boPGeJhMDRUhWN1pOMPA9RpG6RwQuEwmAx9+CmYBTxZqJi3H7GTgIQEtWZYNdq+92etk/xPk/gLxSGZn3phbm6HqcS8qKzICJFKEN+27836fSLlu388Kz/9W70Cr7M8R1QHXGjhSV1vHxPCpBwS9x4EL3iY4qVDNEMJxLhDiTYxM0BR9rwIBWiEW5QEhphmyCn1WIfQVMB84sr73Fcasgiw9nOM0h7mQrF8hiNYYzoxgfw2TPEKnXuZSbfvI04bTdhC8WQgML2Hau+FY3zW2jQcktddXN8APGriP3Tlb/2a2onlb3Cz/rb5O5vyP2hFlEik+gyuC1BAYYwWPrjBcY+BEE9MOebRC3TZ5PRwBXJH2H7xiwp1VB2erLKshJ621GVU1jQ7hktGIFxuEIW0LE96HdVu3Y9+2dSfUxS5zQF3kWeczQ4Kx9Vpa6kyGOteG5RWHM52raPi+hpU+y0/6LE1Zd3GfXGDSZT2VZoMRz8DNAg7JugB9criVlwTsNhbxWt6bZ4z5WYO2uk+dKKi1lzl/O+08meGzzdp6ry2Pz9DPCjEs1PAfPdrBphHIphlqVj7v3E3weENm0pOwpYADst5x6TCdTF8n4xUTGwChVroKFNYsAuj72frj2vO8rLfa5BReE/u9RvqmCvMf1sOPK/BJAxOyhFSJgUL/44GBjwBnNGQmRTBXQ6vPMoE6QX3F6lYZuKSAe9edY0szd8KUz/iaUqHFTHLVRTk33ynLE5PBUsyluAkUP1aoqTRTsCSC/xeCSVqY2Gdxgtg2/3qDyq0ZDEY8CvOiHM6ycGsGI+C6KYhlBcAQZgxL5mn9fVvzpO/QjjqbFtAeitZ1y21dQPG+UGK/IWNOtRxoyg+IPMUd6ELHkgu4QMNHNIzO4TAPoLj2+R22gl2BB3PB8Ai8RcCeNCAxlqe2XsJPC7pv3Rnj4I0Kv8zgD6TVpZlO0qOdkQ6B1w6/QnvU2YAwjgh5U0ylt8AjT8IfNRxockDg2ARwVG4YIjhMQMU39pf0tOoM1L9sTWHrdHV5CKovFNLjuE75bNK5wiGkaTa9yHCOy98wDEwu1gmaIQ6EiYEQF35TpHYQAvOo4QoDczRUGoEgZtd9yBhOcaVnJMBghIGDjKPplRYwbBIRe1qhgUUCoQvUDFlb7yIiLzJDiy8TTBcXHDoFGOkwibB07aRBTQoQwuIjxOuaMeXOTSG8bGBaHgC0JRZsYMYdsD3wdCYYHoRREezj0gQmpa7eyKx7Iq8BNxZ4w7oz2PA+dTIjEHi08BF+GSsuc8g4NIKx+AIGe86kjHWyxc0kLJoAhxMtitYEtrKzoOMvhmsiOJW6MGvWzpDYManh/Zlh6IK9gHFxLeB6nwRG3f6vd0C8UeA9C5scY5eex10tubbsy5gD7SP48ffx0Gj8dsuYFjCWxxTXFHGFTp3vKgfDPLKY6Tdq+JKBUb6mkCO0Wg/JgcCFmWCI4H04tIBJ0QhYnjDQJeB/C75fXYMk+EmmTtqwDpEAgXZAJRNAsCUFSwZmz0uHaRRvx+JmkQuAOAQmZi4VDsZSeGgreBbY2cMfcGmD+P5+iw2th1hm3wtc/kIE++TJPDPupnolUPTKOt0F2vlZNIJ9tGvyce1xrF6odUInmSu6Iy2hTxsUMmYe2ep8ZaxpmmG+IPqD4RcadurpkcbDR7CZTHXHx2t4F/BnLxh+A+0advNJwrfdfYeXunh3xNphAINIaOWz1LmcX1sr7wpfCse+rtMONnPFZjLF/Ya0OhcQxtLau+psHXKFlhB+ZeCr1MY6+MBAunbY2xsGAXtoaHMB4Gsy1UeRNNzRhMajm+Ic3UZaftd7FwjCYtfbWn1t0QDaoR1sQm9i+6pObrB01NUPTicGqAsI0WQt8XAErwBv1f6mUJpDPRtYGP8hVzrG3r5d4Qnd3/X5BuuA3zUJBp9sVVuahS39IiklI0v6RVrKRlK2akhymoYtGViTnvHqWnTbNezYp+O3KdqgvswRhCHc4XMz0urrbtZetizWwKGa3m1r+ZPqUvyLR2cjXh0izZDV/PHRHpL0AX06wSTSsXON47hNC7hafWMJj9p6km0NoLRoDN8oZtOn9dfwOwPH18Y1eznRkJhctfkMmAY8nwKDERp2sZlFcVXi8hsscPyxSfepKBikp/kjM8AhEwBLWr4vLbpjUo711CmLACclZsa/3xeMpmuHEO431chh4OMkkwJGtZObXVJhWAxju6s5SQOEPm2KBMcUEqGEPzURhizOcJpGICaceApzZKmLC6zLgZYWp9km7PUCHvcf4s9dppjBFjexn58QB8vWCz0oIAAcDs/+ApYDM5JafQ+NUP9+F+CmRBi6YUdddxPTtIJIgUFA5/qE5KiCYMjr5IqU1tu35fd5dS3IlNTS28wk6XCSVew1rTW3aYYkKNK+p2lQCIG53nBfHIYkwdeOP1ZXv3Oqz9AFu7gmHzIOGFLMqRcOh38MspkkaSxaVITwywQ/Ii7s8eU5dAIsSaZPVo1g0w62SJa2wMFgmksR3CvgmJ6GOk3wTULMt3Yx6TAY2F7jNwdiEgx12uLvdf0lQwFDkvmTRfhdfoDNnJIevoHLR7BBIEmfFUVl1ARx5a5TgDAZ5K3wYuCpsBpha8mhBQb8uRBmLjDIM+umnwwszsp010gOLKED6ThW+7wxJI87HQQzKUn408ykRjVEGgi2BV5dUNQfs50H3pnMTrs/aUbCrBMEFK0Zno6qz9sbhhRa27aGrYAXnTBomG48hZ8EaHTvNfjNZpazdDmE1Ff4ySHwWSJDaa2/zSSyRY2SOtLqH4Ui25BM2yzQSQAkaYqmlo/BSz+BVVBdBN1XPemEmyBheiIMEUxPWhggaX5BizkVmlj4qgmawVf4fcyfRh3ipKX5FMlLfbvWsYlrBFc2gnT4lC55SVpxSDrMJZFiejWvCExkWAJsk6H1T/T0dRWG31th+ClmgoZxIiHcQILWsMxAFQp4oYm3KCR7Ep3M4TBnNYVsUGhLnUnQGEkaQcbgsEWV6vdJeFSudPN4l1GeCFXRnW/PGZhjPIU9SSXWCH+L04Huhs2Vo0exJ5ieEYa1H29Oz3NaP0MeLZHF/GnEN4jDkKQZbL6BytD6+0aRsAi/DwCDqiHCKgz9er2NHRovG9HAFCcMGjZzNSFRyl20wWCaF1JN8hl80iWaCYPMUJekEeLHlUU7GIeWqO9zcDm6rseXNubapIR7m9nyvSj6ggmJrb5xR6Xq9zdLgmGKSW7pnXfSZkoZeL3JMHQX4CfkMZF8/IS0Op9NWfoU4nU+ZpFJ0Qw+ENiEf1CLgVXaAwaXdrCE0NyaIYQp8QG0WUAgFpJg6GDIYxrlCZGmrGXf8GZS6pQFgjRzyTjaORcI8XEZMsVEa+bDXi3q5NykCHzan9JJMAgY4/MlwuN4DaZ/Nt+MzOQzyIyawqdOefoMynJcWY77whB3nlWCpqg3mYhZvXFL2DZ7R9Lgn0ELsYawSnrCkKYdamVMkmZoF35C7uWVDQIMXRlCpkkdaXmjR66kO1//IB4yrYdCpcBg0wiqAQe6Hgph6YOIdwAOeudbF6yu1GTc94dSGvd2JwxRbTES153KeqUGVg8jMymv8GeNGNla+TRtENXtG4fzLGMQ4AAjCRKbSRTVaQvXWIwsM7Q0s7wZNvg7MRuy1QmDARXvkTEF/fBGCEMjQGjPCFG8h1nEtIXNXDKOqFIckp595VbcA+DQdVBEdXX1W3zGvUHzGdaBaaW40UQmdm/i0aSxRfaRaFg7DGBoNK8oKVqU5B+IOqG21bkgMQ4AkqJLWCJMaYKqLKZREgiuYaCDVtphbTfoAr8y0WcorAiK/dfW3xDVaSqNMcLRyromCjeO1tg2cCbeGgvSZ46Ixxlcib02gRI5unTSlrnSKSFT4WkaEQOCwQYiauJ3x32GjgK/W1JLqtrIy6CM8y2Ll5k02uQbq+Eqa5LMpFAMBe5lKYtH6QQRFPRdwhJ9jcPQVZQzXDt/QvkIy1JgGdddHcyfWVU7bM8NSTCsM35CnnpObZtUPr+yFBgtmSBrZpJoAIK6Y+tSfYZGgIh5hCUMZSmshDBRghQegg72Vd9jstrhhCGEFb7BY+MBg7BkwZalLA1EMiZEdTAkAWEbchDXGAZWOGEwsCL+BTojDLHxqCUMZSmsaJhILJok3ILuYzatSPIZXs+SH+4xxG7b8hGWpajSBdsoDxikp/8QH2IgYz7Da1Hd+rvxWWyzLkwcwuhPYaaWj7EsBWmG6SGIvAtmW+pWOGH4AWK1hjd9FqFOWyC9tgUStisfY1kKcqCnh/mEfsB7U91fmqhRIniuPhHFZ/pv29zqtf0ghLeWj7EsBXjPomeCuzQg0kCom5r+OafPQN8Ju7r8AJPsMMf9BwW8rXySZWm0fAC2DmGi78zwtvfxzjrlA0OaY5xhaj8B7Fg+yrI0WgTsEEJFWoTcNctB0syQQOcseDkRhgiW5NAATkgM7AJGNHG+1bJsElYSszQExhMGQfIUqQKeqZ9n1eUz/N1ma5kMvkNs2+6wMsRalsYjSXuFIPMsY6UtPkMIj8Z/wzbx8OOibiRTmhZIGwiroS2APWjuzHplGeHOcwR72rRA2izwcW0h+uRyAAwDNMPVsEbDUl8tkBRq7YkoRfCv5RMtS96yL8wMYcvIM5KkPTSHgb+nagYQRmP+bmKzcftqBMe8h7PLR1qWvCWCdwto8Vg7cIAGcNSZ0AKDdPz4A7a1UpPWWk3pf9h5/7Inuiz5YXivrloYXlkRNlmN1b12OyzzgqEb7snbxe04r13Ae8vHWpYc/kIQwft8ep4zpA3dixiYg2qFYS08qKHTRVcaiZYt0PC+8smWJWvZFd4VwRYR/lrA5cvWyad1KWYrDLfDugge0h4/mCHEesg7MKPLx1uWLCWED0bQljcxzwZHCPd4w1B1ovmDb9KTpzc/eTTMKR9vWTKYSErD3MiSqaozyGRMO7zxCjycAQYI4Y48WiHBnGrR8OHyCZfFt+wAu2mY4esLpMlo7f3dz4j+EwGkwrAS7g1r6dw6hcoMjsvBu2PGl4+5LD5FwxFxEylN1nRK49wNt7l+zwnDX2C9hj+k2V9pkaVYFGDzEI4oH3NZ0soUw5gIjokSBvMkNcQOLaG74PbMMIAwEfwmCwA6PfoURPApMLJ83GVJKq1weARbZXGYPeTz2b/VElEzwgAabtbQrT1CWBk8/d1mwW7l4y5LguMsNBwXQSXvEE9bwxzCLxHuSV8SYfgDLA3hvkZCqpY/NUrD8eUTL4vTRIJ3hjA7S05ckrlU24yB65J+N8VcEUbDDTn6FJIcGxHBUW/BTCsfe1lsJYTPa2j3Sc/2gaR27OlH4a8NwAAb4BcRbHD5BGm5Sw5aJ2o4oXzsZYmXsYbtDRyZ1reQtSEO4XpE8oz2qTD8FZZH8FufyFEGc0pGcNxUzObl4y9Lf3eBz0YwPsnUdslcQmJeaODatN/2iOoIo+GnST/qY7dZ6rYE/r18/GXpjSAZZoTwMQ0irVPXBYi2g3LvM/BkATDAq7A4hJd9tINPUl/tmNRwwiTMNqUYlKXmK3xJw+QsA3V8wvshLLJlqeaCYTlinYardYI28MlRslzYVA1fLMWgLBh21rFOtrRxzJ59YCvXwo0+f0H6/1euiKArTUVpPwjqfYdPtmPeWUrDJg2CArHAwMQ842ZSGuhr/yl4s1AYnoAnNCxOcl58e6ctkaUFYIJSKjbVog4GdSgoQc2e0Z7WhSaxw62zGy70/RcZ0iKEjmBhBFFe08gRdRIaDlFlztKmqhUmQOUboEbVrwpsalBEGaCwgPG/r8NTTYABnoP7DPzeJyckKRxmgaPVwFlgtiilY1MrY78C6h1VCOJbfig0hN1wXlL6RUMwgIi6YaGuLnjuRaj2BETDTARfL5P4NiWtMPZfQP07KFUPwMA148WAibDTTHQNt78JD2b5O5kF7yW4TcO9CUR6d5T0Tg8uAIVE8Qla+GApJZsCCOMnQOv3QE3oD0HS1h+KhIY47IL/8QmnNgQDiO4uOCeKaYe0ThDbMUOsIVCMRvEd2ky5psPI9hMEjPovUP9SXaLNpRWU41X0TnfqsERu64R7s/6tXCbJyjrtkGYWuYBAWK67us2kwrfBtJZSM1LL1oeA+lyfeSQZCIRKAaIKhUXewqiqFaJBgQFEdwRnawg9c0N6X42wXFv/axcojmAin6+dXZYRpRW2mQnBeaDGDNQAMgcQfVDUZGxxCPfl+Wu5ndVVcHsEv/IFoVcbuK63f30LAacxhYNK6RlJIMwcB6MuhGDmwFZQZjSV1AAtYaDDwOl5tEJDMIAINXy9fg04FwgDtIF0mkj120QCzmcrs0MpRSPCTwgg+CbIA/r8BOkQbB8QbOeIH2GZQ3UQYIAOeCKE810OdK+DnHQdCncjETCDgMvYwkwppWljd5h3ORHUCSCVu3WXCe9TTaWlYL6TpV+hUBhAmA1wXgRLnCaRdACvEu5Ff/9hNqP5EbPM2FKqNtay63yQ3wDV5tYIrv0kQer9Hg1qAaL/UraDDAOAeF3DKT3OdKI28AFg4H2RSD4EnMM001YK1samFd6zP6jvQzAu2U5OajVTQ623Qud1DUtyQVccAJcjOLYXZNerHBAI8AAfkHQhOZeIs3hcdJVStjGA8K/vAfFz0NOTc0t7NuPYr39vYvt6FUSzER1PNPp3C0p9ECFwGpKXU51/lWIyufwIRQuSU2jj1DLDdWMAYd9dofIzUG91t/wyo3awaQm+BR1PFiLFhd6AijkOyWUIggGtvmhIK9Rv61CcwxrOLTXEcAXhgHeDvhzM20EL91Awk6IdXNqi9/VuWHEogrXDDwZMhVZ+guJjTqGvN5tUChzuQMMGJD8g4r/5k1hfSt9wAuED+4H+CZjpEAk/88jHVIqDEK0A9ke8+mhRf734Ht52syWSu5DMsgIgc24DNWU3ikvRfI27RUcphcMBhEMPAX4Melu/qSPy+gw6gugzsHxRI6HUJvkMdWWdWI7kJCTrnD3sCj8zMqmPQlJBcgItXMIHyn6IoYUAiZn7MagsArWtny+QZg+LpGPXwvKrigShOZqhenckkzgVyTeRSO9okkowodzvNYq70HyGW8WzpWQOulnUCuO/APo0iMYnD9Wvb+VdPoNO8hEA/XeIDkQse6XoS2liIpxpZ3N+guQjiX6B8GxAkvsmDJLHCPgCvxB3lRI6WCAcPRnUWRAeB6YteWatKMVR9jKZVkJ4COL5B5pxOc3NCt3cTEXxaxS7Zoog+YBgN59eQ/IN4FJuKCNNzQXhU++A6Ieg94ZI+QGQBYgBMGwA/Sl46pqizaPBgQFgS7MbAYtRTM0Fgyt/y90x2YniBiqcxuXiH6XUFg3BCRXgo2AWQLRdNXQaeQq/LxAD6gxE58ITpyMIm3VpzR9vvJy/Aicg6MjkTyWBkPyZNiTHYljM8ebgckx1kSCcuBVUfgTqQpDTqtmnjap5rw6oa6FyVjNBGBzN0ONQz+BzSL6PrHXIKQ8tkSWh0W46vUHAVRjO4WLxUinNjWiDMXMhOh3020FL9zwVPuHUNO1Q/z66B8xcxMMrmn2ZgziSzFSYxTdRnIJE5OqB9oFhYOqHRvEEkgU8wi+5W4SldGd5bF+ZAWoB6CMhak9et8l3Wmpvh/lp0AcjHnxuMC51cIdVTjWjmcxCFJ/J5DukJTum5UFV99ciuRHBd/iu+Fsp5WkQfG08tH4U9MkQvbWvNzltQWSfFTzSYNCAWQYb5iL+8tBgXfLgjzGeacYxmvORfLwpMCSBoTAoXkVyBXAh3yod7IEQ/KAVOg6F6KugdwddSZ3w3WvfeJhPvakWL0J0FOK+ewfz0odmwP3uZjxwCZL5DTnRPq/2MSOagGUoFtHKZZwiXikhuLgCHe+H6GSI9qyaRD6T/ugcGiJxew26j0T88Z7BvgVDN/vEjmYSY/gRKgEIhX96hsoAQ98WoXgOyWUYfsbXxMubHgQLWmDyHNBfBL0vRKOT12PyWRk8LwjRcog+Br+7s1l9CcMThh4N0cr3UBzf61Rny0/KphUkEFjPiQj4B4prkVzJieKJkQ/BxeNBHgrRCaD3qDnHIt0kSjOX0jrcXB1t0TIwxyBuu3eobsnQz0u0nxmD4WwkJ9aGeObzHdKG1tbD4BpUFKCRvI7idwRcjeZO/o9YM4K0gITtdwJzJITzQc+AqMVvtb48/kJSKLVfbtISCI9C3PrXobw9w2OSrt1NO+M5FcmpKCoNp2WkO9L96+yAdBLwPIpbaOEWWrmfw8W6jQ8ABPxqJnQfAOFcCHcHPQEimb4glI+/kCUfybo9BNGxiJufHOpbNXxmrNvdVJjEJ5F8m4Bx1uxV39SMLCCkbwbFOhQvEHALFW7D8CCHiVXDF4C7AgjfDt17gz4ConeBngSh8lsHx3fFtCxmkm2EW3QzbPgs4pZh0SE6zKZvNJKDOQjJZSi28tYIPj3SQQogaVvQC0YnihVUeADJXQQ8jOBx9hlCOMxdAYydCet3Ab0nRHNAT4NoXBWArMuKZ9EIuTrbNOiLwHwdccMbw0X6hudcpoebXRFchmK33rQNlcN/SA+xuhxqGwi2Ol3TGm8Q8AQBDyB4EslztLOU7VmOEFGxgv/seGA76JwOensI3wH63RBuDuFYiCr9BTXEezFifJcW9NEMzvoOiBbAyxch7u4cTmI3fCf2PcRswSgWoji6X6Qpb290mmNtE3zpgCFIBCZC0UmFdbVe72UonqeFl5H8k4BVKN6gwhoknQREVFgP3RWgtZoO3TW22qozHsJJEE6BcBpEMyDaDHQbhO01wRf9hTokHwxZw6h5+hWiZdD9Oei+DXFDNNxEbnjPcn2YaWc0JyE5HcXo3DMQ+gChEnyLwFNrBAnAVOhbmSkgrIVzo9q5EVKLmlMroDsArapgRAlC7XMsq1+QFj3K2+sc/a7qH1z91HAVt+Gd3nyzWIfmuyj+DcES58QCPhOX1dfF612bzzn1m6u5Ef3eC6CCoA3BaASjgXHAWGA00A6ipYZOwhfZjvlsMuNx141N2+89vxPEQuicO5xBGP4wANwgIn4mbkWzP4KfIdCpzyvpucuMsuELgOs7C1fY8R8vCpIsNycNgt66Z0HOg6dORVyzariL2sYz8OVq8SKGTyP5NIJXU8eECM8GLU3Q88iQj6yLRoCIn5P3omTGC0xqhfodi6ozWERzEBfejLh7o0ib37hGgV0hOrmUnwL7ILgWQeilqYUHEGlaJJMgJ8isyPrBLB8SBW0+N8rZyjwD4hhYfTziRxtVVvBGOCRSGC4WS1B8AsNRwNNObZDXTM6iIWSCryGLMJnqH5Vry6vaKOgmSUCuB/FDMPsgFl6PuKJzY5OsjXd88PliAxeIXxCxN3AugjV2s7XJPsLwbjgK1hhOtXs3mAPhmZMR391o0+E3/sHy54sVjOa/gNm1kWxRpgatKL9hWAh+ko3ne6Eyi/ZYCuaT0HEo4lv3DMe+g5HTz5C1nGRamcCBBJyBZI/UzFafMQ8+SX558p4GfC5LzlBaR5nPcVfPsldn2iqILoHoPMRpr44U8RmZS8t+2YxmEoci+SqSPVLTNPIk9WXNb5JFwaDJl2DXSJpFVAeBXgTR+dDxD8SZeiSJzcheZ3mBaWcUh1HhZCTvQdXSOnxhkAWBYUsS9IYhDQKf1l971CVCsBLCy2HDBSMRgk0Dhj4o2pjIPihOQnJQbRUg/3SNrGngSVrACZRPWkSjECSdZ4VhCZhLYd2V8MXXEMKMZDHZNGDogyJgc3akwqeBeQRMTVyKV8Zackm2gUJJuU0yDQbdgB+Q9l2283rziLpB3101hzp+hfj8JrP2xaYFQ28xgvMYzzgOI+ATKPbtHWHnm+VqS/+WnlogFYY0EHy1SCa/YBlEPwdxJTy5BHHmJjfZ2iYKQ1253ii6mY5kHoojUbwLiczlQ2T1KWRWGJLq86RgRysgugXMdVD5PeLwdZuyKJQw1Je7TMBKZlHh35AcXBtcVMk8BU2eOqkbbPl9pnuMAP0ihHeCuRHW3gHz1o50X6CEoWFLykhuYgqj2B/B+5HMQTENhcg8YKgpMHiPT+6A6M9gbofu22DVYzC/eyjmJSphGEnm1BS2pcJsJLNR7IXk7ShaCgEiEQbt6yAb0MtB3w/RvWDugehh2LOzbP1LGJqpOQRLaWUVs1DsRMDOSHZEMrOmQcZkAkRqDw3QeywC/TJEz4F+CrofA/MohI/CjStHaj9ACcPGamItYyownVa2BqagmIxiMpLJBIxCMgaFQtCGog2lo+pgeW0gWgtRJ0Srqx1e0QrQr0P0CpilEC1DbFeuf12WspSlLGUpS1nKUpbBKP8fIeX94+xqBcIAAAAASUVORK5CYII=) no-repeat;background-size:100%;width:100%;height:100%}.farbtastic .overlay{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAHmElEQVR42u1d21LkOgxsqQb+/4uP9wkKBtvqluRkOMVUUcvGN6lbNzuZAPx9Xu5jf/r8KXFSDvu/EGovNNcd4+3F+l8ORHffK/tcRshdAp1ou3re8XS9FUc7CPCu/UrSOsdcsUa7krs+dnD9DIhj0m6HZJHmtQZgq8Kxc1bW7upzybXHgUSfAeAkaCfJPaLXXQLaYeWfwxOj58vocyf4rwJC1GZPFVdkALOxkkyqBWWVtWR/BHMo4I6NTIOc14rGR41XSLlCoKvXqIy3wIBWRmELr7Ndolc2RXbR7yZ4TRcBrBws+c7K8DiwT7CitzF9O0JjxhPsALmmkIKOBQpKdq5ZAdkOGF+ZFCOEZcBUgVcJyrTNZBybPipRlumT2TyaELpahEzMm5nfFr+jcc0UKZWj/JPAvcLcJ+X89q81WXyXopYIPb/532nbV09Z7VjRtdiLjM0YykmZt6QwRw0MUVeDGPU1otiwRKQ4RtaKlOdjhxEoWCVLSbpGzvF1wxZdi9qy+qTmeASEqLtaJgSwlltRcCaPB9dOeEPqmrJ5HAWAuq1JJSbySoVII4oSqxhZdPbFlsuqJ0AEelUlepKErPHs+qvGSZES5QlWGCWksRs5hawIIJ+QOssnHpBfAd4y4cuCo+kB7QaZKrwlQ4EnLLkiIwq/L+dhw5cRZ1lWaMu0s2TuKizfkDrzngxZ6v/DRJ99CEEBOKtIBhiGBCOJqHr+co7M5jEqie3ia7bIBXfJBNGwjCUlC35UGJwghCkKPLhmohfS+SGjlxq+VkCDtOKMYpm2yngXLPyEQX2SUn0mODofU0m0BlI8AMgL5KlkSUStjlmYygkNyfgKQDKksHJmPCOU/xFUTYMoApgcggOE+FPFlE2sVVK6Qi+d6HeWoBxdREpAIA5NHuQHwS+RfOLBCWZTiEarRDF3VH++rmMNa0kPTgxys8ica6khrQoYs04G1COEPwhwVC9CEnA0zNHx40nynwlaEeaTcSlPMdITqsBio8AqofsEFF8ofJqUiiF86vDYlMPMPkMJY1XSsIjhSohhrPcUcfR8D8EjAH6XDiGOs3ugaNfdacl+iBBn8HhMvGT1GH90I4n1rOj2K5t7fBcCFiDM4n7VIzq9zKOSmCmBLVFVVRI4E7pW5FbAy5CXJvxBlKsjuek7VT25UI56MjQxxDqRtNU55c3jCE6OlZtc7P37nfAQKrQKQbOQ56L1u0L0I1EZMffe1eLg5HGIJ8OSJ695ISdRpDBfCDXCU5R77U4e8eySdkeMZ/6PhVd5hdhIISdjLquAJ8FTrHGnCxrni+RzMoRNc8pjw2xWICsA5Q1hxAMwTujZESY/9ylviwm+WjaSYDlZ2aiVjhPJOap4Kvmky0CnBcqOlNMJECIwjvx+wokTYRZQT5bTLNkUKShaxq7EzJSWmRK26xjFC3IDwjHLmwiuspgH1ZJDP5/qJhKNkQDCmr4j5Z2oFNBsFY7aOVF1/OqsrGvvUpLpw1Mqp5rdx90rg3Chf/cprzfrt8tn0/CFJlA7j7szR+9IENYJdlbeEXkKo2h0VJIFAcT6KJB2121lMHce3y544uOU0hlScBEpVvWU7H1p+/tpuw/0+W4YhpSoClMtE8QxeycQdxDAPBewfe7rbZIIsSGltGBxfAcJVSNTv46h5rDxnFMgVhFoeLBBfcIQib64wMu6ntKcJvpOBdAMAKNkN1GZ56KdlBcrUt6TIaDjawmnvvaAG40Jwe3oyPg/PQWbw0gIwqHg4lVSkPSabo9Ece3xcZOrCiSSY5lQgoJBZMZicVCq4oAslquSGATYKIQTNIUiVJQ/ECY7SNkes0BQKKswiIqqe+2MXl6QA5tHdGcvT/iR6LtelzGrRhhSIMpQJS5j6Z58QpT1ouXRPYgwhiY3RsH9IQBe8f6ONna9afhC0ppUJbEpEzvWBFFYqPMqDyf65hm4XdsPT0HBkjvHVoHvfNMQivqpsk1L4uxCAP9OrY6XpCnjkAh/HYYWeczSU94TAikCsC9pqwCBog7KGCYElq6twpedXFRou0Ielgi7SMah5BQUAKwSkGnrNBJFbiD3St2jpODAXN3zXvaK9ESfkBQUFuoGRg1B7NiMDCf1H7NEn5kYDSB3WWrnvBWDzBrA1FO6Ae0Cg80hHcQ/f89zCAZRxQLP+xSQSneRggPG0E2+GjGqsn0LXxmlGUuLxu5cftV/JBQfYphWgY9yEP03BL56SsZquqyv24oz7aMYFrvGfHpKl2Id7buEmfmLFbvrnfooMuyMYEoKRFddAceAyK7b0e+3/P4jfF0FRNf4lQHsvGv3Z66Yt/2BDIEjqf+3s69oIOOK2CRYpY0hBYWxbNsda4xnUiLlowpm11cZiwIBVaBV49x54sjMPyOlw3qGIPgHYc8hJwtYB2mnxjB9pvsUdrKdZWcF7lT2hB4VmdlrY5bo1Rg+iByTUQovMgcbUttkXnlKRajfPOYV5Nt6SmXiK9pPjd0BPK7A5evmsSJ8VNqy8+/C3mgg+e5+TN8RkRLlD2bBQZahINZg5agCd+c4KnxdKdDJ+axh7LhA37Hap7zix24whjs+wwD8h7/PS33+Aco5c+VlzzVbAAAAAElFTkSuQmCC) no-repeat;background-size:100%}.farbtastic .marker{width:13.9487179487px;height:13.9487179487px;margin:-6.5641025641px 0 0 -6.5641025641px;overflow:hidden;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAABvklEQVR42rWUv0sCYRjHO0zFOCoSSUFsq1AHoSkaisAGbXCRlsAtWiSD1v6AoMUtUAQnSRGkpNGoIWjMoU0qInSRTNGwunv6PvAeHKbm4guf4R64zz2/3puYGNchIgksggg4BodgE0yNKnCDC9ABClAF3+AZ7IHJYYIQqPJLrVaLSqUSpVIpymazVKlUSJwuyPTNSmRQVVWVCoUC+Xy+rizL9waDIWM2my/tdnstGo1SvV5n0Q846dcDLkHN5/Nks9leEQ6DGWAAZrAE4Xk4HKZ2u82iFljRS7iJnUajQR6P5xOhEJD6VDxvMpnu0uk0iT7F9RKeglIsFslisdwgJA/p/W4gEND686CX8BjVeDxOeEz8M0C3y+XSJB96yRFLkskkcSNFHwadVa/Xq0ne9JIt3oNyuUxWq/UJoYUBApafxmIxTXKll8hsVRSFIpEISZLEJc31EWw7HI53/phYxP3eMR+Ar1qtRsFgUDUajdcI74BlLoEzYEEul9Mmwya5V2ICBf5Cs9mkRCJBfr+fnE4ncQ+4BJEBC3jj1gat/Sw4E/dGpb+HS3gE66Ncwg3AG/UiVrwJbsVtnh7Lr+MXM921rfVCPpAAAAAASUVORK5CYII=) no-repeat;background-size:100%}.farbtastic *{position:absolute;cursor:crosshair}span.dragging,img.dragging.ui-draggable-dragging{opacity:0.8 !important;z-index:999999;font-size:5rem;padding:20px 80px;position:absolute;background:#f3f1ef;-webkit-box-shadow:1px 1px 6px 2px #777;box-shadow:1px 1px 6px 2px #777}img.dragging.ui-draggable-dragging{max-height:90px}.item-editor-item .hoverable .widget-box.widget-inline.hover,.item-editor-item .hoverable .widget-box.widget-block.hover,.item-editor-item .hoverable .widget-box.widget-rubricBlock.hover .qti-rubricBlock-body,.item-editor-item .hoverable .widget-box.widget-blockInteraction.hover,.item-editor-item .hoverable .widget-box.widget-blockInteraction.edit-question th.qti-choice.hover .inner-wrapper,.item-editor-item .hoverable .widget-box.widget-blockInteraction.edit-question .qti-choice.hover:not(th),.item-editor-item .inlineChoiceInteraction-placeholder.hover,.item-editor-item .qti-inlineChoiceInteraction td[contenteditable]:hover,.item-editor-item .textEntryInteraction-placeholder.hover,.item-editor-item .qti-textEntryInteraction td[contenteditable]:hover,#modalFeedbacks .widget-inline.hover{cursor:pointer;border:1px solid #87aec8}.item-editor-item .hoverable .widget-box.widget-inline.edit-active,.item-editor-item .hoverable .widget-box.widget-block.edit-active,.item-editor-item .hoverable .widget-box.widget-rubricBlock.edit-active .qti-rubricBlock-body,.item-editor-item .hoverable .widget-box.widget-blockInteraction.edit-active,.item-editor-item .hoverable .widget-box.widget-blockInteraction.edit-question th.qti-choice.edit-choice .inner-wrapper,.item-editor-item .hoverable .widget-box.widget-blockInteraction.edit-question .qti-choice.edit-choice:not(th),.item-editor-item .qti-inlineChoiceInteraction td[contenteditable]:focus,.item-editor-item .qti-textEntryInteraction td[contenteditable]:focus,#modalFeedbacks .widget-inline.edit-active{cursor:default;z-index:9;border:1px solid #3e7da7;-webkit-box-shadow:1px 1px 3px 1px #3e7da7;box-shadow:1px 1px 3px 1px #3e7da7}#item-editor-panel .table-tlb,.item-editor-item .mini-tlb[data-edit],#modalFeedbacks .mini-tlb{display:none;position:absolute;top:0;right:0;padding:0;margin-bottom:5px;overflow:hidden;font-size:13px !important;font-size:1.3rem !important;border:1px #3e7da7 solid !important;list-style-type:none;cursor:pointer !important;border-radius:0;background-color:#f3f7fa}#item-editor-panel .table-tlb [class^=\"icon-\"],.item-editor-item .mini-tlb[data-edit] [class^=\"icon-\"],#modalFeedbacks .mini-tlb [class^=\"icon-\"],#item-editor-panel .table-tlb [class*=\" icon-\"],.item-editor-item .mini-tlb[data-edit] [class*=\" icon-\"],#modalFeedbacks .mini-tlb [class*=\" icon-\"]{font-size:16px;font-size:1.6rem;position:relative;top:4px;color:#0e5d91}#item-editor-panel .table-tlb .tlb-button:hover,.item-editor-item .mini-tlb[data-edit] .tlb-button:hover,#modalFeedbacks .mini-tlb .tlb-button:hover{background-color:#0e5d91}#item-editor-panel .table-tlb .tlb-button:hover [class^=\"icon-\"],.item-editor-item .mini-tlb[data-edit] .tlb-button:hover [class^=\"icon-\"],#modalFeedbacks .mini-tlb .tlb-button:hover [class^=\"icon-\"],#item-editor-panel .table-tlb .tlb-button:hover [class*=\" icon-\"],.item-editor-item .mini-tlb[data-edit] .tlb-button:hover [class*=\" icon-\"],#modalFeedbacks .mini-tlb .tlb-button:hover [class*=\" icon-\"]{color:#f3f7fa}#item-editor-panel .table-tlb[data-edit=\"answer\"] .tlb-button:hover,.item-editor-item .mini-tlb[data-edit=\"answer\"][data-edit] .tlb-button:hover,#modalFeedbacks .mini-tlb[data-edit=\"answer\"] .tlb-button:hover{background-color:#f3f7fa}#item-editor-panel .table-tlb[data-edit=\"answer\"] .tlb-button:hover [class^=\"icon-\"],.item-editor-item .mini-tlb[data-edit=\"answer\"][data-edit] .tlb-button:hover [class^=\"icon-\"],#modalFeedbacks .mini-tlb[data-edit=\"answer\"] .tlb-button:hover [class^=\"icon-\"],#item-editor-panel .table-tlb[data-edit=\"answer\"] .tlb-button:hover [class*=\" icon-\"],.item-editor-item .mini-tlb[data-edit=\"answer\"][data-edit] .tlb-button:hover [class*=\" icon-\"],#modalFeedbacks .mini-tlb[data-edit=\"answer\"] .tlb-button:hover [class*=\" icon-\"]{color:inherit}#item-editor-panel .table-tlb .tlb-button,.item-editor-item .mini-tlb[data-edit] .tlb-button,#modalFeedbacks .mini-tlb .tlb-button{width:26px;height:24px;text-align:center;position:relative;cursor:pointer;margin:0;display:inline-block;color:#0e5d91 !important}#item-editor-panel .table-tlb .tlb-button [class^=\"icon-\"],.item-editor-item .mini-tlb[data-edit] .tlb-button [class^=\"icon-\"],#modalFeedbacks .mini-tlb .tlb-button [class^=\"icon-\"],#item-editor-panel .table-tlb .tlb-button [class*=\" icon-\"],.item-editor-item .mini-tlb[data-edit] .tlb-button [class*=\" icon-\"],#modalFeedbacks .mini-tlb .tlb-button [class*=\" icon-\"]{font-size:14px !important;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}#item-editor-panel .table-tlb .tlb-button:hover,.item-editor-item .mini-tlb[data-edit] .tlb-button:hover,#modalFeedbacks .mini-tlb .tlb-button:hover{color:#3e7da7 !important}#item-editor-panel .table-tlb .tlb-button.active,.item-editor-item .mini-tlb[data-edit] .tlb-button.active,#modalFeedbacks .mini-tlb .tlb-button.active{color:#0e5d91 !important}#item-editor-panel .table-tlb .tlb-button .score,.item-editor-item .mini-tlb[data-edit] .tlb-button .score,#modalFeedbacks .mini-tlb .tlb-button .score{left:0;min-width:0;width:35px !important;position:relative;top:1px;height:22px;padding:0px 4px}#item-editor-panel .table-tlb .tlb-button[data-role=\"cke-launcher\"],.item-editor-item .mini-tlb[data-edit] .tlb-button[data-role=\"cke-launcher\"],#modalFeedbacks .mini-tlb .tlb-button[data-role=\"cke-launcher\"]{display:none}#item-editor-panel .table-tlb .tlb-button ul[data-button-group],.item-editor-item .mini-tlb[data-edit] .tlb-button ul[data-button-group],#modalFeedbacks .mini-tlb .tlb-button ul[data-button-group]{background:transparent !important;border:none}#item-editor-panel .table-tlb .tlb-button ul[data-button-group]>li,.item-editor-item .mini-tlb[data-edit] .tlb-button ul[data-button-group]>li,#modalFeedbacks .mini-tlb .tlb-button ul[data-button-group]>li{display:none;background:transparent !important;min-width:0;padding:0;float:none}#item-editor-panel .table-tlb .tlb-button ul[data-button-group]>li span,.item-editor-item .mini-tlb[data-edit] .tlb-button ul[data-button-group]>li span,#modalFeedbacks .mini-tlb .tlb-button ul[data-button-group]>li span{color:#222;text-shadow:none !important}#item-editor-panel .table-tlb .tlb-button ul[data-button-group]>li.active,.item-editor-item .mini-tlb[data-edit] .tlb-button ul[data-button-group]>li.active,#modalFeedbacks .mini-tlb .tlb-button ul[data-button-group]>li.active{display:inline-block}.item-editor-item .widget-box.widget-blockInteraction .qti-interaction .add-option,.item-editor-item .qti-inlineChoiceInteraction .add-option{color:#0e5d91;border:1px #3e7da7 dashed !important;list-style-type:none;cursor:pointer !important;border-radius:3px;background-color:#e7eff4}.item-editor-item .widget-box.widget-blockInteraction .qti-interaction .add-option [class^=\"icon-\"],.item-editor-item .qti-inlineChoiceInteraction .add-option [class^=\"icon-\"],.item-editor-item .widget-box.widget-blockInteraction .qti-interaction .add-option [class*=\" icon-\"],.item-editor-item .qti-inlineChoiceInteraction .add-option [class*=\" icon-\"]{font-size:16px;font-size:1.6rem;position:relative;top:2px;left:2px;color:#0e5d91;margin-right:8px}.item-editor-item .widget-box.widget-blockInteraction .qti-interaction .add-option:hover,.item-editor-item .qti-inlineChoiceInteraction .add-option:hover{opacity:.8}.font-selector optgroup{font-style:normal;line-height:1.5;font-weight:normal;font-size:1.4rem;color:#6f6359;padding:2px}.font-selector option{font-size:1.2rem;color:#222}#appearance-trigger .icon-item{display:none}#item-editor-widget-bar{display:none}#panel-authoring{height:calc(100vh - 135px)}#item-editor-scope{height:calc(100% - 35px)}#item-editor-scope>nav.action-bar{z-index:15;padding:0;display:-ms-flex;display:-webkit-flex;display:flex;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-align-content:flex-start;align-content:flex-start;-webkit-align-items:stretch;align-items:stretch}#item-editor-scope>nav.action-bar .action-group{padding:5px;position:relative}#item-editor-scope>nav.action-bar .menu-left{-ms-order:0;-webkit-order:0;order:0;flex-item-align:stretch;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch;-ms-flex:0 0 195px;-webkit-flex:0 0 195px;flex:0 0 195px;border-right:1px solid #ddd}#item-editor-scope>nav.action-bar .menu-right{-ms-order:0;-webkit-order:0;order:0;flex-item-align:stretch;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch;-ms-flex:0 0 195px;-webkit-flex:0 0 195px;flex:0 0 195px;border-left:1px solid #ddd}#item-editor-scope>nav.action-bar .menu{-ms-order:0;-webkit-order:0;order:0;flex-item-align:stretch;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch;-ms-flex:1 1 auto;-webkit-flex:1 1 auto;flex:1 1 auto;-ms-flex:1 1;-webkit-flex:1 1;flex:1 1}#panel-authoring{height:calc(100vh - 135px)}#panel-authoring #item-editor-scope{height:100%}#item-editor-wrapper{margin:0;position:relative;background-color:#f3f1ef;height:100%;display:-ms-flex;display:-webkit-flex;display:flex;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-align-content:flex-start;align-content:flex-start;-webkit-align-items:stretch;align-items:stretch}#item-editor-wrapper .item-editor-item{position:relative}#item-editor-wrapper .item-editor-item [class*=\" col-\"],#item-editor-wrapper .item-editor-item [class^=\"col-\"]{padding:3px}.item-editor-response-related .response-mapping-info .feedback-info{padding:5px}.item-editor-css-editor select{min-width:0 !important;width:auto !important}.sidebar-right-section-box{display:none}#item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .tool-list:after{content:\" \";display:table}#item-editor-interaction-bar .tool-list:after{clear:both}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container label,.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .label{cursor:default}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .trigger{color:#0e5d91;float:right;padding:3px;margin-left:3px;cursor:pointer}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .trigger:hover{color:#6e9ebd}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .trigger:active{color:#9fbed3}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container.readonly .trigger{color:#b7b1ac !important;cursor:not-allowed}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .identifier-label{font-size:12.5px;font-size:1.25rem;display:inline-block;margin:0;width:calc(100% - 44px);overflow:hidden;text-overflow:ellipsis}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .identifier-label input.identifier{min-width:80px;display:none;margin-bottom:6px}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container h3{display:block}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .outcome-properties-form{display:none}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .minimum-maximum label{display:inline}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .minimum-maximum label.has-icon{display:inline-block;min-width:140px;width:140px}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .minimum-maximum .incrementer-ctrl-wrapper{margin:0 2px}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container .minimum-maximum .incrementer-ctrl-wrapper .incrementer{width:46px !important}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container.editing .icon-edit{font-weight:bold;color:#0e5d91}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container.editing .icon-edit:hover{color:#3e7da7}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container.editing .outcome-properties-form{display:block}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container.editing .identifier-label{margin-bottom:12px}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container.editing .identifier-label span.label{display:none}.item-editor-sidebar .tool-group .qti-outcome-editor .outcome-container.editing .identifier-label input.identifier{display:inline-block}#item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .tool-list:after{content:\" \";display:table}#item-editor-interaction-bar .tool-list:after{clear:both}#item-editor-interaction-bar img.interaction-sidebar-icon{width:28px;height:28px;display:block;margin:5px auto 8px;opacity:0.8}#item-editor-interaction-bar .tool-group .panel.sub-group{position:relative;padding-top:0 !important;padding-bottom:4px}#item-editor-interaction-bar .tool-group .panel.sub-group .tool-list{position:relative;z-index:4}#item-editor-interaction-bar .tool-group .panel.sub-group .sub-group-cover{position:absolute;left:0;top:-7px;width:96%;height:100%;background-color:rgba(243,241,239,0.3) !important;z-index:2;border:1px #8d949e solid;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;margin:2%;cursor:no-drop !important}#item-editor-interaction-bar .tool-group .panel.sub-group .sub-group-cover.blocking{z-index:10}#item-editor-interaction-bar .tool-group .panel.sub-group .sub-group-cover:after,#item-editor-interaction-bar .tool-group .panel.sub-group .sub-group-cover:before{bottom:100%;left:35%;border:solid transparent;content:\" \";height:0;width:0;position:absolute;pointer-events:none}#item-editor-interaction-bar .tool-group .panel.sub-group .sub-group-cover:after{border-color:transparent;border-bottom-color:#f3f1ef;border-width:8px;margin-left:-8px}#item-editor-interaction-bar .tool-group .panel.sub-group .sub-group-cover:before{border-color:transparent;border-bottom-color:#8d949e;border-width:9px;margin-left:-9px}#item-editor-interaction-bar .tool-list{margin-top:-3px}#item-editor-interaction-bar .tool-list li{width:50%;margin:0;float:left;padding:9px 3px;font-size:12px;font-size:1.2rem;border:1px dotted transparent;cursor:move;text-align:center}#item-editor-interaction-bar .tool-list li:hover{background:rgba(255,255,255,0.6);border:1px dotted #aaa}#item-editor-interaction-bar .tool-list li span{display:block;margin:5px auto 8px;font-size:28px;font-size:2.8rem;opacity:.9}#item-editor-interaction-bar .tool-list li img.icon{max-height:28px}#item-editor-interaction-bar .tool-list li.disabled{cursor:default;background-color:#eee !important}#item-editor-interaction-bar .tool-list li.disabled:hover{background:rgba(255,255,255,0.6);border:1px dotted transparent}#item-editor-interaction-bar .tool-list li.dev{background:#f3f7fa;color:#0e5d91}#item-editor-interaction-bar .tool-list li.dev:hover{background:rgba(255,255,255,0.6)}#item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .tool-list:after{content:\" \";display:table}#item-editor-interaction-bar .tool-list:after{clear:both}.window-popup .window-component-body{display:flex}.window-popup .window-component-body .math-popup-input{width:100%;max-width:none;resize:none}.window-popup .window-component-body .math-input{display:flex;flex-direction:column}.window-popup .window-component-body .math-input .math-input-toolbar .math-input-toolgroup{float:left;border-right:1px solid #a4bbc5;margin-right:10px;padding-right:10px;margin-bottom:5px}.window-popup .window-component-body .math-input .math-input-toolbar .math-input-toolgroup:last-child{margin-right:0;padding-right:0;border-right:none}.window-popup .window-component-body .math-input .math-input-toolbar .math-input-toolgroup .math-input-tool{margin:1px}.window-popup .window-component-body .math-input .math-input-form{clear:both;flex:1;margin-top:10px}.window-popup .window-component-body .math-input .math-input-form .math-input-mathquill{width:100%;height:100%;border-color:#ddd;background:#fff}.item-editor-sidebar-wrapper{background:#f3f1ef;position:relative;padding-bottom:35px;-ms-order:0;-webkit-order:0;order:0;flex-item-align:stretch;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch;-ms-flex:0 0 195px;-webkit-flex:0 0 195px;flex:0 0 195px;overflow-y:auto;overflow-x:hidden}.item-editor-sidebar-wrapper.left-bar .item-editor-sidebar{border-right:1px solid #fff}.item-editor-sidebar-wrapper.right-bar .item-editor-sidebar{border-left:1px solid #fff}.item-editor-sidebar-wrapper.right-bar .tooltip{max-width:200px}.item-editor-sidebar .tool-group h2{font-size:14px;font-size:1.4rem;border-top:1px white solid;font-weight:normal;line-height:30px;padding:0 6px;letter-spacing:.06rem;clear:left;margin:0 0 0 0;color:#000;position:relative;background:#dddfe2;cursor:pointer}.item-editor-sidebar .tool-group h2 .icon-down{display:none}.item-editor-sidebar .tool-group h2 .icon-up{display:block}.item-editor-sidebar .tool-group h2.closed .icon-down{display:block}.item-editor-sidebar .tool-group h2.closed .icon-up{display:none}.item-editor-sidebar .tool-group h2 span{position:absolute;top:9px;right:9px}.item-editor-sidebar .tool-group h2.toggler:after{float:right;top:0}.item-editor-sidebar .tool-group hr{margin:6px 8px 4px 8px}.item-editor-sidebar .tool-group .panel{padding:15px 5px 8px 5px}.item-editor-sidebar .tool-group .panel .panel{padding:0;margin-bottom:15px}.item-editor-sidebar .tool-group .panel hr{margin-bottom:15px}.item-editor-sidebar .tool-group .panel h3{padding:0 0 12px 0;margin:0;font-size:14px;font-size:1.4rem;max-width:450px;display:inline-block}.item-editor-sidebar .tool-group .panel h3.full-width{max-width:none;display:block}.item-editor-sidebar .tool-group .panel select,.item-editor-sidebar .tool-group .panel input[type=\"text\"],.item-editor-sidebar .tool-group .panel textarea{width:100%}.item-editor-sidebar .tool-group .panel select.has-icon,.item-editor-sidebar .tool-group .panel input[type=\"text\"].has-icon,.item-editor-sidebar .tool-group .panel textarea.has-icon{width:140px;min-width:140px;max-width:140px}.item-editor-sidebar .tool-group .panel select.short{width:auto;min-width:100px}.item-editor-sidebar .tool-group .panel .icon-help.tooltipstered{cursor:pointer;float:right}.item-editor-sidebar .tool-group .panel:last-child,.item-editor-sidebar .tool-group .panel .panel-row{margin-bottom:7px}.item-editor-sidebar .tool-group .panel label{padding:0;font-size:13px;font-size:1.3rem}.item-editor-sidebar .tool-group .panel label.has-icon{width:140px;min-width:140px;max-width:140px;display:inline-block}.item-editor-sidebar .tool-group .panel input.score{width:40px;min-width:40px}.item-editor-sidebar .tool-group .panel button.block{width:100%;margin-top:5px}.item-editor-sidebar .tool-group .panel .feedbackRule-panel .adder :before{font-size:1.4rem}.item-editor-sidebar .tool-group .panel.subpanel{border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;background-color:rgba(255,255,255,0.8);padding:8px;margin:5px 0;font-size:13px;font-size:1.3rem}.item-editor-sidebar .tool-group .panel .icon-help.tooltipstered{color:#0e5d91}.item-editor-sidebar .inset{margin-left:6px;margin-right:6px}.item-editor-sidebar:first-child{right:auto;left:0}.item-editor-sidebar .reset-group select{width:140px;min-width:140px;max-width:140px}.item-editor-sidebar .reset-group .reset-button{position:relative;top:6px;right:3px;float:right;padding:0;height:20px;width:20px;text-align:right;cursor:pointer}.item-editor-sidebar .reset-group .reset-button:hover{color:#3e7da7}.item-editor-sidebar .item-editor-unit-input-box{position:relative;display:inline}.item-editor-sidebar .item-editor-unit-input-box input{padding-right:28px}.item-editor-sidebar .item-editor-unit-input-box .unit-indicator{width:28px;line-height:28px;height:28px;color:#919191;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.item-editor-sidebar #item-editor-item-resizer .reset-group{display:none}.item-editor-sidebar .cbr-right{width:100%}.item-editor-sidebar .cbr-right span.icon-checkbox,.item-editor-sidebar .cbr-right span.icon-radio{float:right}.item-editor-sidebar .spinner{min-width:100px;line-height:22px}.item-editor-sidebar .spinner ~ .tooltipstered{top:6px}.item-editor-sidebar .spinner.short{padding-right:10px}.item-editor-sidebar .min-max-panel .spinner{min-width:90px}.item-editor-sidebar .incrementer.large{min-width:55px !important}.item-editor-sidebar .incrementer-ctrl{top:-3px}.item-editor-sidebar #item-editor-font-size-changer{padding-top:1px;overflow:hidden;display:table;width:140px;float:left}.item-editor-sidebar #item-editor-font-size-changer a{display:table-cell;padding:0 10px;color:#222;text-decoration:none !important;width:70px;line-height:21px;text-align:left}.item-editor-sidebar #item-editor-font-size-changer a.icon-smaller{text-align:right}.item-editor-sidebar #item-editor-font-size-changer .icon-smaller{font-size:12px;font-size:1.2rem}.item-editor-sidebar #item-editor-font-size-changer .icon-larger{font-size:18px;font-size:1.8rem}.item-editor-sidebar #style-sheet-toggler .style-sheet-toggler{font-size:11px;font-size:1.1rem;border:1px solid #ccc;border-radius:2px;-webkit-border-radius:2px;display:inline-block;width:20px;height:18px;padding:2px 0 1px 3px;cursor:pointer !important;margin:0 4px 0 2px}.item-editor-sidebar #style-sheet-toggler .style-sheet-toggler.disabled:before{font-family:'tao' !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\e643\"}.item-editor-sidebar #style-sheet-toggler .style-sheet-label-editor{display:none;width:100px;min-width:100px;padding:0px 3px;font-size:13px;font-size:1.3rem;position:relative;top:1px}.item-editor-sidebar #style-sheet-toggler .icon-download,.item-editor-sidebar #style-sheet-toggler .icon-bin{float:right;cursor:pointer;margin-left:5px;position:relative;top:2px}.item-editor-sidebar #style-sheet-toggler .not-available,.item-editor-sidebar #style-sheet-toggler .not-available *{color:#919191;cursor:default !important}.item-editor-sidebar #style-sheet-toggler .file-label{display:inline-block;cursor:pointer;width:100px;line-height:.9;position:relative;font-size:13px;font-size:1.3rem;top:2px}.item-editor-sidebar #style-sheet-toggler .file-label:hover{color:#3e7da7}.item-editor-sidebar #stylesheet-uploader{width:100%}.item-editor-sidebar .item-editor-color-picker .color-trigger{width:40px;display:inline-block;height:18px;float:right;font-size:9px;cursor:pointer;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px}.item-editor-sidebar .item-editor-color-picker .reset-button{font-size:13px;font-size:1.3rem;top:5px}.item-editor-sidebar .item-editor-color-picker #color-picker-container{top:-235px}.item-editor-sidebar .item-editor-color-picker #color-picker-container label{max-width:60% !important}.item-editor-sidebar .item-editor-color-picker .color-picker{margin-top:-5px}.item-editor-sidebar .compass{position:relative;width:100px;margin:auto}.item-editor-sidebar .compass span{display:block;font-size:25px;font-size:2.5rem;line-height:1.1;width:33%;background:#fff;text-align:center;cursor:pointer;border:1px dotted #aaa}.item-editor-sidebar .compass span:hover{background:#3e7da7;color:#fff}.item-editor-sidebar .compass span.icon-up,.item-editor-sidebar .compass span.icon-down{margin:auto}.item-editor-sidebar .compass span.icon-left{float:left}.item-editor-sidebar .compass span.icon-right{float:right}.sidebar-popup{background:#f3f1ef;padding:1px;position:absolute;right:182px;top:37px;width:180px;-webkit-box-shadow:0 0 2px 0px rgba(141,148,158,0.75);-moz-box-shadow:0 0 2px 0px rgba(141,148,158,0.75);box-shadow:0 0 2px 0px rgba(141,148,158,0.75);display:none;z-index:15000}.sidebar-popup .sidebar-popup-content{overflow-y:auto}.sidebar-popup .sidebar-popup-content>.panel{padding-left:5px !important;padding-right:5px !important}.sidebar-popup .sidebar-popup-title{color:#fff;background:#3e7da7;margin-bottom:2px;cursor:move}.sidebar-popup .sidebar-popup-title a{color:#fff}.sidebar-popup .sidebar-popup-title .closer{position:absolute;top:1px;right:2px}.sidebar-popup .sidebar-popup-title h3{padding:0 5px !important}.sidebar-popup input,.sidebar-popup textarea{width:100%;max-width:none;display:block}.sidebar-popup.one-twenty-five{width:225px}.sidebar-popup.one-fifty{width:270px}.sidebar-popup.two{width:360px}.sidebar-popup.two-twenty-five{width:405px}.sidebar-popup.two-fifty{width:450px}.sidebar-popup.three{width:540px}.sidebar-popup.three-twenty-five{width:585px}.sidebar-popup.three-fifty{width:630px}.sidebar-popup.mathml input{display:none;font-family:Consolas,\"Andale Mono WT\",\"Andale Mono\",\"Lucida Console\",\"Lucida Sans Typewriter\",\"DejaVu Sans Mono\",\"Bitstream Vera Sans Mono\",\"Liberation Mono\",\"Nimbus Mono L\",Monaco,\"Courier New\",Courier,monospace}.sidebar-popup.mathml textarea{height:250px;font-family:Consolas,\"Andale Mono WT\",\"Andale Mono\",\"Lucida Console\",\"Lucida Sans Typewriter\",\"DejaVu Sans Mono\",\"Bitstream Vera Sans Mono\",\"Liberation Mono\",\"Nimbus Mono L\",Monaco,\"Courier New\",Courier,monospace}.sidebar-popup.latex textarea{display:none;font-family:Consolas,\"Andale Mono WT\",\"Andale Mono\",\"Lucida Console\",\"Lucida Sans Typewriter\",\"DejaVu Sans Mono\",\"Bitstream Vera Sans Mono\",\"Liberation Mono\",\"Nimbus Mono L\",Monaco,\"Courier New\",Courier,monospace}.sidebar-popup.color-picker-container{right:0}#item-editor-panel{padding:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAAAAAA7VNdtAAAFQElEQVR42iXWW45kSREEUDN/xM3M6h4GJCT2vyl2gVBPV1XeCHc3PjirOPFvQE0HWecC3rZ4D9JFcpqSEy4MRO2Cw6M7y6xFY/xaz9fuThJGVSVNpvK7jL3Ggoyp4NsDzjd8dYJS+H8/HtNCo1HjRoNxoto8Wj1xntjG41srvQ7S67JC9UN30vz3snNpfBrEyNaOi5g3ctJFeluZra4rgwJIpMema9qCmEWtsK/I+fpbeDfSXe+AlQMoSxlwreFXRifYhNd4DL6erzoImTTg83iJFbCoM2Z3QqoGeLSmix3Hcvp11yzyax6ujkMEaV02MD/xYB1j2/SoK+IOi738OidmWCrfzwa2zy975XQeOMxNu1+kFS2esEGHrU+vR48LNyVTyQnrz4WK6oVmkaProfD3o1bvRcfywb4/Xsf9IBi70Ethc9qdj2dJXrNiazeN1XDJ+rdbtHkNE/b6/v6JAALjhrn1YHy9A68JGAQCZ/IfIMyaz7OZZjjBQbg0mo3Hd8RnXKSp348L3cdc+6qF6ePCvPPPniFkFIka9P7jn9GVhx5WeT7jB+qOmTRD0xzec/OaovsMn1/TDyBk8/2Rfnq5E0debzcsHwgqNNkS2ylitYcsytui5a14jaCrYp1kjxPHTa/9zqRGxOd6lqgw79pJoX01SPCpW1edJSW3aiwJVifmfk77O1Lx6ESH4Nh5m8e46RzDxYMnzLBd49Lj7u44gRtXb99uRqoTJlicX/FY7O1mU2QjOfIXH7/19zhujmIxUeU+Y1QKf6YTLa8Oo6YHwLmkaAszyLJfczoMUJK0Ssfo6KM+OetMDtBI2/NUhw3uDJi2X7px2XGNqcjTafYRezNhNrERruMnbpiZXFwxjBmQaEouS1RfvtrwJmjhkNe7Yruln4DMBIEDOQ4uFA/O9jLTjJs1j7tcEYZK2NhqsD6f+5rqyB4ddCnj/R2ewSHpjuOPHdf00AChWR4EYtu0hRXEq97FqHFqbFTz/FZs9/eHVIYJpKPdeVdYw/DE8AKNFyGU7E7MBFDZ5kQ1zX0KzEDPwC7zz35dN4ygpi67/DaP19ij7ycgo6M3hZOvrnzPC4pq0F0wFaCAeYWFYFadZibt79fomJg38vbsoV2ghpuL3RO00EC6vjsc1sRrlaJbpnTUODAa2poFTr0XnfHuH7qtftuDGJPB5vfPPM6AQou7fIzWM4p4XMDEG2D1j8Bk70tqWVqbOzTHDco5l4rs4RA8O5aG6z62mfY6CIgvb8OACvvGIgC1Qx7Y1ExcLWmlHb0t8QBcYYAoeY/Y5t7lbY9uu+7xZwANoTKzaoYO63EvBFqYtK3rasyS/Db5ZIfPROCMjQlJoLuYBNkTENIk9JnLtGBdZwUQGvNmPRxdEfdb50cLevs1Elk7c50Rre4n/vOvQPqRPIRDmbEjsuAiImQDk9gpdlKw/fyh8K4JSMxmGXFfD3doyOvux32enindFoDMb3MF0IGK8gHTZgxoqggpTInvH9ao9B6Td9oo5qyBw8eBBntCRj5GOuTktVxz//XHk+p2mXrifiMokq5BR94DNkPCsJBt3f4071kDOQwd/hPz/rnHgbGRns3vxTOOy2ff5uf7mReOgQ4K8gDID62De5VRZe/rfuSMYKOrdsczymEhx4hTJyZvrbYYie0QBj/1V4agcVV4JXqmYgFb8sxYQ95BFdsNyPPHoadIqM1fLYdiT4gQ+P00xZfZih5YtkFn7Xdw7P/FIeltYjSfW+Q1IZ7wcQgU4DupThfe9aN3wtCUjJoLktqBD27/HztqGm4EFwGoAAAAAElFTkSuQmCC);position:relative;overflow:hidden;height:100%;-ms-order:0;-webkit-order:0;order:0;flex-item-align:stretch;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch;-ms-flex:1 1 auto;-webkit-flex:1 1 auto;flex:1 1 auto;-ms-flex:1 1;-webkit-flex:1 1;flex:1 1}#item-editor-panel #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar #item-editor-panel .tool-list:before,#item-editor-panel #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar #item-editor-panel .tool-list:after{content:\" \";display:table}#item-editor-panel #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar #item-editor-panel .tool-list:after{clear:both}#item-editor-panel .item-editor-bar{position:absolute;width:100%;min-height:31px;z-index:100;background:#dddfe2;border-top:1px solid white;border-bottom:0;-webkit-box-shadow:0px 6px 10px -5px #b7b1ac;-moz-box-shadow:0px 6px 10px -5px #b7b1ac;-ms-box-shadow:0px 6px 10px -5px #b7b1ac;-o-box-shadow:0px 6px 10px -5px #b7b1ac;box-shadow:0px 6px 10px -5px #b7b1ac}#item-editor-panel .item-editor-bar>h1{position:absolute;width:100%;text-align:center;font-size:15px;font-size:1.5rem;line-height:28px;padding:0 10px;margin:0}#item-editor-panel .item-editor-bar .cke .cke_top{border:none;border-radius:0;padding:0;margin:0;width:100%;background:#dddfe2;box-shadow:unset}#item-editor-panel .item-editor-bar .cke .cke_top .cke_toolbar .cke_combo_disabled .cke_combo_button:hover,#item-editor-panel .item-editor-bar .cke .cke_top .cke_toolbar .cke_button_disabled:hover{background:transparent !important;color:#222 !important;cursor:default}#item-editor-panel .item-editor-bar .cke .cke_top .cke_toolbar .cke_button_icon,#item-editor-panel .item-editor-bar .cke .cke_top .cke_toolbar .cke_button{height:21px;font-size:14px;line-height:16px}#item-editor-panel .item-editor-bar .cke .cke_top .cke_toolbar .cke_toolgroup{background:transparent;border:none;margin-bottom:1px}#item-editor-panel .item-editor-bar .cke .cke_top .cke_toolbar .cke_toolbar_end{border-right:1px solid #b2b2b2;top:4px;position:relative;margin:0px 5px}#item-editor-panel .item-editor-bar .cke .cke_top .cke_toolbar .cke_combo{height:18px;padding-top:2px}#item-editor-panel .item-editor-bar .cke .cke_top .cke_toolbar .cke_combo .cke_combo_text{height:20px;line-height:22px;padding-top:0px}#item-editor-panel .item-editor-bar .cke .cke_top .cke_toolbar .cke_combo .cke_combo_open{height:17px}#item-editor-panel .item-editor-bar .cke .cke_top .cke_toolbar .cke_combo .cke_combo_open .cke_combo_arrow{margin:6px 0 0}#item-editor-panel .item-editor-bar .invalid-info-box{border-color:#dcb66b;background-color:#f7efde;margin-top:28px;height:28px;padding-top:5px;padding-left:10px}#item-editor-panel #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar #item-editor-panel .tool-list:before,#item-editor-panel #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar #item-editor-panel .tool-list:after{content:\" \";display:table}#item-editor-panel #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar #item-editor-panel .tool-list:after{clear:both}#item-editor-panel .widget-table{display:inline-block}#item-editor-panel .widget-table.table-center{display:table;margin:0 auto}#item-editor-panel .widget-table.table-right{display:table;margin:0 0 0 auto}#item-editor-panel .widget-table .qti-table-container{border:0}#item-editor-panel .widget-table table.qti-table th.hoverDelete,#item-editor-panel .widget-table table.qti-table td.hoverDelete{background-color:#f9f3e6}#item-editor-panel .widget-table table.qti-table th.insertColAfter,#item-editor-panel .widget-table table.qti-table td.insertColAfter{border-right-color:#87aec8;border-right-width:3px}#item-editor-panel .widget-table table.qti-table th.insertRowAfter,#item-editor-panel .widget-table table.qti-table td.insertRowAfter{border-bottom-color:#87aec8;border-bottom-width:3px}#item-editor-panel .widget-table .mini-tlb{width:28px;right:-32px}#item-editor-panel .table-tlb{display:block;right:auto;top:auto}#item-editor-panel .window-component.widget-popup{border:0;z-index:99;background-color:rgba(243,241,239,0.9)}#item-editor-panel .window-component.widget-popup .window-component-title-bar{background-color:#266d9c;color:#fff;text-shadow:1px 1px 0 #0b4a74}#item-editor-panel .window-component.widget-popup .window-component-title-bar .window-component-title{padding:auto}#item-editor-panel .window-component.widget-popup .window-component-body{padding:20px 20px 0;background-color:transparent}#item-editor-panel .window-component.widget-popup .widget-popup-controls-area{padding:10px 10px;display:flex;justify-content:flex-end}#item-editor-panel #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar #item-editor-panel .tool-list:before,#item-editor-panel #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar #item-editor-panel .tool-list:after{content:\" \";display:table}#item-editor-panel #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar #item-editor-panel .tool-list:after{clear:both}#item-editor-panel .qti-tooltip-editor{min-width:250px;max-width:350px}#item-editor-panel .qti-tooltip-editor .tooltip-editor-target-container{margin-bottom:5px}#item-editor-panel .qti-tooltip-editor .tooltip-editor-target-container .tooltip-editor-target{border:1px #ddd solid;text-align:center;cursor:text;padding:3px 5px;background-color:#fff;margin-bottom:2px}#item-editor-panel .qti-tooltip-editor .tooltip-editor-content-container{position:relative;margin-bottom:10px}#item-editor-panel .qti-tooltip-editor .tooltip-editor-content-container .tooltip-editor-content{background-color:#ffffa3;border:1px solid #f1d031;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;width:90%;margin:0 auto;padding:5px;font-size:1.3rem;font-weight:normal;color:#222;cursor:text}#item-editor-panel .qti-tooltip-editor .tooltip-editor-content-container .tooltip-editor-tip{transform:rotate(45deg) skew(20deg, 20deg);position:absolute;bottom:-5px;left:calc(50% - 5px);width:10px;height:10px;background-color:#ffffa3;border-right:1px solid #f1d031;border-bottom:1px solid #f1d031}#item-editor-panel.has-item #item-editor-scroll-outer{background-image:none}#item-editor-panel h1{font-weight:300;margin:0}#item-editor-panel .item-editor-drop-area{min-height:300px;padding-bottom:20px;margin-top:20px;position:relative;z-index:10}#item-editor-panel .item-editor-row{min-height:100px;overflow-x:hidden;overflow-y:visible}#item-editor-scoll-container{position:relative;height:100%;-ms-order:0;-webkit-order:0;order:0;flex-item-align:stretch;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch;-ms-flex:1 1 auto;-webkit-flex:1 1 auto;flex:1 1 auto;-ms-flex:1 1;-webkit-flex:1 1;flex:1 1;overflow:auto}#item-editor-scoll-container #item-editor-scroll-inner{padding:80px 60px 20px}#item-editor-scoll-container #item-editor-scroll-outer{background-image:url(data:image/gif;base64,R0lGODlhKwALAPEAAN3d3TMzM4mJiTMzMyH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAKwALAAACMoSOCMuW2diD88UKG95W88uF4DaGWFmhZid93pq+pwxnLUnXh8ou+sSz+T64oCAyTBUAACH5BAkKAAAALAAAAAArAAsAAAI9xI4IyyAPYWOxmoTHrHzzmGHe94xkmJifyqFKQ0pwLLgHa82xrekkDrIBZRQab1jyfY7KTtPimixiUsevAAAh+QQJCgAAACwAAAAAKwALAAACPYSOCMswD2FjqZpqW9xv4g8KE7d54XmMpNSgqLoOpgvC60xjNonnyc7p+VKamKw1zDCMR8rp8pksYlKorgAAIfkECQoAAAAsAAAAACsACwAAAkCEjgjLltnYmJS6Bxt+sfq5ZUyoNJ9HHlEqdCfFrqn7DrE2m7Wdj/2y45FkQ13t5itKdshFExC8YCLOEBX6AhQAADsAAAAAAAAAAAA=);background-position:center 250px;background-repeat:no-repeat;position:relative}.item-editor-item{border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;-webkit-box-shadow:0px 6px 8px 0px #b7b1ac;-moz-box-shadow:0px 6px 8px 0px #b7b1ac;-ms-box-shadow:0px 6px 8px 0px #b7b1ac;-o-box-shadow:0px 6px 8px 0px #b7b1ac;box-shadow:0px 6px 8px 0px #b7b1ac}.item-editor-item [class*=\" col-\"],.item-editor-item [class^=\"col-\"]{position:relative}.item-editor-item .inserting .widget-block,.item-editor-item .inserting .widget-blockInteraction{border:1px dashed #ddd}.item-editor-item .inserting .widget-img img{display:flex;height:100%}.item-editor-item .hoverable .widget-box.edit-sleep{position:relative}.item-editor-item .hoverable .widget-box.edit-sleep::after{content:'';display:block;position:absolute;left:0;top:0;width:100%;height:100%}.item-editor-item .hoverable .widget-box.widget-inline{display:inline-block}.item-editor-item .hoverable .widget-box.widget-block{display:block}.item-editor-item .hoverable .widget-box.widget-blockInteraction.edit-active{padding-top:24px}.item-editor-item .hoverable .widget-box.widget-img img{display:flex;height:100%}.item-editor-item .widget-box{border:1px solid transparent;position:relative}.item-editor-item .widget-box .overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(243,241,239,0.5)}.item-editor-item .widget-box .overlay .message{padding:10px;background:rgba(243,241,239,0.6);margin:auto;position:absolute;top:40%;left:0;bottom:auto;right:auto;display:block;min-height:30px;width:100%}.item-editor-item .widget-box .tlb-bar{z-index:99}.item-editor-item .widget-box .tlb-wrapper{position:absolute;width:100%;left:0;top:0px;display:block;cursor:default;color:white;background:#266d9c;text-shadow:1px 1px 0 #0b4a74;z-index:999;-webkit-box-shadow:0 0 0 1px #3e7da7;box-shadow:0 0 0 1px #3e7da7}.item-editor-item .widget-box .tlb-wrapper .tlb-title{margin-top:3px;line-height:1.4;font-size:14px !important;font-size:1.4rem !important}.item-editor-item .widget-box .tlb-wrapper .tlb{position:relative}.item-editor-item .widget-box .tlb-wrapper .tlb:before{content:'';height:100%;width:10px;position:absolute;right:100%;top:0;background:linear-gradient(left, transparent, #3e7da7)}.item-editor-item .widget-box .tlb-wrapper .tlb .state-switcher{float:right;padding:0;font-size:14px !important;font-size:1.4rem !important}.item-editor-item .widget-box .tlb-wrapper .tlb>div{margin:3px 0 2px}.item-editor-item .widget-box .tlb-wrapper .tlb .state-switcher{margin-right:15px}.item-editor-item .widget-box .tlb-wrapper .tlb .state-switcher .selected{font-size:1.4rem;font-weight:bold}.item-editor-item .widget-box .tlb-wrapper .tlb .state-switcher .link{font-size:1.4rem}.item-editor-item .widget-box .tlb-wrapper .tlb .state-switcher .link:hover{cursor:pointer;text-decoration:underline}.item-editor-item .widget-box .tlb-wrapper .tlb .state-switcher .separator{font-size:1.4rem}.item-editor-item .widget-box .tlb-wrapper .tlb .tlb-button{padding:3px 6px 0px;opacity:0.8;font-size:13px;font-size:1.3rem}.item-editor-item .widget-box .tlb-wrapper .tlb .tlb-button:hover{cursor:pointer;font-weight:bold;opacity:1}.item-editor-item .widget-box .tlb-wrapper .tlb .tlb-button [class^=\"icon-\"],.item-editor-item .widget-box .tlb-wrapper .tlb .tlb-button [class*=\" icon-\"]{font-size:inherit;text-shadow:1px 1px 0 #0b4a74}.item-editor-item .widget-box>.common-tlb{overflow:hidden;margin:auto;width:20px;display:none;position:absolute;top:10px;left:0;right:0;padding:0;background:rgba(243,241,239,0.5)}.item-editor-item .widget-box.hover>.common-tlb{display:inline-block;cursor:move}.item-editor-item .widget-box .float-space-top.cke_nose{display:block;right:5px;bottom:-6px}.item-editor-item .widget-box .float-space-bottom.cke_nose{display:block;top:-6px}.item-editor-item .widget-box.invalid{border:1px solid #d8ae5b !important}.item-editor-item .widget-box.widget-blockInteraction .qti-choice:not(th){border:1px solid transparent}.item-editor-item .widget-box.widget-blockInteraction .qti-choice .inner-wrapper{min-width:1rem;border:1px solid transparent}.item-editor-item .widget-box.widget-blockInteraction .qti-choice .inner-wrapper>div>div{display:flex}.item-editor-item .widget-box.widget-blockInteraction .qti-interaction .add-option>div{display:table;width:100%;height:100%}.item-editor-item .widget-box.widget-blockInteraction .qti-interaction .add-option>div [class^=\"icon-\"],.item-editor-item .widget-box.widget-blockInteraction .qti-interaction .add-option>div [class*=\" icon-\"]{display:table-cell;font-size:60px;font-size:6rem;position:static !important;vertical-align:middle;width:100%;height:100%;text-align:center;top:0;left:auto;padding:0}.item-editor-item .widget-box.widget-blockInteraction .qti-interaction .qti-prompt .cke_editable{margin-top:1px}.item-editor-item .widget-box.widget-blockInteraction .qti-interaction.qti-orderInteraction .qti-choice.edit-answer.active{cursor:default;z-index:9;border:1px solid #3e7da7}.item-editor-item .widget-box .widget-ok{display:none;float:right;margin:5px;position:relative;z-index:1}.item-editor-item .widget-box-placeholder{display:inline-block;margin:0;min-width:150px;position:relative;vertical-align:middle;background-color:#eee}.item-editor-item [data-edit]{display:none}.item-editor-item [data-edit]>[class*=\" col-\"],.item-editor-item [data-edit] [class^=\"col-\"]{margin-bottom:0 !important}.item-editor-item [data-edit].mini-tlb-label{position:absolute;top:-30px;left:-10px;background:#f3f1ef}.item-editor-item [data-edit].mini-tlb-label label{color:#0e5d91;cursor:default;font-size:12px;font-size:1.2rem;padding:2px 4px;margin:0}.item-editor-item .inner-wrapper{position:relative}.item-editor-item .dummy-element{min-width:50px;border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;background-color:#eee;font-style:italic;color:white;padding:0;display:inline-block;line-height:24px;cursor:default}.item-editor-item .dummy-element [class^=\"icon-\"],.item-editor-item .dummy-element [class*=\" icon-\"]{font-size:inherit;line-height:inherit}.item-editor-item .widget-inline{z-index:20}.item-editor-item .widget-inline,.item-editor-item .inline-text-wrapper{position:relative;display:inline-block}.item-editor-item .widget-inline [class^=\"icon-\"],.item-editor-item .widget-inline [class*=\" icon-\"],.item-editor-item .inline-text-wrapper [class^=\"icon-\"],.item-editor-item .inline-text-wrapper [class*=\" icon-\"]{width:100%;top:-2px}.item-editor-item .widget-inline ~ span.mini-tlb[data-edit],.item-editor-item .inline-text-wrapper ~ span.mini-tlb[data-edit]{position:absolute !important;top:-2px !important;right:-32px !important}.item-editor-item .widget-inline ~ span.mini-tlb[data-edit] .tlb-button,.item-editor-item .inline-text-wrapper ~ span.mini-tlb[data-edit] .tlb-button{margin:0 !important;padding:0 !important;height:24px !important;width:24px !important}.item-editor-item .widget-inline .mini-tlb[data-edit],.item-editor-item .inline-text-wrapper .mini-tlb[data-edit]{right:-32px !important}.item-editor-item .widget-include,.item-editor-item .qti-hottext,.item-editor-item .qti-gap,.item-editor-item .dummy-element{position:relative;display:inline-block}.item-editor-item .widget-include [class^=\"icon-\"],.item-editor-item .widget-include [class*=\" icon-\"],.item-editor-item .qti-hottext [class^=\"icon-\"],.item-editor-item .qti-hottext [class*=\" icon-\"],.item-editor-item .qti-gap [class^=\"icon-\"],.item-editor-item .qti-gap [class*=\" icon-\"],.item-editor-item .dummy-element [class^=\"icon-\"],.item-editor-item .dummy-element [class*=\" icon-\"]{display:inline-block;text-align:center;width:100%;position:relative;top:-2px}.item-editor-item .widget-include ~ span.mini-tlb[data-edit],.item-editor-item .qti-hottext ~ span.mini-tlb[data-edit],.item-editor-item .qti-gap ~ span.mini-tlb[data-edit],.item-editor-item .dummy-element ~ span.mini-tlb[data-edit]{position:absolute !important;top:-2px !important;right:-30px !important}.item-editor-item .widget-include ~ span.mini-tlb[data-edit] .tlb-button,.item-editor-item .qti-hottext ~ span.mini-tlb[data-edit] .tlb-button,.item-editor-item .qti-gap ~ span.mini-tlb[data-edit] .tlb-button,.item-editor-item .dummy-element ~ span.mini-tlb[data-edit] .tlb-button{margin:0 !important;padding:0 !important;height:24px !important;width:24px !important}.item-editor-item .widget-include .mini-tlb[data-edit],.item-editor-item .qti-hottext .mini-tlb[data-edit],.item-editor-item .qti-gap .mini-tlb[data-edit],.item-editor-item .dummy-element .mini-tlb[data-edit]{right:-32px !important}.item-editor-item .qti-hottext .hottext-content{user-select:none}.item-editor-item .qti-gap{margin-right:30px}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .widget-box.widget-block.widget-object{display:inline-block;vertical-align:bottom;max-width:100%}.item-editor-item .widget-box.widget-block.widget-object.previewer{max-width:100%}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .qti-choiceInteraction .real-label input[disabled] ~ [class^=\"icon-\"]{cursor:pointer !important}.item-editor-item .qti-choiceInteraction .choice-area .label-content{display:block}.item-editor-item .qti-choiceInteraction .mini-tlb{right:-38px}.item-editor-item [dir=rtl] .qti-choiceInteraction .mini-tlb{right:auto;left:-38px}.item-editor-item .qti-choiceInteraction .mini-tlb[data-edit=answer]{width:38px;background:transparent;border-color:transparent !important}.item-editor-item .qti-choiceInteraction .mini-tlb[data-edit=answer] .tlb-button{margin:0;padding:0}.item-editor-item .qti-choiceInteraction .mini-tlb[data-edit=answer] .tlb-button:hover{background:transparent}.item-editor-item .qti-choiceInteraction .horizontal .mini-tlb{top:-28px;right:0}.item-editor-item [dir=rtl] .qti-choiceInteraction .horizontal .mini-tlb{left:0;right:auto}.item-editor-item .qti-choiceInteraction .horizontal .qti-choice.edit-choice{padding-top:5px}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .qti-orderInteraction .mini-tlb{right:-38px;top:4px}.item-editor-item [dir=rtl] .qti-orderInteraction .mini-tlb{right:auto;left:-38px}.item-editor-item .qti-orderInteraction.qti-horizontal .qti-choice .mini-tlb{right:-1px;top:-28px;left:auto}.item-editor-item [dir=rtl] .qti-orderInteraction.qti-horizontal .qti-choice .mini-tlb{right:auto;left:-1px}.item-editor-item [data-qti-class=\"orderInteraction\"].edit-question .arrow-bar{visibility:hidden}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .qti-associateInteraction .add-option{position:relative;padding:5px 5px 5px 6px}.item-editor-item .qti-associateInteraction .add-option .icon-add{font-size:1.8rem;left:6px;position:absolute;top:5px}.item-editor-item .qti-associateInteraction .choice-area .qti-choice:not(th){azimuth:nonsense;border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px}.item-editor-item .qti-associateInteraction .choice-area .qti-choice:not(th):hover{border-color:#3e7da7}.item-editor-item .qti-associateInteraction .choice-area .qti-choice .mini-tlb[data-edit]{top:-33px !important;right:-7px !important}.item-editor-item .qti-associateInteraction .result-area>li>.mini-tlb[data-edit]{top:22%;right:-80px;width:70px}.item-editor-item .qti-associateInteraction .result-area>li>.target[data-edit]{float:none;position:absolute;right:-230px;outline:none;width:200px;border:none;cursor:default}.item-editor-item .qti-associateInteraction .result-area>li>.target[data-edit] .col-3,.item-editor-item .qti-associateInteraction .result-area>li>.target[data-edit] .col-4,.item-editor-item .qti-associateInteraction .result-area>li>.target[data-edit] .col-5{text-align:center}.item-editor-item .qti-associateInteraction .result-area>li>.target[data-edit] .col-3 label,.item-editor-item .qti-associateInteraction .result-area>li>.target[data-edit] .col-4 label,.item-editor-item .qti-associateInteraction .result-area>li>.target[data-edit] .col-5 label{position:relative;top:5px}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .edit-question .match-interaction-area{margin-top:32px}.item-editor-item .qti-matchInteraction .qti-prompt-container{margin:5px 0 15px}.item-editor-item .qti-matchInteraction table.matrix th{padding:0}.item-editor-item .qti-matchInteraction table.matrix thead .mini-tlb{top:-32px;left:auto}.item-editor-item [dir=rtl] .qti-matchInteraction table.matrix thead .mini-tlb{left:0;right:auto}.item-editor-item .qti-matchInteraction table.matrix tbody .mini-tlb{top:-1px;right:calc(100% + 7px)}.item-editor-item [dir=rtl] .qti-matchInteraction table.matrix tbody .mini-tlb{right:auto;left:calc(100% + 7px)}.item-editor-item .qti-matchInteraction table.matrix tbody [contenteditable=\"false\"] .mini-tlb{right:-32px !important;left:auto !important}.item-editor-item .qti-matchInteraction table.matrix td input[disabled] ~ [class^=\"icon-\"]{cursor:default !important}.item-editor-item .qti-matchInteraction table.matrix .mini-tlb{width:auto;margin:0;padding:0}.item-editor-item [dir=rtl] .qti-matchInteraction table.matrix .mini-tlb{left:auto}.item-editor-item .qti-matchInteraction table.matrix .mini-tlb .tlb-button{margin:0;padding:0;display:flex;align-items:center;justify-content:center}.item-editor-item .qti-matchInteraction table.matrix .mini-tlb .tlb-button [class^=\"icon-\"],.item-editor-item .qti-matchInteraction table.matrix .mini-tlb .tlb-button [class*=\" icon-\"]{top:initial;left:initial;transform:initial}.item-editor-item .qti-matchInteraction table.matrix .score{left:30px;min-width:0;width:35px !important;height:20px;position:relative;top:0}.item-editor-item [dir=rtl] .qti-matchInteraction .rgt{float:left}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .widget-box.widget-inlineChoiceInteraction{display:none;background:rgba(243,241,239,0.9)}.item-editor-item .widget-box.widget-inlineChoiceInteraction .tlb-wrapper{top:-26px}.item-editor-item .widget-box.widget-inlineChoiceInteraction.edit-norp .qti-inlineChoiceInteraction{padding:20px 30px 10px 30px}.item-editor-item .inlineChoiceInteraction-placeholder{border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;display:inline-block;width:150px;line-height:24px;position:relative;padding:0;margin-right:1px;cursor:pointer}.item-editor-item .inlineChoiceInteraction-placeholder label{padding:0 10px;margin:0}.item-editor-item .inlineChoiceInteraction-placeholder .icon-down{position:absolute;font-size:11px;font-size:1.1rem;right:6px;top:6px}.item-editor-item .qti-inlineChoiceInteraction{padding:20px 10px 5px 30px}.item-editor-item .qti-inlineChoiceInteraction [data-edit]{display:none}.item-editor-item .qti-inlineChoiceInteraction table{border-collapse:separate}.item-editor-item .qti-inlineChoiceInteraction tr{height:27px;white-space:nowrap}.item-editor-item .qti-inlineChoiceInteraction .icon-bin,.item-editor-item .qti-inlineChoiceInteraction .icon-pin,.item-editor-item .qti-inlineChoiceInteraction .icon-shuffle{color:#0e5d91;text-align:center;padding:0 5px;cursor:pointer;vertical-align:middle}.item-editor-item .qti-inlineChoiceInteraction .icon-bin:hover,.item-editor-item .qti-inlineChoiceInteraction .icon-pin:hover,.item-editor-item .qti-inlineChoiceInteraction .icon-shuffle:hover{color:#87aec8}.item-editor-item .qti-inlineChoiceInteraction .icon-down{text-align:center;position:absolute;right:-18px;font-size:11px;width:20px;height:20px;padding-top:3px;cursor:default}.item-editor-item .qti-inlineChoiceInteraction td.option,.item-editor-item .qti-inlineChoiceInteraction .main-option{padding:0 18px 0 10px;border-left:1px #ddd solid;border-right:1px #ddd solid;background:white}.item-editor-item .qti-inlineChoiceInteraction td.option:last,.item-editor-item .qti-inlineChoiceInteraction .main-option:last{border-bottom:1px #ddd solid}.item-editor-item .qti-inlineChoiceInteraction .main-option{border-top:1px #ddd solid;border-bottom:1px #ddd solid;min-width:150px}.item-editor-item .qti-inlineChoiceInteraction .main-option>div{padding:0;position:relative}.item-editor-item .qti-inlineChoiceInteraction td.icon-title{font-size:12px;color:#0e5d91;padding:0 5px}.item-editor-item .qti-inlineChoiceInteraction td[contenteditable]{cursor:text !important}.item-editor-item .qti-inlineChoiceInteraction .widget-inlineChoice .mini-tlb{text-align:center}.item-editor-item .qti-inlineChoiceInteraction .widget-inlineChoice .mini-tlb input{width:30px}.item-editor-item .qti-inlineChoiceInteraction .widget-inlineChoice .mini-tlb .icon-radio{left:10px;top:8px}.item-editor-item .qti-inlineChoiceInteraction .add-option{width:100%;padding:0;margin:4px 0 0 0}.item-editor-item .widget-response .qti-inlineChoiceInteraction{padding:0;margin-bottom:10px}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .widget-box.widget-textEntryInteraction{display:none;background:rgba(243,241,239,0.9)}.item-editor-item .widget-box.widget-textEntryInteraction .tlb-wrapper{top:-26px}.item-editor-item .widget-box.widget-textEntryInteraction .overlay .message{top:0}.item-editor-item .widget-box.widget-textEntryInteraction.edit-norp .qti-textEntryInteraction,.item-editor-item .widget-box.widget-textEntryInteraction.edit-question .qti-textEntryInteraction{padding:20px 30px 10px 30px}.item-editor-item .textEntryInteraction-placeholder{border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;display:inline-block;width:150px;line-height:24px;position:relative;padding:0;margin-right:1px;cursor:pointer}.item-editor-item .textEntryInteraction-placeholder label{padding:0 10px;margin:0}.item-editor-item .textEntryInteraction-placeholder .icon-down{position:absolute;font-size:11px;font-size:1.1rem;right:6px;top:6px}.item-editor-item .qti-textEntryInteraction{padding:20px 10px 5px 30px}.item-editor-item .qti-textEntryInteraction [data-edit]{display:none}.item-editor-item .qti-textEntryInteraction table{border-collapse:separate}.item-editor-item .qti-textEntryInteraction tr{height:27px;white-space:nowrap}.item-editor-item .qti-textEntryInteraction .icon-radio{top:3px;left:8px}.item-editor-item .qti-textEntryInteraction .icon-bin{text-align:center;width:auto;top:0;padding:0 5px;cursor:pointer;vertical-align:middle}.item-editor-item .qti-textEntryInteraction .icon-bin:hover{color:#3e7da7}.item-editor-item .qti-textEntryInteraction td.option,.item-editor-item .qti-textEntryInteraction .main-option{padding:0 18px 0 10px;border-left:1px #ddd solid;border-right:1px #ddd solid;background:white}.item-editor-item .qti-textEntryInteraction td.option:last,.item-editor-item .qti-textEntryInteraction .main-option:last{border-bottom:1px #ddd solid}.item-editor-item .qti-textEntryInteraction .main-option{border-top:1px #ddd solid;border-bottom:1px #ddd solid;min-width:150px}.item-editor-item .qti-textEntryInteraction .main-option>div{padding:0;position:relative}.item-editor-item .qti-textEntryInteraction td.icon-title{font-size:12px;color:#0e5d91;padding:0 5px}.item-editor-item .qti-textEntryInteraction td input{width:122px;height:28px}.item-editor-item .qti-textEntryInteraction td[contenteditable]{cursor:text !important}.item-editor-item .qti-textEntryInteraction input.score{width:30px}.item-editor-item .qti-textEntryInteraction .add-option .icon-add{width:auto;left:3px;top:1px}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .widget-box.widget-endAttemptInteraction{display:none;background:rgba(243,241,239,0.9);padding:20px 30px 60px}.item-editor-item .widget-box.widget-endAttemptInteraction .widget-ok{position:absolute;bottom:10px;right:10px}.item-editor-item .widget-box.widget-endAttemptInteraction .tlb-wrapper{top:-26px}.item-editor-item .endAttemptInteraction-placeholder{padding:0 15px;min-width:80px;border:none}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .edit-sleep textarea{cursor:pointer}.item-editor-item .qti-extendedTextInteraction .cke .cke_toolbar .cke_button_icon{line-height:1.5rem !important}.item-editor-item .qti-extendedTextInteraction .cke .cke_toolbar .cke_combo_disabled .cke_combo_button:hover,.item-editor-item .qti-extendedTextInteraction .cke .cke_toolbar .cke_combo_disabled .cke_combo_button:hover .cke_combo_text,.item-editor-item .qti-extendedTextInteraction .cke .cke_toolbar .cke_combo_disabled .cke_combo_button:hover .cke_combo_open,.item-editor-item .qti-extendedTextInteraction .cke .cke_toolbar .cke_combo_disabled .cke_combo_button:hover .cke_combo_arrow,.item-editor-item .qti-extendedTextInteraction .cke .cke_toolbar .cke_combo_disabled .cke_combo_open:hover,.item-editor-item .qti-extendedTextInteraction .cke .cke_toolbar .cke_button_disabled:hover{background:transparent !important;color:#222 !important;cursor:default}.item-editor-item .qti-extendedTextInteraction .cke .cke_toolbar .cke_button_on{background:#3e7da7 !important}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .response-pair-editor{min-width:350px;background:rgba(243,241,239,0.85);padding:20px 30px 20px 30px}.item-editor-item .response-pair-editor .title{position:relative;top:-5px;left:-10px}.item-editor-item .response-pair-editor .indicator{color:#3e7da7;position:relative;top:10px;font-size:13px;font-size:1.3rem}.item-editor-item .response-pair-editor .col-2{text-align:center}.item-editor-item .response-pair-editor .icon-bin{position:relative;top:7px;cursor:pointer}.item-editor-item .response-pair-editor .cb{top:5px}.item-editor-item .qti-gapMatchInteraction .qti-flow-container{position:relative}.item-editor-item .qti-gapMatchInteraction .qti-flow-container [data-html-editable]{min-height:3rem}.item-editor-item .qti-gapMatchInteraction .qti-flow-container .mini-tlb[data-role=create-gap-tlb]{postion:absolute;right:-30px}.item-editor-item .qti-gapMatchInteraction .qti-flow-container #selection-wrapper{z-index:1000;position:relative}.item-editor-item .qti-gapMatchInteraction .choice-area .qti-choice{border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;border-color:#ddd !important;min-width:80px}.item-editor-item .qti-gapMatchInteraction .gap-info{color:#0e5d91;font-style:italic}.item-editor-item .qti-gapMatchInteraction .qti-gap span.mini-tlb[data-edit]{position:absolute !important;top:-4px !important;right:-30px !important}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .qti-hottextInteraction .qti-hottext input[disabled] ~ [class^=\"icon-\"]{cursor:pointer !important}.item-editor-item .qti-hottextInteraction .qti-hottext .mini-tlb{display:inline-block;postion:absolute;right:-30px;z-index:1000}.item-editor-item .qti-hottextInteraction .qti-hottext .mini-tlb[data-edit]{top:-2px}.item-editor-item .qti-hottextInteraction .qti-hottext .mini-tlb[data-edit].icon-undo{padding-right:8px}.item-editor-item .qti-hottextInteraction .qti-hottext .mini-tlb[data-edit] label{padding:0 3px}.item-editor-item .qti-hottextInteraction .qti-hottext .mini-tlb[data-edit] [data-role=\"score\"]{width:30px}.item-editor-item .qti-hottextInteraction .qti-flow-container{position:relative}.item-editor-item .qti-hottextInteraction .qti-flow-container [data-html-editable]{min-height:3rem}.item-editor-item .qti-hottextInteraction .qti-flow-container .mini-tlb[data-role=create-hottext-tlb]{position:absolute;right:-30px}.item-editor-item .qti-hottextInteraction .qti-flow-container #selection-wrapper{z-index:1000;position:relative}.item-editor-item .qti-hottextInteraction input.score{width:30px;min-width:30px;padding:0 2px}.item-editor-item .qti-hottextInteraction .hottext-content{padding-right:5px}.item-editor-item .qti-hottextInteraction .hottext-checkmark{margin-bottom:0;width:20px}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .qti-rubricBlock .mini-tlb{top:7px;right:7px}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .widget-math .mini-tlb{top:-1px;right:-29px;padding:0;margin:0}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .mapping-editor{position:absolute;left:15px;top:15px;color:#222;background:#f3f1ef;padding:15px 15px 0 15px;-webkit-box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75);-moz-box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75);box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75);z-index:300;min-width:150px}.item-editor-item .mapping-editor .closer{position:absolute;top:10px;right:8px}.item-editor-item .mapping-editor h2{font-size:15px;font-size:1.5rem;margin-bottom:0}.item-editor-item .mapping-editor hr{margin:0}.item-editor-item .mapping-editor .heading{font-weight:bold}.item-editor-item .mapping-editor .arrow{position:absolute;z-index:301;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);border:1px #f3f1ef solid;border-left:none;border-top:none;width:12px;height:12px;background:#f3f1ef;-webkit-box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75);-moz-box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75);box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75)}.item-editor-item .mapping-editor .arrow-cover{background:#f3f1ef;position:absolute;z-index:302}.item-editor-item .mapping-editor.arrow-left-top .arrow{left:-6px;top:10px}.item-editor-item .mapping-editor.arrow-left-top .arrow-cover{left:0;top:2px;width:15px;height:30px}.item-editor-item .mapping-editor.arrow-top-left .arrow{top:-6px}.item-editor-item .mapping-editor.arrow-top-left .arrow-cover{left:6px;top:0;width:30px;height:15px}.item-editor-item .mapping-editor .score{border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;text-align:right;min-width:40px;max-width:40px;position:relative;top:-5px}.item-editor-item .mapping-editor .grid-row{line-height:1.6;padding-top:8px}.item-editor-item .mapping-editor .tooltipstered{text-align:right}.item-editor-item .mapping-editor .icon-checkbox{margin-left:20px}.item-editor-item .mapping-editor .pairs img{max-width:100%}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .qti-graphicInteraction .add-option>div [class^=\"icon-\"]{line-height:.9}.item-editor-item .qti-graphicInteraction .dummy-element{cursor:pointer}.item-editor-item .qti-graphicInteraction .image-sidebar{position:absolute;left:-45px;top:2px;z-index:1000;background:#f9f8f7;border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;padding:5px}.item-editor-item .qti-graphicInteraction .image-sidebar .forms{overflow:hidden;background:white}.item-editor-item .qti-graphicInteraction .image-sidebar .forms [class^=\"icon-\"],.item-editor-item .qti-graphicInteraction .image-sidebar .forms [class*=\" icon-\"]{font-size:26px !important;font-size:2.6rem !important;line-height:1.2;padding:0 5px}.item-editor-item .qti-graphicInteraction .image-sidebar .forms li{border:1px solid transparent;cursor:pointer;text-align:center}.item-editor-item .qti-graphicInteraction .image-sidebar .forms li.active{color:#3e7da7}.item-editor-item .qti-graphicInteraction .image-sidebar .forms li:hover{background:#3e7da7;color:#fff}.item-editor-item .qti-graphicInteraction .image-sidebar .forms li.separator{height:1px;background-color:#ccc;padding:0;margin:10px 3px}.item-editor-item .qti-graphicInteraction .image-sidebar .forms li.disabled{background:white !important;color:#ccc !important}.item-editor-item .qti-graphicInteraction .image-sidebar .forms li.bin{color:#c84155}.item-editor-item .qti-graphicInteraction .image-sidebar .forms li.bin:hover{background:#ba122b;color:#fff}.item-editor-item .qti-graphicInteraction .image-sidebar ~ .image-editor{min-height:292px}.item-editor-item .qti-graphicInteraction .image-sidebar.tall{min-height:320px}.item-editor-item .qti-graphicInteraction .image-sidebar.tall .forms{min-height:320px}.item-editor-item .qti-graphicInteraction .image-sidebar.tall ~ .image-editor{min-height:332px}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .qti-graphicGapMatchInteraction ul.source>li img{height:auto}.item-editor-item .qti-graphicGapMatchInteraction ul.source>li.empty,.item-editor-item .qti-graphicGapMatchInteraction ul.source>li.placeholder{margin:0 3px 3px 0 !important;width:60px;height:60px;max-height:60px}.item-editor-item .qti-graphicGapMatchInteraction ul.source>li .dummy-element{cursor:pointer}.item-editor-item .qti-graphicGapMatchInteraction ul.source>li .dummy-element ~ span.mini-tlb[data-edit]{right:0 !important;top:0 !important}.item-editor-item .qti-graphicGapMatchInteraction ul.source>li .dummy-element ~ span.mini-tlb[data-edit] .tlb-button{line-height:18px}.item-editor-item .qti-graphicGapMatchInteraction ul.source>li img ~ span.mini-tlb[data-edit]{top:0;right:0}.item-editor-item .qti-graphicGapMatchInteraction ul.source>li img ~ span.mini-tlb[data-edit] .tlb-button{line-height:18px}.item-editor-item .qti-graphicGapMatchInteraction ul.source>li.add-option.empty>div>span[class^=\"icon-\"]{font-size:50px;font-size:5rem}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .qti-droppable-block-hover{min-height:30px;width:100%;border:2px dashed #3e7da7;background-color:#e6eef4;margin:0;opacity:0.5}.item-editor-item .grid-edit-resizable-zone{position:absolute;cursor:col-resize;text-align:center;outline:0 dotted blue}.item-editor-item .grid-edit-resizable-handle{position:relative;display:inline-block;width:1px;height:100%}.item-editor-item .grid-edit-resizable-zone-active:hover .grid-edit-resizable-handle{border-width:0 1px;border-color:#ccc;border-style:solid}.item-editor-item .grid-edit-resizable-active{width:0;border:0 dashed #3e7da7;border-left-width:1px}.item-editor-item .grid-edit-resizable-outline{position:absolute;top:0;left:0;height:100%;border:1px solid #3e7da7;background-color:#e4ecef;opacity:0.5;z-index:9}.item-editor-item .grid-edit-insert-box{position:absolute;height:100%;text-align:center;opacity:0.5;z-index:9}.item-editor-item .grid-edit-insert-box:hover{opacity:0.3}.item-editor-item .grid-edit-insert-square{position:relative;width:20px;height:20px;background-color:#3e7da7;border-top-left-radius:3px;border-top-right-radius:3px}.item-editor-item .grid-edit-insert-triangle{position:relative;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:12px solid #3e7da7}.item-editor-item .grid-edit-insert-line{position:absolute;top:0;left:10px;height:100%;border-left:1px dashed #3e7da7}.item-editor-item .grid-draggable-helper{z-index:99;max-height:200px;max-width:50%;overflow:hidden;border:1px solid #ddd;padding:6px}.item-editor-item .grid-draggable-helper:after{content:'...';position:absolute;bottom:0;right:6px}.item-editor-item .grid-draggable{cursor:pointer}.item-editor-item .grid-draggable:hover{opacity:0.8}.item-editor-item .grid-draggable:active,.item-editor-item .grid-draggable-active{cursor:all-scroll}.item-editor-item .dropping{margin-left:-1.42857%;margin-right:1.42857%}.item-editor-item .new-col:first-child{margin-left:1.42857%}.item-editor-item .drop-target[data-html-editable]{border:2px dashed #87c8a5 !important}.item-editor-item .drop-target[data-html-editable]:hover{background:rgba(14,145,75,0.1) !important}.item-editor-item .drop-target #qti-inline-element-placeholder{position:relative;display:inline-block;width:8px;height:14px;margin:0px 2px;background-color:transparent}.item-editor-item .drop-target #qti-inline-element-placeholder .cursor-h{width:100%;height:100%;display:inline-block;position:absolute;top:2px;left:0;border-top:2px solid #0e5d91;border-bottom:2px solid #0e5d91}.item-editor-item .drop-target #qti-inline-element-placeholder .cursor-v{width:0px;height:100%;display:inline-block;position:absolute;top:2px;left:3px;border-left:2px solid #0e5d91}.item-editor-item .widget-box .html-editable-shield{background:rgba(243,241,239,0.5);position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;padding:0}.item-editor-item .add-block-element{position:absolute;bottom:-4px;width:100%}.item-editor-item .add-block-element .line{position:absolute;border-top:1px dashed #5c91b4;top:8px;width:100%}.item-editor-item .add-block-element .circle{display:block;width:16px;height:16px;background:white;-moz-border-radius:30px;-webkit-border-radius:30px;border-radius:30px;position:absolute;margin-left:50%;margin-right:50%;cursor:pointer;border:1px solid #5c91b4}.item-editor-item .add-block-element .circle:hover{border-color:#266d9c}.item-editor-item .add-block-element .circle span{font-weight:bold;font-size:14px;color:#5c91b4;line-height:14px;display:table-cell;vertical-align:middle;text-align:center;width:14px;height:14px}.item-editor-item .add-block-element .circle span:hover{color:#266d9c}.item-editor-item .edit-inserting .add-block-element{display:none}.item-editor-item .colrow{position:relative;margin-top:18px;padding:3px}.item-editor-item .colrow:first-child{margin-top:0}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .qti-customInteraction ~ .overlay{background:transparent}.item-editor-item .qti-customInteraction .simple-editable{border:solid 1px transparent;min-height:1.8rem;min-width:3rem}.item-editor-item .qti-customInteraction .simple-editable:hover{border-color:#87aec8}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .contextual-popup{position:absolute;left:15px;top:0px;width:500px;color:#222;background:#f3f1ef;padding:15px 15px 0;-webkit-box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75);-moz-box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75);box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75);z-index:300}.item-editor-item .contextual-popup h2{font-size:15px;font-size:1.5rem;margin-bottom:0}.item-editor-item .contextual-popup .heading{font-weight:bold}.item-editor-item .contextual-popup .arrow{position:absolute;top:-6px;z-index:301;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);border:1px #f3f1ef solid;border-left:none;border-top:none;width:12px;height:12px;background:#f3f1ef;-webkit-box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75);-moz-box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75);box-shadow:0px 0px 10px 0px rgba(50,50,50,0.75)}.item-editor-item .contextual-popup .arrow-cover{background:#f3f1ef;position:absolute;z-index:302;left:6px;top:0;width:30px;height:15px}.item-editor-item .contextual-popup .tooltipstered{text-align:right}.item-editor-item .contextual-popup .footer{margin-top:10px}.item-editor-item .contextual-popup .footer .btn{float:right;margin-left:20px;margin-bottom:7px}.item-editor-item .contextual-popup .footer .btn.cancel{position:relative;top:3px}.item-editor-item .contextual-popup .elementSelector ul.group-list{box-sizing:border-box;width:100%;line-height:20px;padding:0;margin:0;list-style:none;border-bottom:1px solid #DDD}.item-editor-item .contextual-popup .elementSelector ul.group-list:after{clear:both}.item-editor-item .contextual-popup .elementSelector ul.group-list:after,.item-editor-item .contextual-popup .elementSelector ul.group-list:before{content:\"\";display:table}.item-editor-item .contextual-popup .elementSelector ul.group-list li{padding:0;margin-bottom:-1px;float:left;position:relative}.item-editor-item .contextual-popup .elementSelector ul.group-list li a{display:block;padding:8px 12px;border-width:1px 1px 0px;border-style:solid;border-color:transparent;-moz-border-top-colors:none;-moz-border-right-colors:none;-moz-border-bottom-colors:none;-moz-border-left-colors:none;border-image:none;color:#1D8ACB;text-decoration:none;border-radius:4px 4px 0px 0px;text-shadow:0px 1px 0px white;cursor:pointer;outline:0px none}.item-editor-item .contextual-popup .elementSelector ul.group-list li.active a{border-color:#DDD #DDD transparent;color:#222;background:#f8f7f5;cursor:default}.item-editor-item .contextual-popup .elementSelector ul.group-list li:not(.active) a:hover{border-color:#DDD;background:#F1F1F1;color:#0B5F90;outline:0px none;margin-bottom:1px;padding-bottom:7px}.item-editor-item .contextual-popup .elementSelector ul.group-list li:nth-child(n+2)>a{margin-left:3px}.item-editor-item .contextual-popup .elementSelector ul.group-list li:hover{background:transparent}.item-editor-item .contextual-popup .elementSelector ul.element-list:after{clear:both}.item-editor-item .contextual-popup .elementSelector ul.element-list:after,.item-editor-item .contextual-popup .elementSelector ul.element-list:before{content:\"\";display:table}.item-editor-item .contextual-popup .elementSelector ul.element-list li{width:50%;margin:0px;float:left;padding:10px 18px;font-size:1.2rem;cursor:pointer;position:relative;border:1px solid transparent}.item-editor-item .contextual-popup .elementSelector ul.element-list li .icon{font-size:2rem;display:inline-block;width:24px;height:24px;text-align:center;position:relative;top:2px}.item-editor-item .contextual-popup .elementSelector ul.element-list li .label{position:relative;left:6px;display:inline-block;max-width:160px}.item-editor-item .contextual-popup .elementSelector ul.element-list li:hover{border-color:#87aec8}.item-editor-item .contextual-popup .elementSelector ul.element-list li.active{border-color:#3e7da7;background:white;cursor:default}.item-editor-item .contextual-popup .elementSelector .element-group{display:none;background:#f8f7f5;min-height:200px;padding-top:5px}.item-editor-item .colrow.tmp{border:3px dashed #87aec8}.item-editor-item .colrow.tmp .placeholder{min-height:160px;background:#f3f7fa}.item-editor-item #item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .item-editor-item .tool-list:before,.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{content:\" \";display:table}.item-editor-item #item-editor-interaction-bar .tool-list:after,#item-editor-interaction-bar .item-editor-item .tool-list:after{clear:both}.item-editor-item .widget-include{min-height:2rem}.item-editor-item .add-options{margin:15px 5px 8px 0}.item-editor-item .add-option{display:inline-block;vertical-align:top;position:relative;margin-left:2px;padding:5px 16px 5px 6px;overflow:hidden}.item-editor-item [dir=rtl] .add-option{padding-right:6px;padding-left:16px}.item-editor-item .add-option .icon-add{font-size:1.8rem;left:6px;position:absolute;top:5px}.item-editor-item [dir=rtl] .add-option .icon-add{margin-right:0;margin-left:8px;float:right}.item-editor-item .horizontal .add-option .add-option{margin-top:25px}.item-editor-item .qti-hottextInteraction .mini-tlb{right:-31px !important}.item-editor-item .qti-interaction .qti-prompt ~ .mini-tlb{right:-31px !important;top:1px}.item-editor-item .widget-textBlock .mini-tlb{right:-36px;top:-2px}.item-editor-item .qti-flow-container .mini-tlb{right:-31px !important}#item-editor-interaction-bar .tool-list:before,#item-editor-interaction-bar .tool-list:after{content:\" \";display:table}#item-editor-interaction-bar .tool-list:after{clear:both}#modalFeedbacks{color:#222 !important;background:white !important}#modalFeedbacks .mini-tlb{top:-2px;right:-2px;z-index:5000}#modalFeedbacks .modal-body{position:relative}#modalFeedbacks .widget-ok{margin:30px 0px 0px;display:none}#modalFeedbacks .widget-inline{display:inline-block}#modalFeedbacks .qti-modalFeedback .modal-title{border:solid 1px transparent}#modalFeedbacks .qti-modalFeedback .modal-title.inplace:hover,#modalFeedbacks .qti-modalFeedback .modal-title.inplace:focus{border:dotted 1px #3e7da7}#modalFeedbacks .qti-modalFeedback .modal-title.inplace input{font-size:2rem;width:100% !important;max-width:100%;border:none;padding:0}.feedbackRules .feedbackRule-container{position:relative;margin:5px 0;padding:8px;border:1px solid #ddd;border-radius:2px;-webkit-border-radius:2px;background-color:rgba(255,255,255,0.8);max-width:500px}.feedbackRules .feedbackRule-container select{width:190px}.feedbackRules .feedbackRule-container .feedbackRule-condition{width:86px !important;min-width:86px !important}.feedbackRules .feedbackRule-container .feedbackRule-desc{margin-bottom:5px;width:35px;display:inline-block}.feedbackRules .feedbackRule-container .feedbackRule-then-else{position:relative;margin-top:5px}.feedbackRules .feedbackRule-container .feedbackRule-then-else .feedbackRule-button-delete{top:5px;right:2px}.feedbackRules .feedbackRule-container .feedbackRule-button-delete{color:#0e5d91;position:absolute;top:12px;right:10px;cursor:pointer;font-size:13px;font-size:1.3rem}.feedbackRules .feedbackRule-container .feedbackRule-button-delete:hover{color:#87aec8}.feedbackRules .feedbackRule-container .feedbackRule-compared-value{min-width:35px;width:35px}.feedbackRules .feedbackRule-add,.feedbackRules .feedbackRule-add-else{display:block;margin-top:5px}.feedbackRules .choices-selector{margin:4px 0;font-size:13px;font-size:1.3rem}.feedbackRules .choices-selector input{font-size:inherit;width:100% !important;max-width:unset}.edit-question [data-html-editable]{min-height:20px}[data-html-editable]{border:1px solid transparent;outline:1px solid transparent !important}[data-html-editable] [html-editable-shield]{padding:0;min-width:0;margin:0}.edit-question .qti-interaction [data-html-editable-container]:hover [data-html-editable][contenteditable=true],.qti-modalFeedback.edit-active [data-html-editable-container]:hover [data-html-editable][contenteditable=true]{border:1px dotted #0e5d91}.edit-question .qti-interaction [data-html-editable],.qti-modalFeedback.edit-active [data-html-editable]{margin-right:0px}.edit-question .qti-interaction [data-html-editable][contenteditable=true]:focus,.qti-modalFeedback.edit-active [data-html-editable][contenteditable=true]:focus{border:1px dotted #0e5d91}.edit-question .qti-blockInteraction .horizontal{margin-top:28px}.edit-question .qti-blockInteraction .horizontal .qti-choice{margin-top:25px}.edit-question .qti-blockInteraction .horizontal .qti-choice .mini-tlb{white-space:nowrap}.edit-question .qti-blockInteraction .horizontal .qti-choice .mini-tlb .tlb-button{display:block;margin:0}.edit-question .qti-blockInteraction .horizontal .qti-choice .widget-box .mini-tlb{top:0 !important;right:-30px !important}.widget-rubricBlock [data-html-editable],.widget-textBlock [data-html-editable]{min-height:3rem}.cke-cover-up{padding:0 !important;margin:0 !important;position:absolute !important;cursor:pointer !important;border:none !important;background:black !important;opacity:.05 !important;display:inline-block !important}.cke-qti-wrapper{position:relative !important;display:inline-block !important;padding:0 !important;margin:0 !important}.cke-placeholder:not(:focus)::before{content:attr(data-placeholder);color:#999}.extendedText .incrementer-ctrl-wrapper{right:10px}.extendedText .incrementer-ctrl-wrapper .incrementer{width:50px !important}.select2-result.rtl-lang{position:relative}.select2-chosen .rtl-lang:after,.select2-result.rtl-lang span.select2-match:after{content:'RTL';display:block;color:#ada194;border:#ada194 1px solid;border-radius:2px;position:absolute;right:20px;font-size:10px;top:6px;line-height:12px;padding:0 4px}.select2-result.rtl-lang.select2-highlighted span.select2-match:after{color:#fff;border-color:#fff}@media print{html body #tabs{margin:0 !important;min-height:0 !important;width:auto !important;padding:0 !important;border:none !important}html body .item-editor-sidebar-wrapper{display:none !important}html body .item-no-print{display:none !important}html body #item-editor-scroll-inner{padding:0 !important}html body .action-bar{display:none !important}html body #item-editor-panel{margin:0 !important;padding:0 !important}html body .item-editor-row{border:none !important;background:none !important}html body .qti-item{border-radius:0;box-shadow:none;margin:0 !important;border:none !important;width:100% !important}html body .qti-item [class*=\"col-\"]{border-color:transparent !important}html body [data-edit],html body .mini-tlb{display:none !important}html body [class^=\"btn-\"],html body [class*=\" btn-\"],html body button,html body input[type=\"submit\"],html body input[type=\"reset\"]{color:#222 !important;border:1px solid #dddddd !important;border-radius:2px !important;-webkit-border-radius:2px !important}}@media screen and (min-width: 1366px){.item-editor-sidebar-wrapper.left-bar{-ms-order:0;-webkit-order:0;order:0;flex-item-align:stretch;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch;-ms-flex:0 0 262px;-webkit-flex:0 0 262px;flex:0 0 262px}.item-editor-sidebar-wrapper.left-bar #item-editor-interaction-bar .tool-list li{width:33.3333333333%}.item-editor-sidebar-wrapper.left-bar #item-editor-interaction-bar .sub-group-cover:after,.item-editor-sidebar-wrapper.left-bar #item-editor-interaction-bar .sub-group-cover:before{left:17% !important}#item-editor-scope>nav.action-bar .menu-left{-ms-order:0;-webkit-order:0;order:0;flex-item-align:stretch;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch;-ms-flex:0 0 262px;-webkit-flex:0 0 262px;flex:0 0 262px}}@media screen and (min-width: 1920px){.item-editor-sidebar-wrapper.left-bar{-ms-order:0;-webkit-order:0;order:0;flex-item-align:stretch;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch;-ms-flex:0 0 344px;-webkit-flex:0 0 344px;flex:0 0 344px}.item-editor-sidebar-wrapper.left-bar #item-editor-interaction-bar .tool-list li{width:25%}.item-editor-sidebar-wrapper.left-bar #item-editor-interaction-bar .sub-group-cover:after,.item-editor-sidebar-wrapper.left-bar #item-editor-interaction-bar .sub-group-cover:before{left:12% !important}#item-editor-scope>nav.action-bar .menu-left{-ms-order:0;-webkit-order:0;order:0;flex-item-align:stretch;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch;-ms-flex:0 0 344px;-webkit-flex:0 0 344px;flex:0 0 344px}}\n\n/*# sourceMappingURL=../../../taoQtiItem/views/css/item-creator.css.map *//*\n * MathQuill v0.10.1 http://mathquill.com\n * by Han, Jeanine, and Mary maintainers@mathquill.com\n *\n * This Source Code Form is subject to the terms of the\n * Mozilla Public License, v. 2.0. If a copy of the MPL\n * was not distributed with this file, You can obtain\n * one at http://mozilla.org/MPL/2.0/.\n */\n@font-face {\n font-family: Symbola;\n src: url(font/Symbola.eot);\n src: local(\"Symbola Regular\"), local(\"Symbola\"), url(font/Symbola.woff2) format(\"woff2\"), url(font/Symbola.woff) format(\"woff\"), url(font/Symbola.ttf) format(\"truetype\"), url(font/Symbola.otf) format(\"opentype\"), url(font/Symbola.svg#Symbola) format(\"svg\");\n}\n.mq-editable-field {\n display: -moz-inline-box;\n display: inline-block;\n}\n.mq-editable-field .mq-cursor {\n border-left: 1px solid black;\n margin-left: -1px;\n position: relative;\n z-index: 1;\n padding: 0;\n display: -moz-inline-box;\n display: inline-block;\n}\n.mq-editable-field .mq-cursor.mq-blink {\n visibility: hidden;\n}\n.mq-editable-field,\n.mq-math-mode .mq-editable-field {\n border: 1px solid gray;\n}\n.mq-editable-field.mq-focused,\n.mq-math-mode .mq-editable-field.mq-focused {\n -webkit-box-shadow: #8bd 0 0 1px 2px, inset #6ae 0 0 2px 0;\n -moz-box-shadow: #8bd 0 0 1px 2px, inset #6ae 0 0 2px 0;\n box-shadow: #8bd 0 0 1px 2px, inset #6ae 0 0 2px 0;\n border-color: #709AC0;\n border-radius: 1px;\n}\n.mq-math-mode .mq-editable-field {\n margin: 1px;\n}\n.mq-editable-field .mq-latex-command-input {\n color: inherit;\n font-family: \"Courier New\", monospace;\n border: 1px solid gray;\n padding-right: 1px;\n margin-right: 1px;\n margin-left: 2px;\n}\n.mq-editable-field .mq-latex-command-input.mq-empty {\n background: transparent;\n}\n.mq-editable-field .mq-latex-command-input.mq-hasCursor {\n border-color: ActiveBorder;\n}\n.mq-editable-field.mq-empty:after,\n.mq-editable-field.mq-text-mode:after,\n.mq-math-mode .mq-empty:after {\n visibility: hidden;\n content: 'c';\n}\n.mq-editable-field .mq-cursor:only-child:after,\n.mq-editable-field .mq-textarea + .mq-cursor:last-child:after {\n visibility: hidden;\n content: 'c';\n}\n.mq-editable-field .mq-text-mode .mq-cursor:only-child:after {\n content: '';\n}\n.mq-editable-field.mq-text-mode {\n overflow-x: auto;\n overflow-y: hidden;\n}\n.mq-root-block,\n.mq-math-mode .mq-root-block {\n display: -moz-inline-box;\n display: inline-block;\n width: 100%;\n padding: 2px;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n vertical-align: middle;\n}\n.mq-math-mode {\n font-variant: normal;\n font-weight: normal;\n font-style: normal;\n font-size: 115%;\n line-height: 1;\n display: -moz-inline-box;\n display: inline-block;\n}\n.mq-math-mode .mq-non-leaf,\n.mq-math-mode .mq-scaled {\n display: -moz-inline-box;\n display: inline-block;\n}\n.mq-math-mode var,\n.mq-math-mode .mq-text-mode,\n.mq-math-mode .mq-nonSymbola {\n font-family: \"Times New Roman\", Symbola, serif;\n line-height: .9;\n}\n.mq-math-mode * {\n font-size: inherit;\n line-height: inherit;\n margin: 0;\n padding: 0;\n border-color: black;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n box-sizing: border-box;\n}\n.mq-math-mode .mq-empty {\n background: #ccc;\n}\n.mq-math-mode .mq-empty.mq-root-block {\n background: transparent;\n}\n.mq-math-mode.mq-empty {\n background: transparent;\n}\n.mq-math-mode .mq-text-mode {\n font-size: 87%;\n}\n.mq-math-mode .mq-font {\n font: 1em \"Times New Roman\", Symbola, serif;\n}\n.mq-math-mode .mq-font * {\n font-family: inherit;\n font-style: inherit;\n}\n.mq-math-mode b,\n.mq-math-mode b.mq-font {\n font-weight: bolder;\n}\n.mq-math-mode var,\n.mq-math-mode i,\n.mq-math-mode i.mq-font {\n font-style: italic;\n}\n.mq-math-mode var.mq-f {\n margin-right: 0.2em;\n margin-left: 0.1em;\n}\n.mq-math-mode .mq-roman var.mq-f {\n margin: 0;\n}\n.mq-math-mode big {\n font-size: 125%;\n}\n.mq-math-mode .mq-roman {\n font-style: normal;\n}\n.mq-math-mode .mq-sans-serif {\n font-family: sans-serif, Symbola, serif;\n}\n.mq-math-mode .mq-monospace {\n font-family: monospace, Symbola, serif;\n}\n.mq-math-mode .mq-overline {\n border-top: 1px solid black;\n margin-top: 1px;\n}\n.mq-math-mode .mq-underline {\n border-bottom: 1px solid black;\n margin-bottom: 1px;\n}\n.mq-math-mode .mq-binary-operator {\n padding: 0 0.2em;\n display: -moz-inline-box;\n display: inline-block;\n}\n.mq-math-mode .mq-supsub {\n font-size: 90%;\n vertical-align: -0.5em;\n}\n.mq-math-mode .mq-supsub.mq-limit {\n font-size: 80%;\n vertical-align: -0.4em;\n}\n.mq-math-mode .mq-supsub.mq-sup-only {\n vertical-align: .5em;\n}\n.mq-math-mode .mq-supsub.mq-sup-only .mq-sup {\n display: inline-block;\n vertical-align: text-bottom;\n}\n.mq-math-mode .mq-supsub .mq-sup {\n display: block;\n}\n.mq-math-mode .mq-supsub .mq-sub {\n display: block;\n float: left;\n}\n.mq-math-mode .mq-supsub.mq-limit .mq-sub {\n margin-left: -0.25em;\n}\n.mq-math-mode .mq-supsub .mq-binary-operator {\n padding: 0 .1em;\n}\n.mq-math-mode .mq-supsub .mq-fraction {\n font-size: 70%;\n}\n.mq-math-mode sup.mq-nthroot {\n font-size: 80%;\n vertical-align: 0.8em;\n margin-right: -0.6em;\n margin-left: .2em;\n min-width: .5em;\n}\n.mq-math-mode .mq-paren {\n padding: 0 .1em;\n vertical-align: top;\n -webkit-transform-origin: center .06em;\n -moz-transform-origin: center .06em;\n -ms-transform-origin: center .06em;\n -o-transform-origin: center .06em;\n transform-origin: center .06em;\n}\n.mq-math-mode .mq-paren.mq-ghost {\n color: silver;\n}\n.mq-math-mode .mq-paren + span {\n margin-top: .1em;\n margin-bottom: .1em;\n}\n.mq-math-mode .mq-array {\n vertical-align: middle;\n text-align: center;\n}\n.mq-math-mode .mq-array > span {\n display: block;\n}\n.mq-math-mode .mq-operator-name {\n font-family: Symbola, \"Times New Roman\", serif;\n line-height: .9;\n font-style: normal;\n}\n.mq-math-mode var.mq-operator-name.mq-first {\n padding-left: .2em;\n}\n.mq-math-mode var.mq-operator-name.mq-last {\n padding-right: .2em;\n}\n.mq-math-mode .mq-fraction {\n font-size: 90%;\n text-align: center;\n vertical-align: -0.4em;\n padding: 0 .2em;\n}\n.mq-math-mode .mq-fraction,\n.mq-math-mode .mq-large-operator,\n.mq-math-mode x:-moz-any-link {\n display: -moz-groupbox;\n}\n.mq-math-mode .mq-fraction,\n.mq-math-mode .mq-large-operator,\n.mq-math-mode x:-moz-any-link,\n.mq-math-mode x:default {\n display: inline-block;\n}\n.mq-math-mode .mq-numerator,\n.mq-math-mode .mq-denominator {\n display: block;\n}\n.mq-math-mode .mq-numerator {\n padding: 0 0.1em;\n}\n.mq-math-mode .mq-denominator {\n border-top: 1px solid;\n float: right;\n width: 100%;\n padding: 0.1em;\n}\n.mq-math-mode .mq-sqrt-prefix {\n padding-top: 0;\n position: relative;\n top: 0.1em;\n vertical-align: top;\n -webkit-transform-origin: top;\n -moz-transform-origin: top;\n -ms-transform-origin: top;\n -o-transform-origin: top;\n transform-origin: top;\n}\n.mq-math-mode .mq-sqrt-stem {\n border-top: 1px solid;\n margin-top: 1px;\n padding-left: .15em;\n padding-right: .2em;\n margin-right: .1em;\n padding-top: 1px;\n}\n.mq-math-mode .mq-vector-prefix {\n display: block;\n text-align: center;\n line-height: .25em;\n margin-bottom: -0.1em;\n font-size: 0.75em;\n}\n.mq-math-mode .mq-vector-stem {\n display: block;\n}\n.mq-math-mode .mq-large-operator {\n text-align: center;\n}\n.mq-math-mode .mq-large-operator .mq-from,\n.mq-math-mode .mq-large-operator big,\n.mq-math-mode .mq-large-operator .mq-to {\n display: block;\n}\n.mq-math-mode .mq-large-operator .mq-from,\n.mq-math-mode .mq-large-operator .mq-to {\n font-size: 80%;\n}\n.mq-math-mode .mq-large-operator .mq-from {\n float: right;\n /* take out of normal flow to manipulate baseline */\n width: 100%;\n}\n.mq-math-mode,\n.mq-math-mode .mq-editable-field {\n cursor: text;\n font-family: Symbola, \"Times New Roman\", serif;\n}\n.mq-math-mode .mq-overarrow {\n border-top: 1px solid black;\n margin-top: 1px;\n padding-top: 0.2em;\n}\n.mq-math-mode .mq-overarrow:before {\n display: block;\n position: relative;\n top: -0.34em;\n font-size: 0.5em;\n line-height: 0em;\n content: '\\27A4';\n text-align: right;\n}\n.mq-math-mode .mq-overarrow.mq-arrow-left:before {\n -moz-transform: scaleX(-1);\n -o-transform: scaleX(-1);\n -webkit-transform: scaleX(-1);\n transform: scaleX(-1);\n filter: FlipH;\n -ms-filter: \"FlipH\";\n}\n.mq-math-mode .mq-selection,\n.mq-editable-field .mq-selection,\n.mq-math-mode .mq-selection .mq-non-leaf,\n.mq-editable-field .mq-selection .mq-non-leaf,\n.mq-math-mode .mq-selection .mq-scaled,\n.mq-editable-field .mq-selection .mq-scaled {\n background: #B4D5FE !important;\n background: Highlight !important;\n color: HighlightText;\n border-color: HighlightText;\n}\n.mq-math-mode .mq-selection .mq-matrixed,\n.mq-editable-field .mq-selection .mq-matrixed {\n background: #39F !important;\n}\n.mq-math-mode .mq-selection .mq-matrixed-container,\n.mq-editable-field .mq-selection .mq-matrixed-container {\n filter: progid:DXImageTransform.Microsoft.Chroma(color='#3399FF') !important;\n}\n.mq-math-mode .mq-selection.mq-blur,\n.mq-editable-field .mq-selection.mq-blur,\n.mq-math-mode .mq-selection.mq-blur .mq-non-leaf,\n.mq-editable-field .mq-selection.mq-blur .mq-non-leaf,\n.mq-math-mode .mq-selection.mq-blur .mq-scaled,\n.mq-editable-field .mq-selection.mq-blur .mq-scaled,\n.mq-math-mode .mq-selection.mq-blur .mq-matrixed,\n.mq-editable-field .mq-selection.mq-blur .mq-matrixed {\n background: #D4D4D4 !important;\n color: black;\n border-color: black;\n}\n.mq-math-mode .mq-selection.mq-blur .mq-matrixed-container,\n.mq-editable-field .mq-selection.mq-blur .mq-matrixed-container {\n filter: progid:DXImageTransform.Microsoft.Chroma(color='#D4D4D4') !important;\n}\n.mq-editable-field .mq-textarea,\n.mq-math-mode .mq-textarea {\n position: relative;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n.mq-editable-field .mq-textarea *,\n.mq-math-mode .mq-textarea *,\n.mq-editable-field .mq-selectable,\n.mq-math-mode .mq-selectable {\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n position: absolute;\n clip: rect(1em 1em 1em 1em);\n -webkit-transform: scale(0);\n -moz-transform: scale(0);\n -ms-transform: scale(0);\n -o-transform: scale(0);\n transform: scale(0);\n resize: none;\n width: 1px;\n height: 1px;\n}\n.mq-math-mode .mq-matrixed {\n background: white;\n display: -moz-inline-box;\n display: inline-block;\n}\n.mq-math-mode .mq-matrixed-container {\n filter: progid:DXImageTransform.Microsoft.Chroma(color='white');\n margin-top: -0.1em;\n}\n"),define("taoQtiItem/loader/taoQtiItem.bundle",function(){}),define("taoQtiItem/loader/taoQtiItem.min",["taoItems/loader/taoItems.min"],function(){});
//# sourceMappingURL=taoQtiItem.min.js.map