infusion
Version:
Infusion is an application framework for developing flexible stuff with JavaScript
32 lines • 736 kB
JavaScript
/*!
* infusion - v4.8.0
*
* Build Info:
* branch: HEAD
* revision: 60d89fe69
* build date: 2025-01-15T10:41:55-05:00Z
* excludes: jquery, jquery-ui
*/
"use strict";var fluid=fluid||{};fluid.XMLP=function(strXML){return fluid.XMLP.XMLPImpl(strXML)};fluid.XMLP.closedTags={abbr:true,br:true,col:true,img:true,input:true,link:true,meta:true,param:true,hr:true,area:true,embed:true};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}if(fluid.XMLP._STATE_DOCUMENT===that.m_iState){if(fluid.XMLP._ELM_B==iEvent||fluid.XMLP._ELM_EMP==iEvent){that.m_stack[stack.length]=that.getName()}if(fluid.XMLP._ELM_E==iEvent||fluid.XMLP._ELM_EMP==iEvent){if(stack.length===0){return fluid.XMLP._NONE}var strTop=fluid.peek(stack);that.m_stack.length--;if(strTop===null||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);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_CDATA)}fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB,iE);that.m_iP=iE+3;return fluid.XMLP._CDATA};fluid.XMLP._parseComment=function(that,iB){var iE=that.m_xml.indexOf("-"+"->",iB);if(iE==-1){return 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;return fluid.XMLP._COMMENT};fluid.XMLP._parseDTD=function(that,iB){var iE,strClose,iInt,iLast;iE=that.m_xml.indexOf(">",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_DTD)}iInt=that.m_xml.indexOf("[",iB);strClose=iInt!=-1&&iInt<iE?"]>":">";while(true){if(iE==iLast){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_INFINITELOOP)}iLast=iE;iE=that.m_xml.indexOf(strClose,iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_DTD)}if(that.m_xml.substring(iE-1,iE+2)!="]]>"){break}}that.m_iP=iE+strClose.length;return fluid.XMLP._DTD};fluid.XMLP._parsePI=function(that,iB){var iE,iTB,iTE,iCB,iCE;iE=that.m_xml.indexOf("?>",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_PI)}iTB=fluid.SAXStrings.indexOfNonWhitespace(that.m_xml,iB,iE);if(iTB==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_PI_TARGET)}iTE=fluid.SAXStrings.indexOfWhitespace(that.m_xml,iTB,iE);if(iTE==-1){iTE=iE}iCB=fluid.SAXStrings.indexOfNonWhitespace(that.m_xml,iTE,iE);if(iCB==-1){iCB=iE}iCE=fluid.SAXStrings.lastIndexOfNonWhitespace(that.m_xml,iCB,iE);if(iCE==-1){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;return fluid.XMLP._PI};fluid.XMLP._parseText=function(that,iB){var iE=that.m_xml.indexOf("<",iB);if(iE==-1){iE=that.m_xml.length}fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB,iE);that.m_iP=iE;return fluid.XMLP._TEXT};fluid.XMLP._setContent=function(that,iSrc){var args=arguments;if(fluid.XMLP._CONT_XML==iSrc){that.m_cAlt=null;that.m_cB=args[2];that.m_cE=args[3]}else{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];that.m_cAlt=strErr;that.m_cB=0;that.m_cE=strErr.length;that.m_cSrc=fluid.XMLP._CONT_ALT;return fluid.XMLP._ERROR};fluid.XMLP._parseElement=function(that,iB){var iE,iDE,iRet;var iType,strN,iLast;iDE=iE=that.m_xml.indexOf(">",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_ELM)}if(that.m_xml.charAt(iB)=="/"){iType=fluid.XMLP._ELM_E;iB++}else{iType=fluid.XMLP._ELM_B}if(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)}strN=nameMatch[1].toLowerCase();if("li"===strN&&iType!==fluid.XMLP._ELM_E&&that.m_stack.length>0&&fluid.peek(that.m_stack)==="li"&&!that.m_emitSynthetic){that.m_name="li";that.m_emitSynthetic=true;return fluid.XMLP._ELM_E}that.m_attributes={};that.m_cAlt="";if(that.nameRegex.lastIndex<iDE){that.m_iP=that.nameRegex.lastIndex;while(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 attrname=attrMatch[1].toLowerCase();var attrval;if(that.m_xml.charCodeAt(that.attrStartRegex.lastIndex)===61){var valRegex=that.m_xml.charCodeAt(that.attrStartRegex.lastIndex+1)===34?that.attrValRegex:that.attrValIERegex;valRegex.lastIndex=that.attrStartRegex.lastIndex+1;attrMatch=valRegex.exec(that.m_xml);if(!attrMatch){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){that.m_attributes[attrname]=attrval}else{return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ATT_DUP)}that.m_iP=valRegex.lastIndex}}if(strN.indexOf("<")!=-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_LT_NAME)}that.m_name=strN;that.m_iP=iE+1;if(fluid.XMLP.closedTags[strN]){that.closeRegex.lastIndex=iE+1;var closeMatch=that.closeRegex.exec;if(closeMatch){var matchclose=that.m_xml.indexOf(strN,closeMatch.lastIndex);if(matchclose===closeMatch.lastIndex){return iType}else{return fluid.XMLP._ELM_EMP}}}that.m_emitSynthetic=false;return iType};fluid.XMLP._parse=function(that){var iP=that.m_iP;var xml=that.m_xml;if(iP===xml.length){return fluid.XMLP._NONE}var c=xml.charAt(iP);if(c==="<"){var c2=xml.charAt(iP+1);if(c2==="?"){return fluid.XMLP._parsePI(that,iP+2)}else if(c2==="!"){if(iP===xml.indexOf("<!DOCTYPE",iP)){return fluid.XMLP._parseDTD(that,iP+9)}else if(iP===xml.indexOf("\x3c!--",iP)){return fluid.XMLP._parseComment(that,iP+4)}else if(iP===xml.indexOf("<![CDATA[",iP)){return fluid.XMLP._parseCDATA(that,iP+9)}}else{return fluid.XMLP._parseElement(that,iP+1)}}else{return fluid.XMLP._parseText(that,iP)}};fluid.XMLP.XMLPImpl=function(strXML){var that={};that.m_xml=strXML;that.m_iP=0;that.m_iState=fluid.XMLP._STATE_PROLOG;that.m_stack=[];that.m_attributes={};that.m_emitSynthetic=false;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;return 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");arrD.length--;var iLinePos=arrD.join("\n").length;return iP-iLinePos};fluid.SAXStrings.getLineNumber=function(strD,iP){if(!strD){return-1}iP=iP||strD.length;return strD.substring(0,iP).split("\n").length};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!==" "&&c!=="\t"&&c!=="\n"&&c!=="\r")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(fluid.SAXStrings.WHITESPACE.indexOf(strD.charAt(i))!=-1){return i}}return-1};fluid.SAXStrings.lastIndexOfNonWhitespace=function(strD,iB,iE){if(!strD){return-1}iB=iB||0;iE=iE||strD.length;for(var i=iE-1;i>=iB;i--){if(fluid.SAXStrings.WHITESPACE.indexOf(strD.charAt(i))==-1){return i}}return-1};fluid.SAXStrings.replace=function(strD,iB,iE,strF,strR){if(!strD){return""}iB=iB||0;iE=iE||strD.length;return strD.substring(iB,iE).split(strF).join(strR)};(function(){var module={exports:null};function Hypher(language){var exceptions=[],i=0;this.trie=this.createTrie(language["patterns"]);this.leftMin=language["leftmin"];this.rightMin=language["rightmin"];this.exceptions={};if(language["exceptions"]){exceptions=language["exceptions"].split(/,\s?/g);for(;i<exceptions.length;i+=1){this.exceptions[exceptions[i].replace(/\u2027/g,"").toLowerCase()]=new RegExp("("+exceptions[i].split("‧").join(")(")+")","i")}}}Hypher.TrieNode;Hypher.prototype.createTrie=function(patternObject){var size=0,i=0,c=0,p=0,chars=null,points=null,codePoint=null,t=null,tree={_points:[]},patterns;for(size in patternObject){if(patternObject.hasOwnProperty(size)){patterns=patternObject[size].match(new RegExp(".{1,"+ +size+"}","g"));for(i=0;i<patterns.length;i+=1){chars=patterns[i].replace(/[0-9]/g,"").split("");points=patterns[i].split(/\D/);t=tree;for(c=0;c<chars.length;c+=1){codePoint=chars[c].charCodeAt(0);if(!t[codePoint]){t[codePoint]={}}t=t[codePoint]}t._points=[];for(p=0;p<points.length;p+=1){t._points[p]=points[p]||0}}}}return tree};Hypher.prototype.hyphenateText=function(str,minLength){minLength=minLength||4;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);for(var i=0;i<words.length;i+=1){if(words[i].indexOf("/")!==-1){if(i!==0&&i!==words.length-1&&!/\s+\/|\/\s+/.test(words[i])){words[i]+=""}}else if(words[i].length>minLength){words[i]=this.hyphenate(words[i]).join("")}}return words.join("")};Hypher.prototype.hyphenate=function(word){var characters,characterPoints=[],originalCharacters,i,j,k,node,points=[],wordLength,lowerCaseWord=word.toLowerCase(),nodePoints,nodePointsLength,m=Math.max,trie=this.trie,result=[""];if(this.exceptions.hasOwnProperty(lowerCaseWord)){return word.match(this.exceptions[lowerCaseWord]).slice(1)}if(word.indexOf("")!==-1){return[word]}word="_"+word+"_";characters=word.toLowerCase().split("");originalCharacters=word.split("");wordLength=characters.length;for(i=0;i<wordLength;i+=1){points[i]=0;characterPoints[i]=characters[i].charCodeAt(0)}for(i=0;i<wordLength;i+=1){node=trie;for(j=i;j<wordLength;j+=1){node=node[characterPoints[j]];if(node){nodePoints=node._points;if(nodePoints){for(k=0,nodePointsLength=nodePoints.length;k<nodePointsLength;k+=1){points[i+k]=m(points[i+k],nodePoints[k])}}}else{break}}}for(i=1;i<wordLength-1;i+=1){if(i>this.leftMin&&i<wordLength-this.rightMin&&points[i]%2){result.push(originalCharacters[i])}else{result[result.length-1]+=originalCharacters[i]}}return result};module.exports=Hypher;window["Hypher"]=module.exports;window["Hypher"]["languages"]={}})();(function($){$.fn.hyphenate=function(language){if(window["Hypher"]["languages"][language]){return this.each((function(){var i=0,len=this.childNodes.length;for(;i<len;i+=1){if(this.childNodes[i].nodeType===3){this.childNodes[i].nodeValue=window["Hypher"]["languages"][language].hyphenateText(this.childNodes[i].nodeValue)}}}))}}})(jQuery);(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof module!=="undefined"&&module.exports){module.exports=factory(require("jquery"))}else{factory(jQuery)}})((function($){"use strict";var $scrollTo=$.scrollTo=function(target,duration,settings){return $(window).scrollTo(target,duration,settings)};$scrollTo.defaults={axis:"xy",duration:0,limit:true};function isWin(elem){return!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),["iframe","#document","html","body"])!==-1}function isFunction(obj){return typeof obj==="function"}$.fn.scrollTo=function(target,duration,settings){if(typeof duration==="object"){settings=duration;duration=0}if(typeof settings==="function"){settings={onAfter:settings}}if(target==="max"){target=9e9}settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.duration;var queue=settings.queue&&settings.axis.length>1;if(queue){duration/=2}settings.offset=both(settings.offset);settings.over=both(settings.over);return this.each((function(){if(target===null)return;var win=isWin(this),elem=win?this.contentWindow||window:this,$elem=$(elem),targ=target,attr={},toff;switch(typeof targ){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=win?$(targ):$(targ,elem);case"object":if(targ.length===0)return;if(targ.is||targ.style){toff=(targ=$(targ)).offset()}}var offset=isFunction(settings.offset)&&settings.offset(elem,targ)||settings.offset;$.each(settings.axis.split(""),(function(i,axis){var Pos=axis==="x"?"Left":"Top",pos=Pos.toLowerCase(),key="scroll"+Pos,prev=$elem[key](),max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:prev-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css("margin"+Pos),10)||0;attr[key]-=parseInt(targ.css("border"+Pos+"Width"),10)||0}attr[key]+=offset[pos]||0;if(settings.over[pos]){attr[key]+=targ[axis==="x"?"width":"height"]()*settings.over[pos]}}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)==="%"?parseFloat(val)/100*max:val}if(settings.limit&&/^\d+$/.test(attr[key])){attr[key]=attr[key]<=0?0:Math.min(attr[key],max)}if(!i&&settings.axis.length>1){if(prev===attr[key]){attr={}}else if(queue){animate(settings.onAfterFirst);attr={}}}}));animate(settings.onAfter);function animate(callback){var opts=$.extend({},settings,{queue:true,duration:duration,complete:callback&&function(){callback.call(elem,targ,settings)}});$elem.animate(attr,opts)}}))};$scrollTo.max=function(elem,axis){var Dim=axis==="x"?"Width":"Height",scroll="scroll"+Dim;if(!isWin(elem))return elem[scroll]-$(elem)[Dim.toLowerCase()]();var size="client"+Dim,doc=elem.ownerDocument||elem.document,html=doc.documentElement,body=doc.body;return Math.max(html[scroll],body[scroll])-Math.min(html[size],body[size])};function both(val){return isFunction(val)||$.isPlainObject(val)?val:{top:val,left:val}}$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(t){return $(t.elem)[t.prop]()},set:function(t){var curr=this.get(t);if(t.options.interrupt&&t._last&&t._last!==curr){return $(t.elem).stop()}var next=Math.round(t.now);if(curr!==next){$(t.elem)[t.prop](next);t._last=this.get(t)}}};return $scrollTo}));
/*!
* jQuery UI Touch Punch 0.2.3
*
* Copyright 2011–2014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
(function($){$.support.touch="ontouchend"in document;if(!$.support.touch){return}var mouseProto=$.ui.mouse.prototype,_mouseInit=mouseProto._mouseInit,_mouseDestroy=mouseProto._mouseDestroy,touchHandled;function simulateMouseEvent(event,simulatedType){if(event.originalEvent.touches.length>1){return}event.preventDefault();var touch=event.originalEvent.changedTouches[0],simulatedEvent=document.createEvent("MouseEvents");simulatedEvent.initMouseEvent(simulatedType,true,true,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,false,false,false,false,0,null);event.target.dispatchEvent(simulatedEvent)}mouseProto._touchStart=function(event){var self=this;if(touchHandled||!self._mouseCapture(event.originalEvent.changedTouches[0])){return}touchHandled=true;self._touchMoved=false;simulateMouseEvent(event,"mouseover");simulateMouseEvent(event,"mousemove");simulateMouseEvent(event,"mousedown")};mouseProto._touchMove=function(event){if(!touchHandled){return}this._touchMoved=true;simulateMouseEvent(event,"mousemove")};mouseProto._touchEnd=function(event){if(!touchHandled){return}simulateMouseEvent(event,"mouseup");simulateMouseEvent(event,"mouseout");if(!this._touchMoved){simulateMouseEvent(event,"click")}touchHandled=false};mouseProto._mouseInit=function(){var self=this;self.element.bind({touchstart:$.proxy(self,"_touchStart"),touchmove:$.proxy(self,"_touchMove"),touchend:$.proxy(self,"_touchEnd")});_mouseInit.call(self)};mouseProto._mouseDestroy=function(){var self=this;self.element.unbind({touchstart:$.proxy(self,"_touchStart"),touchmove:$.proxy(self,"_touchMove"),touchend:$.proxy(self,"_touchEnd")});_mouseDestroy.call(self)}})(jQuery);
/*!
* Fluid Infusion v4.8.0
*
* Infusion is distributed under the Educational Community License 2.0 and new BSD licenses:
* http://wiki.fluidproject.org/display/fluid/Fluid+Licensing
*
* Copyright The Infusion copyright holders
* See the AUTHORS.md file at the top-level directory of this distribution and at
* https://github.com/fluid-project/infusion/raw/main/AUTHORS.md
*/
"use strict";var fluid=fluid||{};fluid.version="Infusion 4.8.0";fluid.Error=Error;fluid.environment={fluid:fluid};fluid.global=fluid.global||typeof window!=="undefined"?window:typeof self!=="undefined"?self:{};fluid.invokeLater=function(func){return setTimeout(func,0)};fluid.defeatLogging=true;fluid.activityTracing=false;fluid.activityTrace=[];var activityParser=/(%\w+)/g;fluid.renderActivityArgument=function(arg){if(fluid.isComponent(arg)){return fluid.dumpComponentAndPath(arg)}else{return arg}};fluid.renderOneActivity=function(activity,nowhile){var togo=nowhile===true?[]:[" while "];var message=activity.message;var index=activityParser.lastIndex=0;while(true){var match=activityParser.exec(message);if(match){var key=match[1].substring(1);togo.push(message.substring(index,match.index));togo.push(fluid.renderActivityArgument(activity.args[key]));index=activityParser.lastIndex}else{break}}if(index<message.length){togo.push(message.substring(index))}return togo};fluid.renderActivity=function(activityStack,renderer){renderer=renderer||fluid.renderOneActivity;return fluid.transform(activityStack,renderer)};fluid.singleThreadLocal=function(initFunc){var value=initFunc();return function(newValue){return newValue===undefined?value:value=newValue}};fluid.threadLocal=fluid.singleThreadLocal;fluid.globalThreadLocal=fluid.threadLocal((function(){return{}}));fluid.getActivityStack=function(){var root=fluid.globalThreadLocal();if(!root.activityStack){root.activityStack=[]}return root.activityStack};fluid.describeActivity=fluid.getActivityStack;fluid.logActivity=function(activity){activity=activity||fluid.describeActivity();var rendered=fluid.renderActivity(activity).reverse();if(rendered.length>0){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()};if(fluid.activityTracing){fluid.activityTrace.push(record)}if(fluid.passLogLevel(fluid.logLevel.TRACE)){fluid.log.apply(null,fluid.renderOneActivity(record,true))}var activityStack=fluid.getActivityStack();activityStack.push(record)};fluid.popActivity=function(popframes){popframes=popframes||1;if(fluid.activityTracing){fluid.activityTrace.push({pop:popframes})}var activityStack=fluid.getActivityStack();var 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 arg===undefined?"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(...messages){var activity=fluid.makeArray(fluid.describeActivity());fluid.popActivity(activity.length);if(fluid.failureEvent){fluid.failureEvent.fire(messages,activity)}else{fluid.logFailure(messages,activity);fluid.builtinFail(messages,activity)}};fluid.notrycatch=false;fluid.tryCatch=function(tryfun,catchfun,finallyfun){finallyfun=finallyfun||fluid.identity;if(fluid.notrycatch){var togo=tryfun();finallyfun();return togo}else{try{return tryfun()}catch(e){if(catchfun){catchfun(e)}else{throw e}}finally{finallyfun()}}};fluid.expect=function(name,target,members){fluid.transform(fluid.makeArray(members),(function(key){if(target[key]===undefined){fluid.fail(name+" missing required member "+key)}}))};fluid.isLogging=function(){return logLevelStack[0].priority>fluid.logLevel.IMPORTANT.priority};fluid.isLogLevel=function(arg){return fluid.isMarker(arg)&&arg.priority!==undefined};fluid.passLogLevel=function(testLogLevel){return testLogLevel.priority<=logLevelStack[0].priority};fluid.setLogging=function(enabled){var logLevel;if(typeof enabled==="boolean"){logLevel=fluid.logLevel[enabled?"INFO":"IMPORTANT"]}else if(fluid.isLogLevel(enabled)){logLevel=enabled}else{fluid.fail("Unrecognised fluid logging level ",enabled)}logLevelStack.unshift(logLevel);fluid.defeatLogging=!fluid.isLogging()};fluid.setLogLevel=fluid.setLogging;fluid.popLogging=function(){var togo=logLevelStack.length===1?logLevelStack[0]:logLevelStack.shift();fluid.defeatLogging=!fluid.isLogging();return togo};fluid.doBrowserLog=function(args){if(typeof console!=="undefined"){if(console.debug){console.debug.apply(console,args)}else if(typeof console.log==="function"){console.log.apply(console,args)}}};fluid.log=function(){var directArgs=fluid.makeArray(arguments);var userLogLevel=fluid.logLevel.INFO;if(fluid.isLogLevel(directArgs[0])){userLogLevel=directArgs.shift()}if(fluid.passLogLevel(userLogLevel)){fluid.loggingEvent.fire(directArgs)}};fluid.isValue=function(value){return value!==undefined&&value!==null};fluid.isPrimitive=function(value){var valueType=typeof value;return!value||valueType==="string"||valueType==="boolean"||valueType==="number"||valueType==="function"};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.prototype.toString.call(totest)==="[object Array]"||fluid.isJQuery(totest))};fluid.isPlainObject=function(totest,strict){var string=Object.prototype.toString.call(totest);if(string==="[object Array]"){return!strict}else if(string!=="[object Object]"){return false}return!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 typeof ref==="string"&&ref.charAt(0)==="{"};fluid.isReferenceOrExpander=function(ref){return ref&&(fluid.isIoCReference(ref)||ref.expander)};fluid.isDOMNode=function(obj){return obj&&typeof obj.nodeType==="number"};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&&typeof totest.apply==="function"};fluid.identity=function(arg){return arg};fluid.notImplemented=function(){fluid.fail("This operation is not implemented")};fluid.firstDefined=function(a,b){return a===undefined?b:a};fluid.freshContainer=function(tocopy){return fluid.isArrayable(tocopy)?[]:{}};fluid.testStrategyRecursion=function(funcName,segs){if(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){fluid.testStrategyRecursion("fluid.copy",segs);if(fluid.isUncopyable(tocopy)){return tocopy}else{return fluid.transform(tocopy,(function(value,key){segs.push(key);var togo=fluid.copyRecurse(value,segs);segs.pop();return togo}))}};fluid.copy=function(tocopy){return fluid.copyRecurse(tocopy,[])};fluid.extend=$.extend;fluid.makeArray=function(arg){var togo=[];if(arg!==null&&arg!==undefined){if(fluid.isPrimitive(arg)||fluid.isPlainObject(arg,true)||typeof arg.length!=="number"){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]=[];if(Array.isArray(topush)){array.push.apply(array,topush)}else{array.push(topush)}};function transformInternal(source,togo,key,transformations){var transit=source[key];for(var j=0;j<transformations.length;++j){transit=transformations[j](transit,key)}if(transit!==fluid.NO_VALUE){togo[key]=transit}}fluid.transform=function(source,...transformations){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,transformations)}}else{for(var key in source){transformInternal(source,togo,key,transformations)}}return togo};fluid.forEachInRange=function(array,start,end,func){for(var i=start;i<end;++i){func(array[i],i)}};fluid.peek=function(array){return array.length===0?undefined:array[array.length-1]};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?false:undefined;return function(source,func,deffolt){var disp;if(fluid.isArrayable(source)){for(var i=0;i<source.length;++i){disp=func(source[i],i);if(disp!==target){return find_if?source[i]:disp}}}else{for(var key in source){disp=func(source[key],key);if(disp!==target){return find_if?source[key]:disp}}}return deffolt}};fluid.find=fluid.make_find(false);fluid.find_if=fluid.make_find(true);fluid.remove_if=function(source,fn,target){if(fluid.isArrayable(source)){for(var i=source.length-1;i>=0;--i){if(fn(source[i],i)){if(target){target.unshift(source[i])}source.splice(i,1)}}}else{for(var key in source){if(fn(source[key],key)){if(target){target[key]=source[key]}delete source[key]}}}return target||source};fluid.generate=function(n,generator,applyFunc){var togo=[];for(var i=0;i<n;++i){togo[i]=applyFunc?generator(i):generator}return togo};fluid.iota=function(count,first){first=first||0;var togo=[];for(var 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^keys.indexOf(key)===-1}))};fluid.censorKeys=function(toCensor,keys){return fluid.filterKeys(toCensor,keys,true)};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.keyForValue=function(obj,value){return fluid.find(obj,(function(thisValue,key){if(value===thisValue){return key}}))};fluid.arrayToHash=function(array){var togo={};fluid.each(array,(function(el){togo[el]=true}));return togo};fluid.hashToArray=function(hash,keyName,func){var togo=[];fluid.each(hash,(function(el,key){var newEl=el;if(keyName!==undefined){newEl={};newEl[keyName]=key}if(func){newEl=func(newEl,el,key)||newEl}else if(newEl!==el){$.extend(true,newEl,el)}togo.push(newEl)}));return togo};fluid.flatten=function(array){var togo=[];fluid.each(array,(function(element){if(fluid.isArrayable(element)){togo=togo.concat(element)}else{togo.push(element)}}));return 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){scale=scale&&scale>=0?Math.round(scale):0;if(method==="ceil"||method==="floor"){return Number(Math[method](num+"e"+scale)+"e-"+scale)}else{var sign=num>=0?1:-1;return Number(sign*(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;var later=function(){timeout=null;if(!immediate){result=func.apply(context,args)}};var callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args)}return result}};fluid.freezeRecursive=function(tofreeze,segs){segs=segs||[];fluid.testStrategyRecursion("fluid.freezeRecursive",segs);if(fluid.isPlainObject(tofreeze)){fluid.each(tofreeze,(function(value,key){segs.push(key);fluid.freezeRecursive(value,segs);segs.pop()}));return Object.freeze(tofreeze)}else{return tofreeze}};fluid.marker=function(){};fluid.makeMarker=function(value,extra){var togo=Object.create(fluid.marker.prototype);togo.value=value;fluid.extend(togo,extra);return Object.freeze(togo)};fluid.NO_VALUE=fluid.makeMarker("NO_VALUE");fluid.EXPAND=fluid.makeMarker("EXPAND");fluid.isMarker=function(totest,type){if(!(totest instanceof fluid.marker)){return false}if(!type){return true}return 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(true,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 lastdot===-1?"":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(togo!==undefined){return togo}}if(create&&root[segment]===undefined){return root[segment]={}}return root[segment]};fluid.model.parseToSegments=function(EL,parseEL,copy){return typeof EL==="number"||typeof EL==="string"?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);var initPos=0;if(initSegs){initPos=initSegs.length;segs=initSegs.concat(segs)}var uncess=newValue===fluid.NO_VALUE?0:1;root=traverser(root,segs,initPos,config,uncess);if(newValue===fluid.NO_VALUE){return returnSegs?{root:root,segs:segs}:root}else{root[fluid.peek(segs)]=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){var origEnv=environment;var limit=segs.length-uncess;for(var i=0;i<limit;++i){if(!root){return undefined}var segment=segs[i];if(environment&&environment[segment]){root=environment[segment]}else{root=fluid.model.resolvePathSegment(root,segment,uncess===1,origEnv)}environment=null}return root};fluid.model.setSimple=function(root,EL,newValue,environment,initSegs){fluid.model.accessSimple(root,EL,newValue,environment,initSegs,false)};fluid.model.getSimple=function(root,EL,environment,initSegs){if(EL===null||EL===undefined||EL.length===0){return root}return fluid.model.accessSimple(root,EL,fluid.NO_VALUE,environment,initSegs,false)};fluid.getImmediate=function(root,segs,i){var limit=i===undefined?segs.length:i+1;for(var j=0;j<limit;++j){root=root?root[segs[j]]:undefined}return root};fluid.decodeAccessorArg=function(arg3){return!arg3||arg3===fluid.model.defaultGetConfig||arg3===fluid.model.defaultSetConfig?null:arg3.type==="environment"?arg3.value:undefined};fluid.set=function(root,EL,newValue,config,initSegs){var env=fluid.decodeAccessorArg(config);if(env===undefined){fluid.model.setWithStrategy(root,EL,newValue,config,initSegs)}else{fluid.model.setSimple(root,EL,newValue,env,initSegs)}};fluid.get=function(root,EL,config,initSegs){var env=fluid.decodeAccessorArg(config);return env===undefined?fluid.model.getWithStrategy(root,EL,config,initSegs):fluid.model.accessImpl(root,EL,fluid.NO_VALUE,env,null,false,fluid.model.traverseSimple)};fluid.getGlobalValue=function(path,env){if(path){env=env||fluid.environment;return fluid.get(fluid.global,path,{type:"environment",value:env})}};fluid.bind=function(obj,fnName,args){return obj[fnName].apply(obj,fluid.makeArray(args))};fluid.proxyComponentArgs=fluid.identity;fluid.invokeGlobalFunction=function(functionPath,args,environment){var func=fluid.getGlobalValue(functionPath,environment);if(!func){fluid.fail("Error invoking global function: "+functionPath+" could not be located")}else{var argsArray=fluid.isArrayable(args)?args:fluid.makeArray(args);fluid.proxyComponentArgs(argsArray);return func.apply(null,argsArray)}};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(path,env){env=env||fluid.environment;var existing=fluid.getGlobalValue(path,env);if(!existing){existing={};fluid.setGlobalValue(path,existing,env)}return existing};fluid.dumpEl=fluid.identity;fluid.renderTimestamp=fluid.identity;fluid.generateUniquePrefix=function(){return Math.floor(Math.random()*1e12).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,transaction:10,testing:20,authoring:30};fluid.parsePriorityConstraint=function(constraint,fixedOnly,site){var segs=constraint.split(":");var type=segs[0];var lookup=fluid.priorityTypes[type];if(lookup===undefined){fluid.fail("Invalid constraint type in priority field "+constraint+": the only supported values are "+fluid.keys(fluid.priorityTypes).join(", ")+" or numeric")}if(fixedOnly&&lookup===0){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")}return{type:segs[0],target:segs[1]}};fluid.parsePriority=function(priority,count,fixedOnly,site){priority=priority||0;var togo={count:count||0,fixed:null,constraint:null,site:site};if(typeof priority==="number"){togo.fixed=-priority}else{togo.constraint=fluid.parsePriorityConstraint(priority,fixedOnly,site)}var multiplier=togo.constraint?fluid.priorityTypes[togo.constraint.type]:0;if(multiplier!==0){var target=togo.constraint.target||"none";var extremal=fluid.extremalPriorities[target];if(extremal===undefined){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)}if(togo.fixed!==null){togo.fixed+=togo.count/1024}return 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){if(recA.priority.fixed!==null&&recB.priority.fixed!==null){return recA.priority.fixed-recB.priority.fixed}else{return(recA.priority.fixed===null)-(recB.priority.fixed===null)}};fluid.honourConstraint=function(array,firstConstraint,c){var constraint=array[c].priority.constraint;var matchIndex=fluid.find(array,(function(element,index){return element.namespace===constraint.target?index:undefined}),-1);if(matchIndex===-1){return true}else if(matchIndex>=firstConstraint){return false}else{var offset=constraint.type==="after"?1:0;var target=matchIndex+offset;var temp=array[c];for(var shift=c;shift>=target;--shift){array[shift]=array[shift-1]}array[target]=temp;return true}};fluid.sortByPriority=function(array){array.sort(fluid.compareByPriority);var firstConstraint=fluid.find(array,(function(element,index){return element.priority.constraint&&fluid.priorityTypes[element.priority.constraint.type]===0?index:undefined}),array.length);while(true){if(firstConstraint===array.length){return array}var oldFirstConstraint=firstConstraint;for(var c=firstConstraint;c<array.length;++c){var applied=fluid.honourConstraint(array,firstConstraint,c);if(applied){++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,false,name)}));fluid.sortByPriority(array);return array};fluid.event.identifyListener=function(listener,soft){if(typeof listener!=="string"&&!listener.$$fluid_guid&&!soft){listener.$$fluid_guid=fluid.allocateGuid()}return 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=[];fluid.each(listeners,(function(oneNamespace){var headHard;for(var i=0;i<oneNamespace.length;++i){var thisListener=oneNamespace[i];if(!thisListener.softNamespace&&!headHard){headHard=thisListener}}if(headHard){togo.push(headHard)}else{togo=togo.concat(oneNamespace)}}));return fluid.sortByPriority(togo)};fluid.event.resolveListener=function(listener){var listenerName=listener.globalName||(typeof listener==="string"?listener:null);if(listenerName){var listenerFunc=fluid.getGlobalValue(listenerName);if(!listenerFunc){fluid.fail("Unable to look up name "+listenerName+" as a global function")}else{listener=listenerFunc}}return listener};fluid.nameComponent=function(that){return that?fluid.dumpComponentAndPath(that):"[unknown component]"};fluid.event.nameEvent=function(that,eventName){return eventName+" of "+fluid.nameComponent(that)};fluid.event.firer=function(){};fluid.makeEventFirer=function(options){options=options||{};var name=options.name||"<anonymous>";var that;var lazyInit=function(){that.listeners={};that.byId={};that.sortedListeners=[];that.onDestroy=null;that.addListener=function(listener,namespace,priority,softNamespace,listenerId){var record;if(that.destroyed){fluid.fail("Cannot add listener to destroyed event firer "+that.name)}if(!listener){return}if(fluid.isPlainObject(listener,true)&&!fluid.isApplicable(listener)){record=listener;listener=record.listener;namespace=record.namespace;priority=record.priority;softNamespace=record.softNamespace;listenerId=record.listenerId}if(typeof listener==="string"){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,false,"listeners")});that.byId[id]=record;var thisListeners=that.listeners[namespace]=fluid.makeArray(that.listeners[namespace]);thisListeners[softNamespace?"push":"unshift"](record);that.sortedListeners=fluid.event.sortListeners(that.listeners)};that.addListener.apply(null,arguments)};that=Object.create(fluid.event.firer.prototype);fluid.extend(that,{eventId:fluid.allocateGuid(),name:name,ownerId:options.ownerId,typeName:"fluid.event.firer",destroy:function(){that.destroyed=true;fluid.each(that.onDestroy,(function(func){func()}))},addListener:function(){lazyInit.apply(null,arguments)},removeListener:function(listener){if(!that.listeners){return}var namespace,id,record;if(typeof listener==="string"){namespace=listener;record=that.listeners[namespace];if(!record){id=namespace;namespace=null}}else if(typeof listener==="function"){id=fluid.event.identifyListener(listener,true);if(!id){fluid.fail("Cannot remove unregistered listener function ",listener," from event "+that.name)}}var rec=that.byId[id];var softNamespace=rec&&rec.softNamespace;namespace=namespace||rec&&rec.namespace||id;delete that.byId[id];record=that.listeners[namespace];if(record){if(softNamespace){fluid.remove_if(record,(function(thisLis){return thisLis.listener.$$fluid_guid===id||thisLis.listenerId===id}))}else{record.shift()}if(record.length===0){delete that.listeners[namespace]}}that.sortedListeners=fluid.event.sortListeners(that.listeners)},fire:function(){var listeners=that.sortedListeners;if(options.promise){that.promisePayload=arguments[0]}if(!listeners||that.destroyed){return}for(var i=0;i<listeners.length;++i){var lisrec=listeners[i];if(typeof lisrec.listener!=="function"){lisrec.listener=fluid.event.resolveListener(lisrec.listener)}var listener=lisrec.listener;var ret=listener.apply(null,arguments);var value;if(options.preventable&&ret===false||that.destroyed){value=false}if(value!==undefined){return value}}}});if(options.promise){that.then=function(func){if("promisePayload"in that){func(that.promisePayload)}else{that.addListener(func)}}}return that};fluid.event.addPrimitiveListener=function(holder,name,func){var existing=holder[name];if(!existing){existing=holder[name]=[]}existing.push(func)};fluid.fireEvent=function(component,eventName,args){var firer=component.events&&component.events[eventName];if(firer){firer.fire.apply(null,fluid.makeArray(args))}};fluid.event.addListenerToFirer=function(firer,value,namespace,wrapper){wrapper=wrapper||fluid.identity;if(fluid.isArrayable(value)){for(var i=0;i<value.length;++i){fluid.event.addListenerToFirer(firer,value[i],namespace,wrapper)}}else if(typeof value==="function"||typeof value==="string"){wrapper(firer).addListener(value,namespace)}else if(value&&typeof value==="object"){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);if(!firer){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(".");if(keydot!==-1){namespace=key.substring(keydot+1);key=key.substring(0,keydot)}if(!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,true);fluid.event.addListenerToFirer(firer,record.records,namespace,record.adderWrapper)}))};fluid.eventFromRecord=function(eventSpec,eventKey,that){var isIoCEvent=eventSpec&&(typeof eventSpec!=="string"||fluid.isIoCReference(eventSpec));var event;if(isIoCEvent){if(!fluid.event.resolveEvent){fluid.fail("fluid.event.resolveEvent could not be loaded - please include FluidIoC.js in order to operate IoC-driven event with descriptor ",eventSpec)}else{event=fluid.event.resolveEvent(that,eventKey,eventSpec)}}else{event=fluid.makeEventFirer({name:fluid.event.nameEvent(that,eventKey),preventable:eventSpec==="preventable",promise:eventSpec==="promise",ownerId:that.id})}return event};fluid.mergeListenerPolicy=function(target,source,key){if(typeof key!=="string"){fluid.fail("Error in listeners declaration - the keys in this structure must resolve to event names - got "+key+" from ",source)}var hasNamespace=!fluid.isIoCReference(key)&&key.indexOf(".")!==-1;return hasNamespace?source||target:fluid.arrayConcatPolicy(target,source)};fluid.makeMergeListenersPolicy=function(merger,modelRelay){return function(target,source){target=target||{};if(modelRelay&&(fluid.isArrayable(source)||"target"in source&&(typeof source.target==="string"||source.target.segs))){target[""]=merger(target[""],source,"")}else{fluid.each(source,(function(listeners,key){target[key]=merger(target[key],listeners,key)}))}return target}};fluid.validateListenersImplemented=function(that){var errors=[];fluid.each(that.events,(function(event,name){fluid.each(event.sortedListeners,(function(lisrec){if(lisrec.listener===fluid.notImplemented||lisrec.listener.globalName==="fluid.notImplemented"){errors.push({name:name,namesp