infusion
Version:
Infusion is an application framework for developing flexible stuff with JavaScript
9 lines • 501 kB
JavaScript
/*!
infusion - v3.0.0-dev.20200326T173810Z.24ddb2718
Friday, March 27th, 2020, 9:20:58 PM
branch: FLUID-6482
revision: 24ddb2718
*/
var fluid_3_0_0=fluid_3_0_0||{},fluid=fluid||fluid_3_0_0;!function($,fluid){"use strict";fluid.version="Infusion 3.0.0",fluid.Error=Error,fluid.environment={fluid:fluid},fluid.global=fluid.global||"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},fluid.invokeLater=function(func){return setTimeout(func,1)},fluid.defeatLogging=!0,fluid.activityTracing=!1,fluid.activityTrace=[];var activityParser=/(%\w+)/g;function transformInternal(source,togo,key,args){for(var transit=source[key],j=0;j<args.length-1;++j)transit=args[j+1](transit,key);togo[key]=transit}fluid.renderOneActivity=function(activity,nowhile){for(var togo=!0===nowhile?[]:[" while "],message=activity.message,index=activityParser.lastIndex=0;;){var match=activityParser.exec(message);if(!match)break;var key=match[1].substring(1);togo.push(message.substring(index,match.index)),togo.push(activity.args[key]),index=activityParser.lastIndex}return index<message.length&&togo.push(message.substring(index)),togo},fluid.renderActivity=function(activityStack,renderer){return renderer=renderer||fluid.renderOneActivity,fluid.transform(activityStack,renderer)},fluid.singleThreadLocal=function(initFunc){var value=initFunc();return function(newValue){return void 0===newValue?value:value=newValue}},fluid.threadLocal=fluid.singleThreadLocal,fluid.globalThreadLocal=fluid.threadLocal(function(){return{}}),fluid.getActivityStack=function(){var root=fluid.globalThreadLocal();return root.activityStack||(root.activityStack=[]),root.activityStack},fluid.describeActivity=fluid.getActivityStack,fluid.logActivity=function(activity){activity=activity||fluid.describeActivity();var rendered=fluid.renderActivity(activity).reverse();0<rendered.length&&(fluid.log("Current activity: "),fluid.each(rendered,function(args){fluid.log.apply(null,args)}))},fluid.pushActivity=function(type,message,args){var record={type:type,message:message,args:args,time:(new Date).getTime()};fluid.activityTracing&&fluid.activityTrace.push(record),fluid.passLogLevel(fluid.logLevel.TRACE)&&fluid.log.apply(null,fluid.renderOneActivity(record,!0)),fluid.getActivityStack().push(record)},fluid.popActivity=function(popframes){popframes=popframes||1,fluid.activityTracing&&fluid.activityTrace.push({pop:popframes});var activityStack=fluid.getActivityStack(),popped=activityStack.length-popframes;activityStack.length=popped<0?0:popped},fluid.FluidError=function(){var togo=Error.apply(this,arguments);this.message=togo.message;try{throw togo}catch(togo){this.stack=togo.stack}return this},fluid.FluidError.prototype=Object.create(Error.prototype),fluid.logFailure=function(args,activity){fluid.log.apply(null,[fluid.logLevel.FAIL,"ASSERTION FAILED: "].concat(args)),fluid.logActivity(activity)},fluid.renderLoggingArg=function(arg){return void 0===arg?"undefined":fluid.isPrimitive(arg)||!fluid.isPlainObject(arg)?arg:JSON.stringify(arg)},fluid.builtinFail=function(args){var message=fluid.transform(args,fluid.renderLoggingArg).join("");throw new fluid.FluidError("Assertion failure - check console for more details: "+message)},fluid.fail=function(){var args=fluid.makeArray(arguments),activity=fluid.makeArray(fluid.describeActivity());fluid.popActivity(activity.length),fluid.failureEvent?fluid.failureEvent.fire(args,activity):(fluid.logFailure(args,activity),fluid.builtinFail(args,activity))},fluid.expect=function(name,target,members){fluid.transform(fluid.makeArray(members),function(key){void 0===target[key]&&fluid.fail(name+" missing required parameter "+key)})},fluid.isLogging=function(){return logLevelStack[0].priority>fluid.logLevel.IMPORTANT.priority},fluid.isLogLevel=function(arg){return fluid.isMarker(arg)&&void 0!==arg.priority},fluid.passLogLevel=function(testLogLevel){return testLogLevel.priority<=logLevelStack[0].priority},fluid.setLogging=function(enabled){var logLevel;"boolean"==typeof enabled?logLevel=fluid.logLevel[enabled?"INFO":"IMPORTANT"]:fluid.isLogLevel(enabled)?logLevel=enabled:fluid.fail("Unrecognised fluid logging level ",enabled),logLevelStack.unshift(logLevel),fluid.defeatLogging=!fluid.isLogging()},fluid.setLogLevel=fluid.setLogging,fluid.popLogging=function(){var togo=1===logLevelStack.length?logLevelStack[0]:logLevelStack.shift();return fluid.defeatLogging=!fluid.isLogging(),togo},fluid.doBrowserLog=function(args){"undefined"!=typeof console&&(console.debug?console.debug.apply(console,args):"function"==typeof console.log&&console.log.apply(console,args))},fluid.log=function(){var directArgs=fluid.makeArray(arguments),userLogLevel=fluid.logLevel.INFO;fluid.isLogLevel(directArgs[0])&&(userLogLevel=directArgs.shift()),fluid.passLogLevel(userLogLevel)&&fluid.loggingEvent.fire(directArgs)},fluid.isValue=function(value){return null!=value},fluid.isPrimitive=function(value){var valueType=typeof value;return!value||"string"===valueType||"boolean"===valueType||"number"===valueType||"function"===valueType},fluid.isJQuery=function(totest){return Boolean(totest&&totest.jquery&&totest.constructor&&totest.constructor.prototype&&totest.constructor.prototype.jquery)},fluid.isArrayable=function(totest){return Boolean(totest)&&("[object Array]"===Object.prototype.toString.call(totest)||fluid.isJQuery(totest))},fluid.isPlainObject=function(totest,strict){var string=Object.prototype.toString.call(totest);return"[object Array]"===string?!strict:"[object Object]"===string&&(!totest.constructor||!totest.constructor.prototype||Object.prototype.hasOwnProperty.call(totest.constructor.prototype,"isPrototypeOf"))},fluid.typeCode=function(totest){return fluid.isPrimitive(totest)||!fluid.isPlainObject(totest)?"primitive":fluid.isArrayable(totest)?"array":"object"},fluid.isIoCReference=function(ref){return"string"==typeof ref&&"{"===ref.charAt(0)&&0<ref.indexOf("}")},fluid.isDOMNode=function(obj){return obj&&"number"==typeof obj.nodeType},fluid.isComponent=function(obj){return obj&&obj.constructor===fluid.componentConstructor},fluid.isUncopyable=function(totest){return fluid.isPrimitive(totest)||!fluid.isPlainObject(totest)},fluid.isApplicable=function(totest){return totest.apply&&"function"==typeof totest.apply},fluid.identity=function(arg){return arg},fluid.notImplemented=function(){fluid.fail("This operation is not implemented")},fluid.firstDefined=function(a,b){return void 0===a?b:a},fluid.freshContainer=function(tocopy){return fluid.isArrayable(tocopy)?[]:{}},fluid.testStrategyRecursion=function(funcName,segs){segs.length>fluid.strategyRecursionBailout&&fluid.fail("Runaway recursion encountered in "+funcName+" - reached path depth of "+fluid.strategyRecursionBailout+" via path of "+segs.join(".")+"this object is probably circularly connected. Either adjust your object structure to remove the circularity or increase fluid.strategyRecursionBailout")},fluid.copyRecurse=function(tocopy,segs){return fluid.testStrategyRecursion("fluid.copy",segs),fluid.isUncopyable(tocopy)?tocopy:fluid.transform(tocopy,function(value,key){segs.push(key);var togo=fluid.copyRecurse(value,segs);return segs.pop(),togo})},fluid.copy=function(tocopy){return fluid.copyRecurse(tocopy,[])},fluid.extend=$.extend,fluid.makeArray=function(arg){var togo=[];if(null!=arg)if(fluid.isPrimitive(arg)||fluid.isPlainObject(arg,!0)||"number"!=typeof arg.length)togo.push(arg);else for(var i=0;i<arg.length;++i)togo[i]=arg[i];return togo},fluid.pushArray=function(holder,member,topush){var array=holder[member]?holder[member]:holder[member]=[];fluid.isArrayable(topush)?array.push.apply(array,topush):array.push(topush)},fluid.transform=function(source){if(fluid.isPrimitive(source))return source;var togo=fluid.freshContainer(source);if(fluid.isArrayable(source))for(var i=0;i<source.length;++i)transformInternal(source,togo,i,arguments);else for(var key in source)transformInternal(source,togo,key,arguments);return togo},fluid.each=function(source,func){if(fluid.isArrayable(source))for(var i=0;i<source.length;++i)func(source[i],i);else for(var key in source)func(source[key],key)},fluid.make_find=function(find_if){var target=!find_if&&void 0;return function(source,func,deffolt){var disp;if(fluid.isArrayable(source)){for(var i=0;i<source.length;++i)if((disp=func(source[i],i))!==target)return find_if?source[i]:disp}else for(var key in source)if((disp=func(source[key],key))!==target)return find_if?source[key]:disp;return deffolt}},fluid.find=fluid.make_find(!1),fluid.find_if=fluid.make_find(!0),fluid.accumulate=function(list,fn,arg){for(var i=0;i<list.length;++i)arg=fn(list[i],arg,i);return arg},fluid.add=function(a,b){return a+b},fluid.remove_if=function(source,fn,target){if(fluid.isArrayable(source))for(var i=source.length-1;0<=i;--i)fn(source[i],i)&&(target&&target.unshift(source[i]),source.splice(i,1));else for(var key in source)fn(source[key],key)&&(target&&(target[key]=source[key]),delete source[key]);return target||source},fluid.generate=function(n,generator,applyFunc){for(var togo=[],i=0;i<n;++i)togo[i]=applyFunc?generator(i):generator;return togo},fluid.iota=function(count,first){first=first||0;for(var togo=[],i=0;i<count;++i)togo[togo.length]=first++;return togo},fluid.getMembers=function(holder,name){return fluid.transform(holder,function(member){return fluid.get(member,name)})},fluid.filterKeys=function(toFilter,keys,exclude){return fluid.remove_if($.extend({},toFilter),function(value,key){return exclude^-1===keys.indexOf(key)})},fluid.censorKeys=function(toCensor,keys){return fluid.filterKeys(toCensor,keys,!0)},fluid.keys=function(obj){var togo=[];for(var key in obj)togo.push(key);return togo},fluid.values=function(obj){var togo=[];for(var key in obj)togo.push(obj[key]);return togo},fluid.contains=function(obj,value){return obj?fluid.isArrayable(obj)?-1!==obj.indexOf(value):fluid.find(obj,function(thisValue){if(value===thisValue)return!0}):void 0},fluid.keyForValue=function(obj,value){return fluid.find(obj,function(thisValue,key){if(value===thisValue)return key})},fluid.arrayToHash=function(array){var togo={};return fluid.each(array,function(el){togo[el]=!0}),togo},fluid.stableSort=function(array,func){for(var i=0;i<array.length;i++){var j,k=array[i];for(j=i;0<j&&func(k,array[j-1])<0;j--)array[j]=array[j-1];array[j]=k}},fluid.hashToArray=function(hash,keyName,func){var togo=[];return fluid.each(hash,function(el,key){var newEl={};newEl[keyName]=key,func?newEl=func(newEl,el,key)||newEl:$.extend(!0,newEl,el),togo.push(newEl)}),togo},fluid.flatten=function(array){var togo=[];return fluid.each(array,function(element){fluid.isArrayable(element)?togo=togo.concat(element):togo.push(element)}),togo},fluid.clear=function(target){if(fluid.isArrayable(target))target.length=0;else for(var i in target)delete target[i]},fluid.compareStringLength=function(ascending){return ascending?function(a,b){return a.length-b.length}:function(a,b){return b.length-a.length}},fluid.parseInteger=function(string){return isFinite(string)&&string%1==0?Number(string):NaN},fluid.roundToDecimal=function(num,scale,method){return scale=scale&&0<=scale?Math.round(scale):0,"ceil"===method||"floor"===method?Number(Math[method](num+"e"+scale)+"e-"+scale):Number((0<=num?1:-1)*(Math.round(Math.abs(num)+"e"+scale)+"e-"+scale))},fluid.debounce=function(func,wait,immediate){var timeout,result;return function(){var context=this,args=arguments,callNow=immediate&&!timeout;return clearTimeout(timeout),timeout=setTimeout(function(){timeout=null,immediate||(result=func.apply(context,args))},wait),callNow&&(result=func.apply(context,args)),result}},fluid.freezeRecursive=function(tofreeze,segs){return segs=segs||[],fluid.testStrategyRecursion("fluid.freezeRecursive",segs),fluid.isPlainObject(tofreeze)?(fluid.each(tofreeze,function(value,key){segs.push(key),fluid.freezeRecursive(value,segs),segs.pop()}),Object.freeze(tofreeze)):tofreeze},fluid.marker=function(){},fluid.makeMarker=function(value,extra){var togo=Object.create(fluid.marker.prototype);return togo.value=value,$.extend(togo,extra),Object.freeze(togo)},fluid.VALUE=fluid.makeMarker("VALUE"),fluid.NO_VALUE=fluid.makeMarker("NO_VALUE"),fluid.EXPAND=fluid.makeMarker("EXPAND"),fluid.isMarker=function(totest,type){return totest instanceof fluid.marker&&(!type||totest.value===type.value)},fluid.logLevelsSpec={FATAL:0,FAIL:5,WARN:10,IMPORTANT:12,INFO:15,TRACE:20},fluid.logLevel=fluid.transform(fluid.logLevelsSpec,function(value,key){return fluid.makeMarker(key,{priority:value})});var logLevelStack=[fluid.logLevel.IMPORTANT];fluid.model={},fluid.model.copyModel=function(target,source){fluid.clear(target),$.extend(!0,target,source)},fluid.model.parseEL=function(EL){return""===EL?[]:String(EL).split(".")},fluid.model.composePath=function(prefix,suffix){return""===prefix?suffix:""===suffix?prefix:prefix+"."+suffix},fluid.model.composeSegments=function(){return fluid.makeArray(arguments).join(".")},fluid.lastDotIndex=function(path){return path.lastIndexOf(".")},fluid.model.getToTailPath=function(path){var lastdot=fluid.lastDotIndex(path);return-1===lastdot?"":path.substring(0,lastdot)},fluid.model.getTailPath=function(path){var lastdot=fluid.lastDotIndex(path);return path.substring(lastdot+1)},fluid.path=fluid.model.composeSegments,fluid.composePath=fluid.model.composePath,fluid.requireDataBinding=function(){fluid.fail("Please include DataBinding.js in order to operate complex model accessor configuration")},fluid.model.setWithStrategy=fluid.model.getWithStrategy=fluid.requireDataBinding,fluid.model.resolvePathSegment=function(root,segment,create,origEnv){if(!origEnv&&root.resolvePathSegment){var togo=root.resolvePathSegment(segment);if(void 0!==togo)return togo}return create&&void 0===root[segment]?root[segment]={}:root[segment]},fluid.model.parseToSegments=function(EL,parseEL,copy){return"number"==typeof EL||"string"==typeof EL?parseEL(EL):copy?fluid.makeArray(EL):EL},fluid.model.pathToSegments=function(EL,config){var parser=config&&config.parser?config.parser.parse:fluid.model.parseEL;return fluid.model.parseToSegments(EL,parser)},fluid.model.accessImpl=function(root,EL,newValue,config,initSegs,returnSegs,traverser){var segs=fluid.model.pathToSegments(EL,config),initPos=0;if(initSegs&&(initPos=initSegs.length,segs=initSegs.concat(segs)),root=traverser(root,segs,initPos,config,newValue===fluid.NO_VALUE?0:1),newValue===fluid.NO_VALUE||newValue===fluid.VALUE)return returnSegs?{root:root,segs:segs}:root;root[segs[segs.length-1]]=newValue},fluid.model.accessSimple=function(root,EL,newValue,environment,initSegs,returnSegs){return fluid.model.accessImpl(root,EL,newValue,environment,initSegs,returnSegs,fluid.model.traverseSimple)},fluid.model.traverseSimple=function(root,segs,initPos,environment,uncess){for(var origEnv=environment,limit=segs.length-uncess,i=0;i<limit;++i){if(!root)return;var segment=segs[i];root=environment&&environment[segment]?environment[segment]:fluid.model.resolvePathSegment(root,segment,1===uncess,origEnv),environment=null}return root},fluid.model.setSimple=function(root,EL,newValue,environment,initSegs){fluid.model.accessSimple(root,EL,newValue,environment,initSegs,!1)},fluid.model.getSimple=function(root,EL,environment,initSegs){return null==EL||0===EL.length?root:fluid.model.accessSimple(root,EL,fluid.NO_VALUE,environment,initSegs,!1)},fluid.getImmediate=function(root,segs,i){for(var limit=void 0===i?segs.length:i+1,j=0;j<limit;++j)root=root?root[segs[j]]:void 0;return root},fluid.decodeAccessorArg=function(arg3){return arg3&&arg3!==fluid.model.defaultGetConfig&&arg3!==fluid.model.defaultSetConfig?"environment"===arg3.type?arg3.value:void 0:null},fluid.set=function(root,EL,newValue,config,initSegs){var env=fluid.decodeAccessorArg(config);void 0===env?fluid.model.setWithStrategy(root,EL,newValue,config,initSegs):fluid.model.setSimple(root,EL,newValue,env,initSegs)},fluid.get=function(root,EL,config,initSegs){var env=fluid.decodeAccessorArg(config);return void 0===env?fluid.model.getWithStrategy(root,EL,config,initSegs):fluid.model.accessImpl(root,EL,fluid.NO_VALUE,env,null,!1,fluid.model.traverseSimple)},fluid.getGlobalValue=function(path,env){if(path)return env=env||fluid.environment,fluid.get(fluid.global,path,{type:"environment",value:env})},fluid.bind=function(obj,fnName,args){return obj[fnName].apply(obj,fluid.makeArray(args))},fluid.invokeGlobalFunction=function(functionPath,args,environment){var func=fluid.getGlobalValue(functionPath,environment);if(func)return func.apply(null,fluid.isArrayable(args)?args:fluid.makeArray(args));fluid.fail("Error invoking global function: "+functionPath+" could not be located")},fluid.registerGlobalFunction=function(functionPath,func,env){env=env||fluid.environment,fluid.set(fluid.global,functionPath,func,{type:"environment",value:env})},fluid.setGlobalValue=fluid.registerGlobalFunction,fluid.registerNamespace=function(naimspace,env){env=env||fluid.environment;var existing=fluid.getGlobalValue(naimspace,env);return existing||(existing={},fluid.setGlobalValue(naimspace,existing,env)),existing},fluid.dumpEl=fluid.identity,fluid.renderTimestamp=fluid.identity,fluid.generateUniquePrefix=function(){return Math.floor(1e12*Math.random()).toString(36)+"-"};var fluid_prefix=fluid.generateUniquePrefix();fluid.fluidInstance=fluid_prefix;var fluid_guid=1;fluid.allocateGuid=function(){return fluid_prefix+fluid_guid++},fluid.registerNamespace("fluid.event"),fluid.extremePriority=4e9,fluid.priorityTypes={first:-1,last:1,before:0,after:0},fluid.extremalPriorities={none:0,testing:10,authoring:20},fluid.parsePriorityConstraint=function(constraint,fixedOnly,site){var segs=constraint.split(":"),type=segs[0],lookup=fluid.priorityTypes[type];return void 0===lookup&&fluid.fail("Invalid constraint type in priority field "+constraint+": the only supported values are "+fluid.keys(fluid.priorityTypes).join(", ")+" or numeric"),fixedOnly&&0===lookup&&fluid.fail("Constraint type in priority field "+constraint+" is not supported in a "+site+" record - you must use either a numeric value or first, last"),{type:segs[0],target:segs[1]}},fluid.parsePriority=function(priority,count,fixedOnly,site){var togo={count:count||0,fixed:null,constraint:null,site:site};"number"==typeof(priority=priority||0)?togo.fixed=-priority:togo.constraint=fluid.parsePriorityConstraint(priority,fixedOnly,site);var multiplier=togo.constraint?fluid.priorityTypes[togo.constraint.type]:0;if(0!==multiplier){var target=togo.constraint.target||"none",extremal=fluid.extremalPriorities[target];void 0===extremal&&fluid.fail("Unrecognised extremal priority target "+target+": the currently supported values are "+fluid.keys(fluid.extremalPriorities).join(", ")+": register your value in fluid.extremalPriorities"),togo.fixed=multiplier*(fluid.extremePriority+extremal)}return null!==togo.fixed&&(togo.fixed+=togo.count/1024),togo},fluid.renderPriority=function(parsed){return parsed.constraint?parsed.constraint.target?parsed.constraint.type+":"+parsed.constraint.target:parsed.constraint.type:Math.floor(parsed.fixed)},fluid.compareByPriority=function(recA,recB){return null!==recA.priority.fixed&&null!==recB.priority.fixed?recA.priority.fixed-recB.priority.fixed:(null===recA.priority.fixed)-(null===recB.priority.fixed)},fluid.honourConstraint=function(array,firstConstraint,c){var constraint=array[c].priority.constraint,matchIndex=fluid.find(array,function(element,index){return element.namespace===constraint.target?index:void 0},-1);if(-1===matchIndex)return!0;if(firstConstraint<=matchIndex)return!1;for(var target=matchIndex+("after"===constraint.type?1:0),temp=array[c],shift=c;target<=shift;--shift)array[shift]=array[shift-1];return array[target]=temp,!0},fluid.sortByPriority=function(array){fluid.stableSort(array,fluid.compareByPriority);for(var firstConstraint=fluid.find(array,function(element,index){return element.priority.constraint&&0===fluid.priorityTypes[element.priority.constraint.type]?index:void 0},array.length);;){if(firstConstraint===array.length)return array;for(var oldFirstConstraint=firstConstraint,c=firstConstraint;c<array.length;++c){fluid.honourConstraint(array,firstConstraint,c)&&++firstConstraint}if(firstConstraint===oldFirstConstraint){var holders=array.slice(firstConstraint);fluid.fail("Could not find targets for any constraints in "+holders[0].priority.site+" ",holders,": none of the targets ("+fluid.getMembers(holders,"priority.constraint.target").join(", ")+") matched any namespaces of the elements in (",array.slice(0,firstConstraint),") - this is caused by either an invalid or circular reference")}}},fluid.parsePriorityRecords=function(records,name){var array=fluid.hashToArray(records,"namespace",function(newElement,oldElement){$.extend(newElement,oldElement),newElement.priority=fluid.parsePriority(oldElement.priority,0,!1,name)});return fluid.sortByPriority(array),array},fluid.event.identifyListener=function(listener,soft){return"string"==typeof listener||listener.$$fluid_guid||soft||(listener.$$fluid_guid=fluid.allocateGuid()),listener.$$fluid_guid},fluid.event.impersonateListener=function(origListener,newListener){fluid.event.identifyListener(origListener),newListener.$$fluid_guid=origListener.$$fluid_guid},fluid.event.sortListeners=function(listeners){var togo=[];return fluid.each(listeners,function(oneNamespace){for(var headHard,i=0;i<oneNamespace.length;++i){var thisListener=oneNamespace[i];thisListener.softNamespace||headHard||(headHard=thisListener)}headHard?togo.push(headHard):togo=togo.concat(oneNamespace)}),fluid.sortByPriority(togo)},fluid.event.resolveListener=function(listener){var listenerName=listener.globalName||("string"==typeof listener?listener:null);if(listenerName){var listenerFunc=fluid.getGlobalValue(listenerName);listenerFunc?listener=listenerFunc:fluid.fail("Unable to look up name "+listenerName+" as a global function")}return listener},fluid.nameComponent=function(that){return that?"component with typename "+that.typeName+" and id "+that.id:"[unknown component]"},fluid.event.nameEvent=function(that,eventName){return eventName+" of "+fluid.nameComponent(that)},fluid.makeEventFirer=function(options){var that,name=(options=options||{}).name||"<anonymous>";return that={eventId:fluid.allocateGuid(),name:name,ownerId:options.ownerId,typeName:"fluid.event.firer",destroy:function(){that.destroyed=!0},addListener:function(){(function(){that.listeners={},that.byId={},that.sortedListeners=[],that.addListener=function(listener,namespace,priority,softNamespace,listenerId){var record;if(that.destroyed&&fluid.fail("Cannot add listener to destroyed event firer "+that.name),listener){fluid.isPlainObject(listener,!0)&&!fluid.isApplicable(listener)&&(listener=(record=listener).listener,namespace=record.namespace,priority=record.priority,softNamespace=record.softNamespace,listenerId=record.listenerId),"string"==typeof listener&&(listener={globalName:listener});var id=listenerId||fluid.event.identifyListener(listener);namespace=namespace||id,record=$.extend(record||{},{namespace:namespace,listener:listener,softNamespace:softNamespace,listenerId:listenerId,priority:fluid.parsePriority(priority,that.sortedListeners.length,!1,"listeners")}),that.byId[id]=record,(that.listeners[namespace]=fluid.makeArray(that.listeners[namespace]))[softNamespace?"push":"unshift"](record),that.sortedListeners=fluid.event.sortListeners(that.listeners)}},that.addListener.apply(null,arguments)}).apply(null,arguments)},removeListener:function(listener){if(that.listeners){var namespace,id,record;"string"==typeof listener?(namespace=listener,(record=that.listeners[namespace])||(id=namespace,namespace=null)):"function"==typeof listener&&((id=fluid.event.identifyListener(listener,!0))||fluid.fail("Cannot remove unregistered listener function ",listener," from event "+that.name));var rec=that.byId[id],softNamespace=rec&&rec.softNamespace;namespace=namespace||rec&&rec.namespace||id,delete that.byId[id],(record=that.listeners[namespace])&&(softNamespace?fluid.remove_if(record,function(thisLis){return thisLis.listener.$$fluid_guid===id||thisLis.listenerId===id}):record.shift(),0===record.length&&delete that.listeners[namespace]),that.sortedListeners=fluid.event.sortListeners(that.listeners)}},fire:function(){var listeners=that.sortedListeners;if(listeners&&!that.destroyed)for(var i=0;i<listeners.length;++i){var lisrec=listeners[i];"function"!=typeof lisrec.listener&&(lisrec.listener=fluid.event.resolveListener(lisrec.listener));var value,ret=lisrec.listener.apply(null,arguments);if((options.preventable&&!1===ret||that.destroyed)&&(value=!1),void 0!==value)return value}}}},fluid.fireEvent=function(component,eventName,args){var firer=component.events[eventName];firer&&firer.fire.apply(null,fluid.makeArray(args))},fluid.event.addListenerToFirer=function(firer,value,namespace,wrapper){if(wrapper=wrapper||fluid.identity,fluid.isArrayable(value))for(var i=0;i<value.length;++i)fluid.event.addListenerToFirer(firer,value[i],namespace,wrapper);else"function"==typeof value||"string"==typeof value?wrapper(firer).addListener(value,namespace):value&&"object"==typeof value&&wrapper(firer).addListener(value.listener,namespace||value.namespace,value.priority,value.softNamespace,value.listenerId)},fluid.event.resolveListenerRecord=function(records){return{records:records}},fluid.expandImmediate=function(material){fluid.fail("fluid.expandImmediate could not be loaded - please include FluidIoC.js in order to operate IoC-driven event with descriptor "+material)},fluid.mergeListeners=function(that,events,listeners){fluid.each(listeners,function(value,key){var firer,namespace;if(fluid.isIoCReference(key))(firer=fluid.expandImmediate(key,that))||fluid.fail("Error in listener record: key "+key+' could not be looked up to an event firer - did you miss out "events." when referring to an event firer?');else{var keydot=key.indexOf(".");-1!==keydot&&(namespace=key.substring(keydot+1),key=key.substring(0,keydot)),events[key]||fluid.fail("Listener registered for event "+key+" which is not defined for this component"),firer=events[key]}var record=fluid.event.resolveListenerRecord(value,that,key,namespace,!0);fluid.event.addListenerToFirer(firer,record.records,namespace,record.adderWrapper)})},fluid.eventFromRecord=function(eventSpec,eventKey,that){var event;return eventSpec&&("string"!=typeof eventSpec||fluid.isIoCReference(eventSpec))?fluid.event.resolveEvent?event=fluid.event.resolveEvent(that,eventKey,eventSpec):fluid.fail("fluid.event.resolveEvent could not be loaded - please include FluidIoC.js in order to operate IoC-driven event with descriptor ",eventSpec):event=fluid.makeEventFirer({name:fluid.event.nameEvent(that,eventKey),preventable:"preventable"===eventSpec,ownerId:that.id}),event},fluid.instantiateFirers=function(that,options){fluid.each(options.events,function(eventSpec,eventKey){that.events[eventKey]=fluid.eventFromRecord(eventSpec,eventKey,that)})},fluid.mergeListenerPolicy=function(target,source,key){return"string"!=typeof key&&fluid.fail("Error in listeners declaration - the keys in this structure must resolve to event names - got "+key+" from ",source),!fluid.isIoCReference(key)&&-1!==key.indexOf(".")?source||target:fluid.arrayConcatPolicy(target,source)},fluid.makeMergeListenersPolicy=function(merger,modelRelay){return function(target,source){return target=target||{},modelRelay&&(fluid.isArrayable(source)||"string"==typeof source.target)?target[""]=merger(target[""],source,""):fluid.each(source,function(listeners,key){target[key]=merger(target[key],listeners,key)}),target}},fluid.validateListenersImplemented=function(that){var errors=[];return fluid.each(that.events,function(event,name){fluid.each(event.sortedListeners,function(lisrec){lisrec.listener!==fluid.notImplemented&&"fluid.notImplemented"!==lisrec.listener.globalName||errors.push({name:name,namespace:lisrec.namespace,componentSource:fluid.model.getSimple(that.options.listeners,[name+"."+lisrec.namespace,0,"componentSource"])})})}),errors},fluid.unique=function(array){return fluid.remove_if(array,function(element,i){return!element||0<i&&element===array[i-1]})},fluid.arrayConcatPolicy=function(target,source){return fluid.makeArray(target).concat(fluid.makeArray(source))},fluid.loggingEvent=fluid.makeEventFirer({name:"logging event"}),fluid.addTimestampArg=function(args){var arg0=fluid.renderTimestamp(new Date)+": ";args.unshift(arg0)},fluid.loggingEvent.addListener(fluid.doBrowserLog,"log"),fluid.loggingEvent.addListener(fluid.identity,"filterArgs","before:log"),fluid.loggingEvent.addListener(fluid.addTimestampArg,"addTimestampArg","after:filterArgs"),fluid.failureEvent=fluid.makeEventFirer({name:"failure event"}),fluid.failureEvent.addListener(fluid.builtinFail,"fail"),fluid.failureEvent.addListener(fluid.logFailure,"log","before:fail"),fluid.pushSoftFailure=function(condition){"function"==typeof condition?fluid.failureEvent.addListener(condition,"fail"):-1===condition?fluid.failureEvent.removeListener("fail"):"boolean"==typeof condition&&fluid.fail("pushSoftFailure with boolean value is no longer supported")},fluid.componentConstructor=function(){},fluid.typeTag=function(name){var that=Object.create(fluid.componentConstructor.prototype);return that.typeName=name,that.id=fluid.allocateGuid(),that};var gradeTick=1,gradeTickStore={};function regenerateCursor(source,segs,limit,sourceStrategy){for(var i=0;i<limit;++i)source=sourceStrategy(source,segs[i],i,fluid.makeArray(segs));return source}fluid.defaultsStore={},fluid.resolveGradesImpl=function(gs,gradeNames){for(var i=(gradeNames=fluid.makeArray(gradeNames)).length-1;0<=i;--i){var gradeName=gradeNames[i];if(gradeName&&!gs.gradeHash[gradeName]){var options=(fluid.isIoCReference(gradeName)?null:fluid.rawDefaults(gradeName))||{},thisTick=gradeTickStore[gradeName]||gradeTick-1;gs.lastTick=Math.max(gs.lastTick,thisTick),gs.gradeHash[gradeName]=!0,gs.gradeChain.push(gradeName);for(var oGradeNames=fluid.makeArray(options.gradeNames),j=oGradeNames.length-1;0<=j;--j)fluid.resolveGradesImpl(gs,oGradeNames[j])}}return gs},fluid.resolveGradeStructure=function(defaultName,gradeNames){var gradeStruct={lastTick:0,gradeChain:[],gradeHash:{}};return fluid.resolveGradesImpl(gradeStruct,[defaultName].concat(fluid.makeArray(gradeNames))),gradeStruct.gradeChain.reverse(),gradeStruct},fluid.hasGrade=function(options,gradeName){return!(!options||!options.gradeNames)&&fluid.contains(options.gradeNames,gradeName)},fluid.resolveGrade=function(defaults,defaultName,gradeNames){var gradeStruct=fluid.resolveGradeStructure(defaultName,gradeNames),mergeArgs=fluid.transform(gradeStruct.gradeChain,fluid.rawDefaults,fluid.copy);fluid.remove_if(mergeArgs,function(options){return!options});for(var mergePolicy={},i=0;i<mergeArgs.length;++i)mergeArgs[i]&&mergeArgs[i].mergePolicy&&(mergePolicy=$.extend(!0,mergePolicy,mergeArgs[i].mergePolicy));mergeArgs=[mergePolicy,{}].concat(mergeArgs);var mergedDefaults=fluid.merge.apply(null,mergeArgs);return mergedDefaults.gradeNames=gradeStruct.gradeChain,fluid.freezeRecursive(mergedDefaults),{defaults:mergedDefaults,lastTick:gradeStruct.lastTick}},fluid.mergedDefaultsCache={},fluid.gradeNamesToKey=function(defaultName,gradeNames){return defaultName+"|"+gradeNames.join("|")},fluid.getMergedDefaults=function(defaultName,gradeNames){gradeNames=fluid.makeArray(gradeNames);var key=fluid.gradeNamesToKey(defaultName,gradeNames),mergedDefaults=fluid.mergedDefaultsCache[key];if(mergedDefaults){for(var lastTick=0,searchGrades=mergedDefaults.defaults.gradeNames||[],i=0;i<searchGrades.length;++i)lastTick=Math.max(lastTick,gradeTickStore[searchGrades[i]]||0);lastTick>mergedDefaults.lastTick&&(fluid.passLogLevel(fluid.logLevel.TRACE)&&fluid.log(fluid.logLevel.TRACE,"Clearing cache for component "+defaultName+" with gradeNames ",searchGrades),mergedDefaults=null)}if(!mergedDefaults){var defaults=fluid.rawDefaults(defaultName);if(!defaults)return defaults;mergedDefaults=fluid.mergedDefaultsCache[key]=fluid.resolveGrade(defaults,defaultName,gradeNames)}return mergedDefaults.defaults},fluid.upgradePrimitiveFunc=function(rec,key){if(rec&&fluid.isPrimitive(rec)){var togo={};return togo[key||("string"==typeof rec&&"{"!==rec.charAt(0)?"funcName":"func")]=rec,togo.args=fluid.NO_VALUE,togo}return rec},fluid.annotateListeners=function(componentName,options){options.listeners=fluid.transform(options.listeners,function(record){var togo=fluid.makeArray(record);return fluid.transform(togo,function(onerec){return(onerec=fluid.upgradePrimitiveFunc(onerec,"listener")).componentSource=componentName,onerec})}),options.invokers=fluid.transform(options.invokers,function(record){return(record=fluid.upgradePrimitiveFunc(record))&&(record.componentSource=componentName),record})},fluid.rawDefaults=function(componentName){var entry=fluid.defaultsStore[componentName];return entry&&entry.options},fluid.registerRawDefaults=function(componentName,options){fluid.pushActivity("registerRawDefaults","registering defaults for grade %componentName with options %options",{componentName:componentName,options:options});var optionsCopy=fluid.expandCompact?fluid.expandCompact(options):fluid.copy(options);fluid.annotateListeners(componentName,optionsCopy);var callerInfo=fluid.getCallerInfo&&fluid.getCallerInfo(6);fluid.defaultsStore[componentName]={options:optionsCopy,callerInfo:callerInfo},gradeTickStore[componentName]=gradeTick++,fluid.popActivity()},fluid.doIndexDefaults=function(defaultName,defaults,index,indexSpec){for(var requiredGrades=fluid.makeArray(indexSpec.gradeNames),i=0;i<requiredGrades.length;++i)if(!fluid.hasGrade(defaults,requiredGrades[i]))return;for(var keys=("function"==typeof indexSpec.indexFunc?indexSpec.indexFunc:fluid.getGlobalValue(indexSpec.indexFunc))(defaults)||[],j=0;j<keys.length;++j)fluid.pushArray(index,keys[j],defaultName)},fluid.indexDefaults=function(indexName,indexSpec){var index={};for(var defaultName in fluid.defaultsStore){var defaults=fluid.getMergedDefaults(defaultName);fluid.doIndexDefaults(defaultName,defaults,index,indexSpec)}return index},fluid.defaults=function(componentName,options){if(void 0===options)return fluid.getMergedDefaults(componentName);options&&options.options&&fluid.fail("Probable error in options structure for "+componentName+' with option named "options" - perhaps you meant to write these options at top level in fluid.defaults? - ',options),fluid.registerRawDefaults(componentName,options);var gradedDefaults=fluid.getMergedDefaults(componentName);fluid.hasGrade(gradedDefaults,"fluid.function")||fluid.makeComponentCreator(componentName)},fluid.makeComponentCreator=function(componentName){var creator=function(){var defaults=fluid.getMergedDefaults(componentName);if(defaults.gradeNames&&0!==defaults.gradeNames.length){if(defaults.initFunction)return fluid.initComponent(componentName,arguments);for(var blankGrades=[],i=0;i<defaults.gradeNames.length;++i){var gradeName=defaults.gradeNames[i];fluid.rawDefaults(gradeName)||blankGrades.push(gradeName)}0===blankGrades.length?fluid.fail("Cannot make component creator for type "+componentName+" which does not have an initFunction defined"):fluid.fail("The grade hierarchy of component with type "+componentName+" is incomplete - it inherits from the following grade(s): "+blankGrades.join(", ")+" for which the grade definitions are corrupt or missing. Please check the files which might include these grades and ensure they are readable and have been loaded by this instance of Infusion")}else fluid.fail("Cannot make component creator for type "+componentName+" which does not have any gradeNames defined")},existing=fluid.getGlobalValue(componentName);existing&&$.extend(creator,existing),fluid.setGlobalValue(componentName,creator)},fluid.emptyPolicy=fluid.freezeRecursive({}),fluid.derefMergePolicy=function(policy){return(policy?policy["*"]:fluid.emptyPolicy)||fluid.emptyPolicy},fluid.compileMergePolicy=function(mergePolicy){var builtins={},defaultValues={},togo={builtins:builtins,defaultValues:defaultValues};return mergePolicy&&fluid.each(mergePolicy,function(value,key){var parsed={},builtin=!0;if("function"==typeof value)parsed.func=value;else if("object"==typeof value)parsed=value;else if(fluid.isDefaultValueMergePolicy(value))fluid.set(defaultValues,key,"{that}.options."+value),builtin=!(togo.hasDefaults=!0);else for(var split=value.split(/\s*,\s*/),i=0;i<split.length;++i)parsed[split[i]]=!0;builtin&&fluid.set(builtins,fluid.composePath(key,"*"),parsed)}),togo},fluid.isDefaultValueMergePolicy=function(policy){return"string"==typeof policy&&-1===policy.indexOf(",")&&!/replace|nomerge|noexpand/.test(policy)},fluid.mergeOneImpl=function(thisTarget,thisSource,j,sources,newPolicy,i,segs){var togo=thisTarget,primitiveTarget=fluid.isPrimitive(thisTarget);return void 0!==thisSource&&(newPolicy.func||null===thisSource||!fluid.isPlainObject(thisSource)||newPolicy.nomerge?(sources[j]=void 0,togo=newPolicy.func?newPolicy.func.call(null,thisTarget,thisSource,segs[i-1],segs,i):thisSource):primitiveTarget&&(togo=thisTarget=fluid.freshContainer(thisSource))),togo},fluid.fetchMergeChildren=function(target,i,segs,sources,mergePolicy,options){for(var thisPolicy=fluid.derefMergePolicy(mergePolicy),j=sources.length-1;0<=j;--j){var source=sources[j];if(void 0!==source&&(fluid.each(source,function(newSource,name){var childPolicy=fluid.concreteTrundler(mergePolicy,name);name in target&&(!options.evaluateFully||void 0!==childPolicy||fluid.isPrimitive(target[name]))||(segs[i]=name,options.strategy(target,name,i+1,segs,sources,mergePolicy))}),thisPolicy.replace))break}return target},fluid.inEvaluationMarker=Object.freeze({__CURRENTLY_IN_EVALUATION__:!0}),fluid.strategyRecursionBailout=50,fluid.makeMergeStrategy=function(options){var strategy=function(target,name,i,segs,sources,policy){if(i>fluid.strategyRecursionBailout&&fluid.fail("Overflow/circularity in options merging, current path is ",segs," at depth ",i,' - please protect components from merging using the "nomerge" merge policy'),!fluid.isPrimitive(target)){var oldTarget;if(fluid.isTracing&&fluid.tracing.pathCount.push(fluid.path(segs.slice(0,i))),name in target){if(oldTarget=target[name],!options.evaluateFully)return oldTarget}else target!==fluid.inEvaluationMarker&&(target[name]=fluid.inEvaluationMarker);void 0===sources&&(segs=fluid.makeArray(segs),sources=function(sources,segs,limit,sourceStrategies){for(var togo=[],i=0;i<sources.length;++i){var thisSource=regenerateCursor(sources[i],segs,limit,sourceStrategies[i]);void 0!==thisSource&&togo.push(thisSource)}return togo}(options.sources,segs,i-1,options.sourceStrategies),policy=regenerateCursor(options.mergePolicy,segs,i-1,fluid.concreteTrundler));var start,limit,mul,newPolicyHolder=fluid.concreteTrundler(policy,name),newPolicy=fluid.derefMergePolicy(newPolicyHolder);mul=newPolicy.replace?(start=1-sources.length,limit=0,-1):(start=0,limit=sources.length-1,1);for(var thisTarget,newSources=[],j=start;j<=limit;++j){var k=mul*j,thisSource=options.sourceStrategies[k](sources[k],name,i,segs);if(void 0!==thisSource&&(fluid.isPrimitive(thisSource)||(newSources[k]=thisSource),void 0===oldTarget)){if(-1===mul){thisTarget=target[name]=thisSource;break}thisTarget=fluid.mergeOneImpl(thisTarget,thisSource,j,newSources,newPolicy,i,segs,options),target!==fluid.inEvaluationMarker&&(target[name]=thisTarget)}}return void 0!==oldTarget&&(thisTarget=oldTarget),0<newSources.length&&fluid.isPlainObject(thisTarget)&&fluid.fetchMergeChildren(thisTarget,i,segs,newSources,newPolicyHolder,options),void 0===oldTarget&&0===newSources.length&&delete target[name],thisTarget}};return options.strategy=strategy},fluid.driveStrategy=function(root,pathSegs,strategy){pathSegs=fluid.makeArray(pathSegs);for(var i=0;i<pathSegs.length;++i){if(!root)return;root=strategy(root,pathSegs[i],i+1,pathSegs)}return root},fluid.concreteTrundler=function(source,seg){return source?source[seg]:void 0},fluid.merge=function(policy){var sources=Array.prototype.slice.call(arguments,1),compiled=fluid.compileMergePolicy(policy).builtins,options=fluid.makeMergeOptions(compiled,sources,{});return options.initter(),options.target},fluid.simpleGingerBlock=function(source,recordType){return{target:source,simple:!0,strategy:fluid.concreteTrundler,initter:fluid.identity,recordType:recordType,priority:fluid.mergeRecordTypes[recordType]}},fluid.makeMergeOptions=function(policy,sources,userOptions){var options={mergePolicy:policy,sources:sources};return(options=$.extend(options,userOptions)).target=options.target||fluid.freshContainer(options.sources[0]),options.sourceStrategies=options.sourceStrategies||fluid.generate(options.sources.length,fluid.concreteTrundler),options.initter=function(){options.evaluateFully=!0,fluid.fetchMergeChildren(options.target,0,[],options.sources,options.mergePolicy,options)},fluid.makeMergeStrategy(options),options},fluid.transformOptions=function(options,transRec){return fluid.expect("Options transformation record",transRec,["transformer","config"]),fluid.getGlobalValue(transRec.transformer).call(null,options,transRec.config)},fluid.findMergeBlocks=function(mergeBlocks,recordType){return fluid.remove_if(fluid.makeArray(mergeBlocks),function(block){return block.recordType!==recordType})},fluid.transformOptionsBlocks=function(mergeBlocks,transformOptions,recordTypes){fluid.each(recordTypes,function(recordType){var blocks=fluid.findMergeBlocks(mergeBlocks,recordType);fluid.each(blocks,function(block){var source=block.source?"source":"target";block[block.simple||"target"===source?"target":"source"]=fluid.transformOptions(block[source],transformOptions)})})},fluid.dedupeDistributionNamespaces=function(mergeBlocks){var byNamespace={};fluid.remove_if(mergeBlocks,function(mergeBlock){var ns=mergeBlock.namespace;if(ns){if(byNamespace[ns]&&byNamespace[ns]!==mergeBlock.contextThat.id)return!0;byNamespace[ns]=mergeBlock.contextThat.id}})},fluid.deliverOptionsStrategy=fluid.identity,fluid.computeComponentAccessor=fluid.identity,fluid.computeDynamicComponents=fluid.identity,fluid.mergeRecordTypes={defaults:1e3,defaultValueMerge:900,subcomponentRecord:800,user:700,distribution:100},fluid.model.applyChangeRequest=function(model,request){var segs=request.segs;if(0===segs.length)"ADD"===request.type?$.extend(!0,model,request.value):fluid.clear(model);else if("ADD"===request.type)fluid.model.setSimple(model,request.segs,request.value);else{for(var i=0;i<segs.length-1;++i)if(!(model=model[segs[i]]))return;delete model[segs[segs.length-1]]}},fluid.destroyValue=function(target,segs){target&&fluid.model.applyChangeRequest(target,{type:"DELETE",segs:segs})},fluid.mergeComponentOptions=function(that,componentName,userOptions,localOptions){var rawDefaults=fluid.rawDefaults(componentName),defaults=fluid.getMergedDefaults(componentName,rawDefaults&&rawDefaults.gradeNames?null:localOptions.gradeNames),sharedMergePolicy={},mergeBlocks=[];mergeBlocks=fluid.expandComponentOptions?mergeBlocks.concat(fluid.expandComponentOptions(sharedMergePolicy,defaults,userOptions,that)):mergeBlocks.concat([fluid.simpleGingerBlock(defaults,"defaults"),fluid.simpleGingerBlock(userOptions,"user")]);var options={},sourceStrategies=[],sources=[],baseMergeOptions={target:options,sourceStrategies:sourceStrategies},updateBlocks=function(){fluid.each(mergeBlocks,function(block){fluid.isPrimitive(block.priority)&&(block.priority=fluid.parsePriority(block.priority,0,!1,"options distribution"))}),fluid.sortByPriority(mergeBlocks),fluid.dedupeDistributionNamespaces(mergeBlocks),sourceStrategies.length=0,sources.length=0,fluid.each(mergeBlocks,function(block){sourceStrategies.push(block.strategy),sources.push(block.target)})};updateBlocks();var compiledPolicy,mergePolicy,mergeOptions=fluid.makeMergeOptions(sharedMergePolicy,sources,baseMergeOptions);function computeMergePolicy(){mergePolicy=fluid.driveStrategy(options,"mergePolicy",mergeOptions.strategy),mergePolicy=$.extend({},fluid.rootMergePolicy,mergePolicy),compiledPolicy=fluid.compileMergePolicy(mergePolicy),$.extend(!0,sharedMergePolicy,compiledPolicy.builtins)}mergeOptions.mergeBlocks=mergeBlocks,mergeOptions.updateBlocks=updateBlocks,mergeOptions.destroyValue=function(segs){for(var i=0;i<mergeBlocks.length;++i)mergeBlocks[i].immutableTarget||fluid.destroyValue(mergeBlocks[i].target,segs);fluid.destroyValue(baseMergeOptions.target,segs)},computeMergePolicy(),mergeOptions.computeMergePolicy=computeMergePolicy,compiledPolicy.hasDefaults&&(fluid.generateExpandBlock?(mergeBlocks.push(fluid.generateExpandBlock({options:compiledPolicy.defaultValues,recordType:"defaultValueMerge",priority:fluid.mergeRecordTypes.defaultValueMerge},that,{})),updateBlocks()):fluid.fail("Cannot operate mergePolicy ",mergePolicy," for component ",that," without including FluidIoC.js")),that.options=options,fluid.driveStrategy(options,"gradeNames",mergeOptions.strategy),fluid.deliverOptionsStrategy(that,options,mergeOptions),fluid.computeComponentAccessor(that,userOptions&&userOptions.localRecord);var transformOptions=fluid.driveStrategy(options,"transformOptions",mergeOptions.strategy);return transformOptions&&(fluid.transformOptionsBlocks(mergeBlocks,transformOptions,["user","subcomponentRecord"]),updateBlocks()),baseMergeOptions.target.mergePolicy||computeMergePolicy(),mergeOptions},fluid.defaults("fluid.function",{}),fluid.invokeGradedFunction=function(name,spec){var defaults=fluid.defaults(name);defaults&&defaults.argumentMap&&fluid.hasGrade(defaults,"fluid.function")||fluid.fail("Cannot look up name "+name+" to a function with registered argumentMap - got defaults ",defaults);var args=[];return fluid.each(defaults.argumentMap,function(value,key){args[value]=spec[key]}),fluid.invokeGlobalFunction(name,args)},fluid.noNamespaceDistributionPrefix="no-namespace-distribution-",fluid.mergeOneDistribution=function(target,source,key){var namespace=source.namespace||key||fluid.noNamespaceDistributionPrefix+fluid.allocateGuid();target[source.namespace=namespace]=$.extend(!0,{},target[namespace],source)},fluid.distributeOptionsPolicy=function(target,source){if(target=target||{},fluid.isArrayable(source))for(var i=0;i<source.length;++i)fluid.mergeOneDistribution(target,source[i]);else"string"==typeof source.target?fluid.mergeOneDistribution(target,source):fluid.each(source,function(oneSource,key){fluid.mergeOneDistribution(target,oneSource,key)});return target},fluid.mergingArray=function(){},fluid.mergingArray.prototype=[],fluid.membersMergePolicy=function(target,source){return target=target||{},fluid.each(source,function(oneSource,key){target[key]||(target[key]=new fluid.mergingArray),oneSource instanceof fluid.mergingArray?target[key].push.apply(target[key],oneSource):void 0!==oneSource&&target[key].push(oneSource)}),target},fluid.invokerStrategies=fluid.arrayToHash(["func","funcName","listener","this","method","changePath","value"]),fluid.invokersMergePolicy=function(target,source){return target=target||{},fluid.each(source,function(oneInvoker,name){if(oneInvoker){oneInvoker=fluid.upgradePrimitiveFunc(oneInvoker);var oneT=target[name];for(var key in oneT||(oneT=target[name]={}),fluid.invokerStrategies)if(key in oneInvoker)for(var key2 in fluid.invokerStrategies)oneT[key2]=void 0;$.extend(oneT,oneInvoker)}else target[name]=oneInvoker}),target},fluid.rootMergePolicy={gradeNames:fluid.arrayConcatPolicy,distributeOptions:fluid.distributeOptionsPolicy,members:{noexpand:!0,func:fluid.membersMergePolicy},invokers:{noexpand:!0,func:fluid.invokersMergePolicy},transformOptions:"replace",listeners:fluid.makeMergeListenersPolicy(fluid.mergeListenerPolicy)},fluid.defaults("fluid.component",{initFunction:"fluid.initLittleComponent",mergePolicy:fluid.rootMergePolicy,argumentMap:{options:0},events:{onCreate:null,onDestroy:null,afterDestroy:null}}),fluid.defaults("fluid.emptySubcomponent",{gradeNames:["fluid.component"]}),fluid.computeNickName=function(typeName){var segs=fluid.model.parseEL(typeName);return segs[segs.length-1]},fluid.defaults("fluid.typeFount",{gradeNames:["fluid.component"]}),fluid.initLittleComponent=function(name,userOptions,localOptions,receiver){var that=fluid.typeTag(name);that.lifecycleStatus="constructing",localOptions=localOptions||{gradeNames:"fluid.component"},that.destroy=fluid.makeRootDestroy(that);var mergeOptions=fluid.mergeComponentOptions(that,name,userOptions,localOptions);mergeOptions.exceptions={members:{model:!0,modelRelay:!0}};var options=that.options;that.events={},(receiver||fluid.identity)(that,options,mergeOptions.strategy),fluid.computeDynamicComponents(that,mergeOptions);for(var i=0;i<mergeOptions.mergeBlocks.length;++i)mergeOptions.mergeBlocks[i].initter();return mergeOptions.initter(),delete options.mergePolicy,fluid.instantiateFirers(that,options),fluid.mergeListeners(that,that.events,options.listeners),that},fluid.diagnoseFailedView=fluid.identity,fluid.makeRootDestroy=function(that){return function(){fluid.doDestroy(that),fluid.fireEvent(that,"afterDestroy",[that,"",null])}},fluid.isDestroyed=function(that){return"destroyed"===that.lifecycleStatus},fluid.doDestroy=function(that,name,parent){for(var key in fluid.fireEvent(that,"onDestroy",[that,name||"",parent]),that.lifecycleStatus="destroyed",that.events)"afterDestroy"!==key&&"function"==typeof that.events[key].destroy&&that.events[key].destroy();that.applier&&that.applier.destroy()},fluid.initComponent=function(componentName,initArgs){var options=fluid.defaults(componentName);options.gradeNames||fluid.fail("Cannot initialise component "+componentName+" which has no gradeName registered");var that,args=[componentName].concat(fluid.makeArray(initArgs));fluid.pushActivity("initComponent","constructing component of type %componentName with arguments %initArgs",{componentName:componentName,initArgs:initArgs}),that=fluid.invokeGlobalFunction(options.initFunction,args),fluid.diagnoseFailedView(componentName,that,options,args),fluid.initDependents&&fluid.initDependents(that);var errors=fluid.validateListenersImplemented(that);return 0<errors.length&&fluid.fail(fluid.transform(errors,function(error){return["Error constructing component ",that," - the listener for event "+error.name+" with namespace "+error.namespace+(error.componentSource?" which was defined in grade "+error.componentSource:"")+" needs to be overridden with a concrete implementation"]})).join("\n"),"constructing"===that.lifecycleStatus&&(that.lifecycleStatus="constructed"),that.events.onCreate.fire(that),fluid.popActivity(),that},fluid.initSubcomponentImpl=function(that,entry,args){var togo;if("function"!=typeof entry){var entryType="string"==typeof entry?entry:entry.type;togo="fluid.emptySubcomponent"===entryType?null:fluid.invokeGlobalFunction(entryType,args)}else togo=entry.apply(null,args);return togo};fluid.simpleCSSMatcher={regexp:new RegExp("([#.]?)((?:[\\w\\u00c0-\\uFFFF*_-]|\\\\.)+)","g"),charToTag:{"":"tag","#":"id",".":"clazz"}},fluid.IoCSSMatcher={regexp:new RegExp("([&#]?)((?:[\\w\\u00c0-\\uFFFF*_-]|\\.|\\/)+)","g"),charToTag:{"":"context","&":"context","#":"id"}};var childSeg=new RegExp("\\s*(>)?\\s*","g");fluid.parseSelector=function(selstring,strategy){var togo=[];selstring=selstring.trim();for(var regexp=strategy.regexp,lastIndex=regexp.lastIndex=0;;){for(var atNode=[],first=!0;;){var segMatch=regexp.exec(selstring);if(!segMatch)break;if(segMatch.index!==lastIndex){if(!first)break;fluid.fail("Error in selector string - cannot match child selector expression starting at "+selstring.substring(lastIndex))}var thisNode={},text=segMatch[2],targetTag=strategy.charToTag[segMatch[1]];targetTag&&(thisNode[targetTag]=text),atNode[atNode.length]=thisNode,lastIndex=regexp.lastIndex,first=!1}childSeg.lastIndex=lastIndex;var fullAtNode={predList:atNode},childMatch=childSeg.exec(selstring);if(childMatch&&childMatch.index===lastIndex||fluid.fail("Error in selector string - can not match child selector expression at "+selstring.substring(lastIndex)),">"===childMatch[1]&&(fullAtNode.child=!0),togo[togo.length]=fullAtNode,childSeg.lastIndex>=selstring.length)break;lastIndex=childSeg.lastIndex,regexp.lastIndex=childSeg.lastIndex}return togo},fluid.flattenObjectPaths=function(originalObject){var flattenedObject={};return fluid.each(originalObject,function(value,key){if(null!==value&&"object"==typeof value){var flattenedSubObject=fluid.flattenObjectPaths(value);fluid.each(flattenedSubObject,function(subValue,subKey){flattenedObject[key+"."+subKey]=subValue}),"function"==typeof fluid.get(value,"toString")&&(flattenedObject[key]=value.toString())}else flattenedObject[key]=value}),flattenedObject},fluid.stringTemplate=function(template,values){var flattenedValues=fluid.flattenObjectPaths(values),keys=fluid.keys(flattenedValues);keys=keys.sort(fluid.compareStringLength());for(var i=0;i<keys.length;++i)for(var key=keys[i],templatePlaceholder="%"+key,replacementValue=flattenedValues[key],indexOfPlaceHolder=-1;-1!==(indexOfPlaceHolder=template.indexOf(templatePlaceholder));)template=template.slice(0,indexOfPlaceHolder)+replacementValue+template.slice(indexOfPlaceHolder+templatePlaceholder.length);return template}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.promise=function(){var that={onResolve:[],onReject:[],then:function(onResolve,onReject){return onResolve&&("resolve"===that.disposition?onResolve(that.value):that.onResolve.push(onResolve)),onReject&&("reject"===that.disposition?onReject(that.value):that.onReject.push(onReject)),that},resolve:function(value){return that.disposition?fluid.fail("Error: resolving promise ",that,' which has already received "'+that.disposition+'"'):that.complete("resolve",that.onResolve,value),that},reject:function(reason){return that.disposition?fluid.fail("Error: rejecting promise ",that,'which has already received "'+that.disposition+'"'):that.complete("reject",that.onReject,reason),that},complete:function(which,queue,arg){that.disposition=which,that.value=arg;for(var i=0;i<queue.length;++i)queue[i](arg)}};return that},fluid.isPromise=function(totest){return totest&&"function"==typeof totest.then},fluid.toPromise=function(promiseOrValue){if(fluid.isPromise(promiseOrValue))return promiseOrValue;var togo=fluid.promise();return togo.resolve(promiseOrValue),togo},fluid.promise.follow=function(source,target){source.then(target.resolve,target.reject)},fluid.promise.map=function(source,func){var promise=fluid.toPromise(source),togo=fluid.promise();return promise.then(function(value){var mapped=func(value);fluid.isPromise(mapped)?fluid.promise.follow(mapped,togo):togo.resolve(mapped)},function(error){togo.reject(error)}),togo},fluid.promise.makeSequencer=function(sources,options,strategy){return fluid.isArrayable(sources)||fluid.fail("fluid.promise sequence algorithms must be supplied an array as source"),{sources:sources,resolvedSources:[],index:0,strategy:strategy,options:options,returns:[],promise:fluid.promise()}},fluid.promise.progressSequence=function(that,retValue){that.returns.push(retValue),that.index++,fluid.promise.resumeSequence(that)},fluid.promise.processSequenceReject=function(that,error){for(var i=that.index-1;0<=i;--i){var resolved=that.resolvedSources[i];error=(fluid.isPromise(resolved)&&"function"==typeof resolved.accumulateRejectionReason?resolved.accumulateRejectionReason:fluid.identity)(error)}that.promise.reject(error)},fluid.promise.resumeSequence=function(that){if(that.index===that.sources.length)that.promise.resolve(that.strategy.resolveResult(that));else{var value=that.strategy.invokeNext(that);that.resolvedSources[that.index]=value,fluid.isPromise(value)?value.then(function(retValue){fluid.promise.progressSequence(that,retValue)},function(error){fluid.promise.processSequenceReject(that,error)}):fluid.promise.progressSequence(that,value)}},fluid.promise.makeSequenceStrategy=function(){return{invokeNext:function(that){var source=that.sources[that.index];return"function"==typeof source?source(that.options):source},resolveResult:function(that){return that.returns}}},fluid.promise.sequence=function(sources,options){var sequencer=fluid.promise.makeSequencer(sources,options,fluid.promise.makeSequenceStrategy());return fluid.promise.resumeSequence(sequencer),sequencer.promise},fluid.promise.makeTransformerStrategy=function(){return{invokeNext:function(that){var lisrec=that.sources[that.index];return lisrec.listener=fluid.event.resolveListener(lisrec.listener),lisrec.listener.apply(null,[that.returns[that.index],that.options])},resolveResult:function(that){return that.returns[that.index]}}},fluid.promise.makeTransformer=function(listeners,payload,options){listeners.unshift({listener:function(){return payload}});var sequencer=fluid.promise.makeSequencer(listeners,options,fluid.promise.makeTransformerStrategy());return sequencer.returns.push(null),fluid.promise.resumeSequence(sequencer),sequencer},fluid.promise.filterNamespaces=function(listeners,namespaces){return namespaces?fluid.remove_if(fluid.makeArray(listeners),function(element){return element.namespace&&!element.softNamespace&&!fluid.contains(namespaces,element.namespace)}):listeners},fluid.promise.fireTransformEvent=function(event,payload,options){var listeners=(options=options||{}).reverse?fluid.makeArray(event.sortedListeners).reverse():fluid.makeArray(event.sortedListeners);return listeners=fluid.promise.filterNamespaces(listeners,options.filterNamespaces),fluid.promise.makeTransformer(listeners,payload,options).promise}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.dataSource.encoding.JSON",{gradeNames:"fluid.component",invokers:{parse:"fluid.dataSource.parseJSON",render:"fluid.dataSource.stringifyJSON"},contentType:"application/json"}),fluid.defaults("fluid.dataSource.encoding.none",{gradeNames:"fluid.component",invokers:{parse:"fluid.identity",render:"fluid.identity"},contentType:"text/plain"}),fluid.dataSource.parseJSON=function(string){var togo=fluid.promise();if(string)try{togo.resolve(JSON.parse(string))}catch(err){togo.reject({message:err})}else togo.resolve(void 0);return togo},fluid.dataSource.stringifyJSON=function(obj){return void 0===obj?"":JSON.stringify(obj,null,4)},fluid.defaults("fluid.dataSource",{gradeNames:["fluid.component"],events:{onRead:null,onError:null},components:{encoding:{type:"fluid.dataSource.encoding.JSON"}},listeners:{"onRead.impl":{func:"fluid.notImplemented",priority:"first"},"onRead.encoding":{func:"{encoding}.parse",priority:"after:impl"}},invokers:{get:{funcName:"fluid.dataSource.get",args:["{that}","{arguments}.0","{arguments}.1"]}}}),fluid.defaults("fluid.dataSource.writable",{gradeNames:["fluid.component"],events:{onWrite:null,onWriteResponse:null},listeners:{"onWrite.encoding":{func:"{encoding}.render"},"onWrite.impl":{func:"fluid.notImplemented",priority:"after:encoding"},"onWriteResponse.encoding":{func:"{encoding}.parse"}},invokers:{set:{funcName:"fluid.dataSource.set",args:["{that}","{arguments}.0","{arguments}.1","{arguments}.2"]}}}),fluid.dataSource.registerStandardPromiseHandlers=function(that,promise,options){promise.then("function"==typeof options?options:null,options.onError?options.onError:that.events.onError.fire)},fluid.dataSource.defaultiseOptions=function(componentOptions,options,directModel,isSet){return(options=options||{}).directModel=directModel,options.operation=isSet?"set":"get",options.notFoundIsEmpty=options.notFoundIsEmpty||componentOptions.notFoundIsEmpty,options},fluid.dataSource.get=function(that,directModel,options){options=fluid.dataSource.defaultiseOptions(that.options,options,directModel);var promise=fluid.promise.fireTransformEvent(that.events.onRead,void 0,options);return fluid.dataSource.registerStandardPromiseHandlers(that,promise,options),promise},fluid.dataSource.set=function(that,directModel,model,options){options=fluid.dataSource.defaultiseOptions(that.options,options,directModel,!0);var transformPromise=fluid.promise.fireTransformEvent(that.events.onWrite,model,options),togo=fluid.promise();return transformPromise.then(function(setResponse){var options2=fluid.dataSource.defaultiseOptions(that.options,fluid.copy(options),directModel),retransformed=fluid.promise.fireTransformEvent(that.events.onWriteResponse,setResponse,options2);fluid.promise.follow(retransformed,togo)},function(error){togo.reject(error)}),fluid.dataSource.registerStandardPromiseHandlers(that,togo,options),togo}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";var matched,browser;fluid.uaMatch=function(ua){ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"}},$.browser||(navigator.userAgent.match(/Trident\/7\./)?browser={msie:!0,version:11}:(browser={},(matched=fluid.uaMatch(navigator.userAgent)).browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0)),$.browser=browser);fluid.getScopedData=function(target,key){var data=$(target).data("fluid-scoped-data");return data?data[key]:void 0},fluid.setScopedData=function(target,key,value){$(target).each(function(){var data=$.data(this,"fluid-scoped-data")||{};data[key]=value,$.data(this,"fluid-scoped-data",data)})};var lastFocusedElement=null;$(document).on("focusin",function(event){lastFocusedElement=event.target}),fluid.getLastFocusedElement=function(){return lastFocusedElement};fluid.enabled=function(target,state){if(target=$(target),void 0===state)return!1!==fluid.getScopedData(target,"enablement");$("*",target).add(target).each(function(){void 0!==fluid.getScopedData(this,"enablement")?fluid.setScopedData(this,"enablement",state):/select|textarea|input/i.test(this.nodeName)&&$(this).prop("disabled",!state)}),fluid.setScopedData(target,"enablement",state)},fluid.initEnablement=function(target){fluid.setScopedData(target,"enablement",!0)},fluid.resolveEventTarget=function(event){for(;event.originalEvent&&event.originalEvent.target;)event=event.originalEvent;return event.target},$.each(["focus","blur"],function(i,name){fluid[name]=function(elem){return func=name,(node=$(node=elem)).trigger("fluid-"+func),node.triggerHandler(func),node[func](),node;var node,func}}),fluid.changeElementValue=function(node,value){(node=$(node)).val(value).change()}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.dom=fluid.dom||{};var getNextNode=function(iterator){if(iterator.node.firstChild)return iterator.node=iterator.node.firstChild,iterator.depth+=1,iterator;for(;iterator.node;){if(iterator.node.nextSibling)return iterator.node=iterator.node.nextSibling,iterator;iterator.node=iterator.node.parentNode,iterator.depth-=1}return iterator};fluid.dom.iterateDom=function(node,acceptor,allNodes){for(var condition,currentNode={node:node,depth:0},prevNode=node;null!==currentNode.node&&0<=currentNode.depth&¤tNode.depth<fluid.dom.iterateDom.DOM_BAIL_DEPTH;){if(condition=null,(1===currentNode.node.nodeType||allNodes)&&(condition=acceptor(currentNode.node,currentNode.depth)),condition)if("delete"===condition)currentNode.node.parentNode.removeChild(currentNode.node),currentNode.node=prevNode;else if("stop"===condition)return currentNode.node;prevNode=currentNode.node,currentNode=getNextNode(currentNode)}},fluid.dom.iterateDom.DOM_BAIL_DEPTH=256,fluid.dom.isContainer=function(container,containee){for(;containee;containee=containee.parentNode)if(container===containee)return!0;return!1},fluid.dom.getElementText=function(element){for(var nodes=element.childNodes,text="",i=0;i<nodes.length;++i){var child=nodes[i];3===child.nodeType&&(text+=child.nodeValue)}return text}}(jQuery,fluid_3_0_0),fluid_3_0_0=fluid_3_0_0||{},function($,fluid){"use strict";var unUnicode=/(\\u[\dabcdef]{4}|\\x[\dabcdef]{2})/g;fluid.unescapeProperties=function(string){string=string.replace(unUnicode,function(match){var code=match.substring(2),parsed=parseInt(code,16);return String.fromCharCode(parsed)});for(var pos=0;;){var backpos=string.indexOf("\\",pos);if(-1===backpos)break;if(backpos===string.length-1)return[string.substring(0,string.length-1),!0];var replace=string.charAt(backpos+1);"n"===replace&&(replace="\n"),"r"===replace&&(replace="\r"),"t"===replace&&(replace="\t"),string=string.substring(0,backpos)+replace+string.substring(backpos+2),pos=backpos+1}return[string,!1]};var breakPos=/[^\\][\s:=]/;fluid.parseJavaProperties=function(text){for(var contin,key,valueComp,valueRaw,valueEsc,togo={},lines=(text=(text=text.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).split("\n"),i=0;i<lines.length;++i){var line=$.trim(lines[i]);if(line&&"#"!==line.charAt(0)&&"!"!==line.charAt(0)){if(contin)valueEsc=fluid.unescapeProperties(line);else{valueComp="";var breakpos=line.search(breakPos);-1===breakpos?(key=line,valueRaw=""):(key=$.trim(line.substring(0,breakpos+1)),":"!==(valueRaw=$.trim(line.substring(breakpos+2))).charAt(0)&&"="!==valueRaw.charAt(0)||(valueRaw=$.trim(valueRaw.substring(1)))),key=fluid.unescapeProperties(key)[0],valueEsc=fluid.unescapeProperties(valueRaw)}contin=valueEsc[1],valueEsc[1]?valueComp+=valueEsc[0]:togo[key]=valueComp+valueEsc[0]}}return togo},fluid.formatMessage=function(messageString,args){if(!args)return messageString;"string"==typeof args&&(args=[args]);for(var i=0;i<args.length;++i)messageString=messageString.replace("{"+i+"}",args[i]);return messageString}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.renderTimestamp=function(date){var zeropad=function(num,width){width||(width=2);var numstr=void 0===num?"":num.toString();return"00000".substring(5-width+numstr.length)+numstr};return zeropad(date.getHours())+":"+zeropad(date.getMinutes())+":"+zeropad(date.getSeconds())+"."+zeropad(date.getMilliseconds(),3)},fluid.isTracing=!1,fluid.registerNamespace("fluid.tracing"),fluid.tracing.pathCount=[],fluid.tracing.summarisePathCount=function(pathCount){pathCount=pathCount||fluid.tracing.pathCount;for(var togo={},i=0;i<pathCount.length;++i){var path=pathCount[i];togo[path]?++togo[path]:togo[path]=1}var toReallyGo=[];return fluid.each(togo,function(el,path){toReallyGo.push({path:path,count:el})}),toReallyGo.sort(function(a,b){return b.count-a.count}),toReallyGo},fluid.tracing.condensePathCount=function(prefixes,pathCount){prefixes=fluid.makeArray(prefixes);var prefixCount={};fluid.each(prefixes,function(prefix){prefixCount[prefix]=0});var togo=[];return fluid.each(pathCount,function(el){var path=el.path;fluid.find(prefixes,function(prefix){if(0===path.indexOf(prefix))return prefixCount[prefix]+=el.count,!0})||togo.push(el)}),fluid.each(prefixCount,function(count,path){togo.unshift({path:path,count:count})}),togo},fluid.detectStackStyle=function(e){var style="other",stackStyle={offset:0};return e.arguments?style="chrome":"undefined"!=typeof window&&window.opera&&e.stacktrace?style="opera10":e.stack?(style="firefox",stackStyle.offset=-1===e.stack.indexOf("Trace exception")?1:0):"undefined"==typeof window||!window.opera||"stacktrace"in e||(style="opera"),stackStyle.style=style,stackStyle},fluid.obtainException=function(){try{throw new Error("Trace exception")}catch(e){return e}};var stackStyle=fluid.detectStackStyle(fluid.obtainException());fluid.registerNamespace("fluid.exceptionDecoders"),fluid.decodeStack=function(){if("firefox"!==stackStyle.style)return null;var e=fluid.obtainException();return fluid.exceptionDecoders[stackStyle.style](e)},fluid.exceptionDecoders.firefox=function(e){var lines=e.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^\(/gm,"{anonymous}(").split("\n");return fluid.transform(lines,function(line){var atind=(line=line.replace(/\)/g,"")).indexOf("at ");return-1===atind?[line]:[line.substring(atind+"at ".length),line.substring(0,atind)]})},fluid.getCallerInfo=function(atDepth){atDepth=(atDepth||3)-stackStyle.offset;var stack=fluid.decodeStack(),element=stack&&stack[atDepth]&&stack[atDepth][0];if(element){var lastslash=element.lastIndexOf("/");-1===lastslash&&(lastslash=0);var nextColon=element.indexOf(":",lastslash);return{path:element.substring(0,lastslash),filename:element.substring(lastslash+1,nextColon),index:element.substring(nextColon+1)}}return null},fluid.generatePadding=function(c,count){for(var togo="",i=0;i<count;++i)togo+=c;return togo},fluid.SYNTHETIC_PROPERTY=Object.freeze({}),fluid.getSafeProperty=function(obj,key){var desc=Object.getOwnPropertyDescriptor(obj,key);return desc&&!desc.get?obj[key]:fluid.SYNTHETIC_PROPERTY},fluid.prettyPrintJSON=function(obj,options){return(options=$.extend({indent:4,stack:[],output:""},options)).indentChars=fluid.generatePadding(" ",options.indent),function printImpl(obj,small,options){function out(str){options.output+=str}var big=small+options.indentChars,isFunction="function"==typeof obj;if(void 0!==options.maxRenderChars&&options.output.length>options.maxRenderChars)return!0;if(null===obj)out("null");else if(void 0===obj)out("undefined");else if(obj===fluid.SYNTHETIC_PROPERTY)out("[Synthetic property]");else if(fluid.isPrimitive(obj)&&!isFunction)out(JSON.stringify(obj));else{if(-1!==options.stack.indexOf(obj))return void out("(CIRCULAR)");var i;if(options.stack.push(obj),fluid.isArrayable(obj))if(0===obj.length)out("[]");else{for(out("[\n"+big),i=0;i<obj.length;++i){if(printImpl(obj[i],big,options))return!0;i!==obj.length-1&&out(",\n"+big)}out("\n"+small+"]")}else{out("{"+(isFunction?" Function":"")+"\n"+big);var keys=fluid.keys(obj);for(i=0;i<keys.length;++i){var key=keys[i],value=fluid.getSafeProperty(obj,key);if(out(JSON.stringify(key)+": "),printImpl(value,big,options))return!0;i!==keys.length-1&&out(",\n"+big)}out("\n"+small+"}")}options.stack.pop()}}(obj,"",options),options.output},fluid.dumpEl=function(element){var togo;if(!element)return"null";if(3===element.nodeType||8===element.nodeType)return"[data: "+element.data+"]";if(9===element.nodeType)return"[document: location "+element.location+"]";if(element.nodeType||!fluid.isArrayable(element))return togo=(element=$(element)).get(0).tagName,element.id&&(togo+="#"+element.id),element.attr("class")&&(togo+="."+element.attr("class")),togo;togo="[";for(var i=0;i<element.length;++i)togo+=fluid.dumpEl(element[i]),i<element.length-1&&(togo+=", ");return togo+"]"}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.visitComponentChildren=function(that,visitor,options,segs){for(var name in segs=segs||[],that){var component=that[name];if(!(!fluid.isComponent(component)||options.visited&&options.visited[component.id])){if(segs.push(name),options.visited&&(options.visited[component.id]=!0),visitor(component,name,segs,segs.length-1))return!0;options.flat||fluid.visitComponentChildren(component,visitor,options,segs),segs.pop()}}},fluid.getContextHash=function(instantiator,that){var shadow=instantiator.idToShadow[that.id];return shadow&&shadow.contextHash},fluid.componentHasGrade=function(that,gradeName){var contextHash=fluid.getContextHash(fluid.globalInstantiator,that);return!(!contextHash||!contextHash[gradeName])},fluid.visitComponentsForMatching=function(that,options,visitor){var instantiator=fluid.getInstantiator(that);options=$.extend({visited:{},instantiator:instantiator},options);var thatStack=[that],contextHashes=[fluid.getContextHash(instantiator,that)];fluid.visitComponentChildren(that,function(component,name,segs){thatStack.length=1,contextHashes.length=1;for(var i=0;i<segs.length;++i){var child=thatStack[i][segs[i]];thatStack[i+1]=child,contextHashes[i+1]=fluid.getContextHash(instantiator,child)||{}}return visitor(component,thatStack,contextHashes,segs,segs.length)},options,[])},fluid.getMemberNames=function(instantiator,thatStack){if(0===thatStack.length)return[];var path=instantiator.idToPath(thatStack[thatStack.length-1].id),segs=instantiator.parseEL(path);return segs.unshift.apply(segs,fluid.generate(thatStack.length-segs.length,"")),segs},fluid.visitComponentsForVisibility=function(instantiator,thatStack,visitor,options){options=options||{visited:{},flat:!0,instantiator:instantiator};for(var memberNames=fluid.getMemberNames(instantiator,thatStack),i=thatStack.length-1;0<=i;--i){var that=thatStack[i];if(options.visited[that.id]=!0,visitor(that,memberNames[i],memberNames,i))return;if(fluid.visitComponentChildren(that,visitor,options,memberNames))return;memberNames.pop()}},fluid.mountStrategy=function(prefix,root,toMount){var offset=prefix.length;return function(target,name,i,segs){if(!(i<=prefix.length)){for(var j=0;j<prefix.length;++j)if(segs[j]!==prefix[j])return;return toMount(target,name,i-prefix.length,segs.slice(offset))}}},fluid.invokerFromRecord=function(invokerec,name,that){fluid.pushActivity("makeInvoker","beginning instantiation of invoker with name %name and record %record as child of %that",{name:name,record:invokerec,that:that});var invoker=invokerec?fluid.makeInvoker(that,invokerec,name):void 0;return fluid.popActivity(),invoker},fluid.memberFromRecord=function(memberrecs,name,that){for(var togo,i=0;i<memberrecs.length;++i){var expanded=fluid.expandImmediate(memberrecs[i],that);togo=fluid.isPlainObject(togo)?$.extend(!0,togo,expanded):expanded}return togo},fluid.recordStrategy=function(that,options,optionsStrategy,recordPath,recordMaker,prefix,exceptions){return prefix=prefix||[],{strategy:function(target,name,i){if(1===i){var record=fluid.driveStrategy(options,[recordPath,name],optionsStrategy);if(void 0!==record){fluid.set(target,[name],fluid.inEvaluationMarker);var member=recordMaker(record,name,that);return fluid.set(target,[name],member),member}}},initter:function(){var records=fluid.driveStrategy(options,recordPath,optionsStrategy)||{};for(var name in records)exceptions&&exceptions[name]||fluid.getForComponent(that,prefix.concat([name]))}}},fluid.instantiateFirers=function(that){var shadow=fluid.shadowForComponent(that);(fluid.get(shadow,["eventStrategyBlock","initter"])||fluid.identity)()},fluid.makeDistributionRecord=function(contextThat,sourceRecord,sourcePath,targetSegs,exclusions,sourceType){sourceType=sourceType||"distribution",fluid.pushActivity("makeDistributionRecord","Making distribution record from source record %sourceRecord path %sourcePath to target path %targetSegs",{sourceRecord:sourceRecord,sourcePath:sourcePath,targetSegs:targetSegs});var source=fluid.copy(fluid.get(sourceRecord,sourcePath));fluid.each(exclusions,function(exclusion){fluid.model.applyChangeRequest(source,{segs:exclusion,type:"DELETE"})});var record={options:{}};return fluid.model.applyChangeRequest(record,{segs:targetSegs,type:"ADD",value:source}),fluid.checkComponentRecord(record),fluid.popActivity(),$.extend(record,{contextThat:contextThat,recordType:sourceType})},fluid.filterBlocks=function(contextThat,sourceBlocks,sourceSegs,targetSegs,exclusions,removeSource){var togo=[];return fluid.each(sourceBlocks,function(block){var source=fluid.get(block.source,sourceSegs);if(void 0!==source){togo.push(fluid.makeDistributionRecord(contextThat,block.source,sourceSegs,targetSegs,exclusions,block.recordType));var rescued=$.extend({},source);removeSource&&fluid.model.applyChangeRequest(block.source,{segs:sourceSegs,type:"DELETE"}),fluid.each(exclusions,function(exclusion){var orig=fluid.get(rescued,exclusion);fluid.set(block.source,sourceSegs.concat(exclusion),orig)})}}),togo},fluid.noteCollectedDistribution=function(parentShadow,memberName,distribution){fluid.model.setSimple(parentShadow,["collectedDistributions",memberName,distribution.id],!0)},fluid.isCollectedDistribution=function(parentShadow,memberName,distribution){return fluid.model.getSimple(parentShadow,["collectedDistributions",memberName,distribution.id])},fluid.clearCollectedDistributions=function(parentShadow,memberName){fluid.model.applyChangeRequest(parentShadow,{segs:["collectedDistributions",memberName],type:"DELETE"})},fluid.collectDistributions=function(distributedBlocks,parentShadow,distribution,thatStack,contextHashes,memberNames,i){var lastMember=memberNames[memberNames.length-1];!fluid.isCollectedDistribution(parentShadow,lastMember,distribution)&&fluid.matchIoCSelector(distribution.selector,thatStack,contextHashes,memberNames,i)&&(distributedBlocks.push.apply(distributedBlocks,distribution.blocks),fluid.noteCollectedDistribution(parentShadow,lastMember,distribution))},fluid.registerCollectedClearer=function(shadow,parentShadow,memberName){!shadow.collectedClearer&&parentShadow&&(shadow.collectedClearer=function(){fluid.clearCollectedDistributions(parentShadow,memberName)})},fluid.receiveDistributions=function(parentThat,gradeNames,memberName,that){var instantiator=fluid.getInstantiator(parentThat||that),thatStack=instantiator.getThatStack(parentThat||that);thatStack.unshift(fluid.rootComponent);var memberNames=fluid.getMemberNames(instantiator,thatStack),shadows=fluid.transform(thatStack,function(thisThat){return instantiator.idToShadow[thisThat.id]}),parentShadow=shadows[shadows.length-(parentThat?1:2)],contextHashes=fluid.getMembers(shadows,"contextHash");parentThat?(memberNames.push(memberName),contextHashes.push(fluid.gradeNamesToHash(gradeNames)),thatStack.push(that)):fluid.registerCollectedClearer(shadows[shadows.length-1],parentShadow,memberNames[memberNames.length-1]);for(var distributedBlocks=[],i=0;i<thatStack.length-1;++i)fluid.each(shadows[i].distributions,function(distribution){fluid.collectDistributions(distributedBlocks,parentShadow,distribution,thatStack,contextHashes,memberNames,i)});return distributedBlocks},fluid.computeTreeDistance=function(path1,path2){for(var i=0;i<path1.length&&i<path2.length&&path1[i]===path2[i];)++i;return path1.length+path2.length-2*i},fluid.computeDistributionPriority=function(targetThat,distributedBlock){if(!distributedBlock.priority){var instantiator=fluid.getInstantiator(targetThat),targetStack=instantiator.getThatStack(targetThat),targetPath=fluid.getMemberNames(instantiator,targetStack),sourceStack=instantiator.getThatStack(distributedBlock.contextThat),sourcePath=fluid.getMemberNames(instantiator,sourceStack),distance=fluid.computeTreeDistance(targetPath,sourcePath);distributedBlock.priority=fluid.mergeRecordTypes.distribution-distance}return distributedBlock},fluid.applyDistributions=function(that,preBlocks,targetShadow){var distributedBlocks=fluid.transform(preBlocks,function(preBlock){return fluid.generateExpandBlock(preBlock,that,targetShadow.mergePolicy)},function(distributedBlock){return fluid.computeDistributionPriority(that,distributedBlock)}),mergeOptions=targetShadow.mergeOptions;return mergeOptions.mergeBlocks.push.apply(mergeOptions.mergeBlocks,distributedBlocks),mergeOptions.updateBlocks(),distributedBlocks},fluid.matchIoCSelector=function(selector,thatStack,contextHashes,memberNames,i){for(var thatpos=thatStack.length-1,selpos=selector.length-1;;){for(var isChild=selector[selpos].child,mustMatchHere=thatpos===thatStack.length-1||isChild,that=thatStack[thatpos],selel=selector[selpos],match=!0,j=0;j<selel.predList.length;++j){var pred=selel.predList[j],context=pred.context;if(context&&"*"!==context&&!contextHashes[thatpos][context]&&memberNames[thatpos]!==context){match=!1;break}if(pred.id&&that.id!==pred.id){match=!1;break}}if(0===selpos&&i<thatpos&&mustMatchHere&&isChild&&(match=!1),match){if(0===selpos)return!0;--thatpos,--selpos}else{if(mustMatchHere)return!1;--thatpos}if(thatpos<i)return!1}},fluid.queryIoCSelector=function(root,selector,flat){var parsed=fluid.parseSelector(selector,fluid.IoCSSMatcher),togo=[];return fluid.visitComponentsForMatching(root,{flat:flat},function(that,thatStack,contextHashes){fluid.matchIoCSelector(parsed,thatStack,contextHashes,[],1)&&togo.push(that)}),togo},fluid.isIoCSSSelector=function(context){return-1!==context.indexOf(" ")},fluid.pushDistributions=function(targetHead,selector,target,blocks){var targetShadow=fluid.shadowForComponent(targetHead),id=fluid.allocateGuid(),distribution={id:id,target:target,selector:selector,blocks:blocks};return Object.freeze(distribution),Object.freeze(distribution.blocks),fluid.pushArray(targetShadow,"distributions",distribution),id},fluid.clearDistribution=function(targetHeadId,id){var targetHeadShadow=fluid.globalInstantiator.idToShadow[targetHeadId];targetHeadShadow&&fluid.remove_if(targetHeadShadow.distributions,function(distribution){return distribution.id===id})},fluid.clearDistributions=function(shadow){fluid.each(shadow.outDistributions,function(outDist){fluid.clearDistribution(outDist.targetHeadId,outDist.distributionId)})},fluid.extractSelectorHead=function(parsedSelector){var predList=parsedSelector[0].predList,context=predList[0].context;return predList.length=0,context},fluid.parseExpectedOptionsPath=function(path,role){var segs=fluid.model.parseEL(path);return"options"!==segs[0]&&fluid.fail("Error in options distribution path ",path," - only "+role+' paths beginning with "options" are supported'),segs.slice(1)},fluid.replicateProperty=function(source,property,targets){void 0!==source[property]&&fluid.each(targets,function(target){target[property]=source[property]})},fluid.undistributableOptions=["gradeNames","distributeOptions","argumentMap","initFunction","mergePolicy","progressiveCheckerOptions"],fluid.distributeOptions=function(that,optionsStrategy){var thatShadow=fluid.shadowForComponent(that),records=fluid.driveStrategy(that.options,"distributeOptions",optionsStrategy);fluid.each(records,function(record){fluid.pushActivity("distributeOptions","parsing distributeOptions block %record %that ",{that:that,record:record}),"string"!=typeof record.target&&fluid.fail("Error in options distribution record ",record,' a member named "target" must be supplied holding an IoC reference'),"string"==typeof record.source^void 0===record.record&&fluid.fail("Error in options distribution record ",record,': must supply either a member "source" holding an IoC reference or a member "record" holding a literal record');var targetHead,selector,context,targetRef=fluid.parseContextReference(record.target);if(fluid.isIoCSSSelector(targetRef.context)){selector=fluid.parseSelector(targetRef.context,fluid.IoCSSMatcher);var headContext=fluid.extractSelectorHead(selector);"/"===headContext?targetHead=fluid.rootComponent:context=headContext}else context=targetRef.context;(targetHead=targetHead||fluid.resolveContext(context,that))||fluid.fail("Error in options distribution record ",record," - could not resolve context {"+context+"} to a head component");var preBlocks,targetSegs=fluid.model.parseEL(targetRef.path);if(void 0!==record.record)preBlocks=[fluid.makeDistributionRecord(that,record.record,[],targetSegs,[])];else{var source=fluid.parseContextReference(record.source);"that"!==source.context&&fluid.fail("Error in options distribution record ",record," only a context of {that} is supported");var sourceSegs=fluid.parseExpectedOptionsPath(source.path,"source"),fullExclusions=fluid.makeArray(record.exclusions).concat(0===sourceSegs.length?fluid.undistributableOptions:[]),exclusions=fluid.transform(fullExclusions,function(exclusion){return fluid.model.parseEL(exclusion)});preBlocks=fluid.filterBlocks(that,thatShadow.mergeOptions.mergeBlocks,sourceSegs,targetSegs,exclusions,record.removeSource),thatShadow.mergeOptions.updateBlocks()}if(fluid.replicateProperty(record,"priority",preBlocks),fluid.replicateProperty(record,"namespace",preBlocks),selector){var distributionId=fluid.pushDistributions(targetHead,selector,record.target,preBlocks);thatShadow.outDistributions=thatShadow.outDistributions||[],thatShadow.outDistributions.push({targetHeadId:targetHead.id,distributionId:distributionId})}else{var targetShadow=fluid.shadowForComponent(targetHead);fluid.applyDistributions(that,preBlocks,targetShadow)}fluid.popActivity()})},fluid.gradeNamesToHash=function(gradeNames){var contextHash={};return fluid.each(gradeNames,function(gradeName){contextHash[gradeName]=!0,contextHash[fluid.computeNickName(gradeName)]=!0}),contextHash},fluid.cacheShadowGrades=function(that,shadow){var contextHash=fluid.gradeNamesToHash(that.options.gradeNames);contextHash[shadow.memberName]||(contextHash[shadow.memberName]="memberName"),shadow.contextHash=contextHash,fluid.each(contextHash,function(troo,context){shadow.ownScope[context]=that,shadow.parentShadow&&"fluid.rootComponent"!==shadow.parentShadow.that.type&&(shadow.parentShadow.childrenScope[context]=that)})},fluid.deliverOptionsStrategy=function(that,target,mergeOptions){var shadow=fluid.shadowForComponent(that,shadow);fluid.cacheShadowGrades(that,shadow),shadow.mergeOptions=mergeOptions},fluid.collectDistributedGrades=function(rec){var distributedBlocks=fluid.receiveDistributions(null,null,null,rec.that);if(0<distributedBlocks.length){var readyBlocks=fluid.applyDistributions(rec.that,distributedBlocks,rec.shadow),gradeNamesList=fluid.transform(fluid.getMembers(readyBlocks,["source","gradeNames"]),fluid.makeArray);fluid.accumulateDynamicGrades(rec,fluid.flatten(gradeNamesList))}},fluid.applyDynamicGrades=function(rec){rec.oldGradeNames=fluid.makeArray(rec.gradeNames);var newDefaults=fluid.copy(fluid.getMergedDefaults(rec.that.typeName,rec.gradeNames));rec.gradeNames.length=0,rec.gradeNames.push.apply(rec.gradeNames,newDefaults.gradeNames),fluid.each(rec.gradeNames,function(gradeName){fluid.isIoCReference(gradeName)||(rec.seenGrades[gradeName]=!0)});var shadow=rec.shadow;fluid.cacheShadowGrades(rec.that,shadow),shadow.mergeOptions.destroyValue(["mergePolicy"]),shadow.mergeOptions.destroyValue(["components"]),shadow.mergeOptions.destroyValue(["invokers"]),rec.defaultsBlock.source=newDefaults,shadow.mergeOptions.updateBlocks(),shadow.mergeOptions.computeMergePolicy(),fluid.accumulateDynamicGrades(rec,newDefaults.gradeNames)},fluid.accumulateDynamicGrades=function(rec,newGradeNames){fluid.each(newGradeNames,function(gradeName){rec.seenGrades[gradeName]||(fluid.isIoCReference(gradeName)?(rec.rawDynamic.push(gradeName),rec.seenGrades[gradeName]=!0):fluid.contains(rec.oldGradeNames,gradeName)||rec.plainDynamic.push(gradeName))})},fluid.computeDynamicGrades=function(that,shadow,strategy){delete that.options.gradeNames;var gradeNames=fluid.driveStrategy(that.options,"gradeNames",strategy);gradeNames.length=0;var rec={that:that,shadow:shadow,defaultsBlock:fluid.findMergeBlocks(shadow.mergeOptions.mergeBlocks,"defaults")[0],gradeNames:gradeNames,seenGrades:{},plainDynamic:[],rawDynamic:[]};for(fluid.each(shadow.mergeOptions.mergeBlocks,function(block){gradeNames.push.apply(gradeNames,fluid.makeArray(block.target&&block.target.gradeNames)),fluid.applyDynamicGrades(rec)}),fluid.collectDistributedGrades(rec);;){for(;0<rec.plainDynamic.length;)gradeNames.push.apply(gradeNames,rec.plainDynamic),rec.plainDynamic.length=0,fluid.applyDynamicGrades(rec),fluid.collectDistributedGrades(rec);if(!(0<rec.rawDynamic.length))break;var expanded=fluid.expandImmediate(rec.rawDynamic.shift(),that,shadow.localDynamic);"function"==typeof expanded&&(expanded=expanded()),expanded&&(rec.plainDynamic=rec.plainDynamic.concat(expanded))}shadow.collectedClearer&&(shadow.collectedClearer(),delete shadow.collectedClearer)},fluid.computeDynamicComponentKey=function(recordKey,sourceKey){return recordKey+(0===sourceKey?"":"-"+sourceKey)},fluid.hasDynamicComponentCount=function(shadow,key){var hypos=key.indexOf("-");if(-1!==hypos){var recordKey=key.substring(0,hypos);return void 0!==shadow.dynamicComponentCount&&void 0!==shadow.dynamicComponentCount[recordKey]}},fluid.clearDynamicParentRecord=function(shadow,key){if(fluid.hasDynamicComponentCount(shadow,key)){var holder=fluid.get(shadow.that,["options","components"]);holder&&delete holder[key]}},fluid.registerDynamicRecord=function(that,recordKey,sourceKey,record,toCensor){var key=fluid.computeDynamicComponentKey(recordKey,sourceKey),recordCopy=fluid.copy(record);return delete recordCopy[toCensor],fluid.set(that.options,["components",key],recordCopy),key},fluid.computeDynamicComponents=function(that,mergeOptions){var shadow=fluid.shadowForComponent(that),localSub=shadow.subcomponentLocal={},records=fluid.driveStrategy(that.options,"dynamicComponents",mergeOptions.strategy);fluid.each(records,function(record,recordKey){if(record.sources||record.createOnEvent||fluid.fail("Cannot process dynamicComponents record ",record,' without a "sources" or "createOnEvent" entry'),record.sources){var sources=fluid.expandOptions(record.sources,that);fluid.each(sources,function(source,sourceKey){var key=fluid.registerDynamicRecord(that,recordKey,sourceKey,record,"sources");localSub[key]={source:source,sourcePath:sourceKey}})}else if(record.createOnEvent){var event=fluid.event.expandOneEvent(that,record.createOnEvent);fluid.set(shadow,["dynamicComponentCount",recordKey],0);var listener=function(){var key=fluid.registerDynamicRecord(that,recordKey,shadow.dynamicComponentCount[recordKey]++,record,"createOnEvent"),localRecord={arguments:fluid.makeArray(arguments)};fluid.initDependent(that,key,localRecord)};event.addListener(listener),fluid.recordListener(event,listener,shadow)}})},fluid.computeComponentAccessor=function(that,localRecord){var instantiator=fluid.globalInstantiator,shadow=fluid.shadowForComponent(that);shadow.localDynamic=localRecord;var options=that.options,strategy=shadow.mergeOptions.strategy,optionsStrategy=fluid.mountStrategy(["options"],options,strategy);shadow.invokerStrategy=fluid.recordStrategy(that,options,strategy,"invokers",fluid.invokerFromRecord),shadow.eventStrategyBlock=fluid.recordStrategy(that,options,strategy,"events",fluid.eventFromRecord,["events"]);var eventStrategy=fluid.mountStrategy(["events"],that,shadow.eventStrategyBlock.strategy,["events"]);if(shadow.memberStrategy=fluid.recordStrategy(that,options,strategy,"members",fluid.memberFromRecord,null,{model:!0,modelRelay:!0}),shadow.getConfig={strategies:[fluid.model.funcResolverStrategy,fluid.makeGingerStrategy(that),optionsStrategy,shadow.invokerStrategy.strategy,shadow.memberStrategy.strategy,eventStrategy]},fluid.computeDynamicGrades(that,shadow,strategy,shadow.mergeOptions.mergeBlocks),fluid.distributeOptions(that,strategy),shadow.contextHash["fluid.resolveRoot"]){var memberName;if(shadow.contextHash["fluid.resolveRootSingle"]){var singleRootType=fluid.getForComponent(that,["options","singleRootType"]);singleRootType||fluid.fail("Cannot register object with grades "+Object.keys(shadow.contextHash).join(", ")+" as fluid.resolveRootSingle since it has not defined option singleRootType"),memberName=fluid.typeNameToMemberName(singleRootType)}else memberName=fluid.computeGlobalMemberName(that);var parent=fluid.resolveRootComponent;parent[memberName]&&instantiator.clearComponent(parent,memberName),instantiator.recordKnownComponent(parent,that,memberName,!1)}return shadow.getConfig},fluid.shadowForComponent=function(component){var instantiator=fluid.getInstantiator(component);return instantiator&&component?instantiator.idToShadow[component.id]:null},fluid.getForComponent=function(component,path){var shadow=fluid.shadowForComponent(component),getConfig=shadow?shadow.getConfig:void 0;return fluid.get(component,path,getConfig)},fluid.makeGingerStrategy=function(that){var instantiator=fluid.getInstantiator(that);return function(component,thisSeg,index,segs){var atval=component[thisSeg];if(atval===fluid.inEvaluationMarker&&index===segs.length&&fluid.fail('Error in component configuration - a circular reference was found during evaluation of path segment "'+thisSeg+'": for more details, see the activity records following this message in the console, or issue fluid.setLogging(fluid.logLevel.TRACE) when running your application'),1<index)return atval;if(void 0===atval&&component.hasOwnProperty(thisSeg))return fluid.NO_VALUE;if(void 0===atval){var parentPath=instantiator.idToShadow[component.id].path,childPath=instantiator.composePath(parentPath,thisSeg);atval=instantiator.pathToComponent[childPath]}if(void 0===atval){var subRecord=fluid.getForComponent(component,["options","components",thisSeg]);subRecord&&(subRecord.createOnEvent&&fluid.fail('Error resolving path segment "'+thisSeg+'" of path '+segs.join(".")+" since component with record ",subRecord,' has annotation "createOnEvent" - this very likely represents an implementation error. Either alter the reference so it does not match this component, or alter your workflow to ensure that the component is instantiated by the time this reference resolves'),fluid.initDependent(component,thisSeg),atval=component[thisSeg])}return atval}},fluid.frameworkGrades=["fluid.component","fluid.modelComponent","fluid.viewComponent","fluid.rendererComponent"],fluid.filterBuiltinGrades=function(gradeNames){return fluid.remove_if(fluid.makeArray(gradeNames),function(gradeName){return-1!==fluid.frameworkGrades.indexOf(gradeName)})},fluid.dumpGradeNames=function(that){return that.options&&that.options.gradeNames?" gradeNames: "+JSON.stringify(fluid.filterBuiltinGrades(that.options.gradeNames)):""},fluid.dumpThat=function(that){return'{ typeName: "'+that.typeName+'"'+fluid.dumpGradeNames(that)+" id: "+that.id+"}"},fluid.dumpThatStack=function(thatStack,instantiator){return fluid.transform(thatStack,function(that){var path=instantiator.idToPath(that.id);return fluid.dumpThat(that)+(path?" - path: "+path:"")}).join("\n")},fluid.dumpComponentPath=function(that){var path=fluid.pathForComponent(that);return path?fluid.pathUtil.composeSegments(path):"** no path registered for component **"},fluid.resolveContext=function(context,that,fast){if("that"===context)return that;if("object"==typeof context){var innerContext=fluid.resolveContext(context.context,that,fast);fluid.isComponent(innerContext)||fluid.triggerMismatchedPathError(context.context,that);var rawValue=fluid.getForComponent(innerContext,context.path),expanded=fluid.expandOptions(rawValue,that);return fluid.isComponent(expanded)||fluid.fail("Unable to resolve recursive context expression "+fluid.renderContextReference(context)+": the directly resolved value of "+rawValue+" did not resolve to a component in the scope of component ",that,": got ",expanded),expanded}var foundComponent,instantiator=fluid.globalInstantiator;if(fast)return instantiator.idToShadow[that.id].ownScope[context];var thatStack=instantiator.getFullStack(that);return fluid.visitComponentsForVisibility(instantiator,thatStack,function(component,name){var shadow=fluid.shadowForComponent(component);return context===name||shadow&&shadow.contextHash&&shadow.contextHash[context]||context===component.typeName?(foundComponent=component,!0):fluid.getForComponent(component,["options","components",context])&&!component[context]?(foundComponent=fluid.getForComponent(component,context),!0):void 0}),foundComponent},fluid.triggerMismatchedPathError=function(parsed,parentThat){var ref=fluid.renderContextReference(parsed);fluid.fail("Failed to resolve reference "+ref+" - could not match context with name "+parsed.context+" from component "+fluid.dumpThat(parentThat)+" at path "+fluid.dumpComponentPath(parentThat)+" component: ",parentThat)},fluid.makeStackFetcher=function(parentThat,localRecord,fast){return function(parsed){parentThat&&"destroyed"===parentThat.lifecycleStatus&&fluid.fail("Cannot resolve reference "+fluid.renderContextReference(parsed)+" from component "+fluid.dumpThat(parentThat)+" which has been destroyed");var context=parsed.context;if(localRecord&&context in localRecord)return fluid.get(localRecord[context],parsed.path);var foundComponent=fluid.resolveContext(context,parentThat,fast);return foundComponent||""===parsed.path||fluid.triggerMismatchedPathError(parsed,parentThat),fluid.getForComponent(foundComponent,parsed.path)}},fluid.makeStackResolverOptions=function(parentThat,localRecord,fast){return $.extend(fluid.copy(fluid.rawDefaults("fluid.makeExpandOptions")),{ELstyle:"{}",localRecord:localRecord||{},fetcher:fluid.makeStackFetcher(parentThat,localRecord,fast),contextThat:parentThat,exceptions:{members:{model:!0,modelRelay:!0}}})},fluid.clearListeners=function(shadow){fluid.each(shadow.listeners,function(rec){rec.event.removeListener(rec.listenerId||rec.listener)}),delete shadow.listeners},fluid.recordListener=function(event,listener,shadow,listenerId){event.ownerId!==shadow.that.id&&fluid.pushArray(shadow,"listeners",{event:event,listener:listener,listenerId:listenerId})},fluid.constructScopeObjects=function(instantiator,parent,child,childShadow){var parentShadow=parent?instantiator.idToShadow[parent.id]:null;childShadow.childrenScope=parentShadow?Object.create(parentShadow.ownScope):{},childShadow.ownScope=Object.create(childShadow.childrenScope),childShadow.parentShadow=parentShadow},fluid.clearChildrenScope=function(instantiator,parentShadow,child,childShadow){fluid.each(childShadow.contextHash,function(troo,context){parentShadow.childrenScope[context]===child&&delete parentShadow.childrenScope[context]})},fluid.instantiator=function(){var that=fluid.typeTag("instantiator");function recordComponent(parent,component,path,name,created){var shadow;if(created)(shadow=that.idToShadow[component.id]={}).that=component,shadow.path=path,shadow.memberName=name,fluid.constructScopeObjects(that,parent,component,shadow);else{(shadow=that.idToShadow[component.id]).injectedPaths=shadow.injectedPaths||{},shadow.injectedPaths[path]=!0;var parentShadow=that.idToShadow[parent.id],keys=fluid.keys(shadow.contextHash);fluid.remove_if(keys,function(key){return shadow.contextHash&&"memberName"===shadow.contextHash[key]}),keys.push(name),fluid.each(keys,function(context){parentShadow.childrenScope[context]||(parentShadow.childrenScope[context]=component)})}that.pathToComponent[path]&&fluid.fail("Error during instantiation - path "+path+" which has just created component "+fluid.dumpThat(component)+" has already been used for component "+fluid.dumpThat(that.pathToComponent[path])+" - this is a circular instantiation or other oversight. Please clear the component using instantiator.clearComponent() before reusing the path."),that.pathToComponent[path]=component}return $.extend(that,{lifecycleStatus:"constructed",pathToComponent:{},idToShadow:{},modelTransactions:{init:{}},composePath:fluid.model.composePath,composeSegments:fluid.model.composeSegments,parseEL:fluid.model.parseEL,events:{onComponentAttach:fluid.makeEventFirer({name:"instantiator's onComponentAttach event"}),onComponentClear:fluid.makeEventFirer({name:"instantiator's onComponentClear event"})}}),that.idToPath=function(id){var shadow=that.idToShadow[id];return shadow?shadow.path:""},that.getThatStack=function(component){var shadow=that.idToShadow[component.id];if(shadow){for(var path=shadow.path,parsed=that.parseEL(path),root=that.pathToComponent[""],togo=[],i=0;i<parsed.length;++i)root=root[parsed[i]],togo.push(root);return togo}return[]},that.getFullStack=function(component){var thatStack=component?that.getThatStack(component):[];return thatStack.unshift(fluid.resolveRootComponent),thatStack},that.recordRoot=function(component){recordComponent(null,component,"","",!0)},that.recordKnownComponent=function(parent,component,name,created){if(parent[name]=component,fluid.isComponent(component)||"instantiator"===component.type){var parentPath=that.idToShadow[parent.id].path,path=that.composePath(parentPath,name);recordComponent(parent,component,path,name,created),that.events.onComponentAttach.fire(component,path,that,created)}else fluid.fail("Cannot record non-component with value ",component,' at path "'+name+'" of parent ',parent)},that.clearConcreteComponent=function(destroyRec){fluid.each(destroyRec.childShadow.injectedPaths,function(troo,injectedPath){var parentPath=fluid.model.getToTailPath(injectedPath),otherParent=that.pathToComponent[parentPath];that.clearComponent(otherParent,fluid.model.getTailPath(injectedPath),destroyRec.child)}),fluid.clearDistributions(destroyRec.childShadow),fluid.clearListeners(destroyRec.childShadow),fluid.clearDynamicParentRecord(destroyRec.shadow,destroyRec.name),fluid.fireEvent(destroyRec.child,"afterDestroy",[destroyRec.child,destroyRec.name,destroyRec.component]),delete that.idToShadow[destroyRec.child.id]},that.clearComponent=function(component,name,child,options,nested,path){var shadow=that.idToShadow[component.id];options=options||{flat:!0,instantiator:that,destroyRecs:[]},child=child||component[name],void 0===(path=path||shadow.path)&&fluid.fail("Cannot clear component "+name+" from component ",component," which was not created by this instantiator");var childPath=that.composePath(path,name),childShadow=that.idToShadow[child.id];if(childShadow){var created=childShadow.path===childPath;that.events.onComponentClear.fire(child,childPath,component,created),created?(fluid.visitComponentChildren(child,function(gchild,gchildname,segs,i){var parentPath=that.composeSegments.apply(null,segs.slice(0,i));that.clearComponent(child,gchildname,null,options,!0,parentPath)},options,that.parseEL(childPath)),fluid.doDestroy(child,name,component),options.destroyRecs.push({child:child,childShadow:childShadow,name:name,component:component,shadow:shadow})):fluid.remove_if(childShadow.injectedPaths,function(troo,path){return path===childPath}),fluid.clearChildrenScope(that,shadow,child,childShadow),delete that.pathToComponent[childPath],nested||(delete component[name],fluid.each(options.destroyRecs,that.clearConcreteComponent))}},that},fluid.globalInstantiator=fluid.instantiator(),fluid.getInstantiator=function(component){var instantiator=fluid.globalInstantiator;return component&&instantiator.idToShadow[component.id]?instantiator:null},fluid.defaults("fluid.resolveRoot"),fluid.defaults("fluid.resolveRootSingle",{gradeNames:"fluid.resolveRoot"}),fluid.constructRootComponents=function(instantiator){fluid.rootComponent=instantiator.rootComponent=fluid.typeTag("fluid.rootComponent"),instantiator.recordRoot(fluid.rootComponent),fluid.resolveRootComponent=instantiator.resolveRootComponent=fluid.typeTag("fluid.resolveRootComponent"),instantiator.recordKnownComponent(fluid.rootComponent,fluid.resolveRootComponent,"resolveRootComponent",!0);var rootShadow=instantiator.idToShadow[fluid.rootComponent.id];rootShadow.contextHash={};var resolveRootShadow=instantiator.idToShadow[fluid.resolveRootComponent.id];resolveRootShadow.ownScope=rootShadow.ownScope,resolveRootShadow.childrenScope=rootShadow.childrenScope,instantiator.recordKnownComponent(fluid.resolveRootComponent,instantiator,"instantiator",!0),resolveRootShadow.childrenScope.instantiator=instantiator},fluid.constructRootComponents(fluid.globalInstantiator),fluid.expandOptions=function(args,that,mergePolicy,localRecord,outerExpandOptions){if(!args)return args;fluid.pushActivity("expandOptions","expanding options %args for component %that ",{that:that,args:args});var expandOptions=fluid.makeStackResolverOptions(that,localRecord);expandOptions.mergePolicy=mergePolicy,expandOptions.defer=outerExpandOptions&&outerExpandOptions.defer;var expanded=expandOptions.defer?fluid.makeExpandOptions(args,expandOptions):fluid.expand(args,expandOptions);return fluid.popActivity(),expanded},fluid.localRecordExpected=fluid.arrayToHash(["type","options","container","createOnEvent","priority","recordType"]),fluid.checkComponentRecord=function(localRecord){fluid.each(localRecord,function(value,key){fluid.localRecordExpected[key]||fluid.fail("Probable error in subcomponent record ",localRecord,' - key "'+key+'" found, where the only legal options are '+fluid.keys(fluid.localRecordExpected).join(", "))})},fluid.mergeRecordsToList=function(that,mergeRecords){var list=[];return fluid.each(mergeRecords,function(value,key){if("distributions"===(value.recordType=key))list.push.apply(list,fluid.transform(value,function(distributedBlock){return fluid.computeDistributionPriority(that,distributedBlock)}));else{if(!value.options)return;value.priority=fluid.mergeRecordTypes[key],void 0===value.priority&&fluid.fail("Merge record with unrecognised type "+key+": ",value),list.push(value)}}),list};fluid.generateExpandBlock=function(record,that,mergePolicy,localRecord){var expanded=fluid.expandOptions(record.options,record.contextThat||that,mergePolicy,localRecord,{defer:!0});return expanded.priority=record.priority,expanded.namespace=record.namespace,expanded.recordType=record.recordType,expanded};var expandComponentOptionsImpl=function(mergePolicy,defaults,initRecord,that){var policy,defaultCopy=fluid.copy(defaults);policy=mergePolicy,fluid.each(["gradeNames","mergePolicy","argumentMap","components","dynamicComponents","events","listeners","modelListeners","modelRelay","distributeOptions","transformOptions"],function(key){fluid.set(policy,[key,"*","noexpand"],!0)}),fluid.shadowForComponent(that).mergePolicy=mergePolicy;var mergeRecords={defaults:{options:defaultCopy}};$.extend(mergeRecords,initRecord.mergeRecords),mergeRecords.subcomponentRecord&&fluid.checkComponentRecord(mergeRecords.subcomponentRecord);var expandList=fluid.mergeRecordsToList(that,mergeRecords);return fluid.transform(expandList,function(value){return fluid.generateExpandBlock(value,that,mergePolicy,initRecord.localRecord)})};fluid.fabricateDestroyMethod=function(that,name,instantiator,child){return function(){instantiator.clearComponent(that,name,child)}},fluid.computeGlobalMemberName=function(that){return fluid.computeNickName(that.typeName)+"-"+that.id},fluid.typeNameToMemberName=function(typeName){return typeName.replace(/\./g,"_")},fluid.expandComponentOptions=function(mergePolicy,defaults,userOptions,that){var initRecord=userOptions,instantiator=userOptions&&userOptions.marker===fluid.EXPAND?userOptions.instantiator:null;fluid.pushActivity("expandComponentOptions","expanding component options %options with record %record for component %that",{options:instantiator?userOptions.mergeRecords.user:userOptions,record:initRecord,that:that}),instantiator||(instantiator=fluid.globalInstantiator,initRecord={mergeRecords:{user:{options:fluid.expandCompact(userOptions,!0)}},memberName:fluid.computeGlobalMemberName(that),instantiator:instantiator,parentThat:fluid.rootComponent}),that.destroy=fluid.fabricateDestroyMethod(initRecord.parentThat,initRecord.memberName,instantiator,that),instantiator.recordKnownComponent(initRecord.parentThat,that,initRecord.memberName,!0);var togo=expandComponentOptionsImpl(mergePolicy,defaults,initRecord,that);return fluid.popActivity(),togo},fluid.assembleCreatorArguments=function(parentThat,typeName,options){var upDefaults=fluid.defaults(typeName);upDefaults&&upDefaults.argumentMap||fluid.fail("Error in assembleCreatorArguments: cannot look up component type name "+typeName+" to a component creator grade with an argumentMap");var distributions=parentThat?fluid.receiveDistributions(parentThat,upDefaults.gradeNames,options.memberName,{}):[];fluid.each(distributions,function(distribution){fluid.computeDistributionPriority(parentThat,distribution),fluid.isPrimitive(distribution.priority)&&(distribution.priority=fluid.parsePriority(distribution.priority,0,!1,"options distribution"))}),fluid.sortByPriority(distributions);var localDynamic=options.localDynamic,localRecord=$.extend({},fluid.censorKeys(options.componentRecord,["type"]),localDynamic),argMap=upDefaults.argumentMap,findKeys=Object.keys(argMap).concat(["type"]);fluid.each(findKeys,function(name){for(var i=0;i<distributions.length;++i)void 0!==distributions[i][name]&&(localRecord[name]=distributions[i][name])}),typeName=localRecord.type||typeName,delete localRecord.type,delete localRecord.options;var mergeRecords={distributions:distributions};void 0!==options.componentRecord&&(mergeRecords.subcomponentRecord=$.extend({},options.componentRecord));var args=[];return fluid.each(argMap,function(index,name){var arg;if("options"===name)arg={marker:fluid.EXPAND,localRecord:localDynamic,mergeRecords:mergeRecords,instantiator:fluid.getInstantiator(parentThat),parentThat:parentThat,memberName:options.memberName};else{var value=localRecord[name];arg=fluid.expandImmediate(value,parentThat,localRecord)}args[index]=arg}),{args:args,funcName:typeName}},fluid.initDependent=function(that,name,localRecord){if(!that[name]){var instance,component=that.options.components[name],instantiator=fluid.globalInstantiator,shadow=instantiator.idToShadow[that.id],localDynamic=localRecord||shadow.subcomponentLocal&&shadow.subcomponentLocal[name];if(fluid.pushActivity("initDependent",'instantiating dependent component at path "%path" with record %record as child of %parent',{path:shadow.path+"."+name,record:component,parent:that}),"string"==typeof component||component.expander)that[name]=fluid.inEvaluationMarker,(instance=fluid.expandImmediate(component,that))?instantiator.recordKnownComponent(that,instance,name,!1):delete that[name];else if(component.type){var type=fluid.expandImmediate(component.type,that,localDynamic);type||fluid.fail("Error in subcomponent record: ",component.type," could not be resolved to a type for component ",name," of parent ",that);var invokeSpec=fluid.assembleCreatorArguments(that,type,{componentRecord:component,memberName:name,localDynamic:localDynamic});instance=fluid.initSubcomponentImpl(that,{type:invokeSpec.funcName},invokeSpec.args)}else fluid.fail("Unrecognised material in place of subcomponent "+name+' - no "type" field found');return fluid.popActivity(),instance}},fluid.bindDeferredComponent=function(that,componentName,component){var events=fluid.makeArray(component.createOnEvent);fluid.each(events,function(eventName){var event=fluid.isIoCReference(eventName)?fluid.expandOptions(eventName,that):that.events[eventName];event&&event.addListener||fluid.fail("Error instantiating createOnEvent component with name "+componentName+" of parent ",that," since event specification "+eventName+" could not be expanded to an event - got ",event),event.addListener(function(){fluid.pushActivity("initDeferred","instantiating deferred component %componentName of parent %that due to event %eventName",{componentName:componentName,that:that,eventName:eventName}),that[componentName]&&fluid.globalInstantiator.clearComponent(that,componentName);var localRecord={arguments:fluid.makeArray(arguments)};fluid.initDependent(that,componentName,localRecord),fluid.popActivity()},null,component.priority)})},fluid.priorityForComponent=function(component){return component.priority?component.priority:"fluid.typeFount"===component.type||fluid.hasGrade(fluid.defaults(component.type),"fluid.typeFount")?"first":void 0},fluid.initDependents=function(that){fluid.pushActivity("initDependents","instantiating dependent components for component %that",{that:that});var shadow=fluid.shadowForComponent(that);if(shadow.memberStrategy.initter(),shadow.invokerStrategy.initter(),fluid.getForComponent(that,"modelRelay"),fluid.getForComponent(that,"model"),!fluid.isDestroyed(that)){var components=that.options.components||{},componentSort=[];fluid.each(components,function(component,name){if(component.createOnEvent)fluid.bindDeferredComponent(that,name,component);else{var priority=fluid.priorityForComponent(component);componentSort.push({namespace:name,priority:fluid.parsePriority(priority)})}}),fluid.sortByPriority(componentSort),fluid.each(componentSort,function(entry){fluid.initDependent(that,entry.namespace)}),shadow.subcomponentLocal&&fluid.clear(shadow.subcomponentLocal),that.lifecycleStatus="constructed",fluid.assessTreeConstruction(that,shadow),fluid.popActivity()}},fluid.assessTreeConstruction=function(that,shadow){var instantiator=fluid.globalInstantiator,thatStack=instantiator.getThatStack(that);fluid.find_if(thatStack,function(that){return"constructing"===that.lifecycleStatus})?that.lifecycleStatus="constructed":fluid.markSubtree(instantiator,that,shadow.path,"treeConstructed")},fluid.markSubtree=function(instantiator,that,path,state){that.lifecycleStatus=state,fluid.visitComponentChildren(that,function(child,name){var childPath=instantiator.composePath(path,name),childShadow=instantiator.idToShadow[child.id];childShadow&&childShadow.path===childPath&&fluid.markSubtree(instantiator,child,childPath,state)},{flat:!0})},fluid.pathForComponent=function(component,instantiator){var shadow=(instantiator=instantiator||fluid.getInstantiator(component)||fluid.globalInstantiator).idToShadow[component.id];return shadow?instantiator.parseEL(shadow.path):null},fluid.construct=function(path,options,instantiator){var record=fluid.destroy(path,instantiator);return fluid.set(record.parent,["options","components",record.memberName],{type:options.type,options:options}),fluid.initDependent(record.parent,record.memberName)},fluid.destroy=function(path,instantiator){instantiator=instantiator||fluid.globalInstantiator;var segs=fluid.model.parseToSegments(path,instantiator.parseEL,!0);0===segs.length&&fluid.fail("Cannot destroy the root component");var memberName=segs.pop(),parentPath=instantiator.composeSegments.apply(null,segs),parent=instantiator.pathToComponent[parentPath];return parent||fluid.fail("Cannot modify component with nonexistent parent at path ",path),parent[memberName]&&parent[memberName].destroy(),{parent:parent,memberName:memberName}},fluid.constructSingle=function(parentPath,options,instantiator){instantiator=instantiator||fluid.globalInstantiator,parentPath=parentPath||"";var segs=fluid.model.parseToSegments(parentPath,instantiator.parseEL,!0);"string"==typeof options&&(options={type:options});var type=options.type;type||fluid.fail("Cannot construct singleton object without a type entry");var gradeNames=(options=$.extend({},options)).gradeNames=fluid.makeArray(options.gradeNames);gradeNames.unshift(type),options.type="fluid.component",0===segs.length&&gradeNames.push("fluid.resolveRoot");var memberName=fluid.typeNameToMemberName(options.singleRootType||type);segs.push(memberName),fluid.construct(segs,options,instantiator)},fluid.destroySingle=function(parentPath,typeName,instantiator){instantiator=instantiator||fluid.globalInstantiator;var segs=fluid.model.parseToSegments(parentPath,instantiator.parseEL,!0),memberName=fluid.typeNameToMemberName(typeName);segs.push(memberName),fluid.destroy(segs,instantiator)},fluid.makeGradeLinkage=function(linkageName,inputNames,outputNames){fluid.defaults(linkageName,{gradeNames:"fluid.component",distributeOptions:{record:outputNames,target:"{/ "+inputNames.join("&")+"}.options.gradeNames"}}),fluid.constructSingle([],linkageName)},fluid.componentForPath=function(path){return fluid.globalInstantiator.pathToComponent[fluid.isArrayable(path)?path.join("."):path]},fluid.debugger=function(){},fluid.defaults("fluid.debuggingProbe",{gradeNames:["fluid.component"]}),fluid.probeToDistribution=function(probe){var instantiator=fluid.globalInstantiator,parsed=fluid.parseContextReference(probe.target),segs=fluid.model.parseToSegments(parsed.path,instantiator.parseEL,!0);"options"!==segs[0]&&segs.unshift("options");var parsedPriority=fluid.parsePriority(probe.priority);return parsedPriority.constraint&&!parsedPriority.constraint.target&&(parsedPriority.constraint.target="authoring"),{target:"{/ "+parsed.context+"}."+instantiator.composeSegments.apply(null,segs),record:{func:probe.func,funcName:probe.funcName,args:probe.args,priority:fluid.renderPriority(parsedPriority)}}},fluid.registerProbes=function(probes){var probeDistribution=fluid.transform(probes,fluid.probeToDistribution),memberName="fluid_debuggingProbe_"+fluid.allocateGuid();return fluid.construct([memberName],{type:"fluid.debuggingProbe",distributeOptions:probeDistribution}),memberName},fluid.deregisterProbes=function(probeName){fluid.destroy([probeName])},fluid.thisistToApplicable=function(record,recthis,that){return{apply:function(noThis,args){var resolvedThis=fluid.expandOptions(recthis,that);"string"==typeof resolvedThis&&(resolvedThis=fluid.getGlobalValue(resolvedThis)),resolvedThis||fluid.fail("Could not resolve reference "+recthis+" to a value");var resolvedFunc=resolvedThis[record.method];return"function"!=typeof resolvedFunc&&fluid.fail("Object ",resolvedThis," at reference "+recthis+" has no member named "+record.method+" which is a function "),fluid.passLogLevel(fluid.logLevel.TRACE)&&fluid.log(fluid.logLevel.TRACE,"Applying arguments ",args," to method "+record.method+" of instance ",resolvedThis),resolvedFunc.apply(resolvedThis,args)}}},fluid.changeToApplicable=function(record,that){return{apply:function(noThis,args,localRecord,mergeRecord){var parsed=fluid.parseValidModelReference(that,"changePath listener record",record.changePath),value=fluid.expandOptions(record.value,that,{},fluid.extend(localRecord,{arguments:args})),sources=mergeRecord&&mergeRecord.source&&mergeRecord.source.length?fluid.makeArray(record.source).concat(mergeRecord.source):record.source;parsed.applier.change(parsed.modelSegs,value,record.type,sources)}}},fluid.recordToApplicable=function(record,that,standard){if(void 0!==record.changePath)return fluid.changeToApplicable(record,that,standard);var recthis=record.this;return record.method^recthis&&fluid.fail("Record ",that,' must contain both entries "method" and "this" if it contains either'),record.method?fluid.thisistToApplicable(record,recthis,that):null},fluid.getGlobalValueNonComponent=function(funcName,context){var defaults=fluid.defaults(funcName);return defaults&&fluid.hasGrade(defaults,"fluid.component")&&fluid.fail("Error in function specification - cannot invoke function "+funcName+" in the context of "+context+": component creator functions can only be used as subcomponents"),fluid.getGlobalValue(funcName)},fluid.makeInvoker=function(that,invokerec,name){void 0===(invokerec=fluid.upgradePrimitiveFunc(invokerec)).args||invokerec.args===fluid.NO_VALUE||fluid.isArrayable(invokerec.args)||(invokerec.args=fluid.makeArray(invokerec.args));var func=fluid.recordToApplicable(invokerec,that),invokePre=fluid.preExpand(invokerec.args),localRecord={},expandOptions=fluid.makeStackResolverOptions(that,localRecord,!0);return(func=func||(invokerec.funcName?fluid.getGlobalValueNonComponent(invokerec.funcName,"an invoker"):fluid.expandImmediate(invokerec.func,that)))&&func.apply?func===fluid.notImplemented&&fluid.fail("Error constructing component ",that," - the invoker named "+name+" which was defined in grade "+invokerec.componentSource+" needs to be overridden with a concrete implementation"):fluid.fail("Error in invoker record: could not resolve members func, funcName or method to a function implementation - got "+func+" from ",invokerec),function(){var togo,finalArgs;return!1===fluid.defeatLogging&&fluid.pushActivity("invokeInvoker","invoking invoker with name %name and record %record from path %path holding component %that",{name:name,record:invokerec,path:fluid.dumpComponentPath(that),that:that}),"destroyed"===that.lifecycleStatus?fluid.log(fluid.logLevel.WARN,"Ignoring call to invoker "+name+" of component ",that," which has been destroyed"):(localRecord.arguments=arguments,finalArgs=void 0===invokerec.args||invokerec.args===fluid.NO_VALUE?arguments:(fluid.expandImmediateImpl(invokePre,expandOptions),invokePre.source),togo=func.apply(null,finalArgs)),!1===fluid.defeatLogging&&fluid.popActivity(),togo}},fluid.event.makeTrackedListenerAdder=function(source){var shadow=fluid.shadowForComponent(source);return function(event){return{addListener:function(listener,namespace,priority,softNamespace,listenerId){fluid.recordListener(event,listener,shadow,listenerId),event.addListener.apply(null,arguments)}}}},fluid.event.listenerEngine=function(eventSpec,callback,adder){var argstruc={};fluid.each(eventSpec,function(event,eventName){adder(event).addListener(function(){argstruc[eventName]=fluid.makeArray(arguments),function(){if(!fluid.find(eventSpec,function(value,key){if(void 0===argstruc[key])return!0})){var oldstruc=argstruc;argstruc={},callback(oldstruc)}}()})})},fluid.event.dispatchListener=function(that,listener,eventName,eventSpec,wrappedArgs){void 0===eventSpec.args||eventSpec.args===fluid.NO_VALUE||fluid.isArrayable(eventSpec.args)||(eventSpec.args=fluid.makeArray(eventSpec.args)),listener=fluid.event.resolveListener(listener);var dispatchPre=fluid.preExpand(eventSpec.args),localRecord={},expandOptions=fluid.makeStackResolverOptions(that,localRecord,!0),togo=function(){!1===fluid.defeatLogging&&fluid.pushActivity("dispatchListener","firing to listener to event named %eventName of component %that",{eventName:eventName,that:that});var finalArgs,args=wrappedArgs?arguments[0]:arguments;localRecord.arguments=args,finalArgs=void 0!==eventSpec.args&&eventSpec.args!==fluid.NO_VALUE?(fluid.expandImmediateImpl(dispatchPre,expandOptions),dispatchPre.source):args;var togo=listener.apply(null,finalArgs);return!1===fluid.defeatLogging&&fluid.popActivity(),togo};return fluid.event.impersonateListener(listener,togo),togo},fluid.event.resolveSoftNamespace=function(key){if("string"!=typeof key)return null;var lastpos=Math.max(key.lastIndexOf("."),key.lastIndexOf("}"));return key.substring(lastpos+1)},fluid.event.resolveListenerRecord=function(lisrec,that,eventName,namespace,standard){var badRec=function(record,extra){fluid.fail("Error in listener record - could not resolve reference ",record,' to a listener or firer. Did you miss out "events." when referring to an event firer?'+extra)};fluid.pushActivity("resolveListenerRecord","resolving listener record for event named %eventName for component %that",{eventName:eventName,that:that});var records=fluid.makeArray(lisrec),togo={records:fluid.transform(records,function(record){var expanded=fluid.isPrimitive(record)||record.expander?{listener:record}:fluid.copy(record),methodist=fluid.recordToApplicable(record,that,standard);expanded.listener=methodist||(expanded.listener||expanded.func||expanded.funcName),expanded.listener||badRec(record,' Listener record must contain a member named "listener", "func", "funcName" or "method"');var softNamespace=record.method?fluid.event.resolveSoftNamespace(record.this)+"."+record.method:fluid.event.resolveSoftNamespace(expanded.listener);expanded.namespace||namespace||!softNamespace||(expanded.softNamespace=!0,expanded.namespace=(record.componentSource?record.componentSource:that.typeName)+"."+softNamespace);var listener=expanded.listener=fluid.expandOptions(expanded.listener,that);listener||badRec(record,"");var firer=!1;return"fluid.event.firer"===listener.typeName&&(listener=listener.fire,firer=!0),expanded.listener=standard&&(expanded.args&&"fluid.notImplemented"!==listener||firer)?fluid.event.dispatchListener(that,listener,eventName,expanded):listener,expanded.listenerId=fluid.allocateGuid(),expanded}),adderWrapper:standard?fluid.event.makeTrackedListenerAdder(that):null};return fluid.popActivity(),togo},fluid.event.expandOneEvent=function(that,event){var origin;return(origin="string"==typeof event&&"{"!==event.charAt(0)?fluid.getForComponent(that,["events",event]):fluid.expandOptions(event,that))&&"fluid.event.firer"===origin.typeName||fluid.fail("Error in event specification - could not resolve base event reference ",event," to an event firer: got ",origin),origin},fluid.event.expandEvents=function(that,event){return"string"==typeof event?fluid.event.expandOneEvent(that,event):fluid.transform(event,function(oneEvent){return fluid.event.expandOneEvent(that,oneEvent)})},fluid.event.resolveEvent=function(that,eventName,eventSpec){fluid.pushActivity("resolveEvent","resolving event with name %eventName attached to component %that",{eventName:eventName,that:that});var adder=fluid.event.makeTrackedListenerAdder(that);"string"==typeof eventSpec&&(eventSpec={event:eventSpec});var event="fluid.event.firer"===eventSpec.typeName?eventSpec:eventSpec.event||eventSpec.events;event||fluid.fail("Event specification for event with name "+eventName+" does not include a base event specification: ",eventSpec);var firer,origin="fluid.event.firer"===event.typeName?event:fluid.event.expandEvents(that,event),isMultiple="fluid.event.firer"!==origin.typeName;if(eventSpec.args||isMultiple){firer=fluid.makeEventFirer({name:" [composite] "+fluid.event.nameEvent(that,eventName)});var dispatcher=fluid.event.dispatchListener(that,firer.fire,eventName,eventSpec,isMultiple);isMultiple?fluid.event.listenerEngine(origin,dispatcher,adder):adder(origin).addListener(dispatcher)}else(firer={typeName:"fluid.event.firer",fire:function(){var outerArgs=fluid.makeArray(arguments);fluid.pushActivity("fireSynthetic","firing synthetic event %eventName ",{eventName:eventName});var togo=origin.fire.apply(null,outerArgs);return fluid.popActivity(),togo},addListener:function(listener,namespace,priority,softNamespace,listenerId){var dispatcher=fluid.event.dispatchListener(that,listener,eventName,eventSpec);adder(origin).addListener(dispatcher,namespace,priority,softNamespace,listenerId)},removeListener:function(listener){origin.removeListener(listener)}}).originEvent=origin;return fluid.popActivity(),firer},fluid.withEnvironment=function(envAdd,func,root){var key;root=root||fluid.globalThreadLocal();try{for(key in envAdd)root[key]=envAdd[key];return $.extend(root,envAdd),func()}finally{for(key in envAdd)delete root[key]}},fluid.fetchContextReference=function(parsed,directModel,env,elResolver,externalFetcher){elResolver&&(parsed=elResolver(parsed,env));var base=parsed.context?env[parsed.context]:directModel;return base?parsed.noDereference?parsed.path:fluid.get(base,parsed.path):externalFetcher&&externalFetcher(parsed)||base},fluid.makeEnvironmentFetcher=function(directModel,elResolver,envGetter,externalFetcher){return envGetter=envGetter||fluid.globalThreadLocal,function(parsed){var env=envGetter();return fluid.fetchContextReference(parsed,directModel,env,elResolver,externalFetcher)}},fluid.coerceToPrimitive=function(string){return"false"!==string&&("true"===string||(isFinite(string)?Number(string):string))},fluid.compactStringToRec=function(string,type){var openPos=string.indexOf("("),closePos=string.indexOf(")");if((-1===openPos^-1===closePos||closePos<openPos)&&fluid.fail("Badly-formed compact "+type+" record without matching parentheses: "+string),-1===openPos||-1===closePos)return"expander"===type&&fluid.fail("Badly-formed compact expander record without parentheses: "+string),string;var trail=string.substring(closePos+1);""!==$.trim(trail)&&fluid.fail("Badly-formed compact "+type+" record "+string+" - unexpected material following close parenthesis: "+trail);var prefix=string.substring(0,openPos),body=$.trim(string.substring(openPos+1,closePos)),args=""===body?[]:fluid.transform(body.split(","),$.trim,fluid.coerceToPrimitive),togo=fluid.upgradePrimitiveFunc(prefix,null);return togo.args=args,togo},fluid.expandPrefix="@expand:",fluid.expandCompactString=function(string,active){var rec=string;if(0===string.indexOf(fluid.expandPrefix)){var rem=string.substring(fluid.expandPrefix.length);rec={expander:fluid.compactStringToRec(rem,"expander")}}else active&&(rec=fluid.compactStringToRec(string,active));return rec};var singularPenRecord={listeners:"listener",modelListeners:"modelListener"},singularRecord=$.extend({invokers:"invoker"},singularPenRecord);function regenerateCursor(source,segs,limit,sourceStrategy){for(var i=0;i<limit;++i)source=sourceStrategy(source,segs[i],i,fluid.makeArray(segs));return source}fluid.expandCompactRec=function(segs,target,source){fluid.guardCircularExpansion(segs,segs.length);var pen=0<segs.length?segs[segs.length-1]:"",active=singularRecord[pen];!active&&1<segs.length&&(active=singularPenRecord[segs[segs.length-2]]),fluid.each(source,function(value,key){if(fluid.isPlainObject(value))return target[key]=fluid.freshContainer(value),segs.push(key),fluid.expandCompactRec(segs,target[key],value),void segs.pop();"string"==typeof value&&(value=fluid.expandCompactString(value,active)),target[key]=value})},fluid.expandCompact=function(options){var togo={};return fluid.expandCompactRec([],togo,options),togo},fluid.extractEL=function(string,options){if("ALL"===options.ELstyle||"{}"===options.ELstyle)return string;if(1===options.ELstyle.length){if(string.charAt(0)===options.ELstyle)return string.substring(1)}else if("${}"===options.ELstyle){var i1=string.indexOf("${"),i2=string.lastIndexOf("}");if(0===i1&&-1!==i2)return string.substring(2,i2)}},fluid.extractELWithContext=function(string,options){var EL=fluid.extractEL(string,options);return fluid.isIoCReference(EL)?fluid.parseContextReference(EL):"{}"===options.ELstyle?null:EL?{path:EL}:EL},fluid.parseContextReference=function(reference,index,delimiter){index=index||0;var endcpos,context,nested,isNested="{"===reference.charAt(index+1);-1===(endcpos=isNested?(nested=fluid.parseContextReference(reference,index+1,"}")).endpos:reference.indexOf("}",index+1))&&fluid.fail('Cannot parse context reference "'+reference+'": Malformed context reference without }'),context=isNested?nested:reference.substring(index+1,endcpos);var endpos=delimiter?reference.indexOf(delimiter,endcpos+1):reference.length,path=reference.substring(endcpos+1,endpos);return"."===path.charAt(0)&&(path=path.substring(1)),{context:context,path:path,endpos:endpos}},fluid.renderContextReference=function(parsed){var context=parsed.context;return"{"+(fluid.isPrimitive(context)?context:fluid.renderContextReference(context))+"}"+(parsed.path?"."+parsed.path:"")},fluid.resolveContextValue=function(string,options){function fetch(parsed){fluid.pushActivity("resolveContextValue","resolving context value %parsed",{parsed:parsed});var togo=options.fetcher(parsed);return fluid.pushActivity("resolvedContextValue","resolved value %parsed to value %value",{parsed:parsed,value:togo}),fluid.popActivity(2),togo}var parsed;if(options.bareContextRefs&&fluid.isIoCReference(string))return fetch(parsed=fluid.parseContextReference(string));if(options.ELstyle&&"${}"!==options.ELstyle&&(parsed=fluid.extractELWithContext(string,options)))return fetch(parsed);if("${}"===options.ELstyle)for(;"string"==typeof string;){var i1=string.indexOf("${"),i2=string.indexOf("}",i1+2);if(-1===i1||-1===i2)break;"{"===string.charAt(i1+2)?i2=(parsed=fluid.parseContextReference(string,i1+2,"}")).endpos:parsed={path:string.substring(i1+2,i2)};var subs=fetch(parsed),all=0===i1&&i2===string.length-1;if(null==subs)return subs;string=all?subs:string.substring(0,i1)+subs+string.substring(i2+1)}return string},fluid.fetchExpandChildren=function(target,i,segs,source,mergePolicy,options){if(source.expander){var expanded=fluid.expandExpander(target,source,options);if(fluid.isPrimitive(expanded)||!fluid.isPlainObject(expanded)||fluid.isArrayable(expanded)^fluid.isArrayable(target))return expanded;$.extend(!0,target,expanded)}return fluid.each(source,function(newSource,key){void 0===newSource?target[key]=void 0:"expander"!==key&&(segs[i]=key,!0!==fluid.getImmediate(options.exceptions,segs,i)&&options.strategy(target,key,i+1,segs,source,mergePolicy))}),target},fluid.isUnexpandable=function(source){return fluid.isPrimitive(source)||!fluid.isPlainObject(source)},fluid.expandSource=function(options,target,i,segs,deliverer,source,policy,recurse){var expanded,isTrunk,thisPolicy=fluid.derefMergePolicy(policy);return"string"!=typeof source||thisPolicy.noexpand?thisPolicy.noexpand||fluid.isUnexpandable(source)?expanded=source:source.expander?expanded=fluid.expandExpander(deliverer,source,options):(expanded=fluid.freshContainer(source),isTrunk=!0):options.defaultEL&&"{"!==source.charAt(0)?expanded=source:(fluid.pushActivity("expandContextValue","expanding context value %source held at path %path",{source:source,path:fluid.path.apply(null,segs.slice(0,i))}),expanded=fluid.resolveContextValue(source,options),fluid.popActivity(1)),expanded!==fluid.NO_VALUE&&deliverer(expanded),isTrunk&&recurse(expanded,source,i,segs,policy),expanded},fluid.guardCircularExpansion=function(segs,i){i>fluid.strategyRecursionBailout&&fluid.fail("Overflow/circularity in options expansion, current path is ",segs," at depth ",i,' - please ensure options are not circularly connected, or protect from expansion using the "noexpand" policy or expander')},fluid.makeExpandStrategy=function(options){var recurse=function(target,source,i,segs,policy){return fluid.fetchExpandChildren(target,i||0,segs||[],source,policy,options)},strategy=function(target,name,i,segs,source,policy){if(fluid.guardCircularExpansion(segs,i),target){if(target.hasOwnProperty(name))return target[name];void 0===source&&(source=regenerateCursor(options.source,segs,i-1,options.sourceStrategy),policy=regenerateCursor(options.mergePolicy,segs,i-1,fluid.concreteTrundler));var thisSource=options.sourceStrategy(source,name,i,segs),thisPolicy=fluid.concreteTrundler(policy,name);return fluid.expandSource(options,target,i,segs,function(value){target[name]=value},thisSource,thisPolicy,recurse)}};return options.recurse=recurse,options.strategy=strategy},fluid.defaults("fluid.makeExpandOptions",{ELstyle:"${}",bareContextRefs:!0,target:fluid.inCreationMarker}),fluid.makeExpandOptions=function(source,options){return(options=$.extend({},fluid.rawDefaults("fluid.makeExpandOptions"),options)).defaultEL="${}"===options.ELStyle&&options.bareContextRefs,options.expandSource=function(source){return fluid.expandSource(options,null,0,[],fluid.identity,source,options.mergePolicy,!1)},fluid.isUnexpandable(source)?(options.strategy=fluid.concreteTrundler,options.initter=fluid.identity,options.target="string"==typeof source?(options.defer?fluid.copy:fluid.identity)(options.expandSource(source)):source,options.immutableTarget=!0):(options.source=source,options.target=fluid.freshContainer(source),options.sourceStrategy=options.sourceStrategy||fluid.concreteTrundler,fluid.makeExpandStrategy(options),options.initter=function(){options.target=fluid.fetchExpandChildren(options.target,0,[],options.source,options.mergePolicy,options)}),options},fluid.expand=function(source,options){var expandOptions=fluid.makeExpandOptions(source,options);return expandOptions.initter(),expandOptions.target},fluid.preExpandRecurse=function(root,source,holder,member,rootSegs){function pushExpander(expander){root.expanders.push({expander:expander,holder:holder,member:member}),delete holder[member]}if(fluid.guardCircularExpansion(rootSegs,rootSegs.length),fluid.isIoCReference(source)){var parsed=fluid.parseContextReference(source),segs=fluid.model.parseEL(parsed.path);pushExpander({typeFunc:fluid.expander.fetch,context:parsed.context,segs:segs})}else fluid.isPlainObject(source)&&(source.expander?(source.expander.typeFunc=fluid.getGlobalValue(source.expander.type||"fluid.invokeFunc"),pushExpander(source.expander)):fluid.each(source,function(value,key){rootSegs.push(key),fluid.preExpandRecurse(root,value,source,key,rootSegs),rootSegs.pop()}))},fluid.preExpand=function(source){var root={expanders:[],source:fluid.isUnexpandable(source)?source:fluid.copy(source)};return fluid.preExpandRecurse(root,root.source,root,"source",[]),root},fluid.expandImmediate=function(source,that,localRecord){var options=fluid.makeStackResolverOptions(that,localRecord,!0),root=fluid.preExpand(source);return fluid.expandImmediateImpl(root,options),root.source},fluid.expandImmediateImpl=function(root,options){for(var expanders=root.expanders,i=0;i<expanders.length;++i){var expander=expanders[i];expander.holder[expander.member]=expander.expander.typeFunc(null,expander,options)}},fluid.expandExpander=function(deliverer,source,options){var expander=fluid.getGlobalValue(source.expander.type||"fluid.invokeFunc");return expander||fluid.fail("Unknown expander with type "+source.expander.type),expander(deliverer,source,options)},fluid.registerNamespace("fluid.expander"),fluid.expander.fetch=function(deliverer,source,options){var localRecord=options.localRecord,context=source.expander.context,segs=source.expander.segs,inLocal=void 0!==localRecord[context],contextStatus=options.contextThat.lifecycleStatus,fast="treeConstructed"===contextStatus||"destroyed"===contextStatus,component=inLocal?localRecord[context]:fluid.resolveContext(context,options.contextThat,fast);if(component){var root=component;if(inLocal||"constructing"!==component.lifecycleStatus)for(var i=0;i<segs.length;++i)root=root?root[segs[i]]:void 0;else root=fluid.getForComponent(component,segs);return void 0!==root||inLocal||(root=fluid.getForComponent(component,segs)),root}0<segs.length&&fluid.triggerMismatchedPathError(source.expander,options.contextThat)},fluid.invokeFunc=function(deliverer,source,options){var expander=source.expander,args=fluid.makeArray(expander.args);expander.args=args,args=options.recurse?options.recurse([],args):(expander=fluid.expandImmediate(expander,options.contextThat,options.localRecord)).args;var funcEntry=expander.func||expander.funcName,func=(options.expandSource?options.expandSource(funcEntry):funcEntry)||fluid.recordToApplicable(expander,options.contextThat);return"string"==typeof func&&(func=fluid.getGlobalValue(func)),func||fluid.fail("Error in expander record ",expander,": "+funcEntry+" could not be resolved to a function for component ",options.contextThat),func.apply(null,args)},fluid.noexpand=function(deliverer,source){return source.expander.value?source.expander.value:source.expander.tree}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.model.makeEnvironmentStrategy=function(environment){return function(root,segment,index){return 0===index&&environment[segment]?environment[segment]:void 0}},fluid.model.defaultCreatorStrategy=function(root,segment){if(void 0===root[segment])return root[segment]={},root[segment]},fluid.model.defaultFetchStrategy=function(root,segment){return root[segment]},fluid.model.funcResolverStrategy=function(root,segment){if(root.resolvePathSegment)return root.resolvePathSegment(segment)},fluid.model.traverseWithStrategy=function(root,segs,initPos,config,uncess){for(var strategies=config.strategies,limit=segs.length-uncess,i=initPos;i<limit;++i){if(!root)return root;for(var accepted,j=0;j<strategies.length&&void 0===(accepted=strategies[j](root,segs[i],i+1,segs));++j);accepted===fluid.NO_VALUE&&(accepted=void 0),root=accepted}return root},fluid.model.getValueAndSegments=function(root,EL,config,initSegs){return fluid.model.accessWithStrategy(root,EL,fluid.NO_VALUE,config,initSegs,!0)},fluid.model.makeTrundler=function(config){return function(valueSeg,EL){return fluid.model.getValueAndSegments(valueSeg.root,EL,config,valueSeg.segs)}},fluid.model.getWithStrategy=function(root,EL,config,initSegs){return fluid.model.accessWithStrategy(root,EL,fluid.NO_VALUE,config,initSegs)},fluid.model.setWithStrategy=function(root,EL,newValue,config,initSegs){fluid.model.accessWithStrategy(root,EL,newValue,config,initSegs)},fluid.model.accessWithStrategy=function(root,EL,newValue,config,initSegs,returnSegs){if(fluid.isPrimitive(EL)||fluid.isArrayable(EL))return fluid.model.accessImpl(root,EL,newValue,config,initSegs,returnSegs,fluid.model.traverseWithStrategy);var key=EL.type||"default",resolver=config.resolvers[key];resolver||fluid.fail("Unable to find resolver of type "+key);var trundler=fluid.model.makeTrundler(config),valueSeg={root:root,segs:initSegs};return valueSeg=resolver(valueSeg,EL,trundler),EL.path&&valueSeg&&(valueSeg=trundler(valueSeg,EL.path)),returnSegs?valueSeg:valueSeg?valueSeg.root:void 0},fluid.registerNamespace("fluid.pathUtil"),fluid.pathUtil.getPathSegmentImpl=function(accept,path,i){var segment=null;accept&&(segment="");for(var escaped=!1,limit=path.length;i<limit;++i){var c=path.charAt(i);if(escaped)escaped=!1,null!==segment&&(segment+=c);else{if("."===c)break;"\\"===c?escaped=!0:null!==segment&&(segment+=c)}}return null!==segment&&(accept[0]=segment),i};var globalAccept=[];fluid.pathUtil.parseEL=function(path){for(var togo=[],index=0,limit=path.length;index<limit;){var firstdot=fluid.pathUtil.getPathSegmentImpl(globalAccept,path,index);togo.push(globalAccept[0]),index=firstdot+1}return togo},fluid.pathUtil.composeSegment=function(prefix,toappend){toappend=toappend.toString();for(var i=0;i<toappend.length;++i){var c=toappend.charAt(i);"."!==c&&"\\"!==c&&"}"!==c||(prefix+="\\"),prefix+=c}return prefix},fluid.pathUtil.escapeSegment=function(segment){return fluid.pathUtil.composeSegment("",segment)},fluid.pathUtil.composePath=function(prefix,suffix){return 0!==prefix.length&&(prefix+="."),fluid.pathUtil.composeSegment(prefix,suffix)},fluid.pathUtil.composeSegments=function(){for(var path="",i=0;i<arguments.length;++i)path=fluid.pathUtil.composePath(path,arguments[i]);return path},fluid.pathUtil.matchSegments=function(toMatch,segs,start,end){if(end-start!==toMatch.length)return!1;for(var i=start;i<end;++i)if(segs[i]!==toMatch[i-start])return!1;return!0},fluid.model.unescapedParser={parse:fluid.model.parseEL,compose:fluid.model.composeSegments},fluid.model.defaultGetConfig={parser:fluid.model.unescapedParser,strategies:[fluid.model.funcResolverStrategy,fluid.model.defaultFetchStrategy]},fluid.model.defaultSetConfig={parser:fluid.model.unescapedParser,strategies:[fluid.model.funcResolverStrategy,fluid.model.defaultFetchStrategy,fluid.model.defaultCreatorStrategy]},fluid.model.escapedParser={parse:fluid.pathUtil.parseEL,compose:fluid.pathUtil.composeSegments},fluid.model.escapedGetConfig={parser:fluid.model.escapedParser,strategies:[fluid.model.defaultFetchStrategy]},fluid.model.escapedSetConfig={parser:fluid.model.escapedParser,strategies:[fluid.model.defaultFetchStrategy,fluid.model.defaultCreatorStrategy]},fluid.stronglyConnected=function(vertices,accessor){var that={stack:[],accessor:accessor,components:[],index:0};return vertices.forEach(function(vertex){void 0===vertex.tarjanIndex&&fluid.stronglyConnectedOne(vertex,that)}),that.components},fluid.stronglyConnectedOne=function(vertex,that){if(vertex.tarjanIndex=that.index,vertex.lowIndex=that.index,++that.index,that.stack.push(vertex),vertex.onStack=!0,that.accessor(vertex).forEach(function(outVertex){void 0===outVertex.tarjanIndex?(fluid.stronglyConnectedOne(outVertex,that),vertex.lowIndex=Math.min(vertex.lowIndex,outVertex.lowIndex)):outVertex.onStack&&(vertex.lowIndex=Math.min(vertex.lowIndex,outVertex.tarjanIndex))}),vertex.lowIndex===vertex.tarjanIndex){for(var outVertex,component=[];(outVertex=that.stack.pop()).onStack=!1,component.push(outVertex),outVertex!==vertex;);that.components.push(component)}},fluid.initRelayModel=function(that){return fluid.deenlistModelComponent(that),that.model},fluid.isModelComplete=function(that){return"model"in that&&that.model!==fluid.inEvaluationMarker},fluid.enlistModelComponent=function(that){var instantiator=fluid.getInstantiator(that),enlist=instantiator.modelTransactions.init[that.id];return enlist||(enlist={that:that,applier:fluid.getForComponent(that,"applier"),complete:fluid.isModelComplete(that)},instantiator.modelTransactions.init[that.id]=enlist),enlist},fluid.clearTransactions=function(){var instantiator=fluid.globalInstantiator;fluid.clear(instantiator.modelTransactions),instantiator.modelTransactions.init={}},fluid.failureEvent.addListener(fluid.clearTransactions,"clearTransactions","before:fail"),fluid.clearLinkCounts=function(transRec,relaysAlso){fluid.each(transRec,function(value,key){"number"==typeof value?transRec[key]=0:relaysAlso&&value.options&&"number"==typeof value.relayCount&&(value.relayCount=0)})},fluid.computeInitialOutArcs=function(transacs,mrec){return fluid.transform(mrec,function(recel,id){var oneOutArcs={},listeners=recel.that.applier.listeners.sortedListeners;fluid.each(listeners,function(listener){if(listener.isRelay&&!fluid.isExcludedChangeSource(transacs[id],listener.cond)){var targetId=listener.targetId;targetId!==id&&(oneOutArcs[targetId]=!0)}});var togo=Object.keys(oneOutArcs).map(function(id){return mrec[id]});return fluid.remove_if(togo,function(rec){return void 0===rec}),togo})},fluid.sortCompleteLast=function(reca,recb){return(reca.completeOnInit?1:0)-(recb.completeOnInit?1:0)},fluid.operateInitialTransaction=function(that,mrec){var transac,transId=fluid.allocateGuid(),transRec=fluid.getModelTransactionRec(that,transId),transacs=fluid.transform(mrec,function(recel){return transac=recel.that.applier.initiate(null,"init",transId),transRec[recel.that.applier.applierId]={transaction:transac},transac}),outArcs=fluid.computeInitialOutArcs(transacs,mrec),recs=fluid.values(mrec),components=fluid.stronglyConnected(recs,function(mrec){return outArcs[mrec.that.id]}),priorityIndex=0;components.forEach(function(component){component.forEach(function(recel){recel.initPriority=recel.completeOnInit?Math.Infinity:priorityIndex++})}),recs.sort(function(reca,recb){return reca.initPriority-recb.initPriority}),recs.forEach(function(recel){var that=recel.that,transac=transacs[that.id];recel.completeOnInit?fluid.initModelEvent(that,that.applier,transac,that.applier.listeners.sortedListeners):fluid.each(recel.initModels,function(initModel){transac.fireChangeRequest({type:"ADD",segs:[],value:initModel}),fluid.clearLinkCounts(transRec,!0)});var shadow=fluid.shadowForComponent(that);shadow&&(shadow.modelComplete=!0)}),transac.commit()},fluid.deenlistModelComponent=function(that){var instantiator=fluid.getInstantiator(that),mrec=instantiator.modelTransactions.init;if(mrec[that.id]&&(that.model=void 0,mrec[that.id].complete=!0,!fluid.find_if(mrec,function(recel){return!0!==recel.complete}))){try{fluid.operateInitialTransaction(that,mrec)}catch(e){throw fluid.clearTransactions(),e}instantiator.modelTransactions.init={}}},fluid.parseModelReference=function(that,ref){var parsed=fluid.parseContextReference(ref);return parsed.segs=that.applier.parseEL(parsed.path),parsed},fluid.parseValidModelReference=function(that,name,ref,implicitRelay){var parsed,contextTarget,target,reject=function(){var failArgs=["Error in "+name+": ",ref].concat(fluid.makeArray(arguments));fluid.fail.apply(null,failArgs)},rejectNonModel=function(value){reject(" must be a reference to a component with a ChangeApplier (descended from fluid.modelComponent), instead got ",value)};if("string"==typeof ref)if(fluid.isIoCReference(ref)){var modelPoint=(parsed=fluid.parseModelReference(that,ref)).segs.indexOf("model");-1===modelPoint?implicitRelay?parsed.nonModel=!0:reject(' must be a reference into a component model via a path including the segment "model"'):(parsed.modelSegs=parsed.segs.slice(modelPoint+1),parsed.contextSegs=parsed.segs.slice(0,modelPoint),delete parsed.path)}else parsed={path:ref,modelSegs:that.applier.parseEL(ref)};else fluid.isArrayable(ref.segs)||reject(' must contain an entry "segs" holding path segments referring a model path within a component'),parsed={context:ref.context,modelSegs:fluid.expandOptions(ref.segs,that)};return target=parsed.context?((contextTarget=fluid.resolveContext(parsed.context,that))||reject(" context must be a reference to an existing component"),parsed.contextSegs?fluid.getForComponent(contextTarget,parsed.contextSegs):contextTarget):that,parsed.nonModel||(fluid.isComponent(target)||rejectNonModel(target),target.applier||fluid.getForComponent(target,["applier"]),target.applier||rejectNonModel(target)),parsed.that=target,parsed.applier=target&&target.applier,parsed.path||(parsed.path=target&&target.applier.composeSegments.apply(null,parsed.modelSegs)),parsed},fluid.getModelTransactionRec=function(that,transId){var instantiator=fluid.getInstantiator(that);if(transId||fluid.fail("Cannot get transaction record without transaction id"),!instantiator)return null;var transRec=instantiator.modelTransactions[transId];return transRec||(transRec=instantiator.modelTransactions[transId]={relays:[],sources:{},externalChanges:{}}),transRec},fluid.recordChangeListener=function(component,applier,sourceListener,listenerId){var shadow=fluid.shadowForComponent(component);fluid.recordListener(applier.modelChanged,sourceListener,shadow,listenerId)},fluid.registerRelayTransaction=function(transRec,targetApplier,transId,options,npOptions){var newTrans=targetApplier.initiate("relay",null,transId),transEl=transRec[targetApplier.applierId]={transaction:newTrans,relayCount:0,namespace:npOptions.namespace,priority:npOptions.priority,options:options};return transEl.priority=fluid.parsePriority(transEl.priority,transRec.relays.length,!1,"model relay"),transRec.relays.push(transEl),transEl},fluid.relayRecursionBailout=100,fluid.registerDirectChangeRelay=function(target,targetSegs,source,sourceSegs,linkId,transducer,options,npOptions){var targetApplier=options.targetApplier||target.applier,sourceApplier=options.sourceApplier||source.applier,applierId=targetApplier.applierId;targetSegs=fluid.makeArray(targetSegs),sourceSegs=fluid.makeArray(sourceSegs);var sourceListener=function(newValue,oldValue,path,changeRequest,trans,applier){var transId=trans.id,transRec=fluid.getModelTransactionRec(target,transId);applier&&trans&&!transRec[applier.applierId]&&(transRec[applier.applierId]={transaction:trans});var existing=transRec[applierId];transRec[linkId]=transRec[linkId]||0;++transRec[linkId],transRec[linkId]>fluid.relayRecursionBailout&&fluid.fail("Error in model relay specification at component ",target," - operated more than "+fluid.relayRecursionBailout+" relays without model value settling - current model contents are ",trans.newHolder.model),existing||(existing=fluid.registerRelayTransaction(transRec,targetApplier,transId,options,npOptions)),transducer&&!options.targetApplier?transducer(existing.transaction,options.sourceApplier?void 0:newValue,sourceSegs,targetSegs,changeRequest):(changeRequest&&"DELETE"===changeRequest.type&&existing.transaction.fireChangeRequest({type:"DELETE",segs:targetSegs}),void 0!==newValue&&existing.transaction.fireChangeRequest({type:"ADD",segs:targetSegs,value:newValue}))},spec=sourceApplier.modelChanged.addListener({isRelay:!0,cond:transducer&&transducer.cond,targetId:target.id,targetApplierId:targetApplier.id,segs:sourceSegs,transactional:options.transactional},sourceListener);fluid.passLogLevel(fluid.logLevel.TRACE)&&fluid.log(fluid.logLevel.TRACE,"Adding relay listener with listenerId "+spec.listenerId+" to source applier with id "+sourceApplier.applierId+" from target applier with id "+applierId+" for target component with id "+target.id),source&&(fluid.recordChangeListener(source,sourceApplier,sourceListener,spec.listenerId),target!==source&&fluid.recordChangeListener(target,sourceApplier,sourceListener,spec.listenerId))},fluid.connectModelRelay=function(source,sourceSegs,target,targetSegs,options){var linkId=fluid.allocateGuid();function enlistComponent(component){var enlist=fluid.enlistModelComponent(component);enlist.complete&&(fluid.shadowForComponent(component).modelComplete&&(enlist.completeOnInit=!0))}enlistComponent(target),enlistComponent(source);var npOptions=fluid.filterKeys(options,["namespace","priority"]);options.update?options.targetApplier?fluid.registerDirectChangeRelay(source,sourceSegs,target,targetSegs,linkId,null,{transactional:!1,targetApplier:options.targetApplier,update:options.update},npOptions):fluid.registerDirectChangeRelay(target,targetSegs,source,[],linkId+"-transform",options.forwardAdapter,{transactional:!0,sourceApplier:options.forwardApplier},npOptions):(fluid.registerDirectChangeRelay(target,targetSegs,source,sourceSegs,linkId,options.forwardAdapter,{transactional:!1},npOptions),fluid.registerDirectChangeRelay(source,sourceSegs,target,targetSegs,linkId,options.backwardAdapter,{transactional:!1},npOptions))},fluid.parseSourceExclusionSpec=function(targetSpec,sourceSpec){return targetSpec.excludeSource=fluid.arrayToHash(fluid.makeArray(sourceSpec.excludeSource||(sourceSpec.includeSource?"*":void 0))),targetSpec.includeSource=fluid.arrayToHash(fluid.makeArray(sourceSpec.includeSource)),targetSpec},fluid.isExcludedChangeSource=function(transaction,spec){if(!spec||!spec.excludeSource)return!1;var excluded=spec.excludeSource["*"];for(var source in transaction.fullSources)spec.excludeSource[source]&&(excluded=!0),spec.includeSource[source]&&(excluded=!1);return excluded},fluid.model.guardedAdapter=function(transaction,cond,func,args){fluid.isExcludedChangeSource(transaction,cond)||func===fluid.model.transform.uninvertibleTransform||func.apply(null,args)},fluid.transformToAdapter=function(transform,targetPath){var basedTransform={};return basedTransform[targetPath]=transform,function(trans,newValue,sourceSegs,targetSegs,changeRequest){changeRequest&&"DELETE"===changeRequest.type&&trans.fireChangeRequest({type:"DELETE",path:targetPath}),fluid.model.transformWithRules(newValue,basedTransform,{finalApplier:trans})}},fluid.makeTransformPackage=function(componentThat,transform,sourcePath,targetPath,forwardCond,backwardCond,namespace,priority){var that={forwardHolder:{model:transform},backwardHolder:{model:null},generateAdapters:function(trans){if(that.forwardAdapterImpl=fluid.transformToAdapter(trans?trans.newHolder.model:that.forwardHolder.model,targetPath),null!==sourcePath){var inverted=fluid.model.transform.invertConfiguration(transform);inverted!==fluid.model.transform.uninvertibleTransform?(that.backwardHolder.model=inverted,that.backwardAdapterImpl=fluid.transformToAdapter(that.backwardHolder.model,sourcePath)):that.backwardAdapterImpl=inverted}},forwardAdapter:function(transaction,newValue){void 0===newValue&&that.generateAdapters(),fluid.model.guardedAdapter(transaction,forwardCond,that.forwardAdapterImpl,arguments)}};that.forwardAdapter.cond=forwardCond,that.runTransform=function(trans){trans.commit(),trans.reset()},that.forwardApplier=fluid.makeHolderChangeApplier(that.forwardHolder),that.forwardApplier.isRelayApplier=!0,that.invalidator=fluid.makeEventFirer({name:"Invalidator for model relay with applier "+that.forwardApplier.applierId}),null!==sourcePath&&(that.backwardApplier=fluid.makeHolderChangeApplier(that.backwardHolder),that.backwardAdapter=function(transaction){fluid.model.guardedAdapter(transaction,backwardCond,that.backwardAdapterImpl,arguments)},that.backwardAdapter.cond=backwardCond),that.update=that.invalidator.fire;var implicitOptions={targetApplier:that.forwardApplier,update:that.update,namespace:namespace,priority:priority,refCount:0};return that.forwardHolder.model=fluid.parseImplicitRelay(componentThat,transform,[],implicitOptions),that.refCount=implicitOptions.refCount,that.namespace=namespace,that.priority=priority,that.generateAdapters(),that.invalidator.addListener(that.generateAdapters),that.invalidator.addListener(that.runTransform),that},fluid.singleTransformToFull=function(singleTransform){return{"":{transform:$.extend(!0,{inputPath:""},singleTransform)}}},fluid.model.relayConditions={initOnly:{includeSource:"init"},liveOnly:{excludeSource:"init"},never:{includeSource:[]},always:{}},fluid.model.parseRelayCondition=function(condition){var exclusionRec;return"initOnly"===condition?fluid.log(fluid.logLevel.WARN,'The relay condition "initOnly" is deprecated: Please use the form \'includeSource: "init"\' instead'):"liveOnly"===condition&&fluid.log(fluid.logLevel.WARN,'The relay condition "liveOnly" is deprecated: Please use the form \'excludeSource: "init"\' instead'),condition?"string"==typeof condition?(exclusionRec=fluid.model.relayConditions[condition])||fluid.fail('Unrecognised model relay condition string "'+condition+'": the supported values are "never" or a record with members "includeSource" and/or "excludeSource"'):exclusionRec=condition:exclusionRec={},fluid.parseSourceExclusionSpec({},exclusionRec)},fluid.parseModelRelay=function(that,mrrec,key){var parsedSource=void 0!==mrrec.source?fluid.parseValidModelReference(that,'modelRelay record member "source"',mrrec.source):{path:null,modelSegs:null},parsedTarget=fluid.parseValidModelReference(that,'modelRelay record member "target"',mrrec.target),namespace=mrrec.namespace||key,transform=mrrec.singleTransform?fluid.singleTransformToFull(mrrec.singleTransform):mrrec.transform;transform||fluid.fail('Cannot parse modelRelay record without element "singleTransform" or "transform":',mrrec);var forwardCond=fluid.model.parseRelayCondition(mrrec.forward),backwardCond=fluid.model.parseRelayCondition(mrrec.backward),transformPackage=fluid.makeTransformPackage(that,transform,parsedSource.path,parsedTarget.path,forwardCond,backwardCond,namespace,mrrec.priority);0===transformPackage.refCount?fluid.connectModelRelay(parsedSource.that||that,parsedSource.modelSegs,parsedTarget.that,parsedTarget.modelSegs,fluid.filterKeys(transformPackage,["forwardAdapter","backwardAdapter","namespace","priority"])):(parsedSource.modelSegs&&fluid.fail('Error in model relay definition: If a relay transform has a model dependency, you can not specify a "source" entry - please instead enter this as "input" in the transform specification. Definition was ',mrrec," for component ",that),fluid.connectModelRelay(that,null,parsedTarget.that,parsedTarget.modelSegs,transformPackage))},fluid.parseImplicitRelay=function(that,modelRec,segs,options){var value;if(fluid.isIoCReference(modelRec)){var parsed=fluid.parseValidModelReference(that,"model reference from model (implicit relay)",modelRec,!0);parsed.nonModel?value=fluid.getForComponent(parsed.that,parsed.segs):(++options.refCount,fluid.connectModelRelay(that,segs,parsed.that,parsed.modelSegs,options))}else fluid.isPrimitive(modelRec)||!fluid.isPlainObject(modelRec)?value=modelRec:modelRec.expander&&fluid.isPlainObject(modelRec.expander)?value=fluid.expandOptions(modelRec,that):(value=fluid.freshContainer(modelRec),fluid.each(modelRec,function(innerValue,key){segs.push(key);var innerTrans=fluid.parseImplicitRelay(that,innerValue,segs,options);void 0!==innerTrans&&(value[key]=innerTrans),segs.pop()}));return value},fluid.model.notifyExternal=function(transRec){var allChanges=transRec?fluid.values(transRec.externalChanges):[];fluid.sortByPriority(allChanges);for(var i=0;i<allChanges.length;++i){var change=allChanges[i];change.args[5].destroyed||change.listener.apply(null,change.args)}fluid.clearLinkCounts(transRec,!0)},fluid.model.commitRelays=function(instantiator,transactionId){var transRec=instantiator.modelTransactions[transactionId];fluid.each(transRec,function(transEl){transEl.transaction&&(transEl.transaction.commit("relay"),transEl.transaction.reset())})},fluid.model.updateRelays=function(instantiator,transactionId){var transRec=instantiator.modelTransactions[transactionId],updates=0;return fluid.sortByPriority(transRec.relays),fluid.each(transRec.relays,function(transEl){0<transEl.transaction.changeRecord.changes&&transEl.relayCount<2&&transEl.options.update&&(transEl.relayCount++,fluid.clearLinkCounts(transRec),transEl.options.update(transEl.transaction,transRec),++updates)}),updates},fluid.establishModelRelay=function(that,optionsModel,optionsML,optionsMR,applier){var shadow=fluid.shadowForComponent(that);shadow.modelRelayEstablished?fluid.fail("FLUID-5887 failure: Model relay initialised twice on component",that):shadow.modelRelayEstablished=!0,fluid.mergeModelListeners(that,optionsML);var enlist=fluid.enlistModelComponent(that);fluid.each(optionsMR,function(mrrec,key){for(var i=0;i<mrrec.length;++i)fluid.parseModelRelay(that,mrrec[i],key)});var initModels=fluid.transform(optionsModel,function(modelRec){return fluid.parseImplicitRelay(that,modelRec,[],{refCount:0,priority:"first"})});enlist.initModels=initModels;var instantiator=fluid.getInstantiator(that);return applier.preCommit.addListener(function(transaction){for(;0<fluid.model.updateRelays(instantiator,transaction.id););}),applier.preCommit.addListener(function(transaction,applier,code){"relay"!==code&&fluid.model.commitRelays(instantiator,transaction.id)}),applier.postCommit.addListener(function(transaction,applier,code){"relay"!==code&&(fluid.model.notifyExternal(instantiator.modelTransactions[transaction.id]),delete instantiator.modelTransactions[transaction.id])}),null},fluid.defaults("fluid.modelComponent",{gradeNames:["fluid.component"],changeApplierOptions:{relayStyle:!0,cullUnchanged:!0},members:{model:"@expand:fluid.initRelayModel({that}, {that}.modelRelay)",applier:"@expand:fluid.makeHolderChangeApplier({that}, {that}.options.changeApplierOptions)",modelRelay:"@expand:fluid.establishModelRelay({that}, {that}.options.model, {that}.options.modelListeners, {that}.options.modelRelay, {that}.applier)"},mergePolicy:{model:{noexpand:!0,func:fluid.arrayConcatPolicy},modelListeners:fluid.makeMergeListenersPolicy(fluid.arrayConcatPolicy),modelRelay:fluid.makeMergeListenersPolicy(fluid.arrayConcatPolicy,!0)}}),fluid.modelChangedToChange=function(args){return{value:args[0],oldValue:args[1],path:args[2],transaction:args[4]}},fluid.event.invokeListener=function(listener,args,localRecord,mergeRecord){return"string"==typeof listener&&(listener=fluid.event.resolveListener(listener)),listener.apply(null,args,localRecord,mergeRecord)},fluid.resolveModelListener=function(that,record){var togo=function(){if(!fluid.isDestroyed(that)){var change=fluid.modelChangedToChange(arguments),args=arguments,localRecord={change:change,arguments:args},mergeRecord={source:Object.keys(change.transaction.sources)};record.args&&(args=fluid.expandOptions(record.args,that,{},localRecord)),fluid.event.invokeListener(record.listener,fluid.makeArray(args),localRecord,mergeRecord)}};return fluid.event.impersonateListener(record.listener,togo),togo},fluid.registerModelListeners=function(that,record,paths,namespace){var func=fluid.resolveModelListener(that,record);fluid.each(record.byTarget,function(parsedArray){var parsed=parsedArray[0],spec={listener:func,listenerId:fluid.allocateGuid(),segsArray:fluid.getMembers(parsedArray,"modelSegs"),pathArray:fluid.getMembers(parsedArray,"path"),includeSource:record.includeSource,excludeSource:record.excludeSource,priority:fluid.expandOptions(record.priority,that),transactional:!0};(spec=parsed.applier.modelChanged.addListener(spec,func,namespace,record.softNamespace),fluid.recordChangeListener(that,parsed.applier,func,spec.listenerId),that===parsed.that||fluid.isModelComplete(that))||fluid.getForComponent(that,["events","onCreate"]).addListener(function(){if(fluid.isModelComplete(parsed.that)){var trans=parsed.applier.initiate(null,"init");fluid.initModelEvent(that,parsed.applier,trans,[spec]),trans.commit()}})})},fluid.mergeModelListeners=function(that,listeners){fluid.each(listeners,function(value,key){"string"==typeof value&&(value={funcName:value});var records=fluid.event.resolveListenerRecord(value,that,"modelListeners",null,!1).records;fluid.each(records,function(record){record.byTarget={};var paths=fluid.makeArray(void 0===record.path?key:record.path);fluid.each(paths,function(path){var parsed=fluid.parseValidModelReference(that,"modelListeners entry",path);fluid.pushArray(record.byTarget,parsed.that.id,parsed)});var namespace=(record.namespace&&!record.softNamespace?record.namespace:null)||(void 0!==record.path?key:null);fluid.registerModelListeners(that,record,paths,namespace)})})},fluid.fireChanges=function(applier,changes){for(var i=0;i<changes.length;++i)applier.fireChangeRequest(changes[i])},fluid.model.isChangedPath=function(changeMap,segs){for(var i=0;i<=segs.length;++i){if("string"==typeof changeMap)return!0;i<segs.length&&changeMap&&(changeMap=changeMap[segs[i]])}return!1},fluid.model.setChangedPath=function(options,segs,value){var notePath=function(record){segs.unshift(record),fluid.model.setSimple(options,segs,value),segs.shift()};fluid.model.isChangedPath(options.changeMap,segs)||(++options.changes,notePath("changeMap")),fluid.model.isChangedPath(options.deltaMap,segs)||(++options.deltas,notePath("deltaMap"))},fluid.model.fetchChangeChildren=function(target,i,segs,source,options){fluid.each(source,function(value,key){segs[i]=key,fluid.model.applyChangeStrategy(target,key,i,segs,value,options),segs.length=i})},fluid.model.isSameValue=function(a,b){return"number"!=typeof a||"number"!=typeof b?a===b:a===b||a!=a&&b!=b||Math.abs((a-b)/b)<1e-12},fluid.model.applyChangeStrategy=function(target,name,i,segs,source,options){var targetSlot=target[name],sourceCode=fluid.typeCode(source),targetCode=fluid.typeCode(targetSlot),changedValue=fluid.NO_VALUE;"primitive"===sourceCode?fluid.model.isSameValue(targetSlot,source)||(changedValue=source,++options.unchanged):(targetCode!==sourceCode||"array"===sourceCode&&source.length!==targetSlot.length)&&(changedValue=fluid.freshContainer(source)),changedValue!==fluid.NO_VALUE&&(target[name]=changedValue,options.changeMap&&fluid.model.setChangedPath(options,segs,options.inverse?"DELETE":"ADD")),"primitive"!==sourceCode&&fluid.model.fetchChangeChildren(target[name],i+1,segs,source,options)},fluid.model.stepTargetAccess=function(target,type,segs,startpos,endpos,options){for(var i=startpos;i<endpos;++i){if(target)target[segs[i]]!==(target=fluid.model.traverseWithStrategy(target,segs,i,options["ADD"===type?"resolverSetConfig":"resolverGetConfig"],segs.length-i-1))&&options.changeMap&&fluid.model.setChangedPath(options,segs.slice(0,i+1),"ADD")}return{root:target,last:segs[endpos]}},fluid.model.defaultAccessorConfig=function(options){return(options=options||{}).resolverSetConfig=options.resolverSetConfig||fluid.model.escapedSetConfig,options.resolverGetConfig=options.resolverGetConfig||fluid.model.escapedGetConfig,options},fluid.model.applyHolderChangeRequest=function(holder,request,options){(options=fluid.model.defaultAccessorConfig(options)).deltaMap=options.changeMap?{}:null,options.deltas=0;var pen,length=request.segs.length,atRoot=0===length;if(pen=atRoot?{root:holder,last:"model"}:(holder.model||(holder.model={},fluid.model.setChangedPath(options,[],options.inverse?"DELETE":"ADD")),fluid.model.stepTargetAccess(holder.model,request.type,request.segs,0,length-1,options)),"ADD"===request.type){var value=request.value,segs=fluid.makeArray(request.segs);fluid.model.applyChangeStrategy(pen.root,pen.last,length-1,segs,value,options,atRoot)}else"DELETE"===request.type?pen.root&&void 0!==pen.root[pen.last]&&(delete pen.root[pen.last],options.changeMap&&fluid.model.setChangedPath(options,request.segs,"DELETE")):fluid.fail("Unrecognised change type of "+request.type);return options.deltas?options.deltaMap:null},fluid.model.diff=function(modela,modelb,options){options=options||{changes:0,unchanged:0,changeMap:{}};var togo,typea=fluid.typeCode(modela),typeb=fluid.typeCode(modelb);if("primitive"===typea&&"primitive"===typeb)togo=fluid.model.isSameValue(modela,modelb);else if("primitive"===typea^"primitive"===typeb)togo=!1;else{var holdera={model:fluid.copy(modela)};fluid.model.applyHolderChangeRequest(holdera,{value:modelb,segs:[],type:"ADD"},options);var holderb={model:fluid.copy(modelb)};options.inverse=!0,fluid.model.applyHolderChangeRequest(holderb,{value:modela,segs:[],type:"ADD"},options),togo=0===options.changes}return!1===togo&&0===options.changes?(options.changes=1,options.changeMap=void 0===modelb?"DELETE":"ADD"):!0===togo&&0===options.unchanged&&(options.unchanged=1),togo},fluid.outputMatches=function(matches,outSegs,root){fluid.each(root,function(value,key){matches.push(outSegs.concat(key))})},fluid.matchChanges=function(changeMap,specSegs,newHolder,oldHolder){for(var newRoot=newHolder.model,oldRoot=oldHolder.model,map=changeMap,outSegs=["model"],wildcard=!1,togo=[],i=0;i<specSegs.length;++i){var seg=specSegs[i];"*"===seg?i===specSegs.length-1?wildcard=!0:fluid.fail("Wildcard specification in modelChanged listener is only supported for the final path segment: "+specSegs.join(".")):(outSegs.push(seg),map=fluid.isPrimitive(map)?map:map[seg],newRoot=newRoot?newRoot[seg]:void 0,oldRoot=oldRoot?oldRoot[seg]:void 0)}return map&&(wildcard?"DELETE"===map?fluid.outputMatches(togo,outSegs,oldRoot):"ADD"===map?fluid.outputMatches(togo,outSegs,newRoot):fluid.outputMatches(togo,outSegs,map):togo.push(outSegs)),togo},fluid.storeExternalChange=function(transRec,applier,invalidPath,spec,args){var pathString=applier.composeSegments.apply(null,invalidPath),keyString=[applier.holder.id,spec.listenerId,spec.wildcard?pathString:""].join("|");transRec.externalChanges[keyString]={listener:spec.listener,namespace:spec.namespace,priority:spec.priority,args:args}},fluid.notifyModelChanges=function(listeners,changeMap,newHolder,oldHolder,changeRequest,transaction,applier,that){if(listeners)for(var transRec=transaction&&fluid.getModelTransactionRec(that,transaction.id),i=0;i<listeners.length;++i)for(var spec=listeners[i],multiplePaths=1<spec.segsArray.length,j=0;j<spec.segsArray.length;++j)for(var invalidPaths=fluid.matchChanges(changeMap,spec.segsArray[j],newHolder,oldHolder),k=0;k<invalidPaths.length;++k){if(applier.destroyed)return;var invalidPath=invalidPaths[k];spec.listener=fluid.event.resolveListener(spec.listener);var args=[multiplePaths?newHolder.model:fluid.model.getSimple(newHolder,invalidPath),multiplePaths?oldHolder.model:fluid.model.getSimple(oldHolder,invalidPath),multiplePaths?[]:invalidPath.slice(1),changeRequest,transaction,applier];if(!spec.isRelay){if(fluid.model.diff(args[0],args[1]))continue;if(fluid.isExcludedChangeSource(transaction,spec))continue}transRec&&!spec.isRelay&&spec.transactional?fluid.storeExternalChange(transRec,applier,invalidPath,spec,args):spec.listener.apply(null,args)}},fluid.bindELMethods=function(applier){applier.parseEL=function(EL){return fluid.model.pathToSegments(EL,applier.options.resolverSetConfig)},applier.composeSegments=function(){return applier.options.resolverSetConfig.parser.compose.apply(null,arguments)}},fluid.initModelEvent=function(that,applier,trans,listeners){fluid.notifyModelChanges(listeners,"ADD",trans.oldHolder,fluid.emptyHolder,null,trans,applier,that)},fluid.emptyHolder=fluid.freezeRecursive({model:void 0}),fluid.preFireChangeRequest=function(applier,changeRequest){changeRequest.type||(changeRequest.type="ADD"),changeRequest.segs=changeRequest.segs||applier.parseEL(changeRequest.path)},fluid.bindRequestChange=function(that){that.change=function(path,value,type,source){var changeRequest={path:path,value:value,type:type,source:source};that.fireChangeRequest(changeRequest)}},fluid.isObjectSimple=function(totest){return"[object Object]"===Object.prototype.toString.call(totest)},fluid.mergeChangeSources=function(target,globalSources){fluid.isObjectSimple(globalSources)?fluid.extend(target,globalSources):fluid.each(fluid.makeArray(globalSources),function(globalSource){target[globalSource]=!0})},fluid.ChangeApplier=function(){},fluid.makeHolderChangeApplier=function(holder,options){options=fluid.model.defaultAccessorConfig(options);var applierId=fluid.allocateGuid(),that=new fluid.ChangeApplier,name=fluid.isComponent(holder)?"ChangeApplier for component "+fluid.dumpThat(holder):"ChangeApplier with id "+applierId;return $.extend(that,{applierId:applierId,holder:holder,listeners:fluid.makeEventFirer({name:"Internal change listeners for "+name}),transListeners:fluid.makeEventFirer({name:"External change listeners for "+name}),options:options,modelChanged:{},preCommit:fluid.makeEventFirer({name:"preCommit event for "+name}),postCommit:fluid.makeEventFirer({name:"postCommit event for "+name})}),that.destroy=function(){that.preCommit.destroy(),that.postCommit.destroy(),that.destroyed=!0},that.modelChanged.addListener=function(spec,listener,namespace,softNamespace){return(spec="string"==typeof spec?{path:spec}:fluid.copy(spec)).listenerId=spec.listenerId||fluid.allocateGuid(),spec.namespace=namespace,spec.softNamespace=softNamespace,"string"==typeof listener&&(listener={globalName:listener}),spec.listener=listener,!1!==spec.transactional&&(spec.transactional=!0),spec.segsArray||(void 0!==spec.path&&(spec.segs=spec.segs||that.parseEL(spec.path)),spec.segsArray||(spec.segsArray=[spec.segs])),spec.isRelay||(fluid.parseSourceExclusionSpec(spec,spec),spec.wildcard=fluid.accumulate(fluid.transform(spec.segsArray,function(segs){return fluid.contains(segs,"*")}),fluid.add,0),spec.wildcard&&1<spec.segsArray.length&&fluid.fail("Error in model listener specification ",spec," - you may not supply a wildcard pattern as one of a set of multiple paths to be matched")),that[spec.transactional?"transListeners":"listeners"].addListener(spec),spec},that.modelChanged.removeListener=function(listener){that.listeners.removeListener(listener),that.transListeners.removeListener(listener)},that.fireChangeRequest=function(changeRequest){var ation=that.initiate("local",changeRequest.source);ation.fireChangeRequest(changeRequest),ation.commit()},that.initiate=function(localSource,globalSources,transactionId){var defeatPost="relay"===(localSource="init"===globalSources?null:localSource||"local"),trans={instanceId:fluid.allocateGuid(),id:transactionId||fluid.allocateGuid(),changeRecord:{resolverSetConfig:options.resolverSetConfig,resolverGetConfig:options.resolverGetConfig},reset:function(){trans.oldHolder=holder,trans.newHolder={model:fluid.copy(holder.model)},trans.changeRecord.changes=0,trans.changeRecord.unchanged=0,trans.changeRecord.changeMap={}},commit:function(code){if(that.preCommit.fire(trans,that,code),0<trans.changeRecord.changes){var oldHolder={model:holder.model};holder.model=trans.newHolder.model,fluid.notifyModelChanges(that.transListeners.sortedListeners,trans.changeRecord.changeMap,holder,oldHolder,null,trans,that,holder)}defeatPost||that.postCommit.fire(trans,that,code)},fireChangeRequest:function(changeRequest){fluid.preFireChangeRequest(that,changeRequest),changeRequest.transactionId=trans.id;var deltaMap=fluid.model.applyHolderChangeRequest(trans.newHolder,changeRequest,trans.changeRecord);fluid.notifyModelChanges(that.listeners.sortedListeners,deltaMap,trans.newHolder,holder,changeRequest,trans,that,holder)},hasChangeSource:function(source){return trans.fullSources[source]}},transRec=fluid.getModelTransactionRec(holder,trans.id);return transRec&&(fluid.mergeChangeSources(transRec.sources,globalSources),trans.sources=transRec.sources,trans.fullSources=Object.create(transRec.sources),trans.fullSources[localSource]=!0),trans.reset(),fluid.bindRequestChange(trans),trans},fluid.bindRequestChange(that),fluid.bindELMethods(that),that},fluid.modelPairToChanges=function(value,oldValue,changePathPrefix){changePathPrefix=changePathPrefix||"";var diffOptions={changes:0,unchanged:0,changeMap:{}};fluid.model.diff(oldValue,value,diffOptions);var changes=[];return fluid.modelPairToChangesImpl(value,fluid.pathUtil.parseEL(changePathPrefix),diffOptions.changeMap,[],changes),changes},fluid.modelPairToChangesImpl=function(value,changePathPrefixSegs,changeMap,changeSegs,changes){"ADD"===changeMap?changes.push({path:changePathPrefixSegs,value:value,type:"ADD"}):"DELETE"===changeMap?changes.push({path:changePathPrefixSegs,value:null,type:"DELETE"}):fluid.isPlainObject(changeMap,!0)&&fluid.each(changeMap,function(change,seg){var currentChangeSegs=changeSegs.concat([seg]);"ADD"===change?changes.push({path:changePathPrefixSegs.concat(currentChangeSegs),value:fluid.get(value,currentChangeSegs),type:"ADD"}):"DELETE"===change?changes.push({path:changePathPrefixSegs.concat(currentChangeSegs),value:null,type:"DELETE"}):fluid.isPlainObject(change,!0)&&fluid.modelPairToChangesImpl(value,changePathPrefixSegs,change,currentChangeSegs,changes)})}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.remoteModelComponent",{gradeNames:["fluid.modelComponent"],events:{afterFetch:null,onFetch:null,onFetchError:null,afterWrite:null,onWrite:null,onWriteError:null},members:{pendingRequests:{write:null,fetch:null}},model:{local:{},remote:{},requestInFlight:!1},modelListeners:{requestInFlight:{listener:"fluid.remoteModelComponent.launchPendingRequest",args:["{that}"]}},listeners:{"afterFetch.updateModel":{listener:"fluid.remoteModelComponent.updateModelFromFetch",args:["{that}","{arguments}.0"],priority:"before:unblock"},"afterFetch.unblock":{listener:"fluid.remoteModelComponent.unblockFetchReq",args:["{that}"]},"onFetchError.unblock":{listener:"fluid.remoteModelComponent.unblockFetchReq",args:["{that}"]},"afterWrite.updateRemoteModel":{listener:"fluid.remoteModelComponent.updateRemoteFromLocal",args:["{that}"]},"afterWrite.unblock":{changePath:"requestInFlight",value:!1,priority:"after:updateRemoteModel"},"onWriteError.unblock":{changePath:"requestInFlight",value:!1}},invokers:{fetch:{funcName:"fluid.remoteModelComponent.fetch",args:["{that}"]},fetchImpl:"fluid.notImplemented",write:{funcName:"fluid.remoteModelComponent.write",args:["{that}"]},writeImpl:"fluid.notImplemented"}}),fluid.remoteModelComponent.launchPendingRequest=function(that){that.model.requestInFlight||(that.pendingRequests.fetch?that.fetch():that.pendingRequests.write&&that.write())},fluid.remoteModelComponent.updateModelFromFetch=function(that,fetchedModel){var remoteChanges=fluid.modelPairToChanges(fetchedModel,that.model.remote,"local"),localChanges=fluid.modelPairToChanges(that.model.local,that.model.remote,"local"),changes=remoteChanges.concat(localChanges),transaction=that.applier.initiate();transaction.fireChangeRequest({path:"local",type:"DELETE"}),transaction.change("local",that.model.remote),transaction.fireChangeRequest({path:"remote",type:"DELETE"}),transaction.change("remote",fetchedModel),fluid.fireChanges(transaction,changes),transaction.commit()},fluid.remoteModelComponent.updateRemoteFromLocal=function(that){var transaction=that.applier.initiate();transaction.fireChangeRequest({path:"remote",type:"DELETE"}),transaction.change("remote",that.model.local),transaction.commit()},fluid.remoteModelComponent.makeSequenceStrategy=function(payload){return{invokeNext:function(that){var lisrec=that.sources[that.index];return lisrec.listener=fluid.event.resolveListener(lisrec.listener),lisrec.listener.apply(null,[payload,that.options])},resolveResult:function(){return payload}}},fluid.remoteModelComponent.makeSequence=function(listeners,payload,options){var sequencer=fluid.promise.makeSequencer(listeners,options,fluid.remoteModelComponent.makeSequenceStrategy(payload));return fluid.promise.resumeSequence(sequencer),sequencer},fluid.remoteModelComponent.fireEventSequence=function(event,payload,options){var listeners=fluid.makeArray(event.sortedListeners);return fluid.remoteModelComponent.makeSequence(listeners,payload,options).promise},fluid.remoteModelComponent.fetch=function(that){var activePromise,promise=fluid.promise();(that.pendingRequests.fetch?(activePromise=that.pendingRequests.fetch,fluid.promise.follow(activePromise,promise)):(activePromise=promise,that.pendingRequests.fetch=promise),that.model.requestInFlight)||fluid.remoteModelComponent.fireEventSequence(that.events.onFetch).then(function(){that.applier.change("requestInFlight",!0),that.fetchImpl().then(function(data){var afterFetchSeqPromise=fluid.remoteModelComponent.fireEventSequence(that.events.afterFetch,data);fluid.promise.follow(afterFetchSeqPromise,activePromise)},that.events.onFetchError.fire)},that.events.onFetchError.fire);return promise},fluid.remoteModelComponent.unblockFetchReq=function(that){that.pendingRequests.fetch=null,that.applier.change("requestInFlight",!1)},fluid.remoteModelComponent.write=function(that){var activePromise,promise=fluid.promise();(that.pendingRequests.write?(activePromise=that.pendingRequests.write,fluid.promise.follow(that.pendingRequests.write,promise)):activePromise=promise,that.model.requestInFlight)?that.pendingRequests.write=activePromise:fluid.remoteModelComponent.fireEventSequence(that.events.onWrite).then(function(){if(that.applier.change("requestInFlight",!0),that.pendingRequests.write=null,fluid.model.diff(that.model.local,that.model.remote)){var afterWriteSeqPromise=fluid.remoteModelComponent.fireEventSequence(that.events.afterWrite,that.model.local);fluid.promise.follow(afterWriteSeqPromise,activePromise)}else{that.writeImpl(that.model.local).then(function(data){var afterWriteSeqPromise=fluid.remoteModelComponent.fireEventSequence(that.events.afterWrite,data);fluid.promise.follow(afterWriteSeqPromise,activePromise)},that.events.onWriteError.fire)}},that.events.onWriteError.fire);return promise}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.model.transform"),fluid.defaults("fluid.transformFunction",{gradeNames:"fluid.function"}),fluid.defaults("fluid.standardInputTransformFunction",{gradeNames:"fluid.transformFunction"}),fluid.defaults("fluid.standardOutputTransformFunction",{gradeNames:"fluid.transformFunction"}),fluid.defaults("fluid.multiInputTransformFunction",{gradeNames:"fluid.transformFunction"}),fluid.defaults("fluid.standardTransformFunction",{gradeNames:["fluid.standardInputTransformFunction","fluid.standardOutputTransformFunction"]}),fluid.defaults("fluid.lens",{gradeNames:"fluid.transformFunction",invertConfiguration:null}),fluid.model.transform.pathToRule=function(inputPath){return{transform:{type:"fluid.transforms.value",inputPath:inputPath}}},fluid.model.transform.literalValueToRule=function(input){return{transform:{type:"fluid.transforms.literalValue",input:input}}},fluid.model.composePaths=function(prefix,suffix){return suffix=0===suffix?"0":suffix||"",(prefix=0===prefix?"0":prefix||"")?suffix?prefix+"."+suffix:prefix:suffix},fluid.model.transform.accumulateInputPath=function(inputPath,transformer,paths){void 0!==inputPath&&paths.push(fluid.model.composePaths(transformer.inputPrefix,inputPath))},fluid.model.transform.accumulateStandardInputPath=function(input,transformSpec,transformer,paths){fluid.model.transform.getValue(void 0,transformSpec[input],transformer),fluid.model.transform.accumulateInputPath(transformSpec[input+"Path"],transformer,paths)},fluid.model.transform.accumulateMultiInputPaths=function(inputVariables,transformSpec,transformer,paths){fluid.each(inputVariables,function(v,k){fluid.model.transform.accumulateStandardInputPath(k,transformSpec,transformer,paths)})},fluid.model.transform.getValue=function(inputPath,value,transformer){var togo;return void 0!==inputPath&&(togo=fluid.get(transformer.source,fluid.model.composePaths(transformer.inputPrefix,inputPath),transformer.resolverGetConfig)),void 0===togo&&(togo=fluid.isPrimitive(value)?value:"literalValue"in value?value.literalValue:void 0===value.transform?value:transformer.expand(value)),togo},fluid.model.transform.NONDEFAULT_OUTPUT_PATH_RETURN={},fluid.model.transform.setValue=function(userOutputPath,value,transformer){var toset=fluid.copy(value),outputPath=fluid.model.composePaths(transformer.outputPrefix,userOutputPath);return void 0!==toset&&transformer.applier.change(outputPath,toset),userOutputPath?fluid.model.transform.NONDEFAULT_OUTPUT_PATH_RETURN:toset},fluid.model.transform.resolveParam=function(transformSpec,transformer,key,def){var val=fluid.model.transform.getValue(transformSpec[key+"Path"],transformSpec[key],transformer);return void 0!==val?val:def},fluid.model.transform.matchValue=function(expected,actual,partialMatches){var stats={changes:0,unchanged:0,changeMap:{}};return fluid.model.diff(expected,actual,stats),0===stats.unchanged?0:partialMatches?0xffffff000000-16777216*stats.changes+stats.unchanged:stats.changes?0:0xffffff000000+stats.unchanged},fluid.model.transform.invertPaths=function(transformSpec,transformer){var oldOutput=fluid.model.composePaths(transformer.outputPrefix,transformSpec.outputPath);return transformSpec.outputPath=fluid.model.composePaths(transformer.inputPrefix,transformSpec.inputPath),transformSpec.inputPath=oldOutput,transformSpec},fluid.model.transform.prefixApplier=function(transformSpec,transformer){transformSpec.inputPrefix&&transformer.inputPrefixOp.push(transformSpec.inputPrefix),transformSpec.outputPrefix&&transformer.outputPrefixOp.push(transformSpec.outputPrefix),transformer.expand(transformSpec.input),transformSpec.inputPrefix&&transformer.inputPrefixOp.pop(),transformSpec.outputPrefix&&transformer.outputPrefixOp.pop()},fluid.defaults("fluid.model.transform.prefixApplier",{gradeNames:["fluid.transformFunction"]}),fluid.model.makePathStack=function(transform,prefixName){var stack=transform[prefixName+"Stack"]=[];return transform[prefixName]="",{push:function(prefix){var newPath=fluid.model.composePaths(transform[prefixName],prefix);stack.push(transform[prefixName]),transform[prefixName]=newPath},pop:function(){transform[prefixName]=stack.pop()}}},fluid.model.transform.doTransform=function(transformSpec,transformer,transformOpts){var expdef=transformOpts.defaults,transformFn=fluid.getGlobalValue(transformOpts.typeName);"function"!=typeof transformFn&&fluid.fail("Transformation record specifies transformation function with name "+transformSpec.type+" which is not a function - ",transformFn),fluid.hasGrade(expdef,"fluid.transformFunction")||(expdef=fluid.defaults("fluid.standardTransformFunction"));var transformArgs=[transformSpec,transformer];if(fluid.hasGrade(expdef,"fluid.multiInputTransformFunction")){var inputs={};fluid.each(expdef.inputVariables,function(v,k){inputs[k]=function(){var input=fluid.model.transform.getValue(transformSpec[k+"Path"],transformSpec[k],transformer);return input=void 0===input&&null!==v?v:input}}),transformArgs.unshift(inputs)}if(fluid.hasGrade(expdef,"fluid.standardInputTransformFunction")){"input"in transformSpec||"inputPath"in transformSpec||fluid.fail('Error in transform specification. Either "input" or "inputPath" must be specified for a standardInputTransformFunction: received ',transformSpec);var expanded=fluid.model.transform.getValue(transformSpec.inputPath,transformSpec.input,transformer);if(transformArgs.unshift(expanded),void 0===expanded)return}var transformed=transformFn.apply(null,transformArgs);fluid.hasGrade(expdef,"fluid.standardOutputTransformFunction")&&(void 0!==(void 0!==transformSpec.outputPath?transformSpec.outputPath:transformOpts.doOutput?"":void 0)&&void 0!==transformed&&(fluid.model.transform.setValue(transformSpec.outputPath,transformed,transformer),transformed=void 0));return transformed};var globalAccept=[];fluid.registerNamespace("fluid.pathUtil"),fluid.pathUtil.getPathSegment=function(path,i){return fluid.pathUtil.getPathSegmentImpl(globalAccept,path,i),globalAccept[0]},fluid.pathUtil.getHeadPath=function(path){return fluid.pathUtil.getPathSegment(path,0)},fluid.pathUtil.getFromHeadPath=function(path){var firstdot=fluid.pathUtil.getPathSegmentImpl(null,path,0);return firstdot===path.length?"":path.substring(firstdot+1)},fluid.pathUtil.matchPath=function(spec,path,exact){for(var togo=[];;){if(""===path^""===spec&&exact)return null;if(!spec||!path)break;var spechead=fluid.pathUtil.getHeadPath(spec),pathhead=fluid.pathUtil.getHeadPath(path);if("*"!==spechead&&spechead!==pathhead)return null;togo.push(pathhead),spec=fluid.pathUtil.getFromHeadPath(spec),path=fluid.pathUtil.getFromHeadPath(path)}return togo},fluid.model.transform.expandWildcards=function(transformer,source){fluid.each(source,function(value,key){var q=transformer.queuedTransforms;transformer.pathOp.push(fluid.pathUtil.escapeSegment(key.toString()));for(var i=0;i<q.length;++i)if(fluid.pathUtil.matchPath(q[i].matchPath,transformer.path,!0)){var esCopy=fluid.copy(q[i].transformSpec);(void 0===esCopy.inputPath||fluid.model.transform.hasWildcard(esCopy.inputPath))&&(esCopy.inputPath=""),transformer.inputPrefixOp.push(transformer.path),transformer.outputPrefixOp.push(transformer.path);var transformOpts=fluid.model.transform.lookupType(esCopy.type),result=fluid.model.transform.doTransform(esCopy,transformer,transformOpts);void 0!==result&&fluid.model.transform.setValue(null,result,transformer),transformer.outputPrefixOp.pop(),transformer.inputPrefixOp.pop()}fluid.isPrimitive(value)||fluid.model.transform.expandWildcards(transformer,value),transformer.pathOp.pop()})},fluid.model.transform.hasWildcard=function(path){return"string"==typeof path&&-1!==path.indexOf("*")},fluid.model.transform.maybePushWildcard=function(transformSpec,transformer){var matchPath,hw=fluid.model.transform.hasWildcard;return hw(transformSpec.inputPath)?matchPath=fluid.model.composePaths(transformer.inputPrefix,transformSpec.inputPath):(hw(transformer.outputPrefix)||hw(transformSpec.outputPath))&&(matchPath=fluid.model.composePaths(transformer.outputPrefix,transformSpec.outputPath)),!!matchPath&&(transformer.queuedTransforms.push({transformSpec:transformSpec,outputPrefix:transformer.outputPrefix,inputPrefix:transformer.inputPrefix,matchPath:matchPath}),!0)},fluid.model.sortByKeyLength=function(inObject){return fluid.keys(inObject).sort(fluid.compareStringLength(!0))},fluid.model.transform.handleTransformStrategy=function(transformSpec,transformer,transformOpts){return fluid.model.transform.maybePushWildcard(transformSpec,transformer)?void 0:fluid.model.transform.doTransform(transformSpec,transformer,transformOpts)},fluid.model.transform.handleInvertStrategy=function(transformSpec,transformer,transformOpts){transformSpec=fluid.copy(transformSpec),fluid.hasGrade(transformOpts.defaults,"fluid.standardTransformFunction")&&(transformSpec=fluid.model.transform.invertPaths(transformSpec,transformer));var invertor=transformOpts.defaults&&transformOpts.defaults.invertConfiguration;if(invertor){var inverted=fluid.invokeGlobalFunction(invertor,[transformSpec,transformer]);transformer.inverted.push(inverted)}else transformer.inverted.push(fluid.model.transform.uninvertibleTransform)},fluid.model.transform.handleCollectStrategy=function(transformSpec,transformer,transformOpts){var defaults=transformOpts.defaults,standardInput=fluid.hasGrade(defaults,"fluid.standardInputTransformFunction"),multiInput=fluid.hasGrade(defaults,"fluid.multiInputTransformFunction");standardInput&&fluid.model.transform.accumulateStandardInputPath("input",transformSpec,transformer,transformer.inputPaths),multiInput&&fluid.model.transform.accumulateMultiInputPaths(defaults.inputVariables,transformSpec,transformer,transformer.inputPaths);var collector=defaults.collectInputPaths;if(collector){var collected=fluid.makeArray(fluid.invokeGlobalFunction(collector,[transformSpec,transformer]));Array.prototype.push.apply(transformer.inputPaths,collected)}},fluid.model.transform.lookupType=function(typeName,transformSpec){return typeName||fluid.fail("Transformation record is missing a type name: ",transformSpec),-1===typeName.indexOf(".")&&(typeName="fluid.transforms."+typeName),{defaults:fluid.defaults(typeName),typeName:typeName}},fluid.model.transform.processRule=function(rule,transformer){var togo,transformSpec,transformOpts;if("string"==typeof rule?rule=fluid.model.transform.pathToRule(rule):void 0!==rule.literalValue&&(rule=fluid.model.transform.literalValueToRule(rule.literalValue)),rule.transform)if(fluid.isArrayable(rule.transform)){var transforms=rule.transform;togo=void 0;for(var i=0;i<transforms.length;++i)transformSpec=transforms[i],transformOpts=fluid.model.transform.lookupType(transformSpec.type),transformer.transformHandler(transformSpec,transformer,transformOpts)}else transformSpec=rule.transform,transformOpts=fluid.model.transform.lookupType(transformSpec.type),togo=transformer.transformHandler(transformSpec,transformer,transformOpts);return fluid.isArrayable(rule)&&(transformer.collectedFlatSchemaOpts=transformer.collectedFlatSchemaOpts||{},transformer.collectedFlatSchemaOpts[transformer.outputPrefix]="array"),fluid.each(rule,function(value,key){if("transform"!==key){transformer.outputPrefixOp.push(key);var togo=transformer.expand(value,transformer);void 0!==togo&&(fluid.model.transform.setValue(null,togo,transformer),togo=void 0),transformer.outputPrefixOp.pop()}}),togo},fluid.model.transform.makeStrategy=function(transformer,handleFn,transformFn){transformFn=transformFn||fluid.model.transform.processRule,transformer.expand=function(rules){return transformFn(rules,transformer)},transformer.outputPrefixOp=fluid.model.makePathStack(transformer,"outputPrefix"),transformer.inputPrefixOp=fluid.model.makePathStack(transformer,"inputPrefix"),transformer.transformHandler=handleFn},fluid.model.transform.uninvertibleTransform=Object.freeze({}),fluid.model.transform.invertConfiguration=function(rules){var transformer={inverted:[]};return fluid.model.transform.makeStrategy(transformer,fluid.model.transform.handleInvertStrategy),transformer.expand(rules),-1===transformer.inverted.indexOf(fluid.model.transform.uninvertibleTransform)?{transform:transformer.inverted}:fluid.model.transform.uninvertibleTransform},fluid.model.transform.collectInputPaths=function(rules){var transformer={inputPaths:[]};fluid.model.transform.makeStrategy(transformer,fluid.model.transform.handleCollectStrategy),transformer.expand(rules);var inputPathHash=fluid.arrayToHash(transformer.inputPaths);return Object.keys(inputPathHash)},fluid.model.transform.flatSchemaStrategy=function(flatSchema,getConfig){var keys=fluid.model.sortByKeyLength(flatSchema);return function(root,segment,index,segs){for(var path=getConfig.parser.compose.apply(null,segs.slice(0,index)),i=0;i<keys.length;++i){var key=keys[i];if(null!==fluid.pathUtil.matchPath(key,path,!0))return flatSchema[key]}}},fluid.model.transform.defaultSchemaValue=function(schemaValue){return"array"===(fluid.isPrimitive(schemaValue)?schemaValue:schemaValue.type)?[]:{}},fluid.model.transform.isomorphicSchemaStrategy=function(source,getConfig){return function(root,segment,index,segs){var existing=fluid.get(source,segs.slice(0,index),getConfig);return fluid.isArrayable(existing)?"array":"object"}},fluid.model.transform.decodeStrategy=function(source,options,getConfig){return options.isomorphic?fluid.model.transform.isomorphicSchemaStrategy(source,getConfig):options.flatSchema?fluid.model.transform.flatSchemaStrategy(options.flatSchema,getConfig):void 0},fluid.model.transform.schemaToCreatorStrategy=function(strategy){return function(root,segment,index,segs){if(void 0===root[segment]){var schemaValue=strategy(root,segment,index,segs);return root[segment]=fluid.model.transform.defaultSchemaValue(schemaValue),root[segment]}}},fluid.model.transform.sequence=function(source,rules,options){for(var i=0;i<rules.length;++i)source=fluid.model.transform(source,rules[i],options);return source},fluid.model.compareByPathLength=function(changea,changeb){var pdiff=changea.path.length-changeb.path.length;return 0===pdiff?changea.sequence-changeb.sequence:pdiff},fluid.model.fireSortedChanges=function(changes,applier){changes.sort(fluid.model.compareByPathLength),fluid.fireChanges(applier,changes)},fluid.model.transformWithRules=function(source,rules,options){options=options||{};var getConfig=fluid.model.escapedGetConfig,setConfig=fluid.model.escapedSetConfig,schemaStrategy=fluid.model.transform.decodeStrategy(source,options,getConfig),transformer={source:source,target:{model:schemaStrategy?fluid.model.transform.defaultSchemaValue(schemaStrategy(null,"",0,[""])):{}},resolverGetConfig:getConfig,resolverSetConfig:setConfig,collectedFlatSchemaOpts:void 0,queuedChanges:[],queuedTransforms:[]};fluid.model.transform.makeStrategy(transformer,fluid.model.transform.handleTransformStrategy),transformer.applier={fireChangeRequest:function(changeRequest){changeRequest.sequence=transformer.queuedChanges.length,transformer.queuedChanges.push(changeRequest)}},fluid.bindRequestChange(transformer.applier),transformer.expand(rules);var rootSetConfig=fluid.copy(setConfig);return void 0!==transformer.collectedFlatSchemaOpts&&($.extend(transformer.collectedFlatSchemaOpts,options.flatSchema),schemaStrategy=fluid.model.transform.flatSchemaStrategy(transformer.collectedFlatSchemaOpts,getConfig)),rootSetConfig.strategies=[fluid.model.defaultFetchStrategy,schemaStrategy?fluid.model.transform.schemaToCreatorStrategy(schemaStrategy):fluid.model.defaultCreatorStrategy],transformer.finalApplier=options.finalApplier||fluid.makeHolderChangeApplier(transformer.target,{resolverSetConfig:rootSetConfig}),0<transformer.queuedTransforms.length&&(transformer.typeStack=[],transformer.pathOp=fluid.model.makePathStack(transformer,"path"),fluid.model.transform.expandWildcards(transformer,source)),fluid.model.fireSortedChanges(transformer.queuedChanges,transformer.finalApplier),transformer.target.model},$.extend(fluid.model.transformWithRules,fluid.model.transform),fluid.model.transform=fluid.model.transformWithRules,fluid.transformOne=function(rules){return{transformOptions:{transformer:"fluid.model.transformWithRules",config:rules}}},fluid.transformMany=function(rules){return{transformOptions:{transformer:"fluid.model.transform.sequence",config:rules}}}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.model.transform"),fluid.registerNamespace("fluid.transforms"),fluid.defaults("fluid.transforms.value",{gradeNames:"fluid.standardTransformFunction",invertConfiguration:"fluid.identity"}),fluid.transforms.value=fluid.identity,fluid.transforms.identity=fluid.transforms.value,fluid.defaults("fluid.transforms.identity",{gradeNames:"fluid.transforms.value"}),fluid.transforms.invertToIdentity=function(transformSpec){return transformSpec.type="fluid.transforms.identity",transformSpec},fluid.defaults("fluid.transforms.literalValue",{gradeNames:"fluid.standardOutputTransformFunction"}),fluid.transforms.literalValue=function(transformSpec){return transformSpec.input},fluid.defaults("fluid.transforms.stringToNumber",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.stringToNumber.invert"}),fluid.transforms.stringToNumber=function(value){var newValue=Number(value);return isNaN(newValue)?void 0:newValue},fluid.transforms.stringToNumber.invert=function(transformSpec){return transformSpec.type="fluid.transforms.numberToString",transformSpec},fluid.defaults("fluid.transforms.numberToString",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.numberToString.invert"}),fluid.transforms.numberToString=function(value,transformSpec){if("number"==typeof value)return"number"!=typeof transformSpec.scale||isNaN(transformSpec.scale)?value.toString():fluid.roundToDecimal(value,transformSpec.scale,transformSpec.method).toString()},fluid.transforms.numberToString.invert=function(transformSpec){return transformSpec.type="fluid.transforms.stringToNumber",transformSpec},fluid.defaults("fluid.transforms.count",{gradeNames:"fluid.standardTransformFunction"}),fluid.transforms.count=function(value){return fluid.makeArray(value).length},fluid.defaults("fluid.transforms.round",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.invertToIdentity"}),fluid.transforms.round=function(value,transformSpec){return fluid.roundToDecimal(value,transformSpec.scale,transformSpec.method)},fluid.defaults("fluid.transforms.delete",{gradeNames:"fluid.transformFunction"}),fluid.transforms.delete=function(transformSpec,transformer){var outputPath=fluid.model.composePaths(transformer.outputPrefix,transformSpec.outputPath);transformer.applier.change(outputPath,null,"DELETE")},fluid.defaults("fluid.transforms.firstValue",{gradeNames:"fluid.standardOutputTransformFunction"}),fluid.transforms.firstValue=function(transformSpec,transformer){transformSpec.values&&transformSpec.values.length||fluid.fail('firstValue transformer requires an array of values at path named "values", supplied',transformSpec);for(var i=0;i<transformSpec.values.length;i++){var value=transformSpec.values[i],expanded=transformer.expand(value);if(void 0!==expanded)return expanded}},fluid.defaults("fluid.transforms.linearScale",{gradeNames:["fluid.multiInputTransformFunction","fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.linearScale.invert",inputVariables:{factor:1,offset:0}}),fluid.transforms.linearScale=function(input,extraInputs){var factor=extraInputs.factor(),offset=extraInputs.offset();if("number"==typeof input&&"number"==typeof factor&&"number"==typeof offset)return input*factor+offset},fluid.transforms.linearScale.invert=function(transformSpec){return delete transformSpec.factorPath,delete transformSpec.offsetPath,void 0!==transformSpec.factor&&(transformSpec.factor=0===transformSpec.factor?0:1/transformSpec.factor),void 0!==transformSpec.offset&&(transformSpec.offset=-transformSpec.offset*(void 0!==transformSpec.factor?transformSpec.factor:1)),transformSpec},fluid.defaults("fluid.transforms.binaryOp",{gradeNames:["fluid.multiInputTransformFunction","fluid.standardOutputTransformFunction"],inputVariables:{left:null,right:null}}),fluid.transforms.binaryLookup={"===":function(a,b){return fluid.model.isSameValue(a,b)},"!==":function(a,b){return!fluid.model.isSameValue(a,b)},"<=":function(a,b){return a<=b},"<":function(a,b){return a<b},">=":function(a,b){return b<=a},">":function(a,b){return b<a},"+":function(a,b){return a+b},"-":function(a,b){return a-b},"*":function(a,b){return a*b},"/":function(a,b){return a/b},"%":function(a,b){return a%b},"&&":function(a,b){return a&&b},"||":function(a,b){return a||b}},fluid.transforms.binaryOp=function(inputs,transformSpec,transformer){var left=inputs.left(),right=inputs.right(),operator=fluid.model.transform.getValue(void 0,transformSpec.operator,transformer),fun=fluid.transforms.binaryLookup[operator];return void 0===fun||void 0===left||void 0===right?void 0:fun(left,right)},fluid.defaults("fluid.transforms.condition",{gradeNames:["fluid.multiInputTransformFunction","fluid.standardOutputTransformFunction"],inputVariables:{true:null,false:null,condition:null}}),fluid.transforms.condition=function(inputs){var condition=inputs.condition();if(null!==condition)return inputs[condition?"true":"false"]()},fluid.defaults("fluid.transforms.valueMapper",{gradeNames:["fluid.lens"],invertConfiguration:"fluid.transforms.valueMapper.invert",collectInputPaths:"fluid.transforms.valueMapper.collect"}),fluid.model.transform.compareMatches=function(speca,specb){var matchDiff=specb.matchValue-speca.matchValue;return 0===matchDiff?speca.index-specb.index:matchDiff},fluid.transforms.valueMapper=function(transformSpec,transformer){transformSpec.match||fluid.fail('valueMapper requires an array or hash of matches at path named "match", supplied ',transformSpec);var value=fluid.model.transform.getValue(transformSpec.defaultInputPath,transformSpec.defaultInput,transformer),matchedEntry=fluid.isArrayable(transformSpec.match)?fluid.transforms.valueMapper.longFormMatch(value,transformSpec,transformer):transformSpec.match[value];if(void 0===matchedEntry&&(matchedEntry=transformSpec.noMatch),void 0!==matchedEntry){var outputValue,outputPath=void 0===matchedEntry.outputPath?transformSpec.defaultOutputPath:matchedEntry.outputPath;return transformer.outputPrefixOp.push(outputPath),outputValue=fluid.isPrimitive(matchedEntry)?matchedEntry:matchedEntry.outputUndefinedValue?void 0:void 0===(outputValue=fluid.model.transform.resolveParam(matchedEntry,transformer,"outputValue",void 0))?transformSpec.defaultOutputValue:outputValue,"string"==typeof outputPath&&void 0!==outputValue&&(fluid.model.transform.setValue(void 0,outputValue,transformer,transformSpec.merge),outputValue=void 0),transformer.outputPrefixOp.pop(),outputValue}},fluid.transforms.valueMapper.longFormMatch=function(valueFromDefaultPath,transformSpec,transformer){var o=transformSpec.match;0===o.length&&fluid.fail("valueMapper supplied empty list of matches: ",transformSpec);for(var matchPower=[],i=0;i<o.length;++i){var option=o[i],value=option.inputPath?fluid.model.transform.getValue(option.inputPath,void 0,transformer):valueFromDefaultPath,matchValue=fluid.model.transform.matchValue(option.inputValue,value,option.partialMatches);matchPower[i]={index:i,matchValue:matchValue}}return matchPower.sort(fluid.model.transform.compareMatches),matchPower[0].matchValue<=0?void 0:o[matchPower[0].index]},fluid.transforms.valueMapper.invert=function(transformSpec,transformer){var match=[],togo={type:"fluid.transforms.valueMapper",match:match},isArray=fluid.isArrayable(transformSpec.match);togo.defaultInputPath=fluid.model.composePaths(transformer.outputPrefix,transformSpec.defaultOutputPath),togo.defaultOutputPath=fluid.model.composePaths(transformer.inputPrefix,transformSpec.defaultInputPath);var def=fluid.firstDefined;return fluid.each(transformSpec.match,function(option,key){if(!0!==option.outputUndefinedValue){var outOption={},origInputValue=def(isArray?option.inputValue:key,transformSpec.defaultInputValue);void 0===origInputValue&&fluid.fail("Failure inverting configuration for valueMapper - inputValue could not be resolved for record "+key+": ",transformSpec),outOption.outputValue=origInputValue,outOption.inputValue=!isArray&&fluid.isPrimitive(option)?option:def(option.outputValue,transformSpec.defaultOutputValue),option.outputPath&&(outOption.inputPath=fluid.model.composePaths(transformer.outputPrefix,def(option.outputPath,transformSpec.outputPath))),option.inputPath&&(outOption.outputPath=fluid.model.composePaths(transformer.inputPrefix,def(option.inputPath,transformSpec.inputPath))),match.push(outOption)}}),togo},fluid.transforms.valueMapper.collect=function(transformSpec,transformer){var togo=[];return fluid.model.transform.accumulateStandardInputPath("defaultInput",transformSpec,transformer,togo),fluid.each(transformSpec.match,function(option){fluid.model.transform.accumulateInputPath(option.inputPath,transformer,togo)}),togo},fluid.defaults("fluid.transforms.arrayToSetMembership",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.arrayToSetMembership.invert"}),fluid.transforms.arrayToSetMembership=function(value,transformSpec,transformer){var output={},options=transformSpec.options;return value&&fluid.isArrayable(value)||fluid.fail("arrayToSetMembership didn't find array at inputPath nor passed as value.",transformSpec),options||fluid.fail("arrayToSetMembership requires an options block set"),void 0===transformSpec.presentValue&&(transformSpec.presentValue=!0),void 0===transformSpec.missingValue&&(transformSpec.missingValue=!1),fluid.each(options,function(outPath,key){var outVal=-1!==value.indexOf(key)?transformSpec.presentValue:transformSpec.missingValue;fluid.set(output,outPath,outVal,transformer.resolverSetConfig)}),output},fluid.transforms.arrayToSetMembership.invertWithType=function(transformSpec,transformer,newType){transformSpec.type=newType;var newOptions={};return fluid.each(transformSpec.options,function(path,oldKey){newOptions[path]=oldKey}),transformSpec.options=newOptions,transformSpec},fluid.transforms.arrayToSetMembership.invert=function(transformSpec,transformer){return fluid.transforms.arrayToSetMembership.invertWithType(transformSpec,transformer,"fluid.transforms.setMembershipToArray")},fluid.defaults("fluid.transforms.setMembershipToArray",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.setMembershipToArray.invert"}),fluid.transforms.setMembershipToArray=function(input,transformSpec,transformer){var options=transformSpec.options;options||fluid.fail("setMembershipToArray requires an options block specified"),void 0===transformSpec.presentValue&&(transformSpec.presentValue=!0),void 0===transformSpec.missingValue&&(transformSpec.missingValue=!1);var outputArr=[];return fluid.each(options,function(outputVal,key){fluid.get(input,key,transformer.resolverGetConfig)===transformSpec.presentValue&&outputArr.push(outputVal)}),outputArr},fluid.transforms.setMembershipToArray.invert=function(transformSpec,transformer){return fluid.transforms.arrayToSetMembership.invertWithType(transformSpec,transformer,"fluid.transforms.arrayToSetMembership")},fluid.model.transform.applyPaths=function(operation,pathOp,paths){for(var i=0;i<paths.length;++i)"push"===operation?pathOp.push(paths[i]):pathOp.pop()},fluid.model.transform.expandInnerValues=function(inputPath,outputPath,transformer,innerValues){var inputPrefixOp=transformer.inputPrefixOp,outputPrefixOp=transformer.outputPrefixOp,apply=fluid.model.transform.applyPaths;apply("push",inputPrefixOp,inputPath),apply("push",outputPrefixOp,outputPath);var expanded={};return fluid.each(innerValues,function(innerValue){var expandedInner=transformer.expand(innerValue);fluid.isPrimitive(expandedInner)?expanded=expandedInner:$.extend(!0,expanded,expandedInner)}),apply("pop",outputPrefixOp,outputPath),apply("pop",inputPrefixOp,inputPath),expanded},fluid.defaults("fluid.transforms.indexArrayByKey",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.indexArrayByKey.invert"}),fluid.transforms.indexArrayByKey=function(arr,transformSpec,transformer){void 0===transformSpec.key&&fluid.fail("indexArrayByKey requires a 'key' option.",transformSpec),fluid.isArrayable(arr)||fluid.fail("indexArrayByKey didn't find array at inputPath.",transformSpec);var newHash={},pivot=transformSpec.key;return fluid.each(arr,function(v,k){var newKey=v[pivot],keyType=typeof newKey;"string"!==keyType&&"boolean"!==keyType&&"number"!==keyType&&fluid.fail("indexArrayByKey encountered untransformable array due to missing or invalid key",v);var content=fluid.copy(v);delete content[pivot],transformSpec.innerValue&&(content=fluid.model.transform.expandInnerValues([transformer.inputPrefix,transformSpec.inputPath,k.toString()],[transformSpec.outputPath,newKey],transformer,transformSpec.innerValue)),newHash[newKey]=content}),newHash},fluid.transforms.indexArrayByKey.invert=function(transformSpec){if(transformSpec.type="fluid.transforms.deindexIntoArrayByKey",transformSpec.innerValue)for(var innerValue=transformSpec.innerValue,i=0;i<innerValue.length;++i){var inverted=fluid.model.transform.invertConfiguration(innerValue[i]);if(inverted===fluid.model.transform.uninvertibleTransform)return inverted;innerValue[i]=inverted}return transformSpec},fluid.defaults("fluid.transforms.deindexIntoArrayByKey",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.deindexIntoArrayByKey.invert"}),fluid.transforms.deindexIntoArrayByKey=function(hash,transformSpec,transformer){void 0===transformSpec.key&&fluid.fail('deindexIntoArrayByKey requires a "key" option.',transformSpec);var newArray=[],pivot=transformSpec.key;return fluid.each(hash,function(v,k){var content={};content[pivot]=k,transformSpec.innerValue&&(v=fluid.model.transform.expandInnerValues([transformSpec.inputPath,k],[transformSpec.outputPath,newArray.length.toString()],transformer,transformSpec.innerValue)),$.extend(!0,content,v),newArray.push(content)}),newArray},fluid.transforms.deindexIntoArrayByKey.invert=function(transformSpec){if(transformSpec.type="fluid.transforms.indexArrayByKey",transformSpec.innerValue)for(var innerValue=transformSpec.innerValue,i=0;i<innerValue.length;++i)innerValue[i]=fluid.model.transform.invertConfiguration(innerValue[i]);return transformSpec},fluid.defaults("fluid.transforms.limitRange",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.invertToIdentity"}),fluid.transforms.limitRange=function(value,transformSpec){var min=transformSpec.min;void 0!==min&&(value<(min+=transformSpec.excludeMin||0)&&(value=min));var max=transformSpec.max;void 0!==max&&((max-=transformSpec.excludeMax||0)<value&&(value=max));return value},fluid.defaults("fluid.transforms.indexOf",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.indexOf.invert"}),fluid.transforms.indexOf=function(value,transformSpec){"number"==typeof transformSpec.notFound&&0<=transformSpec.notFound&&fluid.fail("A positive number is not allowed as 'notFound' value for indexOf");var offset=fluid.transforms.parseIndexationOffset(transformSpec.offset,"indexOf"),originalIndex=fluid.makeArray(transformSpec.array).indexOf(value);return-1===originalIndex&&transformSpec.notFound?transformSpec.notFound:originalIndex+offset},fluid.transforms.indexOf.invert=function(transformSpec,transformer){var togo=fluid.transforms.invertArrayIndexation(transformSpec,transformer);return togo.type="fluid.transforms.dereference",togo},fluid.defaults("fluid.transforms.dereference",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.dereference.invert"}),fluid.transforms.dereference=function(value,transformSpec){if("number"==typeof value){var offset=fluid.transforms.parseIndexationOffset(transformSpec.offset,"dereference");return fluid.makeArray(transformSpec.array)[value+offset]}},fluid.transforms.dereference.invert=function(transformSpec,transformer){var togo=fluid.transforms.invertArrayIndexation(transformSpec,transformer);return togo.type="fluid.transforms.indexOf",togo},fluid.transforms.parseIndexationOffset=function(offset,transformName){var parsedOffset=0;return void 0!==offset&&(parsedOffset=fluid.parseInteger(offset),isNaN(parsedOffset)&&fluid.fail(transformName+' requires the value of "offset" to be an integer or a string that can be converted to an integer. '+offset+" is invalid.")),parsedOffset},fluid.transforms.invertArrayIndexation=function(transformSpec){return isNaN(Number(transformSpec.offset))||(transformSpec.offset=-1*Number(transformSpec.offset)),transformSpec},fluid.defaults("fluid.transforms.stringTemplate",{gradeNames:"fluid.standardOutputTransformFunction"}),fluid.transforms.stringTemplate=function(transformSpec){return fluid.stringTemplate(transformSpec.template,transformSpec.terms)},fluid.defaults("fluid.transforms.free",{gradeNames:"fluid.transformFunction"}),fluid.transforms.free=function(transformSpec){var args=fluid.makeArray(transformSpec.args);return fluid.invokeGlobalFunction(transformSpec.func,args)},fluid.defaults("fluid.transforms.quantize",{gradeNames:"fluid.standardTransformFunction",collectInputPaths:"fluid.transforms.quantize.collect"}),fluid.transforms.quantize=function(value,transformSpec,transformer){transformSpec.ranges&&transformSpec.ranges.length||fluid.fail("fluid.transforms.quantize should have a key called ranges containing an array defining ranges to quantize");for(var i=0;i<transformSpec.ranges.length;i++){var rangeSpec=transformSpec.ranges[i];if(value<=rangeSpec.upperBound||void 0===rangeSpec.upperBound&&value>=Number.NEGATIVE_INFINITY)return fluid.isPrimitive(rangeSpec.output)?rangeSpec.output:transformer.expand(rangeSpec.output)}},fluid.transforms.quantize.collect=function(transformSpec,transformer){transformSpec.ranges.forEach(function(rangeSpec){fluid.isPrimitive(rangeSpec.output)||transformer.expand(rangeSpec.output)})},fluid.defaults("fluid.transforms.inRange",{gradeNames:"fluid.standardTransformFunction"}),fluid.transforms.inRange=function(value,transformSpec){return(void 0===transformSpec.min||transformSpec.min<=value)&&(void 0===transformSpec.max||transformSpec.max>=value)},fluid.transforms.stringToBoolean=function(value){return!!value&&!("0"===value||"false"===value)},fluid.transforms.stringToBoolean.invert=function(transformSpec){return transformSpec.type="fluid.transforms.booleanToString",transformSpec},fluid.defaults("fluid.transforms.stringToBoolean",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.stringToBoolean.invert"}),fluid.transforms.booleanToString=function(value){return value?"true":"false"},fluid.transforms.booleanToString.invert=function(transformSpec){return transformSpec.type="fluid.transforms.stringToBoolean",transformSpec},fluid.defaults("fluid.transforms.booleanToString",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.booleanToString.invert"}),fluid.transforms.JSONstringToObject=function(value){try{return JSON.parse(value)}catch(e){return}},fluid.transforms.JSONstringToObject.invert=function(transformSpec){return transformSpec.type="fluid.transforms.objectToJSONString",transformSpec},fluid.defaults("fluid.transforms.JSONstringToObject",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.JSONstringToObject.invert"}),fluid.transforms.objectToJSONString=function(value,transformSpec){var space=transformSpec.space||0;return JSON.stringify(value,null,space)},fluid.transforms.objectToJSONString.invert=function(transformSpec){return transformSpec.type="fluid.transforms.JSONstringToObject",transformSpec},fluid.defaults("fluid.transforms.objectToJSONString",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.objectToJSONString.invert"}),fluid.transforms.stringToDate=function(value){var date=new Date(value);return isNaN(date.getTime())?void 0:date},fluid.transforms.stringToDate.invert=function(transformSpec){return transformSpec.type="fluid.transforms.dateToString",transformSpec},fluid.defaults("fluid.transforms.stringToDate",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.stringToDate.invert"}),fluid.transforms.dateToString=function(value){if(value instanceof Date){var isoString=value.toISOString();return isoString.substring(0,isoString.indexOf("T"))}},fluid.transforms.dateToString.invert=function(transformSpec){return transformSpec.type="fluid.transforms.stringToDate",transformSpec},fluid.defaults("fluid.transforms.dateToString",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.dateToString.invert"}),fluid.transforms.dateTimeToString=function(value){return value instanceof Date?value.toISOString():void 0},fluid.defaults("fluid.transforms.dateTimeToString",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.dateToString.invert"})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{},fluid=fluid||fluid_3_0_0;!function($,fluid){"use strict";fluid.thatistBridge=function(name,peer){var togo=function(funcname){for(var segs=funcname.split("."),move=peer,i=0;i<segs.length;++i)move=move[segs[i]];var args=[this];2===arguments.length&&(args=args.concat($.makeArray(arguments[1])));var ret=move.apply(null,args);this.that=function(){return ret};var type=typeof ret;return!ret||"string"===type||"number"===type||"boolean"===type||ret&&void 0!==ret.length?ret:this};return $.fn[name]=togo},fluid.thatistBridge("fluid",fluid),fluid.thatistBridge("fluid_3_0_0",fluid_3_0_0);var normalizeTabindexName=function(){return $.browser.msie?"tabIndex":"tabindex"},canHaveDefaultTabindex=function(elements){return!(elements.length<=0)&&$(elements[0]).is("a, input, button, select, area, textarea, object")};fluid.tabindex=function(target,toIndex){return target=$(target),null!=toIndex?function(elements,toIndex){return elements.each(function(i,item){$(item).attr(normalizeTabindexName(),toIndex)})}(target,toIndex):function(elements){if(!(elements.length<=0)){if(!fluid.tabindex.hasAttr(elements))return canHaveDefaultTabindex(elements)?Number(0):void 0;var value=elements.attr(normalizeTabindexName());return Number(value)}}(target)},fluid.tabindex.remove=function(target){return(target=$(target)).each(function(i,item){$(item).removeAttr(normalizeTabindexName())})},fluid.tabindex.hasAttr=function(target){if((target=$(target)).length<=0)return!1;var togo=target.map(function(){var attributeNode=this.getAttributeNode(normalizeTabindexName());return!!attributeNode&&attributeNode.specified});return 1===togo.length?togo[0]:togo},fluid.tabindex.has=function(target){return target=$(target),fluid.tabindex.hasAttr(target)||canHaveDefaultTabindex(target)},fluid.a11y=$.a11y||{},fluid.a11y.orientation={HORIZONTAL:0,VERTICAL:1,BOTH:2};var UP_DOWN_KEYMAP={next:$.ui.keyCode.DOWN,previous:$.ui.keyCode.UP},LEFT_RIGHT_KEYMAP={next:$.ui.keyCode.RIGHT,previous:$.ui.keyCode.LEFT};fluid.tabbable=function(target){target=$(target),target.each(function(idx,item){(!(item=$(item)).fluid("tabindex.has")||item.fluid("tabindex")<0)&&item.fluid("tabindex",0)})};var CONTEXT_KEY="selectionContext",unselectElement=function(selectedElement,selectionContext){!function(selectedElement,handler){handler&&selectedElement&&handler(selectedElement)}(selectedElement,selectionContext.options.onUnselect)},selectElement=function(elementToSelect,selectionContext){var element;unselectElement(selectionContext.selectedElement(),selectionContext),elementToSelect=(element=elementToSelect).jquery?element[0]:element;var newIndex=selectionContext.selectables.index(elementToSelect);-1!==newIndex&&(selectionContext.activeItemIndex=newIndex,function(elementToSelect,handler){handler&&handler(elementToSelect)}(elementToSelect,selectionContext.options.onSelect))},reifyIndex=function(sc_that){var elements=sc_that.selectables;sc_that.activeItemIndex>=elements.length&&(sc_that.activeItemIndex=sc_that.options.noWrap?elements.length-1:0),sc_that.activeItemIndex<0&&-32768!==sc_that.activeItemIndex&&(sc_that.activeItemIndex=sc_that.options.noWrap?0:elements.length-1),0<=sc_that.activeItemIndex&&fluid.focus(elements[sc_that.activeItemIndex])},prepareShift=function(selectionContext){var selElm=selectionContext.selectedElement();selElm&&fluid.blur(selElm),unselectElement(selectionContext.selectedElement(),selectionContext),-32768===selectionContext.activeItemIndex&&(selectionContext.activeItemIndex=-1)},focusNextElement=function(selectionContext){prepareShift(selectionContext),++selectionContext.activeItemIndex,reifyIndex(selectionContext)},focusPreviousElement=function(selectionContext){prepareShift(selectionContext),--selectionContext.activeItemIndex,reifyIndex(selectionContext)},arrowKeyHandler=function(selectionContext,keyMap){return function(evt){evt.which===keyMap.next?(focusNextElement(selectionContext),evt.preventDefault()):evt.which===keyMap.previous&&(focusPreviousElement(selectionContext),evt.preventDefault())}},makeElementsSelectable=function(container,defaults,userOptions){var selectionContext,options=$.extend(!0,{},defaults,userOptions),keyMap=function(direction){var keyMap;return direction===fluid.a11y.orientation.HORIZONTAL?keyMap=LEFT_RIGHT_KEYMAP:direction===fluid.a11y.orientation.VERTICAL&&(keyMap=UP_DOWN_KEYMAP),keyMap}(options.direction),selectableElements=options.selectableElements?options.selectableElements:container.find(options.selectableSelector),that={container:container,activeItemIndex:-32768,selectables:selectableElements,focusIsLeavingContainer:!1,options:options};return that.selectablesUpdated=function(focusedItem){var selectionContext;"number"==typeof that.options.selectablesTabindex&&that.selectables.fluid("tabindex",that.options.selectablesTabindex),that.selectables.off("focus."+CONTEXT_KEY),that.selectables.off("blur."+CONTEXT_KEY),that.selectables.on("focus."+CONTEXT_KEY,(selectionContext=that,function(evt){return $(evt.target).fluid("tabindex",0),selectElement(evt.target,selectionContext),evt.stopPropagation()})),that.selectables.on("blur."+CONTEXT_KEY,function(selectionContext){return function(evt){return $(evt.target).fluid("tabindex",selectionContext.options.selectablesTabindex),unselectElement(evt.target,selectionContext),evt.stopPropagation()}}(that)),keyMap&&that.options.noBubbleListeners&&(that.selectables.off("keydown."+CONTEXT_KEY),that.selectables.on("keydown."+CONTEXT_KEY,arrowKeyHandler(that,keyMap))),focusedItem?selectElement(focusedItem,that):reifyIndex(that)},that.refresh=function(){that.options.selectableSelector||fluid.fail("Cannot refresh selectable context which was not initialised by a selector"),that.selectables=container.find(options.selectableSelector),that.selectablesUpdated()},that.selectedElement=function(){return that.activeItemIndex<0?null:that.selectables[that.activeItemIndex]},keyMap&&!that.options.noBubbleListeners&&container.keydown(arrowKeyHandler(that,keyMap)),container.keydown((selectionContext=that,function(evt){evt.which===$.ui.keyCode.TAB&&(function(selectionContext){-32768!==selectionContext.activeItemIndex&&(selectionContext.options.onLeaveContainer?selectionContext.options.onLeaveContainer(selectionContext.selectables[selectionContext.activeItemIndex]):selectionContext.options.onUnselect&&selectionContext.options.onUnselect(selectionContext.selectables[selectionContext.activeItemIndex])),selectionContext.options.rememberSelectionState||(selectionContext.activeItemIndex=-32768)}(selectionContext),evt.shiftKey&&(selectionContext.focusIsLeavingContainer=!0))})),container.focus(function(selectionContext){return function(evt){var shouldOrig=selectionContext.options.autoSelectFirstItem,shouldSelect="function"==typeof shouldOrig?shouldOrig():shouldOrig;return selectionContext.focusIsLeavingContainer&&(shouldSelect=!1),shouldSelect&&evt.target===selectionContext.container.get(0)&&(-32768===selectionContext.activeItemIndex&&(selectionContext.activeItemIndex=0),fluid.focus(selectionContext.selectables[selectionContext.activeItemIndex])),evt.stopPropagation()}}(that)),container.blur(function(selectionContext){return function(evt){return selectionContext.focusIsLeavingContainer=!1,evt.stopPropagation()}}(that)),that.selectablesUpdated(),that};fluid.selectable=function(target,options){target=$(target);var that=makeElementsSelectable(target,fluid.selectable.defaults,options);return fluid.setScopedData(target,CONTEXT_KEY,that),that},fluid.selectable.select=function(target,toSelect){fluid.focus(toSelect)},fluid.selectable.selectNext=function(target){target=$(target),focusNextElement(fluid.getScopedData(target,CONTEXT_KEY))},fluid.selectable.selectPrevious=function(target){target=$(target),focusPreviousElement(fluid.getScopedData(target,CONTEXT_KEY))},fluid.selectable.currentSelection=function(target){target=$(target);var that=fluid.getScopedData(target,CONTEXT_KEY);return $(that.selectedElement())},fluid.selectable.defaults={direction:fluid.a11y.orientation.VERTICAL,selectablesTabindex:-1,autoSelectFirstItem:!0,rememberSelectionState:!0,selectableSelector:".selectable",selectableElements:null,onSelect:null,onUnselect:null,onLeaveContainer:null,noWrap:!1};var makeActivationHandler=function(binding){return function(evt){var target=evt.target;if(fluid.enabled(target)&&((evt.which?evt.which:evt.keyCode)===binding.key&&binding.activateHandler&&function(binding,evt){if(!binding.modifier)return!0;var modifierKey=binding.modifier,isCtrlKeyPresent=modifierKey&&evt.ctrlKey,isAltKeyPresent=modifierKey&&evt.altKey,isShiftKeyPresent=modifierKey&&evt.shiftKey;return isCtrlKeyPresent||isAltKeyPresent||isShiftKeyPresent}(binding,evt))){var event=$.Event("fluid-activate");$(target).trigger(event,[binding.activateHandler]),event.isDefaultPrevented()&&evt.preventDefault()}}};fluid.activatable=function(target,fn,options){!function(elements,onActivateHandler,defaultKeys,options){var bindings=[];$(defaultKeys).each(function(index,key){bindings.push({modifier:null,key:key,activateHandler:onActivateHandler})}),options&&options.additionalBindings&&(bindings=bindings.concat(options.additionalBindings)),fluid.initEnablement(elements);for(var i=0;i<bindings.length;++i){var binding=bindings[i];elements.keydown(makeActivationHandler(binding))}elements.on("fluid-activate",function(evt,handler){return(handler=handler||onActivateHandler)?handler(evt):null})}(target=$(target),fn,fluid.activatable.defaults.keys,options)},fluid.activate=function(target){$(target).trigger("fluid-activate")},fluid.activatable.defaults={keys:[$.ui.keyCode.ENTER,$.ui.keyCode.SPACE]}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.viewComponent",{gradeNames:["fluid.modelComponent"],initFunction:"fluid.initView",argumentMap:{container:0,options:1},members:{dom:"@expand:fluid.initDomBinder({that}, {that}.options.selectors)"}}),fluid.dumpSelector=function(selectable){return"string"==typeof selectable?selectable:selectable.selector?selectable.selector:""},fluid.diagnoseFailedView=function(componentName,that,options,args){if(!that&&fluid.hasGrade(options,"fluid.viewComponent")){var container=fluid.wrap(args[1]),message1="Instantiation of view component with type "+componentName+" failed, since ";container?0===container.length?fluid.fail(message1+'selector "',fluid.dumpSelector(args[1]),'" did not match any markup in the document'):fluid.fail(message1+" component creator function did not return a value"):fluid.fail(message1+" container argument is empty")}},fluid.checkTryCatchParameter=function(){var GETparams=(window.location||{search:"",protocol:"file:"}).search.slice(1).split("&");return!0===fluid.find(GETparams,function(param){if(0===param.indexOf("notrycatch"))return!0})},fluid.notrycatch=fluid.checkTryCatchParameter(),fluid.wrap=function(obj,userJQuery){return userJQuery=userJQuery||$,!obj||obj.jquery?obj:userJQuery(obj)},fluid.unwrap=function(obj){return obj&&obj.jquery?obj[0]:obj},fluid.container=function(containerSpec,fallible,userJQuery){var selector=containerSpec.selector||containerSpec;userJQuery&&(containerSpec=fluid.unwrap(containerSpec));var container=fluid.wrap(containerSpec,userJQuery);if(fallible&&(!container||0===container.length))return null;if(!container||!container.jquery||1!==container.length){"string"!=typeof containerSpec&&(containerSpec=container.selector);var count=void 0!==container.length?container.length:0;fluid.fail((1<count?"More than one ("+count+") container elements were":"No container element was")+" found for selector "+containerSpec)}return fluid.isDOMNode(container[0])||fluid.fail("fluid.container was supplied a non-jQueryable element"),container.selector=selector,container.context=container.context||containerSpec.ownerDocument||document,container},fluid.createDomBinder=function(container,selectors){var that={id:fluid.allocateGuid(),cache:{}},userJQuery=container.constructor;function cacheKey(name,thisContainer){return fluid.allocateSimpleId(thisContainer)+"-"+name}return that.locate=function(name,localContainer){var selector,thisContainer,togo;if(void 0!==(selector=selectors[name]))return(thisContainer=localContainer?$(localContainer):container)||fluid.fail("DOM binder invoked for selector "+name+" without container"),(togo=""===selector?thisContainer:selector?"function"==typeof selector?userJQuery(selector.call(null,fluid.unwrap(thisContainer))):userJQuery(selector,thisContainer):userJQuery()).selector||(togo.selector=selector,togo.context=thisContainer),function(name,thisContainer,result){that.cache[cacheKey(name,thisContainer)]=result}(togo.selectorName=name,thisContainer,togo),togo},that.fastLocate=function(name,localContainer){var key=cacheKey(name,localContainer||container),togo=that.cache[key];return togo||that.locate(name,localContainer)},that.clear=function(){that.cache={}},that.refresh=function(names,localContainer){var thisContainer=localContainer||container;"string"==typeof names&&(names=[names]),void 0===thisContainer.length&&(thisContainer=[thisContainer]);for(var i=0;i<names.length;++i)for(var j=0;j<thisContainer.length;++j)that.locate(names[i],thisContainer[j])},that.resolvePathSegment=that.locate,that},fluid.expectFilledSelector=function(result,message){result&&0===result.length&&result.jquery&&fluid.fail(message+': selector "'+result.selector+'" with name '+result.selectorName+" returned no results in context "+fluid.dumpEl(result.context))},fluid.initView=function(componentName,containerSpec,userOptions,localOptions){var container=fluid.container(containerSpec,!0);if(fluid.expectFilledSelector(container,'Error instantiating component with name "'+componentName),!container)return null;var that=fluid.initLittleComponent(componentName,userOptions,localOptions||{gradeNames:["fluid.viewComponent"]},function(that){that.container=container});that.dom||fluid.initDomBinder(that);var userJQuery=that.options.jQuery;return fluid.log("Constructing view component "+componentName+" with container "+container.constructor.expando+(userJQuery?" user jQuery "+userJQuery.expando:"")+" env: "+$.expando),that},fluid.initDomBinder=function(that,selectors){return that.container||fluid.fail("fluid.initDomBinder called for component with typeName "+that.typeName+' without an initialised container - this has probably resulted from placing "fluid.viewComponent" in incorrect position in grade merging order. Make sure to place it to the right of any non-view grades in the gradeNames list to ensure that it overrides properly: resolved gradeNames is ',that.options.gradeNames," for component ",that),that.dom=fluid.createDomBinder(that.container,selectors||that.options.selectors||{}),that.locate=that.dom.locate,that.dom},fluid.findAncestor=function(element,test){for(element=fluid.unwrap(element);element;){if(test(element))return element;element=element.parentNode}},fluid.findForm=function(node){return fluid.findAncestor(node,function(element){return"form"===element.nodeName.toLowerCase()})},fluid.each(["text","html"],function(method){fluid[method]=function(node,newValue){return node=$(node),void 0===newValue?node[method]():node[method](newValue)}}),fluid.value=function(nodeIn,newValue){var node=fluid.unwrap(nodeIn),multiple=!1;if(void 0===node.nodeType&&1<node.length&&(node=node[0],multiple=!0),"input"!==node.nodeName.toLowerCase()||!/radio|checkbox/.test(node.type))return void 0===newValue?$(node).val():$(node).val(newValue);var elements,name=node.name;if(void 0===name&&fluid.fail("Cannot acquire value from node "+fluid.dumpEl(node)+" which does not have name attribute set"),multiple)elements=nodeIn;else{elements=node.ownerDocument.getElementsByName(name);var scope=fluid.findForm(node);elements=$.grep(elements,function(element){return element.name===name&&(!scope||fluid.dom.isContainer(scope,element))})}if(void 0===newValue){var checked=$.map(elements,function(element){return element.checked?element.value:null});return"radio"===node.type?checked[0]:checked}"boolean"==typeof newValue&&(newValue=newValue?"true":"false"),$.each(elements,function(){this.checked=newValue instanceof Array?-1!==newValue.indexOf(this.value):newValue===this.value})},fluid.BINDING_ROOT_KEY="fluid-binding-root",fluid.findData=function(elem,name){for(;elem;){var data=$.data(elem,name);if(data)return data;elem=elem.parentNode}},fluid.bindFossils=function(node,data,fossils){$.data(node,fluid.BINDING_ROOT_KEY,{data:data,fossils:fossils})},fluid.boundPathForNode=function(node,fossils){var record=fossils[(node=fluid.unwrap(node)).name||node.id];return record?record.EL:null},fluid.applyBoundChange=function(node,newValue,applier){node=fluid.unwrap(node),void 0===newValue&&(newValue=fluid.value(node)),void 0===node.nodeType&&0<node.length&&(node=node[0]);var root=fluid.findData(node,fluid.BINDING_ROOT_KEY);root||fluid.fail("Bound data could not be discovered in any node above "+fluid.dumpEl(node));var name=node.name,fossil=root.fossils[name];fossil||fluid.fail("No fossil discovered for name "+name+" in fossil record above "+fluid.dumpEl(node)),"boolean"==typeof fossil.oldvalue&&(newValue=!!newValue[0]);var EL=root.fossils[name].EL;applier?applier.fireChangeRequest({path:EL,value:newValue,source:"DOM:"+node.id}):fluid.set(root.data,EL,newValue)},fluid.jById=function(id,dokkument){dokkument=dokkument&&9===dokkument.nodeType?dokkument:document;var element=fluid.byId(id,dokkument),togo=element?$(element):[];return togo.selector="#"+id,togo.context=dokkument,togo},fluid.byId=function(id,dokkument){var el=(dokkument=dokkument&&9===dokkument.nodeType?dokkument:document).getElementById(id);return el?(el.id!==id&&fluid.fail("Problem in document structure - picked up element "+fluid.dumpEl(el)+" for id "+id+" without this id - most likely the element has a name which conflicts with this id"),el):null},fluid.getId=function(element){return fluid.unwrap(element).id},fluid.allocateSimpleId=function(element){if(!(element=fluid.unwrap(element))||fluid.isPrimitive(element))return null;if(!element.id){var simpleId="fluid-id-"+fluid.allocateGuid();element.id=simpleId}return element.id},fluid.getDocument=function(element){var node=fluid.unwrap(element);return 9===node.nodeType?node:node.ownerDocument},fluid.defaults("fluid.ariaLabeller",{gradeNames:["fluid.viewComponent"],labelAttribute:"aria-label",liveRegionMarkup:'<div class="liveRegion fl-hidden-accessible" aria-live="polite"></div>',liveRegionId:"fluid-ariaLabeller-liveRegion",invokers:{generateLiveElement:{funcName:"fluid.ariaLabeller.generateLiveElement",args:"{that}"},update:{funcName:"fluid.ariaLabeller.update",args:["{that}","{arguments}.0"]}},listeners:{onCreate:{func:"{that}.update",args:[null]}}}),fluid.ariaLabeller.update=function(that,newOptions){if(newOptions=newOptions||that.options,that.container.attr(that.options.labelAttribute,newOptions.text),newOptions.dynamicLabel){var live=fluid.jById(that.options.liveRegionId);0===live.length&&(live=that.generateLiveElement()),live.text(newOptions.text)}},fluid.ariaLabeller.generateLiveElement=function(that){var liveEl=$(that.options.liveRegionMarkup);return liveEl.prop("id",that.options.liveRegionId),$("body").append(liveEl),liveEl};fluid.getAriaLabeller=function(element){return element=$(element),fluid.getScopedData(element,"aria-labelling")},fluid.updateAriaLabel=function(element,text,options){options=$.extend({},options||{},{text:text});var that=fluid.getAriaLabeller(element);return that?that.update(options):(that=fluid.ariaLabeller(element,options),fluid.setScopedData(element,"aria-labelling",that)),that};var dismissList={};$(document).click(function(event){for(var target=fluid.resolveEventTarget(event);target;){if(dismissList[target.id])return;target=target.parentNode}fluid.each(dismissList,function(dismissFunc,key){dismissFunc(event),delete dismissList[key]})}),fluid.globalDismissal=function(nodes,dismissFunc){fluid.each(nodes,function(node){var id=fluid.unwrap(node).ownerDocument===document?fluid.allocateSimpleId(node):fluid.allocateGuid();dismissFunc?dismissList[id]=dismissFunc:delete dismissList[id]})},fluid.now=function(){return Date.now?Date.now():(new Date).getTime()},fluid.deadMansBlur=function(control,options){var that={options:$.extend(!0,{},fluid.defaults("fluid.deadMansBlur"),options),blurPending:!1,lastCancel:0,canceller:function(event){fluid.log("Cancellation through "+event.type+" on "+fluid.dumpEl(event.target)),that.lastCancel=fluid.now(),that.blurPending=!1},noteProceeded:function(){fluid.globalDismissal(that.options.exclusions)},reArm:function(){fluid.globalDismissal(that.options.exclusions,that.proceed)},addExclusion:function(exclusions){fluid.globalDismissal(exclusions,that.proceed)},proceed:function(event){fluid.log("Direct proceed through "+event.type+" on "+fluid.dumpEl(event.target)),that.blurPending=!1,that.options.handler(control)}};return fluid.each(that.options.exclusions,function(exclusion){exclusion=$(exclusion),fluid.each(exclusion,function(excludeEl){$(excludeEl).on("focusin",that.canceller).on("fluid-focus",that.canceller).click(that.canceller).mousedown(that.canceller)})}),that.options.cancelByDefault?that.reArm():$(control).on("focusout",function(event){fluid.log("Starting blur timer for element "+fluid.dumpEl(event.target));var now=fluid.now();fluid.log("back delay: "+(now-that.lastCancel)),now-that.lastCancel>that.options.backDelay&&(that.blurPending=!0),setTimeout(function(){that.blurPending&&that.options.handler(control)},that.options.delay)}),that},fluid.defaults("fluid.deadMansBlur",{gradeNames:"fluid.function",delay:150,backDelay:100})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.explodeLocalisedName=function(fileName,locale,defaultLocale){var lastDot=fileName.lastIndexOf(".");-1!==lastDot&&0!==lastDot||(lastDot=fileName.length);var baseName=fileName.substring(0,lastDot),extension=fileName.substring(lastDot),segs=locale.split("_"),exploded=fluid.transform(segs,function(seg,index){var shortSegs=segs.slice(0,index+1);return baseName+"_"+shortSegs.join("_")+extension});return defaultLocale&&exploded.unshift(baseName+"_"+defaultLocale+extension),exploded};var resourceCache={},pendingClass={};function canonUrl(url){return url}fluid.fetchResources=function(resourceSpecs,callback,options){var that={options:fluid.copy(options||{})};return that.resourceSpecs=resourceSpecs,that.callback=callback,that.operate=function(){fluid.fetchResources.fetchResourcesImpl(that)},fluid.each(resourceSpecs,function(resourceSpec,key){resourceSpec.recurseFirer=fluid.makeEventFirer({name:'I/O completion for resource "'+key+'"'}),resourceSpec.recurseFirer.addListener(that.operate),resourceSpec.url&&!resourceSpec.href&&(resourceSpec.href=resourceSpec.url),that.options.defaultLocale&&(resourceSpec.defaultLocale=that.options.defaultLocale),resourceSpec.locale||(resourceSpec.locale=resourceSpec.defaultLocale)}),that.options.amalgamateClasses&&fluid.fetchResources.amalgamateClasses(resourceSpecs,that.options.amalgamateClasses,that.operate),fluid.fetchResources.explodeForLocales(resourceSpecs),that.operate(),that},fluid.fetchResources.explodeForLocales=function(resourceSpecs){return fluid.each(resourceSpecs,function(resourceSpec,key){if(resourceSpec.locale){for(var exploded=fluid.explodeLocalisedName(resourceSpec.href,resourceSpec.locale,resourceSpec.defaultLocale),i=0;i<exploded.length;++i){var newKey=key+"$localised-"+i,newRecord=$.extend(!0,{},resourceSpec,{href:exploded[i],localeExploded:!0});resourceSpecs[newKey]=newRecord}resourceSpec.localeExploded=exploded.length}}),resourceSpecs},fluid.fetchResources.condenseOneResource=function(resourceSpecs,resourceSpec,key,localeCount){for(var localeSpecs=[resourceSpec],i=0;i<localeCount;++i){var localKey=key+"$localised-"+i;localeSpecs.unshift(resourceSpecs[localKey]),delete resourceSpecs[localKey]}var lastNonError=fluid.find_if(localeSpecs,function(spec){return!spec.fetchError});lastNonError&&(resourceSpecs[key]=lastNonError)},fluid.fetchResources.condenseForLocales=function(resourceSpecs){fluid.each(resourceSpecs,function(resourceSpec,key){"number"==typeof resourceSpec.localeExploded&&fluid.fetchResources.condenseOneResource(resourceSpecs,resourceSpec,key,resourceSpec.localeExploded)})},fluid.fetchResources.notifyResources=function(that,resourceSpecs,callback){fluid.fetchResources.condenseForLocales(resourceSpecs),callback(resourceSpecs)},fluid.fetchResources.amalgamateClasses=function(specs,classes,operator){fluid.each(classes,function(clazz){var pending=pendingClass[clazz];fluid.each(pending,function(pendingrec,canon){(specs[clazz+"!"+canon]=pendingrec).recurseFirer.addListener(operator)})})},fluid.fetchResources.timeSuccessCallback=function(resourceSpec){if(resourceSpec.timeSuccess&&resourceSpec.options&&resourceSpec.options.success){var success=resourceSpec.options.success;resourceSpec.options.success=function(){var startTime=new Date,ret=success.apply(null,arguments);return fluid.log("External callback for URL "+resourceSpec.href+" completed - callback time: "+((new Date).getTime()-startTime.getTime())+"ms"),ret}}},fluid.fetchResources.clearResourceCache=function(url){url?delete resourceCache[canonUrl(url)]:fluid.clear(resourceCache)},fluid.fetchResources.handleCachedRequest=function(resourceSpec,response,fetchError){var canon=canonUrl(resourceSpec.href),cached=resourceCache[canon];if(cached.$$firer$$){fluid.log("Handling request for "+canon+" from cache");var fetchClass=resourceSpec.fetchClass;fetchClass&&pendingClass[fetchClass]&&(fluid.log("Clearing pendingClass entry for class "+fetchClass),delete pendingClass[fetchClass][canon]);var result={response:response,fetchError:fetchError};resourceCache[canon]=result,cached.fire(response,fetchError)}},fluid.fetchResources.completeRequest=function(thisSpec){thisSpec.queued=!1,thisSpec.completeTime=new Date,fluid.log("Request to URL "+thisSpec.href+" completed - total elapsed time: "+(thisSpec.completeTime.getTime()-thisSpec.initTime.getTime())+"ms"),thisSpec.recurseFirer.fire()},fluid.fetchResources.makeResourceCallback=function(thisSpec){return{success:function(response){thisSpec.resourceText=response,thisSpec.resourceKey=thisSpec.href,thisSpec.forceCache&&fluid.fetchResources.handleCachedRequest(thisSpec,response),fluid.fetchResources.completeRequest(thisSpec)},error:function(response,textStatus,errorThrown){thisSpec.fetchError={status:response.status,textStatus:response.textStatus,errorThrown:errorThrown},thisSpec.forceCache&&fluid.fetchResources.handleCachedRequest(thisSpec,null,thisSpec.fetchError),fluid.fetchResources.completeRequest(thisSpec)}}},fluid.fetchResources.issueCachedRequest=function(resourceSpec,options){var canon=canonUrl(resourceSpec.href),cached=resourceCache[canon];if(cached)cached.$$firer$$?(fluid.log("Request for cached resource which is in flight: url "+canon),cached.addListener(function(response,fetchError){response?options.success(response):options.error(fetchError)})):cached.response?options.success(cached.response):options.error(cached.fetchError);else{fluid.log("First request for cached resource with url "+canon),(cached=fluid.makeEventFirer({name:"cache notifier for resource URL "+canon})).$$firer$$=!0,resourceCache[canon]=cached;var fetchClass=resourceSpec.fetchClass;fetchClass&&(pendingClass[fetchClass]||(pendingClass[fetchClass]={}),pendingClass[fetchClass][canon]=resourceSpec),options.cache=!1,$.ajax(options)}},fluid.fetchResources.composeCallbacks=function(internal,external){return external?internal?function(){try{external.apply(null,arguments)}catch(e){fluid.log("Exception applying external fetchResources callback: "+e)}internal.apply(null,arguments)}:external:internal},fluid.fetchResources.composePolicy=function(target,source){return fluid.fetchResources.composeCallbacks(target,source)},fluid.defaults("fluid.fetchResources.issueRequest",{mergePolicy:{success:fluid.fetchResources.composePolicy,error:fluid.fetchResources.composePolicy,url:"reverse"}}),fluid.fetchResources.issueRequest=function(resourceSpec,key){var thisCallback=fluid.fetchResources.makeResourceCallback(resourceSpec),options={url:resourceSpec.href,success:thisCallback.success,error:thisCallback.error,dataType:resourceSpec.dataType||"text"};fluid.fetchResources.timeSuccessCallback(resourceSpec),options=fluid.merge(fluid.defaults("fluid.fetchResources.issueRequest").mergePolicy,options,resourceSpec.options),resourceSpec.queued=!0,resourceSpec.initTime=new Date,fluid.log("Request with key "+key+" queued for "+resourceSpec.href),resourceSpec.forceCache?fluid.fetchResources.issueCachedRequest(resourceSpec,options):$.ajax(options)},fluid.fetchResources.fetchResourcesImpl=function(that){var complete=!0,resourceSpecs=that.resourceSpecs;for(var key in resourceSpecs){var resourceSpec=resourceSpecs[key];if(resourceSpec.href&&!resourceSpec.completeTime)resourceSpec.queued||fluid.fetchResources.issueRequest(resourceSpec,key),resourceSpec.queued&&(complete=!1);else if(resourceSpec.nodeId&&!resourceSpec.resourceText){var node=document.getElementById(resourceSpec.nodeId);resourceSpec.resourceText=fluid.dom.getElementText(node),resourceSpec.resourceKey=resourceSpec.nodeId}}complete&&that.callback&&!that.callbackCalled&&(that.callbackCalled=!0,setTimeout(function(){fluid.fetchResources.notifyResources(that,resourceSpecs,that.callback)},1))},fluid.fetchResources.primeCacheFromResources=function(componentName){var resources=fluid.defaults(componentName).resources,expanded=(fluid.expandOptions?fluid.expandOptions:fluid.identity)(fluid.copy(resources));fluid.fetchResources(expanded)},fluid.registerNamespace("fluid.expander"),fluid.expander.makeDefaultFetchOptions=function(successdisposer,failid,options){return $.extend(!0,{dataType:"text"},options,{success:function(response,environmentdisposer){var json=JSON.parse(response);environmentdisposer(successdisposer(json))},error:function(response,textStatus){fluid.log("Error fetching "+failid+": "+textStatus)}})},fluid.expander.makeFetchExpander=function(options){return{expander:{type:"fluid.expander.deferredFetcher",href:options.url,options:fluid.expander.makeDefaultFetchOptions(options.disposer,options.url,options.options),resourceSpecCollector:"{resourceSpecCollector}",fetchKey:options.fetchKey}}},fluid.expander.deferredFetcher=function(deliverer,source,expandOptions){var expander=source.expander,spec=fluid.copy(expander),collector=fluid.expand(expander.resourceSpecCollector,expandOptions);delete spec.type,delete spec.resourceSpecCollector,delete spec.fetchKey;var environmentdisposer=function(disposed){deliverer(disposed)};return spec.options.success=function(response){expander.options.success(response,environmentdisposer)},collector[expander.fetchKey||fluid.allocateGuid()]=spec,fluid.NO_VALUE}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.messageResolver",{gradeNames:["fluid.component"],mergePolicy:{messageBase:"nomerge",parents:"nomerge"},resolveFunc:fluid.stringTemplate,parseFunc:fluid.identity,messageBase:{},members:{messageBase:"@expand:{that}.options.parseFunc({that}.options.messageBase)"},invokers:{lookup:"fluid.messageResolver.lookup({that}, {arguments}.0)",resolve:"fluid.messageResolver.resolve({that}, {arguments}.0, {arguments}.1)"},parents:[]}),fluid.messageResolver.lookup=function(that,messagecodes){var resolved=fluid.messageResolver.resolveOne(that.messageBase,messagecodes);return void 0===resolved?fluid.find(that.options.parents,function(parent){return parent?parent.lookup(messagecodes):void 0}):{template:resolved,resolveFunc:that.options.resolveFunc}},fluid.messageResolver.resolve=function(that,messagecodes,args){if(!messagecodes)return"[No messagecodes provided]";messagecodes=fluid.makeArray(messagecodes);var looked=that.lookup(messagecodes);return looked?looked.resolveFunc(looked.template,args):"[Message string for key "+messagecodes[0]+" not found]"},fluid.messageResolver.resolveOne=function(messageBase,messagecodes){for(var i=0;i<messagecodes.length;++i){var message=messageBase[messagecodes[i]];if(void 0!==message)return message}},fluid.messageLocator=function(messageBase,resolveFunc){var resolver=fluid.messageResolver({messageBase:messageBase,resolveFunc:resolveFunc});return function(messagecodes,args){return resolver.resolve(messagecodes,args)}},fluid.resolveMessageSource=function(messageSource){if("data"===messageSource.type){if(void 0===messageSource.url)return fluid.messageLocator(messageSource.messages,messageSource.resolveFunc)}else if("resolver"===messageSource.type)return messageSource.resolver.resolve}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.resourceLoader",{gradeNames:["fluid.component"],listeners:{"onCreate.loadResources":{listener:"fluid.resourceLoader.loadResources",args:["{that}",{expander:{func:"{that}.resolveResources"}}]}},defaultLocale:null,locale:null,terms:{},resources:{},resourceOptions:{},invokers:{transformURL:{funcName:"fluid.stringTemplate",args:["{arguments}.0","{that}.options.terms"]},resolveResources:{funcName:"fluid.resourceLoader.resolveResources",args:"{that}"}},events:{onResourcesLoaded:null}}),fluid.resourceLoader.resolveResources=function(that){var mapped=fluid.transform(that.options.resources,that.transformURL);return fluid.transform(mapped,function(url){var resourceSpec={url:url,forceCache:!0,options:that.options.resourceOptions};return $.extend(resourceSpec,fluid.filterKeys(that.options,["defaultLocale","locale"]))})},fluid.resourceLoader.loadResources=function(that,resources){fluid.fetchResources(resources,function(){that.resources=resources,that.events.onResourcesLoaded.fire(resources)})}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.newViewComponent",{gradeNames:["fluid.modelComponent"],members:{dom:"@expand:fluid.initDomBinder({that}, {that}.options.selectors, {that}.container)",container:"@expand:fluid.container({that}.options.container)"}}),fluid.newViewComponent.addToParent=function(parentContainer,elm,method){method=method||"append",$(parentContainer)[method](elm)},fluid.defaults("fluid.containerRenderingView",{gradeNames:["fluid.newViewComponent"],container:"@expand:{that}.renderContainer()",parentContainer:"fluid.notImplemented",injectionType:"append",invokers:{renderMarkup:"fluid.identity({that}.options.markup.container)",renderContainer:"fluid.containerRenderingView.renderContainer({that}, {that}.renderMarkup, {that}.addToParent)",addToParent:{funcName:"fluid.newViewComponent.addToParent",args:["{that}.options.parentContainer","{arguments}.0","{that}.options.injectionType"]}}}),fluid.containerRenderingView.renderContainer=function(that,renderMarkup,addToParent){fluid.log("Rendering container for "+that.id);var containerMarkup=renderMarkup(),container=$(containerMarkup);return addToParent(container),container},fluid.defaults("fluid.templateRenderingView",{gradeNames:["fluid.newViewComponent","fluid.resourceLoader"],resources:{template:"fluid.notImplemented"},injectionType:"append",events:{afterRender:null},listeners:{"onResourcesLoaded.render":"{that}.render","onResourcesLoaded.afterRender":{listener:"{that}.events.afterRender",args:["{that}"],priority:"after:render"}},invokers:{render:{funcName:"fluid.newViewComponent.addToParent",args:["{that}.container","{that}.resources.template.resourceText","{that}.options.injectionType"]}},distributeOptions:{mapTemplateSource:{source:"{that}.options.template",removeSource:!0,target:"{that}.options.resources.template"}}})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.mutationObserver",{gradeNames:["fluid.viewComponent"],events:{onNodeAdded:null,onNodeRemoved:null,onAttributeChanged:null},listeners:{"onDestroy.disconnect":"{that}.disconnect"},members:{observer:{expander:{func:"{that}.createObserver"}}},defaultObserveConfig:{attributes:!0,childList:!0,subtree:!0},invokers:{observe:{funcName:"fluid.mutationObserver.observe",args:["{that}","{arguments}.0","{arguments}.1"]},disconnect:{this:"{that}.observer",method:"disconnect"},takeRecords:{this:"{that}.observer",method:"takeRecords"},createObserver:{funcName:"fluid.mutationObserver.createObserver",args:["{that}"]}}}),fluid.mutationObserver.createObserver=function(that){return new MutationObserver(function(mutationRecords){fluid.each(mutationRecords,function(mutationRecord){for(var i=0;i<mutationRecord.addedNodes.length;i++)that.events.onNodeAdded.fire(mutationRecord.addedNodes[i],mutationRecord);for(var j=0;j<mutationRecord.removedNodes.length;j++)that.events.onNodeRemoved.fire(mutationRecord.removedNodes[j],mutationRecord);"attributes"===mutationRecord.type&&that.events.onAttributeChanged.fire(mutationRecord.target,mutationRecord)})})},fluid.mutationObserver.observe=function(that,target,options){target=fluid.unwrap(target||that.container),that.observer.observe(target,options||that.options.defaultObserveConfig)}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.textNodeParser",{gradeNames:["fluid.component"],events:{onParsedTextNode:null,afterParse:null},invokers:{parse:{funcName:"fluid.textNodeParser.parse",args:["{that}","{arguments}.0","{arguments}.1","{that}.events.afterParse.fire"]},hasTextToRead:"fluid.textNodeParser.hasTextToRead",isWord:"fluid.textNodeParser.isWord",getLang:"fluid.textNodeParser.getLang"}}),fluid.textNodeParser.isWord=function(str){return fluid.isValue(str)&&/\S/.test(str)},fluid.textNodeParser.hasTextToRead=function(elm,acceptAriaHidden){return(elm=fluid.unwrap(elm))&&("body"===elm.tagName.toLowerCase()||elm.offsetParent)&&fluid.textNodeParser.isWord(elm.innerText)&&(acceptAriaHidden||!$(elm).closest('[aria-hidden="true"]').length)},fluid.textNodeParser.getLang=function(elm){return $(elm).closest("[lang]").attr("lang")},fluid.textNodeParser.parse=function(that,elm,lang,afterParseEvent){elm=fluid.unwrap(elm);var parsed=[];if(that.hasTextToRead(elm)){var childNodes=elm.childNodes,elementLang=elm.getAttribute("lang")||lang||that.getLang(elm);Array.prototype.forEach.call(childNodes,function(childNode,childIndex){if(childNode.nodeType===Node.TEXT_NODE){var textNodeData={node:childNode,lang:elementLang,childIndex:childIndex};parsed.push(textNodeData),that.events.onParsedTextNode.fire(textNodeData)}else childNode.nodeType===Node.ELEMENT_NODE&&(parsed=parsed.concat(fluid.textNodeParser.parse(that,childNode,elementLang)))})}return afterParseEvent&&afterParseEvent(that,parsed),parsed}}(jQuery,fluid_3_0_0),function(){var module={exports:null};function Hypher(language){var exceptions=[],i=0;if(this.trie=this.createTrie(language.patterns),this.leftMin=language.leftmin,this.rightMin=language.rightmin,this.exceptions={},language.exceptions)for(exceptions=language.exceptions.split(/,\s?/g);i<exceptions.length;i+=1)this.exceptions[exceptions[i].replace(/\u2027/g,"").toLowerCase()]=new RegExp("("+exceptions[i].split("‧").join(")(")+")","i")}Hypher.prototype.createTrie=function(patternObject){var patterns,size=0,i=0,c=0,p=0,chars=null,points=null,codePoint=null,t=null,tree={_points:[]};for(size in patternObject)if(patternObject.hasOwnProperty(size))for(patterns=patternObject[size].match(new RegExp(".{1,"+ +size+"}","g")),i=0;i<patterns.length;i+=1){for(chars=patterns[i].replace(/[0-9]/g,"").split(""),points=patterns[i].split(/\D/),t=tree,c=0;c<chars.length;c+=1)t[codePoint=chars[c].charCodeAt(0)]||(t[codePoint]={}),t=t[codePoint];for(t._points=[],p=0;p<points.length;p+=1)t._points[p]=points[p]||0}return tree},Hypher.prototype.hyphenateText=function(str,minLength){minLength=minLength||4;for(var words=str.split(/([a-zA-Z0-9_\u0027\u00DF-\u00EA\u00EC-\u00EF\u00F1-\u00F6\u00F8-\u00FD\u0101\u0103\u0105\u0107\u0109\u010D\u010F\u0111\u0113\u0117\u0119\u011B\u011D\u011F\u0123\u0125\u012B\u012F\u0131\u0135\u0137\u013C\u013E\u0142\u0144\u0146\u0148\u0151\u0153\u0155\u0159\u015B\u015D\u015F\u0161\u0165\u016B\u016D\u016F\u0171\u0173\u017A\u017C\u017E\u017F\u0219\u021B\u02BC\u0390\u03AC-\u03CE\u03F2\u0401\u0410-\u044F\u0451\u0454\u0456\u0457\u045E\u0491\u0531-\u0556\u0561-\u0587\u0902\u0903\u0905-\u090B\u090E-\u0910\u0912\u0914-\u0928\u092A-\u0939\u093E-\u0943\u0946-\u0948\u094A-\u094D\u0982\u0983\u0985-\u098B\u098F\u0990\u0994-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BE-\u09C3\u09C7\u09C8\u09CB-\u09CD\u09D7\u0A02\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A14-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A82\u0A83\u0A85-\u0A8B\u0A8F\u0A90\u0A94-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABE-\u0AC3\u0AC7\u0AC8\u0ACB-\u0ACD\u0B02\u0B03\u0B05-\u0B0B\u0B0F\u0B10\u0B14-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3E-\u0B43\u0B47\u0B48\u0B4B-\u0B4D\u0B57\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C02\u0C03\u0C05-\u0C0B\u0C0E-\u0C10\u0C12\u0C14-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3E-\u0C43\u0C46-\u0C48\u0C4A-\u0C4D\u0C82\u0C83\u0C85-\u0C8B\u0C8E-\u0C90\u0C92\u0C94-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBE-\u0CC3\u0CC6-\u0CC8\u0CCA-\u0CCD\u0D02\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D60\u0D61\u0D7A-\u0D7F\u1F00-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB2-\u1FB4\u1FB6\u1FB7\u1FBD\u1FBF\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD2\u1FD3\u1FD6\u1FD7\u1FE2-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u200D\u2019]+)/g),i=0;i<words.length;i+=1)-1!==words[i].indexOf("/")?0===i||i===words.length-1||/\s+\/|\/\s+/.test(words[i])||(words[i]+=""):words[i].length>minLength&&(words[i]=this.hyphenate(words[i]).join(""));return words.join("")},Hypher.prototype.hyphenate=function(word){var characters,originalCharacters,i,j,k,node,wordLength,nodePoints,nodePointsLength,characterPoints=[],points=[],lowerCaseWord=word.toLowerCase(),m=Math.max,trie=this.trie,result=[""];if(this.exceptions.hasOwnProperty(lowerCaseWord))return word.match(this.exceptions[lowerCaseWord]).slice(1);if(-1!==word.indexOf(""))return[word];for(characters=(word="_"+word+"_").toLowerCase().split(""),originalCharacters=word.split(""),wordLength=characters.length,i=0;i<wordLength;i+=1)points[i]=0,characterPoints[i]=characters[i].charCodeAt(0);for(i=0;i<wordLength;i+=1)for(node=trie,j=i;j<wordLength&&(node=node[characterPoints[j]]);j+=1)if(nodePoints=node._points)for(k=0,nodePointsLength=nodePoints.length;k<nodePointsLength;k+=1)points[i+k]=m(points[i+k],nodePoints[k]);for(i=1;i<wordLength-1;i+=1)i>this.leftMin&&i<wordLength-this.rightMin&&points[i]%2?result.push(originalCharacters[i]):result[result.length-1]+=originalCharacters[i];return result},module.exports=Hypher,window.Hypher=module.exports,window.Hypher.languages={}}(),jQuery.fn.hyphenate=function(language){if(window.Hypher.languages[language])return this.each(function(){for(var i=0,len=this.childNodes.length;i<len;i+=1)3===this.childNodes[i].nodeType&&(this.childNodes[i].nodeValue=window.Hypher.languages[language].hyphenateText(this.childNodes[i].nodeValue))})},function(global){var iteratorSupported=function(){try{return!!Symbol.iterator}catch(error){return!1}}(),createIterator=function(items){var iterator={next:function(){var value=items.shift();return{done:void 0===value,value:value}}};return iteratorSupported&&(iterator[Symbol.iterator]=function(){return iterator}),iterator},serializeParam=function(value){return encodeURIComponent(value).replace(/%20/g,"+")},deserializeParam=function(value){return decodeURIComponent(value).replace(/\+/g," ")};"URLSearchParams"in global&&"a=1"===new URLSearchParams("?a=1").toString()||function(){var URLSearchParams=function(searchString){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var typeofSearchString=typeof searchString;if("undefined"===typeofSearchString);else if("string"===typeofSearchString)""!==searchString&&this._fromString(searchString);else if(searchString instanceof URLSearchParams){var _this=this;searchString.forEach(function(value,name){_this.append(name,value)})}else{if(null===searchString||"object"!==typeofSearchString)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(searchString))for(var i=0;i<searchString.length;i++){var entry=searchString[i];if("[object Array]"!==Object.prototype.toString.call(entry)&&2===entry.length)throw new TypeError("Expected [string, any] as entry at index "+i+" of URLSearchParams's input");this.append(entry[0],entry[1])}else for(var key in searchString)searchString.hasOwnProperty(key)&&this.append(key,searchString[key])}},proto=URLSearchParams.prototype;proto.append=function(name,value){name in this._entries?this._entries[name].push(String(value)):this._entries[name]=[String(value)]},proto.delete=function(name){delete this._entries[name]},proto.get=function(name){return name in this._entries?this._entries[name][0]:null},proto.getAll=function(name){return name in this._entries?this._entries[name].slice(0):[]},proto.has=function(name){return name in this._entries},proto.set=function(name,value){this._entries[name]=[String(value)]},proto.forEach=function(callback,thisArg){var entries;for(var name in this._entries)if(this._entries.hasOwnProperty(name)){entries=this._entries[name];for(var i=0;i<entries.length;i++)callback.call(thisArg,entries[i],name,this)}},proto.keys=function(){var items=[];return this.forEach(function(value,name){items.push(name)}),createIterator(items)},proto.values=function(){var items=[];return this.forEach(function(value){items.push(value)}),createIterator(items)},proto.entries=function(){var items=[];return this.forEach(function(value,name){items.push([name,value])}),createIterator(items)},iteratorSupported&&(proto[Symbol.iterator]=proto.entries),proto.toString=function(){var searchArray=[];return this.forEach(function(value,name){searchArray.push(serializeParam(name)+"="+serializeParam(value))}),searchArray.join("&")},global.URLSearchParams=URLSearchParams}();var proto=URLSearchParams.prototype;"function"!=typeof proto.sort&&(proto.sort=function(){var _this=this,items=[];this.forEach(function(value,name){items.push([name,value]),_this._entries||_this.delete(name)}),items.sort(function(a,b){return a[0]<b[0]?-1:a[0]>b[0]?1:0}),_this._entries&&(_this._entries={});for(var i=0;i<items.length;i++)this.append(items[i][0],items[i][1])}),"function"!=typeof proto._fromString&&Object.defineProperty(proto,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(searchString){if(this._entries)this._entries={};else{var keys=[];this.forEach(function(value,name){keys.push(name)});for(var i=0;i<keys.length;i++)this.delete(keys[i])}var attribute,attributes=(searchString=searchString.replace(/^\?/,"")).split("&");for(i=0;i<attributes.length;i++)attribute=attributes[i].split("="),this.append(deserializeParam(attribute[0]),1<attribute.length?deserializeParam(attribute[1]):"")}})}("undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this),function(global){if(function(){try{var u=new URL("b","http://a");return u.pathname="c%20d","http://a/c%20d"===u.href&&u.searchParams}catch(e){return!1}}()||function(){var _URL=global.URL,URL=function(url,base){"string"!=typeof url&&(url=String(url));var baseElement,doc=document;if(base&&(void 0===global.location||base!==global.location.href)){(baseElement=(doc=document.implementation.createHTMLDocument("")).createElement("base")).href=base,doc.head.appendChild(baseElement);try{if(0!==baseElement.href.indexOf(base))throw new Error(baseElement.href)}catch(err){throw new Error("URL unable to set base "+base+" due to "+err)}}var anchorElement=doc.createElement("a");if(anchorElement.href=url,baseElement&&(doc.body.appendChild(anchorElement),anchorElement.href=anchorElement.href),":"===anchorElement.protocol||!/:/.test(anchorElement.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:anchorElement});var searchParams=new URLSearchParams(this.search),enableSearchUpdate=!0,enableSearchParamsUpdate=!0,_this=this;["append","delete","set"].forEach(function(methodName){var method=searchParams[methodName];searchParams[methodName]=function(){method.apply(searchParams,arguments),enableSearchUpdate&&(enableSearchParamsUpdate=!1,_this.search=searchParams.toString(),enableSearchParamsUpdate=!0)}}),Object.defineProperty(this,"searchParams",{value:searchParams,enumerable:!0});var search=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==search&&(search=this.search,enableSearchParamsUpdate&&(enableSearchUpdate=!1,this.searchParams._fromString(this.search),enableSearchUpdate=!0))}})},proto=URL.prototype;["hash","host","hostname","port","protocol"].forEach(function(attributeName){!function(attributeName){Object.defineProperty(proto,attributeName,{get:function(){return this._anchorElement[attributeName]},set:function(value){this._anchorElement[attributeName]=value},enumerable:!0})}(attributeName)}),Object.defineProperty(proto,"search",{get:function(){return this._anchorElement.search},set:function(value){this._anchorElement.search=value,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(proto,{toString:{get:function(){var _this=this;return function(){return _this.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(value){this._anchorElement.href=value,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(value){this._anchorElement.pathname=value},enumerable:!0},origin:{get:function(){var expectedPort={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],addPortToOrigin=this._anchorElement.port!=expectedPort&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(addPortToOrigin?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(value){},enumerable:!0},username:{get:function(){return""},set:function(value){},enumerable:!0}}),URL.createObjectURL=function(blob){return _URL.createObjectURL.apply(_URL,arguments)},URL.revokeObjectURL=function(url){return _URL.revokeObjectURL.apply(_URL,arguments)},global.URL=URL}(),void 0!==global.location&&!("origin"in global.location)){var getOrigin=function(){return global.location.protocol+"//"+global.location.hostname+(global.location.port?":"+global.location.port:"")};try{Object.defineProperty(global.location,"origin",{get:getOrigin,enumerable:!0})}catch(e){setInterval(function(){global.location.origin=getOrigin()},100)}}}("undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.contextAware"),fluid.defaults("fluid.contextAware.marker",{gradeNames:["fluid.component"]}),fluid.contextAware.makeCheckMarkers=function(checks,path,instantiator){fluid.each(checks,function(value,markerTypeName){fluid.constructSingle(path,{type:markerTypeName,gradeNames:"fluid.contextAware.marker",value:value},instantiator)})},fluid.contextAware.performChecks=function(checkHash){return fluid.transform(checkHash,function(checkRecord){return"function"==typeof checkRecord?checkRecord={func:checkRecord}:"string"==typeof checkRecord&&(checkRecord={funcName:checkRecord}),fluid.isPrimitive(checkRecord)?checkRecord:"value"in checkRecord?checkRecord.value:"func"in checkRecord?checkRecord.func():"funcName"in checkRecord?fluid.invokeGlobalFunction(checkRecord.funcName):void fluid.fail("Error in contextAwareness check record ",checkRecord," - must contain an entry with name value, func, or funcName")})},fluid.contextAware.makeChecks=function(checkHash,path,instantiator){var checkOptions=fluid.contextAware.performChecks(checkHash);fluid.contextAware.makeCheckMarkers(checkOptions,path,instantiator)},fluid.contextAware.forgetChecks=function(markerNames,path,instantiator){instantiator=instantiator||fluid.globalInstantiator,path=path||[];var markerArray=fluid.makeArray(markerNames);fluid.each(markerArray,function(markerName){var memberName=fluid.typeNameToMemberName(markerName),segs=fluid.model.parseToSegments(path,instantiator.parseEL,!0);segs.push(memberName),fluid.destroy(segs,instantiator)})},fluid.defaults("fluid.contextAware",{gradeNames:["{that}.check"],mergePolicy:{contextAwareness:"noexpand"},contextAwareness:{},invokers:{check:{funcName:"fluid.contextAware.check",args:["{that}","{that}.options.contextAwareness"]}}}),fluid.contextAware.getCheckValue=function(that,reference){var targetRef=fluid.parseContextReference(reference),targetComponent=fluid.resolveContext(targetRef.context,that),path=targetRef.path||["options","value"];return fluid.getForComponent(targetComponent,path)},fluid.contextAware.checkOne=function(that,contextAwareRecord){contextAwareRecord.checks&&contextAwareRecord.checks.contextValue&&fluid.fail("Nesting error in contextAwareness record ",contextAwareRecord,' - the "checks" entry must contain a hash and not a contextValue/gradeNames record at top level');var checkList=fluid.parsePriorityRecords(contextAwareRecord.checks,"contextAwareness checkRecord");return fluid.find(checkList,function(check){check.contextValue||fluid.fail("Cannot perform check for contextAwareness record ",check,' without a valid field named "contextValue"');var value=fluid.contextAware.getCheckValue(that,check.contextValue);if(void 0===check.equals?value:value===check.equals)return check.gradeNames},contextAwareRecord.defaultGradeNames)},fluid.contextAware.check=function(that,contextAwarenessOptions){var gradeNames=[],contextAwareList=fluid.parsePriorityRecords(contextAwarenessOptions,"contextAwareness adaptationRecord");return fluid.each(contextAwareList,function(record){var matched=fluid.contextAware.checkOne(that,record);gradeNames=gradeNames.concat(fluid.makeArray(matched))}),gradeNames},fluid.contextAware.makeAdaptation=function(options){fluid.expect("fluid.contextAware.makeAdaptation",options,["distributionName","targetName","adaptationName","checkName","record"]),fluid.defaults(options.distributionName,{gradeNames:["fluid.component"],distributeOptions:{target:"{/ "+options.targetName+"}.options.contextAwareness."+options.adaptationName+".checks."+options.checkName,record:options.record}}),fluid.constructSingle([],options.distributionName)},fluid.contextAware.isBrowser=function(){return"undefined"!=typeof window&&!!window.document},fluid.contextAware.makeChecks({"fluid.browser":{funcName:"fluid.contextAware.isBrowser"}}),fluid.registerNamespace("fluid.contextAware.browser"),fluid.contextAware.browser.getPlatformName=function(){return"undefined"!=typeof navigator&&navigator.platform?navigator.platform:void 0},fluid.contextAware.browser.getUserAgent=function(){return"undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent:void 0},fluid.contextAware.makeChecks({"fluid.browser.platformName":{funcName:"fluid.contextAware.browser.getPlatformName"},"fluid.browser.userAgent":{funcName:"fluid.contextAware.browser.getUserAgent"}})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.enhance"),fluid.contextAware.isBrowser()&&$.fn&&$("head").append("<style type='text/css'>.fl-progEnhance-basic, .fl-ProgEnhance-basic { display: none; } .fl-progEnhance-enhanced, .fl-ProgEnhance-enhanced { display: block; }</style>")}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.XMLP=function(strXML){return fluid.XMLP.XMLPImpl(strXML)},fluid.XMLP.closedTags={abbr:!0,br:!0,col:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,hr:!0,area:!0,embed:!0},fluid.XMLP._NONE=0,fluid.XMLP._ELM_B=1,fluid.XMLP._ELM_E=2,fluid.XMLP._ELM_EMP=3,fluid.XMLP._ATT=4,fluid.XMLP._TEXT=5,fluid.XMLP._ENTITY=6,fluid.XMLP._PI=7,fluid.XMLP._CDATA=8,fluid.XMLP._COMMENT=9,fluid.XMLP._DTD=10,fluid.XMLP._ERROR=11,fluid.XMLP._CONT_XML=0,fluid.XMLP._CONT_ALT=1,fluid.XMLP._ATT_NAME=0,fluid.XMLP._ATT_VAL=1,fluid.XMLP._STATE_PROLOG=1,fluid.XMLP._STATE_DOCUMENT=2,fluid.XMLP._STATE_MISC=3,fluid.XMLP._errs=[],fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_PI=0]="PI: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_DTD=1]="DTD: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_COMMENT=2]="Comment: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_CDATA=3]="CDATA: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_ELM=4]="Element: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_ENTITY=5]="Entity: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_PI_TARGET=6]="PI: target is required",fluid.XMLP._errs[fluid.XMLP.ERR_ELM_EMPTY=7]="Element: cannot be both empty and closing",fluid.XMLP._errs[fluid.XMLP.ERR_ELM_NAME=8]='Element: name must immediately follow "<"',fluid.XMLP._errs[fluid.XMLP.ERR_ELM_LT_NAME=9]='Element: "<" not allowed in element names',fluid.XMLP._errs[fluid.XMLP.ERR_ATT_VALUES=10]="Attribute: values are required and must be in quotes",fluid.XMLP._errs[fluid.XMLP.ERR_ATT_LT_NAME=11]='Element: "<" not allowed in attribute names',fluid.XMLP._errs[fluid.XMLP.ERR_ATT_LT_VALUE=12]='Attribute: "<" not allowed in attribute values',fluid.XMLP._errs[fluid.XMLP.ERR_ATT_DUP=13]="Attribute: duplicate attributes not allowed",fluid.XMLP._errs[fluid.XMLP.ERR_ENTITY_UNKNOWN=14]="Entity: unknown entity",fluid.XMLP._errs[fluid.XMLP.ERR_INFINITELOOP=15]="Infinite loop",fluid.XMLP._errs[fluid.XMLP.ERR_DOC_STRUCTURE=16]="Document: only comments, processing instructions, or whitespace allowed outside of document element",fluid.XMLP._errs[fluid.XMLP.ERR_ELM_NESTING=17]="Element: must be nested correctly",fluid.XMLP._checkStructure=function(that,iEvent){var stack=that.m_stack;if(fluid.XMLP._STATE_PROLOG==that.m_iState&&(that.m_iState=fluid.XMLP._STATE_DOCUMENT),fluid.XMLP._STATE_DOCUMENT===that.m_iState&&(fluid.XMLP._ELM_B!=iEvent&&fluid.XMLP._ELM_EMP!=iEvent||(that.m_stack[stack.length]=that.getName()),fluid.XMLP._ELM_E==iEvent||fluid.XMLP._ELM_EMP==iEvent)){if(0===stack.length)return fluid.XMLP._NONE;var strTop=stack[stack.length-1];if(that.m_stack.length--,null===strTop||strTop!==that.getName())return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_NESTING)}return iEvent},fluid.XMLP._parseCDATA=function(that,iB){var iE=that.m_xml.indexOf("]]>",iB);return-1==iE?fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_CDATA):(fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB,iE),that.m_iP=iE+3,fluid.XMLP._CDATA)},fluid.XMLP._parseComment=function(that,iB){var iE=that.m_xml.indexOf("--\x3e",iB);return-1==iE?fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_COMMENT):(fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB-4,iE+3),that.m_iP=iE+3,fluid.XMLP._COMMENT)},fluid.XMLP._parseDTD=function(that,iB){var iE,strClose,iInt,iLast;if(-1==(iE=that.m_xml.indexOf(">",iB)))return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_DTD);for(strClose=-1!=(iInt=that.m_xml.indexOf("[",iB))&&iInt<iE?"]>":">";;){if(iE==iLast)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_INFINITELOOP);if(iLast=iE,-1==(iE=that.m_xml.indexOf(strClose,iB)))return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_DTD);if("]]>"!=that.m_xml.substring(iE-1,iE+2))break}return that.m_iP=iE+strClose.length,fluid.XMLP._DTD},fluid.XMLP._parsePI=function(that,iB){var iE,iTB,iTE,iCB,iCE;return-1==(iE=that.m_xml.indexOf("?>",iB))?fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_PI):-1==(iTB=fluid.SAXStrings.indexOfNonWhitespace(that.m_xml,iB,iE))?fluid.XMLP._setErr(that,fluid.XMLP.ERR_PI_TARGET):(-1==(iTE=fluid.SAXStrings.indexOfWhitespace(that.m_xml,iTB,iE))&&(iTE=iE),-1==(iCB=fluid.SAXStrings.indexOfNonWhitespace(that.m_xml,iTE,iE))&&(iCB=iE),-1==(iCE=fluid.SAXStrings.lastIndexOfNonWhitespace(that.m_xml,iCB,iE))&&(iCE=iE-1),that.m_name=that.m_xml.substring(iTB,iTE),fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iCB,iCE+1),that.m_iP=iE+2,fluid.XMLP._PI)},fluid.XMLP._parseText=function(that,iB){var iE=that.m_xml.indexOf("<",iB);return-1==iE&&(iE=that.m_xml.length),fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB,iE),that.m_iP=iE,fluid.XMLP._TEXT},fluid.XMLP._setContent=function(that,iSrc){var args=arguments;fluid.XMLP._CONT_XML==iSrc?(that.m_cAlt=null,that.m_cB=args[2],that.m_cE=args[3]):(that.m_cAlt=args[2],that.m_cB=0,that.m_cE=args[2].length),that.m_cSrc=iSrc},fluid.XMLP._setErr=function(that,iErr){var strErr=fluid.XMLP._errs[iErr];return that.m_cAlt=strErr,that.m_cB=0,that.m_cE=strErr.length,that.m_cSrc=fluid.XMLP._CONT_ALT,fluid.XMLP._ERROR},fluid.XMLP._parseElement=function(that,iB){var iE,iDE,iType,strN;if(iDE=iE=that.m_xml.indexOf(">",iB),-1==iE)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_ELM);if("/"==that.m_xml.charAt(iB)?(iType=fluid.XMLP._ELM_E,iB++):iType=fluid.XMLP._ELM_B,"/"==that.m_xml.charAt(iE-1)){if(iType==fluid.XMLP._ELM_E)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_EMPTY);iType=fluid.XMLP._ELM_EMP,iDE--}that.nameRegex.lastIndex=iB;var nameMatch=that.nameRegex.exec(that.m_xml);if(!nameMatch)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_NAME);if("li"===(strN=nameMatch[1].toLowerCase())&&iType!==fluid.XMLP._ELM_E&&0<that.m_stack.length&&"li"===that.m_stack[that.m_stack.length-1]&&!that.m_emitSynthetic)return that.m_name="li",that.m_emitSynthetic=!0,fluid.XMLP._ELM_E;if(that.m_attributes={},that.m_cAlt="",that.nameRegex.lastIndex<iDE)for(that.m_iP=that.nameRegex.lastIndex;that.m_iP<iDE;){that.attrStartRegex.lastIndex=that.m_iP;var attrMatch=that.attrStartRegex.exec(that.m_xml);if(!attrMatch)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ATT_VALUES);var attrval,attrname=attrMatch[1].toLowerCase();if(61===that.m_xml.charCodeAt(that.attrStartRegex.lastIndex)){var valRegex=34===that.m_xml.charCodeAt(that.attrStartRegex.lastIndex+1)?that.attrValRegex:that.attrValIERegex;if(valRegex.lastIndex=that.attrStartRegex.lastIndex+1,!(attrMatch=valRegex.exec(that.m_xml)))return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ATT_VALUES);attrval=attrMatch[1]}else attrval=attrname,valRegex=that.attrStartRegex;if(that.m_attributes[attrname]&&that.m_attributes[attrname]!==attrval)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ATT_DUP);that.m_attributes[attrname]=attrval,that.m_iP=valRegex.lastIndex}if(-1!=strN.indexOf("<"))return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_LT_NAME);if(that.m_name=strN,that.m_iP=iE+1,fluid.XMLP.closedTags[strN]){that.closeRegex.lastIndex=iE+1;var closeMatch=that.closeRegex.exec;if(closeMatch)return that.m_xml.indexOf(strN,closeMatch.lastIndex)===closeMatch.lastIndex?iType:fluid.XMLP._ELM_EMP}return that.m_emitSynthetic=!1,iType},fluid.XMLP._parse=function(that){var iP=that.m_iP,xml=that.m_xml;if(iP===xml.length)return fluid.XMLP._NONE;if("<"!==xml.charAt(iP))return fluid.XMLP._parseText(that,iP);var c2=xml.charAt(iP+1);return"?"===c2?fluid.XMLP._parsePI(that,iP+2):"!"!==c2?fluid.XMLP._parseElement(that,iP+1):iP===xml.indexOf("<!DOCTYPE",iP)?fluid.XMLP._parseDTD(that,iP+9):iP===xml.indexOf("\x3c!--",iP)?fluid.XMLP._parseComment(that,iP+4):iP===xml.indexOf("<![CDATA[",iP)?fluid.XMLP._parseCDATA(that,iP+9):void 0},fluid.XMLP.XMLPImpl=function(strXML){var that={};return that.m_xml=strXML,that.m_iP=0,that.m_iState=fluid.XMLP._STATE_PROLOG,that.m_stack=[],that.m_attributes={},that.m_emitSynthetic=!1,that.getColumnNumber=function(){return fluid.SAXStrings.getColumnNumber(that.m_xml,that.m_iP)},that.getContent=function(){return that.m_cSrc==fluid.XMLP._CONT_XML?that.m_xml:that.m_cAlt},that.getContentBegin=function(){return that.m_cB},that.getContentEnd=function(){return that.m_cE},that.getLineNumber=function(){return fluid.SAXStrings.getLineNumber(that.m_xml,that.m_iP)},that.getName=function(){return that.m_name},that.next=function(){return fluid.XMLP._checkStructure(that,fluid.XMLP._parse(that))},that.nameRegex=/([^\s\/>]+)/g,that.attrStartRegex=/\s*([\w:_][\w:_\-\.]*)/gm,that.attrValRegex=/\"([^\"]*)\"\s*/gm,that.attrValIERegex=/([^\>\s]+)\s*/gm,that.closeRegex=/\s*<\//g,that},fluid.SAXStrings={},fluid.SAXStrings.WHITESPACE=" \t\n\r",fluid.SAXStrings.QUOTES="\"'",fluid.SAXStrings.getColumnNumber=function(strD,iP){if(!strD)return-1;iP=iP||strD.length;var arrD=strD.substring(0,iP).split("\n");return arrD.length--,iP-arrD.join("\n").length},fluid.SAXStrings.getLineNumber=function(strD,iP){return strD?(iP=iP||strD.length,strD.substring(0,iP).split("\n").length):-1},fluid.SAXStrings.indexOfNonWhitespace=function(strD,iB,iE){if(!strD)return-1;iB=iB||0,iE=iE||strD.length;for(var i=iB;i<iE;++i){var c=strD.charAt(i);if(" "!==c&&"\t"!==c&&"\n"!==c&&"\r"!==c)return i}return-1},fluid.SAXStrings.indexOfWhitespace=function(strD,iB,iE){if(!strD)return-1;iB=iB||0,iE=iE||strD.length;for(var i=iB;i<iE;i++)if(-1!=fluid.SAXStrings.WHITESPACE.indexOf(strD.charAt(i)))return i;return-1},fluid.SAXStrings.lastIndexOfNonWhitespace=function(strD,iB,iE){if(!strD)return-1;iB=iB||0;for(var i=(iE=iE||strD.length)-1;iB<=i;i--)if(-1==fluid.SAXStrings.WHITESPACE.indexOf(strD.charAt(i)))return i;return-1},fluid.SAXStrings.replace=function(strD,iB,iE,strF,strR){return strD?(iB=iB||0,iE=iE||strD.length,strD.substring(iB,iE).split(strF).join(strR)):""}}(jQuery,fluid_3_0_0),fluid_3_0_0=fluid_3_0_0||{},function($,fluid){"use strict";fluid.parseTemplate=function(template,baseURL,scanStart,cutpoints_in,opts){var t,parser,tagstack;opts=opts||{},template||fluid.fail("empty template supplied to fluid.parseTemplate");var lumpindex=0,nestingdepth=0,justended=!1,defstart=-1,defend=-1,debugMode=!1,cutpoints=[],simpleClassCutpoints={},cutstatus=[],XMLLump=function(lumpindex,nestingdepth){return{nestingdepth:nestingdepth,lumpindex:lumpindex,parent:t}};function isSimpleClassCutpoint(tree){return 1===tree.length&&1===tree[0].predList.length&&tree[0].predList[0].clazz}function newLump(){var togo=XMLLump(lumpindex,nestingdepth);return debugMode&&(togo.line=parser.getLineNumber(),togo.column=parser.getColumnNumber()),t.lumps[lumpindex]=togo,++lumpindex,togo}function addLump(mmap,ID,lump){var list=mmap[ID];list||(list=[],mmap[ID]=list),list[list.length]=lump}function debugLump(lump){return"<"+lump.tagname+">"}function matchNode(term,headlump,headclazz){if(term.predList){for(var i=0;i<term.predList.length;++i){var pred=term.predList[i];if(pred.id&&headlump.attributemap.id!==pred.id)return!1;if(pred.clazz&&(clazz=pred.clazz,!(totest=headclazz)||-1===(" "+totest+" ").indexOf(" "+clazz+" ")))return!1;if(pred.tag&&headlump.tagname!==pred.tag)return!1}return!0}var clazz,totest}function processTagEnd(){!function(){if(cutpoints)for(var i=0;i<cutpoints.length;++i){var cutstat=cutstatus[i];0<cutstat.length&&cutstat[cutstat.length-1]===nestingdepth&&cutstat.length--}}();var endlump=newLump();--nestingdepth,endlump.text="</"+parser.getName()+">",tagstack[tagstack.length-1].close_tag=t.lumps[lumpindex-1],tagstack.length--,justended=!0}function processTagStart(isempty){(++nestingdepth,justended)&&(justended=!1,newLump().nestingdepth--);-1===t.firstdocumentindex&&(t.firstdocumentindex=lumpindex);var headlump=newLump(),stacktop=tagstack[tagstack.length-1];headlump.uplump=stacktop;var tagname=parser.getName();headlump.tagname=tagname;var attrs=headlump.attributemap=parser.m_attributes,ID=attrs[fluid.ID_ATTRIBUTE];for(var attrname in void 0===ID&&(ID=function(headlump){var togo,i,headclazz=headlump.attributemap.class;if(headclazz){var split=headclazz.split(" ");for(i=0;i<split.length;++i){var simpleCut=simpleClassCutpoints[$.trim(split[i])];if(simpleCut)return simpleCut}}for(i=0;i<cutpoints.length;++i){var cut=cutpoints[i],cutstat=cutstatus[i],nextterm=cutstat.length;if(nextterm<cut.tree.length){var term=cut.tree[nextterm];if(0<nextterm&&cut.tree[nextterm-1].child&&cutstat[nextterm-1]!==headlump.nestingdepth-1)continue;matchNode(term,headlump,headclazz)&&(cutstat[cutstat.length]=headlump.nestingdepth,cutstat.length===cut.tree.length&&(void 0!==togo&&fluid.fail("Cutpoint specification error - node "+debugLump(headlump)+" has already matched with rsf:id of "+togo),void 0!==cut.id&&null!==cut.id||fluid.fail("Error in cutpoints list - entry at position "+i+" does not have an id set"),togo=cut.id))}}return togo}(headlump)),attrs)void 0===ID&&(/href|src|codebase|action/.test(attrname)?ID="scr=rewrite-url":void 0===ID&&/for|headers/.test(attrname)&&(ID="scr=null"));if(ID){126===ID.charCodeAt(0)&&(ID=ID.substring(1),headlump.elide=!0),function(ID,lump){if(-1!==ID.indexOf("scr=contribute-")){var scr=ID.substring("scr=contribute-".length);addLump(t.collectmap,scr,lump)}}(ID,headlump),headlump.rsfID=ID;var downreg=function(){for(var i=tagstack.length-1;0<=i;--i){var lump=tagstack[i];if(void 0!==lump.rsfID)return lump}return t.rootlump}();for(downreg.downmap||(downreg.downmap={});downreg;)downreg.downmap&&addLump(downreg.downmap,ID,headlump),downreg=downreg.uplump;addLump(t.globalmap,ID,headlump);var colpos=ID.indexOf(":");if(-1!==colpos){var prefix=ID.substring(0,colpos);stacktop.finallump||(stacktop.finallump={}),stacktop.finallump[prefix]=headlump}}headlump.text="<"+tagname+fluid.dumpAttributes(attrs)+(isempty&&!ID?"/>":">"),tagstack[tagstack.length]=headlump,isempty&&(ID?processTagEnd():(--nestingdepth,tagstack.length--))}function processDefaultTag(){if(-1!==defstart){-1===t.firstdocumentindex&&(t.firstdocumentindex=lumpindex);var text=parser.getContent().substr(defstart,defend-defstart);justended=!1,newLump().text=text,defstart=-1}}t=fluid.XMLViewTemplate(),function(baseURLin,debugModeIn,cutpointsIn){if(t.rootlump=XMLLump(0,-1),tagstack=[t.rootlump],nestingdepth=lumpindex=0,justended=!1,defend=defstart=-1,baseURL=baseURLin,debugMode=debugModeIn,cutpointsIn)for(var i=0;i<cutpointsIn.length;++i){var tree=fluid.parseSelector(cutpointsIn[i].selector,fluid.simpleCSSMatcher),clazz=isSimpleClassCutpoint(tree);clazz?simpleClassCutpoints[clazz]=cutpointsIn[i].id:(cutstatus.push([]),cutpoints.push($.extend({},cutpointsIn[i],{tree:tree})))}}(baseURL,opts.debugMode,cutpoints_in);var idpos=template.indexOf(fluid.ID_ATTRIBUTE);if(scanStart){var brackpos=template.indexOf(">",idpos);parser=fluid.XMLP(template.substring(brackpos+1))}else parser=fluid.XMLP(template);parseloop:for(;;){switch(parser.next()){case fluid.XMLP._ELM_B:processDefaultTag(),processTagStart(!1);break;case fluid.XMLP._ELM_E:processDefaultTag(),processTagEnd();break;case fluid.XMLP._ELM_EMP:processDefaultTag(),processTagStart(!0);break;case fluid.XMLP._PI:case fluid.XMLP._DTD:defstart=-1;continue;case fluid.XMLP._TEXT:case fluid.XMLP._ENTITY:case fluid.XMLP._CDATA:case fluid.XMLP._COMMENT:-1===defstart&&(defstart=parser.m_cB),defend=parser.m_cE;break;case fluid.XMLP._ERROR:fluid.setLogging(!0);var message="Error parsing template: "+parser.m_cAlt+" at line "+parser.getLineNumber();fluid.log(message),fluid.log("Just read: "+parser.m_xml.substring(parser.m_iP-30,parser.m_iP)),fluid.log("Still to read: "+parser.m_xml.substring(parser.m_iP,parser.m_iP+30)),fluid.fail(message);break parseloop;case fluid.XMLP._NONE:break parseloop}}processDefaultTag();var excess=tagstack.length-1;return excess&&fluid.fail("Error parsing template - unclosed tag(s) of depth "+excess+": "+fluid.transform(tagstack.splice(1,excess),function(lump){return debugLump(lump)}).join(", ")),t},fluid.debugLump=function(lump){var togo=lump.text;return togo+=" at ",togo+="lump line "+lump.line+" column "+lump.column+" index "+lump.lumpindex,togo+=null===lump.parent.href?"":" in file "+lump.parent.href},fluid.ID_ATTRIBUTE="rsf:id",fluid.getPrefix=function(id){var colpos=id.indexOf(":");return-1===colpos?id:id.substring(0,colpos)},fluid.SplitID=function(id){var that={},colpos=id.indexOf(":");return-1===colpos?that.prefix=id:(that.prefix=id.substring(0,colpos),that.suffix=id.substring(colpos+1)),that},fluid.XMLViewTemplate=function(){return{globalmap:{},collectmap:{},lumps:[],firstdocumentindex:-1}},fluid.XMLEncode=function(text){return text.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\"/g,""")},fluid.dumpAttributes=function(attrcopy){var togo="";for(var attrname in attrcopy){var attrvalue=attrcopy[attrname];null!=attrvalue&&(togo+=" "+attrname+'="'+attrvalue+'"')}return togo},fluid.aggregateMMap=function(target,source){for(var key in source){target[key]||(target[key]=[]),target[key]=target[key].concat(source[key])}},fluid.parseTemplates=function(resourceSpec,templateList,opts){var togo=[];opts=opts||{},togo.globalmap={};for(var i=0;i<templateList.length;++i){var resource=resourceSpec[templateList[i]],lastslash=resource.href.lastIndexOf("/"),baseURL=-1===lastslash?"":resource.href.substring(0,lastslash+1),template=fluid.parseTemplate(resource.resourceText,baseURL,opts.scanStart&&0===i,resource.cutpoints,opts);0===i&&fluid.aggregateMMap(togo.globalmap,template.globalmap),template.href=resource.href,template.baseURL=baseURL,template.resourceKey=resource.resourceKey,togo[i]=template,fluid.aggregateMMap(togo.globalmap,template.rootlump.downmap)}return togo}}(jQuery,fluid_3_0_0),fluid_3_0_0=fluid_3_0_0||{},function($,fluid){"use strict";function debugPosition(component){return"as child of "+(component.parent.fullID?"component with full ID "+component.parent.fullID:"root")}function computeFullID(component){var togo="",move=component;for(void 0===component.children&&(togo=component.ID+(void 0!==component.localID?component.localID:""),move=component.parent);move.parent;){var parent=move.parent;if(void 0!==move.fullID)return togo=move.fullID+togo;if(void 0===move.noID){var ID=move.ID;void 0===ID&&fluid.fail("Error in component tree - component found with no ID "+debugPosition(parent)+": please check structure");var colpos=ID.indexOf(":");togo=(-1===colpos?ID:ID.substring(0,colpos))+":"+(void 0===move.localID?"":move.localID)+":"+togo}move=parent}return togo}var unzipComponent,renderer={};function processChild(value,key){if(renderer.isBoundPrimitive(value))return{componentType:"UIBound",value:value,ID:key};var unzip=unzipComponent(value);return unzip.ID?{ID:key,componentType:"UIContainer",children:[unzip]}:(unzip.ID=key,unzip)}function fixupValue(uibound,model,resolverGetConfig){void 0===uibound.value&&void 0!==uibound.valuebinding&&(uibound.value=fluid.get(model,uibound.valuebinding,resolverGetConfig))}function upgradeBound(holder,property,model,resolverGetConfig){void 0!==holder[property]?renderer.isBoundPrimitive(holder[property])?holder[property]={value:holder[property]}:holder[property].messagekey&&(holder[property].componentType="UIMessage"):holder[property]={value:null},fixupValue(holder[property],model,resolverGetConfig)}renderer.isBoundPrimitive=function(value){return fluid.isPrimitive(value)||fluid.isArrayable(value)&&(0===value.length||"string"==typeof value[0])},renderer.duckMap={children:"UIContainer",value:"UIBound",valuebinding:"UIBound",messagekey:"UIMessage",markup:"UIVerbatim",selection:"UISelect",target:"UILink",choiceindex:"UISelectChoice",functionname:"UIInitBlock"};renderer.boundMap=fluid.transform({UISelect:["selection","optionlist","optionnames"],UILink:["target","linktext"],UIVerbatim:["markup"],UIMessage:["messagekey"]},fluid.arrayToHash),renderer.inferComponentType=function(component){for(var key in renderer.duckMap)if(void 0!==component[key])return renderer.duckMap[key]},renderer.applyComponentType=function(component){component.componentType=renderer.inferComponentType(component),void 0===component.componentType&&void 0!==component.ID&&(component.componentType="UIBound")},unzipComponent=function(component,model,resolverGetConfig){if(component&&renderer.applyComponentType(component),!component||void 0===component.componentType){var decorators=component.decorators;decorators&&delete component.decorators,(component={componentType:"UIContainer",children:component}).decorators=decorators}var cType=component.componentType;if("UIContainer"===cType)component.children=function(children){if(fluid.isArrayable(children))return children;var togo=[];for(var key in children){var value=children[key];if(fluid.isArrayable(value))for(var i=0;i<value.length;++i){var processed=processChild(value[i],key);togo[togo.length]=processed}else togo[togo.length]=processChild(value,key)}return togo}(component.children);else{var map=renderer.boundMap[cType];map&&fluid.each(map,function(value,key){upgradeBound(component,key,model,resolverGetConfig)})}return component},fluid.NULL_STRING="▩null▩";var LINK_ATTRIBUTES={a:"href",link:"href",img:"src",frame:"src",script:"src",style:"src",input:"src",embed:"src",form:"action",applet:"codebase",object:"codebase"};renderer.decoratorComponentPrefix="**-renderer-",renderer.IDtoComponentName=function(ID,num){return renderer.decoratorComponentPrefix+ID.replace(/\./g,"")+"-"+num},renderer.invokeFluidDecorator=function(func,args,ID,num,options){var that;if(options.parentComponent){var parent=options.parentComponent,name=renderer.IDtoComponentName(ID,num);fluid.set(parent,["options","components",name],{type:func,container:args[0],options:args[1]}),that=fluid.initDependent(options.parentComponent,name)}else that=fluid.invokeGlobalFunction(func,args);return that},fluid.renderer=function(templates,tree,options,fossilsIn){tree=tree||{};var debugMode=(options=options||{}).debugMode;!options.messageLocator&&options.messageSource&&(options.messageLocator=fluid.resolveMessageSource(options.messageSource)),options.document=options.document||document,options.jQuery=options.jQuery||$,options.fossils=options.fossils||fossilsIn||{};var fetchComponent,globalmap={},branchmap={},rewritemap={},seenset={},collected={},out="",renderOptions=options,decoratorQueue=[],renderedbindings={},usedIDs={},that={options:options};function getRewriteKey(template,parent,id){return template.resourceKey+parent.fullID+id}function resolveInScope(searchID,defprefix,scope){var deflump,scopelook=scope?scope[searchID]:null;if(scopelook)for(var i=0;i<scopelook.length;++i){var scopelump=scopelook[i];if(deflump||scopelump.rsfID!==defprefix||(deflump=scopelump),scopelump.rsfID===searchID)return scopelump}return deflump}function resolveBranches(globalmapp,basecontainer,parentlump){rewritemap={},seenset={},collected={},globalmap=globalmapp,function resolveRecurse(basecontainer,parentlump){var i,id,resolved,template,sourcescope,child,searchID,defprefix,match;for(i=0;i<basecontainer.children.length;++i){var branch=basecontainer.children[i];branch.children&&(sourcescope=parentlump,match=void 0,searchID=(child=branch).jointID?child.jointID:child.ID,defprefix=fluid.SplitID(searchID).prefix+":",(resolved=(match=resolveInScope(searchID,defprefix,sourcescope.downmap))||(child.children&&(match=resolveInScope(searchID,defprefix,globalmap))?match:null))&&(void 0!==(id=(branchmap[branch.fullID]=resolved).attributemap.id)&&(rewritemap[getRewriteKey(parentlump.parent,basecontainer,id)]=branch.fullID),template=resolved.parent,seenset[template.href]||(fluid.aggregateMMap(collected,template.collectmap),seenset[template.href]=!0),resolveRecurse(branch,resolved)))}if(parentlump.downmap)for(id in parentlump.downmap){var lumps=parentlump.downmap[id];for(i=0;i<lumps.length;++i){var lump=lumps[i],lumpid=lump.attributemap.id;if(void 0!==lumpid&&void 0!==lump.rsfID&&null!==(resolved=fetchComponent(basecontainer,lump.rsfID))){var resolveID=resolved.fullID;rewritemap[getRewriteKey(parentlump.parent,basecontainer,lumpid)]=resolveID}}}}(basecontainer,(branchmap={})[basecontainer.fullID]=parentlump)}function dumpTillLump(lumps,start,limit){for(;start<limit;++start){lumps[start].text&&(out+=lumps[start].text)}}function dumpScan(lumps,renderindex,basedepth,closeparent,insideleaf){for(var start=renderindex;renderindex!==lumps.length;){var lump=lumps[renderindex];if(lump.nestingdepth<basedepth)break;if(void 0!==lump.rsfID){if(!insideleaf)break;if(!(insideleaf&&lump.nestingdepth>basedepth+(closeparent?0:1)))break;fluid.log("Error in component tree - leaf component found to contain further components - at "+lump.toString())}++renderindex}return closeparent||renderindex!==lumps.length&&lumps[renderindex].rsfID||--renderindex,dumpTillLump(lumps,start,renderindex),renderindex}function isValue(value){return null!=value&&!0}var outDecoratorsImpl,renderRecurse,trc={};function openTag(){trc.iselide||(out+="<"+trc.uselump.tagname)}function closeTag(){trc.iselide||(out+="</"+trc.uselump.tagname+">")}function renderUnchanged(){dumpTillLump(trc.uselump.parent.lumps,trc.uselump.lumpindex+1,trc.close.lumpindex+(trc.iselide?0:1))}function isSelfClose(){return trc.endopen.lumpindex===trc.close.lumpindex&&fluid.XMLP.closedTags[trc.uselump.tagname]}function dumpTemplateBody(){isSelfClose()?trc.iselide||(out+="/>"):(trc.iselide||(out+=">"),dumpTillLump(trc.uselump.parent.lumps,trc.endopen.lumpindex,trc.close.lumpindex+(trc.iselide?0:1)))}function replaceAttributes(){trc.iselide||(out+=fluid.dumpAttributes(trc.attrcopy)),dumpTemplateBody()}function replaceAttributesOpen(){if(trc.iselide)replaceAttributes();else{out+=fluid.dumpAttributes(trc.attrcopy);var selfClose=isSelfClose();out+=selfClose?"/>":">",trc.nextpos=selfClose?trc.close.lumpindex+1:trc.endopen.lumpindex}}function replaceBody(value){out+=fluid.dumpAttributes(trc.attrcopy),trc.iselide||(out+=">"),out+=fluid.XMLEncode(value.toString()),closeTag()}function rewriteLeaf(value){isValue(value)?replaceBody(value):replaceAttributes()}function dumpHiddenField(todump){out+='<input type="hidden" ';var outattrs={};outattrs[todump.virtual?"id":"name"]=todump.name,outattrs.value=todump.value,out+=fluid.dumpAttributes(outattrs),out+=" />\n"}function applyAutoBind(torender,finalID){if(finalID){var tagname=trc.uselump.tagname,applier=renderOptions.applier;if(renderOptions.autoBind&&/input|select|textarea/.test(tagname)&&!renderedbindings[finalID]){var decorators=[{jQuery:["change",applyFunc]}];$.browser.msie&&"input"===tagname&&/radio|checkbox/.test(trc.attrcopy.type)&&decorators.push({jQuery:["click",applyFunc]}),$.browser.safari&&"input"===tagname&&"radio"===trc.attrcopy.type&&decorators.push({jQuery:["keyup",applyFunc]}),outDecoratorsImpl(torender,decorators,trc.attrcopy,finalID)}}function applyFunc(){fluid.applyBoundChange(fluid.byId(finalID,renderOptions.document),void 0,applier)}}function dumpBoundFields(torender,parent){if(torender){var holder=parent||torender;if(renderOptions.fossils&&void 0!==holder.valuebinding){var fossilKey=holder.submittingname||torender.finalID;renderOptions.fossils[fossilKey]={name:fossilKey,EL:holder.valuebinding,oldvalue:holder.value},applyAutoBind(torender,torender.finalID)}torender.fossilizedbinding&&dumpHiddenField(torender.fossilizedbinding),torender.fossilizedshaper&&dumpHiddenField(torender.fossilizedshaper)}}function dumpSelectionBindings(uiselect){renderedbindings[uiselect.selection.fullID]||(renderedbindings[uiselect.selection.fullID]=!0,dumpBoundFields(uiselect.selection),dumpBoundFields(uiselect.optionlist),dumpBoundFields(uiselect.optionnames))}function isSelectedValue(torender,value){var selection=torender.selection;return fluid.isArrayable(selection.value)?-1!==selection.value.indexOf(value):selection.value===value}function adjustForID(attrcopy,component,late,forceID){late||delete attrcopy["rsf:id"],void 0!==component.finalID?attrcopy.id=component.finalID:void 0!==forceID?attrcopy.id=forceID:(attrcopy.id||late)&&(attrcopy.id=component.fullID);for(var from,to,count=1,baseid=attrcopy.id;renderOptions.document.getElementById(attrcopy.id)||usedIDs[attrcopy.id];)attrcopy.id=baseid+"-"+count++;return 1!==count&&(from=baseid,to=attrcopy.id,fluid.each(rewritemap,function(value,key){value===from&&(rewritemap[key]=to)})),component.finalID=attrcopy.id,attrcopy.id}function assignSubmittingName(attrcopy,component,parent){var submitting=parent||component;return adjustForID(attrcopy,component,!0,component.fullID),void 0===submitting.submittingname&&!1!==submitting.willinput&&(submitting.submittingname=submitting.finalID||submitting.fullID),submitting.submittingname}function explodeDecorators(decorators){var togo=[];if(decorators.type)togo[0]=decorators;else for(var key in decorators){"$"===key&&(key="jQuery");var value=decorators[key],decorator={type:key};"jQuery"===key?(decorator.func=value[0],decorator.args=value.slice(1)):"addClass"===key||"removeClass"===key?decorator.classes=value:"attrs"===key?decorator.attributes=value:"identify"===key&&(decorator.key=value),togo[togo.length]=decorator}return togo}function outDecorators(torender,attrcopy){torender.decorators&&(void 0===torender.decorators.length&&(torender.decorators=explodeDecorators(torender.decorators)),outDecoratorsImpl(torender,torender.decorators,attrcopy))}function degradeMessage(torender){if("UIMessage"===torender.componentType)if(torender.componentType="UIBound",renderOptions.messageLocator){upgradeBound(torender,"messagekey",renderOptions.model,renderOptions.resolverGetConfig);var resArgs=(args=torender.args)?(args=fluid.copy(args),fluid.transform(args,function(arg,index){return upgradeBound(args,index,renderOptions.model,renderOptions.resolverGetConfig),args[index].value})):args;torender.value=renderOptions.messageLocator(torender.messagekey.value,resArgs)}else torender.value="[No messageLocator is configured in options - please consult documentation on options.messageSource]";var args}function renderComponent(torender){var value,attrcopy=trc.attrcopy;degradeMessage(torender);var componentType=torender.componentType,tagname=trc.uselump.tagname;function makeFail(torender,end){fluid.fail("Error in component tree - UISelectChoice with id "+torender.fullID+end)}if(outDecorators(torender,attrcopy),"UIBound"===componentType||"UISelectChoice"===componentType){var parent;void 0!==torender.choiceindex&&(void 0!==torender.parentRelativeID?(parent=function(component,relativeID){for(component=component.parent;0===relativeID.indexOf("..::");)relativeID=relativeID.substring(4),component=component.parent;return component.childmap[relativeID]}(torender,torender.parentRelativeID))||makeFail(torender," has parentRelativeID of "+torender.parentRelativeID+" which cannot be resolved"):makeFail(torender," does not have parentRelativeID set"),assignSubmittingName(attrcopy,torender,parent.selection),dumpSelectionBindings(parent));var submittingname=parent?parent.selection.submittingname:torender.submittingname;if(!parent&&torender.valuebinding&&(submittingname=assignSubmittingName(attrcopy,torender)),"input"!==tagname&&"textarea"!==tagname||void 0!==submittingname&&(attrcopy.name=submittingname),dumpBoundFields(torender,parent?parent.selection:null),"boolean"==typeof torender.value||"radio"===attrcopy.type||"checkbox"===attrcopy.type){var underlyingValue,directValue=torender.value;void 0!==torender.choiceindex&&(parent.optionlist.value||fluid.fail("Error in component tree - selection control with full ID "+parent.fullID+" has no values"),directValue=isSelectedValue(parent,underlyingValue=parent.optionlist.value[torender.choiceindex])),isValue(directValue)&&(directValue?attrcopy.checked="checked":delete attrcopy.checked),attrcopy.value=fluid.XMLEncode(underlyingValue||"true"),rewriteLeaf(null)}else fluid.isArrayable(torender.value)?renderUnchanged():(value=parent?parent["textarea"===tagname||"input"===tagname?"optionlist":"optionnames"].value[torender.choiceindex]:torender.value,"textarea"===tagname?rewriteLeaf(value):"input"===tagname?((torender.willinput||isValue(value))&&(attrcopy.value=fluid.XMLEncode(String(value))),rewriteLeaf(null)):(delete attrcopy.name,function(value){trc.iselide?rewriteLeaf(trc.value):isValue(value)?replaceBody(value):replaceAttributesOpen()}(value)))}else if("UISelect"===componentType){var ishtmlselect="select"===tagname;if(fluid.isArrayable(torender.selection.value)&&(!0,ishtmlselect&&(attrcopy.multiple="multiple")),assignSubmittingName(attrcopy,torender.selection),ishtmlselect&&(!1!==torender.selection.willinput&&(attrcopy.name=torender.selection.submittingname),applyAutoBind(torender,attrcopy.id)),out+=fluid.dumpAttributes(attrcopy),ishtmlselect){out+=">";var values=torender.optionlist.value,names=null!==torender.optionnames&&void 0!==torender.optionnames&&torender.optionnames.value?torender.optionnames.value:values;names&&names.length||fluid.fail("Error in component tree - UISelect component with fullID "+torender.fullID+" does not have optionnames set");for(var i=0;i<names.length;++i)out+='<option value="',null===(value=values[i])&&(value=fluid.NULL_STRING),out+=fluid.XMLEncode(value),isSelectedValue(torender,value)&&(out+='" selected="selected'),out+='">',out+=fluid.XMLEncode(names[i]),out+="</option>\n";closeTag()}else dumpTemplateBody();dumpSelectionBindings(torender)}else if("UILink"===componentType){var attrname=LINK_ATTRIBUTES[tagname];if(attrname){degradeMessage(torender.target);var target=torender.target.value;isValue(target)||(target=attrcopy[attrname]),target=function(template,url){if(renderOptions.urlRewriter){var rewritten=renderOptions.urlRewriter(url);if(rewritten)return rewritten}if(!renderOptions.rebaseURLs)return url;var protpos=url.indexOf(":/");return"/"===url.charAt(0)||-1!==protpos&&protpos<7?url:renderOptions.baseURL+url}(trc.uselump.parent,target),attrcopy[attrname]=fluid.XMLEncode(target)}value=void 0,torender.linktext&&(degradeMessage(torender.linktext),value=torender.linktext.value),isValue(value)?rewriteLeaf(value):replaceAttributesOpen()}else if(void 0!==torender.markup){degradeMessage(torender.markup);var rendered=torender.markup.value;null===rendered?(out+=fluid.dumpAttributes(attrcopy),out+=">",renderUnchanged()):(trc.iselide||(out+=fluid.dumpAttributes(attrcopy),out+=">"),out+=rendered,closeTag())}void 0!==attrcopy.id&&(usedIDs[attrcopy.id]=!0)}function renderComment(message){out+="\x3c!-- "+fluid.XMLEncode(message)+"--\x3e"}function renderDebugMessage(message){out+='<span style="background-color:#FF466B;color:white;padding:1px;">',out+=message,out+="</span><br/>"}function renderComponentSystem(context,torendero,lump){var lumpindex=lump.lumpindex,lumps=lump.parent.lumps,nextpos=-1,outerendopen=lumps[lumpindex+1],outerclose=lump.close_tag;nextpos=outerclose.lumpindex+1;var payloadlist=lump.downmap?lump.downmap["payload-component"]:null,payload=payloadlist?payloadlist[0]:null,iselide=126===lump.rsfID.charCodeAt(0),endopen=outerendopen,close=outerclose,uselump=lump,attrcopy={};if($.extend(!0,attrcopy,(null===payload?lump:payload).attributemap),trc.attrcopy=attrcopy,trc.uselump=uselump,trc.endopen=endopen,trc.close=close,trc.nextpos=nextpos,trc.iselide=iselide,function(context){var attrname,attrval=trc.attrcopy.for;if(void 0!==attrval?attrname="for":void 0!==(attrval=trc.attrcopy.headers)&&(attrname="headers"),attrname){var tagname=trc.uselump.tagname;if(!("for"===attrname&&"label"!==tagname||"headers"===attrname&&"td"!==tagname&&"th"!==tagname)){var rewritten=rewritemap[getRewriteKey(trc.uselump.parent,context,attrval)];void 0!==rewritten&&(trc.attrcopy[attrname]=rewritten)}}}(context),null===torendero&&lump.rsfID.indexOf("scr=")===(iselide?1:0)){var scrname=lump.rsfID.substring(4+(iselide?1:0));"ignore"===scrname?nextpos=trc.close.lumpindex+1:"rewrite-url"===scrname?torendero={componentType:"UILink",target:{}}:(openTag(),replaceAttributesOpen(),nextpos=trc.endopen.lumpindex)}return null!==torendero&&(payload&&(trc.endopen=lumps[payload.lumpindex+1],trc.close=payload.close_tag,dumpTillLump(lumps,lumpindex,(trc.uselump=payload).lumpindex),lumpindex=payload.lumpindex),adjustForID(attrcopy,torendero),openTag(),renderComponent(torendero),null!==payload&&trc.nextpos===nextpos&&dumpTillLump(lumps,trc.close.lumpindex+1,outerclose.lumpindex+1),nextpos=trc.nextpos),nextpos}function renderContainer(child,targetlump){var firstchild=targetlump.parent.lumps[targetlump.lumpindex+1];void 0!==child.children?function(branch,targetlump){if(!targetlump.elide){var attrcopy={};$.extend(!0,attrcopy,targetlump.attributemap),adjustForID(attrcopy,branch),outDecorators(branch,attrcopy),out+="<"+targetlump.tagname+" ",out+=fluid.dumpAttributes(attrcopy),out+=">"}}(child,targetlump):renderComponentSystem(child.parent,child,targetlump),renderRecurse(child,targetlump,firstchild)}function fetchComponents(basecontainer,id){for(var togo;basecontainer&&!(togo=basecontainer.childmap[id]);)basecontainer=basecontainer.parent;return togo}function findChild(sourcescope,child){var split=fluid.SplitID(child.ID),headlumps=sourcescope.downmap[child.ID];return headlumps||(headlumps=sourcescope.downmap[split.prefix+":"]),headlumps?headlumps[0]:null}return outDecoratorsImpl=function(torender,decorators,attrcopy,finalID){var id,sanitizeAttrs=function(value,key){null==value?delete attrcopy[key]:attrcopy[key]=fluid.XMLEncode(value)};renderOptions.idMap=renderOptions.idMap||{};for(var i=0;i<decorators.length;++i){var decorator=decorators[i],type=decorator.type;if(type)if("$"===type&&(type=decorator.type="jQuery"),"jQuery"===type||"event"===type||"fluid"===type)id=adjustForID(attrcopy,torender,!0,finalID),void 0===decorator.ids&&(decorator.ids=[],decoratorQueue[decoratorQueue.length]=decorator),decorator.ids.push(id);else if("attrs"===type)fluid.each(decorator.attributes,sanitizeAttrs);else if("addClass"===type||"removeClass"===type){var fakeNode=$("<div>",{class:attrcopy.class})[0];renderOptions.jQuery(fakeNode)[type](decorator.classes),attrcopy.class=fakeNode.className}else"identify"===type?(id=adjustForID(attrcopy,torender,!0,finalID),renderOptions.idMap[decorator.key]=id):"null"!==type&&fluid.log("Unrecognised decorator of type "+type+" found at component of ID "+finalID);else{var explodedDecorators=explodeDecorators(decorator);outDecoratorsImpl(torender,explodedDecorators,attrcopy,finalID)}}},fetchComponent=function(basecontainer,id){if(0===id.indexOf("msg="))return{componentType:"UIMessage",messagekey:id.substring(4)};for(;basecontainer;){var togo=basecontainer.childmap[id];if(togo)return togo;basecontainer=basecontainer.parent}return null},renderRecurse=function(basecontainer,parentlump,baselump){var children,targetlump,child,rendered,path,renderindex=baselump.lumpindex,basedepth=parentlump.nestingdepth,t1=parentlump.parent;for(debugMode&&(rendered={});(renderindex=dumpScan(t1.lumps,renderindex,basedepth,!parentlump.elide,!1))!==t1.lumps.length;){var lump=t1.lumps[renderindex],id=lump.rsfID;if(lump.nestingdepth<basedepth||void 0===id)break;if(126===id.charCodeAt(0)&&(id=id.substring(1)),-1!==id.indexOf(":")){var prefix=fluid.getPrefix(id);children=fetchComponents(basecontainer,prefix);var closefinal=lump.uplump.finallump[prefix].close_tag;if(children)for(var i=0;i<children.length;++i)if((child=children[i]).children)debugMode&&(rendered[child.fullID]=!0),(targetlump=branchmap[child.fullID])?(debugMode&&renderComment("Branching for "+child.fullID+" from "+fluid.debugLump(lump)+" to "+fluid.debugLump(targetlump)),renderContainer(child,targetlump),debugMode&&renderComment("Branch returned for "+child.fullID+fluid.debugLump(lump)+" to "+fluid.debugLump(targetlump))):debugMode&&renderDebugMessage("No matching template branch found for branch container with full ID "+child.fullID+" rendering from parent template branch "+fluid.debugLump(baselump));else{if(!(targetlump=findChild(parentlump,child))){debugMode&&renderDebugMessage("Repetitive leaf with full ID "+child.fullID+" could not be rendered from parent template branch "+fluid.debugLump(baselump));continue}var renderend=renderComponentSystem(basecontainer,child,targetlump),wasopentag=renderend<t1.lumps.lengtn&&t1.lumps[renderend].nestingdepth>=targetlump.nestingdepth,newbase=child.children?child:basecontainer;wasopentag&&(renderRecurse(newbase,targetlump,t1.lumps[renderend]),renderend=targetlump.close_tag.lumpindex+1),i!==children.length-1?renderend<closefinal.lumpindex&&dumpScan(t1.lumps,renderend,targetlump.nestingdepth-1,!1,!1):dumpScan(t1.lumps,renderend,targetlump.nestingdepth,!0,!1)}else debugMode&&renderDebugMessage("No branch container with prefix "+prefix+": found in container "+(void 0,(path=basecontainer.fullID)?"full path "+path:"component tree root")+" rendering at template position "+fluid.debugLump(baselump)+", skipping");renderindex=closefinal.lumpindex+1,debugMode&&renderComment("Stack returned from branch for ID "+id+" to "+fluid.debugLump(baselump)+": skipping from "+fluid.debugLump(lump)+" to "+fluid.debugLump(closefinal))}else{var component;id&&(component=fetchComponent(basecontainer,id,lump),debugMode&&component&&(rendered[component.fullID]=!0)),renderindex=component&&void 0!==component.children?(renderContainer(component),lump.close_tag.lumpindex+1):renderComponentSystem(basecontainer,component,lump)}if(renderindex===t1.lumps.length)break}if(debugMode){children=basecontainer.children;for(var key=0;key<children.length;++key)rendered[(child=children[key]).fullID]||renderDebugMessage("Component "+child.componentType+" with full ID "+child.fullID+" could not be found within template "+fluid.debugLump(baselump))}},that.renderTemplates=function(){tree=function fixupTree(tree,model,resolverGetConfig){if(void 0===tree.componentType&&(tree=unzipComponent(tree,model,resolverGetConfig)),"UIContainer"===tree.componentType||tree.parent||(tree={children:[tree]}),tree.children){tree.childmap={};for(var i=0;i<tree.children.length;++i){var child=tree.children[i];void 0===child.componentType&&(child=unzipComponent(child,model,resolverGetConfig),tree.children[i]=child),child.parent=tree,void 0===child.ID&&fluid.fail("Error in component tree: component found with no ID "+debugPosition(child));var colpos=(tree.childmap[child.ID]=child).ID.indexOf(":");if(-1===colpos);else{var prefix=child.ID.substring(0,colpos),childlist=tree.childmap[prefix];childlist||(childlist=[],tree.childmap[prefix]=childlist),void 0===child.localID&&0!==childlist.length&&(child.localID=childlist.length),childlist[childlist.length]=child}child.fullID=computeFullID(child);var componentType=child.componentType;if("UISelect"===componentType)child.selection.fullID=child.fullID;else if("UIInitBlock"===componentType){for(var call=child.functionname+"(",childArgs=child.arguments,j=0;j<childArgs.length;++j)childArgs[j]instanceof fluid.ComponentReference&&(childArgs[j]=child.parent.fullID+childArgs[j].reference),call+=JSON.stringify(childArgs[j]),j<childArgs.length-1&&(call+=", ");child.markup={value:call+")\n"},child.componentType="UIVerbatim"}else"UIBound"===componentType&&fixupValue(child,model,resolverGetConfig);fixupTree(child,model,resolverGetConfig)}}return tree}(tree,options.model,options.resolverGetConfig);var template=templates[0];return resolveBranches(templates.globalmap,tree,template.rootlump),renderedbindings={},function(){for(var key in collected)for(var collist=collected[key],i=0;i<collist.length;++i)dumpTillLump((collump=collist[i]).parent.lumps,collump.lumpindex,collump.close_tag.lumpindex+1);var collump}(),renderRecurse(tree,template.rootlump,template.lumps[template.firstdocumentindex]),out},that.processDecoratorQueue=function(){!function(){for(var i=0;i<decoratorQueue.length;++i)for(var decorator=decoratorQueue[i],j=0;j<decorator.ids.length;++j){var id=decorator.ids[j],node=fluid.byId(id,renderOptions.document);if(node||fluid.fail("Error during rendering - component with id "+id+" which has a queued decorator was not found in the output markup"),"jQuery"===decorator.type){var jnode=renderOptions.jQuery(node);jnode[decorator.func].apply(jnode,fluid.makeArray(decorator.args))}else if("fluid"===decorator.type){var args=decorator.args;if(!args){var thisContainer=renderOptions.jQuery(node);decorator.container?decorator.container.push(node):decorator.container=thisContainer,args=[thisContainer,decorator.options]}var that=renderer.invokeFluidDecorator(decorator.func,args,id,i,options);decorator.that=that}else"event"===decorator.type&&(node[decorator.event]=decorator.handler)}}()},that},jQuery.extend(!0,fluid.renderer,renderer),fluid.ComponentReference=function(reference){this.reference=reference},fluid.explode=function(hash,basepath){var togo=[];for(var key in hash){var binding=void 0===basepath?key:basepath+"."+key;togo[togo.length]={ID:key,value:hash[key],valuebinding:binding}}return togo},fluid.explodeSelectionToInputs=function(optionlist,opts){return fluid.transform(optionlist,function(option,index){return{ID:opts.rowID,children:[{ID:opts.inputID,parentRelativeID:"..::"+opts.selectID,choiceindex:index},{ID:opts.labelID,parentRelativeID:"..::"+opts.selectID,choiceindex:index}]}})},fluid.renderTemplates=function(templates,tree,options,fossilsIn){return fluid.renderer(templates,tree,options,fossilsIn).renderTemplates()},fluid.reRender=function(templates,node,tree,options){options=options||{};var renderer=fluid.renderer(templates,tree,options,options.fossils);options=renderer.options,node=fluid.unwrap(node);var lastId,lastFocusedElement=fluid.getLastFocusedElement?fluid.getLastFocusedElement():null;lastFocusedElement&&fluid.dom.isContainer(node,lastFocusedElement)&&(lastId=lastFocusedElement.id),$.browser.msie?options.jQuery(node).empty():node.innerHTML="";var rendered=renderer.renderTemplates();if(options.renderRaw&&(rendered=(rendered=fluid.XMLEncode(rendered)).replace(/\n/g,"<br/>")),options.model&&fluid.bindFossils(node,options.model,options.fossils),$.browser.msie?options.jQuery(node).html(rendered):node.innerHTML=rendered,renderer.processDecoratorQueue(),lastId){var element=fluid.byId(lastId,options.document);element&&options.jQuery(element).focus()}return templates},fluid.extractTemplate=function(node,armouring){return armouring?(rootNode=node,0===(value=fluid.dom.iterateDom(rootNode,function(node){return 8===node.nodeType||4===node.nodeType?"stop":null},!0).nodeValue).indexOf("[CDATA[")?value.substring(6,value.length-2):value):node.innerHTML;var rootNode,value},fluid.render=function(source,target,tree,options){options=options||{};var template=source;"object"==typeof source&&(template=fluid.extractTemplate(fluid.unwrap(source.node),source.armouring)),target=fluid.unwrap(target);var resourceSpec={base:{resourceText:template,href:".",resourceKey:".",cutpoints:options.cutpoints}},templates=fluid.parseTemplates(resourceSpec,["base"],options);return fluid.reRender(templates,target,tree,options)},fluid.selfRender=function(node,tree,options){return options=options||{},fluid.render({node:node,armouring:options.armouring},node,tree,options)}}(jQuery,fluid_3_0_0),fluid_3_0_0=fluid_3_0_0||{},function($,fluid){"use strict";fluid.renderer||fluid.fail("fluidRenderer.js is a necessary dependency of RendererUtilities"),fluid.renderer.visitDecorators=function(that,visitor){fluid.visitComponentChildren(that,function(component,name){0===name.indexOf(fluid.renderer.decoratorComponentPrefix)&&visitor(component,name)},{flat:!0},[])},fluid.renderer.clearDecorators=function(that){var instantiator=fluid.getInstantiator(that);fluid.renderer.visitDecorators(that,function(component,name){instantiator.clearComponent(that,name)})},fluid.renderer.getDecoratorComponents=function(that){var togo={};return fluid.renderer.visitDecorators(that,function(component,name){togo[name]=component}),togo},fluid.renderer.modeliseOptions=function(options,defaults,baseOptions){return $.extend({},defaults,fluid.filterKeys(baseOptions,["model","applier"]),options)},fluid.renderer.reverseMerge=function(target,source,names){names=fluid.makeArray(names),fluid.each(names,function(name){void 0===target[name]&&void 0!==source[name]&&(target[name]=source[name])})},fluid.renderer.createRendererSubcomponent=function(container,selectors,options,parentThat,fossils){var source=(options=options||{}).templateSource?options.templateSource:{node:$(container)},nativeModel=void 0===options.rendererOptions.model,rendererOptions=fluid.renderer.modeliseOptions(options.rendererOptions,null,parentThat);if(rendererOptions.fossils=fossils||{},rendererOptions.parentComponent=parentThat,container.jquery){var cascadeOptions={document:container[0].ownerDocument,jQuery:container.constructor};fluid.renderer.reverseMerge(rendererOptions,cascadeOptions,fluid.keys(cascadeOptions))}var that={},templates=null;return that.render=function(tree){var cutpointFn=options.cutpointGenerator||"fluid.renderer.selectorsToCutpoints";rendererOptions.cutpoints=rendererOptions.cutpoints||fluid.invokeGlobalFunction(cutpointFn,[selectors,options]),nativeModel&&(rendererOptions.model=parentThat.model);var renderTarget=$(options.renderTarget?options.renderTarget:container);templates?(fluid.clear(rendererOptions.fossils),fluid.reRender(templates,renderTarget,tree,rendererOptions)):("function"==typeof source&&(source=source()),templates=fluid.render(source,renderTarget,tree,rendererOptions))},that},fluid.defaults("fluid.rendererComponent",{gradeNames:["fluid.viewComponent"],initFunction:"fluid.initRendererComponent",mergePolicy:{"rendererOptions.idMap":"nomerge",protoTree:"noexpand, replace",parentBundle:"nomerge","changeApplierOptions.resolverSetConfig":"resolverSetConfig"},invokers:{refreshView:{funcName:"fluid.rendererComponent.refreshView",args:"{that}"},produceTree:{funcName:"fluid.rendererComponent.produceTree",args:"{that}"}},rendererOptions:{autoBind:!0},events:{onResourcesFetched:null,prepareModelForRender:null,onRenderTree:null,afterRender:null},listeners:{onCreate:{funcName:"fluid.rendererComponent.renderOnInit",args:["{that}.options.renderOnInit","{that}"],priority:"last"}}}),fluid.rendererComponent.renderOnInit=function(renderOnInit,that){(renderOnInit||that.renderOnInit)&&that.refreshView()},fluid.protoExpanderForComponent=function(parentThat,options){var expanderOptions=fluid.renderer.modeliseOptions(options.expanderOptions,{ELstyle:"${}"},parentThat);return fluid.renderer.reverseMerge(expanderOptions,options,["resolverGetConfig","resolverSetConfig"]),fluid.renderer.makeProtoExpander(expanderOptions,parentThat)},fluid.rendererComponent.refreshView=function(that){if(that.renderer){fluid.renderer.clearDecorators(that),that.events.prepareModelForRender.fire(that.model,that.applier,that);var tree=that.produceTree(that),rendererFnOptions=that.renderer.rendererFnOptions;rendererFnOptions.noexpand||(tree=fluid.protoExpanderForComponent(that,rendererFnOptions)(tree)),that.events.onRenderTree.fire(that,tree),that.renderer.render(tree),that.events.afterRender.fire(that)}else that.renderOnInit=!0},fluid.rendererComponent.produceTree=function(that){var produceTreeOption=that.options.produceTree;return produceTreeOption?("string"==typeof produceTreeOption?fluid.getGlobalValue(produceTreeOption):produceTreeOption)(that):that.options.protoTree},fluid.initRendererComponent=function(componentName,container,options){var that=fluid.initView(componentName,container,options,{gradeNames:["fluid.rendererComponent"]});fluid.getForComponent(that,"model"),fluid.getForComponent(that,"applier"),fluid.diagnoseFailedView(componentName,that,fluid.defaults(componentName),arguments),fluid.fetchResources(that.options.resources,that.events.onResourcesFetched.fire);var messageResolver,rendererOptions=fluid.renderer.modeliseOptions(that.options.rendererOptions,null,that);!rendererOptions.messageSource&&that.options.strings&&(messageResolver=fluid.messageResolver({messageBase:that.options.strings,resolveFunc:that.options.messageResolverFunction,parents:fluid.makeArray(that.options.parentBundle)}),rendererOptions.messageSource={type:"resolver",resolver:messageResolver}),fluid.renderer.reverseMerge(rendererOptions,that.options,["resolverGetConfig","resolverSetConfig"]),that.rendererOptions=rendererOptions;var rendererFnOptions=$.extend({},that.options.rendererFnOptions,{rendererOptions:rendererOptions,repeatingSelectors:that.options.repeatingSelectors,selectorsToIgnore:that.options.selectorsToIgnore,expanderOptions:{envAdd:{styles:that.options.styles}}});that.options.resources&&that.options.resources.template&&(rendererFnOptions.templateSource=function(){return that.options.resources.template.resourceText}),fluid.renderer.reverseMerge(rendererFnOptions,that.options,["resolverGetConfig","resolverSetConfig"]),rendererFnOptions.rendererTargetSelector&&(container=function(){return that.dom.locate(rendererFnOptions.rendererTargetSelector)});var renderer={fossils:{},rendererFnOptions:rendererFnOptions,boundPathForNode:function(node){return fluid.boundPathForNode(node,renderer.fossils)}},rendererSub=fluid.renderer.createRendererSubcomponent(container,that.options.selectors,rendererFnOptions,that,renderer.fossils);return that.renderer=$.extend(renderer,rendererSub),messageResolver&&(that.messageResolver=messageResolver),renderer.refreshView=fluid.getForComponent(that,"refreshView"),that};var markRepeated=function(selectorKey,repeatingSelectors){return repeatingSelectors&&fluid.each(repeatingSelectors,function(repeatingSelector){selectorKey===repeatingSelector&&(selectorKey+=":")}),selectorKey};fluid.renderer.selectorsToCutpoints=function(selectors,options){var togo=[];for(var selectorKey in options=options||{},selectors=fluid.copy(selectors),options.selectorsToIgnore&&(selectors=function(selectors,selectorsToIgnore){return fluid.each(fluid.makeArray(selectorsToIgnore),function(selectorToIgnore){delete selectors[selectorToIgnore]}),selectors}(selectors,options.selectorsToIgnore)),selectors)togo.push({id:markRepeated(selectorKey,options.repeatingSelectors),selector:selectors[selectorKey]});return togo},fluid.renderer.NO_COMPONENT={},fluid.renderer.mergeComponents=function(target,source){for(var key in source)target[key]=source[key];return target},fluid.registerNamespace("fluid.renderer.selection"),fluid.renderer.selection.inputs=function(options,container,key,config){fluid.expect("Selection to inputs expander",options,["selectID","inputID","labelID","rowID"]);var selection=config.expander(options.tree),optsToExpand=fluid.censorKeys(options,["tree"]),expandedOpts=config.expandLight(optsToExpand),rows=fluid.transform(selection.optionlist.value,function(option,index){var togo={},element={parentRelativeID:"..::"+expandedOpts.selectID,choiceindex:index};return togo[expandedOpts.inputID]=element,togo[expandedOpts.labelID]=fluid.copy(element),togo}),togo={};return togo[expandedOpts.selectID]=selection,togo[expandedOpts.rowID]={children:rows},togo=config.expander(togo)},fluid.renderer.repeat=function(options,container,key,config){fluid.expect("Repetition expander",options,["controlledBy","tree"]);var env=config.threadLocal(),path=fluid.extractContextualPath(options.controlledBy,{ELstyle:"ALL"},env),list=fluid.get(config.model,path,config.resolverGetConfig);if(!list||0===list.length)return options.ifEmpty?config.expander(options.ifEmpty):{};var expanded=[];fluid.each(list,function(element,i){var EL=fluid.model.composePath(path,i),envAdd={};options.pathAs&&(envAdd[options.pathAs]="${"+EL+"}"),options.valueAs&&(envAdd[options.valueAs]=fluid.get(config.model,EL,config.resolverGetConfig));var expandrow=fluid.withEnvironment(envAdd,function(){return config.expander(options.tree)},env);fluid.isArrayable(expandrow)?0<expandrow.length&&expanded.push({children:expandrow}):expandrow!==fluid.renderer.NO_COMPONENT&&expanded.push(expandrow)});var repeatID=options.repeatID;return-1===repeatID.indexOf(":")&&(repeatID+=":"),fluid.each(expanded,function(entry){entry.ID=repeatID}),expanded},fluid.renderer.condition=function(options,container,key,config){var condition;if(fluid.expect("Selection to condition expander",options,["condition"]),options.condition.funcName){var args=config.expandLight(options.condition.args);condition=fluid.invokeGlobalFunction(options.condition.funcName,args)}else condition=options.condition.expander?config.expander(options.condition):config.expandLight(options.condition);var tree=condition?options.trueTree:options.falseTree;return tree||(tree=fluid.renderer.NO_COMPONENT),config.expander(tree)},fluid.extractContextualPath=function(string,options,env,externalFetcher){var parsed=fluid.extractELWithContext(string,options);if(parsed)return parsed.context?env[parsed.context]?fluid.transformContextPath(parsed,env).path:{value:externalFetcher(parsed)}:parsed.path},fluid.transformContextPath=function(parsed,env){if(parsed.context){var EL,fetched=env[parsed.context];if("string"==typeof fetched&&(EL=fluid.extractEL(fetched,{ELstyle:"${}"})),EL)return{noDereference:""===parsed.path,path:fluid.model.composePath(EL,parsed.path)}}return parsed},fluid.renderer.makeExternalFetcher=function(contextThat){return function(parsed){var foundComponent=fluid.resolveContext(parsed.context,contextThat);return foundComponent?fluid.getForComponent(foundComponent,parsed.path):void 0}},fluid.renderer.makeProtoExpander=function(expandOptions,parentThat){var threadLocal,options=$.extend({ELstyle:"${}"},expandOptions);parentThat&&(options.externalFetcher=fluid.renderer.makeExternalFetcher(parentThat));var expandCond,expandLeafOrCond,IDescape=options.IDescape||"\\",expandLight=function(source){return fluid.expand(source,options)},expandBound=function(value,concrete){if(void 0!==value.messagekey)return{componentType:"UIMessage",messagekey:expandBound(value.messagekey),args:expandLight(value.args)};var proto,EL,string,env;if(fluid.isPrimitive(value)||fluid.isArrayable(value)?proto={}:((proto=$.extend({},value)).decorators&&(proto.decorators=expandLight(proto.decorators)),value=proto.value,delete proto.value),"string"==typeof value){var fetched=(string=value,env=threadLocal(),fluid.extractContextualPath(string,options,env,options.externalFetcher));EL="string"==typeof fetched?fetched:null,value=fluid.get(fetched,"value")||value}return EL?proto.valuebinding=EL:void 0!==value&&(proto.value=value),options.model&&proto.valuebinding&&void 0===proto.value&&(proto.value=fluid.get(options.model,proto.valuebinding,options.resolverGetConfig)),concrete&&(proto.componentType="UIBound"),proto};options.filter=fluid.expander.lightFilter;var expandConfig={model:options.model,resolverGetConfig:options.resolverGetConfig,resolverSetConfig:options.resolverSetConfig,expander:function(entry){if(entry===fluid.renderer.NO_COMPONENT)return entry;var singleTarget,target=[];return expandLeafOrCond(entry,target,function(comp){singleTarget=comp}),singleTarget||target},expandLight:expandLight},expandChildren=function(entry,pusher){for(var children=entry.children,i=0;i<children.length;++i){var target=[],comp={children:target},child=children[i];expandLeafOrCond(child,target,function(comp){target[target.length]=comp}),1!==comp.children.length||comp.children[0].ID||(comp=comp.children[0]),pusher(comp)}};return expandLeafOrCond=function(entry,target,pusher){var componentType=fluid.renderer.inferComponentType(entry);componentType||!fluid.isPrimitive(entry)&&!function(entry){return!1!==fluid.find(entry,function(value,key){return"decorators"===key})}(entry)||(componentType="UIBound"),componentType?pusher("UIBound"===componentType?expandBound(entry,!0):function(leaf,componentType){var togo={componentType:componentType},map=fluid.renderer.boundMap[componentType]||{};for(var key in leaf)/decorators|args/.test(key)?togo[key]=expandLight(leaf[key]):map[key]?togo[key]=expandBound(leaf[key]):togo[key]=leaf[key];return togo}(entry,componentType)):(target||fluid.fail("Illegal cond->cond transition"),expandCond(entry,target))},expandCond=function(proto,target){var key,expandToTarget=function(expander){var expanded=fluid.invokeGlobalFunction(expander.type,[expander,proto,key,expandConfig]);expanded!==fluid.renderer.NO_COMPONENT&&fluid.each(expanded,function(el){target[target.length]=el})},condPusher=function(comp){comp.ID=key,target[target.length]=comp};for(key in proto){var entry=proto[key];if(key.charAt(0)===IDescape&&(key=key.substring(1)),"expander"===key){var expanders=fluid.makeArray(entry);fluid.each(expanders,expandToTarget)}else entry&&(entry.children?(-1===key.indexOf(":")&&(key+=":"),expandChildren(entry,condPusher)):fluid.renderer.isBoundPrimitive(entry)?condPusher(expandBound(entry,!0)):expandLeafOrCond(entry,null,condPusher))}},function(entry){return threadLocal=fluid.threadLocal(function(){return $.extend({},options.envAdd)}),options.fetcher=fluid.makeEnvironmentFetcher(options.model,fluid.transformContextPath,threadLocal,options.externalFetcher),expandConfig.threadLocal=threadLocal,function(entry){var comp=[];return expandCond(entry,comp),{children:comp}}(entry)}}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.slidingPanel",{gradeNames:["fluid.viewComponent"],selectors:{panel:".flc-slidingPanel-panel",toggleButton:".flc-slidingPanel-toggleButton",toggleButtonLabel:".flc-slidingPanel-toggleButton"},strings:{showText:"show",hideText:"hide",panelLabel:"panel"},events:{onPanelHide:null,onPanelShow:null,afterPanelHide:null,afterPanelShow:null},listeners:{"onCreate.bindClick":{this:"{that}.dom.toggleButton",method:"click",args:["{that}.togglePanel"]},"onCreate.bindModelChange":{listener:"{that}.applier.modelChanged.addListener",args:["isShowing","{that}.refreshView"]},"onCreate.setAriaProps":"{that}.setAriaProps","onCreate.setInitialState":{listener:"{that}.refreshView"},"onPanelHide.setText":{this:"{that}.dom.toggleButtonLabel",method:"text",args:["{that}.options.strings.showText"],priority:"first"},"onPanelHide.setAriaLabel":{this:"{that}.dom.toggleButtonLabel",method:"attr",args:["aria-label","{that}.options.strings.showTextAriaLabel"]},"onPanelShow.setText":{this:"{that}.dom.toggleButtonLabel",method:"text",args:["{that}.options.strings.hideText"],priority:"first"},"onPanelShow.setAriaLabel":{this:"{that}.dom.toggleButtonLabel",method:"attr",args:["aria-label","{that}.options.strings.hideTextAriaLabel"]},"onPanelHide.operate":{listener:"{that}.operateHide"},"onPanelShow.operate":{listener:"{that}.operateShow"},"onCreate.setAriaStates":"{that}.setAriaStates"},members:{panelId:{expander:{funcName:"fluid.allocateSimpleId",args:"{that}.dom.panel"}}},model:{isShowing:!1},modelListeners:{isShowing:{funcName:"{that}.setAriaStates",excludeSource:"init"}},invokers:{operateHide:{this:"{that}.dom.panel",method:"slideUp",args:["{that}.options.animationDurations.hide","{that}.events.afterPanelHide.fire"]},operateShow:{this:"{that}.dom.panel",method:"slideDown",args:["{that}.options.animationDurations.show","{that}.events.afterPanelShow.fire"]},hidePanel:{func:"{that}.applier.change",args:["isShowing",!1]},showPanel:{func:"{that}.applier.change",args:["isShowing",!0]},setAriaStates:{funcName:"fluid.slidingPanel.setAriaStates",args:["{that}","{that}.model.isShowing"]},setAriaProps:{funcName:"fluid.slidingPanel.setAriaProperties",args:["{that}","{that}.panelId"]},togglePanel:{funcName:"fluid.slidingPanel.togglePanel",args:["{that}"]},refreshView:{funcName:"fluid.slidingPanel.refreshView",args:["{that}"]}},animationDurations:{hide:400,show:400}}),fluid.slidingPanel.togglePanel=function(that){that.applier.change("isShowing",!that.model.isShowing)},fluid.slidingPanel.refreshView=function(that){that.events[that.model.isShowing?"onPanelShow":"onPanelHide"].fire()},fluid.slidingPanel.setAriaProperties=function(that,panelId){that.locate("toggleButton").attr({role:"button","aria-controls":panelId}),that.locate("panel").attr({"aria-label":that.options.strings.panelLabel,role:"group"})},fluid.slidingPanel.setAriaStates=function(that,isShowing){that.locate("toggleButton").attr({"aria-pressed":isShowing,"aria-expanded":isShowing})}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.textfield",{gradeNames:["fluid.viewComponent"],attrs:{},strings:{},modelListeners:{value:{this:"{that}.container",method:"val",args:["{change}.value"]}},listeners:{"onCreate.bindChangeEvt":{this:"{that}.container",method:"change",args:["{that}.setModel"]},"onCreate.initTextfieldAttributes":{this:"{that}.container",method:"attr",args:["{that}.options.attrs"]}},invokers:{setModel:{changePath:"value",value:"{arguments}.0.target.value"}}}),fluid.textfield.setModelRestrictToNumbers=function(that,value,path){!isNaN(Number(value))&&that.applier.change(path,value),that.container.val(that.model.value)},fluid.defaults("fluid.textfield.rangeController",{gradeNames:["fluid.textfield"],components:{controller:{type:"fluid.modelComponent",options:{model:{value:null},modelRelay:[{source:"value",target:"{fluid.textfield}.model.value",singleTransform:{type:"fluid.transforms.numberToString",scale:"{that}.options.scale"}},{target:"value",singleTransform:{type:"fluid.transforms.limitRange",input:"{that}.model.value",min:"{that}.model.range.min",max:"{that}.model.range.max"}}]}}},invokers:{setModel:{funcName:"fluid.textfield.setModelRestrictToNumbers",args:["{that}","{arguments}.0.target.value","value"]}}})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.textfieldSlider",{gradeNames:["fluid.viewComponent"],components:{textfield:{type:"fluid.textfield.rangeController",container:"{that}.dom.textfield",options:{components:{controller:{options:{model:"{textfieldSlider}.model"}}},attrs:"{textfieldSlider}.options.attrs",strings:"{textfieldSlider}.options.strings"}},slider:{type:"fluid.slider",container:"{textfieldSlider}.dom.slider",options:{model:"{textfieldSlider}.model",attrs:"{textfieldSlider}.options.attrs",strings:"{textfieldSlider}.options.strings"}}},selectors:{textfield:".flc-textfieldSlider-field",slider:".flc-textfieldSlider-slider"},styles:{container:"fl-textfieldSlider fl-focus"},model:{value:null,step:1,range:{min:0,max:100}},modelRelay:{target:"value",singleTransform:{type:"fluid.transforms.limitRange",input:"{that}.model.value",min:"{that}.options.range.min",max:"{that}.options.range.max"}},attrs:{},strings:{},listeners:{"onCreate.addContainerStyle":{this:"{that}.container",method:"addClass",args:["{that}.options.styles.container"]}},distributeOptions:[{source:"{that}.options.scale",target:"{that > fluid.textfield > controller}.options.scale"}]}),fluid.defaults("fluid.slider",{gradeNames:["fluid.viewComponent"],modelRelay:{target:"value",singleTransform:{type:"fluid.transforms.stringToNumber",input:"{that}.model.stringValue"}},invokers:{setModel:{changePath:"stringValue",value:{expander:{this:"{that}.container",method:"val"}}},updateSliderAttributes:{this:"{that}.container",method:"attr",args:[{min:"{that}.model.range.min",max:"{that}.model.range.max",step:"{that}.model.step",type:"range",value:"{that}.model.value","aria-labelledby":"{that}.options.attrs.aria-labelledby","aria-label":"{that}.options.attrs.aria-label"}]}},listeners:{"onCreate.initSliderAttributes":"{that}.updateSliderAttributes","onCreate.bindSlideEvt":{this:"{that}.container",method:"on",args:["input","{that}.setModel"]},"onCreate.bindRangeChangeEvt":{this:"{that}.container",method:"on",args:["change","{that}.setModel"]}},modelListeners:{value:[{this:"{that}.container",method:"val",args:["{change}.value"],excludeSource:"init"}],range:{listener:"{that}.updateSliderAttributes",excludeSource:"init"},step:{listener:"{that}.updateSliderAttributes",excludeSource:"init"}}})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.textfieldStepper",{gradeNames:["fluid.viewComponent"],strings:{increaseLabel:"increment",decreaseLabel:"decrement"},selectors:{textfield:".flc-textfieldStepper-field",focusContainer:".flc-textfieldStepper-focusContainer",increaseButton:".flc-textfieldStepper-increase",decreaseButton:".flc-textfieldStepper-decrease"},styles:{container:"fl-textfieldStepper",focus:"fl-textfieldStepper-focus"},components:{textfield:{type:"fluid.textfield.rangeController",container:"{that}.dom.textfield",options:{components:{controller:{options:{model:"{textfieldStepper}.model",modelListeners:{"range.min":{this:"{textfield}.container",method:"attr",args:["aria-valuemin","{change}.value"]},"range.max":{this:"{textfield}.container",method:"attr",args:["aria-valuemax","{change}.value"]}}}}},attrs:"{textfieldStepper}.options.attrs",strings:"{textfieldStepper}.options.strings",listeners:{"onCreate.bindUpArrow":{listener:"fluid.textfieldStepper.bindKeyEvent",args:["{that}.container","keydown",38,"{textfieldStepper}.increase"]},"onCreate.bindDownArrow":{listener:"fluid.textfieldStepper.bindKeyEvent",args:["{that}.container","keydown",40,"{textfieldStepper}.decrease"]},"onCreate.addRole":{this:"{that}.container",method:"attr",args:["role","spinbutton"]}},modelListeners:{value:{this:"{that}.container",method:"attr",args:["aria-valuenow","{change}.value"]}}}},increaseButton:{type:"fluid.textfieldStepper.button",container:"{textfieldStepper}.dom.increaseButton",options:{strings:{label:"{textfieldStepper}.options.strings.increaseLabel"},listeners:{"onClick.increase":"{textfieldStepper}.increase"},modelRelay:{target:"disabled",singleTransform:{type:"fluid.transforms.binaryOp",left:"{textfieldStepper}.model.value",right:"{textfieldStepper}.model.range.max",operator:">="}}}},decreaseButton:{type:"fluid.textfieldStepper.button",container:"{textfieldStepper}.dom.decreaseButton",options:{strings:{label:"{textfieldStepper}.options.strings.decreaseLabel"},listeners:{"onClick.decrease":"{textfieldStepper}.decrease"},modelRelay:{target:"disabled",singleTransform:{type:"fluid.transforms.binaryOp",left:"{textfieldStepper}.model.value",right:"{textfieldStepper}.model.range.min",operator:"<="}}}}},invokers:{increase:{funcName:"fluid.textfieldStepper.step",args:["{that}"]},decrease:{funcName:"fluid.textfieldStepper.step",args:["{that}",-1]},addFocus:{this:"{that}.dom.focusContainer",method:"addClass",args:["{that}.options.styles.focus"]},removeFocus:{this:"{that}.dom.focusContainer",method:"removeClass",args:["{that}.options.styles.focus"]}},listeners:{"onCreate.addContainerStyle":{this:"{that}.container",method:"addClass",args:["{that}.options.styles.container"]},"onCreate.bindFocusin":{this:"{that}.container",method:"on",args:["focusin","{that}.addFocus"]},"onCreate.bindFocusout":{this:"{that}.container",method:"on",args:["focusout","{that}.removeFocus"]}},model:{value:null,step:1,range:{min:0,max:100}},attrs:{},distributeOptions:[{source:"{that}.options.scale",target:"{that > fluid.textfield > controller}.options.scale"}]}),fluid.textfieldStepper.step=function(that,coefficient){coefficient=coefficient||1;var newValue=that.model.value+coefficient*that.model.step;that.applier.change("value",newValue)},fluid.textfieldStepper.bindKeyEvent=function(elm,keyEvent,keyCode,fn){$(elm).on(keyEvent,function(event){event.which===keyCode&&(fn(),event.preventDefault())})},fluid.defaults("fluid.textfieldStepper.button",{gradeNames:["fluid.viewComponent"],strings:{},styles:{container:"fl-textfieldStepper-button"},model:{disabled:!1},events:{onClick:null},listeners:{"onCreate.bindClick":{this:"{that}.container",method:"click",args:"{that}.events.onClick.fire"},"onCreate.addLabel":{this:"{that}.container",method:"attr",args:["aria-label","{that}.options.strings.label"]},"onCreate.addContainerStyle":{this:"{that}.container",method:"addClass",args:["{that}.options.styles.container"]},"onCreate.removeFromTabOrder":{this:"{that}.container",method:"attr",args:["tabindex","-1"]}},modelListeners:{disabled:{this:"{that}.container",method:"prop",args:["disabled","{change}.value"]}}})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.switchUI",{gradeNames:["fluid.viewComponent"],selectors:{on:".flc-switchUI-on",off:".flc-switchUI-off",control:".flc-switchUI-control"},strings:{label:"",on:"on",off:"off"},attrs:{role:"switch",tabindex:0},model:{enabled:!1},modelListeners:{enabled:{this:"{that}.dom.control",method:"attr",args:["aria-checked","{change}.value"]}},listeners:{"onCreate.addAttrs":{this:"{that}.dom.control",method:"attr",args:["{that}.options.attrs"]},"onCreate.addOnText":{this:"{that}.dom.on",method:"text",args:["{that}.options.strings.on"]},"onCreate.addOffText":{this:"{that}.dom.off",method:"text",args:["{that}.options.strings.off"]},"onCreate.activateable":{listener:"fluid.activatable",args:["{that}.dom.control","{that}.activateHandler"]},"onCreate.bindClick":{this:"{that}.dom.control",method:"on",args:["click","{that}.toggleModel"]}},invokers:{toggleModel:{funcName:"fluid.switchUI.toggleModel",args:["{that}"]},activateHandler:{funcName:"fluid.switchUI.activateHandler",args:["{arguments}.0","{that}.toggleModel"]}}}),fluid.switchUI.toggleModel=function(that){that.applier.change("enabled",!that.model.enabled)},fluid.switchUI.activateHandler=function(event,fn){event.preventDefault(),fn()}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.tableOfContents"),fluid.tableOfContents.headingTextToAnchorInfo=function(heading){var id=fluid.allocateSimpleId(heading);return{id:id,url:"#"+id}},fluid.tableOfContents.locateHeadings=function(that){var headings=that.locate("headings");return fluid.each(that.options.ignoreForToC,function(sel){headings=headings.not(sel).not(sel+" :header")}),headings},fluid.tableOfContents.refreshView=function(that){var headings=that.locateHeadings();that.anchorInfo=fluid.transform(headings,function(heading){return that.headingTextToAnchorInfo(heading)});var headingsModel=that.modelBuilder.assembleModel(headings,that.anchorInfo);that.applier.change("",headingsModel),that.events.onRefresh.fire()},fluid.defaults("fluid.tableOfContents",{gradeNames:["fluid.viewComponent"],components:{levels:{type:"fluid.tableOfContents.levels",createOnEvent:"onCreate",container:"{tableOfContents}.dom.tocContainer",options:{model:{headings:"{tableOfContents}.model"},events:{afterRender:"{tableOfContents}.events.afterRender"},listeners:{"{tableOfContents}.events.onRefresh":"{that}.refreshView"},strings:"{tableOfContents}.options.strings"}},modelBuilder:{type:"fluid.tableOfContents.modelBuilder"}},model:[],invokers:{headingTextToAnchorInfo:"fluid.tableOfContents.headingTextToAnchorInfo",locateHeadings:{funcName:"fluid.tableOfContents.locateHeadings",args:["{that}"]},refreshView:{funcName:"fluid.tableOfContents.refreshView",args:["{that}"]},hide:{this:"{that}.dom.tocContainer",method:"hide"},show:{this:"{that}.dom.tocContainer",method:"show"}},strings:{tocHeader:"Table of Contents"},selectors:{headings:":header:visible",tocContainer:".flc-toc-tocContainer"},ignoreForToC:{tocContainer:"{that}.options.selectors.tocContainer"},events:{onRefresh:null,afterRender:null,onReady:{events:{onCreate:"onCreate",afterRender:"afterRender"},args:["{that}"]}},listeners:{"onCreate.refreshView":"{that}.refreshView"}}),fluid.registerNamespace("fluid.tableOfContents.modelBuilder"),fluid.tableOfContents.modelBuilder.toModel=function(headingInfo,modelLevelFn){var headings=fluid.copy(headingInfo),buildModelLevel=function(headings,level){for(var modelLevel=[];0<headings.length;){var heading=headings[0];if(heading.level<level)break;if(heading.level>level){var subHeadings=buildModelLevel(headings,level+1);0<modelLevel.length?modelLevel[modelLevel.length-1].headings=subHeadings:modelLevel=modelLevelFn(modelLevel,subHeadings)}heading.level===level&&(modelLevel.push(heading),headings.shift())}return modelLevel};return buildModelLevel(headings,1)},fluid.tableOfContents.modelBuilder.gradualModelLevelFn=function(modelLevel,subHeadings){var subHeadingsClone=fluid.copy(subHeadings);return subHeadingsClone[0].level--,subHeadingsClone},fluid.tableOfContents.modelBuilder.skippedModelLevelFn=function(modelLevel,subHeadings){return modelLevel.push({headings:subHeadings}),modelLevel},fluid.tableOfContents.modelBuilder.convertToHeadingObjects=function(that,headings,anchorInfo){return headings=$(headings),fluid.transform(headings,function(heading,index){return{level:that.headingCalculator.getHeadingLevel(heading),text:$(heading).text(),url:anchorInfo[index].url}})},fluid.tableOfContents.modelBuilder.assembleModel=function(that,headings,anchorInfo){var headingInfo=that.convertToHeadingObjects(headings,anchorInfo);return that.toModel(headingInfo)},fluid.defaults("fluid.tableOfContents.modelBuilder",{gradeNames:["fluid.component"],components:{headingCalculator:{type:"fluid.tableOfContents.modelBuilder.headingCalculator"}},invokers:{toModel:{funcName:"fluid.tableOfContents.modelBuilder.toModel",args:["{arguments}.0","{modelBuilder}.modelLevelFn"]},modelLevelFn:"fluid.tableOfContents.modelBuilder.gradualModelLevelFn",convertToHeadingObjects:"fluid.tableOfContents.modelBuilder.convertToHeadingObjects({that}, {arguments}.0, {arguments}.1)",assembleModel:"fluid.tableOfContents.modelBuilder.assembleModel({that}, {arguments}.0, {arguments}.1)"}}),fluid.registerNamespace("fluid.tableOfContents.modelBuilder.headingCalculator"),fluid.tableOfContents.modelBuilder.headingCalculator.getHeadingLevel=function(that,heading){return that.options.levels.indexOf(heading.tagName)+1},fluid.defaults("fluid.tableOfContents.modelBuilder.headingCalculator",{gradeNames:["fluid.component"],invokers:{getHeadingLevel:"fluid.tableOfContents.modelBuilder.headingCalculator.getHeadingLevel({that}, {arguments}.0)"},levels:["H1","H2","H3","H4","H5","H6"]}),fluid.registerNamespace("fluid.tableOfContents.levels"),fluid.tableOfContents.levels.objModel=function(type,ID){return{ID:type+ID+":",children:[]}},fluid.tableOfContents.levels.handleEmptyItemObj=function(itemObj){itemObj.decorators=[{type:"addClass",classes:"fl-tableOfContents-hide-bullet"}]},fluid.tableOfContents.levels.generateTree=function(headingsModel,currentLevel){currentLevel=currentLevel||0;var levelObj=fluid.tableOfContents.levels.objModel("level",currentLevel);return 0===headingsModel.headings.length?currentLevel?[]:{children:[]}:0===currentLevel?{children:[fluid.tableOfContents.levels.generateTree(headingsModel,currentLevel+1)]}:($.each(headingsModel.headings,function(index,model){var itemObj=fluid.tableOfContents.levels.objModel("items",currentLevel),linkObj={ID:"link"+currentLevel,target:model.url,linktext:model.text};model.level?itemObj.children.push(linkObj):fluid.tableOfContents.levels.handleEmptyItemObj(itemObj),model.headings&&itemObj.children.push(fluid.tableOfContents.levels.generateTree(model,currentLevel+1)),levelObj.children.push(itemObj)}),levelObj)},fluid.tableOfContents.levels.produceTree=function(that){var tree=fluid.tableOfContents.levels.generateTree(that.model);return tree.children.push({ID:"tocHeader",messagekey:"tocHeader"}),tree},fluid.tableOfContents.levels.fetchResources=function(that){fluid.fetchResources(that.options.resources,function(){that.container.append(that.options.resources.template.resourceText),that.refreshView()})},fluid.defaults("fluid.tableOfContents.levels",{gradeNames:["fluid.rendererComponent"],produceTree:"fluid.tableOfContents.levels.produceTree",strings:{tocHeader:"Table of Contents"},selectors:{tocHeader:".flc-toc-header",level1:".flc-toc-levels-level1",level2:".flc-toc-levels-level2",level3:".flc-toc-levels-level3",level4:".flc-toc-levels-level4",level5:".flc-toc-levels-level5",level6:".flc-toc-levels-level6",items1:".flc-toc-levels-items1",items2:".flc-toc-levels-items2",items3:".flc-toc-levels-items3",items4:".flc-toc-levels-items4",items5:".flc-toc-levels-items5",items6:".flc-toc-levels-items6",link1:".flc-toc-levels-link1",link2:".flc-toc-levels-link2",link3:".flc-toc-levels-link3",link4:".flc-toc-levels-link4",link5:".flc-toc-levels-link5",link6:".flc-toc-levels-link6"},repeatingSelectors:["level1","level2","level3","level4","level5","level6","items1","items2","items3","items4","items5","items6"],model:{headings:[]},listeners:{"onCreate.fetchResources":"fluid.tableOfContents.levels.fetchResources"},resources:{template:{forceCache:!0,url:"../html/TableOfContents.html"}},rendererFnOptions:{noexpand:!0},rendererOptions:{debugMode:!1}})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.window",{gradeNames:["fluid.component","fluid.resolveRootSingle"],singleRootType:"fluid.window",members:{window:window},listeners:{"onCreate.bindEvents":{funcName:"fluid.window.bindEvents",args:["{that}"]}}}),fluid.window.bindEvents=function(that){fluid.each(that.options.events,function(type,eventName){window.addEventListener(eventName,that.events[eventName].fire)})},fluid.registerNamespace("fluid.textToSpeech"),fluid.textToSpeech.isSupported=function(){return!(!window||!window.speechSynthesis)},fluid.defaults("fluid.textToSpeech",{gradeNames:["fluid.modelComponent","fluid.resolveRootSingle"],singleRootType:"fluid.textToSpeech",events:{onStart:null,onStop:null,onError:null,onSpeechQueued:null,utteranceOnBoundary:null,utteranceOnEnd:null,utteranceOnError:null,utteranceOnMark:null,utteranceOnPause:null,utteranceOnResume:null,utteranceOnStart:null},members:{queue:[]},components:{wndw:{type:"fluid.window",options:{events:{beforeunload:null}}}},dynamicComponents:{utterance:{type:"fluid.textToSpeech.utterance",createOnEvent:"onSpeechQueued",options:{listeners:{"onBoundary.relay":"{textToSpeech}.events.utteranceOnBoundary.fire","onEnd.relay":{listener:"{textToSpeech}.events.utteranceOnEnd.fire",priority:"before:resolvePromise"},"onError.relay":{listener:"{textToSpeech}.events.utteranceOnError.fire",priority:"before:rejectPromise"},"onMark.relay":"{textToSpeech}.events.utteranceOnMark.fire","onPause.relay":"{textToSpeech}.events.utteranceOnPause.fire","onResume.relay":"{textToSpeech}.events.utteranceOnResume.fire","onStart.relay":"{textToSpeech}.events.utteranceOnStart.fire","onCreate.followPromise":{funcName:"fluid.promise.follow",args:["{that}.promise","{that}.options.onSpeechQueuePromise"]},"onCreate.queue":{this:"{fluid.textToSpeech}.queue",method:"push",args:["{that}"],priority:"after:followPromise"},"onCreate.speak":{listener:"{textToSpeech}.speak",args:["{that}.utterance"],priority:"after:queue"},"onEnd.destroy":{func:"{that}.destroy",priority:"last"}},onSpeechQueuePromise:"{arguments}.2",utterance:"{arguments}.0"}}},model:{utteranceOpts:{}},modelListeners:{speaking:{listener:"fluid.textToSpeech.toggleSpeak",args:["{that}","{change}.value"]},pauseRequested:{listener:"fluid.textToSpeech.requestControl",args:["{that}","pause","{change}"]},resumeRequested:{listener:"fluid.textToSpeech.requestControl",args:["{that}","resume","{change}"]}},invokers:{queueSpeech:{funcName:"fluid.textToSpeech.queueSpeech",args:["{that}","{arguments}.0","{arguments}.1","{arguments}.2"]},queueSpeechSequence:{funcName:"fluid.textToSpeech.queueSpeechSequence",args:["{that}","{arguments}.0","{arguments}.1"]},cancel:{funcName:"fluid.textToSpeech.cancel",args:["{that}"]},pause:{changePath:"pauseRequested",value:!0,source:"pause"},resume:{changePath:"resumeRequested",value:!0,source:"resume"},getVoices:{func:"{that}.invokeSpeechSynthesisFunc",args:["getVoices"]},speak:{func:"{that}.invokeSpeechSynthesisFunc",args:["speak","{arguments}.0"]},invokeSpeechSynthesisFunc:"fluid.textToSpeech.invokeSpeechSynthesisFunc"},listeners:{"utteranceOnStart.speaking":{changePath:"speaking",value:!0,source:"utteranceOnStart"},"utteranceOnEnd.stop":{funcName:"fluid.textToSpeech.handleEnd",args:["{that}"]},"utteranceOnError.forward":"{that}.events.onError","utteranceOnPause.pause":{changePath:"paused",value:!0,source:"utteranceOnPause"},"utteranceOnResume.resume":{changePath:"paused",value:!1,source:"utteranceOnResume"},"onDestroy.cleanup":{func:"{that}.invokeSpeechSynthesisFunc",args:["cancel"]},"{wndw}.events.beforeunload":{funcName:"{that}.invokeSpeechSynthesisFunc",args:["cancel"],namespace:"cancelSpeechSynthesisOnUnload"}}}),fluid.textToSpeech.invokeSpeechSynthesisFunc=function(method,args){args=fluid.makeArray(args),speechSynthesis[method].apply(speechSynthesis,args)},fluid.textToSpeech.toggleSpeak=function(that,speaking){that.events[speaking?"onStart":"onStop"].fire()},fluid.textToSpeech.requestControl=function(that,control,change){change.value&&(that.applier.change(change.path,!1,"ADD","requestControl"),that.invokeSpeechSynthesisFunc(control))},fluid.textToSpeech.handleEnd=function(that){that.queue.shift();if(that.queue.length)that.applier.change("pending",!0,"ADD","handleEnd.pending");else if(!that.queue.length){var newModel=$.extend({},that.model,{speaking:!1,pending:!1,paused:!1});that.applier.change("",newModel,"ADD","handleEnd.reset")}},fluid.textToSpeech.queueSpeech=function(that,text,interrupt,options){var promise=fluid.promise();interrupt&&that.cancel();var utteranceOpts=$.extend({},that.model.utteranceOpts,options,{text:text});return setTimeout(function(){that.events.onSpeechQueued.fire(utteranceOpts,interrupt,promise)},100),promise},fluid.textToSpeech.queueSpeechSequence=function(that,speeches,interrupt){var sequence=fluid.transform(speeches,function(speech,index){var toInterrupt=interrupt&&!index;return that.queueSpeech(speech.text,toInterrupt,speech.options)});return fluid.promise.sequence(sequence)},fluid.textToSpeech.cancel=function(that){for(;that.queue.length;){that.queue[0].events.onEnd.fire()}that.invokeSpeechSynthesisFunc("cancel"),that.invokeSpeechSynthesisFunc("resume")},fluid.defaults("fluid.textToSpeech.utterance",{gradeNames:["fluid.modelComponent"],members:{utterance:{expander:{funcName:"fluid.textToSpeech.utterance.construct",args:["{that}","{that}.options.utteranceEventMap","{that}.options.utterance"]}},promise:{expander:{funcName:"fluid.promise"}}},model:{boundary:0},utterance:{},utteranceEventMap:{onboundary:"onBoundary",onend:"onEnd",onerror:"onError",onmark:"onMark",onpause:"onPause",onresume:"onResume",onstart:"onStart"},events:{onBoundary:null,onEnd:null,onError:null,onMark:null,onPause:null,onResume:null,onStart:null},listeners:{"onBoundary.updateModel":{changePath:"boundary",value:"{arguments}.0.charIndex"},"onEnd.resolvePromise":"{that}.promise.resolve","onError.rejectPromise":"{that}.promise.reject"}}),fluid.textToSpeech.utterance.construct=function(that,utteranceEventMap,utteranceOpts){var utterance=new SpeechSynthesisUtterance;return $.extend(utterance,utteranceOpts),fluid.each(utteranceEventMap,function(compEventName,utteranceEvent){var compEvent=that.events[compEventName],origHandler=utteranceOpts[utteranceEvent];utterance[utteranceEvent]=compEvent.fire,origHandler&&compEvent.addListener(origHandler,"external")}),utterance}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.orator",{gradeNames:["fluid.viewComponent"],selectors:{controller:".flc-orator-controller",content:".flc-orator-content"},model:{enabled:!0,play:!1},components:{tts:{type:"fluid.textToSpeech"},controller:{type:"fluid.orator.controller",options:{parentContainer:"{orator}.container",model:{playing:"{orator}.model.play",enabled:"{orator}.model.enabled"}}},selectionReader:{type:"fluid.orator.selectionReader",container:"{that}.container",options:{model:{enabled:"{orator}.model.enabled"}}},domReader:{type:"fluid.orator.domReader",container:"{that}.dom.content",options:{model:{tts:{enabled:"{orator}.model.enabled"}},listeners:{"onStop.domReaderStop":{changePath:"{orator}.model.play",value:!1,source:"domReader.onStop",priority:"after:removeHighlight"}},modelListeners:{"{orator}.model.play":{funcName:"fluid.orator.handlePlayToggle",args:["{that}","{change}.value"],namespace:"domReader.handlePlayToggle"}}}}},modelListeners:{enabled:{listener:"fluid.orator.cancelWhenDisabled",args:["{tts}.cancel","{change}.value"],namespace:"orator.clearSpeech"}},distributeOptions:[{source:"{that}.options.tts",target:"{that tts}.options",removeSource:!0,namespace:"ttsOpts"},{source:"{that}.options.controller",target:"{that controller}.options",removeSource:!0,namespace:"controllerOpts"},{source:"{that}.options.domReader",target:"{that domReader}.options",removeSource:!0,namespace:"domReaderOpts"},{source:"{that}.options.selectionReader",target:"{that selectionReader}.options",removeSource:!0,namespace:"selectionReaderOpts"}]}),fluid.orator.cancelWhenDisabled=function(cancelFn,state){state||cancelFn()},fluid.orator.handlePlayToggle=function(that,state){state?that.play():that.pause()},fluid.defaults("fluid.orator.controller",{gradeNames:["fluid.containerRenderingView"],selectors:{playToggle:".flc-orator-controller-playToggle"},styles:{play:"fl-orator-controller-play"},strings:{play:"play",pause:"pause"},model:{playing:!1,enabled:!0},injectionType:"prepend",markup:{container:'<div class="flc-orator-controller fl-orator-controller"><div class="fl-icon-orator" aria-hidden="true"></div><button class="flc-orator-controller-playToggle"><span class="fl-orator-controller-playToggle fl-icon-orator-playToggle" aria-hidden="true"></span></button></div>'},invokers:{play:{changePath:"playing",value:!0,source:"play"},pause:{changePath:"playing",value:!1,source:"pause"},toggle:{funcName:"fluid.orator.controller.toggleState",args:["{that}","{arguments}.0","{arguments}.1"]}},listeners:{"onCreate.bindClick":{listener:"fluid.orator.controller.bindClick",args:["{that}"]}},modelListeners:{playing:{listener:"fluid.orator.controller.setToggleView",args:["{that}","{change}.value"]},enabled:{this:"{that}.container",method:"toggle",args:["{change}.value"],namespace:"toggleView"}}}),fluid.orator.controller.bindClick=function(that){that.locate("playToggle").click(function(){that.toggle("playing")})},fluid.orator.controller.toggleState=function(that,path,state){var newState=fluid.isValue(state)?state:!fluid.get(that.model,path);that.applier.change(path,!!newState,"ADD","toggleState")},fluid.orator.controller.setToggleView=function(that,state){var playToggle=that.locate("playToggle");playToggle.toggleClass(that.options.styles.play,state),playToggle.attr({"aria-label":that.options.strings[state?"pause":"play"]})},fluid.defaults("fluid.orator.domReader",{gradeNames:["fluid.viewComponent"],selectors:{highlight:".flc-orator-highlight"},markup:{highlight:'<mark class="flc-orator-highlight fl-orator-highlight"></mark>'},events:{onQueueSpeech:null,onReadFromDOM:null,utteranceOnEnd:null,utteranceOnBoundary:null,utteranceOnError:null,utteranceOnMark:null,utteranceOnPause:null,utteranceOnResume:null,utteranceOnStart:null,onStop:null},utteranceEventMap:{onboundary:"utteranceOnBoundary",onend:"utteranceOnEnd",onerror:"utteranceOnError",onmark:"utteranceOnMark",onpause:"utteranceOnPause",onresume:"utteranceOnResume",onstart:"utteranceOnStart"},model:{tts:{paused:!1,speaking:!1,enabled:!0},parseQueueIndex:0,parseIndex:null,ttsBoundary:null,parseQueueCount:0,parseItemCount:0},modelRelay:[{target:"parseIndex",backward:"never",excludeSource:["utteranceOnPause"],namespace:"getClosestIndex",singleTransform:{type:"fluid.transforms.free",func:"fluid.orator.domReader.getClosestIndex",args:["{that}","{that}.model.ttsBoundary","{that}.model.parseQueueIndex"]}}],members:{parseQueue:[]},components:{parser:{type:"fluid.textNodeParser",options:{listeners:{"onParsedTextNode.addToParseQueue":"{domReader}.addToParseQueue"}}}},invokers:{parsedToString:"fluid.orator.domReader.parsedToString",readFromDOM:{funcName:"fluid.orator.domReader.readFromDOM",args:["{that}","{that}.container"]},removeHighlight:{funcName:"fluid.orator.domReader.unWrap",args:["{that}.dom.highlight"]},addToParseQueue:{funcName:"fluid.orator.domReader.addToParseQueue",args:["{that}","{arguments}.0"]},resetParseQueue:{funcName:"fluid.orator.domReader.resetParseQueue",args:["{that}"]},highlight:{funcName:"fluid.orator.domReader.highlight",args:["{that}"]},play:{funcName:"fluid.orator.domReader.play",args:["{that}","{fluid.textToSpeech}.resume"]},pause:{funcName:"fluid.orator.domReader.pause",args:["{that}","{fluid.textToSpeech}.pause"]},queueSpeech:{funcName:"fluid.orator.domReader.queueSpeech",args:["{that}","{arguments}.0","{arguments}.1"]},isWord:"fluid.textNodeParser.isWord"},modelListeners:{parseIndex:{listener:"{that}.highlight",namespace:"highlight",excludeSource:["init","utteranceOnEnd","resetParseQueue"]}},listeners:{"onQueueSpeech.removeExtraWhiteSpace":"fluid.orator.domReader.removeExtraWhiteSpace","onQueueSpeech.queueSpeech":{func:"{fluid.textToSpeech}.queueSpeech",args:["{arguments}.0","{arguments}.1.interrupt","{arguments}.1"],priority:"after:removeExtraWhiteSpace"},"onStop.resetParseQueue":{listener:"{that}.resetParseQueue"},"onStop.removeHighlight":{listener:"{that}.removeHighlight",priority:"after:resetParseQueue"},"onStop.updateTTSModel":{changePath:"tts",value:{speaking:!1,paused:!1},source:"onStop"},"utteranceOnEnd.resetParseIndex":{changePath:"",value:{parseIndex:null},source:"utteranceOnEnd"},"utteranceOnStart.updateTTSModel":{changePath:"tts",value:{speaking:!0,paused:!1},source:"utteranceOnStart"},"utteranceOnPause.updateTTSModel":{changePath:"tts",value:{speaking:!0,paused:!0},source:"utteranceOnPause"},"utteranceOnPause.resetBoundary":{changePath:"ttsBoundary",value:null,source:"utteranceOnPause"},"utteranceOnResume.updateTTSModel":{changePath:"tts",value:{speaking:!0,paused:!1},source:"utteranceOnResume"},"utteranceOnBoundary.setCurrentBoundary":{listener:"fluid.orator.domReader.setCurrentBoundary",args:["{that}","{arguments}.0.charIndex","{arguments}.0.name"]}}}),fluid.orator.domReader.setCurrentBoundary=function(that,boundary,boundaryType){var parseQueueIndex;that.model.tts.paused||"word"!==boundaryType||(parseQueueIndex=(fluid.isValue(that.model.ttsBoundary)?that.model.ttsBoundary:-1)<boundary?that.model.parseQueueIndex:that.model.parseQueueIndex+1,that.applier.change("",{ttsBoundary:boundary,parseQueueIndex:parseQueueIndex},"ADD","setCurrentBoundary"))},fluid.orator.domReader.play=function(that,resumeFn){that.model.tts.enabled&&(that.model.tts.paused?resumeFn():that.model.tts.speaking||that.readFromDOM())},fluid.orator.domReader.pause=function(that,pauseFn){that.model.tts.speaking&&!that.model.tts.paused&&pauseFn()},fluid.orator.domReader.mapUtteranceEvents=function(that,utterance,utteranceEventMap){fluid.each(utteranceEventMap,function(compEventName,utteranceEvent){var compEvent=that.events[compEventName];utterance[utteranceEvent]=compEvent.fire})},fluid.orator.domReader.removeExtraWhiteSpace=function(text){var promise=fluid.promise(),str=text.toString();return(str=str.trim())?promise.resolve(str):promise.reject("The text is empty"),promise},fluid.orator.domReader.queueSpeech=function(that,text,options){return options=options||{},fluid.orator.domReader.mapUtteranceEvents(that,options,that.options.utteranceEventMap),fluid.promise.fireTransformEvent(that.events.onQueueSpeech,text,options)},fluid.orator.domReader.unWrap=function(elm){if((elm=$(elm)).length){var parent=elm.parent();elm.contents().unwrap(),parent[0].normalize()}},fluid.orator.domReader.retrieveActiveQueue=function(that,lang){var lastQueue=that.parseQueue[that.parseQueue.length-1];return(!lastQueue||lastQueue.length&&lastQueue[0].lang!==lang)&&(lastQueue=[],that.parseQueue.push(lastQueue),that.applier.change("parseQueueCount",that.parseQueue.length,"ADD","retrieveActiveQueue")),lastQueue},fluid.orator.domReader.addToParseQueue=function(that,textNodeData){var activeQueue=fluid.orator.domReader.retrieveActiveQueue(that,textNodeData.lang),lastParsed=activeQueue[activeQueue.length-1]||{},words=textNodeData.node.textContent.split(/(\s+)/),parsed=$.extend({},textNodeData,{blockIndex:(lastParsed.blockIndex||0)+(fluid.get(lastParsed,["word","length"])||0),startOffset:0,parentNode:textNodeData.node.parentNode});fluid.each(words,function(word){var lastIsWord=that.isWord(lastParsed.word),currentIsWord=that.isWord(word);lastIsWord&¤tIsWord?(lastParsed.word+=word,lastParsed.endOffset+=word.length,parsed.blockIndex+=word.length,parsed.startOffset+=word.length):(parsed.word=word,parsed.endOffset=parsed.startOffset+word.length,(currentIsWord||word&&lastIsWord)&&(lastParsed=fluid.copy(parsed),activeQueue.push(lastParsed),that.applier.change("parseItemCount",that.model.parseItemCount+1,"ADD","addToParseQueue"),parsed.blockIndex+=word.length),parsed.startOffset=parsed.endOffset)})},fluid.orator.domReader.resetParseQueue=function(that){that.parseQueue=[],that.applier.change("",{parseQueueIndex:0,parseIndex:null,ttsBoundary:null,parseQueueCount:0,parseItemCount:0},"ADD","resetParseQueue")},fluid.orator.domReader.parsedToString=function(parsed){return fluid.transform(parsed,function(block){return block.word}).join("")},fluid.orator.domReader.readFromDOM=function(that,elm){if((elm=$(elm)).length){that.resetParseQueue(),that.parser.parse(elm[0]);var queueSpeechPromises=fluid.transform(that.parseQueue,function(parsedBlock,index){var interrupt=!index,text=that.parsedToString(parsedBlock);return that.queueSpeech(text,{lang:parsedBlock[0].lang,interrupt:interrupt})});fluid.promise.sequence(queueSpeechPromises).then(that.events.onStop.fire)}},fluid.orator.domReader.getClosestIndex=function(that,boundary,parseQueueIndex){var parseQueue=that.parseQueue[parseQueueIndex];if(fluid.get(parseQueue,"length")&&fluid.isValue(boundary)){var maxIndex=Math.max(parseQueue.length-1,0),index=Math.max(Math.min(that.model.parseIndex||0,maxIndex),0),maxBoundary=parseQueue[maxIndex].blockIndex+parseQueue[maxIndex].word.length;if(!(maxBoundary<boundary||boundary<0)){for(;0<=index;){var nextIndex=index+1,prevIndex=index-1,currentBlockIndex=parseQueue[index].blockIndex,nextBlockIndex=index<maxIndex?parseQueue[nextIndex].blockIndex:maxBoundary+1;if(currentBlockIndex<=boundary&&boundary<nextBlockIndex)break;index=boundary<currentBlockIndex?prevIndex:nextIndex}return index}}},fluid.orator.domReader.findTextNode=function(node){if(node){if(node.nodeType===Node.TEXT_NODE)return node;for(var children=node.childNodes,i=0;i<children.length;i++){var textNode=fluid.orator.domReader.findTextNode(children[i]);if(void 0!==textNode)return textNode}}},fluid.orator.domReader.getTextNodeFromSibling=function(node){for(;node.nextSibling;){node=node.nextSibling;var textNode=fluid.orator.domReader.findTextNode(node);if(textNode)return textNode}},fluid.orator.domReader.getNextTextNode=function(node){var nextTextNode=fluid.orator.domReader.getTextNodeFromSibling(node);if(nextTextNode)return nextTextNode;var parent=node.parentNode;return parent?fluid.orator.domReader.getNextTextNode(parent):void 0},fluid.orator.domReader.setRangeEnd=function(range,node,end){var ranges=fluid.makeArray(range);if(end<=node.length)range.setEnd(node,end);else{var nextRange=document.createRange(),nextTextNode=fluid.orator.domReader.getNextTextNode(node);nextRange.selectNode(nextTextNode),nextRange.setStart(nextTextNode,0),ranges=ranges.concat(fluid.orator.domReader.setRangeEnd(nextRange,nextTextNode,end-node.length))}return ranges},fluid.orator.domReader.highlight=function(that){if(that.removeHighlight(),that.model.parseQueueCount&&fluid.isValue(that.model.parseIndex)){var data=that.parseQueue[that.model.parseQueueIndex][that.model.parseIndex],rangeNode=data.parentNode.childNodes[data.childIndex],startRange=document.createRange();startRange.selectNode(rangeNode),startRange.setStart(rangeNode,data.startOffset);var ranges=fluid.orator.domReader.setRangeEnd(startRange,rangeNode,data.endOffset);fluid.each(ranges,function(range){range.surroundContents($(that.options.markup.highlight)[0]),range.detach()})}},fluid.defaults("fluid.orator.selectionReader",{gradeNames:["fluid.viewComponent"],selectors:{control:".flc-orator-selectionReader-control",controlLabel:".flc-orator-selectionReader-controlLabel"},strings:{play:"play",stop:"stop"},styles:{above:"fl-orator-selectionReader-above",below:"fl-orator-selectionReader-below",control:"fl-orator-selectionReader-control"},markup:{control:'<button class="flc-orator-selectionReader-control"><span class="fl-icon-orator"></span><span class="flc-orator-selectionReader-controlLabel"></span></button>'},model:{enabled:!0,play:!1,text:""},events:{onSelectionChanged:null,onStop:null,onToggleControl:null},components:{parser:{type:"fluid.textNodeParser"}},listeners:{"onCreate.bindEvents":{funcName:"fluid.orator.selectionReader.bindSelectionEvents",args:["{that}"]},"onSelectionChanged.updateSelection":"{that}.getSelection","onStop.stop":{changePath:"play",value:!1,source:"stopMethod"},"onToggleControl.togglePlay":"{that}.toggle"},modelListeners:{text:[{func:"{that}.stop",namespace:"stopPlayingWhenTextChanges"},{funcName:"fluid.orator.selectionReader.renderControl",args:["{that}","{change}.value"],namespace:"render"}],play:[{func:"fluid.orator.selectionReader.queueSpeech",args:["{that}","{change}.value","{fluid.textToSpeech}.queueSpeechSequence"],namespace:"queueSpeech"},{func:"fluid.orator.selectionReader.renderControlState",args:["{that}","{that}.control","{arguments}.0"],excludeSource:["init"],namespace:"renderControlState"}],enabled:{funcName:"fluid.orator.selectionReader.updateText",args:["{that}","{change}.value"],namespace:"updateText"}},invokers:{getSelection:{funcName:"fluid.orator.selectionReader.getSelection",args:["{that}"]},play:{changePath:"play",value:!0,source:"playMethod"},stop:{funcName:"fluid.orator.selectionReader.stopSpeech",args:["{that}.model.play","{fluid.textToSpeech}.cancel"]},toggle:{funcName:"fluid.orator.selectionReader.togglePlay",args:["{that}","{arguments}.0"]}}}),fluid.orator.selectionReader.stopSpeech=function(state,cancelFn){state&&cancelFn()},fluid.orator.selectionReader.queueSpeech=function(that,state,speechFn){state&&that.model.enabled&&that.model.text&&speechFn(fluid.orator.selectionReader.parseRange(that.selection.getRangeAt(0),that.parser.parse),!0).then(that.events.onStop.fire)},fluid.orator.selectionReader.bindSelectionEvents=function(that){$(document).on("selectionchange",function(e){that.model.enabled&&that.events.onSelectionChanged.fire(e)})},fluid.orator.selectionReader.updateText=function(that,state){state?that.getSelection():that.applier.change("text","","ADD","updateText")},fluid.orator.selectionReader.getSelectedText=function(){return window.getSelection().toString()},fluid.orator.selectionReader.getSelection=function(that){that.selection=window.getSelection(),that.applier.change("text",that.selection.toString(),"ADD","getSelection")},fluid.orator.selectionReader.parseRange=function(range,domParser){return range.commonAncestorContainer.nodeType===Node.TEXT_NODE?[{text:range.commonAncestorContainer.textContent.slice(range.startOffset,range.endOffset),options:{lang:$(range.commonAncestorContainer.parentNode).closest("[lang]").attr("lang")}}]:range.commonAncestorContainer===range.startContainer?fluid.orator.selectionReader.parseElement(range.commonAncestorContainer.childNodes[range.startOffset],domParser):fluid.orator.selectionReader.parseElement(range.commonAncestorContainer,domParser,range)},fluid.orator.selectionReader.parseElement=function(element,domParser,options){options=options||{};var parsed=[],fromParser=domParser(element),parsedNodes=fluid.getMembers(fromParser,"node"),startIndex=options.startContainer?parsedNodes.indexOf(options.startContainer):0,endIndex=options.endContainer?parsedNodes.indexOf(options.endContainer):parsedNodes.length-1;if(0<=startIndex&&0<=endIndex)for(var i=startIndex;i<=endIndex;i++){var startOffset=i===startIndex?options.startOffset:0,endOffset=i===endIndex?options.endOffset:void 0,node=fromParser[i].node,lang=fromParser[i].lang,lastParsed=parsed[parsed.length-1];parsed.length&&lastParsed.options.lang===lang?lastParsed.text+=node.textContent.slice(startOffset,endOffset):parsed.push({text:node.textContent.slice(startOffset,endOffset),options:{lang:lang}})}return parsed},fluid.orator.selectionReader.calculatePosition=function(range){var rangeRect=range.getClientRects()[0],rangeParent=range.startContainer.parentNode,rangeParentRect=rangeParent.getClientRects()[0],offsetParent=rangeParent.offsetParent,bodyBorderAdjustment={top:0,left:0};return offsetParent&&"body"===offsetParent.tagName.toLowerCase()&&(bodyBorderAdjustment.top=Math.abs(offsetParent.offsetTop)-offsetParent.clientTop,bodyBorderAdjustment.left=Math.abs(offsetParent.offsetLeft)-offsetParent.clientLeft),{viewPort:{top:rangeRect.top,bottom:rangeRect.bottom,left:rangeRect.left},offset:{top:rangeParent.offsetTop+rangeRect.top-rangeParentRect.top+bodyBorderAdjustment.top,bottom:rangeParent.offsetTop+rangeRect.bottom-rangeParentRect.top+bodyBorderAdjustment.top,left:rangeParent.offsetLeft+rangeRect.left-rangeParentRect.left+bodyBorderAdjustment.left}}},fluid.orator.selectionReader.renderControlState=function(that,control){var text=that.options.strings[that.model.play?"stop":"play"];control.find(that.options.selectors.controlLabel).text(text)},fluid.orator.selectionReader.adjustForHorizontalCollision=function(control,position,viewPortWidth){viewPortWidth=viewPortWidth||document.body.clientWidth;var controlMidPoint=parseFloat(control.css("width"))/2;controlMidPoint>position.viewPort.left?control.css("left",position.offset.left+controlMidPoint-position.viewPort.left):controlMidPoint+position.viewPort.left>viewPortWidth&&control.css("left",position.offset.left-viewPortWidth+position.viewPort.left)},fluid.orator.selectionReader.adjustForVerticalCollision=function(control,position,belowStyle,aboveStyle){parseFloat(control.css("height"))>position.viewPort.top?(control.css("top",position.offset.bottom),control.removeClass(aboveStyle),control.addClass(belowStyle)):(control.removeClass(belowStyle),control.addClass(aboveStyle))},fluid.orator.selectionReader.createControl=function(that){var control=$(that.options.markup.control);return control.addClass(that.options.styles.control),control.click(function(){that.events.onToggleControl.fire()}),control},fluid.orator.selectionReader.renderControl=function(that,state){if(state){var selectionRange=window.getSelection().getRangeAt(0),controlContainer=selectionRange.startContainer.parentNode.offsetParent||selectionRange.startContainer.parentNode,position=fluid.orator.selectionReader.calculatePosition(selectionRange);that.control=that.control||fluid.orator.selectionReader.createControl(that),that.control.css({top:position.offset.top,left:position.offset.left}),fluid.orator.selectionReader.renderControlState(that,that.control),that.control.appendTo(controlContainer),fluid.orator.selectionReader.adjustForVerticalCollision(that.control,position,that.options.styles.below,that.options.styles.above),fluid.orator.selectionReader.adjustForHorizontalCollision(that.control,position),selectionRange.detach()}else that.control&&that.control.detach()},fluid.orator.selectionReader.togglePlay=function(that,state){that[state||!that.model.play?"play":"stop"]()}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.url"),fluid.url.generateDepth=function(depth){return fluid.generate(depth,"../").join("")},fluid.url.parsePathInfo=function(pathInfo){var togo={},segs=pathInfo.split("/");if(0<segs.length){var top=segs.length-1,dotpos=segs[top].indexOf(".");-1!==dotpos&&(togo.extension=segs[top].substring(dotpos+1),segs[top]=segs[top].substring(0,dotpos))}return togo.pathInfo=segs,togo},fluid.url.parsePathInfoTrim=function(pathInfo){var togo=fluid.url.parsePathInfo(pathInfo);return""===togo.pathInfo[togo.pathInfo.length-1]&&togo.pathInfo.length--,togo},fluid.url.collapseSegs=function(segs,from,to){var togo="";void 0===from&&(from=0),void 0===to&&(to=segs.length);for(var i=from;i<to-1;++i)togo+=segs[i]+"/";return from<to&&(togo+=segs[to-1]),togo},fluid.url.makeRelPath=function(parsed,index){var togo=fluid.kettle.collapseSegs(parsed.pathInfo,index);return parsed.extension&&(togo+="."+parsed.extension),togo},fluid.url.cononocolosePath=function(pathInfo){for(var consume=0,i=0;i<pathInfo.length;++i)".."===pathInfo[i]?++consume:0!==consume&&(pathInfo.splice(i-2*consume,2*consume),i-=2*consume,consume=0);return pathInfo},fluid.url.parseUri=function(str){for(var o=fluid.url.parseUri.options,m=o.parser[o.strictMode?"strict":"loose"].exec(str),uri={},i=14;i--;)uri[o.key[i]]=m[i]||"";return uri[o.q.name]={},uri[o.key[12]].replace(o.q.parser,function($0,$1,$2){$1&&(uri[o.q.name][$1]=$2)}),uri},fluid.url.parseUri.options={strictMode:!0,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},fluid.url.parseSegs=function(url){var parsed=fluid.url.parseUri(url);return fluid.url.parsePathInfoTrim(parsed.directory).pathInfo},fluid.url.isAbsoluteUrl=function(url){var parseRel=fluid.url.parseUri(url);return parseRel.host||parseRel.protocol||"/"===parseRel.directory.charAt(0)},fluid.url.computeRelativePrefix=function(outerLocation,iframeLocation,relPath){if(fluid.url.isAbsoluteUrl(relPath))return relPath;var relSegs=fluid.url.parsePathInfo(relPath).pathInfo,parsedRel=fluid.url.parseSegs(outerLocation).concat(relSegs);fluid.url.cononocolosePath(parsedRel);for(var parsedInner=fluid.url.parseSegs(iframeLocation),seg=0;seg<parsedRel.length&&parsedRel[seg]===parsedInner[seg];++seg);var excess=parsedInner.length-seg;return fluid.url.generateDepth(excess)+fluid.url.collapseSegs(parsedRel,seg)}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.store",{gradeNames:["fluid.dataSource","fluid.contextAware"],contextAwareness:{strategy:{defaultGradeNames:"fluid.prefs.cookieStore"}}}),fluid.prefs.store.decodeURIComponent=function(payload){if("string"==typeof payload)return decodeURIComponent(payload)},fluid.prefs.store.encodeURIComponent=function(payload){if("string"==typeof payload)return encodeURIComponent(payload)},fluid.defaults("fluid.prefs.cookieStore",{gradeNames:["fluid.dataSource"],cookie:{name:"fluid-ui-settings",path:"/",expires:""},listeners:{"onRead.impl":{listener:"fluid.prefs.cookieStore.getCookie",args:["{arguments}.1"]},"onRead.decodeURI":{listener:"fluid.prefs.store.decodeURIComponent",priority:"before:encoding"}},invokers:{get:{args:["{that}","{arguments}.0","{that}.options.cookie"]}}}),fluid.defaults("fluid.prefs.cookieStore.writable",{gradeNames:["fluid.dataSource.writable"],listeners:{"onWrite.encodeURI":{func:"fluid.prefs.store.encodeURIComponent",priority:"before:impl"},"onWrite.impl":{listener:"fluid.prefs.cookieStore.writeCookie"},"onWriteResponse.decodeURI":{listener:"fluid.prefs.store.decodeURIComponent",priority:"before:encoding"}},invokers:{set:{args:["{that}","{arguments}.0","{arguments}.1","{that}.options.cookie"]}}}),fluid.makeGradeLinkage("fluid.prefs.cookieStore.linkage",["fluid.dataSource.writable","fluid.prefs.cookieStore"],"fluid.prefs.cookieStore.writable"),fluid.prefs.cookieStore.getCookie=function(options){var cookieName=fluid.get(options,["directModel","cookieName"])||options.name,cookie=document.cookie;if(!(cookie.length<=0)){var cookiePrefix=cookieName+"=",startIndex=cookie.indexOf(cookiePrefix);if(!(startIndex<0)){startIndex+=cookiePrefix.length;var endIndex=cookie.indexOf(";",startIndex);return endIndex<startIndex&&(endIndex=cookie.length),cookie.substring(startIndex,endIndex)}}},fluid.prefs.cookieStore.assembleCookie=function(cookieName,data,options){var cookieStr=cookieName+"="+data;return(options=options||{}).expires&&(cookieStr+="; expires="+options.expires),options.path&&(cookieStr+="; path="+options.path),cookieStr},fluid.prefs.cookieStore.writeCookie=function(payload,options){var cookieName=fluid.get(options,["directModel","cookieName"])||options.name,cookieStr=fluid.prefs.cookieStore.assembleCookie(cookieName,payload,options);return document.cookie=cookieStr,payload},fluid.defaults("fluid.dataSource.encoding.model",{gradeNames:"fluid.component",invokers:{parse:"fluid.identity",render:"fluid.identity"},contentType:"application/json"}),fluid.defaults("fluid.prefs.tempStore",{gradeNames:["fluid.dataSource","fluid.modelComponent"],components:{encoding:{type:"fluid.dataSource.encoding.model"}},listeners:{"onRead.impl":{listener:"fluid.identity",args:["{that}.model"]}}}),fluid.defaults("fluid.prefs.tempStore.writable",{gradeNames:["fluid.dataSource.writable","fluid.modelComponent"],components:{encoding:{type:"fluid.dataSource.encoding.model"}},listeners:{"onWrite.impl":{listener:"fluid.prefs.tempStore.write",args:["{that}","{arguments}.0","{arguments}.1"]}}}),fluid.prefs.tempStore.write=function(that,settings){var transaction=that.applier.initiate();return transaction.fireChangeRequest({path:"",type:"DELETE"}),transaction.change("",settings),transaction.commit(),that.model},fluid.makeGradeLinkage("fluid.prefs.tempStore.linkage",["fluid.dataSource.writable","fluid.prefs.tempStore"],"fluid.prefs.tempStore.writable"),fluid.defaults("fluid.prefs.globalSettingsStore",{gradeNames:["fluid.component"],components:{settingsStore:{type:"fluid.prefs.store",options:{gradeNames:["fluid.resolveRootSingle","fluid.dataSource.writable"],singleRootType:"fluid.prefs.store"}}}})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.initialModel",{gradeNames:["fluid.component"],members:{initialModel:{preferences:{}}}}),fluid.defaults("fluid.uiEnhancer",{gradeNames:["fluid.viewComponent"],defaultLocale:"en",invokers:{updateModel:{func:"{that}.applier.change",args:["","{arguments}.0"]}},userGrades:"@expand:fluid.prefs.filterEnhancerGrades({that}.options.gradeNames)",distributeOptions:{"uiEnhancer.messageLoader.defaultLocale":{source:"{that}.options.defaultLocale",target:"{that messageLoader}.options.defaultLocale"},"uiEnhancer.messageLoader.locale":{source:"{that}.options.locale",target:"{that messageLoader}.model.locale"}}}),fluid.defaults("fluid.uiEnhancer.root",{gradeNames:["fluid.uiEnhancer","fluid.resolveRootSingle"],singleRootType:"fluid.uiEnhancer"}),fluid.uiEnhancer.ignorableGrades=["fluid.uiEnhancer","fluid.uiEnhancer.root","fluid.resolveRoot","fluid.resolveRootSingle"],fluid.prefs.filterEnhancerGrades=function(gradeNames){return fluid.remove_if(fluid.makeArray(gradeNames),function(gradeName){return-1!==fluid.frameworkGrades.indexOf(gradeName)||-1!==fluid.uiEnhancer.ignorableGrades.indexOf(gradeName)})},fluid.prefs.filterEnhancerOptions=function(options){return fluid.filterKeys(options,["classnameMap","fontSizeMap","tocTemplate","tocMessage","components"])},fluid.defaults("fluid.pageEnhancer",{gradeNames:["fluid.component","fluid.originalEnhancerOptions","fluid.prefs.initialModel","fluid.prefs.settingsGetter","fluid.resolveRootSingle"],distributeOptions:{"pageEnhancer.uiEnhancer":{source:"{that}.options.uiEnhancer",target:"{that > uiEnhancer}.options"}},singleRootType:"fluid.pageEnhancer",components:{uiEnhancer:{type:"fluid.uiEnhancer.root",container:"body"}},originalUserOptions:"@expand:fluid.prefs.filterEnhancerOptions({uiEnhancer}.options)",listeners:{"onCreate.initModel":"fluid.pageEnhancer.init"}}),fluid.pageEnhancer.init=function(that){that.getSettings().then(function(fetchedSettings){that.uiEnhancer.updateModel(fluid.get(fetchedSettings,"preferences"))})}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.prefsEditorLoader",{gradeNames:["fluid.prefs.settingsGetter","fluid.prefs.initialModel","fluid.viewComponent"],defaultLocale:"en",components:{prefsEditor:{priority:"last",type:"fluid.prefs.prefsEditor",createOnEvent:"onCreatePrefsEditorReady",options:{members:{initialModel:"{prefsEditorLoader}.initialModel"},invokers:{getSettings:"{prefsEditorLoader}.getSettings"},listeners:{"onReady.boil":{listener:"{prefsEditorLoader}.events.onReady",args:["{prefsEditorLoader}"]}}}},templateLoader:{type:"fluid.resourceLoader",options:{events:{onResourcesLoaded:"{prefsEditorLoader}.events.onPrefsEditorTemplatesLoaded"}}},messageLoader:{type:"fluid.resourceLoader",createOnEvent:"afterInitialSettingsFetched",options:{defaultLocale:"{prefsEditorLoader}.options.defaultLocale",locale:"{prefsEditorLoader}.settings.preferences.locale",resourceOptions:{dataType:"json"},events:{onResourcesLoaded:"{prefsEditorLoader}.events.onPrefsEditorMessagesLoaded"}}}},listeners:{"onCreate.getInitialSettings":{listener:"fluid.prefs.prefsEditorLoader.getInitialSettings",args:["{that}"]}},events:{afterInitialSettingsFetched:null,onPrefsEditorTemplatesLoaded:null,onPrefsEditorMessagesLoaded:null,onCreatePrefsEditorReady:{events:{templateLoaded:"onPrefsEditorTemplatesLoaded",prefsEditorMessagesLoaded:"onPrefsEditorMessagesLoaded"}},onReady:null},distributeOptions:{"prefsEditorLoader.templateLoader":{source:"{that}.options.templateLoader",removeSource:!0,target:"{that > templateLoader}.options"},"prefsEditorLoader.templateLoader.terms":{source:"{that}.options.terms",target:"{that > templateLoader}.options.terms"},"prefsEditorLoader.messageLoader":{source:"{that}.options.messageLoader",removeSource:!0,target:"{that > messageLoader}.options"},"prefsEditorLoader.messageLoader.terms":{source:"{that}.options.terms",target:"{that > messageLoader}.options.terms"},"prefsEditorLoader.prefsEditor":{source:"{that}.options.prefsEditor",removeSource:!0,target:"{that > prefsEditor}.options"}}}),fluid.prefs.prefsEditorLoader.getInitialSettings=function(that){var promise=fluid.promise(),fetchPromise=that.getSettings();return fetchPromise.then(function(savedSettings){that.settings=$.extend(!0,{},that.initialModel,savedSettings),that.events.afterInitialSettingsFetched.fire(that.settings)},function(error){fluid.log(fluid.logLevel.WARN,error),that.settings=that.initialModel,that.events.afterInitialSettingsFetched.fire(that.settings)}),fluid.promise.follow(fetchPromise,promise),promise},fluid.defaults("fluid.prefs.transformDefaultPanelsOptions",{gradeNames:["fluid.viewComponent"],distributeOptions:{"transformDefaultPanelsOptions.textSize":{source:"{that}.options.textSize",removeSource:!0,target:"{that textSize}.options"},"transformDefaultPanelsOptions.lineSpace":{source:"{that}.options.lineSpace",removeSource:!0,target:"{that lineSpace}.options"},"transformDefaultPanelsOptions.textFont":{source:"{that}.options.textFont",removeSource:!0,target:"{that textFont}.options"},"transformDefaultPanelsOptions.contrast":{source:"{that}.options.contrast",removeSource:!0,target:"{that contrast}.options"},"transformDefaultPanelsOptions.layoutControls":{source:"{that}.options.layoutControls",removeSource:!0,target:"{that layoutControls}.options"},"transformDefaultPanelsOptions.enhanceInputs":{source:"{that}.options.enhanceInputs",removeSource:!0,target:"{that enhanceInputs}.options"}}}),fluid.defaults("fluid.prefs.settingsGetter",{gradeNames:["fluid.component"],members:{getSettings:"{fluid.prefs.store}.get"}}),fluid.defaults("fluid.prefs.settingsSetter",{gradeNames:["fluid.component"],invokers:{setSettings:{funcName:"fluid.prefs.settingsSetter.setSettings",args:["{arguments}.0","{arguments}.1","{fluid.prefs.store}.set"]}}}),fluid.prefs.settingsSetter.setSettings=function(model,directModel,set){return set(directModel,fluid.copy(model))},fluid.defaults("fluid.prefs.uiEnhancerRelay",{gradeNames:["fluid.modelComponent"],listeners:{"onCreate.addListener":"{that}.addListener","onDestroy.removeListener":"{that}.removeListener"},events:{updateEnhancerModel:"{fluid.prefs.prefsEditor}.events.onUpdateEnhancerModel"},invokers:{addListener:{funcName:"fluid.prefs.uiEnhancerRelay.addListener",args:["{that}.events.updateEnhancerModel","{that}.updateEnhancerModel"]},removeListener:{funcName:"fluid.prefs.uiEnhancerRelay.removeListener",args:["{that}.events.updateEnhancerModel","{that}.updateEnhancerModel"]},updateEnhancerModel:{funcName:"fluid.prefs.uiEnhancerRelay.updateEnhancerModel",args:["{uiEnhancer}","{fluid.prefs.prefsEditor}.model.preferences"]}}}),fluid.prefs.uiEnhancerRelay.addListener=function(modelChanged,listener){modelChanged.addListener(listener)},fluid.prefs.uiEnhancerRelay.removeListener=function(modelChanged,listener){modelChanged.removeListener(listener)},fluid.prefs.uiEnhancerRelay.updateEnhancerModel=function(uiEnhancer,newModel){uiEnhancer.updateModel(newModel)},fluid.defaults("fluid.prefs.prefsEditor",{gradeNames:["fluid.prefs.settingsGetter","fluid.prefs.settingsSetter","fluid.prefs.initialModel","fluid.remoteModelComponent","fluid.viewComponent"],invokers:{fetchImpl:{funcName:"fluid.prefs.prefsEditor.fetchImpl",args:["{that}"]},writeImpl:{funcName:"fluid.prefs.prefsEditor.writeImpl",args:["{that}","{arguments}.0"]},applyChanges:{funcName:"fluid.prefs.prefsEditor.applyChanges",args:["{that}"]},save:{funcName:"fluid.prefs.prefsEditor.save",args:["{that}"]},saveAndApply:{funcName:"fluid.prefs.prefsEditor.saveAndApply",args:["{that}"]},reset:{funcName:"fluid.prefs.prefsEditor.reset",args:["{that}"]},cancel:{funcName:"fluid.prefs.prefsEditor.cancel",args:["{that}"]}},selectors:{panels:".flc-prefsEditor-panel",cancel:".flc-prefsEditor-cancel",reset:".flc-prefsEditor-reset",save:".flc-prefsEditor-save",previewFrame:".flc-prefsEditor-preview-frame"},events:{onSave:null,onCancel:null,beforeReset:null,afterReset:null,onAutoSave:null,modelChanged:null,onPrefsEditorRefresh:null,onUpdateEnhancerModel:null,onPrefsEditorMarkupReady:null,onReady:null},listeners:{"onCreate.init":"fluid.prefs.prefsEditor.init","onAutoSave.save":"{that}.save"},model:{local:{preferences:"{that}.model.preferences"}},modelListeners:{preferences:[{listener:"fluid.prefs.prefsEditor.handleAutoSave",args:["{that}"],namespace:"autoSave",excludeSource:["init"]},{listener:"{that}.events.modelChanged.fire",args:["{change}.value"],namespace:"modelChange"}]},resources:{template:"{templateLoader}.resources.prefsEditor"},autoSave:!1}),fluid.prefs.prefsEditor.applyChanges=function(that){that.events.onUpdateEnhancerModel.fire()},fluid.prefs.prefsEditor.fetchImpl=function(that){var promise=fluid.promise();return that.getSettings().then(function(savedModel){var completeModel=$.extend(!0,{},that.initialModel,savedModel);promise.resolve(completeModel)},promise.reject),promise},fluid.prefs.prefsEditor.writeImpl=function(that,modelToSave){var promise=fluid.promise(),stats={changes:0,unchanged:0,changeMap:{}},changedPrefs={};modelToSave=fluid.copy(modelToSave),fluid.model.diff(modelToSave.preferences,fluid.get(that.initialModel,["preferences"]),stats),0===stats.changes?delete modelToSave.preferences:(fluid.each(stats.changeMap,function(state,pref){fluid.set(changedPrefs,pref,modelToSave.preferences[pref])}),modelToSave.preferences=changedPrefs),that.events.onSave.fire(modelToSave);var setPromise=that.setSettings(modelToSave);return fluid.promise.follow(setPromise,promise),promise},fluid.prefs.prefsEditor.save=function(that){var promise=fluid.promise();if(!that.model||$.isEmptyObject(that.model))promise.resolve({});else{var writePromise=that.write();fluid.promise.follow(writePromise,promise)}return promise},fluid.prefs.prefsEditor.saveAndApply=function(that){var promise=fluid.promise(),prevSettingsPromise=that.getSettings(),savePromise=that.save();return prevSettingsPromise.then(function(prevSettings){savePromise.then(function(changedSelections){fluid.model.diff(fluid.get(changedSelections,"preferences"),fluid.get(prevSettings,"preferences"))||(that.events.onPrefsEditorRefresh.fire(),that.applyChanges())}),fluid.promise.follow(savePromise,promise)}),promise},fluid.prefs.prefsEditor.reset=function(that){var transaction=that.applier.initiate();that.events.beforeReset.fire(that),transaction.fireChangeRequest({path:"preferences",type:"DELETE"}),transaction.change("",fluid.copy(that.initialModel)),transaction.commit(),that.events.onPrefsEditorRefresh.fire(),that.events.afterReset.fire(that)},fluid.prefs.prefsEditor.cancel=function(that){that.events.onCancel.fire(),that.fetch().then(function(){var transaction=that.applier.initiate();transaction.fireChangeRequest({path:"preferences",type:"DELETE"}),transaction.change("",that.model.remote),transaction.commit(),that.events.onPrefsEditorRefresh.fire()})},fluid.prefs.prefsEditor.finishInit=function(that){that.container.append(that.options.resources.template.resourceText),function(that){var saveButton=that.locate("save");if(0<saveButton.length){saveButton.click(that.saveAndApply);var form=fluid.findForm(saveButton);$(form).submit(function(){that.saveAndApply()})}that.locate("reset").click(that.reset),that.locate("cancel").click(that.cancel)}(that),that.fetch().then(function(){that.events.onPrefsEditorMarkupReady.fire(),that.events.onPrefsEditorRefresh.fire(),that.applyChanges(),that.events.onReady.fire(that)})},fluid.prefs.prefsEditor.handleAutoSave=function(that){that.options.autoSave&&that.events.onAutoSave.fire()},fluid.prefs.prefsEditor.init=function(that){setTimeout(function(){fluid.isDestroyed(that)||fluid.prefs.prefsEditor.finishInit(that)},1)},fluid.defaults("fluid.prefs.preview",{gradeNames:["fluid.viewComponent"],components:{enhancer:{type:"fluid.uiEnhancer",container:"{preview}.enhancerContainer",createOnEvent:"onReady"},templateLoader:"{templateLoader}"},invokers:{updateModel:{funcName:"fluid.prefs.preview.updateModel",args:["{preview}","{prefsEditor}.model.preferences"]}},events:{onReady:null},listeners:{"onCreate.startLoadingContainer":"fluid.prefs.preview.startLoadingContainer","{prefsEditor}.events.modelChanged":{listener:"{that}.updateModel",namespace:"updateModel"},"onReady.updateModel":"{that}.updateModel"},templateUrl:"%prefix/PrefsEditorPreview.html"}),fluid.prefs.preview.updateModel=function(that,preferences){setTimeout(function(){that.enhancer&&that.enhancer.updateModel(preferences)},0)},fluid.prefs.preview.startLoadingContainer=function(that){var templateUrl=that.templateLoader.transformURL(that.options.templateUrl);that.container.on("load",function(){that.enhancerContainer=$("body",that.container.contents()),that.events.onReady.fire()}),that.container.attr("src",templateUrl)}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.msgLookup",{gradeNames:["fluid.component"],members:{msgLookup:{expander:{funcName:"fluid.prefs.stringLookup",args:["{msgResolver}","{that}.options.stringArrayIndex"]}}},stringArrayIndex:{}}),fluid.prefs.stringLookup=function(messageResolver,stringArrayIndex){var that={id:fluid.allocateGuid(),singleLookup:function(value){var looked=messageResolver.lookup([value]);return fluid.get(looked,"template")},multiLookup:function(values){return fluid.transform(values,function(value){return that.singleLookup(value)})},lookup:function(value){var values=fluid.get(stringArrayIndex,value)||value,lookupFn=fluid.isArrayable(values)?"multiLookup":"singleLookup";return that[lookupFn](values)}};return that.resolvePathSegment=that.lookup,that},fluid.defaults("fluid.prefs.panel",{gradeNames:["fluid.prefs.msgLookup","fluid.rendererComponent"],events:{onDomBind:null},listeners:{"onCreate.onDomBind":"{that}.events.onDomBind"},components:{msgResolver:{type:"fluid.messageResolver"}},rendererOptions:{messageLocator:"{msgResolver}.resolve"},distributeOptions:{"panel.msgResolver.messageBase":{source:"{that}.options.messageBase",target:"{that > msgResolver}.options.messageBase"}}}),fluid.defaults("fluid.prefs.subPanel",{gradeNames:["fluid.prefs.panel","{that}.getDomBindGrade"],listeners:{"{compositePanel}.events.afterRender":{listener:"{that}.events.afterRender",args:["{that}"],namespce:"boilAfterRender"},"onCreate.onDomBind":null,"afterRender.onDomBind":"{that}.resetDomBinder"},rules:{expander:{func:"fluid.prefs.subPanel.generateRules",args:["{that}.options.preferenceMap"]}},invokers:{refreshView:"{compositePanel}.refreshView",resetDomBinder:{funcName:"fluid.prefs.subPanel.resetDomBinder",args:["{that}"]},getDomBindGrade:{funcName:"fluid.prefs.subPanel.getDomBindGrade",args:["{prefsEditor}"]}},strings:{},parentBundle:"{compositePanel}.messageResolver",renderOnInit:!1}),fluid.defaults("fluid.prefs.subPanel.domBind",{gradeNames:["fluid.component"],listeners:{"onDomBind.domChange":{listener:"{prefsEditor}.events.onSignificantDOMChange"}}}),fluid.prefs.subPanel.getDomBindGrade=function(prefsEditor){if(void 0!==fluid.get(prefsEditor,"options.events.onSignificantDOMChange"))return"fluid.prefs.subPanel.domBind"},fluid.prefs.subPanel.resetDomBinder=function(that){var userJQuery=that.container.constructor,context=that.container[0].ownerDocument,selector=that.container.selector;that.container=userJQuery(selector,context),that.container.selector=selector,that.container.context=context,0===that.container.length&&fluid.fail("resetDomBinder got no elements in DOM for container searching for selector "+that.container.selector),fluid.initDomBinder(that,that.options.selectors),that.events.onDomBind.fire(that)},fluid.prefs.subPanel.safePrefKey=function(prefKey){return prefKey.replace(/[.]/g,"_")},fluid.prefs.subPanel.generateRules=function(preferenceMap){var rules={};return fluid.each(preferenceMap,function(prefObj,prefKey){fluid.each(prefObj,function(value,prefRule){0===prefRule.indexOf("model.")&&(rules[fluid.prefs.subPanel.safePrefKey(prefKey)]=prefRule.slice("model.".length))})}),rules},fluid.registerNamespace("fluid.prefs.compositePanel"),fluid.prefs.compositePanel.arrayMergePolicy=function(target,source){return target=fluid.makeArray(target),source=fluid.makeArray(source),fluid.each(source,function(selector){target.indexOf(selector)<0&&target.push(selector)}),target},fluid.defaults("fluid.prefs.compositePanel",{gradeNames:["fluid.prefs.panel","{that}.getDistributeOptionsGrade","{that}.getSubPanelLifecycleBindings"],mergePolicy:{subPanelOverrides:"noexpand",selectorsToIgnore:fluid.prefs.compositePanel.arrayMergePolicy},selectors:{},selectorsToIgnore:[],repeatingSelectors:[],events:{initSubPanels:null},listeners:{"onCreate.combineResources":"{that}.combineResources","onCreate.appendTemplate":{this:"{that}.container",method:"append",args:["{that}.options.resources.template.resourceText"]},"onCreate.initSubPanels":"{that}.events.initSubPanels","onCreate.hideInactive":"{that}.hideInactive","afterRender.hideInactive":"{that}.hideInactive"},invokers:{getDistributeOptionsGrade:{funcName:"fluid.prefs.compositePanel.assembleDistributeOptions",args:["{that}.options.components"]},getSubPanelLifecycleBindings:{funcName:"fluid.prefs.compositePanel.subPanelLifecycleBindings",args:["{that}","{that}.options.components"]},combineResources:{funcName:"fluid.prefs.compositePanel.combineTemplates",args:["{that}.options.resources","{that}.options.selectors"]},produceSubPanelTrees:{funcName:"fluid.prefs.compositePanel.produceSubPanelTrees",args:["{that}"]},expandProtoTree:{funcName:"fluid.prefs.compositePanel.expandProtoTree",args:["{that}"]},produceTree:{funcName:"fluid.prefs.compositePanel.produceTree",args:["{that}"]},hideInactive:{funcName:"fluid.prefs.compositePanel.hideInactive",args:["{that}"]},handleRenderOnPreference:{funcName:"fluid.prefs.compositePanel.handleRenderOnPreference",args:["{that}","{that}.refreshView","{that}.conditionalCreateEvent","{arguments}.0","{arguments}.1","{arguments}.2"]},conditionalCreateEvent:{funcName:"fluid.prefs.compositePanel.conditionalCreateEvent"}},subPanelOverrides:{gradeNames:["fluid.prefs.subPanel"]},rendererFnOptions:{noexpand:!0,cutpointGenerator:"fluid.prefs.compositePanel.cutpointGenerator",subPanelRepeatingSelectors:{expander:{funcName:"fluid.prefs.compositePanel.surfaceRepeatingSelectors",args:["{that}.options.components"]}}},components:{},resources:{}}),fluid.prefs.compositePanel.prefetchComponentOptions=function(type,options){var baseOptions=fluid.getMergedDefaults(type,fluid.get(options,"gradeNames"));return fluid.merge(baseOptions.mergePolicy,fluid.copy(baseOptions),options)},fluid.prefs.compositePanel.isPanel=function(type,options){var opts=fluid.prefs.compositePanel.prefetchComponentOptions(type,options);return fluid.hasGrade(opts,"fluid.prefs.panel")},fluid.prefs.compositePanel.isActivePanel=function(comp){return comp&&fluid.hasGrade(comp.options,"fluid.prefs.panel")},fluid.prefs.compositePanel.assembleDistributeOptions=function(components){var gradeName="fluid.prefs.compositePanel.distributeOptions_"+fluid.allocateGuid(),distributeOptions={},relayOption={};return fluid.each(components,function(componentOptions,componentName){fluid.prefs.compositePanel.isPanel(componentOptions.type,componentOptions.options)&&(distributeOptions[componentName+".subPanelOverrides"]={source:"{that}.options.subPanelOverrides",target:"{that > "+componentName+"}.options"});var componentRelayRules={},definedOptions=fluid.prefs.compositePanel.prefetchComponentOptions(componentOptions.type,componentOptions.options),preferenceMap=fluid.get(definedOptions,["preferenceMap"]);fluid.each(preferenceMap,function(prefObj,prefKey){fluid.each(prefObj,function(value,prefRule){0===prefRule.indexOf("model.")&&fluid.set(componentRelayRules,prefRule.slice("model.".length),"{compositePanel}.model."+fluid.prefs.subPanel.safePrefKey(prefKey))})}),relayOption[componentName]=componentRelayRules,distributeOptions[componentName+".modelRelay"]={source:"{that}.options.relayOption."+componentName,target:"{that > "+componentName+"}.options.model"}}),fluid.defaults(gradeName,{relayOption:relayOption,distributeOptions:distributeOptions}),gradeName},fluid.prefs.compositePanel.conditionalCreateEvent=function(value,createEvent){value&&createEvent()},fluid.prefs.compositePanel.handleRenderOnPreference=function(that,refreshViewFunc,conditionalCreateEventFunc,value,createEvent,componentNames){componentNames=fluid.makeArray(componentNames),conditionalCreateEventFunc(value,createEvent),fluid.each(componentNames,function(componentName){var comp=that[componentName];!value&&comp&&comp.destroy()}),refreshViewFunc()},fluid.prefs.compositePanel.creationEventName=function(pref){return"initOn_"+pref},fluid.prefs.compositePanel.generateModelListeners=function(conditionals){return fluid.transform(conditionals,function(componentNames,pref){return{func:"{that}.handleRenderOnPreference",args:["{change}.value","{that}.events."+fluid.prefs.compositePanel.creationEventName(pref)+".fire",componentNames],namespace:"handleRenderOnPreference_"+pref}})},fluid.prefs.compositePanel.rebaseSelectorName=function(memberName,selectorName){return memberName+"_"+selectorName},fluid.prefs.compositePanel.rebaseSelector=function(compositePanelSelector,selector){return compositePanelSelector+" "+selector},fluid.prefs.compositePanel.subPanelLifecycleBindings=function(that,components){var gradeName="fluid.prefs.compositePanel.subPanelCreationTimingDistibution_"+fluid.allocateGuid(),distributeOptions={},subPanelCreationOpts={default:"initSubPanels"},conditionals={},listeners={},events={},selectors={};return fluid.each(components,function(componentOptions,componentName){if(fluid.prefs.compositePanel.isPanel(componentOptions.type,componentOptions.options)){var creationEventOpt="default",renderOnPreference=fluid.get(componentOptions,"options.renderOnPreference");if(renderOnPreference){var pref=fluid.prefs.subPanel.safePrefKey(renderOnPreference),onCreateListener="onCreate."+pref;creationEventOpt=fluid.prefs.compositePanel.creationEventName(pref),subPanelCreationOpts[creationEventOpt]=creationEventOpt,events[creationEventOpt]=null,conditionals[pref]=conditionals[pref]||[],conditionals[pref].push(componentName),listeners[onCreateListener]={listener:"{that}.conditionalCreateEvent",args:["{that}.model."+pref,"{that}.events."+creationEventOpt+".fire"]}}distributeOptions[componentName+".subPanelCreationOpts"]={source:"{that}.options.subPanelCreationOpts."+creationEventOpt,target:"{that}.options.components."+componentName+".createOnEvent"};var opts=fluid.prefs.compositePanel.prefetchComponentOptions(componentOptions.type,componentOptions.options);fluid.each(opts.selectors,function(selector,selName){(!opts.selectorsToIgnore||opts.selectorsToIgnore.indexOf(selName)<0)&&(selectors[fluid.prefs.compositePanel.rebaseSelectorName(componentName,selName)]={expander:{funcName:"fluid.prefs.compositePanel.rebaseSelector",args:["{that}.options.selectors."+componentName,selector]}})})}}),fluid.defaults(gradeName,{events:events,listeners:listeners,modelListeners:fluid.prefs.compositePanel.generateModelListeners(conditionals),subPanelCreationOpts:subPanelCreationOpts,distributeOptions:distributeOptions,selectors:selectors}),gradeName},fluid.prefs.compositePanel.hideInactive=function(that){fluid.each(that.options.components,function(componentOpts,componentName){fluid.prefs.compositePanel.isPanel(componentOpts.type,componentOpts.options)&&!fluid.prefs.compositePanel.isActivePanel(that[componentName])&&that.locate(componentName).hide()})},fluid.prefs.compositePanel.combineTemplates=function(resources,selectors){var cutpoints=[],tree={children:[]};fluid.each(resources,function(resource,resourceName){"template"!==resourceName&&(tree.children.push({ID:resourceName,markup:resource.resourceText}),cutpoints.push({id:resourceName,selector:selectors[resourceName]}))});var resourceSpec={base:{resourceText:resources.template.resourceText,href:".",resourceKey:".",cutpoints:cutpoints}},templates=fluid.parseTemplates(resourceSpec,["base"]),renderer=fluid.renderer(templates,tree,{cutpoints:cutpoints,debugMode:!0});resources.template.resourceText=renderer.renderTemplates()},fluid.prefs.compositePanel.surfaceRepeatingSelectors=function(components){var repeatingSelectors=[];return fluid.each(components,function(compOpts,compName){if(fluid.prefs.compositePanel.isPanel(compOpts.type,compOpts.options)){var opts=fluid.prefs.compositePanel.prefetchComponentOptions(compOpts.type,compOpts.options),rebasedRepeatingSelectors=fluid.transform(opts.repeatingSelectors,function(selector){return fluid.prefs.compositePanel.rebaseSelectorName(compName,selector)});repeatingSelectors=repeatingSelectors.concat(rebasedRepeatingSelectors)}}),repeatingSelectors},fluid.prefs.compositePanel.cutpointGenerator=function(selectors,options){var opts={selectorsToIgnore:options.selectorsToIgnore,repeatingSelectors:options.repeatingSelectors.concat(options.subPanelRepeatingSelectors)};return fluid.renderer.selectorsToCutpoints(selectors,opts)},fluid.prefs.compositePanel.rebaseID=function(value,memberName){return memberName+"_"+value},fluid.prefs.compositePanel.rebaseParentRelativeID=function(val,memberName){var slicePos="..::".length;return val.slice(0,slicePos)+fluid.prefs.compositePanel.rebaseID(val.slice(slicePos),memberName)},fluid.prefs.compositePanel.rebaseValueBinding=function(value,modelRelayRules){return fluid.find(modelRelayRules,function(oldModelPath,newModelPath){return value===oldModelPath?newModelPath:0===value.indexOf(oldModelPath)?value.replace(oldModelPath,newModelPath):void 0})||value},fluid.prefs.compositePanel.rebaseTreeComp=function(msgResolver,model,treeComp,memberName,modelRelayRules){var rebased=fluid.copy(treeComp);if(rebased.ID&&(rebased.ID=fluid.prefs.compositePanel.rebaseID(rebased.ID,memberName)),rebased.children)rebased.children=fluid.prefs.compositePanel.rebaseTree(msgResolver,model,rebased.children,memberName,modelRelayRules);else if(rebased.selection)rebased.selection=fluid.prefs.compositePanel.rebaseTreeComp(msgResolver,model,rebased.selection,memberName,modelRelayRules);else if(rebased.messagekey)rebased.componentType="UIBound",rebased.value=msgResolver.resolve(rebased.messagekey.value,rebased.messagekey.args),delete rebased.messagekey;else if(rebased.parentRelativeID)rebased.parentRelativeID=fluid.prefs.compositePanel.rebaseParentRelativeID(rebased.parentRelativeID,memberName);else if(rebased.valuebinding&&(rebased.valuebinding=fluid.prefs.compositePanel.rebaseValueBinding(rebased.valuebinding,modelRelayRules),rebased.value)){var modelValue=fluid.get(model,rebased.valuebinding);rebased.value=void 0!==modelValue?modelValue:rebased.value}return rebased},fluid.prefs.compositePanel.rebaseTree=function(msgResolver,model,tree,memberName,modelRelayRules){return fluid.isArrayable(tree)?fluid.transform(tree,function(treeComp){return fluid.prefs.compositePanel.rebaseTreeComp(msgResolver,model,treeComp,memberName,modelRelayRules)}):fluid.prefs.compositePanel.rebaseTreeComp(msgResolver,model,tree,memberName,modelRelayRules)},fluid.prefs.compositePanel.produceTree=function(that){var produceTreeOption=that.options.produceTree,ownTree=produceTreeOption?("string"==typeof produceTreeOption?fluid.getGlobalValue(produceTreeOption):produceTreeOption)(that):that.expandProtoTree(),subPanelTree=that.produceSubPanelTrees();return{children:ownTree.children.concat(subPanelTree.children)}},fluid.prefs.compositePanel.expandProtoTree=function(that){var expanderOptions=fluid.renderer.modeliseOptions(that.options.expanderOptions,{ELstyle:"${}"},that);return fluid.renderer.makeProtoExpander(expanderOptions,that)(that.options.protoTree||{})},fluid.prefs.compositePanel.produceSubPanelTrees=function(that){var tree={children:[]};return fluid.each(that.options.components,function(options,componentName){var subPanel=that[componentName];if(fluid.prefs.compositePanel.isActivePanel(subPanel)){var expanderOptions=fluid.renderer.modeliseOptions(subPanel.options.expanderOptions,{ELstyle:"${}"},subPanel),expander=fluid.renderer.makeProtoExpander(expanderOptions,subPanel),subTree=subPanel.produceTree();subTree=fluid.get(subPanel.options,"rendererFnOptions.noexpand")?subTree:expander(subTree);var rebasedTree=fluid.prefs.compositePanel.rebaseTree(subPanel.msgResolver,that.model,subTree,componentName,subPanel.options.rules);tree.children=tree.children.concat(rebasedTree.children)}}),tree},fluid.defaults("fluid.prefs.prefsEditorConnections",{gradeNames:["fluid.component"],listeners:{"{fluid.prefs.prefsEditor}.events.onPrefsEditorRefresh":"{fluid.prefs.panel}.refreshView"},strings:{},parentBundle:"{fluid.prefs.prefsEditorLoader}.msgResolver"}),fluid.defaults("fluid.prefs.panel.switchAdjuster",{gradeNames:["fluid.prefs.panel"],selectors:{header:".flc-prefsEditor-header",switchContainer:".flc-prefsEditor-switch",label:".flc-prefsEditor-label",description:".flc-prefsEditor-description"},selectorsToIgnore:["header","switchContainer"],components:{switchUI:{type:"fluid.switchUI",container:"{that}.dom.switchContainer",createOnEvent:"afterRender",options:{strings:{on:"{fluid.prefs.panel.switchAdjuster}.msgLookup.switchOn",off:"{fluid.prefs.panel.switchAdjuster}.msgLookup.switchOff"},model:{enabled:"{fluid.prefs.panel.switchAdjuster}.model.value"},attrs:{"aria-labelledby":{expander:{funcName:"fluid.allocateSimpleId",args:["{fluid.prefs.panel.switchAdjuster}.dom.description"]}}}}}},protoTree:{label:{messagekey:"label"},description:{messagekey:"description"}}}),fluid.defaults("fluid.prefs.panel.themePicker",{gradeNames:["fluid.prefs.panel"],mergePolicy:{"controlValues.theme":"replace","stringArrayIndex.theme":"replace"},controlValues:{theme:[]},stringArrayIndex:{theme:[]},selectID:"{that}.id",listeners:{"afterRender.style":"{that}.style"},selectors:{themeRow:".flc-prefsEditor-themeRow",themeLabel:".flc-prefsEditor-theme-label",themeInput:".flc-prefsEditor-themeInput",label:".flc-prefsEditor-themePicker-label",description:".flc-prefsEditor-themePicker-descr"},styles:{defaultThemeLabel:"fl-prefsEditor-themePicker-defaultThemeLabel"},repeatingSelectors:["themeRow"],protoTree:{label:{messagekey:"label"},description:{messagekey:"description"},expander:{type:"fluid.renderer.selection.inputs",rowID:"themeRow",labelID:"themeLabel",inputID:"themeInput",selectID:"{that}.options.selectID",tree:{optionnames:"${{that}.msgLookup.theme}",optionlist:"${{that}.options.controlValues.theme}",selection:"${value}"}}},markup:{label:'<span class="fl-preview-A" aria-hidden="true"></span><span class="fl-hidden-accessible">%theme</span><div class="fl-crossout" aria-hidden="true"></div>'},invokers:{style:{funcName:"fluid.prefs.panel.themePicker.style",args:["{that}.dom.themeLabel","{that}.msgLookup.theme","{that}.options.markup.label","{that}.options.controlValues.theme","default","{that}.options.classnameMap.theme","{that}.options.styles.defaultThemeLabel"]}}}),fluid.prefs.panel.themePicker.style=function(labels,strings,markup,theme,defaultThemeName,style,defaultLabelStyle){fluid.each(labels,function(label,index){label=$(label);var themeValue=strings[index];label.html(fluid.stringTemplate(markup,{theme:themeValue})),label.attr("aria-label",themeValue);var labelTheme=theme[index];labelTheme===defaultThemeName&&label.addClass(defaultLabelStyle),label.addClass(style[labelTheme])})},fluid.defaults("fluid.prefs.panel.stepperAdjuster",{gradeNames:["fluid.prefs.panel"],selectors:{header:".flc-prefsEditor-header",textfieldStepperContainer:".flc-prefsEditor-textfieldStepper",label:".flc-prefsEditor-label",descr:".flc-prefsEditor-descr"},selectorsToIgnore:["header","textfieldStepperContainer"],components:{textfieldStepper:{type:"fluid.textfieldStepper",container:"{that}.dom.textfieldStepperContainer",createOnEvent:"afterRender",options:{model:{value:"{fluid.prefs.panel.stepperAdjuster}.model.value",range:{min:"{fluid.prefs.panel.stepperAdjuster}.options.range.min",max:"{fluid.prefs.panel.stepperAdjuster}.options.range.max"},step:"{fluid.prefs.panel.stepperAdjuster}.options.step"},scale:1,strings:{increaseLabel:"{fluid.prefs.panel.stepperAdjuster}.msgLookup.increaseLabel",decreaseLabel:"{fluid.prefs.panel.stepperAdjuster}.msgLookup.decreaseLabel"},attrs:{"aria-labelledby":"{fluid.prefs.panel.stepperAdjuster}.options.panelOptions.labelId"}}}},protoTree:{label:{messagekey:"label",decorators:{attrs:{id:"{that}.options.panelOptions.labelId"}}},descr:{messagekey:"description"}},panelOptions:{labelIdTemplate:"%guid",labelId:{expander:{funcName:"fluid.prefs.panel.stepperAdjuster.setLabelID",args:["{that}.options.panelOptions.labelIdTemplate"]}}}}),fluid.prefs.panel.stepperAdjuster.setLabelID=function(template){return fluid.stringTemplate(template,{guid:fluid.allocateGuid()})},fluid.defaults("fluid.prefs.panel.textSize",{gradeNames:["fluid.prefs.panel.stepperAdjuster"],preferenceMap:{"fluid.prefs.textSize":{"model.value":"value","range.min":"minimum","range.max":"maximum",step:"multipleOf"}},panelOptions:{labelIdTemplate:"textSize-label-%guid"}}),fluid.defaults("fluid.prefs.panel.textFont",{gradeNames:["fluid.prefs.panel"],preferenceMap:{"fluid.prefs.textFont":{"model.value":"value","controlValues.textFont":"enum","stringArrayIndex.textFont":"enumLabels"}},mergePolicy:{"controlValues.textFont":"replace","stringArrayIndex.textFont":"replace"},selectors:{header:".flc-prefsEditor-text-font-header",textFont:".flc-prefsEditor-text-font",label:".flc-prefsEditor-text-font-label",textFontDescr:".flc-prefsEditor-text-font-descr"},selectorsToIgnore:["header"],protoTree:{label:{messagekey:"textFontLabel"},textFontDescr:{messagekey:"textFontDescr"},textFont:{optionnames:"${{that}.msgLookup.textFont}",optionlist:"${{that}.options.controlValues.textFont}",selection:"${value}",decorators:{type:"fluid",func:"fluid.prefs.selectDecorator",options:{styles:"{that}.options.classnameMap.textFont"}}}},classnameMap:null}),fluid.defaults("fluid.prefs.panel.lineSpace",{gradeNames:["fluid.prefs.panel.stepperAdjuster"],preferenceMap:{"fluid.prefs.lineSpace":{"model.value":"value","range.min":"minimum","range.max":"maximum",step:"multipleOf"}},panelOptions:{labelIdTemplate:"lineSpace-label-%guid"}}),fluid.defaults("fluid.prefs.panel.contrast",{gradeNames:["fluid.prefs.panel.themePicker"],preferenceMap:{"fluid.prefs.contrast":{"model.value":"value","controlValues.theme":"enum","stringArrayIndex.theme":"enumLabels"}},listeners:{"afterRender.style":"{that}.style"},selectors:{header:".flc-prefsEditor-contrast-header",themeRow:".flc-prefsEditor-themeRow",themeLabel:".flc-prefsEditor-theme-label",themeInput:".flc-prefsEditor-themeInput",label:".flc-prefsEditor-themePicker-label",contrastDescr:".flc-prefsEditor-themePicker-descr"},selectorsToIgnore:["header"],styles:{defaultThemeLabel:"fl-prefsEditor-themePicker-defaultThemeLabel"}}),fluid.defaults("fluid.prefs.panel.layoutControls",{gradeNames:["fluid.prefs.panel.switchAdjuster"],preferenceMap:{"fluid.prefs.tableOfContents":{"model.value":"value"}}}),fluid.defaults("fluid.prefs.panel.enhanceInputs",{gradeNames:["fluid.prefs.panel.switchAdjuster"],preferenceMap:{"fluid.prefs.enhanceInputs":{"model.value":"value"}}}),fluid.defaults("fluid.prefs.selectDecorator",{gradeNames:["fluid.viewComponent"],listeners:{"onCreate.decorateOptions":"fluid.prefs.selectDecorator.decorateOptions"},styles:{preview:"fl-preview-theme"}}),fluid.prefs.selectDecorator.decorateOptions=function(that){fluid.each($("option",that.container),function(option){var styles=that.options.styles;$(option).addClass(styles.preview+" "+styles[fluid.value(option)])})}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid_3_0_0.defaults("fluid.prefs.panel.captions",{gradeNames:["fluid.prefs.panel.switchAdjuster"],preferenceMap:{"fluid.prefs.captions":{"model.value":"value"}}})}(jQuery);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid_3_0_0.defaults("fluid.prefs.panel.letterSpace",{gradeNames:["fluid.prefs.panel.stepperAdjuster"],preferenceMap:{"fluid.prefs.letterSpace":{"model.value":"value","range.min":"minimum","range.max":"maximum",step:"multipleOf"}},panelOptions:{labelIdTemplate:"letterSpace-label-%guid"}})}(jQuery);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid_3_0_0.defaults("fluid.prefs.panel.speak",{gradeNames:["fluid.prefs.panel.switchAdjuster"],preferenceMap:{"fluid.prefs.speak":{"model.value":"value"}}})}(jQuery);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid_3_0_0.defaults("fluid.prefs.panel.syllabification",{gradeNames:["fluid.prefs.panel.switchAdjuster"],preferenceMap:{"fluid.prefs.syllabification":{"model.value":"value"}}})}(jQuery);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid_3_0_0.defaults("fluid.prefs.panel.localization",{gradeNames:["fluid.prefs.panel"],preferenceMap:{"fluid.prefs.localization":{"model.value":"value","controlValues.localization":"enum","stringArrayIndex.localization":"enumLabels"}},mergePolicy:{"controlValues.localization":"replace","stringArrayIndex.localization":"replace"},selectors:{header:".flc-prefsEditor-localization-header",localization:".flc-prefsEditor-localization",label:".flc-prefsEditor-localization-label",localizationDescr:".flc-prefsEditor-localization-descr"},selectorsToIgnore:["header"],protoTree:{label:{messagekey:"label"},localizationDescr:{messagekey:"description"},localization:{optionnames:"${{that}.msgLookup.localization}",optionlist:"${{that}.options.controlValues.localization}",selection:"${value}"}}})}(jQuery);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid_3_0_0.defaults("fluid.prefs.panel.wordSpace",{gradeNames:["fluid.prefs.panel.stepperAdjuster"],preferenceMap:{"fluid.prefs.wordSpace":{"model.value":"value","range.min":"minimum","range.max":"maximum",step:"multipleOf"}},panelOptions:{labelIdTemplate:"wordSpace-label-%guid"}})}(jQuery);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.enactor",{gradeNames:["fluid.modelComponent"]}),fluid.defaults("fluid.prefs.enactor.styleElements",{gradeNames:["fluid.prefs.enactor"],cssClass:null,elementsToStyle:null,invokers:{applyStyle:{funcName:"fluid.prefs.enactor.styleElements.applyStyle",args:["{arguments}.0","{arguments}.1"]},resetStyle:{funcName:"fluid.prefs.enactor.styleElements.resetStyle",args:["{arguments}.0","{arguments}.1"]},handleStyle:{funcName:"fluid.prefs.enactor.styleElements.handleStyle",args:["{arguments}.0","{that}.options.elementsToStyle","{that}.options.cssClass","{that}.applyStyle","{that}.resetStyle"]}},modelListeners:{value:{listener:"{that}.handleStyle",args:["{change}.value"],namespace:"handleStyle"}}}),fluid.prefs.enactor.styleElements.applyStyle=function(elements,cssClass){elements.addClass(cssClass)},fluid.prefs.enactor.styleElements.resetStyle=function(elements,cssClass){$(elements,"."+cssClass).addBack().removeClass(cssClass)},fluid.prefs.enactor.styleElements.handleStyle=function(value,elements,cssClass,applyStyleFunc,resetStyleFunc){(value?applyStyleFunc:resetStyleFunc)(elements,cssClass)},fluid.defaults("fluid.prefs.enactor.classSwapper",{gradeNames:["fluid.prefs.enactor","fluid.viewComponent"],classes:{},invokers:{clearClasses:{funcName:"fluid.prefs.enactor.classSwapper.clearClasses",args:["{that}.container","{that}.classStr"]},swap:{funcName:"fluid.prefs.enactor.classSwapper.swap",args:["{arguments}.0","{that}","{that}.clearClasses"]}},modelListeners:{value:{listener:"{that}.swap",args:["{change}.value"],namespace:"swapClass"}},members:{classStr:{expander:{func:"fluid.prefs.enactor.classSwapper.joinClassStr",args:"{that}.options.classes"}}}}),fluid.prefs.enactor.classSwapper.clearClasses=function(container,classStr){container.removeClass(classStr)},fluid.prefs.enactor.classSwapper.swap=function(value,that,clearClassesFunc){clearClassesFunc(),that.container.addClass(that.options.classes[value])},fluid.prefs.enactor.classSwapper.joinClassStr=function(classes){var classStr="";return fluid.each(classes,function(oneClassName){oneClassName&&(classStr+=classStr?" "+oneClassName:oneClassName)}),classStr},fluid.defaults("fluid.prefs.enactor.enhanceInputs",{gradeNames:["fluid.prefs.enactor.styleElements","fluid.viewComponent"],preferenceMap:{"fluid.prefs.enhanceInputs":{"model.value":"value"}},cssClass:null,elementsToStyle:"{that}.container"}),fluid.defaults("fluid.prefs.enactor.textFont",{gradeNames:["fluid.prefs.enactor.classSwapper"],preferenceMap:{"fluid.prefs.textFont":{"model.value":"value"}}}),fluid.defaults("fluid.prefs.enactor.contrast",{gradeNames:["fluid.prefs.enactor.classSwapper"],preferenceMap:{"fluid.prefs.contrast":{"model.value":"value"}}}),fluid.prefs.enactor.getTextSizeInPx=function(container,fontSizeMap){var fontSize=container.css("font-size");return fontSizeMap[fontSize]&&(fontSize=fontSizeMap[fontSize]),parseFloat(fontSize)},fluid.defaults("fluid.prefs.enactor.textRelatedSizer",{gradeNames:["fluid.prefs.enactor","fluid.viewComponent"],fontSizeMap:{},invokers:{set:"fluid.notImplemented",getTextSizeInPx:{funcName:"fluid.prefs.enactor.getTextSizeInPx",args:["{that}.container","{that}.options.fontSizeMap"]}},modelListeners:{value:{listener:"{that}.set",args:["{change}.value"],namespace:"setAdaptation"}}}),fluid.defaults("fluid.prefs.enactor.spacingSetter",{gradeNames:["fluid.prefs.enactor.textRelatedSizer"],members:{originalSpacing:{expander:{func:"{that}.getSpacing"}}},cssProp:"",invokers:{set:{funcName:"fluid.prefs.enactor.spacingSetter.set",args:["{that}","{that}.options.cssProp","{arguments}.0"]},getSpacing:{funcName:"fluid.prefs.enactor.spacingSetter.getSpacing",args:["{that}","{that}.options.cssProp","{that}.getTextSizeInPx"]}},modelListeners:{unit:{listener:"{that}.set",args:["{change}.value"],namespace:"setAdaptation"},value:{listener:"fluid.identity",namespace:"setAdaptation"}},modelRelay:{target:"unit",namespace:"toUnit",singleTransform:{type:"fluid.transforms.round",scale:1,input:{transform:{type:"fluid.transforms.linearScale",offset:-1,input:"{that}.model.value"}}}}}),fluid.prefs.enactor.spacingSetter.getSpacing=function(that,cssProp,getTextSizeFn){var current=parseFloat(that.container.css(cssProp)),textSize=getTextSizeFn();return fluid.roundToDecimal(current/textSize,2)},fluid.prefs.enactor.spacingSetter.set=function(that,cssProp,units){var targetSize=that.originalSpacing;units&&(targetSize+=units);var spacingSetter=targetSize?fluid.roundToDecimal(targetSize,2)+"em":"";that.container.css(cssProp,spacingSetter)},fluid.defaults("fluid.prefs.enactor.textSize",{gradeNames:["fluid.prefs.enactor.textRelatedSizer"],preferenceMap:{"fluid.prefs.textSize":{"model.value":"value"}},members:{root:{expander:{this:"{that}.container",method:"closest",args:["html"]}}},invokers:{set:{funcName:"fluid.prefs.enactor.textSize.set",args:["{arguments}.0","{that}","{that}.getTextSizeInPx"]},getTextSizeInPx:{args:["{that}.root","{that}.options.fontSizeMap"]}}}),fluid.prefs.enactor.textSize.set=function(times,that,getTextSizeInPxFunc){if(times=times||1,that.initialSize||(that.initialSize=getTextSizeInPxFunc()),that.initialSize){var targetSize=times*that.initialSize;that.root.css("font-size",targetSize+"px")}},fluid.defaults("fluid.prefs.enactor.lineSpace",{gradeNames:["fluid.prefs.enactor.textRelatedSizer"],preferenceMap:{"fluid.prefs.lineSpace":{"model.value":"value"}},invokers:{set:{funcName:"fluid.prefs.enactor.lineSpace.set",args:["{that}","{arguments}.0"]},getLineHeight:{funcName:"fluid.prefs.enactor.lineSpace.getLineHeight",args:"{that}.container"},getLineHeightMultiplier:{funcName:"fluid.prefs.enactor.lineSpace.getLineHeightMultiplier",args:[{expander:{func:"{that}.getLineHeight"}},{expander:{func:"{that}.getTextSizeInPx"}}]}}}),fluid.prefs.enactor.lineSpace.getLineHeight=function(container){return container.css("line-height")},fluid.prefs.enactor.lineSpace.getLineHeightMultiplier=function(lineHeight,fontSize){return lineHeight?"normal"===lineHeight?1.2:lineHeight.match(/[0-9]$/)?Number(lineHeight):fluid.roundToDecimal(parseFloat(lineHeight)/fontSize,2):0},fluid.prefs.enactor.lineSpace.set=function(that,times){if(that.initialSize||(that.initialSize=that.getLineHeight(),that.lineHeightMultiplier=that.getLineHeightMultiplier()),that.lineHeightMultiplier){var targetLineSpace="normal"===that.initialSize&&1===times?that.initialSize:times*that.lineHeightMultiplier;that.container.css("line-height",targetLineSpace)}},fluid.defaults("fluid.prefs.enactor.tableOfContents",{gradeNames:["fluid.prefs.enactor","fluid.viewComponent"],preferenceMap:{"fluid.prefs.tableOfContents":{"model.toc":"value"}},tocTemplate:null,tocMessage:null,components:{messageLoader:{type:"fluid.resourceLoader",options:{resourceOptions:{dataType:"json"},events:{onResourcesLoaded:"{fluid.prefs.enactor.tableOfContents}.events.onMessagesLoaded"}}},tableOfContents:{type:"fluid.tableOfContents",container:"{fluid.prefs.enactor.tableOfContents}.container",createOnEvent:"onCreateTOCReady",options:{listeners:{"afterRender.boilAfterTocRender":"{fluid.prefs.enactor.tableOfContents}.events.afterTocRender"},strings:{tocHeader:"{messageLoader}.resources.tocMessage.resourceText.tocHeader"}}}},invokers:{applyToc:{funcName:"fluid.prefs.enactor.tableOfContents.applyToc",args:["{arguments}.0","{that}"]}},events:{afterTocRender:null,onCreateTOC:null,onMessagesLoaded:null,onCreateTOCReady:{events:{onCreateTOC:"onCreateTOC",onMessagesLoaded:"onMessagesLoaded"}}},modelListeners:{toc:{listener:"{that}.applyToc",args:["{change}.value"],namespace:"toggleToc"}},distributeOptions:{"tocEnactor.tableOfContents.ignoreForToC":{source:"{that}.options.ignoreForToC",target:"{that tableOfContents}.options.ignoreForToC"},"tocEnactor.tableOfContents.tocTemplate":{source:"{that}.options.tocTemplate",target:"{that > tableOfContents > levels}.options.resources.template.url"},"tocEnactor.messageLoader.tocMessage":{source:"{that}.options.tocMessage",target:"{that messageLoader}.options.resources.tocMessage"}}}),fluid.prefs.enactor.tableOfContents.applyToc=function(value,that){value?that.tableOfContents?that.tableOfContents.show():that.events.onCreateTOC.fire():that.tableOfContents&&that.tableOfContents.hide()}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.enactor.captions",{gradeNames:["fluid.prefs.enactor","fluid.viewComponent"],preferenceMap:{"fluid.prefs.captions":{"model.enabled":"value"}},events:{onVideoElementLocated:null},selectors:{videos:'iframe[src^="https://www.youtube.com/embed/"]'},model:{enabled:!1},components:{ytAPI:{type:"fluid.prefs.enactor.captions.ytAPI"}},dynamicComponents:{player:{type:"fluid.prefs.enactor.captions.youTubePlayer",createOnEvent:"onVideoElementLocated",container:"{arguments}.0",options:{model:{captions:"{captions}.model.enabled"}}}},listeners:{"onCreate.initPlayers":"{that}.initPlayers"},invokers:{initPlayers:{funcName:"fluid.prefs.enactor.captions.initPlayers",args:["{that}","{ytAPI}.notifyWhenLoaded","{that}.dom.videos"]}}}),fluid.prefs.enactor.captions.initPlayers=function(that,getYtApi,videos){var promise=fluid.promise(),ytAPINotice=getYtApi();return promise.then(function(){$(videos).each(function(index,elm){that.events.onVideoElementLocated.fire($(elm))})}),fluid.promise.follow(ytAPINotice,promise),promise},fluid.defaults("fluid.prefs.enactor.captions.ytAPI",{gradeNames:["fluid.component","fluid.resolveRootSingle"],singleRootType:"fluid.prefs.enactor.captions.window",events:{onYouTubeAPILoaded:null},members:{global:window},invokers:{notifyWhenLoaded:{funcName:"fluid.prefs.enactor.captions.ytAPI.notifyWhenLoaded",args:["{that}"]}}}),fluid.prefs.enactor.captions.ytAPI.notifyWhenLoaded=function(that){var promise=fluid.promise();return promise.then(function(){that.events.onYouTubeAPILoaded.fire()},function(error){fluid.log(fluid.logLevel.WARN,error)}),fluid.get(window,["YT","Player"])?promise.resolve():fluid.set(that.global,"onYouTubeIframeAPIReady",promise.resolve),promise},fluid.defaults("fluid.prefs.enactor.captions.youTubePlayer",{gradeNames:["fluid.viewComponent"],events:{onReady:null,onStateChange:null,onPlaybackQualityChange:null,onPlaybackRateChange:null,onError:null,onApiChange:null},model:{captions:!1,track:{}},members:{player:{expander:{funcName:"fluid.prefs.enactor.captions.youTubePlayer.initYTPlayer",args:["{that}"]}},tracklist:[]},invokers:{applyCaptions:{funcName:"fluid.prefs.enactor.captions.youTubePlayer.applyCaptions",args:["{that}.player","{that}.model.track","{that}.model.captions"]}},modelListeners:{setCaptions:{listener:"{that}.applyCaptions",path:["captions","track"],excludeSource:"init"}},listeners:{"onApiChange.prepTrack":{listener:"fluid.prefs.enactor.captions.youTubePlayer.prepTrack",args:["{that}","{that}.player"]},"onApiChange.applyCaptions":{listener:"{that}.applyCaptions",priority:"after:prepTrack"}}}),fluid.prefs.enactor.captions.youTubePlayer.enableJSAPI=function(videoElm){videoElm=$(videoElm);var url=new URL(videoElm.attr("src"));url.searchParams.set("enablejsapi",1),videoElm.attr("src",url.toString())},fluid.prefs.enactor.captions.youTubePlayer.initYTPlayer=function(that){var id=fluid.allocateSimpleId(that.container);return fluid.prefs.enactor.captions.youTubePlayer.enableJSAPI(that.container),new YT.Player(id,{events:{onReady:that.events.onReady.fire,onStateChange:that.events.onStateChange.fire,onPlaybackQualityChange:that.events.onPlaybackQualityChange.fire,onPlaybackRateChange:that.events.onPlaybackRateChange.fire,onError:that.events.onError.fire,onApiChange:that.events.onApiChange.fire}})},fluid.prefs.enactor.captions.youTubePlayer.applyCaptions=function(player,track,state){player.loadModule&&(state?(player.loadModule("captions"),player.setOption("captions","track",track)):player.unloadModule("captions"))},fluid.prefs.enactor.captions.youTubePlayer.prepTrack=function(that,player){player.loadModule("captions");var tracklist=player.getOption("captions","tracklist");tracklist.length&&!that.tracklist.length&&(that.tracklist=tracklist,that.applier.change("track",tracklist[0],"ADD","prepTrack"))}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid_3_0_0.defaults("fluid.prefs.enactor.letterSpace",{gradeNames:["fluid.prefs.enactor.spacingSetter"],preferenceMap:{"fluid.prefs.letterSpace":{"model.value":"value"}},cssProp:"letter-spacing"})}(jQuery);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.enactor.selfVoicing",{gradeNames:["fluid.prefs.enactor","fluid.viewComponent"],preferenceMap:{"fluid.prefs.speak":{"model.enabled":"value"}},selectors:{controller:".flc-prefs-selfVoicingWidget"},events:{onInitOrator:null},modelListeners:{enabled:{funcName:"fluid.prefs.enactor.selfVoicing.initOrator",args:["{that}","{change}.value"],namespace:"initOrator"}},components:{orator:{type:"fluid.orator",createOnEvent:"onInitOrator",container:"{fluid.prefs.enactor.selfVoicing}.container",options:{model:{enabled:"{selfVoicing}.model.enabled"},controller:{parentContainer:"{fluid.prefs.enactor.selfVoicing}.dom.controller"}}}},distributeOptions:[{source:"{that}.options.orator",target:"{that > orator}.options",removeSource:!0,namespace:"oratorOpts"}]}),fluid.prefs.enactor.selfVoicing.initOrator=function(that,enabled){enabled&&!that.orator&&that.events.onInitOrator.fire()}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.enactor.syllabification",{gradeNames:["fluid.prefs.enactor","fluid.prefs.enactor.syllabification.patterns","fluid.viewComponent"],preferenceMap:{"fluid.prefs.syllabification":{"model.enabled":"value"}},selectors:{separator:".flc-syllabification-separator"},strings:{languageUnavailable:"Syllabification not available for %lang",patternLoadError:"The pattern file %src could not be loaded. %errorMsg"},markup:{separator:'<span class="flc-syllabification-separator fl-syllabification-separator"></span>'},model:{enabled:!1},events:{afterParse:null,afterSyllabification:null,onParsedTextNode:null,onNodeAdded:null,onError:null},listeners:{"afterParse.waitForHyphenators":{listener:"fluid.prefs.enactor.syllabification.waitForHyphenators",args:["{that}"]},"onParsedTextNode.syllabify":{listener:"{that}.apply",args:["{arguments}.0.node","{arguments}.0.lang"]},"onNodeAdded.syllabify":{listener:"{that}.parse",args:["{arguments}.0","{that}.model.enabled"]}},components:{parser:{type:"fluid.textNodeParser",options:{listeners:{"afterParse.boil":"{syllabification}.events.afterParse","onParsedTextNode.boil":"{syllabification}.events.onParsedTextNode"},invokers:{hasTextToRead:{funcName:"fluid.textNodeParser.hasTextToRead",args:["{arguments}.0",!0]}}}},observer:{type:"fluid.mutationObserver",container:"{that}.container",options:{defaultObserveConfig:{attributes:!1},modelListeners:{"{syllabification}.model.enabled":{funcName:"fluid.prefs.enactor.syllabification.disconnectObserver",priority:"before:setPresentation",args:["{that}","{change}.value"],namespace:"disconnectObserver"}},listeners:{"onNodeAdded.boil":"{syllabification}.events.onNodeAdded","{syllabification}.events.afterSyllabification":{listener:"{that}.observe",namespace:"enableObserver"}}}}},members:{hyphenators:{}},modelListeners:{enabled:{listener:"{that}.setPresentation",args:["{that}.container","{change}.value"],namespace:"setPresentation"}},invokers:{apply:{funcName:"fluid.prefs.enactor.syllabification.syllabify",args:["{that}","{arguments}.0","{arguments}.1"]},remove:{funcName:"fluid.prefs.enactor.syllabification.removeSyllabification",args:["{that}"]},setPresentation:{funcName:"fluid.prefs.enactor.syllabification.setPresentation",args:["{that}","{arguments}.0","{arguments}.1"]},parse:{funcName:"fluid.prefs.enactor.syllabification.parse",args:["{that}","{arguments}.0"]},createHyphenator:{funcName:"fluid.prefs.enactor.syllabification.createHyphenator",args:["{that}","{arguments}.0","{arguments}.1"]},getHyphenator:{funcName:"fluid.prefs.enactor.syllabification.getHyphenator",args:["{that}","{arguments}.0"]},getPattern:"fluid.prefs.enactor.syllabification.getPattern",hyphenateNode:{funcName:"fluid.prefs.enactor.syllabification.hyphenateNode",args:["{arguments}.0","{arguments}.1","{that}.options.markup.separator"]},injectScript:{this:"$",method:"ajax",args:[{url:"{arguments}.0",dataType:"script",cache:!0}]}}}),fluid.prefs.enactor.syllabification.disconnectObserver=function(that,state){state||that.disconnect()},fluid.prefs.enactor.syllabification.waitForHyphenators=function(that){var hyphenatorPromises=fluid.values(that.hyphenators),promise=fluid.promise.sequence(hyphenatorPromises);return promise.then(function(){that.events.afterSyllabification.fire()},that.events.onError.fire),promise},fluid.prefs.enactor.syllabification.parse=function(that,elm){elm=(elm=fluid.unwrap(elm)).nodeType===Node.ELEMENT_NODE?$(elm):$(elm.parentNode),that.parser.parse(elm)},fluid.prefs.enactor.syllabification.createHyphenator=function(that,pattern,lang){var promise=fluid.promise(),globalPath=["Hypher","languages",lang],hyphenator=fluid.getGlobalValue(globalPath);if(hyphenator)return promise.resolve(hyphenator),promise;var src=fluid.stringTemplate(pattern,that.options.terms);return that.injectScript(src).then(function(){hyphenator=fluid.getGlobalValue(globalPath),promise.resolve(hyphenator)},function(error){var errorInfo={src:src,errorMsg:"string"==typeof error?error:""},errorMessage=fluid.stringTemplate(that.options.strings.patternLoadError,errorInfo);fluid.log(fluid.logLevel.WARN,errorMessage,error),that.events.onError.fire(errorMessage,error),promise.resolve()}),promise},fluid.prefs.enactor.syllabification.getPattern=function(lang,patterns){var src=patterns[lang];return src||(src=patterns[lang=lang.split("-")[0]]),{lang:lang,src:src}},fluid.prefs.enactor.syllabification.getHyphenator=function(that,lang){var hyphenatorPromise,promise=fluid.promise();if(!lang)return promise.resolve(),promise;var pattern=that.getPattern(lang.toLowerCase(),that.options.patterns);return pattern.src?that.hyphenators[pattern.src]?that.hyphenators[pattern.src]:(hyphenatorPromise=that.createHyphenator(pattern.src,pattern.lang),fluid.promise.follow(hyphenatorPromise,promise),that.hyphenators[pattern.src]=hyphenatorPromise,promise):((hyphenatorPromise=promise).resolve(),promise)},fluid.prefs.enactor.syllabification.syllabify=function(that,node,lang){that.getHyphenator(lang).then(function(hyphenator){that.hyphenateNode(hyphenator,node)})},fluid.prefs.enactor.syllabification.hyphenateNode=function(hyphenator,node,separatorMarkup){if(hyphenator){var segs=hyphenator.hyphenateText(node.textContent).replace(/\u200B/gi,"").split("");segs.pop(),fluid.each(segs,function(seg){var separator=$(separatorMarkup)[0];(node=node.splitText(seg.length)).parentNode.insertBefore(separator,node)})}},fluid.prefs.enactor.syllabification.normalize=function(elm){for(var childNode=(elm=fluid.unwrap(elm)).childNodes[0];childNode&&childNode.nextSibling;){var nextSibling=childNode.nextSibling;childNode.nodeType===Node.TEXT_NODE&&nextSibling.nodeType===Node.TEXT_NODE?(childNode.textContent+=nextSibling.textContent,elm.removeChild(nextSibling)):childNode=nextSibling}},fluid.prefs.enactor.syllabification.removeSyllabification=function(that){that.locate("separator").each(function(index,elm){var parent=elm.parentNode;$(elm).remove(),fluid.prefs.enactor.syllabification.normalize(parent)})},fluid.prefs.enactor.syllabification.setPresentation=function(that,elm,state){state?that.parse(elm):that.remove()},fluid.defaults("fluid.prefs.enactor.syllabification.patterns",{terms:{patternPrefix:"../../../lib/hypher/patterns"},patterns:{be:"%patternPrefix/bg.js",bn:"%patternPrefix/bn.js",ca:"%patternPrefix/ca.js",cs:"%patternPrefix/cs.js",da:"%patternPrefix/da.js",de:"%patternPrefix/de.js",el:"%patternPrefix/el-monoton.js","el-monoton":"%patternPrefix/el-monoton.js","el-polyton":"%patternPrefix/el-polyton.js",en:"%patternPrefix/en-us.js","en-gb":"%patternPrefix/en-gb.js","en-us":"%patternPrefix/en-us.js",es:"%patternPrefix/es.js",fi:"%patternPrefix/fi.js",fr:"%patternPrefix/fr.js",grc:"%patternPrefix/grc.js",gu:"%patternPrefix/gu.js",hi:"%patternPrefix/hi.js",hu:"%patternPrefix/hu.js",hy:"%patternPrefix/hy.js",is:"%patternPrefix/is.js",it:"%patternPrefix/it.js",kn:"%patternPrefix/kn.js",la:"%patternPrefix/la.js",lt:"%patternPrefix/lt.js",lv:"%patternPrefix/lv.js",ml:"%patternPrefix/ml.js",nb:"%patternPrefix/nb-no.js","nb-no":"%patternPrefix/nb-no.js",no:"%patternPrefix/nb-no.js",nl:"%patternPrefix/nl.js",or:"%patternPrefix/or.js",pa:"%patternPrefix/pa.js",pl:"%patternPrefix/pl.js",pt:"%patternPrefix/pt.js",ru:"%patternPrefix/ru.js",sk:"%patternPrefix/sk.js",sl:"%patternPrefix/sl.js",sv:"%patternPrefix/sv.js",ta:"%patternPrefix/ta.js",te:"%patternPrefix/te.js",tr:"%patternPrefix/tr.js",uk:"%patternPrefix/uk.js"}})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.enactor.localization",{gradeNames:["fluid.prefs.enactor","fluid.contextAware","fluid.resolveRoot"],preferenceMap:{"fluid.prefs.localization":{"model.lang":"value"}},contextAwareness:{localeChange:{checks:{inPanel:{contextValue:"{iframeRenderer}.id",gradeNames:"fluid.prefs.enactor.localization.inPanel"},urlPath:{contextValue:"{localization}.options.localizationScheme",equals:"urlPath",gradeNames:"fluid.prefs.enactor.localization.urlPathLocale",priority:"after:inPanel"}}}}}),fluid.defaults("fluid.prefs.enactor.localization.urlPathLocale",{langMap:{},langSegValues:{expander:{funcName:"fluid.values",args:["{that}.options.langMap"]}},modelRelay:[{target:"urlLangSeg",singleTransform:{type:"fluid.transforms.valueMapper",defaultInput:"{that}.model.lang",match:"{that}.options.langMap"}}],modelListeners:{urlLangSeg:{funcName:"{that}.updatePathname",args:["{change}.value"],namespace:"updateURLPathname"}},invokers:{updatePathname:{funcName:"fluid.prefs.enactor.localization.urlPathLocale.updatePathname",args:["{that}","{arguments}.0","{that}.options.langSegValues","{that}.options.langSegIndex"]},getPathname:"fluid.prefs.enactor.localization.urlPathLocale.getPathname",setPathname:"fluid.prefs.enactor.localization.urlPathLocale.setPathname"}}),fluid.prefs.enactor.localization.urlPathLocale.getPathname=function(){return location.pathname},fluid.prefs.enactor.localization.urlPathLocale.setPathname=function(pathname){location.pathname=pathname},fluid.prefs.enactor.localization.urlPathLocale.updatePathname=function(that,urlLangSeg,langSegValues,langSegIndex){if(fluid.isValue(urlLangSeg)){langSegIndex=langSegIndex||1;var pathname=that.getPathname(),pathSegs=pathname.split("/"),currentLang=pathSegs[langSegIndex];!!currentLang&&0<=langSegValues.indexOf(currentLang)?urlLangSeg?pathSegs[langSegIndex]=urlLangSeg:langSegIndex===pathSegs.length-1?pathSegs.pop():pathSegs.splice(langSegIndex,1):urlLangSeg&&pathSegs.splice(langSegIndex,0,urlLangSeg);var newPathname=pathSegs.join("/");newPathname!==pathname&&that.setPathname(newPathname)}}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid_3_0_0.defaults("fluid.prefs.enactor.wordSpace",{gradeNames:["fluid.prefs.enactor.spacingSetter"],preferenceMap:{"fluid.prefs.wordSpace":{"model.value":"value"}},cssProp:"word-spacing"})}(jQuery);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.initialModel.starter",{gradeNames:["fluid.prefs.initialModel"],members:{initialModel:{preferences:{textFont:"default",theme:"default",textSize:1,lineSpace:1,toc:!1,inputs:!1}}}}),fluid.defaults("fluid.uiEnhancer.cssClassEnhancerBase",{gradeNames:["fluid.component"],classnameMap:{textFont:{default:"",times:"fl-font-times",comic:"fl-font-comic-sans",arial:"fl-font-arial",verdana:"fl-font-verdana","open-dyslexic":"fl-font-open-dyslexic"},theme:{default:"fl-theme-prefsEditor-default",bw:"fl-theme-bw",wb:"fl-theme-wb",by:"fl-theme-by",yb:"fl-theme-yb",lgdg:"fl-theme-lgdg",gd:"fl-theme-gd",gw:"fl-theme-gw",bbr:"fl-theme-bbr"},inputs:"fl-input-enhanced"}}),fluid.defaults("fluid.uiEnhancer.browserTextEnhancerBase",{gradeNames:["fluid.component"],fontSizeMap:{"xx-small":"9px","x-small":"11px",small:"13px",medium:"15px",large:"18px","x-large":"23px","xx-large":"30px"}}),fluid.defaults("fluid.uiEnhancer.starterEnactors",{gradeNames:["fluid.uiEnhancer","fluid.uiEnhancer.cssClassEnhancerBase","fluid.uiEnhancer.browserTextEnhancerBase"],model:"{fluid.prefs.initialModel}.initialModel.preferences",components:{textSize:{type:"fluid.prefs.enactor.textSize",container:"{uiEnhancer}.container",options:{fontSizeMap:"{uiEnhancer}.options.fontSizeMap",model:{value:"{uiEnhancer}.model.textSize"}}},textFont:{type:"fluid.prefs.enactor.textFont",container:"{uiEnhancer}.container",options:{classes:"{uiEnhancer}.options.classnameMap.textFont",model:{value:"{uiEnhancer}.model.textFont"}}},lineSpace:{type:"fluid.prefs.enactor.lineSpace",container:"{uiEnhancer}.container",options:{fontSizeMap:"{uiEnhancer}.options.fontSizeMap",model:{value:"{uiEnhancer}.model.lineSpace"}}},contrast:{type:"fluid.prefs.enactor.contrast",container:"{uiEnhancer}.container",options:{classes:"{uiEnhancer}.options.classnameMap.theme",model:{value:"{uiEnhancer}.model.theme"}}},enhanceInputs:{type:"fluid.prefs.enactor.enhanceInputs",container:"{uiEnhancer}.container",options:{cssClass:"{uiEnhancer}.options.classnameMap.inputs",model:{value:"{uiEnhancer}.model.inputs"}}},tableOfContents:{type:"fluid.prefs.enactor.tableOfContents",container:"{uiEnhancer}.container",options:{tocTemplate:"{uiEnhancer}.options.tocTemplate",tocMessage:"{uiEnhancer}.options.tocMessage",model:{toc:"{uiEnhancer}.model.toc"}}}}}),fluid.defaults("fluid.prefs.starterPanels",{gradeNames:["fluid.prefs.prefsEditor"],selectors:{textSize:".flc-prefsEditor-text-size",textFont:".flc-prefsEditor-text-font",lineSpace:".flc-prefsEditor-line-space",contrast:".flc-prefsEditor-contrast",layoutControls:".flc-prefsEditor-layout-controls",enhanceInputs:".flc-prefsEditor-enhanceInputs"},components:{textSize:{type:"fluid.prefs.panel.textSize",container:"{prefsEditor}.dom.textSize",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",model:{value:"{prefsEditor}.model.preferences.textSize"},messageBase:"{messageLoader}.resources.textSize.resourceText",resources:{template:"{templateLoader}.resources.textSize"},step:.1,range:{min:1,max:2}}},lineSpace:{type:"fluid.prefs.panel.lineSpace",container:"{prefsEditor}.dom.lineSpace",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",model:{value:"{prefsEditor}.model.preferences.lineSpace"},messageBase:"{messageLoader}.resources.lineSpace.resourceText",resources:{template:"{templateLoader}.resources.lineSpace"},step:.1,range:{min:1,max:2}}},textFont:{type:"fluid.prefs.panel.textFont",container:"{prefsEditor}.dom.textFont",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",classnameMap:"{uiEnhancer}.options.classnameMap",model:{value:"{prefsEditor}.model.preferences.textFont"},messageBase:"{messageLoader}.resources.textFont.resourceText",resources:{template:"{templateLoader}.resources.textFont"},stringArrayIndex:{textFont:["textFont-default","textFont-times","textFont-comic","textFont-arial","textFont-verdana","textFont-open-dyslexic"]},controlValues:{textFont:["default","times","comic","arial","verdana","open-dyslexic"]}}},contrast:{type:"fluid.prefs.panel.contrast",container:"{prefsEditor}.dom.contrast",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",classnameMap:"{uiEnhancer}.options.classnameMap",model:{value:"{prefsEditor}.model.preferences.theme"},messageBase:"{messageLoader}.resources.contrast.resourceText",resources:{template:"{templateLoader}.resources.contrast"},stringArrayIndex:{theme:["contrast-default","contrast-bw","contrast-wb","contrast-by","contrast-yb","contrast-lgdg","contrast-gw","contrast-gd","contrast-bbr"]},controlValues:{theme:["default","bw","wb","by","yb","lgdg","gw","gd","bbr"]}}},layoutControls:{type:"fluid.prefs.panel.layoutControls",container:"{prefsEditor}.dom.layoutControls",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",model:{value:"{prefsEditor}.model.preferences.toc"},messageBase:"{messageLoader}.resources.layoutControls.resourceText",resources:{template:"{templateLoader}.resources.layoutControls"}}},enhanceInputs:{type:"fluid.prefs.panel.enhanceInputs",container:"{prefsEditor}.dom.enhanceInputs",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",model:{value:"{prefsEditor}.model.preferences.inputs"},messageBase:"{messageLoader}.resources.enhanceInputs.resourceText",resources:{template:"{templateLoader}.resources.enhanceInputs"}}}}}),fluid.defaults("fluid.prefs.starterTemplateLoader",{gradeNames:["fluid.resourceLoader"],resources:{textSize:"%templatePrefix/PrefsEditorTemplate-textSize.html",lineSpace:"%templatePrefix/PrefsEditorTemplate-lineSpace.html",textFont:"%templatePrefix/PrefsEditorTemplate-textFont.html",contrast:"%templatePrefix/PrefsEditorTemplate-contrast.html",layoutControls:"%templatePrefix/PrefsEditorTemplate-layout.html",enhanceInputs:"%templatePrefix/PrefsEditorTemplate-enhanceInputs.html"}}),fluid.defaults("fluid.prefs.starterSeparatedPanelTemplateLoader",{gradeNames:["fluid.prefs.starterTemplateLoader"],resources:{prefsEditor:"%templatePrefix/SeparatedPanelPrefsEditor.html"}}),fluid.defaults("fluid.prefs.starterFullPreviewTemplateLoader",{gradeNames:["fluid.prefs.starterTemplateLoader"],resources:{prefsEditor:"%templatePrefix/FullPreviewPrefsEditor.html"}}),fluid.defaults("fluid.prefs.starterFullNoPreviewTemplateLoader",{gradeNames:["fluid.prefs.starterTemplateLoader"],resources:{prefsEditor:"%templatePrefix/FullNoPreviewPrefsEditor.html"}}),fluid.defaults("fluid.prefs.starterMessageLoader",{gradeNames:["fluid.resourceLoader"],resources:{prefsEditor:"%messagePrefix/prefsEditor.json",textSize:"%messagePrefix/textSize.json",textFont:"%messagePrefix/textFont.json",lineSpace:"%messagePrefix/lineSpace.json",contrast:"%messagePrefix/contrast.json",layoutControls:"%messagePrefix/tableOfContents.json",enhanceInputs:"%messagePrefix/enhanceInputs.json"}})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.arrowScrolling",{gradeNames:["fluid.modelComponent"],selectors:{scrollContainer:".flc-prefsEditor-scrollContainer"},onScrollDelay:100,model:{},events:{beforeReset:null,onScroll:null},modelRelay:{target:"panelIndex",forward:{excludeSource:"init"},namespace:"limitPanelIndex",singleTransform:{type:"fluid.transforms.limitRange",input:"{that}.model.panelIndex",min:0,max:"{that}.model.panelMaxIndex"}},modelListeners:{panelIndex:{listener:"fluid.prefs.arrowScrolling.scrollToPanel",args:["{that}","{change}.value"],excludeSource:["scrollEvent"],namespace:"scrollToPanel"}},listeners:{"onReady.scrollEvent":{this:"{that}.dom.scrollContainer",method:"scroll",args:[{expander:{func:"fluid.debounce",args:["{that}.events.onScroll.fire","{that}.options.onScrollDelay"]}}]},"onReady.windowResize":{this:window,method:"addEventListener",args:["resize","{that}.events.onSignificantDOMChange.fire"]},"onDestroy.removeWindowResize":{this:window,method:"removeEventListener",args:["resize","{that}.events.onSignificantDOMChange.fire"]},"onPrefsEditorMarkupReady.setPanelMaxIndex":{changePath:"panelMaxIndex",value:{expander:{funcName:"fluid.prefs.arrowScrolling.calculatePanelMaxIndex",args:["{that}.dom.panels"]}}},"beforeReset.resetPanelIndex":{listener:"{that}.applier.fireChangeRequest",args:{path:"panelIndex",value:0,type:"ADD",source:"reset"}},"onScroll.setPanelIndex":{changePath:"panelIndex",value:{expander:{funcName:"fluid.prefs.arrowScrolling.getClosestPanelIndex",args:"{that}.dom.panels"}},source:"scrollEvent"}},invokers:{eventToScrollIndex:{funcName:"fluid.prefs.arrowScrolling.eventToScrollIndex",args:["{that}","{arguments}.0"]}},distributeOptions:{"arrowScrolling.panel.listeners.bindScrollArrows":{record:{"afterRender.bindScrollArrows":{this:"{that}.dom.header",method:"click",args:["{prefsEditor}.eventToScrollIndex"]}},target:"{that > fluid.prefs.panel}.options.listeners"}}}),fluid.prefs.arrowScrolling.calculatePanelMaxIndex=function(panels){return Math.max(0,panels.length-1)},fluid.prefs.arrowScrolling.eventToScrollIndex=function(that,event){event.preventDefault();var midPoint=$(event.target).width()/2,scrollToIndex=(that.model.panelIndex||0)+(event.offsetX<midPoint?-1:1);that.applier.change("panelIndex",scrollToIndex,"ADD","eventToScrollIndex")},fluid.prefs.arrowScrolling.scrollToPanel=function(that,panelIndex){panelIndex=panelIndex||0;var panels=that.locate("panels"),scrollContainer=that.locate("scrollContainer");panels.eq(panelIndex).width()&&scrollContainer.scrollLeft(scrollContainer.scrollLeft()+panels.eq(panelIndex).offset().left)},fluid.prefs.arrowScrolling.getClosestPanelIndex=function(panels){var panelArray=fluid.transform(panels,function(panel,idx){return{index:idx,offset:Math.abs($(panel).offset().left)}});return panelArray.sort(function(a,b){return a.offset-b.offset}),fluid.get(panelArray,["0","index"])||0}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.dom"),fluid.dom.getDocumentHeight=function(dokkument){return $("body",dokkument)[0].offsetHeight},fluid.defaults("fluid.prefs.separatedPanel",{gradeNames:["fluid.prefs.prefsEditorLoader","fluid.contextAware"],events:{afterRender:null,onReady:null,onCreateSlidingPanelReady:{events:{iframeRendered:"afterRender",onPrefsEditorMessagesLoaded:"onPrefsEditorMessagesLoaded"}},templatesAndIframeReady:{events:{iframeReady:"afterRender",templatesLoaded:"onPrefsEditorTemplatesLoaded",messagesLoaded:"onPrefsEditorMessagesLoaded"}}},lazyLoad:!1,contextAwareness:{lazyLoad:{checks:{lazyLoad:{contextValue:"{fluid.prefs.separatedPanel}.options.lazyLoad",gradeNames:"fluid.prefs.separatedPanel.lazyLoad"}}}},selectors:{reset:".flc-prefsEditor-reset",iframe:".flc-prefsEditor-iframe"},listeners:{"onReady.bindEvents":{listener:"fluid.prefs.separatedPanel.bindEvents",args:["{separatedPanel}.prefsEditor","{iframeRenderer}.iframeEnhancer","{separatedPanel}"]},"onCreate.hideReset":{listener:"fluid.prefs.separatedPanel.hideReset",args:["{separatedPanel}"]}},invokers:{bindReset:{funcName:"fluid.bind",args:["{separatedPanel}.dom.reset","click","{arguments}.0"]}},components:{slidingPanel:{type:"fluid.slidingPanel",container:"{separatedPanel}.container",createOnEvent:"onCreateSlidingPanelReady",options:{gradeNames:["fluid.prefs.msgLookup"],strings:{showText:"{that}.msgLookup.slidingPanelShowText",hideText:"{that}.msgLookup.slidingPanelHideText",showTextAriaLabel:"{that}.msgLookup.showTextAriaLabel",hideTextAriaLabel:"{that}.msgLookup.hideTextAriaLabel",panelLabel:"{that}.msgLookup.slidingPanelPanelLabel"},invokers:{operateShow:{funcName:"fluid.prefs.separatedPanel.showPanel",args:["{that}.dom.panel","{that}.events.afterPanelShow.fire"],this:null,method:null},operateHide:{funcName:"fluid.prefs.separatedPanel.hidePanel",args:["{that}.dom.panel","{iframeRenderer}.iframe","{that}.events.afterPanelHide.fire"],this:null,method:null}},components:{msgResolver:{type:"fluid.messageResolver",options:{messageBase:"{messageLoader}.resources.prefsEditor.resourceText"}}}}},iframeRenderer:{type:"fluid.prefs.separatedPanel.renderIframe",container:"{separatedPanel}.dom.iframe",options:{events:{afterRender:"{separatedPanel}.events.afterRender"},components:{iframeEnhancer:{type:"fluid.uiEnhancer",container:"{iframeRenderer}.renderPrefsEditorContainer",createOnEvent:"afterRender",options:{gradeNames:["{pageEnhancer}.uiEnhancer.options.userGrades"],jQuery:"{iframeRenderer}.jQuery",tocTemplate:"{pageEnhancer}.uiEnhancer.options.tocTemplate",inSeparatedPanel:!0}}}}},prefsEditor:{createOnEvent:"templatesAndIframeReady",container:"{iframeRenderer}.renderPrefsEditorContainer",options:{gradeNames:["fluid.prefs.uiEnhancerRelay","fluid.prefs.arrowScrolling"],model:{preferences:"{separatedPanel}.model.preferences",panelIndex:"{separatedPanel}.model.panelIndex",panelMaxIndex:"{separatedPanel}.model.panelMaxIndex",local:{panelIndex:"{that}.model.panelIndex"}},autoSave:!0,events:{onSignificantDOMChange:null,updateEnhancerModel:"{that}.events.modelChanged"},modelListeners:{panelIndex:[{listener:"fluid.prefs.prefsEditor.handleAutoSave",args:["{that}"],namespace:"autoSavePanelIndex"}]},listeners:{"onCreate.bindReset":{listener:"{separatedPanel}.bindReset",args:["{that}.reset"]},"afterReset.applyChanges":"{that}.applyChanges","{separatedPanel}.slidingPanel.events.afterPanelShow":{listener:"fluid.prefs.arrowScrolling.scrollToPanel",args:["{that}","{that}.model.panelIndex"],priority:"after:updateView",namespace:"scrollToPanel"}}}}},outerEnhancerOptions:"{originalEnhancerOptions}.options.originalUserOptions",distributeOptions:{"separatedPanel.slidingPanel":{source:"{that}.options.slidingPanel",removeSource:!0,target:"{that > slidingPanel}.options"},"separatedPanel.iframeRenderer":{source:"{that}.options.iframeRenderer",removeSource:!0,target:"{that > iframeRenderer}.options"},"separatedPanel.iframeRendered.terms":{source:"{that}.options.terms",target:"{that > iframeRenderer}.options.terms"},"separatedPanel.selectors.iframe":{source:"{that}.options.iframe",removeSource:!0,target:"{that}.options.selectors.iframe"},"separatedPanel.iframeEnhancer.outerEnhancerOptions":{source:"{that}.options.outerEnhancerOptions",removeSource:!0,target:"{that iframeEnhancer}.options"}}}),fluid.prefs.separatedPanel.hideReset=function(separatedPanel){separatedPanel.locate("reset").hide()},fluid.defaults("fluid.prefs.separatedPanel.renderIframe",{gradeNames:["fluid.viewComponent"],events:{afterRender:null},styles:{container:"fl-prefsEditor-separatedPanel-iframe"},terms:{templatePrefix:"."},markupProps:{class:"flc-iframe",src:"%templatePrefix/SeparatedPanelPrefsEditorFrame.html"},listeners:{"onCreate.startLoadingIframe":"fluid.prefs.separatedPanel.renderIframe.startLoadingIframe"}}),fluid.prefs.separatedPanel.renderIframe.startLoadingIframe=function(that){var styles=that.options.styles;that.options.markupProps.src=fluid.stringTemplate(that.options.markupProps.src,that.options.terms),that.iframeSrc=that.options.markupProps.src,that.iframe=$("<iframe/>"),that.iframe.on("load",function(){var iframeWindow=that.iframe[0].contentWindow;that.iframeDocument=iframeWindow.document,that.jQuery=iframeWindow.jQuery||$,that.renderPrefsEditorContainer=that.jQuery("body",that.iframeDocument),that.jQuery(that.iframeDocument).ready(that.events.afterRender.fire)}),that.iframe.attr(that.options.markupProps),that.iframe.addClass(styles.container),that.iframe.hide(),that.iframe.appendTo(that.container)},fluid.prefs.separatedPanel.updateView=function(prefsEditor){prefsEditor.events.onPrefsEditorRefresh.fire(),prefsEditor.events.onSignificantDOMChange.fire()},fluid.prefs.separatedPanel.bindEvents=function(prefsEditor,iframeEnhancer,separatedPanel){var separatedPanelId=separatedPanel.slidingPanel.panelId;separatedPanel.locate("reset").attr({"aria-controls":separatedPanelId,role:"button"}),separatedPanel.slidingPanel.events.afterPanelShow.addListener(function(){fluid.prefs.separatedPanel.updateView(prefsEditor)},"updateView","after:openPanel"),prefsEditor.events.onPrefsEditorRefresh.addListener(function(){iframeEnhancer.updateModel(prefsEditor.model.preferences)},"updateModel"),prefsEditor.events.afterReset.addListener(function(prefsEditor){fluid.prefs.separatedPanel.updateView(prefsEditor)},"updateView"),prefsEditor.events.onSignificantDOMChange.addListener(function(){if(fluid.get(separatedPanel,"slidingPanel.model.isShowing")){var dokkument=prefsEditor.container[0].ownerDocument,height=fluid.dom.getDocumentHeight(dokkument),iframe=separatedPanel.iframeRenderer.iframe,attrs={height:height};separatedPanel.slidingPanel.locate("panel").css({height:""}),iframe.clearQueue(),iframe.animate(attrs,400)}},"adjustHeight"),separatedPanel.slidingPanel.events.afterPanelHide.addListener(function(){separatedPanel.iframeRenderer.iframe.height(0),separatedPanel.iframeRenderer.iframe.hide()},"collapseFrame"),separatedPanel.slidingPanel.events.afterPanelShow.addListener(function(){separatedPanel.iframeRenderer.iframe.show(),separatedPanel.iframeRenderer.iframe.height(),separatedPanel.locate("reset").show()},"openPanel"),separatedPanel.slidingPanel.events.onPanelHide.addListener(function(){separatedPanel.locate("reset").hide()},"hideReset")},fluid.prefs.separatedPanel.hidePanel=function(panel,iframe,callback){iframe.clearQueue(),$(panel).animate({height:0},{duration:400,complete:callback})},fluid.prefs.separatedPanel.showPanel=function(panel,callback){fluid.invokeLater(callback)},fluid.defaults("fluid.prefs.separatedPanel.lazyLoad",{events:{onLazyLoad:null,onPrefsEditorMessagesPreloaded:null,onCreateSlidingPanelReady:{events:{onPrefsEditorMessagesLoaded:"onPrefsEditorMessagesPreloaded"}},templatesAndIframeReady:{events:{onLazyLoad:"onLazyLoad"}}},components:{templateLoader:{createOnEvent:"onLazyLoad"},messageLoader:{options:{events:{onResourcesPreloaded:"{separatedPanel}.events.onPrefsEditorMessagesPreloaded"},preloadResources:"prefsEditor",listeners:{"onCreate.loadResources":{listener:"fluid.prefs.separatedPanel.lazyLoad.preloadResources",args:["{that}",{expander:{func:"{that}.resolveResources"}},"{that}.options.preloadResources"]},"{separatedPanel}.events.onLazyLoad":{listener:"fluid.resourceLoader.loadResources",args:["{messageLoader}",{expander:{func:"{messageLoader}.resolveResources"}}],namespace:"loadResources"}}}},slidingPanel:{options:{invokers:{operateShow:{funcName:"fluid.prefs.separatedPanel.lazyLoad.showPanel",args:["{separatedPanel}","{that}.events.afterPanelShow.fire"]}}}}}}),fluid.prefs.separatedPanel.lazyLoad.showPanel=function(separatedPanel,callback){separatedPanel.prefsEditor?fluid.invokeLater(callback):(separatedPanel.events.onReady.addListener(function(that){that.events.onReady.removeListener("showPanelCallBack"),fluid.invokeLater(callback)},"showPanelCallBack"),separatedPanel.events.onLazyLoad.fire())},fluid.prefs.separatedPanel.lazyLoad.preloadResources=function(that,resources,toPreload){toPreload=fluid.makeArray(toPreload);var preloadResources={};fluid.each(toPreload,function(resourceName){preloadResources[resourceName]=resources[resourceName]}),fluid.fetchResources(preloadResources,function(){that.resources=preloadResources,that.events.onResourcesPreloaded.fire(preloadResources)})}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid_3_0_0.defaults("fluid.prefs.fullNoPreview",{gradeNames:["fluid.prefs.prefsEditorLoader"],components:{prefsEditor:{container:"{that}.container",options:{listeners:{"afterReset.applyChanges":{listener:"{that}.applyChanges"},"afterReset.save":{listener:"{that}.save",priority:"after:applyChanges"}}}}},events:{onReady:null}})}(jQuery);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid_3_0_0.defaults("fluid.prefs.fullPreview",{gradeNames:["fluid.prefs.prefsEditorLoader"],outerUiEnhancerOptions:"{originalEnhancerOptions}.options.originalUserOptions",outerUiEnhancerGrades:"{originalEnhancerOptions}.uiEnhancer.options.userGrades",components:{prefsEditor:{container:"{that}.container",options:{components:{preview:{type:"fluid.prefs.preview",createOnEvent:"onReady",container:"{prefsEditor}.dom.previewFrame",options:{listeners:{"onReady.boilOnPreviewReady":"{fullPreview}.events.onPreviewReady"}}}},listeners:{"onReady.boil":{listener:"{prefsEditorLoader}.events.onPrefsEditorReady"}},distributeOptions:{"fullPreview.prefsEditor.preview":{source:"{that}.options.preview",removeSource:!0,target:"{that > preview}.options"}}}}},events:{onPrefsEditorReady:null,onPreviewReady:null,onReady:{events:{onPrefsEditorReady:"onPrefsEditorReady",onPreviewReady:"onPreviewReady"},args:"{that}"}},distributeOptions:{"fullPreview.enhancer.outerUiEnhancerOptions":{source:"{that}.options.outerUiEnhancerOptions",target:"{that enhancer}.options"},"fullPreview.enhancer.previewEnhancer":{source:"{that}.options.previewEnhancer",target:"{that enhancer}.options"},"fullPreviw.preview":{source:"{that}.options.preview",target:"{that preview}.options"},"fullPreview.enhancer.outerUiEnhancerGrades":{source:"{that}.options.outerUiEnhancerGrades",target:"{that enhancer}.options.gradeNames"}}})}(jQuery);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.prefs.schemas"),fluid.prefs.schemas.merge=function(target,source){return target||(target={type:"object",properties:{}}),source=source.properties||source,$.extend(!0,target.properties,source),target},fluid.defaults("fluid.prefs.primaryBuilder",{gradeNames:["fluid.component","{that}.buildPrimary"],schemaIndex:{expander:{func:"fluid.indexDefaults",args:["schemaIndex",{gradeNames:"fluid.prefs.schemas",indexFunc:"fluid.prefs.primaryBuilder.defaultSchemaIndexer"}]}},primarySchema:{},typeFilter:[],invokers:{buildPrimary:{funcName:"fluid.prefs.primaryBuilder.buildPrimary",args:["{that}.options.schemaIndex","{that}.options.typeFilter","{that}.options.primarySchema"]}}}),fluid.prefs.primaryBuilder.buildPrimary=function(schemaIndex,typeFilter,primarySchema){var suppliedPrimaryGradeName="fluid.prefs.schemas.suppliedPrimary"+fluid.allocateGuid();fluid.defaults(suppliedPrimaryGradeName,{gradeNames:["fluid.prefs.schemas"],schema:fluid.filterKeys(primarySchema.properties||primarySchema,typeFilter,!1)});var primary=[];return fluid.each(typeFilter,function(type){var schemaGrades=schemaIndex[type];schemaGrades&&primary.push.apply(primary,schemaGrades)}),primary.push(suppliedPrimaryGradeName),primary},fluid.prefs.primaryBuilder.defaultSchemaIndexer=function(defaults){if(defaults.schema)return fluid.keys(defaults.schema.properties)},fluid.defaults("fluid.prefs.schemas",{gradeNames:["fluid.component"],mergePolicy:{schema:fluid.prefs.schemas.merge}})}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.prefs"),fluid.defaults("fluid.prefs.auxSchema",{gradeNames:["fluid.component"],auxiliarySchema:{loaderGrades:["fluid.prefs.separatedPanel"]}}),fluid.prefs.expandSchemaValue=function(root,pathRef){return"@"!==pathRef.charAt(0)?pathRef:fluid.get(root,pathRef.substring(1))},fluid.prefs.addAtPath=function(root,path,object){var existingObject=fluid.get(root,path);return fluid.set(root,path,$.extend(!0,{},existingObject,object)),root},fluid.prefs.removeKey=function(root,key){var value=root[key];return delete root[key],value},fluid.prefs.rearrangeDirect=function(root,toPath,sourcePath){var result={},sourceValue=fluid.prefs.removeKey(root,sourcePath);return sourceValue&&fluid.set(result,toPath,sourceValue),result},fluid.prefs.addCommonOptions=function(root,path,commonOptions,templateValues){templateValues=templateValues||{};var existingValue=fluid.get(root,path);if(!existingValue)return root;var opts={},mergePolicy={};return fluid.each(commonOptions,function(value,key){if("container"===key){var componentType=fluid.get(root,[path,"type"]),componentOptions=fluid.defaults(componentType);if(void 0===fluid.get(componentOptions,["argumentMap","container"]))return!1}-1!==key.indexOf("gradeNames")&&(mergePolicy[key]=fluid.arrayConcatPolicy),key=fluid.stringTemplate(key,templateValues),value="string"==typeof value?fluid.stringTemplate(value,templateValues):value,fluid.set(opts,key,value)}),fluid.set(root,path,fluid.merge(mergePolicy,existingValue,opts)),root},fluid.prefs.containerNeeded=function(root,path){var componentType=fluid.get(root,[path,"type"]),componentOptions=fluid.defaults(componentType);return fluid.hasGrade(componentOptions,"fluid.viewComponent")||fluid.hasGrade(componentOptions,"fluid.rendererComponent")},fluid.prefs.checkPrimarySchema=function(primarySchema,prefKey){return primarySchema||fluid.fail("The primary schema for "+prefKey+" is not defined."),!!primarySchema},fluid.prefs.flattenName=function(name){var regexp=new RegExp("\\.","g");return name.replace(regexp,"_")},fluid.prefs.constructAliases=function(auxSchema,flattenedPrefKey,aliases){aliases=fluid.makeArray(aliases);var prefsEditorModel={},enhancerModel={};fluid.each(aliases,function(alias){prefsEditorModel[alias]="{that}.model.preferences."+flattenedPrefKey,enhancerModel[alias]="{that}.model."+flattenedPrefKey}),fluid.prefs.addAtPath(auxSchema,["aliases_prefsEditor","model","preferences"],prefsEditorModel),fluid.prefs.addAtPath(auxSchema,["aliases_enhancer","model"],enhancerModel)},fluid.prefs.expandSchemaComponents=function(auxSchema,type,prefKey,alias,componentConfig,index,commonOptions,modelCommonOptions,mappedDefaults){var componentOptions=fluid.copy(componentConfig)||{},components={},initialModel={},componentName=fluid.prefs.removeKey(componentOptions,"type"),memberName=fluid.prefs.flattenName(componentName),flattenedPrefKey=fluid.prefs.flattenName(prefKey);if(componentName){components[memberName]={type:componentName,options:componentOptions};var selectors=fluid.prefs.rearrangeDirect(componentOptions,memberName,"container"),templates=fluid.prefs.rearrangeDirect(componentOptions,memberName,"template"),messages=fluid.prefs.rearrangeDirect(componentOptions,memberName,"message"),map=fluid.defaults(componentName).preferenceMap[prefKey],prefSchema=mappedDefaults[prefKey];fluid.each(map,function(primaryPath,internalPath){if(fluid.prefs.checkPrimarySchema(prefSchema,prefKey)){var opts={};if(0===internalPath.indexOf("model.")&&"value"===primaryPath){var internalModelName=internalPath.slice(6);fluid.set(opts,"model",fluid.get(opts,"model")||{}),fluid.prefs.addCommonOptions(opts,"model",modelCommonOptions,{internalModelName:internalModelName,externalModelName:flattenedPrefKey}),fluid.set(initialModel,["members","initialModel","preferences",flattenedPrefKey],prefSchema.default),alias&&fluid.set(initialModel,["members","initialModel","preferences",alias],prefSchema.default)}else fluid.set(opts,internalPath,prefSchema[primaryPath]);$.extend(!0,componentOptions,opts)}}),fluid.prefs.addCommonOptions(components,memberName,commonOptions,{prefKey:memberName}),fluid.prefs.addAtPath(auxSchema,[type,"components"],components),fluid.prefs.addAtPath(auxSchema,[type,"selectors"],selectors),fluid.prefs.addAtPath(auxSchema,["templateLoader","resources"],templates),fluid.prefs.addAtPath(auxSchema,["messageLoader","resources"],messages),fluid.prefs.addAtPath(auxSchema,"initialModel",initialModel),fluid.prefs.constructAliases(auxSchema,flattenedPrefKey,alias)}return auxSchema},fluid.prefs.expandSchemaImpl=function(schemaToExpand,altSource){var expandedSchema=fluid.copy(schemaToExpand);return altSource=altSource||expandedSchema,fluid.each(expandedSchema,function(value,key){if("object"==typeof value)expandedSchema[key]=fluid.prefs.expandSchemaImpl(value,altSource);else if("string"==typeof value){var expandedVal=fluid.prefs.expandSchemaValue(altSource,value);void 0!==expandedVal?expandedSchema[key]=expandedVal:delete expandedSchema[key]}}),expandedSchema},fluid.prefs.expandCompositePanels=function(auxSchema,compositePanelList,panelIndex,panelCommonOptions,subPanelCommonOptions,compositePanelBasedOnSubCommonOptions,panelModelCommonOptions,mappedDefaults){var panelsToIgnore=[];return fluid.each(compositePanelList,function(compositeDetail,compositeKey){var selectors,templates,messages,compositePanelOptions={},components={},initialModel={},selectorsToIgnore=[],thisCompositeOptions=fluid.copy(compositeDetail);fluid.set(compositePanelOptions,"type",thisCompositeOptions.type),delete thisCompositeOptions.type,selectors=fluid.prefs.rearrangeDirect(thisCompositeOptions,compositeKey,"container"),templates=fluid.prefs.rearrangeDirect(thisCompositeOptions,compositeKey,"template"),messages=fluid.prefs.rearrangeDirect(thisCompositeOptions,compositeKey,"message");var subPanelList=[],subPanels={},subPanelRenderOn={};fluid.isPlainObject(thisCompositeOptions.panels)&&!fluid.isArrayable(thisCompositeOptions.panels)?fluid.each(thisCompositeOptions.panels,function(subpanelArray,pref){subPanelList=subPanelList.concat(subpanelArray),"always"!==pref&&fluid.each(subpanelArray,function(onePanel){fluid.set(subPanelRenderOn,onePanel,pref)})}):subPanelList=thisCompositeOptions.panels,fluid.each(subPanelList,function(subPanelID){panelsToIgnore.push(subPanelID);var subPanelPrefsKey=fluid.get(auxSchema,[subPanelID,"type"]),safeSubPanelPrefsKey=fluid.prefs.subPanel.safePrefKey(subPanelPrefsKey);selectorsToIgnore.push(safeSubPanelPrefsKey);var subPanelOptions=fluid.copy(fluid.get(auxSchema,[subPanelID,"panel"])),subPanelType=fluid.get(subPanelOptions,"type");fluid.set(subPanels,[safeSubPanelPrefsKey,"type"],subPanelType);var renderOn=fluid.get(subPanelRenderOn,subPanelID);renderOn&&fluid.set(subPanels,[safeSubPanelPrefsKey,"options","renderOnPreference"],renderOn);var map=fluid.defaults(subPanelType).preferenceMap[subPanelPrefsKey],prefSchema=mappedDefaults[subPanelPrefsKey];fluid.each(map,function(primaryPath,internalPath){var opts;fluid.prefs.checkPrimarySchema(prefSchema,subPanelPrefsKey)&&(0===internalPath.indexOf("model.")&&"value"===primaryPath?(fluid.set(compositePanelOptions,["options","model"],fluid.get(compositePanelOptions,["options","model"])||{}),fluid.prefs.addCommonOptions(compositePanelOptions,["options","model"],panelModelCommonOptions,{internalModelName:safeSubPanelPrefsKey,externalModelName:safeSubPanelPrefsKey}),fluid.set(initialModel,["members","initialModel","preferences",safeSubPanelPrefsKey],prefSchema.default)):(opts=opts||{options:{}},fluid.set(opts,"options."+internalPath,prefSchema[primaryPath])),$.extend(!0,subPanels[safeSubPanelPrefsKey],opts))}),fluid.set(templates,safeSubPanelPrefsKey,fluid.get(subPanelOptions,"template")),fluid.set(messages,safeSubPanelPrefsKey,fluid.get(subPanelOptions,"message")),fluid.set(compositePanelOptions,["options","selectors",safeSubPanelPrefsKey],fluid.get(subPanelOptions,"container")),fluid.set(compositePanelOptions,["options","resources"],fluid.get(compositePanelOptions,["options","resources"])||{}),fluid.prefs.addCommonOptions(compositePanelOptions.options,"resources",compositePanelBasedOnSubCommonOptions,{subPrefKey:safeSubPanelPrefsKey}),delete subPanelOptions.type,delete subPanelOptions.template,delete subPanelOptions.message,delete subPanelOptions.container,fluid.set(subPanels,[safeSubPanelPrefsKey,"options"],$.extend(!0,{},fluid.get(subPanels,[safeSubPanelPrefsKey,"options"]),subPanelOptions)),fluid.prefs.addCommonOptions(subPanels,safeSubPanelPrefsKey,subPanelCommonOptions,{compositePanel:compositeKey,prefKey:safeSubPanelPrefsKey})}),delete thisCompositeOptions.panels,fluid.set(compositePanelOptions,["options"],$.extend(!0,{},compositePanelOptions.options,thisCompositeOptions)),fluid.set(compositePanelOptions,["options","selectorsToIgnore"],selectorsToIgnore),fluid.set(compositePanelOptions,["options","components"],subPanels),components[compositeKey]=compositePanelOptions,fluid.prefs.addCommonOptions(components,compositeKey,panelCommonOptions,{prefKey:compositeKey}),fluid.prefs.addAtPath(auxSchema,["panels","components"],components),fluid.prefs.addAtPath(auxSchema,["panels","selectors"],selectors),fluid.prefs.addAtPath(auxSchema,["templateLoader","resources"],templates),fluid.prefs.addAtPath(auxSchema,["messageLoader","resources"],messages),fluid.prefs.addAtPath(auxSchema,"initialModel",initialModel),$.extend(!0,auxSchema,{panelsToIgnore:panelsToIgnore})}),auxSchema},fluid.prefs.expandSchema=function(schemaToExpand,indexes,topCommonOptions,elementCommonOptions,mappedDefaults){var auxSchema=fluid.prefs.expandSchemaImpl(schemaToExpand);auxSchema.namespace=auxSchema.namespace||"fluid.prefs.created_"+fluid.allocateGuid();var terms=fluid.get(auxSchema,"terms");terms&&(delete auxSchema.terms,fluid.set(auxSchema,["terms","terms"],terms));var compositePanelList=fluid.get(auxSchema,"groups");return compositePanelList&&fluid.prefs.expandCompositePanels(auxSchema,compositePanelList,fluid.get(indexes,"panel"),fluid.get(elementCommonOptions,"panel"),fluid.get(elementCommonOptions,"subPanel"),fluid.get(elementCommonOptions,"compositePanelBasedOnSub"),fluid.get(elementCommonOptions,"panelModel"),mappedDefaults),fluid.each(auxSchema,function(category,prefName){var type="panel";category[type]&&!fluid.contains(auxSchema.panelsToIgnore,prefName)&&fluid.prefs.expandSchemaComponents(auxSchema,"panels",category.type,category.alias,category[type],fluid.get(indexes,type),fluid.get(elementCommonOptions,type),fluid.get(elementCommonOptions,type+"Model"),mappedDefaults),category[type="enactor"]&&fluid.prefs.expandSchemaComponents(auxSchema,"enactors",category.type,category.alias,category[type],fluid.get(indexes,type),fluid.get(elementCommonOptions,type),fluid.get(elementCommonOptions,type+"Model"),mappedDefaults),fluid.each(["template","message"],function(type){prefName===type&&(fluid.set(auxSchema,[type+"Loader","resources","prefsEditor"],auxSchema[type]),delete auxSchema[type])})}),auxSchema.panelsToIgnore&&delete auxSchema.panelsToIgnore,fluid.each(topCommonOptions,function(topOptions,type){fluid.prefs.addCommonOptions(auxSchema,type,topOptions)}),auxSchema},fluid.defaults("fluid.prefs.auxBuilder",{gradeNames:["fluid.prefs.auxSchema"],mergePolicy:{elementCommonOptions:"noexpand"},topCommonOptions:{panels:{gradeNames:["fluid.prefs.prefsEditor"]},enactors:{gradeNames:["fluid.uiEnhancer"]},templateLoader:{gradeNames:["fluid.resourceLoader"]},messageLoader:{gradeNames:["fluid.resourceLoader"]},initialModel:{gradeNames:["fluid.prefs.initialModel"]},terms:{gradeNames:["fluid.component"]},aliases_prefsEditor:{gradeNames:["fluid.modelComponent"]},aliases_enhancer:{gradeNames:["fluid.modelComponent"]}},elementCommonOptions:{panel:{createOnEvent:"onPrefsEditorMarkupReady",container:"{prefsEditor}.dom.%prefKey","options.gradeNames":"fluid.prefs.prefsEditorConnections","options.resources.template":"{templateLoader}.resources.%prefKey","options.messageBase":"{messageLoader}.resources.%prefKey.resourceText"},panelModel:{"%internalModelName":"{prefsEditor}.model.preferences.%externalModelName"},compositePanelBasedOnSub:{"%subPrefKey":"{templateLoader}.resources.%subPrefKey"},subPanel:{container:"{%compositePanel}.dom.%prefKey","options.messageBase":"{messageLoader}.resources.%prefKey.resourceText"},enactor:{container:"{uiEnhancer}.container"},enactorModel:{"%internalModelName":"{uiEnhancer}.model.%externalModelName"}},indexes:{panel:{expander:{func:"fluid.indexDefaults",args:["panelsIndex",{gradeNames:"fluid.prefs.panel",indexFunc:"fluid.prefs.auxBuilder.prefMapIndexer"}]}},enactor:{expander:{func:"fluid.indexDefaults",args:["enactorsIndex",{gradeNames:"fluid.prefs.enactor",indexFunc:"fluid.prefs.auxBuilder.prefMapIndexer"}]}}},mappedDefaults:{},expandedAuxSchema:{expander:{func:"fluid.prefs.expandSchema",args:["{that}.options.auxiliarySchema","{that}.options.indexes","{that}.options.topCommonOptions","{that}.options.elementCommonOptions","{that}.options.mappedDefaults"]}}}),fluid.prefs.auxBuilder.prefMapIndexer=function(defaults){return fluid.keys(defaults.preferenceMap)}}(jQuery,fluid_3_0_0),function(fluid){"use strict";fluid.defaults("fluid.prefs.auxSchema.starter",{gradeNames:["fluid.prefs.auxSchema"],auxiliarySchema:{loaderGrades:["fluid.prefs.separatedPanel"],namespace:"fluid.prefs.constructed",terms:{templatePrefix:"../../framework/preferences/html",messagePrefix:"../../framework/preferences/messages"},template:"%templatePrefix/SeparatedPanelPrefsEditor.html",message:"%messagePrefix/prefsEditor.json",defaultLocale:"en",textSize:{type:"fluid.prefs.textSize",alias:"textSize",enactor:{type:"fluid.prefs.enactor.textSize"},panel:{type:"fluid.prefs.panel.textSize",container:".flc-prefsEditor-text-size",message:"%messagePrefix/textSize.json",template:"%templatePrefix/PrefsEditorTemplate-textSize.html"}},textFont:{type:"fluid.prefs.textFont",alias:"textFont",classes:{default:"",times:"fl-font-times",comic:"fl-font-comic-sans",arial:"fl-font-arial",verdana:"fl-font-verdana","open-dyslexic":"fl-font-open-dyslexic"},enactor:{type:"fluid.prefs.enactor.textFont",classes:"@textFont.classes"},panel:{type:"fluid.prefs.panel.textFont",container:".flc-prefsEditor-text-font",classnameMap:{textFont:"@textFont.classes"},template:"%templatePrefix/PrefsEditorTemplate-textFont.html",message:"%messagePrefix/textFont.json"}},lineSpace:{type:"fluid.prefs.lineSpace",alias:"lineSpace",enactor:{type:"fluid.prefs.enactor.lineSpace",fontSizeMap:{"xx-small":"9px","x-small":"11px",small:"13px",medium:"15px",large:"18px","x-large":"23px","xx-large":"30px"}},panel:{type:"fluid.prefs.panel.lineSpace",container:".flc-prefsEditor-line-space",message:"%messagePrefix/lineSpace.json",template:"%templatePrefix/PrefsEditorTemplate-lineSpace.html"}},contrast:{type:"fluid.prefs.contrast",alias:"theme",classes:{default:"fl-theme-prefsEditor-default",bw:"fl-theme-bw",wb:"fl-theme-wb",by:"fl-theme-by",yb:"fl-theme-yb",lgdg:"fl-theme-lgdg",gd:"fl-theme-gd",gw:"fl-theme-gw",bbr:"fl-theme-bbr"},enactor:{type:"fluid.prefs.enactor.contrast",classes:"@contrast.classes"},panel:{type:"fluid.prefs.panel.contrast",container:".flc-prefsEditor-contrast",classnameMap:{theme:"@contrast.classes"},template:"%templatePrefix/PrefsEditorTemplate-contrast.html",message:"%messagePrefix/contrast.json"}},tableOfContents:{type:"fluid.prefs.tableOfContents",alias:"toc",enactor:{type:"fluid.prefs.enactor.tableOfContents",tocTemplate:"../../components/tableOfContents/html/TableOfContents.html",tocMessage:"../../framework/preferences/messages/tableOfContents-enactor.json"},panel:{type:"fluid.prefs.panel.layoutControls",container:".flc-prefsEditor-layout-controls",template:"%templatePrefix/PrefsEditorTemplate-layout.html",message:"%messagePrefix/tableOfContents.json"}},enhanceInputs:{type:"fluid.prefs.enhanceInputs",alias:"inputs",enactor:{type:"fluid.prefs.enactor.enhanceInputs",cssClass:"fl-input-enhanced"},panel:{type:"fluid.prefs.panel.enhanceInputs",container:".flc-prefsEditor-enhanceInputs",template:"%templatePrefix/PrefsEditorTemplate-enhanceInputs.html",message:"%messagePrefix/enhanceInputs.json"}}}}),fluid.defaults("fluid.prefs.schemas.textSize",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.textSize":{type:"number",default:1,minimum:.5,maximum:2,multipleOf:.1}}}),fluid.defaults("fluid.prefs.schemas.lineSpace",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.lineSpace":{type:"number",default:1,minimum:.7,maximum:2,multipleOf:.1}}}),fluid.defaults("fluid.prefs.schemas.textFont",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.textFont":{type:"string",default:"default",enum:["default","times","comic","arial","verdana","open-dyslexic"],enumLabels:["textFont-default","textFont-times","textFont-comic","textFont-arial","textFont-verdana","textFont-open-dyslexic"]}}}),fluid.defaults("fluid.prefs.schemas.contrast",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.contrast":{type:"string",default:"default",enum:["default","bw","wb","by","yb","lgdg","gw","gd","bbr"],enumLabels:["contrast-default","contrast-bw","contrast-wb","contrast-by","contrast-yb","contrast-lgdg","contrast-gw","contrast-gd","contrast-bbr"]}}}),fluid.defaults("fluid.prefs.schemas.tableOfContents",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.tableOfContents":{type:"boolean",default:!1}}}),fluid.defaults("fluid.prefs.schemas.enhanceInputs",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.enhanceInputs":{type:"boolean",default:!1}}})}(fluid_3_0_0=fluid_3_0_0||{}),function(fluid){"use strict";fluid.defaults("fluid.prefs.auxSchema.captions",{gradeNames:["fluid.prefs.auxSchema"],auxiliarySchema:{namespace:"fluid.prefs.constructed",terms:{templatePrefix:"../../framework/preferences/html",messagePrefix:"../../framework/preferences/messages"},template:"%templatePrefix/SeparatedPanelPrefsEditor.html",message:"%messagePrefix/prefsEditor.json",captions:{type:"fluid.prefs.captions",enactor:{type:"fluid.prefs.enactor.captions",container:"body"},panel:{type:"fluid.prefs.panel.captions",container:".flc-prefsEditor-captions",template:"%templatePrefix/PrefsEditorTemplate-captions.html",message:"%messagePrefix/captions.json"}}}}),fluid.defaults("fluid.prefs.schemas.captions",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.captions":{type:"boolean",default:!1}}})}(fluid_3_0_0=fluid_3_0_0||{}),function(fluid){"use strict";fluid.defaults("fluid.prefs.auxSchema.letterSpace",{gradeNames:["fluid.prefs.auxSchema"],auxiliarySchema:{namespace:"fluid.prefs.constructed",terms:{templatePrefix:"../../framework/preferences/html/",messagePrefix:"../../framework/preferences/messages/"},template:"%templatePrefix/SeparatedPanelPrefsEditor.html",message:"%messagePrefix/prefsEditor.json",letterSpace:{type:"fluid.prefs.letterSpace",enactor:{type:"fluid.prefs.enactor.letterSpace",fontSizeMap:{"xx-small":"9px","x-small":"11px",small:"13px",medium:"15px",large:"18px","x-large":"23px","xx-large":"30px"}},panel:{type:"fluid.prefs.panel.letterSpace",container:".flc-prefsEditor-letter-space",template:"%templatePrefix/PrefsEditorTemplate-letterSpace.html",message:"%messagePrefix/letterSpace.json"}}}}),fluid.defaults("fluid.prefs.schemas.letterSpace",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.letterSpace":{type:"number",default:1,minimum:.9,maximum:2,multipleOf:.1}}})}(fluid_3_0_0=fluid_3_0_0||{}),function(fluid){"use strict";fluid.defaults("fluid.prefs.auxSchema.speak",{gradeNames:["fluid.prefs.auxSchema"],auxiliarySchema:{namespace:"fluid.prefs.constructed",terms:{templatePrefix:"../../framework/preferences/html/",messagePrefix:"../../framework/preferences/messages/"},template:"%templatePrefix/SeparatedPanelPrefsEditor.html",message:"%messagePrefix/prefsEditor.json",speak:{type:"fluid.prefs.speak",enactor:{type:"fluid.prefs.enactor.selfVoicing"},panel:{type:"fluid.prefs.panel.speak",container:".flc-prefsEditor-speak",template:"%templatePrefix/PrefsEditorTemplate-speak.html",message:"%messagePrefix/speak.json"}}}}),fluid.defaults("fluid.prefs.schemas.speak",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.speak":{type:"boolean",default:!1}}})}(fluid_3_0_0=fluid_3_0_0||{}),function(fluid){"use strict";fluid.defaults("fluid.prefs.auxSchema.syllabification",{gradeNames:["fluid.prefs.auxSchema"],auxiliarySchema:{namespace:"fluid.prefs.constructed",terms:{templatePrefix:"../../framework/preferences/html",messagePrefix:"../../framework/preferences/messages"},template:"%templatePrefix/SeparatedPanelPrefsEditor.html",message:"%messagePrefix/prefsEditor.json",syllabification:{type:"fluid.prefs.syllabification",enactor:{type:"fluid.prefs.enactor.syllabification",container:"body"},panel:{type:"fluid.prefs.panel.syllabification",container:".flc-prefsEditor-syllabification",template:"%templatePrefix/PrefsEditorTemplate-syllabification.html",message:"%messagePrefix/syllabification.json"}}}}),fluid.defaults("fluid.prefs.schemas.syllabification",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.syllabification":{type:"boolean",default:!1}}})}(fluid_3_0_0=fluid_3_0_0||{}),function(fluid){"use strict";fluid.defaults("fluid.prefs.auxSchema.localization",{gradeNames:["fluid.prefs.auxSchema"],auxiliarySchema:{terms:{templatePrefix:"../../framework/preferences/html/",messagePrefix:"../../framework/preferences/messages/"},template:"%templatePrefix/SeparatedPanelPrefsEditor.html",message:"%messagePrefix/prefsEditor.json",localization:{type:"fluid.prefs.localization",alias:"locale",enactor:{type:"fluid.prefs.enactor.localization"},panel:{type:"fluid.prefs.panel.localization",container:".flc-prefsEditor-localization",template:"%templatePrefix/PrefsEditorTemplate-localization.html",message:"%messagePrefix/localization.json"}}}}),fluid.defaults("fluid.prefs.schemas.localization",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.localization":{type:"string",default:"",enum:["","en","en_CA","en_US","fr","es","fa"],enumLabels:["localization-default","localization-en","localization-fr","localization-es","localization-fa"]}}})}(fluid_3_0_0=fluid_3_0_0||{}),function(fluid){"use strict";fluid.defaults("fluid.prefs.constructed.localizationPrefsEditorConfig",{gradeNames:["fluid.contextAware"],contextAwareness:{localeChange:{checks:{urlPath:{contextValue:"{localizationPrefsEditorConfig}.options.localizationScheme",equals:"urlPath",gradeNames:"fluid.prefs.constructed.localizationPrefsEditorConfig.urlPathLocale"}}}},distributeOptions:{"prefsEditor.localization.enactor.localizationScheme":{source:"{that}.options.localizationScheme",target:"{that uiEnhancer fluid.prefs.enactor.localization}.options.localizationScheme"},"prefsEditor.localization.panel.locales":{source:"{that}.options.locales",target:"{that prefsEditor fluid.prefs.panel.localization}.options.controlValues.localization"},"prefsEditor.localization.panel.localeNames":{source:"{that}.options.localeNames",target:"{that prefsEditor fluid.prefs.panel.localization}.options.stringArrayIndex.localization"}}}),fluid.defaults("fluid.prefs.constructed.localizationPrefsEditorConfig.urlPathLocale",{distributeOptions:{"prefsEditor.localization.enactor.langMap":{source:"{that}.options.langMap",target:"{that uiEnhancer fluid.prefs.enactor.localization}.options.langMap"},"prefsEditor.localization.enactor.langSegIndex":{source:"{that}.options.langSegIndex",target:"{that uiEnhancer fluid.prefs.enactor.localization}.options.langSegIndex"}}})}(fluid_3_0_0=fluid_3_0_0||{}),function(fluid){"use strict";fluid.defaults("fluid.prefs.auxSchema.wordSpace",{gradeNames:["fluid.prefs.auxSchema"],auxiliarySchema:{namespace:"fluid.prefs.constructed",terms:{templatePrefix:"../../framework/preferences/html/",messagePrefix:"../../framework/preferences/messages/"},template:"%templatePrefix/SeparatedPanelPrefsEditor.html",message:"%messagePrefix/prefsEditor.json",wordSpace:{type:"fluid.prefs.wordSpace",enactor:{type:"fluid.prefs.enactor.wordSpace",fontSizeMap:{"xx-small":"9px","x-small":"11px",small:"13px",medium:"15px",large:"18px","x-large":"23px","xx-large":"30px"}},panel:{type:"fluid.prefs.panel.wordSpace",container:".flc-prefsEditor-word-space",template:"%templatePrefix/PrefsEditorTemplate-wordSpace.html",message:"%messagePrefix/wordSpace.json"}}}}),fluid.defaults("fluid.prefs.schemas.wordSpace",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.wordSpace":{type:"number",default:1,minimum:.7,maximum:2,multipleOf:.1}}})}(fluid_3_0_0=fluid_3_0_0||{});fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.prefs"),fluid.defaults("fluid.prefs.builder",{gradeNames:["fluid.component","fluid.prefs.auxBuilder"],mergePolicy:{auxSchema:"expandedAuxSchema"},assembledPrefsEditorGrade:{expander:{func:"fluid.prefs.builder.generateGrade",args:["prefsEditor","{that}.options.auxSchema.namespace",{gradeNames:["fluid.prefs.assembler.prefsEd","fluid.viewComponent"],componentGrades:"{that}.options.constructedGrades",loaderGrades:"{that}.options.auxSchema.loaderGrades",defaultLocale:"{that}.options.auxSchema.defaultLocale",enhancer:{defaultLocale:"{that}.options.auxSchema.defaultLocale"}}]}},assembledUIEGrade:{expander:{func:"fluid.prefs.builder.generateGrade",args:["uie","{that}.options.auxSchema.namespace",{gradeNames:["fluid.viewComponent","fluid.prefs.assembler.uie"],componentGrades:"{that}.options.constructedGrades"}]}},constructedGrades:{expander:{func:"fluid.prefs.builder.constructGrades",args:["{that}.options.auxSchema",["enactors","messages","panels","initialModel","templateLoader","messageLoader","terms","aliases_prefsEditor","aliases_enhancer"]]}},mappedDefaults:"{primaryBuilder}.options.schema.properties",components:{primaryBuilder:{type:"fluid.prefs.primaryBuilder",options:{typeFilter:{expander:{func:"fluid.prefs.builder.parseAuxSchema",args:"{builder}.options.auxiliarySchema"}}}}},distributeOptions:{"builder.primaryBuilder.primarySchema":{source:"{that}.options.primarySchema",removeSource:!0,target:"{that > primaryBuilder}.options.primarySchema"}}}),fluid.defaults("fluid.prefs.assembler.uie",{gradeNames:["fluid.viewComponent"],components:{store:{type:"fluid.prefs.globalSettingsStore",options:{distributeOptions:{"uie.store.context.checkUser":{target:"{that fluid.prefs.store}.options.contextAwareness.strategy.checks.user",record:{contextValue:"{fluid.prefs.assembler.uie}.options.storeType",gradeNames:"{fluid.prefs.assembler.uie}.options.storeType"}}}}},enhancer:{type:"fluid.component",options:{gradeNames:"{that}.options.enhancerType",enhancerType:"fluid.pageEnhancer",components:{uiEnhancer:{options:{gradeNames:["{fluid.prefs.assembler.uie}.options.componentGrades.enactors","{fluid.prefs.assembler.prefsEd}.options.componentGrades.aliases_enhancer"]}}}}}},distributeOptions:{"uie.enhancer":{source:"{that}.options.enhancer",target:"{that uiEnhancer}.options",removeSource:!0},"uie.enhancer.enhancerType":{source:"{that}.options.enhancerType",target:"{that > enhancer}.options.enhancerType"},"uie.store":{source:"{that}.options.store",target:"{that fluid.prefs.store}.options"}}}),fluid.defaults("fluid.prefs.assembler.prefsEd",{gradeNames:["fluid.viewComponent","fluid.prefs.assembler.uie"],components:{prefsEditorLoader:{type:"fluid.viewComponent",container:"{fluid.prefs.assembler.prefsEd}.container",priority:"last",options:{gradeNames:["{fluid.prefs.assembler.prefsEd}.options.componentGrades.terms","{fluid.prefs.assembler.prefsEd}.options.componentGrades.messages","{fluid.prefs.assembler.prefsEd}.options.componentGrades.initialModel","{that}.options.loaderGrades"],templateLoader:{gradeNames:["{fluid.prefs.assembler.prefsEd}.options.componentGrades.templateLoader"]},messageLoader:{gradeNames:["{fluid.prefs.assembler.prefsEd}.options.componentGrades.messageLoader"]},prefsEditor:{gradeNames:["{fluid.prefs.assembler.prefsEd}.options.componentGrades.panels","{fluid.prefs.assembler.prefsEd}.options.componentGrades.aliases_prefsEditor","fluid.prefs.uiEnhancerRelay"]},events:{onReady:"{fluid.prefs.assembler.prefsEd}.events.onPrefsEditorReady"}}}},events:{onPrefsEditorReady:null,onReady:{events:{onPrefsEditorReady:"onPrefsEditorReady",onCreate:"onCreate"},args:["{that}"]}},distributeOptions:{"prefsEdAssembler.prefsEditorLoader.loaderGrades":{source:"{that}.options.loaderGrades",removeSource:!0,target:"{that > prefsEditorLoader}.options.loaderGrades"},"prefsEdAssembler.prefsEditorLoader.terms":{source:"{that}.options.terms",removeSource:!0,target:"{that prefsEditorLoader}.options.terms"},"prefsEdAssembler.prefsEditorLoader.defaultLocale":{source:"{that}.options.defaultLocale",target:"{that prefsEditorLoader}.options.defaultLocale"},"prefsEdAssembler.uiEnhancer.defaultLocale":{source:"{that}.options.defaultLocale",target:"{that uiEnhancer}.options.defaultLocale"},"prefsEdAssembler.prefsEditor":{source:"{that}.options.prefsEditor",removeSource:!0,target:"{that prefsEditor}.options"}}}),fluid.prefs.builder.generateGrade=function(name,namespace,options){var gradeName=fluid.stringTemplate("%namespace.%name",{name:name,namespace:namespace});return fluid.defaults(gradeName,options),gradeName},fluid.prefs.builder.constructGrades=function(auxSchema,gradeCategories){var constructedGrades={};return fluid.each(gradeCategories,function(category){var gradeOpts=auxSchema[category];fluid.get(gradeOpts,"gradeNames")&&(constructedGrades[category]=fluid.prefs.builder.generateGrade(category,auxSchema.namespace,gradeOpts))}),constructedGrades},fluid.prefs.builder.parseAuxSchema=function(auxSchema){var auxTypes=[];return fluid.each(auxSchema,function(field){var type=field.type;type&&auxTypes.push(type)}),auxTypes},fluid.prefs.create=function(container,options){options=options||{};var builder=fluid.prefs.builder(options.build);return fluid.invokeGlobalFunction(builder.options.assembledPrefsEditorGrade,[container,options.prefsEditor])}}(jQuery,fluid_3_0_0);fluid_3_0_0=fluid_3_0_0||{};!function($,fluid){"use strict";fluid.prefs.builder({gradeNames:["fluid.prefs.auxSchema.starter"]}),fluid.defaults("fluid.uiOptions.prefsEditor",{gradeNames:["fluid.prefs.constructed.prefsEditor"],lazyLoad:!1,distributeOptions:{"uio.separatedPanel.lazyLoad":{record:"{that}.options.lazyLoad",target:"{that separatedPanel}.options.lazyLoad"},"uio.uiEnhancer.tocTemplate":{source:"{that}.options.tocTemplate",target:"{that uiEnhancer > tableOfContents}.options.tocTemplate"},"uio.uiEnhancer.tocMessage":{source:"{that}.options.tocMessage",target:"{that uiEnhancer > tableOfContents}.options.tocMessage"},"uio.uiEnhancer.ignoreForToC":{source:"{that}.options.ignoreForToC",target:"{that uiEnhancer > tableOfContents}.options.ignoreForToC"}}})}(jQuery,fluid_3_0_0);
//# sourceMappingURL=infusion-uio-no-jquery.min.js.map