(function(window,document,undefined){if(!window){return}
var _MAP={8:'backspace',9:'tab',13:'enter',16:'shift',17:'ctrl',18:'alt',20:'capslock',27:'esc',32:'space',33:'pageup',34:'pagedown',35:'end',36:'home',37:'left',38:'up',39:'right',40:'down',45:'ins',46:'del',91:'meta',93:'meta',224:'meta'};var _KEYCODE_MAP={106:'*',107:'+',109:'-',110:'.',111:'/',186:';',187:'=',188:',',189:'-',190:'.',191:'/',192:'`',219:'[',220:'\\',221:']',222:'\''};var _SHIFT_MAP={'~':'`','!':'1','@':'2','#':'3','$':'4','%':'5','^':'6','&':'7','*':'8','(':'9',')':'0','_':'-','+':'=',':':';','\"':'\'','<':',','>':'.','?':'/','|':'\\'};var _SPECIAL_ALIASES={'option':'alt','command':'meta','return':'enter','escape':'esc','plus':'+','mod':/Mac|iPod|iPhone|iPad/.test(navigator.platform)?'meta':'ctrl'};var _REVERSE_MAP;for(var i=1;i<20;++i){_MAP[111+i]='f'+i}
for(i=0;i<=9;++i){_MAP[i+96]=i.toString()}
function _addEvent(object,type,callback){if(object.addEventListener){object.addEventListener(type,callback,!1);return}
object.attachEvent('on'+type,callback)}
function _characterFromEvent(e){if(e.type=='keypress'){var character=String.fromCharCode(e.which);if(!e.shiftKey){character=character.toLowerCase()}
return character}
if(_MAP[e.which]){return _MAP[e.which]}
if(_KEYCODE_MAP[e.which]){return _KEYCODE_MAP[e.which]}
return String.fromCharCode(e.which).toLowerCase()}
function _modifiersMatch(modifiers1,modifiers2){return modifiers1.sort().join(',')===modifiers2.sort().join(',')}
function _eventModifiers(e){var modifiers=[];if(e.shiftKey){modifiers.push('shift')}
if(e.altKey){modifiers.push('alt')}
if(e.ctrlKey){modifiers.push('ctrl')}
if(e.metaKey){modifiers.push('meta')}
return modifiers}
function _preventDefault(e){if(e.preventDefault){e.preventDefault();return}
e.returnValue=!1}
function _stopPropagation(e){if(e.stopPropagation){e.stopPropagation();return}
e.cancelBubble=!0}
function _isModifier(key){return key=='shift'||key=='ctrl'||key=='alt'||key=='meta'}
function _getReverseMap(){if(!_REVERSE_MAP){_REVERSE_MAP={};for(var key in _MAP){if(key>95&&key<112){continue}
if(_MAP.hasOwnProperty(key)){_REVERSE_MAP[_MAP[key]]=key}}}
return _REVERSE_MAP}
function _pickBestAction(key,modifiers,action){if(!action){action=_getReverseMap()[key]?'keydown':'keypress'}
if(action=='keypress'&&modifiers.length){action='keydown'}
return action}
function _keysFromString(combination){if(combination==='+'){return['+']}
combination=combination.replace(/\+{2}/g,'+plus');return combination.split('+')}
function _getKeyInfo(combination,action){var keys;var key;var i;var modifiers=[];keys=_keysFromString(combination);for(i=0;i<keys.length;++i){key=keys[i];if(_SPECIAL_ALIASES[key]){key=_SPECIAL_ALIASES[key]}
if(action&&action!='keypress'&&_SHIFT_MAP[key]){key=_SHIFT_MAP[key];modifiers.push('shift')}
if(_isModifier(key)){modifiers.push(key)}}
action=_pickBestAction(key,modifiers,action);return{key:key,modifiers:modifiers,action:action}}
function _belongsTo(element,ancestor){if(element===null||element===document){return!1}
if(element===ancestor){return!0}
return _belongsTo(element.parentNode,ancestor)}
function Mousetrap(targetElement){var self=this;targetElement=targetElement||document;if(!(self instanceof Mousetrap)){return new Mousetrap(targetElement)}
self.target=targetElement;self._callbacks={};self._directMap={};var _sequenceLevels={};var _resetTimer;var _ignoreNextKeyup=!1;var _ignoreNextKeypress=!1;var _nextExpectedAction=!1;function _resetSequences(doNotReset){doNotReset=doNotReset||{};var activeSequences=!1,key;for(key in _sequenceLevels){if(doNotReset[key]){activeSequences=!0;continue}
_sequenceLevels[key]=0}
if(!activeSequences){_nextExpectedAction=!1}}
function _getMatches(character,modifiers,e,sequenceName,combination,level){var i;var callback;var matches=[];var action=e.type;if(!self._callbacks[character]){return[]}
if(action=='keyup'&&_isModifier(character)){modifiers=[character]}
for(i=0;i<self._callbacks[character].length;++i){callback=self._callbacks[character][i];if(!sequenceName&&callback.seq&&_sequenceLevels[callback.seq]!=callback.level){continue}
if(action!=callback.action){continue}
if((action=='keypress'&&!e.metaKey&&!e.ctrlKey)||_modifiersMatch(modifiers,callback.modifiers)){var deleteCombo=!sequenceName&&callback.combo==combination;var deleteSequence=sequenceName&&callback.seq==sequenceName&&callback.level==level;if(deleteCombo||deleteSequence){self._callbacks[character].splice(i,1)}
matches.push(callback)}}
return matches}
function _fireCallback(callback,e,combo,sequence){if(self.stopCallback(e,e.target||e.srcElement,combo,sequence)){return}
if(callback(e,combo)===!1){_preventDefault(e);_stopPropagation(e)}}
self._handleKey=function(character,modifiers,e){var callbacks=_getMatches(character,modifiers,e);var i;var doNotReset={};var maxLevel=0;var processedSequenceCallback=!1;for(i=0;i<callbacks.length;++i){if(callbacks[i].seq){maxLevel=Math.max(maxLevel,callbacks[i].level)}}
for(i=0;i<callbacks.length;++i){if(callbacks[i].seq){if(callbacks[i].level!=maxLevel){continue}
processedSequenceCallback=!0;doNotReset[callbacks[i].seq]=1;_fireCallback(callbacks[i].callback,e,callbacks[i].combo,callbacks[i].seq);continue}
if(!processedSequenceCallback){_fireCallback(callbacks[i].callback,e,callbacks[i].combo)}}
var ignoreThisKeypress=e.type=='keypress'&&_ignoreNextKeypress;if(e.type==_nextExpectedAction&&!_isModifier(character)&&!ignoreThisKeypress){_resetSequences(doNotReset)}
_ignoreNextKeypress=processedSequenceCallback&&e.type=='keydown'};function _handleKeyEvent(e){if(typeof e.which!=='number'){e.which=e.keyCode}
var character=_characterFromEvent(e);if(!character){return}
if(e.type=='keyup'&&_ignoreNextKeyup===character){_ignoreNextKeyup=!1;return}
self.handleKey(character,_eventModifiers(e),e)}
function _resetSequenceTimer(){clearTimeout(_resetTimer);_resetTimer=setTimeout(_resetSequences,1000)}
function _bindSequence(combo,keys,callback,action){_sequenceLevels[combo]=0;function _increaseSequence(nextAction){return function(){_nextExpectedAction=nextAction;++_sequenceLevels[combo];_resetSequenceTimer()}}
function _callbackAndReset(e){_fireCallback(callback,e,combo);if(action!=='keyup'){_ignoreNextKeyup=_characterFromEvent(e)}
setTimeout(_resetSequences,10)}
for(var i=0;i<keys.length;++i){var isFinal=i+1===keys.length;var wrappedCallback=isFinal?_callbackAndReset:_increaseSequence(action||_getKeyInfo(keys[i+1]).action);_bindSingle(keys[i],wrappedCallback,action,combo,i)}}
function _bindSingle(combination,callback,action,sequenceName,level){self._directMap[combination+':'+action]=callback;combination=combination.replace(/\s+/g,' ');var sequence=combination.split(' ');var info;if(sequence.length>1){_bindSequence(combination,sequence,callback,action);return}
info=_getKeyInfo(combination,action);self._callbacks[info.key]=self._callbacks[info.key]||[];_getMatches(info.key,info.modifiers,{type:info.action},sequenceName,combination,level);self._callbacks[info.key][sequenceName?'unshift':'push']({callback:callback,modifiers:info.modifiers,action:info.action,seq:sequenceName,level:level,combo:combination})}
self._bindMultiple=function(combinations,callback,action){for(var i=0;i<combinations.length;++i){_bindSingle(combinations[i],callback,action)}};_addEvent(targetElement,'keypress',_handleKeyEvent);_addEvent(targetElement,'keydown',_handleKeyEvent);_addEvent(targetElement,'keyup',_handleKeyEvent)}
Mousetrap.prototype.bind=function(keys,callback,action){var self=this;keys=keys instanceof Array?keys:[keys];self._bindMultiple.call(self,keys,callback,action);return self};Mousetrap.prototype.unbind=function(keys,action){var self=this;return self.bind.call(self,keys,function(){},action)};Mousetrap.prototype.trigger=function(keys,action){var self=this;if(self._directMap[keys+':'+action]){self._directMap[keys+':'+action]({},keys)}
return self};Mousetrap.prototype.reset=function(){var self=this;self._callbacks={};self._directMap={};return self};Mousetrap.prototype.stopCallback=function(e,element){var self=this;if((' '+element.className+' ').indexOf(' mousetrap ')>-1){return!1}
if(_belongsTo(element,self.target)){return!1}
if('composedPath' in e&&typeof e.composedPath==='function'){var initialEventTarget=e.composedPath()[0];if(initialEventTarget!==e.target){element=initialEventTarget}}
return element.tagName=='INPUT'||element.tagName=='SELECT'||element.tagName=='TEXTAREA'||element.isContentEditable};Mousetrap.prototype.handleKey=function(){var self=this;return self._handleKey.apply(self,arguments)};Mousetrap.addKeycodes=function(object){for(var key in object){if(object.hasOwnProperty(key)){_MAP[key]=object[key]}}
_REVERSE_MAP=null};Mousetrap.init=function(){var documentMousetrap=Mousetrap(document);for(var method in documentMousetrap){if(method.charAt(0)!=='_'){Mousetrap[method]=(function(method){return function(){return documentMousetrap[method].apply(documentMousetrap,arguments)}}(method))}}};Mousetrap.init();window.Mousetrap=Mousetrap;if(typeof module!=='undefined'&&module.exports){module.exports=Mousetrap}
if(typeof define==='function'&&define.amd){define(function(){return Mousetrap})}})(typeof window!=='undefined'?window:null,typeof window!=='undefined'?document:null);/*!
 * jQuery JavaScript Library v3.7.1
 * https://jquery.com/
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license
 * https://jquery.org/license
 *
 * Date: 2023-08-28T13:37Z
 */
(function(global,factory){"use strict";if(typeof module==="object"&&typeof module.exports==="object"){module.exports=global.document?factory(global,!0):function(w){if(!w.document){throw new Error("jQuery requires a window with a document")}
return factory(w)}}else{factory(global)}})(typeof window!=="undefined"?window:this,function(window,noGlobal){"use strict";var arr=[];var getProto=Object.getPrototypeOf;var slice=arr.slice;var flat=arr.flat?function(array){return arr.flat.call(array)}:function(array){return arr.concat.apply([],array)};var push=arr.push;var indexOf=arr.indexOf;var class2type={};var toString=class2type.toString;var hasOwn=class2type.hasOwnProperty;var fnToString=hasOwn.toString;var ObjectFunctionString=fnToString.call(Object);var support={};var isFunction=function isFunction(obj){return typeof obj==="function"&&typeof obj.nodeType!=="number"&&typeof obj.item!=="function"};var isWindow=function isWindow(obj){return obj!=null&&obj===obj.window};var document=window.document;var preservedScriptAttributes={type:!0,src:!0,nonce:!0,noModule:!0};function DOMEval(code,node,doc){doc=doc||document;var i,val,script=doc.createElement("script");script.text=code;if(node){for(i in preservedScriptAttributes){val=node[i]||node.getAttribute&&node.getAttribute(i);if(val){script.setAttribute(i,val)}}}
doc.head.appendChild(script).parentNode.removeChild(script)}
function toType(obj){if(obj==null){return obj+""}
return typeof obj==="object"||typeof obj==="function"?class2type[toString.call(obj)]||"object":typeof obj}
var version="3.7.1",rhtmlSuffix=/HTML$/i,jQuery=function(selector,context){return new jQuery.fn.init(selector,context)};jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,length:0,toArray:function(){return slice.call(this)},get:function(num){if(num==null){return slice.call(this)}
return num<0?this[num+this.length]:this[num]},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;return ret},each:function(callback){return jQuery.each(this,callback)},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},slice:function(){return this.pushStack(slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(jQuery.grep(this,function(_elem,i){return(i+1)%2}))},odd:function(){return this.pushStack(jQuery.grep(this,function(_elem,i){return i%2}))},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[])},end:function(){return this.prevObject||this.constructor()},push:push,sort:arr.sort,splice:arr.splice};jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=!1;if(typeof target==="boolean"){deep=target;target=arguments[i]||{};i++}
if(typeof target!=="object"&&!isFunction(target)){target={}}
if(i===length){target=this;i--}
for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){copy=options[name];if(name==="__proto__"||target===copy){continue}
if(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=Array.isArray(copy)))){src=target[name];if(copyIsArray&&!Array.isArray(src)){clone=[]}else if(!copyIsArray&&!jQuery.isPlainObject(src)){clone={}}else{clone=src}
copyIsArray=!1;target[name]=jQuery.extend(deep,clone,copy)}else if(copy!==undefined){target[name]=copy}}}}
return target};jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:!0,error:function(msg){throw new Error(msg)},noop:function(){},isPlainObject:function(obj){var proto,Ctor;if(!obj||toString.call(obj)!=="[object Object]"){return!1}
proto=getProto(obj);if(!proto){return!0}
Ctor=hasOwn.call(proto,"constructor")&&proto.constructor;return typeof Ctor==="function"&&fnToString.call(Ctor)===ObjectFunctionString},isEmptyObject:function(obj){var name;for(name in obj){return!1}
return!0},globalEval:function(code,options,doc){DOMEval(code,{nonce:options&&options.nonce},doc)},each:function(obj,callback){var length,i=0;if(isArrayLike(obj)){length=obj.length;for(;i<length;i++){if(callback.call(obj[i],i,obj[i])===!1){break}}}else{for(i in obj){if(callback.call(obj[i],i,obj[i])===!1){break}}}
return obj},text:function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){while((node=elem[i++])){ret+=jQuery.text(node)}}
if(nodeType===1||nodeType===11){return elem.textContent}
if(nodeType===9){return elem.documentElement.textContent}
if(nodeType===3||nodeType===4){return elem.nodeValue}
return ret},makeArray:function(arr,results){var ret=results||[];if(arr!=null){if(isArrayLike(Object(arr))){jQuery.merge(ret,typeof arr==="string"?[arr]:arr)}else{push.call(ret,arr)}}
return ret},inArray:function(elem,arr,i){return arr==null?-1:indexOf.call(arr,elem,i)},isXMLDoc:function(elem){var namespace=elem&&elem.namespaceURI,docElem=elem&&(elem.ownerDocument||elem).documentElement;return!rhtmlSuffix.test(namespace||docElem&&docElem.nodeName||"HTML")},merge:function(first,second){var len=+second.length,j=0,i=first.length;for(;j<len;j++){first[i++]=second[j]}
first.length=i;return first},grep:function(elems,callback,invert){var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;for(;i<length;i++){callbackInverse=!callback(elems[i],i);if(callbackInverse!==callbackExpect){matches.push(elems[i])}}
return matches},map:function(elems,callback,arg){var length,value,i=0,ret=[];if(isArrayLike(elems)){length=elems.length;for(;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret.push(value)}}}else{for(i in elems){value=callback(elems[i],i,arg);if(value!=null){ret.push(value)}}}
return flat(ret)},guid:1,support:support});if(typeof Symbol==="function"){jQuery.fn[Symbol.iterator]=arr[Symbol.iterator]}
jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(_i,name){class2type["[object "+name+"]"]=name.toLowerCase()});function isArrayLike(obj){var length=!!obj&&"length" in obj&&obj.length,type=toType(obj);if(isFunction(obj)||isWindow(obj)){return!1}
return type==="array"||length===0||typeof length==="number"&&length>0&&(length-1)in obj}
function nodeName(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()}
var pop=arr.pop;var sort=arr.sort;var splice=arr.splice;var whitespace="[\\x20\\t\\r\\n\\f]";var rtrimCSS=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g");jQuery.contains=function(a,b){var bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(a.contains?a.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16))};var rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function fcssescape(ch,asCodePoint){if(asCodePoint){if(ch==="\0"){return"\uFFFD"}
return ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" "}
return"\\"+ch}
jQuery.escapeSelector=function(sel){return(sel+"").replace(rcssescape,fcssescape)};var preferredDoc=document,pushNative=push;(function(){var i,Expr,outermostContext,sortInput,hasDuplicate,push=pushNative,document,documentElement,documentIsHTML,rbuggyQSA,matches,expando=jQuery.expando,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),nonnativeSelectorCache=createCache(),sortOrder=function(a,b){if(a===b){hasDuplicate=!0}
return 0},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|"+"loop|multiple|open|readonly|required|scoped",identifier="(?:\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",attributes="\\["+whitespace+"*("+identifier+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+whitespace+"*\\]",pseudos=":("+identifier+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|"+".*"+")\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rleadingCombinator=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rdescend=new RegExp(whitespace+"|>"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+identifier+")"),CLASS:new RegExp("^\\.("+identifier+")"),TAG:new RegExp("^("+identifier+"|[*])"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,runescape=new RegExp("\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\([^\\r\\n\\f])","g"),funescape=function(escape,nonHex){var high="0x"+escape.slice(1)-0x10000;if(nonHex){return nonHex}
return high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00)},unloadHandler=function(){setDocument()},inDisabledFieldset=addCombinator(function(elem){return elem.disabled===!0&&nodeName(elem,"fieldset")},{dir:"parentNode",next:"legend"});function safeActiveElement(){try{return document.activeElement}catch(err){}}
try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType}catch(e){push={apply:function(target,els){pushNative.apply(target,slice.call(els))},call:function(target){pushNative.apply(target,slice.call(arguments,1))}}}
function find(selector,context,results,seed){var m,i,elem,nid,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;results=results||[];if(typeof selector!=="string"||!selector||nodeType!==1&&nodeType!==9&&nodeType!==11){return results}
if(!seed){setDocument(context);context=context||document;if(documentIsHTML){if(nodeType!==11&&(match=rquickExpr.exec(selector))){if((m=match[1])){if(nodeType===9){if((elem=context.getElementById(m))){if(elem.id===m){push.call(results,elem);return results}}else{return results}}else{if(newContext&&(elem=newContext.getElementById(m))&&find.contains(context,elem)&&elem.id===m){push.call(results,elem);return results}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results}else if((m=match[3])&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results}}
if(!nonnativeSelectorCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))){newSelector=selector;newContext=context;if(nodeType===1&&(rdescend.test(selector)||rleadingCombinator.test(selector))){newContext=rsibling.test(selector)&&testContext(context.parentNode)||context;if(newContext!=context||!support.scope){if((nid=context.getAttribute("id"))){nid=jQuery.escapeSelector(nid)}else{context.setAttribute("id",(nid=expando))}}
groups=tokenize(selector);i=groups.length;while(i--){groups[i]=(nid?"#"+nid:":scope")+" "+toSelector(groups[i])}
newSelector=groups.join(",")}
try{push.apply(results,newContext.querySelectorAll(newSelector));return results}catch(qsaError){nonnativeSelectorCache(selector,!0)}finally{if(nid===expando){context.removeAttribute("id")}}}}}
return select(selector.replace(rtrimCSS,"$1"),context,results,seed)}
function createCache(){var keys=[];function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()]}
return(cache[key+" "]=value)}
return cache}
function markFunction(fn){fn[expando]=!0;return fn}
function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el)}catch(e){return!1}finally{if(el.parentNode){el.parentNode.removeChild(el)}
el=null}}
function createInputPseudo(type){return function(elem){return nodeName(elem,"input")&&elem.type===type}}
function createButtonPseudo(type){return function(elem){return(nodeName(elem,"input")||nodeName(elem,"button"))&&elem.type===type}}
function createDisabledPseudo(disabled){return function(elem){if("form" in elem){if(elem.parentNode&&elem.disabled===!1){if("label" in elem){if("label" in elem.parentNode){return elem.parentNode.disabled===disabled}else{return elem.disabled===disabled}}
return elem.isDisabled===disabled||elem.isDisabled!==!disabled&&inDisabledFieldset(elem)===disabled}
return elem.disabled===disabled}else if("label" in elem){return elem.disabled===disabled}
return!1}}
function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[(j=matchIndexes[i])]){seed[j]=!(matches[j]=seed[j])}}})})}
function testContext(context){return context&&typeof context.getElementsByTagName!=="undefined"&&context}
function setDocument(node){var subWindow,doc=node?node.ownerDocument||node:preferredDoc;if(doc==document||doc.nodeType!==9||!doc.documentElement){return document}
document=doc;documentElement=document.documentElement;documentIsHTML=!jQuery.isXMLDoc(document);matches=documentElement.matches||documentElement.webkitMatchesSelector||documentElement.msMatchesSelector;if(documentElement.msMatchesSelector&&preferredDoc!=document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow){subWindow.addEventListener("unload",unloadHandler)}
support.getById=assert(function(el){documentElement.appendChild(el).id=jQuery.expando;return!document.getElementsByName||!document.getElementsByName(jQuery.expando).length});support.disconnectedMatch=assert(function(el){return matches.call(el,"*")});support.scope=assert(function(){return document.querySelectorAll(":scope")});support.cssHas=assert(function(){try{document.querySelector(":has(*,:jqfake)");return!1}catch(e){return!0}});if(support.getById){Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}};Expr.find.ID=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var elem=context.getElementById(id);return elem?[elem]:[]}}}else{Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return node&&node.value===attrId}};Expr.find.ID=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var node,i,elems,elem=context.getElementById(id);if(elem){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem]}
elems=context.getElementsByName(id);i=0;while((elem=elems[i++])){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem]}}}
return[]}}}
Expr.find.TAG=function(tag,context){if(typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(tag)}else{return context.querySelectorAll(tag)}};Expr.find.CLASS=function(className,context){if(typeof context.getElementsByClassName!=="undefined"&&documentIsHTML){return context.getElementsByClassName(className)}};rbuggyQSA=[];assert(function(el){var input;documentElement.appendChild(el).innerHTML="<a id='"+expando+"' href='' disabled='disabled'></a>"+"<select id='"+expando+"-\r\\' disabled='disabled'>"+"<option selected=''></option></select>";if(!el.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")")}
if(!el.querySelectorAll("[id~="+expando+"-]").length){rbuggyQSA.push("~=")}
if(!el.querySelectorAll("a#"+expando+"+*").length){rbuggyQSA.push(".#.+[+~]")}
if(!el.querySelectorAll(":checked").length){rbuggyQSA.push(":checked")}
input=document.createElement("input");input.setAttribute("type","hidden");el.appendChild(input).setAttribute("name","D");documentElement.appendChild(el).disabled=!0;if(el.querySelectorAll(":disabled").length!==2){rbuggyQSA.push(":enabled",":disabled")}
input=document.createElement("input");input.setAttribute("name","");el.appendChild(input);if(!el.querySelectorAll("[name='']").length){rbuggyQSA.push("\\["+whitespace+"*name"+whitespace+"*="+whitespace+"*(?:''|\"\")")}});if(!support.cssHas){rbuggyQSA.push(":has")}
rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));sortOrder=function(a,b){if(a===b){hasDuplicate=!0;return 0}
var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(compare){return compare}
compare=(a.ownerDocument||a)==(b.ownerDocument||b)?a.compareDocumentPosition(b):1;if(compare&1||(!support.sortDetached&&b.compareDocumentPosition(a)===compare)){if(a===document||a.ownerDocument==preferredDoc&&find.contains(preferredDoc,a)){return-1}
if(b===document||b.ownerDocument==preferredDoc&&find.contains(preferredDoc,b)){return 1}
return sortInput?(indexOf.call(sortInput,a)-indexOf.call(sortInput,b)):0}
return compare&4?-1:1};return document}
find.matches=function(expr,elements){return find(expr,null,null,elements)};find.matchesSelector=function(elem,expr){setDocument(elem);if(documentIsHTML&&!nonnativeSelectorCache[expr+" "]&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret}}catch(e){nonnativeSelectorCache(expr,!0)}}
return find(expr,document,null,[elem]).length>0};find.contains=function(context,elem){if((context.ownerDocument||context)!=document){setDocument(context)}
return jQuery.contains(context,elem)};find.attr=function(elem,name){if((elem.ownerDocument||elem)!=document){setDocument(elem)}
var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;if(val!==undefined){return val}
return elem.getAttribute(name)};find.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)};jQuery.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.sortStable;sortInput=!support.sortStable&&slice.call(results,0);sort.call(results,sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i)}}
while(j--){splice.call(results,duplicates[j],1)}}
sortInput=null;return results};jQuery.fn.uniqueSort=function(){return this.pushStack(jQuery.uniqueSort(slice.apply(this)))};Expr=jQuery.expr={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" "}
return match.slice(0,4)},CHILD:function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){find.error(match[0])}
match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+((match[7]+match[8])||match[3]==="odd")}else if(match[3]){find.error(match[0])}
return match},PSEUDO:function(match){var excess,unquoted=!match[6]&&match[2];if(matchExpr.CHILD.test(match[0])){return null}
if(match[3]){match[2]=match[4]||match[5]||""}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess)}
return match.slice(0,3)}},filter:{TAG:function(nodeNameSelector){var expectedNodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return!0}:function(elem){return nodeName(elem,expectedNodeName)}},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!=="undefined"&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=find.attr(elem,name);if(result==null){return operator==="!="}
if(!operator){return!0}
result+="";if(operator==="="){return result===check}
if(operator==="!="){return result!==check}
if(operator==="^="){return check&&result.indexOf(check)===0}
if(operator==="*="){return check&&result.indexOf(check)>-1}
if(operator==="$="){return check&&result.slice(-check.length)===check}
if(operator==="~="){return(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1}
if(operator==="|="){return result===check||result.slice(0,check.length+1)===check+"-"}
return!1}},CHILD:function(type,what,_argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode}:function(elem,_context,xml){var cache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=!1;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?nodeName(node,name):node.nodeType===1){return!1}}
start=dir=type==="only"&&!start&&"nextSibling"}
return!0}
start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){outerCache=parent[expando]||(parent[expando]={});cache=outerCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if(node.nodeType===1&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break}}}else{if(useCache){outerCache=elem[expando]||(elem[expando]={});cache=outerCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex}
if(diff===!1){while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?nodeName(node,name):node.nodeType===1)&&++diff){if(useCache){outerCache=node[expando]||(node[expando]={});outerCache[type]=[dirruns,diff]}
if(node===elem){break}}}}}
diff-=last;return diff===first||(diff%first===0&&diff/first>=0)}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||find.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument)}
if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf.call(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i])}}):function(elem){return fn(elem,0,args)}}
return fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrimCSS,"$1"));return matcher[expando]?markFunction(function(seed,matches,_context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if((elem=unmatched[i])){seed[i]=!(matches[i]=elem)}}}):function(elem,_context,xml){input[0]=elem;matcher(input,null,xml,results);input[0]=null;return!results.pop()}}),has:markFunction(function(selector){return function(elem){return find(selector,elem).length>0}}),contains:markFunction(function(text){text=text.replace(runescape,funescape);return function(elem){return(elem.textContent||jQuery.text(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){if(!ridentifier.test(lang||"")){find.error("unsupported lang: "+lang)}
lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if((elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0}}while((elem=elem.parentNode)&&elem.nodeType===1);return!1}}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===documentElement},focus:function(elem){return elem===safeActiveElement()&&document.hasFocus()&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:createDisabledPseudo(!1),disabled:createDisabledPseudo(!0),checked:function(elem){return(nodeName(elem,"input")&&!!elem.checked)||(nodeName(elem,"option")&&!!elem.selected)},selected:function(elem){if(elem.parentNode){elem.parentNode.selectedIndex}
return elem.selected===!0},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return!1}}
return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){return nodeName(elem,"input")&&elem.type==="button"||nodeName(elem,"button")},text:function(elem){var attr;return nodeName(elem,"input")&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()==="text")},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(_matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(_matchIndexes,length,argument){return[argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i<length;i+=2){matchIndexes.push(i)}
return matchIndexes}),odd:createPositionalPseudo(function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i)}
return matchIndexes}),lt:createPositionalPseudo(function(matchIndexes,length,argument){var i;if(argument<0){i=argument+length}else if(argument>length){i=length}else{i=argument}
for(;--i>=0;){matchIndexes.push(i)}
return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i)}
return matchIndexes})}};Expr.pseudos.nth=Expr.pseudos.eq;for(i in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0}){Expr.pseudos[i]=createInputPseudo(i)}
for(i in{submit:!0,reset:!0}){Expr.pseudos[i]=createButtonPseudo(i)}
function setFilters(){}
setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters();function tokenize(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0)}
soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar}
groups.push((tokens=[]))}
matched=!1;if((match=rleadingCombinator.exec(soFar))){matched=match.shift();tokens.push({value:matched,type:match[0].replace(rtrimCSS," ")});soFar=soFar.slice(matched.length)}
for(type in Expr.filter){if((match=matchExpr[type].exec(soFar))&&(!preFilters[type]||(match=preFilters[type](match)))){matched=match.shift();tokens.push({value:matched,type:type,matches:match});soFar=soFar.slice(matched.length)}}
if(!matched){break}}
if(parseOnly){return soFar.length}
return soFar?find.error(selector):tokenCache(selector,groups).slice(0)}
function toSelector(tokens){var i=0,len=tokens.length,selector="";for(;i<len;i++){selector+=tokens[i].value}
return selector}
function addCombinator(matcher,combinator,base){var dir=combinator.dir,skip=combinator.next,key=skip||dir,checkNonElements=base&&key==="parentNode",doneName=done++;return combinator.first?function(elem,context,xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){return matcher(elem,context,xml)}}
return!1}:function(elem,context,xml){var oldCache,outerCache,newCache=[dirruns,doneName];if(xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){if(matcher(elem,context,xml)){return!0}}}}else{while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});if(skip&&nodeName(elem,skip)){elem=elem[dir]||elem}else if((oldCache=outerCache[key])&&oldCache[0]===dirruns&&oldCache[1]===doneName){return(newCache[2]=oldCache[2])}else{outerCache[key]=newCache;if((newCache[2]=matcher(elem,context,xml))){return!0}}}}}
return!1}}
function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return!1}}
return!0}:matchers[0]}
function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i<len;i++){find(selector,contexts[i],results)}
return results}
function condense(unmatched,map,filter,context,xml){var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=map!=null;for(;i<len;i++){if((elem=unmatched[i])){if(!filter||filter(elem,context,xml)){newUnmatched.push(elem);if(mapped){map.push(i)}}}}
return newUnmatched}
function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter)}
if(postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector)}
return markFunction(function(seed,results,context,xml){var temp,i,elem,matcherOut,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml):elems;if(matcher){matcherOut=postFinder||(seed?preFilter:preexisting||postFilter)?[]:results;matcher(matcherIn,matcherOut,context,xml)}else{matcherOut=matcherIn}
if(postFilter){temp=condense(matcherOut,postMap);postFilter(temp,[],context,xml);i=temp.length;while(i--){if((elem=temp[i])){matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem)}}}
if(seed){if(postFinder||preFilter){if(postFinder){temp=[];i=matcherOut.length;while(i--){if((elem=matcherOut[i])){temp.push((matcherIn[i]=elem))}}
postFinder(null,(matcherOut=[]),temp,xml)}
i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(temp=postFinder?indexOf.call(seed,elem):preMap[i])>-1){seed[temp]=!(results[temp]=elem)}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml)}else{push.apply(results,matcherOut)}}})}
function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,!0),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1},implicitRelative,!0),matchers=[function(elem,context,xml){var ret=(!leadingRelative&&(xml||context!=outermostContext))||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));checkContext=null;return ret}];for(;i<len;i++){if((matcher=Expr.relative[tokens[i].type])){matchers=[addCombinator(elementMatcher(matchers),matcher)]}else{matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches);if(matcher[expando]){j=++i;for(;j<len;j++){if(Expr.relative[tokens[j].type]){break}}
return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrimCSS,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens((tokens=tokens.slice(j))),j<len&&toSelector(tokens))}
matchers.push(matcher)}}
return elementMatcher(matchers)}
function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",outermost),dirrunsUnique=(dirruns+=contextBackup==null?1:Math.random()||0.1),len=elems.length;if(outermost){outermostContext=context==document||context||outermost}
for(;i!==len&&(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;if(!context&&elem.ownerDocument!=document){setDocument(elem);xml=!documentIsHTML}
while((matcher=elementMatchers[j++])){if(matcher(elem,context||document,xml)){push.call(results,elem);break}}
if(outermost){dirruns=dirrunsUnique}}
if(bySet){if((elem=!matcher&&elem)){matchedCount--}
if(seed){unmatched.push(elem)}}}
matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while((matcher=setMatchers[j++])){matcher(unmatched,setMatched,context,xml)}
if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results)}}}
setMatched=condense(setMatched)}
push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&(matchedCount+setMatchers.length)>1){jQuery.uniqueSort(results)}}
if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup}
return unmatched};return bySet?markFunction(superMatcher):superMatcher}
function compile(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){match=tokenize(selector)}
i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[expando]){setMatchers.push(cached)}else{elementMatchers.push(cached)}}
cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector}
return cached}
function select(selector,context,results,seed){var i,tokens,token,type,find,compiled=typeof selector==="function"&&selector,match=!seed&&tokenize((selector=compiled.selector||selector));results=results||[];if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find.ID(token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results}else if(compiled){context=context.parentNode}
selector=selector.slice(tokens.shift().value.length)}
i=matchExpr.needsContext.test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[(type=token.type)]){break}
if((find=Expr.find[type])){if((seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results}
break}}}}(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context);return results}
support.sortStable=expando.split("").sort(sortOrder).join("")===expando;setDocument();support.sortDetached=assert(function(el){return el.compareDocumentPosition(document.createElement("fieldset"))&1});jQuery.find=find;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.unique=jQuery.uniqueSort;find.compile=compile;find.select=select;find.setDocument=setDocument;find.tokenize=tokenize;find.escape=jQuery.escapeSelector;find.getText=jQuery.text;find.isXML=jQuery.isXMLDoc;find.selectors=jQuery.expr;find.support=jQuery.support;find.uniqueSort=jQuery.uniqueSort})();var dir=function(elem,dir,until){var matched=[],truncate=until!==undefined;while((elem=elem[dir])&&elem.nodeType!==9){if(elem.nodeType===1){if(truncate&&jQuery(elem).is(until)){break}
matched.push(elem)}}
return matched};var siblings=function(n,elem){var matched=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){matched.push(n)}}
return matched};var rneedsContext=jQuery.expr.match.needsContext;var rsingleTag=(/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i);function winnow(elements,qualifier,not){if(isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not})}
if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not})}
if(typeof qualifier!=="string"){return jQuery.grep(elements,function(elem){return(indexOf.call(qualifier,elem)>-1)!==not})}
return jQuery.filter(qualifier,elements,not)}
jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")"}
if(elems.length===1&&elem.nodeType===1){return jQuery.find.matchesSelector(elem,expr)?[elem]:[]}
return jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1}))};jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,self=this;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++){if(jQuery.contains(self[i],this)){return!0}}}))}
ret=this.pushStack([]);for(i=0;i<len;i++){jQuery.find(selector,self[i],ret)}
return len>1?jQuery.uniqueSort(ret):ret},filter:function(selector){return this.pushStack(winnow(this,selector||[],!1))},not:function(selector){return this.pushStack(winnow(this,selector||[],!0))},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],!1).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector){return this}
root=root||rootjQuery;if(typeof selector==="string"){if(selector[0]==="<"&&selector[selector.length-1]===">"&&selector.length>=3){match=[null,selector,null]}else{match=rquickExpr.exec(selector)}
if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(isFunction(this[match])){this[match](context[match])}else{this.attr(match,context[match])}}}
return this}else{elem=document.getElementById(match[2]);if(elem){this[0]=elem;this.length=1}
return this}}else if(!context||context.jquery){return(context||root).find(selector)}else{return this.constructor(context).find(selector)}}else if(selector.nodeType){this[0]=selector;this.length=1;return this}else if(isFunction(selector)){return root.ready!==undefined?root.ready(selector):selector(jQuery)}
return jQuery.makeArray(selector,this)};init.prototype=jQuery.fn;rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:!0,contents:!0,next:!0,prev:!0};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){var i=0;for(;i<l;i++){if(jQuery.contains(this,targets[i])){return!0}}})},closest:function(selectors,context){var cur,i=0,l=this.length,matched=[],targets=typeof selectors!=="string"&&jQuery(selectors);if(!rneedsContext.test(selectors)){for(;i<l;i++){for(cur=this[i];cur&&cur!==context;cur=cur.parentNode){if(cur.nodeType<11&&(targets?targets.index(cur)>-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break}}}}
return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched)},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1}
if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0])}
return indexOf.call(this,elem.jquery?elem[0]:elem)},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))))},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector))}});function sibling(cur,dir){while((cur=cur[dir])&&cur.nodeType!==1){}
return cur}
jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null},parents:function(elem){return dir(elem,"parentNode")},parentsUntil:function(elem,_i,until){return dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return dir(elem,"nextSibling")},prevAll:function(elem){return dir(elem,"previousSibling")},nextUntil:function(elem,_i,until){return dir(elem,"nextSibling",until)},prevUntil:function(elem,_i,until){return dir(elem,"previousSibling",until)},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem)},children:function(elem){return siblings(elem.firstChild)},contents:function(elem){if(elem.contentDocument!=null&&getProto(elem.contentDocument)){return elem.contentDocument}
if(nodeName(elem,"template")){elem=elem.content||elem}
return jQuery.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until}
if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched)}
if(this.length>1){if(!guaranteedUnique[name]){jQuery.uniqueSort(matched)}
if(rparentsprev.test(name)){matched.reverse()}}
return this.pushStack(matched)}});var rnothtmlwhite=(/[^\x20\t\r\n\f]+/g);function createOptions(options){var object={};jQuery.each(options.match(rnothtmlwhite)||[],function(_,flag){object[flag]=!0});return object}
jQuery.Callbacks=function(options){options=typeof options==="string"?createOptions(options):jQuery.extend({},options);var firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){locked=locked||options.once;fired=firing=!0;for(;queue.length;firingIndex=-1){memory=queue.shift();while(++firingIndex<list.length){if(list[firingIndex].apply(memory[0],memory[1])===!1&&options.stopOnFalse){firingIndex=list.length;memory=!1}}}
if(!options.memory){memory=!1}
firing=!1;if(locked){if(memory){list=[]}else{list=""}}},self={add:function(){if(list){if(memory&&!firing){firingIndex=list.length-1;queue.push(memory)}(function add(args){jQuery.each(args,function(_,arg){if(isFunction(arg)){if(!options.unique||!self.has(arg)){list.push(arg)}}else if(arg&&arg.length&&toType(arg)!=="string"){add(arg)}})})(arguments);if(memory&&!firing){fire()}}
return this},remove:function(){jQuery.each(arguments,function(_,arg){var index;while((index=jQuery.inArray(arg,list,index))>-1){list.splice(index,1);if(index<=firingIndex){firingIndex--}}});return this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0},empty:function(){if(list){list=[]}
return this},disable:function(){locked=queue=[];list=memory="";return this},disabled:function(){return!list},lock:function(){locked=queue=[];if(!memory&&!firing){list=memory=""}
return this},locked:function(){return!!locked},fireWith:function(context,args){if(!locked){args=args||[];args=[context,args.slice?args.slice():args];queue.push(args);if(!firing){fire()}}
return this},fire:function(){self.fireWith(this,arguments);return this},fired:function(){return!!fired}};return self};function Identity(v){return v}
function Thrower(ex){throw ex}
function adoptValue(value,resolve,reject,noValue){var method;try{if(value&&isFunction((method=value.promise))){method.call(value).done(resolve).fail(reject)}else if(value&&isFunction((method=value.then))){method.call(value,resolve,reject)}else{resolve.apply(undefined,[value].slice(noValue))}}catch(value){reject.apply(undefined,[value])}}
jQuery.extend({Deferred:function(func){var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve","done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject","fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],state="pending",promise={state:function(){return state},always:function(){deferred.done(arguments).fail(arguments);return this},"catch":function(fn){return promise.then(null,fn)},pipe:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(_i,tuple){var fn=isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&isFunction(returned.promise)){returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject)}else{newDefer[tuple[0]+"With"](this,fn?[returned]:arguments)}})});fns=null}).promise()},then:function(onFulfilled,onRejected,onProgress){var maxDepth=0;function resolve(depth,deferred,handler,special){return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(depth<maxDepth){return}
returned=handler.apply(that,args);if(returned===deferred.promise()){throw new TypeError("Thenable self-resolution")}
then=returned&&(typeof returned==="object"||typeof returned==="function")&&returned.then;if(isFunction(then)){if(special){then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special))}else{maxDepth++;then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special),resolve(maxDepth,deferred,Identity,deferred.notifyWith))}}else{if(handler!==Identity){that=undefined;args=[returned]}(special||deferred.resolveWith)(that,args)}},process=special?mightThrow:function(){try{mightThrow()}catch(e){if(jQuery.Deferred.exceptionHook){jQuery.Deferred.exceptionHook(e,process.error)}
if(depth+1>=maxDepth){if(handler!==Thrower){that=undefined;args=[e]}
deferred.rejectWith(that,args)}}};if(depth){process()}else{if(jQuery.Deferred.getErrorHook){process.error=jQuery.Deferred.getErrorHook()}else if(jQuery.Deferred.getStackHook){process.error=jQuery.Deferred.getStackHook()}
window.setTimeout(process)}}}
return jQuery.Deferred(function(newDefer){tuples[0][3].add(resolve(0,newDefer,isFunction(onProgress)?onProgress:Identity,newDefer.notifyWith));tuples[1][3].add(resolve(0,newDefer,isFunction(onFulfilled)?onFulfilled:Identity));tuples[2][3].add(resolve(0,newDefer,isFunction(onRejected)?onRejected:Thrower))}).promise()},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise}},deferred={};jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[5];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString},tuples[3-i][2].disable,tuples[3-i][3].disable,tuples[0][2].lock,tuples[0][3].lock)}
list.add(tuple[3].fire);deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?undefined:this,arguments);return this};deferred[tuple[0]+"With"]=list.fireWith});promise.promise(deferred);if(func){func.call(deferred,deferred)}
return deferred},when:function(singleValue){var
remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),primary=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this;resolveValues[i]=arguments.length>1?slice.call(arguments):value;if(!(--remaining)){primary.resolveWith(resolveContexts,resolveValues)}}};if(remaining<=1){adoptValue(singleValue,primary.done(updateFunc(i)).resolve,primary.reject,!remaining);if(primary.state()==="pending"||isFunction(resolveValues[i]&&resolveValues[i].then)){return primary.then()}}
while(i--){adoptValue(resolveValues[i],updateFunc(i),primary.reject)}
return primary.promise()}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,asyncError){if(window.console&&window.console.warn&&error&&rerrorNames.test(error.name)){window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,asyncError)}};jQuery.readyException=function(error){window.setTimeout(function(){throw error})};var readyList=jQuery.Deferred();jQuery.fn.ready=function(fn){readyList.then(fn).catch(function(error){jQuery.readyException(error)});return this};jQuery.extend({isReady:!1,readyWait:1,ready:function(wait){if(wait===!0?--jQuery.readyWait:jQuery.isReady){return}
jQuery.isReady=!0;if(wait!==!0&&--jQuery.readyWait>0){return}
readyList.resolveWith(document,[jQuery])}});jQuery.ready.then=readyList.then;function completed(){document.removeEventListener("DOMContentLoaded",completed);window.removeEventListener("load",completed);jQuery.ready()}
if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){window.setTimeout(jQuery.ready)}else{document.addEventListener("DOMContentLoaded",completed);window.addEventListener("load",completed)}
var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=key==null;if(toType(key)==="object"){chainable=!0;for(i in key){access(elems,fn,i,key[i],!0,emptyGet,raw)}}else if(value!==undefined){chainable=!0;if(!isFunction(value)){raw=!0}
if(bulk){if(raw){fn.call(elems,value);fn=null}else{bulk=fn;fn=function(elem,_key,value){return bulk.call(jQuery(elem),value)}}}
if(fn){for(;i<len;i++){fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)))}}}
if(chainable){return elems}
if(bulk){return fn.call(elems)}
return len?fn(elems[0],key):emptyGet};var rmsPrefix=/^-ms-/,rdashAlpha=/-([a-z])/g;function fcamelCase(_all,letter){return letter.toUpperCase()}
function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)}
var acceptData=function(owner){return owner.nodeType===1||owner.nodeType===9||!(+owner.nodeType)};function Data(){this.expando=jQuery.expando+Data.uid++}
Data.uid=1;Data.prototype={cache:function(owner){var value=owner[this.expando];if(!value){value={};if(acceptData(owner)){if(owner.nodeType){owner[this.expando]=value}else{Object.defineProperty(owner,this.expando,{value:value,configurable:!0})}}}
return value},set:function(owner,data,value){var prop,cache=this.cache(owner);if(typeof data==="string"){cache[camelCase(data)]=value}else{for(prop in data){cache[camelCase(prop)]=data[prop]}}
return cache},get:function(owner,key){return key===undefined?this.cache(owner):owner[this.expando]&&owner[this.expando][camelCase(key)]},access:function(owner,key,value){if(key===undefined||((key&&typeof key==="string")&&value===undefined)){return this.get(owner,key)}
this.set(owner,key,value);return value!==undefined?value:key},remove:function(owner,key){var i,cache=owner[this.expando];if(cache===undefined){return}
if(key!==undefined){if(Array.isArray(key)){key=key.map(camelCase)}else{key=camelCase(key);key=key in cache?[key]:(key.match(rnothtmlwhite)||[])}
i=key.length;while(i--){delete cache[key[i]]}}
if(key===undefined||jQuery.isEmptyObject(cache)){if(owner.nodeType){owner[this.expando]=undefined}else{delete owner[this.expando]}}},hasData:function(owner){var cache=owner[this.expando];return cache!==undefined&&!jQuery.isEmptyObject(cache)}};var dataPriv=new Data();var dataUser=new Data();var rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/[A-Z]/g;function getData(data){if(data==="true"){return!0}
if(data==="false"){return!1}
if(data==="null"){return null}
if(data===+data+""){return+data}
if(rbrace.test(data)){return JSON.parse(data)}
return data}
function dataAttr(elem,key,data){var name;if(data===undefined&&elem.nodeType===1){name="data-"+key.replace(rmultiDash,"-$&").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=getData(data)}catch(e){}
dataUser.set(elem,key,data)}else{data=undefined}}
return data}
jQuery.extend({hasData:function(elem){return dataUser.hasData(elem)||dataPriv.hasData(elem)},data:function(elem,name,data){return dataUser.access(elem,name,data)},removeData:function(elem,name){dataUser.remove(elem,name)},_data:function(elem,name,data){return dataPriv.access(elem,name,data)},_removeData:function(elem,name){dataPriv.remove(elem,name)}});jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(key===undefined){if(this.length){data=dataUser.get(elem);if(elem.nodeType===1&&!dataPriv.get(elem,"hasDataAttrs")){i=attrs.length;while(i--){if(attrs[i]){name=attrs[i].name;if(name.indexOf("data-")===0){name=camelCase(name.slice(5));dataAttr(elem,name,data[name])}}}
dataPriv.set(elem,"hasDataAttrs",!0)}}
return data}
if(typeof key==="object"){return this.each(function(){dataUser.set(this,key)})}
return access(this,function(value){var data;if(elem&&value===undefined){data=dataUser.get(elem,key);if(data!==undefined){return data}
data=dataAttr(elem,key);if(data!==undefined){return data}
return}
this.each(function(){dataUser.set(this,key,value)})},null,value,arguments.length>1,null,!0)},removeData:function(key){return this.each(function(){dataUser.remove(this,key)})}});jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=dataPriv.get(elem,type);if(data){if(!queue||Array.isArray(data)){queue=dataPriv.access(elem,type,jQuery.makeArray(data))}else{queue.push(data)}}
return queue||[]}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};if(fn==="inprogress"){fn=queue.shift();startLength--}
if(fn){if(type==="fx"){queue.unshift("inprogress")}
delete hooks.stop;fn.call(elem,next,hooks)}
if(!startLength&&hooks){hooks.empty.fire()}},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(elem,[type+"queue",key])})})}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--}
if(arguments.length<setter){return jQuery.queue(this[0],type)}
return data===undefined?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type)}})},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)})},clearQueue:function(type){return this.queue(type||"fx",[])},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){if(!(--count)){defer.resolveWith(elements,[elements])}};if(typeof type!=="string"){obj=type;type=undefined}
type=type||"fx";while(i--){tmp=dataPriv.get(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve)}}
resolve();return defer.promise(obj)}});var pnum=(/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;var rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i");var cssExpand=["Top","Right","Bottom","Left"];var documentElement=document.documentElement;var isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem)},composed={composed:!0};if(documentElement.getRootNode){isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem)||elem.getRootNode(composed)===elem.ownerDocument}}
var isHiddenWithinTree=function(elem,el){elem=el||elem;return elem.style.display==="none"||elem.style.display===""&&isAttached(elem)&&jQuery.css(elem,"display")==="none"};function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale,maxIterations=20,currentValue=tween?function(){return tween.cur()}:function(){return jQuery.css(elem,prop,"")},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=elem.nodeType&&(jQuery.cssNumber[prop]||unit!=="px"&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){initial=initial/2;unit=unit||initialInUnit[3];initialInUnit=+initial||1;while(maxIterations--){jQuery.style(elem,prop,initialInUnit+unit);if((1-scale)*(1-(scale=currentValue()/initial||0.5))<=0){maxIterations=0}
initialInUnit=initialInUnit/scale}
initialInUnit=initialInUnit*2;jQuery.style(elem,prop,initialInUnit+unit);valueParts=valueParts||[]}
if(valueParts){initialInUnit=+initialInUnit||+initial||0;adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2];if(tween){tween.unit=unit;tween.start=initialInUnit;tween.end=adjusted}}
return adjusted}
var defaultDisplayMap={};function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];if(display){return display}
temp=doc.body.appendChild(doc.createElement(nodeName));display=jQuery.css(temp,"display");temp.parentNode.removeChild(temp);if(display==="none"){display="block"}
defaultDisplayMap[nodeName]=display;return display}
function showHide(elements,show){var display,elem,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(!elem.style){continue}
display=elem.style.display;if(show){if(display==="none"){values[index]=dataPriv.get(elem,"display")||null;if(!values[index]){elem.style.display=""}}
if(elem.style.display===""&&isHiddenWithinTree(elem)){values[index]=getDefaultDisplay(elem)}}else{if(display!=="none"){values[index]="none";dataPriv.set(elem,"display",display)}}}
for(index=0;index<length;index++){if(values[index]!=null){elements[index].style.display=values[index]}}
return elements}
jQuery.fn.extend({show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide()}
return this.each(function(){if(isHiddenWithinTree(this)){jQuery(this).show()}else{jQuery(this).hide()}})}});var rcheckableType=(/^(?:checkbox|radio)$/i);var rtagName=(/<([a-z][^\/\0>\x20\t\r\n\f]*)/i);var rscriptType=(/^$|^module$|\/(?:java|ecma)script/i);(function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio");input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(input);support.checkClone=div.cloneNode(!0).cloneNode(!0).lastChild.checked;div.innerHTML="<textarea>x</textarea>";support.noCloneChecked=!!div.cloneNode(!0).lastChild.defaultValue;div.innerHTML="<option></option>";support.option=!!div.lastChild})();var wrapMap={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!support.option){wrapMap.optgroup=wrapMap.option=[1,"<select multiple='multiple'>","</select>"]}
function getAll(context,tag){var ret;if(typeof context.getElementsByTagName!=="undefined"){ret=context.getElementsByTagName(tag||"*")}else if(typeof context.querySelectorAll!=="undefined"){ret=context.querySelectorAll(tag||"*")}else{ret=[]}
if(tag===undefined||tag&&nodeName(context,tag)){return jQuery.merge([context],ret)}
return ret}
function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i<l;i++){dataPriv.set(elems[i],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"))}}
var rhtml=/<|&#?\w+;/;function buildFragment(elems,context,scripts,selection,ignored){var elem,tmp,tag,wrap,attached,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;for(;i<l;i++){elem=elems[i];if(elem||elem===0){if(toType(elem)==="object"){jQuery.merge(nodes,elem.nodeType?[elem]:elem)}else if(!rhtml.test(elem)){nodes.push(context.createTextNode(elem))}else{tmp=tmp||fragment.appendChild(context.createElement("div"));tag=(rtagName.exec(elem)||["",""])[1].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+jQuery.htmlPrefilter(elem)+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild}
jQuery.merge(nodes,tmp.childNodes);tmp=fragment.firstChild;tmp.textContent=""}}}
fragment.textContent="";i=0;while((elem=nodes[i++])){if(selection&&jQuery.inArray(elem,selection)>-1){if(ignored){ignored.push(elem)}
continue}
attached=isAttached(elem);tmp=getAll(fragment.appendChild(elem),"script");if(attached){setGlobalEval(tmp)}
if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem)}}}}
return fragment}
var rtypenamespace=/^([^.]*)(?:\.(.+)|)/;function returnTrue(){return!0}
function returnFalse(){return!1}
function on(elem,types,selector,data,fn,one){var origFn,type;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined}
for(type in types){on(elem,type,selector,data,types[type],one)}
return elem}
if(data==null&&fn==null){fn=selector;data=selector=undefined}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined}else{fn=data;data=selector;selector=undefined}}
if(fn===!1){fn=returnFalse}else if(!fn){return elem}
if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments)};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++)}
return elem.each(function(){jQuery.event.add(this,types,fn,data,selector)})}
jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(!acceptData(elem)){return}
if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector}
if(selector){jQuery.find.matchesSelector(documentElement,selector)}
if(!handler.guid){handler.guid=jQuery.guid++}
if(!(events=elemData.events)){events=elemData.events=Object.create(null)}
if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!=="undefined"&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):undefined}}
types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue}
special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===!1){if(elem.addEventListener){elem.addEventListener(type,eventHandle)}}}
if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid}}
if(selector){handlers.splice(handlers.delegateCount++,0,handleObj)}else{handlers.push(handleObj)}
jQuery.event.global[type]=!0}},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(!elemData||!(events=elemData.events)){return}
types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,!0)}
continue}
special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--}
if(special.remove){special.remove.call(elem,handleObj)}}}
if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===!1){jQuery.removeEvent(elem,type,elemData.handle)}
delete events[type]}}
if(jQuery.isEmptyObject(events)){dataPriv.remove(elem,"handle events")}},dispatch:function(nativeEvent){var i,j,ret,matched,handleObj,handlerQueue,args=new Array(arguments.length),event=jQuery.event.fix(nativeEvent),handlers=(dataPriv.get(this,"events")||Object.create(null))[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;for(i=1;i<arguments.length;i++){args[i]=arguments[i]}
event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===!1){return}
handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.rnamespace||handleObj.namespace===!1||event.rnamespace.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===!1){event.preventDefault();event.stopPropagation()}}}}}
if(special.postDispatch){special.postDispatch.call(this,event)}
return event.result},handlers:function(event,handlers){var i,handleObj,sel,matchedHandlers,matchedSelectors,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&!(event.type==="click"&&event.button>=1)){for(;cur!==this;cur=cur.parentNode||this){if(cur.nodeType===1&&!(event.type==="click"&&cur.disabled===!0)){matchedHandlers=[];matchedSelectors={};for(i=0;i<delegateCount;i++){handleObj=handlers[i];sel=handleObj.selector+" ";if(matchedSelectors[sel]===undefined){matchedSelectors[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>-1:jQuery.find(sel,this,null,[cur]).length}
if(matchedSelectors[sel]){matchedHandlers.push(handleObj)}}
if(matchedHandlers.length){handlerQueue.push({elem:cur,handlers:matchedHandlers})}}}}
cur=this;if(delegateCount<handlers.length){handlerQueue.push({elem:cur,handlers:handlers.slice(delegateCount)})}
return handlerQueue},addProp:function(name,hook){Object.defineProperty(jQuery.Event.prototype,name,{enumerable:!0,configurable:!0,get:isFunction(hook)?function(){if(this.originalEvent){return hook(this.originalEvent)}}:function(){if(this.originalEvent){return this.originalEvent[name]}},set:function(value){Object.defineProperty(this,name,{enumerable:!0,configurable:!0,writable:!0,value:value})}})},fix:function(originalEvent){return originalEvent[jQuery.expando]?originalEvent:new jQuery.Event(originalEvent)},special:{load:{noBubble:!0},click:{setup:function(data){var el=this||data;if(rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")){leverageNative(el,"click",!0)}
return!1},trigger:function(data){var el=this||data;if(rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")){leverageNative(el,"click")}
return!0},_default:function(event){var target=event.target;return rcheckableType.test(target.type)&&target.click&&nodeName(target,"input")&&dataPriv.get(target,"click")||nodeName(target,"a")}},beforeunload:{postDispatch:function(event){if(event.result!==undefined&&event.originalEvent){event.originalEvent.returnValue=event.result}}}}};function leverageNative(el,type,isSetup){if(!isSetup){if(dataPriv.get(el,type)===undefined){jQuery.event.add(el,type,returnTrue)}
return}
dataPriv.set(el,type,!1);jQuery.event.add(el,type,{namespace:!1,handler:function(event){var result,saved=dataPriv.get(this,type);if((event.isTrigger&1)&&this[type]){if(!saved){saved=slice.call(arguments);dataPriv.set(this,type,saved);this[type]();result=dataPriv.get(this,type);dataPriv.set(this,type,!1);if(saved!==result){event.stopImmediatePropagation();event.preventDefault();return result}}else if((jQuery.event.special[type]||{}).delegateType){event.stopPropagation()}}else if(saved){dataPriv.set(this,type,jQuery.event.trigger(saved[0],saved.slice(1),this));event.stopPropagation();event.isImmediatePropagationStopped=returnTrue}}})}
jQuery.removeEvent=function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle)}};jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props)}
if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=src.defaultPrevented||src.defaultPrevented===undefined&&src.returnValue===!1?returnTrue:returnFalse;this.target=(src.target&&src.target.nodeType===3)?src.target.parentNode:src.target;this.currentTarget=src.currentTarget;this.relatedTarget=src.relatedTarget}else{this.type=src}
if(props){jQuery.extend(this,props)}
this.timeStamp=src&&src.timeStamp||Date.now();this[jQuery.expando]=!0};jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue;if(e&&!this.isSimulated){e.preventDefault()}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue;if(e&&!this.isSimulated){e.stopPropagation()}},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue;if(e&&!this.isSimulated){e.stopImmediatePropagation()}
this.stopPropagation()}};jQuery.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},jQuery.event.addProp);jQuery.each({focus:"focusin",blur:"focusout"},function(type,delegateType){function focusMappedHandler(nativeEvent){if(document.documentMode){var handle=dataPriv.get(this,"handle"),event=jQuery.event.fix(nativeEvent);event.type=nativeEvent.type==="focusin"?"focus":"blur";event.isSimulated=!0;handle(nativeEvent);if(event.target===event.currentTarget){handle(event)}}else{jQuery.event.simulate(delegateType,nativeEvent.target,jQuery.event.fix(nativeEvent))}}
jQuery.event.special[type]={setup:function(){var attaches;leverageNative(this,type,!0);if(document.documentMode){attaches=dataPriv.get(this,delegateType);if(!attaches){this.addEventListener(delegateType,focusMappedHandler)}
dataPriv.set(this,delegateType,(attaches||0)+1)}else{return!1}},trigger:function(){leverageNative(this,type);return!0},teardown:function(){var attaches;if(document.documentMode){attaches=dataPriv.get(this,delegateType)-1;if(!attaches){this.removeEventListener(delegateType,focusMappedHandler);dataPriv.remove(this,delegateType)}else{dataPriv.set(this,delegateType,attaches)}}else{return!1}},_default:function(event){return dataPriv.get(event.target,type)},delegateType:delegateType};jQuery.event.special[delegateType]={setup:function(){var doc=this.ownerDocument||this.document||this,dataHolder=document.documentMode?this:doc,attaches=dataPriv.get(dataHolder,delegateType);if(!attaches){if(document.documentMode){this.addEventListener(delegateType,focusMappedHandler)}else{doc.addEventListener(type,focusMappedHandler,!0)}}
dataPriv.set(dataHolder,delegateType,(attaches||0)+1)},teardown:function(){var doc=this.ownerDocument||this.document||this,dataHolder=document.documentMode?this:doc,attaches=dataPriv.get(dataHolder,delegateType)-1;if(!attaches){if(document.documentMode){this.removeEventListener(delegateType,focusMappedHandler)}else{doc.removeEventListener(type,focusMappedHandler,!0)}
dataPriv.remove(dataHolder,delegateType)}else{dataPriv.set(dataHolder,delegateType,attaches)}}}});jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;if(!related||(related!==target&&!jQuery.contains(target,related))){event.type=handleObj.origType;ret=handleObj.handler.apply(this,arguments);event.type=fix}
return ret}}});jQuery.fn.extend({on:function(types,selector,data,fn){return on(this,types,selector,data,fn)},one:function(types,selector,data,fn){return on(this,types,selector,data,fn,1)},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj){handleObj=types.handleObj;jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler);return this}
if(typeof types==="object"){for(type in types){this.off(type,selector,types[type])}
return this}
if(selector===!1||typeof selector==="function"){fn=selector;selector=undefined}
if(fn===!1){fn=returnFalse}
return this.each(function(){jQuery.event.remove(this,types,fn,selector)})}});var rnoInnerhtml=/<script|<style|<link/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rcleanScript=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function manipulationTarget(elem,content){if(nodeName(elem,"table")&&nodeName(content.nodeType!==11?content:content.firstChild,"tr")){return jQuery(elem).children("tbody")[0]||elem}
return elem}
function disableScript(elem){elem.type=(elem.getAttribute("type")!==null)+"/"+elem.type;return elem}
function restoreScript(elem){if((elem.type||"").slice(0,5)==="true/"){elem.type=elem.type.slice(5)}else{elem.removeAttribute("type")}
return elem}
function cloneCopyEvent(src,dest){var i,l,type,pdataOld,udataOld,udataCur,events;if(dest.nodeType!==1){return}
if(dataPriv.hasData(src)){pdataOld=dataPriv.get(src);events=pdataOld.events;if(events){dataPriv.remove(dest,"handle events");for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(dest,type,events[type][i])}}}}
if(dataUser.hasData(src)){udataOld=dataUser.access(src);udataCur=jQuery.extend({},udataOld);dataUser.set(dest,udataCur)}}
function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();if(nodeName==="input"&&rcheckableType.test(src.type)){dest.checked=src.checked}else if(nodeName==="input"||nodeName==="textarea"){dest.defaultValue=src.defaultValue}}
function domManip(collection,args,callback,ignored){args=flat(args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=collection.length,iNoClone=l-1,value=args[0],valueIsFunction=isFunction(value);if(valueIsFunction||(l>1&&typeof value==="string"&&!support.checkClone&&rchecked.test(value))){return collection.each(function(index){var self=collection.eq(index);if(valueIsFunction){args[0]=value.call(this,index,self.html())}
domManip(self,args,callback,ignored)})}
if(l){fragment=buildFragment(args,collection[0].ownerDocument,!1,collection,ignored);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first}
if(first||ignored){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i<l;i++){node=fragment;if(i!==iNoClone){node=jQuery.clone(node,!0,!0);if(hasScripts){jQuery.merge(scripts,getAll(node,"script"))}}
callback.call(collection[i],node,i)}
if(hasScripts){doc=scripts[scripts.length-1].ownerDocument;jQuery.map(scripts,restoreScript);for(i=0;i<hasScripts;i++){node=scripts[i];if(rscriptType.test(node.type||"")&&!dataPriv.access(node,"globalEval")&&jQuery.contains(doc,node)){if(node.src&&(node.type||"").toLowerCase()!=="module"){if(jQuery._evalUrl&&!node.noModule){jQuery._evalUrl(node.src,{nonce:node.nonce||node.getAttribute("nonce")},doc)}}else{DOMEval(node.textContent.replace(rcleanScript,""),node,doc)}}}}}}
return collection}
function remove(elem,selector,keepData){var node,nodes=selector?jQuery.filter(selector,elem):elem,i=0;for(;(node=nodes[i])!=null;i++){if(!keepData&&node.nodeType===1){jQuery.cleanData(getAll(node))}
if(node.parentNode){if(keepData&&isAttached(node)){setGlobalEval(getAll(node,"script"))}
node.parentNode.removeChild(node)}}
return elem}
jQuery.extend({htmlPrefilter:function(html){return html},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(!0),inPage=isAttached(elem);if(!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i<l;i++){fixInput(srcElements[i],destElements[i])}}
if(dataAndEvents){if(deepDataAndEvents){srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0,l=srcElements.length;i<l;i++){cloneCopyEvent(srcElements[i],destElements[i])}}else{cloneCopyEvent(elem,clone)}}
destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"))}
return clone},cleanData:function(elems){var data,elem,type,special=jQuery.event.special,i=0;for(;(elem=elems[i])!==undefined;i++){if(acceptData(elem)){if((data=elem[dataPriv.expando])){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type)}else{jQuery.removeEvent(elem,type,data.handle)}}}
elem[dataPriv.expando]=undefined}
if(elem[dataUser.expando]){elem[dataUser.expando]=undefined}}}}});jQuery.fn.extend({detach:function(selector){return remove(this,selector,!0)},remove:function(selector){return remove(this,selector)},text:function(value){return access(this,function(value){return value===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=value}})},null,value,arguments.length)},append:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem)}})},prepend:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild)}})},before:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this)}})},after:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling)}})},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,!1));elem.textContent=""}}
return this},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?!1:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined&&elem.nodeType===1){return elem.innerHTML}
if(typeof value==="string"&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i<l;i++){elem=this[i]||{};if(elem.nodeType===1){jQuery.cleanData(getAll(elem,!1));elem.innerHTML=value}}
elem=0}catch(e){}}
if(elem){this.empty().append(value)}},null,value,arguments.length)},replaceWith:function(){var ignored=[];return domManip(this,arguments,function(elem){var parent=this.parentNode;if(jQuery.inArray(this,ignored)<0){jQuery.cleanData(getAll(this));if(parent){parent.replaceChild(elem,this)}}},ignored)}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;for(;i<=last;i++){elems=i===last?this:this.clone(!0);jQuery(insert[i])[original](elems);push.apply(ret,elems.get())}
return this.pushStack(ret)}});var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i");var rcustomProp=/^--/;var getStyles=function(elem){var view=elem.ownerDocument.defaultView;if(!view||!view.opener){view=window}
return view.getComputedStyle(elem)};var swap=function(elem,options,callback){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name]}
ret=callback.call(elem);for(name in options){elem.style[name]=old[name]}
return ret};var rboxStyle=new RegExp(cssExpand.join("|"),"i");(function(){function computeStyleTests(){if(!div){return}
container.style.cssText="position:absolute;left:-11111px;width:60px;"+"margin-top:1px;padding:0;border:0";div.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;"+"margin:auto;border:1px;padding:1px;"+"width:60%;top:1%";documentElement.appendChild(container).appendChild(div);var divStyle=window.getComputedStyle(div);pixelPositionVal=divStyle.top!=="1%";reliableMarginLeftVal=roundPixelMeasures(divStyle.marginLeft)===12;div.style.right="60%";pixelBoxStylesVal=roundPixelMeasures(divStyle.right)===36;boxSizingReliableVal=roundPixelMeasures(divStyle.width)===36;div.style.position="absolute";scrollboxSizeVal=roundPixelMeasures(div.offsetWidth/3)===12;documentElement.removeChild(container);div=null}
function roundPixelMeasures(measure){return Math.round(parseFloat(measure))}
var pixelPositionVal,boxSizingReliableVal,scrollboxSizeVal,pixelBoxStylesVal,reliableTrDimensionsVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");if(!div.style){return}
div.style.backgroundClip="content-box";div.cloneNode(!0).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";jQuery.extend(support,{boxSizingReliable:function(){computeStyleTests();return boxSizingReliableVal},pixelBoxStyles:function(){computeStyleTests();return pixelBoxStylesVal},pixelPosition:function(){computeStyleTests();return pixelPositionVal},reliableMarginLeft:function(){computeStyleTests();return reliableMarginLeftVal},scrollboxSize:function(){computeStyleTests();return scrollboxSizeVal},reliableTrDimensions:function(){var table,tr,trChild,trStyle;if(reliableTrDimensionsVal==null){table=document.createElement("table");tr=document.createElement("tr");trChild=document.createElement("div");table.style.cssText="position:absolute;left:-11111px;border-collapse:separate";tr.style.cssText="box-sizing:content-box;border:1px solid";tr.style.height="1px";trChild.style.height="9px";trChild.style.display="block";documentElement.appendChild(table).appendChild(tr).appendChild(trChild);trStyle=window.getComputedStyle(tr);reliableTrDimensionsVal=(parseInt(trStyle.height,10)+parseInt(trStyle.borderTopWidth,10)+parseInt(trStyle.borderBottomWidth,10))===tr.offsetHeight;documentElement.removeChild(table)}
return reliableTrDimensionsVal}})})();function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,isCustomProp=rcustomProp.test(name),style=elem.style;computed=computed||getStyles(elem);if(computed){ret=computed.getPropertyValue(name)||computed[name];if(isCustomProp&&ret){ret=ret.replace(rtrimCSS,"$1")||undefined}
if(ret===""&&!isAttached(elem)){ret=jQuery.style(elem,name)}
if(!support.pixelBoxStyles()&&rnumnonpx.test(ret)&&rboxStyle.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth}}
return ret!==undefined?ret+"":ret}
function addGetHookIf(conditionFn,hookFn){return{get:function(){if(conditionFn()){delete this.get;return}
return(this.get=hookFn).apply(this,arguments)}}}
var cssPrefixes=["Webkit","Moz","ms"],emptyStyle=document.createElement("div").style,vendorProps={};function vendorPropName(name){var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name}}}
function finalPropName(name){var final=jQuery.cssProps[name]||vendorProps[name];if(final){return final}
if(name in emptyStyle){return name}
return vendorProps[name]=vendorPropName(name)||name}
var rdisplayswap=/^(none|table(?!-c[ea]).+)/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"};function setPositiveNumber(_elem,value,subtract){var matches=rcssNum.exec(value);return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value}
function boxModelAdjustment(elem,dimension,box,isBorderBox,styles,computedVal){var i=dimension==="width"?1:0,extra=0,delta=0,marginDelta=0;if(box===(isBorderBox?"border":"content")){return 0}
for(;i<4;i+=2){if(box==="margin"){marginDelta+=jQuery.css(elem,box+cssExpand[i],!0,styles)}
if(!isBorderBox){delta+=jQuery.css(elem,"padding"+cssExpand[i],!0,styles);if(box!=="padding"){delta+=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles)}else{extra+=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles)}}else{if(box==="content"){delta-=jQuery.css(elem,"padding"+cssExpand[i],!0,styles)}
if(box!=="margin"){delta-=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles)}}}
if(!isBorderBox&&computedVal>=0){delta+=Math.max(0,Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-computedVal-delta-extra-0.5))||0}
return delta+marginDelta}
function getWidthOrHeight(elem,dimension,extra){var styles=getStyles(elem),boxSizingNeeded=!support.boxSizingReliable()||extra,isBorderBox=boxSizingNeeded&&jQuery.css(elem,"boxSizing",!1,styles)==="border-box",valueIsBorderBox=isBorderBox,val=curCSS(elem,dimension,styles),offsetProp="offset"+dimension[0].toUpperCase()+dimension.slice(1);if(rnumnonpx.test(val)){if(!extra){return val}
val="auto"}
if((!support.boxSizingReliable()&&isBorderBox||!support.reliableTrDimensions()&&nodeName(elem,"tr")||val==="auto"||!parseFloat(val)&&jQuery.css(elem,"display",!1,styles)==="inline")&&elem.getClientRects().length){isBorderBox=jQuery.css(elem,"boxSizing",!1,styles)==="border-box";valueIsBorderBox=offsetProp in elem;if(valueIsBorderBox){val=elem[offsetProp]}}
val=parseFloat(val)||0;return(val+boxModelAdjustment(elem,dimension,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles,val))+"px"}
jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return}
var ret,type,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name),style=elem.style;if(!isCustomProp){name=finalPropName(origName)}
hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rcssNum.exec(value))&&ret[1]){value=adjustCSS(elem,name,ret);type="number"}
if(value==null||value!==value){return}
if(type==="number"&&!isCustomProp){value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px")}
if(!support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit"}
if(!hooks||!("set" in hooks)||(value=hooks.set(elem,value,extra))!==undefined){if(isCustomProp){style.setProperty(name,value)}else{style[name]=value}}}else{if(hooks&&"get" in hooks&&(ret=hooks.get(elem,!1,extra))!==undefined){return ret}
return style[name]}},css:function(elem,name,extra,styles){var val,num,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name);if(!isCustomProp){name=finalPropName(origName)}
hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get" in hooks){val=hooks.get(elem,!0,extra)}
if(val===undefined){val=curCSS(elem,name,styles)}
if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name]}
if(extra===""||extra){num=parseFloat(val);return extra===!0||isFinite(num)?num||0:val}
return val}});jQuery.each(["height","width"],function(_i,dimension){jQuery.cssHooks[dimension]={get:function(elem,computed,extra){if(computed){return rdisplayswap.test(jQuery.css(elem,"display"))&&(!elem.getClientRects().length||!elem.getBoundingClientRect().width)?swap(elem,cssShow,function(){return getWidthOrHeight(elem,dimension,extra)}):getWidthOrHeight(elem,dimension,extra)}},set:function(elem,value,extra){var matches,styles=getStyles(elem),scrollboxSizeBuggy=!support.scrollboxSize()&&styles.position==="absolute",boxSizingNeeded=scrollboxSizeBuggy||extra,isBorderBox=boxSizingNeeded&&jQuery.css(elem,"boxSizing",!1,styles)==="border-box",subtract=extra?boxModelAdjustment(elem,dimension,extra,isBorderBox,styles):0;if(isBorderBox&&scrollboxSizeBuggy){subtract-=Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-parseFloat(styles[dimension])-boxModelAdjustment(elem,dimension,"border",!1,styles)-0.5)}
if(subtract&&(matches=rcssNum.exec(value))&&(matches[3]||"px")!=="px"){elem.style[dimension]=value;value=jQuery.css(elem,dimension)}
return setPositiveNumber(elem,value,subtract)}}});jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,function(elem,computed){if(computed){return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left-swap(elem,{marginLeft:0},function(){return elem.getBoundingClientRect().left}))+"px"}});jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0]}
return expanded}};if(prefix!=="margin"){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber}});jQuery.fn.extend({css:function(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(Array.isArray(name)){styles=getStyles(elem);len=name.length;for(;i<len;i++){map[name[i]]=jQuery.css(elem,name[i],!1,styles)}
return map}
return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name)},name,value,arguments.length>1)}});function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing)}
jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||jQuery.easing._default;this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px")},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this)},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration)}else{this.pos=eased=percent}
this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)}
if(hooks&&hooks.set){hooks.set(this)}else{Tween.propHooks._default.set(this)}
return this}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function(tween){var result;if(tween.elem.nodeType!==1||tween.elem[tween.prop]!=null&&tween.elem.style[tween.prop]==null){return tween.elem[tween.prop]}
result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result},set:function(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween)}else if(tween.elem.nodeType===1&&(jQuery.cssHooks[tween.prop]||tween.elem.style[finalPropName(tween.prop)]!=null)){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit)}else{tween.elem[tween.prop]=tween.now}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now}}};jQuery.easing={linear:function(p){return p},swing:function(p){return 0.5-Math.cos(p*Math.PI)/2},_default:"swing"};jQuery.fx=Tween.prototype.init;jQuery.fx.step={};var fxNow,inProgress,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function schedule(){if(inProgress){if(document.hidden===!1&&window.requestAnimationFrame){window.requestAnimationFrame(schedule)}else{window.setTimeout(schedule,jQuery.fx.interval)}
jQuery.fx.tick()}}
function createFxNow(){window.setTimeout(function(){fxNow=undefined});return(fxNow=Date.now())}
function genFx(type,includeWidth){var which,i=0,attrs={height:type};includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type}
if(includeWidth){attrs.opacity=attrs.width=type}
return attrs}
function createTween(value,prop,animation){var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;for(;index<length;index++){if((tween=collection[index].call(animation,prop,value))){return tween}}}
function defaultPrefilter(elem,props,opts){var prop,value,toggle,hooks,oldfire,propTween,restoreDisplay,display,isBox="width" in props||"height" in props,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHiddenWithinTree(elem),dataShow=dataPriv.get(elem,"fxshow");if(!opts.queue){hooks=jQuery._queueHooks(elem,"fx");if(hooks.unqueued==null){hooks.unqueued=0;oldfire=hooks.empty.fire;hooks.empty.fire=function(){if(!hooks.unqueued){oldfire()}}}
hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(elem,"fx").length){hooks.empty.fire()}})})}
for(prop in props){value=props[prop];if(rfxtypes.test(value)){delete props[prop];toggle=toggle||value==="toggle";if(value===(hidden?"hide":"show")){if(value==="show"&&dataShow&&dataShow[prop]!==undefined){hidden=!0}else{continue}}
orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop)}}
propTween=!jQuery.isEmptyObject(props);if(!propTween&&jQuery.isEmptyObject(orig)){return}
if(isBox&&elem.nodeType===1){opts.overflow=[style.overflow,style.overflowX,style.overflowY];restoreDisplay=dataShow&&dataShow.display;if(restoreDisplay==null){restoreDisplay=dataPriv.get(elem,"display")}
display=jQuery.css(elem,"display");if(display==="none"){if(restoreDisplay){display=restoreDisplay}else{showHide([elem],!0);restoreDisplay=elem.style.display||restoreDisplay;display=jQuery.css(elem,"display");showHide([elem])}}
if(display==="inline"||display==="inline-block"&&restoreDisplay!=null){if(jQuery.css(elem,"float")==="none"){if(!propTween){anim.done(function(){style.display=restoreDisplay});if(restoreDisplay==null){display=style.display;restoreDisplay=display==="none"?"":display}}
style.display="inline-block"}}}
if(opts.overflow){style.overflow="hidden";anim.always(function(){style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2]})}
propTween=!1;for(prop in orig){if(!propTween){if(dataShow){if("hidden" in dataShow){hidden=dataShow.hidden}}else{dataShow=dataPriv.access(elem,"fxshow",{display:restoreDisplay})}
if(toggle){dataShow.hidden=!hidden}
if(hidden){showHide([elem],!0)}
anim.done(function(){if(!hidden){showHide([elem])}
dataPriv.remove(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop])}})}
propTween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop]=propTween.start;if(hidden){propTween.end=propTween.start;propTween.start=0}}}}
function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props){name=camelCase(index);easing=specialEasing[name];value=props[index];if(Array.isArray(value)){easing=value[1];value=props[index]=value[0]}
if(index!==name){props[name]=value;delete props[index]}
hooks=jQuery.cssHooks[name];if(hooks&&"expand" in hooks){value=hooks.expand(value);delete props[name];for(index in value){if(!(index in props)){props[index]=value[index];specialEasing[index]=easing}}}else{specialEasing[name]=easing}}}
function Animation(elem,properties,options){var result,stopped,index=0,length=Animation.prefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem}),tick=function(){if(stopped){return!1}
var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;for(;index<length;index++){animation.tweens[index].run(percent)}
deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){return remaining}
if(!length){deferred.notifyWith(elem,[animation,1,0])}
deferred.resolveWith(elem,[animation]);return!1},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(!0,{specialEasing:{},easing:jQuery.easing._default},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);animation.tweens.push(tween);return tween},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped){return this}
stopped=!0;for(;index<length;index++){animation.tweens[index].run(1)}
if(gotoEnd){deferred.notifyWith(elem,[animation,1,0]);deferred.resolveWith(elem,[animation,gotoEnd])}else{deferred.rejectWith(elem,[animation,gotoEnd])}
return this}}),props=animation.props;propFilter(props,animation.opts.specialEasing);for(;index<length;index++){result=Animation.prefilters[index].call(animation,elem,props,animation.opts);if(result){if(isFunction(result.stop)){jQuery._queueHooks(animation.elem,animation.opts.queue).stop=result.stop.bind(result)}
return result}}
jQuery.map(props,createTween,animation);if(isFunction(animation.opts.start)){animation.opts.start.call(elem,animation)}
animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue}));return animation}
jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){var tween=this.createTween(prop,value);adjustCSS(tween.elem,prop,rcssNum.exec(value),tween);return tween}]},tweener:function(props,callback){if(isFunction(props)){callback=props;props=["*"]}else{props=props.match(rnothtmlwhite)}
var prop,index=0,length=props.length;for(;index<length;index++){prop=props[index];Animation.tweeners[prop]=Animation.tweeners[prop]||[];Animation.tweeners[prop].unshift(callback)}},prefilters:[defaultPrefilter],prefilter:function(callback,prepend){if(prepend){Animation.prefilters.unshift(callback)}else{Animation.prefilters.push(callback)}}});jQuery.speed=function(speed,easing,fn){var opt=speed&&typeof speed==="object"?jQuery.extend({},speed):{complete:fn||!fn&&easing||isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!isFunction(easing)&&easing};if(jQuery.fx.off){opt.duration=0}else{if(typeof opt.duration!=="number"){if(opt.duration in jQuery.fx.speeds){opt.duration=jQuery.fx.speeds[opt.duration]}else{opt.duration=jQuery.fx.speeds._default}}}
if(opt.queue==null||opt.queue===!0){opt.queue="fx"}
opt.old=opt.complete;opt.complete=function(){if(isFunction(opt.old)){opt.old.call(this)}
if(opt.queue){jQuery.dequeue(this,opt.queue)}};return opt};jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHiddenWithinTree).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback)},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);if(empty||dataPriv.get(this,"finish")){anim.stop(!0)}};doAnimation.finish=doAnimation;return empty||optall.queue===!1?this.each(doAnimation):this.queue(optall.queue,doAnimation)},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop;stop(gotoEnd)};if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;type=undefined}
if(clearQueue){this.queue(type||"fx",[])}
return this.each(function(){var dequeue=!0,index=type!=null&&type+"queueHooks",timers=jQuery.timers,data=dataPriv.get(this);if(index){if(data[index]&&data[index].stop){stopQueue(data[index])}}else{for(index in data){if(data[index]&&data[index].stop&&rrun.test(index)){stopQueue(data[index])}}}
for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);dequeue=!1;timers.splice(index,1)}}
if(dequeue||!gotoEnd){jQuery.dequeue(this,type)}})},finish:function(type){if(type!==!1){type=type||"fx"}
return this.each(function(){var index,data=dataPriv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;data.finish=!0;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){hooks.stop.call(this,!0)}
for(index=timers.length;index--;){if(timers[index].elem===this&&timers[index].queue===type){timers[index].anim.stop(!0);timers.splice(index,1)}}
for(index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this)}}
delete data.finish})}});jQuery.each(["toggle","show","hide"],function(_i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return speed==null||typeof speed==="boolean"?cssFn.apply(this,arguments):this.animate(genFx(name,!0),speed,easing,callback)}});jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback)}});jQuery.timers=[];jQuery.fx.tick=function(){var timer,i=0,timers=jQuery.timers;fxNow=Date.now();for(;i<timers.length;i++){timer=timers[i];if(!timer()&&timers[i]===timer){timers.splice(i--,1)}}
if(!timers.length){jQuery.fx.stop()}
fxNow=undefined};jQuery.fx.timer=function(timer){jQuery.timers.push(timer);jQuery.fx.start()};jQuery.fx.interval=13;jQuery.fx.start=function(){if(inProgress){return}
inProgress=!0;schedule()};jQuery.fx.stop=function(){inProgress=null};jQuery.fx.speeds={slow:600,fast:200,_default:400};jQuery.fn.delay=function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(next,hooks){var timeout=window.setTimeout(next,time);hooks.stop=function(){window.clearTimeout(timeout)}})};(function(){var input=document.createElement("input"),select=document.createElement("select"),opt=select.appendChild(document.createElement("option"));input.type="checkbox";support.checkOn=input.value!=="";support.optSelected=opt.selected;input=document.createElement("input");input.value="t";input.type="radio";support.radioValue=input.value==="t"})();var boolHook,attrHandle=jQuery.expr.attrHandle;jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,arguments.length>1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name)})}});jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return}
if(typeof elem.getAttribute==="undefined"){return jQuery.prop(elem,name,value)}
if(nType!==1||!jQuery.isXMLDoc(elem)){hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:undefined)}
if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);return}
if(hooks&&"set" in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret}
elem.setAttribute(name,value+"");return value}
if(hooks&&"get" in hooks&&(ret=hooks.get(elem,name))!==null){return ret}
ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&value==="radio"&&nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val}
return value}}}},removeAttr:function(elem,value){var name,i=0,attrNames=value&&value.match(rnothtmlwhite);if(attrNames&&elem.nodeType===1){while((name=attrNames[i++])){elem.removeAttribute(name)}}}});boolHook={set:function(elem,value,name){if(value===!1){jQuery.removeAttr(elem,name)}else{elem.setAttribute(name,name)}
return name}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(_i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle,lowercaseName=name.toLowerCase();if(!isXML){handle=attrHandle[lowercaseName];attrHandle[lowercaseName]=ret;ret=getter(elem,name,isXML)!=null?lowercaseName:null;attrHandle[lowercaseName]=handle}
return ret}});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return this.each(function(){delete this[jQuery.propFix[name]||name]})}});jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return}
if(nType!==1||!jQuery.isXMLDoc(elem)){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name]}
if(value!==undefined){if(hooks&&"set" in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret}
return(elem[name]=value)}
if(hooks&&"get" in hooks&&(ret=hooks.get(elem,name))!==null){return ret}
return elem[name]},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");if(tabindex){return parseInt(tabindex,10)}
if(rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href){return 0}
return-1}}},propFix:{"for":"htmlFor","class":"className"}});if(!support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent&&parent.parentNode){parent.parentNode.selectedIndex}
return null},set:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex}}}}}
jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this});function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(" ")}
function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||""}
function classesToArray(value){if(Array.isArray(value)){return value}
if(typeof value==="string"){return value.match(rnothtmlwhite)||[]}
return[]}
jQuery.fn.extend({addClass:function(value){var classNames,cur,curValue,className,i,finalValue;if(isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)))})}
classNames=classesToArray(value);if(classNames.length){return this.each(function(){curValue=getClass(this);cur=this.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){for(i=0;i<classNames.length;i++){className=classNames[i];if(cur.indexOf(" "+className+" ")<0){cur+=className+" "}}
finalValue=stripAndCollapse(cur);if(curValue!==finalValue){this.setAttribute("class",finalValue)}}})}
return this},removeClass:function(value){var classNames,cur,curValue,className,i,finalValue;if(isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)))})}
if(!arguments.length){return this.attr("class","")}
classNames=classesToArray(value);if(classNames.length){return this.each(function(){curValue=getClass(this);cur=this.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){for(i=0;i<classNames.length;i++){className=classNames[i];while(cur.indexOf(" "+className+" ")>-1){cur=cur.replace(" "+className+" "," ")}}
finalValue=stripAndCollapse(cur);if(curValue!==finalValue){this.setAttribute("class",finalValue)}}})}
return this},toggleClass:function(value,stateVal){var classNames,className,i,self,type=typeof value,isValidValue=type==="string"||Array.isArray(value);if(isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal)})}
if(typeof stateVal==="boolean"&&isValidValue){return stateVal?this.addClass(value):this.removeClass(value)}
classNames=classesToArray(value);return this.each(function(){if(isValidValue){self=jQuery(this);for(i=0;i<classNames.length;i++){className=classNames[i];if(self.hasClass(className)){self.removeClass(className)}else{self.addClass(className)}}}else if(value===undefined||type==="boolean"){className=getClass(this);if(className){dataPriv.set(this,"__className__",className)}
if(this.setAttribute){this.setAttribute("class",className||value===!1?"":dataPriv.get(this,"__className__")||"")}}})},hasClass:function(selector){var className,elem,i=0;className=" "+selector+" ";while((elem=this[i++])){if(elem.nodeType===1&&(" "+stripAndCollapse(getClass(elem))+" ").indexOf(className)>-1){return!0}}
return!1}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,valueIsFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get" in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret}
ret=elem.value;if(typeof ret==="string"){return ret.replace(rreturn,"")}
return ret==null?"":ret}
return}
valueIsFunction=isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return}
if(valueIsFunction){val=value.call(this,i,jQuery(this).val())}else{val=value}
if(val==null){val=""}else if(typeof val==="number"){val+=""}else if(Array.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+""})}
hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set" in hooks)||hooks.set(this,val,"value")===undefined){this.value=val}})}});jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:stripAndCollapse(jQuery.text(elem))}},select:{get:function(elem){var value,option,i,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one",values=one?null:[],max=one?index+1:options.length;if(index<0){i=max}else{i=one?index:0}
for(;i<max;i++){option=options[i];if((option.selected||i===index)&&!option.disabled&&(!option.parentNode.disabled||!nodeName(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value}
values.push(value)}}
return values},set:function(elem,value){var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;while(i--){option=options[i];if(option.selected=jQuery.inArray(jQuery.valHooks.option.get(option),values)>-1){optionSet=!0}}
if(!optionSet){elem.selectedIndex=-1}
return values}}}});jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(Array.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1)}}};if(!support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value}}});var location=window.location;var nonce={guid:Date.now()};var rquery=(/\?/);jQuery.parseXML=function(data){var xml,parserErrorElem;if(!data||typeof data!=="string"){return null}
try{xml=(new window.DOMParser()).parseFromString(data,"text/xml")}catch(e){}
parserErrorElem=xml&&xml.getElementsByTagName("parsererror")[0];if(!xml||parserErrorElem){jQuery.error("Invalid XML: "+(parserErrorElem?jQuery.map(parserErrorElem.childNodes,function(el){return el.textContent}).join("\n"):data))}
return xml};var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,stopPropagationCallback=function(e){e.stopPropagation()};jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,lastElement,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=lastElement=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return}
if(rfocusMorph.test(type+jQuery.event.triggered)){return}
if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();namespaces.sort()}
ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem}
data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===!1){return}
if(!onlyHandlers&&!special.noBubble&&!isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode}
for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur}
if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window)}}
i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){lastElement=cur;event.type=i>1?bubbleType:special.bindType||type;handle=(dataPriv.get(cur,"events")||Object.create(null))[event.type]&&dataPriv.get(cur,"handle");if(handle){handle.apply(cur,data)}
handle=ontype&&cur[ontype];if(handle&&handle.apply&&acceptData(cur)){event.result=handle.apply(cur,data);if(event.result===!1){event.preventDefault()}}}
event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===!1)&&acceptData(elem)){if(ontype&&isFunction(elem[type])&&!isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null}
jQuery.event.triggered=type;if(event.isPropagationStopped()){lastElement.addEventListener(type,stopPropagationCallback)}
elem[type]();if(event.isPropagationStopped()){lastElement.removeEventListener(type,stopPropagationCallback)}
jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp}}}}
return event.result},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:!0});jQuery.event.trigger(e,null,elem)}});jQuery.fn.extend({trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,!0)}}});var rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(Array.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v)}else{buildParams(prefix+"["+(typeof v==="object"&&v!=null?i:"")+"]",v,traditional,add)}})}else if(!traditional&&toType(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add)}}else{add(prefix,obj)}}
jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value==null?"":value)};if(a==null){return""}
if(Array.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value)})}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add)}}
return s.join("&")};jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type))}).map(function(_i,elem){var val=jQuery(this).val();if(val==null){return null}
if(Array.isArray(val)){return jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}})}
return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}});var r20=/%20/g,rhash=/#.*$/,rantiCache=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href;function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*"}
var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];if(isFunction(func)){while((dataType=dataTypes[i++])){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func)}else{(structure[dataType]=structure[dataType]||[]).push(func)}}}}}
function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=(structure===transports);function inspect(dataType){var selected;inspected[dataType]=!0;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return!1}else if(seekingTransport){return!(selected=dataTypeOrTransport)}});return selected}
return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}
function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key]}}
if(deep){jQuery.extend(!0,target,deep)}
return target}
function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type")}}
if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}}}
if(dataTypes[0]in responses){finalDataType=dataTypes[0]}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}
if(!firstDataType){firstDataType=type}}
finalDataType=finalDataType||firstDataType}
if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType)}
return responses[finalDataType]}}
function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv]}}
current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response}
if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType)}
prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===!0){conv=converters[conv2]}else if(converters[conv2]!==!0){current=tmp[0];dataTypes.unshift(tmp[1])}
break}}}}
if(conv!==!0){if(conv&&s.throws){response=conv(response)}else{try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}}}}}
return{state:"success",data:response}}
jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined}
options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,completed,fireGlobals,i,uncached,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()+" "]=(responseHeaders[match[1].toLowerCase()+" "]||[]).concat(match[2])}}
match=responseHeaders[key.toLowerCase()+" "]}
return match==null?null:match.join(", ")},getAllResponseHeaders:function(){return completed?responseHeadersString:null},setRequestHeader:function(name,value){if(completed==null){name=requestHeadersNames[name.toLowerCase()]=requestHeadersNames[name.toLowerCase()]||name;requestHeaders[name]=value}
return this},overrideMimeType:function(type){if(completed==null){s.mimeType=type}
return this},statusCode:function(map){var code;if(map){if(completed){jqXHR.always(map[jqXHR.status])}else{for(code in map){statusCode[code]=[statusCode[code],map[code]]}}}
return this},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText)}
done(0,finalText);return this}};deferred.promise(jqXHR);s.url=((url||s.url||location.href)+"").replace(rprotocol,location.protocol+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=(s.dataType||"*").toLowerCase().match(rnothtmlwhite)||[""];if(s.crossDomain==null){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url;urlAnchor.href=urlAnchor.href;s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!==urlAnchor.protocol+"//"+urlAnchor.host}catch(e){s.crossDomain=!0}}
if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional)}
inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(completed){return jqXHR}
fireGlobals=jQuery.event&&s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart")}
s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url.replace(rhash,"");if(!s.hasContent){uncached=s.url.slice(cacheURL.length);if(s.data&&(s.processData||typeof s.data==="string")){cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data;delete s.data}
if(s.cache===!1){cacheURL=cacheURL.replace(rantiCache,"$1");uncached=(rquery.test(cacheURL)?"&":"?")+"_="+(nonce.guid++)+uncached}
s.url=cacheURL+uncached}else if(s.data&&s.processData&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0){s.data=s.data.replace(r20,"+")}
if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL])}
if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])}}
if(s.data&&s.hasContent&&s.contentType!==!1||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType)}
jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i])}
if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===!1||completed)){return jqXHR.abort()}
strAbort="abort";completeDeferred.add(s.complete);jqXHR.done(s.success);jqXHR.fail(s.error);transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport")}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s])}
if(completed){return jqXHR}
if(s.async&&s.timeout>0){timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout")},s.timeout)}
try{completed=!1;transport.send(requestHeaders,done)}catch(e){if(completed){throw e}
done(-1,e)}}
function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(completed){return}
completed=!0;if(timeoutTimer){window.clearTimeout(timeoutTimer)}
transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses)}
if(!isSuccess&&jQuery.inArray("script",s.dataTypes)>-1&&jQuery.inArray("json",s.dataTypes)<0){s.converters["text script"]=function(){}}
response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified}
modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified}}
if(status===204||s.type==="HEAD"){statusText="nocontent"}else if(status===304){statusText="notmodified"}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error}}else{error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0}}}
jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR])}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error])}
jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error])}
completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop")}}}
return jqXHR},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script")}});jQuery.each(["get","post"],function(_i,method){jQuery[method]=function(url,data,callback,type){if(isFunction(data)){type=type||callback;callback=data;data=undefined}
return jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url))}});jQuery.ajaxPrefilter(function(s){var i;for(i in s.headers){if(i.toLowerCase()==="content-type"){s.contentType=s.headers[i]||""}}});jQuery._evalUrl=function(url,options,doc){return jQuery.ajax({url:url,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(response){jQuery.globalEval(response,options,doc)}})};jQuery.fn.extend({wrapAll:function(html){var wrap;if(this[0]){if(isFunction(html)){html=html.call(this[0])}
wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(!0);if(this[0].parentNode){wrap.insertBefore(this[0])}
wrap.map(function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild}
return elem}).append(this)}
return this},wrapInner:function(html){if(isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i))})}
return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html)}else{self.append(html)}})},wrap:function(html){var htmlIsFunction=isFunction(html);return this.each(function(i){jQuery(this).wrapAll(htmlIsFunction?html.call(this,i):html)})},unwrap:function(selector){this.parent(selector).not("body").each(function(){jQuery(this).replaceWith(this.childNodes)});return this}});jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem)};jQuery.expr.pseudos.visible=function(elem){return!!(elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length)};jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest()}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&("withCredentials" in xhrSupported);support.ajax=xhrSupported=!!xhrSupported;jQuery.ajaxTransport(function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain){return{send:function(headers,complete){var i,xhr=options.xhr();xhr.open(options.type,options.url,options.async,options.username,options.password);if(options.xhrFields){for(i in options.xhrFields){xhr[i]=options.xhrFields[i]}}
if(options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType)}
if(!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest"}
for(i in headers){xhr.setRequestHeader(i,headers[i])}
callback=function(type){return function(){if(callback){callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.ontimeout=xhr.onreadystatechange=null;if(type==="abort"){xhr.abort()}else if(type==="error"){if(typeof xhr.status!=="number"){complete(0,"error")}else{complete(xhr.status,xhr.statusText)}}else{complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,(xhr.responseType||"text")!=="text"||typeof xhr.responseText!=="string"?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders())}}}};xhr.onload=callback();errorCallback=xhr.onerror=xhr.ontimeout=callback("error");if(xhr.onabort!==undefined){xhr.onabort=errorCallback}else{xhr.onreadystatechange=function(){if(xhr.readyState===4){window.setTimeout(function(){if(callback){errorCallback()}})}}}
callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null)}catch(e){if(callback){throw e}}},abort:function(){if(callback){callback()}}}}});jQuery.ajaxPrefilter(function(s){if(s.crossDomain){s.contents.script=!1}});jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){jQuery.globalEval(text);return text}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=!1}
if(s.crossDomain){s.type="GET"}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain||s.scriptAttrs){var script,callback;return{send:function(_,complete){script=jQuery("<script>").attr(s.scriptAttrs||{}).prop({charset:s.scriptCharset,src:s.url}).on("load error",callback=function(evt){script.remove();callback=null;if(evt){complete(evt.type==="error"?404:200,evt.type)}});document.head.appendChild(script[0])},abort:function(){if(callback){callback()}}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||(jQuery.expando+"_"+(nonce.guid++));this[callback]=!0;return callback}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==!1&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&rjsonp.test(s.data)&&"data");if(jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName)}else if(s.jsonp!==!1){s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName}
s.converters["script json"]=function(){if(!responseContainer){jQuery.error(callbackName+" was not called")}
return responseContainer[0]};s.dataTypes[0]="json";overwritten=window[callbackName];window[callbackName]=function(){responseContainer=arguments};jqXHR.always(function(){if(overwritten===undefined){jQuery(window).removeProp(callbackName)}else{window[callbackName]=overwritten}
if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;oldCallbacks.push(callbackName)}
if(responseContainer&&isFunction(overwritten)){overwritten(responseContainer[0])}
responseContainer=overwritten=undefined});return"script"}});support.createHTMLDocument=(function(){var body=document.implementation.createHTMLDocument("").body;body.innerHTML="<form></form><form></form>";return body.childNodes.length===2})();jQuery.parseHTML=function(data,context,keepScripts){if(typeof data!=="string"){return[]}
if(typeof context==="boolean"){keepScripts=context;context=!1}
var base,parsed,scripts;if(!context){if(support.createHTMLDocument){context=document.implementation.createHTMLDocument("");base=context.createElement("base");base.href=document.location.href;context.head.appendChild(base)}else{context=document}}
parsed=rsingleTag.exec(data);scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])]}
parsed=buildFragment([data],context,scripts);if(scripts&&scripts.length){jQuery(scripts).remove()}
return jQuery.merge([],parsed.childNodes)};jQuery.fn.load=function(url,params,callback){var selector,type,response,self=this,off=url.indexOf(" ");if(off>-1){selector=stripAndCollapse(url.slice(off));url=url.slice(0,off)}
if(isFunction(params)){callback=params;params=undefined}else if(params&&typeof params==="object"){type="POST"}
if(self.length>0){jQuery.ajax({url:url,type:type||"GET",dataType:"html",data:params}).done(function(responseText){response=arguments;self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText)}).always(callback&&function(jqXHR,status){self.each(function(){callback.apply(this,response||[jqXHR.responseText,status,jqXHR])})})}
return this};jQuery.expr.pseudos.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length};jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};if(position==="static"){elem.style.position="relative"}
curOffset=curElem.offset();curCSSTop=jQuery.css(elem,"top");curCSSLeft=jQuery.css(elem,"left");calculatePosition=(position==="absolute"||position==="fixed")&&(curCSSTop+curCSSLeft).indexOf("auto")>-1;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0}
if(isFunction(options)){options=options.call(elem,i,jQuery.extend({},curOffset))}
if(options.top!=null){props.top=(options.top-curOffset.top)+curTop}
if(options.left!=null){props.left=(options.left-curOffset.left)+curLeft}
if("using" in options){options.using.call(elem,props)}else{curElem.css(props)}}};jQuery.fn.extend({offset:function(options){if(arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this,options,i)})}
var rect,win,elem=this[0];if(!elem){return}
if(!elem.getClientRects().length){return{top:0,left:0}}
rect=elem.getBoundingClientRect();win=elem.ownerDocument.defaultView;return{top:rect.top+win.pageYOffset,left:rect.left+win.pageXOffset}},position:function(){if(!this[0]){return}
var offsetParent,offset,doc,elem=this[0],parentOffset={top:0,left:0};if(jQuery.css(elem,"position")==="fixed"){offset=elem.getBoundingClientRect()}else{offset=this.offset();doc=elem.ownerDocument;offsetParent=elem.offsetParent||doc.documentElement;while(offsetParent&&(offsetParent===doc.body||offsetParent===doc.documentElement)&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.parentNode}
if(offsetParent&&offsetParent!==elem&&offsetParent.nodeType===1){parentOffset=jQuery(offsetParent).offset();parentOffset.top+=jQuery.css(offsetParent,"borderTopWidth",!0);parentOffset.left+=jQuery.css(offsetParent,"borderLeftWidth",!0)}}
return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",!0),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",!0)}},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent;while(offsetParent&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.offsetParent}
return offsetParent||documentElement})}});jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method]=function(val){return access(this,function(elem,method,val){var win;if(isWindow(elem)){win=elem}else if(elem.nodeType===9){win=elem.defaultView}
if(val===undefined){return win?win[prop]:elem[method]}
if(win){win.scrollTo(!top?val:win.pageXOffset,top?val:win.pageYOffset)}else{elem[method]=val}},method,val,arguments.length)}});jQuery.each(["top","left"],function(_i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,function(elem,computed){if(computed){computed=curCSS(elem,prop);return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}})});jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||typeof margin!=="boolean"),extra=defaultExtra||(margin===!0||value===!0?"margin":"border");return access(this,function(elem,type,value){var doc;if(isWindow(elem)){return funcName.indexOf("outer")===0?elem["inner"+name]:elem.document.documentElement["client"+name]}
if(elem.nodeType===9){doc=elem.documentElement;return Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])}
return value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:undefined,chainable)}})});jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(_i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}});jQuery.fn.extend({bind:function(types,data,fn){return this.on(types,null,data,fn)},unbind:function(types,fn){return this.off(types,null,fn)},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn)},undelegate:function(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(types,selector||"**",fn)},hover:function(fnOver,fnOut){return this.on("mouseenter",fnOver).on("mouseleave",fnOut||fnOver)}});jQuery.each(("blur focus focusin focusout resize scroll click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup contextmenu").split(" "),function(_i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}});var rtrim=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;jQuery.proxy=function(fn,context){var tmp,args,proxy;if(typeof context==="string"){tmp=fn[context];context=fn;fn=tmp}
if(!isFunction(fn)){return undefined}
args=slice.call(arguments,2);proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)))};proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy};jQuery.holdReady=function(hold){if(hold){jQuery.readyWait++}else{jQuery.ready(!0)}};jQuery.isArray=Array.isArray;jQuery.parseJSON=JSON.parse;jQuery.nodeName=nodeName;jQuery.isFunction=isFunction;jQuery.isWindow=isWindow;jQuery.camelCase=camelCase;jQuery.type=toType;jQuery.now=Date.now;jQuery.isNumeric=function(obj){var type=jQuery.type(obj);return(type==="number"||type==="string")&&!isNaN(obj-parseFloat(obj))};jQuery.trim=function(text){return text==null?"":(text+"").replace(rtrim,"$1")};if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery})}
var _jQuery=window.jQuery,_$=window.$;jQuery.noConflict=function(deep){if(window.$===jQuery){window.$=_$}
if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery}
return jQuery};if(typeof noGlobal==="undefined"){window.jQuery=window.$=jQuery}
return jQuery});/*!
 * JavaScript Cookie v2.2.1
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */
;(function(factory){var registeredInModuleLoader;if(typeof define==='function'&&define.amd){define(factory);registeredInModuleLoader=!0}
if(typeof exports==='object'){module.exports=factory();registeredInModuleLoader=!0}
if(!registeredInModuleLoader){var OldCookies=window.Cookies;var api=window.Cookies=factory();api.noConflict=function(){window.Cookies=OldCookies;return api}}}(function(){function extend(){var i=0;var result={};for(;i<arguments.length;i++){var attributes=arguments[i];for(var key in attributes){result[key]=attributes[key]}}
return result}
function decode(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}
function init(converter){function api(){}
function set(key,value,attributes){if(typeof document==='undefined'){return}
attributes=extend({path:'/'},api.defaults,attributes);if(typeof attributes.expires==='number'){attributes.expires=new Date(new Date()*1+attributes.expires*864e+5)}
attributes.expires=attributes.expires?attributes.expires.toUTCString():'';try{var result=JSON.stringify(value);if(/^[\{\[]/.test(result)){value=result}}catch(e){}
value=converter.write?converter.write(value,key):encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);key=encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var stringifiedAttributes='';for(var attributeName in attributes){if(!attributes[attributeName]){continue}
stringifiedAttributes+='; '+attributeName;if(attributes[attributeName]===!0){continue}
stringifiedAttributes+='='+attributes[attributeName].split(';')[0]}
return(document.cookie=key+'='+value+stringifiedAttributes)}
function get(key,json){if(typeof document==='undefined'){return}
var jar={};var cookies=document.cookie?document.cookie.split('; '):[];var i=0;for(;i<cookies.length;i++){var parts=cookies[i].split('=');var cookie=parts.slice(1).join('=');if(!json&&cookie.charAt(0)==='"'){cookie=cookie.slice(1,-1)}
try{var name=decode(parts[0]);cookie=(converter.read||converter)(cookie,name)||decode(cookie);if(json){try{cookie=JSON.parse(cookie)}catch(e){}}
jar[name]=cookie;if(key===name){break}}catch(e){}}
return key?jar[key]:jar}
api.set=set;api.get=function(key){return get(key,!1)};api.getJSON=function(key){return get(key,!0)};api.remove=function(key,attributes){set(key,'',extend(attributes,{expires:-1}))};api.defaults={};api.withConverter=init;return api}
return init(function(){})}));/*!
 * Bootstrap v3.4.1 (https://getbootstrap.com/)
 * Copyright 2011-2019 Twitter, Inc.
 * Licensed under the MIT license
 */
if(typeof jQuery==='undefined'){throw new Error('Bootstrap\'s JavaScript requires jQuery')}+function($){'use strict';var version=$.fn.jquery.split(' ')[0].split('.')
if((version[0]<2&&version[1]<9)||(version[0]==1&&version[1]==9&&version[2]<1)||(version[0]>3)){throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')}}(jQuery);+function($){'use strict';function transitionEnd(){var el=document.createElement('bootstrap')
var transEndEventNames={WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd otransitionend',transition:'transitionend'}
for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}
return!1}
$.fn.emulateTransitionEnd=function(duration){var called=!1
var $el=this
$(this).one('bsTransitionEnd',function(){called=!0})
var callback=function(){if(!called)$($el).trigger($.support.transition.end)}
setTimeout(callback,duration)
return this}
$(function(){$.support.transition=transitionEnd()
if(!$.support.transition)return
$.event.special.bsTransitionEnd={bindType:$.support.transition.end,delegateType:$.support.transition.end,handle:function(e){if($(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}})}(jQuery);+function($){'use strict';var dismiss='[data-dismiss="alert"]'
var Alert=function(el){$(el).on('click',dismiss,this.close)}
Alert.VERSION='3.4.1'
Alert.TRANSITION_DURATION=150
Alert.prototype.close=function(e){var $this=$(this)
var selector=$this.attr('data-target')
if(!selector){selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
selector=selector==='#'?[]:selector
var $parent=$(document).find(selector)
if(e)e.preventDefault()
if(!$parent.length){$parent=$this.closest('.alert')}
$parent.trigger(e=$.Event('close.bs.alert'))
if(e.isDefaultPrevented())return
$parent.removeClass('in')
function removeElement(){$parent.detach().trigger('closed.bs.alert').remove()}
$.support.transition&&$parent.hasClass('fade')?$parent.one('bsTransitionEnd',removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION):removeElement()}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.alert')
if(!data)$this.data('bs.alert',(data=new Alert(this)))
if(typeof option=='string')data[option].call($this)})}
var old=$.fn.alert
$.fn.alert=Plugin
$.fn.alert.Constructor=Alert
$.fn.alert.noConflict=function(){$.fn.alert=old
return this}
$(document).on('click.bs.alert.data-api',dismiss,Alert.prototype.close)}(jQuery);+function($){'use strict';var Button=function(element,options){this.$element=$(element)
this.options=$.extend({},Button.DEFAULTS,options)
this.isLoading=!1}
Button.VERSION='3.4.1'
Button.DEFAULTS={loadingText:'loading...'}
Button.prototype.setState=function(state){var d='disabled'
var $el=this.$element
var val=$el.is('input')?'val':'html'
var data=$el.data()
state+='Text'
if(data.resetText==null)$el.data('resetText',$el[val]())
setTimeout($.proxy(function(){$el[val](data[state]==null?this.options[state]:data[state])
if(state=='loadingText'){this.isLoading=!0
$el.addClass(d).attr(d,d).prop(d,!0)}else if(this.isLoading){this.isLoading=!1
$el.removeClass(d).removeAttr(d).prop(d,!1)}},this),0)}
Button.prototype.toggle=function(){var changed=!0
var $parent=this.$element.closest('[data-toggle="buttons"]')
if($parent.length){var $input=this.$element.find('input')
if($input.prop('type')=='radio'){if($input.prop('checked'))changed=!1
$parent.find('.active').removeClass('active')
this.$element.addClass('active')}else if($input.prop('type')=='checkbox'){if(($input.prop('checked'))!==this.$element.hasClass('active'))changed=!1
this.$element.toggleClass('active')}
$input.prop('checked',this.$element.hasClass('active'))
if(changed)$input.trigger('change')}else{this.$element.attr('aria-pressed',!this.$element.hasClass('active'))
this.$element.toggleClass('active')}}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.button')
var options=typeof option=='object'&&option
if(!data)$this.data('bs.button',(data=new Button(this,options)))
if(option=='toggle')data.toggle()
else if(option)data.setState(option)})}
var old=$.fn.button
$.fn.button=Plugin
$.fn.button.Constructor=Button
$.fn.button.noConflict=function(){$.fn.button=old
return this}
$(document).on('click.bs.button.data-api','[data-toggle^="button"]',function(e){var $btn=$(e.target).closest('.btn')
Plugin.call($btn,'toggle')
if(!($(e.target).is('input[type="radio"], input[type="checkbox"]'))){e.preventDefault()
if($btn.is('input,button'))$btn.trigger('focus')
else $btn.find('input:visible,button:visible').first().trigger('focus')}}).on('focus.bs.button.data-api blur.bs.button.data-api','[data-toggle^="button"]',function(e){$(e.target).closest('.btn').toggleClass('focus',/^focus(in)?$/.test(e.type))})}(jQuery);+function($){'use strict';var Carousel=function(element,options){this.$element=$(element)
this.$indicators=this.$element.find('.carousel-indicators')
this.options=options
this.paused=null
this.sliding=null
this.interval=null
this.$active=null
this.$items=null
this.options.keyboard&&this.$element.on('keydown.bs.carousel',$.proxy(this.keydown,this))
this.options.pause=='hover'&&!('ontouchstart' in document.documentElement)&&this.$element.on('mouseenter.bs.carousel',$.proxy(this.pause,this)).on('mouseleave.bs.carousel',$.proxy(this.cycle,this))}
Carousel.VERSION='3.4.1'
Carousel.TRANSITION_DURATION=600
Carousel.DEFAULTS={interval:5000,pause:'hover',wrap:!0,keyboard:!0}
Carousel.prototype.keydown=function(e){if(/input|textarea/i.test(e.target.tagName))return
switch(e.which){case 37:this.prev();break
case 39:this.next();break
default:return}
e.preventDefault()}
Carousel.prototype.cycle=function(e){e||(this.paused=!1)
this.interval&&clearInterval(this.interval)
this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval))
return this}
Carousel.prototype.getItemIndex=function(item){this.$items=item.parent().children('.item')
return this.$items.index(item||this.$active)}
Carousel.prototype.getItemForDirection=function(direction,active){var activeIndex=this.getItemIndex(active)
var willWrap=(direction=='prev'&&activeIndex===0)||(direction=='next'&&activeIndex==(this.$items.length-1))
if(willWrap&&!this.options.wrap)return active
var delta=direction=='prev'?-1:1
var itemIndex=(activeIndex+delta)%this.$items.length
return this.$items.eq(itemIndex)}
Carousel.prototype.to=function(pos){var that=this
var activeIndex=this.getItemIndex(this.$active=this.$element.find('.item.active'))
if(pos>(this.$items.length-1)||pos<0)return
if(this.sliding)return this.$element.one('slid.bs.carousel',function(){that.to(pos)})
if(activeIndex==pos)return this.pause().cycle()
return this.slide(pos>activeIndex?'next':'prev',this.$items.eq(pos))}
Carousel.prototype.pause=function(e){e||(this.paused=!0)
if(this.$element.find('.next, .prev').length&&$.support.transition){this.$element.trigger($.support.transition.end)
this.cycle(!0)}
this.interval=clearInterval(this.interval)
return this}
Carousel.prototype.next=function(){if(this.sliding)return
return this.slide('next')}
Carousel.prototype.prev=function(){if(this.sliding)return
return this.slide('prev')}
Carousel.prototype.slide=function(type,next){var $active=this.$element.find('.item.active')
var $next=next||this.getItemForDirection(type,$active)
var isCycling=this.interval
var direction=type=='next'?'left':'right'
var that=this
if($next.hasClass('active'))return(this.sliding=!1)
var relatedTarget=$next[0]
var slideEvent=$.Event('slide.bs.carousel',{relatedTarget:relatedTarget,direction:direction})
this.$element.trigger(slideEvent)
if(slideEvent.isDefaultPrevented())return
this.sliding=!0
isCycling&&this.pause()
if(this.$indicators.length){this.$indicators.find('.active').removeClass('active')
var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)])
$nextIndicator&&$nextIndicator.addClass('active')}
var slidEvent=$.Event('slid.bs.carousel',{relatedTarget:relatedTarget,direction:direction})
if($.support.transition&&this.$element.hasClass('slide')){$next.addClass(type)
if(typeof $next==='object'&&$next.length){$next[0].offsetWidth}
$active.addClass(direction)
$next.addClass(direction)
$active.one('bsTransitionEnd',function(){$next.removeClass([type,direction].join(' ')).addClass('active')
$active.removeClass(['active',direction].join(' '))
that.sliding=!1
setTimeout(function(){that.$element.trigger(slidEvent)},0)}).emulateTransitionEnd(Carousel.TRANSITION_DURATION)}else{$active.removeClass('active')
$next.addClass('active')
this.sliding=!1
this.$element.trigger(slidEvent)}
isCycling&&this.cycle()
return this}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.carousel')
var options=$.extend({},Carousel.DEFAULTS,$this.data(),typeof option=='object'&&option)
var action=typeof option=='string'?option:options.slide
if(!data)$this.data('bs.carousel',(data=new Carousel(this,options)))
if(typeof option=='number')data.to(option)
else if(action)data[action]()
else if(options.interval)data.pause().cycle()})}
var old=$.fn.carousel
$.fn.carousel=Plugin
$.fn.carousel.Constructor=Carousel
$.fn.carousel.noConflict=function(){$.fn.carousel=old
return this}
var clickHandler=function(e){var $this=$(this)
var href=$this.attr('href')
if(href){href=href.replace(/.*(?=#[^\s]+$)/,'')}
var target=$this.attr('data-target')||href
var $target=$(document).find(target)
if(!$target.hasClass('carousel'))return
var options=$.extend({},$target.data(),$this.data())
var slideIndex=$this.attr('data-slide-to')
if(slideIndex)options.interval=!1
Plugin.call($target,options)
if(slideIndex){$target.data('bs.carousel').to(slideIndex)}
e.preventDefault()}
$(document).on('click.bs.carousel.data-api','[data-slide]',clickHandler).on('click.bs.carousel.data-api','[data-slide-to]',clickHandler)
$(window).on('load',function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this)
Plugin.call($carousel,$carousel.data())})})}(jQuery);+function($){'use strict';var Collapse=function(element,options){this.$element=$(element)
this.options=$.extend({},Collapse.DEFAULTS,options)
this.$trigger=$('[data-toggle="collapse"][href="#'+element.id+'"],'+'[data-toggle="collapse"][data-target="#'+element.id+'"]')
this.transitioning=null
if(this.options.parent){this.$parent=this.getParent()}else{this.addAriaAndCollapsedClass(this.$element,this.$trigger)}
if(this.options.toggle)this.toggle()}
Collapse.VERSION='3.4.1'
Collapse.TRANSITION_DURATION=350
Collapse.DEFAULTS={toggle:!0}
Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass('width')
return hasWidth?'width':'height'}
Collapse.prototype.show=function(){if(this.transitioning||this.$element.hasClass('in'))return
var activesData
var actives=this.$parent&&this.$parent.children('.panel').children('.in, .collapsing')
if(actives&&actives.length){activesData=actives.data('bs.collapse')
if(activesData&&activesData.transitioning)return}
var startEvent=$.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented())return
if(actives&&actives.length){Plugin.call(actives,'hide')
activesData||actives.data('bs.collapse',null)}
var dimension=this.dimension()
this.$element.removeClass('collapse').addClass('collapsing')[dimension](0).attr('aria-expanded',!0)
this.$trigger.removeClass('collapsed').attr('aria-expanded',!0)
this.transitioning=1
var complete=function(){this.$element.removeClass('collapsing').addClass('collapse in')[dimension]('')
this.transitioning=0
this.$element.trigger('shown.bs.collapse')}
if(!$.support.transition)return complete.call(this)
var scrollSize=$.camelCase(['scroll',dimension].join('-'))
this.$element.one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])}
Collapse.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass('in'))return
var startEvent=$.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented())return
var dimension=this.dimension()
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
this.$element.addClass('collapsing').removeClass('collapse in').attr('aria-expanded',!1)
this.$trigger.addClass('collapsed').attr('aria-expanded',!1)
this.transitioning=1
var complete=function(){this.transitioning=0
this.$element.removeClass('collapsing').addClass('collapse').trigger('hidden.bs.collapse')}
if(!$.support.transition)return complete.call(this)
this.$element[dimension](0).one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)}
Collapse.prototype.toggle=function(){this[this.$element.hasClass('in')?'hide':'show']()}
Collapse.prototype.getParent=function(){return $(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each($.proxy(function(i,element){var $element=$(element)
this.addAriaAndCollapsedClass(getTargetFromTrigger($element),$element)},this)).end()}
Collapse.prototype.addAriaAndCollapsedClass=function($element,$trigger){var isOpen=$element.hasClass('in')
$element.attr('aria-expanded',isOpen)
$trigger.toggleClass('collapsed',!isOpen).attr('aria-expanded',isOpen)}
function getTargetFromTrigger($trigger){var href
var target=$trigger.attr('data-target')||(href=$trigger.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,'')
return $(document).find(target)}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.collapse')
var options=$.extend({},Collapse.DEFAULTS,$this.data(),typeof option=='object'&&option)
if(!data&&options.toggle&&/show|hide/.test(option))options.toggle=!1
if(!data)$this.data('bs.collapse',(data=new Collapse(this,options)))
if(typeof option=='string')data[option]()})}
var old=$.fn.collapse
$.fn.collapse=Plugin
$.fn.collapse.Constructor=Collapse
$.fn.collapse.noConflict=function(){$.fn.collapse=old
return this}
$(document).on('click.bs.collapse.data-api','[data-toggle="collapse"]',function(e){var $this=$(this)
if(!$this.attr('data-target'))e.preventDefault()
var $target=getTargetFromTrigger($this)
var data=$target.data('bs.collapse')
var option=data?'toggle':$this.data()
Plugin.call($target,option)})}(jQuery);+function($){'use strict';var backdrop='.dropdown-backdrop'
var toggle='[data-toggle="dropdown"]'
var Dropdown=function(element){$(element).on('click.bs.dropdown',this.toggle)}
Dropdown.VERSION='3.4.1'
function getParent($this){var selector=$this.attr('data-target')
if(!selector){selector=$this.attr('href')
selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,'')}
var $parent=selector!=='#'?$(document).find(selector):null
return $parent&&$parent.length?$parent:$this.parent()}
function clearMenus(e){if(e&&e.which===3)return
$(backdrop).remove()
$(toggle).each(function(){var $this=$(this)
var $parent=getParent($this)
var relatedTarget={relatedTarget:this}
if(!$parent.hasClass('open'))return
if(e&&e.type=='click'&&/input|textarea/i.test(e.target.tagName)&&$.contains($parent[0],e.target))return
$parent.trigger(e=$.Event('hide.bs.dropdown',relatedTarget))
if(e.isDefaultPrevented())return
$this.attr('aria-expanded','false')
$parent.removeClass('open').trigger($.Event('hidden.bs.dropdown',relatedTarget))})}
Dropdown.prototype.toggle=function(e){var $this=$(this)
if($this.is('.disabled, :disabled'))return
var $parent=getParent($this)
var isActive=$parent.hasClass('open')
clearMenus()
if(!isActive){if('ontouchstart' in document.documentElement&&!$parent.closest('.navbar-nav').length){$(document.createElement('div')).addClass('dropdown-backdrop').insertAfter($(this)).on('click',clearMenus)}
var relatedTarget={relatedTarget:this}
$parent.trigger(e=$.Event('show.bs.dropdown',relatedTarget))
if(e.isDefaultPrevented())return
$this.trigger('focus').attr('aria-expanded','true')
$parent.toggleClass('open').trigger($.Event('shown.bs.dropdown',relatedTarget))}
return!1}
Dropdown.prototype.keydown=function(e){if(!/(38|40|27|32)/.test(e.which)||/input|textarea/i.test(e.target.tagName))return
var $this=$(this)
e.preventDefault()
e.stopPropagation()
if($this.is('.disabled, :disabled'))return
var $parent=getParent($this)
var isActive=$parent.hasClass('open')
if(!isActive&&e.which!=27||isActive&&e.which==27){if(e.which==27)$parent.find(toggle).trigger('focus')
return $this.trigger('click')}
var desc=' li:not(.disabled):visible a'
var $items=$parent.find('.dropdown-menu'+desc)
if(!$items.length)return
var index=$items.index(e.target)
if(e.which==38&&index>0)index--
if(e.which==40&&index<$items.length-1)index++
if(!~index)index=0
$items.eq(index).trigger('focus')}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.dropdown')
if(!data)$this.data('bs.dropdown',(data=new Dropdown(this)))
if(typeof option=='string')data[option].call($this)})}
var old=$.fn.dropdown
$.fn.dropdown=Plugin
$.fn.dropdown.Constructor=Dropdown
$.fn.dropdown.noConflict=function(){$.fn.dropdown=old
return this}
$(document).on('click.bs.dropdown.data-api',clearMenus).on('click.bs.dropdown.data-api','.dropdown form',function(e){e.stopPropagation()}).on('click.bs.dropdown.data-api',toggle,Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api',toggle,Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api','.dropdown-menu',Dropdown.prototype.keydown)}(jQuery);+function($){'use strict';var Modal=function(element,options){this.options=options
this.$body=$(document.body)
this.$element=$(element)
this.$dialog=this.$element.find('.modal-dialog')
this.$backdrop=null
this.isShown=null
this.originalBodyPad=null
this.scrollbarWidth=0
this.ignoreBackdropClick=!1
this.fixedContent='.navbar-fixed-top, .navbar-fixed-bottom'
if(this.options.remote){this.$element.find('.modal-content').load(this.options.remote,$.proxy(function(){this.$element.trigger('loaded.bs.modal')},this))}}
Modal.VERSION='3.4.1'
Modal.TRANSITION_DURATION=300
Modal.BACKDROP_TRANSITION_DURATION=150
Modal.DEFAULTS={backdrop:!0,keyboard:!0,show:!0}
Modal.prototype.toggle=function(_relatedTarget){return this.isShown?this.hide():this.show(_relatedTarget)}
Modal.prototype.show=function(_relatedTarget){var that=this
var e=$.Event('show.bs.modal',{relatedTarget:_relatedTarget})
this.$element.trigger(e)
if(this.isShown||e.isDefaultPrevented())return
this.isShown=!0
this.checkScrollbar()
this.setScrollbar()
this.$body.addClass('modal-open')
this.escape()
this.resize()
this.$element.on('click.dismiss.bs.modal','[data-dismiss="modal"]',$.proxy(this.hide,this))
this.$dialog.on('mousedown.dismiss.bs.modal',function(){that.$element.one('mouseup.dismiss.bs.modal',function(e){if($(e.target).is(that.$element))that.ignoreBackdropClick=!0})})
this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass('fade')
if(!that.$element.parent().length){that.$element.appendTo(that.$body)}
that.$element.show().scrollTop(0)
that.adjustDialog()
if(transition){that.$element[0].offsetWidth}
that.$element.addClass('in')
that.enforceFocus()
var e=$.Event('shown.bs.modal',{relatedTarget:_relatedTarget})
transition?that.$dialog.one('bsTransitionEnd',function(){that.$element.trigger('focus').trigger(e)}).emulateTransitionEnd(Modal.TRANSITION_DURATION):that.$element.trigger('focus').trigger(e)})}
Modal.prototype.hide=function(e){if(e)e.preventDefault()
e=$.Event('hide.bs.modal')
this.$element.trigger(e)
if(!this.isShown||e.isDefaultPrevented())return
this.isShown=!1
this.escape()
this.resize()
$(document).off('focusin.bs.modal')
this.$element.removeClass('in').off('click.dismiss.bs.modal').off('mouseup.dismiss.bs.modal')
this.$dialog.off('mousedown.dismiss.bs.modal')
$.support.transition&&this.$element.hasClass('fade')?this.$element.one('bsTransitionEnd',$.proxy(this.hideModal,this)).emulateTransitionEnd(Modal.TRANSITION_DURATION):this.hideModal()}
Modal.prototype.enforceFocus=function(){$(document).off('focusin.bs.modal').on('focusin.bs.modal',$.proxy(function(e){if(document!==e.target&&this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.trigger('focus')}},this))}
Modal.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on('keydown.dismiss.bs.modal',$.proxy(function(e){e.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off('keydown.dismiss.bs.modal')}}
Modal.prototype.resize=function(){if(this.isShown){$(window).on('resize.bs.modal',$.proxy(this.handleUpdate,this))}else{$(window).off('resize.bs.modal')}}
Modal.prototype.hideModal=function(){var that=this
this.$element.hide()
this.backdrop(function(){that.$body.removeClass('modal-open')
that.resetAdjustments()
that.resetScrollbar()
that.$element.trigger('hidden.bs.modal')})}
Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove()
this.$backdrop=null}
Modal.prototype.backdrop=function(callback){var that=this
var animate=this.$element.hasClass('fade')?'fade':''
if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate
this.$backdrop=$(document.createElement('div')).addClass('modal-backdrop '+animate).appendTo(this.$body)
this.$element.on('click.dismiss.bs.modal',$.proxy(function(e){if(this.ignoreBackdropClick){this.ignoreBackdropClick=!1
return}
if(e.target!==e.currentTarget)return
this.options.backdrop=='static'?this.$element[0].focus():this.hide()},this))
if(doAnimate)this.$backdrop[0].offsetWidth
this.$backdrop.addClass('in')
if(!callback)return
doAnimate?this.$backdrop.one('bsTransitionEnd',callback).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass('in')
var callbackRemove=function(){that.removeBackdrop()
callback&&callback()}
$.support.transition&&this.$element.hasClass('fade')?this.$backdrop.one('bsTransitionEnd',callbackRemove).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callbackRemove()}else if(callback){callback()}}
Modal.prototype.handleUpdate=function(){this.adjustDialog()}
Modal.prototype.adjustDialog=function(){var modalIsOverflowing=this.$element[0].scrollHeight>document.documentElement.clientHeight
this.$element.css({paddingLeft:!this.bodyIsOverflowing&&modalIsOverflowing?this.scrollbarWidth:'',paddingRight:this.bodyIsOverflowing&&!modalIsOverflowing?this.scrollbarWidth:''})}
Modal.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:'',paddingRight:''})}
Modal.prototype.checkScrollbar=function(){var fullWindowWidth=window.innerWidth
if(!fullWindowWidth){var documentElementRect=document.documentElement.getBoundingClientRect()
fullWindowWidth=documentElementRect.right-Math.abs(documentElementRect.left)}
this.bodyIsOverflowing=document.body.clientWidth<fullWindowWidth
this.scrollbarWidth=this.measureScrollbar()}
Modal.prototype.setScrollbar=function(){var bodyPad=parseInt((this.$body.css('padding-right')||0),10)
this.originalBodyPad=document.body.style.paddingRight||''
var scrollbarWidth=this.scrollbarWidth
if(this.bodyIsOverflowing){this.$body.css('padding-right',bodyPad+scrollbarWidth)
$(this.fixedContent).each(function(index,element){var actualPadding=element.style.paddingRight
var calculatedPadding=$(element).css('padding-right')
$(element).data('padding-right',actualPadding).css('padding-right',parseFloat(calculatedPadding)+scrollbarWidth+'px')})}}
Modal.prototype.resetScrollbar=function(){this.$body.css('padding-right',this.originalBodyPad)
$(this.fixedContent).each(function(index,element){var padding=$(element).data('padding-right')
$(element).removeData('padding-right')
element.style.paddingRight=padding?padding:''})}
Modal.prototype.measureScrollbar=function(){var scrollDiv=document.createElement('div')
scrollDiv.className='modal-scrollbar-measure'
this.$body.append(scrollDiv)
var scrollbarWidth=scrollDiv.offsetWidth-scrollDiv.clientWidth
this.$body[0].removeChild(scrollDiv)
return scrollbarWidth}
function Plugin(option,_relatedTarget){return this.each(function(){var $this=$(this)
var data=$this.data('bs.modal')
var options=$.extend({},Modal.DEFAULTS,$this.data(),typeof option=='object'&&option)
if(!data)$this.data('bs.modal',(data=new Modal(this,options)))
if(typeof option=='string')data[option](_relatedTarget)
else if(options.show)data.show(_relatedTarget)})}
var old=$.fn.modal
$.fn.modal=Plugin
$.fn.modal.Constructor=Modal
$.fn.modal.noConflict=function(){$.fn.modal=old
return this}
$(document).on('click.bs.modal.data-api','[data-toggle="modal"]',function(e){var $this=$(this)
var href=$this.attr('href')
var target=$this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/,''))
var $target=$(document).find(target)
var option=$target.data('bs.modal')?'toggle':$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data())
if($this.is('a'))e.preventDefault()
$target.one('show.bs.modal',function(showEvent){if(showEvent.isDefaultPrevented())return
$target.one('hidden.bs.modal',function(){$this.is(':visible')&&$this.trigger('focus')})})
Plugin.call($target,option,this)})}(jQuery);+function($){'use strict';var DISALLOWED_ATTRIBUTES=['sanitize','whiteList','sanitizeFn']
var uriAttrs=['background','cite','href','itemtype','longdesc','poster','src','xlink:href']
var ARIA_ATTRIBUTE_PATTERN=/^aria-[\w-]*$/i
var DefaultWhitelist={'*':['class','dir','id','lang','role',ARIA_ATTRIBUTE_PATTERN],a:['target','href','title','rel'],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:['src','alt','title','width','height'],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}
var SAFE_URL_PATTERN=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
var DATA_URL_PATTERN=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i
function allowedAttribute(attr,allowedAttributeList){var attrName=attr.nodeName.toLowerCase()
if($.inArray(attrName,allowedAttributeList)!==-1){if($.inArray(attrName,uriAttrs)!==-1){return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN)||attr.nodeValue.match(DATA_URL_PATTERN))}
return!0}
var regExp=$(allowedAttributeList).filter(function(index,value){return value instanceof RegExp})
for(var i=0,l=regExp.length;i<l;i++){if(attrName.match(regExp[i])){return!0}}
return!1}
function sanitizeHtml(unsafeHtml,whiteList,sanitizeFn){if(unsafeHtml.length===0){return unsafeHtml}
if(sanitizeFn&&typeof sanitizeFn==='function'){return sanitizeFn(unsafeHtml)}
if(!document.implementation||!document.implementation.createHTMLDocument){return unsafeHtml}
var createdDocument=document.implementation.createHTMLDocument('sanitization')
createdDocument.body.innerHTML=unsafeHtml
var whitelistKeys=$.map(whiteList,function(el,i){return i})
var elements=$(createdDocument.body).find('*')
for(var i=0,len=elements.length;i<len;i++){var el=elements[i]
var elName=el.nodeName.toLowerCase()
if($.inArray(elName,whitelistKeys)===-1){el.parentNode.removeChild(el)
continue}
var attributeList=$.map(el.attributes,function(el){return el})
var whitelistedAttributes=[].concat(whiteList['*']||[],whiteList[elName]||[])
for(var j=0,len2=attributeList.length;j<len2;j++){if(!allowedAttribute(attributeList[j],whitelistedAttributes)){el.removeAttribute(attributeList[j].nodeName)}}}
return createdDocument.body.innerHTML}
var Tooltip=function(element,options){this.type=null
this.options=null
this.enabled=null
this.timeout=null
this.hoverState=null
this.$element=null
this.inState=null
this.init('tooltip',element,options)}
Tooltip.VERSION='3.4.1'
Tooltip.TRANSITION_DURATION=150
Tooltip.DEFAULTS={animation:!0,placement:'top',selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:!1,container:!1,viewport:{selector:'body',padding:0},sanitize:!0,sanitizeFn:null,whiteList:DefaultWhitelist}
Tooltip.prototype.init=function(type,element,options){this.enabled=!0
this.type=type
this.$element=$(element)
this.options=this.getOptions(options)
this.$viewport=this.options.viewport&&$(document).find($.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):(this.options.viewport.selector||this.options.viewport))
this.inState={click:!1,hover:!1,focus:!1}
if(this.$element[0]instanceof document.constructor&&!this.options.selector){throw new Error('`selector` option must be specified when initializing '+this.type+' on the window.document object!')}
var triggers=this.options.trigger.split(' ')
for(var i=triggers.length;i--;){var trigger=triggers[i]
if(trigger=='click'){this.$element.on('click.'+this.type,this.options.selector,$.proxy(this.toggle,this))}else if(trigger!='manual'){var eventIn=trigger=='hover'?'mouseenter':'focusin'
var eventOut=trigger=='hover'?'mouseleave':'focusout'
this.$element.on(eventIn+'.'+this.type,this.options.selector,$.proxy(this.enter,this))
this.$element.on(eventOut+'.'+this.type,this.options.selector,$.proxy(this.leave,this))}}
this.options.selector?(this._options=$.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()}
Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS}
Tooltip.prototype.getOptions=function(options){var dataAttributes=this.$element.data()
for(var dataAttr in dataAttributes){if(dataAttributes.hasOwnProperty(dataAttr)&&$.inArray(dataAttr,DISALLOWED_ATTRIBUTES)!==-1){delete dataAttributes[dataAttr]}}
options=$.extend({},this.getDefaults(),dataAttributes,options)
if(options.delay&&typeof options.delay=='number'){options.delay={show:options.delay,hide:options.delay}}
if(options.sanitize){options.template=sanitizeHtml(options.template,options.whiteList,options.sanitizeFn)}
return options}
Tooltip.prototype.getDelegateOptions=function(){var options={}
var defaults=this.getDefaults()
this._options&&$.each(this._options,function(key,value){if(defaults[key]!=value)options[key]=value})
return options}
Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
$(obj.currentTarget).data('bs.'+this.type,self)}
if(obj instanceof $.Event){self.inState[obj.type=='focusin'?'focus':'hover']=!0}
if(self.tip().hasClass('in')||self.hoverState=='in'){self.hoverState='in'
return}
clearTimeout(self.timeout)
self.hoverState='in'
if(!self.options.delay||!self.options.delay.show)return self.show()
self.timeout=setTimeout(function(){if(self.hoverState=='in')self.show()},self.options.delay.show)}
Tooltip.prototype.isInStateTrue=function(){for(var key in this.inState){if(this.inState[key])return!0}
return!1}
Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
$(obj.currentTarget).data('bs.'+this.type,self)}
if(obj instanceof $.Event){self.inState[obj.type=='focusout'?'focus':'hover']=!1}
if(self.isInStateTrue())return
clearTimeout(self.timeout)
self.hoverState='out'
if(!self.options.delay||!self.options.delay.hide)return self.hide()
self.timeout=setTimeout(function(){if(self.hoverState=='out')self.hide()},self.options.delay.hide)}
Tooltip.prototype.show=function(){var e=$.Event('show.bs.'+this.type)
if(this.hasContent()&&this.enabled){this.$element.trigger(e)
var inDom=$.contains(this.$element[0].ownerDocument.documentElement,this.$element[0])
if(e.isDefaultPrevented()||!inDom)return
var that=this
var $tip=this.tip()
var tipId=this.getUID(this.type)
this.setContent()
$tip.attr('id',tipId)
this.$element.attr('aria-describedby',tipId)
if(this.options.animation)$tip.addClass('fade')
var placement=typeof this.options.placement=='function'?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement
var autoToken=/\s?auto?\s?/i
var autoPlace=autoToken.test(placement)
if(autoPlace)placement=placement.replace(autoToken,'')||'top'
$tip.detach().css({top:0,left:0,display:'block'}).addClass(placement).data('bs.'+this.type,this)
this.options.container?$tip.appendTo($(document).find(this.options.container)):$tip.insertAfter(this.$element)
this.$element.trigger('inserted.bs.'+this.type)
var pos=this.getPosition()
var actualWidth=$tip[0].offsetWidth
var actualHeight=$tip[0].offsetHeight
if(autoPlace){var orgPlacement=placement
var viewportDim=this.getPosition(this.$viewport)
placement=placement=='bottom'&&pos.bottom+actualHeight>viewportDim.bottom?'top':placement=='top'&&pos.top-actualHeight<viewportDim.top?'bottom':placement=='right'&&pos.right+actualWidth>viewportDim.width?'left':placement=='left'&&pos.left-actualWidth<viewportDim.left?'right':placement
$tip.removeClass(orgPlacement).addClass(placement)}
var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight)
this.applyPlacement(calculatedOffset,placement)
var complete=function(){var prevHoverState=that.hoverState
that.$element.trigger('shown.bs.'+that.type)
that.hoverState=null
if(prevHoverState=='out')that.leave(that)}
$.support.transition&&this.$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()}}
Tooltip.prototype.applyPlacement=function(offset,placement){var $tip=this.tip()
var width=$tip[0].offsetWidth
var height=$tip[0].offsetHeight
var marginTop=parseInt($tip.css('margin-top'),10)
var marginLeft=parseInt($tip.css('margin-left'),10)
if(isNaN(marginTop))marginTop=0
if(isNaN(marginLeft))marginLeft=0
offset.top+=marginTop
offset.left+=marginLeft
$.offset.setOffset($tip[0],$.extend({using:function(props){$tip.css({top:Math.round(props.top),left:Math.round(props.left)})}},offset),0)
$tip.addClass('in')
var actualWidth=$tip[0].offsetWidth
var actualHeight=$tip[0].offsetHeight
if(placement=='top'&&actualHeight!=height){offset.top=offset.top+height-actualHeight}
var delta=this.getViewportAdjustedDelta(placement,offset,actualWidth,actualHeight)
if(delta.left)offset.left+=delta.left
else offset.top+=delta.top
var isVertical=/top|bottom/.test(placement)
var arrowDelta=isVertical?delta.left*2-width+actualWidth:delta.top*2-height+actualHeight
var arrowOffsetPosition=isVertical?'offsetWidth':'offsetHeight'
$tip.offset(offset)
this.replaceArrow(arrowDelta,$tip[0][arrowOffsetPosition],isVertical)}
Tooltip.prototype.replaceArrow=function(delta,dimension,isVertical){this.arrow().css(isVertical?'left':'top',50*(1-delta/dimension)+'%').css(isVertical?'top':'left','')}
Tooltip.prototype.setContent=function(){var $tip=this.tip()
var title=this.getTitle()
if(this.options.html){if(this.options.sanitize){title=sanitizeHtml(title,this.options.whiteList,this.options.sanitizeFn)}
$tip.find('.tooltip-inner').html(title)}else{$tip.find('.tooltip-inner').text(title)}
$tip.removeClass('fade in top bottom left right')}
Tooltip.prototype.hide=function(callback){var that=this
var $tip=$(this.$tip)
var e=$.Event('hide.bs.'+this.type)
function complete(){if(that.hoverState!='in')$tip.detach()
if(that.$element){that.$element.removeAttr('aria-describedby').trigger('hidden.bs.'+that.type)}
callback&&callback()}
this.$element.trigger(e)
if(e.isDefaultPrevented())return
$tip.removeClass('in')
$.support.transition&&$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()
this.hoverState=null
return this}
Tooltip.prototype.fixTitle=function(){var $e=this.$element
if($e.attr('title')||typeof $e.attr('data-original-title')!='string'){$e.attr('data-original-title',$e.attr('title')||'').attr('title','')}}
Tooltip.prototype.hasContent=function(){return this.getTitle()}
Tooltip.prototype.getPosition=function($element){$element=$element||this.$element
var el=$element[0]
var isBody=el.tagName=='BODY'
var elRect=el.getBoundingClientRect()
if(elRect.width==null){elRect=$.extend({},elRect,{width:elRect.right-elRect.left,height:elRect.bottom-elRect.top})}
var isSvg=window.SVGElement&&el instanceof window.SVGElement
var elOffset=isBody?{top:0,left:0}:(isSvg?null:$element.offset())
var scroll={scroll:isBody?document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop()}
var outerDims=isBody?{width:$(window).width(),height:$(window).height()}:null
return $.extend({},elRect,scroll,outerDims,elOffset)}
Tooltip.prototype.getCalculatedOffset=function(placement,pos,actualWidth,actualHeight){return placement=='bottom'?{top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}:placement=='top'?{top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}:placement=='left'?{top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}:{top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}}
Tooltip.prototype.getViewportAdjustedDelta=function(placement,pos,actualWidth,actualHeight){var delta={top:0,left:0}
if(!this.$viewport)return delta
var viewportPadding=this.options.viewport&&this.options.viewport.padding||0
var viewportDimensions=this.getPosition(this.$viewport)
if(/right|left/.test(placement)){var topEdgeOffset=pos.top-viewportPadding-viewportDimensions.scroll
var bottomEdgeOffset=pos.top+viewportPadding-viewportDimensions.scroll+actualHeight
if(topEdgeOffset<viewportDimensions.top){delta.top=viewportDimensions.top-topEdgeOffset}else if(bottomEdgeOffset>viewportDimensions.top+viewportDimensions.height){delta.top=viewportDimensions.top+viewportDimensions.height-bottomEdgeOffset}}else{var leftEdgeOffset=pos.left-viewportPadding
var rightEdgeOffset=pos.left+viewportPadding+actualWidth
if(leftEdgeOffset<viewportDimensions.left){delta.left=viewportDimensions.left-leftEdgeOffset}else if(rightEdgeOffset>viewportDimensions.right){delta.left=viewportDimensions.left+viewportDimensions.width-rightEdgeOffset}}
return delta}
Tooltip.prototype.getTitle=function(){var title
var $e=this.$element
var o=this.options
title=$e.attr('data-original-title')||(typeof o.title=='function'?o.title.call($e[0]):o.title)
return title}
Tooltip.prototype.getUID=function(prefix){do prefix+=~~(Math.random()*1000000)
while(document.getElementById(prefix))
return prefix}
Tooltip.prototype.tip=function(){if(!this.$tip){this.$tip=$(this.options.template)
if(this.$tip.length!=1){throw new Error(this.type+' `template` option must consist of exactly 1 top-level element!')}}
return this.$tip}
Tooltip.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow'))}
Tooltip.prototype.enable=function(){this.enabled=!0}
Tooltip.prototype.disable=function(){this.enabled=!1}
Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled}
Tooltip.prototype.toggle=function(e){var self=this
if(e){self=$(e.currentTarget).data('bs.'+this.type)
if(!self){self=new this.constructor(e.currentTarget,this.getDelegateOptions())
$(e.currentTarget).data('bs.'+this.type,self)}}
if(e){self.inState.click=!self.inState.click
if(self.isInStateTrue())self.enter(self)
else self.leave(self)}else{self.tip().hasClass('in')?self.leave(self):self.enter(self)}}
Tooltip.prototype.destroy=function(){var that=this
clearTimeout(this.timeout)
this.hide(function(){that.$element.off('.'+that.type).removeData('bs.'+that.type)
if(that.$tip){that.$tip.detach()}
that.$tip=null
that.$arrow=null
that.$viewport=null
that.$element=null})}
Tooltip.prototype.sanitizeHtml=function(unsafeHtml){return sanitizeHtml(unsafeHtml,this.options.whiteList,this.options.sanitizeFn)}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.tooltip')
var options=typeof option=='object'&&option
if(!data&&/destroy|hide/.test(option))return
if(!data)$this.data('bs.tooltip',(data=new Tooltip(this,options)))
if(typeof option=='string')data[option]()})}
var old=$.fn.tooltip
$.fn.tooltip=Plugin
$.fn.tooltip.Constructor=Tooltip
$.fn.tooltip.noConflict=function(){$.fn.tooltip=old
return this}}(jQuery);+function($){'use strict';var Popover=function(element,options){this.init('popover',element,options)}
if(!$.fn.tooltip)throw new Error('Popover requires tooltip.js')
Popover.VERSION='3.4.1'
Popover.DEFAULTS=$.extend({},$.fn.tooltip.Constructor.DEFAULTS,{placement:'right',trigger:'click',content:'',template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'})
Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype)
Popover.prototype.constructor=Popover
Popover.prototype.getDefaults=function(){return Popover.DEFAULTS}
Popover.prototype.setContent=function(){var $tip=this.tip()
var title=this.getTitle()
var content=this.getContent()
if(this.options.html){var typeContent=typeof content
if(this.options.sanitize){title=this.sanitizeHtml(title)
if(typeContent==='string'){content=this.sanitizeHtml(content)}}
$tip.find('.popover-title').html(title)
$tip.find('.popover-content').children().detach().end()[typeContent==='string'?'html':'append'](content)}else{$tip.find('.popover-title').text(title)
$tip.find('.popover-content').children().detach().end().text(content)}
$tip.removeClass('fade top bottom left right in')
if(!$tip.find('.popover-title').html())$tip.find('.popover-title').hide()}
Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()}
Popover.prototype.getContent=function(){var $e=this.$element
var o=this.options
return $e.attr('data-content')||(typeof o.content=='function'?o.content.call($e[0]):o.content)}
Popover.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.arrow'))}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.popover')
var options=typeof option=='object'&&option
if(!data&&/destroy|hide/.test(option))return
if(!data)$this.data('bs.popover',(data=new Popover(this,options)))
if(typeof option=='string')data[option]()})}
var old=$.fn.popover
$.fn.popover=Plugin
$.fn.popover.Constructor=Popover
$.fn.popover.noConflict=function(){$.fn.popover=old
return this}}(jQuery);+function($){'use strict';function ScrollSpy(element,options){this.$body=$(document.body)
this.$scrollElement=$(element).is(document.body)?$(window):$(element)
this.options=$.extend({},ScrollSpy.DEFAULTS,options)
this.selector=(this.options.target||'')+' .nav li > a'
this.offsets=[]
this.targets=[]
this.activeTarget=null
this.scrollHeight=0
this.$scrollElement.on('scroll.bs.scrollspy',$.proxy(this.process,this))
this.refresh()
this.process()}
ScrollSpy.VERSION='3.4.1'
ScrollSpy.DEFAULTS={offset:10}
ScrollSpy.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)}
ScrollSpy.prototype.refresh=function(){var that=this
var offsetMethod='offset'
var offsetBase=0
this.offsets=[]
this.targets=[]
this.scrollHeight=this.getScrollHeight()
if(!$.isWindow(this.$scrollElement[0])){offsetMethod='position'
offsetBase=this.$scrollElement.scrollTop()}
this.$body.find(this.selector).map(function(){var $el=$(this)
var href=$el.data('target')||$el.attr('href')
var $href=/^#./.test(href)&&$(href)
return($href&&$href.length&&$href.is(':visible')&&[[$href[offsetMethod]().top+offsetBase,href]])||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){that.offsets.push(this[0])
that.targets.push(this[1])})}
ScrollSpy.prototype.process=function(){var scrollTop=this.$scrollElement.scrollTop()+this.options.offset
var scrollHeight=this.getScrollHeight()
var maxScroll=this.options.offset+scrollHeight-this.$scrollElement.height()
var offsets=this.offsets
var targets=this.targets
var activeTarget=this.activeTarget
var i
if(this.scrollHeight!=scrollHeight){this.refresh()}
if(scrollTop>=maxScroll){return activeTarget!=(i=targets[targets.length-1])&&this.activate(i)}
if(activeTarget&&scrollTop<offsets[0]){this.activeTarget=null
return this.clear()}
for(i=offsets.length;i--;){activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(offsets[i+1]===undefined||scrollTop<offsets[i+1])&&this.activate(targets[i])}}
ScrollSpy.prototype.activate=function(target){this.activeTarget=target
this.clear()
var selector=this.selector+'[data-target="'+target+'"],'+this.selector+'[href="'+target+'"]'
var active=$(selector).parents('li').addClass('active')
if(active.parent('.dropdown-menu').length){active=active.closest('li.dropdown').addClass('active')}
active.trigger('activate.bs.scrollspy')}
ScrollSpy.prototype.clear=function(){$(this.selector).parentsUntil(this.options.target,'.active').removeClass('active')}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.scrollspy')
var options=typeof option=='object'&&option
if(!data)$this.data('bs.scrollspy',(data=new ScrollSpy(this,options)))
if(typeof option=='string')data[option]()})}
var old=$.fn.scrollspy
$.fn.scrollspy=Plugin
$.fn.scrollspy.Constructor=ScrollSpy
$.fn.scrollspy.noConflict=function(){$.fn.scrollspy=old
return this}
$(window).on('load.bs.scrollspy.data-api',function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this)
Plugin.call($spy,$spy.data())})})}(jQuery);+function($){'use strict';var Tab=function(element){this.element=$(element)}
Tab.VERSION='3.4.1'
Tab.TRANSITION_DURATION=150
Tab.prototype.show=function(){var $this=this.element
var $ul=$this.closest('ul:not(.dropdown-menu)')
var selector=$this.data('target')
if(!selector){selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
if($this.parent('li').hasClass('active'))return
var $previous=$ul.find('.active:last a')
var hideEvent=$.Event('hide.bs.tab',{relatedTarget:$this[0]})
var showEvent=$.Event('show.bs.tab',{relatedTarget:$previous[0]})
$previous.trigger(hideEvent)
$this.trigger(showEvent)
if(showEvent.isDefaultPrevented()||hideEvent.isDefaultPrevented())return
var $target=$(document).find(selector)
this.activate($this.closest('li'),$ul)
this.activate($target,$target.parent(),function(){$previous.trigger({type:'hidden.bs.tab',relatedTarget:$this[0]})
$this.trigger({type:'shown.bs.tab',relatedTarget:$previous[0]})})}
Tab.prototype.activate=function(element,container,callback){var $active=container.find('> .active')
var transition=callback&&$.support.transition&&($active.length&&$active.hasClass('fade')||!!container.find('> .fade').length)
function next(){$active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded',!1)
element.addClass('active').find('[data-toggle="tab"]').attr('aria-expanded',!0)
if(transition){element[0].offsetWidth
element.addClass('in')}else{element.removeClass('fade')}
if(element.parent('.dropdown-menu').length){element.closest('li.dropdown').addClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded',!0)}
callback&&callback()}
$active.length&&transition?$active.one('bsTransitionEnd',next).emulateTransitionEnd(Tab.TRANSITION_DURATION):next()
$active.removeClass('in')}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.tab')
if(!data)$this.data('bs.tab',(data=new Tab(this)))
if(typeof option=='string')data[option]()})}
var old=$.fn.tab
$.fn.tab=Plugin
$.fn.tab.Constructor=Tab
$.fn.tab.noConflict=function(){$.fn.tab=old
return this}
var clickHandler=function(e){e.preventDefault()
Plugin.call($(this),'show')}
$(document).on('click.bs.tab.data-api','[data-toggle="tab"]',clickHandler).on('click.bs.tab.data-api','[data-toggle="pill"]',clickHandler)}(jQuery);+function($){'use strict';var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options)
var target=this.options.target===Affix.DEFAULTS.target?$(this.options.target):$(document).find(this.options.target)
this.$target=target.on('scroll.bs.affix.data-api',$.proxy(this.checkPosition,this)).on('click.bs.affix.data-api',$.proxy(this.checkPositionWithEventLoop,this))
this.$element=$(element)
this.affixed=null
this.unpin=null
this.pinnedOffset=null
this.checkPosition()}
Affix.VERSION='3.4.1'
Affix.RESET='affix affix-top affix-bottom'
Affix.DEFAULTS={offset:0,target:window}
Affix.prototype.getState=function(scrollHeight,height,offsetTop,offsetBottom){var scrollTop=this.$target.scrollTop()
var position=this.$element.offset()
var targetHeight=this.$target.height()
if(offsetTop!=null&&this.affixed=='top')return scrollTop<offsetTop?'top':!1
if(this.affixed=='bottom'){if(offsetTop!=null)return(scrollTop+this.unpin<=position.top)?!1:'bottom'
return(scrollTop+targetHeight<=scrollHeight-offsetBottom)?!1:'bottom'}
var initializing=this.affixed==null
var colliderTop=initializing?scrollTop:position.top
var colliderHeight=initializing?targetHeight:height
if(offsetTop!=null&&scrollTop<=offsetTop)return'top'
if(offsetBottom!=null&&(colliderTop+colliderHeight>=scrollHeight-offsetBottom))return'bottom'
return!1}
Affix.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop=this.$target.scrollTop()
var position=this.$element.offset()
return(this.pinnedOffset=position.top-scrollTop)}
Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)}
Affix.prototype.checkPosition=function(){if(!this.$element.is(':visible'))return
var height=this.$element.height()
var offset=this.options.offset
var offsetTop=offset.top
var offsetBottom=offset.bottom
var scrollHeight=Math.max($(document).height(),$(document.body).height())
if(typeof offset!='object')offsetBottom=offsetTop=offset
if(typeof offsetTop=='function')offsetTop=offset.top(this.$element)
if(typeof offsetBottom=='function')offsetBottom=offset.bottom(this.$element)
var affix=this.getState(scrollHeight,height,offsetTop,offsetBottom)
if(this.affixed!=affix){if(this.unpin!=null)this.$element.css('top','')
var affixType='affix'+(affix?'-'+affix:'')
var e=$.Event(affixType+'.bs.affix')
this.$element.trigger(e)
if(e.isDefaultPrevented())return
this.affixed=affix
this.unpin=affix=='bottom'?this.getPinnedOffset():null
this.$element.removeClass(Affix.RESET).addClass(affixType).trigger(affixType.replace('affix','affixed')+'.bs.affix')}
if(affix=='bottom'){this.$element.offset({top:scrollHeight-height-offsetBottom})}}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.affix')
var options=typeof option=='object'&&option
if(!data)$this.data('bs.affix',(data=new Affix(this,options)))
if(typeof option=='string')data[option]()})}
var old=$.fn.affix
$.fn.affix=Plugin
$.fn.affix.Constructor=Affix
$.fn.affix.noConflict=function(){$.fn.affix=old
return this}
$(window).on('load',function(){$('[data-spy="affix"]').each(function(){var $spy=$(this)
var data=$spy.data()
data.offset=data.offset||{}
if(data.offsetBottom!=null)data.offset.bottom=data.offsetBottom
if(data.offsetTop!=null)data.offset.top=data.offsetTop
Plugin.call($spy,data)})})}(jQuery);/*!
 * jQuery Form Plugin
 * version: 4.3.0
 * Requires jQuery v1.7.2 or later
 * Project repository: https://github.com/jquery-form/form

 * Copyright 2017 Kevin Morris
 * Copyright 2006 M. Alsup

 * Dual licensed under the LGPL-2.1+ or MIT licenses
 * https://github.com/jquery-form/form#license

 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof module==='object'&&module.exports){module.exports=function(root,jQuery){if(typeof jQuery==='undefined'){if(typeof window!=='undefined'){jQuery=require('jquery')}else{jQuery=require('jquery')(root)}}
factory(jQuery);return jQuery}}else{factory(jQuery)}}(function($){'use strict';var rCRLF=/\r?\n/g;var feature={};feature.fileapi=$('<input type="file">').get(0).files!==undefined;feature.formdata=(typeof window.FormData!=='undefined');var hasProp=!!$.fn.prop;$.fn.attr2=function(){if(!hasProp){return this.attr.apply(this,arguments)}
var val=this.prop.apply(this,arguments);if((val&&val.jquery)||typeof val==='string'){return val}
return this.attr.apply(this,arguments)};$.fn.ajaxSubmit=function(options,data,dataType,onSuccess){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this}
var method,action,url,isMsie,iframeSrc,$form=this;if(typeof options==='function'){options={success:options}}else if(typeof options==='string'||(options===!1&&arguments.length>0)){options={'url':options,'data':data,'dataType':dataType};if(typeof onSuccess==='function'){options.success=onSuccess}}else if(typeof options==='undefined'){options={}}
method=options.method||options.type||this.attr2('method');action=options.url||this.attr2('action');url=(typeof action==='string')?$.trim(action):'';url=url||window.location.href||'';if(url){url=(url.match(/^([^#]+)/)||[])[1]}
isMsie=/(MSIE|Trident)/.test(navigator.userAgent||'');iframeSrc=(isMsie&&/^https/i.test(window.location.href||''))?'javascript:false':'about:blank';options=$.extend(!0,{url:url,success:$.ajaxSettings.success,type:method||$.ajaxSettings.type,iframeSrc:iframeSrc},options);var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this}
if(options.beforeSerialize&&options.beforeSerialize(this,options)===!1){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this}
var traditional=options.traditional;if(typeof traditional==='undefined'){traditional=$.ajaxSettings.traditional}
var elements=[];var qx,a=this.formToArray(options.semantic,elements,options.filtering);if(options.data){var optionsData=$.isFunction(options.data)?options.data(a):options.data;options.extraData=optionsData;qx=$.param(optionsData,traditional)}
if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===!1){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this}
this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this}
var q=$.param(a,traditional);if(qx){q=(q?(q+'&'+qx):qx)}
if(options.type.toUpperCase()==='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null}else{options.data=q}
var callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm()})}
if(options.clearForm){callbacks.push(function(){$form.clearForm(options.includeHidden)})}
if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data,textStatus,jqXHR){var successArguments=arguments,fn=options.replaceTarget?'replaceWith':'html';$(options.target)[fn](data).each(function(){oldSuccess.apply(this,successArguments)})})}else if(options.success){if($.isArray(options.success)){$.merge(callbacks,options.success)}else{callbacks.push(options.success)}}
options.success=function(data,status,xhr){var context=options.context||this;for(var i=0,max=callbacks.length;i<max;i++){callbacks[i].apply(context,[data,status,xhr||$form,$form])}};if(options.error){var oldError=options.error;options.error=function(xhr,status,error){var context=options.context||this;oldError.apply(context,[xhr,status,error,$form])}}
if(options.complete){var oldComplete=options.complete;options.complete=function(xhr,status){var context=options.context||this;oldComplete.apply(context,[xhr,status,$form])}}
var fileInputs=$('input[type=file]:enabled',this).filter(function(){return $(this).val()!==''});var hasFileInputs=fileInputs.length>0;var mp='multipart/form-data';var multipart=($form.attr('enctype')===mp||$form.attr('encoding')===mp);var fileAPI=feature.fileapi&&feature.formdata;log('fileAPI :'+fileAPI);var shouldUseFrame=(hasFileInputs||multipart)&&!fileAPI;var jqxhr;if(options.iframe!==!1&&(options.iframe||shouldUseFrame)){if(options.closeKeepAlive){$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a)})}else{jqxhr=fileUploadIframe(a)}}else if((hasFileInputs||multipart)&&fileAPI){jqxhr=fileUploadXhr(a)}else{jqxhr=$.ajax(options)}
$form.removeData('jqxhr').data('jqxhr',jqxhr);for(var k=0;k<elements.length;k++){elements[k]=null}
this.trigger('form-submit-notify',[this,options]);return this;function deepSerialize(extraData){var serialized=$.param(extraData,options.traditional).split('&');var len=serialized.length;var result=[];var i,part;for(i=0;i<len;i++){serialized[i]=serialized[i].replace(/\+/g,' ');part=serialized[i].split('=');result.push([decodeURIComponent(part[0]),decodeURIComponent(part[1])])}
return result}
function fileUploadXhr(a){var formdata=new FormData();for(var i=0;i<a.length;i++){formdata.append(a[i].name,a[i].value)}
if(options.extraData){var serializedData=deepSerialize(options.extraData);for(i=0;i<serializedData.length;i++){if(serializedData[i]){formdata.append(serializedData[i][0],serializedData[i][1])}}}
options.data=null;var s=$.extend(!0,{},$.ajaxSettings,options,{contentType:!1,processData:!1,cache:!1,type:method||'POST'});if(options.uploadProgress){s.xhr=function(){var xhr=$.ajaxSettings.xhr();if(xhr.upload){xhr.upload.addEventListener('progress',function(event){var percent=0;var position=event.loaded||event.position;var total=event.total;if(event.lengthComputable){percent=Math.ceil(position/total*100)}
options.uploadProgress(event,position,total,percent)},!1)}
return xhr}}
s.data=null;var beforeSend=s.beforeSend;s.beforeSend=function(xhr,o){if(options.formData){o.data=options.formData}else{o.data=formdata}
if(beforeSend){beforeSend.call(this,xhr,o)}};return $.ajax(s)}
function fileUploadIframe(a){var form=$form[0],el,i,s,g,id,$io,io,xhr,sub,n,timedOut,timeoutHandle;var deferred=$.Deferred();deferred.abort=function(status){xhr.abort(status)};if(a){for(i=0;i<elements.length;i++){el=$(elements[i]);if(hasProp){el.prop('disabled',!1)}else{el.removeAttr('disabled')}}}
s=$.extend(!0,{},$.ajaxSettings,options);s.context=s.context||s;id='jqFormIO'+new Date().getTime();var ownerDocument=form.ownerDocument;var $body=$form.closest('body');if(s.iframeTarget){$io=$(s.iframeTarget,ownerDocument);n=$io.attr2('name');if(!n){$io.attr2('name',id)}else{id=n}}else{$io=$('<iframe name="'+id+'" src="'+s.iframeSrc+'" />',ownerDocument);$io.css({position:'absolute',top:'-1000px',left:'-1000px'})}
io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==='timeout'?'timeout':'aborted');log('aborting upload... '+e);this.aborted=1;try{if(io.contentWindow.document.execCommand){io.contentWindow.document.execCommand('Stop')}}catch(ignore){}
$io.attr('src',s.iframeSrc);xhr.error=e;if(s.error){s.error.call(s.context,xhr,e,status)}
if(g){$.event.trigger('ajaxError',[xhr,s,e])}
if(s.complete){s.complete.call(s.context,xhr,e)}}};g=s.global;if(g&&$.active++===0){$.event.trigger('ajaxStart')}
if(g){$.event.trigger('ajaxSend',[xhr,s])}
if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===!1){if(s.global){$.active--}
deferred.reject();return deferred}
if(xhr.aborted){deferred.reject();return deferred}
sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type==='image'){s.extraData[n+'.x']=form.clk_x;s.extraData[n+'.y']=form.clk_y}}}
var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=null;try{if(frame.contentWindow){doc=frame.contentWindow.document}}catch(err){log('cannot get iframe.contentWindow document: '+err)}
if(doc){return doc}
try{doc=frame.contentDocument?frame.contentDocument:frame.document}catch(err){log('cannot get iframe.contentDocument: '+err);doc=frame.document}
return doc}
var csrf_token=$('meta[name=csrf-token]').attr('content');var csrf_param=$('meta[name=csrf-param]').attr('content');if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token}
function doSubmit(){var t=$form.attr2('target'),a=$form.attr2('action'),mp='multipart/form-data',et=$form.attr('enctype')||$form.attr('encoding')||mp;form.setAttribute('target',id);if(!method||/post/i.test(method)){form.setAttribute('method','POST')}
if(a!==s.url){form.setAttribute('action',s.url)}
if(!s.skipEncodingOverride&&(!method||/post/i.test(method))){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'})}
if(s.timeout){timeoutHandle=setTimeout(function(){timedOut=!0;cb(CLIENT_TIMEOUT_ABORT)},s.timeout)}
function checkState(){try{var state=getDoc(io).readyState;log('state = '+state);if(state&&state.toLowerCase()==='uninitialized'){setTimeout(checkState,50)}}catch(e){log('Server abort: ',e,' (',e.name,')');cb(SERVER_ABORT);if(timeoutHandle){clearTimeout(timeoutHandle)}
timeoutHandle=undefined}}
var extraInputs=[];try{if(s.extraData){for(var n in s.extraData){if(s.extraData.hasOwnProperty(n)){if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty('name')&&s.extraData[n].hasOwnProperty('value')){extraInputs.push($('<input type="hidden" name="'+s.extraData[n].name+'">',ownerDocument).val(s.extraData[n].value).appendTo(form)[0])}else{extraInputs.push($('<input type="hidden" name="'+n+'">',ownerDocument).val(s.extraData[n]).appendTo(form)[0])}}}}
if(!s.iframeTarget){$io.appendTo($body)}
if(io.attachEvent){io.attachEvent('onload',cb)}else{io.addEventListener('load',cb,!1)}
setTimeout(checkState,15);try{form.submit()}catch(err){var submitFn=document.createElement('form').submit;submitFn.apply(form)}}finally{form.setAttribute('action',a);form.setAttribute('enctype',et);if(t){form.setAttribute('target',t)}else{$form.removeAttr('target')}
$(extraInputs).remove()}}
if(s.forceSync){doSubmit()}else{setTimeout(doSubmit,10)}
var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed){return}
doc=getDoc(io);if(!doc){log('cannot access response document');e=SERVER_ABORT}
if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort('timeout');deferred.reject(xhr,'timeout');return}
if(e===SERVER_ABORT&&xhr){xhr.abort('server abort');deferred.reject(xhr,'error','server abort');return}
if(!doc||doc.location.href===s.iframeSrc){if(!timedOut){return}}
if(io.detachEvent){io.detachEvent('onload',cb)}else{io.removeEventListener('load',cb,!1)}
var status='success',errMsg;try{if(timedOut){throw 'timeout'}
var isXml=s.dataType==='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML)){if(--domCheckCount){log('requeing onLoad callback, DOM not available');setTimeout(cb,250);return}}
var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml){s.dataType='xml'}
xhr.getResponseHeader=function(header){var headers={'content-type':s.dataType};return headers[header.toLowerCase()]};if(docRoot){xhr.status=Number(docRoot.getAttribute('status'))||xhr.status;xhr.statusText=docRoot.getAttribute('statusText')||xhr.statusText}
var dt=(s.dataType||'').toLowerCase();var scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName('textarea')[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute('status'))||xhr.status;xhr.statusText=ta.getAttribute('statusText')||xhr.statusText}else if(scr){var pre=doc.getElementsByTagName('pre')[0];var b=doc.getElementsByTagName('body')[0];if(pre){xhr.responseText=pre.textContent?pre.textContent:pre.innerText}else if(b){xhr.responseText=b.textContent?b.textContent:b.innerText}}}else if(dt==='xml'&&!xhr.responseXML&&xhr.responseText){xhr.responseXML=toXml(xhr.responseText)}
try{data=httpData(xhr,dt,s)}catch(err){status='parsererror';xhr.error=errMsg=(err||status)}}catch(err){log('error caught: ',err);status='error';xhr.error=errMsg=(err||status)}
if(xhr.aborted){log('upload aborted');status=null}
if(xhr.status){status=((xhr.status>=200&&xhr.status<300)||xhr.status===304)?'success':'error'}
if(status==='success'){if(s.success){s.success.call(s.context,data,'success',xhr)}
deferred.resolve(xhr.responseText,'success',xhr);if(g){$.event.trigger('ajaxSuccess',[xhr,s])}}else if(status){if(typeof errMsg==='undefined'){errMsg=xhr.statusText}
if(s.error){s.error.call(s.context,xhr,status,errMsg)}
deferred.reject(xhr,'error',errMsg);if(g){$.event.trigger('ajaxError',[xhr,s,errMsg])}}
if(g){$.event.trigger('ajaxComplete',[xhr,s])}
if(g&&!--$.active){$.event.trigger('ajaxStop')}
if(s.complete){s.complete.call(s.context,xhr,status)}
callbackProcessed=!0;if(s.timeout){clearTimeout(timeoutHandle)}
setTimeout(function(){if(!s.iframeTarget){$io.remove()}else{$io.attr('src',s.iframeSrc)}
xhr.responseXML=null},100)}
var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s)}else{doc=(new DOMParser()).parseFromString(s,'text/xml')}
return(doc&&doc.documentElement&&doc.documentElement.nodeName!=='parsererror')?doc:null};var parseJSON=$.parseJSON||function(s){return window['eval']('('+s+')')};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader('content-type')||'',xml=((type==='xml'||!type)&&ct.indexOf('xml')>=0),data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==='parsererror'){if($.error){$.error('parsererror')}}
if(s&&s.dataFilter){data=s.dataFilter(data,type)}
if(typeof data==='string'){if((type==='json'||!type)&&ct.indexOf('json')>=0){data=parseJSON(data)}else if((type==='script'||!type)&&ct.indexOf('javascript')>=0){$.globalEval(data)}}
return data};return deferred}};$.fn.ajaxForm=function(options,data,dataType,onSuccess){if(typeof options==='string'||(options===!1&&arguments.length>0)){options={'url':options,'data':data,'dataType':dataType};if(typeof onSuccess==='function'){options.success=onSuccess}}
options=options||{};options.delegation=options.delegation&&$.isFunction($.fn.on);if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log('DOM not ready, queuing ajaxForm');$(function(){$(o.s,o.c).ajaxForm(options)});return this}
log('terminating; zero elements found by selector'+($.isReady?'':' (DOM not ready)'));return this}
if(options.delegation){$(document).off('submit.form-plugin',this.selector,doAjaxSubmit).off('click.form-plugin',this.selector,captureSubmittingElement).on('submit.form-plugin',this.selector,options,doAjaxSubmit).on('click.form-plugin',this.selector,options,captureSubmittingElement);return this}
if(options.beforeFormUnbind){options.beforeFormUnbind(this,options)}
return this.ajaxFormUnbind().on('submit.form-plugin',options,doAjaxSubmit).on('click.form-plugin',options,captureSubmittingElement)};function doAjaxSubmit(e){var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(e.target).closest('form').ajaxSubmit(options)}}
function captureSubmittingElement(e){var target=e.target;var $el=$(target);if(!$el.is('[type=submit],[type=image]')){var t=$el.closest('[type=submit]');if(t.length===0){return}
target=t[0]}
var form=target.form;form.clk=target;if(target.type==='image'){if(typeof e.offsetX!=='undefined'){form.clk_x=e.offsetX;form.clk_y=e.offsetY}else if(typeof $.fn.offset==='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop}}
setTimeout(function(){form.clk=form.clk_x=form.clk_y=null},100)}
$.fn.ajaxFormUnbind=function(){return this.off('submit.form-plugin click.form-plugin')};$.fn.formToArray=function(semantic,elements,filtering){var a=[];if(this.length===0){return a}
var form=this[0];var formId=this.attr('id');var els=(semantic||typeof form.elements==='undefined')?form.getElementsByTagName('*'):form.elements;var els2;if(els){els=$.makeArray(els)}
if(formId&&(semantic||/(Edge|Trident)\//.test(navigator.userAgent))){els2=$(':input[form="'+formId+'"]').get();if(els2.length){els=(els||[]).concat(els2)}}
if(!els||!els.length){return a}
if($.isFunction(filtering)){els=$.map(els,filtering)}
var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i<max;i++){el=els[i];n=el.name;if(!n||el.disabled){continue}
if(semantic&&form.clk&&el.type==='image'){if(form.clk===el){a.push({name:n,value:$(el).val(),type:el.type});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y})}
continue}
v=$.fieldValue(el,!0);if(v&&v.constructor===Array){if(elements){elements.push(el)}
for(j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]})}}else if(feature.fileapi&&el.type==='file'){if(elements){elements.push(el)}
var files=el.files;if(files.length){for(j=0;j<files.length;j++){a.push({name:n,value:files[j],type:el.type})}}else{a.push({name:n,value:'',type:el.type})}}else if(v!==null&&typeof v!=='undefined'){if(elements){elements.push(el)}
a.push({name:n,value:v,type:el.type,required:el.required})}}
if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];n=input.name;if(n&&!input.disabled&&input.type==='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y})}}
return a};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic))};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n){return}
var v=$.fieldValue(this,successful);if(v&&v.constructor===Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]})}}else if(v!==null&&typeof v!=='undefined'){a.push({name:this.name,value:v})}});return $.param(a)};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v==='undefined'||(v.constructor===Array&&!v.length)){continue}
if(v.constructor===Array){$.merge(val,v)}else{val.push(v)}}
return val};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful==='undefined'){successful=!0}
if(successful&&(!n||el.disabled||t==='reset'||t==='button'||(t==='checkbox'||t==='radio')&&!el.checked||(t==='submit'||t==='image')&&el.form&&el.form.clk!==el||tag==='select'&&el.selectedIndex===-1)){return null}
if(tag==='select'){var index=el.selectedIndex;if(index<0){return null}
var a=[],ops=el.options;var one=(t==='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected&&!op.disabled){var v=op.value;if(!v){v=(op.attributes&&op.attributes.value&&!(op.attributes.value.specified))?op.text:op.value}
if(one){return v}
a.push(v)}}
return a}
return $(el).val().replace(rCRLF,'\r\n')};$.fn.clearForm=function(includeHidden){return this.each(function(){$('input,select,textarea',this).clearFields(includeHidden)})};$.fn.clearFields=$.fn.clearInputs=function(includeHidden){var re=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(re.test(t)||tag==='textarea'){this.value=''}else if(t==='checkbox'||t==='radio'){this.checked=!1}else if(tag==='select'){this.selectedIndex=-1}else if(t==='file'){if(/MSIE/.test(navigator.userAgent)){$(this).replaceWith($(this).clone(!0))}else{$(this).val('')}}else if(includeHidden){if((includeHidden===!0&&/hidden/.test(t))||(typeof includeHidden==='string'&&$(this).is(includeHidden))){this.value=''}}})};$.fn.resetForm=function(){return this.each(function(){var el=$(this);var tag=this.tagName.toLowerCase();switch(tag){case 'input':this.checked=this.defaultChecked;case 'textarea':this.value=this.defaultValue;return!0;case 'option':case 'optgroup':var select=el.parents('select');if(select.length&&select[0].multiple){if(tag==='option'){this.selected=this.defaultSelected}else{el.find('option').resetForm()}}else{select.resetForm()}
return!0;case 'select':el.find('option').each(function(i){this.selected=this.defaultSelected;if(this.defaultSelected&&!el[0].multiple){el[0].selectedIndex=i;return!1}});return!0;case 'label':var forEl=$(el.attr('for'));var list=el.find('input,select,textarea');if(forEl[0]){list.unshift(forEl[0])}
list.resetForm();return!0;case 'form':if(typeof this.reset==='function'||(typeof this.reset==='object'&&!this.reset.nodeType)){this.reset()}
return!0;default:el.find('form,input,label,select,textarea').resetForm();return!0}})};$.fn.enable=function(b){if(typeof b==='undefined'){b=!0}
return this.each(function(){this.disabled=!b})};$.fn.selected=function(select){if(typeof select==='undefined'){select=!0}
return this.each(function(){var t=this.type;if(t==='checkbox'||t==='radio'){this.checked=select}else if(this.tagName.toLowerCase()==='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type==='select-one'){$sel.find('option').selected(!1)}
this.selected=select}})};$.fn.ajaxSubmit.debug=!1;function log(){if(!$.fn.ajaxSubmit.debug){return}
var msg='[jquery.form] '+Array.prototype.join.call(arguments,'');if(window.console&&window.console.log){window.console.log(msg)}else if(window.opera&&window.opera.postError){window.opera.postError(msg)}}}));!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var H;function _(){return H.apply(null,arguments)}function y(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function F(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function L(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(c(e,t))return;return 1}function g(e){return void 0===e}function w(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function V(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function G(e,t){for(var n=[],s=e.length,i=0;i<s;++i)n.push(t(e[i],i));return n}function E(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return Wt(e,t,n,s,!0).utc()}function p(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function A(e){var t,n,s=e._d&&!isNaN(e._d.getTime());return s&&(t=p(e),n=j.call(t.parsedDateParts,function(e){return null!=e}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict)&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e)?s:(e._isValid=s,e._isValid)}function I(e){var t=l(NaN);return null!=e?E(p(t),e):p(t).userInvalidated=!0,t}var j=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},Z=_.momentProperties=[],z=!1;function q(e,t){var n,s,i,r=Z.length;if(g(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),g(t._i)||(e._i=t._i),g(t._f)||(e._f=t._f),g(t._l)||(e._l=t._l),g(t._strict)||(e._strict=t._strict),g(t._tzm)||(e._tzm=t._tzm),g(t._isUTC)||(e._isUTC=t._isUTC),g(t._offset)||(e._offset=t._offset),g(t._pf)||(e._pf=p(t)),g(t._locale)||(e._locale=t._locale),0<r)for(n=0;n<r;n++)g(i=t[s=Z[n]])||(e[s]=i);return e}function $(e){q(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===z&&(z=!0,_.updateOffset(this),z=!1)}function k(e){return e instanceof $||null!=e&&null!=e._isAMomentObject}function B(e){!1===_.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(r,a){var o=!0;return E(function(){if(null!=_.deprecationHandler&&_.deprecationHandler(null,r),o){for(var e,t,n=[],s=arguments.length,i=0;i<s;i++){if(e="","object"==typeof arguments[i]){for(t in e+="\n["+i+"] ",arguments[0])c(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[i];n.push(e)}B(r+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),o=!1}return a.apply(this,arguments)},a)}var J={};function Q(e,t){null!=_.deprecationHandler&&_.deprecationHandler(e,t),J[e]||(B(t),J[e]=!0)}function a(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function X(e,t){var n,s=E({},e);for(n in t)c(t,n)&&(F(e[n])&&F(t[n])?(s[n]={},E(s[n],e[n]),E(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)c(e,n)&&!c(t,n)&&F(e[n])&&(s[n]=E({},s[n]));return s}function K(e){null!=e&&this.set(e)}_.suppressDeprecationWarnings=!1,_.deprecationHandler=null;var ee=Object.keys||function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};function r(e,t,n){var s=""+Math.abs(e);return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}var te=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,se={},ie={};function s(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(ie[e]=i),t&&(ie[t[0]]=function(){return r(i.apply(this,arguments),t[1],t[2])}),n&&(ie[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function re(e,t){return e.isValid()?(t=ae(t,e.localeData()),se[t]=se[t]||function(s){for(var e,i=s.match(te),t=0,r=i.length;t<r;t++)ie[i[t]]?i[t]=ie[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=a(i[n])?i[n].call(e,s):i[n];return t}}(t),se[t](e)):e.localeData().invalidDate()}function ae(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(ne.lastIndex=0;0<=n&&ne.test(e);)e=e.replace(ne,s),ne.lastIndex=0,--n;return e}var oe={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function o(e){return"string"==typeof e?oe[e]||oe[e.toLowerCase()]:void 0}function ue(e){var t,n,s={};for(n in e)c(e,n)&&(t=o(n))&&(s[t]=e[n]);return s}var le={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};var de=/\d/,t=/\d\d/,he=/\d{3}/,ce=/\d{4}/,fe=/[+-]?\d{6}/,n=/\d\d?/,me=/\d\d\d\d?/,_e=/\d\d\d\d\d\d?/,ye=/\d{1,3}/,ge=/\d{1,4}/,we=/[+-]?\d{1,6}/,pe=/\d+/,ke=/[+-]?\d+/,Me=/Z|[+-]\d\d:?\d\d/gi,ve=/Z|[+-]\d\d(?::?\d\d)?/gi,i=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,u=/^[1-9]\d?/,d=/^([1-9]\d|\d)/;function h(e,n,s){Ye[e]=a(n)?n:function(e,t){return e&&s?s:n}}function De(e,t){return c(Ye,e)?Ye[e](t._strict,t._locale):new RegExp(f(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function f(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function m(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function M(e){var e=+e,t=0;return t=0!=e&&isFinite(e)?m(e):t}var Ye={},Se={};function v(e,n){var t,s,i=n;for("string"==typeof e&&(e=[e]),w(n)&&(i=function(e,t){t[n]=M(e)}),s=e.length,t=0;t<s;t++)Se[e[t]]=i}function Oe(e,i){v(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}function be(e){return e%4==0&&e%100!=0||e%400==0}var D=0,Y=1,S=2,O=3,b=4,T=5,Te=6,xe=7,Ne=8;function We(e){return be(e)?366:365}s("Y",0,0,function(){var e=this.year();return e<=9999?r(e,4):"+"+e}),s(0,["YY",2],0,function(){return this.year()%100}),s(0,["YYYY",4],0,"year"),s(0,["YYYYY",5],0,"year"),s(0,["YYYYYY",6,!0],0,"year"),h("Y",ke),h("YY",n,t),h("YYYY",ge,ce),h("YYYYY",we,fe),h("YYYYYY",we,fe),v(["YYYYY","YYYYYY"],D),v("YYYY",function(e,t){t[D]=2===e.length?_.parseTwoDigitYear(e):M(e)}),v("YY",function(e,t){t[D]=_.parseTwoDigitYear(e)}),v("Y",function(e,t){t[D]=parseInt(e,10)}),_.parseTwoDigitYear=function(e){return M(e)+(68<M(e)?1900:2e3)};var x,Pe=Re("FullYear",!0);function Re(t,n){return function(e){return null!=e?(Ue(this,t,e),_.updateOffset(this,n),this):Ce(this,t)}}function Ce(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Ue(e,t,n){var s,i,r;if(e.isValid()&&!isNaN(n)){switch(s=e._d,i=e._isUTC,t){case"Milliseconds":return i?s.setUTCMilliseconds(n):s.setMilliseconds(n);case"Seconds":return i?s.setUTCSeconds(n):s.setSeconds(n);case"Minutes":return i?s.setUTCMinutes(n):s.setMinutes(n);case"Hours":return i?s.setUTCHours(n):s.setHours(n);case"Date":return i?s.setUTCDate(n):s.setDate(n);case"FullYear":break;default:return}t=n,r=e.month(),e=29!==(e=e.date())||1!==r||be(t)?e:28,i?s.setUTCFullYear(t,r,e):s.setFullYear(t,r,e)}}function He(e,t){var n;return isNaN(e)||isNaN(t)?NaN:(n=(t%(n=12)+n)%n,e+=(t-n)/12,1==n?be(e)?29:28:31-n%7%2)}x=Array.prototype.indexOf||function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},s("M",["MM",2],"Mo",function(){return this.month()+1}),s("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),s("MMMM",0,0,function(e){return this.localeData().months(this,e)}),h("M",n,u),h("MM",n,t),h("MMM",function(e,t){return t.monthsShortRegex(e)}),h("MMMM",function(e,t){return t.monthsRegex(e)}),v(["M","MM"],function(e,t){t[Y]=M(e)-1}),v(["MMM","MMMM"],function(e,t,n,s){s=n._locale.monthsParse(e,s,n._strict);null!=s?t[Y]=s:p(n).invalidMonth=e});var Fe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Le="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ve=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ge=i,Ee=i;function Ae(e,t){if(e.isValid()){if("string"==typeof t)if(/^\d+$/.test(t))t=M(t);else if(!w(t=e.localeData().monthsParse(t)))return;var n=(n=e.date())<29?n:Math.min(n,He(e.year(),t));e._isUTC?e._d.setUTCMonth(t,n):e._d.setMonth(t,n)}}function Ie(e){return null!=e?(Ae(this,e),_.updateOffset(this,!0),this):Ce(this,"Month")}function je(){function e(e,t){return t.length-e.length}for(var t,n,s=[],i=[],r=[],a=0;a<12;a++)n=l([2e3,a]),t=f(this.monthsShort(n,"")),n=f(this.months(n,"")),s.push(t),i.push(n),r.push(n),r.push(t);s.sort(e),i.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ze(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}function ze(e){var t;return e<100&&0<=e?((t=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,t)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function qe(e,t,n){n=7+t-n;return n-(7+ze(e,0,n).getUTCDay()-t)%7-1}function $e(e,t,n,s,i){var r,t=1+7*(t-1)+(7+n-s)%7+qe(e,s,i),n=t<=0?We(r=e-1)+t:t>We(e)?(r=e+1,t-We(e)):(r=e,t);return{year:r,dayOfYear:n}}function Be(e,t,n){var s,i,r=qe(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?s=r+N(i=e.year()-1,t,n):r>N(e.year(),t,n)?(s=r-N(e.year(),t,n),i=e.year()+1):(i=e.year(),s=r),{week:s,year:i}}function N(e,t,n){var s=qe(e,t,n),t=qe(e+1,t,n);return(We(e)-s+t)/7}s("w",["ww",2],"wo","week"),s("W",["WW",2],"Wo","isoWeek"),h("w",n,u),h("ww",n,t),h("W",n,u),h("WW",n,t),Oe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=M(e)});function Je(e,t){return e.slice(t,7).concat(e.slice(0,t))}s("d",0,"do","day"),s("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),s("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),s("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),s("e",0,0,"weekday"),s("E",0,0,"isoWeekday"),h("d",n),h("e",n),h("E",n),h("dd",function(e,t){return t.weekdaysMinRegex(e)}),h("ddd",function(e,t){return t.weekdaysShortRegex(e)}),h("dddd",function(e,t){return t.weekdaysRegex(e)}),Oe(["dd","ddd","dddd"],function(e,t,n,s){s=n._locale.weekdaysParse(e,s,n._strict);null!=s?t.d=s:p(n).invalidWeekday=e}),Oe(["d","e","E"],function(e,t,n,s){t[s]=M(e)});var Qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Xe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),et=i,tt=i,nt=i;function st(){function e(e,t){return t.length-e.length}for(var t,n,s,i=[],r=[],a=[],o=[],u=0;u<7;u++)s=l([2e3,1]).day(u),t=f(this.weekdaysMin(s,"")),n=f(this.weekdaysShort(s,"")),s=f(this.weekdays(s,"")),i.push(t),r.push(n),a.push(s),o.push(t),o.push(n),o.push(s);i.sort(e),r.sort(e),a.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function it(){return this.hours()%12||12}function rt(e,t){s(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function at(e,t){return t._meridiemParse}s("H",["HH",2],0,"hour"),s("h",["hh",2],0,it),s("k",["kk",2],0,function(){return this.hours()||24}),s("hmm",0,0,function(){return""+it.apply(this)+r(this.minutes(),2)}),s("hmmss",0,0,function(){return""+it.apply(this)+r(this.minutes(),2)+r(this.seconds(),2)}),s("Hmm",0,0,function(){return""+this.hours()+r(this.minutes(),2)}),s("Hmmss",0,0,function(){return""+this.hours()+r(this.minutes(),2)+r(this.seconds(),2)}),rt("a",!0),rt("A",!1),h("a",at),h("A",at),h("H",n,d),h("h",n,u),h("k",n,u),h("HH",n,t),h("hh",n,t),h("kk",n,t),h("hmm",me),h("hmmss",_e),h("Hmm",me),h("Hmmss",_e),v(["H","HH"],O),v(["k","kk"],function(e,t,n){e=M(e);t[O]=24===e?0:e}),v(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),v(["h","hh"],function(e,t,n){t[O]=M(e),p(n).bigHour=!0}),v("hmm",function(e,t,n){var s=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s)),p(n).bigHour=!0}),v("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s,2)),t[T]=M(e.substr(i)),p(n).bigHour=!0}),v("Hmm",function(e,t,n){var s=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s))}),v("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s,2)),t[T]=M(e.substr(i))});i=Re("Hours",!0);var ot,ut={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Fe,monthsShort:Le,week:{dow:0,doy:6},weekdays:Qe,weekdaysMin:Ke,weekdaysShort:Xe,meridiemParse:/[ap]\.?m?\.?/i},W={},lt={};function dt(e){return e&&e.toLowerCase().replace("_","-")}function ht(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=dt(e[r]).split("-")).length,n=(n=dt(e[r+1]))?n.split("-"):null;0<t;){if(s=ct(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s<n;s+=1)if(e[s]!==t[s])return s;return n}(i,n)>=t-1)break;t--}r++}return ot}function ct(t){var e,n;if(void 0===W[t]&&"undefined"!=typeof module&&module&&module.exports&&(n=t)&&n.match("^[^/\\\\]*$"))try{e=ot._abbr,require("./locale/"+t),ft(e)}catch(e){W[t]=null}return W[t]}function ft(e,t){return e&&((t=g(t)?P(e):mt(e,t))?ot=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ot._abbr}function mt(e,t){if(null===t)return delete W[e],null;var n,s=ut;if(t.abbr=e,null!=W[e])Q("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=W[e]._config;else if(null!=t.parentLocale)if(null!=W[t.parentLocale])s=W[t.parentLocale]._config;else{if(null==(n=ct(t.parentLocale)))return lt[t.parentLocale]||(lt[t.parentLocale]=[]),lt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return W[e]=new K(X(s,t)),lt[e]&&lt[e].forEach(function(e){mt(e.name,e.config)}),ft(e),W[e]}function P(e){var t;if(!(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e))return ot;if(!y(e)){if(t=ct(e))return t;e=[e]}return ht(e)}function _t(e){var t=e._a;return t&&-2===p(e).overflow&&(t=t[Y]<0||11<t[Y]?Y:t[S]<1||t[S]>He(t[D],t[Y])?S:t[O]<0||24<t[O]||24===t[O]&&(0!==t[b]||0!==t[T]||0!==t[Te])?O:t[b]<0||59<t[b]?b:t[T]<0||59<t[T]?T:t[Te]<0||999<t[Te]?Te:-1,p(e)._overflowDayOfYear&&(t<D||S<t)&&(t=S),p(e)._overflowWeeks&&-1===t&&(t=xe),p(e)._overflowWeekday&&-1===t&&(t=Ne),p(e).overflow=t),e}var yt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,pt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Mt=/^\/?Date\((-?\d+)/i,vt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Yt(e){var t,n,s,i,r,a,o=e._i,u=yt.exec(o)||gt.exec(o),o=pt.length,l=kt.length;if(u){for(p(e).iso=!0,t=0,n=o;t<n;t++)if(pt[t][1].exec(u[1])){i=pt[t][0],s=!1!==pt[t][2];break}if(null==i)e._isValid=!1;else{if(u[3]){for(t=0,n=l;t<n;t++)if(kt[t][1].exec(u[3])){r=(u[2]||" ")+kt[t][0];break}if(null==r)return void(e._isValid=!1)}if(s||null==r){if(u[4]){if(!wt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),xt(e)}else e._isValid=!1}}else e._isValid=!1}function St(e,t,n,s,i,r){e=[function(e){e=parseInt(e,10);{if(e<=49)return 2e3+e;if(e<=999)return 1900+e}return e}(e),Le.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&e.push(parseInt(r,10)),e}function Ot(e){var t,n,s=vt.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));s?(t=St(s[4],s[3],s[2],s[5],s[6],s[7]),function(e,t,n){if(!e||Xe.indexOf(e)===new Date(t[0],t[1],t[2]).getDay())return 1;p(n).weekdayMismatch=!0,n._isValid=!1}(s[1],t,e)&&(e._a=t,e._tzm=(t=s[8],n=s[9],s=s[10],t?Dt[t]:n?0:60*(((t=parseInt(s,10))-(n=t%100))/100)+n),e._d=ze.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0)):e._isValid=!1}function bt(e,t,n){return null!=e?e:null!=t?t:n}function Tt(e){var t,n,s,i,r,a,o,u,l,d,h,c=[];if(!e._d){for(s=e,i=new Date(_.now()),n=s._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()],e._w&&null==e._a[S]&&null==e._a[Y]&&(null!=(i=(s=e)._w).GG||null!=i.W||null!=i.E?(u=1,l=4,r=bt(i.GG,s._a[D],Be(R(),1,4).year),a=bt(i.W,1),((o=bt(i.E,1))<1||7<o)&&(d=!0)):(u=s._locale._week.dow,l=s._locale._week.doy,h=Be(R(),u,l),r=bt(i.gg,s._a[D],h.year),a=bt(i.w,h.week),null!=i.d?((o=i.d)<0||6<o)&&(d=!0):null!=i.e?(o=i.e+u,(i.e<0||6<i.e)&&(d=!0)):o=u),a<1||a>N(r,u,l)?p(s)._overflowWeeks=!0:null!=d?p(s)._overflowWeekday=!0:(h=$e(r,a,o,u,l),s._a[D]=h.year,s._dayOfYear=h.dayOfYear)),null!=e._dayOfYear&&(i=bt(e._a[D],n[D]),(e._dayOfYear>We(i)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),d=ze(i,0,e._dayOfYear),e._a[Y]=d.getUTCMonth(),e._a[S]=d.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=c[t]=n[t];for(;t<7;t++)e._a[t]=c[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[O]&&0===e._a[b]&&0===e._a[T]&&0===e._a[Te]&&(e._nextDay=!0,e._a[O]=0),e._d=(e._useUTC?ze:Ze).apply(null,c),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[O]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(p(e).weekdayMismatch=!0)}}function xt(e){if(e._f===_.ISO_8601)Yt(e);else if(e._f===_.RFC_2822)Ot(e);else{e._a=[],p(e).empty=!0;for(var t,n,s,i,r,a=""+e._i,o=a.length,u=0,l=ae(e._f,e._locale).match(te)||[],d=l.length,h=0;h<d;h++)n=l[h],(t=(a.match(De(n,e))||[])[0])&&(0<(s=a.substr(0,a.indexOf(t))).length&&p(e).unusedInput.push(s),a=a.slice(a.indexOf(t)+t.length),u+=t.length),ie[n]?(t?p(e).empty=!1:p(e).unusedTokens.push(n),s=n,r=e,null!=(i=t)&&c(Se,s)&&Se[s](i,r._a,r,s)):e._strict&&!t&&p(e).unusedTokens.push(n);p(e).charsLeftOver=o-u,0<a.length&&p(e).unusedInput.push(a),e._a[O]<=12&&!0===p(e).bigHour&&0<e._a[O]&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[O]=function(e,t,n){if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((e=e.isPM(n))&&t<12&&(t+=12),t=e||12!==t?t:0):t}(e._locale,e._a[O],e._meridiem),null!==(o=p(e).era)&&(e._a[D]=e._locale.erasConvertYear(o,e._a[D])),Tt(e),_t(e)}}function Nt(e){var t,n,s,i=e._i,r=e._f;if(e._locale=e._locale||P(e._l),null===i||void 0===r&&""===i)return I({nullInput:!0});if("string"==typeof i&&(e._i=i=e._locale.preparse(i)),k(i))return new $(_t(i));if(V(i))e._d=i;else if(y(r)){var a,o,u,l,d,h,c=e,f=!1,m=c._f.length;if(0===m)p(c).invalidFormat=!0,c._d=new Date(NaN);else{for(l=0;l<m;l++)d=0,h=!1,a=q({},c),null!=c._useUTC&&(a._useUTC=c._useUTC),a._f=c._f[l],xt(a),A(a)&&(h=!0),d=(d+=p(a).charsLeftOver)+10*p(a).unusedTokens.length,p(a).score=d,f?d<u&&(u=d,o=a):(null==u||d<u||h)&&(u=d,o=a,h)&&(f=!0);E(c,o||a)}}else if(r)xt(e);else if(g(r=(i=e)._i))i._d=new Date(_.now());else V(r)?i._d=new Date(r.valueOf()):"string"==typeof r?(n=i,null!==(t=Mt.exec(n._i))?n._d=new Date(+t[1]):(Yt(n),!1===n._isValid&&(delete n._isValid,Ot(n),!1===n._isValid)&&(delete n._isValid,n._strict?n._isValid=!1:_.createFromInputFallback(n)))):y(r)?(i._a=G(r.slice(0),function(e){return parseInt(e,10)}),Tt(i)):F(r)?(t=i)._d||(s=void 0===(n=ue(t._i)).day?n.date:n.day,t._a=G([n.year,n.month,s,n.hour,n.minute,n.second,n.millisecond],function(e){return e&&parseInt(e,10)}),Tt(t)):w(r)?i._d=new Date(r):_.createFromInputFallback(i);return A(e)||(e._d=null),e}function Wt(e,t,n,s,i){var r={};return!0!==t&&!1!==t||(s=t,t=void 0),!0!==n&&!1!==n||(s=n,n=void 0),(F(e)&&L(e)||y(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=n,r._i=e,r._f=t,r._strict=s,(i=new $(_t(Nt(i=r))))._nextDay&&(i.add(1,"d"),i._nextDay=void 0),i}function R(e,t,n,s){return Wt(e,t,n,s,!1)}_.createFromInputFallback=e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),_.ISO_8601=function(){},_.RFC_2822=function(){};me=e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=R.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:I()}),_e=e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=R.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:I()});function Pt(e,t){var n,s;if(!(t=1===t.length&&y(t[0])?t[0]:t).length)return R();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Rt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ct(e){var e=ue(e),t=e.year||0,n=e.quarter||0,s=e.month||0,i=e.week||e.isoWeek||0,r=e.day||0,a=e.hour||0,o=e.minute||0,u=e.second||0,l=e.millisecond||0;this._isValid=function(e){var t,n,s=!1,i=Rt.length;for(t in e)if(c(e,t)&&(-1===x.call(Rt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<i;++n)if(e[Rt[n]]){if(s)return!1;parseFloat(e[Rt[n]])!==M(e[Rt[n]])&&(s=!0)}return!0}(e),this._milliseconds=+l+1e3*u+6e4*o+1e3*a*60*60,this._days=+r+7*i,this._months=+s+3*n+12*t,this._data={},this._locale=P(),this._bubble()}function Ut(e){return e instanceof Ct}function Ht(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){s(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+r(~~(e/60),2)+n+r(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),h("Z",ve),h("ZZ",ve),v(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vt(ve,e)});var Lt=/([\+\-]|\d\d)/gi;function Vt(e,t){var t=(t||"").match(e);return null===t?null:0===(t=60*(e=((t[t.length-1]||[])+"").match(Lt)||["-",0,0])[1]+M(e[2]))?0:"+"===e[0]?t:-t}function Gt(e,t){var n;return t._isUTC?(t=t.clone(),n=(k(e)||V(e)?e:R(e)).valueOf()-t.valueOf(),t._d.setTime(t._d.valueOf()+n),_.updateOffset(t,!1),t):R(e).local()}function Et(e){return-Math.round(e._d.getTimezoneOffset())}function At(){return!!this.isValid()&&this._isUTC&&0===this._offset}_.updateOffset=function(){};var It=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,jt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function C(e,t){var n,s=e;return Ut(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:w(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(t=It.exec(e))?(n="-"===t[1]?-1:1,s={y:0,d:M(t[S])*n,h:M(t[O])*n,m:M(t[b])*n,s:M(t[T])*n,ms:M(Ht(1e3*t[Te]))*n}):(t=jt.exec(e))?(n="-"===t[1]?-1:1,s={y:Zt(t[2],n),M:Zt(t[3],n),w:Zt(t[4],n),d:Zt(t[5],n),h:Zt(t[6],n),m:Zt(t[7],n),s:Zt(t[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(t=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=zt(e,t):((n=zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(R(s.from),R(s.to)),(s={}).ms=t.milliseconds,s.M=t.months),n=new Ct(s),Ut(e)&&c(e,"_locale")&&(n._locale=e._locale),Ut(e)&&c(e,"_isValid")&&(n._isValid=e._isValid),n}function Zt(e,t){e=e&&parseFloat(e.replace(",","."));return(isNaN(e)?0:e)*t}function zt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function qt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(Q(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),$t(this,C(e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ht(t._days),t=Ht(t._months);e.isValid()&&(s=null==s||s,t&&Ae(e,Ce(e,"Month")+t*n),r&&Ue(e,"Date",Ce(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s)&&_.updateOffset(e,r||t)}C.fn=Ct.prototype,C.invalid=function(){return C(NaN)};Fe=qt(1,"add"),Qe=qt(-1,"subtract");function Bt(e){return"string"==typeof e||e instanceof String}function Jt(e){return k(e)||V(e)||Bt(e)||w(e)||function(t){var e=y(t),n=!1;e&&(n=0===t.filter(function(e){return!w(e)&&Bt(t)}).length);return e&&n}(e)||function(e){var t,n,s=F(e)&&!L(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a=r.length;for(t=0;t<a;t+=1)n=r[t],i=i||c(e,n);return s&&i}(e)||null==e}function Qt(e,t){var n,s;return e.date()<t.date()?-Qt(t,e):-((n=12*(t.year()-e.year())+(t.month()-e.month()))+(t-(s=e.clone().add(n,"months"))<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(1+n,"months")-s)))||0}function Xt(e){return void 0===e?this._locale._abbr:(null!=(e=P(e))&&(this._locale=e),this)}_.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",_.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";Ke=e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Kt(){return this._locale}var en=126227808e5;function tn(e,t){return(e%t+t)%t}function nn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-en:new Date(e,t,n).valueOf()}function sn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-en:Date.UTC(e,t,n)}function rn(e,t){return t.erasAbbrRegex(e)}function an(){for(var e,t,n,s=[],i=[],r=[],a=[],o=this.eras(),u=0,l=o.length;u<l;++u)e=f(o[u].name),t=f(o[u].abbr),n=f(o[u].narrow),i.push(e),s.push(t),r.push(n),a.push(e),a.push(t),a.push(n);this._erasRegex=new RegExp("^("+a.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}function on(e,t){s(0,[e,e.length],0,t)}function un(e,t,n,s,i){var r;return null==e?Be(this,s,i).year:(r=N(e,s,i),function(e,t,n,s,i){e=$e(e,t,n,s,i),t=ze(e.year,0,e.dayOfYear);return this.year(t.getUTCFullYear()),this.month(t.getUTCMonth()),this.date(t.getUTCDate()),this}.call(this,e,t=r<t?r:t,n,s,i))}s("N",0,0,"eraAbbr"),s("NN",0,0,"eraAbbr"),s("NNN",0,0,"eraAbbr"),s("NNNN",0,0,"eraName"),s("NNNNN",0,0,"eraNarrow"),s("y",["y",1],"yo","eraYear"),s("y",["yy",2],0,"eraYear"),s("y",["yyy",3],0,"eraYear"),s("y",["yyyy",4],0,"eraYear"),h("N",rn),h("NN",rn),h("NNN",rn),h("NNNN",function(e,t){return t.erasNameRegex(e)}),h("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),v(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){s=n._locale.erasParse(e,s,n._strict);s?p(n).era=s:p(n).invalidEra=e}),h("y",pe),h("yy",pe),h("yyy",pe),h("yyyy",pe),h("yo",function(e,t){return t._eraYearOrdinalRegex||pe}),v(["y","yy","yyy","yyyy"],D),v(["yo"],function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[D]=n._locale.eraYearOrdinalParse(e,i):t[D]=parseInt(e,10)}),s(0,["gg",2],0,function(){return this.weekYear()%100}),s(0,["GG",2],0,function(){return this.isoWeekYear()%100}),on("gggg","weekYear"),on("ggggg","weekYear"),on("GGGG","isoWeekYear"),on("GGGGG","isoWeekYear"),h("G",ke),h("g",ke),h("GG",n,t),h("gg",n,t),h("GGGG",ge,ce),h("gggg",ge,ce),h("GGGGG",we,fe),h("ggggg",we,fe),Oe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=M(e)}),Oe(["gg","GG"],function(e,t,n,s){t[s]=_.parseTwoDigitYear(e)}),s("Q",0,"Qo","quarter"),h("Q",de),v("Q",function(e,t){t[Y]=3*(M(e)-1)}),s("D",["DD",2],"Do","date"),h("D",n,u),h("DD",n,t),h("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),v(["D","DD"],S),v("Do",function(e,t){t[S]=M(e.match(n)[0])});ge=Re("Date",!0);s("DDD",["DDDD",3],"DDDo","dayOfYear"),h("DDD",ye),h("DDDD",he),v(["DDD","DDDD"],function(e,t,n){n._dayOfYear=M(e)}),s("m",["mm",2],0,"minute"),h("m",n,d),h("mm",n,t),v(["m","mm"],b);var ln,ce=Re("Minutes",!1),we=(s("s",["ss",2],0,"second"),h("s",n,d),h("ss",n,t),v(["s","ss"],T),Re("Seconds",!1));for(s("S",0,0,function(){return~~(this.millisecond()/100)}),s(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),s(0,["SSS",3],0,"millisecond"),s(0,["SSSS",4],0,function(){return 10*this.millisecond()}),s(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),s(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),s(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),s(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),s(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),h("S",ye,de),h("SS",ye,t),h("SSS",ye,he),ln="SSSS";ln.length<=9;ln+="S")h(ln,pe);function dn(e,t){t[Te]=M(1e3*("0."+e))}for(ln="S";ln.length<=9;ln+="S")v(ln,dn);fe=Re("Milliseconds",!1),s("z",0,0,"zoneAbbr"),s("zz",0,0,"zoneName");u=$.prototype;function hn(e){return e}u.add=Fe,u.calendar=function(e,t){1===arguments.length&&(arguments[0]?Jt(arguments[0])?(e=arguments[0],t=void 0):function(e){for(var t=F(e)&&!L(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i=0;i<s.length;i+=1)n=n||c(e,s[i]);return t&&n}(arguments[0])&&(t=arguments[0],e=void 0):t=e=void 0);var e=e||R(),n=Gt(e,this).startOf("day"),n=_.calendarFormat(this,n)||"sameElse",t=t&&(a(t[n])?t[n].call(this,e):t[n]);return this.format(t||this.localeData().calendar(n,this,R(e)))},u.clone=function(){return new $(this)},u.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=o(t)){case"year":r=Qt(this,s)/12;break;case"month":r=Qt(this,s);break;case"quarter":r=Qt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:m(r)},u.endOf=function(e){var t,n;if(void 0!==(e=o(e))&&"millisecond"!==e&&this.isValid()){switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-tn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-tn(t,1e3)-1;break}this._d.setTime(t),_.updateOffset(this,!0)}return this},u.format=function(e){return e=e||(this.isUtc()?_.defaultFormatUtc:_.defaultFormat),e=re(this,e),this.localeData().postformat(e)},u.from=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||R(e).isValid())?C({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},u.fromNow=function(e){return this.from(R(),e)},u.to=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||R(e).isValid())?C({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},u.toNow=function(e){return this.to(R(),e)},u.get=function(e){return a(this[e=o(e)])?this[e]():this},u.invalidAt=function(){return p(this).overflow},u.isAfter=function(e,t){return e=k(e)?e:R(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf())},u.isBefore=function(e,t){return e=k(e)?e:R(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf())},u.isBetween=function(e,t,n,s){return e=k(e)?e:R(e),t=k(t)?t:R(t),!!(this.isValid()&&e.isValid()&&t.isValid())&&("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},u.isSame=function(e,t){var e=k(e)?e:R(e);return!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()===e.valueOf():(e=e.valueOf(),this.clone().startOf(t).valueOf()<=e&&e<=this.clone().endOf(t).valueOf()))},u.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},u.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},u.isValid=function(){return A(this)},u.lang=Ke,u.locale=Xt,u.localeData=Kt,u.max=_e,u.min=me,u.parsingFlags=function(){return E({},p(this))},u.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)c(e,t)&&n.push({unit:t,priority:le[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=ue(e)),s=n.length,i=0;i<s;i++)this[n[i].unit](e[n[i].unit]);else if(a(this[e=o(e)]))return this[e](t);return this},u.startOf=function(e){var t,n;if(void 0!==(e=o(e))&&"millisecond"!==e&&this.isValid()){switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=tn(t,6e4);break;case"second":t=this._d.valueOf(),t-=tn(t,1e3);break}this._d.setTime(t),_.updateOffset(this,!0)}return this},u.subtract=Qe,u.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},u.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},u.toDate=function(){return new Date(this.valueOf())},u.toISOString=function(e){var t;return this.isValid()?(t=(e=!0!==e)?this.clone().utc():this).year()<0||9999<t.year()?re(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):a(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",re(t,"Z")):re(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ"):null},u.inspect=function(){var e,t,n;return this.isValid()?(t="moment",e="",this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z"),t="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(t+n+"-MM-DD[T]HH:mm:ss.SSS"+(e+'[")]'))):"moment.invalid(/* "+this._i+" */)"},"undefined"!=typeof Symbol&&null!=Symbol.for&&(u[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),u.toJSON=function(){return this.isValid()?this.toISOString():null},u.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},u.unix=function(){return Math.floor(this.valueOf()/1e3)},u.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},u.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},u.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].name;if(t[n].until<=e&&e<=t[n].since)return t[n].name}return""},u.eraNarrow=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].narrow;if(t[n].until<=e&&e<=t[n].since)return t[n].narrow}return""},u.eraAbbr=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].abbr;if(t[n].until<=e&&e<=t[n].since)return t[n].abbr}return""},u.eraYear=function(){for(var e,t,n=this.localeData().eras(),s=0,i=n.length;s<i;++s)if(e=n[s].since<=n[s].until?1:-1,t=this.clone().startOf("day").valueOf(),n[s].since<=t&&t<=n[s].until||n[s].until<=t&&t<=n[s].since)return(this.year()-_(n[s].since).year())*e+n[s].offset;return this.year()},u.year=Pe,u.isLeapYear=function(){return be(this.year())},u.weekYear=function(e){return un.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},u.isoWeekYear=function(e){return un.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},u.quarter=u.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},u.month=Ie,u.daysInMonth=function(){return He(this.year(),this.month())},u.week=u.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},u.isoWeek=u.isoWeeks=function(e){var t=Be(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},u.weeksInYear=function(){var e=this.localeData()._week;return N(this.year(),e.dow,e.doy)},u.weeksInWeekYear=function(){var e=this.localeData()._week;return N(this.weekYear(),e.dow,e.doy)},u.isoWeeksInYear=function(){return N(this.year(),1,4)},u.isoWeeksInISOWeekYear=function(){return N(this.isoWeekYear(),1,4)},u.date=ge,u.day=u.days=function(e){var t,n,s;return this.isValid()?(t=Ce(this,"Day"),null!=e?(n=e,s=this.localeData(),e="string"!=typeof n?n:isNaN(n)?"number"==typeof(n=s.weekdaysParse(n))?n:null:parseInt(n,10),this.add(e-t,"d")):t):null!=e?this:NaN},u.weekday=function(e){var t;return this.isValid()?(t=(this.day()+7-this.localeData()._week.dow)%7,null==e?t:this.add(e-t,"d")):null!=e?this:NaN},u.isoWeekday=function(e){var t,n;return this.isValid()?null!=e?(t=e,n=this.localeData(),n="string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t,this.day(this.day()%7?n:n-7)):this.day()||7:null!=e?this:NaN},u.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},u.hour=u.hours=i,u.minute=u.minutes=ce,u.second=u.seconds=we,u.millisecond=u.milliseconds=fe,u.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Et(this);if("string"==typeof e){if(null===(e=Vt(ve,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Et(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?$t(this,C(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,_.updateOffset(this,!0),this._changeInProgress=null)),this},u.utc=function(e){return this.utcOffset(0,e)},u.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e)&&this.subtract(Et(this),"m"),this},u.parseZone=function(){var e;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(e=Vt(Me,this._i))?this.utcOffset(e):this.utcOffset(0,!0)),this},u.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?R(e).utcOffset():0,(this.utcOffset()-e)%60==0)},u.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},u.isLocal=function(){return!!this.isValid()&&!this._isUTC},u.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},u.isUtc=At,u.isUTC=At,u.zoneAbbr=function(){return this._isUTC?"UTC":""},u.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},u.dates=e("dates accessor is deprecated. Use date instead.",ge),u.months=e("months accessor is deprecated. Use month instead",Ie),u.years=e("years accessor is deprecated. Use year instead",Pe),u.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?(this.utcOffset(e="string"!=typeof e?-e:e,t),this):-this.utcOffset()}),u.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){var e,t;return g(this._isDSTShifted)&&(q(e={},this),(e=Nt(e))._a?(t=(e._isUTC?l:R)(e._a),this._isDSTShifted=this.isValid()&&0<function(e,t,n){for(var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a=0;a<s;a++)(n&&e[a]!==t[a]||!n&&M(e[a])!==M(t[a]))&&r++;return r+i}(e._a,t.toArray())):this._isDSTShifted=!1),this._isDSTShifted});d=K.prototype;function cn(e,t,n,s){var i=P(),s=l().set(s,t);return i[n](s,e)}function fn(e,t,n){if(w(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");for(var s=[],i=0;i<12;i++)s[i]=cn(e,i,n,"month");return s}function mn(e,t,n,s){t=("boolean"==typeof e?w(t)&&(n=t,t=void 0):(t=e,e=!1,w(n=t)&&(n=t,t=void 0)),t||"");var i,r=P(),a=e?r._week.dow:0,o=[];if(null!=n)return cn(t,(n+a)%7,s,"day");for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}d.calendar=function(e,t,n){return a(e=this._calendar[e]||this._calendar.sameElse)?e.call(t,n):e},d.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(te).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},d.invalidDate=function(){return this._invalidDate},d.ordinal=function(e){return this._ordinal.replace("%d",e)},d.preparse=hn,d.postformat=hn,d.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return a(i)?i(e,t,n,s):i.replace(/%d/i,e)},d.pastFuture=function(e,t){return a(e=this._relativeTime[0<e?"future":"past"])?e(t):e.replace(/%s/i,t)},d.set=function(e){var t,n;for(n in e)c(e,n)&&(a(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},d.eras=function(e,t){for(var n,s=this._eras||P("en")._eras,i=0,r=s.length;i<r;++i){switch(typeof s[i].since){case"string":n=_(s[i].since).startOf("day"),s[i].since=n.valueOf();break}switch(typeof s[i].until){case"undefined":s[i].until=1/0;break;case"string":n=_(s[i].until).startOf("day").valueOf(),s[i].until=n.valueOf();break}}return s},d.erasParse=function(e,t,n){var s,i,r,a,o,u=this.eras();for(e=e.toUpperCase(),s=0,i=u.length;s<i;++s)if(r=u[s].name.toUpperCase(),a=u[s].abbr.toUpperCase(),o=u[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[s];break;case"NNNN":if(r===e)return u[s];break;case"NNNNN":if(o===e)return u[s];break}else if(0<=[r,a,o].indexOf(e))return u[s]},d.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?_(e.since).year():_(e.since).year()+(t-e.offset)*n},d.erasAbbrRegex=function(e){return c(this,"_erasAbbrRegex")||an.call(this),e?this._erasAbbrRegex:this._erasRegex},d.erasNameRegex=function(e){return c(this,"_erasNameRegex")||an.call(this),e?this._erasNameRegex:this._erasRegex},d.erasNarrowRegex=function(e){return c(this,"_erasNarrowRegex")||an.call(this),e?this._erasNarrowRegex:this._erasRegex},d.months=function(e,t){return e?(y(this._months)?this._months:this._months[(this._months.isFormat||Ve).test(t)?"format":"standalone"])[e.month()]:y(this._months)?this._months:this._months.standalone},d.monthsShort=function(e,t){return e?(y(this._monthsShort)?this._monthsShort:this._monthsShort[Ve.test(t)?"format":"standalone"])[e.month()]:y(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},d.monthsParse=function(e,t,n){var s,i;if(this._monthsParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=l([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=x.call(this._shortMonthsParse,e))?i:null:-1!==(i=x.call(this._longMonthsParse,e))?i:null:"MMM"===t?-1!==(i=x.call(this._shortMonthsParse,e))||-1!==(i=x.call(this._longMonthsParse,e))?i:null:-1!==(i=x.call(this._longMonthsParse,e))||-1!==(i=x.call(this._shortMonthsParse,e))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=l([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(i="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},d.monthsRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||je.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Ee),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},d.monthsShortRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||je.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Ge),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},d.week=function(e){return Be(e,this._week.dow,this._week.doy).week},d.firstDayOfYear=function(){return this._week.doy},d.firstDayOfWeek=function(){return this._week.dow},d.weekdays=function(e,t){return t=y(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"],!0===e?Je(t,this._week.dow):e?t[e.day()]:t},d.weekdaysMin=function(e){return!0===e?Je(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},d.weekdaysShort=function(e){return!0===e?Je(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},d.weekdaysParse=function(e,t,n){var s,i;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=l([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=x.call(this._weekdaysParse,e))?i:null:"ddd"===t?-1!==(i=x.call(this._shortWeekdaysParse,e))?i:null:-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:"dddd"===t?-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._shortWeekdaysParse,e))||-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:"ddd"===t?-1!==(i=x.call(this._shortWeekdaysParse,e))||-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:-1!==(i=x.call(this._minWeekdaysParse,e))||-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._shortWeekdaysParse,e))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=l([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},d.weekdaysRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=et),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},d.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},d.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},d.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},d.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ft("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===M(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),_.lang=e("moment.lang is deprecated. Use moment.locale instead.",ft),_.langData=e("moment.langData is deprecated. Use moment.localeData instead.",P);var _n=Math.abs;function yn(e,t,n,s){t=C(t,n);return e._milliseconds+=s*t._milliseconds,e._days+=s*t._days,e._months+=s*t._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function wn(e){return 4800*e/146097}function pn(e){return 146097*e/4800}function kn(e){return function(){return this.as(e)}}de=kn("ms"),t=kn("s"),ye=kn("m"),he=kn("h"),Fe=kn("d"),_e=kn("w"),me=kn("M"),Qe=kn("Q"),i=kn("y"),ce=de;function Mn(e){return function(){return this.isValid()?this._data[e]:NaN}}var we=Mn("milliseconds"),fe=Mn("seconds"),ge=Mn("minutes"),Pe=Mn("hours"),d=Mn("days"),vn=Mn("months"),Dn=Mn("years");var Yn=Math.round,Sn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function On(e,t,n,s){var i=C(e).abs(),r=Yn(i.as("s")),a=Yn(i.as("m")),o=Yn(i.as("h")),u=Yn(i.as("d")),l=Yn(i.as("M")),d=Yn(i.as("w")),i=Yn(i.as("y")),r=(r<=n.ss?["s",r]:r<n.s&&["ss",r])||(a<=1?["m"]:a<n.m&&["mm",a])||(o<=1?["h"]:o<n.h&&["hh",o])||(u<=1?["d"]:u<n.d&&["dd",u]);return(r=(r=null!=n.w?r||(d<=1?["w"]:d<n.w&&["ww",d]):r)||(l<=1?["M"]:l<n.M&&["MM",l])||(i<=1?["y"]:["yy",i]))[2]=t,r[3]=0<+e,r[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,r)}var bn=Math.abs;function Tn(e){return(0<e)-(e<0)||+e}function xn(){var e,t,n,s,i,r,a,o,u,l,d;return this.isValid()?(e=bn(this._milliseconds)/1e3,t=bn(this._days),n=bn(this._months),(o=this.asSeconds())?(s=m(e/60),i=m(s/60),e%=60,s%=60,r=m(n/12),n%=12,a=e?e.toFixed(3).replace(/\.?0+$/,""):"",u=Tn(this._months)!==Tn(o)?"-":"",l=Tn(this._days)!==Tn(o)?"-":"",d=Tn(this._milliseconds)!==Tn(o)?"-":"",(o<0?"-":"")+"P"+(r?u+r+"Y":"")+(n?u+n+"M":"")+(t?l+t+"D":"")+(i||s||e?"T":"")+(i?d+i+"H":"")+(s?d+s+"M":"")+(e?d+a+"S":"")):"P0D"):this.localeData().invalidDate()}var U=Ct.prototype;return U.isValid=function(){return this._isValid},U.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},U.add=function(e,t){return yn(this,e,t,1)},U.subtract=function(e,t){return yn(this,e,t,-1)},U.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=o(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+wn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(pn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},U.asMilliseconds=de,U.asSeconds=t,U.asMinutes=ye,U.asHours=he,U.asDays=Fe,U.asWeeks=_e,U.asMonths=me,U.asQuarters=Qe,U.asYears=i,U.valueOf=ce,U._bubble=function(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data;return 0<=e&&0<=t&&0<=n||e<=0&&t<=0&&n<=0||(e+=864e5*gn(pn(n)+t),n=t=0),s.milliseconds=e%1e3,e=m(e/1e3),s.seconds=e%60,e=m(e/60),s.minutes=e%60,e=m(e/60),s.hours=e%24,t+=m(e/24),n+=e=m(wn(t)),t-=gn(pn(e)),e=m(n/12),n%=12,s.days=t,s.months=n,s.years=e,this},U.clone=function(){return C(this)},U.get=function(e){return e=o(e),this.isValid()?this[e+"s"]():NaN},U.milliseconds=we,U.seconds=fe,U.minutes=ge,U.hours=Pe,U.days=d,U.weeks=function(){return m(this.days()/7)},U.months=vn,U.years=Dn,U.humanize=function(e,t){var n,s;return this.isValid()?(n=!1,s=Sn,"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(n=e),"object"==typeof t&&(s=Object.assign({},Sn,t),null!=t.s)&&null==t.ss&&(s.ss=t.s-1),e=this.localeData(),t=On(this,!n,s,e),n&&(t=e.pastFuture(+this,t)),e.postformat(t)):this.localeData().invalidDate()},U.toISOString=xn,U.toString=xn,U.toJSON=xn,U.locale=Xt,U.localeData=Kt,U.toIsoString=e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",xn),U.lang=Ke,s("X",0,0,"unix"),s("x",0,0,"valueOf"),h("x",ke),h("X",/[+-]?\d+(\.\d{1,3})?/),v("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),v("x",function(e,t,n){n._d=new Date(M(e))}),_.version="2.30.1",H=R,_.fn=u,_.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},_.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},_.now=function(){return Date.now?Date.now():+new Date},_.utc=l,_.unix=function(e){return R(1e3*e)},_.months=function(e,t){return fn(e,t,"months")},_.isDate=V,_.locale=ft,_.invalid=I,_.duration=C,_.isMoment=k,_.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},_.parseZone=function(){return R.apply(null,arguments).parseZone()},_.localeData=P,_.isDuration=Ut,_.monthsShort=function(e,t){return fn(e,t,"monthsShort")},_.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},_.defineLocale=mt,_.updateLocale=function(e,t){var n,s;return null!=t?(s=ut,null!=W[e]&&null!=W[e].parentLocale?W[e].set(X(W[e]._config,t)):(t=X(s=null!=(n=ct(e))?n._config:s,t),null==n&&(t.abbr=e),(s=new K(t)).parentLocale=W[e],W[e]=s),ft(e)):null!=W[e]&&(null!=W[e].parentLocale?(W[e]=W[e].parentLocale,e===ft()&&ft(e)):null!=W[e]&&delete W[e]),W[e]},_.locales=function(){return ee(W)},_.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},_.normalizeUnits=o,_.relativeTimeRounding=function(e){return void 0===e?Yn:"function"==typeof e&&(Yn=e,!0)},_.relativeTimeThreshold=function(e,t){return void 0!==Sn[e]&&(void 0===t?Sn[e]:(Sn[e]=t,"s"===e&&(Sn.ss=t-1),!0))},_.calendarFormat=function(e,t){return(e=e.diff(t,"days",!0))<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"},_.prototype=u,_.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},_});(function(root,factory){if(typeof define==='function'&&define.amd){define(["jquery"],function($){return(root.returnExportsGlobal=factory($))})}else if(typeof exports==='object'){module.exports=factory(require("jquery"))}else{factory(jQuery)}}(this,function($){"use strict";var EditableCaret,InputCaret,Mirror,Utils,discoveryIframeOf,methods,oDocument,oFrame,oWindow,pluginName,setContextBy;pluginName='caret';EditableCaret=(function(){function EditableCaret($inputor){this.$inputor=$inputor;this.domInputor=this.$inputor[0]}
EditableCaret.prototype.setPos=function(pos){var fn,found,offset,sel;if(sel=oWindow.getSelection()){offset=0;found=!1;(fn=function(pos,parent){var node,range,_i,_len,_ref,_results;_ref=parent.childNodes;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){node=_ref[_i];if(found){break}
if(node.nodeType===3){if(offset+node.length>=pos){found=!0;range=oDocument.createRange();range.setStart(node,pos-offset);sel.removeAllRanges();sel.addRange(range);break}else{_results.push(offset+=node.length)}}else{_results.push(fn(pos,node))}}
return _results})(pos,this.domInputor)}
return this.domInputor};EditableCaret.prototype.getIEPosition=function(){return this.getPosition()};EditableCaret.prototype.getPosition=function(){var inputor_offset,offset;offset=this.getOffset();inputor_offset=this.$inputor.offset();offset.left-=inputor_offset.left;offset.top-=inputor_offset.top;return offset};EditableCaret.prototype.getOldIEPos=function(){var preCaretTextRange,textRange;textRange=oDocument.selection.createRange();preCaretTextRange=oDocument.body.createTextRange();preCaretTextRange.moveToElementText(this.domInputor);preCaretTextRange.setEndPoint("EndToEnd",textRange);return preCaretTextRange.text.length};EditableCaret.prototype.getPos=function(){var clonedRange,pos,range;if(range=this.range()){clonedRange=range.cloneRange();clonedRange.selectNodeContents(this.domInputor);clonedRange.setEnd(range.endContainer,range.endOffset);pos=clonedRange.toString().length;clonedRange.detach();return pos}else if(oDocument.selection){return this.getOldIEPos()}};EditableCaret.prototype.getOldIEOffset=function(){var range,rect;range=oDocument.selection.createRange().duplicate();range.moveStart("character",-1);rect=range.getBoundingClientRect();return{height:rect.bottom-rect.top,left:rect.left,top:rect.top}};EditableCaret.prototype.getOffset=function(pos){var clonedRange,offset,range,rect,shadowCaret;if(oWindow.getSelection&&(range=this.range())){if(range.endOffset-1>0&&range.endContainer!==this.domInputor){clonedRange=range.cloneRange();clonedRange.setStart(range.endContainer,range.endOffset-1);clonedRange.setEnd(range.endContainer,range.endOffset);rect=clonedRange.getBoundingClientRect();offset={height:rect.height,left:rect.left+rect.width,top:rect.top};clonedRange.detach()}
if(!offset||(offset!=null?offset.height:void 0)===0){clonedRange=range.cloneRange();shadowCaret=$(oDocument.createTextNode("|"));clonedRange.insertNode(shadowCaret[0]);clonedRange.selectNode(shadowCaret[0]);rect=clonedRange.getBoundingClientRect();offset={height:rect.height,left:rect.left,top:rect.top};shadowCaret.remove();clonedRange.detach()}}else if(oDocument.selection){offset=this.getOldIEOffset()}
if(offset){offset.top+=$(oWindow).scrollTop();offset.left+=$(oWindow).scrollLeft()}
return offset};EditableCaret.prototype.range=function(){var sel;if(!oWindow.getSelection){return}
sel=oWindow.getSelection();if(sel.rangeCount>0){return sel.getRangeAt(0)}else{return null}};return EditableCaret})();InputCaret=(function(){function InputCaret($inputor){this.$inputor=$inputor;this.domInputor=this.$inputor[0]}
InputCaret.prototype.getIEPos=function(){var endRange,inputor,len,normalizedValue,pos,range,textInputRange;inputor=this.domInputor;range=oDocument.selection.createRange();pos=0;if(range&&range.parentElement()===inputor){normalizedValue=inputor.value.replace(/\r\n/g,"\n");len=normalizedValue.length;textInputRange=inputor.createTextRange();textInputRange.moveToBookmark(range.getBookmark());endRange=inputor.createTextRange();endRange.collapse(!1);if(textInputRange.compareEndPoints("StartToEnd",endRange)>-1){pos=len}else{pos=-textInputRange.moveStart("character",-len)}}
return pos};InputCaret.prototype.getPos=function(){if(oDocument.selection){return this.getIEPos()}else{return this.domInputor.selectionStart}};InputCaret.prototype.setPos=function(pos){var inputor,range;inputor=this.domInputor;if(oDocument.selection){range=inputor.createTextRange();range.move("character",pos);range.select()}else if(inputor.setSelectionRange){inputor.setSelectionRange(pos,pos)}
return inputor};InputCaret.prototype.getIEOffset=function(pos){var h,textRange,x,y;textRange=this.domInputor.createTextRange();pos||(pos=this.getPos());textRange.move('character',pos);x=textRange.boundingLeft;y=textRange.boundingTop;h=textRange.boundingHeight;return{left:x,top:y,height:h}};InputCaret.prototype.getOffset=function(pos){var $inputor,offset,position;$inputor=this.$inputor;if(oDocument.selection){offset=this.getIEOffset(pos);offset.top+=$(oWindow).scrollTop()+$inputor.scrollTop();offset.left+=$(oWindow).scrollLeft()+$inputor.scrollLeft();return offset}else{offset=$inputor.offset();position=this.getPosition(pos);return offset={left:offset.left+position.left-$inputor.scrollLeft(),top:offset.top+position.top-$inputor.scrollTop(),height:position.height}}};InputCaret.prototype.getPosition=function(pos){var $inputor,at_rect,end_range,format,html,mirror,start_range;$inputor=this.$inputor;format=function(value){value=value.replace(/<|>|`|"|&/g,'?').replace(/\r\n|\r|\n/g,"<br/>");if(/firefox/i.test(navigator.userAgent)){value=value.replace(/\s/g,'&nbsp;')}
return value};if(pos===void 0){pos=this.getPos()}
start_range=$inputor.val().slice(0,pos);end_range=$inputor.val().slice(pos);html="<span style='position: relative; display: inline;'>"+format(start_range)+"</span>";html+="<span id='caret' style='position: relative; display: inline;'>|</span>";html+="<span style='position: relative; display: inline;'>"+format(end_range)+"</span>";mirror=new Mirror($inputor);return at_rect=mirror.create(html).rect()};InputCaret.prototype.getIEPosition=function(pos){var h,inputorOffset,offset,x,y;offset=this.getIEOffset(pos);inputorOffset=this.$inputor.offset();x=offset.left-inputorOffset.left;y=offset.top-inputorOffset.top;h=offset.height;return{left:x,top:y,height:h}};return InputCaret})();Mirror=(function(){Mirror.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"];function Mirror($inputor){this.$inputor=$inputor}
Mirror.prototype.mirrorCss=function(){var css,_this=this;css={position:'absolute',left:-9999,top:0,zIndex:-20000};if(this.$inputor.prop('tagName')==='TEXTAREA'){this.css_attr.push('width')}
$.each(this.css_attr,function(i,p){return css[p]=_this.$inputor.css(p)});return css};Mirror.prototype.create=function(html){this.$mirror=$('<div></div>');this.$mirror.css(this.mirrorCss());this.$mirror.html(html);this.$inputor.after(this.$mirror);return this};Mirror.prototype.rect=function(){var $flag,pos,rect;$flag=this.$mirror.find("#caret");pos=$flag.position();rect={left:pos.left,top:pos.top,height:$flag.height()};this.$mirror.remove();return rect};return Mirror})();Utils={contentEditable:function($inputor){return!!($inputor[0].contentEditable&&$inputor[0].contentEditable==='true')}};methods={pos:function(pos){if(pos||pos===0){return this.setPos(pos)}else{return this.getPos()}},position:function(pos){if(oDocument.selection){return this.getIEPosition(pos)}else{return this.getPosition(pos)}},offset:function(pos){var offset;offset=this.getOffset(pos);return offset}};oDocument=null;oWindow=null;oFrame=null;setContextBy=function(settings){var iframe;if(iframe=settings!=null?settings.iframe:void 0){oFrame=iframe;oWindow=iframe.contentWindow;return oDocument=iframe.contentDocument||oWindow.document}else{oFrame=void 0;oWindow=window;return oDocument=document}};discoveryIframeOf=function($dom){var error;oDocument=$dom[0].ownerDocument;oWindow=oDocument.defaultView||oDocument.parentWindow;try{return oFrame=oWindow.frameElement}catch(_error){error=_error}};$.fn.caret=function(method,value,settings){var caret;if(methods[method]){if($.isPlainObject(value)){setContextBy(value);value=void 0}else{setContextBy(settings)}
caret=Utils.contentEditable(this)?new EditableCaret(this):new InputCaret(this);return methods[method].apply(caret,[value])}else{return $.error("Method "+method+" does not exist on jQuery.caret")}};$.fn.caret.EditableCaret=EditableCaret;$.fn.caret.InputCaret=InputCaret;$.fn.caret.Utils=Utils;$.fn.caret.apis=methods}));/*!
 * jQuery Cookie Plugin v1.4.1
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2013 Klaus Hartl
 * Released under the MIT license
 */
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof exports==='object'){factory(require('jquery'))}else{factory(jQuery)}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}
function decode(s){return config.raw?s:decodeURIComponent(s)}
function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}
function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\')}
try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s}catch(e){}}
function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}
var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setTime(+t+days*864e+5)}
return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))}
var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=read(cookie,value);break}
if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie}}
return result};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return!1}
$.cookie(key,'',$.extend({},options,{expires:-1}));return!$.cookie(key)}}));(function(){var root=this;if(typeof Math.sgn=="undefined"){Math.sgn=function(x){return x==0?0:x>0?1:-1}}
var Vectors={subtract:function(v1,v2){return{x:v1.x-v2.x,y:v1.y-v2.y}},dotProduct:function(v1,v2){return(v1.x*v2.x)+(v1.y*v2.y)},square:function(v){return Math.sqrt((v.x*v.x)+(v.y*v.y))},scale:function(v,s){return{x:v.x*s,y:v.y*s}}},maxRecursion=64,flatnessTolerance=Math.pow(2.0,-maxRecursion-1);var _distanceFromCurve=function(point,curve){var candidates=[],w=_convertToBezier(point,curve),degree=curve.length-1,higherDegree=(2*degree)-1,numSolutions=_findRoots(w,higherDegree,candidates,0),v=Vectors.subtract(point,curve[0]),dist=Vectors.square(v),t=0.0;for(var i=0;i<numSolutions;i++){v=Vectors.subtract(point,_bezier(curve,degree,candidates[i],null,null));var newDist=Vectors.square(v);if(newDist<dist){dist=newDist;t=candidates[i]}}
v=Vectors.subtract(point,curve[degree]);newDist=Vectors.square(v);if(newDist<dist){dist=newDist;t=1.0}
return{location:t,distance:dist}};var _nearestPointOnCurve=function(point,curve){var td=_distanceFromCurve(point,curve);return{point:_bezier(curve,curve.length-1,td.location,null,null),location:td.location}};var _convertToBezier=function(point,curve){var degree=curve.length-1,higherDegree=(2*degree)-1,c=[],d=[],cdTable=[],w=[],z=[[1.0,0.6,0.3,0.1],[0.4,0.6,0.6,0.4],[0.1,0.3,0.6,1.0]];for(var i=0;i<=degree;i++)c[i]=Vectors.subtract(curve[i],point);for(var i=0;i<=degree-1;i++){d[i]=Vectors.subtract(curve[i+1],curve[i]);d[i]=Vectors.scale(d[i],3.0)}
for(var row=0;row<=degree-1;row++){for(var column=0;column<=degree;column++){if(!cdTable[row])cdTable[row]=[];cdTable[row][column]=Vectors.dotProduct(d[row],c[column])}}
for(i=0;i<=higherDegree;i++){if(!w[i])w[i]=[];w[i].y=0.0;w[i].x=parseFloat(i)/higherDegree}
var n=degree,m=degree-1;for(var k=0;k<=n+m;k++){var lb=Math.max(0,k-m),ub=Math.min(k,n);for(i=lb;i<=ub;i++){var j=k-i;w[i+j].y+=cdTable[j][i]*z[j][i]}}
return w};var _findRoots=function(w,degree,t,depth){var left=[],right=[],left_count,right_count,left_t=[],right_t=[];switch(_getCrossingCount(w,degree)){case 0:{return 0}
case 1:{if(depth>=maxRecursion){t[0]=(w[0].x+w[degree].x)/2.0;return 1}
if(_isFlatEnough(w,degree)){t[0]=_computeXIntercept(w,degree);return 1}
break}}
_bezier(w,degree,0.5,left,right);left_count=_findRoots(left,degree,left_t,depth+1);right_count=_findRoots(right,degree,right_t,depth+1);for(var i=0;i<left_count;i++)t[i]=left_t[i];for(var i=0;i<right_count;i++)t[i+left_count]=right_t[i];return(left_count+right_count)};var _getCrossingCount=function(curve,degree){var n_crossings=0,sign,old_sign;sign=old_sign=Math.sgn(curve[0].y);for(var i=1;i<=degree;i++){sign=Math.sgn(curve[i].y);if(sign!=old_sign)n_crossings++;old_sign=sign}
return n_crossings};var _isFlatEnough=function(curve,degree){var error,intercept_1,intercept_2,left_intercept,right_intercept,a,b,c,det,dInv,a1,b1,c1,a2,b2,c2;a=curve[0].y-curve[degree].y;b=curve[degree].x-curve[0].x;c=curve[0].x*curve[degree].y-curve[degree].x*curve[0].y;var max_distance_above,max_distance_below;max_distance_above=max_distance_below=0.0;for(var i=1;i<degree;i++){var value=a*curve[i].x+b*curve[i].y+c;if(value>max_distance_above)
max_distance_above=value;else if(value<max_distance_below)
max_distance_below=value}
a1=0.0;b1=1.0;c1=0.0;a2=a;b2=b;c2=c-max_distance_above;det=a1*b2-a2*b1;dInv=1.0/det;intercept_1=(b1*c2-b2*c1)*dInv;a2=a;b2=b;c2=c-max_distance_below;det=a1*b2-a2*b1;dInv=1.0/det;intercept_2=(b1*c2-b2*c1)*dInv;left_intercept=Math.min(intercept_1,intercept_2);right_intercept=Math.max(intercept_1,intercept_2);error=right_intercept-left_intercept;return(error<flatnessTolerance)?1:0};var _computeXIntercept=function(curve,degree){var XLK=1.0,YLK=0.0,XNM=curve[degree].x-curve[0].x,YNM=curve[degree].y-curve[0].y,XMK=curve[0].x-0.0,YMK=curve[0].y-0.0,det=XNM*YLK-YNM*XLK,detInv=1.0/det,S=(XNM*YMK-YNM*XMK)*detInv;return 0.0+XLK*S};var _bezier=function(curve,degree,t,left,right){var temp=[[]];for(var j=0;j<=degree;j++)temp[0][j]=curve[j];for(var i=1;i<=degree;i++){for(var j=0;j<=degree-i;j++){if(!temp[i])temp[i]=[];if(!temp[i][j])temp[i][j]={};temp[i][j].x=(1.0-t)*temp[i-1][j].x+t*temp[i-1][j+1].x;temp[i][j].y=(1.0-t)*temp[i-1][j].y+t*temp[i-1][j+1].y}}
if(left!=null)
for(j=0;j<=degree;j++)left[j]=temp[j][0];if(right!=null)
for(j=0;j<=degree;j++)right[j]=temp[degree-j][j];return(temp[degree][0])};var _curveFunctionCache={};var _getCurveFunctions=function(order){var fns=_curveFunctionCache[order];if(!fns){fns=[];var f_term=function(){return function(t){return Math.pow(t,order)}},l_term=function(){return function(t){return Math.pow((1-t),order)}},c_term=function(c){return function(t){return c}},t_term=function(){return function(t){return t}},one_minus_t_term=function(){return function(t){return 1-t}},_termFunc=function(terms){return function(t){var p=1;for(var i=0;i<terms.length;i++)p=p*terms[i](t);return p}};fns.push(new f_term());for(var i=1;i<order;i++){var terms=[new c_term(order)];for(var j=0;j<(order-i);j++)terms.push(new t_term());for(var j=0;j<i;j++)terms.push(new one_minus_t_term());fns.push(new _termFunc(terms))}
fns.push(new l_term());_curveFunctionCache[order]=fns}
return fns};var _pointOnPath=function(curve,location){var cc=_getCurveFunctions(curve.length-1),_x=0,_y=0;for(var i=0;i<curve.length;i++){_x=_x+(curve[i].x*cc[i](location));_y=_y+(curve[i].y*cc[i](location))}
return{x:_x,y:_y}};var _dist=function(p1,p2){return Math.sqrt(Math.pow(p1.x-p2.x,2)+Math.pow(p1.y-p2.y,2))};var _isPoint=function(curve){return curve[0].x===curve[1].x&&curve[0].y===curve[1].y};var _pointAlongPath=function(curve,location,distance){if(_isPoint(curve)){return{point:curve[0],location:location}}
var prev=_pointOnPath(curve,location),tally=0,curLoc=location,direction=distance>0?1:-1,cur=null;while(tally<Math.abs(distance)){curLoc+=(0.005*direction);cur=_pointOnPath(curve,curLoc);tally+=_dist(cur,prev);prev=cur}
return{point:cur,location:curLoc}};var _length=function(curve){var d=new Date().getTime();if(_isPoint(curve))return 0;var prev=_pointOnPath(curve,0),tally=0,curLoc=0,direction=1,cur=null;while(curLoc<1){curLoc+=(0.005*direction);cur=_pointOnPath(curve,curLoc);tally+=_dist(cur,prev);prev=cur}
console.log("length",new Date().getTime()-d);return tally};var _pointAlongPathFrom=function(curve,location,distance){return _pointAlongPath(curve,location,distance).point};var _locationAlongPathFrom=function(curve,location,distance){return _pointAlongPath(curve,location,distance).location};var _gradientAtPoint=function(curve,location){var p1=_pointOnPath(curve,location),p2=_pointOnPath(curve.slice(0,curve.length-1),location),dy=p2.y-p1.y,dx=p2.x-p1.x;return dy===0?Infinity:Math.atan(dy/dx)};var _gradientAtPointAlongPathFrom=function(curve,location,distance){var p=_pointAlongPath(curve,location,distance);if(p.location>1)p.location=1;if(p.location<0)p.location=0;return _gradientAtPoint(curve,p.location)};var _perpendicularToPathAt=function(curve,location,length,distance){distance=distance==null?0:distance;var p=_pointAlongPath(curve,location,distance),m=_gradientAtPoint(curve,p.location),_theta2=Math.atan(-1/m),y=length/2*Math.sin(_theta2),x=length/2*Math.cos(_theta2);return[{x:p.point.x+x,y:p.point.y+y},{x:p.point.x-x,y:p.point.y-y}]};var _lineIntersection=function(x1,y1,x2,y2,curve){var a=y2-y1,b=x1-x2,c=(x1*(y1-y2))+(y1*(x2-x1)),coeffs=_computeCoefficients(curve),p=[(a*coeffs[0][0])+(b*coeffs[1][0]),(a*coeffs[0][1])+(b*coeffs[1][1]),(a*coeffs[0][2])+(b*coeffs[1][2]),(a*coeffs[0][3])+(b*coeffs[1][3])+c],r=_cubicRoots.apply(null,p),intersections=[];if(r!=null){for(var i=0;i<3;i++){var t=r[i],t2=Math.pow(t,2),t3=Math.pow(t,3),x=[(coeffs[0][0]*t3)+(coeffs[0][1]*t2)+(coeffs[0][2]*t)+coeffs[0][3],(coeffs[1][0]*t3)+(coeffs[1][1]*t2)+(coeffs[1][2]*t)+coeffs[1][3]];var s;if((x2-x1)!==0){s=(x[0]-x1)/(x2-x1)}else{s=(x[1]-y1)/(y2-y1)}
if(t>=0&&t<=1.0&&s>=0&&s<=1.0){intersections.push(x)}}}
return intersections};var _boxIntersection=function(x,y,w,h,curve){var i=[];i.push.apply(i,_lineIntersection(x,y,x+w,y,curve));i.push.apply(i,_lineIntersection(x+w,y,x+w,y+h,curve));i.push.apply(i,_lineIntersection(x+w,y+h,x,y+h,curve));i.push.apply(i,_lineIntersection(x,y+h,x,y,curve));return i};var _boundingBoxIntersection=function(boundingBox,curve){var i=[];i.push.apply(i,_lineIntersection(boundingBox.x,boundingBox.y,boundingBox.x+boundingBox.w,boundingBox.y,curve));i.push.apply(i,_lineIntersection(boundingBox.x+boundingBox.w,boundingBox.y,boundingBox.x+boundingBox.w,boundingBox.y+boundingBox.h,curve));i.push.apply(i,_lineIntersection(boundingBox.x+boundingBox.w,boundingBox.y+boundingBox.h,boundingBox.x,boundingBox.y+boundingBox.h,curve));i.push.apply(i,_lineIntersection(boundingBox.x,boundingBox.y+boundingBox.h,boundingBox.x,boundingBox.y,curve));return i};function _computeCoefficientsForAxis(curve,axis){return[-(curve[0][axis])+(3*curve[1][axis])+(-3*curve[2][axis])+curve[3][axis],(3*(curve[0][axis]))-(6*(curve[1][axis]))+(3*(curve[2][axis])),-3*curve[0][axis]+3*curve[1][axis],curve[0][axis]]}
function _computeCoefficients(curve){return[_computeCoefficientsForAxis(curve,"x"),_computeCoefficientsForAxis(curve,"y")]}
function sgn(x){return x<0?-1:x>0?1:0}
function _cubicRoots(a,b,c,d){var A=b/a,B=c/a,C=d/a,Q=(3*B-Math.pow(A,2))/9,R=(9*A*B-27*C-2*Math.pow(A,3))/54,D=Math.pow(Q,3)+Math.pow(R,2),S,T,t=[];if(D>=0){S=sgn(R+Math.sqrt(D))*Math.pow(Math.abs(R+Math.sqrt(D)),(1/3));T=sgn(R-Math.sqrt(D))*Math.pow(Math.abs(R-Math.sqrt(D)),(1/3));t[0]=-A/3+(S+T);t[1]=-A/3-(S+T)/2;t[2]=-A/3-(S+T)/2;if(Math.abs(Math.sqrt(3)*(S-T)/2)!==0){t[1]=-1;t[2]=-1}}else{var th=Math.acos(R/Math.sqrt(-Math.pow(Q,3)));t[0]=2*Math.sqrt(-Q)*Math.cos(th/3)-A/3;t[1]=2*Math.sqrt(-Q)*Math.cos((th+2*Math.PI)/3)-A/3;t[2]=2*Math.sqrt(-Q)*Math.cos((th+4*Math.PI)/3)-A/3}
for(var i=0;i<3;i++){if(t[i]<0||t[i]>1.0){t[i]=-1}}
return t}
var jsBezier=this.jsBezier={distanceFromCurve:_distanceFromCurve,gradientAtPoint:_gradientAtPoint,gradientAtPointAlongCurveFrom:_gradientAtPointAlongPathFrom,nearestPointOnCurve:_nearestPointOnCurve,pointOnCurve:_pointOnPath,pointAlongCurveFrom:_pointAlongPathFrom,perpendicularToCurveAt:_perpendicularToPathAt,locationAlongCurveFrom:_locationAlongPathFrom,getLength:_length,lineIntersection:_lineIntersection,boxIntersection:_boxIntersection,boundingBoxIntersection:_boundingBoxIntersection,version:"0.9.0"};if(typeof exports!=="undefined"){exports.jsBezier=jsBezier}}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this;var Biltong=root.Biltong={version:"0.4.0"};if(typeof exports!=="undefined"){exports.Biltong=Biltong}
var _isa=function(a){return Object.prototype.toString.call(a)==="[object Array]"},_pointHelper=function(p1,p2,fn){p1=_isa(p1)?p1:[p1.x,p1.y];p2=_isa(p2)?p2:[p2.x,p2.y];return fn(p1,p2)},_gradient=Biltong.gradient=function(p1,p2){return _pointHelper(p1,p2,function(_p1,_p2){if(_p2[0]==_p1[0])
return _p2[1]>_p1[1]?Infinity:-Infinity;else if(_p2[1]==_p1[1])
return _p2[0]>_p1[0]?0:-0;else return(_p2[1]-_p1[1])/(_p2[0]-_p1[0])})},_normal=Biltong.normal=function(p1,p2){return-1/_gradient(p1,p2)},_lineLength=Biltong.lineLength=function(p1,p2){return _pointHelper(p1,p2,function(_p1,_p2){return Math.sqrt(Math.pow(_p2[1]-_p1[1],2)+Math.pow(_p2[0]-_p1[0],2))})},_quadrant=Biltong.quadrant=function(p1,p2){return _pointHelper(p1,p2,function(_p1,_p2){if(_p2[0]>_p1[0]){return(_p2[1]>_p1[1])?2:1}else if(_p2[0]==_p1[0]){return _p2[1]>_p1[1]?2:1}else{return(_p2[1]>_p1[1])?3:4}})},_theta=Biltong.theta=function(p1,p2){return _pointHelper(p1,p2,function(_p1,_p2){var m=_gradient(_p1,_p2),t=Math.atan(m),s=_quadrant(_p1,_p2);if((s==4||s==3))t+=Math.PI;if(t<0)t+=(2*Math.PI);return t})},_intersects=Biltong.intersects=function(r1,r2){var x1=r1.x,x2=r1.x+r1.w,y1=r1.y,y2=r1.y+r1.h,a1=r2.x,a2=r2.x+r2.w,b1=r2.y,b2=r2.y+r2.h;return((x1<=a1&&a1<=x2)&&(y1<=b1&&b1<=y2))||((x1<=a2&&a2<=x2)&&(y1<=b1&&b1<=y2))||((x1<=a1&&a1<=x2)&&(y1<=b2&&b2<=y2))||((x1<=a2&&a1<=x2)&&(y1<=b2&&b2<=y2))||((a1<=x1&&x1<=a2)&&(b1<=y1&&y1<=b2))||((a1<=x2&&x2<=a2)&&(b1<=y1&&y1<=b2))||((a1<=x1&&x1<=a2)&&(b1<=y2&&y2<=b2))||((a1<=x2&&x1<=a2)&&(b1<=y2&&y2<=b2))},_encloses=Biltong.encloses=function(r1,r2,allowSharedEdges){var x1=r1.x,x2=r1.x+r1.w,y1=r1.y,y2=r1.y+r1.h,a1=r2.x,a2=r2.x+r2.w,b1=r2.y,b2=r2.y+r2.h,c=function(v1,v2,v3,v4){return allowSharedEdges?v1<=v2&&v3>=v4:v1<v2&&v3>v4};return c(x1,a1,x2,a2)&&c(y1,b1,y2,b2)},_segmentMultipliers=[null,[1,-1],[1,1],[-1,1],[-1,-1]],_inverseSegmentMultipliers=[null,[-1,-1],[-1,1],[1,1],[1,-1]],_pointOnLine=Biltong.pointOnLine=function(fromPoint,toPoint,distance){var m=_gradient(fromPoint,toPoint),s=_quadrant(fromPoint,toPoint),segmentMultiplier=distance>0?_segmentMultipliers[s]:_inverseSegmentMultipliers[s],theta=Math.atan(m),y=Math.abs(distance*Math.sin(theta))*segmentMultiplier[1],x=Math.abs(distance*Math.cos(theta))*segmentMultiplier[0];return{x:fromPoint.x+x,y:fromPoint.y+y}},_perpendicularLineTo=Biltong.perpendicularLineTo=function(fromPoint,toPoint,length){var m=_gradient(fromPoint,toPoint),theta2=Math.atan(-1/m),y=length/2*Math.sin(theta2),x=length/2*Math.cos(theta2);return[{x:toPoint.x+x,y:toPoint.y+y},{x:toPoint.x-x,y:toPoint.y-y}]}}).call(typeof window!=='undefined'?window:this);(function(){"use strict";function _touch(view,target,pageX,pageY,screenX,screenY,clientX,clientY){return new Touch({target:target,identifier:_uuid(),pageX:pageX,pageY:pageY,screenX:screenX,screenY:screenY,clientX:clientX||screenX,clientY:clientY||screenY})}
function _touchList(){var list=[];Array.prototype.push.apply(list,arguments);list.item=function(index){return this[index]};return list}
function _touchAndList(view,target,pageX,pageY,screenX,screenY,clientX,clientY){return _touchList(_touch.apply(null,arguments))}
var root=this,matchesSelector=function(el,selector,ctx){ctx=ctx||el.parentNode;var possibles=ctx.querySelectorAll(selector);for(var i=0;i<possibles.length;i++){if(possibles[i]===el){return!0}}
return!1},_gel=function(el){return(typeof el=="string"||el.constructor===String)?document.getElementById(el):el},_t=function(e){return e.srcElement||e.target},_pi=function(e,target,obj,doCompute){if(!doCompute)return{path:[target],end:1};else if(typeof e.path!=="undefined"&&e.path.indexOf){return{path:e.path,end:e.path.indexOf(obj)}}else{var out={path:[],end:-1},_one=function(el){out.path.push(el);if(el===obj){out.end=out.path.length-1}else if(el.parentNode!=null){_one(el.parentNode)}};_one(target);return out}},_d=function(l,fn){for(var i=0,j=l.length;i<j;i++){if(l[i]==fn)break}
if(i<l.length)l.splice(i,1);},guid=1,_store=function(obj,event,fn){var g=guid++;obj.__ta=obj.__ta||{};obj.__ta[event]=obj.__ta[event]||{};obj.__ta[event][g]=fn;fn.__tauid=g;return g},_unstore=function(obj,event,fn){obj.__ta&&obj.__ta[event]&&delete obj.__ta[event][fn.__tauid];if(fn.__taExtra){for(var i=0;i<fn.__taExtra.length;i++){_unbind(obj,fn.__taExtra[i][0],fn.__taExtra[i][1])}
fn.__taExtra.length=0}
fn.__taUnstore&&fn.__taUnstore()},_curryChildFilter=function(children,obj,fn,evt){if(children==null)return fn;else{var c=children.split(","),_fn=function(e){_fn.__tauid=fn.__tauid;var t=_t(e),target=t;var pathInfo=_pi(e,t,obj,children!=null)
if(pathInfo.end!=-1){for(var p=0;p<pathInfo.end;p++){target=pathInfo.path[p];for(var i=0;i<c.length;i++){if(matchesSelector(target,c[i],obj)){fn.apply(target,arguments)}}}}};registerExtraFunction(fn,evt,_fn);return _fn}},registerExtraFunction=function(fn,evt,newFn){fn.__taExtra=fn.__taExtra||[];fn.__taExtra.push([evt,newFn])},DefaultHandler=function(obj,evt,fn,children){if(isTouchDevice&&touchMap[evt]){var tfn=_curryChildFilter(children,obj,fn,touchMap[evt]);_bind(obj,touchMap[evt],tfn,fn)}
if(evt==="focus"&&obj.getAttribute("tabindex")==null){obj.setAttribute("tabindex","1")}
_bind(obj,evt,_curryChildFilter(children,obj,fn,evt),fn)},SmartClickHandler=function(obj,evt,fn,children){if(obj.__taSmartClicks==null){var down=function(e){obj.__tad=_pageLocation(e)},up=function(e){obj.__tau=_pageLocation(e)},click=function(e){if(obj.__tad&&obj.__tau&&obj.__tad[0]===obj.__tau[0]&&obj.__tad[1]===obj.__tau[1]){for(var i=0;i<obj.__taSmartClicks.length;i++)
obj.__taSmartClicks[i].apply(_t(e),[e]);}};DefaultHandler(obj,"mousedown",down,children);DefaultHandler(obj,"mouseup",up,children);DefaultHandler(obj,"click",click,children);obj.__taSmartClicks=[]}
obj.__taSmartClicks.push(fn);fn.__taUnstore=function(){_d(obj.__taSmartClicks,fn)}},_tapProfiles={"tap":{touches:1,taps:1},"dbltap":{touches:1,taps:2},"contextmenu":{touches:2,taps:1}},TapHandler=function(clickThreshold,dblClickThreshold){return function(obj,evt,fn,children){if(evt=="contextmenu"&&isMouseDevice)
DefaultHandler(obj,evt,fn,children);else{if(obj.__taTapHandler==null){var tt=obj.__taTapHandler={tap:[],dbltap:[],contextmenu:[],down:!1,taps:0,downSelectors:[]};var down=function(e){var target=_t(e),pathInfo=_pi(e,target,obj,children!=null),finished=!1;for(var p=0;p<pathInfo.end;p++){if(finished)return;target=pathInfo.path[p];for(var i=0;i<tt.downSelectors.length;i++){if(tt.downSelectors[i]==null||matchesSelector(target,tt.downSelectors[i],obj)){tt.down=!0;setTimeout(clearSingle,clickThreshold);setTimeout(clearDouble,dblClickThreshold);finished=!0;break}}}},up=function(e){if(tt.down){var target=_t(e),currentTarget,pathInfo;tt.taps++;var tc=_touchCount(e);for(var eventId in _tapProfiles){if(_tapProfiles.hasOwnProperty(eventId)){var p=_tapProfiles[eventId];if(p.touches===tc&&(p.taps===1||p.taps===tt.taps)){for(var i=0;i<tt[eventId].length;i++){pathInfo=_pi(e,target,obj,tt[eventId][i][1]!=null);for(var pLoop=0;pLoop<pathInfo.end;pLoop++){currentTarget=pathInfo.path[pLoop];if(tt[eventId][i][1]==null||matchesSelector(currentTarget,tt[eventId][i][1],obj)){tt[eventId][i][0].apply(currentTarget,[e]);break}}}}}}}},clearSingle=function(){tt.down=!1},clearDouble=function(){tt.taps=0};DefaultHandler(obj,"mousedown",down);DefaultHandler(obj,"mouseup",up)}
obj.__taTapHandler.downSelectors.push(children);obj.__taTapHandler[evt].push([fn,children]);fn.__taUnstore=function(){_d(obj.__taTapHandler[evt],fn)}}}},meeHelper=function(type,evt,obj,target){for(var i in obj.__tamee[type]){if(obj.__tamee[type].hasOwnProperty(i)){obj.__tamee[type][i].apply(target,[evt])}}},MouseEnterExitHandler=function(){var activeElements=[];return function(obj,evt,fn,children){if(!obj.__tamee){obj.__tamee={over:!1,mouseenter:[],mouseexit:[]};var over=function(e){var t=_t(e);if((children==null&&(t==obj&&!obj.__tamee.over))||(matchesSelector(t,children,obj)&&(t.__tamee==null||!t.__tamee.over))){meeHelper("mouseenter",e,obj,t);t.__tamee=t.__tamee||{};t.__tamee.over=!0;activeElements.push(t)}},out=function(e){var t=_t(e);for(var i=0;i<activeElements.length;i++){if(t==activeElements[i]&&!matchesSelector((e.relatedTarget||e.toElement),"*",t)){t.__tamee.over=!1;activeElements.splice(i,1);meeHelper("mouseexit",e,obj,t)}}};_bind(obj,"mouseover",_curryChildFilter(children,obj,over,"mouseover"),over);_bind(obj,"mouseout",_curryChildFilter(children,obj,out,"mouseout"),out)}
fn.__taUnstore=function(){delete obj.__tamee[evt][fn.__tauid]};_store(obj,evt,fn);obj.__tamee[evt][fn.__tauid]=fn}},isTouchDevice="ontouchstart" in document.documentElement||navigator.maxTouchPoints,isMouseDevice="onmousedown" in document.documentElement,touchMap={"mousedown":"touchstart","mouseup":"touchend","mousemove":"touchmove"},touchstart="touchstart",touchend="touchend",touchmove="touchmove",iev=(function(){var rv=-1;if(navigator.appName=='Microsoft Internet Explorer'){var ua=navigator.userAgent,re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null)
rv=parseFloat(RegExp.$1);}
return rv})(),isIELT9=iev>-1&&iev<9,_genLoc=function(e,prefix){if(e==null)return[0,0];var ts=_touches(e),t=_getTouch(ts,0);return[t[prefix+"X"],t[prefix+"Y"]]},_pageLocation=function(e){if(e==null)return[0,0];if(isIELT9){return[e.clientX+document.documentElement.scrollLeft,e.clientY+document.documentElement.scrollTop]}else{return _genLoc(e,"page")}},_screenLocation=function(e){return _genLoc(e,"screen")},_clientLocation=function(e){return _genLoc(e,"client")},_getTouch=function(touches,idx){return touches.item?touches.item(idx):touches[idx]},_touches=function(e){return e.touches&&e.touches.length>0?e.touches:e.changedTouches&&e.changedTouches.length>0?e.changedTouches:e.targetTouches&&e.targetTouches.length>0?e.targetTouches:[e]},_touchCount=function(e){return _touches(e).length},_bind=function(obj,type,fn,originalFn){_store(obj,type,fn);originalFn.__tauid=fn.__tauid;if(obj.addEventListener)
obj.addEventListener(type,fn,!1);else if(obj.attachEvent){var key=type+fn.__tauid;obj["e"+key]=fn;obj[key]=function(){obj["e"+key]&&obj["e"+key](window.event)};obj.attachEvent("on"+type,obj[key])}},_unbind=function(obj,type,fn){if(fn==null)return;_each(obj,function(){var _el=_gel(this);_unstore(_el,type,fn);if(fn.__tauid!=null){if(_el.removeEventListener){_el.removeEventListener(type,fn,!1);if(isTouchDevice&&touchMap[type])_el.removeEventListener(touchMap[type],fn,!1);}else if(this.detachEvent){var key=type+fn.__tauid;_el[key]&&_el.detachEvent("on"+type,_el[key]);_el[key]=null;_el["e"+key]=null}}
if(fn.__taTouchProxy){_unbind(obj,fn.__taTouchProxy[1],fn.__taTouchProxy[0])}})},_each=function(obj,fn){if(obj==null)return;obj=(typeof Window!=="undefined"&&(typeof obj.top!=="unknown"&&obj==obj.top))?[obj]:(typeof obj!=="string")&&(obj.tagName==null&&obj.length!=null)?obj:typeof obj==="string"?document.querySelectorAll(obj):[obj];for(var i=0;i<obj.length;i++)
fn.apply(obj[i]);},_uuid=function(){return('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c=='x'?r:(r&0x3|0x8);return v.toString(16)}))};root.Mottle=function(params){params=params||{};var clickThreshold=params.clickThreshold||250,dblClickThreshold=params.dblClickThreshold||450,mouseEnterExitHandler=new MouseEnterExitHandler(),tapHandler=new TapHandler(clickThreshold,dblClickThreshold),_smartClicks=params.smartClicks,_doBind=function(obj,evt,fn,children){if(fn==null)return;_each(obj,function(){var _el=_gel(this);if(_smartClicks&&evt==="click")
SmartClickHandler(_el,evt,fn,children);else if(evt==="tap"||evt==="dbltap"||evt==="contextmenu"){tapHandler(_el,evt,fn,children)}else if(evt==="mouseenter"||evt=="mouseexit")
mouseEnterExitHandler(_el,evt,fn,children);else DefaultHandler(_el,evt,fn,children)})};this.remove=function(el){_each(el,function(){var _el=_gel(this);if(_el.__ta){for(var evt in _el.__ta){if(_el.__ta.hasOwnProperty(evt)){for(var h in _el.__ta[evt]){if(_el.__ta[evt].hasOwnProperty(h))
_unbind(_el,evt,_el.__ta[evt][h]);}}}}
_el.parentNode&&_el.parentNode.removeChild(_el)});return this};this.on=function(el,event,children,fn){var _el=arguments[0],_c=arguments.length==4?arguments[2]:null,_e=arguments[1],_f=arguments[arguments.length-1];_doBind(_el,_e,_f,_c);return this};this.off=function(el,event,fn){_unbind(el,event,fn);return this};this.trigger=function(el,event,originalEvent,payload){var originalIsMouse=isMouseDevice&&(typeof MouseEvent==="undefined"||originalEvent==null||originalEvent.constructor===MouseEvent);var eventToBind=(isTouchDevice&&!isMouseDevice&&touchMap[event])?touchMap[event]:event,bindingAMouseEvent=!(isTouchDevice&&!isMouseDevice&&touchMap[event]);var pl=_pageLocation(originalEvent),sl=_screenLocation(originalEvent),cl=_clientLocation(originalEvent);_each(el,function(){var _el=_gel(this),evt;originalEvent=originalEvent||{screenX:sl[0],screenY:sl[1],clientX:cl[0],clientY:cl[1]};var _decorate=function(_evt){if(payload)_evt.payload=payload};var eventGenerators={"TouchEvent":function(evt){var touchList=_touchAndList(window,_el,0,pl[0],pl[1],sl[0],sl[1],cl[0],cl[1]),init=evt.initTouchEvent||evt.initEvent;init(eventToBind,!0,!0,window,null,sl[0],sl[1],cl[0],cl[1],!1,!1,!1,!1,touchList,touchList,touchList,1,0)},"MouseEvents":function(evt){evt.initMouseEvent(eventToBind,!0,!0,window,0,sl[0],sl[1],cl[0],cl[1],!1,!1,!1,!1,1,_el)}};if(document.createEvent){var ite=!bindingAMouseEvent&&!originalIsMouse&&(isTouchDevice&&touchMap[event]),evtName=ite?"TouchEvent":"MouseEvents";evt=document.createEvent(evtName);eventGenerators[evtName](evt);_decorate(evt);_el.dispatchEvent(evt)}else if(document.createEventObject){evt=document.createEventObject();evt.eventType=evt.eventName=eventToBind;evt.screenX=sl[0];evt.screenY=sl[1];evt.clientX=cl[0];evt.clientY=cl[1];_decorate(evt);_el.fireEvent('on'+eventToBind,evt)}});return this}};root.Mottle.consume=function(e,doNotPreventDefault){if(e.stopPropagation)
e.stopPropagation();else e.returnValue=!1;if(!doNotPreventDefault&&e.preventDefault)
e.preventDefault();};root.Mottle.pageLocation=_pageLocation;root.Mottle.setForceTouchEvents=function(value){isTouchDevice=value};root.Mottle.setForceMouseEvents=function(value){isMouseDevice=value};root.Mottle.version="0.8.0";if(typeof exports!=="undefined"){exports.Mottle=root.Mottle}}).call(typeof window==="undefined"?this:window);(function(){"use strict";var root=this;var _suggest=function(list,item,head){if(list.indexOf(item)===-1){head?list.unshift(item):list.push(item);return!0}
return!1};var _vanquish=function(list,item){var idx=list.indexOf(item);if(idx!==-1)list.splice(idx,1);};var _difference=function(l1,l2){var d=[];for(var i=0;i<l1.length;i++){if(l2.indexOf(l1[i])===-1)
d.push(l1[i]);}
return d};var _isString=function(f){return f==null?!1:(typeof f==="string"||f.constructor===String)};var getOffsetRect=function(elem){var box=elem.getBoundingClientRect(),body=document.body,docElem=document.documentElement,scrollTop=window.pageYOffset||docElem.scrollTop||body.scrollTop,scrollLeft=window.pageXOffset||docElem.scrollLeft||body.scrollLeft,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+scrollTop-clientTop,left=box.left+scrollLeft-clientLeft;return{top:Math.round(top),left:Math.round(left)}};var matchesSelector=function(el,selector,ctx){ctx=ctx||el.parentNode;var possibles=ctx.querySelectorAll(selector);for(var i=0;i<possibles.length;i++){if(possibles[i]===el)
return!0}
return!1};var findDelegateElement=function(parentElement,childElement,selector){if(matchesSelector(childElement,selector,parentElement)){return childElement}else{var currentParent=childElement.parentNode;while(currentParent!=null&&currentParent!==parentElement){if(matchesSelector(currentParent,selector,parentElement)){return currentParent}else{currentParent=currentParent.parentNode}}}};var findMatchingSelector=function(availableSelectors,parentElement,childElement){var el=null;var draggableId=parentElement.getAttribute("katavorio-draggable"),prefix=draggableId!=null?"[katavorio-draggable='"+draggableId+"'] ":"";for(var i=0;i<availableSelectors.length;i++){el=findDelegateElement(parentElement,childElement,prefix+availableSelectors[i].selector);if(el!=null){if(availableSelectors[i].filter){var matches=matchesSelector(childElement,availableSelectors[i].filter,el),exclude=availableSelectors[i].filterExclude===!0;if((exclude&&!matches)||matches){return null}}
return[availableSelectors[i],el]}}
return null};var iev=(function(){var rv=-1;if(navigator.appName==='Microsoft Internet Explorer'){var ua=navigator.userAgent,re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null)
rv=parseFloat(RegExp.$1);}
return rv})(),DEFAULT_GRID_X=10,DEFAULT_GRID_Y=10,isIELT9=iev>-1&&iev<9,isIE9=iev===9,_pl=function(e){if(isIELT9){return[e.clientX+document.documentElement.scrollLeft,e.clientY+document.documentElement.scrollTop]}else{var ts=_touches(e),t=_getTouch(ts,0);return isIE9?[t.pageX||t.clientX,t.pageY||t.clientY]:[t.pageX,t.pageY]}},_getTouch=function(touches,idx){return touches.item?touches.item(idx):touches[idx]},_touches=function(e){return e.touches&&e.touches.length>0?e.touches:e.changedTouches&&e.changedTouches.length>0?e.changedTouches:e.targetTouches&&e.targetTouches.length>0?e.targetTouches:[e]},_classes={delegatedDraggable:"katavorio-delegated-draggable",draggable:"katavorio-draggable",droppable:"katavorio-droppable",drag:"katavorio-drag",selected:"katavorio-drag-selected",active:"katavorio-drag-active",hover:"katavorio-drag-hover",noSelect:"katavorio-drag-no-select",ghostProxy:"katavorio-ghost-proxy",clonedDrag:"katavorio-clone-drag"},_defaultScope="katavorio-drag-scope",_events=["stop","start","drag","drop","over","out","beforeStart"],_devNull=function(){},_true=function(){return!0},_foreach=function(l,fn,from){for(var i=0;i<l.length;i++){if(l[i]!=from)
fn(l[i]);}},_setDroppablesActive=function(dd,val,andHover,drag){_foreach(dd,function(e){e.setActive(val);if(val)e.updatePosition();if(andHover)e.setHover(drag,val);})},_each=function(obj,fn){if(obj==null)return;obj=!_isString(obj)&&(obj.tagName==null&&obj.length!=null)?obj:[obj];for(var i=0;i<obj.length;i++)
fn.apply(obj[i],[obj[i]]);},_consume=function(e){if(e.stopPropagation){e.stopPropagation();e.preventDefault()}else{e.returnValue=!1}},_defaultInputFilterSelector="input,textarea,select,button,option",_inputFilter=function(e,el,_katavorio){var t=e.srcElement||e.target;return!matchesSelector(t,_katavorio.getInputFilterSelector(),el)};var Super=function(el,params,css,scope){this.params=params||{};this.el=el;this.params.addClass(this.el,this._class);this.uuid=_uuid();var enabled=!0;this.setEnabled=function(e){enabled=e};this.isEnabled=function(){return enabled};this.toggleEnabled=function(){enabled=!enabled};this.setScope=function(scopes){this.scopes=scopes?scopes.split(/\s+/):[scope]};this.addScope=function(scopes){var m={};_each(this.scopes,function(s){m[s]=!0});_each(scopes?scopes.split(/\s+/):[],function(s){m[s]=!0});this.scopes=[];for(var i in m)this.scopes.push(i);};this.removeScope=function(scopes){var m={};_each(this.scopes,function(s){m[s]=!0});_each(scopes?scopes.split(/\s+/):[],function(s){delete m[s]});this.scopes=[];for(var i in m)this.scopes.push(i);};this.toggleScope=function(scopes){var m={};_each(this.scopes,function(s){m[s]=!0});_each(scopes?scopes.split(/\s+/):[],function(s){if(m[s])delete m[s];else m[s]=!0});this.scopes=[];for(var i in m)this.scopes.push(i);};this.setScope(params.scope);this.k=params.katavorio;return params.katavorio};var TRUE=function(){return!0};var FALSE=function(){return!1};var Drag=function(el,params,css,scope){this._class=css.draggable;var k=Super.apply(this,arguments);this.rightButtonCanDrag=this.params.rightButtonCanDrag;var downAt=[0,0],posAtDown=null,pagePosAtDown=null,pageDelta=[0,0],moving=!1,initialScroll=[0,0],consumeStartEvent=this.params.consumeStartEvent!==!1,dragEl=this.el,clone=this.params.clone,scroll=this.params.scroll,_multipleDrop=params.multipleDrop!==!1,isConstrained=!1,useGhostProxy,ghostProxy,elementToDrag=null,availableSelectors=[],activeSelectorParams=null,ghostProxyParent=params.ghostProxyParent,currentParentPosition,ghostParentPosition,ghostDx,ghostDy;if(params.ghostProxy===!0){useGhostProxy=TRUE}else{if(params.ghostProxy&&typeof params.ghostProxy==="function"){useGhostProxy=params.ghostProxy}else{useGhostProxy=function(container,dragEl){if(activeSelectorParams&&activeSelectorParams.useGhostProxy){return activeSelectorParams.useGhostProxy(container,dragEl)}else{return!1}}}}
if(params.makeGhostProxy){ghostProxy=params.makeGhostProxy}else{ghostProxy=function(el){if(activeSelectorParams&&activeSelectorParams.makeGhostProxy){return activeSelectorParams.makeGhostProxy(el)}else{return el.cloneNode(!0)}}}
if(params.selector){var draggableId=el.getAttribute("katavorio-draggable");if(draggableId==null){draggableId=""+new Date().getTime();el.setAttribute("katavorio-draggable",draggableId)}
availableSelectors.push(params)}
var snapThreshold=params.snapThreshold,_snap=function(pos,gridX,gridY,thresholdX,thresholdY){var _dx=Math.floor(pos[0]/gridX),_dxl=gridX*_dx,_dxt=_dxl+gridX,_x=Math.abs(pos[0]-_dxl)<=thresholdX?_dxl:Math.abs(_dxt-pos[0])<=thresholdX?_dxt:pos[0];var _dy=Math.floor(pos[1]/gridY),_dyl=gridY*_dy,_dyt=_dyl+gridY,_y=Math.abs(pos[1]-_dyl)<=thresholdY?_dyl:Math.abs(_dyt-pos[1])<=thresholdY?_dyt:pos[1];return[_x,_y]};this.posses=[];this.posseRoles={};this.toGrid=function(pos){if(this.params.grid==null){return pos}else{var tx=this.params.grid?this.params.grid[0]/2:snapThreshold?snapThreshold:DEFAULT_GRID_X/2,ty=this.params.grid?this.params.grid[1]/2:snapThreshold?snapThreshold:DEFAULT_GRID_Y/2;return _snap(pos,this.params.grid[0],this.params.grid[1],tx,ty)}};this.snap=function(x,y){if(dragEl==null)return;x=x||(this.params.grid?this.params.grid[0]:DEFAULT_GRID_X);y=y||(this.params.grid?this.params.grid[1]:DEFAULT_GRID_Y);var p=this.params.getPosition(dragEl),tx=this.params.grid?this.params.grid[0]/2:snapThreshold,ty=this.params.grid?this.params.grid[1]/2:snapThreshold,snapped=_snap(p,x,y,tx,ty);this.params.setPosition(dragEl,snapped);return snapped};this.setUseGhostProxy=function(val){useGhostProxy=val?TRUE:FALSE};var constrain;var negativeFilter=function(pos){return(params.allowNegative===!1)?[Math.max(0,pos[0]),Math.max(0,pos[1])]:pos};var _setConstrain=function(value){constrain=typeof value==="function"?value:value?function(pos,dragEl,_constrainRect,_size){return negativeFilter([Math.max(0,Math.min(_constrainRect.w-_size[0],pos[0])),Math.max(0,Math.min(_constrainRect.h-_size[1],pos[1]))])}.bind(this):function(pos){return negativeFilter(pos)}}.bind(this);_setConstrain(typeof this.params.constrain==="function"?this.params.constrain:(this.params.constrain||this.params.containment));this.setConstrain=function(value){_setConstrain(value)};var _doConstrain=function(pos,dragEl,_constrainRect,_size){if(activeSelectorParams!=null&&activeSelectorParams.constrain&&typeof activeSelectorParams.constrain==="function"){return activeSelectorParams.constrain(pos,dragEl,_constrainRect,_size)}else{return constrain(pos,dragEl,_constrainRect,_size)}};var revertFunction;this.setRevert=function(fn){revertFunction=fn};if(this.params.revert){revertFunction=this.params.revert}
var _assignId=function(obj){if(typeof obj==="function"){obj._katavorioId=_uuid();return obj._katavorioId}else{return obj}},_filters={},_testFilter=function(e){for(var key in _filters){var f=_filters[key];var rv=f[0](e);if(f[1])rv=!rv;if(!rv)return!1}
return!0},_setFilter=this.setFilter=function(f,_exclude){if(f){var key=_assignId(f);_filters[key]=[function(e){var t=e.srcElement||e.target,m;if(_isString(f)){m=matchesSelector(t,f,el)}else if(typeof f==="function"){m=f(e,el)}
return m},_exclude!==!1]}},_addFilter=this.addFilter=_setFilter,_removeFilter=this.removeFilter=function(f){var key=typeof f==="function"?f._katavorioId:f;delete _filters[key]};this.clearAllFilters=function(){_filters={}};this.canDrag=this.params.canDrag||_true;var constrainRect,matchingDroppables=[],intersectingDroppables=[];this.addSelector=function(params){if(params.selector){availableSelectors.push(params)}};this.downListener=function(e){if(e.defaultPrevented){return}
var isNotRightClick=this.rightButtonCanDrag||(e.which!==3&&e.button!==2);if(isNotRightClick&&this.isEnabled()&&this.canDrag()){var _f=_testFilter(e)&&_inputFilter(e,this.el,this.k);if(_f){activeSelectorParams=null;elementToDrag=null;if(availableSelectors.length>0){var match=findMatchingSelector(availableSelectors,this.el,e.target||e.srcElement);if(match!=null){activeSelectorParams=match[0];elementToDrag=match[1]}
if(elementToDrag==null){return}}else{elementToDrag=this.el}
if(clone){dragEl=elementToDrag.cloneNode(!0);this.params.addClass(dragEl,_classes.clonedDrag);dragEl.setAttribute("id",null);dragEl.style.position="absolute";if(this.params.parent!=null){var p=this.params.getPosition(this.el);dragEl.style.left=p[0]+"px";dragEl.style.top=p[1]+"px";this.params.parent.appendChild(dragEl)}else{var b=getOffsetRect(elementToDrag);dragEl.style.left=b.left+"px";dragEl.style.top=b.top+"px";document.body.appendChild(dragEl)}}else{dragEl=elementToDrag}
consumeStartEvent&&_consume(e);downAt=_pl(e);if(dragEl&&dragEl.parentNode){initialScroll=[dragEl.parentNode.scrollLeft,dragEl.parentNode.scrollTop]}
this.params.bind(document,"mousemove",this.moveListener);this.params.bind(document,"mouseup",this.upListener);k.markSelection(this);k.markPosses(this);this.params.addClass(document.body,css.noSelect);_dispatch("beforeStart",{el:this.el,pos:posAtDown,e:e,drag:this})}else if(this.params.consumeFilteredEvents){_consume(e)}}}.bind(this);this.moveListener=function(e){if(downAt){if(!moving){var _continue=_dispatch("start",{el:this.el,pos:posAtDown,e:e,drag:this});if(_continue!==!1){if(!downAt){return}
this.mark(!0);moving=!0}else{this.abort()}}
if(downAt){intersectingDroppables.length=0;var pos=_pl(e),dx=pos[0]-downAt[0],dy=pos[1]-downAt[1],z=this.params.ignoreZoom?1:k.getZoom();if(dragEl&&dragEl.parentNode){dx+=dragEl.parentNode.scrollLeft-initialScroll[0];dy+=dragEl.parentNode.scrollTop-initialScroll[1]}
dx/=z;dy/=z;this.moveBy(dx,dy,e);k.updateSelection(dx,dy,this);k.updatePosses(dx,dy,this)}}}.bind(this);this.upListener=function(e){if(downAt){downAt=null;this.params.unbind(document,"mousemove",this.moveListener);this.params.unbind(document,"mouseup",this.upListener);this.params.removeClass(document.body,css.noSelect);this.unmark(e);k.unmarkSelection(this,e);k.unmarkPosses(this,e);this.stop(e);k.notifyPosseDragStop(this,e);moving=!1;intersectingDroppables.length=0;if(clone){dragEl&&dragEl.parentNode&&dragEl.parentNode.removeChild(dragEl);dragEl=null}else{if(revertFunction&&revertFunction(dragEl,this.params.getPosition(dragEl))===!0){this.params.setPosition(dragEl,posAtDown);_dispatch("revert",dragEl)}}}}.bind(this);this.getFilters=function(){return _filters};this.abort=function(){if(downAt!=null){this.upListener()}};this.getDragElement=function(retrieveOriginalElement){return retrieveOriginalElement?elementToDrag||this.el:dragEl||this.el};var listeners={"start":[],"drag":[],"stop":[],"over":[],"out":[],"beforeStart":[],"revert":[]};if(params.events.start)listeners.start.push(params.events.start);if(params.events.beforeStart)listeners.beforeStart.push(params.events.beforeStart);if(params.events.stop)listeners.stop.push(params.events.stop);if(params.events.drag)listeners.drag.push(params.events.drag);if(params.events.revert)listeners.revert.push(params.events.revert);this.on=function(evt,fn){if(listeners[evt])listeners[evt].push(fn);};this.off=function(evt,fn){if(listeners[evt]){var l=[];for(var i=0;i<listeners[evt].length;i++){if(listeners[evt][i]!==fn)l.push(listeners[evt][i]);}
listeners[evt]=l}};var _dispatch=function(evt,value){var result=null;if(activeSelectorParams&&activeSelectorParams[evt]){result=activeSelectorParams[evt](value)}else if(listeners[evt]){for(var i=0;i<listeners[evt].length;i++){try{var v=listeners[evt][i](value);if(v!=null){result=v}}catch(e){}}}
return result};this.notifyStart=function(e){_dispatch("start",{el:this.el,pos:this.params.getPosition(dragEl),e:e,drag:this})};this.stop=function(e,force){if(force||moving){var positions=[],sel=k.getSelection(),dPos=this.params.getPosition(dragEl);if(sel.length>0){for(var i=0;i<sel.length;i++){var p=this.params.getPosition(sel[i].el);positions.push([sel[i].el,{left:p[0],top:p[1]},sel[i]])}}else{positions.push([dragEl,{left:dPos[0],top:dPos[1]},this])}
_dispatch("stop",{el:dragEl,pos:ghostProxyOffsets||dPos,finalPos:dPos,e:e,drag:this,selection:positions})}};this.mark=function(andNotify){posAtDown=this.params.getPosition(dragEl);pagePosAtDown=this.params.getPosition(dragEl,!0);pageDelta=[pagePosAtDown[0]-posAtDown[0],pagePosAtDown[1]-posAtDown[1]];this.size=this.params.getSize(dragEl);matchingDroppables=k.getMatchingDroppables(this);_setDroppablesActive(matchingDroppables,!0,!1,this);this.params.addClass(dragEl,this.params.dragClass||css.drag);var cs;if(this.params.getConstrainingRectangle){cs=this.params.getConstrainingRectangle(dragEl)}else{cs=this.params.getSize(dragEl.parentNode)}
constrainRect={w:cs[0],h:cs[1]};ghostDx=0;ghostDy=0;if(andNotify){k.notifySelectionDragStart(this)}};var ghostProxyOffsets;this.unmark=function(e,doNotCheckDroppables){_setDroppablesActive(matchingDroppables,!1,!0,this);if(isConstrained&&useGhostProxy(elementToDrag,dragEl)){ghostProxyOffsets=[dragEl.offsetLeft-ghostDx,dragEl.offsetTop-ghostDy];dragEl.parentNode.removeChild(dragEl);dragEl=elementToDrag}else{ghostProxyOffsets=null}
this.params.removeClass(dragEl,this.params.dragClass||css.drag);matchingDroppables.length=0;isConstrained=!1;if(!doNotCheckDroppables){if(intersectingDroppables.length>0&&ghostProxyOffsets){params.setPosition(elementToDrag,ghostProxyOffsets)}
intersectingDroppables.sort(_rankSort);for(var i=0;i<intersectingDroppables.length;i++){var retVal=intersectingDroppables[i].drop(this,e);if(retVal===!0)break}}};this.moveBy=function(dx,dy,e){intersectingDroppables.length=0;var desiredLoc=this.toGrid([posAtDown[0]+dx,posAtDown[1]+dy]),cPos=_doConstrain(desiredLoc,dragEl,constrainRect,this.size);if(useGhostProxy(this.el,dragEl)){if(desiredLoc[0]!==cPos[0]||desiredLoc[1]!==cPos[1]){if(!isConstrained){var gp=ghostProxy(elementToDrag);params.addClass(gp,_classes.ghostProxy);if(ghostProxyParent){ghostProxyParent.appendChild(gp);currentParentPosition=params.getPosition(elementToDrag.parentNode,!0);ghostParentPosition=params.getPosition(params.ghostProxyParent,!0);ghostDx=currentParentPosition[0]-ghostParentPosition[0];ghostDy=currentParentPosition[1]-ghostParentPosition[1]}else{elementToDrag.parentNode.appendChild(gp)}
dragEl=gp;isConstrained=!0}
cPos=desiredLoc}else{if(isConstrained){dragEl.parentNode.removeChild(dragEl);dragEl=elementToDrag;isConstrained=!1;currentParentPosition=null;ghostParentPosition=null;ghostDx=0;ghostDy=0}}}
var rect={x:cPos[0],y:cPos[1],w:this.size[0],h:this.size[1]},pageRect={x:rect.x+pageDelta[0],y:rect.y+pageDelta[1],w:rect.w,h:rect.h},focusDropElement=null;this.params.setPosition(dragEl,[cPos[0]+ghostDx,cPos[1]+ghostDy]);for(var i=0;i<matchingDroppables.length;i++){var r2={x:matchingDroppables[i].pagePosition[0],y:matchingDroppables[i].pagePosition[1],w:matchingDroppables[i].size[0],h:matchingDroppables[i].size[1]};if(this.params.intersects(pageRect,r2)&&(_multipleDrop||focusDropElement==null||focusDropElement===matchingDroppables[i].el)&&matchingDroppables[i].canDrop(this)){if(!focusDropElement)focusDropElement=matchingDroppables[i].el;intersectingDroppables.push(matchingDroppables[i]);matchingDroppables[i].setHover(this,!0,e)}else if(matchingDroppables[i].isHover()){matchingDroppables[i].setHover(this,!1,e)}}
_dispatch("drag",{el:this.el,pos:cPos,e:e,drag:this})};this.destroy=function(){this.params.unbind(this.el,"mousedown",this.downListener);this.params.unbind(document,"mousemove",this.moveListener);this.params.unbind(document,"mouseup",this.upListener);this.downListener=null;this.upListener=null;this.moveListener=null};this.params.bind(this.el,"mousedown",this.downListener);if(this.params.handle)
_setFilter(this.params.handle,!1);else _setFilter(this.params.filter,this.params.filterExclude)};var Drop=function(el,params,css,scope){this._class=css.droppable;this.params=params||{};this.rank=params.rank||0;this._activeClass=this.params.activeClass||css.active;this._hoverClass=this.params.hoverClass||css.hover;Super.apply(this,arguments);var hover=!1;this.allowLoopback=this.params.allowLoopback!==!1;this.setActive=function(val){this.params[val?"addClass":"removeClass"](this.el,this._activeClass)};this.updatePosition=function(){this.position=this.params.getPosition(this.el);this.pagePosition=this.params.getPosition(this.el,!0);this.size=this.params.getSize(this.el)};this.canDrop=this.params.canDrop||function(drag){return!0};this.isHover=function(){return hover};this.setHover=function(drag,val,e){if(val||this.el._katavorioDragHover==null||this.el._katavorioDragHover===drag.el._katavorio){this.params[val?"addClass":"removeClass"](this.el,this._hoverClass);this.el._katavorioDragHover=val?drag.el._katavorio:null;if(hover!==val){this.params.events[val?"over":"out"]({el:this.el,e:e,drag:drag,drop:this})}
hover=val}};this.drop=function(drag,event){return this.params.events.drop({drag:drag,e:event,drop:this})};this.destroy=function(){this._class=null;this._activeClass=null;this._hoverClass=null;hover=null}};var _uuid=function(){return('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c==='x'?r:(r&0x3|0x8);return v.toString(16)}))};var _rankSort=function(a,b){return a.rank<b.rank?1:a.rank>b.rank?-1:0};var _gel=function(el){if(el==null)return null;el=(typeof el==="string"||el.constructor===String)?document.getElementById(el):el;if(el==null)return null;el._katavorio=el._katavorio||_uuid();return el};root.Katavorio=function(katavorioParams){var _selection=[],_selectionMap={};this._dragsByScope={};this._dropsByScope={};var _zoom=1,_reg=function(obj,map){_each(obj,function(_obj){for(var i=0;i<_obj.scopes.length;i++){map[_obj.scopes[i]]=map[_obj.scopes[i]]||[];map[_obj.scopes[i]].push(_obj)}})},_unreg=function(obj,map){var c=0;_each(obj,function(_obj){for(var i=0;i<_obj.scopes.length;i++){if(map[_obj.scopes[i]]){var idx=katavorioParams.indexOf(map[_obj.scopes[i]],_obj);if(idx!==-1){map[_obj.scopes[i]].splice(idx,1);c++}}}});return c>0},_getMatchingDroppables=this.getMatchingDroppables=function(drag){var dd=[],_m={};for(var i=0;i<drag.scopes.length;i++){var _dd=this._dropsByScope[drag.scopes[i]];if(_dd){for(var j=0;j<_dd.length;j++){if(_dd[j].canDrop(drag)&&!_m[_dd[j].uuid]&&(_dd[j].allowLoopback||_dd[j].el!==drag.el)){_m[_dd[j].uuid]=!0;dd.push(_dd[j])}}}}
dd.sort(_rankSort);return dd},_prepareParams=function(p){p=p||{};var _p={events:{}},i;for(i in katavorioParams)_p[i]=katavorioParams[i];for(i in p)_p[i]=p[i];for(i=0;i<_events.length;i++){_p.events[_events[i]]=p[_events[i]]||_devNull}
_p.katavorio=this;return _p}.bind(this),_mistletoe=function(existingDrag,params){for(var i=0;i<_events.length;i++){if(params[_events[i]]){existingDrag.on(_events[i],params[_events[i]])}}}.bind(this),_css={},overrideCss=katavorioParams.css||{},_scope=katavorioParams.scope||_defaultScope;for(var i in _classes)_css[i]=_classes[i];for(var i in overrideCss)_css[i]=overrideCss[i];var inputFilterSelector=katavorioParams.inputFilterSelector||_defaultInputFilterSelector;this.getInputFilterSelector=function(){return inputFilterSelector};this.setInputFilterSelector=function(selector){inputFilterSelector=selector;return this};this.draggable=function(el,params){var o=[];_each(el,function(_el){_el=_gel(_el);if(_el!=null){if(_el._katavorioDrag==null){var p=_prepareParams(params);_el._katavorioDrag=new Drag(_el,p,_css,_scope);_reg(_el._katavorioDrag,this._dragsByScope);o.push(_el._katavorioDrag);katavorioParams.addClass(_el,p.selector?_css.delegatedDraggable:_css.draggable)}else{_mistletoe(_el._katavorioDrag,params)}}}.bind(this));return o};this.droppable=function(el,params){var o=[];_each(el,function(_el){_el=_gel(_el);if(_el!=null){var drop=new Drop(_el,_prepareParams(params),_css,_scope);_el._katavorioDrop=_el._katavorioDrop||[];_el._katavorioDrop.push(drop);_reg(drop,this._dropsByScope);o.push(drop);katavorioParams.addClass(_el,_css.droppable)}}.bind(this));return o};this.select=function(el){_each(el,function(){var _el=_gel(this);if(_el&&_el._katavorioDrag){if(!_selectionMap[_el._katavorio]){_selection.push(_el._katavorioDrag);_selectionMap[_el._katavorio]=[_el,_selection.length-1];katavorioParams.addClass(_el,_css.selected)}}});return this};this.deselect=function(el){_each(el,function(){var _el=_gel(this);if(_el&&_el._katavorio){var e=_selectionMap[_el._katavorio];if(e){var _s=[];for(var i=0;i<_selection.length;i++)
if(_selection[i].el!==_el)_s.push(_selection[i]);_selection=_s;delete _selectionMap[_el._katavorio];katavorioParams.removeClass(_el,_css.selected)}}});return this};this.deselectAll=function(){for(var i in _selectionMap){var d=_selectionMap[i];katavorioParams.removeClass(d[0],_css.selected)}
_selection.length=0;_selectionMap={}};this.markSelection=function(drag){_foreach(_selection,function(e){e.mark()},drag)};this.markPosses=function(drag){if(drag.posses){_each(drag.posses,function(p){if(drag.posseRoles[p]&&_posses[p]){_foreach(_posses[p].members,function(d){d.mark()},drag)}})}};this.unmarkSelection=function(drag,event){_foreach(_selection,function(e){e.unmark(event)},drag)};this.unmarkPosses=function(drag,event){if(drag.posses){_each(drag.posses,function(p){if(drag.posseRoles[p]&&_posses[p]){_foreach(_posses[p].members,function(d){d.unmark(event,!0)},drag)}})}};this.getSelection=function(){return _selection.slice(0)};this.updateSelection=function(dx,dy,drag){_foreach(_selection,function(e){e.moveBy(dx,dy)},drag)};var _posseAction=function(fn,drag){if(drag.posses){_each(drag.posses,function(p){if(drag.posseRoles[p]&&_posses[p]){_foreach(_posses[p].members,function(e){fn(e)},drag)}})}};this.updatePosses=function(dx,dy,drag){_posseAction(function(e){e.moveBy(dx,dy)},drag)};this.notifyPosseDragStop=function(drag,evt){_posseAction(function(e){e.stop(evt,!0)},drag)};this.notifySelectionDragStop=function(drag,evt){_foreach(_selection,function(e){e.stop(evt,!0)},drag)};this.notifySelectionDragStart=function(drag,evt){_foreach(_selection,function(e){e.notifyStart(evt)},drag)};this.setZoom=function(z){_zoom=z};this.getZoom=function(){return _zoom};var _scopeManip=function(kObj,scopes,map,fn){_each(kObj,function(_kObj){_unreg(_kObj,map);_kObj[fn](scopes);_reg(_kObj,map)})};_each(["set","add","remove","toggle"],function(v){this[v+"Scope"]=function(el,scopes){_scopeManip(el._katavorioDrag,scopes,this._dragsByScope,v+"Scope");_scopeManip(el._katavorioDrop,scopes,this._dropsByScope,v+"Scope")}.bind(this);this[v+"DragScope"]=function(el,scopes){_scopeManip(el.constructor===Drag?el:el._katavorioDrag,scopes,this._dragsByScope,v+"Scope")}.bind(this);this[v+"DropScope"]=function(el,scopes){_scopeManip(el.constructor===Drop?el:el._katavorioDrop,scopes,this._dropsByScope,v+"Scope")}.bind(this)}.bind(this));this.snapToGrid=function(x,y){for(var s in this._dragsByScope){_foreach(this._dragsByScope[s],function(d){d.snap(x,y)})}};this.getDragsForScope=function(s){return this._dragsByScope[s]};this.getDropsForScope=function(s){return this._dropsByScope[s]};var _destroy=function(el,type,map){el=_gel(el);if(el[type]){var selIdx=_selection.indexOf(el[type]);if(selIdx>=0){_selection.splice(selIdx,1)}
if(_unreg(el[type],map)){_each(el[type],function(kObj){kObj.destroy()})}
delete el[type]}};var _removeListener=function(el,type,evt,fn){el=_gel(el);if(el[type]){el[type].off(evt,fn)}};this.elementRemoved=function(el){if(el._katavorioDrag){this.destroyDraggable(el)}
if(el._katavorioDrop){this.destroyDroppable(el)}};this.destroyDraggable=function(el,evt,fn){if(arguments.length===1){_destroy(el,"_katavorioDrag",this._dragsByScope)}else{_removeListener(el,"_katavorioDrag",evt,fn)}};this.destroyDroppable=function(el,evt,fn){if(arguments.length===1){_destroy(el,"_katavorioDrop",this._dropsByScope)}else{_removeListener(el,"_katavorioDrop",evt,fn)}};this.reset=function(){this._dragsByScope={};this._dropsByScope={};_selection=[];_selectionMap={};_posses={}};var _posses={};var _processOneSpec=function(el,_spec,dontAddExisting){var posseId=_isString(_spec)?_spec:_spec.id;var active=_isString(_spec)?!0:_spec.active!==!1;var posse=_posses[posseId]||(function(){var g={name:posseId,members:[]};_posses[posseId]=g;return g})();_each(el,function(_el){if(_el._katavorioDrag){if(dontAddExisting&&_el._katavorioDrag.posseRoles[posse.name]!=null)return;_suggest(posse.members,_el._katavorioDrag);_suggest(_el._katavorioDrag.posses,posse.name);_el._katavorioDrag.posseRoles[posse.name]=active}});return posse};this.addToPosse=function(el,spec){var posses=[];for(var i=1;i<arguments.length;i++){posses.push(_processOneSpec(el,arguments[i]))}
return posses.length===1?posses[0]:posses};this.setPosse=function(el,spec){var posses=[];for(var i=1;i<arguments.length;i++){posses.push(_processOneSpec(el,arguments[i],!0).name)}
_each(el,function(_el){if(_el._katavorioDrag){var diff=_difference(_el._katavorioDrag.posses,posses);var p=[];Array.prototype.push.apply(p,_el._katavorioDrag.posses);for(var i=0;i<diff.length;i++){this.removeFromPosse(_el,diff[i])}}}.bind(this));return posses.length===1?posses[0]:posses};this.removeFromPosse=function(el,posseId){if(arguments.length<2)throw new TypeError("No posse id provided for remove operation");for(var i=1;i<arguments.length;i++){posseId=arguments[i];_each(el,function(_el){if(_el._katavorioDrag&&_el._katavorioDrag.posses){var d=_el._katavorioDrag;_each(posseId,function(p){_vanquish(_posses[p].members,d);_vanquish(d.posses,p);delete d.posseRoles[p]})}})}};this.removeFromAllPosses=function(el){_each(el,function(_el){if(_el._katavorioDrag&&_el._katavorioDrag.posses){var d=_el._katavorioDrag;_each(d.posses,function(p){_vanquish(_posses[p].members,d)});d.posses.length=0;d.posseRoles={}}})};this.setPosseState=function(el,posseId,state){var posse=_posses[posseId];if(posse){_each(el,function(_el){if(_el._katavorioDrag&&_el._katavorioDrag.posses){_el._katavorioDrag.posseRoles[posse.name]=state}})}}};root.Katavorio.version="1.0.0";if(typeof exports!=="undefined"){exports.Katavorio=root.Katavorio}}).call(typeof window!=='undefined'?window:this);(function(){var root=this;root.jsPlumbUtil=root.jsPlumbUtil||{};var jsPlumbUtil=root.jsPlumbUtil;if(typeof exports!=='undefined'){exports.jsPlumbUtil=jsPlumbUtil}
function isArray(a){return Object.prototype.toString.call(a)==="[object Array]"}
jsPlumbUtil.isArray=isArray;function isNumber(n){return Object.prototype.toString.call(n)==="[object Number]"}
jsPlumbUtil.isNumber=isNumber;function isString(s){return typeof s==="string"}
jsPlumbUtil.isString=isString;function isBoolean(s){return typeof s==="boolean"}
jsPlumbUtil.isBoolean=isBoolean;function isNull(s){return s==null}
jsPlumbUtil.isNull=isNull;function isObject(o){return o==null?!1:Object.prototype.toString.call(o)==="[object Object]"}
jsPlumbUtil.isObject=isObject;function isDate(o){return Object.prototype.toString.call(o)==="[object Date]"}
jsPlumbUtil.isDate=isDate;function isFunction(o){return Object.prototype.toString.call(o)==="[object Function]"}
jsPlumbUtil.isFunction=isFunction;function isNamedFunction(o){return isFunction(o)&&o.name!=null&&o.name.length>0}
jsPlumbUtil.isNamedFunction=isNamedFunction;function isEmpty(o){for(var i in o){if(o.hasOwnProperty(i)){return!1}}
return!0}
jsPlumbUtil.isEmpty=isEmpty;function clone(a){if(isString(a)){return""+a}else if(isBoolean(a)){return!!a}else if(isDate(a)){return new Date(a.getTime())}else if(isFunction(a)){return a}else if(isArray(a)){var b=[];for(var i=0;i<a.length;i++){b.push(clone(a[i]))}
return b}else if(isObject(a)){var c={};for(var j in a){c[j]=clone(a[j])}
return c}else{return a}}
jsPlumbUtil.clone=clone;function merge(a,b,collations,overwrites){var cMap={},ar,i,oMap={};collations=collations||[];overwrites=overwrites||[];for(i=0;i<collations.length;i++){cMap[collations[i]]=!0}
for(i=0;i<overwrites.length;i++){oMap[overwrites[i]]=!0}
var c=clone(a);for(i in b){if(c[i]==null||oMap[i]){c[i]=b[i]}else if(isString(b[i])||isBoolean(b[i])){if(!cMap[i]){c[i]=b[i]}else{ar=[];ar.push.apply(ar,isArray(c[i])?c[i]:[c[i]]);ar.push.apply(ar,isBoolean(b[i])?b[i]:[b[i]]);c[i]=ar}}else{if(isArray(b[i])){ar=[];if(isArray(c[i])){ar.push.apply(ar,c[i])}
ar.push.apply(ar,b[i]);c[i]=ar}else if(isObject(b[i])){if(!isObject(c[i])){c[i]={}}
for(var j in b[i]){c[i][j]=b[i][j]}}}}
return c}
jsPlumbUtil.merge=merge;function replace(inObj,path,value){if(inObj==null){return}
var q=inObj,t=q;path.replace(/([^\.])+/g,function(term,lc,pos,str){var array=term.match(/([^\[0-9]+){1}(\[)([0-9+])/),last=pos+term.length>=str.length,_getArray=function(){return t[array[1]]||(function(){t[array[1]]=[];return t[array[1]]})()};if(last){if(array){_getArray()[array[3]]=value}else{t[term]=value}}else{if(array){var a_1=_getArray();t=a_1[array[3]]||(function(){a_1[array[3]]={};return a_1[array[3]]})()}else{t=t[term]||(function(){t[term]={};return t[term]})()}}
return""});return inObj}
jsPlumbUtil.replace=replace;function functionChain(successValue,failValue,fns){for(var i=0;i<fns.length;i++){var o=fns[i][0][fns[i][1]].apply(fns[i][0],fns[i][2]);if(o===failValue){return o}}
return successValue}
jsPlumbUtil.functionChain=functionChain;function populate(model,values,functionPrefix,doNotExpandFunctions){var getValue=function(fromString){var matches=fromString.match(/(\${.*?})/g);if(matches!=null){for(var i=0;i<matches.length;i++){var val=values[matches[i].substring(2,matches[i].length-1)]||"";if(val!=null){fromString=fromString.replace(matches[i],val)}}}
return fromString};var _one=function(d){if(d!=null){if(isString(d)){return getValue(d)}else if(isFunction(d)&&!doNotExpandFunctions&&(functionPrefix==null||(d.name||"").indexOf(functionPrefix)===0)){return d(values)}else if(isArray(d)){var r=[];for(var i=0;i<d.length;i++){r.push(_one(d[i]))}
return r}else if(isObject(d)){var s={};for(var j in d){s[j]=_one(d[j])}
return s}else{return d}}};return _one(model)}
jsPlumbUtil.populate=populate;function findWithFunction(a,f){if(a){for(var i=0;i<a.length;i++){if(f(a[i])){return i}}}
return-1}
jsPlumbUtil.findWithFunction=findWithFunction;function removeWithFunction(a,f){var idx=findWithFunction(a,f);if(idx>-1){a.splice(idx,1)}
return idx!==-1}
jsPlumbUtil.removeWithFunction=removeWithFunction;function remove(l,v){var idx=l.indexOf(v);if(idx>-1){l.splice(idx,1)}
return idx!==-1}
jsPlumbUtil.remove=remove;function addWithFunction(list,item,hashFunction){if(findWithFunction(list,hashFunction)===-1){list.push(item)}}
jsPlumbUtil.addWithFunction=addWithFunction;function addToList(map,key,value,insertAtStart){var l=map[key];if(l==null){l=[];map[key]=l}
l[insertAtStart?"unshift":"push"](value);return l}
jsPlumbUtil.addToList=addToList;function suggest(list,item,insertAtHead){if(list.indexOf(item)===-1){if(insertAtHead){list.unshift(item)}else{list.push(item)}
return!0}
return!1}
jsPlumbUtil.suggest=suggest;function extend(child,parent,_protoFn){var i;parent=isArray(parent)?parent:[parent];var _copyProtoChain=function(focus){var proto=focus.__proto__;while(proto!=null){if(proto.prototype!=null){for(var j in proto.prototype){if(proto.prototype.hasOwnProperty(j)&&!child.prototype.hasOwnProperty(j)){child.prototype[j]=proto.prototype[j]}}
proto=proto.prototype.__proto__}else{proto=null}}};for(i=0;i<parent.length;i++){for(var j in parent[i].prototype){if(parent[i].prototype.hasOwnProperty(j)&&!child.prototype.hasOwnProperty(j)){child.prototype[j]=parent[i].prototype[j]}}
_copyProtoChain(parent[i])}
var _makeFn=function(name,protoFn){return function(){for(i=0;i<parent.length;i++){if(parent[i].prototype[name]){parent[i].prototype[name].apply(this,arguments)}}
return protoFn.apply(this,arguments)}};var _oneSet=function(fns){for(var k in fns){child.prototype[k]=_makeFn(k,fns[k])}};if(arguments.length>2){for(i=2;i<arguments.length;i++){_oneSet(arguments[i])}}
return child}
jsPlumbUtil.extend=extend;var lut=[];for(var i=0;i<256;i++){lut[i]=(i<16?'0':'')+(i).toString(16)}
function uuid(){var d0=Math.random()*0xffffffff|0;var d1=Math.random()*0xffffffff|0;var d2=Math.random()*0xffffffff|0;var d3=Math.random()*0xffffffff|0;return lut[d0&0xff]+lut[d0>>8&0xff]+lut[d0>>16&0xff]+lut[d0>>24&0xff]+'-'+lut[d1&0xff]+lut[d1>>8&0xff]+'-'+lut[d1>>16&0x0f|0x40]+lut[d1>>24&0xff]+'-'+lut[d2&0x3f|0x80]+lut[d2>>8&0xff]+'-'+lut[d2>>16&0xff]+lut[d2>>24&0xff]+lut[d3&0xff]+lut[d3>>8&0xff]+lut[d3>>16&0xff]+lut[d3>>24&0xff]}
jsPlumbUtil.uuid=uuid;function fastTrim(s){if(s==null){return null}
var str=s.replace(/^\s\s*/,''),ws=/\s/,i=str.length;while(ws.test(str.charAt(--i))){}
return str.slice(0,i+1)}
jsPlumbUtil.fastTrim=fastTrim;function each(obj,fn){obj=obj.length==null||typeof obj==="string"?[obj]:obj;for(var i=0;i<obj.length;i++){fn(obj[i])}}
jsPlumbUtil.each=each;function map(obj,fn){var o=[];for(var i=0;i<obj.length;i++){o.push(fn(obj[i]))}
return o}
jsPlumbUtil.map=map;function mergeWithParents(type,map,parentAttribute){parentAttribute=parentAttribute||"parent";var _def=function(id){return id?map[id]:null};var _parent=function(def){return def?_def(def[parentAttribute]):null};var _one=function(parent,def){if(parent==null){return def}else{var overrides=["anchor","anchors","cssClass","connector","paintStyle","hoverPaintStyle","endpoint","endpoints"];if(def.mergeStrategy==="override"){Array.prototype.push.apply(overrides,["events","overlays"])}
var d_1=merge(parent,def,[],overrides);return _one(_parent(parent),d_1)}};var _getDef=function(t){if(t==null){return{}}
if(typeof t==="string"){return _def(t)}else if(t.length){var done=!1,i=0,_dd=void 0;while(!done&&i<t.length){_dd=_getDef(t[i]);if(_dd){done=!0}else{i++}}
return _dd}};var d=_getDef(type);if(d){return _one(_parent(d),d)}else{return{}}}
jsPlumbUtil.mergeWithParents=mergeWithParents;jsPlumbUtil.logEnabled=!0;function log(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}
if(jsPlumbUtil.logEnabled&&typeof console!=="undefined"){try{var msg=arguments[arguments.length-1];console.log(msg)}catch(e){}}}
jsPlumbUtil.log=log;function wrap(wrappedFunction,newFunction,returnOnThisValue){return function(){var r=null;try{if(newFunction!=null){r=newFunction.apply(this,arguments)}}catch(e){log("jsPlumb function failed : "+e)}
if((wrappedFunction!=null)&&(returnOnThisValue==null||(r!==returnOnThisValue))){try{r=wrappedFunction.apply(this,arguments)}catch(e){log("wrapped function failed : "+e)}}
return r}}
jsPlumbUtil.wrap=wrap;var EventGenerator=(function(){function EventGenerator(){var _this=this;this._listeners={};this.eventsSuspended=!1;this.tick=!1;this.eventsToDieOn={"ready":!0};this.queue=[];this.bind=function(event,listener,insertAtStart){var _one=function(evt){addToList(_this._listeners,evt,listener,insertAtStart);listener.__jsPlumb=listener.__jsPlumb||{};listener.__jsPlumb[uuid()]=evt};if(typeof event==="string"){_one(event)}else if(event.length!=null){for(var i=0;i<event.length;i++){_one(event[i])}}
return _this};this.fire=function(event,value,originalEvent){if(!this.tick){this.tick=!0;if(!this.eventsSuspended&&this._listeners[event]){var l=this._listeners[event].length,i=0,_gone=!1,ret=null;if(!this.shouldFireEvent||this.shouldFireEvent(event,value,originalEvent)){while(!_gone&&i<l&&ret!==!1){if(this.eventsToDieOn[event]){this._listeners[event][i].apply(this,[value,originalEvent])}else{try{ret=this._listeners[event][i].apply(this,[value,originalEvent])}catch(e){log("jsPlumb: fire failed for event "+event+" : "+e)}}
i++;if(this._listeners==null||this._listeners[event]==null){_gone=!0}}}}
this.tick=!1;this._drain()}else{this.queue.unshift(arguments)}
return this};this._drain=function(){var n=_this.queue.pop();if(n){_this.fire.apply(_this,n)}};this.unbind=function(eventOrListener,listener){if(arguments.length===0){this._listeners={}}else if(arguments.length===1){if(typeof eventOrListener==="string"){delete this._listeners[eventOrListener]}else if(eventOrListener.__jsPlumb){var evt=void 0;for(var i in eventOrListener.__jsPlumb){evt=eventOrListener.__jsPlumb[i];remove(this._listeners[evt]||[],eventOrListener)}}}else if(arguments.length===2){remove(this._listeners[eventOrListener]||[],listener)}
return this};this.getListener=function(forEvent){return _this._listeners[forEvent]};this.setSuspendEvents=function(val){_this.eventsSuspended=val};this.isSuspendEvents=function(){return _this.eventsSuspended};this.silently=function(fn){_this.setSuspendEvents(!0);try{fn()}catch(e){log("Cannot execute silent function "+e)}
_this.setSuspendEvents(!1)};this.cleanupListeners=function(){for(var i in _this._listeners){_this._listeners[i]=null}}}
return EventGenerator}());jsPlumbUtil.EventGenerator=EventGenerator;function rotatePoint(point,center,rotation){var radial=[point[0]-center[0],point[1]-center[1]],cr=Math.cos(rotation/360*Math.PI*2),sr=Math.sin(rotation/360*Math.PI*2);return[(radial[0]*cr)-(radial[1]*sr)+center[0],(radial[1]*cr)+(radial[0]*sr)+center[1],cr,sr]}
jsPlumbUtil.rotatePoint=rotatePoint;function rotateAnchorOrientation(orientation,rotation){var r=rotatePoint(orientation,[0,0],rotation);return[Math.round(r[0]),Math.round(r[1])]}
jsPlumbUtil.rotateAnchorOrientation=rotateAnchorOrientation}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this;root.jsPlumbUtil.matchesSelector=function(el,selector,ctx){ctx=ctx||el.parentNode;var possibles=ctx.querySelectorAll(selector);for(var i=0;i<possibles.length;i++){if(possibles[i]===el){return!0}}
return!1};root.jsPlumbUtil.consume=function(e,doNotPreventDefault){if(e.stopPropagation){e.stopPropagation()}else{e.returnValue=!1}
if(!doNotPreventDefault&&e.preventDefault){e.preventDefault()}};root.jsPlumbUtil.sizeElement=function(el,x,y,w,h){if(el){el.style.height=h+"px";el.height=h;el.style.width=w+"px";el.width=w;el.style.left=x+"px";el.style.top=y+"px"}}}).call(typeof window!=='undefined'?window:this);(function(){var DEFAULT_OPTIONS={deriveAnchor:function(edge,index,ep,conn){return{top:["TopRight","TopLeft"],bottom:["BottomRight","BottomLeft"]}[edge][index]}};var root=this;var ListManager=function(jsPlumbInstance,params){this.count=0;this.instance=jsPlumbInstance;this.lists={};this.options=params||{};this.instance.addList=function(el,options){return this.listManager.addList(el,options)};this.instance.removeList=function(el){this.listManager.removeList(el)};this.instance.bind("manageElement",function(p){var scrollableLists=this.instance.getSelector(p.el,"[jtk-scrollable-list]");for(var i=0;i<scrollableLists.length;i++){this.addList(scrollableLists[i])}}.bind(this));this.instance.bind("unmanageElement",function(p){this.removeList(p.el)});this.instance.bind("connection",function(c,evt){if(evt==null){this._maybeUpdateParentList(c.source);this._maybeUpdateParentList(c.target)}}.bind(this))};root.jsPlumbListManager=ListManager;ListManager.prototype={addList:function(el,options){var dp=this.instance.extend({},DEFAULT_OPTIONS);this.instance.extend(dp,this.options);options=this.instance.extend(dp,options||{});var id=[this.instance.getInstanceIndex(),this.count++].join("_");this.lists[id]=new List(this.instance,el,options,id)},removeList:function(el){var list=this.lists[el._jsPlumbList];if(list){list.destroy();delete this.lists[el._jsPlumbList]}},_maybeUpdateParentList:function(el){var parent=el.parentNode,container=this.instance.getContainer();while(parent!=null&&parent!==container){if(parent._jsPlumbList!=null&&this.lists[parent._jsPlumbList]!=null){parent._jsPlumbScrollHandler();return}
parent=parent.parentNode}}};var List=function(instance,el,options,id){el._jsPlumbList=id;function deriveAnchor(edge,index,ep,conn){return options.anchor?options.anchor:options.deriveAnchor(edge,index,ep,conn)}
function deriveEndpoint(edge,index,ep,conn){return options.deriveEndpoint?options.deriveEndpoint(edge,index,ep,conn):options.endpoint?options.endpoint:ep.type}
function _maybeUpdateDraggable(el){var parent=el.parentNode,container=instance.getContainer();while(parent!=null&&parent!==container){if(instance.hasClass(parent,"jtk-managed")){instance.recalculateOffsets(parent);return}
parent=parent.parentNode}}
var scrollHandler=function(e){var children=instance.getSelector(el,".jtk-managed");var elId=instance.getId(el);for(var i=0;i<children.length;i++){if(children[i].offsetTop<el.scrollTop){if(!children[i]._jsPlumbProxies){children[i]._jsPlumbProxies=children[i]._jsPlumbProxies||[];instance.select({source:children[i]}).each(function(c){instance.proxyConnection(c,0,el,elId,function(){return deriveEndpoint("top",0,c.endpoints[0],c)},function(){return deriveAnchor("top",0,c.endpoints[0],c)});children[i]._jsPlumbProxies.push([c,0])});instance.select({target:children[i]}).each(function(c){instance.proxyConnection(c,1,el,elId,function(){return deriveEndpoint("top",1,c.endpoints[1],c)},function(){return deriveAnchor("top",1,c.endpoints[1],c)});children[i]._jsPlumbProxies.push([c,1])})}}else if(children[i].offsetTop+children[i].offsetHeight>el.scrollTop+el.offsetHeight){if(!children[i]._jsPlumbProxies){children[i]._jsPlumbProxies=children[i]._jsPlumbProxies||[];instance.select({source:children[i]}).each(function(c){instance.proxyConnection(c,0,el,elId,function(){return deriveEndpoint("bottom",0,c.endpoints[0],c)},function(){return deriveAnchor("bottom",0,c.endpoints[0],c)});children[i]._jsPlumbProxies.push([c,0])});instance.select({target:children[i]}).each(function(c){instance.proxyConnection(c,1,el,elId,function(){return deriveEndpoint("bottom",1,c.endpoints[1],c)},function(){return deriveAnchor("bottom",1,c.endpoints[1],c)});children[i]._jsPlumbProxies.push([c,1])})}}else if(children[i]._jsPlumbProxies){for(var j=0;j<children[i]._jsPlumbProxies.length;j++){instance.unproxyConnection(children[i]._jsPlumbProxies[j][0],children[i]._jsPlumbProxies[j][1],elId)}
delete children[i]._jsPlumbProxies}
instance.revalidate(children[i])}
_maybeUpdateDraggable(el)};instance.setAttribute(el,"jtk-scrollable-list","true");el._jsPlumbScrollHandler=scrollHandler;instance.on(el,"scroll",scrollHandler);scrollHandler();this.destroy=function(){instance.off(el,"scroll",scrollHandler);delete el._jsPlumbScrollHandler;var children=instance.getSelector(el,".jtk-managed");var elId=instance.getId(el);for(var i=0;i<children.length;i++){if(children[i]._jsPlumbProxies){for(var j=0;j<children[i]._jsPlumbProxies.length;j++){instance.unproxyConnection(children[i]._jsPlumbProxies[j][0],children[i]._jsPlumbProxies[j][1],elId)}
delete children[i]._jsPlumbProxies}}}}}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this;var _ju=root.jsPlumbUtil,_updateHoverStyle=function(component){if(component._jsPlumb.paintStyle&&component._jsPlumb.hoverPaintStyle){var mergedHoverStyle={};jsPlumb.extend(mergedHoverStyle,component._jsPlumb.paintStyle);jsPlumb.extend(mergedHoverStyle,component._jsPlumb.hoverPaintStyle);delete component._jsPlumb.hoverPaintStyle;if(mergedHoverStyle.gradient&&component._jsPlumb.paintStyle.fill){delete mergedHoverStyle.gradient}
component._jsPlumb.hoverPaintStyle=mergedHoverStyle}},events=["tap","dbltap","click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu"],eventFilters={"mouseout":"mouseleave","mouseexit":"mouseleave"},_updateAttachedElements=function(component,state,timestamp,sourceElement){var affectedElements=component.getAttachedElements();if(affectedElements){for(var i=0,j=affectedElements.length;i<j;i++){if(!sourceElement||sourceElement!==affectedElements[i]){affectedElements[i].setHover(state,!0,timestamp)}}}},_splitType=function(t){return t==null?null:t.split(" ")},_mapType=function(map,obj,typeId){for(var i in obj){map[i]=typeId}},_each=function(fn,obj){obj=_ju.isArray(obj)||(obj.length!=null&&!_ju.isString(obj))?obj:[obj];for(var i=0;i<obj.length;i++){try{fn.apply(obj[i],[obj[i]])}catch(e){_ju.log(".each iteration failed : "+e)}}},_applyTypes=function(component,params,doNotRepaint){if(component.getDefaultType){var td=component.getTypeDescriptor(),map={};var defType=component.getDefaultType();var o=_ju.merge({},defType);_mapType(map,defType,"__default");for(var i=0,j=component._jsPlumb.types.length;i<j;i++){var tid=component._jsPlumb.types[i];if(tid!=="__default"){var _t=component._jsPlumb.instance.getType(tid,td);if(_t!=null){var overrides=["anchor","anchors","connector","paintStyle","hoverPaintStyle","endpoint","endpoints","connectorOverlays","connectorStyle","connectorHoverStyle","endpointStyle","endpointHoverStyle"];var collations=[];if(_t.mergeStrategy==="override"){Array.prototype.push.apply(overrides,["events","overlays","cssClass"])}else{collations.push("cssClass")}
o=_ju.merge(o,_t,collations,overrides);_mapType(map,_t,tid)}}}
if(params){o=_ju.populate(o,params,"_")}
component.applyType(o,doNotRepaint,map);if(!doNotRepaint){component.repaint()}}},jsPlumbUIComponent=root.jsPlumbUIComponent=function(params){_ju.EventGenerator.apply(this,arguments);var self=this,a=arguments,idPrefix=self.idPrefix,id=idPrefix+(new Date()).getTime();this._jsPlumb={instance:params._jsPlumb,parameters:params.parameters||{},paintStyle:null,hoverPaintStyle:null,paintStyleInUse:null,hover:!1,beforeDetach:params.beforeDetach,beforeDrop:params.beforeDrop,overlayPlacements:[],hoverClass:params.hoverClass||params._jsPlumb.Defaults.HoverClass,types:[],typeCache:{}};this.cacheTypeItem=function(key,item,typeId){this._jsPlumb.typeCache[typeId]=this._jsPlumb.typeCache[typeId]||{};this._jsPlumb.typeCache[typeId][key]=item};this.getCachedTypeItem=function(key,typeId){return this._jsPlumb.typeCache[typeId]?this._jsPlumb.typeCache[typeId][key]:null};this.getId=function(){return id};var o=params.overlays||[],oo={};if(this.defaultOverlayKeys){for(var i=0;i<this.defaultOverlayKeys.length;i++){Array.prototype.push.apply(o,this._jsPlumb.instance.Defaults[this.defaultOverlayKeys[i]]||[])}
for(i=0;i<o.length;i++){var fo=jsPlumb.convertToFullOverlaySpec(o[i]);oo[fo[1].id]=fo}}
var _defaultType={overlays:oo,parameters:params.parameters||{},scope:params.scope||this._jsPlumb.instance.getDefaultScope()};this.getDefaultType=function(){return _defaultType};this.appendToDefaultType=function(obj){for(var i in obj){_defaultType[i]=obj[i]}};if(params.events){for(var evtName in params.events){self.bind(evtName,params.events[evtName])}}
this.clone=function(){var o=Object.create(this.constructor.prototype);this.constructor.apply(o,a);return o}.bind(this);this.isDetachAllowed=function(connection){var r=!0;if(this._jsPlumb.beforeDetach){try{r=this._jsPlumb.beforeDetach(connection)}catch(e){_ju.log("jsPlumb: beforeDetach callback failed",e)}}
return r};this.isDropAllowed=function(sourceId,targetId,scope,connection,dropEndpoint,source,target){var r=this._jsPlumb.instance.checkCondition("beforeDrop",{sourceId:sourceId,targetId:targetId,scope:scope,connection:connection,dropEndpoint:dropEndpoint,source:source,target:target});if(this._jsPlumb.beforeDrop){try{r=this._jsPlumb.beforeDrop({sourceId:sourceId,targetId:targetId,scope:scope,connection:connection,dropEndpoint:dropEndpoint,source:source,target:target})}catch(e){_ju.log("jsPlumb: beforeDrop callback failed",e)}}
return r};var domListeners=[];this.setListenerComponent=function(c){for(var i=0;i<domListeners.length;i++){domListeners[i][3]=c}}};var _removeTypeCssHelper=function(component,typeIndex){var typeId=component._jsPlumb.types[typeIndex],type=component._jsPlumb.instance.getType(typeId,component.getTypeDescriptor());if(type!=null&&type.cssClass&&component.canvas){component._jsPlumb.instance.removeClass(component.canvas,type.cssClass)}};_ju.extend(root.jsPlumbUIComponent,_ju.EventGenerator,{getParameter:function(name){return this._jsPlumb.parameters[name]},setParameter:function(name,value){this._jsPlumb.parameters[name]=value},getParameters:function(){return this._jsPlumb.parameters},setParameters:function(p){this._jsPlumb.parameters=p},getClass:function(){return jsPlumb.getClass(this.canvas)},hasClass:function(clazz){return jsPlumb.hasClass(this.canvas,clazz)},addClass:function(clazz){jsPlumb.addClass(this.canvas,clazz)},removeClass:function(clazz){jsPlumb.removeClass(this.canvas,clazz)},updateClasses:function(classesToAdd,classesToRemove){jsPlumb.updateClasses(this.canvas,classesToAdd,classesToRemove)},setType:function(typeId,params,doNotRepaint){this.clearTypes();this._jsPlumb.types=_splitType(typeId)||[];_applyTypes(this,params,doNotRepaint)},getType:function(){return this._jsPlumb.types},reapplyTypes:function(params,doNotRepaint){_applyTypes(this,params,doNotRepaint)},hasType:function(typeId){return this._jsPlumb.types.indexOf(typeId)!==-1},addType:function(typeId,params,doNotRepaint){var t=_splitType(typeId),_cont=!1;if(t!=null){for(var i=0,j=t.length;i<j;i++){if(!this.hasType(t[i])){this._jsPlumb.types.push(t[i]);_cont=!0}}
if(_cont){_applyTypes(this,params,doNotRepaint)}}},removeType:function(typeId,params,doNotRepaint){var t=_splitType(typeId),_cont=!1,_one=function(tt){var idx=this._jsPlumb.types.indexOf(tt);if(idx!==-1){_removeTypeCssHelper(this,idx);this._jsPlumb.types.splice(idx,1);return!0}
return!1}.bind(this);if(t!=null){for(var i=0,j=t.length;i<j;i++){_cont=_one(t[i])||_cont}
if(_cont){_applyTypes(this,params,doNotRepaint)}}},clearTypes:function(params,doNotRepaint){var i=this._jsPlumb.types.length;for(var j=0;j<i;j++){_removeTypeCssHelper(this,0);this._jsPlumb.types.splice(0,1)}
_applyTypes(this,params,doNotRepaint)},toggleType:function(typeId,params,doNotRepaint){var t=_splitType(typeId);if(t!=null){for(var i=0,j=t.length;i<j;i++){var idx=this._jsPlumb.types.indexOf(t[i]);if(idx!==-1){_removeTypeCssHelper(this,idx);this._jsPlumb.types.splice(idx,1)}else{this._jsPlumb.types.push(t[i])}}
_applyTypes(this,params,doNotRepaint)}},applyType:function(t,doNotRepaint){this.setPaintStyle(t.paintStyle,doNotRepaint);this.setHoverPaintStyle(t.hoverPaintStyle,doNotRepaint);if(t.parameters){for(var i in t.parameters){this.setParameter(i,t.parameters[i])}}
this._jsPlumb.paintStyleInUse=this.getPaintStyle()},setPaintStyle:function(style,doNotRepaint){this._jsPlumb.paintStyle=style;this._jsPlumb.paintStyleInUse=this._jsPlumb.paintStyle;_updateHoverStyle(this);if(!doNotRepaint){this.repaint()}},getPaintStyle:function(){return this._jsPlumb.paintStyle},setHoverPaintStyle:function(style,doNotRepaint){this._jsPlumb.hoverPaintStyle=style;_updateHoverStyle(this);if(!doNotRepaint){this.repaint()}},getHoverPaintStyle:function(){return this._jsPlumb.hoverPaintStyle},destroy:function(force){if(force||this.typeId==null){this.cleanupListeners();this.clone=null;this._jsPlumb=null}},isHover:function(){return this._jsPlumb.hover},setHover:function(hover,ignoreAttachedElements,timestamp){if(this._jsPlumb&&!this._jsPlumb.instance.currentlyDragging&&!this._jsPlumb.instance.isHoverSuspended()){this._jsPlumb.hover=hover;var method=hover?"addClass":"removeClass";if(this.canvas!=null){if(this._jsPlumb.instance.hoverClass!=null){this._jsPlumb.instance[method](this.canvas,this._jsPlumb.instance.hoverClass)}
if(this._jsPlumb.hoverClass!=null){this._jsPlumb.instance[method](this.canvas,this._jsPlumb.hoverClass)}}
if(this._jsPlumb.hoverPaintStyle!=null){this._jsPlumb.paintStyleInUse=hover?this._jsPlumb.hoverPaintStyle:this._jsPlumb.paintStyle;if(!this._jsPlumb.instance.isSuspendDrawing()){timestamp=timestamp||jsPlumbUtil.uuid();this.repaint({timestamp:timestamp,recalc:!1})}}
if(this.getAttachedElements&&!ignoreAttachedElements){_updateAttachedElements(this,hover,jsPlumbUtil.uuid(),this)}}}});var _jsPlumbInstanceIndex=0,getInstanceIndex=function(){var i=_jsPlumbInstanceIndex+1;_jsPlumbInstanceIndex++;return i};var jsPlumbInstance=root.jsPlumbInstance=function(_defaults){this.version="2.15.6";this.Defaults={Anchor:"Bottom",Anchors:[null,null],ConnectionsDetachable:!0,ConnectionOverlays:[],Connector:"Bezier",Container:null,DoNotThrowErrors:!1,DragOptions:{},DropOptions:{},Endpoint:"Dot",EndpointOverlays:[],Endpoints:[null,null],EndpointStyle:{fill:"#456"},EndpointStyles:[null,null],EndpointHoverStyle:null,EndpointHoverStyles:[null,null],HoverPaintStyle:null,LabelStyle:{color:"black"},ListStyle:{},LogEnabled:!1,Overlays:[],MaxConnections:1,PaintStyle:{"stroke-width":4,stroke:"#456"},ReattachConnections:!1,RenderMode:"svg",Scope:"jsPlumb_DefaultScope"};if(_defaults){jsPlumb.extend(this.Defaults,_defaults)}
this.logEnabled=this.Defaults.LogEnabled;this._connectionTypes={};this._endpointTypes={};_ju.EventGenerator.apply(this);var _currentInstance=this,_instanceIndex=getInstanceIndex(),_bb=_currentInstance.bind,_initialDefaults={},_zoom=1,_info=function(el){if(el==null){return null}else if(el.nodeType===3||el.nodeType===8){return{el:el,text:!0}}else{var _el=_currentInstance.getElement(el);return{el:_el,id:(_ju.isString(el)&&_el==null)?el:_getId(_el)}}};this.getInstanceIndex=function(){return _instanceIndex};this.setZoom=function(z,repaintEverything){_zoom=z;_currentInstance.fire("zoom",_zoom);if(repaintEverything){_currentInstance.repaintEverything()}
return!0};this.getZoom=function(){return _zoom};for(var i in this.Defaults){_initialDefaults[i]=this.Defaults[i]}
var _container,_containerDelegations=[];this.unbindContainer=function(){if(_container!=null&&_containerDelegations.length>0){for(var i=0;i<_containerDelegations.length;i++){_currentInstance.off(_container,_containerDelegations[i][0],_containerDelegations[i][1])}}};this.setContainer=function(c){this.unbindContainer();c=this.getElement(c);this.select().each(function(conn){conn.moveParent(c)});this.selectEndpoints().each(function(ep){ep.moveParent(c)});var previousContainer=_container;_container=c;_containerDelegations.length=0;var eventAliases={"endpointclick":"endpointClick","endpointdblclick":"endpointDblClick"};var _oneDelegateHandler=function(id,e,componentType){var t=e.srcElement||e.target,jp=(t&&t.parentNode?t.parentNode._jsPlumb:null)||(t?t._jsPlumb:null)||(t&&t.parentNode&&t.parentNode.parentNode?t.parentNode.parentNode._jsPlumb:null);if(jp){jp.fire(id,jp,e);var alias=componentType?eventAliases[componentType+id]||id:id;_currentInstance.fire(alias,jp.component||jp,e)}};var _addOneDelegate=function(eventId,selector,fn){_containerDelegations.push([eventId,fn]);_currentInstance.on(_container,eventId,selector,fn)};var _oneDelegate=function(id){_addOneDelegate(id,".jtk-connector",function(e){_oneDelegateHandler(id,e)});_addOneDelegate(id,".jtk-endpoint",function(e){_oneDelegateHandler(id,e,"endpoint")});_addOneDelegate(id,".jtk-overlay",function(e){_oneDelegateHandler(id,e)})};for(var i=0;i<events.length;i++){_oneDelegate(events[i])}
for(var elId in managedElements){var el=managedElements[elId].el;if(el.parentNode===previousContainer){previousContainer.removeChild(el);_container.appendChild(el)}}};this.getContainer=function(){return _container};this.bind=function(event,fn){if("ready"===event&&initialized){fn()}else{_bb.apply(_currentInstance,[event,fn])}};_currentInstance.importDefaults=function(d){for(var i in d){_currentInstance.Defaults[i]=d[i]}
if(d.Container){_currentInstance.setContainer(d.Container)}
return _currentInstance};_currentInstance.restoreDefaults=function(){_currentInstance.Defaults=jsPlumb.extend({},_initialDefaults);return _currentInstance};var log=null,initialized=!1,connections=[],endpointsByElement={},endpointsByUUID={},managedElements={},offsets={},offsetTimestamps={},draggableStates={},connectionBeingDragged=!1,sizes=[],_suspendDrawing=!1,_suspendedAt=null,DEFAULT_SCOPE=this.Defaults.Scope,_curIdStamp=1,_idstamp=function(){return""+_curIdStamp++},_appendElement=function(el,parent){if(_container){_container.appendChild(el)}else if(!parent){this.appendToRoot(el)}else{this.getElement(parent).appendChild(el)}}.bind(this),_draw=function(element,ui,timestamp,clearEdits){var drawResult={c:[],e:[]};if(!_suspendDrawing){element=_currentInstance.getElement(element);if(element!=null){var id=_getId(element),repaintEls=element.querySelectorAll(".jtk-managed");if(timestamp==null){timestamp=jsPlumbUtil.uuid()}
var o=_updateOffset({elId:id,offset:ui,recalc:!1,timestamp:timestamp});for(var i=0;i<repaintEls.length;i++){_updateOffset({elId:repaintEls[i].getAttribute("id"),recalc:!0,timestamp:timestamp})}
var d2=_currentInstance.router.redraw(id,ui,timestamp,null,clearEdits);Array.prototype.push.apply(drawResult.c,d2.c);Array.prototype.push.apply(drawResult.e,d2.e);if(repaintEls){for(var j=0;j<repaintEls.length;j++){d2=_currentInstance.router.redraw(repaintEls[j].getAttribute("id"),null,timestamp,null,clearEdits,!0);Array.prototype.push.apply(drawResult.c,d2.c);Array.prototype.push.apply(drawResult.e,d2.e)}}}}
return drawResult},_getEndpoint=function(uuid){return endpointsByUUID[uuid]},_scopeMatch=function(e1,e2){var s1=e1.scope.split(/\s/),s2=e2.scope.split(/\s/);for(var i=0;i<s1.length;i++){for(var j=0;j<s2.length;j++){if(s2[j]===s1[i]){return!0}}}
return!1},_mergeOverrides=function(def,values){var m=jsPlumb.extend({},def);for(var i in values){if(values[i]){m[i]=values[i]}}
return m},_prepareConnectionParams=function(params,referenceParams){var _p=jsPlumb.extend({},params);if(referenceParams){jsPlumb.extend(_p,referenceParams)}
if(_p.source){if(_p.source.endpoint){_p.sourceEndpoint=_p.source}else{_p.source=_currentInstance.getElement(_p.source)}}
if(_p.target){if(_p.target.endpoint){_p.targetEndpoint=_p.target}else{_p.target=_currentInstance.getElement(_p.target)}}
if(params.uuids){_p.sourceEndpoint=_getEndpoint(params.uuids[0]);_p.targetEndpoint=_getEndpoint(params.uuids[1])}
if(_p.sourceEndpoint&&_p.sourceEndpoint.isFull()){_ju.log(_currentInstance,"could not add connection; source endpoint is full");return}
if(_p.targetEndpoint&&_p.targetEndpoint.isFull()){_ju.log(_currentInstance,"could not add connection; target endpoint is full");return}
if(!_p.type&&_p.sourceEndpoint){_p.type=_p.sourceEndpoint.connectionType}
if(_p.sourceEndpoint&&_p.sourceEndpoint.connectorOverlays){_p.overlays=_p.overlays||[];for(var i=0,j=_p.sourceEndpoint.connectorOverlays.length;i<j;i++){_p.overlays.push(_p.sourceEndpoint.connectorOverlays[i])}}
if(_p.sourceEndpoint&&_p.sourceEndpoint.scope){_p.scope=_p.sourceEndpoint.scope}
if(!_p["pointer-events"]&&_p.sourceEndpoint&&_p.sourceEndpoint.connectorPointerEvents){_p["pointer-events"]=_p.sourceEndpoint.connectorPointerEvents}
var _addEndpoint=function(el,def,idx){var params=_mergeOverrides(def,{anchor:_p.anchors?_p.anchors[idx]:_p.anchor,endpoint:_p.endpoints?_p.endpoints[idx]:_p.endpoint,paintStyle:_p.endpointStyles?_p.endpointStyles[idx]:_p.endpointStyle,hoverPaintStyle:_p.endpointHoverStyles?_p.endpointHoverStyles[idx]:_p.endpointHoverStyle});return _currentInstance.addEndpoint(el,params)};var _oneElementDef=function(type,idx,defs,matchType){if(_p[type]&&!_p[type].endpoint&&!_p[type+"Endpoint"]&&!_p.newConnection){var tid=_getId(_p[type]),tep=defs[tid];tep=tep?tep[matchType]:null;if(tep){if(!tep.enabled){return!1}
var epDef=jsPlumb.extend({},tep.def);delete epDef.label;var newEndpoint=tep.endpoint!=null&&tep.endpoint._jsPlumb?tep.endpoint:_addEndpoint(_p[type],epDef,idx);if(newEndpoint.isFull()){return!1}
_p[type+"Endpoint"]=newEndpoint;if(!_p.scope&&epDef.scope){_p.scope=epDef.scope}
if(tep.uniqueEndpoint){if(!tep.endpoint){tep.endpoint=newEndpoint;newEndpoint.setDeleteOnEmpty(!1)}else{newEndpoint.finalEndpoint=tep.endpoint}}else{newEndpoint.setDeleteOnEmpty(!0)}
if(idx===0&&tep.def.connectorOverlays){_p.overlays=_p.overlays||[];Array.prototype.push.apply(_p.overlays,tep.def.connectorOverlays)}}}};if(_oneElementDef("source",0,this.sourceEndpointDefinitions,_p.type||"default")===!1){return}
if(_oneElementDef("target",1,this.targetEndpointDefinitions,_p.type||"default")===!1){return}
if(_p.sourceEndpoint&&_p.targetEndpoint){if(!_scopeMatch(_p.sourceEndpoint,_p.targetEndpoint)){_p=null}}
return _p}.bind(_currentInstance),_newConnection=function(params){var connectionFunc=_currentInstance.Defaults.ConnectionType||_currentInstance.getDefaultConnectionType();params._jsPlumb=_currentInstance;params.newConnection=_newConnection;params.newEndpoint=_newEndpoint;params.endpointsByUUID=endpointsByUUID;params.endpointsByElement=endpointsByElement;params.finaliseConnection=_finaliseConnection;params.id="con_"+_idstamp();var con=new connectionFunc(params);if(con.isDetachable()){con.endpoints[0].initDraggable("_jsPlumbSource");con.endpoints[1].initDraggable("_jsPlumbTarget")}
return con},_finaliseConnection=_currentInstance.finaliseConnection=function(jpc,params,originalEvent,doInformAnchorManager){params=params||{};if(!jpc.suspendedEndpoint){connections.push(jpc)}
jpc.pending=null;jpc.endpoints[0].isTemporarySource=!1;if(doInformAnchorManager!==!1){_currentInstance.router.newConnection(jpc)}
_draw(jpc.source);if(!params.doNotFireConnectionEvent&&params.fireEvent!==!1){var eventArgs={connection:jpc,source:jpc.source,target:jpc.target,sourceId:jpc.sourceId,targetId:jpc.targetId,sourceEndpoint:jpc.endpoints[0],targetEndpoint:jpc.endpoints[1]};_currentInstance.fire("connection",eventArgs,originalEvent)}},_newEndpoint=function(params,id){var endpointFunc=_currentInstance.Defaults.EndpointType||jsPlumb.Endpoint;var _p=jsPlumb.extend({},params);_p._jsPlumb=_currentInstance;_p.newConnection=_newConnection;_p.newEndpoint=_newEndpoint;_p.endpointsByUUID=endpointsByUUID;_p.endpointsByElement=endpointsByElement;_p.fireDetachEvent=fireDetachEvent;_p.elementId=id||_getId(_p.source);var ep=new endpointFunc(_p);ep.id="ep_"+_idstamp();_manage(_p.elementId,_p.source);if(!jsPlumb.headless){_currentInstance.getDragManager().endpointAdded(_p.source,id)}
return ep},_operation=function(elId,func,endpointFunc){var endpoints=endpointsByElement[elId];if(endpoints&&endpoints.length){for(var i=0,ii=endpoints.length;i<ii;i++){for(var j=0,jj=endpoints[i].connections.length;j<jj;j++){var retVal=func(endpoints[i].connections[j]);if(retVal){return}}
if(endpointFunc){endpointFunc(endpoints[i])}}}},_setDraggable=function(element,draggable){return jsPlumb.each(element,function(el){if(_currentInstance.isDragSupported(el)){draggableStates[_currentInstance.getAttribute(el,"id")]=draggable;_currentInstance.setElementDraggable(el,draggable)}})},_setVisible=function(el,state,alsoChangeEndpoints){state=state==="block";var endpointFunc=null;if(alsoChangeEndpoints){endpointFunc=function(ep){ep.setVisible(state,!0,!0)}}
var info=_info(el);_operation(info.id,function(jpc){if(state&&alsoChangeEndpoints){var oidx=jpc.sourceId===info.id?1:0;if(jpc.endpoints[oidx].isVisible()){jpc.setVisible(!0)}}else{jpc.setVisible(state)}},endpointFunc)},_toggleVisible=function(elId,changeEndpoints){var endpointFunc=null;if(changeEndpoints){endpointFunc=function(ep){var state=ep.isVisible();ep.setVisible(!state)}}
_operation(elId,function(jpc){var state=jpc.isVisible();jpc.setVisible(!state)},endpointFunc)},_getCachedData=function(elId){var o=offsets[elId];if(!o){return _updateOffset({elId:elId})}else{return{o:o,s:sizes[elId]}}},_getId=function(element,uuid,doNotCreateIfNotFound){if(_ju.isString(element)){return element}
if(element==null){return null}
var id=_currentInstance.getAttribute(element,"id");if(!id||id==="undefined"){if(arguments.length===2&&arguments[1]!==undefined){id=uuid}else if(arguments.length===1||(arguments.length===3&&!arguments[2])){id="jsPlumb_"+_instanceIndex+"_"+_idstamp()}
if(!doNotCreateIfNotFound){_currentInstance.setAttribute(element,"id",id)}}
return id};this.setConnectionBeingDragged=function(v){connectionBeingDragged=v};this.isConnectionBeingDragged=function(){return connectionBeingDragged};this.getManagedElements=function(){return managedElements};this.connectorClass="jtk-connector";this.connectorOutlineClass="jtk-connector-outline";this.connectedClass="jtk-connected";this.hoverClass="jtk-hover";this.endpointClass="jtk-endpoint";this.endpointConnectedClass="jtk-endpoint-connected";this.endpointFullClass="jtk-endpoint-full";this.endpointDropAllowedClass="jtk-endpoint-drop-allowed";this.endpointDropForbiddenClass="jtk-endpoint-drop-forbidden";this.overlayClass="jtk-overlay";this.draggingClass="jtk-dragging";this.elementDraggingClass="jtk-element-dragging";this.sourceElementDraggingClass="jtk-source-element-dragging";this.targetElementDraggingClass="jtk-target-element-dragging";this.endpointAnchorClassPrefix="jtk-endpoint-anchor";this.hoverSourceClass="jtk-source-hover";this.hoverTargetClass="jtk-target-hover";this.dragSelectClass="jtk-drag-select";this.Anchors={};this.Connectors={"svg":{}};this.Endpoints={"svg":{}};this.Overlays={"svg":{}};this.ConnectorRenderers={};this.SVG="svg";this.addEndpoint=function(el,params,referenceParams){referenceParams=referenceParams||{};var p=jsPlumb.extend({},referenceParams);jsPlumb.extend(p,params);p.endpoint=p.endpoint||_currentInstance.Defaults.Endpoint;p.paintStyle=p.paintStyle||_currentInstance.Defaults.EndpointStyle;var results=[],inputs=(_ju.isArray(el)||(el.length!=null&&!_ju.isString(el)))?el:[el];for(var i=0,j=inputs.length;i<j;i++){p.source=_currentInstance.getElement(inputs[i]);_ensureContainer(p.source);var id=_getId(p.source),e=_newEndpoint(p,id);var myOffset=_manage(id,p.source,null,!_suspendDrawing).info.o;_ju.addToList(endpointsByElement,id,e);if(!_suspendDrawing){e.paint({anchorLoc:e.anchor.compute({xy:[myOffset.left,myOffset.top],wh:sizes[id],element:e,timestamp:_suspendedAt,rotation:this.getRotation(id)}),timestamp:_suspendedAt})}
results.push(e)}
return results.length===1?results[0]:results};this.addEndpoints=function(el,endpoints,referenceParams){var results=[];for(var i=0,j=endpoints.length;i<j;i++){var e=_currentInstance.addEndpoint(el,endpoints[i],referenceParams);if(_ju.isArray(e)){Array.prototype.push.apply(results,e)}else{results.push(e)}}
return results};this.animate=function(el,properties,options){if(!this.animationSupported){return!1}
options=options||{};var del=_currentInstance.getElement(el),id=_getId(del),stepFunction=jsPlumb.animEvents.step,completeFunction=jsPlumb.animEvents.complete;options[stepFunction]=_ju.wrap(options[stepFunction],function(){_currentInstance.revalidate(id)});options[completeFunction]=_ju.wrap(options[completeFunction],function(){_currentInstance.revalidate(id)});_currentInstance.doAnimate(del,properties,options)};this.checkCondition=function(conditionName,args){var l=_currentInstance.getListener(conditionName),r=!0;if(l&&l.length>0){var values=Array.prototype.slice.call(arguments,1);try{for(var i=0,j=l.length;i<j;i++){r=r&&l[i].apply(l[i],values)}}catch(e){_ju.log(_currentInstance,"cannot check condition ["+conditionName+"]"+e)}}
return r};this.connect=function(params,referenceParams){var _p=_prepareConnectionParams(params,referenceParams),jpc;if(_p){if(_p.source==null&&_p.sourceEndpoint==null){_ju.log("Cannot establish connection - source does not exist");return}
if(_p.target==null&&_p.targetEndpoint==null){_ju.log("Cannot establish connection - target does not exist");return}
_ensureContainer(_p.source);jpc=_newConnection(_p);_finaliseConnection(jpc,_p)}
return jpc};var stTypes=[{el:"source",elId:"sourceId",epDefs:"sourceEndpointDefinitions"},{el:"target",elId:"targetId",epDefs:"targetEndpointDefinitions"}];var _set=function(c,el,idx,doNotRepaint){var ep,_st=stTypes[idx],cId=c[_st.elId],cEl=c[_st.el],sid,sep,oldEndpoint=c.endpoints[idx];var evtParams={index:idx,originalSourceId:idx===0?cId:c.sourceId,newSourceId:c.sourceId,originalTargetId:idx===1?cId:c.targetId,newTargetId:c.targetId,connection:c};if(el.constructor===jsPlumb.Endpoint){ep=el;ep.addConnection(c);el=ep.element}else{sid=_getId(el);sep=this[_st.epDefs][sid];if(sid===c[_st.elId]){ep=null}else if(sep){for(var t in sep){if(!sep[t].enabled){return}
ep=sep[t].endpoint!=null&&sep[t].endpoint._jsPlumb?sep[t].endpoint:this.addEndpoint(el,sep[t].def);if(sep[t].uniqueEndpoint){sep[t].endpoint=ep}
ep.addConnection(c)}}else{ep=c.makeEndpoint(idx===0,el,sid)}}
if(ep!=null){oldEndpoint.detachFromConnection(c);c.endpoints[idx]=ep;c[_st.el]=ep.element;c[_st.elId]=ep.elementId;evtParams[idx===0?"newSourceId":"newTargetId"]=ep.elementId;fireMoveEvent(evtParams);if(!doNotRepaint){c.repaint()}}
evtParams.element=el;return evtParams}.bind(this);this.setSource=function(connection,el,doNotRepaint){var p=_set(connection,el,0,doNotRepaint);this.router.sourceOrTargetChanged(p.originalSourceId,p.newSourceId,connection,p.el,0)};this.setTarget=function(connection,el,doNotRepaint){var p=_set(connection,el,1,doNotRepaint);this.router.sourceOrTargetChanged(p.originalTargetId,p.newTargetId,connection,p.el,1)};this.deleteEndpoint=function(object,dontUpdateHover,deleteAttachedObjects){var endpoint=(typeof object==="string")?endpointsByUUID[object]:object;if(endpoint){_currentInstance.deleteObject({endpoint:endpoint,dontUpdateHover:dontUpdateHover,deleteAttachedObjects:deleteAttachedObjects})}
return _currentInstance};this.deleteEveryEndpoint=function(){var _is=_currentInstance.setSuspendDrawing(!0);for(var id in endpointsByElement){var endpoints=endpointsByElement[id];if(endpoints&&endpoints.length){for(var i=0,j=endpoints.length;i<j;i++){_currentInstance.deleteEndpoint(endpoints[i],!0)}}}
endpointsByElement={};managedElements={};endpointsByUUID={};offsets={};offsetTimestamps={};_currentInstance.router.reset();var dm=_currentInstance.getDragManager();if(dm){dm.reset()}
if(!_is){_currentInstance.setSuspendDrawing(!1)}
return _currentInstance};var fireDetachEvent=function(jpc,doFireEvent,originalEvent){var connType=_currentInstance.Defaults.ConnectionType||_currentInstance.getDefaultConnectionType(),argIsConnection=jpc.constructor===connType,params=argIsConnection?{connection:jpc,source:jpc.source,target:jpc.target,sourceId:jpc.sourceId,targetId:jpc.targetId,sourceEndpoint:jpc.endpoints[0],targetEndpoint:jpc.endpoints[1]}:jpc;if(doFireEvent){_currentInstance.fire("connectionDetached",params,originalEvent)}
_currentInstance.fire("internal.connectionDetached",params,originalEvent);_currentInstance.router.connectionDetached(params)};var fireMoveEvent=_currentInstance.fireMoveEvent=function(params,evt){_currentInstance.fire("connectionMoved",params,evt)};this.unregisterEndpoint=function(endpoint){if(endpoint._jsPlumb.uuid){endpointsByUUID[endpoint._jsPlumb.uuid]=null}
_currentInstance.router.deleteEndpoint(endpoint);for(var e in endpointsByElement){var endpoints=endpointsByElement[e];if(endpoints){var newEndpoints=[];for(var i=0,j=endpoints.length;i<j;i++){if(endpoints[i]!==endpoint){newEndpoints.push(endpoints[i])}}
endpointsByElement[e]=newEndpoints}
if(endpointsByElement[e].length<1){delete endpointsByElement[e]}}};var IS_DETACH_ALLOWED="isDetachAllowed";var BEFORE_DETACH="beforeDetach";var CHECK_CONDITION="checkCondition";this.deleteConnection=function(connection,params){if(connection!=null){params=params||{};if(params.force||_ju.functionChain(!0,!1,[[connection.endpoints[0],IS_DETACH_ALLOWED,[connection]],[connection.endpoints[1],IS_DETACH_ALLOWED,[connection]],[connection,IS_DETACH_ALLOWED,[connection]],[_currentInstance,CHECK_CONDITION,[BEFORE_DETACH,connection]]])){connection.setHover(!1);fireDetachEvent(connection,!connection.pending&&params.fireEvent!==!1,params.originalEvent);connection.endpoints[0].detachFromConnection(connection);connection.endpoints[1].detachFromConnection(connection);_ju.removeWithFunction(connections,function(_c){return connection.id===_c.id});connection.cleanup();connection.destroy();return!0}}
return!1};this.deleteEveryConnection=function(params){params=params||{};var count=connections.length,deletedCount=0;_currentInstance.batch(function(){for(var i=0;i<count;i++){deletedCount+=_currentInstance.deleteConnection(connections[0],params)?1:0}});return deletedCount};this.deleteConnectionsForElement=function(el,params){params=params||{};el=_currentInstance.getElement(el);var id=_getId(el),endpoints=endpointsByElement[id];if(endpoints&&endpoints.length){for(var i=0,j=endpoints.length;i<j;i++){endpoints[i].deleteEveryConnection(params)}}
return _currentInstance};this.deleteObject=function(params){var result={endpoints:{},connections:{},endpointCount:0,connectionCount:0},deleteAttachedObjects=params.deleteAttachedObjects!==!1;var unravelConnection=function(connection){if(connection!=null&&result.connections[connection.id]==null){if(!params.dontUpdateHover&&connection._jsPlumb!=null){connection.setHover(!1)}
result.connections[connection.id]=connection;result.connectionCount++}};var unravelEndpoint=function(endpoint){if(endpoint!=null&&result.endpoints[endpoint.id]==null){if(!params.dontUpdateHover&&endpoint._jsPlumb!=null){endpoint.setHover(!1)}
result.endpoints[endpoint.id]=endpoint;result.endpointCount++;if(deleteAttachedObjects){for(var i=0;i<endpoint.connections.length;i++){var c=endpoint.connections[i];unravelConnection(c)}}}};if(params.connection){unravelConnection(params.connection)}else{unravelEndpoint(params.endpoint)}
for(var i in result.connections){var c=result.connections[i];if(c._jsPlumb){_ju.removeWithFunction(connections,function(_c){return c.id===_c.id});fireDetachEvent(c,params.fireEvent===!1?!1:!c.pending,params.originalEvent);var doNotCleanup=params.deleteAttachedObjects==null?null:!params.deleteAttachedObjects;c.endpoints[0].detachFromConnection(c,null,doNotCleanup);c.endpoints[1].detachFromConnection(c,null,doNotCleanup);c.cleanup(!0);c.destroy(!0)}}
for(var j in result.endpoints){var e=result.endpoints[j];if(e._jsPlumb){_currentInstance.unregisterEndpoint(e);e.cleanup(!0);e.destroy(!0)}}
return result};var _setOperation=function(list,func,args,selector){for(var i=0,j=list.length;i<j;i++){list[i][func].apply(list[i],args)}
return selector(list)},_getOperation=function(list,func,args){var out=[];for(var i=0,j=list.length;i<j;i++){out.push([list[i][func].apply(list[i],args),list[i]])}
return out},setter=function(list,func,selector){return function(){return _setOperation(list,func,arguments,selector)}},getter=function(list,func){return function(){return _getOperation(list,func,arguments)}},prepareList=function(input,doNotGetIds){var r=[];if(input){if(typeof input==='string'){if(input==="*"){return input}
r.push(input)}else{if(doNotGetIds){r=input}else{if(input.length){for(var i=0,j=input.length;i<j;i++){r.push(_info(input[i]).id)}}else{r.push(_info(input).id)}}}}
return r},filterList=function(list,value,missingIsFalse){if(list==="*"){return!0}
return list.length>0?list.indexOf(value)!==-1:!missingIsFalse};this.getConnections=function(options,flat){if(!options){options={}}else if(options.constructor===String){options={"scope":options}}
var scope=options.scope||_currentInstance.getDefaultScope(),scopes=prepareList(scope,!0),sources=prepareList(options.source),targets=prepareList(options.target),results=(!flat&&scopes.length>1)?{}:[],_addOne=function(scope,obj){if(!flat&&scopes.length>1){var ss=results[scope];if(ss==null){ss=results[scope]=[]}
ss.push(obj)}else{results.push(obj)}};for(var j=0,jj=connections.length;j<jj;j++){var c=connections[j],sourceId=c.proxies&&c.proxies[0]?c.proxies[0].originalEp.elementId:c.sourceId,targetId=c.proxies&&c.proxies[1]?c.proxies[1].originalEp.elementId:c.targetId;if(filterList(scopes,c.scope)&&filterList(sources,sourceId)&&filterList(targets,targetId)){_addOne(c.scope,c)}}
return results};var _curryEach=function(list,executor){return function(f){for(var i=0,ii=list.length;i<ii;i++){f(list[i])}
return executor(list)}},_curryGet=function(list){return function(idx){return list[idx]}};var _makeCommonSelectHandler=function(list,executor){var out={length:list.length,each:_curryEach(list,executor),get:_curryGet(list)},setters=["setHover","removeAllOverlays","setLabel","addClass","addOverlay","removeOverlay","removeOverlays","showOverlay","hideOverlay","showOverlays","hideOverlays","setPaintStyle","setHoverPaintStyle","setSuspendEvents","setParameter","setParameters","setVisible","repaint","addType","toggleType","removeType","removeClass","setType","bind","unbind"],getters=["getLabel","getOverlay","isHover","getParameter","getParameters","getPaintStyle","getHoverPaintStyle","isVisible","hasType","getType","isSuspendEvents"],i,ii;for(i=0,ii=setters.length;i<ii;i++){out[setters[i]]=setter(list,setters[i],executor)}
for(i=0,ii=getters.length;i<ii;i++){out[getters[i]]=getter(list,getters[i])}
return out};var _makeConnectionSelectHandler=function(list){var common=_makeCommonSelectHandler(list,_makeConnectionSelectHandler);return jsPlumb.extend(common,{setDetachable:setter(list,"setDetachable",_makeConnectionSelectHandler),setReattach:setter(list,"setReattach",_makeConnectionSelectHandler),setConnector:setter(list,"setConnector",_makeConnectionSelectHandler),delete:function(){for(var i=0,ii=list.length;i<ii;i++){_currentInstance.deleteConnection(list[i])}},isDetachable:getter(list,"isDetachable"),isReattach:getter(list,"isReattach")})};var _makeEndpointSelectHandler=function(list){var common=_makeCommonSelectHandler(list,_makeEndpointSelectHandler);return jsPlumb.extend(common,{setEnabled:setter(list,"setEnabled",_makeEndpointSelectHandler),setAnchor:setter(list,"setAnchor",_makeEndpointSelectHandler),isEnabled:getter(list,"isEnabled"),deleteEveryConnection:function(){for(var i=0,ii=list.length;i<ii;i++){list[i].deleteEveryConnection()}},"delete":function(){for(var i=0,ii=list.length;i<ii;i++){_currentInstance.deleteEndpoint(list[i])}}})};this.select=function(params){params=params||{};params.scope=params.scope||"*";return _makeConnectionSelectHandler(params.connections||_currentInstance.getConnections(params,!0))};this.selectEndpoints=function(params){params=params||{};params.scope=params.scope||"*";var noElementFilters=!params.element&&!params.source&&!params.target,elements=noElementFilters?"*":prepareList(params.element),sources=noElementFilters?"*":prepareList(params.source),targets=noElementFilters?"*":prepareList(params.target),scopes=prepareList(params.scope,!0);var ep=[];for(var el in endpointsByElement){var either=filterList(elements,el,!0),source=filterList(sources,el,!0),sourceMatchExact=sources!=="*",target=filterList(targets,el,!0),targetMatchExact=targets!=="*";if(either||source||target){inner:for(var i=0,ii=endpointsByElement[el].length;i<ii;i++){var _ep=endpointsByElement[el][i];if(filterList(scopes,_ep.scope,!0)){var noMatchSource=(sourceMatchExact&&sources.length>0&&!_ep.isSource),noMatchTarget=(targetMatchExact&&targets.length>0&&!_ep.isTarget);if(noMatchSource||noMatchTarget){continue inner}
ep.push(_ep)}}}}
return _makeEndpointSelectHandler(ep)};this.getAllConnections=function(){return connections};this.getDefaultScope=function(){return DEFAULT_SCOPE};this.getEndpoint=_getEndpoint;this.getEndpoints=function(el){return endpointsByElement[_info(el).id]||[]};this.getDefaultEndpointType=function(){return jsPlumb.Endpoint};this.getDefaultConnectionType=function(){return jsPlumb.Connection};this.getId=_getId;this.draw=_draw;this.info=_info;this.appendElement=_appendElement;var _hoverSuspended=!1;this.isHoverSuspended=function(){return _hoverSuspended};this.setHoverSuspended=function(s){_hoverSuspended=s};this.hide=function(el,changeEndpoints){_setVisible(el,"none",changeEndpoints);return _currentInstance};this.idstamp=_idstamp;var _ensureContainer=function(candidate){if(!_container&&candidate){var can=_currentInstance.getElement(candidate);if(can.offsetParent){_currentInstance.setContainer(can.offsetParent)}}};var _getContainerFromDefaults=function(){if(_currentInstance.Defaults.Container){_currentInstance.setContainer(_currentInstance.Defaults.Container)}};var _manage=_currentInstance.manage=function(id,element,_transient,_recalc){if(!managedElements[id]){managedElements[id]={el:element,endpoints:[],connections:[],rotation:0};managedElements[id].info=_updateOffset({elId:id,timestamp:_suspendedAt});_currentInstance.addClass(element,"jtk-managed");if(!_transient){_currentInstance.fire("manageElement",{id:id,info:managedElements[id].info,el:element})}}else{if(_recalc){managedElements[id].info=_updateOffset({elId:id,timestamp:_suspendedAt,recalc:!0})}}
return managedElements[id]};this.unmanage=function(id){if(managedElements[id]){var el=managedElements[id].el;_currentInstance.removeClass(el,"jtk-managed");delete managedElements[id];_currentInstance.fire("unmanageElement",{id:id,el:el})}};this.rotate=function(elId,amountInDegrees,doNotRedraw){if(managedElements[elId]){managedElements[elId].rotation=amountInDegrees;managedElements[elId].el.style.transform="rotate("+amountInDegrees+"deg)";managedElements[elId].el.style.transformOrigin="center center";if(doNotRedraw!==!0){return this.revalidate(elId)}}
return{c:[],e:[]}};this.getRotation=function(elementId){return managedElements[elementId]?managedElements[elementId].rotation||0:0};var _updateOffset=function(params){var timestamp=params.timestamp,recalc=params.recalc,offset=params.offset,elId=params.elId,s;if(_suspendDrawing&&!timestamp){timestamp=_suspendedAt}
if(!recalc){if(timestamp&&timestamp===offsetTimestamps[elId]){return{o:params.offset||offsets[elId],s:sizes[elId]}}}
if(recalc||(!offset&&offsets[elId]==null)){s=managedElements[elId]?managedElements[elId].el:null;if(s!=null){sizes[elId]=_currentInstance.getSize(s);offsets[elId]=_currentInstance.getOffset(s);offsetTimestamps[elId]=timestamp}}else{offsets[elId]=offset||offsets[elId];if(sizes[elId]==null){s=managedElements[elId].el;if(s!=null){sizes[elId]=_currentInstance.getSize(s)}}
offsetTimestamps[elId]=timestamp}
if(offsets[elId]&&!offsets[elId].right){offsets[elId].right=offsets[elId].left+sizes[elId][0];offsets[elId].bottom=offsets[elId].top+sizes[elId][1];offsets[elId].width=sizes[elId][0];offsets[elId].height=sizes[elId][1];offsets[elId].centerx=offsets[elId].left+(offsets[elId].width/2);offsets[elId].centery=offsets[elId].top+(offsets[elId].height/2)}
return{o:offsets[elId],s:sizes[elId]}};this.updateOffset=_updateOffset;this.init=function(){if(!initialized){_getContainerFromDefaults();_currentInstance.router=new root.jsPlumb.DefaultRouter(_currentInstance);_currentInstance.anchorManager=_currentInstance.router.anchorManager;initialized=!0;_currentInstance.fire("ready",_currentInstance)}}.bind(this);this.log=log;this.jsPlumbUIComponent=jsPlumbUIComponent;this.makeAnchor=function(){var pp,_a=function(t,p){if(root.jsPlumb.Anchors[t]){return new root.jsPlumb.Anchors[t](p)}
if(!_currentInstance.Defaults.DoNotThrowErrors){throw{msg:"jsPlumb: unknown anchor type '"+t+"'"}}};if(arguments.length===0){return null}
var specimen=arguments[0],elementId=arguments[1],jsPlumbInstance=arguments[2],newAnchor=null;if(specimen.compute&&specimen.getOrientation){return specimen}else if(typeof specimen==="string"){newAnchor=_a(arguments[0],{elementId:elementId,jsPlumbInstance:_currentInstance})}else if(_ju.isArray(specimen)){if(_ju.isArray(specimen[0])||_ju.isString(specimen[0])){if(specimen.length===2&&_ju.isObject(specimen[1])){if(_ju.isString(specimen[0])){pp=root.jsPlumb.extend({elementId:elementId,jsPlumbInstance:_currentInstance},specimen[1]);newAnchor=_a(specimen[0],pp)}else{pp=root.jsPlumb.extend({elementId:elementId,jsPlumbInstance:_currentInstance,anchors:specimen[0]},specimen[1]);newAnchor=new root.jsPlumb.DynamicAnchor(pp)}}else{newAnchor=new jsPlumb.DynamicAnchor({anchors:specimen,selector:null,elementId:elementId,jsPlumbInstance:_currentInstance})}}else{var anchorParams={x:specimen[0],y:specimen[1],orientation:(specimen.length>=4)?[specimen[2],specimen[3]]:[0,0],offsets:(specimen.length>=6)?[specimen[4],specimen[5]]:[0,0],elementId:elementId,jsPlumbInstance:_currentInstance,cssClass:specimen.length===7?specimen[6]:null};newAnchor=new root.jsPlumb.Anchor(anchorParams);newAnchor.clone=function(){return new root.jsPlumb.Anchor(anchorParams)}}}
if(!newAnchor.id){newAnchor.id="anchor_"+_idstamp()}
return newAnchor};this.makeAnchors=function(types,elementId,jsPlumbInstance){var r=[];for(var i=0,ii=types.length;i<ii;i++){if(typeof types[i]==="string"){r.push(root.jsPlumb.Anchors[types[i]]({elementId:elementId,jsPlumbInstance:jsPlumbInstance}))}else if(_ju.isArray(types[i])){r.push(_currentInstance.makeAnchor(types[i],elementId,jsPlumbInstance))}}
return r};this.makeDynamicAnchor=function(anchors,anchorSelector){return new root.jsPlumb.DynamicAnchor({anchors:anchors,selector:anchorSelector,elementId:null,jsPlumbInstance:_currentInstance})};this.targetEndpointDefinitions={};this.sourceEndpointDefinitions={};var selectorFilter=function(evt,_el,selector,_instance,negate){var t=evt.target||evt.srcElement,ok=!1,sel=_instance.getSelector(_el,selector);for(var j=0;j<sel.length;j++){if(sel[j]===t){ok=!0;break}}
return negate?!ok:ok};var _makeElementDropHandler=function(elInfo,p,dropOptions,isSource,isTarget){var proxyComponent=new jsPlumbUIComponent(p);var _drop=p._jsPlumb.EndpointDropHandler({jsPlumb:_currentInstance,enabled:function(){return elInfo.def.enabled},isFull:function(){var targetCount=_currentInstance.select({target:elInfo.id}).length;return elInfo.def.maxConnections>0&&targetCount>=elInfo.def.maxConnections},element:elInfo.el,elementId:elInfo.id,isSource:isSource,isTarget:isTarget,addClass:function(clazz){_currentInstance.addClass(elInfo.el,clazz)},removeClass:function(clazz){_currentInstance.removeClass(elInfo.el,clazz)},onDrop:function(jpc){var source=jpc.endpoints[0];source.anchor.locked=!1},isDropAllowed:function(){return proxyComponent.isDropAllowed.apply(proxyComponent,arguments)},isRedrop:function(jpc){return(jpc.suspendedElement!=null&&jpc.suspendedEndpoint!=null&&jpc.suspendedEndpoint.element===elInfo.el)},getEndpoint:function(jpc){var newEndpoint=elInfo.def.endpoint;if(newEndpoint==null||newEndpoint._jsPlumb==null){var eps=_currentInstance.deriveEndpointAndAnchorSpec(jpc.getType().join(" "),!0);var pp=eps.endpoints?root.jsPlumb.extend(p,{endpoint:elInfo.def.def.endpoint||eps.endpoints[1]}):p;if(eps.anchors){pp=root.jsPlumb.extend(pp,{anchor:elInfo.def.def.anchor||eps.anchors[1]})}
newEndpoint=_currentInstance.addEndpoint(elInfo.el,pp);newEndpoint._mtNew=!0}
if(p.uniqueEndpoint){elInfo.def.endpoint=newEndpoint}
newEndpoint.setDeleteOnEmpty(!0);if(jpc.isDetachable()){newEndpoint.initDraggable()}
if(newEndpoint.anchor.positionFinder!=null){var dropPosition=_currentInstance.getUIPosition(arguments,_currentInstance.getZoom()),elPosition=_currentInstance.getOffset(elInfo.el),elSize=_currentInstance.getSize(elInfo.el),ap=dropPosition==null?[0,0]:newEndpoint.anchor.positionFinder(dropPosition,elPosition,elSize,newEndpoint.anchor.constructorParams);newEndpoint.anchor.x=ap[0];newEndpoint.anchor.y=ap[1]}
return newEndpoint},maybeCleanup:function(ep){if(ep._mtNew&&ep.connections.length===0){_currentInstance.deleteObject({endpoint:ep})}else{delete ep._mtNew}}});var dropEvent=root.jsPlumb.dragEvents.drop;dropOptions.scope=dropOptions.scope||(p.scope||_currentInstance.Defaults.Scope);dropOptions[dropEvent]=_ju.wrap(dropOptions[dropEvent],_drop,!0);dropOptions.rank=p.rank||0;if(isTarget){dropOptions[root.jsPlumb.dragEvents.over]=function(){return!0}}
if(p.allowLoopback===!1){dropOptions.canDrop=function(_drag){var de=_drag.getDragElement()._jsPlumbRelatedElement;return de!==elInfo.el}}
_currentInstance.initDroppable(elInfo.el,dropOptions,"internal");return _drop};this.makeTarget=function(el,params,referenceParams){var p=root.jsPlumb.extend({_jsPlumb:this},referenceParams);root.jsPlumb.extend(p,params);var maxConnections=p.maxConnections||-1,_doOne=function(el){var elInfo=_info(el),elid=elInfo.id,dropOptions=root.jsPlumb.extend({},p.dropOptions||{}),type=p.connectionType||"default";this.targetEndpointDefinitions[elid]=this.targetEndpointDefinitions[elid]||{};_ensureContainer(elid);if(elInfo.el._isJsPlumbGroup&&dropOptions.rank==null){dropOptions.rank=-1}
var _def={def:root.jsPlumb.extend({},p),uniqueEndpoint:p.uniqueEndpoint,maxConnections:maxConnections,enabled:!0};if(p.createEndpoint){_def.uniqueEndpoint=!0;_def.endpoint=_currentInstance.addEndpoint(el,_def.def);_def.endpoint.setDeleteOnEmpty(!1)}
elInfo.def=_def;this.targetEndpointDefinitions[elid][type]=_def;_makeElementDropHandler(elInfo,p,dropOptions,p.isSource===!0,!0);elInfo.el._katavorioDrop[elInfo.el._katavorioDrop.length-1].targetDef=_def}.bind(this);var inputs=el.length&&el.constructor!==String?el:[el];for(var i=0,ii=inputs.length;i<ii;i++){_doOne(inputs[i])}
return this};this.unmakeTarget=function(el,doNotClearArrays){var info=_info(el);_currentInstance.destroyDroppable(info.el,"internal");if(!doNotClearArrays){delete this.targetEndpointDefinitions[info.id]}
return this};this.makeSource=function(el,params,referenceParams){var p=root.jsPlumb.extend({_jsPlumb:this},referenceParams);root.jsPlumb.extend(p,params);var type=p.connectionType||"default";var aae=_currentInstance.deriveEndpointAndAnchorSpec(type);p.endpoint=p.endpoint||aae.endpoints[0];p.anchor=p.anchor||aae.anchors[0];var maxConnections=p.maxConnections||-1,onMaxConnections=p.onMaxConnections,_doOne=function(elInfo){var elid=elInfo.id,_del=this.getElement(elInfo.el);this.sourceEndpointDefinitions[elid]=this.sourceEndpointDefinitions[elid]||{};_ensureContainer(elid);var _def={def:root.jsPlumb.extend({},p),uniqueEndpoint:p.uniqueEndpoint,maxConnections:maxConnections,enabled:!0};if(p.createEndpoint){_def.uniqueEndpoint=!0;_def.endpoint=_currentInstance.addEndpoint(el,_def.def);_def.endpoint.setDeleteOnEmpty(!1)}
this.sourceEndpointDefinitions[elid][type]=_def;elInfo.def=_def;var stopEvent=root.jsPlumb.dragEvents.stop,dragEvent=root.jsPlumb.dragEvents.drag,dragOptions=root.jsPlumb.extend({},p.dragOptions||{}),existingDrag=dragOptions.drag,existingStop=dragOptions.stop,ep=null,endpointAddedButNoDragYet=!1;dragOptions.scope=dragOptions.scope||p.scope;dragOptions[dragEvent]=_ju.wrap(dragOptions[dragEvent],function(){if(existingDrag){existingDrag.apply(this,arguments)}
endpointAddedButNoDragYet=!1});dragOptions[stopEvent]=_ju.wrap(dragOptions[stopEvent],function(){if(existingStop){existingStop.apply(this,arguments)}
this.currentlyDragging=!1;if(ep._jsPlumb!=null){var anchorDef=p.anchor||this.Defaults.Anchor,oldAnchor=ep.anchor,oldConnection=ep.connections[0];var newAnchor=this.makeAnchor(anchorDef,elid,this),_el=ep.element;if(newAnchor.positionFinder!=null){var elPosition=_currentInstance.getOffset(_el),elSize=this.getSize(_el),dropPosition={left:elPosition.left+(oldAnchor.x*elSize[0]),top:elPosition.top+(oldAnchor.y*elSize[1])},ap=newAnchor.positionFinder(dropPosition,elPosition,elSize,newAnchor.constructorParams);newAnchor.x=ap[0];newAnchor.y=ap[1]}
ep.setAnchor(newAnchor,!0);ep.repaint();this.repaint(ep.elementId);if(oldConnection!=null){this.repaint(oldConnection.targetId)}}}.bind(this));var mouseDownListener=function(e){if(e.which===3||e.button===2){return}
elid=this.getId(this.getElement(elInfo.el));var def=this.sourceEndpointDefinitions[elid][type];if(!def.enabled){return}
if(p.filter){var r=_ju.isString(p.filter)?selectorFilter(e,elInfo.el,p.filter,this,p.filterExclude):p.filter(e,elInfo.el);if(r===!1){return}}
var sourceCount=this.select({source:elid}).length;if(def.maxConnections>=0&&(sourceCount>=def.maxConnections)){if(onMaxConnections){onMaxConnections({element:elInfo.el,maxConnections:maxConnections},e)}
return!1}
var elxy=root.jsPlumb.getPositionOnElement(e,_del,_zoom);var tempEndpointParams={};root.jsPlumb.extend(tempEndpointParams,def.def);tempEndpointParams.isTemporarySource=!0;tempEndpointParams.anchor=[elxy[0],elxy[1],0,0];tempEndpointParams.dragOptions=dragOptions;if(def.def.scope){tempEndpointParams.scope=def.def.scope}
ep=this.addEndpoint(elid,tempEndpointParams);endpointAddedButNoDragYet=!0;ep.setDeleteOnEmpty(!0);if(def.uniqueEndpoint){if(!def.endpoint){def.endpoint=ep;ep.setDeleteOnEmpty(!1)}else{ep.finalEndpoint=def.endpoint}}
var _delTempEndpoint=function(){_currentInstance.off(ep.canvas,"mouseup",_delTempEndpoint);_currentInstance.off(elInfo.el,"mouseup",_delTempEndpoint);if(endpointAddedButNoDragYet){endpointAddedButNoDragYet=!1;_currentInstance.deleteEndpoint(ep)}};_currentInstance.on(ep.canvas,"mouseup",_delTempEndpoint);_currentInstance.on(elInfo.el,"mouseup",_delTempEndpoint);var payload={};if(def.def.extract){for(var att in def.def.extract){var v=(e.srcElement||e.target).getAttribute(att);if(v){payload[def.def.extract[att]]=v}}}
_currentInstance.trigger(ep.canvas,"mousedown",e,payload);_ju.consume(e)}.bind(this);this.on(elInfo.el,"mousedown",mouseDownListener);_def.trigger=mouseDownListener;if(p.filter&&(_ju.isString(p.filter)||_ju.isFunction(p.filter))){_currentInstance.setDragFilter(elInfo.el,p.filter)}
var dropOptions=root.jsPlumb.extend({},p.dropOptions||{});_makeElementDropHandler(elInfo,p,dropOptions,!0,p.isTarget===!0)}.bind(this);var inputs=el.length&&el.constructor!==String?el:[el];for(var i=0,ii=inputs.length;i<ii;i++){_doOne(_info(inputs[i]))}
return this};this.unmakeSource=function(el,connectionType,doNotClearArrays){var info=_info(el);_currentInstance.destroyDroppable(info.el,"internal");var eldefs=this.sourceEndpointDefinitions[info.id];if(eldefs){for(var def in eldefs){if(connectionType==null||connectionType===def){var mouseDownListener=eldefs[def].trigger;if(mouseDownListener){_currentInstance.off(info.el,"mousedown",mouseDownListener)}
if(!doNotClearArrays){delete this.sourceEndpointDefinitions[info.id][def]}}}}
return this};this.unmakeEverySource=function(){for(var i in this.sourceEndpointDefinitions){_currentInstance.unmakeSource(i,null,!0)}
this.sourceEndpointDefinitions={};return this};var _getScope=function(el,types,connectionType){types=_ju.isArray(types)?types:[types];var id=_getId(el);connectionType=connectionType||"default";for(var i=0;i<types.length;i++){var eldefs=this[types[i]][id];if(eldefs&&eldefs[connectionType]){return eldefs[connectionType].def.scope||this.Defaults.Scope}}}.bind(this);var _setScope=function(el,scope,types,connectionType){types=_ju.isArray(types)?types:[types];var id=_getId(el);connectionType=connectionType||"default";for(var i=0;i<types.length;i++){var eldefs=this[types[i]][id];if(eldefs&&eldefs[connectionType]){eldefs[connectionType].def.scope=scope}}}.bind(this);this.getScope=function(el,scope){return _getScope(el,["sourceEndpointDefinitions","targetEndpointDefinitions"])};this.getSourceScope=function(el){return _getScope(el,"sourceEndpointDefinitions")};this.getTargetScope=function(el){return _getScope(el,"targetEndpointDefinitions")};this.setScope=function(el,scope,connectionType){this.setSourceScope(el,scope,connectionType);this.setTargetScope(el,scope,connectionType)};this.setSourceScope=function(el,scope,connectionType){_setScope(el,scope,"sourceEndpointDefinitions",connectionType);this.setDragScope(el,scope)};this.setTargetScope=function(el,scope,connectionType){_setScope(el,scope,"targetEndpointDefinitions",connectionType);this.setDropScope(el,scope)};this.unmakeEveryTarget=function(){for(var i in this.targetEndpointDefinitions){_currentInstance.unmakeTarget(i,!0)}
this.targetEndpointDefinitions={};return this};var _setEnabled=function(type,el,state,toggle,connectionType){var a=type==="source"?this.sourceEndpointDefinitions:this.targetEndpointDefinitions,originalState,info,newState;connectionType=connectionType||"default";if(el.length&&!_ju.isString(el)){originalState=[];for(var i=0,ii=el.length;i<ii;i++){info=_info(el[i]);if(a[info.id]&&a[info.id][connectionType]){originalState[i]=a[info.id][connectionType].enabled;newState=toggle?!originalState[i]:state;a[info.id][connectionType].enabled=newState;_currentInstance[newState?"removeClass":"addClass"](info.el,"jtk-"+type+"-disabled")}}}else{info=_info(el);var id=info.id;if(a[id]&&a[id][connectionType]){originalState=a[id][connectionType].enabled;newState=toggle?!originalState:state;a[id][connectionType].enabled=newState;_currentInstance[newState?"removeClass":"addClass"](info.el,"jtk-"+type+"-disabled")}}
return originalState}.bind(this);var _first=function(el,fn){if(el!=null){if(_ju.isString(el)||!el.length){return fn.apply(this,[el])}else if(el.length){return fn.apply(this,[el[0]])}}}.bind(this);this.toggleSourceEnabled=function(el,connectionType){_setEnabled("source",el,null,!0,connectionType);return this.isSourceEnabled(el,connectionType)};this.setSourceEnabled=function(el,state,connectionType){return _setEnabled("source",el,state,null,connectionType)};this.isSource=function(el,connectionType){connectionType=connectionType||"default";return _first(el,function(_el){var eldefs=this.sourceEndpointDefinitions[_info(_el).id];return eldefs!=null&&eldefs[connectionType]!=null}.bind(this))};this.isSourceEnabled=function(el,connectionType){connectionType=connectionType||"default";return _first(el,function(_el){var sep=this.sourceEndpointDefinitions[_info(_el).id];return sep&&sep[connectionType]&&sep[connectionType].enabled===!0}.bind(this))};this.toggleTargetEnabled=function(el,connectionType){_setEnabled("target",el,null,!0,connectionType);return this.isTargetEnabled(el,connectionType)};this.isTarget=function(el,connectionType){connectionType=connectionType||"default";return _first(el,function(_el){var eldefs=this.targetEndpointDefinitions[_info(_el).id];return eldefs!=null&&eldefs[connectionType]!=null}.bind(this))};this.isTargetEnabled=function(el,connectionType){connectionType=connectionType||"default";return _first(el,function(_el){var tep=this.targetEndpointDefinitions[_info(_el).id];return tep&&tep[connectionType]&&tep[connectionType].enabled===!0}.bind(this))};this.setTargetEnabled=function(el,state,connectionType){return _setEnabled("target",el,state,null,connectionType)};this.ready=function(fn){_currentInstance.bind("ready",fn)};var _elEach=function(el,fn){if(typeof el==='object'&&el.length){for(var i=0,ii=el.length;i<ii;i++){fn(el[i])}}else{fn(el)}
return _currentInstance};this.repaint=function(el,ui,timestamp){return _elEach(el,function(_el){_draw(_el,ui,timestamp)})};this.revalidate=function(el,timestamp,isIdAlready){var elId=isIdAlready?el:_currentInstance.getId(el);_currentInstance.updateOffset({elId:elId,recalc:!0,timestamp:timestamp});var dm=_currentInstance.getDragManager();if(dm){dm.updateOffsets(elId)}
return _draw(el,null,timestamp)};this.repaintEverything=function(){var timestamp=jsPlumbUtil.uuid(),elId;for(elId in endpointsByElement){_currentInstance.updateOffset({elId:elId,recalc:!0,timestamp:timestamp})}
for(elId in endpointsByElement){_draw(elId,null,timestamp)}
return this};this.removeAllEndpoints=function(el,recurse,affectedElements){affectedElements=affectedElements||[];var _one=function(_el){var info=_info(_el),ebe=endpointsByElement[info.id],i,ii;if(ebe){affectedElements.push(info);for(i=0,ii=ebe.length;i<ii;i++){_currentInstance.deleteEndpoint(ebe[i],!1)}}
delete endpointsByElement[info.id];if(recurse){if(info.el&&info.el.nodeType!==3&&info.el.nodeType!==8){for(i=0,ii=info.el.childNodes.length;i<ii;i++){_one(info.el.childNodes[i])}}}};_one(el);return this};var _doRemove=function(info,affectedElements){_currentInstance.removeAllEndpoints(info.id,!0,affectedElements);var dm=_currentInstance.getDragManager();var _one=function(_info){if(dm){dm.elementRemoved(_info.id)}
_currentInstance.router.elementRemoved(_info.id);if(_currentInstance.isSource(_info.el)){_currentInstance.unmakeSource(_info.el)}
if(_currentInstance.isTarget(_info.el)){_currentInstance.unmakeTarget(_info.el)}
_currentInstance.destroyDraggable(_info.el);_currentInstance.destroyDroppable(_info.el);delete _currentInstance.floatingConnections[_info.id];delete managedElements[_info.id];delete offsets[_info.id];if(_info.el){_currentInstance.removeElement(_info.el);_info.el._jsPlumb=null}};for(var ae=1;ae<affectedElements.length;ae++){_one(affectedElements[ae])}
_one(info)};this.remove=function(el,doNotRepaint){var info=_info(el),affectedElements=[];if(info.text&&info.el.parentNode){info.el.parentNode.removeChild(info.el)}else if(info.id){_currentInstance.batch(function(){_doRemove(info,affectedElements)},doNotRepaint===!0)}
return _currentInstance};this.empty=function(el,doNotRepaint){var affectedElements=[];var _one=function(el,dontRemoveFocus){var info=_info(el);if(info.text){info.el.parentNode.removeChild(info.el)}else if(info.el){while(info.el.childNodes.length>0){_one(info.el.childNodes[0])}
if(!dontRemoveFocus){_doRemove(info,affectedElements)}}};_currentInstance.batch(function(){_one(el,!0)},doNotRepaint===!1);return _currentInstance};this.reset=function(doNotUnbindInstanceEventListeners){_currentInstance.silently(function(){_hoverSuspended=!1;_currentInstance.removeAllGroups();_currentInstance.removeGroupManager();_currentInstance.deleteEveryEndpoint();if(!doNotUnbindInstanceEventListeners){_currentInstance.unbind()}
this.targetEndpointDefinitions={};this.sourceEndpointDefinitions={};connections.length=0;if(this.doReset){this.doReset()}}.bind(this))};this.destroy=function(){this.reset();_container=null;_containerDelegations=null};var _clearObject=function(obj){if(obj.canvas&&obj.canvas.parentNode){obj.canvas.parentNode.removeChild(obj.canvas)}
obj.cleanup();obj.destroy()};this.clear=function(){_currentInstance.select().each(_clearObject);_currentInstance.selectEndpoints().each(_clearObject);endpointsByElement={};endpointsByUUID={}};this.setDefaultScope=function(scope){DEFAULT_SCOPE=scope;return _currentInstance};this.deriveEndpointAndAnchorSpec=function(type,dontPrependDefault){var bits=((dontPrependDefault?"":"default ")+type).split(/[\s]/),eps=null,ep=null,a=null,as=null;for(var i=0;i<bits.length;i++){var _t=_currentInstance.getType(bits[i],"connection");if(_t){if(_t.endpoints){eps=_t.endpoints}
if(_t.endpoint){ep=_t.endpoint}
if(_t.anchors){as=_t.anchors}
if(_t.anchor){a=_t.anchor}}}
return{endpoints:eps?eps:[ep,ep],anchors:as?as:[a,a]}};this.setId=function(el,newId,doNotSetAttribute){var id;if(_ju.isString(el)){id=el}else{el=this.getElement(el);id=this.getId(el)}
var sConns=this.getConnections({source:id,scope:'*'},!0),tConns=this.getConnections({target:id,scope:'*'},!0);newId=""+newId;if(!doNotSetAttribute){el=this.getElement(id);this.setAttribute(el,"id",newId)}else{el=this.getElement(newId)}
endpointsByElement[newId]=endpointsByElement[id]||[];for(var i=0,ii=endpointsByElement[newId].length;i<ii;i++){endpointsByElement[newId][i].setElementId(newId);endpointsByElement[newId][i].setReferenceElement(el)}
delete endpointsByElement[id];this.sourceEndpointDefinitions[newId]=this.sourceEndpointDefinitions[id];delete this.sourceEndpointDefinitions[id];this.targetEndpointDefinitions[newId]=this.targetEndpointDefinitions[id];delete this.targetEndpointDefinitions[id];this.router.changeId(id,newId);var dm=this.getDragManager();if(dm){dm.changeId(id,newId)}
managedElements[newId]=managedElements[id];delete managedElements[id];var _conns=function(list,epIdx,type){for(var i=0,ii=list.length;i<ii;i++){list[i].endpoints[epIdx].setElementId(newId);list[i].endpoints[epIdx].setReferenceElement(el);list[i][type+"Id"]=newId;list[i][type]=el}};_conns(sConns,0,"source");_conns(tConns,1,"target");this.repaint(newId)};this.setDebugLog=function(debugLog){log=debugLog};this.setSuspendDrawing=function(val,repaintAfterwards){var curVal=_suspendDrawing;_suspendDrawing=val;if(val){_suspendedAt=new Date().getTime()}else{_suspendedAt=null}
if(repaintAfterwards){this.repaintEverything()}
return curVal};this.isSuspendDrawing=function(){return _suspendDrawing};this.getSuspendedAt=function(){return _suspendedAt};this.batch=function(fn,doNotRepaintAfterwards){var _wasSuspended=this.isSuspendDrawing();if(!_wasSuspended){this.setSuspendDrawing(!0)}
try{fn()}catch(e){_ju.log("Function run while suspended failed",e)}
if(!_wasSuspended){this.setSuspendDrawing(!1,!doNotRepaintAfterwards)}};this.doWhileSuspended=this.batch;this.getCachedData=_getCachedData;this.show=function(el,changeEndpoints){_setVisible(el,"block",changeEndpoints);return _currentInstance};this.toggleVisible=_toggleVisible;this.addListener=this.bind;var floatingConnections=[];this.registerFloatingConnection=function(info,conn,ep){floatingConnections[info.id]=conn;_ju.addToList(endpointsByElement,info.id,ep)};this.getFloatingConnectionFor=function(id){return floatingConnections[id]};this.listManager=new root.jsPlumbListManager(this,this.Defaults.ListStyle)};_ju.extend(root.jsPlumbInstance,_ju.EventGenerator,{setAttribute:function(el,a,v){this.setAttribute(el,a,v)},getAttribute:function(el,a){return this.getAttribute(root.jsPlumb.getElement(el),a)},convertToFullOverlaySpec:function(spec){if(_ju.isString(spec)){spec=[spec,{}]}
spec[1].id=spec[1].id||_ju.uuid();return spec},registerConnectionType:function(id,type){this._connectionTypes[id]=root.jsPlumb.extend({},type);if(type.overlays){var to={};for(var i=0;i<type.overlays.length;i++){var fo=this.convertToFullOverlaySpec(type.overlays[i]);to[fo[1].id]=fo}
this._connectionTypes[id].overlays=to}},registerConnectionTypes:function(types){for(var i in types){this.registerConnectionType(i,types[i])}},registerEndpointType:function(id,type){this._endpointTypes[id]=root.jsPlumb.extend({},type);if(type.overlays){var to={};for(var i=0;i<type.overlays.length;i++){var fo=this.convertToFullOverlaySpec(type.overlays[i]);to[fo[1].id]=fo}
this._endpointTypes[id].overlays=to}},registerEndpointTypes:function(types){for(var i in types){this.registerEndpointType(i,types[i])}},getType:function(id,typeDescriptor){return typeDescriptor==="connection"?this._connectionTypes[id]:this._endpointTypes[id]},setIdChanged:function(oldId,newId){this.setId(oldId,newId,!0)},setParent:function(el,newParent){var _dom=this.getElement(el),_id=this.getId(_dom),_pdom=this.getElement(newParent),_pid=this.getId(_pdom),dm=this.getDragManager();_dom.parentNode.removeChild(_dom);_pdom.appendChild(_dom);if(dm){dm.setParent(_dom,_id,_pdom,_pid)}},extend:function(o1,o2,names){var i;if(names){for(i=0;i<names.length;i++){o1[names[i]]=o2[names[i]]}}else{for(i in o2){o1[i]=o2[i]}}
return o1},floatingConnections:{},getFloatingAnchorIndex:function(jpc){return jpc.endpoints[0].isFloating()?0:jpc.endpoints[1].isFloating()?1:-1},proxyConnection:function(connection,index,proxyEl,proxyElId,endpointGenerator,anchorGenerator){var proxyEp,originalElementId=connection.endpoints[index].elementId,originalEndpoint=connection.endpoints[index];connection.proxies=connection.proxies||[];if(connection.proxies[index]){proxyEp=connection.proxies[index].ep}else{proxyEp=this.addEndpoint(proxyEl,{endpoint:endpointGenerator(connection,index),anchor:anchorGenerator(connection,index),parameters:{isProxyEndpoint:!0}})}
proxyEp.setDeleteOnEmpty(!0);connection.proxies[index]={ep:proxyEp,originalEp:originalEndpoint};if(index===0){this.router.sourceOrTargetChanged(originalElementId,proxyElId,connection,proxyEl,0)}else{this.router.sourceOrTargetChanged(originalElementId,proxyElId,connection,proxyEl,1)}
originalEndpoint.detachFromConnection(connection,null,!0);proxyEp.connections=[connection];connection.endpoints[index]=proxyEp;originalEndpoint.setVisible(!1);connection.setVisible(!0);this.revalidate(proxyEl)},unproxyConnection:function(connection,index,proxyElId){if(connection._jsPlumb==null||connection.proxies==null||connection.proxies[index]==null){return}
var originalElement=connection.proxies[index].originalEp.element,originalElementId=connection.proxies[index].originalEp.elementId;connection.endpoints[index]=connection.proxies[index].originalEp;if(index===0){this.router.sourceOrTargetChanged(proxyElId,originalElementId,connection,originalElement,0)}else{this.router.sourceOrTargetChanged(proxyElId,originalElementId,connection,originalElement,1)}
connection.proxies[index].ep.detachFromConnection(connection,null);connection.proxies[index].originalEp.addConnection(connection);if(connection.isVisible()){connection.proxies[index].originalEp.setVisible(!0)}
delete connection.proxies[index]}});var jsPlumb=new jsPlumbInstance();root.jsPlumb=jsPlumb;jsPlumb.getInstance=function(_defaults,overrideFns){var j=new jsPlumbInstance(_defaults);if(overrideFns){for(var ovf in overrideFns){j[ovf]=overrideFns[ovf]}}
j.init();return j};jsPlumb.each=function(spec,fn){if(spec==null){return}
if(typeof spec==="string"){fn(jsPlumb.getElement(spec))}else if(spec.length!=null){for(var i=0;i<spec.length;i++){fn(jsPlumb.getElement(spec[i]))}}else{fn(spec)}};if(typeof exports!=='undefined'){exports.jsPlumb=jsPlumb}}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_jp=root.jsPlumb,_ju=root.jsPlumbUtil;var _internalLabelOverlayId="__label",_makeLabelOverlay=function(component,params){var _params={cssClass:params.cssClass,labelStyle:component.labelStyle,id:_internalLabelOverlayId,component:component,_jsPlumb:component._jsPlumb.instance},mergedParams=_jp.extend(_params,params);return new _jp.Overlays[component._jsPlumb.instance.getRenderMode()].Label(mergedParams)},_processOverlay=function(component,o){var _newOverlay=null;if(_ju.isArray(o)){var type=o[0],p=_jp.extend({component:component,_jsPlumb:component._jsPlumb.instance},o[1]);if(o.length===3){_jp.extend(p,o[2])}
_newOverlay=new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][type](p)}else if(o.constructor===String){_newOverlay=new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][o]({component:component,_jsPlumb:component._jsPlumb.instance})}else{_newOverlay=o}
_newOverlay.id=_newOverlay.id||_ju.uuid();component.cacheTypeItem("overlay",_newOverlay,_newOverlay.id);component._jsPlumb.overlays[_newOverlay.id]=_newOverlay;return _newOverlay};_jp.OverlayCapableJsPlumbUIComponent=function(params){root.jsPlumbUIComponent.apply(this,arguments);this._jsPlumb.overlays={};this._jsPlumb.overlayPositions={};if(params.label){this.getDefaultType().overlays[_internalLabelOverlayId]=["Label",{label:params.label,location:params.labelLocation||this.defaultLabelLocation||0.5,labelStyle:params.labelStyle||this._jsPlumb.instance.Defaults.LabelStyle,id:_internalLabelOverlayId}]}
this.setListenerComponent=function(c){if(this._jsPlumb){for(var i in this._jsPlumb.overlays){this._jsPlumb.overlays[i].setListenerComponent(c)}}}};_jp.OverlayCapableJsPlumbUIComponent.applyType=function(component,t){if(t.overlays){var keep={},i;for(i in t.overlays){var existing=component._jsPlumb.overlays[t.overlays[i][1].id];if(existing){existing.updateFrom(t.overlays[i][1]);keep[t.overlays[i][1].id]=!0;existing.reattach(component._jsPlumb.instance,component)}else{var c=component.getCachedTypeItem("overlay",t.overlays[i][1].id);if(c!=null){c.reattach(component._jsPlumb.instance,component);c.setVisible(!0);c.updateFrom(t.overlays[i][1]);component._jsPlumb.overlays[c.id]=c}else{c=component.addOverlay(t.overlays[i],!0)}
keep[c.id]=!0}}
for(i in component._jsPlumb.overlays){if(keep[component._jsPlumb.overlays[i].id]==null){component.removeOverlay(component._jsPlumb.overlays[i].id,!0)}}}};_ju.extend(_jp.OverlayCapableJsPlumbUIComponent,root.jsPlumbUIComponent,{setHover:function(hover,ignoreAttachedElements){if(this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged()){for(var i in this._jsPlumb.overlays){this._jsPlumb.overlays[i][hover?"addClass":"removeClass"](this._jsPlumb.instance.hoverClass)}}},addOverlay:function(overlay,doNotRepaint){var o=_processOverlay(this,overlay);if(this.getData&&o.type==="Label"&&_ju.isArray(overlay)){var d=this.getData(),p=overlay[1];if(d){var locationAttribute=p.labelLocationAttribute||"labelLocation";var loc=d?d[locationAttribute]:null;if(loc){o.loc=loc}}}
if(!doNotRepaint){this.repaint()}
return o},getOverlay:function(id){return this._jsPlumb.overlays[id]},getOverlays:function(){return this._jsPlumb.overlays},hideOverlay:function(id){var o=this.getOverlay(id);if(o){o.hide()}},hideOverlays:function(){for(var i in this._jsPlumb.overlays){this._jsPlumb.overlays[i].hide()}},showOverlay:function(id){var o=this.getOverlay(id);if(o){o.show()}},showOverlays:function(){for(var i in this._jsPlumb.overlays){this._jsPlumb.overlays[i].show()}},removeAllOverlays:function(doNotRepaint){for(var i in this._jsPlumb.overlays){if(this._jsPlumb.overlays[i].cleanup){this._jsPlumb.overlays[i].cleanup()}}
this._jsPlumb.overlays={};this._jsPlumb.overlayPositions=null;this._jsPlumb.overlayPlacements={};if(!doNotRepaint){this.repaint()}},removeOverlay:function(overlayId,dontCleanup){var o=this._jsPlumb.overlays[overlayId];if(o){o.setVisible(!1);if(!dontCleanup&&o.cleanup){o.cleanup()}
delete this._jsPlumb.overlays[overlayId];if(this._jsPlumb.overlayPositions){delete this._jsPlumb.overlayPositions[overlayId]}
if(this._jsPlumb.overlayPlacements){delete this._jsPlumb.overlayPlacements[overlayId]}}},removeOverlays:function(){for(var i=0,j=arguments.length;i<j;i++){this.removeOverlay(arguments[i])}},moveParent:function(newParent){if(this.bgCanvas){this.bgCanvas.parentNode.removeChild(this.bgCanvas);newParent.appendChild(this.bgCanvas)}
if(this.canvas&&this.canvas.parentNode){this.canvas.parentNode.removeChild(this.canvas);newParent.appendChild(this.canvas);for(var i in this._jsPlumb.overlays){if(this._jsPlumb.overlays[i].isAppendedAtTopLevel){var el=this._jsPlumb.overlays[i].getElement();el.parentNode.removeChild(el);newParent.appendChild(el)}}}},getLabel:function(){var lo=this.getOverlay(_internalLabelOverlayId);return lo!=null?lo.getLabel():null},getLabelOverlay:function(){return this.getOverlay(_internalLabelOverlayId)},setLabel:function(l){var lo=this.getOverlay(_internalLabelOverlayId);if(!lo){var params=l.constructor===String||l.constructor===Function?{label:l}:l;lo=_makeLabelOverlay(this,params);this._jsPlumb.overlays[_internalLabelOverlayId]=lo}else{if(l.constructor===String||l.constructor===Function){lo.setLabel(l)}else{if(l.label){lo.setLabel(l.label)}
if(l.location){lo.setLocation(l.location)}}}
if(!this._jsPlumb.instance.isSuspendDrawing()){this.repaint()}},cleanup:function(force){for(var i in this._jsPlumb.overlays){this._jsPlumb.overlays[i].cleanup(force);this._jsPlumb.overlays[i].destroy(force)}
if(force){this._jsPlumb.overlays={};this._jsPlumb.overlayPositions=null}},setVisible:function(v){this[v?"showOverlays":"hideOverlays"]()},setAbsoluteOverlayPosition:function(overlay,xy){this._jsPlumb.overlayPositions[overlay.id]=xy},getAbsoluteOverlayPosition:function(overlay){return this._jsPlumb.overlayPositions?this._jsPlumb.overlayPositions[overlay.id]:null},_clazzManip:function(action,clazz,dontUpdateOverlays){if(!dontUpdateOverlays){for(var i in this._jsPlumb.overlays){this._jsPlumb.overlays[i][action+"Class"](clazz)}}},addClass:function(clazz,dontUpdateOverlays){this._clazzManip("add",clazz,dontUpdateOverlays)},removeClass:function(clazz,dontUpdateOverlays){this._clazzManip("remove",clazz,dontUpdateOverlays)}})}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_jp=root.jsPlumb,_ju=root.jsPlumbUtil;var _makeConnectionDragHandler=function(endpoint,placeholder,_jsPlumb){var stopped=!1;return{drag:function(){if(stopped){stopped=!1;return!0}
if(placeholder.element){var _ui=_jsPlumb.getUIPosition(arguments,_jsPlumb.getZoom());if(_ui!=null){_jsPlumb.setPosition(placeholder.element,_ui)}
_jsPlumb.repaint(placeholder.element,_ui);endpoint.paint({anchorPoint:endpoint.anchor.getCurrentLocation({element:endpoint})})}},stopDrag:function(){stopped=!0}}};var _makeDraggablePlaceholder=function(placeholder,_jsPlumb,ipco,ips){var n=_jsPlumb.createElement("div",{position:"absolute"});_jsPlumb.appendElement(n);var id=_jsPlumb.getId(n);_jsPlumb.setPosition(n,ipco);n.style.width=ips[0]+"px";n.style.height=ips[1]+"px";_jsPlumb.manage(id,n,!0);placeholder.id=id;placeholder.element=n};var _makeFloatingEndpoint=function(paintStyle,referenceAnchor,endpoint,referenceCanvas,sourceElement,_jsPlumb,_newEndpoint,scope){var floatingAnchor=new _jp.FloatingAnchor({reference:referenceAnchor,referenceCanvas:referenceCanvas,jsPlumbInstance:_jsPlumb});return _newEndpoint({paintStyle:paintStyle,endpoint:endpoint,anchor:floatingAnchor,source:sourceElement,scope:scope})};var typeParameters=["connectorStyle","connectorHoverStyle","connectorOverlays","connector","connectionType","connectorClass","connectorHoverClass"];var findConnectionToUseForDynamicAnchor=function(ep,elementWithPrecedence){var idx=0;if(elementWithPrecedence!=null){for(var i=0;i<ep.connections.length;i++){if(ep.connections[i].sourceId===elementWithPrecedence||ep.connections[i].targetId===elementWithPrecedence){idx=i;break}}}
return ep.connections[idx]};_jp.Endpoint=function(params){var _jsPlumb=params._jsPlumb,_newConnection=params.newConnection,_newEndpoint=params.newEndpoint;this.idPrefix="_jsplumb_e_";this.defaultLabelLocation=[0.5,0.5];this.defaultOverlayKeys=["Overlays","EndpointOverlays"];_jp.OverlayCapableJsPlumbUIComponent.apply(this,arguments);this.appendToDefaultType({connectionType:params.connectionType,maxConnections:params.maxConnections==null?this._jsPlumb.instance.Defaults.MaxConnections:params.maxConnections,paintStyle:params.endpointStyle||params.paintStyle||params.style||this._jsPlumb.instance.Defaults.EndpointStyle||_jp.Defaults.EndpointStyle,hoverPaintStyle:params.endpointHoverStyle||params.hoverPaintStyle||this._jsPlumb.instance.Defaults.EndpointHoverStyle||_jp.Defaults.EndpointHoverStyle,connectorStyle:params.connectorStyle,connectorHoverStyle:params.connectorHoverStyle,connectorClass:params.connectorClass,connectorHoverClass:params.connectorHoverClass,connectorOverlays:params.connectorOverlays,connector:params.connector,connectorTooltip:params.connectorTooltip});this._jsPlumb.enabled=!(params.enabled===!1);this._jsPlumb.visible=!0;this.element=_jp.getElement(params.source);this._jsPlumb.uuid=params.uuid;this._jsPlumb.floatingEndpoint=null;var inPlaceCopy=null;if(this._jsPlumb.uuid){params.endpointsByUUID[this._jsPlumb.uuid]=this}
this.elementId=params.elementId;this.dragProxy=params.dragProxy;this._jsPlumb.connectionCost=params.connectionCost;this._jsPlumb.connectionsDirected=params.connectionsDirected;this._jsPlumb.currentAnchorClass="";this._jsPlumb.events={};var deleteOnEmpty=params.deleteOnEmpty===!0;this.setDeleteOnEmpty=function(d){deleteOnEmpty=d};var _updateAnchorClass=function(){var oldAnchorClass=_jsPlumb.endpointAnchorClassPrefix+"-"+this._jsPlumb.currentAnchorClass;this._jsPlumb.currentAnchorClass=this.anchor.getCssClass();var anchorClass=_jsPlumb.endpointAnchorClassPrefix+(this._jsPlumb.currentAnchorClass?"-"+this._jsPlumb.currentAnchorClass:"");this.removeClass(oldAnchorClass);this.addClass(anchorClass);_jp.updateClasses(this.element,anchorClass,oldAnchorClass)}.bind(this);this.prepareAnchor=function(anchorParams){var a=this._jsPlumb.instance.makeAnchor(anchorParams,this.elementId,_jsPlumb);a.bind("anchorChanged",function(currentAnchor){this.fire("anchorChanged",{endpoint:this,anchor:currentAnchor});_updateAnchorClass()}.bind(this));return a};this.setPreparedAnchor=function(anchor,doNotRepaint){this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId);this.anchor=anchor;_updateAnchorClass();if(!doNotRepaint){this._jsPlumb.instance.repaint(this.elementId)}
return this};this.setAnchor=function(anchorParams,doNotRepaint){var a=this.prepareAnchor(anchorParams);this.setPreparedAnchor(a,doNotRepaint);return this};var internalHover=function(state){if(this.connections.length>0){for(var i=0;i<this.connections.length;i++){this.connections[i].setHover(state,!1)}}else{this.setHover(state)}}.bind(this);this.bind("mouseover",function(){internalHover(!0)});this.bind("mouseout",function(){internalHover(!1)});if(!params._transient){this._jsPlumb.instance.router.addEndpoint(this,this.elementId)}
this.prepareEndpoint=function(ep,typeId){var _e=function(t,p){var rm=_jsPlumb.getRenderMode();if(_jp.Endpoints[rm][t]){return new _jp.Endpoints[rm][t](p)}
if(!_jsPlumb.Defaults.DoNotThrowErrors){throw{msg:"jsPlumb: unknown endpoint type '"+t+"'"}}};var endpointArgs={_jsPlumb:this._jsPlumb.instance,cssClass:params.cssClass,container:params.container,tooltip:params.tooltip,connectorTooltip:params.connectorTooltip,endpoint:this};var endpoint;if(_ju.isString(ep)){endpoint=_e(ep,endpointArgs)}else if(_ju.isArray(ep)){endpointArgs=_ju.merge(ep[1],endpointArgs);endpoint=_e(ep[0],endpointArgs)}else{endpoint=ep.clone()}
endpoint.clone=function(){if(_ju.isString(ep)){return _e(ep,endpointArgs)}else if(_ju.isArray(ep)){endpointArgs=_ju.merge(ep[1],endpointArgs);return _e(ep[0],endpointArgs)}}.bind(this);endpoint.typeId=typeId;return endpoint};this.setEndpoint=function(ep,doNotRepaint){var _ep=this.prepareEndpoint(ep);this.setPreparedEndpoint(_ep,!0)};this.setPreparedEndpoint=function(ep,doNotRepaint){if(this.endpoint!=null){this.endpoint.cleanup();this.endpoint.destroy()}
this.endpoint=ep;this.type=this.endpoint.type;this.canvas=this.endpoint.canvas};_jp.extend(this,params,typeParameters);this.isSource=params.isSource||!1;this.isTemporarySource=params.isTemporarySource||!1;this.isTarget=params.isTarget||!1;this.connections=params.connections||[];this.connectorPointerEvents=params["connector-pointer-events"];this.scope=params.scope||_jsPlumb.getDefaultScope();this.timestamp=null;this.reattachConnections=params.reattach||_jsPlumb.Defaults.ReattachConnections;this.connectionsDetachable=_jsPlumb.Defaults.ConnectionsDetachable;if(params.connectionsDetachable===!1||params.detachable===!1){this.connectionsDetachable=!1}
this.dragAllowedWhenFull=params.dragAllowedWhenFull!==!1;if(params.onMaxConnections){this.bind("maxConnections",params.onMaxConnections)}
this.addConnection=function(connection){this.connections.push(connection);this[(this.connections.length>0?"add":"remove")+"Class"](_jsPlumb.endpointConnectedClass);this[(this.isFull()?"add":"remove")+"Class"](_jsPlumb.endpointFullClass)};this.detachFromConnection=function(connection,idx,doNotCleanup){idx=idx==null?this.connections.indexOf(connection):idx;if(idx>=0){this.connections.splice(idx,1);this[(this.connections.length>0?"add":"remove")+"Class"](_jsPlumb.endpointConnectedClass);this[(this.isFull()?"add":"remove")+"Class"](_jsPlumb.endpointFullClass)}
if(!doNotCleanup&&deleteOnEmpty&&this.connections.length===0){_jsPlumb.deleteObject({endpoint:this,fireEvent:!1,deleteAttachedObjects:doNotCleanup!==!0})}};this.deleteEveryConnection=function(params){var c=this.connections.length;for(var i=0;i<c;i++){_jsPlumb.deleteConnection(this.connections[0],params)}};this.detachFrom=function(targetEndpoint,fireEvent,originalEvent){var c=[];for(var i=0;i<this.connections.length;i++){if(this.connections[i].endpoints[1]===targetEndpoint||this.connections[i].endpoints[0]===targetEndpoint){c.push(this.connections[i])}}
for(var j=0,count=c.length;j<count;j++){_jsPlumb.deleteConnection(c[0])}
return this};this.getElement=function(){return this.element};this.setElement=function(el){var parentId=this._jsPlumb.instance.getId(el),curId=this.elementId;_ju.removeWithFunction(params.endpointsByElement[this.elementId],function(e){return e.id===this.id}.bind(this));this.element=_jp.getElement(el);this.elementId=_jsPlumb.getId(this.element);_jsPlumb.router.rehomeEndpoint(this,curId,this.element);_jsPlumb.dragManager.endpointAdded(this.element);_ju.addToList(params.endpointsByElement,parentId,this);return this};this.makeInPlaceCopy=function(){var loc=this.anchor.getCurrentLocation({element:this}),o=this.anchor.getOrientation(this),acc=this.anchor.getCssClass(),inPlaceAnchor={bind:function(){},compute:function(){return[loc[0],loc[1]]},getCurrentLocation:function(){return[loc[0],loc[1]]},getOrientation:function(){return o},getCssClass:function(){return acc}};return _newEndpoint({dropOptions:params.dropOptions,anchor:inPlaceAnchor,source:this.element,paintStyle:this.getPaintStyle(),endpoint:params.hideOnDrag?"Blank":this.endpoint,_transient:!0,scope:this.scope,reference:this})};this.connectorSelector=function(){return this.connections[0]};this.setStyle=this.setPaintStyle;this.paint=function(params){params=params||{};var timestamp=params.timestamp,recalc=!(params.recalc===!1);if(!timestamp||this.timestamp!==timestamp){var info=_jsPlumb.updateOffset({elId:this.elementId,timestamp:timestamp});var xy=params.offset?params.offset.o:info.o;if(xy!=null){var ap=params.anchorPoint,connectorPaintStyle=params.connectorPaintStyle;if(ap==null){var wh=params.dimensions||info.s,anchorParams={xy:[xy.left,xy.top],wh:wh,element:this,timestamp:timestamp};if(recalc&&this.anchor.isDynamic&&this.connections.length>0){var c=findConnectionToUseForDynamicAnchor(this,params.elementWithPrecedence),oIdx=c.endpoints[0]===this?1:0,oId=oIdx===0?c.sourceId:c.targetId,oInfo=_jsPlumb.getCachedData(oId),oOffset=oInfo.o,oWH=oInfo.s;anchorParams.index=oIdx===0?1:0;anchorParams.connection=c;anchorParams.txy=[oOffset.left,oOffset.top];anchorParams.twh=oWH;anchorParams.tElement=c.endpoints[oIdx];anchorParams.tRotation=_jsPlumb.getRotation(oId)}else if(this.connections.length>0){anchorParams.connection=this.connections[0]}
anchorParams.rotation=_jsPlumb.getRotation(this.elementId);ap=this.anchor.compute(anchorParams)}
this.endpoint.compute(ap,this.anchor.getOrientation(this),this._jsPlumb.paintStyleInUse,connectorPaintStyle||this.paintStyleInUse);this.endpoint.paint(this._jsPlumb.paintStyleInUse,this.anchor);this.timestamp=timestamp;for(var i in this._jsPlumb.overlays){if(this._jsPlumb.overlays.hasOwnProperty(i)){var o=this._jsPlumb.overlays[i];if(o.isVisible()){this._jsPlumb.overlayPlacements[i]=o.draw(this.endpoint,this._jsPlumb.paintStyleInUse);o.paint(this._jsPlumb.overlayPlacements[i])}}}}}};this.getTypeDescriptor=function(){return"endpoint"};this.isVisible=function(){return this._jsPlumb.visible};this.repaint=this.paint;var draggingInitialised=!1;this.initDraggable=function(){if(!draggingInitialised&&_jp.isDragSupported(this.element)){var placeholderInfo={id:null,element:null},jpc=null,existingJpc=!1,existingJpcParams=null,_dragHandler=_makeConnectionDragHandler(this,placeholderInfo,_jsPlumb),dragOptions=params.dragOptions||{},defaultOpts={},startEvent=_jp.dragEvents.start,stopEvent=_jp.dragEvents.stop,dragEvent=_jp.dragEvents.drag,beforeStartEvent=_jp.dragEvents.beforeStart,payload;var beforeStart=function(beforeStartParams){payload=beforeStartParams.e.payload||{}};var start=function(startParams){jpc=this.connectorSelector();var _continue=!0;if(!this.isEnabled()){_continue=!1}
if(jpc==null&&!this.isSource&&!this.isTemporarySource){_continue=!1}
if(this.isSource&&this.isFull()&&!(jpc!=null&&this.dragAllowedWhenFull)){_continue=!1}
if(jpc!=null&&!jpc.isDetachable(this)){if(this.isFull()){_continue=!1}else{jpc=null}}
var beforeDrag=_jsPlumb.checkCondition(jpc==null?"beforeDrag":"beforeStartDetach",{endpoint:this,source:this.element,sourceId:this.elementId,connection:jpc});if(beforeDrag===!1){_continue=!1}else if(typeof beforeDrag==="object"){_jp.extend(beforeDrag,payload||{})}else{beforeDrag=payload||{}}
if(_continue===!1){if(_jsPlumb.stopDrag){_jsPlumb.stopDrag(this.canvas)}
_dragHandler.stopDrag();return!1}
for(var i=0;i<this.connections.length;i++){this.connections[i].setHover(!1)}
this.addClass("endpointDrag");_jsPlumb.setConnectionBeingDragged(!0);if(jpc&&!this.isFull()&&this.isSource){jpc=null}
_jsPlumb.updateOffset({elId:this.elementId});var ipco=this._jsPlumb.instance.getOffset(this.canvas),canvasElement=this.canvas,ips=this._jsPlumb.instance.getSize(this.canvas);_makeDraggablePlaceholder(placeholderInfo,_jsPlumb,ipco,ips);_jsPlumb.setAttributes(this.canvas,{"dragId":placeholderInfo.id,"elId":this.elementId});var endpointToFloat=this.dragProxy||this.endpoint;if(this.dragProxy==null&&this.connectionType!=null){var aae=this._jsPlumb.instance.deriveEndpointAndAnchorSpec(this.connectionType);if(aae.endpoints[1]){endpointToFloat=aae.endpoints[1]}}
var centerAnchor=this._jsPlumb.instance.makeAnchor("Center");centerAnchor.isFloating=!0;this._jsPlumb.floatingEndpoint=_makeFloatingEndpoint(this.getPaintStyle(),centerAnchor,endpointToFloat,this.canvas,placeholderInfo.element,_jsPlumb,_newEndpoint,this.scope);var _savedAnchor=this._jsPlumb.floatingEndpoint.anchor;if(jpc==null){this.setHover(!1,!1);jpc=_newConnection({sourceEndpoint:this,targetEndpoint:this._jsPlumb.floatingEndpoint,source:this.element,target:placeholderInfo.element,anchors:[this.anchor,this._jsPlumb.floatingEndpoint.anchor],paintStyle:params.connectorStyle,hoverPaintStyle:params.connectorHoverStyle,connector:params.connector,overlays:params.connectorOverlays,type:this.connectionType,cssClass:this.connectorClass,hoverClass:this.connectorHoverClass,scope:params.scope,data:beforeDrag});jpc.pending=!0;jpc.addClass(_jsPlumb.draggingClass);this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);this._jsPlumb.floatingEndpoint.anchor=_savedAnchor;_jsPlumb.fire("connectionDrag",jpc);_jsPlumb.router.newConnection(jpc)}else{existingJpc=!0;jpc.setHover(!1);var anchorIdx=jpc.endpoints[0].id===this.id?0:1;this.detachFromConnection(jpc,null,!0);var dragScope=_jsPlumb.getDragScope(canvasElement);_jsPlumb.setAttribute(this.canvas,"originalScope",dragScope);_jsPlumb.fire("connectionDrag",jpc);if(anchorIdx===0){existingJpcParams=[jpc.source,jpc.sourceId,canvasElement,dragScope];_jsPlumb.router.sourceOrTargetChanged(jpc.endpoints[anchorIdx].elementId,placeholderInfo.id,jpc,placeholderInfo.element,0)}else{existingJpcParams=[jpc.target,jpc.targetId,canvasElement,dragScope];_jsPlumb.router.sourceOrTargetChanged(jpc.endpoints[anchorIdx].elementId,placeholderInfo.id,jpc,placeholderInfo.element,1)}
jpc.suspendedEndpoint=jpc.endpoints[anchorIdx];jpc.suspendedElement=jpc.endpoints[anchorIdx].getElement();jpc.suspendedElementId=jpc.endpoints[anchorIdx].elementId;jpc.suspendedElementType=anchorIdx===0?"source":"target";jpc.suspendedEndpoint.setHover(!1);this._jsPlumb.floatingEndpoint.referenceEndpoint=jpc.suspendedEndpoint;jpc.endpoints[anchorIdx]=this._jsPlumb.floatingEndpoint;jpc.addClass(_jsPlumb.draggingClass);this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass)}
_jsPlumb.registerFloatingConnection(placeholderInfo,jpc,this._jsPlumb.floatingEndpoint);_jsPlumb.currentlyDragging=!0}.bind(this);var stop=function(){_jsPlumb.setConnectionBeingDragged(!1);if(jpc&&jpc.endpoints!=null){var originalEvent=_jsPlumb.getDropEvent(arguments);var idx=_jsPlumb.getFloatingAnchorIndex(jpc);jpc.endpoints[idx===0?1:0].anchor.locked=!1;jpc.removeClass(_jsPlumb.draggingClass);if(this._jsPlumb&&(jpc.deleteConnectionNow||jpc.endpoints[idx]===this._jsPlumb.floatingEndpoint)){if(existingJpc&&jpc.suspendedEndpoint){if(idx===0){jpc.floatingElement=jpc.source;jpc.floatingId=jpc.sourceId;jpc.floatingEndpoint=jpc.endpoints[0];jpc.floatingIndex=0;jpc.source=existingJpcParams[0];jpc.sourceId=existingJpcParams[1]}else{jpc.floatingElement=jpc.target;jpc.floatingId=jpc.targetId;jpc.floatingEndpoint=jpc.endpoints[1];jpc.floatingIndex=1;jpc.target=existingJpcParams[0];jpc.targetId=existingJpcParams[1]}
var fe=this._jsPlumb.floatingEndpoint;_jsPlumb.setDragScope(existingJpcParams[2],existingJpcParams[3]);jpc.endpoints[idx]=jpc.suspendedEndpoint;if(jpc.isReattach()||jpc._forceReattach||jpc._forceDetach||!_jsPlumb.deleteConnection(jpc,{originalEvent:originalEvent})){jpc.setHover(!1);jpc._forceDetach=null;jpc._forceReattach=null;this._jsPlumb.floatingEndpoint.detachFromConnection(jpc);jpc.suspendedEndpoint.addConnection(jpc);if(idx===1){_jsPlumb.router.sourceOrTargetChanged(jpc.floatingId,jpc.targetId,jpc,jpc.target,idx)}else{_jsPlumb.router.sourceOrTargetChanged(jpc.floatingId,jpc.sourceId,jpc,jpc.source,idx)}
_jsPlumb.repaint(existingJpcParams[1])}else{_jsPlumb.deleteObject({endpoint:fe})}}}
if(this.deleteAfterDragStop){_jsPlumb.deleteObject({endpoint:this})}else{if(this._jsPlumb){this.paint({recalc:!1})}}
_jsPlumb.fire("connectionDragStop",jpc,originalEvent);if(jpc.pending){_jsPlumb.fire("connectionAborted",jpc,originalEvent)}
_jsPlumb.currentlyDragging=!1;jpc.suspendedElement=null;jpc.suspendedEndpoint=null;jpc=null}
if(placeholderInfo&&placeholderInfo.element){_jsPlumb.remove(placeholderInfo.element,!1,!1)}
if(inPlaceCopy){_jsPlumb.deleteObject({endpoint:inPlaceCopy})}
if(this._jsPlumb){this.canvas.style.visibility="visible";this.anchor.locked=!1;this._jsPlumb.floatingEndpoint=null}}.bind(this);dragOptions=_jp.extend(defaultOpts,dragOptions);dragOptions.scope=this.scope||dragOptions.scope;dragOptions[beforeStartEvent]=_ju.wrap(dragOptions[beforeStartEvent],beforeStart,!1);dragOptions[startEvent]=_ju.wrap(dragOptions[startEvent],start,!1);dragOptions[dragEvent]=_ju.wrap(dragOptions[dragEvent],_dragHandler.drag);dragOptions[stopEvent]=_ju.wrap(dragOptions[stopEvent],stop);dragOptions.multipleDrop=!1;dragOptions.canDrag=function(){return this.isSource||this.isTemporarySource||(this.connections.length>0&&this.connectionsDetachable!==!1)}.bind(this);_jsPlumb.initDraggable(this.canvas,dragOptions,"internal");this.canvas._jsPlumbRelatedElement=this.element;draggingInitialised=!0}};var ep=params.endpoint||this._jsPlumb.instance.Defaults.Endpoint||_jp.Defaults.Endpoint;this.setEndpoint(ep,!0);var anchorParamsToUse=params.anchor?params.anchor:params.anchors?params.anchors:(_jsPlumb.Defaults.Anchor||"Top");this.setAnchor(anchorParamsToUse,!0);var type=["default",(params.type||"")].join(" ");this.addType(type,params.data,!0);this.canvas=this.endpoint.canvas;this.canvas._jsPlumb=this;this.initDraggable();var _initDropTarget=function(canvas,isTransient,endpoint,referenceEndpoint){if(_jp.isDropSupported(this.element)){var dropOptions=params.dropOptions||_jsPlumb.Defaults.DropOptions||_jp.Defaults.DropOptions;dropOptions=_jp.extend({},dropOptions);dropOptions.scope=dropOptions.scope||this.scope;var dropEvent=_jp.dragEvents.drop,overEvent=_jp.dragEvents.over,outEvent=_jp.dragEvents.out,_ep=this,drop=_jsPlumb.EndpointDropHandler({getEndpoint:function(){return _ep},jsPlumb:_jsPlumb,enabled:function(){return endpoint!=null?endpoint.isEnabled():!0},isFull:function(){return endpoint.isFull()},element:this.element,elementId:this.elementId,isSource:this.isSource,isTarget:this.isTarget,addClass:function(clazz){_ep.addClass(clazz)},removeClass:function(clazz){_ep.removeClass(clazz)},isDropAllowed:function(){return _ep.isDropAllowed.apply(_ep,arguments)},reference:referenceEndpoint,isRedrop:function(jpc,dhParams){return jpc.suspendedEndpoint&&dhParams.reference&&(jpc.suspendedEndpoint.id===dhParams.reference.id)}});dropOptions[dropEvent]=_ju.wrap(dropOptions[dropEvent],drop,!0);dropOptions[overEvent]=_ju.wrap(dropOptions[overEvent],function(){var draggable=_jp.getDragObject(arguments),id=_jsPlumb.getAttribute(_jp.getElement(draggable),"dragId"),_jpc=_jsPlumb.getFloatingConnectionFor(id);if(_jpc!=null){var idx=_jsPlumb.getFloatingAnchorIndex(_jpc);var _cont=(this.isTarget&&idx!==0)||(_jpc.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id===_jpc.suspendedEndpoint.id);if(_cont){var bb=_jsPlumb.checkCondition("checkDropAllowed",{sourceEndpoint:_jpc.endpoints[idx],targetEndpoint:this,connection:_jpc});this[(bb?"add":"remove")+"Class"](_jsPlumb.endpointDropAllowedClass);this[(bb?"remove":"add")+"Class"](_jsPlumb.endpointDropForbiddenClass);_jpc.endpoints[idx].anchor.over(this.anchor,this)}}}.bind(this));dropOptions[outEvent]=_ju.wrap(dropOptions[outEvent],function(){var draggable=_jp.getDragObject(arguments),id=draggable==null?null:_jsPlumb.getAttribute(_jp.getElement(draggable),"dragId"),_jpc=id?_jsPlumb.getFloatingConnectionFor(id):null;if(_jpc!=null){var idx=_jsPlumb.getFloatingAnchorIndex(_jpc);var _cont=(this.isTarget&&idx!==0)||(_jpc.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id===_jpc.suspendedEndpoint.id);if(_cont){this.removeClass(_jsPlumb.endpointDropAllowedClass);this.removeClass(_jsPlumb.endpointDropForbiddenClass);_jpc.endpoints[idx].anchor.out()}}}.bind(this));_jsPlumb.initDroppable(canvas,dropOptions,"internal",isTransient)}}.bind(this);if(!this.anchor.isFloating){_initDropTarget(this.canvas,!(params._transient||this.anchor.isFloating),this,params.reference)}
return this};_ju.extend(_jp.Endpoint,_jp.OverlayCapableJsPlumbUIComponent,{setVisible:function(v,doNotChangeConnections,doNotNotifyOtherEndpoint){this._jsPlumb.visible=v;if(this.canvas){this.canvas.style.display=v?"block":"none"}
this[v?"showOverlays":"hideOverlays"]();if(!doNotChangeConnections){for(var i=0;i<this.connections.length;i++){this.connections[i].setVisible(v);if(!doNotNotifyOtherEndpoint){var oIdx=this===this.connections[i].endpoints[0]?1:0;if(this.connections[i].endpoints[oIdx].connections.length===1){this.connections[i].endpoints[oIdx].setVisible(v,!0,!0)}}}}},getAttachedElements:function(){return this.connections},applyType:function(t,doNotRepaint){this.setPaintStyle(t.endpointStyle||t.paintStyle,doNotRepaint);this.setHoverPaintStyle(t.endpointHoverStyle||t.hoverPaintStyle,doNotRepaint);if(t.maxConnections!=null){this._jsPlumb.maxConnections=t.maxConnections}
if(t.scope){this.scope=t.scope}
_jp.extend(this,t,typeParameters);if(t.cssClass!=null&&this.canvas){this._jsPlumb.instance.addClass(this.canvas,t.cssClass)}
_jp.OverlayCapableJsPlumbUIComponent.applyType(this,t)},isEnabled:function(){return this._jsPlumb.enabled},setEnabled:function(e){this._jsPlumb.enabled=e},cleanup:function(){var anchorClass=this._jsPlumb.instance.endpointAnchorClassPrefix+(this._jsPlumb.currentAnchorClass?"-"+this._jsPlumb.currentAnchorClass:"");_jp.removeClass(this.element,anchorClass);this.anchor=null;this.endpoint.cleanup(!0);this.endpoint.destroy();this.endpoint=null;this._jsPlumb.instance.destroyDraggable(this.canvas,"internal");this._jsPlumb.instance.destroyDroppable(this.canvas,"internal")},setHover:function(h){if(this.endpoint&&this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged()){this.endpoint.setHover(h)}},isFull:function(){return this._jsPlumb.maxConnections===0?!0:!(this.isFloating()||this._jsPlumb.maxConnections<0||this.connections.length<this._jsPlumb.maxConnections)},isFloating:function(){return this.anchor!=null&&this.anchor.isFloating},isConnectedTo:function(endpoint){var found=!1;if(endpoint){for(var i=0;i<this.connections.length;i++){if(this.connections[i].endpoints[1]===endpoint||this.connections[i].endpoints[0]===endpoint){found=!0;break}}}
return found},getConnectionCost:function(){return this._jsPlumb.connectionCost},setConnectionCost:function(c){this._jsPlumb.connectionCost=c},areConnectionsDirected:function(){return this._jsPlumb.connectionsDirected},setConnectionsDirected:function(b){this._jsPlumb.connectionsDirected=b},setElementId:function(_elId){this.elementId=_elId;this.anchor.elementId=_elId},setReferenceElement:function(_el){this.element=_jp.getElement(_el)},setDragAllowedWhenFull:function(allowed){this.dragAllowedWhenFull=allowed},equals:function(endpoint){return this.anchor.equals(endpoint.anchor)},getUuid:function(){return this._jsPlumb.uuid},computeAnchor:function(params){return this.anchor.compute(params)}});root.jsPlumbInstance.prototype.EndpointDropHandler=function(dhParams){return function(e){var _jsPlumb=dhParams.jsPlumb;dhParams.removeClass(_jsPlumb.endpointDropAllowedClass);dhParams.removeClass(_jsPlumb.endpointDropForbiddenClass);var originalEvent=_jsPlumb.getDropEvent(arguments),draggable=_jsPlumb.getDragObject(arguments),id=_jsPlumb.getAttribute(draggable,"dragId"),elId=_jsPlumb.getAttribute(draggable,"elId"),scope=_jsPlumb.getAttribute(draggable,"originalScope"),jpc=_jsPlumb.getFloatingConnectionFor(id);if(jpc==null){return}
var existingConnection=jpc.suspendedEndpoint!=null;if(existingConnection&&jpc.suspendedEndpoint._jsPlumb==null){return}
var _ep=dhParams.getEndpoint(jpc);if(_ep==null){return}
if(dhParams.isRedrop(jpc,dhParams)){jpc._forceReattach=!0;jpc.setHover(!1);if(dhParams.maybeCleanup){dhParams.maybeCleanup(_ep)}
return}
var idx=_jsPlumb.getFloatingAnchorIndex(jpc);if((idx===0&&!dhParams.isSource)||(idx===1&&!dhParams.isTarget)){if(dhParams.maybeCleanup){dhParams.maybeCleanup(_ep)}
return}
if(dhParams.onDrop){dhParams.onDrop(jpc)}
if(scope){_jsPlumb.setDragScope(draggable,scope)}
var isFull=dhParams.isFull(e);if(isFull){_ep.fire("maxConnections",{endpoint:this,connection:jpc,maxConnections:_ep._jsPlumb.maxConnections},originalEvent)}
if(!isFull&&dhParams.enabled()){var _doContinue=!0;if(idx===0){jpc.floatingElement=jpc.source;jpc.floatingId=jpc.sourceId;jpc.floatingEndpoint=jpc.endpoints[0];jpc.floatingIndex=0;jpc.source=dhParams.element;jpc.sourceId=_jsPlumb.getId(dhParams.element)}else{jpc.floatingElement=jpc.target;jpc.floatingId=jpc.targetId;jpc.floatingEndpoint=jpc.endpoints[1];jpc.floatingIndex=1;jpc.target=dhParams.element;jpc.targetId=_jsPlumb.getId(dhParams.element)}
if(existingConnection&&jpc.suspendedEndpoint.id!==_ep.id){if(!jpc.isDetachAllowed(jpc)||!jpc.endpoints[idx].isDetachAllowed(jpc)||!jpc.suspendedEndpoint.isDetachAllowed(jpc)||!_jsPlumb.checkCondition("beforeDetach",jpc)){_doContinue=!1}}
var continueFunction=function(optionalData){jpc.endpoints[idx].detachFromConnection(jpc);if(jpc.suspendedEndpoint){jpc.suspendedEndpoint.detachFromConnection(jpc)}
jpc.endpoints[idx]=_ep;_ep.addConnection(jpc);var params=_ep.getParameters();for(var aParam in params){jpc.setParameter(aParam,params[aParam])}
if(!existingConnection){if(params.draggable){_jsPlumb.initDraggable(this.element,dhParams.dragOptions,"internal",_jsPlumb)}}else{var suspendedElementId=jpc.suspendedEndpoint.elementId;_jsPlumb.fireMoveEvent({index:idx,originalSourceId:idx===0?suspendedElementId:jpc.sourceId,newSourceId:idx===0?_ep.elementId:jpc.sourceId,originalTargetId:idx===1?suspendedElementId:jpc.targetId,newTargetId:idx===1?_ep.elementId:jpc.targetId,originalSourceEndpoint:idx===0?jpc.suspendedEndpoint:jpc.endpoints[0],newSourceEndpoint:idx===0?_ep:jpc.endpoints[0],originalTargetEndpoint:idx===1?jpc.suspendedEndpoint:jpc.endpoints[1],newTargetEndpoint:idx===1?_ep:jpc.endpoints[1],connection:jpc},originalEvent)}
if(idx===1){_jsPlumb.router.sourceOrTargetChanged(jpc.floatingId,jpc.targetId,jpc,jpc.target,1)}else{_jsPlumb.router.sourceOrTargetChanged(jpc.floatingId,jpc.sourceId,jpc,jpc.source,0)}
if(jpc.endpoints[0].finalEndpoint){var _toDelete=jpc.endpoints[0];_toDelete.detachFromConnection(jpc);jpc.endpoints[0]=jpc.endpoints[0].finalEndpoint;jpc.endpoints[0].addConnection(jpc)}
if(_ju.isObject(optionalData)){jpc.mergeData(optionalData)}
_jsPlumb.finaliseConnection(jpc,null,originalEvent,!1);jpc.setHover(!1);_jsPlumb.revalidate(jpc.endpoints[0].element)}.bind(this);var dontContinueFunction=function(){if(jpc.suspendedEndpoint){jpc.endpoints[idx]=jpc.suspendedEndpoint;jpc.setHover(!1);jpc._forceDetach=!0;if(idx===0){jpc.source=jpc.suspendedEndpoint.element;jpc.sourceId=jpc.suspendedEndpoint.elementId}else{jpc.target=jpc.suspendedEndpoint.element;jpc.targetId=jpc.suspendedEndpoint.elementId}
jpc.suspendedEndpoint.addConnection(jpc);if(idx===1){_jsPlumb.router.sourceOrTargetChanged(jpc.floatingId,jpc.targetId,jpc,jpc.target,1)}else{_jsPlumb.router.sourceOrTargetChanged(jpc.floatingId,jpc.sourceId,jpc,jpc.source,0)}
_jsPlumb.repaint(jpc.sourceId);jpc._forceDetach=!1}};_doContinue=_doContinue&&dhParams.isDropAllowed(jpc.sourceId,jpc.targetId,jpc.scope,jpc,_ep);if(_doContinue){continueFunction(_doContinue);return!0}else{dontContinueFunction()}}
if(dhParams.maybeCleanup){dhParams.maybeCleanup(_ep)}
_jsPlumb.currentlyDragging=!1}}}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_jp=root.jsPlumb,_ju=root.jsPlumbUtil;var makeConnector=function(_jsPlumb,renderMode,connectorName,connectorArgs,forComponent){_jp.Connectors[renderMode]=_jp.Connectors[renderMode]||{};if(_jp.Connectors[renderMode][connectorName]==null){if(_jp.Connectors[connectorName]==null){if(!_jsPlumb.Defaults.DoNotThrowErrors){throw new TypeError("jsPlumb: unknown connector type '"+connectorName+"'")}else{return null}}
_jp.Connectors[renderMode][connectorName]=function(){_jp.Connectors[connectorName].apply(this,arguments);_jp.ConnectorRenderers[renderMode].apply(this,arguments)};_ju.extend(_jp.Connectors[renderMode][connectorName],[_jp.Connectors[connectorName],_jp.ConnectorRenderers[renderMode]])}
return new _jp.Connectors[renderMode][connectorName](connectorArgs,forComponent)},_makeAnchor=function(anchorParams,elementId,_jsPlumb){return(anchorParams)?_jsPlumb.makeAnchor(anchorParams,elementId,_jsPlumb):null},_updateConnectedClass=function(conn,element,_jsPlumb,remove){if(element!=null){element._jsPlumbConnections=element._jsPlumbConnections||{};if(remove){delete element._jsPlumbConnections[conn.id]}else{element._jsPlumbConnections[conn.id]=!0}
if(_ju.isEmpty(element._jsPlumbConnections)){_jsPlumb.removeClass(element,_jsPlumb.connectedClass)}else{_jsPlumb.addClass(element,_jsPlumb.connectedClass)}}};_jp.Connection=function(params){var _newEndpoint=params.newEndpoint;this.id=params.id;this.connector=null;this.idPrefix="_jsplumb_c_";this.defaultLabelLocation=0.5;this.defaultOverlayKeys=["Overlays","ConnectionOverlays"];this.previousConnection=params.previousConnection;this.source=_jp.getElement(params.source);this.target=_jp.getElement(params.target);_jp.OverlayCapableJsPlumbUIComponent.apply(this,arguments);if(params.sourceEndpoint){this.source=params.sourceEndpoint.getElement();this.sourceId=params.sourceEndpoint.elementId}else{this.sourceId=this._jsPlumb.instance.getId(this.source)}
if(params.targetEndpoint){this.target=params.targetEndpoint.getElement();this.targetId=params.targetEndpoint.elementId}else{this.targetId=this._jsPlumb.instance.getId(this.target)}
this.scope=params.scope;this.endpoints=[];this.endpointStyles=[];var _jsPlumb=this._jsPlumb.instance;_jsPlumb.manage(this.sourceId,this.source);_jsPlumb.manage(this.targetId,this.target);this._jsPlumb.visible=!0;this._jsPlumb.params={cssClass:params.cssClass,container:params.container,"pointer-events":params["pointer-events"],editorParams:params.editorParams,overlays:params.overlays};this._jsPlumb.lastPaintedAt=null;this.bind("mouseover",function(){this.setHover(!0)}.bind(this));this.bind("mouseout",function(){this.setHover(!1)}.bind(this));this.makeEndpoint=function(isSource,el,elId,ep,definition){elId=elId||this._jsPlumb.instance.getId(el);return this.prepareEndpoint(_jsPlumb,_newEndpoint,this,ep,isSource?0:1,params,el,elId,definition)};if(params.type){params.endpoints=params.endpoints||this._jsPlumb.instance.deriveEndpointAndAnchorSpec(params.type).endpoints}
var eS=this.makeEndpoint(!0,this.source,this.sourceId,params.sourceEndpoint),eT=this.makeEndpoint(!1,this.target,this.targetId,params.targetEndpoint);if(eS){_ju.addToList(params.endpointsByElement,this.sourceId,eS)}
if(eT){_ju.addToList(params.endpointsByElement,this.targetId,eT)}
if(!this.scope){this.scope=this.endpoints[0].scope}
if(params.deleteEndpointsOnEmpty!=null){this.endpoints[0].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);this.endpoints[1].setDeleteOnEmpty(params.deleteEndpointsOnEmpty)}
var _detachable=_jsPlumb.Defaults.ConnectionsDetachable;if(params.detachable===!1){_detachable=!1}
if(this.endpoints[0].connectionsDetachable===!1){_detachable=!1}
if(this.endpoints[1].connectionsDetachable===!1){_detachable=!1}
var _reattach=params.reattach||this.endpoints[0].reattachConnections||this.endpoints[1].reattachConnections||_jsPlumb.Defaults.ReattachConnections;this.appendToDefaultType({detachable:_detachable,reattach:_reattach,paintStyle:this.endpoints[0].connectorStyle||this.endpoints[1].connectorStyle||params.paintStyle||_jsPlumb.Defaults.PaintStyle||_jp.Defaults.PaintStyle,hoverPaintStyle:this.endpoints[0].connectorHoverStyle||this.endpoints[1].connectorHoverStyle||params.hoverPaintStyle||_jsPlumb.Defaults.HoverPaintStyle||_jp.Defaults.HoverPaintStyle});var _suspendedAt=_jsPlumb.getSuspendedAt();if(!_jsPlumb.isSuspendDrawing()){var myInfo=_jsPlumb.getCachedData(this.sourceId),myOffset=myInfo.o,myWH=myInfo.s,otherInfo=_jsPlumb.getCachedData(this.targetId),otherOffset=otherInfo.o,otherWH=otherInfo.s,initialTimestamp=_suspendedAt||jsPlumbUtil.uuid(),anchorLoc=this.endpoints[0].anchor.compute({xy:[myOffset.left,myOffset.top],wh:myWH,element:this.endpoints[0],elementId:this.endpoints[0].elementId,txy:[otherOffset.left,otherOffset.top],twh:otherWH,tElement:this.endpoints[1],timestamp:initialTimestamp,rotation:_jsPlumb.getRotation(this.endpoints[0].elementId)});this.endpoints[0].paint({anchorLoc:anchorLoc,timestamp:initialTimestamp});anchorLoc=this.endpoints[1].anchor.compute({xy:[otherOffset.left,otherOffset.top],wh:otherWH,element:this.endpoints[1],elementId:this.endpoints[1].elementId,txy:[myOffset.left,myOffset.top],twh:myWH,tElement:this.endpoints[0],timestamp:initialTimestamp,rotation:_jsPlumb.getRotation(this.endpoints[1].elementId)});this.endpoints[1].paint({anchorLoc:anchorLoc,timestamp:initialTimestamp})}
this.getTypeDescriptor=function(){return"connection"};this.getAttachedElements=function(){return this.endpoints};this.isDetachable=function(ep){return this._jsPlumb.detachable===!1?!1:ep!=null?ep.connectionsDetachable===!0:this._jsPlumb.detachable===!0};this.setDetachable=function(detachable){this._jsPlumb.detachable=detachable===!0};this.isReattach=function(){return this._jsPlumb.reattach===!0||this.endpoints[0].reattachConnections===!0||this.endpoints[1].reattachConnections===!0};this.setReattach=function(reattach){this._jsPlumb.reattach=reattach===!0};this._jsPlumb.cost=params.cost||this.endpoints[0].getConnectionCost();this._jsPlumb.directed=params.directed;if(params.directed==null){this._jsPlumb.directed=this.endpoints[0].areConnectionsDirected()}
var _p=_jp.extend({},this.endpoints[1].getParameters());_jp.extend(_p,this.endpoints[0].getParameters());_jp.extend(_p,this.getParameters());this.setParameters(_p);this.setConnector(this.endpoints[0].connector||this.endpoints[1].connector||params.connector||_jsPlumb.Defaults.Connector||_jp.Defaults.Connector,!0);var data=params.data==null||!_ju.isObject(params.data)?{}:params.data;this.getData=function(){return data};this.setData=function(d){data=d||{}};this.mergeData=function(d){data=_jp.extend(data,d)};var _types=["default",this.endpoints[0].connectionType,this.endpoints[1].connectionType,params.type].join(" ");if(/[^\s]/.test(_types)){this.addType(_types,params.data,!0)}
this.updateConnectedClass()};_ju.extend(_jp.Connection,_jp.OverlayCapableJsPlumbUIComponent,{applyType:function(t,doNotRepaint,typeMap){var _connector=null;if(t.connector!=null){_connector=this.getCachedTypeItem("connector",typeMap.connector);if(_connector==null){_connector=this.prepareConnector(t.connector,typeMap.connector);this.cacheTypeItem("connector",_connector,typeMap.connector)}
this.setPreparedConnector(_connector)}
if(t.detachable!=null){this.setDetachable(t.detachable)}
if(t.reattach!=null){this.setReattach(t.reattach)}
if(t.scope){this.scope=t.scope}
if(t.cssClass!=null&&this.canvas){this._jsPlumb.instance.addClass(this.canvas,t.cssClass)}
var _anchors=null;if(t.anchor){_anchors=this.getCachedTypeItem("anchors",typeMap.anchor);if(_anchors==null){_anchors=[this._jsPlumb.instance.makeAnchor(t.anchor),this._jsPlumb.instance.makeAnchor(t.anchor)];this.cacheTypeItem("anchors",_anchors,typeMap.anchor)}}else if(t.anchors){_anchors=this.getCachedTypeItem("anchors",typeMap.anchors);if(_anchors==null){_anchors=[this._jsPlumb.instance.makeAnchor(t.anchors[0]),this._jsPlumb.instance.makeAnchor(t.anchors[1])];this.cacheTypeItem("anchors",_anchors,typeMap.anchors)}}
if(_anchors!=null){this.endpoints[0].anchor=_anchors[0];this.endpoints[1].anchor=_anchors[1];if(this.endpoints[1].anchor.isDynamic){this._jsPlumb.instance.repaint(this.endpoints[1].elementId)}}
_jp.OverlayCapableJsPlumbUIComponent.applyType(this,t)},addClass:function(c,informEndpoints){if(informEndpoints){this.endpoints[0].addClass(c);this.endpoints[1].addClass(c);if(this.suspendedEndpoint){this.suspendedEndpoint.addClass(c)}}
if(this.connector){this.connector.addClass(c)}},removeClass:function(c,informEndpoints){if(informEndpoints){this.endpoints[0].removeClass(c);this.endpoints[1].removeClass(c);if(this.suspendedEndpoint){this.suspendedEndpoint.removeClass(c)}}
if(this.connector){this.connector.removeClass(c)}},isVisible:function(){return this._jsPlumb.visible},setVisible:function(v){this._jsPlumb.visible=v;if(this.connector){this.connector.setVisible(v)}
this.repaint()},cleanup:function(){this.updateConnectedClass(!0);this.endpoints=null;this.source=null;this.target=null;if(this.connector!=null){this.connector.cleanup(!0);this.connector.destroy(!0)}
this.connector=null},updateConnectedClass:function(remove){if(this._jsPlumb){_updateConnectedClass(this,this.source,this._jsPlumb.instance,remove);_updateConnectedClass(this,this.target,this._jsPlumb.instance,remove)}},setHover:function(state){if(this.connector&&this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged()){this.connector.setHover(state);root.jsPlumb[state?"addClass":"removeClass"](this.source,this._jsPlumb.instance.hoverSourceClass);root.jsPlumb[state?"addClass":"removeClass"](this.target,this._jsPlumb.instance.hoverTargetClass)}},getUuids:function(){return[this.endpoints[0].getUuid(),this.endpoints[1].getUuid()]},getCost:function(){return this._jsPlumb?this._jsPlumb.cost:-Infinity},setCost:function(c){this._jsPlumb.cost=c},isDirected:function(){return this._jsPlumb.directed},getConnector:function(){return this.connector},prepareConnector:function(connectorSpec,typeId){var connectorArgs={_jsPlumb:this._jsPlumb.instance,cssClass:this._jsPlumb.params.cssClass,container:this._jsPlumb.params.container,"pointer-events":this._jsPlumb.params["pointer-events"]},renderMode=this._jsPlumb.instance.getRenderMode(),connector;if(_ju.isString(connectorSpec)){connector=makeConnector(this._jsPlumb.instance,renderMode,connectorSpec,connectorArgs,this)}else if(_ju.isArray(connectorSpec)){if(connectorSpec.length===1){connector=makeConnector(this._jsPlumb.instance,renderMode,connectorSpec[0],connectorArgs,this)}else{connector=makeConnector(this._jsPlumb.instance,renderMode,connectorSpec[0],_ju.merge(connectorSpec[1],connectorArgs),this)}}
if(typeId!=null){connector.typeId=typeId}
return connector},setPreparedConnector:function(connector,doNotRepaint,doNotChangeListenerComponent,typeId){if(this.connector!==connector){var previous,previousClasses="";if(this.connector!=null){previous=this.connector;previousClasses=previous.getClass();this.connector.cleanup();this.connector.destroy()}
this.connector=connector;if(typeId){this.cacheTypeItem("connector",connector,typeId)}
this.canvas=this.connector.canvas;this.bgCanvas=this.connector.bgCanvas;this.connector.reattach(this._jsPlumb.instance);this.addClass(previousClasses);if(this.canvas){this.canvas._jsPlumb=this}
if(this.bgCanvas){this.bgCanvas._jsPlumb=this}
if(previous!=null){var o=this.getOverlays();for(var i=0;i<o.length;i++){if(o[i].transfer){o[i].transfer(this.connector)}}}
if(!doNotChangeListenerComponent){this.setListenerComponent(this.connector)}
if(!doNotRepaint){this.repaint()}}},setConnector:function(connectorSpec,doNotRepaint,doNotChangeListenerComponent,typeId){var connector=this.prepareConnector(connectorSpec,typeId);this.setPreparedConnector(connector,doNotRepaint,doNotChangeListenerComponent,typeId)},paint:function(params){if(!this._jsPlumb.instance.isSuspendDrawing()&&this._jsPlumb.visible){params=params||{};var timestamp=params.timestamp,swap=!1,tId=swap?this.sourceId:this.targetId,sId=swap?this.targetId:this.sourceId,tIdx=swap?0:1,sIdx=swap?1:0;if(timestamp==null||timestamp!==this._jsPlumb.lastPaintedAt){var sourceInfo=this._jsPlumb.instance.updateOffset({elId:sId}).o,targetInfo=this._jsPlumb.instance.updateOffset({elId:tId}).o,sE=this.endpoints[sIdx],tE=this.endpoints[tIdx];var sAnchorP=sE.anchor.getCurrentLocation({xy:[sourceInfo.left,sourceInfo.top],wh:[sourceInfo.width,sourceInfo.height],element:sE,timestamp:timestamp,rotation:this._jsPlumb.instance.getRotation(this.sourceId)}),tAnchorP=tE.anchor.getCurrentLocation({xy:[targetInfo.left,targetInfo.top],wh:[targetInfo.width,targetInfo.height],element:tE,timestamp:timestamp,rotation:this._jsPlumb.instance.getRotation(this.targetId)});this.connector.resetBounds();this.connector.compute({sourcePos:sAnchorP,targetPos:tAnchorP,sourceOrientation:sE.anchor.getOrientation(sE),targetOrientation:tE.anchor.getOrientation(tE),sourceEndpoint:this.endpoints[sIdx],targetEndpoint:this.endpoints[tIdx],"stroke-width":this._jsPlumb.paintStyleInUse.strokeWidth,sourceInfo:sourceInfo,targetInfo:targetInfo});var overlayExtents={minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity};for(var i in this._jsPlumb.overlays){if(this._jsPlumb.overlays.hasOwnProperty(i)){var o=this._jsPlumb.overlays[i];if(o.isVisible()){this._jsPlumb.overlayPlacements[i]=o.draw(this.connector,this._jsPlumb.paintStyleInUse,this.getAbsoluteOverlayPosition(o));overlayExtents.minX=Math.min(overlayExtents.minX,this._jsPlumb.overlayPlacements[i].minX);overlayExtents.maxX=Math.max(overlayExtents.maxX,this._jsPlumb.overlayPlacements[i].maxX);overlayExtents.minY=Math.min(overlayExtents.minY,this._jsPlumb.overlayPlacements[i].minY);overlayExtents.maxY=Math.max(overlayExtents.maxY,this._jsPlumb.overlayPlacements[i].maxY)}}}
var lineWidth=parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth||1)/2,outlineWidth=parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth||0),extents={xmin:Math.min(this.connector.bounds.minX-(lineWidth+outlineWidth),overlayExtents.minX),ymin:Math.min(this.connector.bounds.minY-(lineWidth+outlineWidth),overlayExtents.minY),xmax:Math.max(this.connector.bounds.maxX+(lineWidth+outlineWidth),overlayExtents.maxX),ymax:Math.max(this.connector.bounds.maxY+(lineWidth+outlineWidth),overlayExtents.maxY)};this.connector.paintExtents=extents;this.connector.paint(this._jsPlumb.paintStyleInUse,null,extents);for(var j in this._jsPlumb.overlays){if(this._jsPlumb.overlays.hasOwnProperty(j)){var p=this._jsPlumb.overlays[j];if(p.isVisible()){p.paint(this._jsPlumb.overlayPlacements[j],extents)}}}}
this._jsPlumb.lastPaintedAt=timestamp}},repaint:function(params){var p=jsPlumb.extend(params||{},{});p.elId=this.sourceId;this.paint(p)},prepareEndpoint:function(_jsPlumb,_newEndpoint,conn,existing,index,params,element,elementId,definition){var e;if(existing){conn.endpoints[index]=existing;existing.addConnection(conn)}else{if(!params.endpoints){params.endpoints=[null,null]}
var ep=definition||params.endpoints[index]||params.endpoint||_jsPlumb.Defaults.Endpoints[index]||_jp.Defaults.Endpoints[index]||_jsPlumb.Defaults.Endpoint||_jp.Defaults.Endpoint;if(!params.endpointStyles){params.endpointStyles=[null,null]}
if(!params.endpointHoverStyles){params.endpointHoverStyles=[null,null]}
var es=params.endpointStyles[index]||params.endpointStyle||_jsPlumb.Defaults.EndpointStyles[index]||_jp.Defaults.EndpointStyles[index]||_jsPlumb.Defaults.EndpointStyle||_jp.Defaults.EndpointStyle;if(es.fill==null&&params.paintStyle!=null){es.fill=params.paintStyle.stroke}
if(es.outlineStroke==null&&params.paintStyle!=null){es.outlineStroke=params.paintStyle.outlineStroke}
if(es.outlineWidth==null&&params.paintStyle!=null){es.outlineWidth=params.paintStyle.outlineWidth}
var ehs=params.endpointHoverStyles[index]||params.endpointHoverStyle||_jsPlumb.Defaults.EndpointHoverStyles[index]||_jp.Defaults.EndpointHoverStyles[index]||_jsPlumb.Defaults.EndpointHoverStyle||_jp.Defaults.EndpointHoverStyle;if(params.hoverPaintStyle!=null){if(ehs==null){ehs={}}
if(ehs.fill==null){ehs.fill=params.hoverPaintStyle.stroke}}
var a=params.anchors?params.anchors[index]:params.anchor?params.anchor:_makeAnchor(_jsPlumb.Defaults.Anchors[index],elementId,_jsPlumb)||_makeAnchor(_jp.Defaults.Anchors[index],elementId,_jsPlumb)||_makeAnchor(_jsPlumb.Defaults.Anchor,elementId,_jsPlumb)||_makeAnchor(_jp.Defaults.Anchor,elementId,_jsPlumb),u=params.uuids?params.uuids[index]:null;e=_newEndpoint({paintStyle:es,hoverPaintStyle:ehs,endpoint:ep,connections:[conn],uuid:u,anchor:a,source:element,scope:params.scope,reattach:params.reattach||_jsPlumb.Defaults.ReattachConnections,detachable:params.detachable||_jsPlumb.Defaults.ConnectionsDetachable});if(existing==null){e.setDeleteOnEmpty(!0)}
conn.endpoints[index]=e;if(params.drawEndpoints===!1){e.setVisible(!1,!0,!0)}}
return e},replaceEndpoint:function(idx,endpointDef){var current=this.endpoints[idx],elId=current.elementId,ebe=this._jsPlumb.instance.getEndpoints(elId),_idx=ebe.indexOf(current),_new=this.makeEndpoint(idx===0,current.element,elId,null,endpointDef);this.endpoints[idx]=_new;ebe.splice(_idx,1,_new);this._jsPlumb.instance.deleteObject({endpoint:current,deleteAttachedObjects:!1});this._jsPlumb.instance.fire("endpointReplaced",{previous:current,current:_new});this._jsPlumb.instance.router.sourceOrTargetChanged(this.endpoints[1].elementId,this.endpoints[1].elementId,this,this.endpoints[1].element,1)}})}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_ju=root.jsPlumbUtil,_jp=root.jsPlumb;_jp.AnchorManager=function(params){var _amEndpoints={},continuousAnchorLocations={},continuousAnchorOrientations={},connectionsByElementId={},self=this,anchorLists={},jsPlumbInstance=params.jsPlumbInstance,floatingConnections={},placeAnchorsOnLine=function(desc,elementDimensions,elementPosition,connections,horizontal,otherMultiplier,reverse,rotation){var a=[],step=elementDimensions[horizontal?0:1]/(connections.length+1);for(var i=0;i<connections.length;i++){var val=(i+1)*step,other=otherMultiplier*elementDimensions[horizontal?1:0];if(reverse){val=elementDimensions[horizontal?0:1]-val}
var dx=(horizontal?val:other),x=elementPosition.left+dx,xp=dx/elementDimensions[0],dy=(horizontal?other:val),y=elementPosition.top+dy,yp=dy/elementDimensions[1];if(rotation!==0){var rotated=jsPlumbUtil.rotatePoint([x,y],[elementPosition.centerx,elementPosition.centery],rotation);x=rotated[0];y=rotated[1]}
a.push([x,y,xp,yp,connections[i][1],connections[i][2]])}
return a},rightAndBottomSort=function(a,b){return b[0][0]-a[0][0]},leftAndTopSort=function(a,b){var p1=a[0][0]<0?-Math.PI-a[0][0]:Math.PI-a[0][0],p2=b[0][0]<0?-Math.PI-b[0][0]:Math.PI-b[0][0];return p1-p2},edgeSortFunctions={"top":leftAndTopSort,"right":rightAndBottomSort,"bottom":rightAndBottomSort,"left":leftAndTopSort},_sortHelper=function(_array,_fn){return _array.sort(_fn)},placeAnchors=function(elementId,_anchorLists){var cd=jsPlumbInstance.getCachedData(elementId),sS=cd.s,sO=cd.o,placeSomeAnchors=function(desc,elementDimensions,elementPosition,unsortedConnections,isHorizontal,otherMultiplier,orientation){if(unsortedConnections.length>0){var sc=_sortHelper(unsortedConnections,edgeSortFunctions[desc]),reverse=desc==="right"||desc==="top",rotation=jsPlumbInstance.getRotation(elementId),anchors=placeAnchorsOnLine(desc,elementDimensions,elementPosition,sc,isHorizontal,otherMultiplier,reverse,rotation);var _setAnchorLocation=function(endpoint,anchorPos){continuousAnchorLocations[endpoint.id]=[anchorPos[0],anchorPos[1],anchorPos[2],anchorPos[3]];continuousAnchorOrientations[endpoint.id]=orientation};for(var i=0;i<anchors.length;i++){var c=anchors[i][4],weAreSource=c.endpoints[0].elementId===elementId,weAreTarget=c.endpoints[1].elementId===elementId;if(weAreSource){_setAnchorLocation(c.endpoints[0],anchors[i])}
if(weAreTarget){_setAnchorLocation(c.endpoints[1],anchors[i])}}}};placeSomeAnchors("bottom",sS,sO,_anchorLists.bottom,!0,1,[0,1]);placeSomeAnchors("top",sS,sO,_anchorLists.top,!0,0,[0,-1]);placeSomeAnchors("left",sS,sO,_anchorLists.left,!1,0,[-1,0]);placeSomeAnchors("right",sS,sO,_anchorLists.right,!1,1,[1,0])};this.reset=function(){_amEndpoints={};connectionsByElementId={};anchorLists={}};this.addFloatingConnection=function(key,conn){floatingConnections[key]=conn};this.newConnection=function(conn){var sourceId=conn.sourceId,targetId=conn.targetId,ep=conn.endpoints,doRegisterTarget=!0,registerConnection=function(otherIndex,otherEndpoint,otherAnchor,elId,c){if((sourceId===targetId)&&otherAnchor.isContinuous){conn._jsPlumb.instance.removeElement(ep[1].canvas);doRegisterTarget=!1}
_ju.addToList(connectionsByElementId,elId,[c,otherEndpoint,otherAnchor.constructor===_jp.DynamicAnchor])};registerConnection(0,ep[0],ep[0].anchor,targetId,conn);if(doRegisterTarget){registerConnection(1,ep[1],ep[1].anchor,sourceId,conn)}};var removeEndpointFromAnchorLists=function(endpoint){(function(list,eId){if(list){var f=function(e){return e[4]===eId};_ju.removeWithFunction(list.top,f);_ju.removeWithFunction(list.left,f);_ju.removeWithFunction(list.bottom,f);_ju.removeWithFunction(list.right,f)}})(anchorLists[endpoint.elementId],endpoint.id)};this.connectionDetached=function(connInfo,doNotRedraw){var connection=connInfo.connection||connInfo,sourceId=connInfo.sourceId,targetId=connInfo.targetId,ep=connection.endpoints,removeConnection=function(otherIndex,otherEndpoint,otherAnchor,elId,c){_ju.removeWithFunction(connectionsByElementId[elId],function(_c){return _c[0].id===c.id})};removeConnection(1,ep[1],ep[1].anchor,sourceId,connection);removeConnection(0,ep[0],ep[0].anchor,targetId,connection);if(connection.floatingId){removeConnection(connection.floatingIndex,connection.floatingEndpoint,connection.floatingEndpoint.anchor,connection.floatingId,connection);removeEndpointFromAnchorLists(connection.floatingEndpoint)}
removeEndpointFromAnchorLists(connection.endpoints[0]);removeEndpointFromAnchorLists(connection.endpoints[1]);if(!doNotRedraw){self.redraw(connection.sourceId);if(connection.targetId!==connection.sourceId){self.redraw(connection.targetId)}}};this.addEndpoint=function(endpoint,elementId){_ju.addToList(_amEndpoints,elementId,endpoint)};this.changeId=function(oldId,newId){connectionsByElementId[newId]=connectionsByElementId[oldId];_amEndpoints[newId]=_amEndpoints[oldId];delete connectionsByElementId[oldId];delete _amEndpoints[oldId]};this.getConnectionsFor=function(elementId){return connectionsByElementId[elementId]||[]};this.getEndpointsFor=function(elementId){return _amEndpoints[elementId]||[]};this.deleteEndpoint=function(endpoint){_ju.removeWithFunction(_amEndpoints[endpoint.elementId],function(e){return e.id===endpoint.id});removeEndpointFromAnchorLists(endpoint)};this.elementRemoved=function(elementId){delete floatingConnections[elementId];delete _amEndpoints[elementId];_amEndpoints[elementId]=[]};var _updateAnchorList=function(lists,theta,order,conn,aBoolean,otherElId,idx,reverse,edgeId,elId,connsToPaint,endpointsToPaint){var exactIdx=-1,firstMatchingElIdx=-1,endpoint=conn.endpoints[idx],endpointId=endpoint.id,oIdx=[1,0][idx],values=[[theta,order],conn,aBoolean,otherElId,endpointId],listToAddTo=lists[edgeId],listToRemoveFrom=endpoint._continuousAnchorEdge?lists[endpoint._continuousAnchorEdge]:null,i,candidate;if(listToRemoveFrom){var rIdx=_ju.findWithFunction(listToRemoveFrom,function(e){return e[4]===endpointId});if(rIdx!==-1){listToRemoveFrom.splice(rIdx,1);for(i=0;i<listToRemoveFrom.length;i++){candidate=listToRemoveFrom[i][1];_ju.addWithFunction(connsToPaint,candidate,function(c){return c.id===candidate.id});_ju.addWithFunction(endpointsToPaint,listToRemoveFrom[i][1].endpoints[idx],function(e){return e.id===candidate.endpoints[idx].id});_ju.addWithFunction(endpointsToPaint,listToRemoveFrom[i][1].endpoints[oIdx],function(e){return e.id===candidate.endpoints[oIdx].id})}}}
for(i=0;i<listToAddTo.length;i++){candidate=listToAddTo[i][1];if(params.idx===1&&listToAddTo[i][3]===otherElId&&firstMatchingElIdx===-1){firstMatchingElIdx=i}
_ju.addWithFunction(connsToPaint,candidate,function(c){return c.id===candidate.id});_ju.addWithFunction(endpointsToPaint,listToAddTo[i][1].endpoints[idx],function(e){return e.id===candidate.endpoints[idx].id});_ju.addWithFunction(endpointsToPaint,listToAddTo[i][1].endpoints[oIdx],function(e){return e.id===candidate.endpoints[oIdx].id})}
if(exactIdx!==-1){listToAddTo[exactIdx]=values}else{var insertIdx=reverse?firstMatchingElIdx!==-1?firstMatchingElIdx:0:listToAddTo.length;listToAddTo.splice(insertIdx,0,values)}
endpoint._continuousAnchorEdge=edgeId};this.sourceOrTargetChanged=function(originalId,newId,connection,newElement,anchorIndex){if(anchorIndex===0){if(originalId!==newId){connection.sourceId=newId;connection.source=newElement;_ju.removeWithFunction(connectionsByElementId[originalId],function(info){return info[0].id===connection.id});var tIdx=_ju.findWithFunction(connectionsByElementId[connection.targetId],function(i){return i[0].id===connection.id});if(tIdx>-1){connectionsByElementId[connection.targetId][tIdx][0]=connection;connectionsByElementId[connection.targetId][tIdx][1]=connection.endpoints[0];connectionsByElementId[connection.targetId][tIdx][2]=connection.endpoints[0].anchor.constructor===_jp.DynamicAnchor}
_ju.addToList(connectionsByElementId,newId,[connection,connection.endpoints[1],connection.endpoints[1].anchor.constructor===_jp.DynamicAnchor]);if(connection.endpoints[1].anchor.isContinuous){if(connection.source===connection.target){connection._jsPlumb.instance.removeElement(connection.endpoints[1].canvas)}else{if(connection.endpoints[1].canvas.parentNode==null){connection._jsPlumb.instance.appendElement(connection.endpoints[1].canvas)}}}
connection.updateConnectedClass()}}else if(anchorIndex===1){var sourceElId=connection.endpoints[0].elementId;connection.target=newElement;connection.targetId=newId;var sIndex=_ju.findWithFunction(connectionsByElementId[sourceElId],function(i){return i[0].id===connection.id}),tIndex=_ju.findWithFunction(connectionsByElementId[originalId],function(i){return i[0].id===connection.id});if(sIndex!==-1){connectionsByElementId[sourceElId][sIndex][0]=connection;connectionsByElementId[sourceElId][sIndex][1]=connection.endpoints[1];connectionsByElementId[sourceElId][sIndex][2]=connection.endpoints[1].anchor.constructor===_jp.DynamicAnchor}
if(tIndex>-1){connectionsByElementId[originalId].splice(tIndex,1);_ju.addToList(connectionsByElementId,newId,[connection,connection.endpoints[0],connection.endpoints[0].anchor.constructor===_jp.DynamicAnchor])}
connection.updateConnectedClass()}};this.rehomeEndpoint=function(ep,currentId,element){var eps=_amEndpoints[currentId]||[],elementId=jsPlumbInstance.getId(element);if(elementId!==currentId){var idx=eps.indexOf(ep);if(idx>-1){var _ep=eps.splice(idx,1)[0];self.add(_ep,elementId)}}
for(var i=0;i<ep.connections.length;i++){if(ep.connections[i].sourceId===currentId){self.sourceOrTargetChanged(currentId,ep.elementId,ep.connections[i],ep.element,0)}else if(ep.connections[i].targetId===currentId){self.sourceOrTargetChanged(currentId,ep.elementId,ep.connections[i],ep.element,1)}}};this.redraw=function(elementId,ui,timestamp,offsetToUI,clearEdits,doNotRecalcEndpoint){var connectionsToPaint=[],endpointsToPaint=[],anchorsToUpdate=[];if(!jsPlumbInstance.isSuspendDrawing()){var ep=_amEndpoints[elementId]||[],endpointConnections=connectionsByElementId[elementId]||[];timestamp=timestamp||jsPlumbUtil.uuid();offsetToUI=offsetToUI||{left:0,top:0};if(ui){ui={left:ui.left+offsetToUI.left,top:ui.top+offsetToUI.top}}
var myOffset=jsPlumbInstance.updateOffset({elId:elementId,offset:ui,recalc:!1,timestamp:timestamp}),orientationCache={};for(var i=0;i<endpointConnections.length;i++){var conn=endpointConnections[i][0],sourceId=conn.sourceId,targetId=conn.targetId,sourceContinuous=conn.endpoints[0].anchor.isContinuous,targetContinuous=conn.endpoints[1].anchor.isContinuous;if(sourceContinuous||targetContinuous){var oKey=sourceId+"_"+targetId,o=orientationCache[oKey],oIdx=conn.sourceId===elementId?1:0,targetRotation=jsPlumbInstance.getRotation(targetId),sourceRotation=jsPlumbInstance.getRotation(sourceId);if(sourceContinuous&&!anchorLists[sourceId]){anchorLists[sourceId]={top:[],right:[],bottom:[],left:[]}}
if(targetContinuous&&!anchorLists[targetId]){anchorLists[targetId]={top:[],right:[],bottom:[],left:[]}}
if(elementId!==targetId){jsPlumbInstance.updateOffset({elId:targetId,timestamp:timestamp})}
if(elementId!==sourceId){jsPlumbInstance.updateOffset({elId:sourceId,timestamp:timestamp})}
var td=jsPlumbInstance.getCachedData(targetId),sd=jsPlumbInstance.getCachedData(sourceId);if(targetId===sourceId&&(sourceContinuous||targetContinuous)){_updateAnchorList(anchorLists[sourceId],-Math.PI/2,0,conn,!1,targetId,0,!1,"top",sourceId,connectionsToPaint,endpointsToPaint);_updateAnchorList(anchorLists[targetId],-Math.PI/2,0,conn,!1,sourceId,1,!1,"top",targetId,connectionsToPaint,endpointsToPaint)}else{if(!o){o=this.calculateOrientation(sourceId,targetId,sd.o,td.o,conn.endpoints[0].anchor,conn.endpoints[1].anchor,conn,sourceRotation,targetRotation);orientationCache[oKey]=o}
if(sourceContinuous){_updateAnchorList(anchorLists[sourceId],o.theta,0,conn,!1,targetId,0,!1,o.a[0],sourceId,connectionsToPaint,endpointsToPaint)}
if(targetContinuous){_updateAnchorList(anchorLists[targetId],o.theta2,-1,conn,!0,sourceId,1,!0,o.a[1],targetId,connectionsToPaint,endpointsToPaint)}}
if(sourceContinuous){_ju.addWithFunction(anchorsToUpdate,sourceId,function(a){return a===sourceId})}
if(targetContinuous){_ju.addWithFunction(anchorsToUpdate,targetId,function(a){return a===targetId})}
_ju.addWithFunction(connectionsToPaint,conn,function(c){return c.id===conn.id});if((sourceContinuous&&oIdx===0)||(targetContinuous&&oIdx===1)){_ju.addWithFunction(endpointsToPaint,conn.endpoints[oIdx],function(e){return e.id===conn.endpoints[oIdx].id})}}}
for(i=0;i<ep.length;i++){if(ep[i].connections.length===0&&ep[i].anchor.isContinuous){if(!anchorLists[elementId]){anchorLists[elementId]={top:[],right:[],bottom:[],left:[]}}
_updateAnchorList(anchorLists[elementId],-Math.PI/2,0,{endpoints:[ep[i],ep[i]],paint:function(){}},!1,elementId,0,!1,ep[i].anchor.getDefaultFace(),elementId,connectionsToPaint,endpointsToPaint);_ju.addWithFunction(anchorsToUpdate,elementId,function(a){return a===elementId})}}
for(i=0;i<anchorsToUpdate.length;i++){placeAnchors(anchorsToUpdate[i],anchorLists[anchorsToUpdate[i]])}
for(i=0;i<ep.length;i++){ep[i].paint({timestamp:timestamp,offset:myOffset,dimensions:myOffset.s,recalc:doNotRecalcEndpoint!==!0})}
for(i=0;i<endpointsToPaint.length;i++){var cd=jsPlumbInstance.getCachedData(endpointsToPaint[i].elementId);endpointsToPaint[i].paint({timestamp:null,offset:cd,dimensions:cd.s})}
for(i=0;i<endpointConnections.length;i++){var otherEndpoint=endpointConnections[i][1];if(otherEndpoint.anchor.constructor===_jp.DynamicAnchor){otherEndpoint.paint({elementWithPrecedence:elementId,timestamp:timestamp});_ju.addWithFunction(connectionsToPaint,endpointConnections[i][0],function(c){return c.id===endpointConnections[i][0].id});for(var k=0;k<otherEndpoint.connections.length;k++){if(otherEndpoint.connections[k]!==endpointConnections[i][0]){_ju.addWithFunction(connectionsToPaint,otherEndpoint.connections[k],function(c){return c.id===otherEndpoint.connections[k].id})}}}else{_ju.addWithFunction(connectionsToPaint,endpointConnections[i][0],function(c){return c.id===endpointConnections[i][0].id})}}
var fc=floatingConnections[elementId];if(fc){fc.paint({timestamp:timestamp,recalc:!1,elId:elementId})}
for(i=0;i<connectionsToPaint.length;i++){connectionsToPaint[i].paint({elId:elementId,timestamp:null,recalc:!1,clearEdits:clearEdits})}}
return{c:connectionsToPaint,e:endpointsToPaint}};var ContinuousAnchor=function(anchorParams){_ju.EventGenerator.apply(this);this.type="Continuous";this.isDynamic=!0;this.isContinuous=!0;var faces=anchorParams.faces||["top","right","bottom","left"],clockwise=!(anchorParams.clockwise===!1),availableFaces={},opposites={"top":"bottom","right":"left","left":"right","bottom":"top"},clockwiseOptions={"top":"right","right":"bottom","left":"top","bottom":"left"},antiClockwiseOptions={"top":"left","right":"top","left":"bottom","bottom":"right"},secondBest=clockwise?clockwiseOptions:antiClockwiseOptions,lastChoice=clockwise?antiClockwiseOptions:clockwiseOptions,cssClass=anchorParams.cssClass||"",_currentFace=null,_lockedFace=null,X_AXIS_FACES=["left","right"],Y_AXIS_FACES=["top","bottom"],_lockedAxis=null;for(var i=0;i<faces.length;i++){availableFaces[faces[i]]=!0}
this.getDefaultFace=function(){return faces.length===0?"top":faces[0]};this.isRelocatable=function(){return!0};this.isSnapOnRelocate=function(){return!0};this.verifyEdge=function(edge){if(availableFaces[edge]){return edge}else if(availableFaces[opposites[edge]]){return opposites[edge]}else if(availableFaces[secondBest[edge]]){return secondBest[edge]}else if(availableFaces[lastChoice[edge]]){return lastChoice[edge]}
return edge};this.isEdgeSupported=function(edge){return _lockedAxis==null?(_lockedFace==null?availableFaces[edge]===!0:_lockedFace===edge):_lockedAxis.indexOf(edge)!==-1};this.setCurrentFace=function(face,overrideLock){_currentFace=face;if(overrideLock&&_lockedFace!=null){_lockedFace=_currentFace}};this.getCurrentFace=function(){return _currentFace};this.getSupportedFaces=function(){var af=[];for(var k in availableFaces){if(availableFaces[k]){af.push(k)}}
return af};this.lock=function(){_lockedFace=_currentFace};this.unlock=function(){_lockedFace=null};this.isLocked=function(){return _lockedFace!=null};this.lockCurrentAxis=function(){if(_currentFace!=null){_lockedAxis=(_currentFace==="left"||_currentFace==="right")?X_AXIS_FACES:Y_AXIS_FACES}};this.unlockCurrentAxis=function(){_lockedAxis=null};this.compute=function(params){return continuousAnchorLocations[params.element.id]||[0,0]};this.getCurrentLocation=function(params){return continuousAnchorLocations[params.element.id]||[0,0]};this.getOrientation=function(endpoint){return continuousAnchorOrientations[endpoint.id]||[0,0]};this.getCssClass=function(){return cssClass}};jsPlumbInstance.continuousAnchorFactory={get:function(params){return new ContinuousAnchor(params)},clear:function(elementId){delete continuousAnchorLocations[elementId]}}};_jp.AnchorManager.prototype.calculateOrientation=function(sourceId,targetId,sd,td,sourceAnchor,targetAnchor,connection,sourceRotation,targetRotation){var Orientation={HORIZONTAL:"horizontal",VERTICAL:"vertical",DIAGONAL:"diagonal",IDENTITY:"identity"},axes=["left","top","right","bottom"];if(sourceId===targetId){return{orientation:Orientation.IDENTITY,a:["top","top"]}}
var theta=Math.atan2((td.centery-sd.centery),(td.centerx-sd.centerx)),theta2=Math.atan2((sd.centery-td.centery),(sd.centerx-td.centerx));var candidates=[],midpoints={};(function(types,dim){for(var i=0;i<types.length;i++){midpoints[types[i]]={"left":[dim[i][0].left,dim[i][0].centery],"right":[dim[i][0].right,dim[i][0].centery],"top":[dim[i][0].centerx,dim[i][0].top],"bottom":[dim[i][0].centerx,dim[i][0].bottom]};if(dim[i][1]!==0){for(var axis in midpoints[types[i]]){midpoints[types[i]][axis]=jsPlumbUtil.rotatePoint(midpoints[types[i]][axis],[dim[i][0].centerx,dim[i][0].centery],dim[i][1])}}}})(["source","target"],[[sd,sourceRotation],[td,targetRotation]]);for(var sf=0;sf<axes.length;sf++){for(var tf=0;tf<axes.length;tf++){candidates.push({source:axes[sf],target:axes[tf],dist:Biltong.lineLength(midpoints.source[axes[sf]],midpoints.target[axes[tf]])})}}
candidates.sort(function(a,b){return a.dist<b.dist?-1:a.dist>b.dist?1:0});var sourceEdge=candidates[0].source,targetEdge=candidates[0].target;for(var i=0;i<candidates.length;i++){if(sourceAnchor.isContinuous&&sourceAnchor.locked){sourceEdge=sourceAnchor.getCurrentFace()}else if(!sourceAnchor.isContinuous||sourceAnchor.isEdgeSupported(candidates[i].source)){sourceEdge=candidates[i].source}else{sourceEdge=null}
if(targetAnchor.isContinuous&&targetAnchor.locked){targetEdge=targetAnchor.getCurrentFace()}else if(!targetAnchor.isContinuous||targetAnchor.isEdgeSupported(candidates[i].target)){targetEdge=candidates[i].target}else{targetEdge=null}
if(sourceEdge!=null&&targetEdge!=null){break}}
if(sourceAnchor.isContinuous){sourceAnchor.setCurrentFace(sourceEdge)}
if(targetAnchor.isContinuous){targetAnchor.setCurrentFace(targetEdge)}
return{a:[sourceEdge,targetEdge],theta:theta,theta2:theta2}};_jp.Anchor=function(params){this.x=params.x||0;this.y=params.y||0;this.elementId=params.elementId;this.cssClass=params.cssClass||"";this.orientation=params.orientation||[0,0];this.lastReturnValue=null;this.offsets=params.offsets||[0,0];this.timestamp=null;this._unrotatedOrientation=[this.orientation[0],this.orientation[1]];this.relocatable=params.relocatable!==!1;this.snapOnRelocate=params.snapOnRelocate!==!1;this.locked=!1;_ju.EventGenerator.apply(this);this.compute=function(params){var xy=params.xy,wh=params.wh,timestamp=params.timestamp;if(timestamp&&timestamp===this.timestamp){return this.lastReturnValue}
var candidate=[xy[0]+(this.x*wh[0])+this.offsets[0],xy[1]+(this.y*wh[1])+this.offsets[1],this.x,this.y];var rotation=params.rotation;if(rotation!=null&&rotation!==0){var c2=jsPlumbUtil.rotatePoint(candidate,[xy[0]+(wh[0]/2),xy[1]+(wh[1]/2)],rotation);this.orientation[0]=Math.round((this._unrotatedOrientation[0]*c2[2])-(this._unrotatedOrientation[1]*c2[3]));this.orientation[1]=Math.round((this._unrotatedOrientation[1]*c2[2])+(this._unrotatedOrientation[0]*c2[3]));this.lastReturnValue=[c2[0],c2[1],this.x,this.y]}else{this.orientation[0]=this._unrotatedOrientation[0];this.orientation[1]=this._unrotatedOrientation[1];this.lastReturnValue=candidate}
this.timestamp=timestamp;return this.lastReturnValue};this.getCurrentLocation=function(params){params=params||{};return(this.lastReturnValue==null||(params.timestamp!=null&&this.timestamp!==params.timestamp))?this.compute(params):this.lastReturnValue};this.setPosition=function(x,y,ox,oy,overrideLock){if(!this.locked||overrideLock){this.x=x;this.y=y;this.orientation=[ox,oy];this.lastReturnValue=null}}};_ju.extend(_jp.Anchor,_ju.EventGenerator,{equals:function(anchor){if(!anchor){return!1}
var ao=anchor.getOrientation(),o=this.getOrientation();return this.x===anchor.x&&this.y===anchor.y&&this.offsets[0]===anchor.offsets[0]&&this.offsets[1]===anchor.offsets[1]&&o[0]===ao[0]&&o[1]===ao[1]},getOrientation:function(){return this.orientation},getCssClass:function(){return this.cssClass}});_jp.FloatingAnchor=function(params){_jp.Anchor.apply(this,arguments);var ref=params.reference,refCanvas=params.referenceCanvas,size=_jp.getSize(refCanvas),xDir=0,yDir=0,orientation=null,_lastResult=null;this.orientation=null;this.x=0;this.y=0;this.isFloating=!0;this.compute=function(params){var xy=params.xy,result=[xy[0]+(size[0]/2),xy[1]+(size[1]/2)];_lastResult=result;return result};this.getOrientation=function(_endpoint){if(orientation){return orientation}else{var o=ref.getOrientation(_endpoint);return[Math.abs(o[0])*xDir*-1,Math.abs(o[1])*yDir*-1]}};this.over=function(anchor,endpoint){orientation=anchor.getOrientation(endpoint)};this.out=function(){orientation=null};this.getCurrentLocation=function(params){return _lastResult==null?this.compute(params):_lastResult}};_ju.extend(_jp.FloatingAnchor,_jp.Anchor);var _convertAnchor=function(anchor,jsPlumbInstance,elementId){return anchor.constructor===_jp.Anchor?anchor:jsPlumbInstance.makeAnchor(anchor,elementId,jsPlumbInstance)};_jp.DynamicAnchor=function(params){_jp.Anchor.apply(this,arguments);this.isDynamic=!0;this.anchors=[];this.elementId=params.elementId;this.jsPlumbInstance=params.jsPlumbInstance;for(var i=0;i<params.anchors.length;i++){this.anchors[i]=_convertAnchor(params.anchors[i],this.jsPlumbInstance,this.elementId)}
this.getAnchors=function(){return this.anchors};var _curAnchor=this.anchors.length>0?this.anchors[0]:null,_lastAnchor=_curAnchor,self=this,_distance=function(anchor,cx,cy,xy,wh,r,tr){var ax=xy[0]+(anchor.x*wh[0]),ay=xy[1]+(anchor.y*wh[1]),acx=xy[0]+(wh[0]/2),acy=xy[1]+(wh[1]/2);if(r!=null&&r!==0){var rotated=jsPlumbUtil.rotatePoint([ax,ay],[acx,acy],r);ax=rotated[0];ay=rotated[1]}
return(Math.sqrt(Math.pow(cx-ax,2)+Math.pow(cy-ay,2))+Math.sqrt(Math.pow(acx-ax,2)+Math.pow(acy-ay,2)))},_anchorSelector=params.selector||function(xy,wh,txy,twh,r,tr,anchors){var cx=txy[0]+(twh[0]/2),cy=txy[1]+(twh[1]/2);var minIdx=-1,minDist=Infinity;for(var i=0;i<anchors.length;i++){var d=_distance(anchors[i],cx,cy,xy,wh,r,tr);if(d<minDist){minIdx=i+0;minDist=d}}
return anchors[minIdx]};this.compute=function(params){var xy=params.xy,wh=params.wh,txy=params.txy,twh=params.twh,r=params.rotation,tr=params.tRotation;this.timestamp=params.timestamp;if(this.locked||txy==null||twh==null){this.lastReturnValue=_curAnchor.compute(params);return this.lastReturnValue}else{params.timestamp=null}
_curAnchor=_anchorSelector(xy,wh,txy,twh,r,tr,this.anchors);this.x=_curAnchor.x;this.y=_curAnchor.y;if(_curAnchor!==_lastAnchor){this.fire("anchorChanged",_curAnchor)}
_lastAnchor=_curAnchor;this.lastReturnValue=_curAnchor.compute(params);return this.lastReturnValue};this.getCurrentLocation=function(params){return _curAnchor!=null?_curAnchor.getCurrentLocation(params):null};this.getOrientation=function(_endpoint){return _curAnchor!=null?_curAnchor.getOrientation(_endpoint):[0,0]};this.over=function(anchor,endpoint){if(_curAnchor!=null){_curAnchor.over(anchor,endpoint)}};this.out=function(){if(_curAnchor!=null){_curAnchor.out()}};this.setAnchor=function(a){_curAnchor=a};this.getCssClass=function(){return(_curAnchor&&_curAnchor.getCssClass())||""};this.setAnchorCoordinates=function(coords){var idx=jsPlumbUtil.findWithFunction(this.anchors,function(a){return a.x===coords[0]&&a.y===coords[1]});if(idx!==-1){this.setAnchor(this.anchors[idx]);return!0}else{return!1}}};_ju.extend(_jp.DynamicAnchor,_jp.Anchor);var _curryAnchor=function(x,y,ox,oy,type,fnInit){_jp.Anchors[type]=function(params){var a=params.jsPlumbInstance.makeAnchor([x,y,ox,oy,0,0],params.elementId,params.jsPlumbInstance);a.type=type;if(fnInit){fnInit(a,params)}
return a}};_curryAnchor(0.5,0,0,-1,"TopCenter");_curryAnchor(0.5,1,0,1,"BottomCenter");_curryAnchor(0,0.5,-1,0,"LeftMiddle");_curryAnchor(1,0.5,1,0,"RightMiddle");_curryAnchor(0.5,0,0,-1,"Top");_curryAnchor(0.5,1,0,1,"Bottom");_curryAnchor(0,0.5,-1,0,"Left");_curryAnchor(1,0.5,1,0,"Right");_curryAnchor(0.5,0.5,0,0,"Center");_curryAnchor(1,0,0,-1,"TopRight");_curryAnchor(1,1,0,1,"BottomRight");_curryAnchor(0,0,0,-1,"TopLeft");_curryAnchor(0,1,0,1,"BottomLeft");_jp.Defaults.DynamicAnchors=function(params){return params.jsPlumbInstance.makeAnchors(["TopCenter","RightMiddle","BottomCenter","LeftMiddle"],params.elementId,params.jsPlumbInstance)};_jp.Anchors.AutoDefault=function(params){var a=params.jsPlumbInstance.makeDynamicAnchor(_jp.Defaults.DynamicAnchors(params));a.type="AutoDefault";return a};var _curryContinuousAnchor=function(type,faces){_jp.Anchors[type]=function(params){var a=params.jsPlumbInstance.makeAnchor(["Continuous",{faces:faces}],params.elementId,params.jsPlumbInstance);a.type=type;return a}};_jp.Anchors.Continuous=function(params){return params.jsPlumbInstance.continuousAnchorFactory.get(params)};_curryContinuousAnchor("ContinuousLeft",["left"]);_curryContinuousAnchor("ContinuousTop",["top"]);_curryContinuousAnchor("ContinuousBottom",["bottom"]);_curryContinuousAnchor("ContinuousRight",["right"]);_curryAnchor(0,0,0,0,"Assign",function(anchor,params){var pf=params.position||"Fixed";anchor.positionFinder=pf.constructor===String?params.jsPlumbInstance.AnchorPositionFinders[pf]:pf;anchor.constructorParams=params});root.jsPlumbInstance.prototype.AnchorPositionFinders={"Fixed":function(dp,ep,es){return[(dp.left-ep.left)/es[0],(dp.top-ep.top)/es[1]]},"Grid":function(dp,ep,es,params){var dx=dp.left-ep.left,dy=dp.top-ep.top,gx=es[0]/(params.grid[0]),gy=es[1]/(params.grid[1]),mx=Math.floor(dx/gx),my=Math.floor(dy/gy);return[((mx*gx)+(gx/2))/es[0],((my*gy)+(gy/2))/es[1]]}};_jp.Anchors.Perimeter=function(params){params=params||{};var anchorCount=params.anchorCount||60,shape=params.shape;if(!shape){throw new Error("no shape supplied to Perimeter Anchor type")}
var _circle=function(){var r=0.5,step=Math.PI*2/anchorCount,current=0,a=[];for(var i=0;i<anchorCount;i++){var x=r+(r*Math.sin(current)),y=r+(r*Math.cos(current));a.push([x,y,0,0]);current+=step}
return a},_path=function(segments){var anchorsPerFace=anchorCount/segments.length,a=[],_computeFace=function(x1,y1,x2,y2,fractionalLength,ox,oy){anchorsPerFace=anchorCount*fractionalLength;var dx=(x2-x1)/anchorsPerFace,dy=(y2-y1)/anchorsPerFace;for(var i=0;i<anchorsPerFace;i++){a.push([x1+(dx*i),y1+(dy*i),ox==null?0:ox,oy==null?0:oy])}};for(var i=0;i<segments.length;i++){_computeFace.apply(null,segments[i])}
return a},_shape=function(faces){var s=[];for(var i=0;i<faces.length;i++){s.push([faces[i][0],faces[i][1],faces[i][2],faces[i][3],1/faces.length,faces[i][4],faces[i][5]])}
return _path(s)},_rectangle=function(){return _shape([[0,0,1,0,0,-1],[1,0,1,1,1,0],[1,1,0,1,0,1],[0,1,0,0,-1,0]])};var _shapes={"Circle":_circle,"Ellipse":_circle,"Diamond":function(){return _shape([[0.5,0,1,0.5],[1,0.5,0.5,1],[0.5,1,0,0.5],[0,0.5,0.5,0]])},"Rectangle":_rectangle,"Square":_rectangle,"Triangle":function(){return _shape([[0.5,0,1,1],[1,1,0,1],[0,1,0.5,0]])},"Path":function(params){var points=params.points,p=[],tl=0;for(var i=0;i<points.length-1;i++){var l=Math.sqrt(Math.pow(points[i][2]-points[i][0])+Math.pow(points[i][3]-points[i][1]));tl+=l;p.push([points[i][0],points[i][1],points[i+1][0],points[i+1][1],l])}
for(var j=0;j<p.length;j++){p[j][4]=p[j][4]/tl}
return _path(p)}},_rotate=function(points,amountInDegrees){var o=[],theta=amountInDegrees/180*Math.PI;for(var i=0;i<points.length;i++){var _x=points[i][0]-0.5,_y=points[i][1]-0.5;o.push([0.5+((_x*Math.cos(theta))-(_y*Math.sin(theta))),0.5+((_x*Math.sin(theta))+(_y*Math.cos(theta))),points[i][2],points[i][3]])}
return o};if(!_shapes[shape]){throw new Error("Shape ["+shape+"] is unknown by Perimeter Anchor type")}
var da=_shapes[shape](params);if(params.rotation){da=_rotate(da,params.rotation)}
var a=params.jsPlumbInstance.makeDynamicAnchor(da);a.type="Perimeter";return a}}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_ju=root.jsPlumbUtil,_jp=root.jsPlumb;_jp.DefaultRouter=function(jsPlumbInstance){this.jsPlumbInstance=jsPlumbInstance;this.anchorManager=new _jp.AnchorManager({jsPlumbInstance:jsPlumbInstance});this.sourceOrTargetChanged=function(originalId,newId,connection,newElement,anchorIndex){this.anchorManager.sourceOrTargetChanged(originalId,newId,connection,newElement,anchorIndex)};this.reset=function(){this.anchorManager.reset()};this.changeId=function(oldId,newId){this.anchorManager.changeId(oldId,newId)};this.elementRemoved=function(elementId){this.anchorManager.elementRemoved(elementId)};this.newConnection=function(conn){this.anchorManager.newConnection(conn)};this.connectionDetached=function(connInfo,doNotRedraw){this.anchorManager.connectionDetached(connInfo,doNotRedraw)};this.redraw=function(elementId,ui,timestamp,offsetToUI,clearEdits,doNotRecalcEndpoint){return this.anchorManager.redraw(elementId,ui,timestamp,offsetToUI,clearEdits,doNotRecalcEndpoint)};this.deleteEndpoint=function(endpoint){this.anchorManager.deleteEndpoint(endpoint)};this.rehomeEndpoint=function(ep,currentId,element){this.anchorManager.rehomeEndpoint(ep,currentId,element)};this.addEndpoint=function(endpoint,elementId){this.anchorManager.addEndpoint(endpoint,elementId)}}}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_jp=root.jsPlumb,_ju=root.jsPlumbUtil,_jg=root.Biltong;_jp.Segments={AbstractSegment:function(params){this.params=params;this.findClosestPointOnPath=function(x,y){return{d:Infinity,x:null,y:null,l:null}};this.getBounds=function(){return{minX:Math.min(params.x1,params.x2),minY:Math.min(params.y1,params.y2),maxX:Math.max(params.x1,params.x2),maxY:Math.max(params.y1,params.y2)}};this.lineIntersection=function(x1,y1,x2,y2){return[]};this.boxIntersection=function(x,y,w,h){var a=[];a.push.apply(a,this.lineIntersection(x,y,x+w,y));a.push.apply(a,this.lineIntersection(x+w,y,x+w,y+h));a.push.apply(a,this.lineIntersection(x+w,y+h,x,y+h));a.push.apply(a,this.lineIntersection(x,y+h,x,y));return a};this.boundingBoxIntersection=function(box){return this.boxIntersection(box.x,box.y,box.w,box.y)}},Straight:function(params){var _super=_jp.Segments.AbstractSegment.apply(this,arguments),length,m,m2,x1,x2,y1,y2,_recalc=function(){length=Math.sqrt(Math.pow(x2-x1,2)+Math.pow(y2-y1,2));m=_jg.gradient({x:x1,y:y1},{x:x2,y:y2});m2=-1/m};this.type="Straight";this.getLength=function(){return length};this.getGradient=function(){return m};this.getCoordinates=function(){return{x1:x1,y1:y1,x2:x2,y2:y2}};this.setCoordinates=function(coords){x1=coords.x1;y1=coords.y1;x2=coords.x2;y2=coords.y2;_recalc()};this.setCoordinates({x1:params.x1,y1:params.y1,x2:params.x2,y2:params.y2});this.getBounds=function(){return{minX:Math.min(x1,x2),minY:Math.min(y1,y2),maxX:Math.max(x1,x2),maxY:Math.max(y1,y2)}};this.pointOnPath=function(location,absolute){if(location===0&&!absolute){return{x:x1,y:y1}}else if(location===1&&!absolute){return{x:x2,y:y2}}else{var l=absolute?location>0?location:length+location:location*length;return _jg.pointOnLine({x:x1,y:y1},{x:x2,y:y2},l)}};this.gradientAtPoint=function(_){return m};this.pointAlongPathFrom=function(location,distance,absolute){var p=this.pointOnPath(location,absolute),farAwayPoint=distance<=0?{x:x1,y:y1}:{x:x2,y:y2};if(distance<=0&&Math.abs(distance)>1){distance*=-1}
return _jg.pointOnLine(p,farAwayPoint,distance)};var within=function(a,b,c){return c>=Math.min(a,b)&&c<=Math.max(a,b)};var closest=function(a,b,c){return Math.abs(c-a)<Math.abs(c-b)?a:b};this.findClosestPointOnPath=function(x,y){var out={d:Infinity,x:null,y:null,l:null,x1:x1,x2:x2,y1:y1,y2:y2};if(m===0){out.y=y1;out.x=within(x1,x2,x)?x:closest(x1,x2,x)}else if(m===Infinity||m===-Infinity){out.x=x1;out.y=within(y1,y2,y)?y:closest(y1,y2,y)}else{var b=y1-(m*x1),b2=y-(m2*x),_x1=(b2-b)/(m-m2),_y1=(m*_x1)+b;out.x=within(x1,x2,_x1)?_x1:closest(x1,x2,_x1);out.y=within(y1,y2,_y1)?_y1:closest(y1,y2,_y1)}
var fractionInSegment=_jg.lineLength([out.x,out.y],[x1,y1]);out.d=_jg.lineLength([x,y],[out.x,out.y]);out.l=fractionInSegment/length;return out};var _pointLiesBetween=function(q,p1,p2){return(p2>p1)?(p1<=q&&q<=p2):(p1>=q&&q>=p2)},_plb=_pointLiesBetween;this.lineIntersection=function(_x1,_y1,_x2,_y2){var m2=Math.abs(_jg.gradient({x:_x1,y:_y1},{x:_x2,y:_y2})),m1=Math.abs(m),b=m1===Infinity?x1:y1-(m1*x1),out=[],b2=m2===Infinity?_x1:_y1-(m2*_x1);if(m2!==m1){if(m2===Infinity&&m1===0){if(_plb(_x1,x1,x2)&&_plb(y1,_y1,_y2)){out=[_x1,y1]}}else if(m2===0&&m1===Infinity){if(_plb(_y1,y1,y2)&&_plb(x1,_x1,_x2)){out=[x1,_y1]}}else{var X,Y;if(m2===Infinity){X=_x1;if(_plb(X,x1,x2)){Y=(m1*_x1)+b;if(_plb(Y,_y1,_y2)){out=[X,Y]}}}else if(m2===0){Y=_y1;if(_plb(Y,y1,y2)){X=(_y1-b)/m1;if(_plb(X,_x1,_x2)){out=[X,Y]}}}else{X=(b2-b)/(m1-m2);Y=(m1*X)+b;if(_plb(X,x1,x2)&&_plb(Y,y1,y2)){out=[X,Y]}}}}
return out};this.boxIntersection=function(x,y,w,h){var a=[];a.push.apply(a,this.lineIntersection(x,y,x+w,y));a.push.apply(a,this.lineIntersection(x+w,y,x+w,y+h));a.push.apply(a,this.lineIntersection(x+w,y+h,x,y+h));a.push.apply(a,this.lineIntersection(x,y+h,x,y));return a};this.boundingBoxIntersection=function(box){return this.boxIntersection(box.x,box.y,box.w,box.h)}},Arc:function(params){var _super=_jp.Segments.AbstractSegment.apply(this,arguments),_calcAngle=function(_x,_y){return _jg.theta([params.cx,params.cy],[_x,_y])},_calcAngleForLocation=function(segment,location){if(segment.anticlockwise){var sa=segment.startAngle<segment.endAngle?segment.startAngle+TWO_PI:segment.startAngle,s=Math.abs(sa-segment.endAngle);return sa-(s*location)}else{var ea=segment.endAngle<segment.startAngle?segment.endAngle+TWO_PI:segment.endAngle,ss=Math.abs(ea-segment.startAngle);return segment.startAngle+(ss*location)}},TWO_PI=2*Math.PI;this.radius=params.r;this.anticlockwise=params.ac;this.type="Arc";if(params.startAngle&&params.endAngle){this.startAngle=params.startAngle;this.endAngle=params.endAngle;this.x1=params.cx+(this.radius*Math.cos(params.startAngle));this.y1=params.cy+(this.radius*Math.sin(params.startAngle));this.x2=params.cx+(this.radius*Math.cos(params.endAngle));this.y2=params.cy+(this.radius*Math.sin(params.endAngle))}else{this.startAngle=_calcAngle(params.x1,params.y1);this.endAngle=_calcAngle(params.x2,params.y2);this.x1=params.x1;this.y1=params.y1;this.x2=params.x2;this.y2=params.y2}
if(this.endAngle<0){this.endAngle+=TWO_PI}
if(this.startAngle<0){this.startAngle+=TWO_PI}
var ea=this.endAngle<this.startAngle?this.endAngle+TWO_PI:this.endAngle;this.sweep=Math.abs(ea-this.startAngle);if(this.anticlockwise){this.sweep=TWO_PI-this.sweep}
var circumference=2*Math.PI*this.radius,frac=this.sweep/TWO_PI,length=circumference*frac;this.getLength=function(){return length};this.getBounds=function(){return{minX:params.cx-params.r,maxX:params.cx+params.r,minY:params.cy-params.r,maxY:params.cy+params.r}};var VERY_SMALL_VALUE=0.0000000001,gentleRound=function(n){var f=Math.floor(n),r=Math.ceil(n);if(n-f<VERY_SMALL_VALUE){return f}else if(r-n<VERY_SMALL_VALUE){return r}
return n};this.pointOnPath=function(location,absolute){if(location===0){return{x:this.x1,y:this.y1,theta:this.startAngle}}else if(location===1){return{x:this.x2,y:this.y2,theta:this.endAngle}}
if(absolute){location=location/length}
var angle=_calcAngleForLocation(this,location),_x=params.cx+(params.r*Math.cos(angle)),_y=params.cy+(params.r*Math.sin(angle));return{x:gentleRound(_x),y:gentleRound(_y),theta:angle}};this.gradientAtPoint=function(location,absolute){var p=this.pointOnPath(location,absolute);var m=_jg.normal([params.cx,params.cy],[p.x,p.y]);if(!this.anticlockwise&&(m===Infinity||m===-Infinity)){m*=-1}
return m};this.pointAlongPathFrom=function(location,distance,absolute){var p=this.pointOnPath(location,absolute),arcSpan=distance/circumference*2*Math.PI,dir=this.anticlockwise?-1:1,startAngle=p.theta+(dir*arcSpan),startX=params.cx+(this.radius*Math.cos(startAngle)),startY=params.cy+(this.radius*Math.sin(startAngle));return{x:startX,y:startY}}},Bezier:function(params){this.curve=[{x:params.x1,y:params.y1},{x:params.cp1x,y:params.cp1y},{x:params.cp2x,y:params.cp2y},{x:params.x2,y:params.y2}];var _isPoint=function(c){return c[0].x===c[1].x&&c[0].y===c[1].y};var _dist=function(p1,p2){return Math.sqrt(Math.pow(p1.x-p2.x,2)+Math.pow(p1.y-p2.y,2))};var _compute=function(loc){var EMPTY_POINT={x:0,y:0};if(loc===0){return this.curve[0]}
var degree=this.curve.length-1;if(loc===1){return this.curve[degree]}
var o=this.curve;var s=1-loc;if(degree===0){return this.curve[0]}
if(degree===1){return{x:s*o[0].x+loc*o[1].x,y:s*o[0].y+loc*o[1].y}}
if(degree<4){var l=s*s,h=loc*loc,u=0,m,g,f;if(degree===2){o=[o[0],o[1],o[2],EMPTY_POINT];m=l;g=2*(s*loc);f=h}else if(degree===3){m=l*s;g=3*(l*loc);f=3*(s*h);u=loc*h}
return{x:m*o[0].x+g*o[1].x+f*o[2].x+u*o[3].x,y:m*o[0].y+g*o[1].y+f*o[2].y+u*o[3].y}}else{return EMPTY_POINT}}.bind(this);var _getLUT=function(steps){var out=[];steps--;for(var n=0;n<=steps;n++){out.push(_compute(n/steps))}
return out};var _computeLength=function(){if(_isPoint(this.curve)){this.length=0}
var steps=16;var lut=_getLUT(steps);this.length=0;for(var i=0;i<steps-1;i++){var a=lut[i],b=lut[i+1];this.length+=_dist(a,b)}}.bind(this);var _super=_jp.Segments.AbstractSegment.apply(this,arguments);this.bounds={minX:Math.min(params.x1,params.x2,params.cp1x,params.cp2x),minY:Math.min(params.y1,params.y2,params.cp1y,params.cp2y),maxX:Math.max(params.x1,params.x2,params.cp1x,params.cp2x),maxY:Math.max(params.y1,params.y2,params.cp1y,params.cp2y)};this.type="Bezier";_computeLength();var _translateLocation=function(_curve,location,absolute){if(absolute){location=root.jsBezier.locationAlongCurveFrom(_curve,location>0?0:1,location)}
return location};this.pointOnPath=function(location,absolute){location=_translateLocation(this.curve,location,absolute);return root.jsBezier.pointOnCurve(this.curve,location)};this.gradientAtPoint=function(location,absolute){location=_translateLocation(this.curve,location,absolute);return root.jsBezier.gradientAtPoint(this.curve,location)};this.pointAlongPathFrom=function(location,distance,absolute){location=_translateLocation(this.curve,location,absolute);return root.jsBezier.pointAlongCurveFrom(this.curve,location,distance)};this.getLength=function(){return this.length};this.getBounds=function(){return this.bounds};this.findClosestPointOnPath=function(x,y){var p=root.jsBezier.nearestPointOnCurve({x:x,y:y},this.curve);return{d:Math.sqrt(Math.pow(p.point.x-x,2)+Math.pow(p.point.y-y,2)),x:p.point.x,y:p.point.y,l:1-p.location,s:this}};this.lineIntersection=function(x1,y1,x2,y2){return root.jsBezier.lineIntersection(x1,y1,x2,y2,this.curve)}}};_jp.SegmentRenderer={getPath:function(segment,isFirstSegment){return({"Straight":function(isFirstSegment){var d=segment.getCoordinates();return(isFirstSegment?"M "+d.x1+" "+d.y1+" ":"")+"L "+d.x2+" "+d.y2},"Bezier":function(isFirstSegment){var d=segment.params;return(isFirstSegment?"M "+d.x2+" "+d.y2+" ":"")+"C "+d.cp2x+" "+d.cp2y+" "+d.cp1x+" "+d.cp1y+" "+d.x1+" "+d.y1},"Arc":function(isFirstSegment){var d=segment.params,laf=segment.sweep>Math.PI?1:0,sf=segment.anticlockwise?0:1;return(isFirstSegment?"M"+segment.x1+" "+segment.y1+" ":"")+"A "+segment.radius+" "+d.r+" 0 "+laf+","+sf+" "+segment.x2+" "+segment.y2}})[segment.type](isFirstSegment)}};var AbstractComponent=function(){this.resetBounds=function(){this.bounds={minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity}};this.resetBounds()};_jp.Connectors.AbstractConnector=function(params){AbstractComponent.apply(this,arguments);var segments=[],totalLength=0,segmentProportions=[],segmentProportionalLengths=[],stub=params.stub||0,sourceStub=_ju.isArray(stub)?stub[0]:stub,targetStub=_ju.isArray(stub)?stub[1]:stub,gap=params.gap||0,sourceGap=_ju.isArray(gap)?gap[0]:gap,targetGap=_ju.isArray(gap)?gap[1]:gap,userProvidedSegments=null,paintInfo=null;this.getPathData=function(){var p="";for(var i=0;i<segments.length;i++){p+=_jp.SegmentRenderer.getPath(segments[i],i===0);p+=" "}
return p};this.findSegmentForPoint=function(x,y){var out={d:Infinity,s:null,x:null,y:null,l:null};for(var i=0;i<segments.length;i++){var _s=segments[i].findClosestPointOnPath(x,y);if(_s.d<out.d){out.d=_s.d;out.l=_s.l;out.x=_s.x;out.y=_s.y;out.s=segments[i];out.x1=_s.x1;out.x2=_s.x2;out.y1=_s.y1;out.y2=_s.y2;out.index=i;out.connectorLocation=segmentProportions[i][0]+(_s.l*(segmentProportions[i][1]-segmentProportions[i][0]))}}
return out};this.lineIntersection=function(x1,y1,x2,y2){var out=[];for(var i=0;i<segments.length;i++){out.push.apply(out,segments[i].lineIntersection(x1,y1,x2,y2))}
return out};this.boxIntersection=function(x,y,w,h){var out=[];for(var i=0;i<segments.length;i++){out.push.apply(out,segments[i].boxIntersection(x,y,w,h))}
return out};this.boundingBoxIntersection=function(box){var out=[];for(var i=0;i<segments.length;i++){out.push.apply(out,segments[i].boundingBoxIntersection(box))}
return out};var _updateSegmentProportions=function(){var curLoc=0;for(var i=0;i<segments.length;i++){var sl=segments[i].getLength();segmentProportionalLengths[i]=sl/totalLength;segmentProportions[i]=[curLoc,(curLoc+=(sl/totalLength))]}},_findSegmentForLocation=function(location,absolute){var idx,i,inSegmentProportion;if(absolute){location=location>0?location/totalLength:(totalLength+location)/totalLength}
if(location===1){idx=segments.length-1;inSegmentProportion=1}else if(location===0){inSegmentProportion=0;idx=0}else{if(location>=0.5){idx=0;inSegmentProportion=0;for(i=segmentProportions.length-1;i>-1;i--){if(segmentProportions[i][1]>=location&&segmentProportions[i][0]<=location){idx=i;inSegmentProportion=(location-segmentProportions[i][0])/segmentProportionalLengths[i];break}}}else{idx=segmentProportions.length-1;inSegmentProportion=1;for(i=0;i<segmentProportions.length;i++){if(segmentProportions[i][1]>=location){idx=i;inSegmentProportion=(location-segmentProportions[i][0])/segmentProportionalLengths[i];break}}}}
return{segment:segments[idx],proportion:inSegmentProportion,index:idx}},_addSegment=function(conn,type,params){if(params.x1===params.x2&&params.y1===params.y2){return}
var s=new _jp.Segments[type](params);segments.push(s);totalLength+=s.getLength();conn.updateBounds(s)},_clearSegments=function(){totalLength=segments.length=segmentProportions.length=segmentProportionalLengths.length=0};this.setSegments=function(_segs){userProvidedSegments=[];totalLength=0;for(var i=0;i<_segs.length;i++){userProvidedSegments.push(_segs[i]);totalLength+=_segs[i].getLength()}};this.getLength=function(){return totalLength};var _prepareCompute=function(params){this.strokeWidth=params.strokeWidth;var segment=_jg.quadrant(params.sourcePos,params.targetPos),swapX=params.targetPos[0]<params.sourcePos[0],swapY=params.targetPos[1]<params.sourcePos[1],lw=params.strokeWidth||1,so=params.sourceEndpoint.anchor.getOrientation(params.sourceEndpoint),to=params.targetEndpoint.anchor.getOrientation(params.targetEndpoint),x=swapX?params.targetPos[0]:params.sourcePos[0],y=swapY?params.targetPos[1]:params.sourcePos[1],w=Math.abs(params.targetPos[0]-params.sourcePos[0]),h=Math.abs(params.targetPos[1]-params.sourcePos[1]);if(so[0]===0&&so[1]===0||to[0]===0&&to[1]===0){var index=w>h?0:1,oIndex=[1,0][index];so=[];to=[];so[index]=params.sourcePos[index]>params.targetPos[index]?-1:1;to[index]=params.sourcePos[index]>params.targetPos[index]?1:-1;so[oIndex]=0;to[oIndex]=0}
var sx=swapX?w+(sourceGap*so[0]):sourceGap*so[0],sy=swapY?h+(sourceGap*so[1]):sourceGap*so[1],tx=swapX?targetGap*to[0]:w+(targetGap*to[0]),ty=swapY?targetGap*to[1]:h+(targetGap*to[1]),oProduct=((so[0]*to[0])+(so[1]*to[1]));var result={sx:sx,sy:sy,tx:tx,ty:ty,lw:lw,xSpan:Math.abs(tx-sx),ySpan:Math.abs(ty-sy),mx:(sx+tx)/2,my:(sy+ty)/2,so:so,to:to,x:x,y:y,w:w,h:h,segment:segment,startStubX:sx+(so[0]*sourceStub),startStubY:sy+(so[1]*sourceStub),endStubX:tx+(to[0]*targetStub),endStubY:ty+(to[1]*targetStub),isXGreaterThanStubTimes2:Math.abs(sx-tx)>(sourceStub+targetStub),isYGreaterThanStubTimes2:Math.abs(sy-ty)>(sourceStub+targetStub),opposite:oProduct===-1,perpendicular:oProduct===0,orthogonal:oProduct===1,sourceAxis:so[0]===0?"y":"x",points:[x,y,w,h,sx,sy,tx,ty],stubs:[sourceStub,targetStub]};result.anchorOrientation=result.opposite?"opposite":result.orthogonal?"orthogonal":"perpendicular";return result};this.getSegments=function(){return segments};this.updateBounds=function(segment){var segBounds=segment.getBounds();this.bounds.minX=Math.min(this.bounds.minX,segBounds.minX);this.bounds.maxX=Math.max(this.bounds.maxX,segBounds.maxX);this.bounds.minY=Math.min(this.bounds.minY,segBounds.minY);this.bounds.maxY=Math.max(this.bounds.maxY,segBounds.maxY)};var dumpSegmentsToConsole=function(){console.log("SEGMENTS:");for(var i=0;i<segments.length;i++){console.log(segments[i].type,segments[i].getLength(),segmentProportions[i])}};this.pointOnPath=function(location,absolute){var seg=_findSegmentForLocation(location,absolute);return seg.segment&&seg.segment.pointOnPath(seg.proportion,!1)||[0,0]};this.gradientAtPoint=function(location,absolute){var seg=_findSegmentForLocation(location,absolute);return seg.segment&&seg.segment.gradientAtPoint(seg.proportion,!1)||0};this.pointAlongPathFrom=function(location,distance,absolute){var seg=_findSegmentForLocation(location,absolute);return seg.segment&&seg.segment.pointAlongPathFrom(seg.proportion,distance,!1)||[0,0]};this.compute=function(params){paintInfo=_prepareCompute.call(this,params);_clearSegments();this._compute(paintInfo,params);this.x=paintInfo.points[0];this.y=paintInfo.points[1];this.w=paintInfo.points[2];this.h=paintInfo.points[3];this.segment=paintInfo.segment;_updateSegmentProportions()};return{addSegment:_addSegment,prepareCompute:_prepareCompute,sourceStub:sourceStub,targetStub:targetStub,maxStub:Math.max(sourceStub,targetStub),sourceGap:sourceGap,targetGap:targetGap,maxGap:Math.max(sourceGap,targetGap)}};_ju.extend(_jp.Connectors.AbstractConnector,AbstractComponent);_jp.Endpoints.AbstractEndpoint=function(params){AbstractComponent.apply(this,arguments);var compute=this.compute=function(anchorPoint,orientation,endpointStyle,connectorPaintStyle){var out=this._compute.apply(this,arguments);this.x=out[0];this.y=out[1];this.w=out[2];this.h=out[3];this.bounds.minX=this.x;this.bounds.minY=this.y;this.bounds.maxX=this.x+this.w;this.bounds.maxY=this.y+this.h;return out};return{compute:compute,cssClass:params.cssClass}};_ju.extend(_jp.Endpoints.AbstractEndpoint,AbstractComponent);_jp.Endpoints.Dot=function(params){this.type="Dot";var _super=_jp.Endpoints.AbstractEndpoint.apply(this,arguments);params=params||{};this.radius=params.radius||10;this.defaultOffset=0.5*this.radius;this.defaultInnerRadius=this.radius/3;this._compute=function(anchorPoint,orientation,endpointStyle,connectorPaintStyle){this.radius=endpointStyle.radius||this.radius;var x=anchorPoint[0]-this.radius,y=anchorPoint[1]-this.radius,w=this.radius*2,h=this.radius*2;if(endpointStyle.stroke){var lw=endpointStyle.strokeWidth||1;x-=lw;y-=lw;w+=(lw*2);h+=(lw*2)}
return[x,y,w,h,this.radius]}};_ju.extend(_jp.Endpoints.Dot,_jp.Endpoints.AbstractEndpoint);_jp.Endpoints.Rectangle=function(params){this.type="Rectangle";var _super=_jp.Endpoints.AbstractEndpoint.apply(this,arguments);params=params||{};this.width=params.width||20;this.height=params.height||20;this._compute=function(anchorPoint,orientation,endpointStyle,connectorPaintStyle){var width=endpointStyle.width||this.width,height=endpointStyle.height||this.height,x=anchorPoint[0]-(width/2),y=anchorPoint[1]-(height/2);return[x,y,width,height]}};_ju.extend(_jp.Endpoints.Rectangle,_jp.Endpoints.AbstractEndpoint);var DOMElementEndpoint=function(params){_jp.jsPlumbUIComponent.apply(this,arguments);this._jsPlumb.displayElements=[]};_ju.extend(DOMElementEndpoint,_jp.jsPlumbUIComponent,{getDisplayElements:function(){return this._jsPlumb.displayElements},appendDisplayElement:function(el){this._jsPlumb.displayElements.push(el)}});_jp.Endpoints.Image=function(params){this.type="Image";DOMElementEndpoint.apply(this,arguments);_jp.Endpoints.AbstractEndpoint.apply(this,arguments);var _onload=params.onload,src=params.src||params.url,clazz=params.cssClass?" "+params.cssClass:"";this._jsPlumb.img=new Image();this._jsPlumb.ready=!1;this._jsPlumb.initialized=!1;this._jsPlumb.deleted=!1;this._jsPlumb.widthToUse=params.width;this._jsPlumb.heightToUse=params.height;this._jsPlumb.endpoint=params.endpoint;this._jsPlumb.img.onload=function(){if(this._jsPlumb!=null){this._jsPlumb.ready=!0;this._jsPlumb.widthToUse=this._jsPlumb.widthToUse||this._jsPlumb.img.width;this._jsPlumb.heightToUse=this._jsPlumb.heightToUse||this._jsPlumb.img.height;if(_onload){_onload(this)}}}.bind(this);this._jsPlumb.endpoint.setImage=function(_img,onload){var s=_img.constructor===String?_img:_img.src;_onload=onload;this._jsPlumb.img.src=s;if(this.canvas!=null){this.canvas.setAttribute("src",this._jsPlumb.img.src)}}.bind(this);this._jsPlumb.endpoint.setImage(src,_onload);this._compute=function(anchorPoint,orientation,endpointStyle,connectorPaintStyle){this.anchorPoint=anchorPoint;if(this._jsPlumb.ready){return[anchorPoint[0]-this._jsPlumb.widthToUse/2,anchorPoint[1]-this._jsPlumb.heightToUse/2,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse]}else{return[0,0,0,0]}};this.canvas=_jp.createElement("img",{position:"absolute",margin:0,padding:0,outline:0},this._jsPlumb.instance.endpointClass+clazz);if(this._jsPlumb.widthToUse){this.canvas.setAttribute("width",this._jsPlumb.widthToUse)}
if(this._jsPlumb.heightToUse){this.canvas.setAttribute("height",this._jsPlumb.heightToUse)}
this._jsPlumb.instance.appendElement(this.canvas);this.actuallyPaint=function(d,style,anchor){if(!this._jsPlumb.deleted){if(!this._jsPlumb.initialized){this.canvas.setAttribute("src",this._jsPlumb.img.src);this.appendDisplayElement(this.canvas);this._jsPlumb.initialized=!0}
var x=this.anchorPoint[0]-(this._jsPlumb.widthToUse/2),y=this.anchorPoint[1]-(this._jsPlumb.heightToUse/2);_ju.sizeElement(this.canvas,x,y,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse)}};this.paint=function(style,anchor){if(this._jsPlumb!=null){if(this._jsPlumb.ready){this.actuallyPaint(style,anchor)}else{root.setTimeout(function(){this.paint(style,anchor)}.bind(this),200)}}}};_ju.extend(_jp.Endpoints.Image,[DOMElementEndpoint,_jp.Endpoints.AbstractEndpoint],{cleanup:function(force){if(force){this._jsPlumb.deleted=!0;if(this.canvas){this.canvas.parentNode.removeChild(this.canvas)}
this.canvas=null}}});_jp.Endpoints.Blank=function(params){var _super=_jp.Endpoints.AbstractEndpoint.apply(this,arguments);this.type="Blank";DOMElementEndpoint.apply(this,arguments);this._compute=function(anchorPoint,orientation,endpointStyle,connectorPaintStyle){return[anchorPoint[0],anchorPoint[1],10,0]};var clazz=params.cssClass?" "+params.cssClass:"";this.canvas=_jp.createElement("div",{display:"block",width:"1px",height:"1px",background:"transparent",position:"absolute"},this._jsPlumb.instance.endpointClass+clazz);this._jsPlumb.instance.appendElement(this.canvas);this.paint=function(style,anchor){_ju.sizeElement(this.canvas,this.x,this.y,this.w,this.h)}};_ju.extend(_jp.Endpoints.Blank,[_jp.Endpoints.AbstractEndpoint,DOMElementEndpoint],{cleanup:function(){if(this.canvas&&this.canvas.parentNode){this.canvas.parentNode.removeChild(this.canvas)}}});_jp.Endpoints.Triangle=function(params){this.type="Triangle";_jp.Endpoints.AbstractEndpoint.apply(this,arguments);var self=this;params=params||{};params.width=params.width||55;params.height=params.height||55;this.width=params.width;this.height=params.height;this._compute=function(anchorPoint,orientation,endpointStyle,connectorPaintStyle){var width=endpointStyle.width||self.width,height=endpointStyle.height||self.height,x=anchorPoint[0]-(width/2),y=anchorPoint[1]-(height/2);return[x,y,width,height]}};var AbstractOverlay=_jp.Overlays.AbstractOverlay=function(params){this.visible=!0;this.isAppendedAtTopLevel=!0;this.component=params.component;this.loc=params.location==null?0.5:params.location;this.endpointLoc=params.endpointLocation==null?[0.5,0.5]:params.endpointLocation;this.visible=params.visible!==!1};AbstractOverlay.prototype={cleanup:function(force){if(force){this.component=null;this.canvas=null;this.endpointLoc=null}},reattach:function(instance,component){},setVisible:function(val){this.visible=val;this.component.repaint()},isVisible:function(){return this.visible},hide:function(){this.setVisible(!1)},show:function(){this.setVisible(!0)},incrementLocation:function(amount){this.loc+=amount;this.component.repaint()},setLocation:function(l){this.loc=l;this.component.repaint()},getLocation:function(){return this.loc},updateFrom:function(){}};_jp.Overlays.Arrow=function(params){this.type="Arrow";AbstractOverlay.apply(this,arguments);this.isAppendedAtTopLevel=!1;params=params||{};var self=this;this.length=params.length||20;this.width=params.width||20;this.id=params.id;this.direction=(params.direction||1)<0?-1:1;var paintStyle=params.paintStyle||{"stroke-width":1},foldback=params.foldback||0.623;this.computeMaxSize=function(){return self.width*1.5};this.elementCreated=function(p,component){this.path=p;if(params.events){for(var i in params.events){_jp.on(p,i,params.events[i])}}};this.draw=function(component,currentConnectionPaintStyle){var hxy,mid,txy,tail,cxy;if(component.pointAlongPathFrom){if(_ju.isString(this.loc)||this.loc>1||this.loc<0){var l=parseInt(this.loc,10),fromLoc=this.loc<0?1:0;hxy=component.pointAlongPathFrom(fromLoc,l,!1);mid=component.pointAlongPathFrom(fromLoc,l-(this.direction*this.length/2),!1);txy=_jg.pointOnLine(hxy,mid,this.length)}else if(this.loc===1){hxy=component.pointOnPath(this.loc);mid=component.pointAlongPathFrom(this.loc,-(this.length));txy=_jg.pointOnLine(hxy,mid,this.length);if(this.direction===-1){var _=txy;txy=hxy;hxy=_}}else if(this.loc===0){txy=component.pointOnPath(this.loc);mid=component.pointAlongPathFrom(this.loc,this.length);hxy=_jg.pointOnLine(txy,mid,this.length);if(this.direction===-1){var __=txy;txy=hxy;hxy=__}}else{hxy=component.pointAlongPathFrom(this.loc,this.direction*this.length/2);mid=component.pointOnPath(this.loc);txy=_jg.pointOnLine(hxy,mid,this.length)}
tail=_jg.perpendicularLineTo(hxy,txy,this.width);cxy=_jg.pointOnLine(hxy,txy,foldback*this.length);var d={hxy:hxy,tail:tail,cxy:cxy},stroke=paintStyle.stroke||currentConnectionPaintStyle.stroke,fill=paintStyle.fill||currentConnectionPaintStyle.stroke,lineWidth=paintStyle.strokeWidth||currentConnectionPaintStyle.strokeWidth;return{component:component,d:d,"stroke-width":lineWidth,stroke:stroke,fill:fill,minX:Math.min(hxy.x,tail[0].x,tail[1].x),maxX:Math.max(hxy.x,tail[0].x,tail[1].x),minY:Math.min(hxy.y,tail[0].y,tail[1].y),maxY:Math.max(hxy.y,tail[0].y,tail[1].y)}}else{return{component:component,minX:0,maxX:0,minY:0,maxY:0}}}};_ju.extend(_jp.Overlays.Arrow,AbstractOverlay,{updateFrom:function(d){this.length=d.length||this.length;this.width=d.width||this.width;this.direction=d.direction!=null?d.direction:this.direction;this.foldback=d.foldback||this.foldback},cleanup:function(){if(this.path&&this.path.parentNode){this.path.parentNode.removeChild(this.path)}}});_jp.Overlays.PlainArrow=function(params){params=params||{};var p=_jp.extend(params,{foldback:1});_jp.Overlays.Arrow.call(this,p);this.type="PlainArrow"};_ju.extend(_jp.Overlays.PlainArrow,_jp.Overlays.Arrow);_jp.Overlays.Diamond=function(params){params=params||{};var l=params.length||40,p=_jp.extend(params,{length:l/2,foldback:2});_jp.Overlays.Arrow.call(this,p);this.type="Diamond"};_ju.extend(_jp.Overlays.Diamond,_jp.Overlays.Arrow);var _getDimensions=function(component,forceRefresh){if(component._jsPlumb.cachedDimensions==null||forceRefresh){component._jsPlumb.cachedDimensions=component.getDimensions()}
return component._jsPlumb.cachedDimensions};var AbstractDOMOverlay=function(params){_jp.jsPlumbUIComponent.apply(this,arguments);AbstractOverlay.apply(this,arguments);var _f=this.fire;this.fire=function(){_f.apply(this,arguments);if(this.component){this.component.fire.apply(this.component,arguments)}};this.detached=!1;this.id=params.id;this._jsPlumb.div=null;this._jsPlumb.initialised=!1;this._jsPlumb.component=params.component;this._jsPlumb.cachedDimensions=null;this._jsPlumb.create=params.create;this._jsPlumb.initiallyInvisible=params.visible===!1;this.getElement=function(){if(this._jsPlumb.div==null){var div=this._jsPlumb.div=_jp.getElement(this._jsPlumb.create(this._jsPlumb.component));div.style.position="absolute";jsPlumb.addClass(div,this._jsPlumb.instance.overlayClass+" "+(this.cssClass?this.cssClass:params.cssClass?params.cssClass:""));this._jsPlumb.instance.appendElement(div);this._jsPlumb.instance.getId(div);this.canvas=div;var ts="translate(-50%, -50%)";div.style.webkitTransform=ts;div.style.mozTransform=ts;div.style.msTransform=ts;div.style.oTransform=ts;div.style.transform=ts;div._jsPlumb=this;if(params.visible===!1){div.style.display="none"}}
return this._jsPlumb.div};this.draw=function(component,currentConnectionPaintStyle,absolutePosition){var td=_getDimensions(this);if(td!=null&&td.length===2){var cxy={x:0,y:0};if(absolutePosition){cxy={x:absolutePosition[0],y:absolutePosition[1]}}else if(component.pointOnPath){var loc=this.loc,absolute=!1;if(_ju.isString(this.loc)||this.loc<0||this.loc>1){loc=parseInt(this.loc,10);absolute=!0}
cxy=component.pointOnPath(loc,absolute)}else{var locToUse=this.loc.constructor===Array?this.loc:this.endpointLoc;cxy={x:locToUse[0]*component.w,y:locToUse[1]*component.h}}
var minx=cxy.x-(td[0]/2),miny=cxy.y-(td[1]/2);return{component:component,d:{minx:minx,miny:miny,td:td,cxy:cxy},minX:minx,maxX:minx+td[0],minY:miny,maxY:miny+td[1]}}else{return{minX:0,maxX:0,minY:0,maxY:0}}}};_ju.extend(AbstractDOMOverlay,[_jp.jsPlumbUIComponent,AbstractOverlay],{getDimensions:function(){return[1,1]},setVisible:function(state){if(this._jsPlumb.div){this._jsPlumb.div.style.display=state?"block":"none";if(state&&this._jsPlumb.initiallyInvisible){_getDimensions(this,!0);this.component.repaint();this._jsPlumb.initiallyInvisible=!1}}},clearCachedDimensions:function(){this._jsPlumb.cachedDimensions=null},cleanup:function(force){if(force){if(this._jsPlumb.div!=null){this._jsPlumb.div._jsPlumb=null;this._jsPlumb.instance.removeElement(this._jsPlumb.div)}}else{if(this._jsPlumb&&this._jsPlumb.div&&this._jsPlumb.div.parentNode){this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div)}
this.detached=!0}},reattach:function(instance,component){if(this._jsPlumb.div!=null){instance.getContainer().appendChild(this._jsPlumb.div)}
this.detached=!1},computeMaxSize:function(){var td=_getDimensions(this);return Math.max(td[0],td[1])},paint:function(p,containerExtents){if(!this._jsPlumb.initialised){this.getElement();p.component.appendDisplayElement(this._jsPlumb.div);this._jsPlumb.initialised=!0;if(this.detached){this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div)}}
this._jsPlumb.div.style.left=(p.component.x+p.d.minx)+"px";this._jsPlumb.div.style.top=(p.component.y+p.d.miny)+"px"}});_jp.Overlays.Custom=function(params){this.type="Custom";AbstractDOMOverlay.apply(this,arguments)};_ju.extend(_jp.Overlays.Custom,AbstractDOMOverlay);_jp.Overlays.GuideLines=function(){var self=this;self.length=50;self.strokeWidth=5;this.type="GuideLines";AbstractOverlay.apply(this,arguments);_jp.jsPlumbUIComponent.apply(this,arguments);this.draw=function(connector,currentConnectionPaintStyle){var head=connector.pointAlongPathFrom(self.loc,self.length/2),mid=connector.pointOnPath(self.loc),tail=_jg.pointOnLine(head,mid,self.length),tailLine=_jg.perpendicularLineTo(head,tail,40),headLine=_jg.perpendicularLineTo(tail,head,20);return{connector:connector,head:head,tail:tail,headLine:headLine,tailLine:tailLine,minX:Math.min(head.x,tail.x,headLine[0].x,headLine[1].x),minY:Math.min(head.y,tail.y,headLine[0].y,headLine[1].y),maxX:Math.max(head.x,tail.x,headLine[0].x,headLine[1].x),maxY:Math.max(head.y,tail.y,headLine[0].y,headLine[1].y)}}};_jp.Overlays.Label=function(params){this.labelStyle=params.labelStyle;var labelWidth=null,labelHeight=null,labelText=null,labelPadding=null;this.cssClass=this.labelStyle!=null?this.labelStyle.cssClass:null;var p=_jp.extend({create:function(){return _jp.createElement("div")}},params);_jp.Overlays.Custom.call(this,p);this.type="Label";this.label=params.label||"";this.labelText=null;if(this.labelStyle){var el=this.getElement();this.labelStyle.font=this.labelStyle.font||"12px sans-serif";el.style.font=this.labelStyle.font;el.style.color=this.labelStyle.color||"black";if(this.labelStyle.fill){el.style.background=this.labelStyle.fill}
if(this.labelStyle.borderWidth>0){var dStyle=this.labelStyle.borderStyle?this.labelStyle.borderStyle:"black";el.style.border=this.labelStyle.borderWidth+"px solid "+dStyle}
if(this.labelStyle.padding){el.style.padding=this.labelStyle.padding}}};_ju.extend(_jp.Overlays.Label,_jp.Overlays.Custom,{cleanup:function(force){if(force){this.div=null;this.label=null;this.labelText=null;this.cssClass=null;this.labelStyle=null}},getLabel:function(){return this.label},setLabel:function(l){this.label=l;this.labelText=null;this.clearCachedDimensions();this.update();this.component.repaint()},getDimensions:function(){this.update();return AbstractDOMOverlay.prototype.getDimensions.apply(this,arguments)},update:function(){if(typeof this.label==="function"){var lt=this.label(this);this.getElement().innerHTML=lt.replace(/\r\n/g,"<br/>")}else{if(this.labelText==null){this.labelText=this.label;this.getElement().innerHTML=this.labelText.replace(/\r\n/g,"<br/>")}}},updateFrom:function(d){if(d.label!=null){this.setLabel(d.label)}}})}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_ju=root.jsPlumbUtil,_jpi=root.jsPlumbInstance;var GROUP_COLLAPSED_CLASS="jtk-group-collapsed";var GROUP_EXPANDED_CLASS="jtk-group-expanded";var GROUP_CONTAINER_SELECTOR="[jtk-group-content]";var ELEMENT_DRAGGABLE_EVENT="elementDraggable";var STOP="stop";var REVERT="revert";var GROUP_MANAGER="_groupManager";var GROUP="_jsPlumbGroup";var GROUP_DRAG_SCOPE="_jsPlumbGroupDrag";var EVT_CHILD_ADDED="group:addMember";var EVT_CHILD_REMOVED="group:removeMember";var EVT_GROUP_ADDED="group:add";var EVT_GROUP_REMOVED="group:remove";var EVT_EXPAND="group:expand";var EVT_COLLAPSE="group:collapse";var EVT_GROUP_DRAG_STOP="groupDragStop";var EVT_CONNECTION_MOVED="connectionMoved";var EVT_INTERNAL_CONNECTION_DETACHED="internal.connectionDetached";var CMD_REMOVE_ALL="removeAll";var CMD_ORPHAN_ALL="orphanAll";var CMD_SHOW="show";var CMD_HIDE="hide";var GroupManager=function(_jsPlumb){var _managedGroups={},_connectionSourceMap={},_connectionTargetMap={},self=this;function isDescendant(el,parentEl){var c=_jsPlumb.getContainer();var abort=!1,g=null,child=null;while(!abort){if(el==null||el===c){return!1}else{if(el===parentEl){return!0}else{el=el.parentNode}}}}
_jsPlumb.bind("connection",function(p){var sourceGroup=_jsPlumb.getGroupFor(p.source);var targetGroup=_jsPlumb.getGroupFor(p.target);if(sourceGroup!=null&&targetGroup!=null&&sourceGroup===targetGroup){_connectionSourceMap[p.connection.id]=sourceGroup;_connectionTargetMap[p.connection.id]=sourceGroup}else{if(sourceGroup!=null){_ju.suggest(sourceGroup.connections.source,p.connection);_connectionSourceMap[p.connection.id]=sourceGroup}
if(targetGroup!=null){_ju.suggest(targetGroup.connections.target,p.connection);_connectionTargetMap[p.connection.id]=targetGroup}}});function _cleanupDetachedConnection(conn){delete conn.proxies;var group=_connectionSourceMap[conn.id],f;if(group!=null){f=function(c){return c.id===conn.id};_ju.removeWithFunction(group.connections.source,f);_ju.removeWithFunction(group.connections.target,f);delete _connectionSourceMap[conn.id]}
group=_connectionTargetMap[conn.id];if(group!=null){f=function(c){return c.id===conn.id};_ju.removeWithFunction(group.connections.source,f);_ju.removeWithFunction(group.connections.target,f);delete _connectionTargetMap[conn.id]}}
_jsPlumb.bind(EVT_INTERNAL_CONNECTION_DETACHED,function(p){_cleanupDetachedConnection(p.connection)});_jsPlumb.bind(EVT_CONNECTION_MOVED,function(p){var connMap=p.index===0?_connectionSourceMap:_connectionTargetMap;var group=connMap[p.connection.id];if(group){var list=group.connections[p.index===0?"source":"target"];var idx=list.indexOf(p.connection);if(idx!==-1){list.splice(idx,1)}}});this.addGroup=function(group){_jsPlumb.addClass(group.getEl(),GROUP_EXPANDED_CLASS);_managedGroups[group.id]=group;group.manager=this;_updateConnectionsForGroup(group);_jsPlumb.fire(EVT_GROUP_ADDED,{group:group})};this.addToGroup=function(group,el,doNotFireEvent){group=this.getGroup(group);if(group){var groupEl=group.getEl();if(el._isJsPlumbGroup){return}
var currentGroup=el._jsPlumbGroup;if(currentGroup!==group){_jsPlumb.removeFromDragSelection(el);var elpos=_jsPlumb.getOffset(el,!0);var cpos=group.collapsed?_jsPlumb.getOffset(groupEl,!0):_jsPlumb.getOffset(group.getDragArea(),!0);if(currentGroup!=null){currentGroup.remove(el,!1,doNotFireEvent,!1,group);self.updateConnectionsForGroup(currentGroup)}
group.add(el,doNotFireEvent);var handleDroppedConnections=function(list,index){var oidx=index===0?1:0;list.each(function(c){c.setVisible(!1);if(c.endpoints[oidx].element._jsPlumbGroup===group){c.endpoints[oidx].setVisible(!1);_expandConnection(c,oidx,group)}else{c.endpoints[index].setVisible(!1);_collapseConnection(c,index,group)}})};if(group.collapsed){handleDroppedConnections(_jsPlumb.select({source:el}),0);handleDroppedConnections(_jsPlumb.select({target:el}),1)}
var elId=_jsPlumb.getId(el);_jsPlumb.dragManager.setParent(el,elId,groupEl,_jsPlumb.getId(groupEl),elpos);var newPosition={left:elpos.left-cpos.left,top:elpos.top-cpos.top};_jsPlumb.setPosition(el,newPosition);_jsPlumb.dragManager.revalidateParent(el,elId,elpos);self.updateConnectionsForGroup(group);_jsPlumb.revalidate(elId);if(!doNotFireEvent){var p={group:group,el:el,pos:newPosition};if(currentGroup){p.sourceGroup=currentGroup}
_jsPlumb.fire(EVT_CHILD_ADDED,p)}}}};this.removeFromGroup=function(group,el,doNotFireEvent){group=this.getGroup(group);if(group){if(group.collapsed){var _expandSet=function(conns,index){for(var i=0;i<conns.length;i++){var c=conns[i];if(c.proxies){for(var j=0;j<c.proxies.length;j++){if(c.proxies[j]!=null){var proxiedElement=c.proxies[j].originalEp.element;if(proxiedElement===el||isDescendant(proxiedElement,el)){_expandConnection(c,index,group)}}}}}};_expandSet(group.connections.source.slice(),0);_expandSet(group.connections.target.slice(),1)}
group.remove(el,null,doNotFireEvent)}};this.getGroup=function(groupId){var group=groupId;if(_ju.isString(groupId)){group=_managedGroups[groupId];if(group==null){throw new TypeError("No such group ["+groupId+"]")}}
return group};this.getGroups=function(){var o=[];for(var g in _managedGroups){o.push(_managedGroups[g])}
return o};this.removeGroup=function(group,deleteMembers,manipulateDOM,doNotFireEvent){group=this.getGroup(group);this.expandGroup(group,!0);var newPositions=group[deleteMembers?CMD_REMOVE_ALL:CMD_ORPHAN_ALL](manipulateDOM,doNotFireEvent);_jsPlumb.remove(group.getEl());delete _managedGroups[group.id];delete _jsPlumb._groups[group.id];_jsPlumb.fire(EVT_GROUP_REMOVED,{group:group});return newPositions};this.removeAllGroups=function(deleteMembers,manipulateDOM,doNotFireEvent){for(var g in _managedGroups){this.removeGroup(_managedGroups[g],deleteMembers,manipulateDOM,doNotFireEvent)}};function _setVisible(group,state){var m=group.getEl().querySelectorAll(".jtk-managed");for(var i=0;i<m.length;i++){_jsPlumb[state?CMD_SHOW:CMD_HIDE](m[i],!0)}}
var _collapseConnection=function(c,index,group){var otherEl=c.endpoints[index===0?1:0].element;if(otherEl[GROUP]&&(!otherEl[GROUP].shouldProxy()&&otherEl[GROUP].collapsed)){return}
var groupEl=group.getEl(),groupElId=_jsPlumb.getId(groupEl);_jsPlumb.proxyConnection(c,index,groupEl,groupElId,function(c,index){return group.getEndpoint(c,index)},function(c,index){return group.getAnchor(c,index)})};this.collapseGroup=function(group){group=this.getGroup(group);if(group==null||group.collapsed){return}
var groupEl=group.getEl();_setVisible(group,!1);if(group.shouldProxy()){var _collapseSet=function(conns,index){for(var i=0;i<conns.length;i++){var c=conns[i];_collapseConnection(c,index,group)}};_collapseSet(group.connections.source,0);_collapseSet(group.connections.target,1)}
group.collapsed=!0;_jsPlumb.removeClass(groupEl,GROUP_EXPANDED_CLASS);_jsPlumb.addClass(groupEl,GROUP_COLLAPSED_CLASS);_jsPlumb.revalidate(groupEl);_jsPlumb.fire(EVT_COLLAPSE,{group:group})};var _expandConnection=function(c,index,group){_jsPlumb.unproxyConnection(c,index,_jsPlumb.getId(group.getEl()))};this.expandGroup=function(group,doNotFireEvent){group=this.getGroup(group);if(group==null||!group.collapsed){return}
var groupEl=group.getEl();_setVisible(group,!0);if(group.shouldProxy()){var _expandSet=function(conns,index){for(var i=0;i<conns.length;i++){var c=conns[i];_expandConnection(c,index,group)}};_expandSet(group.connections.source,0);_expandSet(group.connections.target,1)}
group.collapsed=!1;_jsPlumb.addClass(groupEl,GROUP_EXPANDED_CLASS);_jsPlumb.removeClass(groupEl,GROUP_COLLAPSED_CLASS);_jsPlumb.revalidate(groupEl);this.repaintGroup(group);if(!doNotFireEvent){_jsPlumb.fire(EVT_EXPAND,{group:group})}};this.repaintGroup=function(group){group=this.getGroup(group);var m=group.getMembers();for(var i=0;i<m.length;i++){_jsPlumb.revalidate(m[i])}};function _updateConnectionsForGroup(group){var members=group.getMembers().slice();var childMembers=[];for(var i=0;i<members.length;i++){Array.prototype.push.apply(childMembers,members[i].querySelectorAll(".jtk-managed"))}
Array.prototype.push.apply(members,childMembers);var c1=_jsPlumb.getConnections({source:members,scope:"*"},!0);var c2=_jsPlumb.getConnections({target:members,scope:"*"},!0);var processed={};group.connections.source.length=0;group.connections.target.length=0;var oneSet=function(c){for(var i=0;i<c.length;i++){if(processed[c[i].id]){continue}
processed[c[i].id]=!0;var gs=_jsPlumb.getGroupFor(c[i].source),gt=_jsPlumb.getGroupFor(c[i].target);if(gs===group){if(gt!==group){group.connections.source.push(c[i])}
_connectionSourceMap[c[i].id]=group}else if(gt===group){group.connections.target.push(c[i]);_connectionTargetMap[c[i].id]=group}}};oneSet(c1);oneSet(c2)}
this.updateConnectionsForGroup=_updateConnectionsForGroup;this.refreshAllGroups=function(){for(var g in _managedGroups){_updateConnectionsForGroup(_managedGroups[g]);_jsPlumb.dragManager.updateOffsets(_jsPlumb.getId(_managedGroups[g].getEl()))}}};var Group=function(_jsPlumb,params){var self=this;var el=params.el;this.getEl=function(){return el};this.id=params.id||_ju.uuid();el._isJsPlumbGroup=!0;var getDragArea=this.getDragArea=function(){var da=_jsPlumb.getSelector(el,GROUP_CONTAINER_SELECTOR);return da&&da.length>0?da[0]:el};var ghost=params.ghost===!0;var constrain=ghost||(params.constrain===!0);var revert=params.revert!==!1;var orphan=params.orphan===!0;var prune=params.prune===!0;var dropOverride=params.dropOverride===!0;var proxied=params.proxied!==!1;var elements=[];this.connections={source:[],target:[],internal:[]};this.getAnchor=function(conn,endpointIndex){return params.anchor||"Continuous"};this.getEndpoint=function(conn,endpointIndex){return params.endpoint||["Dot",{radius:10}]};this.collapsed=!1;if(params.draggable!==!1){var opts={drag:function(){for(var i=0;i<elements.length;i++){_jsPlumb.draw(elements[i])}},stop:function(params){_jsPlumb.fire(EVT_GROUP_DRAG_STOP,jsPlumb.extend(params,{group:self}))},scope:GROUP_DRAG_SCOPE};if(params.dragOptions){root.jsPlumb.extend(opts,params.dragOptions)}
_jsPlumb.draggable(params.el,opts)}
if(params.droppable!==!1){_jsPlumb.droppable(params.el,{drop:function(p){var el=p.drag.el;if(el._isJsPlumbGroup){return}
var currentGroup=el._jsPlumbGroup;if(currentGroup!==self){if(currentGroup!=null){if(currentGroup.overrideDrop(el,self)){return}}
_jsPlumb.getGroupManager().addToGroup(self,el,!1)}}})}
var _each=function(_el,fn){var els=_el.nodeType==null?_el:[_el];for(var i=0;i<els.length;i++){fn(els[i])}};this.overrideDrop=function(_el,targetGroup){return dropOverride&&(revert||prune||orphan)};this.add=function(_el,doNotFireEvent){var dragArea=getDragArea();_each(_el,function(__el){if(__el._jsPlumbGroup!=null){if(__el._jsPlumbGroup===self){return}else{__el._jsPlumbGroup.remove(__el,!0,doNotFireEvent,!1)}}
__el._jsPlumbGroup=self;elements.push(__el);if(_jsPlumb.isAlreadyDraggable(__el)){_bindDragHandlers(__el)}
if(__el.parentNode!==dragArea){dragArea.appendChild(__el)}});_jsPlumb.getGroupManager().updateConnectionsForGroup(self)};this.remove=function(el,manipulateDOM,doNotFireEvent,doNotUpdateConnections,targetGroup){_each(el,function(__el){if(__el._jsPlumbGroup===self){delete __el._jsPlumbGroup;_ju.removeWithFunction(elements,function(e){return e===__el});if(manipulateDOM){try{self.getDragArea().removeChild(__el)}catch(e){jsPlumbUtil.log("Could not remove element from Group "+e)}}
_unbindDragHandlers(__el);if(!doNotFireEvent){var p={group:self,el:__el};if(targetGroup){p.targetGroup=targetGroup}
_jsPlumb.fire(EVT_CHILD_REMOVED,p)}}});if(!doNotUpdateConnections){_jsPlumb.getGroupManager().updateConnectionsForGroup(self)}};this.removeAll=function(manipulateDOM,doNotFireEvent){for(var i=0,l=elements.length;i<l;i++){var el=elements[0];self.remove(el,manipulateDOM,doNotFireEvent,!0);_jsPlumb.remove(el,!0)}
elements.length=0;_jsPlumb.getGroupManager().updateConnectionsForGroup(self)};this.orphanAll=function(){var orphanedPositions={};for(var i=0;i<elements.length;i++){var newPosition=_orphan(elements[i]);orphanedPositions[newPosition[0]]=newPosition[1]}
elements.length=0;return orphanedPositions};this.getMembers=function(){return elements};el[GROUP]=this;_jsPlumb.bind(ELEMENT_DRAGGABLE_EVENT,function(dragParams){if(dragParams.el._jsPlumbGroup===this){_bindDragHandlers(dragParams.el)}}.bind(this));function _findParent(_el){return _el.offsetParent}
function _isInsideParent(_el,pos){var p=_findParent(_el),s=_jsPlumb.getSize(p),ss=_jsPlumb.getSize(_el),leftEdge=pos[0],rightEdge=leftEdge+ss[0],topEdge=pos[1],bottomEdge=topEdge+ss[1];return rightEdge>0&&leftEdge<s[0]&&bottomEdge>0&&topEdge<s[1]}
function _orphan(_el){var id=_jsPlumb.getId(_el);var pos=_jsPlumb.getOffset(_el);_el.parentNode.removeChild(_el);_jsPlumb.getContainer().appendChild(_el);_jsPlumb.setPosition(_el,pos);_unbindDragHandlers(_el);_jsPlumb.dragManager.clearParent(_el,id);return[id,pos]}
function _pruneOrOrphan(p){var out=[];function _one(el,left,top){var orphanedPosition=null;if(!_isInsideParent(el,[left,top])){var group=el._jsPlumbGroup;if(prune){_jsPlumb.remove(el)}else{orphanedPosition=_orphan(el)}
group.remove(el)}
return orphanedPosition}
for(var i=0;i<p.selection.length;i++){out.push(_one(p.selection[i][0],p.selection[i][1].left,p.selection[i][1].top))}
return out.length===1?out[0]:out}
function _revalidate(_el){var id=_jsPlumb.getId(_el);_jsPlumb.revalidate(_el);_jsPlumb.dragManager.revalidateParent(_el,id)}
function _unbindDragHandlers(_el){if(!_el._katavorioDrag){return}
if(prune||orphan){_el._katavorioDrag.off(STOP,_pruneOrOrphan)}
if(!prune&&!orphan&&revert){_el._katavorioDrag.off(REVERT,_revalidate);_el._katavorioDrag.setRevert(null)}}
function _bindDragHandlers(_el){if(!_el._katavorioDrag){return}
if(prune||orphan){_el._katavorioDrag.on(STOP,_pruneOrOrphan)}
if(constrain){_el._katavorioDrag.setConstrain(!0)}
if(ghost){_el._katavorioDrag.setUseGhostProxy(!0)}
if(!prune&&!orphan&&revert){_el._katavorioDrag.on(REVERT,_revalidate);_el._katavorioDrag.setRevert(function(__el,pos){return!_isInsideParent(__el,pos)})}}
this.shouldProxy=function(){return proxied};_jsPlumb.getGroupManager().addGroup(this)};_jpi.prototype.addGroup=function(params){var j=this;j._groups=j._groups||{};if(j._groups[params.id]!=null){throw new TypeError("cannot create Group ["+params.id+"]; a Group with that ID exists")}
if(params.el[GROUP]!=null){throw new TypeError("cannot create Group ["+params.id+"]; the given element is already a Group")}
var group=new Group(j,params);j._groups[group.id]=group;if(params.collapsed){this.collapseGroup(group)}
return group};_jpi.prototype.addToGroup=function(group,el,doNotFireEvent){var _one=function(_el){var id=this.getId(_el);this.manage(id,_el);this.getGroupManager().addToGroup(group,_el,doNotFireEvent)}.bind(this);if(Array.isArray(el)){for(var i=0;i<el.length;i++){_one(el[i])}}else{_one(el)}};_jpi.prototype.removeFromGroup=function(group,el,doNotFireEvent){this.getGroupManager().removeFromGroup(group,el,doNotFireEvent);this.getContainer().appendChild(el)};_jpi.prototype.removeGroup=function(group,deleteMembers,manipulateDOM,doNotFireEvent){return this.getGroupManager().removeGroup(group,deleteMembers,manipulateDOM,doNotFireEvent)};_jpi.prototype.removeAllGroups=function(deleteMembers,manipulateDOM,doNotFireEvent){this.getGroupManager().removeAllGroups(deleteMembers,manipulateDOM,doNotFireEvent)};_jpi.prototype.getGroup=function(groupId){return this.getGroupManager().getGroup(groupId)};_jpi.prototype.getGroups=function(){return this.getGroupManager().getGroups()};_jpi.prototype.expandGroup=function(group){this.getGroupManager().expandGroup(group)};_jpi.prototype.collapseGroup=function(groupId){this.getGroupManager().collapseGroup(groupId)};_jpi.prototype.repaintGroup=function(group){this.getGroupManager().repaintGroup(group)};_jpi.prototype.toggleGroup=function(group){group=this.getGroupManager().getGroup(group);if(group!=null){this.getGroupManager()[group.collapsed?"expandGroup":"collapseGroup"](group)}};_jpi.prototype.getGroupManager=function(){var mgr=this[GROUP_MANAGER];if(mgr==null){mgr=this[GROUP_MANAGER]=new GroupManager(this)}
return mgr};_jpi.prototype.removeGroupManager=function(){delete this[GROUP_MANAGER]};_jpi.prototype.getGroupFor=function(el){el=this.getElement(el);if(el){var c=this.getContainer();var abort=!1,g=null,child=null;while(!abort){if(el==null||el===c){abort=!0}else{if(el[GROUP]){g=el[GROUP];child=el;abort=!0}else{el=el.parentNode}}}
return g}}}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_jp=root.jsPlumb,_ju=root.jsPlumbUtil;var STRAIGHT="Straight";var ARC="Arc";var Flowchart=function(params){this.type="Flowchart";params=params||{};params.stub=params.stub==null?30:params.stub;var segments,_super=_jp.Connectors.AbstractConnector.apply(this,arguments),midpoint=params.midpoint==null||isNaN(params.midpoint)?0.5:params.midpoint,alwaysRespectStubs=params.alwaysRespectStubs===!0,lastx=null,lasty=null,lastOrientation,cornerRadius=params.cornerRadius!=null?params.cornerRadius:0,loopbackRadius=params.loopbackRadius||25,isLoopbackCurrently=!1,sgn=function(n){return n<0?-1:n===0?0:1},segmentDirections=function(segment){return[sgn(segment[2]-segment[0]),sgn(segment[3]-segment[1])]},addSegment=function(segments,x,y,paintInfo){if(lastx===x&&lasty===y){return}
var lx=lastx==null?paintInfo.sx:lastx,ly=lasty==null?paintInfo.sy:lasty,o=lx===x?"v":"h";lastx=x;lasty=y;segments.push([lx,ly,x,y,o])},segLength=function(s){return Math.sqrt(Math.pow(s[0]-s[2],2)+Math.pow(s[1]-s[3],2))},_cloneArray=function(a){var _a=[];_a.push.apply(_a,a);return _a},writeSegments=function(conn,segments,paintInfo){var current=null,next,currentDirection,nextDirection;for(var i=0;i<segments.length-1;i++){current=current||_cloneArray(segments[i]);next=_cloneArray(segments[i+1]);currentDirection=segmentDirections(current);nextDirection=segmentDirections(next);if(cornerRadius>0&&current[4]!==next[4]){var minSegLength=Math.min(segLength(current),segLength(next));var radiusToUse=Math.min(cornerRadius,minSegLength/2);current[2]-=currentDirection[0]*radiusToUse;current[3]-=currentDirection[1]*radiusToUse;next[0]+=nextDirection[0]*radiusToUse;next[1]+=nextDirection[1]*radiusToUse;var ac=(currentDirection[1]===nextDirection[0]&&nextDirection[0]===1)||((currentDirection[1]===nextDirection[0]&&nextDirection[0]===0)&&currentDirection[0]!==nextDirection[1])||(currentDirection[1]===nextDirection[0]&&nextDirection[0]===-1),sgny=next[1]>current[3]?1:-1,sgnx=next[0]>current[2]?1:-1,sgnEqual=sgny===sgnx,cx=(sgnEqual&&ac||(!sgnEqual&&!ac))?next[0]:current[2],cy=(sgnEqual&&ac||(!sgnEqual&&!ac))?current[3]:next[1];_super.addSegment(conn,STRAIGHT,{x1:current[0],y1:current[1],x2:current[2],y2:current[3]});_super.addSegment(conn,ARC,{r:radiusToUse,x1:current[2],y1:current[3],x2:next[0],y2:next[1],cx:cx,cy:cy,ac:ac})}else{var dx=(current[2]===current[0])?0:(current[2]>current[0])?(paintInfo.lw/2):-(paintInfo.lw/2),dy=(current[3]===current[1])?0:(current[3]>current[1])?(paintInfo.lw/2):-(paintInfo.lw/2);_super.addSegment(conn,STRAIGHT,{x1:current[0]-dx,y1:current[1]-dy,x2:current[2]+dx,y2:current[3]+dy})}
current=next}
if(next!=null){_super.addSegment(conn,STRAIGHT,{x1:next[0],y1:next[1],x2:next[2],y2:next[3]})}};this.midpoint=midpoint;this._compute=function(paintInfo,params){segments=[];lastx=null;lasty=null;lastOrientation=null;var commonStubCalculator=function(){return[paintInfo.startStubX,paintInfo.startStubY,paintInfo.endStubX,paintInfo.endStubY]},stubCalculators={perpendicular:commonStubCalculator,orthogonal:commonStubCalculator,opposite:function(axis){var pi=paintInfo,idx=axis==="x"?0:1,areInProximity={"x":function(){return((pi.so[idx]===1&&(((pi.startStubX>pi.endStubX)&&(pi.tx>pi.startStubX))||((pi.sx>pi.endStubX)&&(pi.tx>pi.sx)))))||((pi.so[idx]===-1&&(((pi.startStubX<pi.endStubX)&&(pi.tx<pi.startStubX))||((pi.sx<pi.endStubX)&&(pi.tx<pi.sx)))))},"y":function(){return((pi.so[idx]===1&&(((pi.startStubY>pi.endStubY)&&(pi.ty>pi.startStubY))||((pi.sy>pi.endStubY)&&(pi.ty>pi.sy)))))||((pi.so[idx]===-1&&(((pi.startStubY<pi.endStubY)&&(pi.ty<pi.startStubY))||((pi.sy<pi.endStubY)&&(pi.ty<pi.sy)))))}};if(!alwaysRespectStubs&&areInProximity[axis]()){return{"x":[(paintInfo.sx+paintInfo.tx)/2,paintInfo.startStubY,(paintInfo.sx+paintInfo.tx)/2,paintInfo.endStubY],"y":[paintInfo.startStubX,(paintInfo.sy+paintInfo.ty)/2,paintInfo.endStubX,(paintInfo.sy+paintInfo.ty)/2]}[axis]}else{return[paintInfo.startStubX,paintInfo.startStubY,paintInfo.endStubX,paintInfo.endStubY]}}};var stubs=stubCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis),idx=paintInfo.sourceAxis==="x"?0:1,oidx=paintInfo.sourceAxis==="x"?1:0,ss=stubs[idx],oss=stubs[oidx],es=stubs[idx+2],oes=stubs[oidx+2];addSegment(segments,stubs[0],stubs[1],paintInfo);var midx=paintInfo.startStubX+((paintInfo.endStubX-paintInfo.startStubX)*midpoint),midy=paintInfo.startStubY+((paintInfo.endStubY-paintInfo.startStubY)*midpoint);var orientations={x:[0,1],y:[1,0]},lineCalculators={perpendicular:function(axis){var pi=paintInfo,sis={x:[[[1,2,3,4],null,[2,1,4,3]],null,[[4,3,2,1],null,[3,4,1,2]]],y:[[[3,2,1,4],null,[2,3,4,1]],null,[[4,1,2,3],null,[1,4,3,2]]]},stubs={x:[[pi.startStubX,pi.endStubX],null,[pi.endStubX,pi.startStubX]],y:[[pi.startStubY,pi.endStubY],null,[pi.endStubY,pi.startStubY]]},midLines={x:[[midx,pi.startStubY],[midx,pi.endStubY]],y:[[pi.startStubX,midy],[pi.endStubX,midy]]},linesToEnd={x:[[pi.endStubX,pi.startStubY]],y:[[pi.startStubX,pi.endStubY]]},startToEnd={x:[[pi.startStubX,pi.endStubY],[pi.endStubX,pi.endStubY]],y:[[pi.endStubX,pi.startStubY],[pi.endStubX,pi.endStubY]]},startToMidToEnd={x:[[pi.startStubX,midy],[pi.endStubX,midy],[pi.endStubX,pi.endStubY]],y:[[midx,pi.startStubY],[midx,pi.endStubY],[pi.endStubX,pi.endStubY]]},otherStubs={x:[pi.startStubY,pi.endStubY],y:[pi.startStubX,pi.endStubX]},soIdx=orientations[axis][0],toIdx=orientations[axis][1],_so=pi.so[soIdx]+1,_to=pi.to[toIdx]+1,otherFlipped=(pi.to[toIdx]===-1&&(otherStubs[axis][1]<otherStubs[axis][0]))||(pi.to[toIdx]===1&&(otherStubs[axis][1]>otherStubs[axis][0])),stub1=stubs[axis][_so][0],stub2=stubs[axis][_so][1],segmentIndexes=sis[axis][_so][_to];if(pi.segment===segmentIndexes[3]||(pi.segment===segmentIndexes[2]&&otherFlipped)){return midLines[axis]}else if(pi.segment===segmentIndexes[2]&&stub2<stub1){return linesToEnd[axis]}else if((pi.segment===segmentIndexes[2]&&stub2>=stub1)||(pi.segment===segmentIndexes[1]&&!otherFlipped)){return startToMidToEnd[axis]}else if(pi.segment===segmentIndexes[0]||(pi.segment===segmentIndexes[1]&&otherFlipped)){return startToEnd[axis]}},orthogonal:function(axis,startStub,otherStartStub,endStub,otherEndStub){var pi=paintInfo,extent={"x":pi.so[0]===-1?Math.min(startStub,endStub):Math.max(startStub,endStub),"y":pi.so[1]===-1?Math.min(startStub,endStub):Math.max(startStub,endStub)}[axis];return{"x":[[extent,otherStartStub],[extent,otherEndStub],[endStub,otherEndStub]],"y":[[otherStartStub,extent],[otherEndStub,extent],[otherEndStub,endStub]]}[axis]},opposite:function(axis,ss,oss,es){var pi=paintInfo,otherAxis={"x":"y","y":"x"}[axis],dim={"x":"height","y":"width"}[axis],comparator=pi["is"+axis.toUpperCase()+"GreaterThanStubTimes2"];if(params.sourceEndpoint.elementId===params.targetEndpoint.elementId){var _val=oss+((1-params.sourceEndpoint.anchor[otherAxis])*params.sourceInfo[dim])+_super.maxStub;return{"x":[[ss,_val],[es,_val]],"y":[[_val,ss],[_val,es]]}[axis]}else if(!comparator||(pi.so[idx]===1&&ss>es)||(pi.so[idx]===-1&&ss<es)){return{"x":[[ss,midy],[es,midy]],"y":[[midx,ss],[midx,es]]}[axis]}else if((pi.so[idx]===1&&ss<es)||(pi.so[idx]===-1&&ss>es)){return{"x":[[midx,pi.sy],[midx,pi.ty]],"y":[[pi.sx,midy],[pi.tx,midy]]}[axis]}}};var p=lineCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis,ss,oss,es,oes);if(p){for(var i=0;i<p.length;i++){addSegment(segments,p[i][0],p[i][1],paintInfo)}}
addSegment(segments,stubs[2],stubs[3],paintInfo);addSegment(segments,paintInfo.tx,paintInfo.ty,paintInfo);writeSegments(this,segments,paintInfo)}};_jp.Connectors.Flowchart=Flowchart;_ju.extend(_jp.Connectors.Flowchart,_jp.Connectors.AbstractConnector)}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_jp=root.jsPlumb,_ju=root.jsPlumbUtil;_jp.Connectors.AbstractBezierConnector=function(params){params=params||{};var showLoopback=params.showLoopback!==!1,curviness=params.curviness||10,margin=params.margin||5,proximityLimit=params.proximityLimit||80,clockwise=params.orientation&&params.orientation==="clockwise",loopbackRadius=params.loopbackRadius||25,isLoopbackCurrently=!1,_super;this._compute=function(paintInfo,p){var sp=p.sourcePos,tp=p.targetPos,_w=Math.abs(sp[0]-tp[0]),_h=Math.abs(sp[1]-tp[1]);if(!showLoopback||(p.sourceEndpoint.elementId!==p.targetEndpoint.elementId)){isLoopbackCurrently=!1;this._computeBezier(paintInfo,p,sp,tp,_w,_h)}else{isLoopbackCurrently=!0;var x1=p.sourcePos[0],y1=p.sourcePos[1]-margin,cx=x1,cy=y1-loopbackRadius,_x=cx-loopbackRadius,_y=cy-loopbackRadius;_w=2*loopbackRadius;_h=2*loopbackRadius;paintInfo.points[0]=_x;paintInfo.points[1]=_y;paintInfo.points[2]=_w;paintInfo.points[3]=_h;_super.addSegment(this,"Arc",{loopback:!0,x1:(x1-_x)+4,y1:y1-_y,startAngle:0,endAngle:2*Math.PI,r:loopbackRadius,ac:!clockwise,x2:(x1-_x)-4,y2:y1-_y,cx:cx-_x,cy:cy-_y})}};_super=_jp.Connectors.AbstractConnector.apply(this,arguments);return _super};_ju.extend(_jp.Connectors.AbstractBezierConnector,_jp.Connectors.AbstractConnector);var Bezier=function(params){params=params||{};this.type="Bezier";var _super=_jp.Connectors.AbstractBezierConnector.apply(this,arguments),majorAnchor=params.curviness||150,minorAnchor=10;this.getCurviness=function(){return majorAnchor};this._findControlPoint=function(point,sourceAnchorPosition,targetAnchorPosition,sourceEndpoint,targetEndpoint,soo,too){var perpendicular=soo[0]!==too[0]||soo[1]===too[1],p=[];if(!perpendicular){if(soo[0]===0){p.push(sourceAnchorPosition[0]<targetAnchorPosition[0]?point[0]+minorAnchor:point[0]-minorAnchor)}else{p.push(point[0]-(majorAnchor*soo[0]))}
if(soo[1]===0){p.push(sourceAnchorPosition[1]<targetAnchorPosition[1]?point[1]+minorAnchor:point[1]-minorAnchor)}else{p.push(point[1]+(majorAnchor*too[1]))}}else{if(too[0]===0){p.push(targetAnchorPosition[0]<sourceAnchorPosition[0]?point[0]+minorAnchor:point[0]-minorAnchor)}else{p.push(point[0]+(majorAnchor*too[0]))}
if(too[1]===0){p.push(targetAnchorPosition[1]<sourceAnchorPosition[1]?point[1]+minorAnchor:point[1]-minorAnchor)}else{p.push(point[1]+(majorAnchor*soo[1]))}}
return p};this._computeBezier=function(paintInfo,p,sp,tp,_w,_h){var _CP,_CP2,_sx=sp[0]<tp[0]?_w:0,_sy=sp[1]<tp[1]?_h:0,_tx=sp[0]<tp[0]?0:_w,_ty=sp[1]<tp[1]?0:_h;_CP=this._findControlPoint([_sx,_sy],sp,tp,p.sourceEndpoint,p.targetEndpoint,paintInfo.so,paintInfo.to);_CP2=this._findControlPoint([_tx,_ty],tp,sp,p.targetEndpoint,p.sourceEndpoint,paintInfo.to,paintInfo.so);_super.addSegment(this,"Bezier",{x1:_sx,y1:_sy,x2:_tx,y2:_ty,cp1x:_CP[0],cp1y:_CP[1],cp2x:_CP2[0],cp2y:_CP2[1]})}};_jp.Connectors.Bezier=Bezier;_ju.extend(Bezier,_jp.Connectors.AbstractBezierConnector)}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_jp=root.jsPlumb,_ju=root.jsPlumbUtil;var _segment=function(x1,y1,x2,y2){if(x1<=x2&&y2<=y1){return 1}else if(x1<=x2&&y1<=y2){return 2}else if(x2<=x1&&y2>=y1){return 3}
return 4},_findControlPoint=function(midx,midy,segment,sourceEdge,targetEdge,dx,dy,distance,proximityLimit){if(distance<=proximityLimit){return[midx,midy]}
if(segment===1){if(sourceEdge[3]<=0&&targetEdge[3]>=1){return[midx+(sourceEdge[2]<0.5?-1*dx:dx),midy]}else if(sourceEdge[2]>=1&&targetEdge[2]<=0){return[midx,midy+(sourceEdge[3]<0.5?-1*dy:dy)]}else{return[midx+(-1*dx),midy+(-1*dy)]}}else if(segment===2){if(sourceEdge[3]>=1&&targetEdge[3]<=0){return[midx+(sourceEdge[2]<0.5?-1*dx:dx),midy]}else if(sourceEdge[2]>=1&&targetEdge[2]<=0){return[midx,midy+(sourceEdge[3]<0.5?-1*dy:dy)]}else{return[midx+dx,midy+(-1*dy)]}}else if(segment===3){if(sourceEdge[3]>=1&&targetEdge[3]<=0){return[midx+(sourceEdge[2]<0.5?-1*dx:dx),midy]}else if(sourceEdge[2]<=0&&targetEdge[2]>=1){return[midx,midy+(sourceEdge[3]<0.5?-1*dy:dy)]}else{return[midx+(-1*dx),midy+(-1*dy)]}}else if(segment===4){if(sourceEdge[3]<=0&&targetEdge[3]>=1){return[midx+(sourceEdge[2]<0.5?-1*dx:dx),midy]}else if(sourceEdge[2]<=0&&targetEdge[2]>=1){return[midx,midy+(sourceEdge[3]<0.5?-1*dy:dy)]}else{return[midx+dx,midy+(-1*dy)]}}};var StateMachine=function(params){params=params||{};this.type="StateMachine";var _super=_jp.Connectors.AbstractBezierConnector.apply(this,arguments),curviness=params.curviness||10,margin=params.margin||5,proximityLimit=params.proximityLimit||80,clockwise=params.orientation&&params.orientation==="clockwise",_controlPoint;this._computeBezier=function(paintInfo,params,sp,tp,w,h){var _sx=params.sourcePos[0]<params.targetPos[0]?0:w,_sy=params.sourcePos[1]<params.targetPos[1]?0:h,_tx=params.sourcePos[0]<params.targetPos[0]?w:0,_ty=params.sourcePos[1]<params.targetPos[1]?h:0;if(params.sourcePos[2]===0){_sx-=margin}
if(params.sourcePos[2]===1){_sx+=margin}
if(params.sourcePos[3]===0){_sy-=margin}
if(params.sourcePos[3]===1){_sy+=margin}
if(params.targetPos[2]===0){_tx-=margin}
if(params.targetPos[2]===1){_tx+=margin}
if(params.targetPos[3]===0){_ty-=margin}
if(params.targetPos[3]===1){_ty+=margin}
var _midx=(_sx+_tx)/2,_midy=(_sy+_ty)/2,segment=_segment(_sx,_sy,_tx,_ty),distance=Math.sqrt(Math.pow(_tx-_sx,2)+Math.pow(_ty-_sy,2)),cp1x,cp2x,cp1y,cp2y;_controlPoint=_findControlPoint(_midx,_midy,segment,params.sourcePos,params.targetPos,curviness,curviness,distance,proximityLimit);cp1x=_controlPoint[0];cp2x=_controlPoint[0];cp1y=_controlPoint[1];cp2y=_controlPoint[1];_super.addSegment(this,"Bezier",{x1:_tx,y1:_ty,x2:_sx,y2:_sy,cp1x:cp1x,cp1y:cp1y,cp2x:cp2x,cp2y:cp2y})}};_jp.Connectors.StateMachine=StateMachine;_ju.extend(StateMachine,_jp.Connectors.AbstractBezierConnector)}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_jp=root.jsPlumb,_ju=root.jsPlumbUtil;var STRAIGHT="Straight";var Straight=function(params){this.type=STRAIGHT;var _super=_jp.Connectors.AbstractConnector.apply(this,arguments);this._compute=function(paintInfo,_){_super.addSegment(this,STRAIGHT,{x1:paintInfo.sx,y1:paintInfo.sy,x2:paintInfo.startStubX,y2:paintInfo.startStubY});_super.addSegment(this,STRAIGHT,{x1:paintInfo.startStubX,y1:paintInfo.startStubY,x2:paintInfo.endStubX,y2:paintInfo.endStubY});_super.addSegment(this,STRAIGHT,{x1:paintInfo.endStubX,y1:paintInfo.endStubY,x2:paintInfo.tx,y2:paintInfo.ty})}};_jp.Connectors.Straight=Straight;_ju.extend(Straight,_jp.Connectors.AbstractConnector)}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_jp=root.jsPlumb,_ju=root.jsPlumbUtil;var svgAttributeMap={"stroke-linejoin":"stroke-linejoin","stroke-dashoffset":"stroke-dashoffset","stroke-linecap":"stroke-linecap"},STROKE_DASHARRAY="stroke-dasharray",DASHSTYLE="dashstyle",LINEAR_GRADIENT="linearGradient",RADIAL_GRADIENT="radialGradient",DEFS="defs",FILL="fill",STOP="stop",STROKE="stroke",STROKE_WIDTH="stroke-width",STYLE="style",NONE="none",JSPLUMB_GRADIENT="jsplumb_gradient_",LINE_WIDTH="strokeWidth",ns={svg:"http://www.w3.org/2000/svg"},_attr=function(node,attributes){for(var i in attributes){node.setAttribute(i,""+attributes[i])}},_node=function(name,attributes){attributes=attributes||{};attributes.version="1.1";attributes.xmlns=ns.svg;return _jp.createElementNS(ns.svg,name,null,null,attributes)},_pos=function(d){return"position:absolute;left:"+d[0]+"px;top:"+d[1]+"px"},_clearGradient=function(parent){var els=parent.querySelectorAll(" defs,linearGradient,radialGradient");for(var i=0;i<els.length;i++){els[i].parentNode.removeChild(els[i])}},_updateGradient=function(parent,node,style,dimensions,uiComponent){var id=JSPLUMB_GRADIENT+uiComponent._jsPlumb.instance.idstamp();_clearGradient(parent);var g;if(!style.gradient.offset){g=_node(LINEAR_GRADIENT,{id:id,gradientUnits:"userSpaceOnUse"})}else{g=_node(RADIAL_GRADIENT,{id:id})}
var defs=_node(DEFS);parent.appendChild(defs);defs.appendChild(g);for(var i=0;i<style.gradient.stops.length;i++){var styleToUse=uiComponent.segment===1||uiComponent.segment===2?i:style.gradient.stops.length-1-i,stopColor=style.gradient.stops[styleToUse][1],s=_node(STOP,{"offset":Math.floor(style.gradient.stops[i][0]*100)+"%","stop-color":stopColor});g.appendChild(s)}
var applyGradientTo=style.stroke?STROKE:FILL;node.setAttribute(applyGradientTo,"url(#"+id+")")},_applyStyles=function(parent,node,style,dimensions,uiComponent){node.setAttribute(FILL,style.fill?style.fill:NONE);node.setAttribute(STROKE,style.stroke?style.stroke:NONE);if(style.gradient){_updateGradient(parent,node,style,dimensions,uiComponent)}else{_clearGradient(parent);node.setAttribute(STYLE,"")}
if(style.strokeWidth){node.setAttribute(STROKE_WIDTH,style.strokeWidth)}
if(style[DASHSTYLE]&&style[LINE_WIDTH]&&!style[STROKE_DASHARRAY]){var sep=style[DASHSTYLE].indexOf(",")===-1?" ":",",parts=style[DASHSTYLE].split(sep),styleToUse="";parts.forEach(function(p){styleToUse+=(Math.floor(p*style.strokeWidth)+sep)});node.setAttribute(STROKE_DASHARRAY,styleToUse)}else if(style[STROKE_DASHARRAY]){node.setAttribute(STROKE_DASHARRAY,style[STROKE_DASHARRAY])}
for(var i in svgAttributeMap){if(style[i]){node.setAttribute(svgAttributeMap[i],style[i])}}},_appendAtIndex=function(svg,path,idx){if(svg.childNodes.length>idx){svg.insertBefore(path,svg.childNodes[idx])}else{svg.appendChild(path)}};_ju.svg={node:_node,attr:_attr,pos:_pos};var SvgComponent=function(params){var pointerEventsSpec=params.pointerEventsSpec||"all",renderer={};_jp.jsPlumbUIComponent.apply(this,params.originalArgs);this.canvas=null;this.path=null;this.svg=null;this.bgCanvas=null;var clazz=params.cssClass+" "+(params.originalArgs[0].cssClass||""),svgParams={"style":"","width":0,"height":0,"pointer-events":pointerEventsSpec,"position":"absolute"};this.svg=_node("svg",svgParams);if(params.useDivWrapper){this.canvas=_jp.createElement("div",{position:"absolute"});_ju.sizeElement(this.canvas,0,0,1,1);this.canvas.className=clazz}else{_attr(this.svg,{"class":clazz});this.canvas=this.svg}
params._jsPlumb.appendElement(this.canvas,params.originalArgs[0].parent);if(params.useDivWrapper){this.canvas.appendChild(this.svg)}
var displayElements=[this.canvas];this.getDisplayElements=function(){return displayElements};this.appendDisplayElement=function(el){displayElements.push(el)};this.paint=function(style,anchor,extents){if(style!=null){var xy=[this.x,this.y],wh=[this.w,this.h],p;if(extents!=null){if(extents.xmin<0){xy[0]+=extents.xmin}
if(extents.ymin<0){xy[1]+=extents.ymin}
wh[0]=extents.xmax+((extents.xmin<0)?-extents.xmin:0);wh[1]=extents.ymax+((extents.ymin<0)?-extents.ymin:0)}
if(params.useDivWrapper){_ju.sizeElement(this.canvas,xy[0],xy[1],wh[0]>0?wh[0]:1,wh[1]>0?wh[1]:1);xy[0]=0;xy[1]=0;p=_pos([0,0])}else{p=_pos([xy[0],xy[1]])}
renderer.paint.apply(this,arguments);_attr(this.svg,{"style":p,"width":wh[0]||1,"height":wh[1]||1})}};return{renderer:renderer}};_ju.extend(SvgComponent,_jp.jsPlumbUIComponent,{cleanup:function(force){if(force||this.typeId==null){if(this.canvas){this.canvas._jsPlumb=null}
if(this.svg){this.svg._jsPlumb=null}
if(this.bgCanvas){this.bgCanvas._jsPlumb=null}
if(this.canvas&&this.canvas.parentNode){this.canvas.parentNode.removeChild(this.canvas)}
if(this.bgCanvas&&this.bgCanvas.parentNode){this.canvas.parentNode.removeChild(this.canvas)}
this.svg=null;this.canvas=null;this.path=null;this.group=null;this._jsPlumb=null}else{if(this.canvas&&this.canvas.parentNode){this.canvas.parentNode.removeChild(this.canvas)}
if(this.bgCanvas&&this.bgCanvas.parentNode){this.bgCanvas.parentNode.removeChild(this.bgCanvas)}}},reattach:function(instance){var c=instance.getContainer();if(this.canvas&&this.canvas.parentNode==null){c.appendChild(this.canvas)}
if(this.bgCanvas&&this.bgCanvas.parentNode==null){c.appendChild(this.bgCanvas)}},setVisible:function(v){if(this.canvas){this.canvas.style.display=v?"block":"none"}}});_jp.ConnectorRenderers.svg=function(params){var self=this,_super=SvgComponent.apply(this,[{cssClass:params._jsPlumb.connectorClass,originalArgs:arguments,pointerEventsSpec:"none",_jsPlumb:params._jsPlumb}]);_super.renderer.paint=function(style,anchor,extents){var segments=self.getSegments(),p="",offset=[0,0];if(extents.xmin<0){offset[0]=-extents.xmin}
if(extents.ymin<0){offset[1]=-extents.ymin}
if(segments.length>0){p=self.getPathData();var a={d:p,transform:"translate("+offset[0]+","+offset[1]+")","pointer-events":params["pointer-events"]||"visibleStroke"},outlineStyle=null,d=[self.x,self.y,self.w,self.h];if(style.outlineStroke){var outlineWidth=style.outlineWidth||1,outlineStrokeWidth=style.strokeWidth+(2*outlineWidth);outlineStyle=_jp.extend({},style);delete outlineStyle.gradient;outlineStyle.stroke=style.outlineStroke;outlineStyle.strokeWidth=outlineStrokeWidth;if(self.bgPath==null){self.bgPath=_node("path",a);_jp.addClass(self.bgPath,_jp.connectorOutlineClass);_appendAtIndex(self.svg,self.bgPath,0)}else{_attr(self.bgPath,a)}
_applyStyles(self.svg,self.bgPath,outlineStyle,d,self)}
if(self.path==null){self.path=_node("path",a);_appendAtIndex(self.svg,self.path,style.outlineStroke?1:0)}else{_attr(self.path,a)}
_applyStyles(self.svg,self.path,style,d,self)}}};_ju.extend(_jp.ConnectorRenderers.svg,SvgComponent);var SvgEndpoint=_jp.SvgEndpoint=function(params){var _super=SvgComponent.apply(this,[{cssClass:params._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:params._jsPlumb}]);_super.renderer.paint=function(style){var s=_jp.extend({},style);if(s.outlineStroke){s.stroke=s.outlineStroke}
if(this.node==null){this.node=this.makeNode(s);this.svg.appendChild(this.node)}else if(this.updateNode!=null){this.updateNode(this.node)}
_applyStyles(this.svg,this.node,s,[this.x,this.y,this.w,this.h],this);_pos(this.node,[this.x,this.y])}.bind(this)};_ju.extend(SvgEndpoint,SvgComponent);_jp.Endpoints.svg.Dot=function(){_jp.Endpoints.Dot.apply(this,arguments);SvgEndpoint.apply(this,arguments);this.makeNode=function(style){return _node("circle",{"cx":this.w/2,"cy":this.h/2,"r":this.radius})};this.updateNode=function(node){_attr(node,{"cx":this.w/2,"cy":this.h/2,"r":this.radius})}};_ju.extend(_jp.Endpoints.svg.Dot,[_jp.Endpoints.Dot,SvgEndpoint]);_jp.Endpoints.svg.Rectangle=function(){_jp.Endpoints.Rectangle.apply(this,arguments);SvgEndpoint.apply(this,arguments);this.makeNode=function(style){return _node("rect",{"width":this.w,"height":this.h})};this.updateNode=function(node){_attr(node,{"width":this.w,"height":this.h})}};_ju.extend(_jp.Endpoints.svg.Rectangle,[_jp.Endpoints.Rectangle,SvgEndpoint]);_jp.Endpoints.svg.Image=_jp.Endpoints.Image;_jp.Endpoints.svg.Blank=_jp.Endpoints.Blank;_jp.Overlays.svg.Label=_jp.Overlays.Label;_jp.Overlays.svg.Custom=_jp.Overlays.Custom;var AbstractSvgArrowOverlay=function(superclass,originalArgs){superclass.apply(this,originalArgs);_jp.jsPlumbUIComponent.apply(this,originalArgs);this.isAppendedAtTopLevel=!1;var self=this;this.path=null;this.paint=function(params,containerExtents){if(params.component.svg&&containerExtents){if(this.path==null){this.path=_node("path",{"pointer-events":"all"});params.component.svg.appendChild(this.path);if(this.elementCreated){this.elementCreated(this.path,params.component)}
this.canvas=params.component.svg}
var clazz=originalArgs&&(originalArgs.length===1)?(originalArgs[0].cssClass||""):"",offset=[0,0];if(containerExtents.xmin<0){offset[0]=-containerExtents.xmin}
if(containerExtents.ymin<0){offset[1]=-containerExtents.ymin}
_attr(this.path,{"d":makePath(params.d),"class":clazz,stroke:params.stroke?params.stroke:null,fill:params.fill?params.fill:null,transform:"translate("+offset[0]+","+offset[1]+")"})}};var makePath=function(d){return(isNaN(d.cxy.x)||isNaN(d.cxy.y))?"":"M"+d.hxy.x+","+d.hxy.y+" L"+d.tail[0].x+","+d.tail[0].y+" L"+d.cxy.x+","+d.cxy.y+" L"+d.tail[1].x+","+d.tail[1].y+" L"+d.hxy.x+","+d.hxy.y};this.transfer=function(target){if(target.canvas&&this.path&&this.path.parentNode){this.path.parentNode.removeChild(this.path);target.canvas.appendChild(this.path)}}};var svgProtoFunctions={cleanup:function(force){if(this.path!=null){if(force){this._jsPlumb.instance.removeElement(this.path)}else{if(this.path.parentNode){this.path.parentNode.removeChild(this.path)}}}},reattach:function(instance,component){if(this.path&&component.canvas){component.canvas.appendChild(this.path)}},setVisible:function(v){if(this.path!=null){(this.path.style.display=(v?"block":"none"))}}};_ju.extend(AbstractSvgArrowOverlay,[_jp.jsPlumbUIComponent,_jp.Overlays.AbstractOverlay]);_jp.Overlays.svg.Arrow=function(){AbstractSvgArrowOverlay.apply(this,[_jp.Overlays.Arrow,arguments])};_ju.extend(_jp.Overlays.svg.Arrow,[_jp.Overlays.Arrow,AbstractSvgArrowOverlay],svgProtoFunctions);_jp.Overlays.svg.PlainArrow=function(){AbstractSvgArrowOverlay.apply(this,[_jp.Overlays.PlainArrow,arguments])};_ju.extend(_jp.Overlays.svg.PlainArrow,[_jp.Overlays.PlainArrow,AbstractSvgArrowOverlay],svgProtoFunctions);_jp.Overlays.svg.Diamond=function(){AbstractSvgArrowOverlay.apply(this,[_jp.Overlays.Diamond,arguments])};_ju.extend(_jp.Overlays.svg.Diamond,[_jp.Overlays.Diamond,AbstractSvgArrowOverlay],svgProtoFunctions);_jp.Overlays.svg.GuideLines=function(){var path=null,self=this,p1_1,p1_2;_jp.Overlays.GuideLines.apply(this,arguments);this.paint=function(params,containerExtents){if(path==null){path=_node("path");params.connector.svg.appendChild(path);self.attachListeners(path,params.connector);self.attachListeners(path,self);p1_1=_node("path");params.connector.svg.appendChild(p1_1);self.attachListeners(p1_1,params.connector);self.attachListeners(p1_1,self);p1_2=_node("path");params.connector.svg.appendChild(p1_2);self.attachListeners(p1_2,params.connector);self.attachListeners(p1_2,self)}
var offset=[0,0];if(containerExtents.xmin<0){offset[0]=-containerExtents.xmin}
if(containerExtents.ymin<0){offset[1]=-containerExtents.ymin}
_attr(path,{"d":makePath(params.head,params.tail),stroke:"red",fill:null,transform:"translate("+offset[0]+","+offset[1]+")"});_attr(p1_1,{"d":makePath(params.tailLine[0],params.tailLine[1]),stroke:"blue",fill:null,transform:"translate("+offset[0]+","+offset[1]+")"});_attr(p1_2,{"d":makePath(params.headLine[0],params.headLine[1]),stroke:"green",fill:null,transform:"translate("+offset[0]+","+offset[1]+")"})};var makePath=function(d1,d2){return"M "+d1.x+","+d1.y+" L"+d2.x+","+d2.y}};_ju.extend(_jp.Overlays.svg.GuideLines,_jp.Overlays.GuideLines)}).call(typeof window!=='undefined'?window:this);(function(){"use strict";var root=this,_jp=root.jsPlumb,_ju=root.jsPlumbUtil,_jk=root.Katavorio,_jg=root.Biltong;var _getEventManager=function(instance){var e=instance._mottle;if(!e){e=instance._mottle=new root.Mottle()}
return e};var _getDragManager=function(instance,category){category=category||"main";var key="_katavorio_"+category;var k=instance[key],e=instance.getEventManager();if(!k){k=new _jk({bind:e.on,unbind:e.off,getSize:_jp.getSize,getConstrainingRectangle:function(el){return[el.parentNode.scrollWidth,el.parentNode.scrollHeight]},getPosition:function(el,relativeToRoot){var o=instance.getOffset(el,relativeToRoot,el._katavorioDrag?el.offsetParent:null);return[o.left,o.top]},setPosition:function(el,xy){el.style.left=xy[0]+"px";el.style.top=xy[1]+"px"},addClass:_jp.addClass,removeClass:_jp.removeClass,intersects:_jg.intersects,indexOf:function(l,i){return l.indexOf(i)},scope:instance.getDefaultScope(),css:{noSelect:instance.dragSelectClass,droppable:"jtk-droppable",draggable:"jtk-draggable",drag:"jtk-drag",selected:"jtk-drag-selected",active:"jtk-drag-active",hover:"jtk-drag-hover",ghostProxy:"jtk-ghost-proxy"}});k.setZoom(instance.getZoom());instance[key]=k;instance.bind("zoom",k.setZoom)}
return k};var _dragStart=function(params){var options=params.el._jsPlumbDragOptions;var cont=!0;if(options.canDrag){cont=options.canDrag()}
if(cont){this.setHoverSuspended(!0);this.select({source:params.el}).addClass(this.elementDraggingClass+" "+this.sourceElementDraggingClass,!0);this.select({target:params.el}).addClass(this.elementDraggingClass+" "+this.targetElementDraggingClass,!0);this.setConnectionBeingDragged(!0)}
return cont};var _dragMove=function(params){var ui=this.getUIPosition(arguments,this.getZoom());if(ui!=null){var o=params.el._jsPlumbDragOptions;this.draw(params.el,ui,null,!0);if(o._dragging){this.addClass(params.el,"jtk-dragged")}
o._dragging=!0}};var _dragStop=function(params){var elements=params.selection,uip;var _one=function(_e){var drawResult;if(_e[1]!=null){uip=this.getUIPosition([{el:_e[2].el,pos:[_e[1].left,_e[1].top]}]);drawResult=this.draw(_e[2].el,uip)}
if(_e[0]._jsPlumbDragOptions!=null){delete _e[0]._jsPlumbDragOptions._dragging}
this.removeClass(_e[0],"jtk-dragged");this.select({source:_e[2].el}).removeClass(this.elementDraggingClass+" "+this.sourceElementDraggingClass,!0);this.select({target:_e[2].el}).removeClass(this.elementDraggingClass+" "+this.targetElementDraggingClass,!0);params.e._drawResult=params.e._drawResult||{c:[],e:[],a:[]};Array.prototype.push.apply(params.e._drawResult.c,drawResult.c);Array.prototype.push.apply(params.e._drawResult.e,drawResult.e);Array.prototype.push.apply(params.e._drawResult.a,drawResult.a);this.getDragManager().dragEnded(_e[2].el)}.bind(this);for(var i=0;i<elements.length;i++){_one(elements[i])}
this.setHoverSuspended(!1);this.setConnectionBeingDragged(!1)};var _animProps=function(o,p){var _one=function(pName){if(p[pName]!=null){if(_ju.isString(p[pName])){var m=p[pName].match(/-=/)?-1:1,v=p[pName].substring(2);return o[pName]+(m*v)}else{return p[pName]}}else{return o[pName]}};return[_one("left"),_one("top")]};var _genLoc=function(prefix,e){if(e==null){return[0,0]}
var ts=_touches(e),t=_getTouch(ts,0);return[t[prefix+"X"],t[prefix+"Y"]]},_pageLocation=_genLoc.bind(this,"page"),_screenLocation=_genLoc.bind(this,"screen"),_clientLocation=_genLoc.bind(this,"client"),_getTouch=function(touches,idx){return touches.item?touches.item(idx):touches[idx]},_touches=function(e){return e.touches&&e.touches.length>0?e.touches:e.changedTouches&&e.changedTouches.length>0?e.changedTouches:e.targetTouches&&e.targetTouches.length>0?e.targetTouches:[e]};var DragManager=function(_currentInstance){var _draggables={},_dlist=[],_delements={},_elementsWithEndpoints={},_draggablesForElements={};this.register=function(el){var id=_currentInstance.getId(el),parentOffset;if(!_draggables[id]){_draggables[id]=el;_dlist.push(el);_delements[id]={}}
var _oneLevel=function(p){if(p){for(var i=0;i<p.childNodes.length;i++){if(p.childNodes[i].nodeType!==3&&p.childNodes[i].nodeType!==8){var cEl=jsPlumb.getElement(p.childNodes[i]),cid=_currentInstance.getId(p.childNodes[i],null,!0);if(cid&&_elementsWithEndpoints[cid]&&_elementsWithEndpoints[cid]>0){if(!parentOffset){parentOffset=_currentInstance.getOffset(el)}
var cOff=_currentInstance.getOffset(cEl);_delements[id][cid]={id:cid,offset:{left:cOff.left-parentOffset.left,top:cOff.top-parentOffset.top}};_draggablesForElements[cid]=id}
_oneLevel(p.childNodes[i])}}}};_oneLevel(el)};this.updateOffsets=function(elId,childOffsetOverrides){if(elId!=null){childOffsetOverrides=childOffsetOverrides||{};var domEl=jsPlumb.getElement(elId),id=_currentInstance.getId(domEl),children=_delements[id],parentOffset;if(children){for(var i in children){if(children.hasOwnProperty(i)){var cel=jsPlumb.getElement(i),cOff=childOffsetOverrides[i]||_currentInstance.getOffset(cel);if(cel.offsetParent==null&&_delements[id][i]!=null){continue}
if(!parentOffset){parentOffset=_currentInstance.getOffset(domEl)}
_delements[id][i]={id:i,offset:{left:cOff.left-parentOffset.left,top:cOff.top-parentOffset.top}};_draggablesForElements[i]=id}}}}};this.endpointAdded=function(el,id){id=id||_currentInstance.getId(el);var b=document.body,p=el.parentNode;_elementsWithEndpoints[id]=_elementsWithEndpoints[id]?_elementsWithEndpoints[id]+1:1;while(p!=null&&p!==b){var pid=_currentInstance.getId(p,null,!0);if(pid&&_draggables[pid]){var pLoc=_currentInstance.getOffset(p);if(_delements[pid][id]==null){var cLoc=_currentInstance.getOffset(el);_delements[pid][id]={id:id,offset:{left:cLoc.left-pLoc.left,top:cLoc.top-pLoc.top}};_draggablesForElements[id]=pid}
break}
p=p.parentNode}};this.endpointDeleted=function(endpoint){if(_elementsWithEndpoints[endpoint.elementId]){_elementsWithEndpoints[endpoint.elementId]--;if(_elementsWithEndpoints[endpoint.elementId]<=0){for(var i in _delements){if(_delements.hasOwnProperty(i)&&_delements[i]){delete _delements[i][endpoint.elementId];delete _draggablesForElements[endpoint.elementId]}}}}};this.changeId=function(oldId,newId){_delements[newId]=_delements[oldId];_delements[oldId]={};_draggablesForElements[newId]=_draggablesForElements[oldId];_draggablesForElements[oldId]=null};this.getElementsForDraggable=function(id){return _delements[id]};this.elementRemoved=function(elementId){var elId=_draggablesForElements[elementId];if(elId){_delements[elId]&&delete _delements[elId][elementId];delete _draggablesForElements[elementId]}};this.reset=function(){_draggables={};_dlist=[];_delements={};_elementsWithEndpoints={}};this.dragEnded=function(el){if(el.offsetParent!=null){var id=_currentInstance.getId(el),ancestor=_draggablesForElements[id];if(ancestor){this.updateOffsets(ancestor)}}};this.setParent=function(el,elId,p,pId,currentChildLocation){var current=_draggablesForElements[elId];if(!_delements[pId]){_delements[pId]={}}
var pLoc=_currentInstance.getOffset(p),cLoc=currentChildLocation||_currentInstance.getOffset(el);if(current&&_delements[current]){delete _delements[current][elId]}
_delements[pId][elId]={id:elId,offset:{left:cLoc.left-pLoc.left,top:cLoc.top-pLoc.top}};_draggablesForElements[elId]=pId};this.clearParent=function(el,elId){var current=_draggablesForElements[elId];if(current){delete _delements[current][elId];delete _draggablesForElements[elId]}};this.revalidateParent=function(el,elId,childOffset){var current=_draggablesForElements[elId];if(current){var co={};co[elId]=childOffset;this.updateOffsets(current,co);_currentInstance.revalidate(current)}};this.getDragAncestor=function(el){var de=jsPlumb.getElement(el),id=_currentInstance.getId(de),aid=_draggablesForElements[id];if(aid){return jsPlumb.getElement(aid)}else{return null}}};var _setClassName=function(el,cn,classList){cn=_ju.fastTrim(cn);if(typeof el.className.baseVal!=="undefined"){el.className.baseVal=cn}else{el.className=cn}
try{var cl=el.classList;if(cl!=null){while(cl.length>0){cl.remove(cl.item(0))}
for(var i=0;i<classList.length;i++){if(classList[i]){cl.add(classList[i])}}}}catch(e){_ju.log("JSPLUMB: cannot set class list",e)}},_getClassName=function(el){return(typeof el.className.baseVal==="undefined")?el.className:el.className.baseVal},_classManip=function(el,classesToAdd,classesToRemove){classesToAdd=classesToAdd==null?[]:_ju.isArray(classesToAdd)?classesToAdd:classesToAdd.split(/\s+/);classesToRemove=classesToRemove==null?[]:_ju.isArray(classesToRemove)?classesToRemove:classesToRemove.split(/\s+/);var className=_getClassName(el),curClasses=className.split(/\s+/);var _oneSet=function(add,classes){for(var i=0;i<classes.length;i++){if(add){if(curClasses.indexOf(classes[i])===-1){curClasses.push(classes[i])}}else{var idx=curClasses.indexOf(classes[i]);if(idx!==-1){curClasses.splice(idx,1)}}}};_oneSet(!0,classesToAdd);_oneSet(!1,classesToRemove);_setClassName(el,curClasses.join(" "),curClasses)};root.jsPlumb.extend(root.jsPlumbInstance.prototype,{headless:!1,pageLocation:_pageLocation,screenLocation:_screenLocation,clientLocation:_clientLocation,getDragManager:function(){if(this.dragManager==null){this.dragManager=new DragManager(this)}
return this.dragManager},recalculateOffsets:function(elId){this.getDragManager().updateOffsets(elId)},createElement:function(tag,style,clazz,atts){return this.createElementNS(null,tag,style,clazz,atts)},createElementNS:function(ns,tag,style,clazz,atts){var e=ns==null?document.createElement(tag):document.createElementNS(ns,tag);var i;style=style||{};for(i in style){e.style[i]=style[i]}
if(clazz){e.className=clazz}
atts=atts||{};for(i in atts){e.setAttribute(i,""+atts[i])}
return e},getAttribute:function(el,attName){return el.getAttribute!=null?el.getAttribute(attName):null},setAttribute:function(el,a,v){if(el.setAttribute!=null){el.setAttribute(a,v)}},setAttributes:function(el,atts){for(var i in atts){if(atts.hasOwnProperty(i)){el.setAttribute(i,atts[i])}}},appendToRoot:function(node){document.body.appendChild(node)},getRenderModes:function(){return["svg"]},getClass:_getClassName,addClass:function(el,clazz){jsPlumb.each(el,function(e){_classManip(e,clazz)})},hasClass:function(el,clazz){el=jsPlumb.getElement(el);if(el.classList){return el.classList.contains(clazz)}else{return _getClassName(el).indexOf(clazz)!==-1}},removeClass:function(el,clazz){jsPlumb.each(el,function(e){_classManip(e,null,clazz)})},toggleClass:function(el,clazz){if(jsPlumb.hasClass(el,clazz)){jsPlumb.removeClass(el,clazz)}else{jsPlumb.addClass(el,clazz)}},updateClasses:function(el,toAdd,toRemove){jsPlumb.each(el,function(e){_classManip(e,toAdd,toRemove)})},setClass:function(el,clazz){if(clazz!=null){jsPlumb.each(el,function(e){_setClassName(e,clazz,clazz.split(/\s+/))})}},setPosition:function(el,p){el.style.left=p.left+"px";el.style.top=p.top+"px"},getPosition:function(el){var _one=function(prop){var v=el.style[prop];return v?v.substring(0,v.length-2):0};return{left:_one("left"),top:_one("top")}},getStyle:function(el,prop){if(typeof window.getComputedStyle!=='undefined'){return getComputedStyle(el,null).getPropertyValue(prop)}else{return el.currentStyle[prop]}},getSelector:function(ctx,spec){var sel=null;if(arguments.length===1){sel=ctx.nodeType!=null?ctx:document.querySelectorAll(ctx)}else{sel=ctx.querySelectorAll(spec)}
return sel},getOffset:function(el,relativeToRoot,container){el=jsPlumb.getElement(el);container=container||this.getContainer();var out={left:el.offsetLeft,top:el.offsetTop},op=(relativeToRoot||(container!=null&&(el!==container&&el.offsetParent!==container)))?el.offsetParent:null,_maybeAdjustScroll=function(offsetParent){if(offsetParent!=null&&offsetParent!==document.body&&(offsetParent.scrollTop>0||offsetParent.scrollLeft>0)){out.left-=offsetParent.scrollLeft;out.top-=offsetParent.scrollTop}}.bind(this);while(op!=null){out.left+=op.offsetLeft;out.top+=op.offsetTop;_maybeAdjustScroll(op);op=relativeToRoot?op.offsetParent:op.offsetParent===container?null:op.offsetParent}
if(container!=null&&!relativeToRoot&&(container.scrollTop>0||container.scrollLeft>0)){var pp=el.offsetParent!=null?this.getStyle(el.offsetParent,"position"):"static",p=this.getStyle(el,"position");if(p!=="absolute"&&p!=="fixed"&&pp!=="absolute"&&pp!=="fixed"){out.left-=container.scrollLeft;out.top-=container.scrollTop}}
return out},getPositionOnElement:function(evt,el,zoom){var box=typeof el.getBoundingClientRect!=="undefined"?el.getBoundingClientRect():{left:0,top:0,width:0,height:0},body=document.body,docElem=document.documentElement,scrollTop=window.pageYOffset||docElem.scrollTop||body.scrollTop,scrollLeft=window.pageXOffset||docElem.scrollLeft||body.scrollLeft,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,pst=0,psl=0,top=box.top+scrollTop-clientTop+(pst*zoom),left=box.left+scrollLeft-clientLeft+(psl*zoom),cl=jsPlumb.pageLocation(evt),w=box.width||(el.offsetWidth*zoom),h=box.height||(el.offsetHeight*zoom),x=(cl[0]-left)/w,y=(cl[1]-top)/h;return[x,y]},getAbsolutePosition:function(el){var _one=function(s){var ss=el.style[s];if(ss){return parseFloat(ss.substring(0,ss.length-2))}};return[_one("left"),_one("top")]},setAbsolutePosition:function(el,xy,animateFrom,animateOptions){if(animateFrom){this.animate(el,{left:"+="+(xy[0]-animateFrom[0]),top:"+="+(xy[1]-animateFrom[1])},animateOptions)}else{el.style.left=xy[0]+"px";el.style.top=xy[1]+"px"}},getSize:function(el){return[el.offsetWidth,el.offsetHeight]},getWidth:function(el){return el.offsetWidth},getHeight:function(el){return el.offsetHeight},getRenderMode:function(){return"svg"},draggable:function(el,options){var info;el=_ju.isArray(el)||(el.length!=null&&!_ju.isString(el))?el:[el];Array.prototype.slice.call(el).forEach(function(_el){info=this.info(_el);if(info.el){this._initDraggableIfNecessary(info.el,!0,options,info.id,!0)}}.bind(this));return this},snapToGrid:function(el,x,y){var out=[];var _oneEl=function(_el){var info=this.info(_el);if(info.el!=null&&info.el._katavorioDrag){var snapped=info.el._katavorioDrag.snap(x,y);this.revalidate(info.el);out.push([info.el,snapped])}}.bind(this);if(arguments.length===1||arguments.length===3){_oneEl(el,x,y)}else{var _me=this.getManagedElements();for(var mel in _me){_oneEl(mel,arguments[0],arguments[1])}}
return out},initDraggable:function(el,options,category){_getDragManager(this,category).draggable(el,options);el._jsPlumbDragOptions=options},destroyDraggable:function(el,category){_getDragManager(this,category).destroyDraggable(el);el._jsPlumbDragOptions=null;el._jsPlumbRelatedElement=null},unbindDraggable:function(el,evt,fn,category){_getDragManager(this,category).destroyDraggable(el,evt,fn)},setDraggable:function(element,draggable){return jsPlumb.each(element,function(el){if(this.isDragSupported(el)){this._draggableStates[this.getAttribute(el,"id")]=draggable;this.setElementDraggable(el,draggable)}}.bind(this))},_draggableStates:{},toggleDraggable:function(el){var state;jsPlumb.each(el,function(el){var elId=this.getAttribute(el,"id");state=this._draggableStates[elId]==null?!1:this._draggableStates[elId];state=!state;this._draggableStates[elId]=state;this.setDraggable(el,state);return state}.bind(this));return state},_initDraggableIfNecessary:function(element,isDraggable,dragOptions,id,fireEvent){if(!jsPlumb.headless){var _draggable=isDraggable==null?!1:isDraggable;if(_draggable){if(jsPlumb.isDragSupported(element,this)){var options=dragOptions||this.Defaults.DragOptions;options=jsPlumb.extend({},options);if(!jsPlumb.isAlreadyDraggable(element,this)){var dragEvent=jsPlumb.dragEvents.drag,stopEvent=jsPlumb.dragEvents.stop,startEvent=jsPlumb.dragEvents.start;this.manage(id,element);options[startEvent]=_ju.wrap(options[startEvent],_dragStart.bind(this));options[dragEvent]=_ju.wrap(options[dragEvent],_dragMove.bind(this));options[stopEvent]=_ju.wrap(options[stopEvent],_dragStop.bind(this));var elId=this.getId(element);this._draggableStates[elId]=!0;var draggable=this._draggableStates[elId];options.disabled=draggable==null?!1:!draggable;this.initDraggable(element,options);this.getDragManager().register(element);if(fireEvent){this.fire("elementDraggable",{el:element,options:options})}}else{if(dragOptions.force){this.initDraggable(element,options)}}}}}},animationSupported:!0,getElement:function(el){if(el==null){return null}
el=typeof el==="string"?el:(el.tagName==null&&el.length!=null&&el.enctype==null)?el[0]:el;return typeof el==="string"?document.getElementById(el):el},removeElement:function(element){_getDragManager(this).elementRemoved(element);this.getEventManager().remove(element)},doAnimate:function(el,properties,options){options=options||{};var o=this.getOffset(el),ap=_animProps(o,properties),ldist=ap[0]-o.left,tdist=ap[1]-o.top,d=options.duration||250,step=15,steps=d/step,linc=(step/d)*ldist,tinc=(step/d)*tdist,idx=0,_int=setInterval(function(){_jp.setPosition(el,{left:o.left+(linc*(idx+1)),top:o.top+(tinc*(idx+1))});if(options.step!=null){options.step(idx,Math.ceil(steps))}
idx++;if(idx>=steps){window.clearInterval(_int);if(options.complete!=null){options.complete()}}},step)},destroyDroppable:function(el,category){_getDragManager(this,category).destroyDroppable(el)},unbindDroppable:function(el,evt,fn,category){_getDragManager(this,category).destroyDroppable(el,evt,fn)},droppable:function(el,options){el=_ju.isArray(el)||(el.length!=null&&!_ju.isString(el))?el:[el];var info;options=options||{};options.allowLoopback=!1;Array.prototype.slice.call(el).forEach(function(_el){info=this.info(_el);if(info.el){this.initDroppable(info.el,options)}}.bind(this));return this},initDroppable:function(el,options,category){_getDragManager(this,category).droppable(el,options)},isAlreadyDraggable:function(el){return el._katavorioDrag!=null},isDragSupported:function(el,options){return!0},isDropSupported:function(el,options){return!0},isElementDraggable:function(el){el=_jp.getElement(el);return el._katavorioDrag&&el._katavorioDrag.isEnabled()},getDragObject:function(eventArgs){return eventArgs[0].drag.getDragElement()},getDragScope:function(el){return el._katavorioDrag&&el._katavorioDrag.scopes.join(" ")||""},getDropEvent:function(args){return args[0].e},getUIPosition:function(eventArgs,zoom){var el=eventArgs[0].el;if(el.offsetParent==null){return null}
var finalPos=eventArgs[0].finalPos||eventArgs[0].pos;var p={left:finalPos[0],top:finalPos[1]};if(el._katavorioDrag&&el.offsetParent!==this.getContainer()){var oc=this.getOffset(el.offsetParent);p.left+=oc.left;p.top+=oc.top}
return p},setDragFilter:function(el,filter,_exclude){if(el._katavorioDrag){el._katavorioDrag.setFilter(filter,_exclude)}},setElementDraggable:function(el,draggable){el=_jp.getElement(el);if(el._katavorioDrag){el._katavorioDrag.setEnabled(draggable)}},setDragScope:function(el,scope){if(el._katavorioDrag){el._katavorioDrag.k.setDragScope(el,scope)}},setDropScope:function(el,scope){if(el._katavorioDrop&&el._katavorioDrop.length>0){el._katavorioDrop[0].k.setDropScope(el,scope)}},addToPosse:function(el,spec){var specs=Array.prototype.slice.call(arguments,1);var dm=_getDragManager(this);_jp.each(el,function(_el){_el=[_jp.getElement(_el)];_el.push.apply(_el,specs);dm.addToPosse.apply(dm,_el)})},setPosse:function(el,spec){var specs=Array.prototype.slice.call(arguments,1);var dm=_getDragManager(this);_jp.each(el,function(_el){_el=[_jp.getElement(_el)];_el.push.apply(_el,specs);dm.setPosse.apply(dm,_el)})},removeFromPosse:function(el,posseId){var specs=Array.prototype.slice.call(arguments,1);var dm=_getDragManager(this);_jp.each(el,function(_el){_el=[_jp.getElement(_el)];_el.push.apply(_el,specs);dm.removeFromPosse.apply(dm,_el)})},removeFromAllPosses:function(el){var dm=_getDragManager(this);_jp.each(el,function(_el){dm.removeFromAllPosses(_jp.getElement(_el))})},setPosseState:function(el,posseId,state){var dm=_getDragManager(this);_jp.each(el,function(_el){dm.setPosseState(_jp.getElement(_el),posseId,state)})},dragEvents:{'start':'start','stop':'stop','drag':'drag','step':'step','over':'over','out':'out','drop':'drop','complete':'complete','beforeStart':'beforeStart'},animEvents:{'step':"step",'complete':'complete'},stopDrag:function(el){if(el._katavorioDrag){el._katavorioDrag.abort()}},addToDragSelection:function(spec){var el=this.getElement(spec);if(el!=null&&(el._isJsPlumbGroup||el._jsPlumbGroup==null)){_getDragManager(this).select(spec)}},removeFromDragSelection:function(spec){_getDragManager(this).deselect(spec)},getDragSelection:function(){return _getDragManager(this).getSelection()},clearDragSelection:function(){_getDragManager(this).deselectAll()},trigger:function(el,event,originalEvent,payload){this.getEventManager().trigger(el,event,originalEvent,payload)},doReset:function(){for(var key in this){if(key.indexOf("_katavorio_")===0){this[key].reset()}}},getEventManager:function(){return _getEventManager(this)},on:function(el,event,callback){this.getEventManager().on.apply(this,arguments);return this},off:function(el,event,callback){this.getEventManager().off.apply(this,arguments);return this}});var ready=function(f){var _do=function(){if(/complete|loaded|interactive/.test(document.readyState)&&typeof(document.body)!=="undefined"&&document.body!=null){f()}else{setTimeout(_do,9)}};_do()};ready(_jp.init)}).call(typeof window!=='undefined'?window:this);/*!
 * typeahead.js 0.11.1
 * https://github.com/twitter/typeahead.js
 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
 */
(function(root,factory){if(typeof define==="function"&&define.amd){define("bloodhound",["jquery"],function(a0){return root.Bloodhound=factory(a0)})}else if(typeof exports==="object"){module.exports=factory(require("jquery"))}else{root.Bloodhound=factory(jQuery)}})(this,function($){var _=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(str){return!str||/^\s*$/.test(str)},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(obj){return typeof obj==="string"},isNumber:function(obj){return typeof obj==="number"},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return typeof obj==="undefined"},isElement:function(obj){return!!(obj&&obj.nodeType===1)},isJQuery:function(obj){return obj instanceof $},toStr:function toStr(s){return _.isUndefined(s)||s===null?"":s+""},bind:$.proxy,each:function(collection,cb){$.each(collection,reverseArgs);function reverseArgs(index,value){return cb(value,index)}},map:$.map,filter:$.grep,every:function(obj,test){var result=!0;if(!obj){return result}
$.each(obj,function(key,val){if(!(result=test.call(null,val,key,obj))){return!1}});return!!result},some:function(obj,test){var result=!1;if(!obj){return result}
$.each(obj,function(key,val){if(result=test.call(null,val,key,obj)){return!1}});return!!result},mixin:$.extend,identity:function(x){return x},clone:function(obj){return $.extend(!0,{},obj)},getIdGenerator:function(){var counter=0;return function(){return counter++}},templatify:function templatify(obj){return $.isFunction(obj)?obj:template;function template(){return String(obj)}},defer:function(fn){setTimeout(fn,0)},debounce:function(func,wait,immediate){var timeout,result;return function(){var context=this,args=arguments,later,callNow;later=function(){timeout=null;if(!immediate){result=func.apply(context,args)}};callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args)}
return result}},throttle:function(func,wait){var context,args,timeout,result,previous,later;previous=0;later=function(){previous=new Date();timeout=null;result=func.apply(context,args)};return function(){var now=new Date(),remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0){clearTimeout(timeout);timeout=null;previous=now;result=func.apply(context,args)}else if(!timeout){timeout=setTimeout(later,remaining)}
return result}},stringify:function(val){return _.isString(val)?val:JSON.stringify(val)},noop:function(){}}}();var VERSION="0.11.1";var tokenizers=function(){"use strict";return{nonword:nonword,whitespace:whitespace,obj:{nonword:getObjTokenizer(nonword),whitespace:getObjTokenizer(whitespace)}};function whitespace(str){str=_.toStr(str);return str?str.split(/\s+/):[]}
function nonword(str){str=_.toStr(str);return str?str.split(/\W+/):[]}
function getObjTokenizer(tokenizer){return function setKey(keys){keys=_.isArray(keys)?keys:[].slice.call(arguments,0);return function tokenize(o){var tokens=[];_.each(keys,function(k){tokens=tokens.concat(tokenizer(_.toStr(o[k])))});return tokens}}}}();var LruCache=function(){"use strict";function LruCache(maxSize){this.maxSize=_.isNumber(maxSize)?maxSize:100;this.reset();if(this.maxSize<=0){this.set=this.get=$.noop}}
_.mixin(LruCache.prototype,{set:function set(key,val){var tailItem=this.list.tail,node;if(this.size>=this.maxSize){this.list.remove(tailItem);delete this.hash[tailItem.key];this.size--}
if(node=this.hash[key]){node.val=val;this.list.moveToFront(node)}else{node=new Node(key,val);this.list.add(node);this.hash[key]=node;this.size++}},get:function get(key){var node=this.hash[key];if(node){this.list.moveToFront(node);return node.val}},reset:function reset(){this.size=0;this.hash={};this.list=new List()}});function List(){this.head=this.tail=null}
_.mixin(List.prototype,{add:function add(node){if(this.head){node.next=this.head;this.head.prev=node}
this.head=node;this.tail=this.tail||node},remove:function remove(node){node.prev?node.prev.next=node.next:this.head=node.next;node.next?node.next.prev=node.prev:this.tail=node.prev},moveToFront:function(node){this.remove(node);this.add(node)}});function Node(key,val){this.key=key;this.val=val;this.prev=this.next=null}
return LruCache}();var PersistentStorage=function(){"use strict";var LOCAL_STORAGE;try{LOCAL_STORAGE=window.localStorage;LOCAL_STORAGE.setItem("~~~","!");LOCAL_STORAGE.removeItem("~~~")}catch(err){LOCAL_STORAGE=null}
function PersistentStorage(namespace,override){this.prefix=["__",namespace,"__"].join("");this.ttlKey="__ttl__";this.keyMatcher=new RegExp("^"+_.escapeRegExChars(this.prefix));this.ls=override||LOCAL_STORAGE;!this.ls&&this._noop()}
_.mixin(PersistentStorage.prototype,{_prefix:function(key){return this.prefix+key},_ttlKey:function(key){return this._prefix(key)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=_.noop},_safeSet:function(key,val){try{this.ls.setItem(key,val)}catch(err){if(err.name==="QuotaExceededError"){this.clear();this._noop()}}},get:function(key){if(this.isExpired(key)){this.remove(key)}
return decode(this.ls.getItem(this._prefix(key)))},set:function(key,val,ttl){if(_.isNumber(ttl)){this._safeSet(this._ttlKey(key),encode(now()+ttl))}else{this.ls.removeItem(this._ttlKey(key))}
return this._safeSet(this._prefix(key),encode(val))},remove:function(key){this.ls.removeItem(this._ttlKey(key));this.ls.removeItem(this._prefix(key));return this},clear:function(){var i,keys=gatherMatchingKeys(this.keyMatcher);for(i=keys.length;i--;){this.remove(keys[i])}
return this},isExpired:function(key){var ttl=decode(this.ls.getItem(this._ttlKey(key)));return _.isNumber(ttl)&&now()>ttl?!0:!1}});return PersistentStorage;function now(){return new Date().getTime()}
function encode(val){return JSON.stringify(_.isUndefined(val)?null:val)}
function decode(val){return $.parseJSON(val)}
function gatherMatchingKeys(keyMatcher){var i,key,keys=[],len=LOCAL_STORAGE.length;for(i=0;i<len;i++){if((key=LOCAL_STORAGE.key(i)).match(keyMatcher)){keys.push(key.replace(keyMatcher,""))}}
return keys}}();var Transport=function(){"use strict";var pendingRequestsCount=0,pendingRequests={},maxPendingRequests=6,sharedCache=new LruCache(10);function Transport(o){o=o||{};this.cancelled=!1;this.lastReq=null;this._send=o.transport;this._get=o.limiter?o.limiter(this._get):this._get;this._cache=o.cache===!1?new LruCache(0):sharedCache}
Transport.setMaxPendingRequests=function setMaxPendingRequests(num){maxPendingRequests=num};Transport.resetCache=function resetCache(){sharedCache.reset()};_.mixin(Transport.prototype,{_fingerprint:function fingerprint(o){o=o||{};return o.url+o.type+$.param(o.data||{})},_get:function(o,cb){var that=this,fingerprint,jqXhr;fingerprint=this._fingerprint(o);if(this.cancelled||fingerprint!==this.lastReq){return}
if(jqXhr=pendingRequests[fingerprint]){jqXhr.done(done).fail(fail)}else if(pendingRequestsCount<maxPendingRequests){pendingRequestsCount++;pendingRequests[fingerprint]=this._send(o).done(done).fail(fail).always(always)}else{this.onDeckRequestArgs=[].slice.call(arguments,0)}
function done(resp){cb(null,resp);that._cache.set(fingerprint,resp)}
function fail(){cb(!0)}
function always(){pendingRequestsCount--;delete pendingRequests[fingerprint];if(that.onDeckRequestArgs){that._get.apply(that,that.onDeckRequestArgs);that.onDeckRequestArgs=null}}},get:function(o,cb){var resp,fingerprint;cb=cb||$.noop;o=_.isString(o)?{url:o}:o||{};fingerprint=this._fingerprint(o);this.cancelled=!1;this.lastReq=fingerprint;if(resp=this._cache.get(fingerprint)){cb(null,resp)}else{this._get(o,cb)}},cancel:function(){this.cancelled=!0}});return Transport}();var SearchIndex=window.SearchIndex=function(){"use strict";var CHILDREN="c",IDS="i";function SearchIndex(o){o=o||{};if(!o.datumTokenizer||!o.queryTokenizer){$.error("datumTokenizer and queryTokenizer are both required")}
this.identify=o.identify||_.stringify;this.datumTokenizer=o.datumTokenizer;this.queryTokenizer=o.queryTokenizer;this.reset()}
_.mixin(SearchIndex.prototype,{bootstrap:function bootstrap(o){this.datums=o.datums;this.trie=o.trie},add:function(data){var that=this;data=_.isArray(data)?data:[data];_.each(data,function(datum){var id,tokens;that.datums[id=that.identify(datum)]=datum;tokens=normalizeTokens(that.datumTokenizer(datum));_.each(tokens,function(token){var node,chars,ch;node=that.trie;chars=token.split("");while(ch=chars.shift()){node=node[CHILDREN][ch]||(node[CHILDREN][ch]=newNode());node[IDS].push(id)}})})},get:function get(ids){var that=this;return _.map(ids,function(id){return that.datums[id]})},search:function search(query){var that=this,tokens,matches;tokens=normalizeTokens(this.queryTokenizer(query));_.each(tokens,function(token){var node,chars,ch,ids;if(matches&&matches.length===0){return!1}
node=that.trie;chars=token.split("");while(node&&(ch=chars.shift())){node=node[CHILDREN][ch]}
if(node&&chars.length===0){ids=node[IDS].slice(0);matches=matches?getIntersection(matches,ids):ids}else{matches=[];return!1}});return matches?_.map(unique(matches),function(id){return that.datums[id]}):[]},all:function all(){var values=[];for(var key in this.datums){values.push(this.datums[key])}
return values},reset:function reset(){this.datums={};this.trie=newNode()},serialize:function serialize(){return{datums:this.datums,trie:this.trie}}});return SearchIndex;function normalizeTokens(tokens){tokens=_.filter(tokens,function(token){return!!token});tokens=_.map(tokens,function(token){return token.toLowerCase()});return tokens}
function newNode(){var node={};node[IDS]=[];node[CHILDREN]={};return node}
function unique(array){var seen={},uniques=[];for(var i=0,len=array.length;i<len;i++){if(!seen[array[i]]){seen[array[i]]=!0;uniques.push(array[i])}}
return uniques}
function getIntersection(arrayA,arrayB){var ai=0,bi=0,intersection=[];arrayA=arrayA.sort();arrayB=arrayB.sort();var lenArrayA=arrayA.length,lenArrayB=arrayB.length;while(ai<lenArrayA&&bi<lenArrayB){if(arrayA[ai]<arrayB[bi]){ai++}else if(arrayA[ai]>arrayB[bi]){bi++}else{intersection.push(arrayA[ai]);ai++;bi++}}
return intersection}}();var Prefetch=function(){"use strict";var keys;keys={data:"data",protocol:"protocol",thumbprint:"thumbprint"};function Prefetch(o){this.url=o.url;this.ttl=o.ttl;this.cache=o.cache;this.prepare=o.prepare;this.transform=o.transform;this.transport=o.transport;this.thumbprint=o.thumbprint;this.storage=new PersistentStorage(o.cacheKey)}
_.mixin(Prefetch.prototype,{_settings:function settings(){return{url:this.url,type:"GET",dataType:"json"}},store:function store(data){if(!this.cache){return}
this.storage.set(keys.data,data,this.ttl);this.storage.set(keys.protocol,location.protocol,this.ttl);this.storage.set(keys.thumbprint,this.thumbprint,this.ttl)},fromCache:function fromCache(){var stored={},isExpired;if(!this.cache){return null}
stored.data=this.storage.get(keys.data);stored.protocol=this.storage.get(keys.protocol);stored.thumbprint=this.storage.get(keys.thumbprint);isExpired=stored.thumbprint!==this.thumbprint||stored.protocol!==location.protocol;return stored.data&&!isExpired?stored.data:null},fromNetwork:function(cb){var that=this,settings;if(!cb){return}
settings=this.prepare(this._settings());this.transport(settings).fail(onError).done(onResponse);function onError(){cb(!0)}
function onResponse(resp){cb(null,that.transform(resp))}},clear:function clear(){this.storage.clear();return this}});return Prefetch}();var Remote=function(){"use strict";function Remote(o){this.url=o.url;this.prepare=o.prepare;this.transform=o.transform;this.transport=new Transport({cache:o.cache,limiter:o.limiter,transport:o.transport})}
_.mixin(Remote.prototype,{_settings:function settings(){return{url:this.url,type:"GET",dataType:"json"}},get:function get(query,cb){var that=this,settings;if(!cb){return}
query=query||"";settings=this.prepare(query,this._settings());return this.transport.get(settings,onResponse);function onResponse(err,resp){err?cb([]):cb(that.transform(resp))}},cancelLastRequest:function cancelLastRequest(){this.transport.cancel()}});return Remote}();var oParser=function(){"use strict";return function parse(o){var defaults,sorter;defaults={initialize:!0,identify:_.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null};o=_.mixin(defaults,o||{});!o.datumTokenizer&&$.error("datumTokenizer is required");!o.queryTokenizer&&$.error("queryTokenizer is required");sorter=o.sorter;o.sorter=sorter?function(x){return x.sort(sorter)}:_.identity;o.local=_.isFunction(o.local)?o.local():o.local;o.prefetch=parsePrefetch(o.prefetch);o.remote=parseRemote(o.remote);return o};function parsePrefetch(o){var defaults;if(!o){return null}
defaults={url:null,ttl:24*60*60*1e3,cache:!0,cacheKey:null,thumbprint:"",prepare:_.identity,transform:_.identity,transport:null};o=_.isString(o)?{url:o}:o;o=_.mixin(defaults,o);!o.url&&$.error("prefetch requires url to be set");o.transform=o.filter||o.transform;o.cacheKey=o.cacheKey||o.url;o.thumbprint=VERSION+o.thumbprint;o.transport=o.transport?callbackToDeferred(o.transport):$.ajax;return o}
function parseRemote(o){var defaults;if(!o){return}
defaults={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:_.identity,transport:null};o=_.isString(o)?{url:o}:o;o=_.mixin(defaults,o);!o.url&&$.error("remote requires url to be set");o.transform=o.filter||o.transform;o.prepare=toRemotePrepare(o);o.limiter=toLimiter(o);o.transport=o.transport?callbackToDeferred(o.transport):$.ajax;delete o.replace;delete o.wildcard;delete o.rateLimitBy;delete o.rateLimitWait;return o}
function toRemotePrepare(o){var prepare,replace,wildcard;prepare=o.prepare;replace=o.replace;wildcard=o.wildcard;if(prepare){return prepare}
if(replace){prepare=prepareByReplace}else if(o.wildcard){prepare=prepareByWildcard}else{prepare=idenityPrepare}
return prepare;function prepareByReplace(query,settings){settings.url=replace(settings.url,query);return settings}
function prepareByWildcard(query,settings){settings.url=settings.url.replace(wildcard,encodeURIComponent(query));return settings}
function idenityPrepare(query,settings){return settings}}
function toLimiter(o){var limiter,method,wait;limiter=o.limiter;method=o.rateLimitBy;wait=o.rateLimitWait;if(!limiter){limiter=/^throttle$/i.test(method)?throttle(wait):debounce(wait)}
return limiter;function debounce(wait){return function debounce(fn){return _.debounce(fn,wait)}}
function throttle(wait){return function throttle(fn){return _.throttle(fn,wait)}}}
function callbackToDeferred(fn){return function wrapper(o){var deferred=$.Deferred();fn(o,onSuccess,onError);return deferred;function onSuccess(resp){_.defer(function(){deferred.resolve(resp)})}
function onError(err){_.defer(function(){deferred.reject(err)})}}}}();var Bloodhound=function(){"use strict";var old;old=window&&window.Bloodhound;function Bloodhound(o){o=oParser(o);this.sorter=o.sorter;this.identify=o.identify;this.sufficient=o.sufficient;this.local=o.local;this.remote=o.remote?new Remote(o.remote):null;this.prefetch=o.prefetch?new Prefetch(o.prefetch):null;this.index=new SearchIndex({identify:this.identify,datumTokenizer:o.datumTokenizer,queryTokenizer:o.queryTokenizer});o.initialize!==!1&&this.initialize()}
Bloodhound.noConflict=function noConflict(){window&&(window.Bloodhound=old);return Bloodhound};Bloodhound.tokenizers=tokenizers;_.mixin(Bloodhound.prototype,{__ttAdapter:function ttAdapter(){var that=this;return this.remote?withAsync:withoutAsync;function withAsync(query,sync,async){return that.search(query,sync,async)}
function withoutAsync(query,sync){return that.search(query,sync)}},_loadPrefetch:function loadPrefetch(){var that=this,deferred,serialized;deferred=$.Deferred();if(!this.prefetch){deferred.resolve()}else if(serialized=this.prefetch.fromCache()){this.index.bootstrap(serialized);deferred.resolve()}else{this.prefetch.fromNetwork(done)}
return deferred.promise();function done(err,data){if(err){return deferred.reject()}
that.add(data);that.prefetch.store(that.index.serialize());deferred.resolve()}},_initialize:function initialize(){var that=this,deferred;this.clear();(this.initPromise=this._loadPrefetch()).done(addLocalToIndex);return this.initPromise;function addLocalToIndex(){that.add(that.local)}},initialize:function initialize(force){return!this.initPromise||force?this._initialize():this.initPromise},add:function add(data){this.index.add(data);return this},get:function get(ids){ids=_.isArray(ids)?ids:[].slice.call(arguments);return this.index.get(ids)},search:function search(query,sync,async){var that=this,local;local=this.sorter(this.index.search(query));sync(this.remote?local.slice():local);if(this.remote&&local.length<this.sufficient){this.remote.get(query,processRemote)}else if(this.remote){this.remote.cancelLastRequest()}
return this;function processRemote(remote){var nonDuplicates=[];_.each(remote,function(r){!_.some(local,function(l){return that.identify(r)===that.identify(l)})&&nonDuplicates.push(r)});async&&async(nonDuplicates)}},all:function all(){return this.index.all()},clear:function clear(){this.index.reset();return this},clearPrefetchCache:function clearPrefetchCache(){this.prefetch&&this.prefetch.clear();return this},clearRemoteCache:function clearRemoteCache(){Transport.resetCache();return this},ttAdapter:function ttAdapter(){return this.__ttAdapter()}});return Bloodhound}();return Bloodhound});(function(root,factory){if(typeof define==="function"&&define.amd){define("typeahead.js",["jquery"],function(a0){return factory(a0)})}else if(typeof exports==="object"){module.exports=factory(require("jquery"))}else{factory(jQuery)}})(this,function($){var _=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(str){return!str||/^\s*$/.test(str)},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(obj){return typeof obj==="string"},isNumber:function(obj){return typeof obj==="number"},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return typeof obj==="undefined"},isElement:function(obj){return!!(obj&&obj.nodeType===1)},isJQuery:function(obj){return obj instanceof $},toStr:function toStr(s){return _.isUndefined(s)||s===null?"":s+""},bind:$.proxy,each:function(collection,cb){$.each(collection,reverseArgs);function reverseArgs(index,value){return cb(value,index)}},map:$.map,filter:$.grep,every:function(obj,test){var result=!0;if(!obj){return result}
$.each(obj,function(key,val){if(!(result=test.call(null,val,key,obj))){return!1}});return!!result},some:function(obj,test){var result=!1;if(!obj){return result}
$.each(obj,function(key,val){if(result=test.call(null,val,key,obj)){return!1}});return!!result},mixin:$.extend,identity:function(x){return x},clone:function(obj){return $.extend(!0,{},obj)},getIdGenerator:function(){var counter=0;return function(){return counter++}},templatify:function templatify(obj){return $.isFunction(obj)?obj:template;function template(){return String(obj)}},defer:function(fn){setTimeout(fn,0)},debounce:function(func,wait,immediate){var timeout,result;return function(){var context=this,args=arguments,later,callNow;later=function(){timeout=null;if(!immediate){result=func.apply(context,args)}};callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args)}
return result}},throttle:function(func,wait){var context,args,timeout,result,previous,later;previous=0;later=function(){previous=new Date();timeout=null;result=func.apply(context,args)};return function(){var now=new Date(),remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0){clearTimeout(timeout);timeout=null;previous=now;result=func.apply(context,args)}else if(!timeout){timeout=setTimeout(later,remaining)}
return result}},stringify:function(val){return _.isString(val)?val:JSON.stringify(val)},noop:function(){}}}();var WWW=function(){"use strict";var defaultClassNames={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return build;function build(o){var www,classes;classes=_.mixin({},defaultClassNames,o);www={css:buildCss(),classes:classes,html:buildHtml(classes),selectors:buildSelectors(classes)};return{css:www.css,html:www.html,classes:www.classes,selectors:www.selectors,mixin:function(o){_.mixin(o,www)}}}
function buildHtml(c){return{wrapper:'<span class="'+c.wrapper+'"></span>',menu:'<div class="'+c.menu+'"></div>'}}
function buildSelectors(classes){var selectors={};_.each(classes,function(v,k){selectors[k]="."+v});return selectors}
function buildCss(){var css={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};if(_.isMsie()){_.mixin(css.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"})}
return css}}();var EventBus=function(){"use strict";var namespace,deprecationMap;namespace="typeahead:";deprecationMap={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"};function EventBus(o){if(!o||!o.el){$.error("EventBus initialized without el")}
this.$el=$(o.el)}
_.mixin(EventBus.prototype,{_trigger:function(type,args){var $e;$e=$.Event(namespace+type);(args=args||[]).unshift($e);this.$el.trigger.apply(this.$el,args);return $e},before:function(type){var args,$e;args=[].slice.call(arguments,1);$e=this._trigger("before"+type,args);return $e.isDefaultPrevented()},trigger:function(type){var deprecatedType;this._trigger(type,[].slice.call(arguments,1));if(deprecatedType=deprecationMap[type]){this._trigger(deprecatedType,[].slice.call(arguments,1))}}});return EventBus}();var EventEmitter=function(){"use strict";var splitter=/\s+/,nextTick=getNextTick();return{onSync:onSync,onAsync:onAsync,off:off,trigger:trigger};function on(method,types,cb,context){var type;if(!cb){return this}
types=types.split(splitter);cb=context?bindContext(cb,context):cb;this._callbacks=this._callbacks||{};while(type=types.shift()){this._callbacks[type]=this._callbacks[type]||{sync:[],async:[]};this._callbacks[type][method].push(cb)}
return this}
function onAsync(types,cb,context){return on.call(this,"async",types,cb,context)}
function onSync(types,cb,context){return on.call(this,"sync",types,cb,context)}
function off(types){var type;if(!this._callbacks){return this}
types=types.split(splitter);while(type=types.shift()){delete this._callbacks[type]}
return this}
function trigger(types){var type,callbacks,args,syncFlush,asyncFlush;if(!this._callbacks){return this}
types=types.split(splitter);args=[].slice.call(arguments,1);while((type=types.shift())&&(callbacks=this._callbacks[type])){syncFlush=getFlush(callbacks.sync,this,[type].concat(args));asyncFlush=getFlush(callbacks.async,this,[type].concat(args));syncFlush()&&nextTick(asyncFlush)}
return this}
function getFlush(callbacks,context,args){return flush;function flush(){var cancelled;for(var i=0,len=callbacks.length;!cancelled&&i<len;i+=1){cancelled=callbacks[i].apply(context,args)===!1}
return!cancelled}}
function getNextTick(){var nextTickFn;if(window.setImmediate){nextTickFn=function nextTickSetImmediate(fn){setImmediate(function(){fn()})}}else{nextTickFn=function nextTickSetTimeout(fn){setTimeout(function(){fn()},0)}}
return nextTickFn}
function bindContext(fn,context){return fn.bind?fn.bind(context):function(){fn.apply(context,[].slice.call(arguments,0))}}}();var highlight=function(doc){"use strict";var defaults={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function hightlight(o){var regex;o=_.mixin({},defaults,o);if(!o.node||!o.pattern){return}
o.pattern=_.isArray(o.pattern)?o.pattern:[o.pattern];regex=getRegex(o.pattern,o.caseSensitive,o.wordsOnly);traverse(o.node,hightlightTextNode);function hightlightTextNode(textNode){var match,patternNode,wrapperNode;if(match=regex.exec(textNode.data)){wrapperNode=doc.createElement(o.tagName);o.className&&(wrapperNode.className=o.className);patternNode=textNode.splitText(match.index);patternNode.splitText(match[0].length);wrapperNode.appendChild(patternNode.cloneNode(!0));textNode.parentNode.replaceChild(wrapperNode,patternNode)}
return!!match}
function traverse(el,hightlightTextNode){var childNode,TEXT_NODE_TYPE=3;for(var i=0;i<el.childNodes.length;i++){childNode=el.childNodes[i];if(childNode.nodeType===TEXT_NODE_TYPE){i+=hightlightTextNode(childNode)?1:0}else{traverse(childNode,hightlightTextNode)}}}};function getRegex(patterns,caseSensitive,wordsOnly){var escapedPatterns=[],regexStr;for(var i=0,len=patterns.length;i<len;i++){escapedPatterns.push(_.escapeRegExChars(patterns[i]))}
regexStr=wordsOnly?"\\b("+escapedPatterns.join("|")+")\\b":"("+escapedPatterns.join("|")+")";return caseSensitive?new RegExp(regexStr):new RegExp(regexStr,"i")}}(window.document);var Input=function(){"use strict";var specialKeyCodeMap;specialKeyCodeMap={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"};function Input(o,www){o=o||{};if(!o.input){$.error("input is missing")}
www.mixin(this);this.$hint=$(o.hint);this.$input=$(o.input);this.query=this.$input.val();this.queryWhenFocused=this.hasFocus()?this.query:null;this.$overflowHelper=buildOverflowHelper(this.$input);this._checkLanguageDirection();if(this.$hint.length===0){this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=_.noop}}
Input.normalizeQuery=function(str){return _.toStr(str).replace(/^\s*/g,"").replace(/\s{2,}/g," ")};_.mixin(Input.prototype,EventEmitter,{_onBlur:function onBlur(){this.resetInputValue();this.trigger("blurred")},_onFocus:function onFocus(){this.queryWhenFocused=this.query;this.trigger("focused")},_onKeydown:function onKeydown($e){var keyName=specialKeyCodeMap[$e.which||$e.keyCode];this._managePreventDefault(keyName,$e);if(keyName&&this._shouldTrigger(keyName,$e)){this.trigger(keyName+"Keyed",$e)}},_onInput:function onInput(){this._setQuery(this.getInputValue());this.clearHintIfInvalid();this._checkLanguageDirection()},_managePreventDefault:function managePreventDefault(keyName,$e){var preventDefault;switch(keyName){case "up":case "down":preventDefault=!withModifier($e);break;default:preventDefault=!1}
preventDefault&&$e.preventDefault()},_shouldTrigger:function shouldTrigger(keyName,$e){var trigger;switch(keyName){case "tab":trigger=!withModifier($e);break;default:trigger=!0}
return trigger},_checkLanguageDirection:function checkLanguageDirection(){var dir=(this.$input.css("direction")||"ltr").toLowerCase();if(this.dir!==dir){this.dir=dir;this.$hint.attr("dir",dir);this.trigger("langDirChanged",dir)}},_setQuery:function setQuery(val,silent){var areEquivalent,hasDifferentWhitespace;areEquivalent=areQueriesEquivalent(val,this.query);hasDifferentWhitespace=areEquivalent?this.query.length!==val.length:!1;this.query=val;if(!silent&&!areEquivalent){this.trigger("queryChanged",this.query)}else if(!silent&&hasDifferentWhitespace){this.trigger("whitespaceChanged",this.query)}},bind:function(){var that=this,onBlur,onFocus,onKeydown,onInput;onBlur=_.bind(this._onBlur,this);onFocus=_.bind(this._onFocus,this);onKeydown=_.bind(this._onKeydown,this);onInput=_.bind(this._onInput,this);this.$input.on("blur.tt",onBlur).on("focus.tt",onFocus).on("keydown.tt",onKeydown);if(!_.isMsie()||_.isMsie()>9){this.$input.on("input.tt",onInput)}else{this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function($e){if(specialKeyCodeMap[$e.which||$e.keyCode]){return}
_.defer(_.bind(that._onInput,that,$e))})}
return this},focus:function focus(){this.$input.focus()},blur:function blur(){this.$input.blur()},getLangDir:function getLangDir(){return this.dir},getQuery:function getQuery(){return this.query||""},setQuery:function setQuery(val,silent){this.setInputValue(val);this._setQuery(val,silent)},hasQueryChangedSinceLastFocus:function hasQueryChangedSinceLastFocus(){return this.query!==this.queryWhenFocused},getInputValue:function getInputValue(){return this.$input.val()},setInputValue:function setInputValue(value){this.$input.val(value);this.clearHintIfInvalid();this._checkLanguageDirection()},resetInputValue:function resetInputValue(){this.setInputValue(this.query)},getHint:function getHint(){return this.$hint.val()},setHint:function setHint(value){this.$hint.val(value)},clearHint:function clearHint(){this.setHint("")},clearHintIfInvalid:function clearHintIfInvalid(){var val,hint,valIsPrefixOfHint,isValid;val=this.getInputValue();hint=this.getHint();valIsPrefixOfHint=val!==hint&&hint.indexOf(val)===0;isValid=val!==""&&valIsPrefixOfHint&&!this.hasOverflow();!isValid&&this.clearHint()},hasFocus:function hasFocus(){return this.$input.is(":focus")},hasOverflow:function hasOverflow(){var constraint=this.$input.width()-2;this.$overflowHelper.text(this.getInputValue());return this.$overflowHelper.width()>=constraint},isCursorAtEnd:function(){var valueLength,selectionStart,range;valueLength=this.$input.val().length;selectionStart=this.$input[0].selectionStart;if(_.isNumber(selectionStart)){return selectionStart===valueLength}else if(document.selection){range=document.selection.createRange();range.moveStart("character",-valueLength);return valueLength===range.text.length}
return!0},destroy:function destroy(){this.$hint.off(".tt");this.$input.off(".tt");this.$overflowHelper.remove();this.$hint=this.$input=this.$overflowHelper=$("<div>")}});return Input;function buildOverflowHelper($input){return $('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:$input.css("font-family"),fontSize:$input.css("font-size"),fontStyle:$input.css("font-style"),fontVariant:$input.css("font-variant"),fontWeight:$input.css("font-weight"),wordSpacing:$input.css("word-spacing"),letterSpacing:$input.css("letter-spacing"),textIndent:$input.css("text-indent"),textRendering:$input.css("text-rendering"),textTransform:$input.css("text-transform")}).insertAfter($input)}
function areQueriesEquivalent(a,b){return Input.normalizeQuery(a)===Input.normalizeQuery(b)}
function withModifier($e){return $e.altKey||$e.ctrlKey||$e.metaKey||$e.shiftKey}}();var Dataset=function(){"use strict";var keys,nameGenerator;keys={val:"tt-selectable-display",obj:"tt-selectable-object"};nameGenerator=_.getIdGenerator();function Dataset(o,www){o=o||{};o.templates=o.templates||{};o.templates.notFound=o.templates.notFound||o.templates.empty;if(!o.source){$.error("missing source")}
if(!o.node){$.error("missing node")}
if(o.name&&!isValidName(o.name)){$.error("invalid dataset name: "+o.name)}
www.mixin(this);this.highlight=!!o.highlight;this.name=o.name||nameGenerator();this.limit=o.limit||5;this.displayFn=getDisplayFn(o.display||o.displayKey);this.templates=getTemplates(o.templates,this.displayFn);this.source=o.source.__ttAdapter?o.source.__ttAdapter():o.source;this.async=_.isUndefined(o.async)?this.source.length>2:!!o.async;this._resetLastSuggestion();this.$el=$(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}
Dataset.extractData=function extractData(el){var $el=$(el);if($el.data(keys.obj)){return{val:$el.data(keys.val)||"",obj:$el.data(keys.obj)||null}}
return null};_.mixin(Dataset.prototype,EventEmitter,{_overwrite:function overwrite(query,suggestions){suggestions=suggestions||[];if(suggestions.length){this._renderSuggestions(query,suggestions)}else if(this.async&&this.templates.pending){this._renderPending(query)}else if(!this.async&&this.templates.notFound){this._renderNotFound(query)}else{this._empty()}
this.trigger("rendered",this.name,suggestions,!1)},_append:function append(query,suggestions){suggestions=suggestions||[];if(suggestions.length&&this.$lastSuggestion.length){this._appendSuggestions(query,suggestions)}else if(suggestions.length){this._renderSuggestions(query,suggestions)}else if(!this.$lastSuggestion.length&&this.templates.notFound){this._renderNotFound(query)}
this.trigger("rendered",this.name,suggestions,!0)},_renderSuggestions:function renderSuggestions(query,suggestions){var $fragment;$fragment=this._getSuggestionsFragment(query,suggestions);this.$lastSuggestion=$fragment.children().last();this.$el.html($fragment).prepend(this._getHeader(query,suggestions)).append(this._getFooter(query,suggestions))},_appendSuggestions:function appendSuggestions(query,suggestions){var $fragment,$lastSuggestion;$fragment=this._getSuggestionsFragment(query,suggestions);$lastSuggestion=$fragment.children().last();this.$lastSuggestion.after($fragment);this.$lastSuggestion=$lastSuggestion},_renderPending:function renderPending(query){var template=this.templates.pending;this._resetLastSuggestion();template&&this.$el.html(template({query:query,dataset:this.name}))},_renderNotFound:function renderNotFound(query){var template=this.templates.notFound;this._resetLastSuggestion();template&&this.$el.html(template({query:query,dataset:this.name}))},_empty:function empty(){this.$el.empty();this._resetLastSuggestion()},_getSuggestionsFragment:function getSuggestionsFragment(query,suggestions){var that=this,fragment;fragment=document.createDocumentFragment();_.each(suggestions,function getSuggestionNode(suggestion){var $el,context;context=that._injectQuery(query,suggestion);$el=$(that.templates.suggestion(context)).data(keys.obj,suggestion).data(keys.val,that.displayFn(suggestion)).addClass(that.classes.suggestion+" "+that.classes.selectable);fragment.appendChild($el[0])});this.highlight&&highlight({className:this.classes.highlight,node:fragment,pattern:query});return $(fragment)},_getFooter:function getFooter(query,suggestions){return this.templates.footer?this.templates.footer({query:query,suggestions:suggestions,dataset:this.name}):null},_getHeader:function getHeader(query,suggestions){return this.templates.header?this.templates.header({query:query,suggestions:suggestions,dataset:this.name}):null},_resetLastSuggestion:function resetLastSuggestion(){this.$lastSuggestion=$()},_injectQuery:function injectQuery(query,obj){return _.isObject(obj)?_.mixin({_query:query},obj):obj},update:function update(query){var that=this,canceled=!1,syncCalled=!1,rendered=0;this.cancel();this.cancel=function cancel(){canceled=!0;that.cancel=$.noop;that.async&&that.trigger("asyncCanceled",query)};this.source(query,sync,async);!syncCalled&&sync([]);function sync(suggestions){if(syncCalled){return}
syncCalled=!0;suggestions=(suggestions||[]).slice(0,that.limit);rendered=suggestions.length;that._overwrite(query,suggestions);if(rendered<that.limit&&that.async){that.trigger("asyncRequested",query)}}
function async(suggestions){suggestions=suggestions||[];if(!canceled&&rendered<that.limit){that.cancel=$.noop;rendered+=suggestions.length;that._append(query,suggestions.slice(0,that.limit-rendered));that.async&&that.trigger("asyncReceived",query)}}},cancel:$.noop,clear:function clear(){this._empty();this.cancel();this.trigger("cleared")},isEmpty:function isEmpty(){return this.$el.is(":empty")},destroy:function destroy(){this.$el=$("<div>")}});return Dataset;function getDisplayFn(display){display=display||_.stringify;return _.isFunction(display)?display:displayFn;function displayFn(obj){return obj[display]}}
function getTemplates(templates,displayFn){return{notFound:templates.notFound&&_.templatify(templates.notFound),pending:templates.pending&&_.templatify(templates.pending),header:templates.header&&_.templatify(templates.header),footer:templates.footer&&_.templatify(templates.footer),suggestion:templates.suggestion||suggestionTemplate};function suggestionTemplate(context){return $("<div>").text(displayFn(context))}}
function isValidName(str){return/^[_a-zA-Z0-9-]+$/.test(str)}}();var Menu=function(){"use strict";function Menu(o,www){var that=this;o=o||{};if(!o.node){$.error("node is required")}
www.mixin(this);this.$node=$(o.node);this.query=null;this.datasets=_.map(o.datasets,initializeDataset);function initializeDataset(oDataset){var node=that.$node.find(oDataset.node).first();oDataset.node=node.length?node:$("<div>").appendTo(that.$node);return new Dataset(oDataset,www)}}
_.mixin(Menu.prototype,EventEmitter,{_onSelectableClick:function onSelectableClick($e){this.trigger("selectableClicked",$($e.currentTarget))},_onRendered:function onRendered(type,dataset,suggestions,async){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty());this.trigger("datasetRendered",dataset,suggestions,async)},_onCleared:function onCleared(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty());this.trigger("datasetCleared")},_propagate:function propagate(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function allDatasetsEmpty(){return _.every(this.datasets,isDatasetEmpty);function isDatasetEmpty(dataset){return dataset.isEmpty()}},_getSelectables:function getSelectables(){return this.$node.find(this.selectors.selectable)},_removeCursor:function _removeCursor(){var $selectable=this.getActiveSelectable();$selectable&&$selectable.removeClass(this.classes.cursor)},_ensureVisible:function ensureVisible($el){var elTop,elBottom,nodeScrollTop,nodeHeight;elTop=$el.position().top;elBottom=elTop+$el.outerHeight(!0);nodeScrollTop=this.$node.scrollTop();nodeHeight=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10);if(elTop<0){this.$node.scrollTop(nodeScrollTop+elTop)}else if(nodeHeight<elBottom){this.$node.scrollTop(nodeScrollTop+(elBottom-nodeHeight))}},bind:function(){var that=this,onSelectableClick;onSelectableClick=_.bind(this._onSelectableClick,this);this.$node.on("click.tt",this.selectors.selectable,onSelectableClick);_.each(this.datasets,function(dataset){dataset.onSync("asyncRequested",that._propagate,that).onSync("asyncCanceled",that._propagate,that).onSync("asyncReceived",that._propagate,that).onSync("rendered",that._onRendered,that).onSync("cleared",that._onCleared,that)});return this},isOpen:function isOpen(){return this.$node.hasClass(this.classes.open)},open:function open(){this.$node.addClass(this.classes.open)},close:function close(){this.$node.removeClass(this.classes.open);this._removeCursor()},setLanguageDirection:function setLanguageDirection(dir){this.$node.attr("dir",dir)},selectableRelativeToCursor:function selectableRelativeToCursor(delta){var $selectables,$oldCursor,oldIndex,newIndex;$oldCursor=this.getActiveSelectable();$selectables=this._getSelectables();oldIndex=$oldCursor?$selectables.index($oldCursor):-1;newIndex=oldIndex+delta;newIndex=(newIndex+1)%($selectables.length+1)-1;newIndex=newIndex<-1?$selectables.length-1:newIndex;return newIndex===-1?null:$selectables.eq(newIndex)},setCursor:function setCursor($selectable){this._removeCursor();if($selectable=$selectable&&$selectable.first()){$selectable.addClass(this.classes.cursor);this._ensureVisible($selectable)}},getSelectableData:function getSelectableData($el){return $el&&$el.length?Dataset.extractData($el):null},getActiveSelectable:function getActiveSelectable(){var $selectable=this._getSelectables().filter(this.selectors.cursor).first();return $selectable.length?$selectable:null},getTopSelectable:function getTopSelectable(){var $selectable=this._getSelectables().first();return $selectable.length?$selectable:null},update:function update(query){var isValidUpdate=query!==this.query;if(isValidUpdate){this.query=query;_.each(this.datasets,updateDataset)}
return isValidUpdate;function updateDataset(dataset){dataset.update(query)}},empty:function empty(){_.each(this.datasets,clearDataset);this.query=null;this.$node.addClass(this.classes.empty);function clearDataset(dataset){dataset.clear()}},destroy:function destroy(){this.$node.off(".tt");this.$node=$("<div>");_.each(this.datasets,destroyDataset);function destroyDataset(dataset){dataset.destroy()}}});return Menu}();var DefaultMenu=function(){"use strict";var s=Menu.prototype;function DefaultMenu(){Menu.apply(this,[].slice.call(arguments,0))}
_.mixin(DefaultMenu.prototype,Menu.prototype,{open:function open(){!this._allDatasetsEmpty()&&this._show();return s.open.apply(this,[].slice.call(arguments,0))},close:function close(){this._hide();return s.close.apply(this,[].slice.call(arguments,0))},_onRendered:function onRendered(){if(this._allDatasetsEmpty()){this._hide()}else{this.isOpen()&&this._show()}
return s._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function onCleared(){if(this._allDatasetsEmpty()){this._hide()}else{this.isOpen()&&this._show()}
return s._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function setLanguageDirection(dir){this.$node.css(dir==="ltr"?this.css.ltr:this.css.rtl);return s.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function hide(){this.$node.hide()},_show:function show(){this.$node.css("display","block")}});return DefaultMenu}();var Typeahead=function(){"use strict";function Typeahead(o,www){var onFocused,onBlurred,onEnterKeyed,onTabKeyed,onEscKeyed,onUpKeyed,onDownKeyed,onLeftKeyed,onRightKeyed,onQueryChanged,onWhitespaceChanged;o=o||{};if(!o.input){$.error("missing input")}
if(!o.menu){$.error("missing menu")}
if(!o.eventBus){$.error("missing event bus")}
www.mixin(this);this.eventBus=o.eventBus;this.minLength=_.isNumber(o.minLength)?o.minLength:1;this.input=o.input;this.menu=o.menu;this.enabled=!0;this.active=!1;this.input.hasFocus()&&this.activate();this.dir=this.input.getLangDir();this._hacks();this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this);onFocused=c(this,"activate","open","_onFocused");onBlurred=c(this,"deactivate","_onBlurred");onEnterKeyed=c(this,"isActive","isOpen","_onEnterKeyed");onTabKeyed=c(this,"isActive","isOpen","_onTabKeyed");onEscKeyed=c(this,"isActive","_onEscKeyed");onUpKeyed=c(this,"isActive","open","_onUpKeyed");onDownKeyed=c(this,"isActive","open","_onDownKeyed");onLeftKeyed=c(this,"isActive","isOpen","_onLeftKeyed");onRightKeyed=c(this,"isActive","isOpen","_onRightKeyed");onQueryChanged=c(this,"_openIfActive","_onQueryChanged");onWhitespaceChanged=c(this,"_openIfActive","_onWhitespaceChanged");this.input.bind().onSync("focused",onFocused,this).onSync("blurred",onBlurred,this).onSync("enterKeyed",onEnterKeyed,this).onSync("tabKeyed",onTabKeyed,this).onSync("escKeyed",onEscKeyed,this).onSync("upKeyed",onUpKeyed,this).onSync("downKeyed",onDownKeyed,this).onSync("leftKeyed",onLeftKeyed,this).onSync("rightKeyed",onRightKeyed,this).onSync("queryChanged",onQueryChanged,this).onSync("whitespaceChanged",onWhitespaceChanged,this).onSync("langDirChanged",this._onLangDirChanged,this)}
_.mixin(Typeahead.prototype,{_hacks:function hacks(){var $input,$menu;$input=this.input.$input||$("<div>");$menu=this.menu.$node||$("<div>");$input.on("blur.tt",function($e){var active,isActive,hasActive;active=document.activeElement;isActive=$menu.is(active);hasActive=$menu.has(active).length>0;if(_.isMsie()&&(isActive||hasActive)){$e.preventDefault();$e.stopImmediatePropagation();_.defer(function(){$input.focus()})}});$menu.on("mousedown.tt",function($e){$e.preventDefault()})},_onSelectableClicked:function onSelectableClicked(type,$el){this.select($el)},_onDatasetCleared:function onDatasetCleared(){this._updateHint()},_onDatasetRendered:function onDatasetRendered(type,dataset,suggestions,async){this._updateHint();this.eventBus.trigger("render",suggestions,async,dataset)},_onAsyncRequested:function onAsyncRequested(type,dataset,query){this.eventBus.trigger("asyncrequest",query,dataset)},_onAsyncCanceled:function onAsyncCanceled(type,dataset,query){this.eventBus.trigger("asynccancel",query,dataset)},_onAsyncReceived:function onAsyncReceived(type,dataset,query){this.eventBus.trigger("asyncreceive",query,dataset)},_onFocused:function onFocused(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function onBlurred(){if(this.input.hasQueryChangedSinceLastFocus()){this.eventBus.trigger("change",this.input.getQuery())}},_onEnterKeyed:function onEnterKeyed(type,$e){var $selectable;if($selectable=this.menu.getActiveSelectable()){this.select($selectable)&&$e.preventDefault()}},_onTabKeyed:function onTabKeyed(type,$e){var $selectable;if($selectable=this.menu.getActiveSelectable()){this.select($selectable)&&$e.preventDefault()}else if($selectable=this.menu.getTopSelectable()){this.autocomplete($selectable)&&$e.preventDefault()}},_onEscKeyed:function onEscKeyed(){this.close()},_onUpKeyed:function onUpKeyed(){this.moveCursor(-1)},_onDownKeyed:function onDownKeyed(){this.moveCursor(+1)},_onLeftKeyed:function onLeftKeyed(){if(this.dir==="rtl"&&this.input.isCursorAtEnd()){this.autocomplete(this.menu.getTopSelectable())}},_onRightKeyed:function onRightKeyed(){if(this.dir==="ltr"&&this.input.isCursorAtEnd()){this.autocomplete(this.menu.getTopSelectable())}},_onQueryChanged:function onQueryChanged(e,query){this._minLengthMet(query)?this.menu.update(query):this.menu.empty()},_onWhitespaceChanged:function onWhitespaceChanged(){this._updateHint()},_onLangDirChanged:function onLangDirChanged(e,dir){if(this.dir!==dir){this.dir=dir;this.menu.setLanguageDirection(dir)}},_openIfActive:function openIfActive(){this.isActive()&&this.open()},_minLengthMet:function minLengthMet(query){query=_.isString(query)?query:this.input.getQuery()||"";return query.length>=this.minLength},_updateHint:function updateHint(){var $selectable,data,val,query,escapedQuery,frontMatchRegEx,match;$selectable=this.menu.getTopSelectable();data=this.menu.getSelectableData($selectable);val=this.input.getInputValue();if(data&&!_.isBlankString(val)&&!this.input.hasOverflow()){query=Input.normalizeQuery(val);escapedQuery=_.escapeRegExChars(query);frontMatchRegEx=new RegExp("^(?:"+escapedQuery+")(.+$)","i");match=frontMatchRegEx.exec(data.val);match&&this.input.setHint(val+match[1])}else{this.input.clearHint()}},isEnabled:function isEnabled(){return this.enabled},enable:function enable(){this.enabled=!0},disable:function disable(){this.enabled=!1},isActive:function isActive(){return this.active},activate:function activate(){if(this.isActive()){return!0}else if(!this.isEnabled()||this.eventBus.before("active")){return!1}else{this.active=!0;this.eventBus.trigger("active");return!0}},deactivate:function deactivate(){if(!this.isActive()){return!0}else if(this.eventBus.before("idle")){return!1}else{this.active=!1;this.close();this.eventBus.trigger("idle");return!0}},isOpen:function isOpen(){return this.menu.isOpen()},open:function open(){if(!this.isOpen()&&!this.eventBus.before("open")){this.menu.open();this._updateHint();this.eventBus.trigger("open")}
return this.isOpen()},close:function close(){if(this.isOpen()&&!this.eventBus.before("close")){this.menu.close();this.input.clearHint();this.input.resetInputValue();this.eventBus.trigger("close")}
return!this.isOpen()},setVal:function setVal(val){this.input.setQuery(_.toStr(val))},getVal:function getVal(){return this.input.getQuery()},select:function select($selectable){var data=this.menu.getSelectableData($selectable);if(data&&!this.eventBus.before("select",data.obj)){this.input.setQuery(data.val,!0);this.eventBus.trigger("select",data.obj);this.close();return!0}
return!1},autocomplete:function autocomplete($selectable){var query,data,isValid;query=this.input.getQuery();data=this.menu.getSelectableData($selectable);isValid=data&&query!==data.val;if(isValid&&!this.eventBus.before("autocomplete",data.obj)){this.input.setQuery(data.val);this.eventBus.trigger("autocomplete",data.obj);return!0}
return!1},moveCursor:function moveCursor(delta){var query,$candidate,data,payload,cancelMove;query=this.input.getQuery();$candidate=this.menu.selectableRelativeToCursor(delta);data=this.menu.getSelectableData($candidate);payload=data?data.obj:null;cancelMove=this._minLengthMet()&&this.menu.update(query);if(!cancelMove&&!this.eventBus.before("cursorchange",payload)){this.menu.setCursor($candidate);if(data){this.input.setInputValue(data.val)}else{this.input.resetInputValue();this._updateHint()}
this.eventBus.trigger("cursorchange",payload);return!0}
return!1},destroy:function destroy(){this.input.destroy();this.menu.destroy()}});return Typeahead;function c(ctx){var methods=[].slice.call(arguments,1);return function(){var args=[].slice.call(arguments);_.each(methods,function(method){return ctx[method].apply(ctx,args)})}}}();(function(){"use strict";var old,keys,methods;old=$.fn.typeahead;keys={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"};methods={initialize:function initialize(o,datasets){var www;datasets=_.isArray(datasets)?datasets:[].slice.call(arguments,1);o=o||{};www=WWW(o.classNames);return this.each(attach);function attach(){var $input,$wrapper,$hint,$menu,defaultHint,defaultMenu,eventBus,input,menu,typeahead,MenuConstructor;_.each(datasets,function(d){d.highlight=!!o.highlight});$input=$(this);$wrapper=$(www.html.wrapper);$hint=$elOrNull(o.hint);$menu=$elOrNull(o.menu);defaultHint=o.hint!==!1&&!$hint;defaultMenu=o.menu!==!1&&!$menu;defaultHint&&($hint=buildHintFromInput($input,www));defaultMenu&&($menu=$(www.html.menu).css(www.css.menu));$hint&&$hint.val("");$input=prepInput($input,www);if(defaultHint||defaultMenu){$wrapper.css(www.css.wrapper);$input.css(defaultHint?www.css.input:www.css.inputWithNoHint);$input.wrap($wrapper).parent().prepend(defaultHint?$hint:null).append(defaultMenu?$menu:null)}
MenuConstructor=defaultMenu?DefaultMenu:Menu;eventBus=new EventBus({el:$input});input=new Input({hint:$hint,input:$input},www);menu=new MenuConstructor({node:$menu,datasets:datasets},www);typeahead=new Typeahead({input:input,menu:menu,eventBus:eventBus,minLength:o.minLength},www);$input.data(keys.www,www);$input.data(keys.typeahead,typeahead)}},isEnabled:function isEnabled(){var enabled;ttEach(this.first(),function(t){enabled=t.isEnabled()});return enabled},enable:function enable(){ttEach(this,function(t){t.enable()});return this},disable:function disable(){ttEach(this,function(t){t.disable()});return this},isActive:function isActive(){var active;ttEach(this.first(),function(t){active=t.isActive()});return active},activate:function activate(){ttEach(this,function(t){t.activate()});return this},deactivate:function deactivate(){ttEach(this,function(t){t.deactivate()});return this},isOpen:function isOpen(){var open;ttEach(this.first(),function(t){open=t.isOpen()});return open},open:function open(){ttEach(this,function(t){t.open()});return this},close:function close(){ttEach(this,function(t){t.close()});return this},select:function select(el){var success=!1,$el=$(el);ttEach(this.first(),function(t){success=t.select($el)});return success},autocomplete:function autocomplete(el){var success=!1,$el=$(el);ttEach(this.first(),function(t){success=t.autocomplete($el)});return success},moveCursor:function moveCursoe(delta){var success=!1;ttEach(this.first(),function(t){success=t.moveCursor(delta)});return success},val:function val(newVal){var query;if(!arguments.length){ttEach(this.first(),function(t){query=t.getVal()});return query}else{ttEach(this,function(t){t.setVal(newVal)});return this}},destroy:function destroy(){ttEach(this,function(typeahead,$input){revert($input);typeahead.destroy()});return this}};$.fn.typeahead=function(method){if(methods[method]){return methods[method].apply(this,[].slice.call(arguments,1))}else{return methods.initialize.apply(this,arguments)}};$.fn.typeahead.noConflict=function noConflict(){$.fn.typeahead=old;return this};function ttEach($els,fn){$els.each(function(){var $input=$(this),typeahead;(typeahead=$input.data(keys.typeahead))&&fn(typeahead,$input)})}
function buildHintFromInput($input,www){return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}
function prepInput($input,www){$input.data(keys.attrs,{dir:$input.attr("dir"),autocomplete:$input.attr("autocomplete"),spellcheck:$input.attr("spellcheck"),style:$input.attr("style")});$input.addClass(www.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!$input.attr("dir")&&$input.attr("dir","auto")}catch(e){}
return $input}
function getBackgroundStyles($el){return{backgroundAttachment:$el.css("background-attachment"),backgroundClip:$el.css("background-clip"),backgroundColor:$el.css("background-color"),backgroundImage:$el.css("background-image"),backgroundOrigin:$el.css("background-origin"),backgroundPosition:$el.css("background-position"),backgroundRepeat:$el.css("background-repeat"),backgroundSize:$el.css("background-size")}}
function revert($input){var www,$wrapper;www=$input.data(keys.www);$wrapper=$input.parent().filter(www.selectors.wrapper);_.each($input.data(keys.attrs),function(val,key){_.isUndefined(val)?$input.removeAttr(key):$input.attr(key,val)});$input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input);if($wrapper.length){$input.detach().insertAfter($wrapper);$wrapper.remove()}}
function $elOrNull(obj){var isValid,$el;isValid=_.isJQuery(obj)||_.isElement(obj);$el=isValid?$(obj).first():[];return $el.length?$el:null}})()});/*!
 * @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2016
 * @version 1.3.4
 *
 * Date formatter utility library that allows formatting date/time variables or Date objects using PHP DateTime format.
 * @see http://php.net/manual/en/function.date.php
 *
 * For more JQuery plugins visit http://plugins.krajee.com
 * For more Yii related demos visit http://demos.krajee.com
 */var DateFormatter;!function(){"use strict";var t,e,r,n,a,u,i;u=864e5,i=3600,t=function(t,e){return"string"==typeof t&&"string"==typeof e&&t.toLowerCase()===e.toLowerCase()},e=function(t,r,n){var a=n||"0",u=t.toString();return u.length<r?e(a+u,r):u},r=function(t){var e,n;for(t=t||{},e=1;e<arguments.length;e++)if(n=arguments[e])for(var a in n)n.hasOwnProperty(a)&&("object"==typeof n[a]?r(t[a],n[a]):t[a]=n[a]);return t},n=function(t,e){for(var r=0;r<e.length;r++)if(e[r].toLowerCase()===t.toLowerCase())return r;return-1},a={dateSettings:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["AM","PM"],ordinal:function(t){var e=t%10,r={1:"st",2:"nd",3:"rd"};return 1!==Math.floor(t%100/10)&&r[e]?r[e]:"th"}},separators:/[ \-+\/\.T:@]/g,validParts:/[dDjlNSwzWFmMntLoYyaABgGhHisueTIOPZcrU]/g,intParts:/[djwNzmnyYhHgGis]/g,tzParts:/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,tzClip:/[^-+\dA-Z]/g},DateFormatter=function(t){var e=this,n=r(a,t);e.dateSettings=n.dateSettings,e.separators=n.separators,e.validParts=n.validParts,e.intParts=n.intParts,e.tzParts=n.tzParts,e.tzClip=n.tzClip},DateFormatter.prototype={constructor:DateFormatter,getMonth:function(t){var e,r=this;return e=n(t,r.dateSettings.monthsShort)+1,0===e&&(e=n(t,r.dateSettings.months)+1),e},parseDate:function(e,r){var n,a,u,i,s,o,c,f,l,h,d=this,g=!1,m=!1,p=d.dateSettings,y={date:null,year:null,month:null,day:null,hour:0,min:0,sec:0};if(!e)return null;if(e instanceof Date)return e;if("U"===r)return u=parseInt(e),u?new Date(1e3*u):e;switch(typeof e){case"number":return new Date(e);case"string":break;default:return null}if(n=r.match(d.validParts),!n||0===n.length)throw new Error("Invalid date format definition.");for(a=e.replace(d.separators,"\x00").split("\x00"),u=0;u<a.length;u++)switch(i=a[u],s=parseInt(i),n[u]){case"y":case"Y":if(!s)return null;l=i.length,y.year=2===l?parseInt((70>s?"20":"19")+i):s,g=!0;break;case"m":case"n":case"M":case"F":if(isNaN(s)){if(o=d.getMonth(i),!(o>0))return null;y.month=o}else{if(!(s>=1&&12>=s))return null;y.month=s}g=!0;break;case"d":case"j":if(!(s>=1&&31>=s))return null;y.day=s,g=!0;break;case"g":case"h":if(c=n.indexOf("a")>-1?n.indexOf("a"):n.indexOf("A")>-1?n.indexOf("A"):-1,h=a[c],c>-1)f=t(h,p.meridiem[0])?0:t(h,p.meridiem[1])?12:-1,s>=1&&12>=s&&f>-1?y.hour=s+f-1:s>=0&&23>=s&&(y.hour=s);else{if(!(s>=0&&23>=s))return null;y.hour=s}m=!0;break;case"G":case"H":if(!(s>=0&&23>=s))return null;y.hour=s,m=!0;break;case"i":if(!(s>=0&&59>=s))return null;y.min=s,m=!0;break;case"s":if(!(s>=0&&59>=s))return null;y.sec=s,m=!0}if(g===!0&&y.year&&y.month&&y.day)y.date=new Date(y.year,y.month-1,y.day,y.hour,y.min,y.sec,0);else{if(m!==!0)return null;y.date=new Date(0,0,0,y.hour,y.min,y.sec,0)}return y.date},guessDate:function(t,e){if("string"!=typeof t)return t;var r,n,a,u,i,s,o=this,c=t.replace(o.separators,"\x00").split("\x00"),f=/^[djmn]/g,l=e.match(o.validParts),h=new Date,d=0;if(!f.test(l[0]))return t;for(a=0;a<c.length;a++){if(d=2,i=c[a],s=parseInt(i.substr(0,2)),isNaN(s))return null;switch(a){case 0:"m"===l[0]||"n"===l[0]?h.setMonth(s-1):h.setDate(s);break;case 1:"m"===l[0]||"n"===l[0]?h.setDate(s):h.setMonth(s-1);break;case 2:if(n=h.getFullYear(),r=i.length,d=4>r?r:4,n=parseInt(4>r?n.toString().substr(0,4-r)+i:i.substr(0,4)),!n)return null;h.setFullYear(n);break;case 3:h.setHours(s);break;case 4:h.setMinutes(s);break;case 5:h.setSeconds(s)}u=i.substr(d),u.length>0&&c.splice(a+1,0,u)}return h},parseFormat:function(t,r){var n,a=this,s=a.dateSettings,o=/\\?(.?)/gi,c=function(t,e){return n[t]?n[t]():e};return n={d:function(){return e(n.j(),2)},D:function(){return s.daysShort[n.w()]},j:function(){return r.getDate()},l:function(){return s.days[n.w()]},N:function(){return n.w()||7},w:function(){return r.getDay()},z:function(){var t=new Date(n.Y(),n.n()-1,n.j()),e=new Date(n.Y(),0,1);return Math.round((t-e)/u)},W:function(){var t=new Date(n.Y(),n.n()-1,n.j()-n.N()+3),r=new Date(t.getFullYear(),0,4);return e(1+Math.round((t-r)/u/7),2)},F:function(){return s.months[r.getMonth()]},m:function(){return e(n.n(),2)},M:function(){return s.monthsShort[r.getMonth()]},n:function(){return r.getMonth()+1},t:function(){return new Date(n.Y(),n.n(),0).getDate()},L:function(){var t=n.Y();return t%4===0&&t%100!==0||t%400===0?1:0},o:function(){var t=n.n(),e=n.W(),r=n.Y();return r+(12===t&&9>e?1:1===t&&e>9?-1:0)},Y:function(){return r.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return n.A().toLowerCase()},A:function(){var t=n.G()<12?0:1;return s.meridiem[t]},B:function(){var t=r.getUTCHours()*i,n=60*r.getUTCMinutes(),a=r.getUTCSeconds();return e(Math.floor((t+n+a+i)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return r.getHours()},h:function(){return e(n.g(),2)},H:function(){return e(n.G(),2)},i:function(){return e(r.getMinutes(),2)},s:function(){return e(r.getSeconds(),2)},u:function(){return e(1e3*r.getMilliseconds(),6)},e:function(){var t=/\((.*)\)/.exec(String(r))[1];return t||"Coordinated Universal Time"},I:function(){var t=new Date(n.Y(),0),e=Date.UTC(n.Y(),0),r=new Date(n.Y(),6),a=Date.UTC(n.Y(),6);return t-e!==r-a?1:0},O:function(){var t=r.getTimezoneOffset(),n=Math.abs(t);return(t>0?"-":"+")+e(100*Math.floor(n/60)+n%60,4)},P:function(){var t=n.O();return t.substr(0,3)+":"+t.substr(3,2)},T:function(){var t=(String(r).match(a.tzParts)||[""]).pop().replace(a.tzClip,"");return t||"UTC"},Z:function(){return 60*-r.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(o,c)},r:function(){return"D, d M Y H:i:s O".replace(o,c)},U:function(){return r.getTime()/1e3||0}},c(t,t)},formatDate:function(t,e){var r,n,a,u,i,s=this,o="",c="\\";if("string"==typeof t&&(t=s.parseDate(t,e),!t))return null;if(t instanceof Date){for(a=e.length,r=0;a>r;r++)i=e.charAt(r),"S"!==i&&i!==c&&(r>0&&e.charAt(r-1)===c?o+=i:(u=s.parseFormat(i,t),r!==a-1&&s.intParts.test(i)&&"S"===e.charAt(r+1)&&(n=parseInt(u)||0,u+=s.dateSettings.ordinal(n)),o+=u));return o}return""}}}();/**
 * @preserve jQuery DateTimePicker
 * @homepage http://xdsoft.net/jqplugins/datetimepicker/
 * @author Chupurnov Valeriy (<chupurnov@gmail.com>)
 */
var datetimepickerFactory=function($){'use strict';var default_options={i18n:{ar:{months:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],dayOfWeekShort:["ن","ث","ع","خ","ج","س","ح"],dayOfWeek:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"]},ro:{months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],dayOfWeekShort:["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],dayOfWeek:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă"]},id:{months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],dayOfWeekShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],dayOfWeek:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},is:{months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],dayOfWeekShort:["Sun","Mán","Þrið","Mið","Fim","Fös","Lau"],dayOfWeek:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur"]},bg:{months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],dayOfWeekShort:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],dayOfWeek:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота"]},fa:{months:['فروردین','اردیبهشت','خرداد','تیر','مرداد','شهریور','مهر','آبان','آذر','دی','بهمن','اسفند'],dayOfWeekShort:['یکشنبه','دوشنبه','سه شنبه','چهارشنبه','پنجشنبه','جمعه','شنبه'],dayOfWeek:["یک‌شنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنج‌شنبه","جمعه","شنبه","یک‌شنبه"]},ru:{months:['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],dayOfWeekShort:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],dayOfWeek:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"]},uk:{months:['Січень','Лютий','Березень','Квітень','Травень','Червень','Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'],dayOfWeekShort:["Ндл","Пнд","Втр","Срд","Чтв","Птн","Сбт"],dayOfWeek:["Неділя","Понеділок","Вівторок","Середа","Четвер","П'ятниця","Субота"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},el:{months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],dayOfWeekShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],dayOfWeek:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"]},de:{months:['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],dayOfWeekShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayOfWeek:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},nl:{months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],dayOfWeekShort:["zo","ma","di","wo","do","vr","za"],dayOfWeek:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},tr:{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],dayOfWeekShort:["Paz","Pts","Sal","Çar","Per","Cum","Cts"],dayOfWeek:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayOfWeekShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],dayOfWeek:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayOfWeekShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],dayOfWeek:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"]},th:{months:['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],dayOfWeekShort:['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],dayOfWeek:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"]},pl:{months:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],dayOfWeekShort:["nd","pn","wt","śr","cz","pt","sb"],dayOfWeek:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},pt:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},ch:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"]},se:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},km:{months:["មករា​","កុម្ភៈ","មិនា​","មេសា​","ឧសភា​","មិថុនា​","កក្កដា​","សីហា​","កញ្ញា​","តុលា​","វិច្ឆិកា","ធ្នូ​"],dayOfWeekShort:["អាទិ​","ច័ន្ទ​","អង្គារ​","ពុធ​","ព្រហ​​","សុក្រ​","សៅរ៍"],dayOfWeek:["អាទិត្យ​","ច័ន្ទ​","អង្គារ​","ពុធ​","ព្រហស្បតិ៍​","សុក្រ​","សៅរ៍"]},kr:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeekShort:["일","월","화","수","목","금","토"],dayOfWeek:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dayOfWeek:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"]},da:{months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag']},ja:{months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeekShort:["日","月","火","水","木","金","土"],dayOfWeek:["日曜","月曜","火曜","水曜","木曜","金曜","土曜"]},vi:{months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],dayOfWeekShort:["CN","T2","T3","T4","T5","T6","T7"],dayOfWeek:["Chủ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu","Thứ bảy"]},sl:{months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],dayOfWeekShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"],dayOfWeek:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"]},cs:{months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],dayOfWeekShort:["Ne","Po","Út","St","Čt","Pá","So"]},hu:{months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],dayOfWeekShort:["Va","Hé","Ke","Sze","Cs","Pé","Szo"],dayOfWeek:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"]},az:{months:["Yanvar","Fevral","Mart","Aprel","May","Iyun","Iyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],dayOfWeekShort:["B","Be","Ça","Ç","Ca","C","Ş"],dayOfWeek:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"]},bs:{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},ca:{months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],dayOfWeekShort:["Dg","Dl","Dt","Dc","Dj","Dv","Ds"],dayOfWeek:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"]},'en-GB':{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},et:{months:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],dayOfWeekShort:["P","E","T","K","N","R","L"],dayOfWeek:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev"]},eu:{months:["Urtarrila","Otsaila","Martxoa","Apirila","Maiatza","Ekaina","Uztaila","Abuztua","Iraila","Urria","Azaroa","Abendua"],dayOfWeekShort:["Ig.","Al.","Ar.","Az.","Og.","Or.","La."],dayOfWeek:['Igandea','Astelehena','Asteartea','Asteazkena','Osteguna','Ostirala','Larunbata']},fi:{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],dayOfWeekShort:["Su","Ma","Ti","Ke","To","Pe","La"],dayOfWeek:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"]},gl:{months:["Xan","Feb","Maz","Abr","Mai","Xun","Xul","Ago","Set","Out","Nov","Dec"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Xov","Ven","Sab"],dayOfWeek:["Domingo","Luns","Martes","Mércores","Xoves","Venres","Sábado"]},hr:{months:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],dayOfWeekShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},ko:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeekShort:["일","월","화","수","목","금","토"],dayOfWeek:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},lt:{months:["Sausio","Vasario","Kovo","Balandžio","Gegužės","Birželio","Liepos","Rugpjūčio","Rugsėjo","Spalio","Lapkričio","Gruodžio"],dayOfWeekShort:["Sek","Pir","Ant","Tre","Ket","Pen","Šeš"],dayOfWeek:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis"]},lv:{months:["Janvāris","Februāris","Marts","Aprīlis ","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],dayOfWeekShort:["Sv","Pr","Ot","Tr","Ct","Pk","St"],dayOfWeek:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena"]},mk:{months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],dayOfWeekShort:["нед","пон","вто","сре","чет","пет","саб"],dayOfWeek:["Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота"]},mn:{months:["1-р сар","2-р сар","3-р сар","4-р сар","5-р сар","6-р сар","7-р сар","8-р сар","9-р сар","10-р сар","11-р сар","12-р сар"],dayOfWeekShort:["Дав","Мяг","Лха","Пүр","Бсн","Бям","Ням"],dayOfWeek:["Даваа","Мягмар","Лхагва","Пүрэв","Баасан","Бямба","Ням"]},'pt-BR':{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},sk:{months:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],dayOfWeekShort:["Ne","Po","Ut","St","Št","Pi","So"],dayOfWeek:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"]},sq:{months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],dayOfWeekShort:["Die","Hën","Mar","Mër","Enj","Pre","Shtu"],dayOfWeek:["E Diel","E Hënë","E Martē","E Mërkurë","E Enjte","E Premte","E Shtunë"]},'sr-YU':{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sre","čet","Pet","Sub"],dayOfWeek:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota"]},sr:{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],dayOfWeekShort:["нед","пон","уто","сре","чет","пет","суб"],dayOfWeek:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота"]},sv:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"],dayOfWeek:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"]},'zh-TW':{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},zh:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},ug:{months:["1-ئاي","2-ئاي","3-ئاي","4-ئاي","5-ئاي","6-ئاي","7-ئاي","8-ئاي","9-ئاي","10-ئاي","11-ئاي","12-ئاي"],dayOfWeek:["يەكشەنبە","دۈشەنبە","سەيشەنبە","چارشەنبە","پەيشەنبە","جۈمە","شەنبە"]},he:{months:['ינואר','פברואר','מרץ','אפריל','מאי','יוני','יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],dayOfWeekShort:['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],dayOfWeek:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת","ראשון"]},hy:{months:["Հունվար","Փետրվար","Մարտ","Ապրիլ","Մայիս","Հունիս","Հուլիս","Օգոստոս","Սեպտեմբեր","Հոկտեմբեր","Նոյեմբեր","Դեկտեմբեր"],dayOfWeekShort:["Կի","Երկ","Երք","Չոր","Հնգ","Ուրբ","Շբթ"],dayOfWeek:["Կիրակի","Երկուշաբթի","Երեքշաբթի","Չորեքշաբթի","Հինգշաբթի","Ուրբաթ","Շաբաթ"]},kg:{months:['Үчтүн айы','Бирдин айы','Жалган Куран','Чын Куран','Бугу','Кулжа','Теке','Баш Оона','Аяк Оона','Тогуздун айы','Жетинин айы','Бештин айы'],dayOfWeekShort:["Жек","Дүй","Шей","Шар","Бей","Жум","Ише"],dayOfWeek:["Жекшемб","Дүйшөмб","Шейшемб","Шаршемб","Бейшемби","Жума","Ишенб"]},rm:{months:["Schaner","Favrer","Mars","Avrigl","Matg","Zercladur","Fanadur","Avust","Settember","October","November","December"],dayOfWeekShort:["Du","Gli","Ma","Me","Gie","Ve","So"],dayOfWeek:["Dumengia","Glindesdi","Mardi","Mesemna","Gievgia","Venderdi","Sonda"]},ka:{months:['იანვარი','თებერვალი','მარტი','აპრილი','მაისი','ივნისი','ივლისი','აგვისტო','სექტემბერი','ოქტომბერი','ნოემბერი','დეკემბერი'],dayOfWeekShort:["კვ","ორშ","სამშ","ოთხ","ხუთ","პარ","შაბ"],dayOfWeek:["კვირა","ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი"]}},ownerDocument:document,contentWindow:window,value:'',rtl:!1,format:'Y/m/d H:i',formatTime:'H:i',formatDate:'Y/m/d',startDate:!1,step:60,monthChangeSpinner:!0,closeOnDateSelect:!1,closeOnTimeSelect:!0,closeOnWithoutClick:!0,closeOnInputClick:!0,openOnFocus:!0,timepicker:!0,datepicker:!0,weeks:!1,defaultTime:!1,defaultDate:!1,minDate:!1,maxDate:!1,minTime:!1,maxTime:!1,minDateTime:!1,maxDateTime:!1,allowTimes:[],opened:!1,initTime:!0,inline:!1,theme:'',touchMovedThreshold:5,onSelectDate:function(){},onSelectTime:function(){},onChangeMonth:function(){},onGetWeekOfYear:function(){},onChangeYear:function(){},onChangeDateTime:function(){},onShow:function(){},onClose:function(){},onGenerate:function(){},withoutCopyright:!0,inverseButton:!1,hours12:!1,next:'xdsoft_next',prev:'xdsoft_prev',dayOfWeekStart:0,parentID:'body',timeHeightInTimePicker:25,timepickerScrollbar:!0,todayButton:!0,prevButton:!0,nextButton:!0,defaultSelect:!0,scrollMonth:!0,scrollTime:!0,scrollInput:!0,lazyInit:!1,mask:!1,validateOnBlur:!0,allowBlank:!0,yearStart:1950,yearEnd:2050,monthStart:0,monthEnd:11,style:'',id:'',fixed:!1,roundTime:'round',className:'',weekends:[],highlightedDates:[],highlightedPeriods:[],allowDates:[],allowDateRe:null,disabledDates:[],disabledWeekDays:[],yearOffset:0,beforeShowDay:null,enterLikeTab:!0,showApplyButton:!1,insideParent:!1,};var dateHelper=null,defaultDateHelper=null,globalLocaleDefault='en',globalLocale='en';var dateFormatterOptionsDefault={meridiem:['AM','PM']};var initDateFormatter=function(){var locale=default_options.i18n[globalLocale],opts={days:locale.dayOfWeek,daysShort:locale.dayOfWeekShort,months:locale.months,monthsShort:$.map(locale.months,function(n){return n.substring(0,3)})};if(typeof DateFormatter==='function'){dateHelper=defaultDateHelper=new DateFormatter({dateSettings:$.extend({},dateFormatterOptionsDefault,opts)})}};var dateFormatters={moment:{default_options:{format:'YYYY/MM/DD HH:mm',formatDate:'YYYY/MM/DD',formatTime:'HH:mm',},formatter:{parseDate:function(date,format){if(isFormatStandard(format)){return defaultDateHelper.parseDate(date,format)}
var d=moment(date,format);return d.isValid()?d.toDate():!1},formatDate:function(date,format){if(isFormatStandard(format)){return defaultDateHelper.formatDate(date,format)}
return moment(date).format(format)},formatMask:function(format){return format.replace(/Y{4}/g,'9999').replace(/Y{2}/g,'99').replace(/M{2}/g,'19').replace(/D{2}/g,'39').replace(/H{2}/g,'29').replace(/m{2}/g,'59').replace(/s{2}/g,'59')},}}}
$.datetimepicker={setLocale:function(locale){var newLocale=default_options.i18n[locale]?locale:globalLocaleDefault;if(globalLocale!==newLocale){globalLocale=newLocale;initDateFormatter()}},setDateFormatter:function(dateFormatter){if(typeof dateFormatter==='string'&&dateFormatters.hasOwnProperty(dateFormatter)){var df=dateFormatters[dateFormatter];$.extend(default_options,df.default_options);dateHelper=df.formatter}else{dateHelper=dateFormatter}},};var standardFormats={RFC_2822:'D, d M Y H:i:s O',ATOM:'Y-m-d\TH:i:sP',ISO_8601:'Y-m-d\TH:i:sO',RFC_822:'D, d M y H:i:s O',RFC_850:'l, d-M-y H:i:s T',RFC_1036:'D, d M y H:i:s O',RFC_1123:'D, d M Y H:i:s O',RSS:'D, d M Y H:i:s O',W3C:'Y-m-d\TH:i:sP'}
var isFormatStandard=function(format){return Object.values(standardFormats).indexOf(format)===-1?!1:!0}
$.extend($.datetimepicker,standardFormats);initDateFormatter();if(!window.getComputedStyle){window.getComputedStyle=function(el){this.el=el;this.getPropertyValue=function(prop){var re=/(-([a-z]))/g;if(prop==='float'){prop='styleFloat'}
if(re.test(prop)){prop=prop.replace(re,function(a,b,c){return c.toUpperCase()})}
return el.currentStyle[prop]||null};return this}}
if(!Array.prototype.indexOf){Array.prototype.indexOf=function(obj,start){var i,j;for(i=(start||0),j=this.length;i<j;i+=1){if(this[i]===obj){return i}}
return-1}}
Date.prototype.countDaysInMonth=function(){return new Date(this.getFullYear(),this.getMonth()+1,0).getDate()};$.fn.xdsoftScroller=function(options,percent){return this.each(function(){var timeboxparent=$(this),pointerEventToXY=function(e){var out={x:0,y:0},touch;if(e.type==='touchstart'||e.type==='touchmove'||e.type==='touchend'||e.type==='touchcancel'){touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];out.x=touch.clientX;out.y=touch.clientY}else if(e.type==='mousedown'||e.type==='mouseup'||e.type==='mousemove'||e.type==='mouseover'||e.type==='mouseout'||e.type==='mouseenter'||e.type==='mouseleave'){out.x=e.clientX;out.y=e.clientY}
return out},timebox,parentHeight,height,scrollbar,scroller,maximumOffset=100,start=!1,startY=0,startTop=0,h1=0,touchStart=!1,startTopScroll=0,calcOffset=function(){};if(percent==='hide'){timeboxparent.find('.xdsoft_scrollbar').hide();return}
if(!$(this).hasClass('xdsoft_scroller_box')){timebox=timeboxparent.children().eq(0);parentHeight=timeboxparent[0].clientHeight;height=timebox[0].offsetHeight;scrollbar=$('<div class="xdsoft_scrollbar"></div>');scroller=$('<div class="xdsoft_scroller"></div>');scrollbar.append(scroller);timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar);calcOffset=function calcOffset(event){var offset=pointerEventToXY(event).y-startY+startTopScroll;if(offset<0){offset=0}
if(offset+scroller[0].offsetHeight>h1){offset=h1-scroller[0].offsetHeight}
timeboxparent.trigger('scroll_element.xdsoft_scroller',[maximumOffset?offset/maximumOffset:0])};scroller.on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller',function(event){if(!parentHeight){timeboxparent.trigger('resize_scroll.xdsoft_scroller',[percent])}
startY=pointerEventToXY(event).y;startTopScroll=parseInt(scroller.css('margin-top'),10);h1=scrollbar[0].offsetHeight;if(event.type==='mousedown'||event.type==='touchstart'){if(options.ownerDocument){$(options.ownerDocument.body).addClass('xdsoft_noselect')}
$([options.ownerDocument.body,options.contentWindow]).on('touchend mouseup.xdsoft_scroller',function arguments_callee(){$([options.ownerDocument.body,options.contentWindow]).off('touchend mouseup.xdsoft_scroller',arguments_callee).off('mousemove.xdsoft_scroller',calcOffset).removeClass('xdsoft_noselect')});$(options.ownerDocument.body).on('mousemove.xdsoft_scroller',calcOffset)}else{touchStart=!0;event.stopPropagation();event.preventDefault()}}).on('touchmove',function(event){if(touchStart){event.preventDefault();calcOffset(event)}}).on('touchend touchcancel',function(){touchStart=!1;startTopScroll=0});timeboxparent.on('scroll_element.xdsoft_scroller',function(event,percentage){if(!parentHeight){timeboxparent.trigger('resize_scroll.xdsoft_scroller',[percentage,!0])}
percentage=percentage>1?1:(percentage<0||isNaN(percentage))?0:percentage;scroller.css('margin-top',maximumOffset*percentage);setTimeout(function(){timebox.css('marginTop',-parseInt((timebox[0].offsetHeight-parentHeight)*percentage,10))},10)}).on('resize_scroll.xdsoft_scroller',function(event,percentage,noTriggerScroll){var percent,sh;parentHeight=timeboxparent[0].clientHeight;height=timebox[0].offsetHeight;percent=parentHeight/height;sh=percent*scrollbar[0].offsetHeight;if(percent>1){scroller.hide()}else{scroller.show();scroller.css('height',parseInt(sh>10?sh:10,10));maximumOffset=scrollbar[0].offsetHeight-scroller[0].offsetHeight;if(noTriggerScroll!==!0){timeboxparent.trigger('scroll_element.xdsoft_scroller',[percentage||Math.abs(parseInt(timebox.css('marginTop'),10))/(height-parentHeight)])}}});timeboxparent.on('mousewheel',function(event){var top=Math.abs(parseInt(timebox.css('marginTop'),10));top=top-(event.deltaY*20);if(top<0){top=0}
timeboxparent.trigger('scroll_element.xdsoft_scroller',[top/(height-parentHeight)]);event.stopPropagation();return!1});timeboxparent.on('touchstart',function(event){start=pointerEventToXY(event);startTop=Math.abs(parseInt(timebox.css('marginTop'),10))});timeboxparent.on('touchmove',function(event){if(start){event.preventDefault();var coord=pointerEventToXY(event);timeboxparent.trigger('scroll_element.xdsoft_scroller',[(startTop-(coord.y-start.y))/(height-parentHeight)])}});timeboxparent.on('touchend touchcancel',function(){start=!1;startTop=0})}
timeboxparent.trigger('resize_scroll.xdsoft_scroller',[percent])})};$.fn.datetimepicker=function(opt,opt2){var result=this,KEY0=48,KEY9=57,_KEY0=96,_KEY9=105,CTRLKEY=17,CMDKEY=91,DEL=46,ENTER=13,ESC=27,BACKSPACE=8,ARROWLEFT=37,ARROWUP=38,ARROWRIGHT=39,ARROWDOWN=40,TAB=9,F5=116,AKEY=65,CKEY=67,VKEY=86,ZKEY=90,YKEY=89,ctrlDown=!1,cmdDown=!1,options=($.isPlainObject(opt)||!opt)?$.extend(!0,{},default_options,opt):$.extend(!0,{},default_options),lazyInitTimer=0,createDateTimePicker,destroyDateTimePicker,lazyInit=function(input){input.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart',function initOnActionCallback(){if(input.is(':disabled')||input.data('xdsoft_datetimepicker')){return}
clearTimeout(lazyInitTimer);lazyInitTimer=setTimeout(function(){if(!input.data('xdsoft_datetimepicker')){createDateTimePicker(input)}
input.off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart',initOnActionCallback).trigger('open.xdsoft')},100)})};createDateTimePicker=function(input){var datetimepicker=$('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),xdsoft_copyright=$('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),datepicker=$('<div class="xdsoft_datepicker active"></div>'),month_picker=$('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>'+'<div class="xdsoft_label xdsoft_month"><span></span><i></i></div>'+'<div class="xdsoft_label xdsoft_year"><span></span><i></i></div>'+'<button type="button" class="xdsoft_next"></button></div>'),calendar=$('<div class="xdsoft_calendar"></div>'),timepicker=$('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),timeboxparent=timepicker.find('.xdsoft_time_box').eq(0),timebox=$('<div class="xdsoft_time_variant"></div>'),applyButton=$('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'),monthselect=$('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),yearselect=$('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),triggerAfterOpen=!1,XDSoft_datetime,xchangeTimer,timerclick,current_time_index,setPos,timer=0,_xdsoft_datetime,forEachAncestorOf;if(options.id){datetimepicker.attr('id',options.id)}
if(options.style){datetimepicker.attr('style',options.style)}
if(options.weeks){datetimepicker.addClass('xdsoft_showweeks')}
if(options.rtl){datetimepicker.addClass('xdsoft_rtl')}
datetimepicker.addClass('xdsoft_'+options.theme);datetimepicker.addClass(options.className);month_picker.find('.xdsoft_month span').after(monthselect);month_picker.find('.xdsoft_year span').after(yearselect);month_picker.find('.xdsoft_month,.xdsoft_year').on('touchstart mousedown.xdsoft',function(event){var select=$(this).find('.xdsoft_select').eq(0),val=0,top=0,visible=select.is(':visible'),items,i;month_picker.find('.xdsoft_select').hide();if(_xdsoft_datetime.currentTime){val=_xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month')?'getMonth':'getFullYear']()}
select[visible?'hide':'show']();for(items=select.find('div.xdsoft_option'),i=0;i<items.length;i+=1){if(items.eq(i).data('value')===val){break}else{top+=items[0].offsetHeight}}
select.xdsoftScroller(options,top/(select.children()[0].offsetHeight-(select[0].clientHeight)));event.stopPropagation();return!1});var handleTouchMoved=function(event){var evt=event.originalEvent;var touchPosition=evt.touches?evt.touches[0]:evt;this.touchStartPosition=this.touchStartPosition||touchPosition;var xMovement=Math.abs(this.touchStartPosition.clientX-touchPosition.clientX);var yMovement=Math.abs(this.touchStartPosition.clientY-touchPosition.clientY);var distance=Math.sqrt(xMovement*xMovement+yMovement*yMovement);if(distance>options.touchMovedThreshold){this.touchMoved=!0}}
month_picker.find('.xdsoft_select').xdsoftScroller(options).on('touchstart mousedown.xdsoft',function(event){var evt=event.originalEvent;this.touchMoved=!1;this.touchStartPosition=evt.touches?evt.touches[0]:evt;event.stopPropagation();event.preventDefault()}).on('touchmove','.xdsoft_option',handleTouchMoved).on('touchend mousedown.xdsoft','.xdsoft_option',function(){if(!this.touchMoved){if(_xdsoft_datetime.currentTime===undefined||_xdsoft_datetime.currentTime===null){_xdsoft_datetime.currentTime=_xdsoft_datetime.now()}
var year=_xdsoft_datetime.currentTime.getFullYear();if(_xdsoft_datetime&&_xdsoft_datetime.currentTime){_xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect')?'setMonth':'setFullYear']($(this).data('value'))}
$(this).parent().parent().hide();datetimepicker.trigger('xchange.xdsoft');if(options.onChangeMonth&&$.isFunction(options.onChangeMonth)){options.onChangeMonth.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'))}
if(year!==_xdsoft_datetime.currentTime.getFullYear()&&$.isFunction(options.onChangeYear)){options.onChangeYear.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'))}}});datetimepicker.getValue=function(){return _xdsoft_datetime.getCurrentTime()};datetimepicker.setOptions=function(_options){var highlightedDates={};options=$.extend(!0,{},options,_options);if(_options.allowTimes&&$.isArray(_options.allowTimes)&&_options.allowTimes.length){options.allowTimes=$.extend(!0,[],_options.allowTimes)}
if(_options.weekends&&$.isArray(_options.weekends)&&_options.weekends.length){options.weekends=$.extend(!0,[],_options.weekends)}
if(_options.allowDates&&$.isArray(_options.allowDates)&&_options.allowDates.length){options.allowDates=$.extend(!0,[],_options.allowDates)}
if(_options.allowDateRe&&Object.prototype.toString.call(_options.allowDateRe)==="[object String]"){options.allowDateRe=new RegExp(_options.allowDateRe)}
if(_options.highlightedDates&&$.isArray(_options.highlightedDates)&&_options.highlightedDates.length){$.each(_options.highlightedDates,function(index,value){var splitData=$.map(value.split(','),$.trim),exDesc,hDate=new HighlightedDate(dateHelper.parseDate(splitData[0],options.formatDate),splitData[1],splitData[2]),keyDate=dateHelper.formatDate(hDate.date,options.formatDate);if(highlightedDates[keyDate]!==undefined){exDesc=highlightedDates[keyDate].desc;if(exDesc&&exDesc.length&&hDate.desc&&hDate.desc.length){highlightedDates[keyDate].desc=exDesc+"\n"+hDate.desc}}else{highlightedDates[keyDate]=hDate}});options.highlightedDates=$.extend(!0,[],highlightedDates)}
if(_options.highlightedPeriods&&$.isArray(_options.highlightedPeriods)&&_options.highlightedPeriods.length){highlightedDates=$.extend(!0,[],options.highlightedDates);$.each(_options.highlightedPeriods,function(index,value){var dateTest,dateEnd,desc,hDate,keyDate,exDesc,style;if($.isArray(value)){dateTest=value[0];dateEnd=value[1];desc=value[2];style=value[3]}else{var splitData=$.map(value.split(','),$.trim);dateTest=dateHelper.parseDate(splitData[0],options.formatDate);dateEnd=dateHelper.parseDate(splitData[1],options.formatDate);desc=splitData[2];style=splitData[3]}
while(dateTest<=dateEnd){hDate=new HighlightedDate(dateTest,desc,style);keyDate=dateHelper.formatDate(dateTest,options.formatDate);dateTest.setDate(dateTest.getDate()+1);if(highlightedDates[keyDate]!==undefined){exDesc=highlightedDates[keyDate].desc;if(exDesc&&exDesc.length&&hDate.desc&&hDate.desc.length){highlightedDates[keyDate].desc=exDesc+"\n"+hDate.desc}}else{highlightedDates[keyDate]=hDate}}});options.highlightedDates=$.extend(!0,[],highlightedDates)}
if(_options.disabledDates&&$.isArray(_options.disabledDates)&&_options.disabledDates.length){options.disabledDates=$.extend(!0,[],_options.disabledDates)}
if(_options.disabledWeekDays&&$.isArray(_options.disabledWeekDays)&&_options.disabledWeekDays.length){options.disabledWeekDays=$.extend(!0,[],_options.disabledWeekDays)}
if((options.open||options.opened)&&(!options.inline)){input.trigger('open.xdsoft')}
if(options.inline){triggerAfterOpen=!0;datetimepicker.addClass('xdsoft_inline');input.after(datetimepicker).hide()}
if(options.inverseButton){options.next='xdsoft_prev';options.prev='xdsoft_next'}
if(options.datepicker){datepicker.addClass('active')}else{datepicker.removeClass('active')}
if(options.timepicker){timepicker.addClass('active')}else{timepicker.removeClass('active')}
if(options.value){_xdsoft_datetime.setCurrentTime(options.value);if(input&&input.val){input.val(_xdsoft_datetime.str)}}
if(isNaN(options.dayOfWeekStart)){options.dayOfWeekStart=0}else{options.dayOfWeekStart=parseInt(options.dayOfWeekStart,10)%7}
if(!options.timepickerScrollbar){timeboxparent.xdsoftScroller(options,'hide')}
if(options.minDate&&/^[\+\-](.*)$/.test(options.minDate)){options.minDate=dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate),options.formatDate)}
if(options.maxDate&&/^[\+\-](.*)$/.test(options.maxDate)){options.maxDate=dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate),options.formatDate)}
if(options.minDateTime&&/^\+(.*)$/.test(options.minDateTime)){options.minDateTime=_xdsoft_datetime.strToDateTime(options.minDateTime).dateFormat(options.formatDate)}
if(options.maxDateTime&&/^\+(.*)$/.test(options.maxDateTime)){options.maxDateTime=_xdsoft_datetime.strToDateTime(options.maxDateTime).dateFormat(options.formatDate)}
applyButton.toggle(options.showApplyButton);month_picker.find('.xdsoft_today_button').css('visibility',!options.todayButton?'hidden':'visible');month_picker.find('.'+options.prev).css('visibility',!options.prevButton?'hidden':'visible');month_picker.find('.'+options.next).css('visibility',!options.nextButton?'hidden':'visible');setMask(options);if(options.validateOnBlur){input.off('blur.xdsoft').on('blur.xdsoft',function(){if(options.allowBlank&&(!$.trim($(this).val()).length||(typeof options.mask==="string"&&$.trim($(this).val())===options.mask.replace(/[0-9]/g,'_')))){$(this).val(null);datetimepicker.data('xdsoft_datetime').empty()}else{var d=dateHelper.parseDate($(this).val(),options.format);if(d){$(this).val(dateHelper.formatDate(d,options.format))}else{var splittedHours=+([$(this).val()[0],$(this).val()[1]].join('')),splittedMinutes=+([$(this).val()[2],$(this).val()[3]].join(''));if(!options.datepicker&&options.timepicker&&splittedHours>=0&&splittedHours<24&&splittedMinutes>=0&&splittedMinutes<60){$(this).val([splittedHours,splittedMinutes].map(function(item){return item>9?item:'0'+item}).join(':'))}else{$(this).val(dateHelper.formatDate(_xdsoft_datetime.now(),options.format))}}
datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val())}
datetimepicker.trigger('changedatetime.xdsoft');datetimepicker.trigger('close.xdsoft')})}
options.dayOfWeekStartPrev=(options.dayOfWeekStart===0)?6:options.dayOfWeekStart-1;datetimepicker.trigger('xchange.xdsoft').trigger('afterOpen.xdsoft')};datetimepicker.data('options',options).on('touchstart mousedown.xdsoft',function(event){event.stopPropagation();event.preventDefault();yearselect.hide();monthselect.hide();return!1});timeboxparent.append(timebox);timeboxparent.xdsoftScroller(options);datetimepicker.on('afterOpen.xdsoft',function(){timeboxparent.xdsoftScroller(options)});datetimepicker.append(datepicker).append(timepicker);if(options.withoutCopyright!==!0){datetimepicker.append(xdsoft_copyright)}
datepicker.append(month_picker).append(calendar).append(applyButton);if(options.insideParent){$(input).parent().append(datetimepicker)}else{$(options.parentID).append(datetimepicker)}
XDSoft_datetime=function(){var _this=this;_this.now=function(norecursion){var d=new Date(),date,time;if(!norecursion&&options.defaultDate){date=_this.strToDateTime(options.defaultDate);d.setFullYear(date.getFullYear());d.setMonth(date.getMonth());d.setDate(date.getDate())}
d.setFullYear(d.getFullYear());if(!norecursion&&options.defaultTime){time=_this.strtotime(options.defaultTime);d.setHours(time.getHours());d.setMinutes(time.getMinutes());d.setSeconds(time.getSeconds());d.setMilliseconds(time.getMilliseconds())}
return d};_this.isValidDate=function(d){if(Object.prototype.toString.call(d)!=="[object Date]"){return!1}
return!isNaN(d.getTime())};_this.setCurrentTime=function(dTime,requireValidDate){if(typeof dTime==='string'){_this.currentTime=_this.strToDateTime(dTime)}else if(_this.isValidDate(dTime)){_this.currentTime=dTime}else if(!dTime&&!requireValidDate&&options.allowBlank&&!options.inline){_this.currentTime=null}else{_this.currentTime=_this.now()}
datetimepicker.trigger('xchange.xdsoft')};_this.empty=function(){_this.currentTime=null};_this.getCurrentTime=function(){return _this.currentTime};_this.nextMonth=function(){if(_this.currentTime===undefined||_this.currentTime===null){_this.currentTime=_this.now()}
var month=_this.currentTime.getMonth()+1,year;if(month===12){_this.currentTime.setFullYear(_this.currentTime.getFullYear()+1);month=0}
year=_this.currentTime.getFullYear();_this.currentTime.setDate(Math.min(new Date(_this.currentTime.getFullYear(),month+1,0).getDate(),_this.currentTime.getDate()));_this.currentTime.setMonth(month);if(options.onChangeMonth&&$.isFunction(options.onChangeMonth)){options.onChangeMonth.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'))}
if(year!==_this.currentTime.getFullYear()&&$.isFunction(options.onChangeYear)){options.onChangeYear.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'))}
datetimepicker.trigger('xchange.xdsoft');return month};_this.prevMonth=function(){if(_this.currentTime===undefined||_this.currentTime===null){_this.currentTime=_this.now()}
var month=_this.currentTime.getMonth()-1;if(month===-1){_this.currentTime.setFullYear(_this.currentTime.getFullYear()-1);month=11}
_this.currentTime.setDate(Math.min(new Date(_this.currentTime.getFullYear(),month+1,0).getDate(),_this.currentTime.getDate()));_this.currentTime.setMonth(month);if(options.onChangeMonth&&$.isFunction(options.onChangeMonth)){options.onChangeMonth.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'))}
datetimepicker.trigger('xchange.xdsoft');return month};_this.getWeekOfYear=function(datetime){if(options.onGetWeekOfYear&&$.isFunction(options.onGetWeekOfYear)){var week=options.onGetWeekOfYear.call(datetimepicker,datetime);if(typeof week!=='undefined'){return week}}
var onejan=new Date(datetime.getFullYear(),0,1);if(onejan.getDay()!==4){onejan.setMonth(0,1+((4-onejan.getDay()+7)%7))}
return Math.ceil((((datetime-onejan)/86400000)+onejan.getDay()+1)/7)};_this.strToDateTime=function(sDateTime){var tmpDate=[],timeOffset,currentTime;if(sDateTime&&sDateTime instanceof Date&&_this.isValidDate(sDateTime)){return sDateTime}
tmpDate=/^([+-]{1})(.*)$/.exec(sDateTime);if(tmpDate){tmpDate[2]=dateHelper.parseDate(tmpDate[2],options.formatDate)}
if(tmpDate&&tmpDate[2]){timeOffset=tmpDate[2].getTime()-(tmpDate[2].getTimezoneOffset())*60000;currentTime=new Date((_this.now(!0)).getTime()+parseInt(tmpDate[1]+'1',10)*timeOffset)}else{currentTime=sDateTime?dateHelper.parseDate(sDateTime,options.format):_this.now()}
if(!_this.isValidDate(currentTime)){currentTime=_this.now()}
return currentTime};_this.strToDate=function(sDate){if(sDate&&sDate instanceof Date&&_this.isValidDate(sDate)){return sDate}
var currentTime=sDate?dateHelper.parseDate(sDate,options.formatDate):_this.now(!0);if(!_this.isValidDate(currentTime)){currentTime=_this.now(!0)}
return currentTime};_this.strtotime=function(sTime){if(sTime&&sTime instanceof Date&&_this.isValidDate(sTime)){return sTime}
var currentTime=sTime?dateHelper.parseDate(sTime,options.formatTime):_this.now(!0);if(!_this.isValidDate(currentTime)){currentTime=_this.now(!0)}
return currentTime};_this.str=function(){var format=options.format;if(options.yearOffset){format=format.replace('Y',_this.currentTime.getFullYear()+options.yearOffset);format=format.replace('y',String(_this.currentTime.getFullYear()+options.yearOffset).substring(2,4))}
return dateHelper.formatDate(_this.currentTime,format)};_this.currentTime=this.now()};_xdsoft_datetime=new XDSoft_datetime();applyButton.on('touchend click',function(e){e.preventDefault();datetimepicker.data('changed',!0);_xdsoft_datetime.setCurrentTime(getCurrentValue());input.val(_xdsoft_datetime.str());datetimepicker.trigger('close.xdsoft')});month_picker.find('.xdsoft_today_button').on('touchend mousedown.xdsoft',function(){datetimepicker.data('changed',!0);_xdsoft_datetime.setCurrentTime(0,!0);datetimepicker.trigger('afterOpen.xdsoft')}).on('dblclick.xdsoft',function(){var currentDate=_xdsoft_datetime.getCurrentTime(),minDate,maxDate;currentDate=new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate());minDate=_xdsoft_datetime.strToDate(options.minDate);minDate=new Date(minDate.getFullYear(),minDate.getMonth(),minDate.getDate());if(currentDate<minDate){return}
maxDate=_xdsoft_datetime.strToDate(options.maxDate);maxDate=new Date(maxDate.getFullYear(),maxDate.getMonth(),maxDate.getDate());if(currentDate>maxDate){return}
input.val(_xdsoft_datetime.str());input.trigger('change');datetimepicker.trigger('close.xdsoft')});month_picker.find('.xdsoft_prev,.xdsoft_next').on('touchend mousedown.xdsoft',function(){var $this=$(this),timer=0,stop=!1;(function arguments_callee1(v){if($this.hasClass(options.next)){_xdsoft_datetime.nextMonth()}else if($this.hasClass(options.prev)){_xdsoft_datetime.prevMonth()}
if(options.monthChangeSpinner){if(!stop){timer=setTimeout(arguments_callee1,v||100)}}}(500));$([options.ownerDocument.body,options.contentWindow]).on('touchend mouseup.xdsoft',function arguments_callee2(){clearTimeout(timer);stop=!0;$([options.ownerDocument.body,options.contentWindow]).off('touchend mouseup.xdsoft',arguments_callee2)})});timepicker.find('.xdsoft_prev,.xdsoft_next').on('touchend mousedown.xdsoft',function(){var $this=$(this),timer=0,stop=!1,period=110;(function arguments_callee4(v){var pheight=timeboxparent[0].clientHeight,height=timebox[0].offsetHeight,top=Math.abs(parseInt(timebox.css('marginTop'),10));if($this.hasClass(options.next)&&(height-pheight)-options.timeHeightInTimePicker>=top){timebox.css('marginTop','-'+(top+options.timeHeightInTimePicker)+'px')}else if($this.hasClass(options.prev)&&top-options.timeHeightInTimePicker>=0){timebox.css('marginTop','-'+(top-options.timeHeightInTimePicker)+'px')}
timeboxparent.trigger('scroll_element.xdsoft_scroller',[Math.abs(parseInt(timebox[0].style.marginTop,10)/(height-pheight))]);period=(period>10)?10:period-10;if(!stop){timer=setTimeout(arguments_callee4,v||period)}}(500));$([options.ownerDocument.body,options.contentWindow]).on('touchend mouseup.xdsoft',function arguments_callee5(){clearTimeout(timer);stop=!0;$([options.ownerDocument.body,options.contentWindow]).off('touchend mouseup.xdsoft',arguments_callee5)})});xchangeTimer=0;datetimepicker.on('xchange.xdsoft',function(event){clearTimeout(xchangeTimer);xchangeTimer=setTimeout(function(){if(_xdsoft_datetime.currentTime===undefined||_xdsoft_datetime.currentTime===null){_xdsoft_datetime.currentTime=_xdsoft_datetime.now()}
var table='',start=new Date(_xdsoft_datetime.currentTime.getFullYear(),_xdsoft_datetime.currentTime.getMonth(),1,12,0,0),i=0,j,today=_xdsoft_datetime.now(),maxDate=!1,minDate=!1,minDateTime=!1,maxDateTime=!1,hDate,day,d,y,m,w,classes=[],customDateSettings,newRow=!0,time='',h,line_time,description;while(start.getDay()!==options.dayOfWeekStart){start.setDate(start.getDate()-1)}
table+='<table><thead><tr>';if(options.weeks){table+='<th></th>'}
for(j=0;j<7;j+=1){table+='<th>'+options.i18n[globalLocale].dayOfWeekShort[(j+options.dayOfWeekStart)%7]+'</th>'}
table+='</tr></thead>';table+='<tbody>';if(options.maxDate!==!1){maxDate=_xdsoft_datetime.strToDate(options.maxDate);maxDate=new Date(maxDate.getFullYear(),maxDate.getMonth(),maxDate.getDate(),23,59,59,999)}
if(options.minDate!==!1){minDate=_xdsoft_datetime.strToDate(options.minDate);minDate=new Date(minDate.getFullYear(),minDate.getMonth(),minDate.getDate())}
if(options.minDateTime!==!1){minDateTime=_xdsoft_datetime.strToDate(options.minDateTime);minDateTime=new Date(minDateTime.getFullYear(),minDateTime.getMonth(),minDateTime.getDate(),minDateTime.getHours(),minDateTime.getMinutes(),minDateTime.getSeconds())}
if(options.maxDateTime!==!1){maxDateTime=_xdsoft_datetime.strToDate(options.maxDateTime);maxDateTime=new Date(maxDateTime.getFullYear(),maxDateTime.getMonth(),maxDateTime.getDate(),maxDateTime.getHours(),maxDateTime.getMinutes(),maxDateTime.getSeconds())}
var maxDateTimeDay;if(maxDateTime!==!1){maxDateTimeDay=((maxDateTime.getFullYear()*12)+maxDateTime.getMonth())*31+maxDateTime.getDate()}
while(i<_xdsoft_datetime.currentTime.countDaysInMonth()||start.getDay()!==options.dayOfWeekStart||_xdsoft_datetime.currentTime.getMonth()===start.getMonth()){classes=[];i+=1;day=start.getDay();d=start.getDate();y=start.getFullYear();m=start.getMonth();w=_xdsoft_datetime.getWeekOfYear(start);description='';classes.push('xdsoft_date');if(options.beforeShowDay&&$.isFunction(options.beforeShowDay.call)){customDateSettings=options.beforeShowDay.call(datetimepicker,start)}else{customDateSettings=null}
if(options.allowDateRe&&Object.prototype.toString.call(options.allowDateRe)==="[object RegExp]"){if(!options.allowDateRe.test(dateHelper.formatDate(start,options.formatDate))){classes.push('xdsoft_disabled')}}
if(options.allowDates&&options.allowDates.length>0){if(options.allowDates.indexOf(dateHelper.formatDate(start,options.formatDate))===-1){classes.push('xdsoft_disabled')}}
var currentDay=((start.getFullYear()*12)+start.getMonth())*31+start.getDate();if((maxDate!==!1&&start>maxDate)||(minDateTime!==!1&&start<minDateTime)||(minDate!==!1&&start<minDate)||(maxDateTime!==!1&&currentDay>maxDateTimeDay)||(customDateSettings&&customDateSettings[0]===!1)){classes.push('xdsoft_disabled')}
if(options.disabledDates.indexOf(dateHelper.formatDate(start,options.formatDate))!==-1){classes.push('xdsoft_disabled')}
if(options.disabledWeekDays.indexOf(day)!==-1){classes.push('xdsoft_disabled')}
if(input.is('[disabled]')){classes.push('xdsoft_disabled')}
if(customDateSettings&&customDateSettings[1]!==""){classes.push(customDateSettings[1])}
if(_xdsoft_datetime.currentTime.getMonth()!==m){classes.push('xdsoft_other_month')}
if((options.defaultSelect||datetimepicker.data('changed'))&&dateHelper.formatDate(_xdsoft_datetime.currentTime,options.formatDate)===dateHelper.formatDate(start,options.formatDate)){classes.push('xdsoft_current')}
if(dateHelper.formatDate(today,options.formatDate)===dateHelper.formatDate(start,options.formatDate)){classes.push('xdsoft_today')}
if(start.getDay()===0||start.getDay()===6||options.weekends.indexOf(dateHelper.formatDate(start,options.formatDate))!==-1){classes.push('xdsoft_weekend')}
if(options.highlightedDates[dateHelper.formatDate(start,options.formatDate)]!==undefined){hDate=options.highlightedDates[dateHelper.formatDate(start,options.formatDate)];classes.push(hDate.style===undefined?'xdsoft_highlighted_default':hDate.style);description=hDate.desc===undefined?'':hDate.desc}
if(options.beforeShowDay&&$.isFunction(options.beforeShowDay)){classes.push(options.beforeShowDay(start))}
if(newRow){table+='<tr>';newRow=!1;if(options.weeks){table+='<th>'+w+'</th>'}}
table+='<td data-date="'+d+'" data-month="'+m+'" data-year="'+y+'"'+' class="xdsoft_date xdsoft_day_of_week'+start.getDay()+' '+classes.join(' ')+'" title="'+description+'">'+'<div>'+d+'</div>'+'</td>';if(start.getDay()===options.dayOfWeekStartPrev){table+='</tr>';newRow=!0}
start.setDate(d+1)}
table+='</tbody></table>';calendar.html(table);month_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]);month_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear()+options.yearOffset);time='';h='';m='';var minTimeMinutesOfDay=0;if(options.minTime!==!1){var t=_xdsoft_datetime.strtotime(options.minTime);minTimeMinutesOfDay=60*t.getHours()+t.getMinutes()}
var maxTimeMinutesOfDay=24*60;if(options.maxTime!==!1){var t=_xdsoft_datetime.strtotime(options.maxTime);maxTimeMinutesOfDay=60*t.getHours()+t.getMinutes()}
if(options.minDateTime!==!1){var t=_xdsoft_datetime.strToDateTime(options.minDateTime);var currentDayIsMinDateTimeDay=dateHelper.formatDate(_xdsoft_datetime.currentTime,options.formatDate)===dateHelper.formatDate(t,options.formatDate);if(currentDayIsMinDateTimeDay){var m=60*t.getHours()+t.getMinutes();if(m>minTimeMinutesOfDay)minTimeMinutesOfDay=m}}
if(options.maxDateTime!==!1){var t=_xdsoft_datetime.strToDateTime(options.maxDateTime);var currentDayIsMaxDateTimeDay=dateHelper.formatDate(_xdsoft_datetime.currentTime,options.formatDate)===dateHelper.formatDate(t,options.formatDate);if(currentDayIsMaxDateTimeDay){var m=60*t.getHours()+t.getMinutes();if(m<maxTimeMinutesOfDay)maxTimeMinutesOfDay=m}}
line_time=function line_time(h,m){var now=_xdsoft_datetime.now(),current_time,isALlowTimesInit=options.allowTimes&&$.isArray(options.allowTimes)&&options.allowTimes.length;now.setHours(h);h=parseInt(now.getHours(),10);now.setMinutes(m);m=parseInt(now.getMinutes(),10);classes=[];var currentMinutesOfDay=60*h+m;if(input.is('[disabled]')||(currentMinutesOfDay>=maxTimeMinutesOfDay)||(currentMinutesOfDay<minTimeMinutesOfDay)){classes.push('xdsoft_disabled')}
current_time=new Date(_xdsoft_datetime.currentTime);current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(),10));if(!isALlowTimesInit){current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes()/options.step)*options.step)}
if((options.initTime||options.defaultSelect||datetimepicker.data('changed'))&&current_time.getHours()===parseInt(h,10)&&((!isALlowTimesInit&&options.step>59)||current_time.getMinutes()===parseInt(m,10))){if(options.defaultSelect||datetimepicker.data('changed')){classes.push('xdsoft_current')}else if(options.initTime){classes.push('xdsoft_init_time')}}
if(parseInt(today.getHours(),10)===parseInt(h,10)&&parseInt(today.getMinutes(),10)===parseInt(m,10)){classes.push('xdsoft_today')}
time+='<div class="xdsoft_time '+classes.join(' ')+'" data-hour="'+h+'" data-minute="'+m+'">'+dateHelper.formatDate(now,options.formatTime)+'</div>'};if(!options.allowTimes||!$.isArray(options.allowTimes)||!options.allowTimes.length){for(i=0,j=0;i<(options.hours12?12:24);i+=1){for(j=0;j<60;j+=options.step){var currentMinutesOfDay=i*60+j;if(currentMinutesOfDay<minTimeMinutesOfDay)continue;if(currentMinutesOfDay>=maxTimeMinutesOfDay)continue;h=(i<10?'0':'')+i;m=(j<10?'0':'')+j;line_time(h,m)}}}else{for(i=0;i<options.allowTimes.length;i+=1){h=_xdsoft_datetime.strtotime(options.allowTimes[i]).getHours();m=_xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes();line_time(h,m)}}
timebox.html(time);opt='';for(i=parseInt(options.yearStart,10);i<=parseInt(options.yearEnd,10);i+=1){opt+='<div class="xdsoft_option '+(_xdsoft_datetime.currentTime.getFullYear()===i?'xdsoft_current':'')+'" data-value="'+i+'">'+(i+options.yearOffset)+'</div>'}
yearselect.children().eq(0).html(opt);for(i=parseInt(options.monthStart,10),opt='';i<=parseInt(options.monthEnd,10);i+=1){opt+='<div class="xdsoft_option '+(_xdsoft_datetime.currentTime.getMonth()===i?'xdsoft_current':'')+'" data-value="'+i+'">'+options.i18n[globalLocale].months[i]+'</div>'}
monthselect.children().eq(0).html(opt);$(datetimepicker).trigger('generate.xdsoft')},10);event.stopPropagation()}).on('afterOpen.xdsoft',function(){if(options.timepicker){var classType,pheight,height,top;if(timebox.find('.xdsoft_current').length){classType='.xdsoft_current'}else if(timebox.find('.xdsoft_init_time').length){classType='.xdsoft_init_time'}
if(classType){pheight=timeboxparent[0].clientHeight;height=timebox[0].offsetHeight;top=timebox.find(classType).index()*options.timeHeightInTimePicker+1;if((height-pheight)<top){top=height-pheight}
timeboxparent.trigger('scroll_element.xdsoft_scroller',[parseInt(top,10)/(height-pheight)])}else{timeboxparent.trigger('scroll_element.xdsoft_scroller',[0])}}});timerclick=0;calendar.on('touchend click.xdsoft','td',function(xdevent){xdevent.stopPropagation();timerclick+=1;var $this=$(this),currentTime=_xdsoft_datetime.currentTime;if(currentTime===undefined||currentTime===null){_xdsoft_datetime.currentTime=_xdsoft_datetime.now();currentTime=_xdsoft_datetime.currentTime}
if($this.hasClass('xdsoft_disabled')){return!1}
currentTime.setDate(1);currentTime.setFullYear($this.data('year'));currentTime.setMonth($this.data('month'));currentTime.setDate($this.data('date'));datetimepicker.trigger('select.xdsoft',[currentTime]);input.val(_xdsoft_datetime.str());if(options.onSelectDate&&$.isFunction(options.onSelectDate)){options.onSelectDate.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'),xdevent)}
datetimepicker.data('changed',!0);datetimepicker.trigger('xchange.xdsoft');datetimepicker.trigger('changedatetime.xdsoft');if((timerclick>1||(options.closeOnDateSelect===!0||(options.closeOnDateSelect===!1&&!options.timepicker)))&&!options.inline){datetimepicker.trigger('close.xdsoft')}
setTimeout(function(){timerclick=0},200)});timebox.on('touchstart','div',function(xdevent){this.touchMoved=!1}).on('touchmove','div',handleTouchMoved).on('touchend click.xdsoft','div',function(xdevent){if(!this.touchMoved){xdevent.stopPropagation();var $this=$(this),currentTime=_xdsoft_datetime.currentTime;if(currentTime===undefined||currentTime===null){_xdsoft_datetime.currentTime=_xdsoft_datetime.now();currentTime=_xdsoft_datetime.currentTime}
if($this.hasClass('xdsoft_disabled')){return!1}
currentTime.setHours($this.data('hour'));currentTime.setMinutes($this.data('minute'));datetimepicker.trigger('select.xdsoft',[currentTime]);datetimepicker.data('input').val(_xdsoft_datetime.str());if(options.onSelectTime&&$.isFunction(options.onSelectTime)){options.onSelectTime.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'),xdevent)}
datetimepicker.data('changed',!0);datetimepicker.trigger('xchange.xdsoft');datetimepicker.trigger('changedatetime.xdsoft');if(options.inline!==!0&&options.closeOnTimeSelect===!0){datetimepicker.trigger('close.xdsoft')}}});datepicker.on('mousewheel.xdsoft',function(event){if(!options.scrollMonth){return!0}
if(event.deltaY<0){_xdsoft_datetime.nextMonth()}else{_xdsoft_datetime.prevMonth()}
return!1});input.on('mousewheel.xdsoft',function(event){if(!options.scrollInput){return!0}
if(!options.datepicker&&options.timepicker){current_time_index=timebox.find('.xdsoft_current').length?timebox.find('.xdsoft_current').eq(0).index():0;if(current_time_index+event.deltaY>=0&&current_time_index+event.deltaY<timebox.children().length){current_time_index+=event.deltaY}
if(timebox.children().eq(current_time_index).length){timebox.children().eq(current_time_index).trigger('mousedown')}
return!1}
if(options.datepicker&&!options.timepicker){datepicker.trigger(event,[event.deltaY,event.deltaX,event.deltaY]);if(input.val){input.val(_xdsoft_datetime.str())}
datetimepicker.trigger('changedatetime.xdsoft');return!1}});datetimepicker.on('changedatetime.xdsoft',function(event){if(options.onChangeDateTime&&$.isFunction(options.onChangeDateTime)){var $input=datetimepicker.data('input');options.onChangeDateTime.call(datetimepicker,_xdsoft_datetime.currentTime,$input,event);delete options.value;$input.trigger('change')}}).on('generate.xdsoft',function(){if(options.onGenerate&&$.isFunction(options.onGenerate)){options.onGenerate.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'))}
if(triggerAfterOpen){datetimepicker.trigger('afterOpen.xdsoft');triggerAfterOpen=!1}}).on('click.xdsoft',function(xdevent){xdevent.stopPropagation()});current_time_index=0;forEachAncestorOf=function(node,callback){do{node=node.parentNode;if(!node||callback(node)===!1){break}}while(node.nodeName!=='HTML');};setPos=function(){var dateInputOffset,dateInputElem,verticalPosition,left,position,datetimepickerElem,dateInputHasFixedAncestor,$dateInput,windowWidth,verticalAnchorEdge,datetimepickerCss,windowHeight,windowScrollTop;$dateInput=datetimepicker.data('input');dateInputOffset=$dateInput.offset();dateInputElem=$dateInput[0];verticalAnchorEdge='top';verticalPosition=(dateInputOffset.top+dateInputElem.offsetHeight)-1;left=dateInputOffset.left;position="absolute";windowWidth=$(options.contentWindow).width();windowHeight=$(options.contentWindow).height();windowScrollTop=$(options.contentWindow).scrollTop();if((options.ownerDocument.documentElement.clientWidth-dateInputOffset.left)<datepicker.parent().outerWidth(!0)){var diff=datepicker.parent().outerWidth(!0)-dateInputElem.offsetWidth;left=left-diff}
if($dateInput.parent().css('direction')==='rtl'){left-=(datetimepicker.outerWidth()-$dateInput.outerWidth())}
if(options.fixed){verticalPosition-=windowScrollTop;left-=$(options.contentWindow).scrollLeft();position="fixed"}else{dateInputHasFixedAncestor=!1;forEachAncestorOf(dateInputElem,function(ancestorNode){if(ancestorNode===null){return!1}
if(options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position')==='fixed'){dateInputHasFixedAncestor=!0;return!1}});if(dateInputHasFixedAncestor&&!options.insideParent){position='fixed';if(verticalPosition+datetimepicker.outerHeight()>windowHeight+windowScrollTop){verticalAnchorEdge='bottom';verticalPosition=(windowHeight+windowScrollTop)-dateInputOffset.top}else{verticalPosition-=windowScrollTop}}else{if(verticalPosition+datetimepicker[0].offsetHeight>windowHeight+windowScrollTop){verticalPosition=dateInputOffset.top-datetimepicker[0].offsetHeight+1}}
if(verticalPosition<0){verticalPosition=0}
if(left+dateInputElem.offsetWidth>windowWidth){left=windowWidth-dateInputElem.offsetWidth}}
datetimepickerElem=datetimepicker[0];forEachAncestorOf(datetimepickerElem,function(ancestorNode){var ancestorNodePosition;ancestorNodePosition=options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position');if(ancestorNodePosition==='relative'&&windowWidth>=ancestorNode.offsetWidth){left=left-((windowWidth-ancestorNode.offsetWidth)/2);return!1}});datetimepickerCss={position:position,left:options.insideParent?dateInputElem.offsetLeft:left,top:'',bottom:''};if(options.insideParent){datetimepickerCss[verticalAnchorEdge]=dateInputElem.offsetTop+dateInputElem.offsetHeight}else{datetimepickerCss[verticalAnchorEdge]=verticalPosition}
datetimepicker.css(datetimepickerCss)};datetimepicker.on('open.xdsoft',function(event){var onShow=!0;if(options.onShow&&$.isFunction(options.onShow)){onShow=options.onShow.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'),event)}
if(onShow!==!1){datetimepicker.show();setPos();$(options.contentWindow).off('resize.xdsoft',setPos).on('resize.xdsoft',setPos);if(options.closeOnWithoutClick){$([options.ownerDocument.body,options.contentWindow]).on('touchstart mousedown.xdsoft',function arguments_callee6(){datetimepicker.trigger('close.xdsoft');$([options.ownerDocument.body,options.contentWindow]).off('touchstart mousedown.xdsoft',arguments_callee6)})}}}).on('close.xdsoft',function(event){var onClose=!0;month_picker.find('.xdsoft_month,.xdsoft_year').find('.xdsoft_select').hide();if(options.onClose&&$.isFunction(options.onClose)){onClose=options.onClose.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'),event)}
if(onClose!==!1&&!options.opened&&!options.inline){datetimepicker.hide()}
event.stopPropagation()}).on('toggle.xdsoft',function(){if(datetimepicker.is(':visible')){datetimepicker.trigger('close.xdsoft')}else{datetimepicker.trigger('open.xdsoft')}}).data('input',input);timer=0;datetimepicker.data('xdsoft_datetime',_xdsoft_datetime);datetimepicker.setOptions(options);function getCurrentValue(){var ct=!1,time;if(options.startDate){ct=_xdsoft_datetime.strToDate(options.startDate)}else{ct=options.value||((input&&input.val&&input.val())?input.val():'');if(ct){ct=_xdsoft_datetime.strToDateTime(ct);if(options.yearOffset){ct=new Date(ct.getFullYear()-options.yearOffset,ct.getMonth(),ct.getDate(),ct.getHours(),ct.getMinutes(),ct.getSeconds(),ct.getMilliseconds())}}else if(options.defaultDate){ct=_xdsoft_datetime.strToDateTime(options.defaultDate);if(options.defaultTime){time=_xdsoft_datetime.strtotime(options.defaultTime);ct.setHours(time.getHours());ct.setMinutes(time.getMinutes())}}}
if(ct&&_xdsoft_datetime.isValidDate(ct)){datetimepicker.data('changed',!0)}else{ct=''}
return ct||0}
function setMask(options){var isValidValue=function(mask,value){var reg=mask.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,'\\$1').replace(/_/g,'{digit+}').replace(/([0-9]{1})/g,'{digit$1}').replace(/\{digit([0-9]{1})\}/g,'[0-$1_]{1}').replace(/\{digit[\+]\}/g,'[0-9_]{1}');return(new RegExp(reg)).test(value)},getCaretPos=function(input){try{if(options.ownerDocument.selection&&options.ownerDocument.selection.createRange){var range=options.ownerDocument.selection.createRange();return range.getBookmark().charCodeAt(2)-2}
if(input.setSelectionRange){return input.selectionStart}}catch(e){return 0}},setCaretPos=function(node,pos){node=(typeof node==="string"||node instanceof String)?options.ownerDocument.getElementById(node):node;if(!node){return!1}
if(node.createTextRange){var textRange=node.createTextRange();textRange.collapse(!0);textRange.moveEnd('character',pos);textRange.moveStart('character',pos);textRange.select();return!0}
if(node.setSelectionRange){node.setSelectionRange(pos,pos);return!0}
return!1};if(options.mask){input.off('keydown.xdsoft')}
if(options.mask===!0){if(dateHelper.formatMask){options.mask=dateHelper.formatMask(options.format)}else{options.mask=options.format.replace(/Y/g,'9999').replace(/F/g,'9999').replace(/m/g,'19').replace(/d/g,'39').replace(/H/g,'29').replace(/i/g,'59').replace(/s/g,'59')}}
if($.type(options.mask)==='string'){if(!isValidValue(options.mask,input.val())){input.val(options.mask.replace(/[0-9]/g,'_'));setCaretPos(input[0],0)}
input.on('paste.xdsoft',function(event){var clipboardData=event.clipboardData||event.originalEvent.clipboardData||window.clipboardData,pastedData=clipboardData.getData('text'),val=this.value,pos=this.selectionStart
var valueBeforeCursor=val.substr(0,pos);var valueAfterPaste=val.substr(pos+pastedData.length);val=valueBeforeCursor+pastedData+valueAfterPaste;pos+=pastedData.length;if(isValidValue(options.mask,val)){this.value=val;setCaretPos(this,pos)}else if($.trim(val)===''){this.value=options.mask.replace(/[0-9]/g,'_')}else{input.trigger('error_input.xdsoft')}
event.preventDefault();return!1});input.on('keydown.xdsoft',function(event){var val=this.value,key=event.which,pos=this.selectionStart,selEnd=this.selectionEnd,hasSel=pos!==selEnd,digit;if(((key>=KEY0&&key<=KEY9)||(key>=_KEY0&&key<=_KEY9))||(key===BACKSPACE||key===DEL)){digit=(key===BACKSPACE||key===DEL)?'_':String.fromCharCode((_KEY0<=key&&key<=_KEY9)?key-KEY0:key);if(key===BACKSPACE&&pos&&!hasSel){pos-=1}
while(!0){var maskValueAtCurPos=options.mask.substr(pos,1);var posShorterThanMaskLength=pos<options.mask.length;var posGreaterThanZero=pos>0;var notNumberOrPlaceholder=/[^0-9_]/;var curPosOnSep=notNumberOrPlaceholder.test(maskValueAtCurPos);var continueMovingPosition=curPosOnSep&&posShorterThanMaskLength&&posGreaterThanZero
if(!continueMovingPosition)break;pos+=(key===BACKSPACE&&!hasSel)?-1:1}
if(event.metaKey){pos=0;hasSel=!0}
if(hasSel){var selLength=selEnd-pos
var defaultBlank=options.mask.replace(/[0-9]/g,'_');var defaultBlankSelectionReplacement=defaultBlank.substr(pos,selLength);var selReplacementRemainder=defaultBlankSelectionReplacement.substr(1)
var valueBeforeSel=val.substr(0,pos);var insertChars=digit+selReplacementRemainder;var charsAfterSelection=val.substr(pos+selLength);val=valueBeforeSel+insertChars+charsAfterSelection}else{var valueBeforeCursor=val.substr(0,pos);var insertChar=digit;var valueAfterNextChar=val.substr(pos+1);val=valueBeforeCursor+insertChar+valueAfterNextChar}
if($.trim(val)===''){val=defaultBlank}else{if(pos===options.mask.length){event.preventDefault();return!1}}
pos+=(key===BACKSPACE)?0:1;while(/[^0-9_]/.test(options.mask.substr(pos,1))&&pos<options.mask.length&&pos>0){pos+=(key===BACKSPACE)?0:1}
if(isValidValue(options.mask,val)){this.value=val;setCaretPos(this,pos)}else if($.trim(val)===''){this.value=options.mask.replace(/[0-9]/g,'_')}else{input.trigger('error_input.xdsoft')}}else{if(([AKEY,CKEY,VKEY,ZKEY,YKEY].indexOf(key)!==-1&&ctrlDown)||[ESC,ARROWUP,ARROWDOWN,ARROWLEFT,ARROWRIGHT,F5,CTRLKEY,TAB,ENTER].indexOf(key)!==-1){return!0}}
event.preventDefault();return!1})}}
_xdsoft_datetime.setCurrentTime(getCurrentValue());input.data('xdsoft_datetimepicker',datetimepicker).on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart',function(){if(input.is(':disabled')||(input.data('xdsoft_datetimepicker').is(':visible')&&options.closeOnInputClick)){return}
if(!options.openOnFocus){return}
clearTimeout(timer);timer=setTimeout(function(){if(input.is(':disabled')){return}
triggerAfterOpen=!0;_xdsoft_datetime.setCurrentTime(getCurrentValue(),!0);if(options.mask){setMask(options)}
datetimepicker.trigger('open.xdsoft')},100)}).on('keydown.xdsoft',function(event){var elementSelector,key=event.which;if([ENTER].indexOf(key)!==-1&&options.enterLikeTab){elementSelector=$("input:visible,textarea:visible,button:visible,a:visible");datetimepicker.trigger('close.xdsoft');elementSelector.eq(elementSelector.index(this)+1).focus();return!1}
if([TAB].indexOf(key)!==-1){datetimepicker.trigger('close.xdsoft');return!0}}).on('blur.xdsoft',function(){datetimepicker.trigger('close.xdsoft')})};destroyDateTimePicker=function(input){var datetimepicker=input.data('xdsoft_datetimepicker');if(datetimepicker){datetimepicker.data('xdsoft_datetime',null);datetimepicker.remove();input.data('xdsoft_datetimepicker',null).off('.xdsoft');$(options.contentWindow).off('resize.xdsoft');$([options.contentWindow,options.ownerDocument.body]).off('mousedown.xdsoft touchstart');if(input.unmousewheel){input.unmousewheel()}}};$(options.ownerDocument).off('keydown.xdsoftctrl keyup.xdsoftctrl').off('keydown.xdsoftcmd keyup.xdsoftcmd').on('keydown.xdsoftctrl',function(e){if(e.keyCode===CTRLKEY){ctrlDown=!0}}).on('keyup.xdsoftctrl',function(e){if(e.keyCode===CTRLKEY){ctrlDown=!1}}).on('keydown.xdsoftcmd',function(e){if(e.keyCode===CMDKEY){cmdDown=!0}}).on('keyup.xdsoftcmd',function(e){if(e.keyCode===CMDKEY){cmdDown=!1}});this.each(function(){var datetimepicker=$(this).data('xdsoft_datetimepicker'),$input;if(datetimepicker){if($.type(opt)==='string'){switch(opt){case 'show':$(this).select().focus();datetimepicker.trigger('open.xdsoft');break;case 'hide':datetimepicker.trigger('close.xdsoft');break;case 'toggle':datetimepicker.trigger('toggle.xdsoft');break;case 'destroy':destroyDateTimePicker($(this));break;case 'reset':this.value=this.defaultValue;if(!this.value||!datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value,options.format))){datetimepicker.data('changed',!1)}
datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);break;case 'validate':$input=datetimepicker.data('input');$input.trigger('blur.xdsoft');break;default:if(datetimepicker[opt]&&$.isFunction(datetimepicker[opt])){result=datetimepicker[opt](opt2)}}}else{datetimepicker.setOptions(opt)}
return 0}
if($.type(opt)!=='string'){if(!options.lazyInit||options.open||options.inline){createDateTimePicker($(this))}else{lazyInit($(this))}}});return result};$.fn.datetimepicker.defaults=default_options;function HighlightedDate(date,desc,style){"use strict";this.date=date;this.desc=desc;this.style=style}};(function(factory){if(typeof define==='function'&&define.amd){define(['jquery','jquery-mousewheel'],factory)}else if(typeof exports==='object'){module.exports=factory(require('jquery'))}else{factory(jQuery)}}(datetimepickerFactory));
/*!
 * jQuery Mousewheel 3.1.13
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 */
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof exports==='object'){module.exports=factory}else{factory(jQuery)}}(function($){var toFix=['wheel','mousewheel','DOMMouseScroll','MozMousePixelScroll'],toBind=('onwheel' in document||document.documentMode>=9)?['wheel']:['mousewheel','DomMouseScroll','MozMousePixelScroll'],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks){for(var i=toFix.length;i;){$.event.fixHooks[toFix[--i]]=$.event.mouseHooks}}
var special=$.event.special.mousewheel={version:'3.1.12',setup:function(){if(this.addEventListener){for(var i=toBind.length;i;){this.addEventListener(toBind[--i],handler,!1)}}else{this.onmousewheel=handler}
$.data(this,'mousewheel-line-height',special.getLineHeight(this));$.data(this,'mousewheel-page-height',special.getPageHeight(this))},teardown:function(){if(this.removeEventListener){for(var i=toBind.length;i;){this.removeEventListener(toBind[--i],handler,!1)}}else{this.onmousewheel=null}
$.removeData(this,'mousewheel-line-height');$.removeData(this,'mousewheel-page-height')},getLineHeight:function(elem){var $elem=$(elem),$parent=$elem['offsetParent' in $.fn?'offsetParent':'parent']();if(!$parent.length){$parent=$('body')}
return parseInt($parent.css('fontSize'),10)||parseInt($elem.css('fontSize'),10)||16},getPageHeight:function(elem){return $(elem).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};$.fn.extend({mousewheel:function(fn){return fn?this.bind('mousewheel',fn):this.trigger('mousewheel')},unmousewheel:function(fn){return this.unbind('mousewheel',fn)}});function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0,offsetX=0,offsetY=0;event=$.event.fix(orgEvent);event.type='mousewheel';if('detail' in orgEvent){deltaY=orgEvent.detail*-1}
if('wheelDelta' in orgEvent){deltaY=orgEvent.wheelDelta}
if('wheelDeltaY' in orgEvent){deltaY=orgEvent.wheelDeltaY}
if('wheelDeltaX' in orgEvent){deltaX=orgEvent.wheelDeltaX*-1}
if('axis' in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaX=deltaY*-1;deltaY=0}
delta=deltaY===0?deltaX:deltaY;if('deltaY' in orgEvent){deltaY=orgEvent.deltaY*-1;delta=deltaY}
if('deltaX' in orgEvent){deltaX=orgEvent.deltaX;if(deltaY===0){delta=deltaX*-1}}
if(deltaY===0&&deltaX===0){return}
if(orgEvent.deltaMode===1){var lineHeight=$.data(this,'mousewheel-line-height');delta*=lineHeight;deltaY*=lineHeight;deltaX*=lineHeight}else if(orgEvent.deltaMode===2){var pageHeight=$.data(this,'mousewheel-page-height');delta*=pageHeight;deltaY*=pageHeight;deltaX*=pageHeight}
absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX));if(!lowestDelta||absDelta<lowestDelta){lowestDelta=absDelta;if(shouldAdjustOldDeltas(orgEvent,absDelta)){lowestDelta/=40}}
if(shouldAdjustOldDeltas(orgEvent,absDelta)){delta/=40;deltaX/=40;deltaY/=40}
delta=Math[delta>=1?'floor':'ceil'](delta/lowestDelta);deltaX=Math[deltaX>=1?'floor':'ceil'](deltaX/lowestDelta);deltaY=Math[deltaY>=1?'floor':'ceil'](deltaY/lowestDelta);if(special.settings.normalizeOffset&&this.getBoundingClientRect){var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left;offsetY=event.clientY-boundingRect.top}
event.deltaX=deltaX;event.deltaY=deltaY;event.deltaFactor=lowestDelta;event.offsetX=offsetX;event.offsetY=offsetY;event.deltaMode=0;args.unshift(event,delta,deltaX,deltaY);if(nullLowestDeltaTimeout){clearTimeout(nullLowestDeltaTimeout)}
nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200);return($.event.dispatch||$.event.handle).apply(this,args)}
function nullLowestDelta(){lowestDelta=null}
function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&orgEvent.type==='mousewheel'&&absDelta%120===0}}));(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Shuffle=factory())}(this,(function(){'use strict';function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}
function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;if("value" in descriptor)descriptor.writable=!0;Object.defineProperty(target,descriptor.key,descriptor)}}
function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor}
function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function")}
subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});if(superClass)_setPrototypeOf(subClass,superClass);}
function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o)}
function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o};return _setPrototypeOf(o,p)}
function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy==="function")return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return!0}catch(e){return!1}}
function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}
return self}
function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call}
return _assertThisInitialized(self)}
function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else{result=Super.apply(this,arguments)}
return _possibleConstructorReturn(this,result)}}
var tinyEmitter={exports:{}};function E(){}
E.prototype={on:function(name,callback,ctx){var e=this.e||(this.e={});(e[name]||(e[name]=[])).push({fn:callback,ctx:ctx});return this},once:function(name,callback,ctx){var self=this;function listener(){self.off(name,listener);callback.apply(ctx,arguments)}
listener._=callback;return this.on(name,listener,ctx)},emit:function(name){var data=[].slice.call(arguments,1);var evtArr=((this.e||(this.e={}))[name]||[]).slice();var i=0;var len=evtArr.length;for(i;i<len;i++){evtArr[i].fn.apply(evtArr[i].ctx,data)}
return this},off:function(name,callback){var e=this.e||(this.e={});var evts=e[name];var liveEvents=[];if(evts&&callback){for(var i=0,len=evts.length;i<len;i++){if(evts[i].fn!==callback&&evts[i].fn._!==callback)
liveEvents.push(evts[i]);}}(liveEvents.length)?e[name]=liveEvents:delete e[name];return this}};tinyEmitter.exports=E;tinyEmitter.exports.TinyEmitter=E;var TinyEmitter=tinyEmitter.exports;var proto=typeof Element!=='undefined'?Element.prototype:{};var vendor=proto.matches||proto.matchesSelector||proto.webkitMatchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector;var matchesSelector=match;function match(el,selector){if(!el||el.nodeType!==1)return!1;if(vendor)return vendor.call(el,selector);var nodes=el.parentNode.querySelectorAll(selector);for(var i=0;i<nodes.length;i++){if(nodes[i]==el)return!0}
return!1}
var throttleit=throttle;function throttle(func,wait){var ctx,args,rtn,timeoutID;var last=0;return function throttled(){ctx=this;args=arguments;var delta=new Date()-last;if(!timeoutID)
if(delta>=wait)call();else timeoutID=setTimeout(call,wait-delta);return rtn};function call(){timeoutID=0;last=+new Date();rtn=func.apply(ctx,args);ctx=null;args=null}}
var arrayParallel=function parallel(fns,context,callback){if(!callback){if(typeof context==='function'){callback=context;context=null}else{callback=noop}}
var pending=fns&&fns.length;if(!pending)return callback(null,[]);var finished=!1;var results=new Array(pending);fns.forEach(context?function(fn,i){fn.call(context,maybeDone(i))}:function(fn,i){fn(maybeDone(i))});function maybeDone(i){return function(err,result){if(finished)return;if(err){callback(err,results);finished=!0;return}
results[i]=result;if(!--pending)callback(null,results);}}};function noop(){}
function getNumber(value){return parseFloat(value)||0}
var Point=function(){function Point(x,y){_classCallCheck(this,Point);this.x=getNumber(x);this.y=getNumber(y)}
_createClass(Point,null,[{key:"equals",value:function equals(a,b){return a.x===b.x&&a.y===b.y}}]);return Point}();var Rect=function(){function Rect(x,y,w,h,id){_classCallCheck(this,Rect);this.id=id;this.left=x;this.top=y;this.width=w;this.height=h}
_createClass(Rect,null,[{key:"intersects",value:function intersects(a,b){return a.left<b.left+b.width&&b.left<a.left+a.width&&a.top<b.top+b.height&&b.top<a.top+a.height}}]);return Rect}();var Classes={BASE:'shuffle',SHUFFLE_ITEM:'shuffle-item',VISIBLE:'shuffle-item--visible',HIDDEN:'shuffle-item--hidden'};var id$1=0;var ShuffleItem=function(){function ShuffleItem(element,isRTL){_classCallCheck(this,ShuffleItem);id$1+=1;this.id=id$1;this.element=element;this.isRTL=isRTL;this.isVisible=!0;this.isHidden=!1}
_createClass(ShuffleItem,[{key:"show",value:function show(){this.isVisible=!0;this.element.classList.remove(Classes.HIDDEN);this.element.classList.add(Classes.VISIBLE);this.element.removeAttribute('aria-hidden')}},{key:"hide",value:function hide(){this.isVisible=!1;this.element.classList.remove(Classes.VISIBLE);this.element.classList.add(Classes.HIDDEN);this.element.setAttribute('aria-hidden',!0)}},{key:"init",value:function init(){this.addClasses([Classes.SHUFFLE_ITEM,Classes.VISIBLE]);this.applyCss(ShuffleItem.Css.INITIAL);this.applyCss(this.isRTL?ShuffleItem.Css.DIRECTION.rtl:ShuffleItem.Css.DIRECTION.ltr);this.scale=ShuffleItem.Scale.VISIBLE;this.point=new Point()}},{key:"addClasses",value:function addClasses(classes){var _this=this;classes.forEach(function(className){_this.element.classList.add(className)})}},{key:"removeClasses",value:function removeClasses(classes){var _this2=this;classes.forEach(function(className){_this2.element.classList.remove(className)})}},{key:"applyCss",value:function applyCss(obj){var _this3=this;Object.keys(obj).forEach(function(key){_this3.element.style[key]=obj[key]})}},{key:"dispose",value:function dispose(){this.removeClasses([Classes.HIDDEN,Classes.VISIBLE,Classes.SHUFFLE_ITEM]);this.element.removeAttribute('style');this.element=null}}]);return ShuffleItem}();ShuffleItem.Css={INITIAL:{position:'absolute',top:0,visibility:'visible',willChange:'transform'},DIRECTION:{ltr:{left:0},rtl:{right:0}},VISIBLE:{before:{opacity:1,visibility:'visible'},after:{transitionDelay:''}},HIDDEN:{before:{opacity:0},after:{visibility:'hidden',transitionDelay:''}}};ShuffleItem.Scale={VISIBLE:1,HIDDEN:0.001};var value=null;var testComputedSize=(function(){if(value!==null){return value}
var element=document.body||document.documentElement;var e=document.createElement('div');e.style.cssText='width:10px;padding:2px;box-sizing:border-box;';element.appendChild(e);var _window$getComputedSt=window.getComputedStyle(e,null),width=_window$getComputedSt.width;value=Math.round(getNumber(width))===10;element.removeChild(e);return value});function getNumberStyle(element,style){var styles=arguments.length>2&&arguments[2]!==undefined?arguments[2]:window.getComputedStyle(element,null);var value=getNumber(styles[style]);if(!testComputedSize()&&style==='width'){value+=getNumber(styles.paddingLeft)+getNumber(styles.paddingRight)+getNumber(styles.borderLeftWidth)+getNumber(styles.borderRightWidth)}else if(!testComputedSize()&&style==='height'){value+=getNumber(styles.paddingTop)+getNumber(styles.paddingBottom)+getNumber(styles.borderTopWidth)+getNumber(styles.borderBottomWidth)}
return value}
function randomize(array){var n=array.length;while(n){n-=1;var i=Math.floor(Math.random()*(n+1));var temp=array[i];array[i]=array[n];array[n]=temp}
return array}
var defaults={reverse:!1,by:null,compare:null,randomize:!1,key:'element'};function sorter(arr,options){var opts=Object.assign({},defaults,options);var original=Array.from(arr);var revert=!1;if(!arr.length){return[]}
if(opts.randomize){return randomize(arr)}
if(typeof opts.by==='function'){arr.sort(function(a,b){if(revert){return 0}
var valA=opts.by(a[opts.key]);var valB=opts.by(b[opts.key]);if(valA===undefined&&valB===undefined){revert=!0;return 0}
if(valA<valB||valA==='sortFirst'||valB==='sortLast'){return-1}
if(valA>valB||valA==='sortLast'||valB==='sortFirst'){return 1}
return 0})}else if(typeof opts.compare==='function'){arr.sort(opts.compare)}
if(revert){return original}
if(opts.reverse){arr.reverse()}
return arr}
var transitions={};var eventName='transitionend';var count=0;function uniqueId(){count+=1;return eventName+count}
function cancelTransitionEnd(id){if(transitions[id]){transitions[id].element.removeEventListener(eventName,transitions[id].listener);transitions[id]=null;return!0}
return!1}
function onTransitionEnd(element,callback){var id=uniqueId();var listener=function listener(evt){if(evt.currentTarget===evt.target){cancelTransitionEnd(id);callback(evt)}};element.addEventListener(eventName,listener);transitions[id]={element:element,listener:listener};return id}
function arrayMax(array){return Math.max.apply(Math,array)}
function arrayMin(array){return Math.min.apply(Math,array)}
function getColumnSpan(itemWidth,columnWidth,columns,threshold){var columnSpan=itemWidth/columnWidth;if(Math.abs(Math.round(columnSpan)-columnSpan)<threshold){columnSpan=Math.round(columnSpan)}
return Math.min(Math.ceil(columnSpan),columns)}
function getAvailablePositions(positions,columnSpan,columns){if(columnSpan===1){return positions}
var available=[];for(var i=0;i<=columns-columnSpan;i++){available.push(arrayMax(positions.slice(i,i+columnSpan)))}
return available}
function getShortColumn(positions,buffer){var minPosition=arrayMin(positions);for(var i=0,len=positions.length;i<len;i++){if(positions[i]>=minPosition-buffer&&positions[i]<=minPosition+buffer){return i}}
return 0}
function getItemPosition(_ref){var itemSize=_ref.itemSize,positions=_ref.positions,gridSize=_ref.gridSize,total=_ref.total,threshold=_ref.threshold,buffer=_ref.buffer;var span=getColumnSpan(itemSize.width,gridSize,total,threshold);var setY=getAvailablePositions(positions,span,total);var shortColumnIndex=getShortColumn(setY,buffer);var point=new Point(gridSize*shortColumnIndex,setY[shortColumnIndex]);var setHeight=setY[shortColumnIndex]+itemSize.height;for(var i=0;i<span;i++){positions[shortColumnIndex+i]=setHeight}
return point}
function getCenteredPositions(itemRects,containerWidth){var rowMap={};itemRects.forEach(function(itemRect){if(rowMap[itemRect.top]){rowMap[itemRect.top].push(itemRect)}else{rowMap[itemRect.top]=[itemRect]}});var rects=[];var rows=[];var centeredRows=[];Object.keys(rowMap).forEach(function(key){var itemRects=rowMap[key];rows.push(itemRects);var lastItem=itemRects[itemRects.length-1];var end=lastItem.left+lastItem.width;var offset=Math.round((containerWidth-end)/2);var finalRects=itemRects;var canMove=!1;if(offset>0){var newRects=[];canMove=itemRects.every(function(r){var newRect=new Rect(r.left+offset,r.top,r.width,r.height,r.id);var noOverlap=!rects.some(function(r){return Rect.intersects(newRect,r)});newRects.push(newRect);return noOverlap});if(canMove){finalRects=newRects}}
if(!canMove){var intersectingRect;var hasOverlap=itemRects.some(function(itemRect){return rects.some(function(r){var intersects=Rect.intersects(itemRect,r);if(intersects){intersectingRect=r}
return intersects})});if(hasOverlap){var rowIndex=centeredRows.findIndex(function(items){return items.includes(intersectingRect)});centeredRows.splice(rowIndex,1,rows[rowIndex])}}
rects=rects.concat(finalRects);centeredRows.push(finalRects)});return[].concat.apply([],centeredRows).sort(function(a,b){return a.id-b.id}).map(function(itemRect){return new Point(itemRect.left,itemRect.top)})}
function hyphenate(str){return str.replace(/([A-Z])/g,function(str,m1){return"-".concat(m1.toLowerCase())})}
function arrayUnique(x){return Array.from(new Set(x))}
var id=0;var Shuffle=function(_TinyEmitter){_inherits(Shuffle,_TinyEmitter);var _super=_createSuper(Shuffle);function Shuffle(element){var _this;var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Shuffle);_this=_super.call(this);_this.options=Object.assign({},Shuffle.options,options);if(_this.options.delimeter){_this.options.delimiter=_this.options.delimeter}
_this.lastSort={};_this.group=Shuffle.ALL_ITEMS;_this.lastFilter=Shuffle.ALL_ITEMS;_this.isEnabled=!0;_this.isDestroyed=!1;_this.isInitialized=!1;_this._transitions=[];_this.isTransitioning=!1;_this._queue=[];var el=_this._getElementOption(element);if(!el){throw new TypeError('Shuffle needs to be initialized with an element.')}
_this.element=el;_this.id='shuffle_'+id;id+=1;_this._init();_this.isInitialized=!0;return _this}
_createClass(Shuffle,[{key:"_init",value:function _init(){this.items=this._getItems();this.sortedItems=this.items;this.options.sizer=this._getElementOption(this.options.sizer);this.element.classList.add(Shuffle.Classes.BASE);this._initItems(this.items);this._onResize=this._getResizeFunction();window.addEventListener('resize',this._onResize);if(document.readyState!=='complete'){var layout=this.layout.bind(this);window.addEventListener('load',function onLoad(){window.removeEventListener('load',onLoad);layout()})}
var containerCss=window.getComputedStyle(this.element,null);var containerWidth=Shuffle.getSize(this.element).width;this._validateStyles(containerCss);this._setColumns(containerWidth);this.filter(this.options.group,this.options.initialSort);this.element.offsetWidth;this.setItemTransitions(this.items);this.element.style.transition="height ".concat(this.options.speed,"ms ").concat(this.options.easing)}},{key:"_getResizeFunction",value:function _getResizeFunction(){var resizeFunction=this._handleResize.bind(this);return this.options.throttle?this.options.throttle(resizeFunction,this.options.throttleTime):resizeFunction}},{key:"_getElementOption",value:function _getElementOption(option){if(typeof option==='string'){return this.element.querySelector(option)}
if(option&&option.nodeType&&option.nodeType===1){return option}
if(option&&option.jquery){return option[0]}
return null}},{key:"_validateStyles",value:function _validateStyles(styles){if(styles.position==='static'){this.element.style.position='relative'}
if(styles.overflow!=='hidden'){this.element.style.overflow='hidden'}}},{key:"_filter",value:function _filter(){var category=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.lastFilter;var collection=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.items;var set=this._getFilteredSets(category,collection);this._toggleFilterClasses(set);this.lastFilter=category;if(typeof category==='string'){this.group=category}
return set}},{key:"_getFilteredSets",value:function _getFilteredSets(category,items){var _this2=this;var visible=[];var hidden=[];if(category===Shuffle.ALL_ITEMS){visible=items}else{items.forEach(function(item){if(_this2._doesPassFilter(category,item.element)){visible.push(item)}else{hidden.push(item)}})}
return{visible:visible,hidden:hidden}}},{key:"_doesPassFilter",value:function _doesPassFilter(category,element){if(typeof category==='function'){return category.call(element,element,this)}
var attr=element.getAttribute('data-'+Shuffle.FILTER_ATTRIBUTE_KEY);var keys=this.options.delimiter?attr.split(this.options.delimiter):JSON.parse(attr);function testCategory(category){return keys.includes(category)}
if(Array.isArray(category)){if(this.options.filterMode===Shuffle.FilterMode.ANY){return category.some(testCategory)}
return category.every(testCategory)}
return keys.includes(category)}},{key:"_toggleFilterClasses",value:function _toggleFilterClasses(_ref){var visible=_ref.visible,hidden=_ref.hidden;visible.forEach(function(item){item.show()});hidden.forEach(function(item){item.hide()})}},{key:"_initItems",value:function _initItems(items){items.forEach(function(item){item.init()})}},{key:"_disposeItems",value:function _disposeItems(items){items.forEach(function(item){item.dispose()})}},{key:"_updateItemCount",value:function _updateItemCount(){this.visibleItems=this._getFilteredItems().length}},{key:"setItemTransitions",value:function setItemTransitions(items){var _this$options=this.options,speed=_this$options.speed,easing=_this$options.easing;var positionProps=this.options.useTransforms?['transform']:['top','left'];var cssProps=Object.keys(ShuffleItem.Css.HIDDEN.before).map(function(k){return hyphenate(k)});var properties=positionProps.concat(cssProps).join();items.forEach(function(item){item.element.style.transitionDuration=speed+'ms';item.element.style.transitionTimingFunction=easing;item.element.style.transitionProperty=properties})}},{key:"_getItems",value:function _getItems(){var _this3=this;return Array.from(this.element.children).filter(function(el){return matchesSelector(el,_this3.options.itemSelector)}).map(function(el){return new ShuffleItem(el,_this3.options.isRTL)})}},{key:"_mergeNewItems",value:function _mergeNewItems(items){var children=Array.from(this.element.children);return sorter(this.items.concat(items),{by:function by(element){return children.indexOf(element)}})}},{key:"_getFilteredItems",value:function _getFilteredItems(){return this.items.filter(function(item){return item.isVisible})}},{key:"_getConcealedItems",value:function _getConcealedItems(){return this.items.filter(function(item){return!item.isVisible})}},{key:"_getColumnSize",value:function _getColumnSize(containerWidth,gutterSize){var size;if(typeof this.options.columnWidth==='function'){size=this.options.columnWidth(containerWidth)}else if(this.options.sizer){size=Shuffle.getSize(this.options.sizer).width}else if(this.options.columnWidth){size=this.options.columnWidth}else if(this.items.length>0){size=Shuffle.getSize(this.items[0].element,!0).width}else{size=containerWidth}
if(size===0){size=containerWidth}
return size+gutterSize}},{key:"_getGutterSize",value:function _getGutterSize(containerWidth){var size;if(typeof this.options.gutterWidth==='function'){size=this.options.gutterWidth(containerWidth)}else if(this.options.sizer){size=getNumberStyle(this.options.sizer,'marginLeft')}else{size=this.options.gutterWidth}
return size}},{key:"_setColumns",value:function _setColumns(){var containerWidth=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Shuffle.getSize(this.element).width;var gutter=this._getGutterSize(containerWidth);var columnWidth=this._getColumnSize(containerWidth,gutter);var calculatedColumns=(containerWidth+gutter)/columnWidth;if(Math.abs(Math.round(calculatedColumns)-calculatedColumns)<this.options.columnThreshold){calculatedColumns=Math.round(calculatedColumns)}
this.cols=Math.max(Math.floor(calculatedColumns||0),1);this.containerWidth=containerWidth;this.colWidth=columnWidth}},{key:"_setContainerSize",value:function _setContainerSize(){this.element.style.height=this._getContainerSize()+'px'}},{key:"_getContainerSize",value:function _getContainerSize(){return arrayMax(this.positions)}},{key:"_getStaggerAmount",value:function _getStaggerAmount(index){return Math.min(index*this.options.staggerAmount,this.options.staggerAmountMax)}},{key:"_dispatch",value:function _dispatch(name){var data=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.isDestroyed){return}
data.shuffle=this;this.emit(name,data)}},{key:"_resetCols",value:function _resetCols(){var i=this.cols;this.positions=[];while(i){i-=1;this.positions.push(0)}}},{key:"_layout",value:function _layout(items){var _this4=this;var itemPositions=this._getNextPositions(items);var count=0;items.forEach(function(item,i){function callback(){item.applyCss(ShuffleItem.Css.VISIBLE.after)}
if(Point.equals(item.point,itemPositions[i])&&!item.isHidden){item.applyCss(ShuffleItem.Css.VISIBLE.before);callback();return}
item.point=itemPositions[i];item.scale=ShuffleItem.Scale.VISIBLE;item.isHidden=!1;var styles=_this4.getStylesForTransition(item,ShuffleItem.Css.VISIBLE.before);styles.transitionDelay=_this4._getStaggerAmount(count)+'ms';_this4._queue.push({item:item,styles:styles,callback:callback});count+=1})}},{key:"_getNextPositions",value:function _getNextPositions(items){var _this5=this;if(this.options.isCentered){var itemsData=items.map(function(item,i){var itemSize=Shuffle.getSize(item.element,!0);var point=_this5._getItemPosition(itemSize);return new Rect(point.x,point.y,itemSize.width,itemSize.height,i)});return this.getTransformedPositions(itemsData,this.containerWidth)}
return items.map(function(item){return _this5._getItemPosition(Shuffle.getSize(item.element,!0))})}},{key:"_getItemPosition",value:function _getItemPosition(itemSize){return getItemPosition({itemSize:itemSize,positions:this.positions,gridSize:this.colWidth,total:this.cols,threshold:this.options.columnThreshold,buffer:this.options.buffer})}},{key:"getTransformedPositions",value:function getTransformedPositions(itemRects,containerWidth){return getCenteredPositions(itemRects,containerWidth)}},{key:"_shrink",value:function _shrink(){var _this6=this;var collection=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this._getConcealedItems();var count=0;collection.forEach(function(item){function callback(){item.applyCss(ShuffleItem.Css.HIDDEN.after)}
if(item.isHidden){item.applyCss(ShuffleItem.Css.HIDDEN.before);callback();return}
item.scale=ShuffleItem.Scale.HIDDEN;item.isHidden=!0;var styles=_this6.getStylesForTransition(item,ShuffleItem.Css.HIDDEN.before);styles.transitionDelay=_this6._getStaggerAmount(count)+'ms';_this6._queue.push({item:item,styles:styles,callback:callback});count+=1})}},{key:"_handleResize",value:function _handleResize(){if(!this.isEnabled||this.isDestroyed){return}
this.update()}},{key:"getStylesForTransition",value:function getStylesForTransition(item,styleObject){var styles=Object.assign({},styleObject);if(this.options.useTransforms){var sign=this.options.isRTL?'-':'';var x=this.options.roundTransforms?Math.round(item.point.x):item.point.x;var y=this.options.roundTransforms?Math.round(item.point.y):item.point.y;styles.transform="translate(".concat(sign).concat(x,"px, ").concat(y,"px) scale(").concat(item.scale,")")}else{if(this.options.isRTL){styles.right=item.point.x+'px'}else{styles.left=item.point.x+'px'}
styles.top=item.point.y+'px'}
return styles}},{key:"_whenTransitionDone",value:function _whenTransitionDone(element,itemCallback,done){var id=onTransitionEnd(element,function(evt){itemCallback();done(null,evt)});this._transitions.push(id)}},{key:"_getTransitionFunction",value:function _getTransitionFunction(opts){var _this7=this;return function(done){opts.item.applyCss(opts.styles);_this7._whenTransitionDone(opts.item.element,opts.callback,done)}}},{key:"_processQueue",value:function _processQueue(){if(this.isTransitioning){this._cancelMovement()}
var hasSpeed=this.options.speed>0;var hasQueue=this._queue.length>0;if(hasQueue&&hasSpeed&&this.isInitialized){this._startTransitions(this._queue)}else if(hasQueue){this._styleImmediately(this._queue);this._dispatch(Shuffle.EventType.LAYOUT)}else{this._dispatch(Shuffle.EventType.LAYOUT)}
this._queue.length=0}},{key:"_startTransitions",value:function _startTransitions(transitions){var _this8=this;this.isTransitioning=!0;var callbacks=transitions.map(function(obj){return _this8._getTransitionFunction(obj)});arrayParallel(callbacks,this._movementFinished.bind(this))}},{key:"_cancelMovement",value:function _cancelMovement(){this._transitions.forEach(cancelTransitionEnd);this._transitions.length=0;this.isTransitioning=!1}},{key:"_styleImmediately",value:function _styleImmediately(objects){if(objects.length){var elements=objects.map(function(obj){return obj.item.element});Shuffle._skipTransitions(elements,function(){objects.forEach(function(obj){obj.item.applyCss(obj.styles);obj.callback()})})}}},{key:"_movementFinished",value:function _movementFinished(){this._transitions.length=0;this.isTransitioning=!1;this._dispatch(Shuffle.EventType.LAYOUT)}},{key:"filter",value:function filter(category,sortOptions){if(!this.isEnabled){return}
if(!category||category&&category.length===0){category=Shuffle.ALL_ITEMS}
this._filter(category);this._shrink();this._updateItemCount();this.sort(sortOptions)}},{key:"sort",value:function sort(){var sortOptions=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.lastSort;if(!this.isEnabled){return}
this._resetCols();var items=sorter(this._getFilteredItems(),sortOptions);this.sortedItems=items;this._layout(items);this._processQueue();this._setContainerSize();this.lastSort=sortOptions}},{key:"update",value:function update(){var isOnlyLayout=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;if(this.isEnabled){if(!isOnlyLayout){this._setColumns()}
this.sort()}}},{key:"layout",value:function layout(){this.update(!0)}},{key:"add",value:function add(newItems){var _this9=this;var items=arrayUnique(newItems).map(function(el){return new ShuffleItem(el,_this9.options.isRTL)});this._initItems(items);this._resetCols();var allItems=this._mergeNewItems(items);var sortedItems=sorter(allItems,this.lastSort);var allSortedItemsSet=this._filter(this.lastFilter,sortedItems);var isNewItem=function isNewItem(item){return items.includes(item)};var applyHiddenState=function applyHiddenState(item){item.scale=ShuffleItem.Scale.HIDDEN;item.isHidden=!0;item.applyCss(ShuffleItem.Css.HIDDEN.before);item.applyCss(ShuffleItem.Css.HIDDEN.after)};var itemPositions=this._getNextPositions(allSortedItemsSet.visible);allSortedItemsSet.visible.forEach(function(item,i){if(isNewItem(item)){item.point=itemPositions[i];applyHiddenState(item);item.applyCss(_this9.getStylesForTransition(item,{}))}});allSortedItemsSet.hidden.forEach(function(item){if(isNewItem(item)){applyHiddenState(item)}});this.element.offsetWidth;this.setItemTransitions(items);this.items=this._mergeNewItems(items);this.filter(this.lastFilter)}},{key:"disable",value:function disable(){this.isEnabled=!1}},{key:"enable",value:function enable(){var isUpdateLayout=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;this.isEnabled=!0;if(isUpdateLayout){this.update()}}},{key:"remove",value:function remove(elements){var _this10=this;if(!elements.length){return}
var collection=arrayUnique(elements);var oldItems=collection.map(function(element){return _this10.getItemByElement(element)}).filter(function(item){return!!item});var handleLayout=function handleLayout(){_this10._disposeItems(oldItems);collection.forEach(function(element){element.parentNode.removeChild(element)});_this10._dispatch(Shuffle.EventType.REMOVED,{collection:collection})};this._toggleFilterClasses({visible:[],hidden:oldItems});this._shrink(oldItems);this.sort();this.items=this.items.filter(function(item){return!oldItems.includes(item)});this._updateItemCount();this.once(Shuffle.EventType.LAYOUT,handleLayout)}},{key:"getItemByElement",value:function getItemByElement(element){return this.items.find(function(item){return item.element===element})}},{key:"resetItems",value:function resetItems(){var _this11=this;this._disposeItems(this.items);this.isInitialized=!1;this.items=this._getItems();this._initItems(this.items);this.once(Shuffle.EventType.LAYOUT,function(){_this11.setItemTransitions(_this11.items);_this11.isInitialized=!0});this.filter(this.lastFilter)}},{key:"destroy",value:function destroy(){this._cancelMovement();window.removeEventListener('resize',this._onResize);this.element.classList.remove('shuffle');this.element.removeAttribute('style');this._disposeItems(this.items);this.items.length=0;this._transitions.length=0;this.options.sizer=null;this.element=null;this.isDestroyed=!0;this.isEnabled=!1}}],[{key:"getSize",value:function getSize(element){var includeMargins=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var styles=window.getComputedStyle(element,null);var width=getNumberStyle(element,'width',styles);var height=getNumberStyle(element,'height',styles);if(includeMargins){var marginLeft=getNumberStyle(element,'marginLeft',styles);var marginRight=getNumberStyle(element,'marginRight',styles);var marginTop=getNumberStyle(element,'marginTop',styles);var marginBottom=getNumberStyle(element,'marginBottom',styles);width+=marginLeft+marginRight;height+=marginTop+marginBottom}
return{width:width,height:height}}},{key:"_skipTransitions",value:function _skipTransitions(elements,callback){var zero='0ms';var data=elements.map(function(element){var style=element.style;var duration=style.transitionDuration;var delay=style.transitionDelay;style.transitionDuration=zero;style.transitionDelay=zero;return{duration:duration,delay:delay}});callback();elements[0].offsetWidth;elements.forEach(function(element,i){element.style.transitionDuration=data[i].duration;element.style.transitionDelay=data[i].delay})}}]);return Shuffle}(TinyEmitter);Shuffle.ShuffleItem=ShuffleItem;Shuffle.ALL_ITEMS='all';Shuffle.FILTER_ATTRIBUTE_KEY='groups';Shuffle.EventType={LAYOUT:'shuffle:layout',REMOVED:'shuffle:removed'};Shuffle.Classes=Classes;Shuffle.FilterMode={ANY:'any',ALL:'all'};Shuffle.options={group:Shuffle.ALL_ITEMS,speed:250,easing:'cubic-bezier(0.4, 0.0, 0.2, 1)',itemSelector:'*',sizer:null,gutterWidth:0,columnWidth:0,delimiter:null,buffer:0,columnThreshold:0.01,initialSort:null,throttle:throttleit,throttleTime:300,staggerAmount:15,staggerAmountMax:150,useTransforms:!0,filterMode:Shuffle.FilterMode.ANY,isCentered:!1,isRTL:!1,roundTransforms:!0};Shuffle.Point=Point;Shuffle.Rect=Rect;Shuffle.__sorter=sorter;Shuffle.__getColumnSpan=getColumnSpan;Shuffle.__getAvailablePositions=getAvailablePositions;Shuffle.__getShortColumn=getShortColumn;Shuffle.__getCenteredPositions=getCenteredPositions;return Shuffle})));(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof exports==='object'){module.exports=factory(require('jquery'))}else{factory(jQuery)}}(function($){'use strict';$.minicolors={defaults:{animationSpeed:50,animationEasing:'swing',change:null,changeDelay:0,control:'hue',defaultValue:'',format:'hex',hide:null,hideSpeed:100,inline:!1,keywords:'',letterCase:'lowercase',opacity:!1,position:'bottom',show:null,showSpeed:100,theme:'default',swatches:[]}};$.extend($.fn,{minicolors:function(method,data){switch(method){case 'destroy':$(this).each(function(){destroy($(this))});return $(this);case 'hide':hide();return $(this);case 'opacity':if(data===undefined){return $(this).attr('data-opacity')}else{$(this).each(function(){updateFromInput($(this).attr('data-opacity',data))})}
return $(this);case 'rgbObject':return rgbObject($(this),method==='rgbaObject');case 'rgbString':case 'rgbaString':return rgbString($(this),method==='rgbaString');case 'settings':if(data===undefined){return $(this).data('minicolors-settings')}else{$(this).each(function(){var settings=$(this).data('minicolors-settings')||{};destroy($(this));$(this).minicolors($.extend(!0,settings,data))})}
return $(this);case 'show':show($(this).eq(0));return $(this);case 'value':if(data===undefined){return $(this).val()}else{$(this).each(function(){if(typeof(data)==='object'&&data!==null){if(data.opacity!==undefined){$(this).attr('data-opacity',keepWithin(data.opacity,0,1))}
if(data.color){$(this).val(data.color)}}else{$(this).val(data)}
updateFromInput($(this))})}
return $(this);default:if(method!=='create')data=method;$(this).each(function(){init($(this),data)});return $(this)}}});function init(input,settings){var minicolors=$('<div class="minicolors" />');var defaults=$.minicolors.defaults;var name;var size;var swatches;var swatch;var swatchString;var panel;var i;if(input.data('minicolors-initialized'))return;settings=$.extend(!0,{},defaults,settings);minicolors.addClass('minicolors-theme-'+settings.theme).toggleClass('minicolors-with-opacity',settings.opacity);if(settings.position!==undefined){$.each(settings.position.split(' '),function(){minicolors.addClass('minicolors-position-'+this)})}
if(settings.format==='rgb'){size=settings.opacity?'25':'20'}else{size=settings.keywords?'11':'7'}
input.addClass('minicolors-input').data('minicolors-initialized',!1).data('minicolors-settings',settings).prop('size',size).wrap(minicolors).after('<div class="minicolors-panel minicolors-slider-'+settings.control+'">'+'<div class="minicolors-slider minicolors-sprite">'+'<div class="minicolors-picker"></div>'+'</div>'+'<div class="minicolors-opacity-slider minicolors-sprite">'+'<div class="minicolors-picker"></div>'+'</div>'+'<div class="minicolors-grid minicolors-sprite">'+'<div class="minicolors-grid-inner"></div>'+'<div class="minicolors-picker"><div></div></div>'+'</div>'+'</div>');if(!settings.inline){input.after('<span class="minicolors-swatch minicolors-sprite minicolors-input-swatch"><span class="minicolors-swatch-color"></span></span>');input.next('.minicolors-input-swatch').on('click',function(event){event.preventDefault();input.trigger('focus')})}
panel=input.parent().find('.minicolors-panel');panel.on('selectstart',function(){return!1}).end();if(settings.swatches&&settings.swatches.length!==0){panel.addClass('minicolors-with-swatches');swatches=$('<ul class="minicolors-swatches"></ul>').appendTo(panel);for(i=0;i<settings.swatches.length;++i){if(typeof settings.swatches[i]==='object'){name=settings.swatches[i].name;swatch=settings.swatches[i].color}else{name='';swatch=settings.swatches[i]}
swatchString=swatch;swatch=isRgb(swatch)?parseRgb(swatch,!0):hex2rgb(parseHex(swatch,!0));$('<li class="minicolors-swatch minicolors-sprite"><span class="minicolors-swatch-color"></span></li>').attr("title",name).appendTo(swatches).data('swatch-color',swatchString).find('.minicolors-swatch-color').css({backgroundColor:((swatchString!=='transparent')?rgb2hex(swatch):'transparent'),opacity:String(swatch.a)});settings.swatches[i]=swatch}}
if(settings.inline)input.parent().addClass('minicolors-inline');updateFromInput(input,!1);input.data('minicolors-initialized',!0)}
function destroy(input){var minicolors=input.parent();input.removeData('minicolors-initialized').removeData('minicolors-settings').removeProp('size').removeClass('minicolors-input');minicolors.before(input).remove()}
function show(input){var minicolors=input.parent();var panel=minicolors.find('.minicolors-panel');var settings=input.data('minicolors-settings');if(!input.data('minicolors-initialized')||input.prop('disabled')||minicolors.hasClass('minicolors-inline')||minicolors.hasClass('minicolors-focus'))return;hide();minicolors.addClass('minicolors-focus');if(panel.animate){panel.stop(!0,!0).fadeIn(settings.showSpeed,function(){if(settings.show)settings.show.call(input.get(0));})}else{panel.show();if(settings.show)settings.show.call(input.get(0));}}
function hide(){$('.minicolors-focus').each(function(){var minicolors=$(this);var input=minicolors.find('.minicolors-input');var panel=minicolors.find('.minicolors-panel');var settings=input.data('minicolors-settings');if(panel.animate){panel.fadeOut(settings.hideSpeed,function(){if(settings.hide)settings.hide.call(input.get(0));minicolors.removeClass('minicolors-focus')})}else{panel.hide();if(settings.hide)settings.hide.call(input.get(0));minicolors.removeClass('minicolors-focus')}})}
function move(target,event,animate){var input=target.parents('.minicolors').find('.minicolors-input');var settings=input.data('minicolors-settings');var picker=target.find('[class$=-picker]');var offsetX=target.offset().left;var offsetY=target.offset().top;var x=Math.round(event.pageX-offsetX);var y=Math.round(event.pageY-offsetY);var duration=animate?settings.animationSpeed:0;var wx,wy,r,phi,styles;if(event.originalEvent.changedTouches){x=event.originalEvent.changedTouches[0].pageX-offsetX;y=event.originalEvent.changedTouches[0].pageY-offsetY}
if(x<0)x=0;if(y<0)y=0;if(x>target.width())x=target.width();if(y>target.height())y=target.height();if(target.parent().is('.minicolors-slider-wheel')&&picker.parent().is('.minicolors-grid')){wx=75-x;wy=75-y;r=Math.sqrt(wx*wx+wy*wy);phi=Math.atan2(wy,wx);if(phi<0)phi+=Math.PI*2;if(r>75){r=75;x=75-(75*Math.cos(phi));y=75-(75*Math.sin(phi))}
x=Math.round(x);y=Math.round(y)}
styles={top:y+'px'};if(target.is('.minicolors-grid')){styles.left=x+'px'}
if(picker.animate){picker.stop(!0).animate(styles,duration,settings.animationEasing,function(){updateFromControl(input,target)})}else{picker.css(styles);updateFromControl(input,target)}}
function updateFromControl(input,target){function getCoords(picker,container){var left,top;if(!picker.length||!container)return null;left=picker.offset().left;top=picker.offset().top;return{x:left-container.offset().left+(picker.outerWidth()/2),y:top-container.offset().top+(picker.outerHeight()/2)}}
var hue,saturation,brightness,x,y,r,phi;var hex=input.val();var opacity=input.attr('data-opacity');var minicolors=input.parent();var settings=input.data('minicolors-settings');var swatch=minicolors.find('.minicolors-input-swatch');var grid=minicolors.find('.minicolors-grid');var slider=minicolors.find('.minicolors-slider');var opacitySlider=minicolors.find('.minicolors-opacity-slider');var gridPicker=grid.find('[class$=-picker]');var sliderPicker=slider.find('[class$=-picker]');var opacityPicker=opacitySlider.find('[class$=-picker]');var gridPos=getCoords(gridPicker,grid);var sliderPos=getCoords(sliderPicker,slider);var opacityPos=getCoords(opacityPicker,opacitySlider);if(target.is('.minicolors-grid, .minicolors-slider, .minicolors-opacity-slider')){switch(settings.control){case 'wheel':x=(grid.width()/2)-gridPos.x;y=(grid.height()/2)-gridPos.y;r=Math.sqrt(x*x+y*y);phi=Math.atan2(y,x);if(phi<0)phi+=Math.PI*2;if(r>75){r=75;gridPos.x=69-(75*Math.cos(phi));gridPos.y=69-(75*Math.sin(phi))}
saturation=keepWithin(r/0.75,0,100);hue=keepWithin(phi*180/Math.PI,0,360);brightness=keepWithin(100-Math.floor(sliderPos.y*(100/slider.height())),0,100);hex=hsb2hex({h:hue,s:saturation,b:brightness});slider.css('backgroundColor',hsb2hex({h:hue,s:saturation,b:100}));break;case 'saturation':hue=keepWithin(parseInt(gridPos.x*(360/grid.width()),10),0,360);saturation=keepWithin(100-Math.floor(sliderPos.y*(100/slider.height())),0,100);brightness=keepWithin(100-Math.floor(gridPos.y*(100/grid.height())),0,100);hex=hsb2hex({h:hue,s:saturation,b:brightness});slider.css('backgroundColor',hsb2hex({h:hue,s:100,b:brightness}));minicolors.find('.minicolors-grid-inner').css('opacity',saturation/100);break;case 'brightness':hue=keepWithin(parseInt(gridPos.x*(360/grid.width()),10),0,360);saturation=keepWithin(100-Math.floor(gridPos.y*(100/grid.height())),0,100);brightness=keepWithin(100-Math.floor(sliderPos.y*(100/slider.height())),0,100);hex=hsb2hex({h:hue,s:saturation,b:brightness});slider.css('backgroundColor',hsb2hex({h:hue,s:saturation,b:100}));minicolors.find('.minicolors-grid-inner').css('opacity',1-(brightness/100));break;default:hue=keepWithin(360-parseInt(sliderPos.y*(360/slider.height()),10),0,360);saturation=keepWithin(Math.floor(gridPos.x*(100/grid.width())),0,100);brightness=keepWithin(100-Math.floor(gridPos.y*(100/grid.height())),0,100);hex=hsb2hex({h:hue,s:saturation,b:brightness});grid.css('backgroundColor',hsb2hex({h:hue,s:100,b:100}));break}
if(settings.opacity){opacity=parseFloat(1-(opacityPos.y/opacitySlider.height())).toFixed(2)}else{opacity=1}
updateInput(input,hex,opacity)}else{swatch.find('span').css({backgroundColor:hex,opacity:String(opacity)});doChange(input,hex,opacity)}}
function updateInput(input,value,opacity){var rgb;var minicolors=input.parent();var settings=input.data('minicolors-settings');var swatch=minicolors.find('.minicolors-input-swatch');if(settings.opacity)input.attr('data-opacity',opacity);if(settings.format==='rgb'){if(isRgb(value)){rgb=parseRgb(value,!0)}else{rgb=hex2rgb(parseHex(value,!0))}
opacity=input.attr('data-opacity')===''?1:keepWithin(parseFloat(input.attr('data-opacity')).toFixed(2),0,1);if(isNaN(opacity)||!settings.opacity)opacity=1;if(input.minicolors('rgbObject').a<=1&&rgb&&settings.opacity){value='rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', '+parseFloat(opacity)+')'}else{value='rgb('+rgb.r+', '+rgb.g+', '+rgb.b+')'}}else{if(isRgb(value)){value=rgbString2hex(value)}
value=convertCase(value,settings.letterCase)}
input.val(value);swatch.find('span').css({backgroundColor:value,opacity:String(opacity)});doChange(input,value,opacity)}
function updateFromInput(input,preserveInputValue){var hex,hsb,opacity,keywords,alpha,value,x,y,r,phi;var minicolors=input.parent();var settings=input.data('minicolors-settings');var swatch=minicolors.find('.minicolors-input-swatch');var grid=minicolors.find('.minicolors-grid');var slider=minicolors.find('.minicolors-slider');var opacitySlider=minicolors.find('.minicolors-opacity-slider');var gridPicker=grid.find('[class$=-picker]');var sliderPicker=slider.find('[class$=-picker]');var opacityPicker=opacitySlider.find('[class$=-picker]');if(isRgb(input.val())){hex=rgbString2hex(input.val());alpha=keepWithin(parseFloat(getAlpha(input.val())).toFixed(2),0,1);if(alpha){input.attr('data-opacity',alpha)}}else{hex=convertCase(parseHex(input.val(),!0),settings.letterCase)}
if(!hex){hex=convertCase(parseInput(settings.defaultValue,!0),settings.letterCase)}
hsb=hex2hsb(hex);keywords=!settings.keywords?[]:$.map(settings.keywords.split(','),function(a){return a.toLowerCase().trim()});if(input.val()!==''&&$.inArray(input.val().toLowerCase(),keywords)>-1){value=convertCase(input.val())}else{value=isRgb(input.val())?parseRgb(input.val()):hex}
if(!preserveInputValue)input.val(value);if(settings.opacity){opacity=input.attr('data-opacity')===''?1:keepWithin(parseFloat(input.attr('data-opacity')).toFixed(2),0,1);if(isNaN(opacity))opacity=1;input.attr('data-opacity',opacity);swatch.find('span').css('opacity',String(opacity));y=keepWithin(opacitySlider.height()-(opacitySlider.height()*opacity),0,opacitySlider.height());opacityPicker.css('top',y+'px')}
if(input.val().toLowerCase()==='transparent'){swatch.find('span').css('opacity',String(0))}
swatch.find('span').css('backgroundColor',hex);switch(settings.control){case 'wheel':r=keepWithin(Math.ceil(hsb.s*0.75),0,grid.height()/2);phi=hsb.h*Math.PI/180;x=keepWithin(75-Math.cos(phi)*r,0,grid.width());y=keepWithin(75-Math.sin(phi)*r,0,grid.height());gridPicker.css({top:y+'px',left:x+'px'});y=150-(hsb.b/(100/grid.height()));if(hex==='')y=0;sliderPicker.css('top',y+'px');slider.css('backgroundColor',hsb2hex({h:hsb.h,s:hsb.s,b:100}));break;case 'saturation':x=keepWithin((5*hsb.h)/12,0,150);y=keepWithin(grid.height()-Math.ceil(hsb.b/(100/grid.height())),0,grid.height());gridPicker.css({top:y+'px',left:x+'px'});y=keepWithin(slider.height()-(hsb.s*(slider.height()/100)),0,slider.height());sliderPicker.css('top',y+'px');slider.css('backgroundColor',hsb2hex({h:hsb.h,s:100,b:hsb.b}));minicolors.find('.minicolors-grid-inner').css('opacity',hsb.s/100);break;case 'brightness':x=keepWithin((5*hsb.h)/12,0,150);y=keepWithin(grid.height()-Math.ceil(hsb.s/(100/grid.height())),0,grid.height());gridPicker.css({top:y+'px',left:x+'px'});y=keepWithin(slider.height()-(hsb.b*(slider.height()/100)),0,slider.height());sliderPicker.css('top',y+'px');slider.css('backgroundColor',hsb2hex({h:hsb.h,s:hsb.s,b:100}));minicolors.find('.minicolors-grid-inner').css('opacity',1-(hsb.b/100));break;default:x=keepWithin(Math.ceil(hsb.s/(100/grid.width())),0,grid.width());y=keepWithin(grid.height()-Math.ceil(hsb.b/(100/grid.height())),0,grid.height());gridPicker.css({top:y+'px',left:x+'px'});y=keepWithin(slider.height()-(hsb.h/(360/slider.height())),0,slider.height());sliderPicker.css('top',y+'px');grid.css('backgroundColor',hsb2hex({h:hsb.h,s:100,b:100}));break}
if(input.data('minicolors-initialized')){doChange(input,value,opacity)}}
function doChange(input,value,opacity){var settings=input.data('minicolors-settings');var lastChange=input.data('minicolors-lastChange');var obj,sel,i;if(!lastChange||lastChange.value!==value||lastChange.opacity!==opacity){input.data('minicolors-lastChange',{value:value,opacity:opacity});if(settings.swatches&&settings.swatches.length!==0){if(!isRgb(value)){obj=hex2rgb(value)}else{obj=parseRgb(value,!0)}
sel=-1;for(i=0;i<settings.swatches.length;++i){if(obj.r===settings.swatches[i].r&&obj.g===settings.swatches[i].g&&obj.b===settings.swatches[i].b&&obj.a===settings.swatches[i].a){sel=i;break}}
input.parent().find('.minicolors-swatches .minicolors-swatch').removeClass('selected');if(sel!==-1){input.parent().find('.minicolors-swatches .minicolors-swatch').eq(i).addClass('selected')}}
if(settings.change){if(settings.changeDelay){clearTimeout(input.data('minicolors-changeTimeout'));input.data('minicolors-changeTimeout',setTimeout(function(){settings.change.call(input.get(0),value,opacity)},settings.changeDelay))}else{settings.change.call(input.get(0),value,opacity)}}
input.trigger('change').trigger('input')}}
function rgbObject(input){var rgb,opacity=$(input).attr('data-opacity');if(isRgb($(input).val())){rgb=parseRgb($(input).val(),!0)}else{var hex=parseHex($(input).val(),!0);rgb=hex2rgb(hex)}
if(!rgb)return null;if(opacity!==undefined)$.extend(rgb,{a:parseFloat(opacity)});return rgb}
function rgbString(input,alpha){var rgb,opacity=$(input).attr('data-opacity');if(isRgb($(input).val())){rgb=parseRgb($(input).val(),!0)}else{var hex=parseHex($(input).val(),!0);rgb=hex2rgb(hex)}
if(!rgb)return null;if(opacity===undefined)opacity=1;if(alpha){return'rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', '+parseFloat(opacity)+')'}else{return'rgb('+rgb.r+', '+rgb.g+', '+rgb.b+')'}}
function convertCase(string,letterCase){return letterCase==='uppercase'?string.toUpperCase():string.toLowerCase()}
function parseHex(string,expand){string=string.replace(/^#/g,'');if(!string.match(/^[A-F0-9]{3,6}/ig))return'';if(string.length!==3&&string.length!==6)return'';if(string.length===3&&expand){string=string[0]+string[0]+string[1]+string[1]+string[2]+string[2]}
return'#'+string}
function parseRgb(string,obj){var values=string.replace(/[^\d,.]/g,'');var rgba=values.split(',');rgba[0]=keepWithin(parseInt(rgba[0],10),0,255);rgba[1]=keepWithin(parseInt(rgba[1],10),0,255);rgba[2]=keepWithin(parseInt(rgba[2],10),0,255);if(rgba[3]!==undefined){rgba[3]=keepWithin(parseFloat(rgba[3],10),0,1)}
if(obj){if(rgba[3]!==undefined){return{r:rgba[0],g:rgba[1],b:rgba[2],a:rgba[3]}}else{return{r:rgba[0],g:rgba[1],b:rgba[2]}}}
if(typeof(rgba[3])!=='undefined'&&rgba[3]<=1){return'rgba('+rgba[0]+', '+rgba[1]+', '+rgba[2]+', '+rgba[3]+')'}else{return'rgb('+rgba[0]+', '+rgba[1]+', '+rgba[2]+')'}}
function parseInput(string,expand){if(isRgb(string)){return parseRgb(string)}else{return parseHex(string,expand)}}
function keepWithin(value,min,max){if(value<min)value=min;if(value>max)value=max;return value}
function isRgb(string){var rgb=string.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return(rgb&&rgb.length===4)?!0:!1}
function getAlpha(rgba){rgba=rgba.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i);return(rgba&&rgba.length===6)?rgba[4]:'1'}
function hsb2rgb(hsb){var rgb={};var h=Math.round(hsb.h);var s=Math.round(hsb.s*255/100);var v=Math.round(hsb.b*255/100);if(s===0){rgb.r=rgb.g=rgb.b=v}else{var t1=v;var t2=(255-s)*v/255;var t3=(t1-t2)*(h%60)/60;if(h===360)h=0;if(h<60){rgb.r=t1;rgb.b=t2;rgb.g=t2+t3}else if(h<120){rgb.g=t1;rgb.b=t2;rgb.r=t1-t3}else if(h<180){rgb.g=t1;rgb.r=t2;rgb.b=t2+t3}else if(h<240){rgb.b=t1;rgb.r=t2;rgb.g=t1-t3}else if(h<300){rgb.b=t1;rgb.g=t2;rgb.r=t2+t3}else if(h<360){rgb.r=t1;rgb.g=t2;rgb.b=t1-t3}else{rgb.r=0;rgb.g=0;rgb.b=0}}
return{r:Math.round(rgb.r),g:Math.round(rgb.g),b:Math.round(rgb.b)}}
function rgbString2hex(rgb){rgb=rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return(rgb&&rgb.length===4)?'#'+('0'+parseInt(rgb[1],10).toString(16)).slice(-2)+('0'+parseInt(rgb[2],10).toString(16)).slice(-2)+('0'+parseInt(rgb[3],10).toString(16)).slice(-2):''}
function rgb2hex(rgb){var hex=[rgb.r.toString(16),rgb.g.toString(16),rgb.b.toString(16)];$.each(hex,function(nr,val){if(val.length===1)hex[nr]='0'+val});return'#'+hex.join('')}
function hsb2hex(hsb){return rgb2hex(hsb2rgb(hsb))}
function hex2hsb(hex){var hsb=rgb2hsb(hex2rgb(hex));if(hsb.s===0)hsb.h=360;return hsb}
function rgb2hsb(rgb){var hsb={h:0,s:0,b:0};var min=Math.min(rgb.r,rgb.g,rgb.b);var max=Math.max(rgb.r,rgb.g,rgb.b);var delta=max-min;hsb.b=max;hsb.s=max!==0?255*delta/max:0;if(hsb.s!==0){if(rgb.r===max){hsb.h=(rgb.g-rgb.b)/delta}else if(rgb.g===max){hsb.h=2+(rgb.b-rgb.r)/delta}else{hsb.h=4+(rgb.r-rgb.g)/delta}}else{hsb.h=-1}
hsb.h*=60;if(hsb.h<0){hsb.h+=360}
hsb.s*=100/255;hsb.b*=100/255;return hsb}
function hex2rgb(hex){hex=parseInt(((hex.indexOf('#')>-1)?hex.substring(1):hex),16);return{r:hex>>16,g:(hex&0x00FF00)>>8,b:(hex&0x0000FF)}}
$([document]).on('mousedown.minicolors touchstart.minicolors',function(event){if(!$(event.target).parents().add(event.target).hasClass('minicolors')){hide()}}).on('mousedown.minicolors touchstart.minicolors','.minicolors-grid, .minicolors-slider, .minicolors-opacity-slider',function(event){var target=$(this);event.preventDefault();$(event.delegateTarget).data('minicolors-target',target);move(target,event,!0)}).on('mousemove.minicolors touchmove.minicolors',function(event){var target=$(event.delegateTarget).data('minicolors-target');if(target)move(target,event);}).on('mouseup.minicolors touchend.minicolors',function(){$(this).removeData('minicolors-target')}).on('click.minicolors','.minicolors-swatches li',function(event){event.preventDefault();var target=$(this),input=target.parents('.minicolors').find('.minicolors-input'),color=target.data('swatch-color');updateInput(input,color,getAlpha(color));updateFromInput(input)}).on('mousedown.minicolors touchstart.minicolors','.minicolors-input-swatch',function(event){var input=$(this).parent().find('.minicolors-input');event.preventDefault();show(input)}).on('focus.minicolors','.minicolors-input',function(){var input=$(this);if(!input.data('minicolors-initialized'))return;show(input)}).on('blur.minicolors','.minicolors-input',function(){var input=$(this);var settings=input.data('minicolors-settings');var keywords;var hex;var rgba;var swatchOpacity;var value;if(!input.data('minicolors-initialized'))return;keywords=!settings.keywords?[]:$.map(settings.keywords.split(','),function(a){return a.toLowerCase().trim()});if(input.val()!==''&&$.inArray(input.val().toLowerCase(),keywords)>-1){value=input.val()}else{if(isRgb(input.val())){rgba=parseRgb(input.val(),!0)}else{hex=parseHex(input.val(),!0);rgba=hex?hex2rgb(hex):null}
if(rgba===null){value=settings.defaultValue}else if(settings.format==='rgb'){value=settings.opacity?parseRgb('rgba('+rgba.r+','+rgba.g+','+rgba.b+','+input.attr('data-opacity')+')'):parseRgb('rgb('+rgba.r+','+rgba.g+','+rgba.b+')')}else{value=rgb2hex(rgba)}}
swatchOpacity=settings.opacity?input.attr('data-opacity'):1;if(value.toLowerCase()==='transparent')swatchOpacity=0;input.closest('.minicolors').find('.minicolors-input-swatch > span').css('opacity',String(swatchOpacity));input.val(value);if(input.val()==='')input.val(parseInput(settings.defaultValue,!0));input.val(convertCase(input.val(),settings.letterCase))}).on('keydown.minicolors','.minicolors-input',function(event){var input=$(this);if(!input.data('minicolors-initialized'))return;switch(event.which){case 9:hide();break;case 13:case 27:hide();input.blur();break}}).on('keyup.minicolors','.minicolors-input',function(){var input=$(this);if(!input.data('minicolors-initialized'))return;updateFromInput(input,!0)}).on('paste.minicolors','.minicolors-input',function(){var input=$(this);if(!input.data('minicolors-initialized'))return;setTimeout(function(){updateFromInput(input,!0)},1)})}));(function(){var Dropzone,Emitter,camelize,contentLoaded,detectVerticalSquash,drawImageIOSFix,noop,without,__slice=[].slice,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child};noop=function(){};Emitter=(function(){function Emitter(){}
Emitter.prototype.addEventListener=Emitter.prototype.on;Emitter.prototype.on=function(event,fn){this._callbacks=this._callbacks||{};if(!this._callbacks[event]){this._callbacks[event]=[]}
this._callbacks[event].push(fn);return this};Emitter.prototype.emit=function(){var args,callback,callbacks,event,_i,_len;event=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[];this._callbacks=this._callbacks||{};callbacks=this._callbacks[event];if(callbacks){for(_i=0,_len=callbacks.length;_i<_len;_i++){callback=callbacks[_i];callback.apply(this,args)}}
return this};Emitter.prototype.removeListener=Emitter.prototype.off;Emitter.prototype.removeAllListeners=Emitter.prototype.off;Emitter.prototype.removeEventListener=Emitter.prototype.off;Emitter.prototype.off=function(event,fn){var callback,callbacks,i,_i,_len;if(!this._callbacks||arguments.length===0){this._callbacks={};return this}
callbacks=this._callbacks[event];if(!callbacks){return this}
if(arguments.length===1){delete this._callbacks[event];return this}
for(i=_i=0,_len=callbacks.length;_i<_len;i=++_i){callback=callbacks[i];if(callback===fn){callbacks.splice(i,1);break}}
return this};return Emitter})();Dropzone=(function(_super){var extend,resolveOption;__extends(Dropzone,_super);Dropzone.prototype.Emitter=Emitter;Dropzone.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"];Dropzone.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,filesizeBase:1000,maxFiles:null,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",accept:function(file,done){return done()},init:function(){return noop},forceFallback:!1,fallback:function(){var child,messageElement,span,_i,_len,_ref;this.element.className=""+this.element.className+" dz-browser-not-supported";_ref=this.element.getElementsByTagName("div");for(_i=0,_len=_ref.length;_i<_len;_i++){child=_ref[_i];if(/(^| )dz-message($| )/.test(child.className)){messageElement=child;child.className="dz-message";continue}}
if(!messageElement){messageElement=Dropzone.createElement("<div class=\"dz-message\"><span></span></div>");this.element.appendChild(messageElement)}
span=messageElement.getElementsByTagName("span")[0];if(span){if(span.textContent!=null){span.textContent=this.options.dictFallbackMessage}else if(span.innerText!=null){span.innerText=this.options.dictFallbackMessage}}
return this.element.appendChild(this.getFallbackForm())},resize:function(file){var info,srcRatio,trgRatio;info={srcX:0,srcY:0,srcWidth:file.width,srcHeight:file.height};srcRatio=file.width/file.height;info.optWidth=this.options.thumbnailWidth;info.optHeight=this.options.thumbnailHeight;if((info.optWidth==null)&&(info.optHeight==null)){info.optWidth=info.srcWidth;info.optHeight=info.srcHeight}else if(info.optWidth==null){info.optWidth=srcRatio*info.optHeight}else if(info.optHeight==null){info.optHeight=(1/srcRatio)*info.optWidth}
trgRatio=info.optWidth/info.optHeight;if(file.height<info.optHeight||file.width<info.optWidth){info.trgHeight=info.srcHeight;info.trgWidth=info.srcWidth}else{if(srcRatio>trgRatio){info.srcHeight=file.height;info.srcWidth=info.srcHeight*trgRatio}else{info.srcWidth=file.width;info.srcHeight=info.srcWidth/trgRatio}}
info.srcX=(file.width-info.srcWidth)/2;info.srcY=(file.height-info.srcHeight)/2;return info},drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:noop,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:noop,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(file){var node,removeFileEvent,removeLink,_i,_j,_k,_len,_len1,_len2,_ref,_ref1,_ref2,_results;if(this.element===this.previewsContainer){this.element.classList.add("dz-started")}
if(this.previewsContainer){file.previewElement=Dropzone.createElement(this.options.previewTemplate.trim());file.previewTemplate=file.previewElement;this.previewsContainer.appendChild(file.previewElement);_ref=file.previewElement.querySelectorAll("[data-dz-name]");for(_i=0,_len=_ref.length;_i<_len;_i++){node=_ref[_i];node.textContent=this._renameFilename(file.name)}
_ref1=file.previewElement.querySelectorAll("[data-dz-size]");for(_j=0,_len1=_ref1.length;_j<_len1;_j++){node=_ref1[_j];node.innerHTML=this.filesize(file.size)}
if(this.options.addRemoveLinks){file._removeLink=Dropzone.createElement("<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>"+this.options.dictRemoveFile+"</a>");file.previewElement.appendChild(file._removeLink)}
removeFileEvent=(function(_this){return function(e){e.preventDefault();e.stopPropagation();if(file.status===Dropzone.UPLOADING){return Dropzone.confirm(_this.options.dictCancelUploadConfirmation,function(){return _this.removeFile(file)})}else{if(_this.options.dictRemoveFileConfirmation){return Dropzone.confirm(_this.options.dictRemoveFileConfirmation,function(){return _this.removeFile(file)})}else{return _this.removeFile(file)}}}})(this);_ref2=file.previewElement.querySelectorAll("[data-dz-remove]");_results=[];for(_k=0,_len2=_ref2.length;_k<_len2;_k++){removeLink=_ref2[_k];_results.push(removeLink.addEventListener("click",removeFileEvent))}
return _results}},removedfile:function(file){var _ref;if(file.previewElement){if((_ref=file.previewElement)!=null){_ref.parentNode.removeChild(file.previewElement)}}
return this._updateMaxFilesReachedClass()},thumbnail:function(file,dataUrl){var thumbnailElement,_i,_len,_ref;if(file.previewElement){file.previewElement.classList.remove("dz-file-preview");_ref=file.previewElement.querySelectorAll("[data-dz-thumbnail]");for(_i=0,_len=_ref.length;_i<_len;_i++){thumbnailElement=_ref[_i];thumbnailElement.alt=file.name;thumbnailElement.src=dataUrl}
return setTimeout(((function(_this){return function(){return file.previewElement.classList.add("dz-image-preview")}})(this)),1)}},error:function(file,message){var node,_i,_len,_ref,_results;if(file.previewElement){file.previewElement.classList.add("dz-error");if(typeof message!=="String"&&message.error){message=message.error}
_ref=file.previewElement.querySelectorAll("[data-dz-errormessage]");_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){node=_ref[_i];_results.push(node.textContent=message)}
return _results}},errormultiple:noop,processing:function(file){if(file.previewElement){file.previewElement.classList.add("dz-processing");if(file._removeLink){return file._removeLink.textContent=this.options.dictCancelUpload}}},processingmultiple:noop,uploadprogress:function(file,progress,bytesSent){var node,_i,_len,_ref,_results;if(file.previewElement){_ref=file.previewElement.querySelectorAll("[data-dz-uploadprogress]");_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){node=_ref[_i];if(node.nodeName==='PROGRESS'){_results.push(node.value=progress)}else{_results.push(node.style.width=""+progress+"%")}}
return _results}},totaluploadprogress:noop,sending:noop,sendingmultiple:noop,success:function(file){if(file.previewElement){return file.previewElement.classList.add("dz-success")}},successmultiple:noop,canceled:function(file){return this.emit("error",file,"Upload canceled.")},canceledmultiple:noop,complete:function(file){if(file._removeLink){file._removeLink.textContent=this.options.dictRemoveFile}
if(file.previewElement){return file.previewElement.classList.add("dz-complete")}},completemultiple:noop,maxfilesexceeded:noop,maxfilesreached:noop,queuecomplete:noop,addedfiles:noop,previewTemplate:"<div class=\"dz-preview dz-file-preview\">\n  <div class=\"dz-image\"><img data-dz-thumbnail /></div>\n  <div class=\"dz-details\">\n    <div class=\"dz-size\"><span data-dz-size></span></div>\n    <div class=\"dz-filename\"><span data-dz-name></span></div>\n  </div>\n  <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n  <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n  <div class=\"dz-success-mark\">\n    <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n      <title>Check</title>\n      <defs></defs>\n      <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n        <path d=\"M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" stroke-opacity=\"0.198794158\" stroke=\"#747474\" fill-opacity=\"0.816519475\" fill=\"#FFFFFF\" sketch:type=\"MSShapeGroup\"></path>\n      </g>\n    </svg>\n  </div>\n  <div class=\"dz-error-mark\">\n    <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n      <title>Error</title>\n      <defs></defs>\n      <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n        <g id=\"Check-+-Oval-2\" sketch:type=\"MSLayerGroup\" stroke=\"#747474\" stroke-opacity=\"0.198794158\" fill=\"#FFFFFF\" fill-opacity=\"0.816519475\">\n          <path d=\"M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" sketch:type=\"MSShapeGroup\"></path>\n        </g>\n      </g>\n    </svg>\n  </div>\n</div>"};extend=function(){var key,object,objects,target,val,_i,_len;target=arguments[0],objects=2<=arguments.length?__slice.call(arguments,1):[];for(_i=0,_len=objects.length;_i<_len;_i++){object=objects[_i];for(key in object){val=object[key];target[key]=val}}
return target};function Dropzone(element,options){var elementOptions,fallback,_ref;this.element=element;this.version=Dropzone.version;this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,"");this.clickableElements=[];this.listeners=[];this.files=[];if(typeof this.element==="string"){this.element=document.querySelector(this.element)}
if(!(this.element&&(this.element.nodeType!=null))){throw new Error("Invalid dropzone element.")}
if(this.element.dropzone){throw new Error("Dropzone already attached.")}
Dropzone.instances.push(this);this.element.dropzone=this;elementOptions=(_ref=Dropzone.optionsForElement(this.element))!=null?_ref:{};this.options=extend({},this.defaultOptions,elementOptions,options!=null?options:{});if(this.options.forceFallback||!Dropzone.isBrowserSupported()){return this.options.fallback.call(this)}
if(this.options.url==null){this.options.url=this.element.getAttribute("action")}
if(!this.options.url){throw new Error("No URL provided.")}
if(this.options.acceptedFiles&&this.options.acceptedMimeTypes){throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.")}
if(this.options.acceptedMimeTypes){this.options.acceptedFiles=this.options.acceptedMimeTypes;delete this.options.acceptedMimeTypes}
this.options.method=this.options.method.toUpperCase();if((fallback=this.getExistingFallback())&&fallback.parentNode){fallback.parentNode.removeChild(fallback)}
if(this.options.previewsContainer!==!1){if(this.options.previewsContainer){this.previewsContainer=Dropzone.getElement(this.options.previewsContainer,"previewsContainer")}else{this.previewsContainer=this.element}}
if(this.options.clickable){if(this.options.clickable===!0){this.clickableElements=[this.element]}else{this.clickableElements=Dropzone.getElements(this.options.clickable,"clickable")}}
this.init()}
Dropzone.prototype.getAcceptedFiles=function(){var file,_i,_len,_ref,_results;_ref=this.files;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){file=_ref[_i];if(file.accepted){_results.push(file)}}
return _results};Dropzone.prototype.getRejectedFiles=function(){var file,_i,_len,_ref,_results;_ref=this.files;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){file=_ref[_i];if(!file.accepted){_results.push(file)}}
return _results};Dropzone.prototype.getFilesWithStatus=function(status){var file,_i,_len,_ref,_results;_ref=this.files;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){file=_ref[_i];if(file.status===status){_results.push(file)}}
return _results};Dropzone.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(Dropzone.QUEUED)};Dropzone.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(Dropzone.UPLOADING)};Dropzone.prototype.getAddedFiles=function(){return this.getFilesWithStatus(Dropzone.ADDED)};Dropzone.prototype.getActiveFiles=function(){var file,_i,_len,_ref,_results;_ref=this.files;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){file=_ref[_i];if(file.status===Dropzone.UPLOADING||file.status===Dropzone.QUEUED){_results.push(file)}}
return _results};Dropzone.prototype.init=function(){var eventName,noPropagation,setupHiddenFileInput,_i,_len,_ref,_ref1;if(this.element.tagName==="form"){this.element.setAttribute("enctype","multipart/form-data")}
if(this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")){this.element.appendChild(Dropzone.createElement("<div class=\"dz-default dz-message\"><span>"+this.options.dictDefaultMessage+"</span></div>"))}
if(this.clickableElements.length){setupHiddenFileInput=(function(_this){return function(){if(_this.hiddenFileInput){_this.hiddenFileInput.parentNode.removeChild(_this.hiddenFileInput)}
_this.hiddenFileInput=document.createElement("input");_this.hiddenFileInput.setAttribute("type","file");if((_this.options.maxFiles==null)||_this.options.maxFiles>1){_this.hiddenFileInput.setAttribute("multiple","multiple")}
_this.hiddenFileInput.className="dz-hidden-input";if(_this.options.acceptedFiles!=null){_this.hiddenFileInput.setAttribute("accept",_this.options.acceptedFiles)}
if(_this.options.capture!=null){_this.hiddenFileInput.setAttribute("capture",_this.options.capture)}
_this.hiddenFileInput.style.visibility="hidden";_this.hiddenFileInput.style.position="absolute";_this.hiddenFileInput.style.top="0";_this.hiddenFileInput.style.left="0";_this.hiddenFileInput.style.height="0";_this.hiddenFileInput.style.width="0";document.querySelector(_this.options.hiddenInputContainer).appendChild(_this.hiddenFileInput);return _this.hiddenFileInput.addEventListener("change",function(){var file,files,_i,_len;files=_this.hiddenFileInput.files;if(files.length){for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];_this.addFile(file)}}
_this.emit("addedfiles",files);return setupHiddenFileInput()})}})(this);setupHiddenFileInput()}
this.URL=(_ref=window.URL)!=null?_ref:window.webkitURL;_ref1=this.events;for(_i=0,_len=_ref1.length;_i<_len;_i++){eventName=_ref1[_i];this.on(eventName,this.options[eventName])}
this.on("uploadprogress",(function(_this){return function(){return _this.updateTotalUploadProgress()}})(this));this.on("removedfile",(function(_this){return function(){return _this.updateTotalUploadProgress()}})(this));this.on("canceled",(function(_this){return function(file){return _this.emit("complete",file)}})(this));this.on("complete",(function(_this){return function(file){if(_this.getAddedFiles().length===0&&_this.getUploadingFiles().length===0&&_this.getQueuedFiles().length===0){return setTimeout((function(){return _this.emit("queuecomplete")}),0)}}})(this));noPropagation=function(e){e.stopPropagation();if(e.preventDefault){return e.preventDefault()}else{return e.returnValue=!1}};this.listeners=[{element:this.element,events:{"dragstart":(function(_this){return function(e){return _this.emit("dragstart",e)}})(this),"dragenter":(function(_this){return function(e){noPropagation(e);return _this.emit("dragenter",e)}})(this),"dragover":(function(_this){return function(e){var efct;try{efct=e.dataTransfer.effectAllowed}catch(_error){}
e.dataTransfer.dropEffect='move'===efct||'linkMove'===efct?'move':'copy';noPropagation(e);return _this.emit("dragover",e)}})(this),"dragleave":(function(_this){return function(e){return _this.emit("dragleave",e)}})(this),"drop":(function(_this){return function(e){noPropagation(e);return _this.drop(e)}})(this),"dragend":(function(_this){return function(e){return _this.emit("dragend",e)}})(this)}}];this.clickableElements.forEach((function(_this){return function(clickableElement){return _this.listeners.push({element:clickableElement,events:{"click":function(evt){if((clickableElement!==_this.element)||(evt.target===_this.element||Dropzone.elementInside(evt.target,_this.element.querySelector(".dz-message")))){_this.hiddenFileInput.click()}
return!0}}})}})(this));this.enable();return this.options.init.call(this)};Dropzone.prototype.destroy=function(){var _ref;this.disable();this.removeAllFiles(!0);if((_ref=this.hiddenFileInput)!=null?_ref.parentNode:void 0){this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);this.hiddenFileInput=null}
delete this.element.dropzone;return Dropzone.instances.splice(Dropzone.instances.indexOf(this),1)};Dropzone.prototype.updateTotalUploadProgress=function(){var activeFiles,file,totalBytes,totalBytesSent,totalUploadProgress,_i,_len,_ref;totalBytesSent=0;totalBytes=0;activeFiles=this.getActiveFiles();if(activeFiles.length){_ref=this.getActiveFiles();for(_i=0,_len=_ref.length;_i<_len;_i++){file=_ref[_i];totalBytesSent+=file.upload.bytesSent;totalBytes+=file.upload.total}
totalUploadProgress=100*totalBytesSent/totalBytes}else{totalUploadProgress=100}
return this.emit("totaluploadprogress",totalUploadProgress,totalBytes,totalBytesSent)};Dropzone.prototype._getParamName=function(n){if(typeof this.options.paramName==="function"){return this.options.paramName(n)}else{return""+this.options.paramName+(this.options.uploadMultiple?"["+n+"]":"")}};Dropzone.prototype._renameFilename=function(name){if(typeof this.options.renameFilename!=="function"){return name}
return this.options.renameFilename(name)};Dropzone.prototype.getFallbackForm=function(){var existingFallback,fields,fieldsString,form;if(existingFallback=this.getExistingFallback()){return existingFallback}
fieldsString="<div class=\"dz-fallback\">";if(this.options.dictFallbackText){fieldsString+="<p>"+this.options.dictFallbackText+"</p>"}
fieldsString+="<input type=\"file\" name=\""+(this._getParamName(0))+"\" "+(this.options.uploadMultiple?'multiple="multiple"':void 0)+" /><input type=\"submit\" value=\"Upload!\"></div>";fields=Dropzone.createElement(fieldsString);if(this.element.tagName!=="FORM"){form=Dropzone.createElement("<form action=\""+this.options.url+"\" enctype=\"multipart/form-data\" method=\""+this.options.method+"\"></form>");form.appendChild(fields)}else{this.element.setAttribute("enctype","multipart/form-data");this.element.setAttribute("method",this.options.method)}
return form!=null?form:fields};Dropzone.prototype.getExistingFallback=function(){var fallback,getFallback,tagName,_i,_len,_ref;getFallback=function(elements){var el,_i,_len;for(_i=0,_len=elements.length;_i<_len;_i++){el=elements[_i];if(/(^| )fallback($| )/.test(el.className)){return el}}};_ref=["div","form"];for(_i=0,_len=_ref.length;_i<_len;_i++){tagName=_ref[_i];if(fallback=getFallback(this.element.getElementsByTagName(tagName))){return fallback}}};Dropzone.prototype.setupEventListeners=function(){var elementListeners,event,listener,_i,_len,_ref,_results;_ref=this.listeners;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){elementListeners=_ref[_i];_results.push((function(){var _ref1,_results1;_ref1=elementListeners.events;_results1=[];for(event in _ref1){listener=_ref1[event];_results1.push(elementListeners.element.addEventListener(event,listener,!1))}
return _results1})())}
return _results};Dropzone.prototype.removeEventListeners=function(){var elementListeners,event,listener,_i,_len,_ref,_results;_ref=this.listeners;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){elementListeners=_ref[_i];_results.push((function(){var _ref1,_results1;_ref1=elementListeners.events;_results1=[];for(event in _ref1){listener=_ref1[event];_results1.push(elementListeners.element.removeEventListener(event,listener,!1))}
return _results1})())}
return _results};Dropzone.prototype.disable=function(){var file,_i,_len,_ref,_results;this.clickableElements.forEach(function(element){return element.classList.remove("dz-clickable")});this.removeEventListeners();_ref=this.files;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){file=_ref[_i];_results.push(this.cancelUpload(file))}
return _results};Dropzone.prototype.enable=function(){this.clickableElements.forEach(function(element){return element.classList.add("dz-clickable")});return this.setupEventListeners()};Dropzone.prototype.filesize=function(size){var cutoff,i,selectedSize,selectedUnit,unit,units,_i,_len;selectedSize=0;selectedUnit="b";if(size>0){units=['TB','GB','MB','KB','b'];for(i=_i=0,_len=units.length;_i<_len;i=++_i){unit=units[i];cutoff=Math.pow(this.options.filesizeBase,4-i)/10;if(size>=cutoff){selectedSize=size/Math.pow(this.options.filesizeBase,4-i);selectedUnit=unit;break}}
selectedSize=Math.round(10*selectedSize)/10}
return"<strong>"+selectedSize+"</strong> "+selectedUnit};Dropzone.prototype._updateMaxFilesReachedClass=function(){if((this.options.maxFiles!=null)&&this.getAcceptedFiles().length>=this.options.maxFiles){if(this.getAcceptedFiles().length===this.options.maxFiles){this.emit('maxfilesreached',this.files)}
return this.element.classList.add("dz-max-files-reached")}else{return this.element.classList.remove("dz-max-files-reached")}};Dropzone.prototype.drop=function(e){var files,items;if(!e.dataTransfer){return}
this.emit("drop",e);files=e.dataTransfer.files;this.emit("addedfiles",files);if(files.length){items=e.dataTransfer.items;if(items&&items.length&&(items[0].webkitGetAsEntry!=null)){this._addFilesFromItems(items)}else{this.handleFiles(files)}}};Dropzone.prototype.paste=function(e){var items,_ref;if((e!=null?(_ref=e.clipboardData)!=null?_ref.items:void 0:void 0)==null){return}
this.emit("paste",e);items=e.clipboardData.items;if(items.length){return this._addFilesFromItems(items)}};Dropzone.prototype.handleFiles=function(files){var file,_i,_len,_results;_results=[];for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];_results.push(this.addFile(file))}
return _results};Dropzone.prototype._addFilesFromItems=function(items){var entry,item,_i,_len,_results;_results=[];for(_i=0,_len=items.length;_i<_len;_i++){item=items[_i];if((item.webkitGetAsEntry!=null)&&(entry=item.webkitGetAsEntry())){if(entry.isFile){_results.push(this.addFile(item.getAsFile()))}else if(entry.isDirectory){_results.push(this._addFilesFromDirectory(entry,entry.name))}else{_results.push(void 0)}}else if(item.getAsFile!=null){if((item.kind==null)||item.kind==="file"){_results.push(this.addFile(item.getAsFile()))}else{_results.push(void 0)}}else{_results.push(void 0)}}
return _results};Dropzone.prototype._addFilesFromDirectory=function(directory,path){var dirReader,errorHandler,readEntries;dirReader=directory.createReader();errorHandler=function(error){return typeof console!=="undefined"&&console!==null?typeof console.log==="function"?console.log(error):void 0:void 0};readEntries=(function(_this){return function(){return dirReader.readEntries(function(entries){var entry,_i,_len;if(entries.length>0){for(_i=0,_len=entries.length;_i<_len;_i++){entry=entries[_i];if(entry.isFile){entry.file(function(file){if(_this.options.ignoreHiddenFiles&&file.name.substring(0,1)==='.'){return}
file.fullPath=""+path+"/"+file.name;return _this.addFile(file)})}else if(entry.isDirectory){_this._addFilesFromDirectory(entry,""+path+"/"+entry.name)}}
readEntries()}
return null},errorHandler)}})(this);return readEntries()};Dropzone.prototype.accept=function(file,done){if(file.size>this.options.maxFilesize*1024*1024){return done(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(file.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize))}else if(!Dropzone.isValidFile(file,this.options.acceptedFiles)){return done(this.options.dictInvalidFileType)}else if((this.options.maxFiles!=null)&&this.getAcceptedFiles().length>=this.options.maxFiles){done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles));return this.emit("maxfilesexceeded",file)}else{return this.options.accept.call(this,file,done)}};Dropzone.prototype.addFile=function(file){file.upload={progress:0,total:file.size,bytesSent:0};this.files.push(file);file.status=Dropzone.ADDED;this.emit("addedfile",file);this._enqueueThumbnail(file);return this.accept(file,(function(_this){return function(error){if(error){file.accepted=!1;_this._errorProcessing([file],error)}else{file.accepted=!0;if(_this.options.autoQueue){_this.enqueueFile(file)}}
return _this._updateMaxFilesReachedClass()}})(this))};Dropzone.prototype.enqueueFiles=function(files){var file,_i,_len;for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];this.enqueueFile(file)}
return null};Dropzone.prototype.enqueueFile=function(file){if(file.status===Dropzone.ADDED&&file.accepted===!0){file.status=Dropzone.QUEUED;if(this.options.autoProcessQueue){return setTimeout(((function(_this){return function(){return _this.processQueue()}})(this)),0)}}else{throw new Error("This file can't be queued because it has already been processed or was rejected.")}};Dropzone.prototype._thumbnailQueue=[];Dropzone.prototype._processingThumbnail=!1;Dropzone.prototype._enqueueThumbnail=function(file){if(this.options.createImageThumbnails&&file.type.match(/image.*/)&&file.size<=this.options.maxThumbnailFilesize*1024*1024){this._thumbnailQueue.push(file);return setTimeout(((function(_this){return function(){return _this._processThumbnailQueue()}})(this)),0)}};Dropzone.prototype._processThumbnailQueue=function(){if(this._processingThumbnail||this._thumbnailQueue.length===0){return}
this._processingThumbnail=!0;return this.createThumbnail(this._thumbnailQueue.shift(),(function(_this){return function(){_this._processingThumbnail=!1;return _this._processThumbnailQueue()}})(this))};Dropzone.prototype.removeFile=function(file){if(file.status===Dropzone.UPLOADING){this.cancelUpload(file)}
this.files=without(this.files,file);this.emit("removedfile",file);if(this.files.length===0){return this.emit("reset")}};Dropzone.prototype.removeAllFiles=function(cancelIfNecessary){var file,_i,_len,_ref;if(cancelIfNecessary==null){cancelIfNecessary=!1}
_ref=this.files.slice();for(_i=0,_len=_ref.length;_i<_len;_i++){file=_ref[_i];if(file.status!==Dropzone.UPLOADING||cancelIfNecessary){this.removeFile(file)}}
return null};Dropzone.prototype.createThumbnail=function(file,callback){var fileReader;fileReader=new FileReader;fileReader.onload=(function(_this){return function(){if(file.type==="image/svg+xml"){_this.emit("thumbnail",file,fileReader.result);if(callback!=null){callback()}
return}
return _this.createThumbnailFromUrl(file,fileReader.result,callback)}})(this);return fileReader.readAsDataURL(file)};Dropzone.prototype.createThumbnailFromUrl=function(file,imageUrl,callback,crossOrigin){var img;img=document.createElement("img");if(crossOrigin){img.crossOrigin=crossOrigin}
img.onload=(function(_this){return function(){var canvas,ctx,resizeInfo,thumbnail,_ref,_ref1,_ref2,_ref3;file.width=img.width;file.height=img.height;resizeInfo=_this.options.resize.call(_this,file);if(resizeInfo.trgWidth==null){resizeInfo.trgWidth=resizeInfo.optWidth}
if(resizeInfo.trgHeight==null){resizeInfo.trgHeight=resizeInfo.optHeight}
canvas=document.createElement("canvas");ctx=canvas.getContext("2d");canvas.width=resizeInfo.trgWidth;canvas.height=resizeInfo.trgHeight;drawImageIOSFix(ctx,img,(_ref=resizeInfo.srcX)!=null?_ref:0,(_ref1=resizeInfo.srcY)!=null?_ref1:0,resizeInfo.srcWidth,resizeInfo.srcHeight,(_ref2=resizeInfo.trgX)!=null?_ref2:0,(_ref3=resizeInfo.trgY)!=null?_ref3:0,resizeInfo.trgWidth,resizeInfo.trgHeight);thumbnail=canvas.toDataURL("image/png");_this.emit("thumbnail",file,thumbnail);if(callback!=null){return callback()}}})(this);if(callback!=null){img.onerror=callback}
return img.src=imageUrl};Dropzone.prototype.processQueue=function(){var i,parallelUploads,processingLength,queuedFiles;parallelUploads=this.options.parallelUploads;processingLength=this.getUploadingFiles().length;i=processingLength;if(processingLength>=parallelUploads){return}
queuedFiles=this.getQueuedFiles();if(!(queuedFiles.length>0)){return}
if(this.options.uploadMultiple){return this.processFiles(queuedFiles.slice(0,parallelUploads-processingLength))}else{while(i<parallelUploads){if(!queuedFiles.length){return}
this.processFile(queuedFiles.shift());i++}}};Dropzone.prototype.processFile=function(file){return this.processFiles([file])};Dropzone.prototype.processFiles=function(files){var file,_i,_len;for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];file.processing=!0;file.status=Dropzone.UPLOADING;this.emit("processing",file)}
if(this.options.uploadMultiple){this.emit("processingmultiple",files)}
return this.uploadFiles(files)};Dropzone.prototype._getFilesWithXhr=function(xhr){var file,files;return files=(function(){var _i,_len,_ref,_results;_ref=this.files;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){file=_ref[_i];if(file.xhr===xhr){_results.push(file)}}
return _results}).call(this)};Dropzone.prototype.cancelUpload=function(file){var groupedFile,groupedFiles,_i,_j,_len,_len1,_ref;if(file.status===Dropzone.UPLOADING){groupedFiles=this._getFilesWithXhr(file.xhr);for(_i=0,_len=groupedFiles.length;_i<_len;_i++){groupedFile=groupedFiles[_i];groupedFile.status=Dropzone.CANCELED}
file.xhr.abort();for(_j=0,_len1=groupedFiles.length;_j<_len1;_j++){groupedFile=groupedFiles[_j];this.emit("canceled",groupedFile)}
if(this.options.uploadMultiple){this.emit("canceledmultiple",groupedFiles)}}else if((_ref=file.status)===Dropzone.ADDED||_ref===Dropzone.QUEUED){file.status=Dropzone.CANCELED;this.emit("canceled",file);if(this.options.uploadMultiple){this.emit("canceledmultiple",[file])}}
if(this.options.autoProcessQueue){return this.processQueue()}};resolveOption=function(){var args,option;option=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[];if(typeof option==='function'){return option.apply(this,args)}
return option};Dropzone.prototype.uploadFile=function(file){return this.uploadFiles([file])};Dropzone.prototype.uploadFiles=function(files){var file,formData,handleError,headerName,headerValue,headers,i,input,inputName,inputType,key,method,option,progressObj,response,updateProgress,url,value,xhr,_i,_j,_k,_l,_len,_len1,_len2,_len3,_m,_ref,_ref1,_ref2,_ref3,_ref4,_ref5;xhr=new XMLHttpRequest();for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];file.xhr=xhr}
method=resolveOption(this.options.method,files);url=resolveOption(this.options.url,files);xhr.open(method,url,!0);xhr.withCredentials=!!this.options.withCredentials;response=null;handleError=(function(_this){return function(){var _j,_len1,_results;_results=[];for(_j=0,_len1=files.length;_j<_len1;_j++){file=files[_j];_results.push(_this._errorProcessing(files,response||_this.options.dictResponseError.replace("{{statusCode}}",xhr.status),xhr))}
return _results}})(this);updateProgress=(function(_this){return function(e){var allFilesFinished,progress,_j,_k,_l,_len1,_len2,_len3,_results;if(e!=null){progress=100*e.loaded/e.total;for(_j=0,_len1=files.length;_j<_len1;_j++){file=files[_j];file.upload={progress:progress,total:e.total,bytesSent:e.loaded}}}else{allFilesFinished=!0;progress=100;for(_k=0,_len2=files.length;_k<_len2;_k++){file=files[_k];if(!(file.upload.progress===100&&file.upload.bytesSent===file.upload.total)){allFilesFinished=!1}
file.upload.progress=progress;file.upload.bytesSent=file.upload.total}
if(allFilesFinished){return}}
_results=[];for(_l=0,_len3=files.length;_l<_len3;_l++){file=files[_l];_results.push(_this.emit("uploadprogress",file,progress,file.upload.bytesSent))}
return _results}})(this);xhr.onload=(function(_this){return function(e){var _ref;if(files[0].status===Dropzone.CANCELED){return}
if(xhr.readyState!==4){return}
response=xhr.responseText;if(xhr.getResponseHeader("content-type")&&~xhr.getResponseHeader("content-type").indexOf("application/json")){try{response=JSON.parse(response)}catch(_error){e=_error;response="Invalid JSON response from server."}}
updateProgress();if(!((200<=(_ref=xhr.status)&&_ref<300))){return handleError()}else{return _this._finished(files,response,e)}}})(this);xhr.onerror=(function(_this){return function(){if(files[0].status===Dropzone.CANCELED){return}
return handleError()}})(this);progressObj=(_ref=xhr.upload)!=null?_ref:xhr;progressObj.onprogress=updateProgress;headers={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};if(this.options.headers){extend(headers,this.options.headers)}
for(headerName in headers){headerValue=headers[headerName];if(headerValue){xhr.setRequestHeader(headerName,headerValue)}}
formData=new FormData();if(this.options.params){_ref1=this.options.params;for(key in _ref1){value=_ref1[key];formData.append(key,value)}}
for(_j=0,_len1=files.length;_j<_len1;_j++){file=files[_j];this.emit("sending",file,xhr,formData)}
if(this.options.uploadMultiple){this.emit("sendingmultiple",files,xhr,formData)}
if(this.element.tagName==="FORM"){_ref2=this.element.querySelectorAll("input, textarea, select, button");for(_k=0,_len2=_ref2.length;_k<_len2;_k++){input=_ref2[_k];inputName=input.getAttribute("name");inputType=input.getAttribute("type");if(input.tagName==="SELECT"&&input.hasAttribute("multiple")){_ref3=input.options;for(_l=0,_len3=_ref3.length;_l<_len3;_l++){option=_ref3[_l];if(option.selected){formData.append(inputName,option.value)}}}else if(!inputType||((_ref4=inputType.toLowerCase())!=="checkbox"&&_ref4!=="radio")||input.checked){formData.append(inputName,input.value)}}}
for(i=_m=0,_ref5=files.length-1;0<=_ref5?_m<=_ref5:_m>=_ref5;i=0<=_ref5?++_m:--_m){formData.append(this._getParamName(i),files[i],this._renameFilename(files[i].name))}
return this.submitRequest(xhr,formData,files)};Dropzone.prototype.submitRequest=function(xhr,formData,files){return xhr.send(formData)};Dropzone.prototype._finished=function(files,responseText,e){var file,_i,_len;for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];file.status=Dropzone.SUCCESS;this.emit("success",file,responseText,e);this.emit("complete",file)}
if(this.options.uploadMultiple){this.emit("successmultiple",files,responseText,e);this.emit("completemultiple",files)}
if(this.options.autoProcessQueue){return this.processQueue()}};Dropzone.prototype._errorProcessing=function(files,message,xhr){var file,_i,_len;for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];file.status=Dropzone.ERROR;this.emit("error",file,message,xhr);this.emit("complete",file)}
if(this.options.uploadMultiple){this.emit("errormultiple",files,message,xhr);this.emit("completemultiple",files)}
if(this.options.autoProcessQueue){return this.processQueue()}};return Dropzone})(Emitter);Dropzone.version="4.3.0";Dropzone.options={};Dropzone.optionsForElement=function(element){if(element.getAttribute("id")){return Dropzone.options[camelize(element.getAttribute("id"))]}else{return void 0}};Dropzone.instances=[];Dropzone.forElement=function(element){if(typeof element==="string"){element=document.querySelector(element)}
if((element!=null?element.dropzone:void 0)==null){throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.")}
return element.dropzone};Dropzone.autoDiscover=!0;Dropzone.discover=function(){var checkElements,dropzone,dropzones,_i,_len,_results;if(document.querySelectorAll){dropzones=document.querySelectorAll(".dropzone")}else{dropzones=[];checkElements=function(elements){var el,_i,_len,_results;_results=[];for(_i=0,_len=elements.length;_i<_len;_i++){el=elements[_i];if(/(^| )dropzone($| )/.test(el.className)){_results.push(dropzones.push(el))}else{_results.push(void 0)}}
return _results};checkElements(document.getElementsByTagName("div"));checkElements(document.getElementsByTagName("form"))}
_results=[];for(_i=0,_len=dropzones.length;_i<_len;_i++){dropzone=dropzones[_i];if(Dropzone.optionsForElement(dropzone)!==!1){_results.push(new Dropzone(dropzone))}else{_results.push(void 0)}}
return _results};Dropzone.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i];Dropzone.isBrowserSupported=function(){var capableBrowser,regex,_i,_len,_ref;capableBrowser=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector){if(!("classList" in document.createElement("a"))){capableBrowser=!1}else{_ref=Dropzone.blacklistedBrowsers;for(_i=0,_len=_ref.length;_i<_len;_i++){regex=_ref[_i];if(regex.test(navigator.userAgent)){capableBrowser=!1;continue}}}}else{capableBrowser=!1}
return capableBrowser};without=function(list,rejectedItem){var item,_i,_len,_results;_results=[];for(_i=0,_len=list.length;_i<_len;_i++){item=list[_i];if(item!==rejectedItem){_results.push(item)}}
return _results};camelize=function(str){return str.replace(/[\-_](\w)/g,function(match){return match.charAt(1).toUpperCase()})};Dropzone.createElement=function(string){var div;div=document.createElement("div");div.innerHTML=string;return div.childNodes[0]};Dropzone.elementInside=function(element,container){if(element===container){return!0}
while(element=element.parentNode){if(element===container){return!0}}
return!1};Dropzone.getElement=function(el,name){var element;if(typeof el==="string"){element=document.querySelector(el)}else if(el.nodeType!=null){element=el}
if(element==null){throw new Error("Invalid `"+name+"` option provided. Please provide a CSS selector or a plain HTML element.")}
return element};Dropzone.getElements=function(els,name){var e,el,elements,_i,_j,_len,_len1,_ref;if(els instanceof Array){elements=[];try{for(_i=0,_len=els.length;_i<_len;_i++){el=els[_i];elements.push(this.getElement(el,name))}}catch(_error){e=_error;elements=null}}else if(typeof els==="string"){elements=[];_ref=document.querySelectorAll(els);for(_j=0,_len1=_ref.length;_j<_len1;_j++){el=_ref[_j];elements.push(el)}}else if(els.nodeType!=null){elements=[els]}
if(!((elements!=null)&&elements.length)){throw new Error("Invalid `"+name+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.")}
return elements};Dropzone.confirm=function(question,accepted,rejected){if(window.confirm(question)){return accepted()}else if(rejected!=null){return rejected()}};Dropzone.isValidFile=function(file,acceptedFiles){var baseMimeType,mimeType,validType,_i,_len;if(!acceptedFiles){return!0}
acceptedFiles=acceptedFiles.split(",");mimeType=file.type;baseMimeType=mimeType.replace(/\/.*$/,"");for(_i=0,_len=acceptedFiles.length;_i<_len;_i++){validType=acceptedFiles[_i];validType=validType.trim();if(validType.charAt(0)==="."){if(file.name.toLowerCase().indexOf(validType.toLowerCase(),file.name.length-validType.length)!==-1){return!0}}else if(/\/\*$/.test(validType)){if(baseMimeType===validType.replace(/\/.*$/,"")){return!0}}else{if(mimeType===validType){return!0}}}
return!1};if(typeof jQuery!=="undefined"&&jQuery!==null){jQuery.fn.dropzone=function(options){return this.each(function(){return new Dropzone(this,options)})}}
if(typeof module!=="undefined"&&module!==null){module.exports=Dropzone}else{window.Dropzone=Dropzone}
Dropzone.ADDED="added";Dropzone.QUEUED="queued";Dropzone.ACCEPTED=Dropzone.QUEUED;Dropzone.UPLOADING="uploading";Dropzone.PROCESSING=Dropzone.UPLOADING;Dropzone.CANCELED="canceled";Dropzone.ERROR="error";Dropzone.SUCCESS="success";detectVerticalSquash=function(img){var alpha,canvas,ctx,data,ey,ih,iw,py,ratio,sy;iw=img.naturalWidth;ih=img.naturalHeight;canvas=document.createElement("canvas");canvas.width=1;canvas.height=ih;ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);data=ctx.getImageData(0,0,1,ih).data;sy=0;ey=ih;py=ih;while(py>sy){alpha=data[(py-1)*4+3];if(alpha===0){ey=py}else{sy=py}
py=(ey+sy)>>1}
ratio=py/ih;if(ratio===0){return 1}else{return ratio}};drawImageIOSFix=function(ctx,img,sx,sy,sw,sh,dx,dy,dw,dh){var vertSquashRatio;vertSquashRatio=detectVerticalSquash(img);return ctx.drawImage(img,sx,sy,sw,sh,dx,dy,dw,dh/vertSquashRatio)};contentLoaded=function(win,fn){var add,doc,done,init,poll,pre,rem,root,top;done=!1;top=!0;doc=win.document;root=doc.documentElement;add=(doc.addEventListener?"addEventListener":"attachEvent");rem=(doc.addEventListener?"removeEventListener":"detachEvent");pre=(doc.addEventListener?"":"on");init=function(e){if(e.type==="readystatechange"&&doc.readyState!=="complete"){return}(e.type==="load"?win:doc)[rem](pre+e.type,init,!1);if(!done&&(done=!0)){return fn.call(win,e.type||e)}};poll=function(){var e;try{root.doScroll("left")}catch(_error){e=_error;setTimeout(poll,50);return}
return init("poll")};if(doc.readyState!=="complete"){if(doc.createEventObject&&root.doScroll){try{top=!win.frameElement}catch(_error){}
if(top){poll()}}
doc[add](pre+"DOMContentLoaded",init,!1);doc[add](pre+"readystatechange",init,!1);return win[add](pre+"load",init,!1)}};Dropzone._autoDiscoverFunction=function(){if(Dropzone.autoDiscover){return Dropzone.discover()}};contentLoaded(window,Dropzone._autoDiscoverFunction)}).call(this);!function($){"use strict";var MultiSelect=function(element,options){this.options=options;this.$element=$(element);this.$container=$('<div/>',{'class':"ms-container"});this.$selectableContainer=$('<div/>',{'class':'ms-selectable'});this.$selectionContainer=$('<div/>',{'class':'ms-selection'});this.$selectableUl=$('<ul/>',{'class':"ms-list",'tabindex':'-1'});this.$selectionUl=$('<ul/>',{'class':"ms-list",'tabindex':'-1'});this.scrollTo=0;this.elemsSelector='li:visible:not(.ms-optgroup-label,.ms-optgroup-container,.'+options.disabledClass+')'};MultiSelect.prototype={constructor:MultiSelect,init:function(){var that=this,ms=this.$element;if(ms.next('.ms-container').length===0){ms.css({position:'absolute',left:'-9999px'});ms.attr('id',ms.attr('id')?ms.attr('id'):Math.ceil(Math.random()*1000)+'multiselect');this.$container.attr('id','ms-'+ms.attr('id'));this.$container.addClass(that.options.cssClass);ms.find('option').each(function(){that.generateLisFromOption(this)});this.$selectionUl.find('.ms-optgroup-label').hide();if(that.options.selectableHeader){that.$selectableContainer.append(that.options.selectableHeader)}
that.$selectableContainer.append(that.$selectableUl);if(that.options.selectableFooter){that.$selectableContainer.append(that.options.selectableFooter)}
if(that.options.selectionHeader){that.$selectionContainer.append(that.options.selectionHeader)}
that.$selectionContainer.append(that.$selectionUl);if(that.options.selectionFooter){that.$selectionContainer.append(that.options.selectionFooter)}
that.$container.append(that.$selectableContainer);that.$container.append(that.$selectionContainer);ms.after(that.$container);that.activeMouse(that.$selectableUl);that.activeKeyboard(that.$selectableUl);var action=that.options.dblClick?'dblclick':'click';that.$selectableUl.on(action,'.ms-elem-selectable',function(){that.select($(this).data('ms-value'))});that.$selectionUl.on(action,'.ms-elem-selection',function(){that.deselect($(this).data('ms-value'))});that.activeMouse(that.$selectionUl);that.activeKeyboard(that.$selectionUl);ms.on('focus',function(){that.$selectableUl.focus()})}
var selectedValues=ms.find('option:selected').map(function(){return $(this).val()}).get();that.select(selectedValues,'init');if(typeof that.options.afterInit==='function'){that.options.afterInit.call(this,this.$container)}},'generateLisFromOption':function(option,index,$container){var that=this,ms=that.$element,attributes="",$option=$(option);for(var cpt=0;cpt<option.attributes.length;cpt++){var attr=option.attributes[cpt];if(attr.name!=='value'&&attr.name!=='disabled'){attributes+=attr.name+'="'+attr.value+'" '}}
var selectableLi=$('<li '+attributes+'><span>'+that.escapeHTML($option.text())+'</span></li>'),selectedLi=selectableLi.clone(),value=$option.val(),elementId=that.sanitize(value);selectableLi.data('ms-value',value).addClass('ms-elem-selectable').attr('id',elementId+'-selectable');selectedLi.data('ms-value',value).addClass('ms-elem-selection').attr('id',elementId+'-selection').hide();if($option.prop('disabled')||ms.prop('disabled')){selectedLi.addClass(that.options.disabledClass);selectableLi.addClass(that.options.disabledClass)}
var $optgroup=$option.parent('optgroup');if($optgroup.length>0){var optgroupLabel=$optgroup.attr('label'),optgroupId=that.sanitize(optgroupLabel),$selectableOptgroup=that.$selectableUl.find('#optgroup-selectable-'+optgroupId),$selectionOptgroup=that.$selectionUl.find('#optgroup-selection-'+optgroupId);if($selectableOptgroup.length===0){var optgroupContainerTpl='<li class="ms-optgroup-container"></li>',optgroupTpl='<ul class="ms-optgroup"><li class="ms-optgroup-label"><span>'+optgroupLabel+'</span></li></ul>';$selectableOptgroup=$(optgroupContainerTpl);$selectionOptgroup=$(optgroupContainerTpl);$selectableOptgroup.attr('id','optgroup-selectable-'+optgroupId);$selectionOptgroup.attr('id','optgroup-selection-'+optgroupId);$selectableOptgroup.append($(optgroupTpl));$selectionOptgroup.append($(optgroupTpl));if(that.options.selectableOptgroup){$selectableOptgroup.find('.ms-optgroup-label').on('click',function(){var values=$optgroup.children(':not(:selected, :disabled)').map(function(){return $(this).val()}).get();that.select(values)});$selectionOptgroup.find('.ms-optgroup-label').on('click',function(){var values=$optgroup.children(':selected:not(:disabled)').map(function(){return $(this).val()}).get();that.deselect(values)})}
that.$selectableUl.append($selectableOptgroup);that.$selectionUl.append($selectionOptgroup)}
index=index==undefined?$selectableOptgroup.find('ul').children().length:index+1;selectableLi.insertAt(index,$selectableOptgroup.children());selectedLi.insertAt(index,$selectionOptgroup.children())}else{index=index==undefined?that.$selectableUl.children().length:index;selectableLi.insertAt(index,that.$selectableUl);selectedLi.insertAt(index,that.$selectionUl)}},'addOption':function(options){var that=this;if(options.value!==undefined&&options.value!==null){options=[options]}
$.each(options,function(index,option){if(option.value!==undefined&&option.value!==null&&that.$element.find("option[value='"+option.value+"']").length===0){var $option=$('<option value="'+option.value+'">'+option.text+'</option>'),index=parseInt((typeof option.index==='undefined'?that.$element.children().length:option.index)),$container=option.nested==undefined?that.$element:$("optgroup[label='"+option.nested+"']")
$option.insertAt(index,$container);that.generateLisFromOption($option.get(0),index,option.nested)}})},'escapeHTML':function(text){return $("<div>").text(text).html()},'activeKeyboard':function($list){var that=this;$list.on('focus',function(){$(this).addClass('ms-focus')}).on('blur',function(){$(this).removeClass('ms-focus')}).on('keydown',function(e){switch(e.which){case 40:case 38:e.preventDefault();e.stopPropagation();that.moveHighlight($(this),(e.which===38)?-1:1);return;case 37:case 39:e.preventDefault();e.stopPropagation();that.switchList($list);return;case 9:if(that.$element.is('[tabindex]')){e.preventDefault();var tabindex=parseInt(that.$element.attr('tabindex'),10);tabindex=(e.shiftKey)?tabindex-1:tabindex+1;$('[tabindex="'+(tabindex)+'"]').focus();return}else{if(e.shiftKey){that.$element.trigger('focus')}}}
if($.inArray(e.which,that.options.keySelect)>-1){e.preventDefault();e.stopPropagation();that.selectHighlighted($list);return}})},'moveHighlight':function($list,direction){var $elems=$list.find(this.elemsSelector),$currElem=$elems.filter('.ms-hover'),$nextElem=null,elemHeight=$elems.first().outerHeight(),containerHeight=$list.height(),containerSelector='#'+this.$container.prop('id');$elems.removeClass('ms-hover');if(direction===1){$nextElem=$currElem.nextAll(this.elemsSelector).first();if($nextElem.length===0){var $optgroupUl=$currElem.parent();if($optgroupUl.hasClass('ms-optgroup')){var $optgroupLi=$optgroupUl.parent(),$nextOptgroupLi=$optgroupLi.next(':visible');if($nextOptgroupLi.length>0){$nextElem=$nextOptgroupLi.find(this.elemsSelector).first()}else{$nextElem=$elems.first()}}else{$nextElem=$elems.first()}}}else if(direction===-1){$nextElem=$currElem.prevAll(this.elemsSelector).first();if($nextElem.length===0){var $optgroupUl=$currElem.parent();if($optgroupUl.hasClass('ms-optgroup')){var $optgroupLi=$optgroupUl.parent(),$prevOptgroupLi=$optgroupLi.prev(':visible');if($prevOptgroupLi.length>0){$nextElem=$prevOptgroupLi.find(this.elemsSelector).last()}else{$nextElem=$elems.last()}}else{$nextElem=$elems.last()}}}
if($nextElem.length>0){$nextElem.addClass('ms-hover');var scrollTo=$list.scrollTop()+$nextElem.position().top-containerHeight/2+elemHeight/2;$list.scrollTop(scrollTo)}},'selectHighlighted':function($list){var $elems=$list.find(this.elemsSelector),$highlightedElem=$elems.filter('.ms-hover').first();if($highlightedElem.length>0){if($list.parent().hasClass('ms-selectable')){this.select($highlightedElem.data('ms-value'))}else{this.deselect($highlightedElem.data('ms-value'))}
$elems.removeClass('ms-hover')}},'switchList':function($list){$list.blur();this.$container.find(this.elemsSelector).removeClass('ms-hover');if($list.parent().hasClass('ms-selectable')){this.$selectionUl.focus()}else{this.$selectableUl.focus()}},'activeMouse':function($list){var that=this;this.$container.on('mouseenter',that.elemsSelector,function(){$(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');$(this).addClass('ms-hover')});this.$container.on('mouseleave',that.elemsSelector,function(){$(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover')})},'refresh':function(){this.destroy();this.$element.multiSelect(this.options)},'destroy':function(){$("#ms-"+this.$element.attr("id")).remove();this.$element.css('position','').css('left','')
this.$element.removeData('multiselect')},'select':function(value,method){if(typeof value==='string'){value=[value]}
var that=this,ms=this.$element,msIds=$.map(value,function(val){return(that.sanitize(val))}),selectables=this.$selectableUl.find('#'+msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'),selections=this.$selectionUl.find('#'+msIds.join('-selection, #')+'-selection').filter(':not(.'+that.options.disabledClass+')'),options=ms.find('option:not(:disabled)').filter(function(){return($.inArray(this.value,value)>-1)});if(method==='init'){selectables=this.$selectableUl.find('#'+msIds.join('-selectable, #')+'-selectable'),selections=this.$selectionUl.find('#'+msIds.join('-selection, #')+'-selection')}
if(selectables.length>0){selectables.addClass('ms-selected').hide();selections.addClass('ms-selected').show();options.prop('selected',!0);that.$container.find(that.elemsSelector).removeClass('ms-hover');var selectableOptgroups=that.$selectableUl.children('.ms-optgroup-container');if(selectableOptgroups.length>0){selectableOptgroups.each(function(){var selectablesLi=$(this).find('.ms-elem-selectable');if(selectablesLi.length===selectablesLi.filter('.ms-selected').length){$(this).find('.ms-optgroup-label').hide()}});var selectionOptgroups=that.$selectionUl.children('.ms-optgroup-container');selectionOptgroups.each(function(){var selectionsLi=$(this).find('.ms-elem-selection');if(selectionsLi.filter('.ms-selected').length>0){$(this).find('.ms-optgroup-label').show()}})}else{if(that.options.keepOrder&&method!=='init'){var selectionLiLast=that.$selectionUl.find('.ms-selected');if((selectionLiLast.length>1)&&(selectionLiLast.last().get(0)!=selections.get(0))){selections.insertAfter(selectionLiLast.last())}}}
if(method!=='init'){ms.trigger('change');if(typeof that.options.afterSelect==='function'){that.options.afterSelect.call(this,value)}}}},'deselect':function(value){if(typeof value==='string'){value=[value]}
var that=this,ms=this.$element,msIds=$.map(value,function(val){return(that.sanitize(val))}),selectables=this.$selectableUl.find('#'+msIds.join('-selectable, #')+'-selectable'),selections=this.$selectionUl.find('#'+msIds.join('-selection, #')+'-selection').filter('.ms-selected').filter(':not(.'+that.options.disabledClass+')'),options=ms.find('option').filter(function(){return($.inArray(this.value,value)>-1)});if(selections.length>0){selectables.removeClass('ms-selected').show();selections.removeClass('ms-selected').hide();options.prop('selected',!1);that.$container.find(that.elemsSelector).removeClass('ms-hover');var selectableOptgroups=that.$selectableUl.children('.ms-optgroup-container');if(selectableOptgroups.length>0){selectableOptgroups.each(function(){var selectablesLi=$(this).find('.ms-elem-selectable');if(selectablesLi.filter(':not(.ms-selected)').length>0){$(this).find('.ms-optgroup-label').show()}});var selectionOptgroups=that.$selectionUl.children('.ms-optgroup-container');selectionOptgroups.each(function(){var selectionsLi=$(this).find('.ms-elem-selection');if(selectionsLi.filter('.ms-selected').length===0){$(this).find('.ms-optgroup-label').hide()}})}
ms.trigger('change');if(typeof that.options.afterDeselect==='function'){that.options.afterDeselect.call(this,value)}}},'select_all':function(){var ms=this.$element,values=ms.val();ms.find('option:not(":disabled")').prop('selected',!0);this.$selectableUl.find('.ms-elem-selectable').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').hide();this.$selectionUl.find('.ms-optgroup-label').show();this.$selectableUl.find('.ms-optgroup-label').hide();this.$selectionUl.find('.ms-elem-selection').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').show();this.$selectionUl.focus();ms.trigger('change');if(typeof this.options.afterSelect==='function'){var selectedValues=$.grep(ms.val(),function(item){return $.inArray(item,values)<0});this.options.afterSelect.call(this,selectedValues)}},'deselect_all':function(){var ms=this.$element,values=ms.val();ms.find('option').prop('selected',!1);this.$selectableUl.find('.ms-elem-selectable').removeClass('ms-selected').show();this.$selectionUl.find('.ms-optgroup-label').hide();this.$selectableUl.find('.ms-optgroup-label').show();this.$selectionUl.find('.ms-elem-selection').removeClass('ms-selected').hide();this.$selectableUl.focus();ms.trigger('change');if(typeof this.options.afterDeselect==='function'){this.options.afterDeselect.call(this,values)}},sanitize:function(value){var hash=0,i,character;if(value.length==0)return hash;var ls=0;for(i=0,ls=value.length;i<ls;i++){character=value.charCodeAt(i);hash=((hash<<5)-hash)+character;hash|=0}
return hash}};$.fn.multiSelect=function(){var option=arguments[0],args=arguments;return this.each(function(){var $this=$(this),data=$this.data('multiselect'),options=$.extend({},$.fn.multiSelect.defaults,$this.data(),typeof option==='object'&&option);if(!data){$this.data('multiselect',(data=new MultiSelect(this,options)))}
if(typeof option==='string'){data[option](args[1])}else{data.init()}})};$.fn.multiSelect.defaults={keySelect:[32],selectableOptgroup:!1,disabledClass:'disabled',dblClick:!1,keepOrder:!1,cssClass:''};$.fn.multiSelect.Constructor=MultiSelect;$.fn.insertAt=function(index,$parent){return this.each(function(){if(index===0){$parent.prepend(this)}else{$parent.children().eq(index-1).after(this)}})}}(window.jQuery);/*!
 * Chart.js v2.9.4
 * https://www.chartjs.org
 * (c) 2020 Chart.js Contributors
 * Released under the MIT License
 */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(function(){try{return require('moment')}catch(e){}}()):typeof define==='function'&&define.amd?define(['require'],function(require){return factory(function(){try{return require('moment')}catch(e){}}())}):(global=global||self,global.Chart=factory(global.moment))}(this,(function(moment){'use strict';moment=moment&&moment.hasOwnProperty('default')?moment['default']:moment;function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports}
function getCjsExportFromNamespace(n){return n&&n['default']||n}
var colorName={"aliceblue":[240,248,255],"antiquewhite":[250,235,215],"aqua":[0,255,255],"aquamarine":[127,255,212],"azure":[240,255,255],"beige":[245,245,220],"bisque":[255,228,196],"black":[0,0,0],"blanchedalmond":[255,235,205],"blue":[0,0,255],"blueviolet":[138,43,226],"brown":[165,42,42],"burlywood":[222,184,135],"cadetblue":[95,158,160],"chartreuse":[127,255,0],"chocolate":[210,105,30],"coral":[255,127,80],"cornflowerblue":[100,149,237],"cornsilk":[255,248,220],"crimson":[220,20,60],"cyan":[0,255,255],"darkblue":[0,0,139],"darkcyan":[0,139,139],"darkgoldenrod":[184,134,11],"darkgray":[169,169,169],"darkgreen":[0,100,0],"darkgrey":[169,169,169],"darkkhaki":[189,183,107],"darkmagenta":[139,0,139],"darkolivegreen":[85,107,47],"darkorange":[255,140,0],"darkorchid":[153,50,204],"darkred":[139,0,0],"darksalmon":[233,150,122],"darkseagreen":[143,188,143],"darkslateblue":[72,61,139],"darkslategray":[47,79,79],"darkslategrey":[47,79,79],"darkturquoise":[0,206,209],"darkviolet":[148,0,211],"deeppink":[255,20,147],"deepskyblue":[0,191,255],"dimgray":[105,105,105],"dimgrey":[105,105,105],"dodgerblue":[30,144,255],"firebrick":[178,34,34],"floralwhite":[255,250,240],"forestgreen":[34,139,34],"fuchsia":[255,0,255],"gainsboro":[220,220,220],"ghostwhite":[248,248,255],"gold":[255,215,0],"goldenrod":[218,165,32],"gray":[128,128,128],"green":[0,128,0],"greenyellow":[173,255,47],"grey":[128,128,128],"honeydew":[240,255,240],"hotpink":[255,105,180],"indianred":[205,92,92],"indigo":[75,0,130],"ivory":[255,255,240],"khaki":[240,230,140],"lavender":[230,230,250],"lavenderblush":[255,240,245],"lawngreen":[124,252,0],"lemonchiffon":[255,250,205],"lightblue":[173,216,230],"lightcoral":[240,128,128],"lightcyan":[224,255,255],"lightgoldenrodyellow":[250,250,210],"lightgray":[211,211,211],"lightgreen":[144,238,144],"lightgrey":[211,211,211],"lightpink":[255,182,193],"lightsalmon":[255,160,122],"lightseagreen":[32,178,170],"lightskyblue":[135,206,250],"lightslategray":[119,136,153],"lightslategrey":[119,136,153],"lightsteelblue":[176,196,222],"lightyellow":[255,255,224],"lime":[0,255,0],"limegreen":[50,205,50],"linen":[250,240,230],"magenta":[255,0,255],"maroon":[128,0,0],"mediumaquamarine":[102,205,170],"mediumblue":[0,0,205],"mediumorchid":[186,85,211],"mediumpurple":[147,112,219],"mediumseagreen":[60,179,113],"mediumslateblue":[123,104,238],"mediumspringgreen":[0,250,154],"mediumturquoise":[72,209,204],"mediumvioletred":[199,21,133],"midnightblue":[25,25,112],"mintcream":[245,255,250],"mistyrose":[255,228,225],"moccasin":[255,228,181],"navajowhite":[255,222,173],"navy":[0,0,128],"oldlace":[253,245,230],"olive":[128,128,0],"olivedrab":[107,142,35],"orange":[255,165,0],"orangered":[255,69,0],"orchid":[218,112,214],"palegoldenrod":[238,232,170],"palegreen":[152,251,152],"paleturquoise":[175,238,238],"palevioletred":[219,112,147],"papayawhip":[255,239,213],"peachpuff":[255,218,185],"peru":[205,133,63],"pink":[255,192,203],"plum":[221,160,221],"powderblue":[176,224,230],"purple":[128,0,128],"rebeccapurple":[102,51,153],"red":[255,0,0],"rosybrown":[188,143,143],"royalblue":[65,105,225],"saddlebrown":[139,69,19],"salmon":[250,128,114],"sandybrown":[244,164,96],"seagreen":[46,139,87],"seashell":[255,245,238],"sienna":[160,82,45],"silver":[192,192,192],"skyblue":[135,206,235],"slateblue":[106,90,205],"slategray":[112,128,144],"slategrey":[112,128,144],"snow":[255,250,250],"springgreen":[0,255,127],"steelblue":[70,130,180],"tan":[210,180,140],"teal":[0,128,128],"thistle":[216,191,216],"tomato":[255,99,71],"turquoise":[64,224,208],"violet":[238,130,238],"wheat":[245,222,179],"white":[255,255,255],"whitesmoke":[245,245,245],"yellow":[255,255,0],"yellowgreen":[154,205,50]};var conversions=createCommonjsModule(function(module){var reverseKeywords={};for(var key in colorName){if(colorName.hasOwnProperty(key)){reverseKeywords[colorName[key]]=key}}
var convert=module.exports={rgb:{channels:3,labels:'rgb'},hsl:{channels:3,labels:'hsl'},hsv:{channels:3,labels:'hsv'},hwb:{channels:3,labels:'hwb'},cmyk:{channels:4,labels:'cmyk'},xyz:{channels:3,labels:'xyz'},lab:{channels:3,labels:'lab'},lch:{channels:3,labels:'lch'},hex:{channels:1,labels:['hex']},keyword:{channels:1,labels:['keyword']},ansi16:{channels:1,labels:['ansi16']},ansi256:{channels:1,labels:['ansi256']},hcg:{channels:3,labels:['h','c','g']},apple:{channels:3,labels:['r16','g16','b16']},gray:{channels:1,labels:['gray']}};for(var model in convert){if(convert.hasOwnProperty(model)){if(!('channels' in convert[model])){throw new Error('missing channels property: '+model)}
if(!('labels' in convert[model])){throw new Error('missing channel labels property: '+model)}
if(convert[model].labels.length!==convert[model].channels){throw new Error('channel and label counts mismatch: '+model)}
var channels=convert[model].channels;var labels=convert[model].labels;delete convert[model].channels;delete convert[model].labels;Object.defineProperty(convert[model],'channels',{value:channels});Object.defineProperty(convert[model],'labels',{value:labels})}}
convert.rgb.hsl=function(rgb){var r=rgb[0]/255;var g=rgb[1]/255;var b=rgb[2]/255;var min=Math.min(r,g,b);var max=Math.max(r,g,b);var delta=max-min;var h;var s;var l;if(max===min){h=0}else if(r===max){h=(g-b)/delta}else if(g===max){h=2+(b-r)/delta}else if(b===max){h=4+(r-g)/delta}
h=Math.min(h*60,360);if(h<0){h+=360}
l=(min+max)/2;if(max===min){s=0}else if(l<=0.5){s=delta/(max+min)}else{s=delta/(2-max-min)}
return[h,s*100,l*100]};convert.rgb.hsv=function(rgb){var rdif;var gdif;var bdif;var h;var s;var r=rgb[0]/255;var g=rgb[1]/255;var b=rgb[2]/255;var v=Math.max(r,g,b);var diff=v-Math.min(r,g,b);var diffc=function(c){return(v-c)/6/diff+1/2};if(diff===0){h=s=0}else{s=diff/v;rdif=diffc(r);gdif=diffc(g);bdif=diffc(b);if(r===v){h=bdif-gdif}else if(g===v){h=(1/3)+rdif-bdif}else if(b===v){h=(2/3)+gdif-rdif}
if(h<0){h+=1}else if(h>1){h-=1}}
return[h*360,s*100,v*100]};convert.rgb.hwb=function(rgb){var r=rgb[0];var g=rgb[1];var b=rgb[2];var h=convert.rgb.hsl(rgb)[0];var w=1/255*Math.min(r,Math.min(g,b));b=1-1/255*Math.max(r,Math.max(g,b));return[h,w*100,b*100]};convert.rgb.cmyk=function(rgb){var r=rgb[0]/255;var g=rgb[1]/255;var b=rgb[2]/255;var c;var m;var y;var k;k=Math.min(1-r,1-g,1-b);c=(1-r-k)/(1-k)||0;m=(1-g-k)/(1-k)||0;y=(1-b-k)/(1-k)||0;return[c*100,m*100,y*100,k*100]};function comparativeDistance(x,y){return(Math.pow(x[0]-y[0],2)+Math.pow(x[1]-y[1],2)+Math.pow(x[2]-y[2],2))}
convert.rgb.keyword=function(rgb){var reversed=reverseKeywords[rgb];if(reversed){return reversed}
var currentClosestDistance=Infinity;var currentClosestKeyword;for(var keyword in colorName){if(colorName.hasOwnProperty(keyword)){var value=colorName[keyword];var distance=comparativeDistance(rgb,value);if(distance<currentClosestDistance){currentClosestDistance=distance;currentClosestKeyword=keyword}}}
return currentClosestKeyword};convert.keyword.rgb=function(keyword){return colorName[keyword]};convert.rgb.xyz=function(rgb){var r=rgb[0]/255;var g=rgb[1]/255;var b=rgb[2]/255;r=r>0.04045?Math.pow(((r+0.055)/1.055),2.4):(r/12.92);g=g>0.04045?Math.pow(((g+0.055)/1.055),2.4):(g/12.92);b=b>0.04045?Math.pow(((b+0.055)/1.055),2.4):(b/12.92);var x=(r*0.4124)+(g*0.3576)+(b*0.1805);var y=(r*0.2126)+(g*0.7152)+(b*0.0722);var z=(r*0.0193)+(g*0.1192)+(b*0.9505);return[x*100,y*100,z*100]};convert.rgb.lab=function(rgb){var xyz=convert.rgb.xyz(rgb);var x=xyz[0];var y=xyz[1];var z=xyz[2];var l;var a;var b;x/=95.047;y/=100;z/=108.883;x=x>0.008856?Math.pow(x,1/3):(7.787*x)+(16/116);y=y>0.008856?Math.pow(y,1/3):(7.787*y)+(16/116);z=z>0.008856?Math.pow(z,1/3):(7.787*z)+(16/116);l=(116*y)-16;a=500*(x-y);b=200*(y-z);return[l,a,b]};convert.hsl.rgb=function(hsl){var h=hsl[0]/360;var s=hsl[1]/100;var l=hsl[2]/100;var t1;var t2;var t3;var rgb;var val;if(s===0){val=l*255;return[val,val,val]}
if(l<0.5){t2=l*(1+s)}else{t2=l+s-l*s}
t1=2*l-t2;rgb=[0,0,0];for(var i=0;i<3;i++){t3=h+1/3*-(i-1);if(t3<0){t3++}
if(t3>1){t3--}
if(6*t3<1){val=t1+(t2-t1)*6*t3}else if(2*t3<1){val=t2}else if(3*t3<2){val=t1+(t2-t1)*(2/3-t3)*6}else{val=t1}
rgb[i]=val*255}
return rgb};convert.hsl.hsv=function(hsl){var h=hsl[0];var s=hsl[1]/100;var l=hsl[2]/100;var smin=s;var lmin=Math.max(l,0.01);var sv;var v;l*=2;s*=(l<=1)?l:2-l;smin*=lmin<=1?lmin:2-lmin;v=(l+s)/2;sv=l===0?(2*smin)/(lmin+smin):(2*s)/(l+s);return[h,sv*100,v*100]};convert.hsv.rgb=function(hsv){var h=hsv[0]/60;var s=hsv[1]/100;var v=hsv[2]/100;var hi=Math.floor(h)%6;var f=h-Math.floor(h);var p=255*v*(1-s);var q=255*v*(1-(s*f));var t=255*v*(1-(s*(1-f)));v*=255;switch(hi){case 0:return[v,t,p];case 1:return[q,v,p];case 2:return[p,v,t];case 3:return[p,q,v];case 4:return[t,p,v];case 5:return[v,p,q]}};convert.hsv.hsl=function(hsv){var h=hsv[0];var s=hsv[1]/100;var v=hsv[2]/100;var vmin=Math.max(v,0.01);var lmin;var sl;var l;l=(2-s)*v;lmin=(2-s)*vmin;sl=s*vmin;sl/=(lmin<=1)?lmin:2-lmin;sl=sl||0;l/=2;return[h,sl*100,l*100]};convert.hwb.rgb=function(hwb){var h=hwb[0]/360;var wh=hwb[1]/100;var bl=hwb[2]/100;var ratio=wh+bl;var i;var v;var f;var n;if(ratio>1){wh/=ratio;bl/=ratio}
i=Math.floor(6*h);v=1-bl;f=6*h-i;if((i&0x01)!==0){f=1-f}
n=wh+f*(v-wh);var r;var g;var b;switch(i){default:case 6:case 0:r=v;g=n;b=wh;break;case 1:r=n;g=v;b=wh;break;case 2:r=wh;g=v;b=n;break;case 3:r=wh;g=n;b=v;break;case 4:r=n;g=wh;b=v;break;case 5:r=v;g=wh;b=n;break}
return[r*255,g*255,b*255]};convert.cmyk.rgb=function(cmyk){var c=cmyk[0]/100;var m=cmyk[1]/100;var y=cmyk[2]/100;var k=cmyk[3]/100;var r;var g;var b;r=1-Math.min(1,c*(1-k)+k);g=1-Math.min(1,m*(1-k)+k);b=1-Math.min(1,y*(1-k)+k);return[r*255,g*255,b*255]};convert.xyz.rgb=function(xyz){var x=xyz[0]/100;var y=xyz[1]/100;var z=xyz[2]/100;var r;var g;var b;r=(x*3.2406)+(y*-1.5372)+(z*-0.4986);g=(x*-0.9689)+(y*1.8758)+(z*0.0415);b=(x*0.0557)+(y*-0.2040)+(z*1.0570);r=r>0.0031308?((1.055*Math.pow(r,1.0/2.4))-0.055):r*12.92;g=g>0.0031308?((1.055*Math.pow(g,1.0/2.4))-0.055):g*12.92;b=b>0.0031308?((1.055*Math.pow(b,1.0/2.4))-0.055):b*12.92;r=Math.min(Math.max(0,r),1);g=Math.min(Math.max(0,g),1);b=Math.min(Math.max(0,b),1);return[r*255,g*255,b*255]};convert.xyz.lab=function(xyz){var x=xyz[0];var y=xyz[1];var z=xyz[2];var l;var a;var b;x/=95.047;y/=100;z/=108.883;x=x>0.008856?Math.pow(x,1/3):(7.787*x)+(16/116);y=y>0.008856?Math.pow(y,1/3):(7.787*y)+(16/116);z=z>0.008856?Math.pow(z,1/3):(7.787*z)+(16/116);l=(116*y)-16;a=500*(x-y);b=200*(y-z);return[l,a,b]};convert.lab.xyz=function(lab){var l=lab[0];var a=lab[1];var b=lab[2];var x;var y;var z;y=(l+16)/116;x=a/500+y;z=y-b/200;var y2=Math.pow(y,3);var x2=Math.pow(x,3);var z2=Math.pow(z,3);y=y2>0.008856?y2:(y-16/116)/7.787;x=x2>0.008856?x2:(x-16/116)/7.787;z=z2>0.008856?z2:(z-16/116)/7.787;x*=95.047;y*=100;z*=108.883;return[x,y,z]};convert.lab.lch=function(lab){var l=lab[0];var a=lab[1];var b=lab[2];var hr;var h;var c;hr=Math.atan2(b,a);h=hr*360/2/Math.PI;if(h<0){h+=360}
c=Math.sqrt(a*a+b*b);return[l,c,h]};convert.lch.lab=function(lch){var l=lch[0];var c=lch[1];var h=lch[2];var a;var b;var hr;hr=h/360*2*Math.PI;a=c*Math.cos(hr);b=c*Math.sin(hr);return[l,a,b]};convert.rgb.ansi16=function(args){var r=args[0];var g=args[1];var b=args[2];var value=1 in arguments?arguments[1]:convert.rgb.hsv(args)[2];value=Math.round(value/50);if(value===0){return 30}
var ansi=30+((Math.round(b/255)<<2)|(Math.round(g/255)<<1)|Math.round(r/255));if(value===2){ansi+=60}
return ansi};convert.hsv.ansi16=function(args){return convert.rgb.ansi16(convert.hsv.rgb(args),args[2])};convert.rgb.ansi256=function(args){var r=args[0];var g=args[1];var b=args[2];if(r===g&&g===b){if(r<8){return 16}
if(r>248){return 231}
return Math.round(((r-8)/247)*24)+232}
var ansi=16+(36*Math.round(r/255*5))+(6*Math.round(g/255*5))+Math.round(b/255*5);return ansi};convert.ansi16.rgb=function(args){var color=args%10;if(color===0||color===7){if(args>50){color+=3.5}
color=color/10.5*255;return[color,color,color]}
var mult=(~~(args>50)+1)*0.5;var r=((color&1)*mult)*255;var g=(((color>>1)&1)*mult)*255;var b=(((color>>2)&1)*mult)*255;return[r,g,b]};convert.ansi256.rgb=function(args){if(args>=232){var c=(args-232)*10+8;return[c,c,c]}
args-=16;var rem;var r=Math.floor(args/36)/5*255;var g=Math.floor((rem=args%36)/6)/5*255;var b=(rem%6)/5*255;return[r,g,b]};convert.rgb.hex=function(args){var integer=((Math.round(args[0])&0xFF)<<16)+((Math.round(args[1])&0xFF)<<8)+(Math.round(args[2])&0xFF);var string=integer.toString(16).toUpperCase();return'000000'.substring(string.length)+string};convert.hex.rgb=function(args){var match=args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!match){return[0,0,0]}
var colorString=match[0];if(match[0].length===3){colorString=colorString.split('').map(function(char){return char+char}).join('')}
var integer=parseInt(colorString,16);var r=(integer>>16)&0xFF;var g=(integer>>8)&0xFF;var b=integer&0xFF;return[r,g,b]};convert.rgb.hcg=function(rgb){var r=rgb[0]/255;var g=rgb[1]/255;var b=rgb[2]/255;var max=Math.max(Math.max(r,g),b);var min=Math.min(Math.min(r,g),b);var chroma=(max-min);var grayscale;var hue;if(chroma<1){grayscale=min/(1-chroma)}else{grayscale=0}
if(chroma<=0){hue=0}else if(max===r){hue=((g-b)/chroma)%6}else if(max===g){hue=2+(b-r)/chroma}else{hue=4+(r-g)/chroma+4}
hue/=6;hue%=1;return[hue*360,chroma*100,grayscale*100]};convert.hsl.hcg=function(hsl){var s=hsl[1]/100;var l=hsl[2]/100;var c=1;var f=0;if(l<0.5){c=2.0*s*l}else{c=2.0*s*(1.0-l)}
if(c<1.0){f=(l-0.5*c)/(1.0-c)}
return[hsl[0],c*100,f*100]};convert.hsv.hcg=function(hsv){var s=hsv[1]/100;var v=hsv[2]/100;var c=s*v;var f=0;if(c<1.0){f=(v-c)/(1-c)}
return[hsv[0],c*100,f*100]};convert.hcg.rgb=function(hcg){var h=hcg[0]/360;var c=hcg[1]/100;var g=hcg[2]/100;if(c===0.0){return[g*255,g*255,g*255]}
var pure=[0,0,0];var hi=(h%1)*6;var v=hi%1;var w=1-v;var mg=0;switch(Math.floor(hi)){case 0:pure[0]=1;pure[1]=v;pure[2]=0;break;case 1:pure[0]=w;pure[1]=1;pure[2]=0;break;case 2:pure[0]=0;pure[1]=1;pure[2]=v;break;case 3:pure[0]=0;pure[1]=w;pure[2]=1;break;case 4:pure[0]=v;pure[1]=0;pure[2]=1;break;default:pure[0]=1;pure[1]=0;pure[2]=w}
mg=(1.0-c)*g;return[(c*pure[0]+mg)*255,(c*pure[1]+mg)*255,(c*pure[2]+mg)*255]};convert.hcg.hsv=function(hcg){var c=hcg[1]/100;var g=hcg[2]/100;var v=c+g*(1.0-c);var f=0;if(v>0.0){f=c/v}
return[hcg[0],f*100,v*100]};convert.hcg.hsl=function(hcg){var c=hcg[1]/100;var g=hcg[2]/100;var l=g*(1.0-c)+0.5*c;var s=0;if(l>0.0&&l<0.5){s=c/(2*l)}else if(l>=0.5&&l<1.0){s=c/(2*(1-l))}
return[hcg[0],s*100,l*100]};convert.hcg.hwb=function(hcg){var c=hcg[1]/100;var g=hcg[2]/100;var v=c+g*(1.0-c);return[hcg[0],(v-c)*100,(1-v)*100]};convert.hwb.hcg=function(hwb){var w=hwb[1]/100;var b=hwb[2]/100;var v=1-b;var c=v-w;var g=0;if(c<1){g=(v-c)/(1-c)}
return[hwb[0],c*100,g*100]};convert.apple.rgb=function(apple){return[(apple[0]/65535)*255,(apple[1]/65535)*255,(apple[2]/65535)*255]};convert.rgb.apple=function(rgb){return[(rgb[0]/255)*65535,(rgb[1]/255)*65535,(rgb[2]/255)*65535]};convert.gray.rgb=function(args){return[args[0]/100*255,args[0]/100*255,args[0]/100*255]};convert.gray.hsl=convert.gray.hsv=function(args){return[0,0,args[0]]};convert.gray.hwb=function(gray){return[0,100,gray[0]]};convert.gray.cmyk=function(gray){return[0,0,0,gray[0]]};convert.gray.lab=function(gray){return[gray[0],0,0]};convert.gray.hex=function(gray){var val=Math.round(gray[0]/100*255)&0xFF;var integer=(val<<16)+(val<<8)+val;var string=integer.toString(16).toUpperCase();return'000000'.substring(string.length)+string};convert.rgb.gray=function(rgb){var val=(rgb[0]+rgb[1]+rgb[2])/3;return[val/255*100]}});var conversions_1=conversions.rgb;var conversions_2=conversions.hsl;var conversions_3=conversions.hsv;var conversions_4=conversions.hwb;var conversions_5=conversions.cmyk;var conversions_6=conversions.xyz;var conversions_7=conversions.lab;var conversions_8=conversions.lch;var conversions_9=conversions.hex;var conversions_10=conversions.keyword;var conversions_11=conversions.ansi16;var conversions_12=conversions.ansi256;var conversions_13=conversions.hcg;var conversions_14=conversions.apple;var conversions_15=conversions.gray;function buildGraph(){var graph={};var models=Object.keys(conversions);for(var len=models.length,i=0;i<len;i++){graph[models[i]]={distance:-1,parent:null}}
return graph}
function deriveBFS(fromModel){var graph=buildGraph();var queue=[fromModel];graph[fromModel].distance=0;while(queue.length){var current=queue.pop();var adjacents=Object.keys(conversions[current]);for(var len=adjacents.length,i=0;i<len;i++){var adjacent=adjacents[i];var node=graph[adjacent];if(node.distance===-1){node.distance=graph[current].distance+1;node.parent=current;queue.unshift(adjacent)}}}
return graph}
function link(from,to){return function(args){return to(from(args))}}
function wrapConversion(toModel,graph){var path=[graph[toModel].parent,toModel];var fn=conversions[graph[toModel].parent][toModel];var cur=graph[toModel].parent;while(graph[cur].parent){path.unshift(graph[cur].parent);fn=link(conversions[graph[cur].parent][cur],fn);cur=graph[cur].parent}
fn.conversion=path;return fn}
var route=function(fromModel){var graph=deriveBFS(fromModel);var conversion={};var models=Object.keys(graph);for(var len=models.length,i=0;i<len;i++){var toModel=models[i];var node=graph[toModel];if(node.parent===null){continue}
conversion[toModel]=wrapConversion(toModel,graph)}
return conversion};var convert={};var models=Object.keys(conversions);function wrapRaw(fn){var wrappedFn=function(args){if(args===undefined||args===null){return args}
if(arguments.length>1){args=Array.prototype.slice.call(arguments)}
return fn(args)};if('conversion' in fn){wrappedFn.conversion=fn.conversion}
return wrappedFn}
function wrapRounded(fn){var wrappedFn=function(args){if(args===undefined||args===null){return args}
if(arguments.length>1){args=Array.prototype.slice.call(arguments)}
var result=fn(args);if(typeof result==='object'){for(var len=result.length,i=0;i<len;i++){result[i]=Math.round(result[i])}}
return result};if('conversion' in fn){wrappedFn.conversion=fn.conversion}
return wrappedFn}
models.forEach(function(fromModel){convert[fromModel]={};Object.defineProperty(convert[fromModel],'channels',{value:conversions[fromModel].channels});Object.defineProperty(convert[fromModel],'labels',{value:conversions[fromModel].labels});var routes=route(fromModel);var routeModels=Object.keys(routes);routeModels.forEach(function(toModel){var fn=routes[toModel];convert[fromModel][toModel]=wrapRounded(fn);convert[fromModel][toModel].raw=wrapRaw(fn)})});var colorConvert=convert;var colorName$1={"aliceblue":[240,248,255],"antiquewhite":[250,235,215],"aqua":[0,255,255],"aquamarine":[127,255,212],"azure":[240,255,255],"beige":[245,245,220],"bisque":[255,228,196],"black":[0,0,0],"blanchedalmond":[255,235,205],"blue":[0,0,255],"blueviolet":[138,43,226],"brown":[165,42,42],"burlywood":[222,184,135],"cadetblue":[95,158,160],"chartreuse":[127,255,0],"chocolate":[210,105,30],"coral":[255,127,80],"cornflowerblue":[100,149,237],"cornsilk":[255,248,220],"crimson":[220,20,60],"cyan":[0,255,255],"darkblue":[0,0,139],"darkcyan":[0,139,139],"darkgoldenrod":[184,134,11],"darkgray":[169,169,169],"darkgreen":[0,100,0],"darkgrey":[169,169,169],"darkkhaki":[189,183,107],"darkmagenta":[139,0,139],"darkolivegreen":[85,107,47],"darkorange":[255,140,0],"darkorchid":[153,50,204],"darkred":[139,0,0],"darksalmon":[233,150,122],"darkseagreen":[143,188,143],"darkslateblue":[72,61,139],"darkslategray":[47,79,79],"darkslategrey":[47,79,79],"darkturquoise":[0,206,209],"darkviolet":[148,0,211],"deeppink":[255,20,147],"deepskyblue":[0,191,255],"dimgray":[105,105,105],"dimgrey":[105,105,105],"dodgerblue":[30,144,255],"firebrick":[178,34,34],"floralwhite":[255,250,240],"forestgreen":[34,139,34],"fuchsia":[255,0,255],"gainsboro":[220,220,220],"ghostwhite":[248,248,255],"gold":[255,215,0],"goldenrod":[218,165,32],"gray":[128,128,128],"green":[0,128,0],"greenyellow":[173,255,47],"grey":[128,128,128],"honeydew":[240,255,240],"hotpink":[255,105,180],"indianred":[205,92,92],"indigo":[75,0,130],"ivory":[255,255,240],"khaki":[240,230,140],"lavender":[230,230,250],"lavenderblush":[255,240,245],"lawngreen":[124,252,0],"lemonchiffon":[255,250,205],"lightblue":[173,216,230],"lightcoral":[240,128,128],"lightcyan":[224,255,255],"lightgoldenrodyellow":[250,250,210],"lightgray":[211,211,211],"lightgreen":[144,238,144],"lightgrey":[211,211,211],"lightpink":[255,182,193],"lightsalmon":[255,160,122],"lightseagreen":[32,178,170],"lightskyblue":[135,206,250],"lightslategray":[119,136,153],"lightslategrey":[119,136,153],"lightsteelblue":[176,196,222],"lightyellow":[255,255,224],"lime":[0,255,0],"limegreen":[50,205,50],"linen":[250,240,230],"magenta":[255,0,255],"maroon":[128,0,0],"mediumaquamarine":[102,205,170],"mediumblue":[0,0,205],"mediumorchid":[186,85,211],"mediumpurple":[147,112,219],"mediumseagreen":[60,179,113],"mediumslateblue":[123,104,238],"mediumspringgreen":[0,250,154],"mediumturquoise":[72,209,204],"mediumvioletred":[199,21,133],"midnightblue":[25,25,112],"mintcream":[245,255,250],"mistyrose":[255,228,225],"moccasin":[255,228,181],"navajowhite":[255,222,173],"navy":[0,0,128],"oldlace":[253,245,230],"olive":[128,128,0],"olivedrab":[107,142,35],"orange":[255,165,0],"orangered":[255,69,0],"orchid":[218,112,214],"palegoldenrod":[238,232,170],"palegreen":[152,251,152],"paleturquoise":[175,238,238],"palevioletred":[219,112,147],"papayawhip":[255,239,213],"peachpuff":[255,218,185],"peru":[205,133,63],"pink":[255,192,203],"plum":[221,160,221],"powderblue":[176,224,230],"purple":[128,0,128],"rebeccapurple":[102,51,153],"red":[255,0,0],"rosybrown":[188,143,143],"royalblue":[65,105,225],"saddlebrown":[139,69,19],"salmon":[250,128,114],"sandybrown":[244,164,96],"seagreen":[46,139,87],"seashell":[255,245,238],"sienna":[160,82,45],"silver":[192,192,192],"skyblue":[135,206,235],"slateblue":[106,90,205],"slategray":[112,128,144],"slategrey":[112,128,144],"snow":[255,250,250],"springgreen":[0,255,127],"steelblue":[70,130,180],"tan":[210,180,140],"teal":[0,128,128],"thistle":[216,191,216],"tomato":[255,99,71],"turquoise":[64,224,208],"violet":[238,130,238],"wheat":[245,222,179],"white":[255,255,255],"whitesmoke":[245,245,245],"yellow":[255,255,0],"yellowgreen":[154,205,50]};var colorString={getRgba:getRgba,getHsla:getHsla,getRgb:getRgb,getHsl:getHsl,getHwb:getHwb,getAlpha:getAlpha,hexString:hexString,rgbString:rgbString,rgbaString:rgbaString,percentString:percentString,percentaString:percentaString,hslString:hslString,hslaString:hslaString,hwbString:hwbString,keyword:keyword};function getRgba(string){if(!string){return}
var abbr=/^#([a-fA-F0-9]{3,4})$/i,hex=/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,rgba=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,per=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,keyword=/(\w+)/;var rgb=[0,0,0],a=1,match=string.match(abbr),hexAlpha="";if(match){match=match[1];hexAlpha=match[3];for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match[i]+match[i],16)}
if(hexAlpha){a=Math.round((parseInt(hexAlpha+hexAlpha,16)/255)*100)/100}}else if(match=string.match(hex)){hexAlpha=match[2];match=match[1];for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match.slice(i*2,i*2+2),16)}
if(hexAlpha){a=Math.round((parseInt(hexAlpha,16)/255)*100)/100}}else if(match=string.match(rgba)){for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match[i+1])}
a=parseFloat(match[4])}else if(match=string.match(per)){for(var i=0;i<rgb.length;i++){rgb[i]=Math.round(parseFloat(match[i+1])*2.55)}
a=parseFloat(match[4])}else if(match=string.match(keyword)){if(match[1]=="transparent"){return[0,0,0,0]}
rgb=colorName$1[match[1]];if(!rgb){return}}
for(var i=0;i<rgb.length;i++){rgb[i]=scale(rgb[i],0,255)}
if(!a&&a!=0){a=1}else{a=scale(a,0,1)}
rgb[3]=a;return rgb}
function getHsla(string){if(!string){return}
var hsl=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;var match=string.match(hsl);if(match){var alpha=parseFloat(match[4]);var h=scale(parseInt(match[1]),0,360),s=scale(parseFloat(match[2]),0,100),l=scale(parseFloat(match[3]),0,100),a=scale(isNaN(alpha)?1:alpha,0,1);return[h,s,l,a]}}
function getHwb(string){if(!string){return}
var hwb=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;var match=string.match(hwb);if(match){var alpha=parseFloat(match[4]);var h=scale(parseInt(match[1]),0,360),w=scale(parseFloat(match[2]),0,100),b=scale(parseFloat(match[3]),0,100),a=scale(isNaN(alpha)?1:alpha,0,1);return[h,w,b,a]}}
function getRgb(string){var rgba=getRgba(string);return rgba&&rgba.slice(0,3)}
function getHsl(string){var hsla=getHsla(string);return hsla&&hsla.slice(0,3)}
function getAlpha(string){var vals=getRgba(string);if(vals){return vals[3]}else if(vals=getHsla(string)){return vals[3]}else if(vals=getHwb(string)){return vals[3]}}
function hexString(rgba,a){var a=(a!==undefined&&rgba.length===3)?a:rgba[3];return"#"+hexDouble(rgba[0])+hexDouble(rgba[1])+hexDouble(rgba[2])+((a>=0&&a<1)?hexDouble(Math.round(a*255)):"")}
function rgbString(rgba,alpha){if(alpha<1||(rgba[3]&&rgba[3]<1)){return rgbaString(rgba,alpha)}
return"rgb("+rgba[0]+", "+rgba[1]+", "+rgba[2]+")"}
function rgbaString(rgba,alpha){if(alpha===undefined){alpha=(rgba[3]!==undefined?rgba[3]:1)}
return"rgba("+rgba[0]+", "+rgba[1]+", "+rgba[2]+", "+alpha+")"}
function percentString(rgba,alpha){if(alpha<1||(rgba[3]&&rgba[3]<1)){return percentaString(rgba,alpha)}
var r=Math.round(rgba[0]/255*100),g=Math.round(rgba[1]/255*100),b=Math.round(rgba[2]/255*100);return"rgb("+r+"%, "+g+"%, "+b+"%)"}
function percentaString(rgba,alpha){var r=Math.round(rgba[0]/255*100),g=Math.round(rgba[1]/255*100),b=Math.round(rgba[2]/255*100);return"rgba("+r+"%, "+g+"%, "+b+"%, "+(alpha||rgba[3]||1)+")"}
function hslString(hsla,alpha){if(alpha<1||(hsla[3]&&hsla[3]<1)){return hslaString(hsla,alpha)}
return"hsl("+hsla[0]+", "+hsla[1]+"%, "+hsla[2]+"%)"}
function hslaString(hsla,alpha){if(alpha===undefined){alpha=(hsla[3]!==undefined?hsla[3]:1)}
return"hsla("+hsla[0]+", "+hsla[1]+"%, "+hsla[2]+"%, "+alpha+")"}
function hwbString(hwb,alpha){if(alpha===undefined){alpha=(hwb[3]!==undefined?hwb[3]:1)}
return"hwb("+hwb[0]+", "+hwb[1]+"%, "+hwb[2]+"%"+(alpha!==undefined&&alpha!==1?", "+alpha:"")+")"}
function keyword(rgb){return reverseNames[rgb.slice(0,3)]}
function scale(num,min,max){return Math.min(Math.max(min,num),max)}
function hexDouble(num){var str=num.toString(16).toUpperCase();return(str.length<2)?"0"+str:str}
var reverseNames={};for(var name in colorName$1){reverseNames[colorName$1[name]]=name}
var Color=function(obj){if(obj instanceof Color){return obj}
if(!(this instanceof Color)){return new Color(obj)}
this.valid=!1;this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var vals;if(typeof obj==='string'){vals=colorString.getRgba(obj);if(vals){this.setValues('rgb',vals)}else if(vals=colorString.getHsla(obj)){this.setValues('hsl',vals)}else if(vals=colorString.getHwb(obj)){this.setValues('hwb',vals)}}else if(typeof obj==='object'){vals=obj;if(vals.r!==undefined||vals.red!==undefined){this.setValues('rgb',vals)}else if(vals.l!==undefined||vals.lightness!==undefined){this.setValues('hsl',vals)}else if(vals.v!==undefined||vals.value!==undefined){this.setValues('hsv',vals)}else if(vals.w!==undefined||vals.whiteness!==undefined){this.setValues('hwb',vals)}else if(vals.c!==undefined||vals.cyan!==undefined){this.setValues('cmyk',vals)}}};Color.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace('rgb',arguments)},hsl:function(){return this.setSpace('hsl',arguments)},hsv:function(){return this.setSpace('hsv',arguments)},hwb:function(){return this.setSpace('hwb',arguments)},cmyk:function(){return this.setSpace('cmyk',arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var values=this.values;if(values.alpha!==1){return values.hwb.concat([values.alpha])}
return values.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var values=this.values;return values.rgb.concat([values.alpha])},hslaArray:function(){var values=this.values;return values.hsl.concat([values.alpha])},alpha:function(val){if(val===undefined){return this.values.alpha}
this.setValues('alpha',val);return this},red:function(val){return this.setChannel('rgb',0,val)},green:function(val){return this.setChannel('rgb',1,val)},blue:function(val){return this.setChannel('rgb',2,val)},hue:function(val){if(val){val%=360;val=val<0?360+val:val}
return this.setChannel('hsl',0,val)},saturation:function(val){return this.setChannel('hsl',1,val)},lightness:function(val){return this.setChannel('hsl',2,val)},saturationv:function(val){return this.setChannel('hsv',1,val)},whiteness:function(val){return this.setChannel('hwb',1,val)},blackness:function(val){return this.setChannel('hwb',2,val)},value:function(val){return this.setChannel('hsv',2,val)},cyan:function(val){return this.setChannel('cmyk',0,val)},magenta:function(val){return this.setChannel('cmyk',1,val)},yellow:function(val){return this.setChannel('cmyk',2,val)},black:function(val){return this.setChannel('cmyk',3,val)},hexString:function(){return colorString.hexString(this.values.rgb)},rgbString:function(){return colorString.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return colorString.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return colorString.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return colorString.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return colorString.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return colorString.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return colorString.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var rgb=this.values.rgb;return(rgb[0]<<16)|(rgb[1]<<8)|rgb[2]},luminosity:function(){var rgb=this.values.rgb;var lum=[];for(var i=0;i<rgb.length;i++){var chan=rgb[i]/255;lum[i]=(chan<=0.03928)?chan/12.92:Math.pow(((chan+0.055)/1.055),2.4)}
return 0.2126*lum[0]+0.7152*lum[1]+0.0722*lum[2]},contrast:function(color2){var lum1=this.luminosity();var lum2=color2.luminosity();if(lum1>lum2){return(lum1+0.05)/(lum2+0.05)}
return(lum2+0.05)/(lum1+0.05)},level:function(color2){var contrastRatio=this.contrast(color2);if(contrastRatio>=7.1){return'AAA'}
return(contrastRatio>=4.5)?'AA':''},dark:function(){var rgb=this.values.rgb;var yiq=(rgb[0]*299+rgb[1]*587+rgb[2]*114)/1000;return yiq<128},light:function(){return!this.dark()},negate:function(){var rgb=[];for(var i=0;i<3;i++){rgb[i]=255-this.values.rgb[i]}
this.setValues('rgb',rgb);return this},lighten:function(ratio){var hsl=this.values.hsl;hsl[2]+=hsl[2]*ratio;this.setValues('hsl',hsl);return this},darken:function(ratio){var hsl=this.values.hsl;hsl[2]-=hsl[2]*ratio;this.setValues('hsl',hsl);return this},saturate:function(ratio){var hsl=this.values.hsl;hsl[1]+=hsl[1]*ratio;this.setValues('hsl',hsl);return this},desaturate:function(ratio){var hsl=this.values.hsl;hsl[1]-=hsl[1]*ratio;this.setValues('hsl',hsl);return this},whiten:function(ratio){var hwb=this.values.hwb;hwb[1]+=hwb[1]*ratio;this.setValues('hwb',hwb);return this},blacken:function(ratio){var hwb=this.values.hwb;hwb[2]+=hwb[2]*ratio;this.setValues('hwb',hwb);return this},greyscale:function(){var rgb=this.values.rgb;var val=rgb[0]*0.3+rgb[1]*0.59+rgb[2]*0.11;this.setValues('rgb',[val,val,val]);return this},clearer:function(ratio){var alpha=this.values.alpha;this.setValues('alpha',alpha-(alpha*ratio));return this},opaquer:function(ratio){var alpha=this.values.alpha;this.setValues('alpha',alpha+(alpha*ratio));return this},rotate:function(degrees){var hsl=this.values.hsl;var hue=(hsl[0]+degrees)%360;hsl[0]=hue<0?360+hue:hue;this.setValues('hsl',hsl);return this},mix:function(mixinColor,weight){var color1=this;var color2=mixinColor;var p=weight===undefined?0.5:weight;var w=2*p-1;var a=color1.alpha()-color2.alpha();var w1=(((w*a===-1)?w:(w+a)/(1+w*a))+1)/2.0;var w2=1-w1;return this.rgb(w1*color1.red()+w2*color2.red(),w1*color1.green()+w2*color2.green(),w1*color1.blue()+w2*color2.blue()).alpha(color1.alpha()*p+color2.alpha()*(1-p))},toJSON:function(){return this.rgb()},clone:function(){var result=new Color();var source=this.values;var target=result.values;var value,type;for(var prop in source){if(source.hasOwnProperty(prop)){value=source[prop];type=({}).toString.call(value);if(type==='[object Array]'){target[prop]=value.slice(0)}else if(type==='[object Number]'){target[prop]=value}else{console.error('unexpected color value:',value)}}}
return result}};Color.prototype.spaces={rgb:['red','green','blue'],hsl:['hue','saturation','lightness'],hsv:['hue','saturation','value'],hwb:['hue','whiteness','blackness'],cmyk:['cyan','magenta','yellow','black']};Color.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]};Color.prototype.getValues=function(space){var values=this.values;var vals={};for(var i=0;i<space.length;i++){vals[space.charAt(i)]=values[space][i]}
if(values.alpha!==1){vals.a=values.alpha}
return vals};Color.prototype.setValues=function(space,vals){var values=this.values;var spaces=this.spaces;var maxes=this.maxes;var alpha=1;var i;this.valid=!0;if(space==='alpha'){alpha=vals}else if(vals.length){values[space]=vals.slice(0,space.length);alpha=vals[space.length]}else if(vals[space.charAt(0)]!==undefined){for(i=0;i<space.length;i++){values[space][i]=vals[space.charAt(i)]}
alpha=vals.a}else if(vals[spaces[space][0]]!==undefined){var chans=spaces[space];for(i=0;i<space.length;i++){values[space][i]=vals[chans[i]]}
alpha=vals.alpha}
values.alpha=Math.max(0,Math.min(1,(alpha===undefined?values.alpha:alpha)));if(space==='alpha'){return!1}
var capped;for(i=0;i<space.length;i++){capped=Math.max(0,Math.min(maxes[space][i],values[space][i]));values[space][i]=Math.round(capped)}
for(var sname in spaces){if(sname!==space){values[sname]=colorConvert[space][sname](values[space])}}
return!0};Color.prototype.setSpace=function(space,args){var vals=args[0];if(vals===undefined){return this.getValues(space)}
if(typeof vals==='number'){vals=Array.prototype.slice.call(args)}
this.setValues(space,vals);return this};Color.prototype.setChannel=function(space,index,val){var svalues=this.values[space];if(val===undefined){return svalues[index]}else if(val===svalues[index]){return this}
svalues[index]=val;this.setValues(space,svalues);return this};if(typeof window!=='undefined'){window.Color=Color}
var chartjsColor=Color;function isValidKey(key){return['__proto__','prototype','constructor'].indexOf(key)===-1}
var helpers={noop:function(){},uid:(function(){var id=0;return function(){return id++}}()),isNullOrUndef:function(value){return value===null||typeof value==='undefined'},isArray:function(value){if(Array.isArray&&Array.isArray(value)){return!0}
var type=Object.prototype.toString.call(value);if(type.substr(0,7)==='[object'&&type.substr(-6)==='Array]'){return!0}
return!1},isObject:function(value){return value!==null&&Object.prototype.toString.call(value)==='[object Object]'},isFinite:function(value){return(typeof value==='number'||value instanceof Number)&&isFinite(value)},valueOrDefault:function(value,defaultValue){return typeof value==='undefined'?defaultValue:value},valueAtIndexOrDefault:function(value,index,defaultValue){return helpers.valueOrDefault(helpers.isArray(value)?value[index]:value,defaultValue)},callback:function(fn,args,thisArg){if(fn&&typeof fn.call==='function'){return fn.apply(thisArg,args)}},each:function(loopable,fn,thisArg,reverse){var i,len,keys;if(helpers.isArray(loopable)){len=loopable.length;if(reverse){for(i=len-1;i>=0;i--){fn.call(thisArg,loopable[i],i)}}else{for(i=0;i<len;i++){fn.call(thisArg,loopable[i],i)}}}else if(helpers.isObject(loopable)){keys=Object.keys(loopable);len=keys.length;for(i=0;i<len;i++){fn.call(thisArg,loopable[keys[i]],keys[i])}}},arrayEquals:function(a0,a1){var i,ilen,v0,v1;if(!a0||!a1||a0.length!==a1.length){return!1}
for(i=0,ilen=a0.length;i<ilen;++i){v0=a0[i];v1=a1[i];if(v0 instanceof Array&&v1 instanceof Array){if(!helpers.arrayEquals(v0,v1)){return!1}}else if(v0!==v1){return!1}}
return!0},clone:function(source){if(helpers.isArray(source)){return source.map(helpers.clone)}
if(helpers.isObject(source)){var target=Object.create(source);var keys=Object.keys(source);var klen=keys.length;var k=0;for(;k<klen;++k){target[keys[k]]=helpers.clone(source[keys[k]])}
return target}
return source},_merger:function(key,target,source,options){if(!isValidKey(key)){return}
var tval=target[key];var sval=source[key];if(helpers.isObject(tval)&&helpers.isObject(sval)){helpers.merge(tval,sval,options)}else{target[key]=helpers.clone(sval)}},_mergerIf:function(key,target,source){if(!isValidKey(key)){return}
var tval=target[key];var sval=source[key];if(helpers.isObject(tval)&&helpers.isObject(sval)){helpers.mergeIf(tval,sval)}else if(!target.hasOwnProperty(key)){target[key]=helpers.clone(sval)}},merge:function(target,source,options){var sources=helpers.isArray(source)?source:[source];var ilen=sources.length;var merge,i,keys,klen,k;if(!helpers.isObject(target)){return target}
options=options||{};merge=options.merger||helpers._merger;for(i=0;i<ilen;++i){source=sources[i];if(!helpers.isObject(source)){continue}
keys=Object.keys(source);for(k=0,klen=keys.length;k<klen;++k){merge(keys[k],target,source,options)}}
return target},mergeIf:function(target,source){return helpers.merge(target,source,{merger:helpers._mergerIf})},extend:Object.assign||function(target){return helpers.merge(target,[].slice.call(arguments,1),{merger:function(key,dst,src){dst[key]=src[key]}})},inherits:function(extensions){var me=this;var ChartElement=(extensions&&extensions.hasOwnProperty('constructor'))?extensions.constructor:function(){return me.apply(this,arguments)};var Surrogate=function(){this.constructor=ChartElement};Surrogate.prototype=me.prototype;ChartElement.prototype=new Surrogate();ChartElement.extend=helpers.inherits;if(extensions){helpers.extend(ChartElement.prototype,extensions)}
ChartElement.__super__=me.prototype;return ChartElement},_deprecated:function(scope,value,previous,current){if(value!==undefined){console.warn(scope+': "'+previous+'" is deprecated. Please use "'+current+'" instead')}}};var helpers_core=helpers;helpers.callCallback=helpers.callback;helpers.indexOf=function(array,item,fromIndex){return Array.prototype.indexOf.call(array,item,fromIndex)};helpers.getValueOrDefault=helpers.valueOrDefault;helpers.getValueAtIndexOrDefault=helpers.valueAtIndexOrDefault;var effects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){if((t/=0.5)<1){return 0.5*t*t}
return-0.5*((--t)*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t=t-1)*t*t+1},easeInOutCubic:function(t){if((t/=0.5)<1){return 0.5*t*t*t}
return 0.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t=t-1)*t*t*t-1)},easeInOutQuart:function(t){if((t/=0.5)<1){return 0.5*t*t*t*t}
return-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t=t-1)*t*t*t*t+1},easeInOutQuint:function(t){if((t/=0.5)<1){return 0.5*t*t*t*t*t}
return 0.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-Math.cos(t*(Math.PI/2))+1},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return(t===0)?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return(t===1)?1:-Math.pow(2,-10*t)+1},easeInOutExpo:function(t){if(t===0){return 0}
if(t===1){return 1}
if((t/=0.5)<1){return 0.5*Math.pow(2,10*(t-1))}
return 0.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){if(t>=1){return t}
return-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t=t-1)*t)},easeInOutCirc:function(t){if((t/=0.5)<1){return-0.5*(Math.sqrt(1-t*t)-1)}
return 0.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var s=1.70158;var p=0;var a=1;if(t===0){return 0}
if(t===1){return 1}
if(!p){p=0.3}
if(a<1){a=1;s=p/4}else{s=p/(2*Math.PI)*Math.asin(1/a)}
return-(a*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/p))},easeOutElastic:function(t){var s=1.70158;var p=0;var a=1;if(t===0){return 0}
if(t===1){return 1}
if(!p){p=0.3}
if(a<1){a=1;s=p/4}else{s=p/(2*Math.PI)*Math.asin(1/a)}
return a*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/p)+1},easeInOutElastic:function(t){var s=1.70158;var p=0;var a=1;if(t===0){return 0}
if((t/=0.5)===2){return 1}
if(!p){p=0.45}
if(a<1){a=1;s=p/4}else{s=p/(2*Math.PI)*Math.asin(1/a)}
if(t<1){return-0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/p))}
return a*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/p)*0.5+1},easeInBack:function(t){var s=1.70158;return t*t*((s+1)*t-s)},easeOutBack:function(t){var s=1.70158;return(t=t-1)*t*((s+1)*t+s)+1},easeInOutBack:function(t){var s=1.70158;if((t/=0.5)<1){return 0.5*(t*t*(((s*=(1.525))+1)*t-s))}
return 0.5*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)},easeInBounce:function(t){return 1-effects.easeOutBounce(1-t)},easeOutBounce:function(t){if(t<(1/2.75)){return 7.5625*t*t}
if(t<(2/2.75)){return 7.5625*(t-=(1.5/2.75))*t+0.75}
if(t<(2.5/2.75)){return 7.5625*(t-=(2.25/2.75))*t+0.9375}
return 7.5625*(t-=(2.625/2.75))*t+0.984375},easeInOutBounce:function(t){if(t<0.5){return effects.easeInBounce(t*2)*0.5}
return effects.easeOutBounce(t*2-1)*0.5+0.5}};var helpers_easing={effects:effects};helpers_core.easingEffects=effects;var PI=Math.PI;var RAD_PER_DEG=PI/180;var DOUBLE_PI=PI*2;var HALF_PI=PI/2;var QUARTER_PI=PI/4;var TWO_THIRDS_PI=PI*2/3;var exports$1={clear:function(chart){chart.ctx.clearRect(0,0,chart.width,chart.height)},roundedRect:function(ctx,x,y,width,height,radius){if(radius){var r=Math.min(radius,height/2,width/2);var left=x+r;var top=y+r;var right=x+width-r;var bottom=y+height-r;ctx.moveTo(x,top);if(left<right&&top<bottom){ctx.arc(left,top,r,-PI,-HALF_PI);ctx.arc(right,top,r,-HALF_PI,0);ctx.arc(right,bottom,r,0,HALF_PI);ctx.arc(left,bottom,r,HALF_PI,PI)}else if(left<right){ctx.moveTo(left,y);ctx.arc(right,top,r,-HALF_PI,HALF_PI);ctx.arc(left,top,r,HALF_PI,PI+HALF_PI)}else if(top<bottom){ctx.arc(left,top,r,-PI,0);ctx.arc(left,bottom,r,0,PI)}else{ctx.arc(left,top,r,-PI,PI)}
ctx.closePath();ctx.moveTo(x,y)}else{ctx.rect(x,y,width,height)}},drawPoint:function(ctx,style,radius,x,y,rotation){var type,xOffset,yOffset,size,cornerRadius;var rad=(rotation||0)*RAD_PER_DEG;if(style&&typeof style==='object'){type=style.toString();if(type==='[object HTMLImageElement]'||type==='[object HTMLCanvasElement]'){ctx.save();ctx.translate(x,y);ctx.rotate(rad);ctx.drawImage(style,-style.width/2,-style.height/2,style.width,style.height);ctx.restore();return}}
if(isNaN(radius)||radius<=0){return}
ctx.beginPath();switch(style){default:ctx.arc(x,y,radius,0,DOUBLE_PI);ctx.closePath();break;case 'triangle':ctx.moveTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius);rad+=TWO_THIRDS_PI;ctx.lineTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius);rad+=TWO_THIRDS_PI;ctx.lineTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius);ctx.closePath();break;case 'rectRounded':cornerRadius=radius*0.516;size=radius-cornerRadius;xOffset=Math.cos(rad+QUARTER_PI)*size;yOffset=Math.sin(rad+QUARTER_PI)*size;ctx.arc(x-xOffset,y-yOffset,cornerRadius,rad-PI,rad-HALF_PI);ctx.arc(x+yOffset,y-xOffset,cornerRadius,rad-HALF_PI,rad);ctx.arc(x+xOffset,y+yOffset,cornerRadius,rad,rad+HALF_PI);ctx.arc(x-yOffset,y+xOffset,cornerRadius,rad+HALF_PI,rad+PI);ctx.closePath();break;case 'rect':if(!rotation){size=Math.SQRT1_2*radius;ctx.rect(x-size,y-size,2*size,2*size);break}
rad+=QUARTER_PI;case 'rectRot':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+yOffset,y-xOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.lineTo(x-yOffset,y+xOffset);ctx.closePath();break;case 'crossRot':rad+=QUARTER_PI;case 'cross':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x+yOffset,y-xOffset);ctx.lineTo(x-yOffset,y+xOffset);break;case 'star':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x+yOffset,y-xOffset);ctx.lineTo(x-yOffset,y+xOffset);rad+=QUARTER_PI;xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x+yOffset,y-xOffset);ctx.lineTo(x-yOffset,y+xOffset);break;case 'line':xOffset=Math.cos(rad)*radius;yOffset=Math.sin(rad)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);break;case 'dash':ctx.moveTo(x,y);ctx.lineTo(x+Math.cos(rad)*radius,y+Math.sin(rad)*radius);break}
ctx.fill();ctx.stroke()},_isPointInArea:function(point,area){var epsilon=1e-6;return point.x>area.left-epsilon&&point.x<area.right+epsilon&&point.y>area.top-epsilon&&point.y<area.bottom+epsilon},clipArea:function(ctx,area){ctx.save();ctx.beginPath();ctx.rect(area.left,area.top,area.right-area.left,area.bottom-area.top);ctx.clip()},unclipArea:function(ctx){ctx.restore()},lineTo:function(ctx,previous,target,flip){var stepped=target.steppedLine;if(stepped){if(stepped==='middle'){var midpoint=(previous.x+target.x)/2.0;ctx.lineTo(midpoint,flip?target.y:previous.y);ctx.lineTo(midpoint,flip?previous.y:target.y)}else if((stepped==='after'&&!flip)||(stepped!=='after'&&flip)){ctx.lineTo(previous.x,target.y)}else{ctx.lineTo(target.x,previous.y)}
ctx.lineTo(target.x,target.y);return}
if(!target.tension){ctx.lineTo(target.x,target.y);return}
ctx.bezierCurveTo(flip?previous.controlPointPreviousX:previous.controlPointNextX,flip?previous.controlPointPreviousY:previous.controlPointNextY,flip?target.controlPointNextX:target.controlPointPreviousX,flip?target.controlPointNextY:target.controlPointPreviousY,target.x,target.y)}};var helpers_canvas=exports$1;helpers_core.clear=exports$1.clear;helpers_core.drawRoundedRectangle=function(ctx){ctx.beginPath();exports$1.roundedRect.apply(exports$1,arguments)};var defaults={_set:function(scope,values){return helpers_core.merge(this[scope]||(this[scope]={}),values)}};defaults._set('global',{defaultColor:'rgba(0,0,0,0.1)',defaultFontColor:'#666',defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:'normal',defaultLineHeight:1.2,showLines:!0});var core_defaults=defaults;var valueOrDefault=helpers_core.valueOrDefault;function toFontString(font){if(!font||helpers_core.isNullOrUndef(font.size)||helpers_core.isNullOrUndef(font.family)){return null}
return(font.style?font.style+' ':'')+(font.weight?font.weight+' ':'')+font.size+'px '+font.family}
var helpers_options={toLineHeight:function(value,size){var matches=(''+value).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!matches||matches[1]==='normal'){return size*1.2}
value=+matches[2];switch(matches[3]){case 'px':return value;case '%':value/=100;break}
return size*value},toPadding:function(value){var t,r,b,l;if(helpers_core.isObject(value)){t=+value.top||0;r=+value.right||0;b=+value.bottom||0;l=+value.left||0}else{t=r=b=l=+value||0}
return{top:t,right:r,bottom:b,left:l,height:t+b,width:l+r}},_parseFont:function(options){var globalDefaults=core_defaults.global;var size=valueOrDefault(options.fontSize,globalDefaults.defaultFontSize);var font={family:valueOrDefault(options.fontFamily,globalDefaults.defaultFontFamily),lineHeight:helpers_core.options.toLineHeight(valueOrDefault(options.lineHeight,globalDefaults.defaultLineHeight),size),size:size,style:valueOrDefault(options.fontStyle,globalDefaults.defaultFontStyle),weight:null,string:''};font.string=toFontString(font);return font},resolve:function(inputs,context,index,info){var cacheable=!0;var i,ilen,value;for(i=0,ilen=inputs.length;i<ilen;++i){value=inputs[i];if(value===undefined){continue}
if(context!==undefined&&typeof value==='function'){value=value(context);cacheable=!1}
if(index!==undefined&&helpers_core.isArray(value)){value=value[index];cacheable=!1}
if(value!==undefined){if(info&&!cacheable){info.cacheable=!1}
return value}}}};var exports$2={_factorize:function(value){var result=[];var sqrt=Math.sqrt(value);var i;for(i=1;i<sqrt;i++){if(value%i===0){result.push(i);result.push(value/i)}}
if(sqrt===(sqrt|0)){result.push(sqrt)}
result.sort(function(a,b){return a-b}).pop();return result},log10:Math.log10||function(x){var exponent=Math.log(x)*Math.LOG10E;var powerOf10=Math.round(exponent);var isPowerOf10=x===Math.pow(10,powerOf10);return isPowerOf10?powerOf10:exponent}};var helpers_math=exports$2;helpers_core.log10=exports$2.log10;var getRtlAdapter=function(rectX,width){return{x:function(x){return rectX+rectX+width-x},setWidth:function(w){width=w},textAlign:function(align){if(align==='center'){return align}
return align==='right'?'left':'right'},xPlus:function(x,value){return x-value},leftForLtr:function(x,itemWidth){return x-itemWidth},}};var getLtrAdapter=function(){return{x:function(x){return x},setWidth:function(w){},textAlign:function(align){return align},xPlus:function(x,value){return x+value},leftForLtr:function(x,_itemWidth){return x},}};var getAdapter=function(rtl,rectX,width){return rtl?getRtlAdapter(rectX,width):getLtrAdapter()};var overrideTextDirection=function(ctx,direction){var style,original;if(direction==='ltr'||direction==='rtl'){style=ctx.canvas.style;original=[style.getPropertyValue('direction'),style.getPropertyPriority('direction'),];style.setProperty('direction',direction,'important');ctx.prevTextDirection=original}};var restoreTextDirection=function(ctx){var original=ctx.prevTextDirection;if(original!==undefined){delete ctx.prevTextDirection;ctx.canvas.style.setProperty('direction',original[0],original[1])}};var helpers_rtl={getRtlAdapter:getAdapter,overrideTextDirection:overrideTextDirection,restoreTextDirection:restoreTextDirection,};var helpers$1=helpers_core;var easing=helpers_easing;var canvas=helpers_canvas;var options=helpers_options;var math=helpers_math;var rtl=helpers_rtl;helpers$1.easing=easing;helpers$1.canvas=canvas;helpers$1.options=options;helpers$1.math=math;helpers$1.rtl=rtl;function interpolate(start,view,model,ease){var keys=Object.keys(model);var i,ilen,key,actual,origin,target,type,c0,c1;for(i=0,ilen=keys.length;i<ilen;++i){key=keys[i];target=model[key];if(!view.hasOwnProperty(key)){view[key]=target}
actual=view[key];if(actual===target||key[0]==='_'){continue}
if(!start.hasOwnProperty(key)){start[key]=actual}
origin=start[key];type=typeof target;if(type===typeof origin){if(type==='string'){c0=chartjsColor(origin);if(c0.valid){c1=chartjsColor(target);if(c1.valid){view[key]=c1.mix(c0,ease).rgbString();continue}}}else if(helpers$1.isFinite(origin)&&helpers$1.isFinite(target)){view[key]=origin+(target-origin)*ease;continue}}
view[key]=target}}
var Element=function(configuration){helpers$1.extend(this,configuration);this.initialize.apply(this,arguments)};helpers$1.extend(Element.prototype,{_type:undefined,initialize:function(){this.hidden=!1},pivot:function(){var me=this;if(!me._view){me._view=helpers$1.extend({},me._model)}
me._start={};return me},transition:function(ease){var me=this;var model=me._model;var start=me._start;var view=me._view;if(!model||ease===1){me._view=helpers$1.extend({},model);me._start=null;return me}
if(!view){view=me._view={}}
if(!start){start=me._start={}}
interpolate(start,view,model,ease);return me},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return helpers$1.isNumber(this._model.x)&&helpers$1.isNumber(this._model.y)}});Element.extend=helpers$1.inherits;var core_element=Element;var exports$3=core_element.extend({chart:null,currentStep:0,numSteps:60,easing:'',render:null,onAnimationProgress:null,onAnimationComplete:null,});var core_animation=exports$3;Object.defineProperty(exports$3.prototype,'animationObject',{get:function(){return this}});Object.defineProperty(exports$3.prototype,'chartInstance',{get:function(){return this.chart},set:function(value){this.chart=value}});core_defaults._set('global',{animation:{duration:1000,easing:'easeOutQuart',onProgress:helpers$1.noop,onComplete:helpers$1.noop}});var core_animations={animations:[],request:null,addAnimation:function(chart,animation,duration,lazy){var animations=this.animations;var i,ilen;animation.chart=chart;animation.startTime=Date.now();animation.duration=duration;if(!lazy){chart.animating=!0}
for(i=0,ilen=animations.length;i<ilen;++i){if(animations[i].chart===chart){animations[i]=animation;return}}
animations.push(animation);if(animations.length===1){this.requestAnimationFrame()}},cancelAnimation:function(chart){var index=helpers$1.findIndex(this.animations,function(animation){return animation.chart===chart});if(index!==-1){this.animations.splice(index,1);chart.animating=!1}},requestAnimationFrame:function(){var me=this;if(me.request===null){me.request=helpers$1.requestAnimFrame.call(window,function(){me.request=null;me.startDigest()})}},startDigest:function(){var me=this;me.advance();if(me.animations.length>0){me.requestAnimationFrame()}},advance:function(){var animations=this.animations;var animation,chart,numSteps,nextStep;var i=0;while(i<animations.length){animation=animations[i];chart=animation.chart;numSteps=animation.numSteps;nextStep=Math.floor((Date.now()-animation.startTime)/animation.duration*numSteps)+1;animation.currentStep=Math.min(nextStep,numSteps);helpers$1.callback(animation.render,[chart,animation],chart);helpers$1.callback(animation.onAnimationProgress,[animation],chart);if(animation.currentStep>=numSteps){helpers$1.callback(animation.onAnimationComplete,[animation],chart);chart.animating=!1;animations.splice(i,1)}else{++i}}}};var resolve=helpers$1.options.resolve;var arrayEvents=['push','pop','shift','splice','unshift'];function listenArrayEvents(array,listener){if(array._chartjs){array._chartjs.listeners.push(listener);return}
Object.defineProperty(array,'_chartjs',{configurable:!0,enumerable:!1,value:{listeners:[listener]}});arrayEvents.forEach(function(key){var method='onData'+key.charAt(0).toUpperCase()+key.slice(1);var base=array[key];Object.defineProperty(array,key,{configurable:!0,enumerable:!1,value:function(){var args=Array.prototype.slice.call(arguments);var res=base.apply(this,args);helpers$1.each(array._chartjs.listeners,function(object){if(typeof object[method]==='function'){object[method].apply(object,args)}});return res}})})}
function unlistenArrayEvents(array,listener){var stub=array._chartjs;if(!stub){return}
var listeners=stub.listeners;var index=listeners.indexOf(listener);if(index!==-1){listeners.splice(index,1)}
if(listeners.length>0){return}
arrayEvents.forEach(function(key){delete array[key]});delete array._chartjs}
var DatasetController=function(chart,datasetIndex){this.initialize(chart,datasetIndex)};helpers$1.extend(DatasetController.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:['backgroundColor','borderCapStyle','borderColor','borderDash','borderDashOffset','borderJoinStyle','borderWidth'],_dataElementOptions:['backgroundColor','borderColor','borderWidth','pointStyle'],initialize:function(chart,datasetIndex){var me=this;me.chart=chart;me.index=datasetIndex;me.linkScales();me.addElements();me._type=me.getMeta().type},updateIndex:function(datasetIndex){this.index=datasetIndex},linkScales:function(){var me=this;var meta=me.getMeta();var chart=me.chart;var scales=chart.scales;var dataset=me.getDataset();var scalesOpts=chart.options.scales;if(meta.xAxisID===null||!(meta.xAxisID in scales)||dataset.xAxisID){meta.xAxisID=dataset.xAxisID||scalesOpts.xAxes[0].id}
if(meta.yAxisID===null||!(meta.yAxisID in scales)||dataset.yAxisID){meta.yAxisID=dataset.yAxisID||scalesOpts.yAxes[0].id}},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(scaleID){return this.chart.scales[scaleID]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){if(this._data){unlistenArrayEvents(this._data,this)}},createMetaDataset:function(){var me=this;var type=me.datasetElementType;return type&&new type({_chart:me.chart,_datasetIndex:me.index})},createMetaData:function(index){var me=this;var type=me.dataElementType;return type&&new type({_chart:me.chart,_datasetIndex:me.index,_index:index})},addElements:function(){var me=this;var meta=me.getMeta();var data=me.getDataset().data||[];var metaData=meta.data;var i,ilen;for(i=0,ilen=data.length;i<ilen;++i){metaData[i]=metaData[i]||me.createMetaData(i)}
meta.dataset=meta.dataset||me.createMetaDataset()},addElementAndReset:function(index){var element=this.createMetaData(index);this.getMeta().data.splice(index,0,element);this.updateElement(element,index,!0)},buildOrUpdateElements:function(){var me=this;var dataset=me.getDataset();var data=dataset.data||(dataset.data=[]);if(me._data!==data){if(me._data){unlistenArrayEvents(me._data,me)}
if(data&&Object.isExtensible(data)){listenArrayEvents(data,me)}
me._data=data}
me.resyncElements()},_configure:function(){var me=this;me._config=helpers$1.merge(Object.create(null),[me.chart.options.datasets[me._type],me.getDataset(),],{merger:function(key,target,source){if(key!=='_meta'&&key!=='data'){helpers$1._merger(key,target,source)}}})},_update:function(reset){var me=this;me._configure();me._cachedDataOpts=null;me.update(reset)},update:helpers$1.noop,transition:function(easingValue){var meta=this.getMeta();var elements=meta.data||[];var ilen=elements.length;var i=0;for(;i<ilen;++i){elements[i].transition(easingValue)}
if(meta.dataset){meta.dataset.transition(easingValue)}},draw:function(){var meta=this.getMeta();var elements=meta.data||[];var ilen=elements.length;var i=0;if(meta.dataset){meta.dataset.draw()}
for(;i<ilen;++i){elements[i].draw()}},getStyle:function(index){var me=this;var meta=me.getMeta();var dataset=meta.dataset;var style;me._configure();if(dataset&&index===undefined){style=me._resolveDatasetElementOptions(dataset||{})}else{index=index||0;style=me._resolveDataElementOptions(meta.data[index]||{},index)}
if(style.fill===!1||style.fill===null){style.backgroundColor=style.borderColor}
return style},_resolveDatasetElementOptions:function(element,hover){var me=this;var chart=me.chart;var datasetOpts=me._config;var custom=element.custom||{};var options=chart.options.elements[me.datasetElementType.prototype._type]||{};var elementOptions=me._datasetElementOptions;var values={};var i,ilen,key,readKey;var context={chart:chart,dataset:me.getDataset(),datasetIndex:me.index,hover:hover};for(i=0,ilen=elementOptions.length;i<ilen;++i){key=elementOptions[i];readKey=hover?'hover'+key.charAt(0).toUpperCase()+key.slice(1):key;values[key]=resolve([custom[readKey],datasetOpts[readKey],options[readKey]],context)}
return values},_resolveDataElementOptions:function(element,index){var me=this;var custom=element&&element.custom;var cached=me._cachedDataOpts;if(cached&&!custom){return cached}
var chart=me.chart;var datasetOpts=me._config;var options=chart.options.elements[me.dataElementType.prototype._type]||{};var elementOptions=me._dataElementOptions;var values={};var context={chart:chart,dataIndex:index,dataset:me.getDataset(),datasetIndex:me.index};var info={cacheable:!custom};var keys,i,ilen,key;custom=custom||{};if(helpers$1.isArray(elementOptions)){for(i=0,ilen=elementOptions.length;i<ilen;++i){key=elementOptions[i];values[key]=resolve([custom[key],datasetOpts[key],options[key]],context,index,info)}}else{keys=Object.keys(elementOptions);for(i=0,ilen=keys.length;i<ilen;++i){key=keys[i];values[key]=resolve([custom[key],datasetOpts[elementOptions[key]],datasetOpts[key],options[key]],context,index,info)}}
if(info.cacheable){me._cachedDataOpts=Object.freeze(values)}
return values},removeHoverStyle:function(element){helpers$1.merge(element._model,element.$previousStyle||{});delete element.$previousStyle},setHoverStyle:function(element){var dataset=this.chart.data.datasets[element._datasetIndex];var index=element._index;var custom=element.custom||{};var model=element._model;var getHoverColor=helpers$1.getHoverColor;element.$previousStyle={backgroundColor:model.backgroundColor,borderColor:model.borderColor,borderWidth:model.borderWidth};model.backgroundColor=resolve([custom.hoverBackgroundColor,dataset.hoverBackgroundColor,getHoverColor(model.backgroundColor)],undefined,index);model.borderColor=resolve([custom.hoverBorderColor,dataset.hoverBorderColor,getHoverColor(model.borderColor)],undefined,index);model.borderWidth=resolve([custom.hoverBorderWidth,dataset.hoverBorderWidth,model.borderWidth],undefined,index)},_removeDatasetHoverStyle:function(){var element=this.getMeta().dataset;if(element){this.removeHoverStyle(element)}},_setDatasetHoverStyle:function(){var element=this.getMeta().dataset;var prev={};var i,ilen,key,keys,hoverOptions,model;if(!element){return}
model=element._model;hoverOptions=this._resolveDatasetElementOptions(element,!0);keys=Object.keys(hoverOptions);for(i=0,ilen=keys.length;i<ilen;++i){key=keys[i];prev[key]=model[key];model[key]=hoverOptions[key]}
element.$previousStyle=prev},resyncElements:function(){var me=this;var meta=me.getMeta();var data=me.getDataset().data;var numMeta=meta.data.length;var numData=data.length;if(numData<numMeta){meta.data.splice(numData,numMeta-numData)}else if(numData>numMeta){me.insertElements(numMeta,numData-numMeta)}},insertElements:function(start,count){for(var i=0;i<count;++i){this.addElementAndReset(start+i)}},onDataPush:function(){var count=arguments.length;this.insertElements(this.getDataset().data.length-count,count)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(start,count){this.getMeta().data.splice(start,count);this.insertElements(start,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}});DatasetController.extend=helpers$1.inherits;var core_datasetController=DatasetController;var TAU=Math.PI*2;core_defaults._set('global',{elements:{arc:{backgroundColor:core_defaults.global.defaultColor,borderColor:'#fff',borderWidth:2,borderAlign:'center'}}});function clipArc(ctx,arc){var startAngle=arc.startAngle;var endAngle=arc.endAngle;var pixelMargin=arc.pixelMargin;var angleMargin=pixelMargin/arc.outerRadius;var x=arc.x;var y=arc.y;ctx.beginPath();ctx.arc(x,y,arc.outerRadius,startAngle-angleMargin,endAngle+angleMargin);if(arc.innerRadius>pixelMargin){angleMargin=pixelMargin/arc.innerRadius;ctx.arc(x,y,arc.innerRadius-pixelMargin,endAngle+angleMargin,startAngle-angleMargin,!0)}else{ctx.arc(x,y,pixelMargin,endAngle+Math.PI/2,startAngle-Math.PI/2)}
ctx.closePath();ctx.clip()}
function drawFullCircleBorders(ctx,vm,arc,inner){var endAngle=arc.endAngle;var i;if(inner){arc.endAngle=arc.startAngle+TAU;clipArc(ctx,arc);arc.endAngle=endAngle;if(arc.endAngle===arc.startAngle&&arc.fullCircles){arc.endAngle+=TAU;arc.fullCircles--}}
ctx.beginPath();ctx.arc(arc.x,arc.y,arc.innerRadius,arc.startAngle+TAU,arc.startAngle,!0);for(i=0;i<arc.fullCircles;++i){ctx.stroke()}
ctx.beginPath();ctx.arc(arc.x,arc.y,vm.outerRadius,arc.startAngle,arc.startAngle+TAU);for(i=0;i<arc.fullCircles;++i){ctx.stroke()}}
function drawBorder(ctx,vm,arc){var inner=vm.borderAlign==='inner';if(inner){ctx.lineWidth=vm.borderWidth*2;ctx.lineJoin='round'}else{ctx.lineWidth=vm.borderWidth;ctx.lineJoin='bevel'}
if(arc.fullCircles){drawFullCircleBorders(ctx,vm,arc,inner)}
if(inner){clipArc(ctx,arc)}
ctx.beginPath();ctx.arc(arc.x,arc.y,vm.outerRadius,arc.startAngle,arc.endAngle);ctx.arc(arc.x,arc.y,arc.innerRadius,arc.endAngle,arc.startAngle,!0);ctx.closePath();ctx.stroke()}
var element_arc=core_element.extend({_type:'arc',inLabelRange:function(mouseX){var vm=this._view;if(vm){return(Math.pow(mouseX-vm.x,2)<Math.pow(vm.radius+vm.hoverRadius,2))}
return!1},inRange:function(chartX,chartY){var vm=this._view;if(vm){var pointRelativePosition=helpers$1.getAngleFromPoint(vm,{x:chartX,y:chartY});var angle=pointRelativePosition.angle;var distance=pointRelativePosition.distance;var startAngle=vm.startAngle;var endAngle=vm.endAngle;while(endAngle<startAngle){endAngle+=TAU}
while(angle>endAngle){angle-=TAU}
while(angle<startAngle){angle+=TAU}
var betweenAngles=(angle>=startAngle&&angle<=endAngle);var withinRadius=(distance>=vm.innerRadius&&distance<=vm.outerRadius);return(betweenAngles&&withinRadius)}
return!1},getCenterPoint:function(){var vm=this._view;var halfAngle=(vm.startAngle+vm.endAngle)/2;var halfRadius=(vm.innerRadius+vm.outerRadius)/2;return{x:vm.x+Math.cos(halfAngle)*halfRadius,y:vm.y+Math.sin(halfAngle)*halfRadius}},getArea:function(){var vm=this._view;return Math.PI*((vm.endAngle-vm.startAngle)/(2*Math.PI))*(Math.pow(vm.outerRadius,2)-Math.pow(vm.innerRadius,2))},tooltipPosition:function(){var vm=this._view;var centreAngle=vm.startAngle+((vm.endAngle-vm.startAngle)/2);var rangeFromCentre=(vm.outerRadius-vm.innerRadius)/2+vm.innerRadius;return{x:vm.x+(Math.cos(centreAngle)*rangeFromCentre),y:vm.y+(Math.sin(centreAngle)*rangeFromCentre)}},draw:function(){var ctx=this._chart.ctx;var vm=this._view;var pixelMargin=(vm.borderAlign==='inner')?0.33:0;var arc={x:vm.x,y:vm.y,innerRadius:vm.innerRadius,outerRadius:Math.max(vm.outerRadius-pixelMargin,0),pixelMargin:pixelMargin,startAngle:vm.startAngle,endAngle:vm.endAngle,fullCircles:Math.floor(vm.circumference/TAU)};var i;ctx.save();ctx.fillStyle=vm.backgroundColor;ctx.strokeStyle=vm.borderColor;if(arc.fullCircles){arc.endAngle=arc.startAngle+TAU;ctx.beginPath();ctx.arc(arc.x,arc.y,arc.outerRadius,arc.startAngle,arc.endAngle);ctx.arc(arc.x,arc.y,arc.innerRadius,arc.endAngle,arc.startAngle,!0);ctx.closePath();for(i=0;i<arc.fullCircles;++i){ctx.fill()}
arc.endAngle=arc.startAngle+vm.circumference%TAU}
ctx.beginPath();ctx.arc(arc.x,arc.y,arc.outerRadius,arc.startAngle,arc.endAngle);ctx.arc(arc.x,arc.y,arc.innerRadius,arc.endAngle,arc.startAngle,!0);ctx.closePath();ctx.fill();if(vm.borderWidth){drawBorder(ctx,vm,arc)}
ctx.restore()}});var valueOrDefault$1=helpers$1.valueOrDefault;var defaultColor=core_defaults.global.defaultColor;core_defaults._set('global',{elements:{line:{tension:0.4,backgroundColor:defaultColor,borderWidth:3,borderColor:defaultColor,borderCapStyle:'butt',borderDash:[],borderDashOffset:0.0,borderJoinStyle:'miter',capBezierPoints:!0,fill:!0,}}});var element_line=core_element.extend({_type:'line',draw:function(){var me=this;var vm=me._view;var ctx=me._chart.ctx;var spanGaps=vm.spanGaps;var points=me._children.slice();var globalDefaults=core_defaults.global;var globalOptionLineElements=globalDefaults.elements.line;var lastDrawnIndex=-1;var closePath=me._loop;var index,previous,currentVM;if(!points.length){return}
if(me._loop){for(index=0;index<points.length;++index){previous=helpers$1.previousItem(points,index);if(!points[index]._view.skip&&previous._view.skip){points=points.slice(index).concat(points.slice(0,index));closePath=spanGaps;break}}
if(closePath){points.push(points[0])}}
ctx.save();ctx.lineCap=vm.borderCapStyle||globalOptionLineElements.borderCapStyle;if(ctx.setLineDash){ctx.setLineDash(vm.borderDash||globalOptionLineElements.borderDash)}
ctx.lineDashOffset=valueOrDefault$1(vm.borderDashOffset,globalOptionLineElements.borderDashOffset);ctx.lineJoin=vm.borderJoinStyle||globalOptionLineElements.borderJoinStyle;ctx.lineWidth=valueOrDefault$1(vm.borderWidth,globalOptionLineElements.borderWidth);ctx.strokeStyle=vm.borderColor||globalDefaults.defaultColor;ctx.beginPath();currentVM=points[0]._view;if(!currentVM.skip){ctx.moveTo(currentVM.x,currentVM.y);lastDrawnIndex=0}
for(index=1;index<points.length;++index){currentVM=points[index]._view;previous=lastDrawnIndex===-1?helpers$1.previousItem(points,index):points[lastDrawnIndex];if(!currentVM.skip){if((lastDrawnIndex!==(index-1)&&!spanGaps)||lastDrawnIndex===-1){ctx.moveTo(currentVM.x,currentVM.y)}else{helpers$1.canvas.lineTo(ctx,previous._view,currentVM)}
lastDrawnIndex=index}}
if(closePath){ctx.closePath()}
ctx.stroke();ctx.restore()}});var valueOrDefault$2=helpers$1.valueOrDefault;var defaultColor$1=core_defaults.global.defaultColor;core_defaults._set('global',{elements:{point:{radius:3,pointStyle:'circle',backgroundColor:defaultColor$1,borderColor:defaultColor$1,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});function xRange(mouseX){var vm=this._view;return vm?(Math.abs(mouseX-vm.x)<vm.radius+vm.hitRadius):!1}
function yRange(mouseY){var vm=this._view;return vm?(Math.abs(mouseY-vm.y)<vm.radius+vm.hitRadius):!1}
var element_point=core_element.extend({_type:'point',inRange:function(mouseX,mouseY){var vm=this._view;return vm?((Math.pow(mouseX-vm.x,2)+Math.pow(mouseY-vm.y,2))<Math.pow(vm.hitRadius+vm.radius,2)):!1},inLabelRange:xRange,inXRange:xRange,inYRange:yRange,getCenterPoint:function(){var vm=this._view;return{x:vm.x,y:vm.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var vm=this._view;return{x:vm.x,y:vm.y,padding:vm.radius+vm.borderWidth}},draw:function(chartArea){var vm=this._view;var ctx=this._chart.ctx;var pointStyle=vm.pointStyle;var rotation=vm.rotation;var radius=vm.radius;var x=vm.x;var y=vm.y;var globalDefaults=core_defaults.global;var defaultColor=globalDefaults.defaultColor;if(vm.skip){return}
if(chartArea===undefined||helpers$1.canvas._isPointInArea(vm,chartArea)){ctx.strokeStyle=vm.borderColor||defaultColor;ctx.lineWidth=valueOrDefault$2(vm.borderWidth,globalDefaults.elements.point.borderWidth);ctx.fillStyle=vm.backgroundColor||defaultColor;helpers$1.canvas.drawPoint(ctx,pointStyle,radius,x,y,rotation)}}});var defaultColor$2=core_defaults.global.defaultColor;core_defaults._set('global',{elements:{rectangle:{backgroundColor:defaultColor$2,borderColor:defaultColor$2,borderSkipped:'bottom',borderWidth:0}}});function isVertical(vm){return vm&&vm.width!==undefined}
function getBarBounds(vm){var x1,x2,y1,y2,half;if(isVertical(vm)){half=vm.width/2;x1=vm.x-half;x2=vm.x+half;y1=Math.min(vm.y,vm.base);y2=Math.max(vm.y,vm.base)}else{half=vm.height/2;x1=Math.min(vm.x,vm.base);x2=Math.max(vm.x,vm.base);y1=vm.y-half;y2=vm.y+half}
return{left:x1,top:y1,right:x2,bottom:y2}}
function swap(orig,v1,v2){return orig===v1?v2:orig===v2?v1:orig}
function parseBorderSkipped(vm){var edge=vm.borderSkipped;var res={};if(!edge){return res}
if(vm.horizontal){if(vm.base>vm.x){edge=swap(edge,'left','right')}}else if(vm.base<vm.y){edge=swap(edge,'bottom','top')}
res[edge]=!0;return res}
function parseBorderWidth(vm,maxW,maxH){var value=vm.borderWidth;var skip=parseBorderSkipped(vm);var t,r,b,l;if(helpers$1.isObject(value)){t=+value.top||0;r=+value.right||0;b=+value.bottom||0;l=+value.left||0}else{t=r=b=l=+value||0}
return{t:skip.top||(t<0)?0:t>maxH?maxH:t,r:skip.right||(r<0)?0:r>maxW?maxW:r,b:skip.bottom||(b<0)?0:b>maxH?maxH:b,l:skip.left||(l<0)?0:l>maxW?maxW:l}}
function boundingRects(vm){var bounds=getBarBounds(vm);var width=bounds.right-bounds.left;var height=bounds.bottom-bounds.top;var border=parseBorderWidth(vm,width/2,height/2);return{outer:{x:bounds.left,y:bounds.top,w:width,h:height},inner:{x:bounds.left+border.l,y:bounds.top+border.t,w:width-border.l-border.r,h:height-border.t-border.b}}}
function inRange(vm,x,y){var skipX=x===null;var skipY=y===null;var bounds=!vm||(skipX&&skipY)?!1:getBarBounds(vm);return bounds&&(skipX||x>=bounds.left&&x<=bounds.right)&&(skipY||y>=bounds.top&&y<=bounds.bottom)}
var element_rectangle=core_element.extend({_type:'rectangle',draw:function(){var ctx=this._chart.ctx;var vm=this._view;var rects=boundingRects(vm);var outer=rects.outer;var inner=rects.inner;ctx.fillStyle=vm.backgroundColor;ctx.fillRect(outer.x,outer.y,outer.w,outer.h);if(outer.w===inner.w&&outer.h===inner.h){return}
ctx.save();ctx.beginPath();ctx.rect(outer.x,outer.y,outer.w,outer.h);ctx.clip();ctx.fillStyle=vm.borderColor;ctx.rect(inner.x,inner.y,inner.w,inner.h);ctx.fill('evenodd');ctx.restore()},height:function(){var vm=this._view;return vm.base-vm.y},inRange:function(mouseX,mouseY){return inRange(this._view,mouseX,mouseY)},inLabelRange:function(mouseX,mouseY){var vm=this._view;return isVertical(vm)?inRange(vm,mouseX,null):inRange(vm,null,mouseY)},inXRange:function(mouseX){return inRange(this._view,mouseX,null)},inYRange:function(mouseY){return inRange(this._view,null,mouseY)},getCenterPoint:function(){var vm=this._view;var x,y;if(isVertical(vm)){x=vm.x;y=(vm.y+vm.base)/2}else{x=(vm.x+vm.base)/2;y=vm.y}
return{x:x,y:y}},getArea:function(){var vm=this._view;return isVertical(vm)?vm.width*Math.abs(vm.y-vm.base):vm.height*Math.abs(vm.x-vm.base)},tooltipPosition:function(){var vm=this._view;return{x:vm.x,y:vm.y}}});var elements={};var Arc=element_arc;var Line=element_line;var Point=element_point;var Rectangle=element_rectangle;elements.Arc=Arc;elements.Line=Line;elements.Point=Point;elements.Rectangle=Rectangle;var deprecated=helpers$1._deprecated;var valueOrDefault$3=helpers$1.valueOrDefault;core_defaults._set('bar',{hover:{mode:'label'},scales:{xAxes:[{type:'category',offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:'linear'}]}});core_defaults._set('global',{datasets:{bar:{categoryPercentage:0.8,barPercentage:0.9}}});function computeMinSampleSize(scale,pixels){var min=scale._length;var prev,curr,i,ilen;for(i=1,ilen=pixels.length;i<ilen;++i){min=Math.min(min,Math.abs(pixels[i]-pixels[i-1]))}
for(i=0,ilen=scale.getTicks().length;i<ilen;++i){curr=scale.getPixelForTick(i);min=i>0?Math.min(min,Math.abs(curr-prev)):min;prev=curr}
return min}
function computeFitCategoryTraits(index,ruler,options){var thickness=options.barThickness;var count=ruler.stackCount;var curr=ruler.pixels[index];var min=helpers$1.isNullOrUndef(thickness)?computeMinSampleSize(ruler.scale,ruler.pixels):-1;var size,ratio;if(helpers$1.isNullOrUndef(thickness)){size=min*options.categoryPercentage;ratio=options.barPercentage}else{size=thickness*count;ratio=1}
return{chunk:size/count,ratio:ratio,start:curr-(size/2)}}
function computeFlexCategoryTraits(index,ruler,options){var pixels=ruler.pixels;var curr=pixels[index];var prev=index>0?pixels[index-1]:null;var next=index<pixels.length-1?pixels[index+1]:null;var percent=options.categoryPercentage;var start,size;if(prev===null){prev=curr-(next===null?ruler.end-ruler.start:next-curr)}
if(next===null){next=curr+curr-prev}
start=curr-(curr-Math.min(prev,next))/2*percent;size=Math.abs(next-prev)/2*percent;return{chunk:size/ruler.stackCount,ratio:options.barPercentage,start:start}}
var controller_bar=core_datasetController.extend({dataElementType:elements.Rectangle,_dataElementOptions:['backgroundColor','borderColor','borderSkipped','borderWidth','barPercentage','barThickness','categoryPercentage','maxBarThickness','minBarLength'],initialize:function(){var me=this;var meta,scaleOpts;core_datasetController.prototype.initialize.apply(me,arguments);meta=me.getMeta();meta.stack=me.getDataset().stack;meta.bar=!0;scaleOpts=me._getIndexScale().options;deprecated('bar chart',scaleOpts.barPercentage,'scales.[x/y]Axes.barPercentage','dataset.barPercentage');deprecated('bar chart',scaleOpts.barThickness,'scales.[x/y]Axes.barThickness','dataset.barThickness');deprecated('bar chart',scaleOpts.categoryPercentage,'scales.[x/y]Axes.categoryPercentage','dataset.categoryPercentage');deprecated('bar chart',me._getValueScale().options.minBarLength,'scales.[x/y]Axes.minBarLength','dataset.minBarLength');deprecated('bar chart',scaleOpts.maxBarThickness,'scales.[x/y]Axes.maxBarThickness','dataset.maxBarThickness')},update:function(reset){var me=this;var rects=me.getMeta().data;var i,ilen;me._ruler=me.getRuler();for(i=0,ilen=rects.length;i<ilen;++i){me.updateElement(rects[i],i,reset)}},updateElement:function(rectangle,index,reset){var me=this;var meta=me.getMeta();var dataset=me.getDataset();var options=me._resolveDataElementOptions(rectangle,index);rectangle._xScale=me.getScaleForId(meta.xAxisID);rectangle._yScale=me.getScaleForId(meta.yAxisID);rectangle._datasetIndex=me.index;rectangle._index=index;rectangle._model={backgroundColor:options.backgroundColor,borderColor:options.borderColor,borderSkipped:options.borderSkipped,borderWidth:options.borderWidth,datasetLabel:dataset.label,label:me.chart.data.labels[index]};if(helpers$1.isArray(dataset.data[index])){rectangle._model.borderSkipped=null}
me._updateElementGeometry(rectangle,index,reset,options);rectangle.pivot()},_updateElementGeometry:function(rectangle,index,reset,options){var me=this;var model=rectangle._model;var vscale=me._getValueScale();var base=vscale.getBasePixel();var horizontal=vscale.isHorizontal();var ruler=me._ruler||me.getRuler();var vpixels=me.calculateBarValuePixels(me.index,index,options);var ipixels=me.calculateBarIndexPixels(me.index,index,ruler,options);model.horizontal=horizontal;model.base=reset?base:vpixels.base;model.x=horizontal?reset?base:vpixels.head:ipixels.center;model.y=horizontal?ipixels.center:reset?base:vpixels.head;model.height=horizontal?ipixels.size:undefined;model.width=horizontal?undefined:ipixels.size},_getStacks:function(last){var me=this;var scale=me._getIndexScale();var metasets=scale._getMatchingVisibleMetas(me._type);var stacked=scale.options.stacked;var ilen=metasets.length;var stacks=[];var i,meta;for(i=0;i<ilen;++i){meta=metasets[i];if(stacked===!1||stacks.indexOf(meta.stack)===-1||(stacked===undefined&&meta.stack===undefined)){stacks.push(meta.stack)}
if(meta.index===last){break}}
return stacks},getStackCount:function(){return this._getStacks().length},getStackIndex:function(datasetIndex,name){var stacks=this._getStacks(datasetIndex);var index=(name!==undefined)?stacks.indexOf(name):-1;return(index===-1)?stacks.length-1:index},getRuler:function(){var me=this;var scale=me._getIndexScale();var pixels=[];var i,ilen;for(i=0,ilen=me.getMeta().data.length;i<ilen;++i){pixels.push(scale.getPixelForValue(null,i,me.index))}
return{pixels:pixels,start:scale._startPixel,end:scale._endPixel,stackCount:me.getStackCount(),scale:scale}},calculateBarValuePixels:function(datasetIndex,index,options){var me=this;var chart=me.chart;var scale=me._getValueScale();var isHorizontal=scale.isHorizontal();var datasets=chart.data.datasets;var metasets=scale._getMatchingVisibleMetas(me._type);var value=scale._parseValue(datasets[datasetIndex].data[index]);var minBarLength=options.minBarLength;var stacked=scale.options.stacked;var stack=me.getMeta().stack;var start=value.start===undefined?0:value.max>=0&&value.min>=0?value.min:value.max;var length=value.start===undefined?value.end:value.max>=0&&value.min>=0?value.max-value.min:value.min-value.max;var ilen=metasets.length;var i,imeta,ivalue,base,head,size,stackLength;if(stacked||(stacked===undefined&&stack!==undefined)){for(i=0;i<ilen;++i){imeta=metasets[i];if(imeta.index===datasetIndex){break}
if(imeta.stack===stack){stackLength=scale._parseValue(datasets[imeta.index].data[index]);ivalue=stackLength.start===undefined?stackLength.end:stackLength.min>=0&&stackLength.max>=0?stackLength.max:stackLength.min;if((value.min<0&&ivalue<0)||(value.max>=0&&ivalue>0)){start+=ivalue}}}}
base=scale.getPixelForValue(start);head=scale.getPixelForValue(start+length);size=head-base;if(minBarLength!==undefined&&Math.abs(size)<minBarLength){size=minBarLength;if(length>=0&&!isHorizontal||length<0&&isHorizontal){head=base-minBarLength}else{head=base+minBarLength}}
return{size:size,base:base,head:head,center:head+size/2}},calculateBarIndexPixels:function(datasetIndex,index,ruler,options){var me=this;var range=options.barThickness==='flex'?computeFlexCategoryTraits(index,ruler,options):computeFitCategoryTraits(index,ruler,options);var stackIndex=me.getStackIndex(datasetIndex,me.getMeta().stack);var center=range.start+(range.chunk*stackIndex)+(range.chunk/2);var size=Math.min(valueOrDefault$3(options.maxBarThickness,Infinity),range.chunk*range.ratio);return{base:center-size/2,head:center+size/2,center:center,size:size}},draw:function(){var me=this;var chart=me.chart;var scale=me._getValueScale();var rects=me.getMeta().data;var dataset=me.getDataset();var ilen=rects.length;var i=0;helpers$1.canvas.clipArea(chart.ctx,chart.chartArea);for(;i<ilen;++i){var val=scale._parseValue(dataset.data[i]);if(!isNaN(val.min)&&!isNaN(val.max)){rects[i].draw()}}
helpers$1.canvas.unclipArea(chart.ctx)},_resolveDataElementOptions:function(){var me=this;var values=helpers$1.extend({},core_datasetController.prototype._resolveDataElementOptions.apply(me,arguments));var indexOpts=me._getIndexScale().options;var valueOpts=me._getValueScale().options;values.barPercentage=valueOrDefault$3(indexOpts.barPercentage,values.barPercentage);values.barThickness=valueOrDefault$3(indexOpts.barThickness,values.barThickness);values.categoryPercentage=valueOrDefault$3(indexOpts.categoryPercentage,values.categoryPercentage);values.maxBarThickness=valueOrDefault$3(indexOpts.maxBarThickness,values.maxBarThickness);values.minBarLength=valueOrDefault$3(valueOpts.minBarLength,values.minBarLength);return values}});var valueOrDefault$4=helpers$1.valueOrDefault;var resolve$1=helpers$1.options.resolve;core_defaults._set('bubble',{hover:{mode:'single'},scales:{xAxes:[{type:'linear',position:'bottom',id:'x-axis-0'}],yAxes:[{type:'linear',position:'left',id:'y-axis-0'}]},tooltips:{callbacks:{title:function(){return''},label:function(item,data){var datasetLabel=data.datasets[item.datasetIndex].label||'';var dataPoint=data.datasets[item.datasetIndex].data[item.index];return datasetLabel+': ('+item.xLabel+', '+item.yLabel+', '+dataPoint.r+')'}}}});var controller_bubble=core_datasetController.extend({dataElementType:elements.Point,_dataElementOptions:['backgroundColor','borderColor','borderWidth','hoverBackgroundColor','hoverBorderColor','hoverBorderWidth','hoverRadius','hitRadius','pointStyle','rotation'],update:function(reset){var me=this;var meta=me.getMeta();var points=meta.data;helpers$1.each(points,function(point,index){me.updateElement(point,index,reset)})},updateElement:function(point,index,reset){var me=this;var meta=me.getMeta();var custom=point.custom||{};var xScale=me.getScaleForId(meta.xAxisID);var yScale=me.getScaleForId(meta.yAxisID);var options=me._resolveDataElementOptions(point,index);var data=me.getDataset().data[index];var dsIndex=me.index;var x=reset?xScale.getPixelForDecimal(0.5):xScale.getPixelForValue(typeof data==='object'?data:NaN,index,dsIndex);var y=reset?yScale.getBasePixel():yScale.getPixelForValue(data,index,dsIndex);point._xScale=xScale;point._yScale=yScale;point._options=options;point._datasetIndex=dsIndex;point._index=index;point._model={backgroundColor:options.backgroundColor,borderColor:options.borderColor,borderWidth:options.borderWidth,hitRadius:options.hitRadius,pointStyle:options.pointStyle,rotation:options.rotation,radius:reset?0:options.radius,skip:custom.skip||isNaN(x)||isNaN(y),x:x,y:y,};point.pivot()},setHoverStyle:function(point){var model=point._model;var options=point._options;var getHoverColor=helpers$1.getHoverColor;point.$previousStyle={backgroundColor:model.backgroundColor,borderColor:model.borderColor,borderWidth:model.borderWidth,radius:model.radius};model.backgroundColor=valueOrDefault$4(options.hoverBackgroundColor,getHoverColor(options.backgroundColor));model.borderColor=valueOrDefault$4(options.hoverBorderColor,getHoverColor(options.borderColor));model.borderWidth=valueOrDefault$4(options.hoverBorderWidth,options.borderWidth);model.radius=options.radius+options.hoverRadius},_resolveDataElementOptions:function(point,index){var me=this;var chart=me.chart;var dataset=me.getDataset();var custom=point.custom||{};var data=dataset.data[index]||{};var values=core_datasetController.prototype._resolveDataElementOptions.apply(me,arguments);var context={chart:chart,dataIndex:index,dataset:dataset,datasetIndex:me.index};if(me._cachedDataOpts===values){values=helpers$1.extend({},values)}
values.radius=resolve$1([custom.radius,data.r,me._config.radius,chart.options.elements.point.radius],context,index);return values}});var valueOrDefault$5=helpers$1.valueOrDefault;var PI$1=Math.PI;var DOUBLE_PI$1=PI$1*2;var HALF_PI$1=PI$1/2;core_defaults._set('doughnut',{animation:{animateRotate:!0,animateScale:!1},hover:{mode:'single'},legendCallback:function(chart){var list=document.createElement('ul');var data=chart.data;var datasets=data.datasets;var labels=data.labels;var i,ilen,listItem,listItemSpan;list.setAttribute('class',chart.id+'-legend');if(datasets.length){for(i=0,ilen=datasets[0].data.length;i<ilen;++i){listItem=list.appendChild(document.createElement('li'));listItemSpan=listItem.appendChild(document.createElement('span'));listItemSpan.style.backgroundColor=datasets[0].backgroundColor[i];if(labels[i]){listItem.appendChild(document.createTextNode(labels[i]))}}}
return list.outerHTML},legend:{labels:{generateLabels:function(chart){var data=chart.data;if(data.labels.length&&data.datasets.length){return data.labels.map(function(label,i){var meta=chart.getDatasetMeta(0);var style=meta.controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,hidden:isNaN(data.datasets[0].data[i])||meta.data[i].hidden,index:i}})}
return[]}},onClick:function(e,legendItem){var index=legendItem.index;var chart=this.chart;var i,ilen,meta;for(i=0,ilen=(chart.data.datasets||[]).length;i<ilen;++i){meta=chart.getDatasetMeta(i);if(meta.data[index]){meta.data[index].hidden=!meta.data[index].hidden}}
chart.update()}},cutoutPercentage:50,rotation:-HALF_PI$1,circumference:DOUBLE_PI$1,tooltips:{callbacks:{title:function(){return''},label:function(tooltipItem,data){var dataLabel=data.labels[tooltipItem.index];var value=': '+data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];if(helpers$1.isArray(dataLabel)){dataLabel=dataLabel.slice();dataLabel[0]+=value}else{dataLabel+=value}
return dataLabel}}}});var controller_doughnut=core_datasetController.extend({dataElementType:elements.Arc,linkScales:helpers$1.noop,_dataElementOptions:['backgroundColor','borderColor','borderWidth','borderAlign','hoverBackgroundColor','hoverBorderColor','hoverBorderWidth',],getRingIndex:function(datasetIndex){var ringIndex=0;for(var j=0;j<datasetIndex;++j){if(this.chart.isDatasetVisible(j)){++ringIndex}}
return ringIndex},update:function(reset){var me=this;var chart=me.chart;var chartArea=chart.chartArea;var opts=chart.options;var ratioX=1;var ratioY=1;var offsetX=0;var offsetY=0;var meta=me.getMeta();var arcs=meta.data;var cutout=opts.cutoutPercentage/100||0;var circumference=opts.circumference;var chartWeight=me._getRingWeight(me.index);var maxWidth,maxHeight,i,ilen;if(circumference<DOUBLE_PI$1){var startAngle=opts.rotation%DOUBLE_PI$1;startAngle+=startAngle>=PI$1?-DOUBLE_PI$1:startAngle<-PI$1?DOUBLE_PI$1:0;var endAngle=startAngle+circumference;var startX=Math.cos(startAngle);var startY=Math.sin(startAngle);var endX=Math.cos(endAngle);var endY=Math.sin(endAngle);var contains0=(startAngle<=0&&endAngle>=0)||endAngle>=DOUBLE_PI$1;var contains90=(startAngle<=HALF_PI$1&&endAngle>=HALF_PI$1)||endAngle>=DOUBLE_PI$1+HALF_PI$1;var contains180=startAngle===-PI$1||endAngle>=PI$1;var contains270=(startAngle<=-HALF_PI$1&&endAngle>=-HALF_PI$1)||endAngle>=PI$1+HALF_PI$1;var minX=contains180?-1:Math.min(startX,startX*cutout,endX,endX*cutout);var minY=contains270?-1:Math.min(startY,startY*cutout,endY,endY*cutout);var maxX=contains0?1:Math.max(startX,startX*cutout,endX,endX*cutout);var maxY=contains90?1:Math.max(startY,startY*cutout,endY,endY*cutout);ratioX=(maxX-minX)/2;ratioY=(maxY-minY)/2;offsetX=-(maxX+minX)/2;offsetY=-(maxY+minY)/2}
for(i=0,ilen=arcs.length;i<ilen;++i){arcs[i]._options=me._resolveDataElementOptions(arcs[i],i)}
chart.borderWidth=me.getMaxBorderWidth();maxWidth=(chartArea.right-chartArea.left-chart.borderWidth)/ratioX;maxHeight=(chartArea.bottom-chartArea.top-chart.borderWidth)/ratioY;chart.outerRadius=Math.max(Math.min(maxWidth,maxHeight)/2,0);chart.innerRadius=Math.max(chart.outerRadius*cutout,0);chart.radiusLength=(chart.outerRadius-chart.innerRadius)/(me._getVisibleDatasetWeightTotal()||1);chart.offsetX=offsetX*chart.outerRadius;chart.offsetY=offsetY*chart.outerRadius;meta.total=me.calculateTotal();me.outerRadius=chart.outerRadius-chart.radiusLength*me._getRingWeightOffset(me.index);me.innerRadius=Math.max(me.outerRadius-chart.radiusLength*chartWeight,0);for(i=0,ilen=arcs.length;i<ilen;++i){me.updateElement(arcs[i],i,reset)}},updateElement:function(arc,index,reset){var me=this;var chart=me.chart;var chartArea=chart.chartArea;var opts=chart.options;var animationOpts=opts.animation;var centerX=(chartArea.left+chartArea.right)/2;var centerY=(chartArea.top+chartArea.bottom)/2;var startAngle=opts.rotation;var endAngle=opts.rotation;var dataset=me.getDataset();var circumference=reset&&animationOpts.animateRotate?0:arc.hidden?0:me.calculateCircumference(dataset.data[index])*(opts.circumference/DOUBLE_PI$1);var innerRadius=reset&&animationOpts.animateScale?0:me.innerRadius;var outerRadius=reset&&animationOpts.animateScale?0:me.outerRadius;var options=arc._options||{};helpers$1.extend(arc,{_datasetIndex:me.index,_index:index,_model:{backgroundColor:options.backgroundColor,borderColor:options.borderColor,borderWidth:options.borderWidth,borderAlign:options.borderAlign,x:centerX+chart.offsetX,y:centerY+chart.offsetY,startAngle:startAngle,endAngle:endAngle,circumference:circumference,outerRadius:outerRadius,innerRadius:innerRadius,label:helpers$1.valueAtIndexOrDefault(dataset.label,index,chart.data.labels[index])}});var model=arc._model;if(!reset||!animationOpts.animateRotate){if(index===0){model.startAngle=opts.rotation}else{model.startAngle=me.getMeta().data[index-1]._model.endAngle}
model.endAngle=model.startAngle+model.circumference}
arc.pivot()},calculateTotal:function(){var dataset=this.getDataset();var meta=this.getMeta();var total=0;var value;helpers$1.each(meta.data,function(element,index){value=dataset.data[index];if(!isNaN(value)&&!element.hidden){total+=Math.abs(value)}});return total},calculateCircumference:function(value){var total=this.getMeta().total;if(total>0&&!isNaN(value)){return DOUBLE_PI$1*(Math.abs(value)/total)}
return 0},getMaxBorderWidth:function(arcs){var me=this;var max=0;var chart=me.chart;var i,ilen,meta,arc,controller,options,borderWidth,hoverWidth;if(!arcs){for(i=0,ilen=chart.data.datasets.length;i<ilen;++i){if(chart.isDatasetVisible(i)){meta=chart.getDatasetMeta(i);arcs=meta.data;if(i!==me.index){controller=meta.controller}
break}}}
if(!arcs){return 0}
for(i=0,ilen=arcs.length;i<ilen;++i){arc=arcs[i];if(controller){controller._configure();options=controller._resolveDataElementOptions(arc,i)}else{options=arc._options}
if(options.borderAlign!=='inner'){borderWidth=options.borderWidth;hoverWidth=options.hoverBorderWidth;max=borderWidth>max?borderWidth:max;max=hoverWidth>max?hoverWidth:max}}
return max},setHoverStyle:function(arc){var model=arc._model;var options=arc._options;var getHoverColor=helpers$1.getHoverColor;arc.$previousStyle={backgroundColor:model.backgroundColor,borderColor:model.borderColor,borderWidth:model.borderWidth,};model.backgroundColor=valueOrDefault$5(options.hoverBackgroundColor,getHoverColor(options.backgroundColor));model.borderColor=valueOrDefault$5(options.hoverBorderColor,getHoverColor(options.borderColor));model.borderWidth=valueOrDefault$5(options.hoverBorderWidth,options.borderWidth)},_getRingWeightOffset:function(datasetIndex){var ringWeightOffset=0;for(var i=0;i<datasetIndex;++i){if(this.chart.isDatasetVisible(i)){ringWeightOffset+=this._getRingWeight(i)}}
return ringWeightOffset},_getRingWeight:function(dataSetIndex){return Math.max(valueOrDefault$5(this.chart.data.datasets[dataSetIndex].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});core_defaults._set('horizontalBar',{hover:{mode:'index',axis:'y'},scales:{xAxes:[{type:'linear',position:'bottom'}],yAxes:[{type:'category',position:'left',offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:'left'}},tooltips:{mode:'index',axis:'y'}});core_defaults._set('global',{datasets:{horizontalBar:{categoryPercentage:0.8,barPercentage:0.9}}});var controller_horizontalBar=controller_bar.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}});var valueOrDefault$6=helpers$1.valueOrDefault;var resolve$2=helpers$1.options.resolve;var isPointInArea=helpers$1.canvas._isPointInArea;core_defaults._set('line',{showLines:!0,spanGaps:!1,hover:{mode:'label'},scales:{xAxes:[{type:'category',id:'x-axis-0'}],yAxes:[{type:'linear',id:'y-axis-0'}]}});function scaleClip(scale,halfBorderWidth){var tickOpts=scale&&scale.options.ticks||{};var reverse=tickOpts.reverse;var min=tickOpts.min===undefined?halfBorderWidth:0;var max=tickOpts.max===undefined?halfBorderWidth:0;return{start:reverse?max:min,end:reverse?min:max}}
function defaultClip(xScale,yScale,borderWidth){var halfBorderWidth=borderWidth/2;var x=scaleClip(xScale,halfBorderWidth);var y=scaleClip(yScale,halfBorderWidth);return{top:y.end,right:x.end,bottom:y.start,left:x.start}}
function toClip(value){var t,r,b,l;if(helpers$1.isObject(value)){t=value.top;r=value.right;b=value.bottom;l=value.left}else{t=r=b=l=value}
return{top:t,right:r,bottom:b,left:l}}
var controller_line=core_datasetController.extend({datasetElementType:elements.Line,dataElementType:elements.Point,_datasetElementOptions:['backgroundColor','borderCapStyle','borderColor','borderDash','borderDashOffset','borderJoinStyle','borderWidth','cubicInterpolationMode','fill'],_dataElementOptions:{backgroundColor:'pointBackgroundColor',borderColor:'pointBorderColor',borderWidth:'pointBorderWidth',hitRadius:'pointHitRadius',hoverBackgroundColor:'pointHoverBackgroundColor',hoverBorderColor:'pointHoverBorderColor',hoverBorderWidth:'pointHoverBorderWidth',hoverRadius:'pointHoverRadius',pointStyle:'pointStyle',radius:'pointRadius',rotation:'pointRotation'},update:function(reset){var me=this;var meta=me.getMeta();var line=meta.dataset;var points=meta.data||[];var options=me.chart.options;var config=me._config;var showLine=me._showLine=valueOrDefault$6(config.showLine,options.showLines);var i,ilen;me._xScale=me.getScaleForId(meta.xAxisID);me._yScale=me.getScaleForId(meta.yAxisID);if(showLine){if(config.tension!==undefined&&config.lineTension===undefined){config.lineTension=config.tension}
line._scale=me._yScale;line._datasetIndex=me.index;line._children=points;line._model=me._resolveDatasetElementOptions(line);line.pivot()}
for(i=0,ilen=points.length;i<ilen;++i){me.updateElement(points[i],i,reset)}
if(showLine&&line._model.tension!==0){me.updateBezierControlPoints()}
for(i=0,ilen=points.length;i<ilen;++i){points[i].pivot()}},updateElement:function(point,index,reset){var me=this;var meta=me.getMeta();var custom=point.custom||{};var dataset=me.getDataset();var datasetIndex=me.index;var value=dataset.data[index];var xScale=me._xScale;var yScale=me._yScale;var lineModel=meta.dataset._model;var x,y;var options=me._resolveDataElementOptions(point,index);x=xScale.getPixelForValue(typeof value==='object'?value:NaN,index,datasetIndex);y=reset?yScale.getBasePixel():me.calculatePointY(value,index,datasetIndex);point._xScale=xScale;point._yScale=yScale;point._options=options;point._datasetIndex=datasetIndex;point._index=index;point._model={x:x,y:y,skip:custom.skip||isNaN(x)||isNaN(y),radius:options.radius,pointStyle:options.pointStyle,rotation:options.rotation,backgroundColor:options.backgroundColor,borderColor:options.borderColor,borderWidth:options.borderWidth,tension:valueOrDefault$6(custom.tension,lineModel?lineModel.tension:0),steppedLine:lineModel?lineModel.steppedLine:!1,hitRadius:options.hitRadius}},_resolveDatasetElementOptions:function(element){var me=this;var config=me._config;var custom=element.custom||{};var options=me.chart.options;var lineOptions=options.elements.line;var values=core_datasetController.prototype._resolveDatasetElementOptions.apply(me,arguments);values.spanGaps=valueOrDefault$6(config.spanGaps,options.spanGaps);values.tension=valueOrDefault$6(config.lineTension,lineOptions.tension);values.steppedLine=resolve$2([custom.steppedLine,config.steppedLine,lineOptions.stepped]);values.clip=toClip(valueOrDefault$6(config.clip,defaultClip(me._xScale,me._yScale,values.borderWidth)));return values},calculatePointY:function(value,index,datasetIndex){var me=this;var chart=me.chart;var yScale=me._yScale;var sumPos=0;var sumNeg=0;var i,ds,dsMeta,stackedRightValue,rightValue,metasets,ilen;if(yScale.options.stacked){rightValue=+yScale.getRightValue(value);metasets=chart._getSortedVisibleDatasetMetas();ilen=metasets.length;for(i=0;i<ilen;++i){dsMeta=metasets[i];if(dsMeta.index===datasetIndex){break}
ds=chart.data.datasets[dsMeta.index];if(dsMeta.type==='line'&&dsMeta.yAxisID===yScale.id){stackedRightValue=+yScale.getRightValue(ds.data[index]);if(stackedRightValue<0){sumNeg+=stackedRightValue||0}else{sumPos+=stackedRightValue||0}}}
if(rightValue<0){return yScale.getPixelForValue(sumNeg+rightValue)}
return yScale.getPixelForValue(sumPos+rightValue)}
return yScale.getPixelForValue(value)},updateBezierControlPoints:function(){var me=this;var chart=me.chart;var meta=me.getMeta();var lineModel=meta.dataset._model;var area=chart.chartArea;var points=meta.data||[];var i,ilen,model,controlPoints;if(lineModel.spanGaps){points=points.filter(function(pt){return!pt._model.skip})}
function capControlPoint(pt,min,max){return Math.max(Math.min(pt,max),min)}
if(lineModel.cubicInterpolationMode==='monotone'){helpers$1.splineCurveMonotone(points)}else{for(i=0,ilen=points.length;i<ilen;++i){model=points[i]._model;controlPoints=helpers$1.splineCurve(helpers$1.previousItem(points,i)._model,model,helpers$1.nextItem(points,i)._model,lineModel.tension);model.controlPointPreviousX=controlPoints.previous.x;model.controlPointPreviousY=controlPoints.previous.y;model.controlPointNextX=controlPoints.next.x;model.controlPointNextY=controlPoints.next.y}}
if(chart.options.elements.line.capBezierPoints){for(i=0,ilen=points.length;i<ilen;++i){model=points[i]._model;if(isPointInArea(model,area)){if(i>0&&isPointInArea(points[i-1]._model,area)){model.controlPointPreviousX=capControlPoint(model.controlPointPreviousX,area.left,area.right);model.controlPointPreviousY=capControlPoint(model.controlPointPreviousY,area.top,area.bottom)}
if(i<points.length-1&&isPointInArea(points[i+1]._model,area)){model.controlPointNextX=capControlPoint(model.controlPointNextX,area.left,area.right);model.controlPointNextY=capControlPoint(model.controlPointNextY,area.top,area.bottom)}}}}},draw:function(){var me=this;var chart=me.chart;var meta=me.getMeta();var points=meta.data||[];var area=chart.chartArea;var canvas=chart.canvas;var i=0;var ilen=points.length;var clip;if(me._showLine){clip=meta.dataset._model.clip;helpers$1.canvas.clipArea(chart.ctx,{left:clip.left===!1?0:area.left-clip.left,right:clip.right===!1?canvas.width:area.right+clip.right,top:clip.top===!1?0:area.top-clip.top,bottom:clip.bottom===!1?canvas.height:area.bottom+clip.bottom});meta.dataset.draw();helpers$1.canvas.unclipArea(chart.ctx)}
for(;i<ilen;++i){points[i].draw(area)}},setHoverStyle:function(point){var model=point._model;var options=point._options;var getHoverColor=helpers$1.getHoverColor;point.$previousStyle={backgroundColor:model.backgroundColor,borderColor:model.borderColor,borderWidth:model.borderWidth,radius:model.radius};model.backgroundColor=valueOrDefault$6(options.hoverBackgroundColor,getHoverColor(options.backgroundColor));model.borderColor=valueOrDefault$6(options.hoverBorderColor,getHoverColor(options.borderColor));model.borderWidth=valueOrDefault$6(options.hoverBorderWidth,options.borderWidth);model.radius=valueOrDefault$6(options.hoverRadius,options.radius)},});var resolve$3=helpers$1.options.resolve;core_defaults._set('polarArea',{scale:{type:'radialLinear',angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-0.5*Math.PI,legendCallback:function(chart){var list=document.createElement('ul');var data=chart.data;var datasets=data.datasets;var labels=data.labels;var i,ilen,listItem,listItemSpan;list.setAttribute('class',chart.id+'-legend');if(datasets.length){for(i=0,ilen=datasets[0].data.length;i<ilen;++i){listItem=list.appendChild(document.createElement('li'));listItemSpan=listItem.appendChild(document.createElement('span'));listItemSpan.style.backgroundColor=datasets[0].backgroundColor[i];if(labels[i]){listItem.appendChild(document.createTextNode(labels[i]))}}}
return list.outerHTML},legend:{labels:{generateLabels:function(chart){var data=chart.data;if(data.labels.length&&data.datasets.length){return data.labels.map(function(label,i){var meta=chart.getDatasetMeta(0);var style=meta.controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,hidden:isNaN(data.datasets[0].data[i])||meta.data[i].hidden,index:i}})}
return[]}},onClick:function(e,legendItem){var index=legendItem.index;var chart=this.chart;var i,ilen,meta;for(i=0,ilen=(chart.data.datasets||[]).length;i<ilen;++i){meta=chart.getDatasetMeta(i);meta.data[index].hidden=!meta.data[index].hidden}
chart.update()}},tooltips:{callbacks:{title:function(){return''},label:function(item,data){return data.labels[item.index]+': '+item.yLabel}}}});var controller_polarArea=core_datasetController.extend({dataElementType:elements.Arc,linkScales:helpers$1.noop,_dataElementOptions:['backgroundColor','borderColor','borderWidth','borderAlign','hoverBackgroundColor','hoverBorderColor','hoverBorderWidth',],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(reset){var me=this;var dataset=me.getDataset();var meta=me.getMeta();var start=me.chart.options.startAngle||0;var starts=me._starts=[];var angles=me._angles=[];var arcs=meta.data;var i,ilen,angle;me._updateRadius();meta.count=me.countVisibleElements();for(i=0,ilen=dataset.data.length;i<ilen;i++){starts[i]=start;angle=me._computeAngle(i);angles[i]=angle;start+=angle}
for(i=0,ilen=arcs.length;i<ilen;++i){arcs[i]._options=me._resolveDataElementOptions(arcs[i],i);me.updateElement(arcs[i],i,reset)}},_updateRadius:function(){var me=this;var chart=me.chart;var chartArea=chart.chartArea;var opts=chart.options;var minSize=Math.min(chartArea.right-chartArea.left,chartArea.bottom-chartArea.top);chart.outerRadius=Math.max(minSize/2,0);chart.innerRadius=Math.max(opts.cutoutPercentage?(chart.outerRadius/100)*(opts.cutoutPercentage):1,0);chart.radiusLength=(chart.outerRadius-chart.innerRadius)/chart.getVisibleDatasetCount();me.outerRadius=chart.outerRadius-(chart.radiusLength*me.index);me.innerRadius=me.outerRadius-chart.radiusLength},updateElement:function(arc,index,reset){var me=this;var chart=me.chart;var dataset=me.getDataset();var opts=chart.options;var animationOpts=opts.animation;var scale=chart.scale;var labels=chart.data.labels;var centerX=scale.xCenter;var centerY=scale.yCenter;var datasetStartAngle=opts.startAngle;var distance=arc.hidden?0:scale.getDistanceFromCenterForValue(dataset.data[index]);var startAngle=me._starts[index];var endAngle=startAngle+(arc.hidden?0:me._angles[index]);var resetRadius=animationOpts.animateScale?0:scale.getDistanceFromCenterForValue(dataset.data[index]);var options=arc._options||{};helpers$1.extend(arc,{_datasetIndex:me.index,_index:index,_scale:scale,_model:{backgroundColor:options.backgroundColor,borderColor:options.borderColor,borderWidth:options.borderWidth,borderAlign:options.borderAlign,x:centerX,y:centerY,innerRadius:0,outerRadius:reset?resetRadius:distance,startAngle:reset&&animationOpts.animateRotate?datasetStartAngle:startAngle,endAngle:reset&&animationOpts.animateRotate?datasetStartAngle:endAngle,label:helpers$1.valueAtIndexOrDefault(labels,index,labels[index])}});arc.pivot()},countVisibleElements:function(){var dataset=this.getDataset();var meta=this.getMeta();var count=0;helpers$1.each(meta.data,function(element,index){if(!isNaN(dataset.data[index])&&!element.hidden){count++}});return count},setHoverStyle:function(arc){var model=arc._model;var options=arc._options;var getHoverColor=helpers$1.getHoverColor;var valueOrDefault=helpers$1.valueOrDefault;arc.$previousStyle={backgroundColor:model.backgroundColor,borderColor:model.borderColor,borderWidth:model.borderWidth,};model.backgroundColor=valueOrDefault(options.hoverBackgroundColor,getHoverColor(options.backgroundColor));model.borderColor=valueOrDefault(options.hoverBorderColor,getHoverColor(options.borderColor));model.borderWidth=valueOrDefault(options.hoverBorderWidth,options.borderWidth)},_computeAngle:function(index){var me=this;var count=this.getMeta().count;var dataset=me.getDataset();var meta=me.getMeta();if(isNaN(dataset.data[index])||meta.data[index].hidden){return 0}
var context={chart:me.chart,dataIndex:index,dataset:dataset,datasetIndex:me.index};return resolve$3([me.chart.options.elements.arc.angle,(2*Math.PI)/count],context,index)}});core_defaults._set('pie',helpers$1.clone(core_defaults.doughnut));core_defaults._set('pie',{cutoutPercentage:0});var controller_pie=controller_doughnut;var valueOrDefault$7=helpers$1.valueOrDefault;core_defaults._set('radar',{spanGaps:!1,scale:{type:'radialLinear'},elements:{line:{fill:'start',tension:0}}});var controller_radar=core_datasetController.extend({datasetElementType:elements.Line,dataElementType:elements.Point,linkScales:helpers$1.noop,_datasetElementOptions:['backgroundColor','borderWidth','borderColor','borderCapStyle','borderDash','borderDashOffset','borderJoinStyle','fill'],_dataElementOptions:{backgroundColor:'pointBackgroundColor',borderColor:'pointBorderColor',borderWidth:'pointBorderWidth',hitRadius:'pointHitRadius',hoverBackgroundColor:'pointHoverBackgroundColor',hoverBorderColor:'pointHoverBorderColor',hoverBorderWidth:'pointHoverBorderWidth',hoverRadius:'pointHoverRadius',pointStyle:'pointStyle',radius:'pointRadius',rotation:'pointRotation'},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(reset){var me=this;var meta=me.getMeta();var line=meta.dataset;var points=meta.data||[];var scale=me.chart.scale;var config=me._config;var i,ilen;if(config.tension!==undefined&&config.lineTension===undefined){config.lineTension=config.tension}
line._scale=scale;line._datasetIndex=me.index;line._children=points;line._loop=!0;line._model=me._resolveDatasetElementOptions(line);line.pivot();for(i=0,ilen=points.length;i<ilen;++i){me.updateElement(points[i],i,reset)}
me.updateBezierControlPoints();for(i=0,ilen=points.length;i<ilen;++i){points[i].pivot()}},updateElement:function(point,index,reset){var me=this;var custom=point.custom||{};var dataset=me.getDataset();var scale=me.chart.scale;var pointPosition=scale.getPointPositionForValue(index,dataset.data[index]);var options=me._resolveDataElementOptions(point,index);var lineModel=me.getMeta().dataset._model;var x=reset?scale.xCenter:pointPosition.x;var y=reset?scale.yCenter:pointPosition.y;point._scale=scale;point._options=options;point._datasetIndex=me.index;point._index=index;point._model={x:x,y:y,skip:custom.skip||isNaN(x)||isNaN(y),radius:options.radius,pointStyle:options.pointStyle,rotation:options.rotation,backgroundColor:options.backgroundColor,borderColor:options.borderColor,borderWidth:options.borderWidth,tension:valueOrDefault$7(custom.tension,lineModel?lineModel.tension:0),hitRadius:options.hitRadius}},_resolveDatasetElementOptions:function(){var me=this;var config=me._config;var options=me.chart.options;var values=core_datasetController.prototype._resolveDatasetElementOptions.apply(me,arguments);values.spanGaps=valueOrDefault$7(config.spanGaps,options.spanGaps);values.tension=valueOrDefault$7(config.lineTension,options.elements.line.tension);return values},updateBezierControlPoints:function(){var me=this;var meta=me.getMeta();var area=me.chart.chartArea;var points=meta.data||[];var i,ilen,model,controlPoints;if(meta.dataset._model.spanGaps){points=points.filter(function(pt){return!pt._model.skip})}
function capControlPoint(pt,min,max){return Math.max(Math.min(pt,max),min)}
for(i=0,ilen=points.length;i<ilen;++i){model=points[i]._model;controlPoints=helpers$1.splineCurve(helpers$1.previousItem(points,i,!0)._model,model,helpers$1.nextItem(points,i,!0)._model,model.tension);model.controlPointPreviousX=capControlPoint(controlPoints.previous.x,area.left,area.right);model.controlPointPreviousY=capControlPoint(controlPoints.previous.y,area.top,area.bottom);model.controlPointNextX=capControlPoint(controlPoints.next.x,area.left,area.right);model.controlPointNextY=capControlPoint(controlPoints.next.y,area.top,area.bottom)}},setHoverStyle:function(point){var model=point._model;var options=point._options;var getHoverColor=helpers$1.getHoverColor;point.$previousStyle={backgroundColor:model.backgroundColor,borderColor:model.borderColor,borderWidth:model.borderWidth,radius:model.radius};model.backgroundColor=valueOrDefault$7(options.hoverBackgroundColor,getHoverColor(options.backgroundColor));model.borderColor=valueOrDefault$7(options.hoverBorderColor,getHoverColor(options.borderColor));model.borderWidth=valueOrDefault$7(options.hoverBorderWidth,options.borderWidth);model.radius=valueOrDefault$7(options.hoverRadius,options.radius)}});core_defaults._set('scatter',{hover:{mode:'single'},scales:{xAxes:[{id:'x-axis-1',type:'linear',position:'bottom'}],yAxes:[{id:'y-axis-1',type:'linear',position:'left'}]},tooltips:{callbacks:{title:function(){return''},label:function(item){return'('+item.xLabel+', '+item.yLabel+')'}}}});core_defaults._set('global',{datasets:{scatter:{showLine:!1}}});var controller_scatter=controller_line;var controllers={bar:controller_bar,bubble:controller_bubble,doughnut:controller_doughnut,horizontalBar:controller_horizontalBar,line:controller_line,polarArea:controller_polarArea,pie:controller_pie,radar:controller_radar,scatter:controller_scatter};function getRelativePosition(e,chart){if(e.native){return{x:e.x,y:e.y}}
return helpers$1.getRelativePosition(e,chart)}
function parseVisibleItems(chart,handler){var metasets=chart._getSortedVisibleDatasetMetas();var metadata,i,j,ilen,jlen,element;for(i=0,ilen=metasets.length;i<ilen;++i){metadata=metasets[i].data;for(j=0,jlen=metadata.length;j<jlen;++j){element=metadata[j];if(!element._view.skip){handler(element)}}}}
function getIntersectItems(chart,position){var elements=[];parseVisibleItems(chart,function(element){if(element.inRange(position.x,position.y)){elements.push(element)}});return elements}
function getNearestItems(chart,position,intersect,distanceMetric){var minDistance=Number.POSITIVE_INFINITY;var nearestItems=[];parseVisibleItems(chart,function(element){if(intersect&&!element.inRange(position.x,position.y)){return}
var center=element.getCenterPoint();var distance=distanceMetric(position,center);if(distance<minDistance){nearestItems=[element];minDistance=distance}else if(distance===minDistance){nearestItems.push(element)}});return nearestItems}
function getDistanceMetricForAxis(axis){var useX=axis.indexOf('x')!==-1;var useY=axis.indexOf('y')!==-1;return function(pt1,pt2){var deltaX=useX?Math.abs(pt1.x-pt2.x):0;var deltaY=useY?Math.abs(pt1.y-pt2.y):0;return Math.sqrt(Math.pow(deltaX,2)+Math.pow(deltaY,2))}}
function indexMode(chart,e,options){var position=getRelativePosition(e,chart);options.axis=options.axis||'x';var distanceMetric=getDistanceMetricForAxis(options.axis);var items=options.intersect?getIntersectItems(chart,position):getNearestItems(chart,position,!1,distanceMetric);var elements=[];if(!items.length){return[]}
chart._getSortedVisibleDatasetMetas().forEach(function(meta){var element=meta.data[items[0]._index];if(element&&!element._view.skip){elements.push(element)}});return elements}
var core_interaction={modes:{single:function(chart,e){var position=getRelativePosition(e,chart);var elements=[];parseVisibleItems(chart,function(element){if(element.inRange(position.x,position.y)){elements.push(element);return elements}});return elements.slice(0,1)},label:indexMode,index:indexMode,dataset:function(chart,e,options){var position=getRelativePosition(e,chart);options.axis=options.axis||'xy';var distanceMetric=getDistanceMetricForAxis(options.axis);var items=options.intersect?getIntersectItems(chart,position):getNearestItems(chart,position,!1,distanceMetric);if(items.length>0){items=chart.getDatasetMeta(items[0]._datasetIndex).data}
return items},'x-axis':function(chart,e){return indexMode(chart,e,{intersect:!1})},point:function(chart,e){var position=getRelativePosition(e,chart);return getIntersectItems(chart,position)},nearest:function(chart,e,options){var position=getRelativePosition(e,chart);options.axis=options.axis||'xy';var distanceMetric=getDistanceMetricForAxis(options.axis);return getNearestItems(chart,position,options.intersect,distanceMetric)},x:function(chart,e,options){var position=getRelativePosition(e,chart);var items=[];var intersectsItem=!1;parseVisibleItems(chart,function(element){if(element.inXRange(position.x)){items.push(element)}
if(element.inRange(position.x,position.y)){intersectsItem=!0}});if(options.intersect&&!intersectsItem){items=[]}
return items},y:function(chart,e,options){var position=getRelativePosition(e,chart);var items=[];var intersectsItem=!1;parseVisibleItems(chart,function(element){if(element.inYRange(position.y)){items.push(element)}
if(element.inRange(position.x,position.y)){intersectsItem=!0}});if(options.intersect&&!intersectsItem){items=[]}
return items}}};var extend=helpers$1.extend;function filterByPosition(array,position){return helpers$1.where(array,function(v){return v.pos===position})}
function sortByWeight(array,reverse){return array.sort(function(a,b){var v0=reverse?b:a;var v1=reverse?a:b;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight})}
function wrapBoxes(boxes){var layoutBoxes=[];var i,ilen,box;for(i=0,ilen=(boxes||[]).length;i<ilen;++i){box=boxes[i];layoutBoxes.push({index:i,box:box,pos:box.position,horizontal:box.isHorizontal(),weight:box.weight})}
return layoutBoxes}
function setLayoutDims(layouts,params){var i,ilen,layout;for(i=0,ilen=layouts.length;i<ilen;++i){layout=layouts[i];layout.width=layout.horizontal?layout.box.fullWidth&&params.availableWidth:params.vBoxMaxWidth;layout.height=layout.horizontal&&params.hBoxMaxHeight}}
function buildLayoutBoxes(boxes){var layoutBoxes=wrapBoxes(boxes);var left=sortByWeight(filterByPosition(layoutBoxes,'left'),!0);var right=sortByWeight(filterByPosition(layoutBoxes,'right'));var top=sortByWeight(filterByPosition(layoutBoxes,'top'),!0);var bottom=sortByWeight(filterByPosition(layoutBoxes,'bottom'));return{leftAndTop:left.concat(top),rightAndBottom:right.concat(bottom),chartArea:filterByPosition(layoutBoxes,'chartArea'),vertical:left.concat(right),horizontal:top.concat(bottom)}}
function getCombinedMax(maxPadding,chartArea,a,b){return Math.max(maxPadding[a],chartArea[a])+Math.max(maxPadding[b],chartArea[b])}
function updateDims(chartArea,params,layout){var box=layout.box;var maxPadding=chartArea.maxPadding;var newWidth,newHeight;if(layout.size){chartArea[layout.pos]-=layout.size}
layout.size=layout.horizontal?box.height:box.width;chartArea[layout.pos]+=layout.size;if(box.getPadding){var boxPadding=box.getPadding();maxPadding.top=Math.max(maxPadding.top,boxPadding.top);maxPadding.left=Math.max(maxPadding.left,boxPadding.left);maxPadding.bottom=Math.max(maxPadding.bottom,boxPadding.bottom);maxPadding.right=Math.max(maxPadding.right,boxPadding.right)}
newWidth=params.outerWidth-getCombinedMax(maxPadding,chartArea,'left','right');newHeight=params.outerHeight-getCombinedMax(maxPadding,chartArea,'top','bottom');if(newWidth!==chartArea.w||newHeight!==chartArea.h){chartArea.w=newWidth;chartArea.h=newHeight;var sizes=layout.horizontal?[newWidth,chartArea.w]:[newHeight,chartArea.h];return sizes[0]!==sizes[1]&&(!isNaN(sizes[0])||!isNaN(sizes[1]))}}
function handleMaxPadding(chartArea){var maxPadding=chartArea.maxPadding;function updatePos(pos){var change=Math.max(maxPadding[pos]-chartArea[pos],0);chartArea[pos]+=change;return change}
chartArea.y+=updatePos('top');chartArea.x+=updatePos('left');updatePos('right');updatePos('bottom')}
function getMargins(horizontal,chartArea){var maxPadding=chartArea.maxPadding;function marginForPositions(positions){var margin={left:0,top:0,right:0,bottom:0};positions.forEach(function(pos){margin[pos]=Math.max(chartArea[pos],maxPadding[pos])});return margin}
return horizontal?marginForPositions(['left','right']):marginForPositions(['top','bottom'])}
function fitBoxes(boxes,chartArea,params){var refitBoxes=[];var i,ilen,layout,box,refit,changed;for(i=0,ilen=boxes.length;i<ilen;++i){layout=boxes[i];box=layout.box;box.update(layout.width||chartArea.w,layout.height||chartArea.h,getMargins(layout.horizontal,chartArea));if(updateDims(chartArea,params,layout)){changed=!0;if(refitBoxes.length){refit=!0}}
if(!box.fullWidth){refitBoxes.push(layout)}}
return refit?fitBoxes(refitBoxes,chartArea,params)||changed:changed}
function placeBoxes(boxes,chartArea,params){var userPadding=params.padding;var x=chartArea.x;var y=chartArea.y;var i,ilen,layout,box;for(i=0,ilen=boxes.length;i<ilen;++i){layout=boxes[i];box=layout.box;if(layout.horizontal){box.left=box.fullWidth?userPadding.left:chartArea.left;box.right=box.fullWidth?params.outerWidth-userPadding.right:chartArea.left+chartArea.w;box.top=y;box.bottom=y+box.height;box.width=box.right-box.left;y=box.bottom}else{box.left=x;box.right=x+box.width;box.top=chartArea.top;box.bottom=chartArea.top+chartArea.h;box.height=box.bottom-box.top;x=box.right}}
chartArea.x=x;chartArea.y=y}
core_defaults._set('global',{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var core_layouts={defaults:{},addBox:function(chart,item){if(!chart.boxes){chart.boxes=[]}
item.fullWidth=item.fullWidth||!1;item.position=item.position||'top';item.weight=item.weight||0;item._layers=item._layers||function(){return[{z:0,draw:function(){item.draw.apply(item,arguments)}}]};chart.boxes.push(item)},removeBox:function(chart,layoutItem){var index=chart.boxes?chart.boxes.indexOf(layoutItem):-1;if(index!==-1){chart.boxes.splice(index,1)}},configure:function(chart,item,options){var props=['fullWidth','position','weight'];var ilen=props.length;var i=0;var prop;for(;i<ilen;++i){prop=props[i];if(options.hasOwnProperty(prop)){item[prop]=options[prop]}}},update:function(chart,width,height){if(!chart){return}
var layoutOptions=chart.options.layout||{};var padding=helpers$1.options.toPadding(layoutOptions.padding);var availableWidth=width-padding.width;var availableHeight=height-padding.height;var boxes=buildLayoutBoxes(chart.boxes);var verticalBoxes=boxes.vertical;var horizontalBoxes=boxes.horizontal;var params=Object.freeze({outerWidth:width,outerHeight:height,padding:padding,availableWidth:availableWidth,vBoxMaxWidth:availableWidth/2/verticalBoxes.length,hBoxMaxHeight:availableHeight/2});var chartArea=extend({maxPadding:extend({},padding),w:availableWidth,h:availableHeight,x:padding.left,y:padding.top},padding);setLayoutDims(verticalBoxes.concat(horizontalBoxes),params);fitBoxes(verticalBoxes,chartArea,params);if(fitBoxes(horizontalBoxes,chartArea,params)){fitBoxes(verticalBoxes,chartArea,params)}
handleMaxPadding(chartArea);placeBoxes(boxes.leftAndTop,chartArea,params);chartArea.x+=chartArea.w;chartArea.y+=chartArea.h;placeBoxes(boxes.rightAndBottom,chartArea,params);chart.chartArea={left:chartArea.left,top:chartArea.top,right:chartArea.left+chartArea.w,bottom:chartArea.top+chartArea.h};helpers$1.each(boxes.chartArea,function(layout){var box=layout.box;extend(box,chart.chartArea);box.update(chartArea.w,chartArea.h)})}};var platform_basic={acquireContext:function(item){if(item&&item.canvas){item=item.canvas}
return item&&item.getContext('2d')||null}};var platform_dom="/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n";var platform_dom$1=Object.freeze({__proto__:null,'default':platform_dom});var stylesheet=getCjsExportFromNamespace(platform_dom$1);var EXPANDO_KEY='$chartjs';var CSS_PREFIX='chartjs-';var CSS_SIZE_MONITOR=CSS_PREFIX+'size-monitor';var CSS_RENDER_MONITOR=CSS_PREFIX+'render-monitor';var CSS_RENDER_ANIMATION=CSS_PREFIX+'render-animation';var ANIMATION_START_EVENTS=['animationstart','webkitAnimationStart'];var EVENT_TYPES={touchstart:'mousedown',touchmove:'mousemove',touchend:'mouseup',pointerenter:'mouseenter',pointerdown:'mousedown',pointermove:'mousemove',pointerup:'mouseup',pointerleave:'mouseout',pointerout:'mouseout'};function readUsedSize(element,property){var value=helpers$1.getStyle(element,property);var matches=value&&value.match(/^(\d+)(\.\d+)?px$/);return matches?Number(matches[1]):undefined}
function initCanvas(canvas,config){var style=canvas.style;var renderHeight=canvas.getAttribute('height');var renderWidth=canvas.getAttribute('width');canvas[EXPANDO_KEY]={initial:{height:renderHeight,width:renderWidth,style:{display:style.display,height:style.height,width:style.width}}};style.display=style.display||'block';if(renderWidth===null||renderWidth===''){var displayWidth=readUsedSize(canvas,'width');if(displayWidth!==undefined){canvas.width=displayWidth}}
if(renderHeight===null||renderHeight===''){if(canvas.style.height===''){canvas.height=canvas.width/(config.options.aspectRatio||2)}else{var displayHeight=readUsedSize(canvas,'height');if(displayWidth!==undefined){canvas.height=displayHeight}}}
return canvas}
var supportsEventListenerOptions=(function(){var supports=!1;try{var options=Object.defineProperty({},'passive',{get:function(){supports=!0}});window.addEventListener('e',null,options)}catch(e){}
return supports}());var eventListenerOptions=supportsEventListenerOptions?{passive:!0}:!1;function addListener(node,type,listener){node.addEventListener(type,listener,eventListenerOptions)}
function removeListener(node,type,listener){node.removeEventListener(type,listener,eventListenerOptions)}
function createEvent(type,chart,x,y,nativeEvent){return{type:type,chart:chart,native:nativeEvent||null,x:x!==undefined?x:null,y:y!==undefined?y:null,}}
function fromNativeEvent(event,chart){var type=EVENT_TYPES[event.type]||event.type;var pos=helpers$1.getRelativePosition(event,chart);return createEvent(type,chart,pos.x,pos.y,event)}
function throttled(fn,thisArg){var ticking=!1;var args=[];return function(){args=Array.prototype.slice.call(arguments);thisArg=thisArg||this;if(!ticking){ticking=!0;helpers$1.requestAnimFrame.call(window,function(){ticking=!1;fn.apply(thisArg,args)})}}}
function createDiv(cls){var el=document.createElement('div');el.className=cls||'';return el}
function createResizer(handler){var maxSize=1000000;var resizer=createDiv(CSS_SIZE_MONITOR);var expand=createDiv(CSS_SIZE_MONITOR+'-expand');var shrink=createDiv(CSS_SIZE_MONITOR+'-shrink');expand.appendChild(createDiv());shrink.appendChild(createDiv());resizer.appendChild(expand);resizer.appendChild(shrink);resizer._reset=function(){expand.scrollLeft=maxSize;expand.scrollTop=maxSize;shrink.scrollLeft=maxSize;shrink.scrollTop=maxSize};var onScroll=function(){resizer._reset();handler()};addListener(expand,'scroll',onScroll.bind(expand,'expand'));addListener(shrink,'scroll',onScroll.bind(shrink,'shrink'));return resizer}
function watchForRender(node,handler){var expando=node[EXPANDO_KEY]||(node[EXPANDO_KEY]={});var proxy=expando.renderProxy=function(e){if(e.animationName===CSS_RENDER_ANIMATION){handler()}};helpers$1.each(ANIMATION_START_EVENTS,function(type){addListener(node,type,proxy)});expando.reflow=!!node.offsetParent;node.classList.add(CSS_RENDER_MONITOR)}
function unwatchForRender(node){var expando=node[EXPANDO_KEY]||{};var proxy=expando.renderProxy;if(proxy){helpers$1.each(ANIMATION_START_EVENTS,function(type){removeListener(node,type,proxy)});delete expando.renderProxy}
node.classList.remove(CSS_RENDER_MONITOR)}
function addResizeListener(node,listener,chart){var expando=node[EXPANDO_KEY]||(node[EXPANDO_KEY]={});var resizer=expando.resizer=createResizer(throttled(function(){if(expando.resizer){var container=chart.options.maintainAspectRatio&&node.parentNode;var w=container?container.clientWidth:0;listener(createEvent('resize',chart));if(container&&container.clientWidth<w&&chart.canvas){listener(createEvent('resize',chart))}}}));watchForRender(node,function(){if(expando.resizer){var container=node.parentNode;if(container&&container!==resizer.parentNode){container.insertBefore(resizer,container.firstChild)}
resizer._reset()}})}
function removeResizeListener(node){var expando=node[EXPANDO_KEY]||{};var resizer=expando.resizer;delete expando.resizer;unwatchForRender(node);if(resizer&&resizer.parentNode){resizer.parentNode.removeChild(resizer)}}
function injectCSS(rootNode,css){var expando=rootNode[EXPANDO_KEY]||(rootNode[EXPANDO_KEY]={});if(!expando.containsStyles){expando.containsStyles=!0;css='/* Chart.js */\n'+css;var style=document.createElement('style');style.setAttribute('type','text/css');style.appendChild(document.createTextNode(css));rootNode.appendChild(style)}}
var platform_dom$2={disableCSSInjection:!1,_enabled:typeof window!=='undefined'&&typeof document!=='undefined',_ensureLoaded:function(canvas){if(!this.disableCSSInjection){var root=canvas.getRootNode?canvas.getRootNode():document;var targetNode=root.host?root:document.head;injectCSS(targetNode,stylesheet)}},acquireContext:function(item,config){if(typeof item==='string'){item=document.getElementById(item)}else if(item.length){item=item[0]}
if(item&&item.canvas){item=item.canvas}
var context=item&&item.getContext&&item.getContext('2d');if(context&&context.canvas===item){this._ensureLoaded(item);initCanvas(item,config);return context}
return null},releaseContext:function(context){var canvas=context.canvas;if(!canvas[EXPANDO_KEY]){return}
var initial=canvas[EXPANDO_KEY].initial;['height','width'].forEach(function(prop){var value=initial[prop];if(helpers$1.isNullOrUndef(value)){canvas.removeAttribute(prop)}else{canvas.setAttribute(prop,value)}});helpers$1.each(initial.style||{},function(value,key){canvas.style[key]=value});canvas.width=canvas.width;delete canvas[EXPANDO_KEY]},addEventListener:function(chart,type,listener){var canvas=chart.canvas;if(type==='resize'){addResizeListener(canvas,listener,chart);return}
var expando=listener[EXPANDO_KEY]||(listener[EXPANDO_KEY]={});var proxies=expando.proxies||(expando.proxies={});var proxy=proxies[chart.id+'_'+type]=function(event){listener(fromNativeEvent(event,chart))};addListener(canvas,type,proxy)},removeEventListener:function(chart,type,listener){var canvas=chart.canvas;if(type==='resize'){removeResizeListener(canvas);return}
var expando=listener[EXPANDO_KEY]||{};var proxies=expando.proxies||{};var proxy=proxies[chart.id+'_'+type];if(!proxy){return}
removeListener(canvas,type,proxy)}};helpers$1.addEvent=addListener;helpers$1.removeEvent=removeListener;var implementation=platform_dom$2._enabled?platform_dom$2:platform_basic;var platform=helpers$1.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},implementation);core_defaults._set('global',{plugins:{}});var core_plugins={_plugins:[],_cacheId:0,register:function(plugins){var p=this._plugins;([]).concat(plugins).forEach(function(plugin){if(p.indexOf(plugin)===-1){p.push(plugin)}});this._cacheId++},unregister:function(plugins){var p=this._plugins;([]).concat(plugins).forEach(function(plugin){var idx=p.indexOf(plugin);if(idx!==-1){p.splice(idx,1)}});this._cacheId++},clear:function(){this._plugins=[];this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(chart,hook,args){var descriptors=this.descriptors(chart);var ilen=descriptors.length;var i,descriptor,plugin,params,method;for(i=0;i<ilen;++i){descriptor=descriptors[i];plugin=descriptor.plugin;method=plugin[hook];if(typeof method==='function'){params=[chart].concat(args||[]);params.push(descriptor.options);if(method.apply(plugin,params)===!1){return!1}}}
return!0},descriptors:function(chart){var cache=chart.$plugins||(chart.$plugins={});if(cache.id===this._cacheId){return cache.descriptors}
var plugins=[];var descriptors=[];var config=(chart&&chart.config)||{};var options=(config.options&&config.options.plugins)||{};this._plugins.concat(config.plugins||[]).forEach(function(plugin){var idx=plugins.indexOf(plugin);if(idx!==-1){return}
var id=plugin.id;var opts=options[id];if(opts===!1){return}
if(opts===!0){opts=helpers$1.clone(core_defaults.global.plugins[id])}
plugins.push(plugin);descriptors.push({plugin:plugin,options:opts||{}})});cache.descriptors=descriptors;cache.id=this._cacheId;return descriptors},_invalidate:function(chart){delete chart.$plugins}};var core_scaleService={constructors:{},defaults:{},registerScaleType:function(type,scaleConstructor,scaleDefaults){this.constructors[type]=scaleConstructor;this.defaults[type]=helpers$1.clone(scaleDefaults)},getScaleConstructor:function(type){return this.constructors.hasOwnProperty(type)?this.constructors[type]:undefined},getScaleDefaults:function(type){return this.defaults.hasOwnProperty(type)?helpers$1.merge(Object.create(null),[core_defaults.scale,this.defaults[type]]):{}},updateScaleDefaults:function(type,additions){var me=this;if(me.defaults.hasOwnProperty(type)){me.defaults[type]=helpers$1.extend(me.defaults[type],additions)}},addScalesToLayout:function(chart){helpers$1.each(chart.scales,function(scale){scale.fullWidth=scale.options.fullWidth;scale.position=scale.options.position;scale.weight=scale.options.weight;core_layouts.addBox(chart,scale)})}};var valueOrDefault$8=helpers$1.valueOrDefault;var getRtlHelper=helpers$1.rtl.getRtlAdapter;core_defaults._set('global',{tooltips:{enabled:!0,custom:null,mode:'nearest',position:'average',intersect:!0,backgroundColor:'rgba(0,0,0,0.8)',titleFontStyle:'bold',titleSpacing:2,titleMarginBottom:6,titleFontColor:'#fff',titleAlign:'left',bodySpacing:2,bodyFontColor:'#fff',bodyAlign:'left',footerFontStyle:'bold',footerSpacing:2,footerMarginTop:6,footerFontColor:'#fff',footerAlign:'left',yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:'#fff',displayColors:!0,borderColor:'rgba(0,0,0,0)',borderWidth:0,callbacks:{beforeTitle:helpers$1.noop,title:function(tooltipItems,data){var title='';var labels=data.labels;var labelCount=labels?labels.length:0;if(tooltipItems.length>0){var item=tooltipItems[0];if(item.label){title=item.label}else if(item.xLabel){title=item.xLabel}else if(labelCount>0&&item.index<labelCount){title=labels[item.index]}}
return title},afterTitle:helpers$1.noop,beforeBody:helpers$1.noop,beforeLabel:helpers$1.noop,label:function(tooltipItem,data){var label=data.datasets[tooltipItem.datasetIndex].label||'';if(label){label+=': '}
if(!helpers$1.isNullOrUndef(tooltipItem.value)){label+=tooltipItem.value}else{label+=tooltipItem.yLabel}
return label},labelColor:function(tooltipItem,chart){var meta=chart.getDatasetMeta(tooltipItem.datasetIndex);var activeElement=meta.data[tooltipItem.index];var view=activeElement._view;return{borderColor:view.borderColor,backgroundColor:view.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:helpers$1.noop,afterBody:helpers$1.noop,beforeFooter:helpers$1.noop,footer:helpers$1.noop,afterFooter:helpers$1.noop}}});var positioners={average:function(elements){if(!elements.length){return!1}
var i,len;var x=0;var y=0;var count=0;for(i=0,len=elements.length;i<len;++i){var el=elements[i];if(el&&el.hasValue()){var pos=el.tooltipPosition();x+=pos.x;y+=pos.y;++count}}
return{x:x/count,y:y/count}},nearest:function(elements,eventPosition){var x=eventPosition.x;var y=eventPosition.y;var minDistance=Number.POSITIVE_INFINITY;var i,len,nearestElement;for(i=0,len=elements.length;i<len;++i){var el=elements[i];if(el&&el.hasValue()){var center=el.getCenterPoint();var d=helpers$1.distanceBetweenPoints(eventPosition,center);if(d<minDistance){minDistance=d;nearestElement=el}}}
if(nearestElement){var tp=nearestElement.tooltipPosition();x=tp.x;y=tp.y}
return{x:x,y:y}}};function pushOrConcat(base,toPush){if(toPush){if(helpers$1.isArray(toPush)){Array.prototype.push.apply(base,toPush)}else{base.push(toPush)}}
return base}
function splitNewlines(str){if((typeof str==='string'||str instanceof String)&&str.indexOf('\n')>-1){return str.split('\n')}
return str}
function createTooltipItem(element){var xScale=element._xScale;var yScale=element._yScale||element._scale;var index=element._index;var datasetIndex=element._datasetIndex;var controller=element._chart.getDatasetMeta(datasetIndex).controller;var indexScale=controller._getIndexScale();var valueScale=controller._getValueScale();return{xLabel:xScale?xScale.getLabelForIndex(index,datasetIndex):'',yLabel:yScale?yScale.getLabelForIndex(index,datasetIndex):'',label:indexScale?''+indexScale.getLabelForIndex(index,datasetIndex):'',value:valueScale?''+valueScale.getLabelForIndex(index,datasetIndex):'',index:index,datasetIndex:datasetIndex,x:element._model.x,y:element._model.y}}
function getBaseModel(tooltipOpts){var globalDefaults=core_defaults.global;return{xPadding:tooltipOpts.xPadding,yPadding:tooltipOpts.yPadding,xAlign:tooltipOpts.xAlign,yAlign:tooltipOpts.yAlign,rtl:tooltipOpts.rtl,textDirection:tooltipOpts.textDirection,bodyFontColor:tooltipOpts.bodyFontColor,_bodyFontFamily:valueOrDefault$8(tooltipOpts.bodyFontFamily,globalDefaults.defaultFontFamily),_bodyFontStyle:valueOrDefault$8(tooltipOpts.bodyFontStyle,globalDefaults.defaultFontStyle),_bodyAlign:tooltipOpts.bodyAlign,bodyFontSize:valueOrDefault$8(tooltipOpts.bodyFontSize,globalDefaults.defaultFontSize),bodySpacing:tooltipOpts.bodySpacing,titleFontColor:tooltipOpts.titleFontColor,_titleFontFamily:valueOrDefault$8(tooltipOpts.titleFontFamily,globalDefaults.defaultFontFamily),_titleFontStyle:valueOrDefault$8(tooltipOpts.titleFontStyle,globalDefaults.defaultFontStyle),titleFontSize:valueOrDefault$8(tooltipOpts.titleFontSize,globalDefaults.defaultFontSize),_titleAlign:tooltipOpts.titleAlign,titleSpacing:tooltipOpts.titleSpacing,titleMarginBottom:tooltipOpts.titleMarginBottom,footerFontColor:tooltipOpts.footerFontColor,_footerFontFamily:valueOrDefault$8(tooltipOpts.footerFontFamily,globalDefaults.defaultFontFamily),_footerFontStyle:valueOrDefault$8(tooltipOpts.footerFontStyle,globalDefaults.defaultFontStyle),footerFontSize:valueOrDefault$8(tooltipOpts.footerFontSize,globalDefaults.defaultFontSize),_footerAlign:tooltipOpts.footerAlign,footerSpacing:tooltipOpts.footerSpacing,footerMarginTop:tooltipOpts.footerMarginTop,caretSize:tooltipOpts.caretSize,cornerRadius:tooltipOpts.cornerRadius,backgroundColor:tooltipOpts.backgroundColor,opacity:0,legendColorBackground:tooltipOpts.multiKeyBackground,displayColors:tooltipOpts.displayColors,borderColor:tooltipOpts.borderColor,borderWidth:tooltipOpts.borderWidth}}
function getTooltipSize(tooltip,model){var ctx=tooltip._chart.ctx;var height=model.yPadding*2;var width=0;var body=model.body;var combinedBodyLength=body.reduce(function(count,bodyItem){return count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length},0);combinedBodyLength+=model.beforeBody.length+model.afterBody.length;var titleLineCount=model.title.length;var footerLineCount=model.footer.length;var titleFontSize=model.titleFontSize;var bodyFontSize=model.bodyFontSize;var footerFontSize=model.footerFontSize;height+=titleLineCount*titleFontSize;height+=titleLineCount?(titleLineCount-1)*model.titleSpacing:0;height+=titleLineCount?model.titleMarginBottom:0;height+=combinedBodyLength*bodyFontSize;height+=combinedBodyLength?(combinedBodyLength-1)*model.bodySpacing:0;height+=footerLineCount?model.footerMarginTop:0;height+=footerLineCount*(footerFontSize);height+=footerLineCount?(footerLineCount-1)*model.footerSpacing:0;var widthPadding=0;var maxLineWidth=function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding)};ctx.font=helpers$1.fontString(titleFontSize,model._titleFontStyle,model._titleFontFamily);helpers$1.each(model.title,maxLineWidth);ctx.font=helpers$1.fontString(bodyFontSize,model._bodyFontStyle,model._bodyFontFamily);helpers$1.each(model.beforeBody.concat(model.afterBody),maxLineWidth);widthPadding=model.displayColors?(bodyFontSize+2):0;helpers$1.each(body,function(bodyItem){helpers$1.each(bodyItem.before,maxLineWidth);helpers$1.each(bodyItem.lines,maxLineWidth);helpers$1.each(bodyItem.after,maxLineWidth)});widthPadding=0;ctx.font=helpers$1.fontString(footerFontSize,model._footerFontStyle,model._footerFontFamily);helpers$1.each(model.footer,maxLineWidth);width+=2*model.xPadding;return{width:width,height:height}}
function determineAlignment(tooltip,size){var model=tooltip._model;var chart=tooltip._chart;var chartArea=tooltip._chart.chartArea;var xAlign='center';var yAlign='center';if(model.y<size.height){yAlign='top'}else if(model.y>(chart.height-size.height)){yAlign='bottom'}
var lf,rf;var olf,orf;var yf;var midX=(chartArea.left+chartArea.right)/2;var midY=(chartArea.top+chartArea.bottom)/2;if(yAlign==='center'){lf=function(x){return x<=midX};rf=function(x){return x>midX}}else{lf=function(x){return x<=(size.width/2)};rf=function(x){return x>=(chart.width-(size.width/2))}}
olf=function(x){return x+size.width+model.caretSize+model.caretPadding>chart.width};orf=function(x){return x-size.width-model.caretSize-model.caretPadding<0};yf=function(y){return y<=midY?'top':'bottom'};if(lf(model.x)){xAlign='left';if(olf(model.x)){xAlign='center';yAlign=yf(model.y)}}else if(rf(model.x)){xAlign='right';if(orf(model.x)){xAlign='center';yAlign=yf(model.y)}}
var opts=tooltip._options;return{xAlign:opts.xAlign?opts.xAlign:xAlign,yAlign:opts.yAlign?opts.yAlign:yAlign}}
function getBackgroundPoint(vm,size,alignment,chart){var x=vm.x;var y=vm.y;var caretSize=vm.caretSize;var caretPadding=vm.caretPadding;var cornerRadius=vm.cornerRadius;var xAlign=alignment.xAlign;var yAlign=alignment.yAlign;var paddingAndSize=caretSize+caretPadding;var radiusAndPadding=cornerRadius+caretPadding;if(xAlign==='right'){x-=size.width}else if(xAlign==='center'){x-=(size.width/2);if(x+size.width>chart.width){x=chart.width-size.width}
if(x<0){x=0}}
if(yAlign==='top'){y+=paddingAndSize}else if(yAlign==='bottom'){y-=size.height+paddingAndSize}else{y-=(size.height/2)}
if(yAlign==='center'){if(xAlign==='left'){x+=paddingAndSize}else if(xAlign==='right'){x-=paddingAndSize}}else if(xAlign==='left'){x-=radiusAndPadding}else if(xAlign==='right'){x+=radiusAndPadding}
return{x:x,y:y}}
function getAlignedX(vm,align){return align==='center'?vm.x+vm.width/2:align==='right'?vm.x+vm.width-vm.xPadding:vm.x+vm.xPadding}
function getBeforeAfterBodyLines(callback){return pushOrConcat([],splitNewlines(callback))}
var exports$4=core_element.extend({initialize:function(){this._model=getBaseModel(this._options);this._lastActive=[]},getTitle:function(){var me=this;var opts=me._options;var callbacks=opts.callbacks;var beforeTitle=callbacks.beforeTitle.apply(me,arguments);var title=callbacks.title.apply(me,arguments);var afterTitle=callbacks.afterTitle.apply(me,arguments);var lines=[];lines=pushOrConcat(lines,splitNewlines(beforeTitle));lines=pushOrConcat(lines,splitNewlines(title));lines=pushOrConcat(lines,splitNewlines(afterTitle));return lines},getBeforeBody:function(){return getBeforeAfterBodyLines(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(tooltipItems,data){var me=this;var callbacks=me._options.callbacks;var bodyItems=[];helpers$1.each(tooltipItems,function(tooltipItem){var bodyItem={before:[],lines:[],after:[]};pushOrConcat(bodyItem.before,splitNewlines(callbacks.beforeLabel.call(me,tooltipItem,data)));pushOrConcat(bodyItem.lines,callbacks.label.call(me,tooltipItem,data));pushOrConcat(bodyItem.after,splitNewlines(callbacks.afterLabel.call(me,tooltipItem,data)));bodyItems.push(bodyItem)});return bodyItems},getAfterBody:function(){return getBeforeAfterBodyLines(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var me=this;var callbacks=me._options.callbacks;var beforeFooter=callbacks.beforeFooter.apply(me,arguments);var footer=callbacks.footer.apply(me,arguments);var afterFooter=callbacks.afterFooter.apply(me,arguments);var lines=[];lines=pushOrConcat(lines,splitNewlines(beforeFooter));lines=pushOrConcat(lines,splitNewlines(footer));lines=pushOrConcat(lines,splitNewlines(afterFooter));return lines},update:function(changed){var me=this;var opts=me._options;var existingModel=me._model;var model=me._model=getBaseModel(opts);var active=me._active;var data=me._data;var alignment={xAlign:existingModel.xAlign,yAlign:existingModel.yAlign};var backgroundPoint={x:existingModel.x,y:existingModel.y};var tooltipSize={width:existingModel.width,height:existingModel.height};var tooltipPosition={x:existingModel.caretX,y:existingModel.caretY};var i,len;if(active.length){model.opacity=1;var labelColors=[];var labelTextColors=[];tooltipPosition=positioners[opts.position].call(me,active,me._eventPosition);var tooltipItems=[];for(i=0,len=active.length;i<len;++i){tooltipItems.push(createTooltipItem(active[i]))}
if(opts.filter){tooltipItems=tooltipItems.filter(function(a){return opts.filter(a,data)})}
if(opts.itemSort){tooltipItems=tooltipItems.sort(function(a,b){return opts.itemSort(a,b,data)})}
helpers$1.each(tooltipItems,function(tooltipItem){labelColors.push(opts.callbacks.labelColor.call(me,tooltipItem,me._chart));labelTextColors.push(opts.callbacks.labelTextColor.call(me,tooltipItem,me._chart))});model.title=me.getTitle(tooltipItems,data);model.beforeBody=me.getBeforeBody(tooltipItems,data);model.body=me.getBody(tooltipItems,data);model.afterBody=me.getAfterBody(tooltipItems,data);model.footer=me.getFooter(tooltipItems,data);model.x=tooltipPosition.x;model.y=tooltipPosition.y;model.caretPadding=opts.caretPadding;model.labelColors=labelColors;model.labelTextColors=labelTextColors;model.dataPoints=tooltipItems;tooltipSize=getTooltipSize(this,model);alignment=determineAlignment(this,tooltipSize);backgroundPoint=getBackgroundPoint(model,tooltipSize,alignment,me._chart)}else{model.opacity=0}
model.xAlign=alignment.xAlign;model.yAlign=alignment.yAlign;model.x=backgroundPoint.x;model.y=backgroundPoint.y;model.width=tooltipSize.width;model.height=tooltipSize.height;model.caretX=tooltipPosition.x;model.caretY=tooltipPosition.y;me._model=model;if(changed&&opts.custom){opts.custom.call(me,model)}
return me},drawCaret:function(tooltipPoint,size){var ctx=this._chart.ctx;var vm=this._view;var caretPosition=this.getCaretPosition(tooltipPoint,size,vm);ctx.lineTo(caretPosition.x1,caretPosition.y1);ctx.lineTo(caretPosition.x2,caretPosition.y2);ctx.lineTo(caretPosition.x3,caretPosition.y3)},getCaretPosition:function(tooltipPoint,size,vm){var x1,x2,x3,y1,y2,y3;var caretSize=vm.caretSize;var cornerRadius=vm.cornerRadius;var xAlign=vm.xAlign;var yAlign=vm.yAlign;var ptX=tooltipPoint.x;var ptY=tooltipPoint.y;var width=size.width;var height=size.height;if(yAlign==='center'){y2=ptY+(height/2);if(xAlign==='left'){x1=ptX;x2=x1-caretSize;x3=x1;y1=y2+caretSize;y3=y2-caretSize}else{x1=ptX+width;x2=x1+caretSize;x3=x1;y1=y2-caretSize;y3=y2+caretSize}}else{if(xAlign==='left'){x2=ptX+cornerRadius+(caretSize);x1=x2-caretSize;x3=x2+caretSize}else if(xAlign==='right'){x2=ptX+width-cornerRadius-caretSize;x1=x2-caretSize;x3=x2+caretSize}else{x2=vm.caretX;x1=x2-caretSize;x3=x2+caretSize}
if(yAlign==='top'){y1=ptY;y2=y1-caretSize;y3=y1}else{y1=ptY+height;y2=y1+caretSize;y3=y1;var tmp=x3;x3=x1;x1=tmp}}
return{x1:x1,x2:x2,x3:x3,y1:y1,y2:y2,y3:y3}},drawTitle:function(pt,vm,ctx){var title=vm.title;var length=title.length;var titleFontSize,titleSpacing,i;if(length){var rtlHelper=getRtlHelper(vm.rtl,vm.x,vm.width);pt.x=getAlignedX(vm,vm._titleAlign);ctx.textAlign=rtlHelper.textAlign(vm._titleAlign);ctx.textBaseline='middle';titleFontSize=vm.titleFontSize;titleSpacing=vm.titleSpacing;ctx.fillStyle=vm.titleFontColor;ctx.font=helpers$1.fontString(titleFontSize,vm._titleFontStyle,vm._titleFontFamily);for(i=0;i<length;++i){ctx.fillText(title[i],rtlHelper.x(pt.x),pt.y+titleFontSize/2);pt.y+=titleFontSize+titleSpacing;if(i+1===length){pt.y+=vm.titleMarginBottom-titleSpacing}}}},drawBody:function(pt,vm,ctx){var bodyFontSize=vm.bodyFontSize;var bodySpacing=vm.bodySpacing;var bodyAlign=vm._bodyAlign;var body=vm.body;var drawColorBoxes=vm.displayColors;var xLinePadding=0;var colorX=drawColorBoxes?getAlignedX(vm,'left'):0;var rtlHelper=getRtlHelper(vm.rtl,vm.x,vm.width);var fillLineOfText=function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyFontSize/2);pt.y+=bodyFontSize+bodySpacing};var bodyItem,textColor,labelColors,lines,i,j,ilen,jlen;var bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign);ctx.textAlign=bodyAlign;ctx.textBaseline='middle';ctx.font=helpers$1.fontString(bodyFontSize,vm._bodyFontStyle,vm._bodyFontFamily);pt.x=getAlignedX(vm,bodyAlignForCalculation);ctx.fillStyle=vm.bodyFontColor;helpers$1.each(vm.beforeBody,fillLineOfText);xLinePadding=drawColorBoxes&&bodyAlignForCalculation!=='right'?bodyAlign==='center'?(bodyFontSize/2+1):(bodyFontSize+2):0;for(i=0,ilen=body.length;i<ilen;++i){bodyItem=body[i];textColor=vm.labelTextColors[i];labelColors=vm.labelColors[i];ctx.fillStyle=textColor;helpers$1.each(bodyItem.before,fillLineOfText);lines=bodyItem.lines;for(j=0,jlen=lines.length;j<jlen;++j){if(drawColorBoxes){var rtlColorX=rtlHelper.x(colorX);ctx.fillStyle=vm.legendColorBackground;ctx.fillRect(rtlHelper.leftForLtr(rtlColorX,bodyFontSize),pt.y,bodyFontSize,bodyFontSize);ctx.lineWidth=1;ctx.strokeStyle=labelColors.borderColor;ctx.strokeRect(rtlHelper.leftForLtr(rtlColorX,bodyFontSize),pt.y,bodyFontSize,bodyFontSize);ctx.fillStyle=labelColors.backgroundColor;ctx.fillRect(rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX,1),bodyFontSize-2),pt.y+1,bodyFontSize-2,bodyFontSize-2);ctx.fillStyle=textColor}
fillLineOfText(lines[j])}
helpers$1.each(bodyItem.after,fillLineOfText)}
xLinePadding=0;helpers$1.each(vm.afterBody,fillLineOfText);pt.y-=bodySpacing},drawFooter:function(pt,vm,ctx){var footer=vm.footer;var length=footer.length;var footerFontSize,i;if(length){var rtlHelper=getRtlHelper(vm.rtl,vm.x,vm.width);pt.x=getAlignedX(vm,vm._footerAlign);pt.y+=vm.footerMarginTop;ctx.textAlign=rtlHelper.textAlign(vm._footerAlign);ctx.textBaseline='middle';footerFontSize=vm.footerFontSize;ctx.fillStyle=vm.footerFontColor;ctx.font=helpers$1.fontString(footerFontSize,vm._footerFontStyle,vm._footerFontFamily);for(i=0;i<length;++i){ctx.fillText(footer[i],rtlHelper.x(pt.x),pt.y+footerFontSize/2);pt.y+=footerFontSize+vm.footerSpacing}}},drawBackground:function(pt,vm,ctx,tooltipSize){ctx.fillStyle=vm.backgroundColor;ctx.strokeStyle=vm.borderColor;ctx.lineWidth=vm.borderWidth;var xAlign=vm.xAlign;var yAlign=vm.yAlign;var x=pt.x;var y=pt.y;var width=tooltipSize.width;var height=tooltipSize.height;var radius=vm.cornerRadius;ctx.beginPath();ctx.moveTo(x+radius,y);if(yAlign==='top'){this.drawCaret(pt,tooltipSize)}
ctx.lineTo(x+width-radius,y);ctx.quadraticCurveTo(x+width,y,x+width,y+radius);if(yAlign==='center'&&xAlign==='right'){this.drawCaret(pt,tooltipSize)}
ctx.lineTo(x+width,y+height-radius);ctx.quadraticCurveTo(x+width,y+height,x+width-radius,y+height);if(yAlign==='bottom'){this.drawCaret(pt,tooltipSize)}
ctx.lineTo(x+radius,y+height);ctx.quadraticCurveTo(x,y+height,x,y+height-radius);if(yAlign==='center'&&xAlign==='left'){this.drawCaret(pt,tooltipSize)}
ctx.lineTo(x,y+radius);ctx.quadraticCurveTo(x,y,x+radius,y);ctx.closePath();ctx.fill();if(vm.borderWidth>0){ctx.stroke()}},draw:function(){var ctx=this._chart.ctx;var vm=this._view;if(vm.opacity===0){return}
var tooltipSize={width:vm.width,height:vm.height};var pt={x:vm.x,y:vm.y};var opacity=Math.abs(vm.opacity<1e-3)?0:vm.opacity;var hasTooltipContent=vm.title.length||vm.beforeBody.length||vm.body.length||vm.afterBody.length||vm.footer.length;if(this._options.enabled&&hasTooltipContent){ctx.save();ctx.globalAlpha=opacity;this.drawBackground(pt,vm,ctx,tooltipSize);pt.y+=vm.yPadding;helpers$1.rtl.overrideTextDirection(ctx,vm.textDirection);this.drawTitle(pt,vm,ctx);this.drawBody(pt,vm,ctx);this.drawFooter(pt,vm,ctx);helpers$1.rtl.restoreTextDirection(ctx,vm.textDirection);ctx.restore()}},handleEvent:function(e){var me=this;var options=me._options;var changed=!1;me._lastActive=me._lastActive||[];if(e.type==='mouseout'){me._active=[]}else{me._active=me._chart.getElementsAtEventForMode(e,options.mode,options);if(options.reverse){me._active.reverse()}}
changed=!helpers$1.arrayEquals(me._active,me._lastActive);if(changed){me._lastActive=me._active;if(options.enabled||options.custom){me._eventPosition={x:e.x,y:e.y};me.update(!0);me.pivot()}}
return changed}});var positioners_1=positioners;var core_tooltip=exports$4;core_tooltip.positioners=positioners_1;var valueOrDefault$9=helpers$1.valueOrDefault;core_defaults._set('global',{elements:{},events:['mousemove','mouseout','click','touchstart','touchmove'],hover:{onHover:null,mode:'nearest',intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});function mergeScaleConfig(){return helpers$1.merge(Object.create(null),[].slice.call(arguments),{merger:function(key,target,source,options){if(key==='xAxes'||key==='yAxes'){var slen=source[key].length;var i,type,scale;if(!target[key]){target[key]=[]}
for(i=0;i<slen;++i){scale=source[key][i];type=valueOrDefault$9(scale.type,key==='xAxes'?'category':'linear');if(i>=target[key].length){target[key].push({})}
if(!target[key][i].type||(scale.type&&scale.type!==target[key][i].type)){helpers$1.merge(target[key][i],[core_scaleService.getScaleDefaults(type),scale])}else{helpers$1.merge(target[key][i],scale)}}}else{helpers$1._merger(key,target,source,options)}}})}
function mergeConfig(){return helpers$1.merge(Object.create(null),[].slice.call(arguments),{merger:function(key,target,source,options){var tval=target[key]||Object.create(null);var sval=source[key];if(key==='scales'){target[key]=mergeScaleConfig(tval,sval)}else if(key==='scale'){target[key]=helpers$1.merge(tval,[core_scaleService.getScaleDefaults(sval.type),sval])}else{helpers$1._merger(key,target,source,options)}}})}
function initConfig(config){config=config||Object.create(null);var data=config.data=config.data||{};data.datasets=data.datasets||[];data.labels=data.labels||[];config.options=mergeConfig(core_defaults.global,core_defaults[config.type],config.options||{});return config}
function updateConfig(chart){var newOptions=chart.options;helpers$1.each(chart.scales,function(scale){core_layouts.removeBox(chart,scale)});newOptions=mergeConfig(core_defaults.global,core_defaults[chart.config.type],newOptions);chart.options=chart.config.options=newOptions;chart.ensureScalesHaveIDs();chart.buildOrUpdateScales();chart.tooltip._options=newOptions.tooltips;chart.tooltip.initialize()}
function nextAvailableScaleId(axesOpts,prefix,index){var id;var hasId=function(obj){return obj.id===id};do{id=prefix+index++}while(helpers$1.findIndex(axesOpts,hasId)>=0);return id}
function positionIsHorizontal(position){return position==='top'||position==='bottom'}
function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1]}}
var Chart=function(item,config){this.construct(item,config);return this};helpers$1.extend(Chart.prototype,{construct:function(item,config){var me=this;config=initConfig(config);var context=platform.acquireContext(item,config);var canvas=context&&context.canvas;var height=canvas&&canvas.height;var width=canvas&&canvas.width;me.id=helpers$1.uid();me.ctx=context;me.canvas=canvas;me.config=config;me.width=width;me.height=height;me.aspectRatio=height?width/height:null;me.options=config.options;me._bufferedRender=!1;me._layers=[];me.chart=me;me.controller=me;Chart.instances[me.id]=me;Object.defineProperty(me,'data',{get:function(){return me.config.data},set:function(value){me.config.data=value}});if(!context||!canvas){console.error("Failed to create chart: can't acquire context from the given item");return}
me.initialize();me.update()},initialize:function(){var me=this;core_plugins.notify(me,'beforeInit');helpers$1.retinaScale(me,me.options.devicePixelRatio);me.bindEvents();if(me.options.responsive){me.resize(!0)}
me.initToolTip();core_plugins.notify(me,'afterInit');return me},clear:function(){helpers$1.canvas.clear(this);return this},stop:function(){core_animations.cancelAnimation(this);return this},resize:function(silent){var me=this;var options=me.options;var canvas=me.canvas;var aspectRatio=(options.maintainAspectRatio&&me.aspectRatio)||null;var newWidth=Math.max(0,Math.floor(helpers$1.getMaximumWidth(canvas)));var newHeight=Math.max(0,Math.floor(aspectRatio?newWidth/aspectRatio:helpers$1.getMaximumHeight(canvas)));if(me.width===newWidth&&me.height===newHeight){return}
canvas.width=me.width=newWidth;canvas.height=me.height=newHeight;canvas.style.width=newWidth+'px';canvas.style.height=newHeight+'px';helpers$1.retinaScale(me,options.devicePixelRatio);if(!silent){var newSize={width:newWidth,height:newHeight};core_plugins.notify(me,'resize',[newSize]);if(options.onResize){options.onResize(me,newSize)}
me.stop();me.update({duration:options.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var options=this.options;var scalesOptions=options.scales||{};var scaleOptions=options.scale;helpers$1.each(scalesOptions.xAxes,function(xAxisOptions,index){if(!xAxisOptions.id){xAxisOptions.id=nextAvailableScaleId(scalesOptions.xAxes,'x-axis-',index)}});helpers$1.each(scalesOptions.yAxes,function(yAxisOptions,index){if(!yAxisOptions.id){yAxisOptions.id=nextAvailableScaleId(scalesOptions.yAxes,'y-axis-',index)}});if(scaleOptions){scaleOptions.id=scaleOptions.id||'scale'}},buildOrUpdateScales:function(){var me=this;var options=me.options;var scales=me.scales||{};var items=[];var updated=Object.keys(scales).reduce(function(obj,id){obj[id]=!1;return obj},{});if(options.scales){items=items.concat((options.scales.xAxes||[]).map(function(xAxisOptions){return{options:xAxisOptions,dtype:'category',dposition:'bottom'}}),(options.scales.yAxes||[]).map(function(yAxisOptions){return{options:yAxisOptions,dtype:'linear',dposition:'left'}}))}
if(options.scale){items.push({options:options.scale,dtype:'radialLinear',isDefault:!0,dposition:'chartArea'})}
helpers$1.each(items,function(item){var scaleOptions=item.options;var id=scaleOptions.id;var scaleType=valueOrDefault$9(scaleOptions.type,item.dtype);if(positionIsHorizontal(scaleOptions.position)!==positionIsHorizontal(item.dposition)){scaleOptions.position=item.dposition}
updated[id]=!0;var scale=null;if(id in scales&&scales[id].type===scaleType){scale=scales[id];scale.options=scaleOptions;scale.ctx=me.ctx;scale.chart=me}else{var scaleClass=core_scaleService.getScaleConstructor(scaleType);if(!scaleClass){return}
scale=new scaleClass({id:id,type:scaleType,options:scaleOptions,ctx:me.ctx,chart:me});scales[scale.id]=scale}
scale.mergeTicksOptions();if(item.isDefault){me.scale=scale}});helpers$1.each(updated,function(hasUpdated,id){if(!hasUpdated){delete scales[id]}});me.scales=scales;core_scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var me=this;var newControllers=[];var datasets=me.data.datasets;var i,ilen;for(i=0,ilen=datasets.length;i<ilen;i++){var dataset=datasets[i];var meta=me.getDatasetMeta(i);var type=dataset.type||me.config.type;if(meta.type&&meta.type!==type){me.destroyDatasetMeta(i);meta=me.getDatasetMeta(i)}
meta.type=type;meta.order=dataset.order||0;meta.index=i;if(meta.controller){meta.controller.updateIndex(i);meta.controller.linkScales()}else{var ControllerClass=controllers[meta.type];if(ControllerClass===undefined){throw new Error('"'+meta.type+'" is not a chart type.')}
meta.controller=new ControllerClass(me,i);newControllers.push(meta.controller)}}
return newControllers},resetElements:function(){var me=this;helpers$1.each(me.data.datasets,function(dataset,datasetIndex){me.getDatasetMeta(datasetIndex).controller.reset()},me)},reset:function(){this.resetElements();this.tooltip.initialize()},update:function(config){var me=this;var i,ilen;if(!config||typeof config!=='object'){config={duration:config,lazy:arguments[1]}}
updateConfig(me);core_plugins._invalidate(me);if(core_plugins.notify(me,'beforeUpdate')===!1){return}
me.tooltip._data=me.data;var newControllers=me.buildOrUpdateControllers();for(i=0,ilen=me.data.datasets.length;i<ilen;i++){me.getDatasetMeta(i).controller.buildOrUpdateElements()}
me.updateLayout();if(me.options.animation&&me.options.animation.duration){helpers$1.each(newControllers,function(controller){controller.reset()})}
me.updateDatasets();me.tooltip.initialize();me.lastActive=[];core_plugins.notify(me,'afterUpdate');me._layers.sort(compare2Level('z','_idx'));if(me._bufferedRender){me._bufferedRequest={duration:config.duration,easing:config.easing,lazy:config.lazy}}else{me.render(config)}},updateLayout:function(){var me=this;if(core_plugins.notify(me,'beforeLayout')===!1){return}
core_layouts.update(this,this.width,this.height);me._layers=[];helpers$1.each(me.boxes,function(box){if(box._configure){box._configure()}
me._layers.push.apply(me._layers,box._layers())},me);me._layers.forEach(function(item,index){item._idx=index});core_plugins.notify(me,'afterScaleUpdate');core_plugins.notify(me,'afterLayout')},updateDatasets:function(){var me=this;if(core_plugins.notify(me,'beforeDatasetsUpdate')===!1){return}
for(var i=0,ilen=me.data.datasets.length;i<ilen;++i){me.updateDataset(i)}
core_plugins.notify(me,'afterDatasetsUpdate')},updateDataset:function(index){var me=this;var meta=me.getDatasetMeta(index);var args={meta:meta,index:index};if(core_plugins.notify(me,'beforeDatasetUpdate',[args])===!1){return}
meta.controller._update();core_plugins.notify(me,'afterDatasetUpdate',[args])},render:function(config){var me=this;if(!config||typeof config!=='object'){config={duration:config,lazy:arguments[1]}}
var animationOptions=me.options.animation;var duration=valueOrDefault$9(config.duration,animationOptions&&animationOptions.duration);var lazy=config.lazy;if(core_plugins.notify(me,'beforeRender')===!1){return}
var onComplete=function(animation){core_plugins.notify(me,'afterRender');helpers$1.callback(animationOptions&&animationOptions.onComplete,[animation],me)};if(animationOptions&&duration){var animation=new core_animation({numSteps:duration/16.66,easing:config.easing||animationOptions.easing,render:function(chart,animationObject){var easingFunction=helpers$1.easing.effects[animationObject.easing];var currentStep=animationObject.currentStep;var stepDecimal=currentStep/animationObject.numSteps;chart.draw(easingFunction(stepDecimal),stepDecimal,currentStep)},onAnimationProgress:animationOptions.onProgress,onAnimationComplete:onComplete});core_animations.addAnimation(me,animation,duration,lazy)}else{me.draw();onComplete(new core_animation({numSteps:0,chart:me}))}
return me},draw:function(easingValue){var me=this;var i,layers;me.clear();if(helpers$1.isNullOrUndef(easingValue)){easingValue=1}
me.transition(easingValue);if(me.width<=0||me.height<=0){return}
if(core_plugins.notify(me,'beforeDraw',[easingValue])===!1){return}
layers=me._layers;for(i=0;i<layers.length&&layers[i].z<=0;++i){layers[i].draw(me.chartArea)}
me.drawDatasets(easingValue);for(;i<layers.length;++i){layers[i].draw(me.chartArea)}
me._drawTooltip(easingValue);core_plugins.notify(me,'afterDraw',[easingValue])},transition:function(easingValue){var me=this;for(var i=0,ilen=(me.data.datasets||[]).length;i<ilen;++i){if(me.isDatasetVisible(i)){me.getDatasetMeta(i).controller.transition(easingValue)}}
me.tooltip.transition(easingValue)},_getSortedDatasetMetas:function(filterVisible){var me=this;var datasets=me.data.datasets||[];var result=[];var i,ilen;for(i=0,ilen=datasets.length;i<ilen;++i){if(!filterVisible||me.isDatasetVisible(i)){result.push(me.getDatasetMeta(i))}}
result.sort(compare2Level('order','index'));return result},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(easingValue){var me=this;var metasets,i;if(core_plugins.notify(me,'beforeDatasetsDraw',[easingValue])===!1){return}
metasets=me._getSortedVisibleDatasetMetas();for(i=metasets.length-1;i>=0;--i){me.drawDataset(metasets[i],easingValue)}
core_plugins.notify(me,'afterDatasetsDraw',[easingValue])},drawDataset:function(meta,easingValue){var me=this;var args={meta:meta,index:meta.index,easingValue:easingValue};if(core_plugins.notify(me,'beforeDatasetDraw',[args])===!1){return}
meta.controller.draw(easingValue);core_plugins.notify(me,'afterDatasetDraw',[args])},_drawTooltip:function(easingValue){var me=this;var tooltip=me.tooltip;var args={tooltip:tooltip,easingValue:easingValue};if(core_plugins.notify(me,'beforeTooltipDraw',[args])===!1){return}
tooltip.draw();core_plugins.notify(me,'afterTooltipDraw',[args])},getElementAtEvent:function(e){return core_interaction.modes.single(this,e)},getElementsAtEvent:function(e){return core_interaction.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return core_interaction.modes['x-axis'](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,mode,options){var method=core_interaction.modes[mode];if(typeof method==='function'){return method(this,e,options)}
return[]},getDatasetAtEvent:function(e){return core_interaction.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(datasetIndex){var me=this;var dataset=me.data.datasets[datasetIndex];if(!dataset._meta){dataset._meta={}}
var meta=dataset._meta[me.id];if(!meta){meta=dataset._meta[me.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset.order||0,index:datasetIndex}}
return meta},getVisibleDatasetCount:function(){var count=0;for(var i=0,ilen=this.data.datasets.length;i<ilen;++i){if(this.isDatasetVisible(i)){count++}}
return count},isDatasetVisible:function(datasetIndex){var meta=this.getDatasetMeta(datasetIndex);return typeof meta.hidden==='boolean'?!meta.hidden:!this.data.datasets[datasetIndex].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(datasetIndex){var id=this.id;var dataset=this.data.datasets[datasetIndex];var meta=dataset._meta&&dataset._meta[id];if(meta){meta.controller.destroy();delete dataset._meta[id]}},destroy:function(){var me=this;var canvas=me.canvas;var i,ilen;me.stop();for(i=0,ilen=me.data.datasets.length;i<ilen;++i){me.destroyDatasetMeta(i)}
if(canvas){me.unbindEvents();helpers$1.canvas.clear(me);platform.releaseContext(me.ctx);me.canvas=null;me.ctx=null}
core_plugins.notify(me,'destroy');delete Chart.instances[me.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var me=this;me.tooltip=new core_tooltip({_chart:me,_chartInstance:me,_data:me.data,_options:me.options.tooltips},me)},bindEvents:function(){var me=this;var listeners=me._listeners={};var listener=function(){me.eventHandler.apply(me,arguments)};helpers$1.each(me.options.events,function(type){platform.addEventListener(me,type,listener);listeners[type]=listener});if(me.options.responsive){listener=function(){me.resize()};platform.addEventListener(me,'resize',listener);listeners.resize=listener}},unbindEvents:function(){var me=this;var listeners=me._listeners;if(!listeners){return}
delete me._listeners;helpers$1.each(listeners,function(listener,type){platform.removeEventListener(me,type,listener)})},updateHoverStyle:function(elements,mode,enabled){var prefix=enabled?'set':'remove';var element,i,ilen;for(i=0,ilen=elements.length;i<ilen;++i){element=elements[i];if(element){this.getDatasetMeta(element._datasetIndex).controller[prefix+'HoverStyle'](element)}}
if(mode==='dataset'){this.getDatasetMeta(elements[0]._datasetIndex).controller['_'+prefix+'DatasetHoverStyle']()}},eventHandler:function(e){var me=this;var tooltip=me.tooltip;if(core_plugins.notify(me,'beforeEvent',[e])===!1){return}
me._bufferedRender=!0;me._bufferedRequest=null;var changed=me.handleEvent(e);if(tooltip){changed=tooltip._start?tooltip.handleEvent(e):changed|tooltip.handleEvent(e)}
core_plugins.notify(me,'afterEvent',[e]);var bufferedRequest=me._bufferedRequest;if(bufferedRequest){me.render(bufferedRequest)}else if(changed&&!me.animating){me.stop();me.render({duration:me.options.hover.animationDuration,lazy:!0})}
me._bufferedRender=!1;me._bufferedRequest=null;return me},handleEvent:function(e){var me=this;var options=me.options||{};var hoverOptions=options.hover;var changed=!1;me.lastActive=me.lastActive||[];if(e.type==='mouseout'){me.active=[]}else{me.active=me.getElementsAtEventForMode(e,hoverOptions.mode,hoverOptions)}
helpers$1.callback(options.onHover||options.hover.onHover,[e.native,me.active],me);if(e.type==='mouseup'||e.type==='click'){if(options.onClick){options.onClick.call(me,e.native,me.active)}}
if(me.lastActive.length){me.updateHoverStyle(me.lastActive,hoverOptions.mode,!1)}
if(me.active.length&&hoverOptions.mode){me.updateHoverStyle(me.active,hoverOptions.mode,!0)}
changed=!helpers$1.arrayEquals(me.active,me.lastActive);me.lastActive=me.active;return changed}});Chart.instances={};var core_controller=Chart;Chart.Controller=Chart;Chart.types={};helpers$1.configMerge=mergeConfig;helpers$1.scaleMerge=mergeScaleConfig;var core_helpers=function(){helpers$1.where=function(collection,filterCallback){if(helpers$1.isArray(collection)&&Array.prototype.filter){return collection.filter(filterCallback)}
var filtered=[];helpers$1.each(collection,function(item){if(filterCallback(item)){filtered.push(item)}});return filtered};helpers$1.findIndex=Array.prototype.findIndex?function(array,callback,scope){return array.findIndex(callback,scope)}:function(array,callback,scope){scope=scope===undefined?array:scope;for(var i=0,ilen=array.length;i<ilen;++i){if(callback.call(scope,array[i],i,array)){return i}}
return-1};helpers$1.findNextWhere=function(arrayToSearch,filterCallback,startIndex){if(helpers$1.isNullOrUndef(startIndex)){startIndex=-1}
for(var i=startIndex+1;i<arrayToSearch.length;i++){var currentItem=arrayToSearch[i];if(filterCallback(currentItem)){return currentItem}}};helpers$1.findPreviousWhere=function(arrayToSearch,filterCallback,startIndex){if(helpers$1.isNullOrUndef(startIndex)){startIndex=arrayToSearch.length}
for(var i=startIndex-1;i>=0;i--){var currentItem=arrayToSearch[i];if(filterCallback(currentItem)){return currentItem}}};helpers$1.isNumber=function(n){return!isNaN(parseFloat(n))&&isFinite(n)};helpers$1.almostEquals=function(x,y,epsilon){return Math.abs(x-y)<epsilon};helpers$1.almostWhole=function(x,epsilon){var rounded=Math.round(x);return((rounded-epsilon)<=x)&&((rounded+epsilon)>=x)};helpers$1.max=function(array){return array.reduce(function(max,value){if(!isNaN(value)){return Math.max(max,value)}
return max},Number.NEGATIVE_INFINITY)};helpers$1.min=function(array){return array.reduce(function(min,value){if(!isNaN(value)){return Math.min(min,value)}
return min},Number.POSITIVE_INFINITY)};helpers$1.sign=Math.sign?function(x){return Math.sign(x)}:function(x){x=+x;if(x===0||isNaN(x)){return x}
return x>0?1:-1};helpers$1.toRadians=function(degrees){return degrees*(Math.PI/180)};helpers$1.toDegrees=function(radians){return radians*(180/Math.PI)};helpers$1._decimalPlaces=function(x){if(!helpers$1.isFinite(x)){return}
var e=1;var p=0;while(Math.round(x*e)/e!==x){e*=10;p++}
return p};helpers$1.getAngleFromPoint=function(centrePoint,anglePoint){var distanceFromXCenter=anglePoint.x-centrePoint.x;var distanceFromYCenter=anglePoint.y-centrePoint.y;var radialDistanceFromCenter=Math.sqrt(distanceFromXCenter*distanceFromXCenter+distanceFromYCenter*distanceFromYCenter);var angle=Math.atan2(distanceFromYCenter,distanceFromXCenter);if(angle<(-0.5*Math.PI)){angle+=2.0*Math.PI}
return{angle:angle,distance:radialDistanceFromCenter}};helpers$1.distanceBetweenPoints=function(pt1,pt2){return Math.sqrt(Math.pow(pt2.x-pt1.x,2)+Math.pow(pt2.y-pt1.y,2))};helpers$1.aliasPixel=function(pixelWidth){return(pixelWidth%2===0)?0:0.5};helpers$1._alignPixel=function(chart,pixel,width){var devicePixelRatio=chart.currentDevicePixelRatio;var halfWidth=width/2;return Math.round((pixel-halfWidth)*devicePixelRatio)/devicePixelRatio+halfWidth};helpers$1.splineCurve=function(firstPoint,middlePoint,afterPoint,t){var previous=firstPoint.skip?middlePoint:firstPoint;var current=middlePoint;var next=afterPoint.skip?middlePoint:afterPoint;var d01=Math.sqrt(Math.pow(current.x-previous.x,2)+Math.pow(current.y-previous.y,2));var d12=Math.sqrt(Math.pow(next.x-current.x,2)+Math.pow(next.y-current.y,2));var s01=d01/(d01+d12);var s12=d12/(d01+d12);s01=isNaN(s01)?0:s01;s12=isNaN(s12)?0:s12;var fa=t*s01;var fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}}};helpers$1.EPSILON=Number.EPSILON||1e-14;helpers$1.splineCurveMonotone=function(points){var pointsWithTangents=(points||[]).map(function(point){return{model:point._model,deltaK:0,mK:0}});var pointsLen=pointsWithTangents.length;var i,pointBefore,pointCurrent,pointAfter;for(i=0;i<pointsLen;++i){pointCurrent=pointsWithTangents[i];if(pointCurrent.model.skip){continue}
pointBefore=i>0?pointsWithTangents[i-1]:null;pointAfter=i<pointsLen-1?pointsWithTangents[i+1]:null;if(pointAfter&&!pointAfter.model.skip){var slopeDeltaX=(pointAfter.model.x-pointCurrent.model.x);pointCurrent.deltaK=slopeDeltaX!==0?(pointAfter.model.y-pointCurrent.model.y)/slopeDeltaX:0}
if(!pointBefore||pointBefore.model.skip){pointCurrent.mK=pointCurrent.deltaK}else if(!pointAfter||pointAfter.model.skip){pointCurrent.mK=pointBefore.deltaK}else if(this.sign(pointBefore.deltaK)!==this.sign(pointCurrent.deltaK)){pointCurrent.mK=0}else{pointCurrent.mK=(pointBefore.deltaK+pointCurrent.deltaK)/2}}
var alphaK,betaK,tauK,squaredMagnitude;for(i=0;i<pointsLen-1;++i){pointCurrent=pointsWithTangents[i];pointAfter=pointsWithTangents[i+1];if(pointCurrent.model.skip||pointAfter.model.skip){continue}
if(helpers$1.almostEquals(pointCurrent.deltaK,0,this.EPSILON)){pointCurrent.mK=pointAfter.mK=0;continue}
alphaK=pointCurrent.mK/pointCurrent.deltaK;betaK=pointAfter.mK/pointCurrent.deltaK;squaredMagnitude=Math.pow(alphaK,2)+Math.pow(betaK,2);if(squaredMagnitude<=9){continue}
tauK=3/Math.sqrt(squaredMagnitude);pointCurrent.mK=alphaK*tauK*pointCurrent.deltaK;pointAfter.mK=betaK*tauK*pointCurrent.deltaK}
var deltaX;for(i=0;i<pointsLen;++i){pointCurrent=pointsWithTangents[i];if(pointCurrent.model.skip){continue}
pointBefore=i>0?pointsWithTangents[i-1]:null;pointAfter=i<pointsLen-1?pointsWithTangents[i+1]:null;if(pointBefore&&!pointBefore.model.skip){deltaX=(pointCurrent.model.x-pointBefore.model.x)/3;pointCurrent.model.controlPointPreviousX=pointCurrent.model.x-deltaX;pointCurrent.model.controlPointPreviousY=pointCurrent.model.y-deltaX*pointCurrent.mK}
if(pointAfter&&!pointAfter.model.skip){deltaX=(pointAfter.model.x-pointCurrent.model.x)/3;pointCurrent.model.controlPointNextX=pointCurrent.model.x+deltaX;pointCurrent.model.controlPointNextY=pointCurrent.model.y+deltaX*pointCurrent.mK}}};helpers$1.nextItem=function(collection,index,loop){if(loop){return index>=collection.length-1?collection[0]:collection[index+1]}
return index>=collection.length-1?collection[collection.length-1]:collection[index+1]};helpers$1.previousItem=function(collection,index,loop){if(loop){return index<=0?collection[collection.length-1]:collection[index-1]}
return index<=0?collection[0]:collection[index-1]};helpers$1.niceNum=function(range,round){var exponent=Math.floor(helpers$1.log10(range));var fraction=range/Math.pow(10,exponent);var niceFraction;if(round){if(fraction<1.5){niceFraction=1}else if(fraction<3){niceFraction=2}else if(fraction<7){niceFraction=5}else{niceFraction=10}}else if(fraction<=1.0){niceFraction=1}else if(fraction<=2){niceFraction=2}else if(fraction<=5){niceFraction=5}else{niceFraction=10}
return niceFraction*Math.pow(10,exponent)};helpers$1.requestAnimFrame=(function(){if(typeof window==='undefined'){return function(callback){callback()}}
return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){return window.setTimeout(callback,1000/60)}}());helpers$1.getRelativePosition=function(evt,chart){var mouseX,mouseY;var e=evt.originalEvent||evt;var canvas=evt.target||evt.srcElement;var boundingRect=canvas.getBoundingClientRect();var touches=e.touches;if(touches&&touches.length>0){mouseX=touches[0].clientX;mouseY=touches[0].clientY}else{mouseX=e.clientX;mouseY=e.clientY}
var paddingLeft=parseFloat(helpers$1.getStyle(canvas,'padding-left'));var paddingTop=parseFloat(helpers$1.getStyle(canvas,'padding-top'));var paddingRight=parseFloat(helpers$1.getStyle(canvas,'padding-right'));var paddingBottom=parseFloat(helpers$1.getStyle(canvas,'padding-bottom'));var width=boundingRect.right-boundingRect.left-paddingLeft-paddingRight;var height=boundingRect.bottom-boundingRect.top-paddingTop-paddingBottom;mouseX=Math.round((mouseX-boundingRect.left-paddingLeft)/(width)*canvas.width/chart.currentDevicePixelRatio);mouseY=Math.round((mouseY-boundingRect.top-paddingTop)/(height)*canvas.height/chart.currentDevicePixelRatio);return{x:mouseX,y:mouseY}};function parseMaxStyle(styleValue,node,parentProperty){var valueInPixels;if(typeof styleValue==='string'){valueInPixels=parseInt(styleValue,10);if(styleValue.indexOf('%')!==-1){valueInPixels=valueInPixels/100*node.parentNode[parentProperty]}}else{valueInPixels=styleValue}
return valueInPixels}
function isConstrainedValue(value){return value!==undefined&&value!==null&&value!=='none'}
function getConstraintDimension(domNode,maxStyle,percentageProperty){var view=document.defaultView;var parentNode=helpers$1._getParentNode(domNode);var constrainedNode=view.getComputedStyle(domNode)[maxStyle];var constrainedContainer=view.getComputedStyle(parentNode)[maxStyle];var hasCNode=isConstrainedValue(constrainedNode);var hasCContainer=isConstrainedValue(constrainedContainer);var infinity=Number.POSITIVE_INFINITY;if(hasCNode||hasCContainer){return Math.min(hasCNode?parseMaxStyle(constrainedNode,domNode,percentageProperty):infinity,hasCContainer?parseMaxStyle(constrainedContainer,parentNode,percentageProperty):infinity)}
return'none'}
helpers$1.getConstraintWidth=function(domNode){return getConstraintDimension(domNode,'max-width','clientWidth')};helpers$1.getConstraintHeight=function(domNode){return getConstraintDimension(domNode,'max-height','clientHeight')};helpers$1._calculatePadding=function(container,padding,parentDimension){padding=helpers$1.getStyle(container,padding);return padding.indexOf('%')>-1?parentDimension*parseInt(padding,10)/100:parseInt(padding,10)};helpers$1._getParentNode=function(domNode){var parent=domNode.parentNode;if(parent&&parent.toString()==='[object ShadowRoot]'){parent=parent.host}
return parent};helpers$1.getMaximumWidth=function(domNode){var container=helpers$1._getParentNode(domNode);if(!container){return domNode.clientWidth}
var clientWidth=container.clientWidth;var paddingLeft=helpers$1._calculatePadding(container,'padding-left',clientWidth);var paddingRight=helpers$1._calculatePadding(container,'padding-right',clientWidth);var w=clientWidth-paddingLeft-paddingRight;var cw=helpers$1.getConstraintWidth(domNode);return isNaN(cw)?w:Math.min(w,cw)};helpers$1.getMaximumHeight=function(domNode){var container=helpers$1._getParentNode(domNode);if(!container){return domNode.clientHeight}
var clientHeight=container.clientHeight;var paddingTop=helpers$1._calculatePadding(container,'padding-top',clientHeight);var paddingBottom=helpers$1._calculatePadding(container,'padding-bottom',clientHeight);var h=clientHeight-paddingTop-paddingBottom;var ch=helpers$1.getConstraintHeight(domNode);return isNaN(ch)?h:Math.min(h,ch)};helpers$1.getStyle=function(el,property){return el.currentStyle?el.currentStyle[property]:document.defaultView.getComputedStyle(el,null).getPropertyValue(property)};helpers$1.retinaScale=function(chart,forceRatio){var pixelRatio=chart.currentDevicePixelRatio=forceRatio||(typeof window!=='undefined'&&window.devicePixelRatio)||1;if(pixelRatio===1){return}
var canvas=chart.canvas;var height=chart.height;var width=chart.width;canvas.height=height*pixelRatio;canvas.width=width*pixelRatio;chart.ctx.scale(pixelRatio,pixelRatio);if(!canvas.style.height&&!canvas.style.width){canvas.style.height=height+'px';canvas.style.width=width+'px'}};helpers$1.fontString=function(pixelSize,fontStyle,fontFamily){return fontStyle+' '+pixelSize+'px '+fontFamily};helpers$1.longestText=function(ctx,font,arrayOfThings,cache){cache=cache||{};var data=cache.data=cache.data||{};var gc=cache.garbageCollect=cache.garbageCollect||[];if(cache.font!==font){data=cache.data={};gc=cache.garbageCollect=[];cache.font=font}
ctx.font=font;var longest=0;var ilen=arrayOfThings.length;var i,j,jlen,thing,nestedThing;for(i=0;i<ilen;i++){thing=arrayOfThings[i];if(thing!==undefined&&thing!==null&&helpers$1.isArray(thing)!==!0){longest=helpers$1.measureText(ctx,data,gc,longest,thing)}else if(helpers$1.isArray(thing)){for(j=0,jlen=thing.length;j<jlen;j++){nestedThing=thing[j];if(nestedThing!==undefined&&nestedThing!==null&&!helpers$1.isArray(nestedThing)){longest=helpers$1.measureText(ctx,data,gc,longest,nestedThing)}}}}
var gcLen=gc.length/2;if(gcLen>arrayOfThings.length){for(i=0;i<gcLen;i++){delete data[gc[i]]}
gc.splice(0,gcLen)}
return longest};helpers$1.measureText=function(ctx,data,gc,longest,string){var textWidth=data[string];if(!textWidth){textWidth=data[string]=ctx.measureText(string).width;gc.push(string)}
if(textWidth>longest){longest=textWidth}
return longest};helpers$1.numberOfLabelLines=function(arrayOfThings){var numberOfLines=1;helpers$1.each(arrayOfThings,function(thing){if(helpers$1.isArray(thing)){if(thing.length>numberOfLines){numberOfLines=thing.length}}});return numberOfLines};helpers$1.color=!chartjsColor?function(value){console.error('Color.js not found!');return value}:function(value){if(value instanceof CanvasGradient){value=core_defaults.global.defaultColor}
return chartjsColor(value)};helpers$1.getHoverColor=function(colorValue){return(colorValue instanceof CanvasPattern||colorValue instanceof CanvasGradient)?colorValue:helpers$1.color(colorValue).saturate(0.5).darken(0.1).rgbString()}};function abstract(){throw new Error('This method is not implemented: either no adapter can '+'be found or an incomplete integration was provided.')}
function DateAdapter(options){this.options=options||{}}
helpers$1.extend(DateAdapter.prototype,{formats:abstract,parse:abstract,format:abstract,add:abstract,diff:abstract,startOf:abstract,endOf:abstract,_create:function(value){return value}});DateAdapter.override=function(members){helpers$1.extend(DateAdapter.prototype,members)};var _date=DateAdapter;var core_adapters={_date:_date};var core_ticks={formatters:{values:function(value){return helpers$1.isArray(value)?value:''+value},linear:function(tickValue,index,ticks){var delta=ticks.length>3?ticks[2]-ticks[1]:ticks[1]-ticks[0];if(Math.abs(delta)>1){if(tickValue!==Math.floor(tickValue)){delta=tickValue-Math.floor(tickValue)}}
var logDelta=helpers$1.log10(Math.abs(delta));var tickString='';if(tickValue!==0){var maxTick=Math.max(Math.abs(ticks[0]),Math.abs(ticks[ticks.length-1]));if(maxTick<1e-4){var logTick=helpers$1.log10(Math.abs(tickValue));var numExponential=Math.floor(logTick)-Math.floor(logDelta);numExponential=Math.max(Math.min(numExponential,20),0);tickString=tickValue.toExponential(numExponential)}else{var numDecimal=-1*Math.floor(logDelta);numDecimal=Math.max(Math.min(numDecimal,20),0);tickString=tickValue.toFixed(numDecimal)}}else{tickString='0'}
return tickString},logarithmic:function(tickValue,index,ticks){var remain=tickValue/(Math.pow(10,Math.floor(helpers$1.log10(tickValue))));if(tickValue===0){return'0'}else if(remain===1||remain===2||remain===5||index===0||index===ticks.length-1){return tickValue.toExponential()}
return''}}};var isArray=helpers$1.isArray;var isNullOrUndef=helpers$1.isNullOrUndef;var valueOrDefault$a=helpers$1.valueOrDefault;var valueAtIndexOrDefault=helpers$1.valueAtIndexOrDefault;core_defaults._set('scale',{display:!0,position:'left',offset:!1,gridLines:{display:!0,color:'rgba(0,0,0,0.1)',lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:'rgba(0,0,0,0.25)',zeroLineBorderDash:[],zeroLineBorderDashOffset:0.0,offsetGridLines:!1,borderDash:[],borderDashOffset:0.0},scaleLabel:{display:!1,labelString:'',padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:core_ticks.formatters.values,minor:{},major:{}}});function sample(arr,numItems){var result=[];var increment=arr.length/numItems;var i=0;var len=arr.length;for(;i<len;i+=increment){result.push(arr[Math.floor(i)])}
return result}
function getPixelForGridLine(scale,index,offsetGridLines){var length=scale.getTicks().length;var validIndex=Math.min(index,length-1);var lineValue=scale.getPixelForTick(validIndex);var start=scale._startPixel;var end=scale._endPixel;var epsilon=1e-6;var offset;if(offsetGridLines){if(length===1){offset=Math.max(lineValue-start,end-lineValue)}else if(index===0){offset=(scale.getPixelForTick(1)-lineValue)/2}else{offset=(lineValue-scale.getPixelForTick(validIndex-1))/2}
lineValue+=validIndex<index?offset:-offset;if(lineValue<start-epsilon||lineValue>end+epsilon){return}}
return lineValue}
function garbageCollect(caches,length){helpers$1.each(caches,function(cache){var gc=cache.gc;var gcLen=gc.length/2;var i;if(gcLen>length){for(i=0;i<gcLen;++i){delete cache.data[gc[i]]}
gc.splice(0,gcLen)}})}
function computeLabelSizes(ctx,tickFonts,ticks,caches){var length=ticks.length;var widths=[];var heights=[];var offsets=[];var widestLabelSize=0;var highestLabelSize=0;var i,j,jlen,label,tickFont,fontString,cache,lineHeight,width,height,nestedLabel,widest,highest;for(i=0;i<length;++i){label=ticks[i].label;tickFont=ticks[i].major?tickFonts.major:tickFonts.minor;ctx.font=fontString=tickFont.string;cache=caches[fontString]=caches[fontString]||{data:{},gc:[]};lineHeight=tickFont.lineHeight;width=height=0;if(!isNullOrUndef(label)&&!isArray(label)){width=helpers$1.measureText(ctx,cache.data,cache.gc,width,label);height=lineHeight}else if(isArray(label)){for(j=0,jlen=label.length;j<jlen;++j){nestedLabel=label[j];if(!isNullOrUndef(nestedLabel)&&!isArray(nestedLabel)){width=helpers$1.measureText(ctx,cache.data,cache.gc,width,nestedLabel);height+=lineHeight}}}
widths.push(width);heights.push(height);offsets.push(lineHeight/2);widestLabelSize=Math.max(width,widestLabelSize);highestLabelSize=Math.max(height,highestLabelSize)}
garbageCollect(caches,length);widest=widths.indexOf(widestLabelSize);highest=heights.indexOf(highestLabelSize);function valueAt(idx){return{width:widths[idx]||0,height:heights[idx]||0,offset:offsets[idx]||0}}
return{first:valueAt(0),last:valueAt(length-1),widest:valueAt(widest),highest:valueAt(highest)}}
function getTickMarkLength(options){return options.drawTicks?options.tickMarkLength:0}
function getScaleLabelHeight(options){var font,padding;if(!options.display){return 0}
font=helpers$1.options._parseFont(options);padding=helpers$1.options.toPadding(options.padding);return font.lineHeight+padding.height}
function parseFontOptions(options,nestedOpts){return helpers$1.extend(helpers$1.options._parseFont({fontFamily:valueOrDefault$a(nestedOpts.fontFamily,options.fontFamily),fontSize:valueOrDefault$a(nestedOpts.fontSize,options.fontSize),fontStyle:valueOrDefault$a(nestedOpts.fontStyle,options.fontStyle),lineHeight:valueOrDefault$a(nestedOpts.lineHeight,options.lineHeight)}),{color:helpers$1.options.resolve([nestedOpts.fontColor,options.fontColor,core_defaults.global.defaultFontColor])})}
function parseTickFontOptions(options){var minor=parseFontOptions(options,options.minor);var major=options.major.enabled?parseFontOptions(options,options.major):minor;return{minor:minor,major:major}}
function nonSkipped(ticksToFilter){var filtered=[];var item,index,len;for(index=0,len=ticksToFilter.length;index<len;++index){item=ticksToFilter[index];if(typeof item._index!=='undefined'){filtered.push(item)}}
return filtered}
function getEvenSpacing(arr){var len=arr.length;var i,diff;if(len<2){return!1}
for(diff=arr[0],i=1;i<len;++i){if(arr[i]-arr[i-1]!==diff){return!1}}
return diff}
function calculateSpacing(majorIndices,ticks,axisLength,ticksLimit){var evenMajorSpacing=getEvenSpacing(majorIndices);var spacing=(ticks.length-1)/ticksLimit;var factors,factor,i,ilen;if(!evenMajorSpacing){return Math.max(spacing,1)}
factors=helpers$1.math._factorize(evenMajorSpacing);for(i=0,ilen=factors.length-1;i<ilen;i++){factor=factors[i];if(factor>spacing){return factor}}
return Math.max(spacing,1)}
function getMajorIndices(ticks){var result=[];var i,ilen;for(i=0,ilen=ticks.length;i<ilen;i++){if(ticks[i].major){result.push(i)}}
return result}
function skipMajors(ticks,majorIndices,spacing){var count=0;var next=majorIndices[0];var i,tick;spacing=Math.ceil(spacing);for(i=0;i<ticks.length;i++){tick=ticks[i];if(i===next){tick._index=i;count++;next=majorIndices[count*spacing]}else{delete tick.label}}}
function skip(ticks,spacing,majorStart,majorEnd){var start=valueOrDefault$a(majorStart,0);var end=Math.min(valueOrDefault$a(majorEnd,ticks.length),ticks.length);var count=0;var length,i,tick,next;spacing=Math.ceil(spacing);if(majorEnd){length=majorEnd-majorStart;spacing=length/Math.floor(length/spacing)}
next=start;while(next<0){count++;next=Math.round(start+count*spacing)}
for(i=Math.max(start,0);i<end;i++){tick=ticks[i];if(i===next){tick._index=i;count++;next=Math.round(start+count*spacing)}else{delete tick.label}}}
var Scale=core_element.extend({zeroLineIndex:0,getPadding:function(){var me=this;return{left:me.paddingLeft||0,top:me.paddingTop||0,right:me.paddingRight||0,bottom:me.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var data=this.chart.data;return this.options.labels||(this.isHorizontal()?data.xLabels:data.yLabels)||data.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){helpers$1.callback(this.options.beforeUpdate,[this])},update:function(maxWidth,maxHeight,margins){var me=this;var tickOpts=me.options.ticks;var sampleSize=tickOpts.sampleSize;var i,ilen,labels,ticks,samplingEnabled;me.beforeUpdate();me.maxWidth=maxWidth;me.maxHeight=maxHeight;me.margins=helpers$1.extend({left:0,right:0,top:0,bottom:0},margins);me._ticks=null;me.ticks=null;me._labelSizes=null;me._maxLabelLines=0;me.longestLabelWidth=0;me.longestTextCache=me.longestTextCache||{};me._gridLineItems=null;me._labelItems=null;me.beforeSetDimensions();me.setDimensions();me.afterSetDimensions();me.beforeDataLimits();me.determineDataLimits();me.afterDataLimits();me.beforeBuildTicks();ticks=me.buildTicks()||[];ticks=me.afterBuildTicks(ticks)||ticks;if((!ticks||!ticks.length)&&me.ticks){ticks=[];for(i=0,ilen=me.ticks.length;i<ilen;++i){ticks.push({value:me.ticks[i],major:!1})}}
me._ticks=ticks;samplingEnabled=sampleSize<ticks.length;labels=me._convertTicksToLabels(samplingEnabled?sample(ticks,sampleSize):ticks);me._configure();me.beforeCalculateTickRotation();me.calculateTickRotation();me.afterCalculateTickRotation();me.beforeFit();me.fit();me.afterFit();me._ticksToDraw=tickOpts.display&&(tickOpts.autoSkip||tickOpts.source==='auto')?me._autoSkip(ticks):ticks;if(samplingEnabled){labels=me._convertTicksToLabels(me._ticksToDraw)}
me.ticks=labels;me.afterUpdate();return me.minSize},_configure:function(){var me=this;var reversePixels=me.options.ticks.reverse;var startPixel,endPixel;if(me.isHorizontal()){startPixel=me.left;endPixel=me.right}else{startPixel=me.top;endPixel=me.bottom;reversePixels=!reversePixels}
me._startPixel=startPixel;me._endPixel=endPixel;me._reversePixels=reversePixels;me._length=endPixel-startPixel},afterUpdate:function(){helpers$1.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){helpers$1.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var me=this;if(me.isHorizontal()){me.width=me.maxWidth;me.left=0;me.right=me.width}else{me.height=me.maxHeight;me.top=0;me.bottom=me.height}
me.paddingLeft=0;me.paddingTop=0;me.paddingRight=0;me.paddingBottom=0},afterSetDimensions:function(){helpers$1.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){helpers$1.callback(this.options.beforeDataLimits,[this])},determineDataLimits:helpers$1.noop,afterDataLimits:function(){helpers$1.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){helpers$1.callback(this.options.beforeBuildTicks,[this])},buildTicks:helpers$1.noop,afterBuildTicks:function(ticks){var me=this;if(isArray(ticks)&&ticks.length){return helpers$1.callback(me.options.afterBuildTicks,[me,ticks])}
me.ticks=helpers$1.callback(me.options.afterBuildTicks,[me,me.ticks])||me.ticks;return ticks},beforeTickToLabelConversion:function(){helpers$1.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var me=this;var tickOpts=me.options.ticks;me.ticks=me.ticks.map(tickOpts.userCallback||tickOpts.callback,this)},afterTickToLabelConversion:function(){helpers$1.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){helpers$1.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var me=this;var options=me.options;var tickOpts=options.ticks;var numTicks=me.getTicks().length;var minRotation=tickOpts.minRotation||0;var maxRotation=tickOpts.maxRotation;var labelRotation=minRotation;var labelSizes,maxLabelWidth,maxLabelHeight,maxWidth,tickWidth,maxHeight,maxLabelDiagonal;if(!me._isVisible()||!tickOpts.display||minRotation>=maxRotation||numTicks<=1||!me.isHorizontal()){me.labelRotation=minRotation;return}
labelSizes=me._getLabelSizes();maxLabelWidth=labelSizes.widest.width;maxLabelHeight=labelSizes.highest.height-labelSizes.highest.offset;maxWidth=Math.min(me.maxWidth,me.chart.width-maxLabelWidth);tickWidth=options.offset?me.maxWidth/numTicks:maxWidth/(numTicks-1);if(maxLabelWidth+6>tickWidth){tickWidth=maxWidth/(numTicks-(options.offset?0.5:1));maxHeight=me.maxHeight-getTickMarkLength(options.gridLines)-tickOpts.padding-getScaleLabelHeight(options.scaleLabel);maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight);labelRotation=helpers$1.toDegrees(Math.min(Math.asin(Math.min((labelSizes.highest.height+6)/tickWidth,1)),Math.asin(Math.min(maxHeight/maxLabelDiagonal,1))-Math.asin(maxLabelHeight/maxLabelDiagonal)));labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation))}
me.labelRotation=labelRotation},afterCalculateTickRotation:function(){helpers$1.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){helpers$1.callback(this.options.beforeFit,[this])},fit:function(){var me=this;var minSize=me.minSize={width:0,height:0};var chart=me.chart;var opts=me.options;var tickOpts=opts.ticks;var scaleLabelOpts=opts.scaleLabel;var gridLineOpts=opts.gridLines;var display=me._isVisible();var isBottom=opts.position==='bottom';var isHorizontal=me.isHorizontal();if(isHorizontal){minSize.width=me.maxWidth}else if(display){minSize.width=getTickMarkLength(gridLineOpts)+getScaleLabelHeight(scaleLabelOpts)}
if(!isHorizontal){minSize.height=me.maxHeight}else if(display){minSize.height=getTickMarkLength(gridLineOpts)+getScaleLabelHeight(scaleLabelOpts)}
if(tickOpts.display&&display){var tickFonts=parseTickFontOptions(tickOpts);var labelSizes=me._getLabelSizes();var firstLabelSize=labelSizes.first;var lastLabelSize=labelSizes.last;var widestLabelSize=labelSizes.widest;var highestLabelSize=labelSizes.highest;var lineSpace=tickFonts.minor.lineHeight*0.4;var tickPadding=tickOpts.padding;if(isHorizontal){var isRotated=me.labelRotation!==0;var angleRadians=helpers$1.toRadians(me.labelRotation);var cosRotation=Math.cos(angleRadians);var sinRotation=Math.sin(angleRadians);var labelHeight=sinRotation*widestLabelSize.width+cosRotation*(highestLabelSize.height-(isRotated?highestLabelSize.offset:0))+(isRotated?0:lineSpace);minSize.height=Math.min(me.maxHeight,minSize.height+labelHeight+tickPadding);var offsetLeft=me.getPixelForTick(0)-me.left;var offsetRight=me.right-me.getPixelForTick(me.getTicks().length-1);var paddingLeft,paddingRight;if(isRotated){paddingLeft=isBottom?cosRotation*firstLabelSize.width+sinRotation*firstLabelSize.offset:sinRotation*(firstLabelSize.height-firstLabelSize.offset);paddingRight=isBottom?sinRotation*(lastLabelSize.height-lastLabelSize.offset):cosRotation*lastLabelSize.width+sinRotation*lastLabelSize.offset}else{paddingLeft=firstLabelSize.width/2;paddingRight=lastLabelSize.width/2}
me.paddingLeft=Math.max((paddingLeft-offsetLeft)*me.width/(me.width-offsetLeft),0)+3;me.paddingRight=Math.max((paddingRight-offsetRight)*me.width/(me.width-offsetRight),0)+3}else{var labelWidth=tickOpts.mirror?0:widestLabelSize.width+tickPadding+lineSpace;minSize.width=Math.min(me.maxWidth,minSize.width+labelWidth);me.paddingTop=firstLabelSize.height/2;me.paddingBottom=lastLabelSize.height/2}}
me.handleMargins();if(isHorizontal){me.width=me._length=chart.width-me.margins.left-me.margins.right;me.height=minSize.height}else{me.width=minSize.width;me.height=me._length=chart.height-me.margins.top-me.margins.bottom}},handleMargins:function(){var me=this;if(me.margins){me.margins.left=Math.max(me.paddingLeft,me.margins.left);me.margins.top=Math.max(me.paddingTop,me.margins.top);me.margins.right=Math.max(me.paddingRight,me.margins.right);me.margins.bottom=Math.max(me.paddingBottom,me.margins.bottom)}},afterFit:function(){helpers$1.callback(this.options.afterFit,[this])},isHorizontal:function(){var pos=this.options.position;return pos==='top'||pos==='bottom'},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(rawValue){if(isNullOrUndef(rawValue)){return NaN}
if((typeof rawValue==='number'||rawValue instanceof Number)&&!isFinite(rawValue)){return NaN}
if(rawValue){if(this.isHorizontal()){if(rawValue.x!==undefined){return this.getRightValue(rawValue.x)}}else if(rawValue.y!==undefined){return this.getRightValue(rawValue.y)}}
return rawValue},_convertTicksToLabels:function(ticks){var me=this;var labels,i,ilen;me.ticks=ticks.map(function(tick){return tick.value});me.beforeTickToLabelConversion();labels=me.convertTicksToLabels(ticks)||me.ticks;me.afterTickToLabelConversion();for(i=0,ilen=ticks.length;i<ilen;++i){ticks[i].label=labels[i]}
return labels},_getLabelSizes:function(){var me=this;var labelSizes=me._labelSizes;if(!labelSizes){me._labelSizes=labelSizes=computeLabelSizes(me.ctx,parseTickFontOptions(me.options.ticks),me.getTicks(),me.longestTextCache);me.longestLabelWidth=labelSizes.widest.width}
return labelSizes},_parseValue:function(value){var start,end,min,max;if(isArray(value)){start=+this.getRightValue(value[0]);end=+this.getRightValue(value[1]);min=Math.min(start,end);max=Math.max(start,end)}else{value=+this.getRightValue(value);start=undefined;end=value;min=value;max=value}
return{min:min,max:max,start:start,end:end}},_getScaleLabel:function(rawValue){var v=this._parseValue(rawValue);if(v.start!==undefined){return'['+v.start+', '+v.end+']'}
return+this.getRightValue(rawValue)},getLabelForIndex:helpers$1.noop,getPixelForValue:helpers$1.noop,getValueForPixel:helpers$1.noop,getPixelForTick:function(index){var me=this;var offset=me.options.offset;var numTicks=me._ticks.length;var tickWidth=1/Math.max(numTicks-(offset?0:1),1);return index<0||index>numTicks-1?null:me.getPixelForDecimal(index*tickWidth+(offset?tickWidth/2:0))},getPixelForDecimal:function(decimal){var me=this;if(me._reversePixels){decimal=1-decimal}
return me._startPixel+decimal*me._length},getDecimalForPixel:function(pixel){var decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var me=this;var min=me.min;var max=me.max;return me.beginAtZero?0:min<0&&max<0?max:min>0&&max>0?min:0},_autoSkip:function(ticks){var me=this;var tickOpts=me.options.ticks;var axisLength=me._length;var ticksLimit=tickOpts.maxTicksLimit||axisLength/me._tickSize()+1;var majorIndices=tickOpts.major.enabled?getMajorIndices(ticks):[];var numMajorIndices=majorIndices.length;var first=majorIndices[0];var last=majorIndices[numMajorIndices-1];var i,ilen,spacing,avgMajorSpacing;if(numMajorIndices>ticksLimit){skipMajors(ticks,majorIndices,numMajorIndices/ticksLimit);return nonSkipped(ticks)}
spacing=calculateSpacing(majorIndices,ticks,axisLength,ticksLimit);if(numMajorIndices>0){for(i=0,ilen=numMajorIndices-1;i<ilen;i++){skip(ticks,spacing,majorIndices[i],majorIndices[i+1])}
avgMajorSpacing=numMajorIndices>1?(last-first)/(numMajorIndices-1):null;skip(ticks,spacing,helpers$1.isNullOrUndef(avgMajorSpacing)?0:first-avgMajorSpacing,first);skip(ticks,spacing,last,helpers$1.isNullOrUndef(avgMajorSpacing)?ticks.length:last+avgMajorSpacing);return nonSkipped(ticks)}
skip(ticks,spacing);return nonSkipped(ticks)},_tickSize:function(){var me=this;var optionTicks=me.options.ticks;var rot=helpers$1.toRadians(me.labelRotation);var cos=Math.abs(Math.cos(rot));var sin=Math.abs(Math.sin(rot));var labelSizes=me._getLabelSizes();var padding=optionTicks.autoSkipPadding||0;var w=labelSizes?labelSizes.widest.width+padding:0;var h=labelSizes?labelSizes.highest.height+padding:0;return me.isHorizontal()?h*cos>w*sin?w/cos:h/sin:h*sin<w*cos?h/cos:w/sin},_isVisible:function(){var me=this;var chart=me.chart;var display=me.options.display;var i,ilen,meta;if(display!=='auto'){return!!display}
for(i=0,ilen=chart.data.datasets.length;i<ilen;++i){if(chart.isDatasetVisible(i)){meta=chart.getDatasetMeta(i);if(meta.xAxisID===me.id||meta.yAxisID===me.id){return!0}}}
return!1},_computeGridLineItems:function(chartArea){var me=this;var chart=me.chart;var options=me.options;var gridLines=options.gridLines;var position=options.position;var offsetGridLines=gridLines.offsetGridLines;var isHorizontal=me.isHorizontal();var ticks=me._ticksToDraw;var ticksLength=ticks.length+(offsetGridLines?1:0);var tl=getTickMarkLength(gridLines);var items=[];var axisWidth=gridLines.drawBorder?valueAtIndexOrDefault(gridLines.lineWidth,0,0):0;var axisHalfWidth=axisWidth/2;var alignPixel=helpers$1._alignPixel;var alignBorderValue=function(pixel){return alignPixel(chart,pixel,axisWidth)};var borderValue,i,tick,lineValue,alignedLineValue;var tx1,ty1,tx2,ty2,x1,y1,x2,y2,lineWidth,lineColor,borderDash,borderDashOffset;if(position==='top'){borderValue=alignBorderValue(me.bottom);ty1=me.bottom-tl;ty2=borderValue-axisHalfWidth;y1=alignBorderValue(chartArea.top)+axisHalfWidth;y2=chartArea.bottom}else if(position==='bottom'){borderValue=alignBorderValue(me.top);y1=chartArea.top;y2=alignBorderValue(chartArea.bottom)-axisHalfWidth;ty1=borderValue+axisHalfWidth;ty2=me.top+tl}else if(position==='left'){borderValue=alignBorderValue(me.right);tx1=me.right-tl;tx2=borderValue-axisHalfWidth;x1=alignBorderValue(chartArea.left)+axisHalfWidth;x2=chartArea.right}else{borderValue=alignBorderValue(me.left);x1=chartArea.left;x2=alignBorderValue(chartArea.right)-axisHalfWidth;tx1=borderValue+axisHalfWidth;tx2=me.left+tl}
for(i=0;i<ticksLength;++i){tick=ticks[i]||{};if(isNullOrUndef(tick.label)&&i<ticks.length){continue}
if(i===me.zeroLineIndex&&options.offset===offsetGridLines){lineWidth=gridLines.zeroLineWidth;lineColor=gridLines.zeroLineColor;borderDash=gridLines.zeroLineBorderDash||[];borderDashOffset=gridLines.zeroLineBorderDashOffset||0.0}else{lineWidth=valueAtIndexOrDefault(gridLines.lineWidth,i,1);lineColor=valueAtIndexOrDefault(gridLines.color,i,'rgba(0,0,0,0.1)');borderDash=gridLines.borderDash||[];borderDashOffset=gridLines.borderDashOffset||0.0}
lineValue=getPixelForGridLine(me,tick._index||i,offsetGridLines);if(lineValue===undefined){continue}
alignedLineValue=alignPixel(chart,lineValue,lineWidth);if(isHorizontal){tx1=tx2=x1=x2=alignedLineValue}else{ty1=ty2=y1=y2=alignedLineValue}
items.push({tx1:tx1,ty1:ty1,tx2:tx2,ty2:ty2,x1:x1,y1:y1,x2:x2,y2:y2,width:lineWidth,color:lineColor,borderDash:borderDash,borderDashOffset:borderDashOffset,})}
items.ticksLength=ticksLength;items.borderValue=borderValue;return items},_computeLabelItems:function(){var me=this;var options=me.options;var optionTicks=options.ticks;var position=options.position;var isMirrored=optionTicks.mirror;var isHorizontal=me.isHorizontal();var ticks=me._ticksToDraw;var fonts=parseTickFontOptions(optionTicks);var tickPadding=optionTicks.padding;var tl=getTickMarkLength(options.gridLines);var rotation=-helpers$1.toRadians(me.labelRotation);var items=[];var i,ilen,tick,label,x,y,textAlign,pixel,font,lineHeight,lineCount,textOffset;if(position==='top'){y=me.bottom-tl-tickPadding;textAlign=!rotation?'center':'left'}else if(position==='bottom'){y=me.top+tl+tickPadding;textAlign=!rotation?'center':'right'}else if(position==='left'){x=me.right-(isMirrored?0:tl)-tickPadding;textAlign=isMirrored?'left':'right'}else{x=me.left+(isMirrored?0:tl)+tickPadding;textAlign=isMirrored?'right':'left'}
for(i=0,ilen=ticks.length;i<ilen;++i){tick=ticks[i];label=tick.label;if(isNullOrUndef(label)){continue}
pixel=me.getPixelForTick(tick._index||i)+optionTicks.labelOffset;font=tick.major?fonts.major:fonts.minor;lineHeight=font.lineHeight;lineCount=isArray(label)?label.length:1;if(isHorizontal){x=pixel;textOffset=position==='top'?((!rotation?0.5:1)-lineCount)*lineHeight:(!rotation?0.5:0)*lineHeight}else{y=pixel;textOffset=(1-lineCount)*lineHeight/2}
items.push({x:x,y:y,rotation:rotation,label:label,font:font,textOffset:textOffset,textAlign:textAlign})}
return items},_drawGrid:function(chartArea){var me=this;var gridLines=me.options.gridLines;if(!gridLines.display){return}
var ctx=me.ctx;var chart=me.chart;var alignPixel=helpers$1._alignPixel;var axisWidth=gridLines.drawBorder?valueAtIndexOrDefault(gridLines.lineWidth,0,0):0;var items=me._gridLineItems||(me._gridLineItems=me._computeGridLineItems(chartArea));var width,color,i,ilen,item;for(i=0,ilen=items.length;i<ilen;++i){item=items[i];width=item.width;color=item.color;if(width&&color){ctx.save();ctx.lineWidth=width;ctx.strokeStyle=color;if(ctx.setLineDash){ctx.setLineDash(item.borderDash);ctx.lineDashOffset=item.borderDashOffset}
ctx.beginPath();if(gridLines.drawTicks){ctx.moveTo(item.tx1,item.ty1);ctx.lineTo(item.tx2,item.ty2)}
if(gridLines.drawOnChartArea){ctx.moveTo(item.x1,item.y1);ctx.lineTo(item.x2,item.y2)}
ctx.stroke();ctx.restore()}}
if(axisWidth){var firstLineWidth=axisWidth;var lastLineWidth=valueAtIndexOrDefault(gridLines.lineWidth,items.ticksLength-1,1);var borderValue=items.borderValue;var x1,x2,y1,y2;if(me.isHorizontal()){x1=alignPixel(chart,me.left,firstLineWidth)-firstLineWidth/2;x2=alignPixel(chart,me.right,lastLineWidth)+lastLineWidth/2;y1=y2=borderValue}else{y1=alignPixel(chart,me.top,firstLineWidth)-firstLineWidth/2;y2=alignPixel(chart,me.bottom,lastLineWidth)+lastLineWidth/2;x1=x2=borderValue}
ctx.lineWidth=axisWidth;ctx.strokeStyle=valueAtIndexOrDefault(gridLines.color,0);ctx.beginPath();ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.stroke()}},_drawLabels:function(){var me=this;var optionTicks=me.options.ticks;if(!optionTicks.display){return}
var ctx=me.ctx;var items=me._labelItems||(me._labelItems=me._computeLabelItems());var i,j,ilen,jlen,item,tickFont,label,y;for(i=0,ilen=items.length;i<ilen;++i){item=items[i];tickFont=item.font;ctx.save();ctx.translate(item.x,item.y);ctx.rotate(item.rotation);ctx.font=tickFont.string;ctx.fillStyle=tickFont.color;ctx.textBaseline='middle';ctx.textAlign=item.textAlign;label=item.label;y=item.textOffset;if(isArray(label)){for(j=0,jlen=label.length;j<jlen;++j){ctx.fillText(''+label[j],0,y);y+=tickFont.lineHeight}}else{ctx.fillText(label,0,y)}
ctx.restore()}},_drawTitle:function(){var me=this;var ctx=me.ctx;var options=me.options;var scaleLabel=options.scaleLabel;if(!scaleLabel.display){return}
var scaleLabelFontColor=valueOrDefault$a(scaleLabel.fontColor,core_defaults.global.defaultFontColor);var scaleLabelFont=helpers$1.options._parseFont(scaleLabel);var scaleLabelPadding=helpers$1.options.toPadding(scaleLabel.padding);var halfLineHeight=scaleLabelFont.lineHeight/2;var position=options.position;var rotation=0;var scaleLabelX,scaleLabelY;if(me.isHorizontal()){scaleLabelX=me.left+me.width/2;scaleLabelY=position==='bottom'?me.bottom-halfLineHeight-scaleLabelPadding.bottom:me.top+halfLineHeight+scaleLabelPadding.top}else{var isLeft=position==='left';scaleLabelX=isLeft?me.left+halfLineHeight+scaleLabelPadding.top:me.right-halfLineHeight-scaleLabelPadding.top;scaleLabelY=me.top+me.height/2;rotation=isLeft?-0.5*Math.PI:0.5*Math.PI}
ctx.save();ctx.translate(scaleLabelX,scaleLabelY);ctx.rotate(rotation);ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillStyle=scaleLabelFontColor;ctx.font=scaleLabelFont.string;ctx.fillText(scaleLabel.labelString,0,0);ctx.restore()},draw:function(chartArea){var me=this;if(!me._isVisible()){return}
me._drawGrid(chartArea);me._drawTitle();me._drawLabels()},_layers:function(){var me=this;var opts=me.options;var tz=opts.ticks&&opts.ticks.z||0;var gz=opts.gridLines&&opts.gridLines.z||0;if(!me._isVisible()||tz===gz||me.draw!==me._draw){return[{z:tz,draw:function(){me.draw.apply(me,arguments)}}]}
return[{z:gz,draw:function(){me._drawGrid.apply(me,arguments);me._drawTitle.apply(me,arguments)}},{z:tz,draw:function(){me._drawLabels.apply(me,arguments)}}]},_getMatchingVisibleMetas:function(type){var me=this;var isHorizontal=me.isHorizontal();return me.chart._getSortedVisibleDatasetMetas().filter(function(meta){return(!type||meta.type===type)&&(isHorizontal?meta.xAxisID===me.id:meta.yAxisID===me.id)})}});Scale.prototype._draw=Scale.prototype.draw;var core_scale=Scale;var isNullOrUndef$1=helpers$1.isNullOrUndef;var defaultConfig={position:'bottom'};var scale_category=core_scale.extend({determineDataLimits:function(){var me=this;var labels=me._getLabels();var ticksOpts=me.options.ticks;var min=ticksOpts.min;var max=ticksOpts.max;var minIndex=0;var maxIndex=labels.length-1;var findIndex;if(min!==undefined){findIndex=labels.indexOf(min);if(findIndex>=0){minIndex=findIndex}}
if(max!==undefined){findIndex=labels.indexOf(max);if(findIndex>=0){maxIndex=findIndex}}
me.minIndex=minIndex;me.maxIndex=maxIndex;me.min=labels[minIndex];me.max=labels[maxIndex]},buildTicks:function(){var me=this;var labels=me._getLabels();var minIndex=me.minIndex;var maxIndex=me.maxIndex;me.ticks=(minIndex===0&&maxIndex===labels.length-1)?labels:labels.slice(minIndex,maxIndex+1)},getLabelForIndex:function(index,datasetIndex){var me=this;var chart=me.chart;if(chart.getDatasetMeta(datasetIndex).controller._getValueScaleId()===me.id){return me.getRightValue(chart.data.datasets[datasetIndex].data[index])}
return me._getLabels()[index]},_configure:function(){var me=this;var offset=me.options.offset;var ticks=me.ticks;core_scale.prototype._configure.call(me);if(!me.isHorizontal()){me._reversePixels=!me._reversePixels}
if(!ticks){return}
me._startValue=me.minIndex-(offset?0.5:0);me._valueRange=Math.max(ticks.length-(offset?0:1),1)},getPixelForValue:function(value,index,datasetIndex){var me=this;var valueCategory,labels,idx;if(!isNullOrUndef$1(index)&&!isNullOrUndef$1(datasetIndex)){value=me.chart.data.datasets[datasetIndex].data[index]}
if(!isNullOrUndef$1(value)){valueCategory=me.isHorizontal()?value.x:value.y}
if(valueCategory!==undefined||(value!==undefined&&isNaN(index))){labels=me._getLabels();value=helpers$1.valueOrDefault(valueCategory,value);idx=labels.indexOf(value);index=idx!==-1?idx:index;if(isNaN(index)){index=value}}
return me.getPixelForDecimal((index-me._startValue)/me._valueRange)},getPixelForTick:function(index){var ticks=this.ticks;return index<0||index>ticks.length-1?null:this.getPixelForValue(ticks[index],index+this.minIndex)},getValueForPixel:function(pixel){var me=this;var value=Math.round(me._startValue+me.getDecimalForPixel(pixel)*me._valueRange);return Math.min(Math.max(value,0),me.ticks.length-1)},getBasePixel:function(){return this.bottom}});var _defaults=defaultConfig;scale_category._defaults=_defaults;var noop=helpers$1.noop;var isNullOrUndef$2=helpers$1.isNullOrUndef;function generateTicks(generationOptions,dataRange){var ticks=[];var MIN_SPACING=1e-14;var stepSize=generationOptions.stepSize;var unit=stepSize||1;var maxNumSpaces=generationOptions.maxTicks-1;var min=generationOptions.min;var max=generationOptions.max;var precision=generationOptions.precision;var rmin=dataRange.min;var rmax=dataRange.max;var spacing=helpers$1.niceNum((rmax-rmin)/maxNumSpaces/unit)*unit;var factor,niceMin,niceMax,numSpaces;if(spacing<MIN_SPACING&&isNullOrUndef$2(min)&&isNullOrUndef$2(max)){return[rmin,rmax]}
numSpaces=Math.ceil(rmax/spacing)-Math.floor(rmin/spacing);if(numSpaces>maxNumSpaces){spacing=helpers$1.niceNum(numSpaces*spacing/maxNumSpaces/unit)*unit}
if(stepSize||isNullOrUndef$2(precision)){factor=Math.pow(10,helpers$1._decimalPlaces(spacing))}else{factor=Math.pow(10,precision);spacing=Math.ceil(spacing*factor)/factor}
niceMin=Math.floor(rmin/spacing)*spacing;niceMax=Math.ceil(rmax/spacing)*spacing;if(stepSize){if(!isNullOrUndef$2(min)&&helpers$1.almostWhole(min/spacing,spacing/1000)){niceMin=min}
if(!isNullOrUndef$2(max)&&helpers$1.almostWhole(max/spacing,spacing/1000)){niceMax=max}}
numSpaces=(niceMax-niceMin)/spacing;if(helpers$1.almostEquals(numSpaces,Math.round(numSpaces),spacing/1000)){numSpaces=Math.round(numSpaces)}else{numSpaces=Math.ceil(numSpaces)}
niceMin=Math.round(niceMin*factor)/factor;niceMax=Math.round(niceMax*factor)/factor;ticks.push(isNullOrUndef$2(min)?niceMin:min);for(var j=1;j<numSpaces;++j){ticks.push(Math.round((niceMin+j*spacing)*factor)/factor)}
ticks.push(isNullOrUndef$2(max)?niceMax:max);return ticks}
var scale_linearbase=core_scale.extend({getRightValue:function(value){if(typeof value==='string'){return+value}
return core_scale.prototype.getRightValue.call(this,value)},handleTickRangeOptions:function(){var me=this;var opts=me.options;var tickOpts=opts.ticks;if(tickOpts.beginAtZero){var minSign=helpers$1.sign(me.min);var maxSign=helpers$1.sign(me.max);if(minSign<0&&maxSign<0){me.max=0}else if(minSign>0&&maxSign>0){me.min=0}}
var setMin=tickOpts.min!==undefined||tickOpts.suggestedMin!==undefined;var setMax=tickOpts.max!==undefined||tickOpts.suggestedMax!==undefined;if(tickOpts.min!==undefined){me.min=tickOpts.min}else if(tickOpts.suggestedMin!==undefined){if(me.min===null){me.min=tickOpts.suggestedMin}else{me.min=Math.min(me.min,tickOpts.suggestedMin)}}
if(tickOpts.max!==undefined){me.max=tickOpts.max}else if(tickOpts.suggestedMax!==undefined){if(me.max===null){me.max=tickOpts.suggestedMax}else{me.max=Math.max(me.max,tickOpts.suggestedMax)}}
if(setMin!==setMax){if(me.min>=me.max){if(setMin){me.max=me.min+1}else{me.min=me.max-1}}}
if(me.min===me.max){me.max++;if(!tickOpts.beginAtZero){me.min--}}},getTickLimit:function(){var me=this;var tickOpts=me.options.ticks;var stepSize=tickOpts.stepSize;var maxTicksLimit=tickOpts.maxTicksLimit;var maxTicks;if(stepSize){maxTicks=Math.ceil(me.max/stepSize)-Math.floor(me.min/stepSize)+1}else{maxTicks=me._computeTickLimit();maxTicksLimit=maxTicksLimit||11}
if(maxTicksLimit){maxTicks=Math.min(maxTicksLimit,maxTicks)}
return maxTicks},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:noop,buildTicks:function(){var me=this;var opts=me.options;var tickOpts=opts.ticks;var maxTicks=me.getTickLimit();maxTicks=Math.max(2,maxTicks);var numericGeneratorOptions={maxTicks:maxTicks,min:tickOpts.min,max:tickOpts.max,precision:tickOpts.precision,stepSize:helpers$1.valueOrDefault(tickOpts.fixedStepSize,tickOpts.stepSize)};var ticks=me.ticks=generateTicks(numericGeneratorOptions,me);me.handleDirectionalChanges();me.max=helpers$1.max(ticks);me.min=helpers$1.min(ticks);if(tickOpts.reverse){ticks.reverse();me.start=me.max;me.end=me.min}else{me.start=me.min;me.end=me.max}},convertTicksToLabels:function(){var me=this;me.ticksAsNumbers=me.ticks.slice();me.zeroLineIndex=me.ticks.indexOf(0);core_scale.prototype.convertTicksToLabels.call(me)},_configure:function(){var me=this;var ticks=me.getTicks();var start=me.min;var end=me.max;var offset;core_scale.prototype._configure.call(me);if(me.options.offset&&ticks.length){offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset;end+=offset}
me._startValue=start;me._endValue=end;me._valueRange=end-start}});var defaultConfig$1={position:'left',ticks:{callback:core_ticks.formatters.linear}};var DEFAULT_MIN=0;var DEFAULT_MAX=1;function getOrCreateStack(stacks,stacked,meta){var key=[meta.type,stacked===undefined&&meta.stack===undefined?meta.index:'',meta.stack].join('.');if(stacks[key]===undefined){stacks[key]={pos:[],neg:[]}}
return stacks[key]}
function stackData(scale,stacks,meta,data){var opts=scale.options;var stacked=opts.stacked;var stack=getOrCreateStack(stacks,stacked,meta);var pos=stack.pos;var neg=stack.neg;var ilen=data.length;var i,value;for(i=0;i<ilen;++i){value=scale._parseValue(data[i]);if(isNaN(value.min)||isNaN(value.max)||meta.data[i].hidden){continue}
pos[i]=pos[i]||0;neg[i]=neg[i]||0;if(opts.relativePoints){pos[i]=100}else if(value.min<0||value.max<0){neg[i]+=value.min}else{pos[i]+=value.max}}}
function updateMinMax(scale,meta,data){var ilen=data.length;var i,value;for(i=0;i<ilen;++i){value=scale._parseValue(data[i]);if(isNaN(value.min)||isNaN(value.max)||meta.data[i].hidden){continue}
scale.min=Math.min(scale.min,value.min);scale.max=Math.max(scale.max,value.max)}}
var scale_linear=scale_linearbase.extend({determineDataLimits:function(){var me=this;var opts=me.options;var chart=me.chart;var datasets=chart.data.datasets;var metasets=me._getMatchingVisibleMetas();var hasStacks=opts.stacked;var stacks={};var ilen=metasets.length;var i,meta,data,values;me.min=Number.POSITIVE_INFINITY;me.max=Number.NEGATIVE_INFINITY;if(hasStacks===undefined){for(i=0;!hasStacks&&i<ilen;++i){meta=metasets[i];hasStacks=meta.stack!==undefined}}
for(i=0;i<ilen;++i){meta=metasets[i];data=datasets[meta.index].data;if(hasStacks){stackData(me,stacks,meta,data)}else{updateMinMax(me,meta,data)}}
helpers$1.each(stacks,function(stackValues){values=stackValues.pos.concat(stackValues.neg);me.min=Math.min(me.min,helpers$1.min(values));me.max=Math.max(me.max,helpers$1.max(values))});me.min=helpers$1.isFinite(me.min)&&!isNaN(me.min)?me.min:DEFAULT_MIN;me.max=helpers$1.isFinite(me.max)&&!isNaN(me.max)?me.max:DEFAULT_MAX;me.handleTickRangeOptions()},_computeTickLimit:function(){var me=this;var tickFont;if(me.isHorizontal()){return Math.ceil(me.width/40)}
tickFont=helpers$1.options._parseFont(me.options.ticks);return Math.ceil(me.height/tickFont.lineHeight)},handleDirectionalChanges:function(){if(!this.isHorizontal()){this.ticks.reverse()}},getLabelForIndex:function(index,datasetIndex){return this._getScaleLabel(this.chart.data.datasets[datasetIndex].data[index])},getPixelForValue:function(value){var me=this;return me.getPixelForDecimal((+me.getRightValue(value)-me._startValue)/me._valueRange)},getValueForPixel:function(pixel){return this._startValue+this.getDecimalForPixel(pixel)*this._valueRange},getPixelForTick:function(index){var ticks=this.ticksAsNumbers;if(index<0||index>ticks.length-1){return null}
return this.getPixelForValue(ticks[index])}});var _defaults$1=defaultConfig$1;scale_linear._defaults=_defaults$1;var valueOrDefault$b=helpers$1.valueOrDefault;var log10=helpers$1.math.log10;function generateTicks$1(generationOptions,dataRange){var ticks=[];var tickVal=valueOrDefault$b(generationOptions.min,Math.pow(10,Math.floor(log10(dataRange.min))));var endExp=Math.floor(log10(dataRange.max));var endSignificand=Math.ceil(dataRange.max/Math.pow(10,endExp));var exp,significand;if(tickVal===0){exp=Math.floor(log10(dataRange.minNotZero));significand=Math.floor(dataRange.minNotZero/Math.pow(10,exp));ticks.push(tickVal);tickVal=significand*Math.pow(10,exp)}else{exp=Math.floor(log10(tickVal));significand=Math.floor(tickVal/Math.pow(10,exp))}
var precision=exp<0?Math.pow(10,Math.abs(exp)):1;do{ticks.push(tickVal);++significand;if(significand===10){significand=1;++exp;precision=exp>=0?1:precision}
tickVal=Math.round(significand*Math.pow(10,exp)*precision)/precision}while(exp<endExp||(exp===endExp&&significand<endSignificand));var lastTick=valueOrDefault$b(generationOptions.max,tickVal);ticks.push(lastTick);return ticks}
var defaultConfig$2={position:'left',ticks:{callback:core_ticks.formatters.logarithmic}};function nonNegativeOrDefault(value,defaultValue){return helpers$1.isFinite(value)&&value>=0?value:defaultValue}
var scale_logarithmic=core_scale.extend({determineDataLimits:function(){var me=this;var opts=me.options;var chart=me.chart;var datasets=chart.data.datasets;var isHorizontal=me.isHorizontal();function IDMatches(meta){return isHorizontal?meta.xAxisID===me.id:meta.yAxisID===me.id}
var datasetIndex,meta,value,data,i,ilen;me.min=Number.POSITIVE_INFINITY;me.max=Number.NEGATIVE_INFINITY;me.minNotZero=Number.POSITIVE_INFINITY;var hasStacks=opts.stacked;if(hasStacks===undefined){for(datasetIndex=0;datasetIndex<datasets.length;datasetIndex++){meta=chart.getDatasetMeta(datasetIndex);if(chart.isDatasetVisible(datasetIndex)&&IDMatches(meta)&&meta.stack!==undefined){hasStacks=!0;break}}}
if(opts.stacked||hasStacks){var valuesPerStack={};for(datasetIndex=0;datasetIndex<datasets.length;datasetIndex++){meta=chart.getDatasetMeta(datasetIndex);var key=[meta.type,((opts.stacked===undefined&&meta.stack===undefined)?datasetIndex:''),meta.stack].join('.');if(chart.isDatasetVisible(datasetIndex)&&IDMatches(meta)){if(valuesPerStack[key]===undefined){valuesPerStack[key]=[]}
data=datasets[datasetIndex].data;for(i=0,ilen=data.length;i<ilen;i++){var values=valuesPerStack[key];value=me._parseValue(data[i]);if(isNaN(value.min)||isNaN(value.max)||meta.data[i].hidden||value.min<0||value.max<0){continue}
values[i]=values[i]||0;values[i]+=value.max}}}
helpers$1.each(valuesPerStack,function(valuesForType){if(valuesForType.length>0){var minVal=helpers$1.min(valuesForType);var maxVal=helpers$1.max(valuesForType);me.min=Math.min(me.min,minVal);me.max=Math.max(me.max,maxVal)}})}else{for(datasetIndex=0;datasetIndex<datasets.length;datasetIndex++){meta=chart.getDatasetMeta(datasetIndex);if(chart.isDatasetVisible(datasetIndex)&&IDMatches(meta)){data=datasets[datasetIndex].data;for(i=0,ilen=data.length;i<ilen;i++){value=me._parseValue(data[i]);if(isNaN(value.min)||isNaN(value.max)||meta.data[i].hidden||value.min<0||value.max<0){continue}
me.min=Math.min(value.min,me.min);me.max=Math.max(value.max,me.max);if(value.min!==0){me.minNotZero=Math.min(value.min,me.minNotZero)}}}}}
me.min=helpers$1.isFinite(me.min)?me.min:null;me.max=helpers$1.isFinite(me.max)?me.max:null;me.minNotZero=helpers$1.isFinite(me.minNotZero)?me.minNotZero:null;this.handleTickRangeOptions()},handleTickRangeOptions:function(){var me=this;var tickOpts=me.options.ticks;var DEFAULT_MIN=1;var DEFAULT_MAX=10;me.min=nonNegativeOrDefault(tickOpts.min,me.min);me.max=nonNegativeOrDefault(tickOpts.max,me.max);if(me.min===me.max){if(me.min!==0&&me.min!==null){me.min=Math.pow(10,Math.floor(log10(me.min))-1);me.max=Math.pow(10,Math.floor(log10(me.max))+1)}else{me.min=DEFAULT_MIN;me.max=DEFAULT_MAX}}
if(me.min===null){me.min=Math.pow(10,Math.floor(log10(me.max))-1)}
if(me.max===null){me.max=me.min!==0?Math.pow(10,Math.floor(log10(me.min))+1):DEFAULT_MAX}
if(me.minNotZero===null){if(me.min>0){me.minNotZero=me.min}else if(me.max<1){me.minNotZero=Math.pow(10,Math.floor(log10(me.max)))}else{me.minNotZero=DEFAULT_MIN}}},buildTicks:function(){var me=this;var tickOpts=me.options.ticks;var reverse=!me.isHorizontal();var generationOptions={min:nonNegativeOrDefault(tickOpts.min),max:nonNegativeOrDefault(tickOpts.max)};var ticks=me.ticks=generateTicks$1(generationOptions,me);me.max=helpers$1.max(ticks);me.min=helpers$1.min(ticks);if(tickOpts.reverse){reverse=!reverse;me.start=me.max;me.end=me.min}else{me.start=me.min;me.end=me.max}
if(reverse){ticks.reverse()}},convertTicksToLabels:function(){this.tickValues=this.ticks.slice();core_scale.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(index,datasetIndex){return this._getScaleLabel(this.chart.data.datasets[datasetIndex].data[index])},getPixelForTick:function(index){var ticks=this.tickValues;if(index<0||index>ticks.length-1){return null}
return this.getPixelForValue(ticks[index])},_getFirstTickValue:function(value){var exp=Math.floor(log10(value));var significand=Math.floor(value/Math.pow(10,exp));return significand*Math.pow(10,exp)},_configure:function(){var me=this;var start=me.min;var offset=0;core_scale.prototype._configure.call(me);if(start===0){start=me._getFirstTickValue(me.minNotZero);offset=valueOrDefault$b(me.options.ticks.fontSize,core_defaults.global.defaultFontSize)/me._length}
me._startValue=log10(start);me._valueOffset=offset;me._valueRange=(log10(me.max)-log10(start))/(1-offset)},getPixelForValue:function(value){var me=this;var decimal=0;value=+me.getRightValue(value);if(value>me.min&&value>0){decimal=(log10(value)-me._startValue)/me._valueRange+me._valueOffset}
return me.getPixelForDecimal(decimal)},getValueForPixel:function(pixel){var me=this;var decimal=me.getDecimalForPixel(pixel);return decimal===0&&me.min===0?0:Math.pow(10,me._startValue+(decimal-me._valueOffset)*me._valueRange)}});var _defaults$2=defaultConfig$2;scale_logarithmic._defaults=_defaults$2;var valueOrDefault$c=helpers$1.valueOrDefault;var valueAtIndexOrDefault$1=helpers$1.valueAtIndexOrDefault;var resolve$4=helpers$1.options.resolve;var defaultConfig$3={display:!0,animate:!0,position:'chartArea',angleLines:{display:!0,color:'rgba(0,0,0,0.1)',lineWidth:1,borderDash:[],borderDashOffset:0.0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:'rgba(255,255,255,0.75)',backdropPaddingY:2,backdropPaddingX:2,callback:core_ticks.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(label){return label}}};function getTickBackdropHeight(opts){var tickOpts=opts.ticks;if(tickOpts.display&&opts.display){return valueOrDefault$c(tickOpts.fontSize,core_defaults.global.defaultFontSize)+tickOpts.backdropPaddingY*2}
return 0}
function measureLabelSize(ctx,lineHeight,label){if(helpers$1.isArray(label)){return{w:helpers$1.longestText(ctx,ctx.font,label),h:label.length*lineHeight}}
return{w:ctx.measureText(label).width,h:lineHeight}}
function determineLimits(angle,pos,size,min,max){if(angle===min||angle===max){return{start:pos-(size/2),end:pos+(size/2)}}else if(angle<min||angle>max){return{start:pos-size,end:pos}}
return{start:pos,end:pos+size}}
function fitWithPointLabels(scale){var plFont=helpers$1.options._parseFont(scale.options.pointLabels);var furthestLimits={l:0,r:scale.width,t:0,b:scale.height-scale.paddingTop};var furthestAngles={};var i,textSize,pointPosition;scale.ctx.font=plFont.string;scale._pointLabelSizes=[];var valueCount=scale.chart.data.labels.length;for(i=0;i<valueCount;i++){pointPosition=scale.getPointPosition(i,scale.drawingArea+5);textSize=measureLabelSize(scale.ctx,plFont.lineHeight,scale.pointLabels[i]);scale._pointLabelSizes[i]=textSize;var angleRadians=scale.getIndexAngle(i);var angle=helpers$1.toDegrees(angleRadians)%360;var hLimits=determineLimits(angle,pointPosition.x,textSize.w,0,180);var vLimits=determineLimits(angle,pointPosition.y,textSize.h,90,270);if(hLimits.start<furthestLimits.l){furthestLimits.l=hLimits.start;furthestAngles.l=angleRadians}
if(hLimits.end>furthestLimits.r){furthestLimits.r=hLimits.end;furthestAngles.r=angleRadians}
if(vLimits.start<furthestLimits.t){furthestLimits.t=vLimits.start;furthestAngles.t=angleRadians}
if(vLimits.end>furthestLimits.b){furthestLimits.b=vLimits.end;furthestAngles.b=angleRadians}}
scale.setReductions(scale.drawingArea,furthestLimits,furthestAngles)}
function getTextAlignForAngle(angle){if(angle===0||angle===180){return'center'}else if(angle<180){return'left'}
return'right'}
function fillText(ctx,text,position,lineHeight){var y=position.y+lineHeight/2;var i,ilen;if(helpers$1.isArray(text)){for(i=0,ilen=text.length;i<ilen;++i){ctx.fillText(text[i],position.x,y);y+=lineHeight}}else{ctx.fillText(text,position.x,y)}}
function adjustPointPositionForLabelHeight(angle,textSize,position){if(angle===90||angle===270){position.y-=(textSize.h/2)}else if(angle>270||angle<90){position.y-=textSize.h}}
function drawPointLabels(scale){var ctx=scale.ctx;var opts=scale.options;var pointLabelOpts=opts.pointLabels;var tickBackdropHeight=getTickBackdropHeight(opts);var outerDistance=scale.getDistanceFromCenterForValue(opts.ticks.reverse?scale.min:scale.max);var plFont=helpers$1.options._parseFont(pointLabelOpts);ctx.save();ctx.font=plFont.string;ctx.textBaseline='middle';for(var i=scale.chart.data.labels.length-1;i>=0;i--){var extra=(i===0?tickBackdropHeight/2:0);var pointLabelPosition=scale.getPointPosition(i,outerDistance+extra+5);var pointLabelFontColor=valueAtIndexOrDefault$1(pointLabelOpts.fontColor,i,core_defaults.global.defaultFontColor);ctx.fillStyle=pointLabelFontColor;var angleRadians=scale.getIndexAngle(i);var angle=helpers$1.toDegrees(angleRadians);ctx.textAlign=getTextAlignForAngle(angle);adjustPointPositionForLabelHeight(angle,scale._pointLabelSizes[i],pointLabelPosition);fillText(ctx,scale.pointLabels[i],pointLabelPosition,plFont.lineHeight)}
ctx.restore()}
function drawRadiusLine(scale,gridLineOpts,radius,index){var ctx=scale.ctx;var circular=gridLineOpts.circular;var valueCount=scale.chart.data.labels.length;var lineColor=valueAtIndexOrDefault$1(gridLineOpts.color,index-1);var lineWidth=valueAtIndexOrDefault$1(gridLineOpts.lineWidth,index-1);var pointPosition;if((!circular&&!valueCount)||!lineColor||!lineWidth){return}
ctx.save();ctx.strokeStyle=lineColor;ctx.lineWidth=lineWidth;if(ctx.setLineDash){ctx.setLineDash(gridLineOpts.borderDash||[]);ctx.lineDashOffset=gridLineOpts.borderDashOffset||0.0}
ctx.beginPath();if(circular){ctx.arc(scale.xCenter,scale.yCenter,radius,0,Math.PI*2)}else{pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(var i=1;i<valueCount;i++){pointPosition=scale.getPointPosition(i,radius);ctx.lineTo(pointPosition.x,pointPosition.y)}}
ctx.closePath();ctx.stroke();ctx.restore()}
function numberOrZero(param){return helpers$1.isNumber(param)?param:0}
var scale_radialLinear=scale_linearbase.extend({setDimensions:function(){var me=this;me.width=me.maxWidth;me.height=me.maxHeight;me.paddingTop=getTickBackdropHeight(me.options)/2;me.xCenter=Math.floor(me.width/2);me.yCenter=Math.floor((me.height-me.paddingTop)/2);me.drawingArea=Math.min(me.height-me.paddingTop,me.width)/2},determineDataLimits:function(){var me=this;var chart=me.chart;var min=Number.POSITIVE_INFINITY;var max=Number.NEGATIVE_INFINITY;helpers$1.each(chart.data.datasets,function(dataset,datasetIndex){if(chart.isDatasetVisible(datasetIndex)){var meta=chart.getDatasetMeta(datasetIndex);helpers$1.each(dataset.data,function(rawValue,index){var value=+me.getRightValue(rawValue);if(isNaN(value)||meta.data[index].hidden){return}
min=Math.min(value,min);max=Math.max(value,max)})}});me.min=(min===Number.POSITIVE_INFINITY?0:min);me.max=(max===Number.NEGATIVE_INFINITY?0:max);me.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))},convertTicksToLabels:function(){var me=this;scale_linearbase.prototype.convertTicksToLabels.call(me);me.pointLabels=me.chart.data.labels.map(function(){var label=helpers$1.callback(me.options.pointLabels.callback,arguments,me);return label||label===0?label:''})},getLabelForIndex:function(index,datasetIndex){return+this.getRightValue(this.chart.data.datasets[datasetIndex].data[index])},fit:function(){var me=this;var opts=me.options;if(opts.display&&opts.pointLabels.display){fitWithPointLabels(me)}else{me.setCenterPoint(0,0,0,0)}},setReductions:function(largestPossibleRadius,furthestLimits,furthestAngles){var me=this;var radiusReductionLeft=furthestLimits.l/Math.sin(furthestAngles.l);var radiusReductionRight=Math.max(furthestLimits.r-me.width,0)/Math.sin(furthestAngles.r);var radiusReductionTop=-furthestLimits.t/Math.cos(furthestAngles.t);var radiusReductionBottom=-Math.max(furthestLimits.b-(me.height-me.paddingTop),0)/Math.cos(furthestAngles.b);radiusReductionLeft=numberOrZero(radiusReductionLeft);radiusReductionRight=numberOrZero(radiusReductionRight);radiusReductionTop=numberOrZero(radiusReductionTop);radiusReductionBottom=numberOrZero(radiusReductionBottom);me.drawingArea=Math.min(Math.floor(largestPossibleRadius-(radiusReductionLeft+radiusReductionRight)/2),Math.floor(largestPossibleRadius-(radiusReductionTop+radiusReductionBottom)/2));me.setCenterPoint(radiusReductionLeft,radiusReductionRight,radiusReductionTop,radiusReductionBottom)},setCenterPoint:function(leftMovement,rightMovement,topMovement,bottomMovement){var me=this;var maxRight=me.width-rightMovement-me.drawingArea;var maxLeft=leftMovement+me.drawingArea;var maxTop=topMovement+me.drawingArea;var maxBottom=(me.height-me.paddingTop)-bottomMovement-me.drawingArea;me.xCenter=Math.floor(((maxLeft+maxRight)/2)+me.left);me.yCenter=Math.floor(((maxTop+maxBottom)/2)+me.top+me.paddingTop)},getIndexAngle:function(index){var chart=this.chart;var angleMultiplier=360/chart.data.labels.length;var options=chart.options||{};var startAngle=options.startAngle||0;var angle=(index*angleMultiplier+startAngle)%360;return(angle<0?angle+360:angle)*Math.PI*2/360},getDistanceFromCenterForValue:function(value){var me=this;if(helpers$1.isNullOrUndef(value)){return NaN}
var scalingFactor=me.drawingArea/(me.max-me.min);if(me.options.ticks.reverse){return(me.max-value)*scalingFactor}
return(value-me.min)*scalingFactor},getPointPosition:function(index,distanceFromCenter){var me=this;var thisAngle=me.getIndexAngle(index)-(Math.PI/2);return{x:Math.cos(thisAngle)*distanceFromCenter+me.xCenter,y:Math.sin(thisAngle)*distanceFromCenter+me.yCenter}},getPointPositionForValue:function(index,value){return this.getPointPosition(index,this.getDistanceFromCenterForValue(value))},getBasePosition:function(index){var me=this;var min=me.min;var max=me.max;return me.getPointPositionForValue(index||0,me.beginAtZero?0:min<0&&max<0?max:min>0&&max>0?min:0)},_drawGrid:function(){var me=this;var ctx=me.ctx;var opts=me.options;var gridLineOpts=opts.gridLines;var angleLineOpts=opts.angleLines;var lineWidth=valueOrDefault$c(angleLineOpts.lineWidth,gridLineOpts.lineWidth);var lineColor=valueOrDefault$c(angleLineOpts.color,gridLineOpts.color);var i,offset,position;if(opts.pointLabels.display){drawPointLabels(me)}
if(gridLineOpts.display){helpers$1.each(me.ticks,function(label,index){if(index!==0){offset=me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);drawRadiusLine(me,gridLineOpts,offset,index)}})}
if(angleLineOpts.display&&lineWidth&&lineColor){ctx.save();ctx.lineWidth=lineWidth;ctx.strokeStyle=lineColor;if(ctx.setLineDash){ctx.setLineDash(resolve$4([angleLineOpts.borderDash,gridLineOpts.borderDash,[]]));ctx.lineDashOffset=resolve$4([angleLineOpts.borderDashOffset,gridLineOpts.borderDashOffset,0.0])}
for(i=me.chart.data.labels.length-1;i>=0;i--){offset=me.getDistanceFromCenterForValue(opts.ticks.reverse?me.min:me.max);position=me.getPointPosition(i,offset);ctx.beginPath();ctx.moveTo(me.xCenter,me.yCenter);ctx.lineTo(position.x,position.y);ctx.stroke()}
ctx.restore()}},_drawLabels:function(){var me=this;var ctx=me.ctx;var opts=me.options;var tickOpts=opts.ticks;if(!tickOpts.display){return}
var startAngle=me.getIndexAngle(0);var tickFont=helpers$1.options._parseFont(tickOpts);var tickFontColor=valueOrDefault$c(tickOpts.fontColor,core_defaults.global.defaultFontColor);var offset,width;ctx.save();ctx.font=tickFont.string;ctx.translate(me.xCenter,me.yCenter);ctx.rotate(startAngle);ctx.textAlign='center';ctx.textBaseline='middle';helpers$1.each(me.ticks,function(label,index){if(index===0&&!tickOpts.reverse){return}
offset=me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);if(tickOpts.showLabelBackdrop){width=ctx.measureText(label).width;ctx.fillStyle=tickOpts.backdropColor;ctx.fillRect(-width/2-tickOpts.backdropPaddingX,-offset-tickFont.size/2-tickOpts.backdropPaddingY,width+tickOpts.backdropPaddingX*2,tickFont.size+tickOpts.backdropPaddingY*2)}
ctx.fillStyle=tickFontColor;ctx.fillText(label,0,-offset)});ctx.restore()},_drawTitle:helpers$1.noop});var _defaults$3=defaultConfig$3;scale_radialLinear._defaults=_defaults$3;var deprecated$1=helpers$1._deprecated;var resolve$5=helpers$1.options.resolve;var valueOrDefault$d=helpers$1.valueOrDefault;var MIN_INTEGER=Number.MIN_SAFE_INTEGER||-9007199254740991;var MAX_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991;var INTERVALS={millisecond:{common:!0,size:1,steps:1000},second:{common:!0,size:1000,steps:60},minute:{common:!0,size:60000,steps:60},hour:{common:!0,size:3600000,steps:24},day:{common:!0,size:86400000,steps:30},week:{common:!1,size:604800000,steps:4},month:{common:!0,size:2.628e9,steps:12},quarter:{common:!1,size:7.884e9,steps:4},year:{common:!0,size:3.154e10}};var UNITS=Object.keys(INTERVALS);function sorter(a,b){return a-b}
function arrayUnique(items){var hash={};var out=[];var i,ilen,item;for(i=0,ilen=items.length;i<ilen;++i){item=items[i];if(!hash[item]){hash[item]=!0;out.push(item)}}
return out}
function getMin(options){return helpers$1.valueOrDefault(options.time.min,options.ticks.min)}
function getMax(options){return helpers$1.valueOrDefault(options.time.max,options.ticks.max)}
function buildLookupTable(timestamps,min,max,distribution){if(distribution==='linear'||!timestamps.length){return[{time:min,pos:0},{time:max,pos:1}]}
var table=[];var items=[min];var i,ilen,prev,curr,next;for(i=0,ilen=timestamps.length;i<ilen;++i){curr=timestamps[i];if(curr>min&&curr<max){items.push(curr)}}
items.push(max);for(i=0,ilen=items.length;i<ilen;++i){next=items[i+1];prev=items[i-1];curr=items[i];if(prev===undefined||next===undefined||Math.round((next+prev)/2)!==curr){table.push({time:curr,pos:i/(ilen-1)})}}
return table}
function lookup(table,key,value){var lo=0;var hi=table.length-1;var mid,i0,i1;while(lo>=0&&lo<=hi){mid=(lo+hi)>>1;i0=table[mid-1]||null;i1=table[mid];if(!i0){return{lo:null,hi:i1}}else if(i1[key]<value){lo=mid+1}else if(i0[key]>value){hi=mid-1}else{return{lo:i0,hi:i1}}}
return{lo:i1,hi:null}}
function interpolate$1(table,skey,sval,tkey){var range=lookup(table,skey,sval);var prev=!range.lo?table[0]:!range.hi?table[table.length-2]:range.lo;var next=!range.lo?table[1]:!range.hi?table[table.length-1]:range.hi;var span=next[skey]-prev[skey];var ratio=span?(sval-prev[skey])/span:0;var offset=(next[tkey]-prev[tkey])*ratio;return prev[tkey]+offset}
function toTimestamp(scale,input){var adapter=scale._adapter;var options=scale.options.time;var parser=options.parser;var format=parser||options.format;var value=input;if(typeof parser==='function'){value=parser(value)}
if(!helpers$1.isFinite(value)){value=typeof format==='string'?adapter.parse(value,format):adapter.parse(value)}
if(value!==null){return+value}
if(!parser&&typeof format==='function'){value=format(input);if(!helpers$1.isFinite(value)){value=adapter.parse(value)}}
return value}
function parse(scale,input){if(helpers$1.isNullOrUndef(input)){return null}
var options=scale.options.time;var value=toTimestamp(scale,scale.getRightValue(input));if(value===null){return value}
if(options.round){value=+scale._adapter.startOf(value,options.round)}
return value}
function determineUnitForAutoTicks(minUnit,min,max,capacity){var ilen=UNITS.length;var i,interval,factor;for(i=UNITS.indexOf(minUnit);i<ilen-1;++i){interval=INTERVALS[UNITS[i]];factor=interval.steps?interval.steps:MAX_INTEGER;if(interval.common&&Math.ceil((max-min)/(factor*interval.size))<=capacity){return UNITS[i]}}
return UNITS[ilen-1]}
function determineUnitForFormatting(scale,numTicks,minUnit,min,max){var i,unit;for(i=UNITS.length-1;i>=UNITS.indexOf(minUnit);i--){unit=UNITS[i];if(INTERVALS[unit].common&&scale._adapter.diff(max,min,unit)>=numTicks-1){return unit}}
return UNITS[minUnit?UNITS.indexOf(minUnit):0]}
function determineMajorUnit(unit){for(var i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i<ilen;++i){if(INTERVALS[UNITS[i]].common){return UNITS[i]}}}
function generate(scale,min,max,capacity){var adapter=scale._adapter;var options=scale.options;var timeOpts=options.time;var minor=timeOpts.unit||determineUnitForAutoTicks(timeOpts.minUnit,min,max,capacity);var stepSize=resolve$5([timeOpts.stepSize,timeOpts.unitStepSize,1]);var weekday=minor==='week'?timeOpts.isoWeekday:!1;var first=min;var ticks=[];var time;if(weekday){first=+adapter.startOf(first,'isoWeek',weekday)}
first=+adapter.startOf(first,weekday?'day':minor);if(adapter.diff(max,min,minor)>100000*stepSize){throw min+' and '+max+' are too far apart with stepSize of '+stepSize+' '+minor}
for(time=first;time<max;time=+adapter.add(time,stepSize,minor)){ticks.push(time)}
if(time===max||options.bounds==='ticks'){ticks.push(time)}
return ticks}
function computeOffsets(table,ticks,min,max,options){var start=0;var end=0;var first,last;if(options.offset&&ticks.length){first=interpolate$1(table,'time',ticks[0],'pos');if(ticks.length===1){start=1-first}else{start=(interpolate$1(table,'time',ticks[1],'pos')-first)/2}
last=interpolate$1(table,'time',ticks[ticks.length-1],'pos');if(ticks.length===1){end=last}else{end=(last-interpolate$1(table,'time',ticks[ticks.length-2],'pos'))/2}}
return{start:start,end:end,factor:1/(start+1+end)}}
function setMajorTicks(scale,ticks,map,majorUnit){var adapter=scale._adapter;var first=+adapter.startOf(ticks[0].value,majorUnit);var last=ticks[ticks.length-1].value;var major,index;for(major=first;major<=last;major=+adapter.add(major,1,majorUnit)){index=map[major];if(index>=0){ticks[index].major=!0}}
return ticks}
function ticksFromTimestamps(scale,values,majorUnit){var ticks=[];var map={};var ilen=values.length;var i,value;for(i=0;i<ilen;++i){value=values[i];map[value]=i;ticks.push({value:value,major:!1})}
return(ilen===0||!majorUnit)?ticks:setMajorTicks(scale,ticks,map,majorUnit)}
var defaultConfig$4={position:'bottom',distribution:'linear',bounds:'data',adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:'millisecond',displayFormats:{}},ticks:{autoSkip:!1,source:'auto',major:{enabled:!1}}};var scale_time=core_scale.extend({initialize:function(){this.mergeTicksOptions();core_scale.prototype.initialize.call(this)},update:function(){var me=this;var options=me.options;var time=options.time||(options.time={});var adapter=me._adapter=new core_adapters._date(options.adapters.date);deprecated$1('time scale',time.format,'time.format','time.parser');deprecated$1('time scale',time.min,'time.min','ticks.min');deprecated$1('time scale',time.max,'time.max','ticks.max');helpers$1.mergeIf(time.displayFormats,adapter.formats());return core_scale.prototype.update.apply(me,arguments)},getRightValue:function(rawValue){if(rawValue&&rawValue.t!==undefined){rawValue=rawValue.t}
return core_scale.prototype.getRightValue.call(this,rawValue)},determineDataLimits:function(){var me=this;var chart=me.chart;var adapter=me._adapter;var options=me.options;var unit=options.time.unit||'day';var min=MAX_INTEGER;var max=MIN_INTEGER;var timestamps=[];var datasets=[];var labels=[];var i,j,ilen,jlen,data,timestamp,labelsAdded;var dataLabels=me._getLabels();for(i=0,ilen=dataLabels.length;i<ilen;++i){labels.push(parse(me,dataLabels[i]))}
for(i=0,ilen=(chart.data.datasets||[]).length;i<ilen;++i){if(chart.isDatasetVisible(i)){data=chart.data.datasets[i].data;if(helpers$1.isObject(data[0])){datasets[i]=[];for(j=0,jlen=data.length;j<jlen;++j){timestamp=parse(me,data[j]);timestamps.push(timestamp);datasets[i][j]=timestamp}}else{datasets[i]=labels.slice(0);if(!labelsAdded){timestamps=timestamps.concat(labels);labelsAdded=!0}}}else{datasets[i]=[]}}
if(labels.length){min=Math.min(min,labels[0]);max=Math.max(max,labels[labels.length-1])}
if(timestamps.length){timestamps=ilen>1?arrayUnique(timestamps).sort(sorter):timestamps.sort(sorter);min=Math.min(min,timestamps[0]);max=Math.max(max,timestamps[timestamps.length-1])}
min=parse(me,getMin(options))||min;max=parse(me,getMax(options))||max;min=min===MAX_INTEGER?+adapter.startOf(Date.now(),unit):min;max=max===MIN_INTEGER?+adapter.endOf(Date.now(),unit)+1:max;me.min=Math.min(min,max);me.max=Math.max(min+1,max);me._table=[];me._timestamps={data:timestamps,datasets:datasets,labels:labels}},buildTicks:function(){var me=this;var min=me.min;var max=me.max;var options=me.options;var tickOpts=options.ticks;var timeOpts=options.time;var timestamps=me._timestamps;var ticks=[];var capacity=me.getLabelCapacity(min);var source=tickOpts.source;var distribution=options.distribution;var i,ilen,timestamp;if(source==='data'||(source==='auto'&&distribution==='series')){timestamps=timestamps.data}else if(source==='labels'){timestamps=timestamps.labels}else{timestamps=generate(me,min,max,capacity)}
if(options.bounds==='ticks'&&timestamps.length){min=timestamps[0];max=timestamps[timestamps.length-1]}
min=parse(me,getMin(options))||min;max=parse(me,getMax(options))||max;for(i=0,ilen=timestamps.length;i<ilen;++i){timestamp=timestamps[i];if(timestamp>=min&&timestamp<=max){ticks.push(timestamp)}}
me.min=min;me.max=max;me._unit=timeOpts.unit||(tickOpts.autoSkip?determineUnitForAutoTicks(timeOpts.minUnit,me.min,me.max,capacity):determineUnitForFormatting(me,ticks.length,timeOpts.minUnit,me.min,me.max));me._majorUnit=!tickOpts.major.enabled||me._unit==='year'?undefined:determineMajorUnit(me._unit);me._table=buildLookupTable(me._timestamps.data,min,max,distribution);me._offsets=computeOffsets(me._table,ticks,min,max,options);if(tickOpts.reverse){ticks.reverse()}
return ticksFromTimestamps(me,ticks,me._majorUnit)},getLabelForIndex:function(index,datasetIndex){var me=this;var adapter=me._adapter;var data=me.chart.data;var timeOpts=me.options.time;var label=data.labels&&index<data.labels.length?data.labels[index]:'';var value=data.datasets[datasetIndex].data[index];if(helpers$1.isObject(value)){label=me.getRightValue(value)}
if(timeOpts.tooltipFormat){return adapter.format(toTimestamp(me,label),timeOpts.tooltipFormat)}
if(typeof label==='string'){return label}
return adapter.format(toTimestamp(me,label),timeOpts.displayFormats.datetime)},tickFormatFunction:function(time,index,ticks,format){var me=this;var adapter=me._adapter;var options=me.options;var formats=options.time.displayFormats;var minorFormat=formats[me._unit];var majorUnit=me._majorUnit;var majorFormat=formats[majorUnit];var tick=ticks[index];var tickOpts=options.ticks;var major=majorUnit&&majorFormat&&tick&&tick.major;var label=adapter.format(time,format?format:major?majorFormat:minorFormat);var nestedTickOpts=major?tickOpts.major:tickOpts.minor;var formatter=resolve$5([nestedTickOpts.callback,nestedTickOpts.userCallback,tickOpts.callback,tickOpts.userCallback]);return formatter?formatter(label,index,ticks):label},convertTicksToLabels:function(ticks){var labels=[];var i,ilen;for(i=0,ilen=ticks.length;i<ilen;++i){labels.push(this.tickFormatFunction(ticks[i].value,i,ticks))}
return labels},getPixelForOffset:function(time){var me=this;var offsets=me._offsets;var pos=interpolate$1(me._table,'time',time,'pos');return me.getPixelForDecimal((offsets.start+pos)*offsets.factor)},getPixelForValue:function(value,index,datasetIndex){var me=this;var time=null;if(index!==undefined&&datasetIndex!==undefined){time=me._timestamps.datasets[datasetIndex][index]}
if(time===null){time=parse(me,value)}
if(time!==null){return me.getPixelForOffset(time)}},getPixelForTick:function(index){var ticks=this.getTicks();return index>=0&&index<ticks.length?this.getPixelForOffset(ticks[index].value):null},getValueForPixel:function(pixel){var me=this;var offsets=me._offsets;var pos=me.getDecimalForPixel(pixel)/offsets.factor-offsets.end;var time=interpolate$1(me._table,'pos',pos,'time');return me._adapter._create(time)},_getLabelSize:function(label){var me=this;var ticksOpts=me.options.ticks;var tickLabelWidth=me.ctx.measureText(label).width;var angle=helpers$1.toRadians(me.isHorizontal()?ticksOpts.maxRotation:ticksOpts.minRotation);var cosRotation=Math.cos(angle);var sinRotation=Math.sin(angle);var tickFontSize=valueOrDefault$d(ticksOpts.fontSize,core_defaults.global.defaultFontSize);return{w:(tickLabelWidth*cosRotation)+(tickFontSize*sinRotation),h:(tickLabelWidth*sinRotation)+(tickFontSize*cosRotation)}},getLabelWidth:function(label){return this._getLabelSize(label).w},getLabelCapacity:function(exampleTime){var me=this;var timeOpts=me.options.time;var displayFormats=timeOpts.displayFormats;var format=displayFormats[timeOpts.unit]||displayFormats.millisecond;var exampleLabel=me.tickFormatFunction(exampleTime,0,ticksFromTimestamps(me,[exampleTime],me._majorUnit),format);var size=me._getLabelSize(exampleLabel);var capacity=Math.floor(me.isHorizontal()?me.width/size.w:me.height/size.h);if(me.options.offset){capacity--}
return capacity>0?capacity:1}});var _defaults$4=defaultConfig$4;scale_time._defaults=_defaults$4;var scales={category:scale_category,linear:scale_linear,logarithmic:scale_logarithmic,radialLinear:scale_radialLinear,time:scale_time};var FORMATS={datetime:'MMM D, YYYY, h:mm:ss a',millisecond:'h:mm:ss.SSS a',second:'h:mm:ss a',minute:'h:mm a',hour:'hA',day:'MMM D',week:'ll',month:'MMM YYYY',quarter:'[Q]Q - YYYY',year:'YYYY'};core_adapters._date.override(typeof moment==='function'?{_id:'moment',formats:function(){return FORMATS},parse:function(value,format){if(typeof value==='string'&&typeof format==='string'){value=moment(value,format)}else if(!(value instanceof moment)){value=moment(value)}
return value.isValid()?value.valueOf():null},format:function(time,format){return moment(time).format(format)},add:function(time,amount,unit){return moment(time).add(amount,unit).valueOf()},diff:function(max,min,unit){return moment(max).diff(moment(min),unit)},startOf:function(time,unit,weekday){time=moment(time);if(unit==='isoWeek'){return time.isoWeekday(weekday).valueOf()}
return time.startOf(unit).valueOf()},endOf:function(time,unit){return moment(time).endOf(unit).valueOf()},_create:function(time){return moment(time)},}:{});core_defaults._set('global',{plugins:{filler:{propagate:!0}}});var mappers={dataset:function(source){var index=source.fill;var chart=source.chart;var meta=chart.getDatasetMeta(index);var visible=meta&&chart.isDatasetVisible(index);var points=(visible&&meta.dataset._children)||[];var length=points.length||0;return!length?null:function(point,i){return(i<length&&points[i]._view)||null}},boundary:function(source){var boundary=source.boundary;var x=boundary?boundary.x:null;var y=boundary?boundary.y:null;if(helpers$1.isArray(boundary)){return function(point,i){return boundary[i]}}
return function(point){return{x:x===null?point.x:x,y:y===null?point.y:y,}}}};function decodeFill(el,index,count){var model=el._model||{};var fill=model.fill;var target;if(fill===undefined){fill=!!model.backgroundColor}
if(fill===!1||fill===null){return!1}
if(fill===!0){return'origin'}
target=parseFloat(fill,10);if(isFinite(target)&&Math.floor(target)===target){if(fill[0]==='-'||fill[0]==='+'){target=index+target}
if(target===index||target<0||target>=count){return!1}
return target}
switch(fill){case 'bottom':return'start';case 'top':return'end';case 'zero':return'origin';case 'origin':case 'start':case 'end':return fill;default:return!1}}
function computeLinearBoundary(source){var model=source.el._model||{};var scale=source.el._scale||{};var fill=source.fill;var target=null;var horizontal;if(isFinite(fill)){return null}
if(fill==='start'){target=model.scaleBottom===undefined?scale.bottom:model.scaleBottom}else if(fill==='end'){target=model.scaleTop===undefined?scale.top:model.scaleTop}else if(model.scaleZero!==undefined){target=model.scaleZero}else if(scale.getBasePixel){target=scale.getBasePixel()}
if(target!==undefined&&target!==null){if(target.x!==undefined&&target.y!==undefined){return target}
if(helpers$1.isFinite(target)){horizontal=scale.isHorizontal();return{x:horizontal?target:null,y:horizontal?null:target}}}
return null}
function computeCircularBoundary(source){var scale=source.el._scale;var options=scale.options;var length=scale.chart.data.labels.length;var fill=source.fill;var target=[];var start,end,center,i,point;if(!length){return null}
start=options.ticks.reverse?scale.max:scale.min;end=options.ticks.reverse?scale.min:scale.max;center=scale.getPointPositionForValue(0,start);for(i=0;i<length;++i){point=fill==='start'||fill==='end'?scale.getPointPositionForValue(i,fill==='start'?start:end):scale.getBasePosition(i);if(options.gridLines.circular){point.cx=center.x;point.cy=center.y;point.angle=scale.getIndexAngle(i)-Math.PI/2}
target.push(point)}
return target}
function computeBoundary(source){var scale=source.el._scale||{};if(scale.getPointPositionForValue){return computeCircularBoundary(source)}
return computeLinearBoundary(source)}
function resolveTarget(sources,index,propagate){var source=sources[index];var fill=source.fill;var visited=[index];var target;if(!propagate){return fill}
while(fill!==!1&&visited.indexOf(fill)===-1){if(!isFinite(fill)){return fill}
target=sources[fill];if(!target){return!1}
if(target.visible){return fill}
visited.push(fill);fill=target.fill}
return!1}
function createMapper(source){var fill=source.fill;var type='dataset';if(fill===!1){return null}
if(!isFinite(fill)){type='boundary'}
return mappers[type](source)}
function isDrawable(point){return point&&!point.skip}
function drawArea(ctx,curve0,curve1,len0,len1){var i,cx,cy,r;if(!len0||!len1){return}
ctx.moveTo(curve0[0].x,curve0[0].y);for(i=1;i<len0;++i){helpers$1.canvas.lineTo(ctx,curve0[i-1],curve0[i])}
if(curve1[0].angle!==undefined){cx=curve1[0].cx;cy=curve1[0].cy;r=Math.sqrt(Math.pow(curve1[0].x-cx,2)+Math.pow(curve1[0].y-cy,2));for(i=len1-1;i>0;--i){ctx.arc(cx,cy,r,curve1[i].angle,curve1[i-1].angle,!0)}
return}
ctx.lineTo(curve1[len1-1].x,curve1[len1-1].y);for(i=len1-1;i>0;--i){helpers$1.canvas.lineTo(ctx,curve1[i],curve1[i-1],!0)}}
function doFill(ctx,points,mapper,view,color,loop){var count=points.length;var span=view.spanGaps;var curve0=[];var curve1=[];var len0=0;var len1=0;var i,ilen,index,p0,p1,d0,d1,loopOffset;ctx.beginPath();for(i=0,ilen=count;i<ilen;++i){index=i%count;p0=points[index]._view;p1=mapper(p0,index,view);d0=isDrawable(p0);d1=isDrawable(p1);if(loop&&loopOffset===undefined&&d0){loopOffset=i+1;ilen=count+loopOffset}
if(d0&&d1){len0=curve0.push(p0);len1=curve1.push(p1)}else if(len0&&len1){if(!span){drawArea(ctx,curve0,curve1,len0,len1);len0=len1=0;curve0=[];curve1=[]}else{if(d0){curve0.push(p0)}
if(d1){curve1.push(p1)}}}}
drawArea(ctx,curve0,curve1,len0,len1);ctx.closePath();ctx.fillStyle=color;ctx.fill()}
var plugin_filler={id:'filler',afterDatasetsUpdate:function(chart,options){var count=(chart.data.datasets||[]).length;var propagate=options.propagate;var sources=[];var meta,i,el,source;for(i=0;i<count;++i){meta=chart.getDatasetMeta(i);el=meta.dataset;source=null;if(el&&el._model&&el instanceof elements.Line){source={visible:chart.isDatasetVisible(i),fill:decodeFill(el,i,count),chart:chart,el:el}}
meta.$filler=source;sources.push(source)}
for(i=0;i<count;++i){source=sources[i];if(!source){continue}
source.fill=resolveTarget(sources,i,propagate);source.boundary=computeBoundary(source);source.mapper=createMapper(source)}},beforeDatasetsDraw:function(chart){var metasets=chart._getSortedVisibleDatasetMetas();var ctx=chart.ctx;var meta,i,el,view,points,mapper,color;for(i=metasets.length-1;i>=0;--i){meta=metasets[i].$filler;if(!meta||!meta.visible){continue}
el=meta.el;view=el._view;points=el._children||[];mapper=meta.mapper;color=view.backgroundColor||core_defaults.global.defaultColor;if(mapper&&color&&points.length){helpers$1.canvas.clipArea(ctx,chart.chartArea);doFill(ctx,points,mapper,view,color,el._loop);helpers$1.canvas.unclipArea(ctx)}}}};var getRtlHelper$1=helpers$1.rtl.getRtlAdapter;var noop$1=helpers$1.noop;var valueOrDefault$e=helpers$1.valueOrDefault;core_defaults._set('global',{legend:{display:!0,position:'top',align:'center',fullWidth:!0,reverse:!1,weight:1000,onClick:function(e,legendItem){var index=legendItem.datasetIndex;var ci=this.chart;var meta=ci.getDatasetMeta(index);meta.hidden=meta.hidden===null?!ci.data.datasets[index].hidden:null;ci.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(chart){var datasets=chart.data.datasets;var options=chart.options.legend||{};var usePointStyle=options.labels&&options.labels.usePointStyle;return chart._getSortedDatasetMetas().map(function(meta){var style=meta.controller.getStyle(usePointStyle?0:undefined);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,hidden:!chart.isDatasetVisible(meta.index),lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:style.borderWidth,strokeStyle:style.borderColor,pointStyle:style.pointStyle,rotation:style.rotation,datasetIndex:meta.index}},this)}}},legendCallback:function(chart){var list=document.createElement('ul');var datasets=chart.data.datasets;var i,ilen,listItem,listItemSpan;list.setAttribute('class',chart.id+'-legend');for(i=0,ilen=datasets.length;i<ilen;i++){listItem=list.appendChild(document.createElement('li'));listItemSpan=listItem.appendChild(document.createElement('span'));listItemSpan.style.backgroundColor=datasets[i].backgroundColor;if(datasets[i].label){listItem.appendChild(document.createTextNode(datasets[i].label))}}
return list.outerHTML}});function getBoxWidth(labelOpts,fontSize){return labelOpts.usePointStyle&&labelOpts.boxWidth>fontSize?fontSize:labelOpts.boxWidth}
var Legend=core_element.extend({initialize:function(config){var me=this;helpers$1.extend(me,config);me.legendHitBoxes=[];me._hoveredItem=null;me.doughnutMode=!1},beforeUpdate:noop$1,update:function(maxWidth,maxHeight,margins){var me=this;me.beforeUpdate();me.maxWidth=maxWidth;me.maxHeight=maxHeight;me.margins=margins;me.beforeSetDimensions();me.setDimensions();me.afterSetDimensions();me.beforeBuildLabels();me.buildLabels();me.afterBuildLabels();me.beforeFit();me.fit();me.afterFit();me.afterUpdate();return me.minSize},afterUpdate:noop$1,beforeSetDimensions:noop$1,setDimensions:function(){var me=this;if(me.isHorizontal()){me.width=me.maxWidth;me.left=0;me.right=me.width}else{me.height=me.maxHeight;me.top=0;me.bottom=me.height}
me.paddingLeft=0;me.paddingTop=0;me.paddingRight=0;me.paddingBottom=0;me.minSize={width:0,height:0}},afterSetDimensions:noop$1,beforeBuildLabels:noop$1,buildLabels:function(){var me=this;var labelOpts=me.options.labels||{};var legendItems=helpers$1.callback(labelOpts.generateLabels,[me.chart],me)||[];if(labelOpts.filter){legendItems=legendItems.filter(function(item){return labelOpts.filter(item,me.chart.data)})}
if(me.options.reverse){legendItems.reverse()}
me.legendItems=legendItems},afterBuildLabels:noop$1,beforeFit:noop$1,fit:function(){var me=this;var opts=me.options;var labelOpts=opts.labels;var display=opts.display;var ctx=me.ctx;var labelFont=helpers$1.options._parseFont(labelOpts);var fontSize=labelFont.size;var hitboxes=me.legendHitBoxes=[];var minSize=me.minSize;var isHorizontal=me.isHorizontal();if(isHorizontal){minSize.width=me.maxWidth;minSize.height=display?10:0}else{minSize.width=display?10:0;minSize.height=me.maxHeight}
if(!display){me.width=minSize.width=me.height=minSize.height=0;return}
ctx.font=labelFont.string;if(isHorizontal){var lineWidths=me.lineWidths=[0];var totalHeight=0;ctx.textAlign='left';ctx.textBaseline='middle';helpers$1.each(me.legendItems,function(legendItem,i){var boxWidth=getBoxWidth(labelOpts,fontSize);var width=boxWidth+(fontSize/2)+ctx.measureText(legendItem.text).width;if(i===0||lineWidths[lineWidths.length-1]+width+2*labelOpts.padding>minSize.width){totalHeight+=fontSize+labelOpts.padding;lineWidths[lineWidths.length-(i>0?0:1)]=0}
hitboxes[i]={left:0,top:0,width:width,height:fontSize};lineWidths[lineWidths.length-1]+=width+labelOpts.padding});minSize.height+=totalHeight}else{var vPadding=labelOpts.padding;var columnWidths=me.columnWidths=[];var columnHeights=me.columnHeights=[];var totalWidth=labelOpts.padding;var currentColWidth=0;var currentColHeight=0;helpers$1.each(me.legendItems,function(legendItem,i){var boxWidth=getBoxWidth(labelOpts,fontSize);var itemWidth=boxWidth+(fontSize/2)+ctx.measureText(legendItem.text).width;if(i>0&&currentColHeight+fontSize+2*vPadding>minSize.height){totalWidth+=currentColWidth+labelOpts.padding;columnWidths.push(currentColWidth);columnHeights.push(currentColHeight);currentColWidth=0;currentColHeight=0}
currentColWidth=Math.max(currentColWidth,itemWidth);currentColHeight+=fontSize+vPadding;hitboxes[i]={left:0,top:0,width:itemWidth,height:fontSize}});totalWidth+=currentColWidth;columnWidths.push(currentColWidth);columnHeights.push(currentColHeight);minSize.width+=totalWidth}
me.width=minSize.width;me.height=minSize.height},afterFit:noop$1,isHorizontal:function(){return this.options.position==='top'||this.options.position==='bottom'},draw:function(){var me=this;var opts=me.options;var labelOpts=opts.labels;var globalDefaults=core_defaults.global;var defaultColor=globalDefaults.defaultColor;var lineDefault=globalDefaults.elements.line;var legendHeight=me.height;var columnHeights=me.columnHeights;var legendWidth=me.width;var lineWidths=me.lineWidths;if(!opts.display){return}
var rtlHelper=getRtlHelper$1(opts.rtl,me.left,me.minSize.width);var ctx=me.ctx;var fontColor=valueOrDefault$e(labelOpts.fontColor,globalDefaults.defaultFontColor);var labelFont=helpers$1.options._parseFont(labelOpts);var fontSize=labelFont.size;var cursor;ctx.textAlign=rtlHelper.textAlign('left');ctx.textBaseline='middle';ctx.lineWidth=0.5;ctx.strokeStyle=fontColor;ctx.fillStyle=fontColor;ctx.font=labelFont.string;var boxWidth=getBoxWidth(labelOpts,fontSize);var hitboxes=me.legendHitBoxes;var drawLegendBox=function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0){return}
ctx.save();var lineWidth=valueOrDefault$e(legendItem.lineWidth,lineDefault.borderWidth);ctx.fillStyle=valueOrDefault$e(legendItem.fillStyle,defaultColor);ctx.lineCap=valueOrDefault$e(legendItem.lineCap,lineDefault.borderCapStyle);ctx.lineDashOffset=valueOrDefault$e(legendItem.lineDashOffset,lineDefault.borderDashOffset);ctx.lineJoin=valueOrDefault$e(legendItem.lineJoin,lineDefault.borderJoinStyle);ctx.lineWidth=lineWidth;ctx.strokeStyle=valueOrDefault$e(legendItem.strokeStyle,defaultColor);if(ctx.setLineDash){ctx.setLineDash(valueOrDefault$e(legendItem.lineDash,lineDefault.borderDash))}
if(labelOpts&&labelOpts.usePointStyle){var radius=boxWidth*Math.SQRT2/2;var centerX=rtlHelper.xPlus(x,boxWidth/2);var centerY=y+fontSize/2;helpers$1.canvas.drawPoint(ctx,legendItem.pointStyle,radius,centerX,centerY,legendItem.rotation)}else{ctx.fillRect(rtlHelper.leftForLtr(x,boxWidth),y,boxWidth,fontSize);if(lineWidth!==0){ctx.strokeRect(rtlHelper.leftForLtr(x,boxWidth),y,boxWidth,fontSize)}}
ctx.restore()};var fillText=function(x,y,legendItem,textWidth){var halfFontSize=fontSize/2;var xLeft=rtlHelper.xPlus(x,boxWidth+halfFontSize);var yMiddle=y+halfFontSize;ctx.fillText(legendItem.text,xLeft,yMiddle);if(legendItem.hidden){ctx.beginPath();ctx.lineWidth=2;ctx.moveTo(xLeft,yMiddle);ctx.lineTo(rtlHelper.xPlus(xLeft,textWidth),yMiddle);ctx.stroke()}};var alignmentOffset=function(dimension,blockSize){switch(opts.align){case 'start':return labelOpts.padding;case 'end':return dimension-blockSize;default:return(dimension-blockSize+labelOpts.padding)/2}};var isHorizontal=me.isHorizontal();if(isHorizontal){cursor={x:me.left+alignmentOffset(legendWidth,lineWidths[0]),y:me.top+labelOpts.padding,line:0}}else{cursor={x:me.left+labelOpts.padding,y:me.top+alignmentOffset(legendHeight,columnHeights[0]),line:0}}
helpers$1.rtl.overrideTextDirection(me.ctx,opts.textDirection);var itemHeight=fontSize+labelOpts.padding;helpers$1.each(me.legendItems,function(legendItem,i){var textWidth=ctx.measureText(legendItem.text).width;var width=boxWidth+(fontSize/2)+textWidth;var x=cursor.x;var y=cursor.y;rtlHelper.setWidth(me.minSize.width);if(isHorizontal){if(i>0&&x+width+labelOpts.padding>me.left+me.minSize.width){y=cursor.y+=itemHeight;cursor.line++;x=cursor.x=me.left+alignmentOffset(legendWidth,lineWidths[cursor.line])}}else if(i>0&&y+itemHeight>me.top+me.minSize.height){x=cursor.x=x+me.columnWidths[cursor.line]+labelOpts.padding;cursor.line++;y=cursor.y=me.top+alignmentOffset(legendHeight,columnHeights[cursor.line])}
var realX=rtlHelper.x(x);drawLegendBox(realX,y,legendItem);hitboxes[i].left=rtlHelper.leftForLtr(realX,hitboxes[i].width);hitboxes[i].top=y;fillText(realX,y,legendItem,textWidth);if(isHorizontal){cursor.x+=width+labelOpts.padding}else{cursor.y+=itemHeight}});helpers$1.rtl.restoreTextDirection(me.ctx,opts.textDirection)},_getLegendItemAt:function(x,y){var me=this;var i,hitBox,lh;if(x>=me.left&&x<=me.right&&y>=me.top&&y<=me.bottom){lh=me.legendHitBoxes;for(i=0;i<lh.length;++i){hitBox=lh[i];if(x>=hitBox.left&&x<=hitBox.left+hitBox.width&&y>=hitBox.top&&y<=hitBox.top+hitBox.height){return me.legendItems[i]}}}
return null},handleEvent:function(e){var me=this;var opts=me.options;var type=e.type==='mouseup'?'click':e.type;var hoveredItem;if(type==='mousemove'){if(!opts.onHover&&!opts.onLeave){return}}else if(type==='click'){if(!opts.onClick){return}}else{return}
hoveredItem=me._getLegendItemAt(e.x,e.y);if(type==='click'){if(hoveredItem&&opts.onClick){opts.onClick.call(me,e.native,hoveredItem)}}else{if(opts.onLeave&&hoveredItem!==me._hoveredItem){if(me._hoveredItem){opts.onLeave.call(me,e.native,me._hoveredItem)}
me._hoveredItem=hoveredItem}
if(opts.onHover&&hoveredItem){opts.onHover.call(me,e.native,hoveredItem)}}}});function createNewLegendAndAttach(chart,legendOpts){var legend=new Legend({ctx:chart.ctx,options:legendOpts,chart:chart});core_layouts.configure(chart,legend,legendOpts);core_layouts.addBox(chart,legend);chart.legend=legend}
var plugin_legend={id:'legend',_element:Legend,beforeInit:function(chart){var legendOpts=chart.options.legend;if(legendOpts){createNewLegendAndAttach(chart,legendOpts)}},beforeUpdate:function(chart){var legendOpts=chart.options.legend;var legend=chart.legend;if(legendOpts){helpers$1.mergeIf(legendOpts,core_defaults.global.legend);if(legend){core_layouts.configure(chart,legend,legendOpts);legend.options=legendOpts}else{createNewLegendAndAttach(chart,legendOpts)}}else if(legend){core_layouts.removeBox(chart,legend);delete chart.legend}},afterEvent:function(chart,e){var legend=chart.legend;if(legend){legend.handleEvent(e)}}};var noop$2=helpers$1.noop;core_defaults._set('global',{title:{display:!1,fontStyle:'bold',fullWidth:!0,padding:10,position:'top',text:'',weight:2000}});var Title=core_element.extend({initialize:function(config){var me=this;helpers$1.extend(me,config);me.legendHitBoxes=[]},beforeUpdate:noop$2,update:function(maxWidth,maxHeight,margins){var me=this;me.beforeUpdate();me.maxWidth=maxWidth;me.maxHeight=maxHeight;me.margins=margins;me.beforeSetDimensions();me.setDimensions();me.afterSetDimensions();me.beforeBuildLabels();me.buildLabels();me.afterBuildLabels();me.beforeFit();me.fit();me.afterFit();me.afterUpdate();return me.minSize},afterUpdate:noop$2,beforeSetDimensions:noop$2,setDimensions:function(){var me=this;if(me.isHorizontal()){me.width=me.maxWidth;me.left=0;me.right=me.width}else{me.height=me.maxHeight;me.top=0;me.bottom=me.height}
me.paddingLeft=0;me.paddingTop=0;me.paddingRight=0;me.paddingBottom=0;me.minSize={width:0,height:0}},afterSetDimensions:noop$2,beforeBuildLabels:noop$2,buildLabels:noop$2,afterBuildLabels:noop$2,beforeFit:noop$2,fit:function(){var me=this;var opts=me.options;var minSize=me.minSize={};var isHorizontal=me.isHorizontal();var lineCount,textSize;if(!opts.display){me.width=minSize.width=me.height=minSize.height=0;return}
lineCount=helpers$1.isArray(opts.text)?opts.text.length:1;textSize=lineCount*helpers$1.options._parseFont(opts).lineHeight+opts.padding*2;me.width=minSize.width=isHorizontal?me.maxWidth:textSize;me.height=minSize.height=isHorizontal?textSize:me.maxHeight},afterFit:noop$2,isHorizontal:function(){var pos=this.options.position;return pos==='top'||pos==='bottom'},draw:function(){var me=this;var ctx=me.ctx;var opts=me.options;if(!opts.display){return}
var fontOpts=helpers$1.options._parseFont(opts);var lineHeight=fontOpts.lineHeight;var offset=lineHeight/2+opts.padding;var rotation=0;var top=me.top;var left=me.left;var bottom=me.bottom;var right=me.right;var maxWidth,titleX,titleY;ctx.fillStyle=helpers$1.valueOrDefault(opts.fontColor,core_defaults.global.defaultFontColor);ctx.font=fontOpts.string;if(me.isHorizontal()){titleX=left+((right-left)/2);titleY=top+offset;maxWidth=right-left}else{titleX=opts.position==='left'?left+offset:right-offset;titleY=top+((bottom-top)/2);maxWidth=bottom-top;rotation=Math.PI*(opts.position==='left'?-0.5:0.5)}
ctx.save();ctx.translate(titleX,titleY);ctx.rotate(rotation);ctx.textAlign='center';ctx.textBaseline='middle';var text=opts.text;if(helpers$1.isArray(text)){var y=0;for(var i=0;i<text.length;++i){ctx.fillText(text[i],0,y,maxWidth);y+=lineHeight}}else{ctx.fillText(text,0,0,maxWidth)}
ctx.restore()}});function createNewTitleBlockAndAttach(chart,titleOpts){var title=new Title({ctx:chart.ctx,options:titleOpts,chart:chart});core_layouts.configure(chart,title,titleOpts);core_layouts.addBox(chart,title);chart.titleBlock=title}
var plugin_title={id:'title',_element:Title,beforeInit:function(chart){var titleOpts=chart.options.title;if(titleOpts){createNewTitleBlockAndAttach(chart,titleOpts)}},beforeUpdate:function(chart){var titleOpts=chart.options.title;var titleBlock=chart.titleBlock;if(titleOpts){helpers$1.mergeIf(titleOpts,core_defaults.global.title);if(titleBlock){core_layouts.configure(chart,titleBlock,titleOpts);titleBlock.options=titleOpts}else{createNewTitleBlockAndAttach(chart,titleOpts)}}else if(titleBlock){core_layouts.removeBox(chart,titleBlock);delete chart.titleBlock}}};var plugins={};var filler=plugin_filler;var legend=plugin_legend;var title=plugin_title;plugins.filler=filler;plugins.legend=legend;plugins.title=title;core_controller.helpers=helpers$1;core_helpers();core_controller._adapters=core_adapters;core_controller.Animation=core_animation;core_controller.animationService=core_animations;core_controller.controllers=controllers;core_controller.DatasetController=core_datasetController;core_controller.defaults=core_defaults;core_controller.Element=core_element;core_controller.elements=elements;core_controller.Interaction=core_interaction;core_controller.layouts=core_layouts;core_controller.platform=platform;core_controller.plugins=core_plugins;core_controller.Scale=core_scale;core_controller.scaleService=core_scaleService;core_controller.Ticks=core_ticks;core_controller.Tooltip=core_tooltip;core_controller.helpers.each(scales,function(scale,type){core_controller.scaleService.registerScaleType(type,scale,scale._defaults)});for(var k in plugins){if(plugins.hasOwnProperty(k)){core_controller.plugins.register(plugins[k])}}
core_controller.platform.initialize();var src=core_controller;if(typeof window!=='undefined'){window.Chart=core_controller}
core_controller.Chart=core_controller;core_controller.Legend=plugins.legend._element;core_controller.Title=plugins.title._element;core_controller.pluginService=core_controller.plugins;core_controller.PluginBase=core_controller.Element.extend({});core_controller.canvasHelpers=core_controller.helpers.canvas;core_controller.layoutService=core_controller.layouts;core_controller.LinearScaleBase=scale_linearbase;core_controller.helpers.each(['Bar','Bubble','Doughnut','Line','PolarArea','Radar','Scatter'],function(klass){core_controller[klass]=function(ctx,cfg){return new core_controller(ctx,core_controller.helpers.merge(cfg||{},{type:klass.charAt(0).toLowerCase()+klass.slice(1)}))}});return src})));(function(){var $,AbstractChosen,Chosen,SelectParser,bind=function(fn,me){return function(){return fn.apply(me,arguments)}},extend=function(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child},hasProp={}.hasOwnProperty;SelectParser=(function(){function SelectParser(){this.options_index=0;this.parsed=[]}
SelectParser.prototype.add_node=function(child){if(child.nodeName.toUpperCase()==="OPTGROUP"){return this.add_group(child)}else{return this.add_option(child)}};SelectParser.prototype.add_group=function(group){var group_position,i,len,option,ref,results1;group_position=this.parsed.length;this.parsed.push({array_index:group_position,group:!0,label:group.label,title:group.title?group.title:void 0,children:0,disabled:group.disabled,classes:group.className});ref=group.childNodes;results1=[];for(i=0,len=ref.length;i<len;i++){option=ref[i];results1.push(this.add_option(option,group_position,group.disabled))}
return results1};SelectParser.prototype.add_option=function(option,group_position,group_disabled){if(option.nodeName.toUpperCase()==="OPTION"){if(option.text!==""){if(group_position!=null){this.parsed[group_position].children+=1}
this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML,title:option.title?option.title:void 0,selected:option.selected,disabled:group_disabled===!0?group_disabled:option.disabled,group_array_index:group_position,group_label:group_position!=null?this.parsed[group_position].label:null,classes:option.className,style:option.style.cssText})}else{this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0})}
return this.options_index+=1}};return SelectParser})();SelectParser.select_to_array=function(select){var child,i,len,parser,ref;parser=new SelectParser();ref=select.childNodes;for(i=0,len=ref.length;i<len;i++){child=ref[i];parser.add_node(child)}
return parser.parsed};AbstractChosen=(function(){function AbstractChosen(form_field,options1){this.form_field=form_field;this.options=options1!=null?options1:{};this.label_click_handler=bind(this.label_click_handler,this);if(!AbstractChosen.browser_is_supported()){return}
this.is_multiple=this.form_field.multiple;this.set_default_text();this.set_default_values();this.setup();this.set_up_html();this.register_observers();this.on_ready()}
AbstractChosen.prototype.set_default_values=function(){this.click_test_action=(function(_this){return function(evt){return _this.test_active_click(evt)}})(this);this.activate_action=(function(_this){return function(evt){return _this.activate_field(evt)}})(this);this.active_field=!1;this.mouse_on_container=!1;this.results_showing=!1;this.result_highlighted=null;this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className);this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1;this.disable_search_threshold=this.options.disable_search_threshold||0;this.disable_search=this.options.disable_search||!1;this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:!0;this.group_search=this.options.group_search!=null?this.options.group_search:!0;this.search_contains=this.options.search_contains||!1;this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:!0;this.max_selected_options=this.options.max_selected_options||Infinity;this.inherit_select_classes=this.options.inherit_select_classes||!1;this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:!0;this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:!0;this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1;this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY;this.case_sensitive_search=this.options.case_sensitive_search||!1;return this.hide_results_on_select=this.options.hide_results_on_select!=null?this.options.hide_results_on_select:!0};AbstractChosen.prototype.set_default_text=function(){if(this.form_field.getAttribute("data-placeholder")){this.default_text=this.form_field.getAttribute("data-placeholder")}else if(this.is_multiple){this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text}else{this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text}
this.default_text=this.escape_html(this.default_text);return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text};AbstractChosen.prototype.choice_label=function(item){if(this.include_group_label_in_selected&&(item.group_label!=null)){return"<b class='group-name'>"+(this.escape_html(item.group_label))+"</b>"+item.html}else{return item.html}};AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0};AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1};AbstractChosen.prototype.input_focus=function(evt){if(this.is_multiple){if(!this.active_field){return setTimeout(((function(_this){return function(){return _this.container_mousedown()}})(this)),50)}}else{if(!this.active_field){return this.activate_field()}}};AbstractChosen.prototype.input_blur=function(evt){if(!this.mouse_on_container){this.active_field=!1;return setTimeout(((function(_this){return function(){return _this.blur_test()}})(this)),100)}};AbstractChosen.prototype.label_click_handler=function(evt){if(this.is_multiple){return this.container_mousedown(evt)}else{return this.activate_field()}};AbstractChosen.prototype.results_option_build=function(options){var content,data,data_content,i,len,ref,shown_results;content='';shown_results=0;ref=this.results_data;for(i=0,len=ref.length;i<len;i++){data=ref[i];data_content='';if(data.group){data_content=this.result_add_group(data)}else{data_content=this.result_add_option(data)}
if(data_content!==''){shown_results++;content+=data_content}
if(options!=null?options.first:void 0){if(data.selected&&this.is_multiple){this.choice_build(data)}else if(data.selected&&!this.is_multiple){this.single_set_selected_text(this.choice_label(data))}}
if(shown_results>=this.max_shown_results){break}}
return content};AbstractChosen.prototype.result_add_option=function(option){var classes,option_el;if(!option.search_match){return''}
if(!this.include_option_in_results(option)){return''}
classes=[];if(!option.disabled&&!(option.selected&&this.is_multiple)){classes.push("active-result")}
if(option.disabled&&!(option.selected&&this.is_multiple)){classes.push("disabled-result")}
if(option.selected){classes.push("result-selected")}
if(option.group_array_index!=null){classes.push("group-option")}
if(option.classes!==""){classes.push(option.classes)}
option_el=document.createElement("li");option_el.className=classes.join(" ");if(option.style){option_el.style.cssText=option.style}
option_el.setAttribute("data-option-array-index",option.array_index);option_el.innerHTML=option.highlighted_html||option.html;if(option.title){option_el.title=option.title}
return this.outerHTML(option_el)};AbstractChosen.prototype.result_add_group=function(group){var classes,group_el;if(!(group.search_match||group.group_match)){return''}
if(!(group.active_options>0)){return''}
classes=[];classes.push("group-result");if(group.classes){classes.push(group.classes)}
group_el=document.createElement("li");group_el.className=classes.join(" ");group_el.innerHTML=group.highlighted_html||this.escape_html(group.label);if(group.title){group_el.title=group.title}
return this.outerHTML(group_el)};AbstractChosen.prototype.results_update_field=function(){this.set_default_text();if(!this.is_multiple){this.results_reset_cleanup()}
this.result_clear_highlight();this.results_build();if(this.results_showing){return this.winnow_results()}};AbstractChosen.prototype.reset_single_select_options=function(){var i,len,ref,result,results1;ref=this.results_data;results1=[];for(i=0,len=ref.length;i<len;i++){result=ref[i];if(result.selected){results1.push(result.selected=!1)}else{results1.push(void 0)}}
return results1};AbstractChosen.prototype.results_toggle=function(){if(this.results_showing){return this.results_hide()}else{return this.results_show()}};AbstractChosen.prototype.results_search=function(evt){if(this.results_showing){return this.winnow_results()}else{return this.results_show()}};AbstractChosen.prototype.winnow_results=function(options){var escapedQuery,fix,i,len,option,prefix,query,ref,regex,results,results_group,search_match,startpos,suffix,text;this.no_results_clear();results=0;query=this.get_search_text();escapedQuery=query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");regex=this.get_search_regex(escapedQuery);ref=this.results_data;for(i=0,len=ref.length;i<len;i++){option=ref[i];option.search_match=!1;results_group=null;search_match=null;option.highlighted_html='';if(this.include_option_in_results(option)){if(option.group){option.group_match=!1;option.active_options=0}
if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){results_group=this.results_data[option.group_array_index];if(results_group.active_options===0&&results_group.search_match){results+=1}
results_group.active_options+=1}
text=option.group?option.label:option.text;if(!(option.group&&!this.group_search)){search_match=this.search_string_match(text,regex);option.search_match=search_match!=null;if(option.search_match&&!option.group){results+=1}
if(option.search_match){if(query.length){startpos=search_match.index;prefix=text.slice(0,startpos);fix=text.slice(startpos,startpos+query.length);suffix=text.slice(startpos+query.length);option.highlighted_html=(this.escape_html(prefix))+"<em>"+(this.escape_html(fix))+"</em>"+(this.escape_html(suffix))}
if(results_group!=null){results_group.group_match=!0}}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){option.search_match=!0}}}}
this.result_clear_highlight();var resultsCount=this.results_data.length,selectedCount=0;for(_i=0,_len=this.results_data.length;_i<_len;_i++){if(!this.results_data[_i].group&&this.results_data[_i].selected){selectedCount++}}
if((results<1||(resultsCount>0&&resultsCount===selectedCount&&$(this.form_field).data('allow-add')))&&query.length){this.update_results_content("");return this.no_results(query)}else{this.update_results_content(this.results_option_build());return this.winnow_results_set_highlight()}};AbstractChosen.prototype.get_search_regex=function(escaped_search_string){var regex_flag,regex_string;regex_string=this.search_contains?escaped_search_string:"(^|\\s|\\b)"+escaped_search_string+"[^\\s]*";if(!(this.enable_split_word_search||this.search_contains)){regex_string="^"+regex_string}
regex_flag=this.case_sensitive_search?"":"i";return new RegExp(regex_string,regex_flag)};AbstractChosen.prototype.search_string_match=function(search_string,regex){var match;match=regex.exec(search_string);if(!this.search_contains&&(match!=null?match[1]:void 0)){match.index+=1}
return match};AbstractChosen.prototype.choices_count=function(){var i,len,option,ref;if(this.selected_option_count!=null){return this.selected_option_count}
this.selected_option_count=0;ref=this.form_field.options;for(i=0,len=ref.length;i<len;i++){option=ref[i];if(option.selected){this.selected_option_count+=1}}
return this.selected_option_count};AbstractChosen.prototype.choices_click=function(evt){evt.preventDefault();this.activate_field();if(!(this.results_showing||this.is_disabled)){return this.results_show()}};AbstractChosen.prototype.keydown_checker=function(evt){var ref,stroke;stroke=(ref=evt.which)!=null?ref:evt.keyCode;this.search_field_scale();if(stroke!==8&&this.pending_backstroke){this.clear_backstroke()}
switch(stroke){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:if(this.results_showing&&!this.is_multiple){this.result_select(evt)}
this.mouse_on_container=!1;break;case 13:if(this.results_showing){evt.preventDefault();if(!$(this.form_field).data('allow-add')||!this.is_multiple||this.result_highlight){return this.result_select(evt)}
var newTag=$(evt.target).val();if($(this.form_field).find('option').filter(function(){return $(this).text()===newTag}).length===0){$(this.form_field).append($('<option></option>').text(newTag));$(this.form_field).trigger('chosen:updated');this.result_highlight=this.search_results.find('li.active-result').last();return this.result_select(evt)}}
break;case 27:if(this.results_showing){evt.preventDefault()}
break;case 32:if(this.disable_search){evt.preventDefault()}
break;case 38:evt.preventDefault();this.keyup_arrow();break;case 40:evt.preventDefault();this.keydown_arrow();break}};AbstractChosen.prototype.keyup_checker=function(evt){var ref,stroke;stroke=(ref=evt.which)!=null?ref:evt.keyCode;this.search_field_scale();switch(stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0){this.keydown_backstroke()}else if(!this.pending_backstroke){this.result_clear_highlight();this.results_search()}
break;case 13:evt.preventDefault();if(this.results_showing){this.result_select(evt)}
break;case 27:if(this.results_showing){this.results_hide()}
break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search();break}};AbstractChosen.prototype.clipboard_event_checker=function(evt){if(this.is_disabled){return}
return setTimeout(((function(_this){return function(){return _this.results_search()}})(this)),50)};AbstractChosen.prototype.container_width=function(){if(this.options.width!=null){return this.options.width}else{return this.form_field.offsetWidth+"px"}};AbstractChosen.prototype.include_option_in_results=function(option){if(this.is_multiple&&(!this.display_selected_options&&option.selected)){return!1}
if(!this.display_disabled_options&&option.disabled){return!1}
if(option.empty){return!1}
return!0};AbstractChosen.prototype.search_results_touchstart=function(evt){this.touch_started=!0;return this.search_results_mouseover(evt)};AbstractChosen.prototype.search_results_touchmove=function(evt){this.touch_started=!1;return this.search_results_mouseout(evt)};AbstractChosen.prototype.search_results_touchend=function(evt){if(this.touch_started){return this.search_results_mouseup(evt)}};AbstractChosen.prototype.outerHTML=function(element){var tmp;if(element.outerHTML){return element.outerHTML}
tmp=document.createElement("div");tmp.appendChild(element);return tmp.innerHTML};AbstractChosen.prototype.get_single_html=function(){return"<a class=\"chosen-single chosen-default\">\n  <span>"+this.default_text+"</span>\n  <div><b></b></div>\n</a>\n<div class=\"chosen-drop\">\n  <div class=\"chosen-search\">\n    <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" />\n  </div>\n  <ul class=\"chosen-results\"></ul>\n</div>"};AbstractChosen.prototype.get_multi_html=function(){return"<ul class=\"chosen-choices\">\n  <li class=\"search-field\">\n    <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" value=\""+this.default_text+"\" />\n  </li>\n</ul>\n<div class=\"chosen-drop\">\n  <ul class=\"chosen-results\"></ul>\n</div>"};AbstractChosen.prototype.get_no_results_html=function(terms){return"<li class=\"no-results\">\n  "+this.results_none_found+" <span>"+(this.escape_html(terms))+"</span>\n</li>"};AbstractChosen.browser_is_supported=function(){if("Microsoft Internet Explorer"===window.navigator.appName){return document.documentMode>=8}
if(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent)){return!1}
return!0};AbstractChosen.default_multiple_text="Select Some Options";AbstractChosen.default_single_text="Select an Option";AbstractChosen.default_no_result_text="No results match";return AbstractChosen})();$=jQuery;$.fn.extend({chosen:function(options){if(!AbstractChosen.browser_is_supported()){return this}
return this.each(function(input_field){var $this,chosen;$this=$(this);chosen=$this.data('chosen');if(options==='destroy'){if(chosen instanceof Chosen){chosen.destroy()}
return}
if(!(chosen instanceof Chosen)){$this.data('chosen',new Chosen(this,options))}})}});Chosen=(function(superClass){extend(Chosen,superClass);function Chosen(){return Chosen.__super__.constructor.apply(this,arguments)}
Chosen.prototype.setup=function(){this.form_field_jq=$(this.form_field);return this.current_selectedIndex=this.form_field.selectedIndex};Chosen.prototype.set_up_html=function(){var container_classes,container_props;container_classes=["chosen-container"];container_classes.push("chosen-container-"+(this.is_multiple?"multi":"single"));if(this.inherit_select_classes&&this.form_field.className){container_classes.push(this.form_field.className)}
if(this.is_rtl){container_classes.push("chosen-rtl")}
container_props={'class':container_classes.join(' '),'title':this.form_field.title};if(this.form_field.id.length){container_props.id=this.form_field.id.replace(/[^\w]/g,'_')+"_chosen"}
this.container=$("<div />",container_props);this.container.width(this.container_width());if(this.is_multiple){this.container.html(this.get_multi_html())}else{this.container.html(this.get_single_html())}
this.form_field_jq.hide().after(this.container);this.dropdown=this.container.find('div.chosen-drop').first();this.search_field=this.container.find('input').first();this.search_results=this.container.find('ul.chosen-results').first();this.search_field_scale();this.search_no_results=this.container.find('li.no-results').first();if(this.is_multiple){this.search_choices=this.container.find('ul.chosen-choices').first();this.search_container=this.container.find('li.search-field').first()}else{this.search_container=this.container.find('div.chosen-search').first();this.selected_item=this.container.find('.chosen-single').first()}
this.results_build();this.set_tab_index();return this.set_label_behavior()};Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})};Chosen.prototype.register_observers=function(){this.container.on('touchstart.chosen',(function(_this){return function(evt){_this.container_mousedown(evt)}})(this));this.container.on('touchend.chosen',(function(_this){return function(evt){_this.container_mouseup(evt)}})(this));this.container.on('mousedown.chosen',(function(_this){return function(evt){_this.container_mousedown(evt)}})(this));this.container.on('mouseup.chosen',(function(_this){return function(evt){_this.container_mouseup(evt)}})(this));this.container.on('mouseenter.chosen',(function(_this){return function(evt){_this.mouse_enter(evt)}})(this));this.container.on('mouseleave.chosen',(function(_this){return function(evt){_this.mouse_leave(evt)}})(this));this.search_results.on('mouseup.chosen',(function(_this){return function(evt){_this.search_results_mouseup(evt)}})(this));this.search_results.on('mouseover.chosen',(function(_this){return function(evt){_this.search_results_mouseover(evt)}})(this));this.search_results.on('mouseout.chosen',(function(_this){return function(evt){_this.search_results_mouseout(evt)}})(this));this.search_results.on('mousewheel.chosen DOMMouseScroll.chosen',(function(_this){return function(evt){_this.search_results_mousewheel(evt)}})(this));this.search_results.on('touchstart.chosen',(function(_this){return function(evt){_this.search_results_touchstart(evt)}})(this));this.search_results.on('touchmove.chosen',(function(_this){return function(evt){_this.search_results_touchmove(evt)}})(this));this.search_results.on('touchend.chosen',(function(_this){return function(evt){_this.search_results_touchend(evt)}})(this));this.form_field_jq.on("chosen:updated.chosen",(function(_this){return function(evt){_this.results_update_field(evt)}})(this));this.form_field_jq.on("chosen:activate.chosen",(function(_this){return function(evt){_this.activate_field(evt)}})(this));this.form_field_jq.on("chosen:open.chosen",(function(_this){return function(evt){_this.container_mousedown(evt)}})(this));this.form_field_jq.on("chosen:close.chosen",(function(_this){return function(evt){_this.close_field(evt)}})(this));this.search_field.on('blur.chosen',(function(_this){return function(evt){_this.input_blur(evt)}})(this));this.search_field.on('keyup.chosen',(function(_this){return function(evt){_this.keyup_checker(evt)}})(this));this.search_field.on('keydown.chosen',(function(_this){return function(evt){_this.keydown_checker(evt)}})(this));this.search_field.on('focus.chosen',(function(_this){return function(evt){_this.input_focus(evt)}})(this));this.search_field.on('cut.chosen',(function(_this){return function(evt){_this.clipboard_event_checker(evt)}})(this));this.search_field.on('paste.chosen',(function(_this){return function(evt){_this.clipboard_event_checker(evt)}})(this));if(this.is_multiple){return this.search_choices.on('click.chosen',(function(_this){return function(evt){_this.choices_click(evt)}})(this))}else{return this.container.on('click.chosen',function(evt){evt.preventDefault()})}};Chosen.prototype.destroy=function(){$(this.container[0].ownerDocument).off('click.chosen',this.click_test_action);if(this.form_field_label.length>0){this.form_field_label.off('click.chosen')}
if(this.search_field[0].tabIndex){this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex}
this.container.remove();this.form_field_jq.removeData('chosen');return this.form_field_jq.show()};Chosen.prototype.search_field_disabled=function(){this.is_disabled=this.form_field.disabled||this.form_field_jq.parents('fieldset').is(':disabled');this.container.toggleClass('chosen-disabled',this.is_disabled);this.search_field[0].disabled=this.is_disabled;if(!this.is_multiple){this.selected_item.off('focus.chosen',this.activate_field)}
if(this.is_disabled){return this.close_field()}else if(!this.is_multiple){return this.selected_item.on('focus.chosen',this.activate_field)}};Chosen.prototype.container_mousedown=function(evt){var ref;if(this.is_disabled){return}
if(evt&&((ref=evt.type)==='mousedown'||ref==='touchstart')&&!this.results_showing){evt.preventDefault()}
if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){if(!this.active_field){if(this.is_multiple){this.search_field.val("")}
$(this.container[0].ownerDocument).on('click.chosen',this.click_test_action);this.results_show()}else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){evt.preventDefault();this.results_toggle()}
return this.activate_field()}};Chosen.prototype.container_mouseup=function(evt){if(evt.target.nodeName==="ABBR"&&!this.is_disabled){return this.results_reset(evt)}};Chosen.prototype.search_results_mousewheel=function(evt){var delta;if(evt.originalEvent){delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail}
if(delta!=null){evt.preventDefault();if(evt.type==='DOMMouseScroll'){delta=delta*40}
return this.search_results.scrollTop(delta+this.search_results.scrollTop())}};Chosen.prototype.blur_test=function(evt){if(!this.active_field&&this.container.hasClass("chosen-container-active")){return this.close_field()}};Chosen.prototype.close_field=function(){$(this.container[0].ownerDocument).off("click.chosen",this.click_test_action);this.active_field=!1;this.results_hide();this.container.removeClass("chosen-container-active");this.clear_backstroke();this.show_search_field_default();this.search_field_scale();return this.search_field.blur()};Chosen.prototype.activate_field=function(){if(this.is_disabled){return}
this.container.addClass("chosen-container-active");this.active_field=!0;this.search_field.val(this.search_field.val());return this.search_field.focus()};Chosen.prototype.test_active_click=function(evt){var active_container;active_container=$(evt.target).closest('.chosen-container');if(active_container.length&&this.container[0]===active_container[0]){return this.active_field=!0}else{return this.close_field()}};Chosen.prototype.results_build=function(){this.parsing=!0;this.selected_option_count=null;this.results_data=SelectParser.select_to_array(this.form_field);if(this.is_multiple){this.search_choices.find("li.search-choice").remove()}else{this.single_set_selected_text();if(this.disable_search||this.form_field.options.length<=this.disable_search_threshold){this.search_field[0].readOnly=!0;this.container.addClass("chosen-container-single-nosearch")}else{this.search_field[0].readOnly=!1;this.container.removeClass("chosen-container-single-nosearch")}}
this.update_results_content(this.results_option_build({first:!0}));this.search_field_disabled();this.show_search_field_default();this.search_field_scale();return this.parsing=!1};Chosen.prototype.result_do_highlight=function(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){this.result_clear_highlight();this.result_highlight=el;this.result_highlight.addClass("highlighted");maxHeight=parseInt(this.search_results.css("maxHeight"),10);visible_top=this.search_results.scrollTop();visible_bottom=maxHeight+visible_top;high_top=this.result_highlight.position().top+this.search_results.scrollTop();high_bottom=high_top+this.result_highlight.outerHeight();if(high_bottom>=visible_bottom){return this.search_results.scrollTop((high_bottom-maxHeight)>0?high_bottom-maxHeight:0)}else if(high_top<visible_top){return this.search_results.scrollTop(high_top)}}};Chosen.prototype.result_clear_highlight=function(){if(this.result_highlight){this.result_highlight.removeClass("highlighted")}
return this.result_highlight=null};Chosen.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return!1}
this.container.addClass("chosen-with-drop");this.results_showing=!0;this.search_field.focus();this.search_field.val(this.get_search_field_value());this.winnow_results();return this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this})};Chosen.prototype.update_results_content=function(content){return this.search_results.html(content)};Chosen.prototype.results_hide=function(){if(this.results_showing){this.result_clear_highlight();this.container.removeClass("chosen-with-drop");this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})}
return this.results_showing=!1};Chosen.prototype.set_tab_index=function(el){var ti;if(this.form_field.tabIndex){ti=this.form_field.tabIndex;this.form_field.tabIndex=-1;return this.search_field[0].tabIndex=ti}};Chosen.prototype.set_label_behavior=function(){this.form_field_label=this.form_field_jq.parents("label");if(!this.form_field_label.length&&this.form_field.id.length){this.form_field_label=$("label[for='"+this.form_field.id+"']")}
if(this.form_field_label.length>0){return this.form_field_label.on('click.chosen',this.label_click_handler)}};Chosen.prototype.show_search_field_default=function(){if(this.is_multiple&&this.choices_count()<1&&!this.active_field){this.search_field.val(this.default_text);return this.search_field.addClass("default")}else{this.search_field.val("");return this.search_field.removeClass("default")}};Chosen.prototype.search_results_mouseup=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target.length){this.result_highlight=target;this.result_select(evt);return this.search_field.focus()}};Chosen.prototype.search_results_mouseover=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target){return this.result_do_highlight(target)}};Chosen.prototype.search_results_mouseout=function(evt){if($(evt.target).hasClass("active-result")||$(evt.target).parents('.active-result').first()){return this.result_clear_highlight()}};Chosen.prototype.choice_build=function(item){var choice,close_link;choice=$('<li />',{"class":"search-choice"}).html("<span>"+(this.choice_label(item))+"</span>");if(item.disabled){choice.addClass('search-choice-disabled')}else{close_link=$('<a />',{"class":'search-choice-close','data-option-array-index':item.array_index});close_link.on('click.chosen',(function(_this){return function(evt){return _this.choice_destroy_link_click(evt)}})(this));choice.append(close_link)}
return this.search_container.before(choice)};Chosen.prototype.choice_destroy_link_click=function(evt){evt.preventDefault();evt.stopPropagation();if(!this.is_disabled){return this.choice_destroy($(evt.target))}};Chosen.prototype.choice_destroy=function(link){if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){if(this.active_field){this.search_field.focus()}else{this.show_search_field_default()}
if(this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1){this.results_hide()}
link.parents('li').first().remove();return this.search_field_scale()}};Chosen.prototype.results_reset=function(){this.reset_single_select_options();this.form_field.options[0].selected=!0;this.single_set_selected_text();this.show_search_field_default();this.results_reset_cleanup();this.trigger_form_field_change();if(this.active_field){return this.results_hide()}};Chosen.prototype.results_reset_cleanup=function(){this.current_selectedIndex=this.form_field.selectedIndex;return this.selected_item.find("abbr").remove()};Chosen.prototype.result_select=function(evt){var high,item;if(this.result_highlight){high=this.result_highlight;this.result_clear_highlight();if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return!1}
if(this.is_multiple){high.removeClass("active-result")}else{this.reset_single_select_options()}
high.addClass("result-selected");item=this.results_data[high[0].getAttribute("data-option-array-index")];item.selected=!0;this.form_field.options[item.options_index].selected=!0;this.selected_option_count=null;if(this.is_multiple){this.choice_build(item)}else{this.single_set_selected_text(this.choice_label(item))}
if(this.is_multiple&&(!this.hide_results_on_select||(evt.metaKey||evt.ctrlKey))){if(evt.metaKey||evt.ctrlKey){this.winnow_results({skip_highlight:!0})}else{this.search_field.val("");this.winnow_results()}}else{this.results_hide();this.show_search_field_default()}
if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){this.trigger_form_field_change({selected:this.form_field.options[item.options_index].value})}
this.current_selectedIndex=this.form_field.selectedIndex;evt.preventDefault();return this.search_field_scale()}};Chosen.prototype.single_set_selected_text=function(text){if(text==null){text=this.default_text}
if(text===this.default_text){this.selected_item.addClass("chosen-default")}else{this.single_deselect_control_build();this.selected_item.removeClass("chosen-default")}
return this.selected_item.find("span").html(text)};Chosen.prototype.result_deselect=function(pos){var result_data;result_data=this.results_data[pos];if(!this.form_field.options[result_data.options_index].disabled){result_data.selected=!1;this.form_field.options[result_data.options_index].selected=!1;this.selected_option_count=null;this.result_clear_highlight();if(this.results_showing){this.winnow_results()}
this.trigger_form_field_change({deselected:this.form_field.options[result_data.options_index].value});this.search_field_scale();return!0}else{return!1}};Chosen.prototype.single_deselect_control_build=function(){if(!this.allow_single_deselect){return}
if(!this.selected_item.find("abbr").length){this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>")}
return this.selected_item.addClass("chosen-single-with-deselect")};Chosen.prototype.get_search_field_value=function(){return this.search_field.val()};Chosen.prototype.get_search_text=function(){return $.trim(this.get_search_field_value())};Chosen.prototype.escape_html=function(text){return $('<div/>').text(text).html()};Chosen.prototype.winnow_results_set_highlight=function(){var do_high,selected_results;selected_results=!this.is_multiple?this.search_results.find(".result-selected.active-result"):[];do_high=selected_results.length?selected_results.first():this.search_results.find(".active-result").first();if(do_high!=null){return this.result_do_highlight(do_high)}};Chosen.prototype.no_results=function(terms){var no_results_html;no_results_html=this.get_no_results_html(terms);this.search_results.append(no_results_html);return this.form_field_jq.trigger("chosen:no_results",{chosen:this})};Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()};Chosen.prototype.keydown_arrow=function(){var next_sib;if(this.results_showing&&this.result_highlight){next_sib=this.result_highlight.nextAll("li.active-result").first();if(next_sib){return this.result_do_highlight(next_sib)}}else{return this.results_show()}};Chosen.prototype.keyup_arrow=function(){var prev_sibs;if(!this.results_showing&&!this.is_multiple){return this.results_show()}else if(this.result_highlight){prev_sibs=this.result_highlight.prevAll("li.active-result");if(prev_sibs.length){return this.result_do_highlight(prev_sibs.first())}else{if(this.choices_count()>0){this.results_hide()}
return this.result_clear_highlight()}}};Chosen.prototype.keydown_backstroke=function(){var next_available_destroy;if(this.pending_backstroke){this.choice_destroy(this.pending_backstroke.find("a").first());return this.clear_backstroke()}else{next_available_destroy=this.search_container.siblings("li.search-choice").last();if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){this.pending_backstroke=next_available_destroy;if(this.single_backstroke_delete){return this.keydown_backstroke()}else{return this.pending_backstroke.addClass("search-choice-focus")}}}};Chosen.prototype.clear_backstroke=function(){if(this.pending_backstroke){this.pending_backstroke.removeClass("search-choice-focus")}
return this.pending_backstroke=null};Chosen.prototype.search_field_scale=function(){var div,i,len,style,style_block,styles,width;if(!this.is_multiple){return}
style_block={position:'absolute',left:'-1000px',top:'-1000px',display:'none',whiteSpace:'pre'};styles=['fontSize','fontStyle','fontWeight','fontFamily','lineHeight','textTransform','letterSpacing'];for(i=0,len=styles.length;i<len;i++){style=styles[i];style_block[style]=this.search_field.css(style)}
div=$('<div />').css(style_block);div.text(this.get_search_field_value());$('body').append(div);width=div.width()+25;div.remove();if(this.container.is(':visible')){width=Math.min(this.container.outerWidth()-10,width)}
return this.search_field.width(width)};Chosen.prototype.trigger_form_field_change=function(extra){this.form_field_jq.trigger("input",extra);return this.form_field_jq.trigger("change",extra)};return Chosen})(AbstractChosen)}).call(this);(function(root,factory){if(typeof define==='function'&&define.amd){define(["jquery"],function(a0){return(factory(a0))})}else if(typeof exports==='object'){module.exports=factory(require("jquery"))}else{factory(jQuery)}}(this,function($){var DEFAULT_CALLBACKS,KEY_CODE;KEY_CODE={ESC:27,TAB:9,ENTER:13,CTRL:17,A:65,P:80,N:78,LEFT:37,UP:38,RIGHT:39,DOWN:40,BACKSPACE:8,SPACE:32};DEFAULT_CALLBACKS={beforeSave:function(data){return Controller.arrayToDefaultHash(data)},matcher:function(flag,subtext,should_startWithSpace,acceptSpaceBar){var _a,_y,match,regexp,space;flag=flag.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");if(should_startWithSpace){flag='(?:^|\\s)'+flag}
_a=decodeURI("%C3%80");_y=decodeURI("%C3%BF");space=acceptSpaceBar?"\ ":"";regexp=new RegExp(flag+"([A-Za-z"+_a+"-"+_y+"0-9_"+space+"\'\.\+\-]*)$|"+flag+"([^\\x00-\\xff]*)$",'gi');match=regexp.exec(subtext);if(match){return match[2]||match[1]}else{return null}},filter:function(query,data,searchKey){var _results,i,item,len;_results=[];for(i=0,len=data.length;i<len;i++){item=data[i];if(~new String(item[searchKey]).toLowerCase().indexOf(query.toLowerCase())){_results.push(item)}}
return _results},remoteFilter:null,sorter:function(query,items,searchKey){var _results,i,item,len;if(!query){return items}
_results=[];for(i=0,len=items.length;i<len;i++){item=items[i];item.atwho_order=new String(item[searchKey]).toLowerCase().indexOf(query.toLowerCase());if(item.atwho_order>-1){_results.push(item)}}
return _results.sort(function(a,b){return a.atwho_order-b.atwho_order})},tplEval:function(tpl,map){var error,error1,template;template=tpl;try{if(typeof tpl!=='string'){template=tpl(map)}
return template.replace(/\$\{([^\}]*)\}/g,function(tag,key,pos){return map[key]})}catch(error1){error=error1;return""}},highlighter:function(li,query){var regexp;if(!query){return li}
regexp=new RegExp(">\\s*([^\<]*?)("+query.replace("+","\\+")+")([^\<]*)\\s*<",'ig');return li.replace(regexp,function(str,$1,$2,$3){return'> '+$1+'<strong>'+$2+'</strong>'+$3+' <'})},beforeInsert:function(value,$li,e){return value},beforeReposition:function(offset){return offset},afterMatchFailed:function(at,el){}};var App;App=(function(){function App(inputor){this.currentFlag=null;this.controllers={};this.aliasMaps={};this.$inputor=$(inputor);this.setupRootElement();this.listen()}
App.prototype.createContainer=function(doc){var ref;if((ref=this.$el)!=null){ref.remove()}
return $(doc.body).append(this.$el=$("<div class='atwho-container'></div>"))};App.prototype.setupRootElement=function(iframe,asRoot){var error,error1;if(asRoot==null){asRoot=!1}
if(iframe){this.window=iframe.contentWindow;this.document=iframe.contentDocument||this.window.document;this.iframe=iframe}else{this.document=this.$inputor[0].ownerDocument;this.window=this.document.defaultView||this.document.parentWindow;try{this.iframe=this.window.frameElement}catch(error1){error=error1;this.iframe=null;if($.fn.atwho.debug){throw new Error("iframe auto-discovery is failed.\nPlease use `setIframe` to set the target iframe manually.\n"+error)}}}
return this.createContainer((this.iframeAsRoot=asRoot)?this.document:document)};App.prototype.controller=function(at){var c,current,currentFlag,ref;if(this.aliasMaps[at]){current=this.controllers[this.aliasMaps[at]]}else{ref=this.controllers;for(currentFlag in ref){c=ref[currentFlag];if(currentFlag===at){current=c;break}}}
if(current){return current}else{return this.controllers[this.currentFlag]}};App.prototype.setContextFor=function(at){this.currentFlag=at;return this};App.prototype.reg=function(flag,setting){var base,controller;controller=(base=this.controllers)[flag]||(base[flag]=this.$inputor.is('[contentEditable]')?new EditableController(this,flag):new TextareaController(this,flag));if(setting.alias){this.aliasMaps[setting.alias]=flag}
controller.init(setting);return this};App.prototype.listen=function(){return this.$inputor.on('compositionstart',(function(_this){return function(e){var ref;if((ref=_this.controller())!=null){ref.view.hide()}
_this.isComposing=!0;return null}})(this)).on('compositionend',(function(_this){return function(e){_this.isComposing=!1;setTimeout(function(e){return _this.dispatch(e)});return null}})(this)).on('keyup.atwhoInner',(function(_this){return function(e){return _this.onKeyup(e)}})(this)).on('keydown.atwhoInner',(function(_this){return function(e){return _this.onKeydown(e)}})(this)).on('blur.atwhoInner',(function(_this){return function(e){var c;if(c=_this.controller()){c.expectedQueryCBId=null;return c.view.hide(e,c.getOpt("displayTimeout"))}}})(this)).on('click.atwhoInner',(function(_this){return function(e){return _this.dispatch(e)}})(this)).on('scroll.atwhoInner',(function(_this){return function(){var lastScrollTop;lastScrollTop=_this.$inputor.scrollTop();return function(e){var currentScrollTop,ref;currentScrollTop=e.target.scrollTop;if(lastScrollTop!==currentScrollTop){if((ref=_this.controller())!=null){ref.view.hide(e)}}
lastScrollTop=currentScrollTop;return!0}}})(this)())};App.prototype.shutdown=function(){var _,c,ref;ref=this.controllers;for(_ in ref){c=ref[_];c.destroy();delete this.controllers[_]}
this.$inputor.off('.atwhoInner');return this.$el.remove()};App.prototype.dispatch=function(e){var _,c,ref,results;if(void 0===e){return}
ref=this.controllers;results=[];for(_ in ref){c=ref[_];results.push(c.lookUp(e))}
return results};App.prototype.onKeyup=function(e){var ref;switch(e.keyCode){case KEY_CODE.ESC:e.preventDefault();if((ref=this.controller())!=null){ref.view.hide()}
break;case KEY_CODE.DOWN:case KEY_CODE.UP:case KEY_CODE.CTRL:case KEY_CODE.ENTER:$.noop();break;case KEY_CODE.P:case KEY_CODE.N:if(!e.ctrlKey){this.dispatch(e)}
break;default:this.dispatch(e)}};App.prototype.onKeydown=function(e){var ref,view;view=(ref=this.controller())!=null?ref.view:void 0;if(!(view&&view.visible())){return}
switch(e.keyCode){case KEY_CODE.ESC:e.preventDefault();view.hide(e);break;case KEY_CODE.UP:e.preventDefault();view.prev();break;case KEY_CODE.DOWN:e.preventDefault();view.next();break;case KEY_CODE.P:if(!e.ctrlKey){return}
e.preventDefault();view.prev();break;case KEY_CODE.N:if(!e.ctrlKey){return}
e.preventDefault();view.next();break;case KEY_CODE.TAB:case KEY_CODE.ENTER:case KEY_CODE.SPACE:if(!view.visible()){return}
if(!this.controller().getOpt('spaceSelectsMatch')&&e.keyCode===KEY_CODE.SPACE){return}
if(!this.controller().getOpt('tabSelectsMatch')&&e.keyCode===KEY_CODE.TAB){return}
if(view.highlighted()){e.preventDefault();view.choose(e)}else{view.hide(e)}
break;default:$.noop()}};return App})();var Controller,slice=[].slice;Controller=(function(){Controller.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date().getTime())};function Controller(app,at1){this.app=app;this.at=at1;this.$inputor=this.app.$inputor;this.id=this.$inputor[0].id||this.uid();this.expectedQueryCBId=null;this.setting=null;this.query=null;this.pos=0;this.range=null;if((this.$el=$("#atwho-ground-"+this.id,this.app.$el)).length===0){this.app.$el.append(this.$el=$("<div id='atwho-ground-"+this.id+"'></div>"))}
this.model=new Model(this);this.view=new View(this)}
Controller.prototype.init=function(setting){this.setting=$.extend({},this.setting||$.fn.atwho["default"],setting);this.view.init();return this.model.reload(this.setting.data)};Controller.prototype.destroy=function(){this.trigger('beforeDestroy');this.model.destroy();this.view.destroy();return this.$el.remove()};Controller.prototype.callDefault=function(){var args,error,error1,funcName;funcName=arguments[0],args=2<=arguments.length?slice.call(arguments,1):[];try{return DEFAULT_CALLBACKS[funcName].apply(this,args)}catch(error1){error=error1;return $.error(error+" Or maybe At.js doesn't have function "+funcName)}};Controller.prototype.trigger=function(name,data){var alias,eventName;if(data==null){data=[]}
data.push(this);alias=this.getOpt('alias');eventName=alias?name+"-"+alias+".atwho":name+".atwho";return this.$inputor.trigger(eventName,data)};Controller.prototype.callbacks=function(funcName){return this.getOpt("callbacks")[funcName]||DEFAULT_CALLBACKS[funcName]};Controller.prototype.getOpt=function(at,default_value){var e,error1;try{return this.setting[at]}catch(error1){e=error1;return null}};Controller.prototype.insertContentFor=function($li){var data,tpl;tpl=this.getOpt('insertTpl');data=$.extend({},$li.data('item-data'),{'atwho-at':this.at});return this.callbacks("tplEval").call(this,tpl,data,"onInsert")};Controller.prototype.renderView=function(data){var searchKey;searchKey=this.getOpt("searchKey");data=this.callbacks("sorter").call(this,this.query.text,data.slice(0,1001),searchKey);return this.view.render(data.slice(0,this.getOpt('limit')))};Controller.arrayToDefaultHash=function(data){var i,item,len,results;if(!$.isArray(data)){return data}
results=[];for(i=0,len=data.length;i<len;i++){item=data[i];if($.isPlainObject(item)){results.push(item)}else{results.push({name:item})}}
return results};Controller.prototype.lookUp=function(e){var query,wait;if(e&&e.type==='click'&&!this.getOpt('lookUpOnClick')){return}
if(this.getOpt('suspendOnComposing')&&this.app.isComposing){return}
query=this.catchQuery(e);if(!query){this.expectedQueryCBId=null;return query}
this.app.setContextFor(this.at);if(wait=this.getOpt('delay')){this._delayLookUp(query,wait)}else{this._lookUp(query)}
return query};Controller.prototype._delayLookUp=function(query,wait){var now,remaining;now=Date.now?Date.now():new Date().getTime();this.previousCallTime||(this.previousCallTime=now);remaining=wait-(now-this.previousCallTime);if((0<remaining&&remaining<wait)){this.previousCallTime=now;this._stopDelayedCall();return this.delayedCallTimeout=setTimeout((function(_this){return function(){_this.previousCallTime=0;_this.delayedCallTimeout=null;return _this._lookUp(query)}})(this),wait)}else{this._stopDelayedCall();if(this.previousCallTime!==now){this.previousCallTime=0}
return this._lookUp(query)}};Controller.prototype._stopDelayedCall=function(){if(this.delayedCallTimeout){clearTimeout(this.delayedCallTimeout);return this.delayedCallTimeout=null}};Controller.prototype._generateQueryCBId=function(){return{}};Controller.prototype._lookUp=function(query){var _callback;_callback=function(queryCBId,data){if(queryCBId!==this.expectedQueryCBId){return}
if(data&&data.length>0){return this.renderView(this.constructor.arrayToDefaultHash(data))}else{return this.view.hide()}};this.expectedQueryCBId=this._generateQueryCBId();return this.model.query(query.text,$.proxy(_callback,this,this.expectedQueryCBId))};return Controller})();var TextareaController,extend=function(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child},hasProp={}.hasOwnProperty;TextareaController=(function(superClass){extend(TextareaController,superClass);function TextareaController(){return TextareaController.__super__.constructor.apply(this,arguments)}
TextareaController.prototype.catchQuery=function(){var caretPos,content,end,isString,query,start,subtext;content=this.$inputor.val();caretPos=this.$inputor.caret('pos',{iframe:this.app.iframe});subtext=content.slice(0,caretPos);query=this.callbacks("matcher").call(this,this.at,subtext,this.getOpt('startWithSpace'),this.getOpt("acceptSpaceBar"));isString=typeof query==='string';if(isString&&query.length<this.getOpt('minLen',0)){return}
if(isString&&query.length<=this.getOpt('maxLen',20)){start=caretPos-query.length;end=start+query.length;this.pos=start;query={'text':query,'headPos':start,'endPos':end};this.trigger("matched",[this.at,query.text])}else{query=null;this.view.hide()}
return this.query=query};TextareaController.prototype.rect=function(){var c,iframeOffset,scaleBottom;if(!(c=this.$inputor.caret('offset',this.pos-1,{iframe:this.app.iframe}))){return}
if(this.app.iframe&&!this.app.iframeAsRoot){iframeOffset=$(this.app.iframe).offset();c.left+=iframeOffset.left;c.top+=iframeOffset.top}
scaleBottom=this.app.document.selection?0:2;return{left:c.left,top:c.top,bottom:c.top+c.height+scaleBottom}};TextareaController.prototype.insert=function(content,$li){var $inputor,source,startStr,suffix,text;$inputor=this.$inputor;source=$inputor.val();startStr=source.slice(0,Math.max(this.query.headPos-this.at.length,0));suffix=(suffix=this.getOpt('suffix'))===""?suffix:suffix||" ";content+=suffix;text=""+startStr+content+(source.slice(this.query.endPos||0));$inputor.val(text);$inputor.caret('pos',startStr.length+content.length,{iframe:this.app.iframe});if(!$inputor.is(':focus')){$inputor.focus()}
return $inputor.change()};return TextareaController})(Controller);var EditableController,extend=function(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child},hasProp={}.hasOwnProperty;EditableController=(function(superClass){extend(EditableController,superClass);function EditableController(){return EditableController.__super__.constructor.apply(this,arguments)}
EditableController.prototype._getRange=function(){var sel;sel=this.app.window.getSelection();if(sel.rangeCount>0){return sel.getRangeAt(0)}};EditableController.prototype._setRange=function(position,node,range){if(range==null){range=this._getRange()}
if(!(range&&node)){return}
node=$(node)[0];if(position==='after'){range.setEndAfter(node);range.setStartAfter(node)}else{range.setEndBefore(node);range.setStartBefore(node)}
range.collapse(!1);return this._clearRange(range)};EditableController.prototype._clearRange=function(range){var sel;if(range==null){range=this._getRange()}
sel=this.app.window.getSelection();if(this.ctrl_a_pressed==null){sel.removeAllRanges();return sel.addRange(range)}};EditableController.prototype._movingEvent=function(e){var ref;return e.type==='click'||((ref=e.which)===KEY_CODE.RIGHT||ref===KEY_CODE.LEFT||ref===KEY_CODE.UP||ref===KEY_CODE.DOWN)};EditableController.prototype._unwrap=function(node){var next;node=$(node).unwrap().get(0);if((next=node.nextSibling)&&next.nodeValue){node.nodeValue+=next.nodeValue;$(next).remove()}
return node};EditableController.prototype.catchQuery=function(e){var $inserted,$query,_range,index,inserted,isString,lastNode,matched,offset,query,query_content,range;if(!(range=this._getRange())){return}
if(!range.collapsed){return}
if(e.which===KEY_CODE.ENTER){($query=$(range.startContainer).closest('.atwho-query')).contents().unwrap();if($query.is(':empty')){$query.remove()}($query=$(".atwho-query",this.app.document)).text($query.text()).contents().last().unwrap();this._clearRange();return}
if(/firefox/i.test(navigator.userAgent)){if($(range.startContainer).is(this.$inputor)){this._clearRange();return}
if(e.which===KEY_CODE.BACKSPACE&&range.startContainer.nodeType===document.ELEMENT_NODE&&(offset=range.startOffset-1)>=0){_range=range.cloneRange();_range.setStart(range.startContainer,offset);if($(_range.cloneContents()).contents().last().is('.atwho-inserted')){inserted=$(range.startContainer).contents().get(offset);this._setRange('after',$(inserted).contents().last())}}else if(e.which===KEY_CODE.LEFT&&range.startContainer.nodeType===document.TEXT_NODE){$inserted=$(range.startContainer.previousSibling);if($inserted.is('.atwho-inserted')&&range.startOffset===0){this._setRange('after',$inserted.contents().last())}}}
$(range.startContainer).closest('.atwho-inserted').addClass('atwho-query').siblings().removeClass('atwho-query');if(($query=$(".atwho-query",this.app.document)).length>0&&$query.is(':empty')&&$query.text().length===0){$query.remove()}
if(!this._movingEvent(e)){$query.removeClass('atwho-inserted')}
if($query.length>0){switch(e.which){case KEY_CODE.LEFT:this._setRange('before',$query.get(0),range);$query.removeClass('atwho-query');return;case KEY_CODE.RIGHT:this._setRange('after',$query.get(0).nextSibling,range);$query.removeClass('atwho-query');return}}
if($query.length>0&&(query_content=$query.attr('data-atwho-at-query'))){$query.empty().html(query_content).attr('data-atwho-at-query',null);this._setRange('after',$query.get(0),range)}
_range=range.cloneRange();_range.setStart(range.startContainer,0);matched=this.callbacks("matcher").call(this,this.at,_range.toString(),this.getOpt('startWithSpace'),this.getOpt("acceptSpaceBar"));isString=typeof matched==='string';if($query.length===0&&isString&&(index=range.startOffset-this.at.length-matched.length)>=0){range.setStart(range.startContainer,index);$query=$('<span/>',this.app.document).attr(this.getOpt("editableAtwhoQueryAttrs")).addClass('atwho-query');range.surroundContents($query.get(0));lastNode=$query.contents().last().get(0);if(lastNode){if(/firefox/i.test(navigator.userAgent)){range.setStart(lastNode,lastNode.length);range.setEnd(lastNode,lastNode.length);this._clearRange(range)}else{this._setRange('after',lastNode,range)}}}
if(isString&&matched.length<this.getOpt('minLen',0)){return}
if(isString&&matched.length<=this.getOpt('maxLen',20)){query={text:matched,el:$query};this.trigger("matched",[this.at,query.text]);return this.query=query}else{this.view.hide();this.query={el:$query};if($query.text().indexOf(this.at)>=0){if(this._movingEvent(e)&&$query.hasClass('atwho-inserted')){$query.removeClass('atwho-query')}else if(!1!==this.callbacks('afterMatchFailed').call(this,this.at,$query)){this._setRange("after",this._unwrap($query.text($query.text()).contents().first()))}}
return null}};EditableController.prototype.rect=function(){var $iframe,iframeOffset,rect;rect=this.query.el.offset();if(!(rect&&this.query.el[0].getClientRects().length)){return}
if(this.app.iframe&&!this.app.iframeAsRoot){iframeOffset=($iframe=$(this.app.iframe)).offset();rect.left+=iframeOffset.left-this.$inputor.scrollLeft();rect.top+=iframeOffset.top-this.$inputor.scrollTop()}
rect.bottom=rect.top+this.query.el.height();return rect};EditableController.prototype.insert=function(content,$li){var data,overrides,range,suffix,suffixNode;if(!this.$inputor.is(':focus')){this.$inputor.focus()}
overrides=this.getOpt('functionOverrides');if(overrides.insert){return overrides.insert.call(this,content,$li)}
suffix=(suffix=this.getOpt('suffix'))===""?suffix:suffix||"\u00A0";data=$li.data('item-data');this.query.el.removeClass('atwho-query').addClass('atwho-inserted').html(content).attr('data-atwho-at-query',""+data['atwho-at']+this.query.text);if(range=this._getRange()){if(this.query.el.length){range.setEndAfter(this.query.el[0])}
range.collapse(!1);range.insertNode(suffixNode=this.app.document.createTextNode("\u200D"+suffix));this._setRange('after',suffixNode,range)}
if(!this.$inputor.is(':focus')){this.$inputor.focus()}
return this.$inputor.change()};return EditableController})(Controller);var Model;Model=(function(){function Model(context){this.context=context;this.at=this.context.at;this.storage=this.context.$inputor}
Model.prototype.destroy=function(){return this.storage.data(this.at,null)};Model.prototype.saved=function(){return this.fetch()>0};Model.prototype.query=function(query,callback){var _remoteFilter,data,searchKey;data=this.fetch();searchKey=this.context.getOpt("searchKey");data=this.context.callbacks('filter').call(this.context,query,data,searchKey)||[];_remoteFilter=this.context.callbacks('remoteFilter');if(data.length>0||(!_remoteFilter&&data.length===0)){return callback(data)}else{return _remoteFilter.call(this.context,query,callback)}};Model.prototype.fetch=function(){return this.storage.data(this.at)||[]};Model.prototype.save=function(data){return this.storage.data(this.at,this.context.callbacks("beforeSave").call(this.context,data||[]))};Model.prototype.load=function(data){if(!(this.saved()||!data)){return this._load(data)}};Model.prototype.reload=function(data){return this._load(data)};Model.prototype._load=function(data){if(typeof data==="string"){return $.ajax(data,{dataType:"json"}).done((function(_this){return function(data){return _this.save(data)}})(this))}else{return this.save(data)}};return Model})();var View;View=(function(){function View(context){this.context=context;this.$el=$("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");this.$elUl=this.$el.children();this.timeoutID=null;this.context.$el.append(this.$el);this.bindEvent()}
View.prototype.init=function(){var header_tpl,id;id=this.context.getOpt("alias")||this.context.at.charCodeAt(0);header_tpl=this.context.getOpt("headerTpl");if(header_tpl&&this.$el.children().length===1){this.$el.prepend(header_tpl)}
return this.$el.attr({'id':"at-view-"+id})};View.prototype.destroy=function(){return this.$el.remove()};View.prototype.bindEvent=function(){var $menu,lastCoordX,lastCoordY;$menu=this.$el.find('ul');lastCoordX=0;lastCoordY=0;return $menu.on('mousemove.atwho-view','li',(function(_this){return function(e){var $cur;if(lastCoordX===e.clientX&&lastCoordY===e.clientY){return}
lastCoordX=e.clientX;lastCoordY=e.clientY;$cur=$(e.currentTarget);if($cur.hasClass('cur')){return}
$menu.find('.cur').removeClass('cur');return $cur.addClass('cur')}})(this)).on('click.atwho-view','li',(function(_this){return function(e){$menu.find('.cur').removeClass('cur');$(e.currentTarget).addClass('cur');_this.choose(e);return e.preventDefault()}})(this))};View.prototype.visible=function(){return $.expr.filters.visible(this.$el[0])};View.prototype.highlighted=function(){return this.$el.find(".cur").length>0};View.prototype.choose=function(e){var $li,content;if(($li=this.$el.find(".cur")).length){content=this.context.insertContentFor($li);this.context._stopDelayedCall();this.context.insert(this.context.callbacks("beforeInsert").call(this.context,content,$li,e),$li);this.context.trigger("inserted",[$li,e]);this.hide(e)}
if(this.context.getOpt("hideWithoutSuffix")){return this.stopShowing=!0}};View.prototype.reposition=function(rect){var _window,offset,overflowOffset,ref;_window=this.context.app.iframeAsRoot?this.context.app.window:window;if(rect.bottom+this.$el.height()-$(_window).scrollTop()>$(_window).height()){rect.bottom=rect.top-this.$el.height()}
if(rect.left>(overflowOffset=$(_window).width()-this.$el.width()-5)){rect.left=overflowOffset}
offset={left:rect.left,top:rect.bottom};if((ref=this.context.callbacks("beforeReposition"))!=null){ref.call(this.context,offset)}
this.$el.offset(offset);return this.context.trigger("reposition",[offset])};View.prototype.next=function(){var cur,next,nextEl,offset;cur=this.$el.find('.cur').removeClass('cur');next=cur.next();if(!next.length){next=this.$el.find('li:first')}
next.addClass('cur');nextEl=next[0];offset=nextEl.offsetTop+nextEl.offsetHeight+(nextEl.nextSibling?nextEl.nextSibling.offsetHeight:0);return this.scrollTop(Math.max(0,offset-this.$el.height()))};View.prototype.prev=function(){var cur,offset,prev,prevEl;cur=this.$el.find('.cur').removeClass('cur');prev=cur.prev();if(!prev.length){prev=this.$el.find('li:last')}
prev.addClass('cur');prevEl=prev[0];offset=prevEl.offsetTop+prevEl.offsetHeight+(prevEl.nextSibling?prevEl.nextSibling.offsetHeight:0);return this.scrollTop(Math.max(0,offset-this.$el.height()))};View.prototype.scrollTop=function(scrollTop){var scrollDuration;scrollDuration=this.context.getOpt('scrollDuration');if(scrollDuration){return this.$elUl.animate({scrollTop:scrollTop},scrollDuration)}else{return this.$elUl.scrollTop(scrollTop)}};View.prototype.show=function(){var rect;if(this.stopShowing){this.stopShowing=!1;return}
if(!this.visible()){this.$el.show();this.$el.scrollTop(0);this.context.trigger('shown')}
if(rect=this.context.rect()){return this.reposition(rect)}};View.prototype.hide=function(e,time){var callback;if(!this.visible()){return}
if(isNaN(time)){this.$el.hide();return this.context.trigger('hidden',[e])}else{callback=(function(_this){return function(){return _this.hide()}})(this);clearTimeout(this.timeoutID);return this.timeoutID=setTimeout(callback,time)}};View.prototype.render=function(list){var $li,$ul,i,item,len,li,tpl;if(!($.isArray(list)&&list.length>0)){this.hide();return}
this.$el.find('ul').empty();$ul=this.$el.find('ul');tpl=this.context.getOpt('displayTpl');for(i=0,len=list.length;i<len;i++){item=list[i];item=$.extend({},item,{'atwho-at':this.context.at});li=this.context.callbacks("tplEval").call(this.context,tpl,item,"onDisplay");$li=$(this.context.callbacks("highlighter").call(this.context,li,this.context.query.text));$li.data("item-data",item);$ul.append($li)}
this.show();if(this.context.getOpt('highlightFirst')){return $ul.find("li:first").addClass("cur")}};return View})();var Api;Api={load:function(at,data){var c;if(c=this.controller(at)){return c.model.load(data)}},isSelecting:function(){var ref;return!!((ref=this.controller())!=null?ref.view.visible():void 0)},hide:function(){var ref;return(ref=this.controller())!=null?ref.view.hide():void 0},reposition:function(){var c;if(c=this.controller()){return c.view.reposition(c.rect())}},setIframe:function(iframe,asRoot){this.setupRootElement(iframe,asRoot);return null},run:function(){return this.dispatch()},destroy:function(){this.shutdown();return this.$inputor.data('atwho',null)}};$.fn.atwho=function(method){var _args,result;_args=arguments;result=null;this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var $this,app;if(!(app=($this=$(this)).data("atwho"))){$this.data('atwho',(app=new App(this)))}
if(typeof method==='object'||!method){return app.reg(method.at,method)}else if(Api[method]&&app){return result=Api[method].apply(app,Array.prototype.slice.call(_args,1))}else{return $.error("Method "+method+" does not exist on jQuery.atwho")}});if(result!=null){return result}else{return this}};$.fn.atwho["default"]={at:void 0,alias:void 0,data:null,displayTpl:"<li>${name}</li>",insertTpl:"${atwho-at}${name}",headerTpl:null,callbacks:DEFAULT_CALLBACKS,functionOverrides:{},searchKey:"name",suffix:void 0,hideWithoutSuffix:!1,startWithSpace:!0,acceptSpaceBar:!1,highlightFirst:!0,limit:5,maxLen:20,minLen:0,displayTimeout:300,delay:null,spaceSelectsMatch:!1,tabSelectsMatch:!0,editableAtwhoQueryAttrs:{},scrollDuration:150,suspendOnComposing:!0,lookUpOnClick:!0};$.fn.atwho.debug=!1}));var jvm={inherits:function(child,parent){function temp(){}
temp.prototype=parent.prototype;child.prototype=new temp();child.prototype.constructor=child;child.parentClass=parent},mixin:function(target,source){var prop;for(prop in source.prototype){if(source.prototype.hasOwnProperty(prop)){target.prototype[prop]=source.prototype[prop]}}},min:function(values){var min=Number.MAX_VALUE,i;if(values instanceof Array){for(i=0;i<values.length;i++){if(values[i]<min){min=values[i]}}}else{for(i in values){if(values[i]<min){min=values[i]}}}
return min},max:function(values){var max=Number.MIN_VALUE,i;if(values instanceof Array){for(i=0;i<values.length;i++){if(values[i]>max){max=values[i]}}}else{for(i in values){if(values[i]>max){max=values[i]}}}
return max},keys:function(object){var keys=[],key;for(key in object){keys.push(key)}
return keys},values:function(object){var values=[],key,i;for(i=0;i<arguments.length;i++){object=arguments[i];for(key in object){values.push(object[key])}}
return values},whenImageLoaded:function(url){var deferred=new jvm.$.Deferred(),img=jvm.$('<img/>');img.on('error',function(){deferred.reject()}).on('load',function(){deferred.resolve(img)});img.attr('src',url);return deferred},isImageUrl:function(s){return/\.\w{3,4}$/.test(s)}};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(searchElement,fromIndex){var k;if(this==null){throw new TypeError('"this" is null or not defined')}
var O=Object(this);var len=O.length>>>0;if(len===0){return-1}
var n=+fromIndex||0;if(Math.abs(n)===Infinity){n=0}
if(n>=len){return-1}
k=Math.max(n>=0?n:len-Math.abs(n),0);while(k<len){if(k in O&&O[k]===searchElement){return k}
k++}
return-1}}(function(factory){if(typeof exports==='object'){module.exports=factory}else if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else{factory(jQuery)}}(function($){jvm.$=$;var apiParams={set:{colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,focus:1},get:{selectedRegions:1,selectedMarkers:1,mapObject:1,regionName:1}};$.fn.vectorMap=function(options){var map,methodName,map=this.children('.jvectormap-container').data('mapObject');if(options==='addMap'){jvm.Map.maps[arguments[1]]=arguments[2]}else if((options==='set'||options==='get')&&apiParams[options][arguments[1]]){methodName=arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1);return map[options+methodName].apply(map,Array.prototype.slice.call(arguments,2))}else{options=options||{};options.container=this;map=new jvm.Map(options)}
return this}}));
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version: 3.1.9
 *
 * Requires: jQuery 1.2.2+
 */
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof exports==='object'){module.exports=factory}else{factory(jQuery)}}(function($){var toFix=['wheel','mousewheel','DOMMouseScroll','MozMousePixelScroll'],toBind=('onwheel' in document||document.documentMode>=9)?['wheel']:['mousewheel','DomMouseScroll','MozMousePixelScroll'],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks){for(var i=toFix.length;i;){$.event.fixHooks[toFix[--i]]=$.event.mouseHooks}}
var special=$.event.special.mousewheel={version:'3.1.9',setup:function(){if(this.addEventListener){for(var i=toBind.length;i;){this.addEventListener(toBind[--i],handler,!1)}}else{this.onmousewheel=handler}
$.data(this,'mousewheel-line-height',special.getLineHeight(this));$.data(this,'mousewheel-page-height',special.getPageHeight(this))},teardown:function(){if(this.removeEventListener){for(var i=toBind.length;i;){this.removeEventListener(toBind[--i],handler,!1)}}else{this.onmousewheel=null}},getLineHeight:function(elem){return parseInt($(elem)['offsetParent' in $.fn?'offsetParent':'parent']().css('fontSize'),10)},getPageHeight:function(elem){return $(elem).height()},settings:{adjustOldDeltas:!0}};$.fn.extend({mousewheel:function(fn){return fn?this.bind('mousewheel',fn):this.trigger('mousewheel')},unmousewheel:function(fn){return this.unbind('mousewheel',fn)}});function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0;event=$.event.fix(orgEvent);event.type='mousewheel';if('detail' in orgEvent){deltaY=orgEvent.detail*-1}
if('wheelDelta' in orgEvent){deltaY=orgEvent.wheelDelta}
if('wheelDeltaY' in orgEvent){deltaY=orgEvent.wheelDeltaY}
if('wheelDeltaX' in orgEvent){deltaX=orgEvent.wheelDeltaX*-1}
if('axis' in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaX=deltaY*-1;deltaY=0}
delta=deltaY===0?deltaX:deltaY;if('deltaY' in orgEvent){deltaY=orgEvent.deltaY*-1;delta=deltaY}
if('deltaX' in orgEvent){deltaX=orgEvent.deltaX;if(deltaY===0){delta=deltaX*-1}}
if(deltaY===0&&deltaX===0){return}
if(orgEvent.deltaMode===1){var lineHeight=$.data(this,'mousewheel-line-height');delta*=lineHeight;deltaY*=lineHeight;deltaX*=lineHeight}else if(orgEvent.deltaMode===2){var pageHeight=$.data(this,'mousewheel-page-height');delta*=pageHeight;deltaY*=pageHeight;deltaX*=pageHeight}
absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX));if(!lowestDelta||absDelta<lowestDelta){lowestDelta=absDelta;if(shouldAdjustOldDeltas(orgEvent,absDelta)){lowestDelta/=40}}
if(shouldAdjustOldDeltas(orgEvent,absDelta)){delta/=40;deltaX/=40;deltaY/=40}
delta=Math[delta>=1?'floor':'ceil'](delta/lowestDelta);deltaX=Math[deltaX>=1?'floor':'ceil'](deltaX/lowestDelta);deltaY=Math[deltaY>=1?'floor':'ceil'](deltaY/lowestDelta);event.deltaX=deltaX;event.deltaY=deltaY;event.deltaFactor=lowestDelta;event.deltaMode=0;args.unshift(event,delta,deltaX,deltaY);if(nullLowestDeltaTimeout){clearTimeout(nullLowestDeltaTimeout)}
nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200);return($.event.dispatch||$.event.handle).apply(this,args)}
function nullLowestDelta(){lowestDelta=null}
function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&orgEvent.type==='mousewheel'&&absDelta%120===0}}));jvm.AbstractElement=function(name,config){this.node=this.createElement(name);this.name=name;this.properties={};if(config){this.set(config)}};jvm.AbstractElement.prototype.set=function(property,value){var key;if(typeof property==='object'){for(key in property){this.properties[key]=property[key];this.applyAttr(key,property[key])}}else{this.properties[property]=value;this.applyAttr(property,value)}};jvm.AbstractElement.prototype.get=function(property){return this.properties[property]};jvm.AbstractElement.prototype.applyAttr=function(property,value){this.node.setAttribute(property,value)};jvm.AbstractElement.prototype.remove=function(){jvm.$(this.node).remove()};jvm.AbstractCanvasElement=function(container,width,height){this.container=container;this.setSize(width,height);this.rootElement=new jvm[this.classPrefix+'GroupElement']();this.node.appendChild(this.rootElement.node);this.container.appendChild(this.node)}
jvm.AbstractCanvasElement.prototype.add=function(element,group){group=group||this.rootElement;group.add(element);element.canvas=this}
jvm.AbstractCanvasElement.prototype.addPath=function(config,style,group){var el=new jvm[this.classPrefix+'PathElement'](config,style);this.add(el,group);return el};jvm.AbstractCanvasElement.prototype.addCircle=function(config,style,group){var el=new jvm[this.classPrefix+'CircleElement'](config,style);this.add(el,group);return el};jvm.AbstractCanvasElement.prototype.addImage=function(config,style,group){var el=new jvm[this.classPrefix+'ImageElement'](config,style);this.add(el,group);return el};jvm.AbstractCanvasElement.prototype.addText=function(config,style,group){var el=new jvm[this.classPrefix+'TextElement'](config,style);this.add(el,group);return el};jvm.AbstractCanvasElement.prototype.addGroup=function(parentGroup){var el=new jvm[this.classPrefix+'GroupElement']();if(parentGroup){parentGroup.node.appendChild(el.node)}else{this.node.appendChild(el.node)}
el.canvas=this;return el};jvm.AbstractShapeElement=function(name,config,style){this.style=style||{};this.style.current=this.style.current||{};this.isHovered=!1;this.isSelected=!1;this.updateStyle()};jvm.AbstractShapeElement.prototype.setStyle=function(property,value){var styles={};if(typeof property==='object'){styles=property}else{styles[property]=value}
jvm.$.extend(this.style.current,styles);this.updateStyle()};jvm.AbstractShapeElement.prototype.updateStyle=function(){var attrs={};jvm.AbstractShapeElement.mergeStyles(attrs,this.style.initial);jvm.AbstractShapeElement.mergeStyles(attrs,this.style.current);if(this.isHovered){jvm.AbstractShapeElement.mergeStyles(attrs,this.style.hover)}
if(this.isSelected){jvm.AbstractShapeElement.mergeStyles(attrs,this.style.selected);if(this.isHovered){jvm.AbstractShapeElement.mergeStyles(attrs,this.style.selectedHover)}}
this.set(attrs)};jvm.AbstractShapeElement.mergeStyles=function(styles,newStyles){var key;newStyles=newStyles||{};for(key in newStyles){if(newStyles[key]===null){delete styles[key]}else{styles[key]=newStyles[key]}}}
jvm.SVGElement=function(name,config){jvm.SVGElement.parentClass.apply(this,arguments)}
jvm.inherits(jvm.SVGElement,jvm.AbstractElement);jvm.SVGElement.svgns="http://www.w3.org/2000/svg";jvm.SVGElement.prototype.createElement=function(tagName){return document.createElementNS(jvm.SVGElement.svgns,tagName)};jvm.SVGElement.prototype.addClass=function(className){this.node.setAttribute('class',className)};jvm.SVGElement.prototype.getElementCtr=function(ctr){return jvm['SVG'+ctr]};jvm.SVGElement.prototype.getBBox=function(){return this.node.getBBox()};jvm.SVGGroupElement=function(){jvm.SVGGroupElement.parentClass.call(this,'g')}
jvm.inherits(jvm.SVGGroupElement,jvm.SVGElement);jvm.SVGGroupElement.prototype.add=function(element){this.node.appendChild(element.node)};jvm.SVGCanvasElement=function(container,width,height){this.classPrefix='SVG';jvm.SVGCanvasElement.parentClass.call(this,'svg');this.defsElement=new jvm.SVGElement('defs');this.node.appendChild(this.defsElement.node);jvm.AbstractCanvasElement.apply(this,arguments)}
jvm.inherits(jvm.SVGCanvasElement,jvm.SVGElement);jvm.mixin(jvm.SVGCanvasElement,jvm.AbstractCanvasElement);jvm.SVGCanvasElement.prototype.setSize=function(width,height){this.width=width;this.height=height;this.node.setAttribute('width',width);this.node.setAttribute('height',height)};jvm.SVGCanvasElement.prototype.applyTransformParams=function(scale,transX,transY){this.scale=scale;this.transX=transX;this.transY=transY;this.rootElement.node.setAttribute('transform','scale('+scale+') translate('+transX+', '+transY+')')};jvm.SVGShapeElement=function(name,config,style){jvm.SVGShapeElement.parentClass.call(this,name,config);jvm.AbstractShapeElement.apply(this,arguments)};jvm.inherits(jvm.SVGShapeElement,jvm.SVGElement);jvm.mixin(jvm.SVGShapeElement,jvm.AbstractShapeElement);jvm.SVGShapeElement.prototype.applyAttr=function(attr,value){var patternEl,imageEl,that=this;if(attr==='fill'&&jvm.isImageUrl(value)){if(!jvm.SVGShapeElement.images[value]){jvm.whenImageLoaded(value).then(function(img){imageEl=new jvm.SVGElement('image');imageEl.node.setAttributeNS('http://www.w3.org/1999/xlink','href',value);imageEl.applyAttr('x','0');imageEl.applyAttr('y','0');imageEl.applyAttr('width',img[0].width);imageEl.applyAttr('height',img[0].height);patternEl=new jvm.SVGElement('pattern');patternEl.applyAttr('id','image'+jvm.SVGShapeElement.imageCounter);patternEl.applyAttr('x',0);patternEl.applyAttr('y',0);patternEl.applyAttr('width',img[0].width/2);patternEl.applyAttr('height',img[0].height/2);patternEl.applyAttr('viewBox','0 0 '+img[0].width+' '+img[0].height);patternEl.applyAttr('patternUnits','userSpaceOnUse');patternEl.node.appendChild(imageEl.node);that.canvas.defsElement.node.appendChild(patternEl.node);jvm.SVGShapeElement.images[value]=jvm.SVGShapeElement.imageCounter++;that.applyAttr('fill','url(#image'+jvm.SVGShapeElement.images[value]+')')})}else{this.applyAttr('fill','url(#image'+jvm.SVGShapeElement.images[value]+')')}}else{jvm.SVGShapeElement.parentClass.prototype.applyAttr.apply(this,arguments)}};jvm.SVGShapeElement.imageCounter=1;jvm.SVGShapeElement.images={};jvm.SVGPathElement=function(config,style){jvm.SVGPathElement.parentClass.call(this,'path',config,style);this.node.setAttribute('fill-rule','evenodd')}
jvm.inherits(jvm.SVGPathElement,jvm.SVGShapeElement);jvm.SVGCircleElement=function(config,style){jvm.SVGCircleElement.parentClass.call(this,'circle',config,style)};jvm.inherits(jvm.SVGCircleElement,jvm.SVGShapeElement);jvm.SVGImageElement=function(config,style){jvm.SVGImageElement.parentClass.call(this,'image',config,style)};jvm.inherits(jvm.SVGImageElement,jvm.SVGShapeElement);jvm.SVGImageElement.prototype.applyAttr=function(attr,value){var that=this,imageUrl;if(attr=='image'){if(typeof value=='object'){imageUrl=value.url;this.offset=value.offset}else{imageUrl=value;this.offset=[0,0]}
jvm.whenImageLoaded(imageUrl).then(function(img){that.node.setAttributeNS('http://www.w3.org/1999/xlink','href',imageUrl);that.width=img[0].width;that.height=img[0].height;that.applyAttr('width',that.width);that.applyAttr('height',that.height);that.applyAttr('x',that.cx-that.width/2+that.offset[0]);that.applyAttr('y',that.cy-that.height/2+that.offset[1]);jvm.$(that.node).trigger('imageloaded',[img])})}else if(attr=='cx'){this.cx=value;if(this.width){this.applyAttr('x',value-this.width/2+this.offset[0])}}else if(attr=='cy'){this.cy=value;if(this.height){this.applyAttr('y',value-this.height/2+this.offset[1])}}else{jvm.SVGImageElement.parentClass.prototype.applyAttr.apply(this,arguments)}};jvm.SVGTextElement=function(config,style){jvm.SVGTextElement.parentClass.call(this,'text',config,style)}
jvm.inherits(jvm.SVGTextElement,jvm.SVGShapeElement);jvm.SVGTextElement.prototype.applyAttr=function(attr,value){if(attr==='text'){this.node.textContent=value}else{jvm.SVGTextElement.parentClass.prototype.applyAttr.apply(this,arguments)}};jvm.VMLElement=function(name,config){if(!jvm.VMLElement.VMLInitialized){jvm.VMLElement.initializeVML()}
jvm.VMLElement.parentClass.apply(this,arguments)};jvm.inherits(jvm.VMLElement,jvm.AbstractElement);jvm.VMLElement.VMLInitialized=!1;jvm.VMLElement.initializeVML=function(){try{if(!document.namespaces.rvml){document.namespaces.add("rvml","urn:schemas-microsoft-com:vml")}
jvm.VMLElement.prototype.createElement=function(tagName){return document.createElement('<rvml:'+tagName+' class="rvml">')}}catch(e){jvm.VMLElement.prototype.createElement=function(tagName){return document.createElement('<'+tagName+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}
document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");jvm.VMLElement.VMLInitialized=!0};jvm.VMLElement.prototype.getElementCtr=function(ctr){return jvm['VML'+ctr]};jvm.VMLElement.prototype.addClass=function(className){jvm.$(this.node).addClass(className)};jvm.VMLElement.prototype.applyAttr=function(attr,value){this.node[attr]=value};jvm.VMLElement.prototype.getBBox=function(){var node=jvm.$(this.node);return{x:node.position().left/this.canvas.scale,y:node.position().top/this.canvas.scale,width:node.width()/this.canvas.scale,height:node.height()/this.canvas.scale}};jvm.VMLGroupElement=function(){jvm.VMLGroupElement.parentClass.call(this,'group');this.node.style.left='0px';this.node.style.top='0px';this.node.coordorigin="0 0"};jvm.inherits(jvm.VMLGroupElement,jvm.VMLElement);jvm.VMLGroupElement.prototype.add=function(element){this.node.appendChild(element.node)};jvm.VMLCanvasElement=function(container,width,height){this.classPrefix='VML';jvm.VMLCanvasElement.parentClass.call(this,'group');jvm.AbstractCanvasElement.apply(this,arguments);this.node.style.position='absolute'};jvm.inherits(jvm.VMLCanvasElement,jvm.VMLElement);jvm.mixin(jvm.VMLCanvasElement,jvm.AbstractCanvasElement);jvm.VMLCanvasElement.prototype.setSize=function(width,height){var paths,groups,i,l;this.width=width;this.height=height;this.node.style.width=width+"px";this.node.style.height=height+"px";this.node.coordsize=width+' '+height;this.node.coordorigin="0 0";if(this.rootElement){paths=this.rootElement.node.getElementsByTagName('shape');for(i=0,l=paths.length;i<l;i++){paths[i].coordsize=width+' '+height;paths[i].style.width=width+'px';paths[i].style.height=height+'px'}
groups=this.node.getElementsByTagName('group');for(i=0,l=groups.length;i<l;i++){groups[i].coordsize=width+' '+height;groups[i].style.width=width+'px';groups[i].style.height=height+'px'}}};jvm.VMLCanvasElement.prototype.applyTransformParams=function(scale,transX,transY){this.scale=scale;this.transX=transX;this.transY=transY;this.rootElement.node.coordorigin=(this.width-transX-this.width/100)+','+(this.height-transY-this.height/100);this.rootElement.node.coordsize=this.width/scale+','+this.height/scale};jvm.VMLShapeElement=function(name,config){jvm.VMLShapeElement.parentClass.call(this,name,config);this.fillElement=new jvm.VMLElement('fill');this.strokeElement=new jvm.VMLElement('stroke');this.node.appendChild(this.fillElement.node);this.node.appendChild(this.strokeElement.node);this.node.stroked=!1;jvm.AbstractShapeElement.apply(this,arguments)};jvm.inherits(jvm.VMLShapeElement,jvm.VMLElement);jvm.mixin(jvm.VMLShapeElement,jvm.AbstractShapeElement);jvm.VMLShapeElement.prototype.applyAttr=function(attr,value){switch(attr){case 'fill':this.node.fillcolor=value;break;case 'fill-opacity':this.fillElement.node.opacity=Math.round(value*100)+'%';break;case 'stroke':if(value==='none'){this.node.stroked=!1}else{this.node.stroked=!0}
this.node.strokecolor=value;break;case 'stroke-opacity':this.strokeElement.node.opacity=Math.round(value*100)+'%';break;case 'stroke-width':if(parseInt(value,10)===0){this.node.stroked=!1}else{this.node.stroked=!0}
this.node.strokeweight=value;break;case 'd':this.node.path=jvm.VMLPathElement.pathSvgToVml(value);break;default:jvm.VMLShapeElement.parentClass.prototype.applyAttr.apply(this,arguments)}};jvm.VMLPathElement=function(config,style){var scale=new jvm.VMLElement('skew');jvm.VMLPathElement.parentClass.call(this,'shape',config,style);this.node.coordorigin="0 0";scale.node.on=!0;scale.node.matrix='0.01,0,0,0.01,0,0';scale.node.offset='0,0';this.node.appendChild(scale.node)};jvm.inherits(jvm.VMLPathElement,jvm.VMLShapeElement);jvm.VMLPathElement.prototype.applyAttr=function(attr,value){if(attr==='d'){this.node.path=jvm.VMLPathElement.pathSvgToVml(value)}else{jvm.VMLShapeElement.prototype.applyAttr.call(this,attr,value)}};jvm.VMLPathElement.pathSvgToVml=function(path){var cx=0,cy=0,ctrlx,ctrly;path=path.replace(/(-?\d+)e(-?\d+)/g,'0');return path.replace(/([MmLlHhVvCcSs])\s*((?:-?\d*(?:\.\d+)?\s*,?\s*)+)/g,function(segment,letter,coords,index){coords=coords.replace(/(\d)-/g,'$1,-').replace(/^\s+/g,'').replace(/\s+$/g,'').replace(/\s+/g,',').split(',');if(!coords[0])coords.shift();for(var i=0,l=coords.length;i<l;i++){coords[i]=Math.round(100*coords[i])}
switch(letter){case 'm':cx+=coords[0];cy+=coords[1];return't'+coords.join(',');case 'M':cx=coords[0];cy=coords[1];return'm'+coords.join(',');case 'l':cx+=coords[0];cy+=coords[1];return'r'+coords.join(',');case 'L':cx=coords[0];cy=coords[1];return'l'+coords.join(',');case 'h':cx+=coords[0];return'r'+coords[0]+',0';case 'H':cx=coords[0];return'l'+cx+','+cy;case 'v':cy+=coords[0];return'r0,'+coords[0];case 'V':cy=coords[0];return'l'+cx+','+cy;case 'c':ctrlx=cx+coords[coords.length-4];ctrly=cy+coords[coords.length-3];cx+=coords[coords.length-2];cy+=coords[coords.length-1];return'v'+coords.join(',');case 'C':ctrlx=coords[coords.length-4];ctrly=coords[coords.length-3];cx=coords[coords.length-2];cy=coords[coords.length-1];return'c'+coords.join(',');case 's':coords.unshift(cy-ctrly);coords.unshift(cx-ctrlx);ctrlx=cx+coords[coords.length-4];ctrly=cy+coords[coords.length-3];cx+=coords[coords.length-2];cy+=coords[coords.length-1];return'v'+coords.join(',');case 'S':coords.unshift(cy+cy-ctrly);coords.unshift(cx+cx-ctrlx);ctrlx=coords[coords.length-4];ctrly=coords[coords.length-3];cx=coords[coords.length-2];cy=coords[coords.length-1];return'c'+coords.join(',')}
return''}).replace(/z/g,'e')};jvm.VMLCircleElement=function(config,style){jvm.VMLCircleElement.parentClass.call(this,'oval',config,style)};jvm.inherits(jvm.VMLCircleElement,jvm.VMLShapeElement);jvm.VMLCircleElement.prototype.applyAttr=function(attr,value){switch(attr){case 'r':this.node.style.width=value*2+'px';this.node.style.height=value*2+'px';this.applyAttr('cx',this.get('cx')||0);this.applyAttr('cy',this.get('cy')||0);break;case 'cx':if(!value)return;this.node.style.left=value-(this.get('r')||0)+'px';break;case 'cy':if(!value)return;this.node.style.top=value-(this.get('r')||0)+'px';break;default:jvm.VMLCircleElement.parentClass.prototype.applyAttr.call(this,attr,value)}};jvm.VectorCanvas=function(container,width,height){this.mode=window.SVGAngle?'svg':'vml';if(this.mode=='svg'){this.impl=new jvm.SVGCanvasElement(container,width,height)}else{this.impl=new jvm.VMLCanvasElement(container,width,height)}
this.impl.mode=this.mode;return this.impl};jvm.SimpleScale=function(scale){this.scale=scale};jvm.SimpleScale.prototype.getValue=function(value){return value};jvm.OrdinalScale=function(scale){this.scale=scale};jvm.OrdinalScale.prototype.getValue=function(value){return this.scale[value]};jvm.OrdinalScale.prototype.getTicks=function(){var ticks=[],key;for(key in this.scale){ticks.push({label:key,value:this.scale[key]})}
return ticks};jvm.NumericScale=function(scale,normalizeFunction,minValue,maxValue){this.scale=[];normalizeFunction=normalizeFunction||'linear';if(scale)this.setScale(scale);if(normalizeFunction)this.setNormalizeFunction(normalizeFunction);if(typeof minValue!=='undefined')this.setMin(minValue);if(typeof maxValue!=='undefined')this.setMax(maxValue);};jvm.NumericScale.prototype={setMin:function(min){this.clearMinValue=min;if(typeof this.normalize==='function'){this.minValue=this.normalize(min)}else{this.minValue=min}},setMax:function(max){this.clearMaxValue=max;if(typeof this.normalize==='function'){this.maxValue=this.normalize(max)}else{this.maxValue=max}},setScale:function(scale){var i;this.scale=[];for(i=0;i<scale.length;i++){this.scale[i]=[scale[i]]}},setNormalizeFunction:function(f){if(f==='polynomial'){this.normalize=function(value){return Math.pow(value,0.2)}}else if(f==='linear'){delete this.normalize}else{this.normalize=f}
this.setMin(this.clearMinValue);this.setMax(this.clearMaxValue)},getValue:function(value){var lengthes=[],fullLength=0,l,i=0,c;if(typeof this.normalize==='function'){value=this.normalize(value)}
for(i=0;i<this.scale.length-1;i++){l=this.vectorLength(this.vectorSubtract(this.scale[i+1],this.scale[i]));lengthes.push(l);fullLength+=l}
c=(this.maxValue-this.minValue)/fullLength;for(i=0;i<lengthes.length;i++){lengthes[i]*=c}
i=0;value-=this.minValue;while(value-lengthes[i]>=0){value-=lengthes[i];i++}
if(i==this.scale.length-1){value=this.vectorToNum(this.scale[i])}else{value=(this.vectorToNum(this.vectorAdd(this.scale[i],this.vectorMult(this.vectorSubtract(this.scale[i+1],this.scale[i]),(value)/(lengthes[i])))))}
return value},vectorToNum:function(vector){var num=0,i;for(i=0;i<vector.length;i++){num+=Math.round(vector[i])*Math.pow(256,vector.length-i-1)}
return num},vectorSubtract:function(vector1,vector2){var vector=[],i;for(i=0;i<vector1.length;i++){vector[i]=vector1[i]-vector2[i]}
return vector},vectorAdd:function(vector1,vector2){var vector=[],i;for(i=0;i<vector1.length;i++){vector[i]=vector1[i]+vector2[i]}
return vector},vectorMult:function(vector,num){var result=[],i;for(i=0;i<vector.length;i++){result[i]=vector[i]*num}
return result},vectorLength:function(vector){var result=0,i;for(i=0;i<vector.length;i++){result+=vector[i]*vector[i]}
return Math.sqrt(result)},getTicks:function(){var m=5,extent=[this.clearMinValue,this.clearMaxValue],span=extent[1]-extent[0],step=Math.pow(10,Math.floor(Math.log(span/m)/Math.LN10)),err=m/span*step,ticks=[],tick,v;if(err<=.15)step*=10;else if(err<=.35)step*=5;else if(err<=.75)step*=2;extent[0]=Math.floor(extent[0]/step)*step;extent[1]=Math.ceil(extent[1]/step)*step;tick=extent[0];while(tick<=extent[1]){if(tick==extent[0]){v=this.clearMinValue}else if(tick==extent[1]){v=this.clearMaxValue}else{v=tick}
ticks.push({label:tick,value:this.getValue(v)});tick+=step}
return ticks}};jvm.ColorScale=function(colors,normalizeFunction,minValue,maxValue){jvm.ColorScale.parentClass.apply(this,arguments)}
jvm.inherits(jvm.ColorScale,jvm.NumericScale);jvm.ColorScale.prototype.setScale=function(scale){var i;for(i=0;i<scale.length;i++){this.scale[i]=jvm.ColorScale.rgbToArray(scale[i])}};jvm.ColorScale.prototype.getValue=function(value){return jvm.ColorScale.numToRgb(jvm.ColorScale.parentClass.prototype.getValue.call(this,value))};jvm.ColorScale.arrayToRgb=function(ar){var rgb='#',d,i;for(i=0;i<ar.length;i++){d=ar[i].toString(16);rgb+=d.length==1?'0'+d:d}
return rgb};jvm.ColorScale.numToRgb=function(num){num=num.toString(16);while(num.length<6){num='0'+num}
return'#'+num};jvm.ColorScale.rgbToArray=function(rgb){rgb=rgb.substr(1);return[parseInt(rgb.substr(0,2),16),parseInt(rgb.substr(2,2),16),parseInt(rgb.substr(4,2),16)]};jvm.Legend=function(params){this.params=params||{};this.map=this.params.map;this.series=this.params.series;this.body=jvm.$('<div/>');this.body.addClass('jvectormap-legend');if(this.params.cssClass){this.body.addClass(this.params.cssClass)}
if(params.vertical){this.map.legendCntVertical.append(this.body)}else{this.map.legendCntHorizontal.append(this.body)}
this.render()}
jvm.Legend.prototype.render=function(){var ticks=this.series.scale.getTicks(),i,inner=jvm.$('<div/>').addClass('jvectormap-legend-inner'),tick,sample,label;this.body.html('');if(this.params.title){this.body.append(jvm.$('<div/>').addClass('jvectormap-legend-title').html(this.params.title))}
this.body.append(inner);for(i=0;i<ticks.length;i++){tick=jvm.$('<div/>').addClass('jvectormap-legend-tick');sample=jvm.$('<div/>').addClass('jvectormap-legend-tick-sample');switch(this.series.params.attribute){case 'fill':if(jvm.isImageUrl(ticks[i].value)){sample.css('background','url('+ticks[i].value+')')}else{sample.css('background',ticks[i].value)}
break;case 'stroke':sample.css('background',ticks[i].value);break;case 'image':sample.css('background','url('+(typeof ticks[i].value==='object'?ticks[i].value.url:ticks[i].value)+') no-repeat center center');break;case 'r':jvm.$('<div/>').css({'border-radius':ticks[i].value,border:this.map.params.markerStyle.initial['stroke-width']+'px '+this.map.params.markerStyle.initial.stroke+' solid',width:ticks[i].value*2+'px',height:ticks[i].value*2+'px',background:this.map.params.markerStyle.initial.fill}).appendTo(sample);break}
tick.append(sample);label=ticks[i].label;if(this.params.labelRender){label=this.params.labelRender(label)}
tick.append(jvm.$('<div>'+label+' </div>').addClass('jvectormap-legend-tick-text'));inner.append(tick)}
inner.append(jvm.$('<div/>').css('clear','both'))}
jvm.DataSeries=function(params,elements,map){var scaleConstructor;params=params||{};params.attribute=params.attribute||'fill';this.elements=elements;this.params=params;this.map=map;if(params.attributes){this.setAttributes(params.attributes)}
if(jvm.$.isArray(params.scale)){scaleConstructor=(params.attribute==='fill'||params.attribute==='stroke')?jvm.ColorScale:jvm.NumericScale;this.scale=new scaleConstructor(params.scale,params.normalizeFunction,params.min,params.max)}else if(params.scale){this.scale=new jvm.OrdinalScale(params.scale)}else{this.scale=new jvm.SimpleScale(params.scale)}
this.values=params.values||{};this.setValues(this.values);if(this.params.legend){this.legend=new jvm.Legend(jvm.$.extend({map:this.map,series:this},this.params.legend))}};jvm.DataSeries.prototype={setAttributes:function(key,attr){var attrs=key,code;if(typeof key=='string'){if(this.elements[key]){this.elements[key].setStyle(this.params.attribute,attr)}}else{for(code in attrs){if(this.elements[code]){this.elements[code].element.setStyle(this.params.attribute,attrs[code])}}}},setValues:function(values){var max=-Number.MAX_VALUE,min=Number.MAX_VALUE,val,cc,attrs={};if(!(this.scale instanceof jvm.OrdinalScale)&&!(this.scale instanceof jvm.SimpleScale)){if(typeof this.params.min==='undefined'||typeof this.params.max==='undefined'){for(cc in values){val=parseFloat(values[cc]);if(val>max)max=val;if(val<min)min=val}}
if(typeof this.params.min==='undefined'){this.scale.setMin(min);this.params.min=min}else{this.scale.setMin(this.params.min)}
if(typeof this.params.max==='undefined'){this.scale.setMax(max);this.params.max=max}else{this.scale.setMax(this.params.max)}
for(cc in values){if(cc!='indexOf'){val=parseFloat(values[cc]);if(!isNaN(val)){attrs[cc]=this.scale.getValue(val)}else{attrs[cc]=this.elements[cc].element.style.initial[this.params.attribute]}}}}else{for(cc in values){if(values[cc]){attrs[cc]=this.scale.getValue(values[cc])}else{attrs[cc]=this.elements[cc].element.style.initial[this.params.attribute]}}}
this.setAttributes(attrs);jvm.$.extend(this.values,values)},clear:function(){var key,attrs={};for(key in this.values){if(this.elements[key]){attrs[key]=this.elements[key].element.shape.style.initial[this.params.attribute]}}
this.setAttributes(attrs);this.values={}},setScale:function(scale){this.scale.setScale(scale);if(this.values){this.setValues(this.values)}},setNormalizeFunction:function(f){this.scale.setNormalizeFunction(f);if(this.values){this.setValues(this.values)}}};jvm.Proj={degRad:180/Math.PI,radDeg:Math.PI/180,radius:6381372,sgn:function(n){if(n>0){return 1}else if(n<0){return-1}else{return n}},mill:function(lat,lng,c){return{x:this.radius*(lng-c)*this.radDeg,y:-this.radius*Math.log(Math.tan((45+0.4*lat)*this.radDeg))/0.8}},mill_inv:function(x,y,c){return{lat:(2.5*Math.atan(Math.exp(0.8*y/this.radius))-5*Math.PI/8)*this.degRad,lng:(c*this.radDeg+x/this.radius)*this.degRad}},merc:function(lat,lng,c){return{x:this.radius*(lng-c)*this.radDeg,y:-this.radius*Math.log(Math.tan(Math.PI/4+lat*Math.PI/360))}},merc_inv:function(x,y,c){return{lat:(2*Math.atan(Math.exp(y/this.radius))-Math.PI/2)*this.degRad,lng:(c*this.radDeg+x/this.radius)*this.degRad}},aea:function(lat,lng,c){var fi0=0,lambda0=c*this.radDeg,fi1=29.5*this.radDeg,fi2=45.5*this.radDeg,fi=lat*this.radDeg,lambda=lng*this.radDeg,n=(Math.sin(fi1)+Math.sin(fi2))/2,C=Math.cos(fi1)*Math.cos(fi1)+2*n*Math.sin(fi1),theta=n*(lambda-lambda0),ro=Math.sqrt(C-2*n*Math.sin(fi))/n,ro0=Math.sqrt(C-2*n*Math.sin(fi0))/n;return{x:ro*Math.sin(theta)*this.radius,y:-(ro0-ro*Math.cos(theta))*this.radius}},aea_inv:function(xCoord,yCoord,c){var x=xCoord/this.radius,y=yCoord/this.radius,fi0=0,lambda0=c*this.radDeg,fi1=29.5*this.radDeg,fi2=45.5*this.radDeg,n=(Math.sin(fi1)+Math.sin(fi2))/2,C=Math.cos(fi1)*Math.cos(fi1)+2*n*Math.sin(fi1),ro0=Math.sqrt(C-2*n*Math.sin(fi0))/n,ro=Math.sqrt(x*x+(ro0-y)*(ro0-y)),theta=Math.atan(x/(ro0-y));return{lat:(Math.asin((C-ro*ro*n*n)/(2*n)))*this.degRad,lng:(lambda0+theta/n)*this.degRad}},lcc:function(lat,lng,c){var fi0=0,lambda0=c*this.radDeg,lambda=lng*this.radDeg,fi1=33*this.radDeg,fi2=45*this.radDeg,fi=lat*this.radDeg,n=Math.log(Math.cos(fi1)*(1/Math.cos(fi2)))/Math.log(Math.tan(Math.PI/4+fi2/2)*(1/Math.tan(Math.PI/4+fi1/2))),F=(Math.cos(fi1)*Math.pow(Math.tan(Math.PI/4+fi1/2),n))/n,ro=F*Math.pow(1/Math.tan(Math.PI/4+fi/2),n),ro0=F*Math.pow(1/Math.tan(Math.PI/4+fi0/2),n);return{x:ro*Math.sin(n*(lambda-lambda0))*this.radius,y:-(ro0-ro*Math.cos(n*(lambda-lambda0)))*this.radius}},lcc_inv:function(xCoord,yCoord,c){var x=xCoord/this.radius,y=yCoord/this.radius,fi0=0,lambda0=c*this.radDeg,fi1=33*this.radDeg,fi2=45*this.radDeg,n=Math.log(Math.cos(fi1)*(1/Math.cos(fi2)))/Math.log(Math.tan(Math.PI/4+fi2/2)*(1/Math.tan(Math.PI/4+fi1/2))),F=(Math.cos(fi1)*Math.pow(Math.tan(Math.PI/4+fi1/2),n))/n,ro0=F*Math.pow(1/Math.tan(Math.PI/4+fi0/2),n),ro=this.sgn(n)*Math.sqrt(x*x+(ro0-y)*(ro0-y)),theta=Math.atan(x/(ro0-y));return{lat:(2*Math.atan(Math.pow(F/ro,1/n))-Math.PI/2)*this.degRad,lng:(lambda0+theta/n)*this.degRad}}};jvm.MapObject=function(config){};jvm.MapObject.prototype.getLabelText=function(key){var text;if(this.config.label){if(typeof this.config.label.render==='function'){text=this.config.label.render(key)}else{text=key}}else{text=null}
return text}
jvm.MapObject.prototype.getLabelOffsets=function(key){var offsets;if(this.config.label){if(typeof this.config.label.offsets==='function'){offsets=this.config.label.offsets(key)}else if(typeof this.config.label.offsets==='object'){offsets=this.config.label.offsets[key]}}
return offsets||[0,0]}
jvm.MapObject.prototype.setHovered=function(isHovered){if(this.isHovered!==isHovered){this.isHovered=isHovered;this.shape.isHovered=isHovered;this.shape.updateStyle();if(this.label){this.label.isHovered=isHovered;this.label.updateStyle()}}};jvm.MapObject.prototype.setSelected=function(isSelected){if(this.isSelected!==isSelected){this.isSelected=isSelected;this.shape.isSelected=isSelected;this.shape.updateStyle();if(this.label){this.label.isSelected=isSelected;this.label.updateStyle()}
jvm.$(this.shape).trigger('selected',[isSelected])}};jvm.MapObject.prototype.setStyle=function(){this.shape.setStyle.apply(this.shape,arguments)};jvm.MapObject.prototype.remove=function(){this.shape.remove();if(this.label){this.label.remove()}};jvm.Region=function(config){var bbox,text,offsets,wrapper;this.config=config;this.map=this.config.map;wrapper=config.canvas.addGroup(config.canvas.rootElement);this.shape=config.canvas.addPath({d:config.path},config.style,wrapper);var invisibleShape=config.canvas.addPath({d:config.path,'data-code':config.code},{initial:{'fill':'transparent','stroke':'transparent','stroke-width':config.margin}},wrapper);invisibleShape.addClass('jvectormap-region jvectormap-element');bbox=this.shape.getBBox();text=this.getLabelText(config.code);if(this.config.label&&text){offsets=this.getLabelOffsets(config.code);this.labelX=bbox.x+bbox.width/2+offsets[0];this.labelY=bbox.y+bbox.height/2+offsets[1];this.label=config.canvas.addText({text:text,'text-anchor':'middle','alignment-baseline':'central',x:this.labelX,y:this.labelY,'data-code':config.code},config.labelStyle,config.labelsGroup);this.label.addClass('jvectormap-region jvectormap-element')}};jvm.inherits(jvm.Region,jvm.MapObject);jvm.Region.prototype.updateLabelPosition=function(){if(this.label){this.label.set({x:this.labelX*this.map.scale+this.map.transX*this.map.scale,y:this.labelY*this.map.scale+this.map.transY*this.map.scale})}};jvm.Marker=function(config){var text;this.config=config;this.map=this.config.map;this.isImage=!!this.config.style.initial.image;this.createShape();text=this.getLabelText(config.index);if(this.config.label&&text){this.offsets=this.getLabelOffsets(config.index);this.labelX=config.cx/this.map.scale-this.map.transX;this.labelY=config.cy/this.map.scale-this.map.transY;this.label=config.canvas.addText({text:text,'data-index':config.index,dy:"0.6ex",x:this.labelX,y:this.labelY},config.labelStyle,config.labelsGroup);this.label.addClass('jvectormap-marker jvectormap-element')}};jvm.inherits(jvm.Marker,jvm.MapObject);jvm.Marker.prototype.createShape=function(){var that=this;if(this.shape){this.shape.remove()}
this.shape=this.config.canvas[this.isImage?'addImage':'addCircle']({"data-index":this.config.index,cx:this.config.cx,cy:this.config.cy},this.config.style,this.config.group);this.shape.addClass('jvectormap-marker jvectormap-element');if(this.isImage){jvm.$(this.shape.node).on('imageloaded',function(){that.updateLabelPosition()})}};jvm.Marker.prototype.updateLabelPosition=function(){if(this.label){this.label.set({x:this.labelX*this.map.scale+this.offsets[0]+this.map.transX*this.map.scale+5+(this.isImage?(this.shape.width||0)/2:this.shape.properties.r),y:this.labelY*this.map.scale+this.map.transY*this.map.scale+this.offsets[1]})}};jvm.Marker.prototype.setStyle=function(property,value){var isImage;jvm.Marker.parentClass.prototype.setStyle.apply(this,arguments);if(property==='r'){this.updateLabelPosition()}
isImage=!!this.shape.get('image');if(isImage!=this.isImage){this.isImage=isImage;this.config.style=jvm.$.extend(!0,{},this.shape.style);this.createShape()}};jvm.Map=function(params){var map=this,e;this.params=jvm.$.extend(!0,{},jvm.Map.defaultParams,params);if(!jvm.Map.maps[this.params.map]){throw new Error('Attempt to use map which was not loaded: '+this.params.map)}
this.mapData=jvm.Map.maps[this.params.map];this.markers={};this.regions={};this.regionsColors={};this.regionsData={};this.container=jvm.$('<div>').addClass('jvectormap-container');if(this.params.container){this.params.container.append(this.container)}
this.container.data('mapObject',this);this.defaultWidth=this.mapData.width;this.defaultHeight=this.mapData.height;this.setBackgroundColor(this.params.backgroundColor);this.onResize=function(){map.updateSize()}
jvm.$(window).resize(this.onResize);for(e in jvm.Map.apiEvents){if(this.params[e]){this.container.bind(jvm.Map.apiEvents[e]+'.jvectormap',this.params[e])}}
this.canvas=new jvm.VectorCanvas(this.container[0],this.width,this.height);if(this.params.bindTouchEvents){if(('ontouchstart' in window)||(window.DocumentTouch&&document instanceof DocumentTouch)){this.bindContainerTouchEvents()}else if(window.MSGesture){this.bindContainerPointerEvents()}}
this.bindContainerEvents();this.bindElementEvents();this.createTip();if(this.params.zoomButtons){this.bindZoomButtons()}
this.createRegions();this.createMarkers(this.params.markers||{});this.updateSize();if(this.params.focusOn){if(typeof this.params.focusOn==='string'){this.params.focusOn={region:this.params.focusOn}}else if(jvm.$.isArray(this.params.focusOn)){this.params.focusOn={regions:this.params.focusOn}}
this.setFocus(this.params.focusOn)}
if(this.params.selectedRegions){this.setSelectedRegions(this.params.selectedRegions)}
if(this.params.selectedMarkers){this.setSelectedMarkers(this.params.selectedMarkers)}
this.legendCntHorizontal=jvm.$('<div/>').addClass('jvectormap-legend-cnt jvectormap-legend-cnt-h');this.legendCntVertical=jvm.$('<div/>').addClass('jvectormap-legend-cnt jvectormap-legend-cnt-v');this.container.append(this.legendCntHorizontal);this.container.append(this.legendCntVertical);if(this.params.series){this.createSeries()}};jvm.Map.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,setBackgroundColor:function(backgroundColor){this.container.css('background-color',backgroundColor)},resize:function(){var curBaseScale=this.baseScale;if(this.width/this.height>this.defaultWidth/this.defaultHeight){this.baseScale=this.height/this.defaultHeight;this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)}else{this.baseScale=this.width/this.defaultWidth;this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)}
this.scale*=this.baseScale/curBaseScale;this.transX*=this.baseScale/curBaseScale;this.transY*=this.baseScale/curBaseScale},updateSize:function(){this.width=this.container.width();this.height=this.container.height();this.resize();this.canvas.setSize(this.width,this.height);this.applyTransform()},reset:function(){var key,i;for(key in this.series){for(i=0;i<this.series[key].length;i++){this.series[key][i].clear()}}
this.scale=this.baseScale;this.transX=this.baseTransX;this.transY=this.baseTransY;this.applyTransform()},applyTransform:function(){var maxTransX,maxTransY,minTransX,minTransY;if(this.defaultWidth*this.scale<=this.width){maxTransX=(this.width-this.defaultWidth*this.scale)/(2*this.scale);minTransX=(this.width-this.defaultWidth*this.scale)/(2*this.scale)}else{maxTransX=0;minTransX=(this.width-this.defaultWidth*this.scale)/this.scale}
if(this.defaultHeight*this.scale<=this.height){maxTransY=(this.height-this.defaultHeight*this.scale)/(2*this.scale);minTransY=(this.height-this.defaultHeight*this.scale)/(2*this.scale)}else{maxTransY=0;minTransY=(this.height-this.defaultHeight*this.scale)/this.scale}
if(this.transY>maxTransY){this.transY=maxTransY}else if(this.transY<minTransY){this.transY=minTransY}
if(this.transX>maxTransX){this.transX=maxTransX}else if(this.transX<minTransX){this.transX=minTransX}
this.canvas.applyTransformParams(this.scale,this.transX,this.transY);if(this.markers){this.repositionMarkers()}
this.repositionLabels();this.container.trigger('viewportChange',[this.scale/this.baseScale,this.transX,this.transY])},bindContainerEvents:function(){var mouseDown=!1,oldPageX,oldPageY,map=this;if(this.params.panOnDrag){this.container.mousemove(function(e){if(mouseDown){map.transX-=(oldPageX-e.pageX)/map.scale;map.transY-=(oldPageY-e.pageY)/map.scale;map.applyTransform();oldPageX=e.pageX;oldPageY=e.pageY}
return!1}).mousedown(function(e){mouseDown=!0;oldPageX=e.pageX;oldPageY=e.pageY;return!1});this.onContainerMouseUp=function(){mouseDown=!1};jvm.$('body').mouseup(this.onContainerMouseUp)}
if(this.params.zoomOnScroll){this.container.mousewheel(function(event,delta,deltaX,deltaY){var offset=jvm.$(map.container).offset(),centerX=event.pageX-offset.left,centerY=event.pageY-offset.top,zoomStep=Math.pow(1+map.params.zoomOnScrollSpeed/1000,event.deltaFactor*event.deltaY);map.tip.hide();map.setScale(map.scale*zoomStep,centerX,centerY);event.preventDefault()})}},bindContainerTouchEvents:function(){var touchStartScale,touchStartDistance,map=this,touchX,touchY,centerTouchX,centerTouchY,lastTouchesLength,handleTouchEvent=function(e){var touches=e.originalEvent.touches,offset,scale,transXOld,transYOld;if(e.type=='touchstart'){lastTouchesLength=0}
if(touches.length==1){if(lastTouchesLength==1){transXOld=map.transX;transYOld=map.transY;map.transX-=(touchX-touches[0].pageX)/map.scale;map.transY-=(touchY-touches[0].pageY)/map.scale;map.applyTransform();map.tip.hide();if(transXOld!=map.transX||transYOld!=map.transY){e.preventDefault()}}
touchX=touches[0].pageX;touchY=touches[0].pageY}else if(touches.length==2){if(lastTouchesLength==2){scale=Math.sqrt(Math.pow(touches[0].pageX-touches[1].pageX,2)+Math.pow(touches[0].pageY-touches[1].pageY,2))/touchStartDistance;map.setScale(touchStartScale*scale,centerTouchX,centerTouchY)
map.tip.hide();e.preventDefault()}else{offset=jvm.$(map.container).offset();if(touches[0].pageX>touches[1].pageX){centerTouchX=touches[1].pageX+(touches[0].pageX-touches[1].pageX)/2}else{centerTouchX=touches[0].pageX+(touches[1].pageX-touches[0].pageX)/2}
if(touches[0].pageY>touches[1].pageY){centerTouchY=touches[1].pageY+(touches[0].pageY-touches[1].pageY)/2}else{centerTouchY=touches[0].pageY+(touches[1].pageY-touches[0].pageY)/2}
centerTouchX-=offset.left;centerTouchY-=offset.top;touchStartScale=map.scale;touchStartDistance=Math.sqrt(Math.pow(touches[0].pageX-touches[1].pageX,2)+Math.pow(touches[0].pageY-touches[1].pageY,2))}}
lastTouchesLength=touches.length};jvm.$(this.container).bind('touchstart',handleTouchEvent);jvm.$(this.container).bind('touchmove',handleTouchEvent)},bindContainerPointerEvents:function(){var map=this,gesture=new MSGesture(),element=this.container[0],handlePointerDownEvent=function(e){gesture.addPointer(e.pointerId)},handleGestureEvent=function(e){var transXOld,transYOld;if(e.translationX!=0||e.translationY!=0){transXOld=map.transX;transYOld=map.transY;map.transX+=e.translationX/map.scale;map.transY+=e.translationY/map.scale;map.applyTransform();map.tip.hide();if(transXOld!=map.transX||transYOld!=map.transY){e.preventDefault()}}
if(e.scale!=1){map.setScale(map.scale*e.scale,e.offsetX,e.offsetY)
map.tip.hide();e.preventDefault()}};gesture.target=element;element.addEventListener("MSGestureChange",handleGestureEvent,!1);element.addEventListener("pointerdown",handlePointerDownEvent,!1)},bindElementEvents:function(){var map=this,pageX,pageY,mouseMoved;this.container.mousemove(function(e){if(Math.abs(pageX-e.pageX)+Math.abs(pageY-e.pageY)>2){mouseMoved=!0}});this.container.delegate("[class~='jvectormap-element']",'mouseover mouseout',function(e){var baseVal=jvm.$(this).attr('class').baseVal||jvm.$(this).attr('class'),type=baseVal.indexOf('jvectormap-region')===-1?'marker':'region',code=type=='region'?jvm.$(this).attr('data-code'):jvm.$(this).attr('data-index'),element=type=='region'?map.regions[code].element:map.markers[code].element,tipText=type=='region'?map.mapData.paths[code].name:(map.markers[code].config.name||''),tipShowEvent=jvm.$.Event(type+'TipShow.jvectormap'),overEvent=jvm.$.Event(type+'Over.jvectormap');if(e.type=='mouseover'){map.container.trigger(overEvent,[code]);if(!overEvent.isDefaultPrevented()){element.setHovered(!0)}
map.tip.text(tipText);map.container.trigger(tipShowEvent,[map.tip,code]);if(!tipShowEvent.isDefaultPrevented()){map.tip.show();map.tipWidth=map.tip.width();map.tipHeight=map.tip.height()}}else{element.setHovered(!1);map.tip.hide();map.container.trigger(type+'Out.jvectormap',[code])}});this.container.delegate("[class~='jvectormap-element']",'mousedown',function(e){pageX=e.pageX;pageY=e.pageY;mouseMoved=!1});this.container.delegate("[class~='jvectormap-element']",'mouseup',function(){var baseVal=jvm.$(this).attr('class').baseVal?jvm.$(this).attr('class').baseVal:jvm.$(this).attr('class'),type=baseVal.indexOf('jvectormap-region')===-1?'marker':'region',code=type=='region'?jvm.$(this).attr('data-code'):jvm.$(this).attr('data-index'),clickEvent=jvm.$.Event(type+'Click.jvectormap'),element=type=='region'?map.regions[code].element:map.markers[code].element;if(!mouseMoved){map.container.trigger(clickEvent,[code]);if((type==='region'&&map.params.regionsSelectable)||(type==='marker'&&map.params.markersSelectable)){if(!clickEvent.isDefaultPrevented()){if(map.params[type+'sSelectableOne']){map.clearSelected(type+'s')}
element.setSelected(!element.isSelected)}}}})},bindZoomButtons:function(){var map=this;jvm.$('<div/>').addClass('jvectormap-zoomin').text('+').appendTo(this.container);jvm.$('<div/>').addClass('jvectormap-zoomout').html('&#x2212;').appendTo(this.container);this.container.find('.jvectormap-zoomin').click(function(){map.setScale(map.scale*map.params.zoomStep,map.width/2,map.height/2,!1,map.params.zoomAnimate)});this.container.find('.jvectormap-zoomout').click(function(){map.setScale(map.scale/map.params.zoomStep,map.width/2,map.height/2,!1,map.params.zoomAnimate)})},createTip:function(){var map=this;jvm.$('body > .jvectormap-tip').remove();this.tip=jvm.$('<div/>').addClass('jvectormap-tip').appendTo(jvm.$('body'));this.container.mousemove(function(e){var left=e.pageX-15-map.tipWidth,top=e.pageY-15-map.tipHeight;if(left<5){left=e.pageX+15}
if(top<5){top=e.pageY+15}
map.tip.css({left:left,top:top})})},setScale:function(scale,anchorX,anchorY,isCentered,animate){var viewportChangeEvent=jvm.$.Event('zoom.jvectormap'),interval,that=this,i=0,count=Math.abs(Math.round((scale-this.scale)*60/Math.max(scale,this.scale))),scaleStart,scaleDiff,transXStart,transXDiff,transYStart,transYDiff,transX,transY,deferred=new jvm.$.Deferred();if(scale>this.params.zoomMax*this.baseScale){scale=this.params.zoomMax*this.baseScale}else if(scale<this.params.zoomMin*this.baseScale){scale=this.params.zoomMin*this.baseScale}
if(typeof anchorX!='undefined'&&typeof anchorY!='undefined'){zoomStep=scale/this.scale;if(isCentered){transX=anchorX+this.defaultWidth*(this.width/(this.defaultWidth*scale))/2;transY=anchorY+this.defaultHeight*(this.height/(this.defaultHeight*scale))/2}else{transX=this.transX-(zoomStep-1)/scale*anchorX;transY=this.transY-(zoomStep-1)/scale*anchorY}}
if(animate&&count>0){scaleStart=this.scale;scaleDiff=(scale-scaleStart)/count;transXStart=this.transX*this.scale;transYStart=this.transY*this.scale;transXDiff=(transX*scale-transXStart)/count;transYDiff=(transY*scale-transYStart)/count;interval=setInterval(function(){i+=1;that.scale=scaleStart+scaleDiff*i;that.transX=(transXStart+transXDiff*i)/that.scale;that.transY=(transYStart+transYDiff*i)/that.scale;that.applyTransform();if(i==count){clearInterval(interval);that.container.trigger(viewportChangeEvent,[scale/that.baseScale]);deferred.resolve()}},10)}else{this.transX=transX;this.transY=transY;this.scale=scale;this.applyTransform();this.container.trigger(viewportChangeEvent,[scale/this.baseScale]);deferred.resolve()}
return deferred},setFocus:function(config){var bbox,itemBbox,newBbox,codes,i,point;config=config||{};if(config.region){codes=[config.region]}else if(config.regions){codes=config.regions}
if(codes){for(i=0;i<codes.length;i++){if(this.regions[codes[i]]){itemBbox=this.regions[codes[i]].element.shape.getBBox();if(itemBbox){if(typeof bbox=='undefined'){bbox=itemBbox}else{newBbox={x:Math.min(bbox.x,itemBbox.x),y:Math.min(bbox.y,itemBbox.y),width:Math.max(bbox.x+bbox.width,itemBbox.x+itemBbox.width)-Math.min(bbox.x,itemBbox.x),height:Math.max(bbox.y+bbox.height,itemBbox.y+itemBbox.height)-Math.min(bbox.y,itemBbox.y)}
bbox=newBbox}}}}
return this.setScale(Math.min(this.width/bbox.width,this.height/bbox.height),-(bbox.x+bbox.width/2),-(bbox.y+bbox.height/2),!0,config.animate)}else{if(config.lat!==undefined&&config.lng!==undefined){point=this.latLngToPoint(config.lat,config.lng);config.x=this.transX-point.x/this.scale;config.y=this.transY-point.y/this.scale}else if(config.x&&config.y){config.x*=-this.defaultWidth;config.y*=-this.defaultHeight}
return this.setScale(config.scale*this.baseScale,config.x,config.y,!0,config.animate)}},getSelected:function(type){var key,selected=[];for(key in this[type]){if(this[type][key].element.isSelected){selected.push(key)}}
return selected},getSelectedRegions:function(){return this.getSelected('regions')},getSelectedMarkers:function(){return this.getSelected('markers')},setSelected:function(type,keys){var i;if(typeof keys!='object'){keys=[keys]}
if(jvm.$.isArray(keys)){for(i=0;i<keys.length;i++){this[type][keys[i]].element.setSelected(!0)}}else{for(i in keys){this[type][i].element.setSelected(!!keys[i])}}},setSelectedRegions:function(keys){this.setSelected('regions',keys)},setSelectedMarkers:function(keys){this.setSelected('markers',keys)},clearSelected:function(type){var select={},selected=this.getSelected(type),i;for(i=0;i<selected.length;i++){select[selected[i]]=!1};this.setSelected(type,select)},clearSelectedRegions:function(){this.clearSelected('regions')},clearSelectedMarkers:function(){this.clearSelected('markers')},getMapObject:function(){return this},getRegionName:function(code){return this.mapData.paths[code].name},createRegions:function(){var key,region,map=this;this.regionLabelsGroup=this.regionLabelsGroup||this.canvas.addGroup();for(key in this.mapData.paths){region=new jvm.Region({map:this,path:this.mapData.paths[key].path,code:key,style:jvm.$.extend(!0,{},this.params.regionStyle),margin:this.params.regionMargin,labelStyle:jvm.$.extend(!0,{},this.params.regionLabelStyle),canvas:this.canvas,labelsGroup:this.regionLabelsGroup,label:this.canvas.mode!='vml'?(this.params.labels&&this.params.labels.regions):null});jvm.$(region.shape).bind('selected',function(e,isSelected){map.container.trigger('regionSelected.jvectormap',[jvm.$(this.node).attr('data-code'),isSelected,map.getSelectedRegions()])});this.regions[key]={element:region,config:this.mapData.paths[key]}}},createMarkers:function(markers){var i,marker,point,markerConfig,markersArray,map=this;this.markersGroup=this.markersGroup||this.canvas.addGroup();this.markerLabelsGroup=this.markerLabelsGroup||this.canvas.addGroup();if(jvm.$.isArray(markers)){markersArray=markers.slice();markers={};for(i=0;i<markersArray.length;i++){markers[i]=markersArray[i]}}
for(i in markers){markerConfig=markers[i]instanceof Array?{latLng:markers[i]}:markers[i];point=this.getMarkerPosition(markerConfig);if(point!==!1){marker=new jvm.Marker({map:this,style:jvm.$.extend(!0,{},this.params.markerStyle,{initial:markerConfig.style||{}}),labelStyle:jvm.$.extend(!0,{},this.params.markerLabelStyle),index:i,cx:point.x,cy:point.y,group:this.markersGroup,canvas:this.canvas,labelsGroup:this.markerLabelsGroup,label:this.canvas.mode!='vml'?(this.params.labels&&this.params.labels.markers):null});jvm.$(marker.shape).bind('selected',function(e,isSelected){map.container.trigger('markerSelected.jvectormap',[jvm.$(this.node).attr('data-index'),isSelected,map.getSelectedMarkers()])});if(this.markers[i]){this.removeMarkers([i])}
this.markers[i]={element:marker,config:markerConfig}}}},repositionMarkers:function(){var i,point;for(i in this.markers){point=this.getMarkerPosition(this.markers[i].config);if(point!==!1){this.markers[i].element.setStyle({cx:point.x,cy:point.y})}}},repositionLabels:function(){var key;for(key in this.regions){this.regions[key].element.updateLabelPosition()}
for(key in this.markers){this.markers[key].element.updateLabelPosition()}},getMarkerPosition:function(markerConfig){if(jvm.Map.maps[this.params.map].projection){return this.latLngToPoint.apply(this,markerConfig.latLng||[0,0])}else{return{x:markerConfig.coords[0]*this.scale+this.transX*this.scale,y:markerConfig.coords[1]*this.scale+this.transY*this.scale}}},addMarker:function(key,marker,seriesData){var markers={},data=[],values,i,seriesData=seriesData||[];markers[key]=marker;for(i=0;i<seriesData.length;i++){values={};if(typeof seriesData[i]!=='undefined'){values[key]=seriesData[i]}
data.push(values)}
this.addMarkers(markers,data)},addMarkers:function(markers,seriesData){var i;seriesData=seriesData||[];this.createMarkers(markers);for(i=0;i<seriesData.length;i++){this.series.markers[i].setValues(seriesData[i]||{})}},removeMarkers:function(markers){var i;for(i=0;i<markers.length;i++){this.markers[markers[i]].element.remove();delete this.markers[markers[i]]}},removeAllMarkers:function(){var i,markers=[];for(i in this.markers){markers.push(i)}
this.removeMarkers(markers)},latLngToPoint:function(lat,lng){var point,proj=jvm.Map.maps[this.params.map].projection,centralMeridian=proj.centralMeridian,inset,bbox;if(lng<(-180+centralMeridian)){lng+=360}
point=jvm.Proj[proj.type](lat,lng,centralMeridian);inset=this.getInsetForPoint(point.x,point.y);if(inset){bbox=inset.bbox;point.x=(point.x-bbox[0].x)/(bbox[1].x-bbox[0].x)*inset.width*this.scale;point.y=(point.y-bbox[0].y)/(bbox[1].y-bbox[0].y)*inset.height*this.scale;return{x:point.x+this.transX*this.scale+inset.left*this.scale,y:point.y+this.transY*this.scale+inset.top*this.scale}}else{return!1}},pointToLatLng:function(x,y){var proj=jvm.Map.maps[this.params.map].projection,centralMeridian=proj.centralMeridian,insets=jvm.Map.maps[this.params.map].insets,i,inset,bbox,nx,ny;for(i=0;i<insets.length;i++){inset=insets[i];bbox=inset.bbox;nx=x-(this.transX*this.scale+inset.left*this.scale);ny=y-(this.transY*this.scale+inset.top*this.scale);nx=(nx/(inset.width*this.scale))*(bbox[1].x-bbox[0].x)+bbox[0].x;ny=(ny/(inset.height*this.scale))*(bbox[1].y-bbox[0].y)+bbox[0].y;if(nx>bbox[0].x&&nx<bbox[1].x&&ny>bbox[0].y&&ny<bbox[1].y){return jvm.Proj[proj.type+'_inv'](nx,-ny,centralMeridian)}}
return!1},getInsetForPoint:function(x,y){var insets=jvm.Map.maps[this.params.map].insets,i,bbox;for(i=0;i<insets.length;i++){bbox=insets[i].bbox;if(x>bbox[0].x&&x<bbox[1].x&&y>bbox[0].y&&y<bbox[1].y){return insets[i]}}},createSeries:function(){var i,key;this.series={markers:[],regions:[]};for(key in this.params.series){for(i=0;i<this.params.series[key].length;i++){this.series[key][i]=new jvm.DataSeries(this.params.series[key][i],this[key],this)}}},remove:function(){this.tip.remove();this.container.remove();jvm.$(window).unbind('resize',this.onResize);jvm.$('body').unbind('mouseup',this.onContainerMouseUp)}};jvm.Map.maps={};jvm.Map.defaultParams={map:'world_mill_en',backgroundColor:'#505050',zoomButtons:!0,zoomOnScroll:!0,zoomOnScrollSpeed:3,panOnDrag:!0,zoomMax:8,zoomMin:1,zoomStep:1.6,zoomAnimate:!0,regionsSelectable:!1,markersSelectable:!1,bindTouchEvents:!0,regionStyle:{initial:{fill:'white',"fill-opacity":1,stroke:'none',"stroke-width":0,"stroke-opacity":1},hover:{"fill-opacity":0.8,cursor:'pointer'},selected:{fill:'yellow'},selectedHover:{}},regionMargin:0,regionLabelStyle:{initial:{'font-family':'Verdana','font-size':'12','font-weight':'bold',cursor:'default',fill:'black'},hover:{cursor:'pointer'}},markerStyle:{initial:{fill:'grey',stroke:'#505050',"fill-opacity":1,"stroke-width":1,"stroke-opacity":1,r:5},hover:{stroke:'black',"stroke-width":2,cursor:'pointer'},selected:{fill:'blue'},selectedHover:{}},markerLabelStyle:{initial:{'font-family':'Verdana','font-size':'12','font-weight':'bold',cursor:'default',fill:'black'},hover:{cursor:'pointer'}}};jvm.Map.apiEvents={onRegionTipShow:'regionTipShow',onRegionOver:'regionOver',onRegionOut:'regionOut',onRegionClick:'regionClick',onRegionSelected:'regionSelected',onMarkerTipShow:'markerTipShow',onMarkerOver:'markerOver',onMarkerOut:'markerOut',onMarkerClick:'markerClick',onMarkerSelected:'markerSelected',onViewportChange:'viewportChange'};jvm.MultiMap=function(params){var that=this;this.maps={};this.params=jvm.$.extend(!0,{},jvm.MultiMap.defaultParams,params);this.params.maxLevel=this.params.maxLevel||Number.MAX_VALUE;this.params.main=this.params.main||{};this.params.main.multiMapLevel=0;this.history=[this.addMap(this.params.main.map,this.params.main)];this.defaultProjection=this.history[0].mapData.projection.type;this.mapsLoaded={};this.params.container.css({position:'relative'});this.backButton=jvm.$('<div/>').addClass('jvectormap-goback').text('Back').appendTo(this.params.container);this.backButton.hide();this.backButton.click(function(){that.goBack()});this.spinner=jvm.$('<div/>').addClass('jvectormap-spinner').appendTo(this.params.container);this.spinner.hide()};jvm.MultiMap.prototype={addMap:function(name,config){var cnt=jvm.$('<div/>').css({width:'100%',height:'100%'});this.params.container.append(cnt);this.maps[name]=new jvm.Map(jvm.$.extend(config,{container:cnt}));if(this.params.maxLevel>config.multiMapLevel){this.maps[name].container.on('regionClick.jvectormap',{scope:this},function(e,code){var multimap=e.data.scope,mapName=multimap.params.mapNameByCode(code,multimap);if(!multimap.drillDownPromise||multimap.drillDownPromise.state()!=='pending'){multimap.drillDown(mapName,code)}})}
return this.maps[name]},downloadMap:function(code){var that=this,deferred=jvm.$.Deferred();if(!this.mapsLoaded[code]){jvm.$.get(this.params.mapUrlByCode(code,this)).then(function(){that.mapsLoaded[code]=!0;deferred.resolve()},function(){deferred.reject()})}else{deferred.resolve()}
return deferred},drillDown:function(name,code){var currentMap=this.history[this.history.length-1],that=this,focusPromise=currentMap.setFocus({region:code,animate:!0}),downloadPromise=this.downloadMap(code);focusPromise.then(function(){if(downloadPromise.state()==='pending'){that.spinner.show()}});downloadPromise.always(function(){that.spinner.hide()});this.drillDownPromise=jvm.$.when(downloadPromise,focusPromise);this.drillDownPromise.then(function(){currentMap.params.container.hide();if(!that.maps[name]){that.addMap(name,{map:name,multiMapLevel:currentMap.params.multiMapLevel+1})}else{that.maps[name].params.container.show()}
that.history.push(that.maps[name]);that.backButton.show()})},goBack:function(){var currentMap=this.history.pop(),prevMap=this.history[this.history.length-1],that=this;currentMap.setFocus({scale:1,x:0.5,y:0.5,animate:!0}).then(function(){currentMap.params.container.hide();prevMap.params.container.show();prevMap.updateSize();if(that.history.length===1){that.backButton.hide()}
prevMap.setFocus({scale:1,x:0.5,y:0.5,animate:!0})})}};jvm.MultiMap.defaultParams={mapNameByCode:function(code,multiMap){return code.toLowerCase()+'_'+multiMap.defaultProjection+'_en'},mapUrlByCode:function(code,multiMap){return'jquery-jvectormap-data-'+code.toLowerCase()+'-'+multiMap.defaultProjection+'-en.js'}};(function($,global,undefined){'use strict';$.quicksearch={defaults:{delay:100,selector:null,stripeRows:null,loader:null,caseSensitive:!1,noResults:'',matchedResultsCount:0,keyCode:!1,bind:'keyup search input',resetBind:'reset',removeDiacritics:!1,minValLength:0,onBefore:$.noop,onAfter:$.noop,onValTooSmall:$.noop,onNoResultFound:null,show:function(){$(this).show()},hide:function(){$(this).hide()},prepareQuery:function(val){return val.toLowerCase().split(' ')},testQuery:function(query,txt,_row){for(var i=0;i<query.length;i+=1){if(txt.indexOf(query[i])===-1){return!1}}
return!0}},diacriticsRemovalMap:[{'base':'A','letters':/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{'base':'AA','letters':/[\uA732]/g},{'base':'AE','letters':/[\u00C6\u01FC\u01E2]/g},{'base':'AO','letters':/[\uA734]/g},{'base':'AU','letters':/[\uA736]/g},{'base':'AV','letters':/[\uA738\uA73A]/g},{'base':'AY','letters':/[\uA73C]/g},{'base':'B','letters':/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{'base':'C','letters':/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{'base':'D','letters':/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{'base':'DZ','letters':/[\u01F1\u01C4]/g},{'base':'Dz','letters':/[\u01F2\u01C5]/g},{'base':'E','letters':/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{'base':'F','letters':/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{'base':'G','letters':/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{'base':'H','letters':/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{'base':'I','letters':/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{'base':'J','letters':/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{'base':'K','letters':/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{'base':'L','letters':/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{'base':'LJ','letters':/[\u01C7]/g},{'base':'Lj','letters':/[\u01C8]/g},{'base':'M','letters':/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{'base':'N','letters':/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{'base':'NJ','letters':/[\u01CA]/g},{'base':'Nj','letters':/[\u01CB]/g},{'base':'O','letters':/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{'base':'OI','letters':/[\u01A2]/g},{'base':'OO','letters':/[\uA74E]/g},{'base':'OU','letters':/[\u0222]/g},{'base':'P','letters':/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{'base':'Q','letters':/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{'base':'R','letters':/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{'base':'S','letters':/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{'base':'T','letters':/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{'base':'TZ','letters':/[\uA728]/g},{'base':'U','letters':/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{'base':'V','letters':/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{'base':'VY','letters':/[\uA760]/g},{'base':'W','letters':/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{'base':'X','letters':/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{'base':'Y','letters':/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{'base':'Z','letters':/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{'base':'a','letters':/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{'base':'aa','letters':/[\uA733]/g},{'base':'ae','letters':/[\u00E6\u01FD\u01E3]/g},{'base':'ao','letters':/[\uA735]/g},{'base':'au','letters':/[\uA737]/g},{'base':'av','letters':/[\uA739\uA73B]/g},{'base':'ay','letters':/[\uA73D]/g},{'base':'b','letters':/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{'base':'c','letters':/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{'base':'d','letters':/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{'base':'dz','letters':/[\u01F3\u01C6]/g},{'base':'e','letters':/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{'base':'f','letters':/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{'base':'g','letters':/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{'base':'h','letters':/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{'base':'hv','letters':/[\u0195]/g},{'base':'i','letters':/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{'base':'j','letters':/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{'base':'k','letters':/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{'base':'l','letters':/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{'base':'lj','letters':/[\u01C9]/g},{'base':'m','letters':/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{'base':'n','letters':/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{'base':'nj','letters':/[\u01CC]/g},{'base':'o','letters':/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{'base':'oi','letters':/[\u01A3]/g},{'base':'ou','letters':/[\u0223]/g},{'base':'oo','letters':/[\uA74F]/g},{'base':'p','letters':/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{'base':'q','letters':/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{'base':'r','letters':/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{'base':'s','letters':/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{'base':'t','letters':/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{'base':'tz','letters':/[\uA729]/g},{'base':'u','letters':/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{'base':'v','letters':/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{'base':'vy','letters':/[\uA761]/g},{'base':'w','letters':/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{'base':'x','letters':/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{'base':'y','letters':/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{'base':'z','letters':/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}]};$.fn.quicksearch=function(target,opt){this.removeDiacritics=function(str){var changes=$.quicksearch.diacriticsRemovalMap;for(var i=0;i<changes.length;i++){str=str.replace(changes[i].letters,changes[i].base)}
return str};var timeout,cache,rowcache,jq_results,val='',last_val='',self=this,options=$.extend({},$.quicksearch.defaults,opt);options.noResults=!options.noResults?$():$(options.noResults);options.loader=!options.loader?$():$(options.loader);this.go=function(){var i=0,len=0,numMatchedRows=0,noresults=!0,query,val_empty=(val.replace(' ','').length===0);if(options.removeDiacritics){val=self.removeDiacritics(val)}
query=options.prepareQuery(val);for(i=0,len=rowcache.length;i<len;i++){if(query.length>0&&query[0].length<options.minValLength){options.show.apply(rowcache[i]);noresults=!1;numMatchedRows++}else if(val_empty||options.testQuery(query,cache[i],rowcache[i])){options.show.apply(rowcache[i]);noresults=!1;numMatchedRows++}else{options.hide.apply(rowcache[i])}}
if(noresults){if($.isFunction(options.onNoResultFound)){options.onNoResultFound(this)}else{this.results(!1)}}else{this.results(!0);this.stripe()}
this.matchedResultsCount=numMatchedRows;this.loader(!1);options.onAfter.call(this);last_val=val;return this};this.search=function(submittedVal){val=submittedVal;self.trigger()};this.reset=function(){val='';this.loader(!0);options.onBefore.call(this);global.clearTimeout(timeout);timeout=global.setTimeout(function(){self.go()},options.delay)};this.currentMatchedResults=function(){return this.matchedResultsCount};this.stripe=function(){if(typeof options.stripeRows==="object"&&options.stripeRows!==null){var joined=options.stripeRows.join(' ');var stripeRows_length=options.stripeRows.length;jq_results.not(':hidden').each(function(i){$(this).removeClass(joined).addClass(options.stripeRows[i%stripeRows_length])})}
return this};this.strip_html=function(input){var output=input.replace(new RegExp('<[^<]+\\>','g'),' ');if(!options.caseSensitive){output=output.toLowerCase()}
output=$.trim(output);return output};this.results=function(bool){if(!!options.noResults.length){options.noResults[bool?'hide':'show']()}
return this};this.loader=function(bool){if(!!options.loader.length){options.loader[bool?'show':'hide']()}
return this};this.cache=function(doRedraw){doRedraw=(typeof doRedraw==="undefined")?!0:doRedraw;jq_results=$(target).not(options.noResults);if(typeof options.selector==="string"){cache=jq_results.map(function(){return $(this).find(options.selector).map(function(){var temp=self.strip_html(this.innerHTML);return options.removeDiacritics?self.removeDiacritics(temp):temp}).get().join(" ")})}else{cache=jq_results.map(function(){var temp=self.strip_html(this.innerHTML);return options.removeDiacritics?self.removeDiacritics(temp):temp})}
rowcache=jq_results.map(function(){return this});val=val||this.val()||"";if(doRedraw){this.go()}
return this};this.trigger=function(){if((val.length<options.minValLength&&val.length>last_val.length)||(val.length<options.minValLength-1&&val.length<last_val.length)){options.onValTooSmall.call(this,val);self.go()}else{this.loader(!0);options.onBefore.call(this);global.clearTimeout(timeout);timeout=global.setTimeout(function(){self.go()},options.delay)}
return this};this.cache();this.stripe();this.loader(!1);return this.each(function(){$(this).on(options.bind,function(e){if(options.keyCode){var keycode=e.keyCode||e.which;if(keycode===options.keyCode){val=$(this).val();self.trigger()}}else{val=$(this).val();self.trigger()}});$(this).on(options.resetBind,function(){val='';self.reset()})})};if(global.module&&global.module.exports){module.exports=$.fn.quicksearch}})(jQuery,window||global);(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else{factory(jQuery)}})(function($){"use strict";$.ui=$.ui||{};return $.ui.version="1.13.3"});/*!
 * jQuery UI Widget 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";var widgetUuid=0;var widgetHasOwnProperty=Array.prototype.hasOwnProperty;var widgetSlice=Array.prototype.slice;$.cleanData=(function(orig){return function(elems){var events,elem,i;for(i=0;(elem=elems[i])!=null;i++){events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler("remove")}}
orig(elems)}})($.cleanData);$.widget=function(name,base,prototype){var existingConstructor,constructor,basePrototype;var proxiedPrototype={};var namespace=name.split(".")[0];name=name.split(".")[1];var fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget}
if(Array.isArray(prototype)){prototype=$.extend.apply(null,[{}].concat(prototype))}
$.expr.pseudos[fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName)};$[namespace]=$[namespace]||{};existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(!this||!this._createWidget){return new constructor(options,element)}
if(arguments.length){this._createWidget(options,element)}};$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]});basePrototype=new base();basePrototype.options=$.widget.extend({},basePrototype.options);$.each(prototype,function(prop,value){if(typeof value!=="function"){proxiedPrototype[prop]=value;return}
proxiedPrototype[prop]=(function(){function _super(){return base.prototype[prop].apply(this,arguments)}
function _superApply(args){return base.prototype[prop].apply(this,args)}
return function(){var __super=this._super;var __superApply=this._superApply;var returnValue;this._super=_super;this._superApply=_superApply;returnValue=value.apply(this,arguments);this._super=__super;this._superApply=__superApply;return returnValue}})()});constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?(basePrototype.widgetEventPrefix||name):name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName});if(existingConstructor){$.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto)});delete existingConstructor._childConstructors}else{base._childConstructors.push(constructor)}
$.widget.bridge(name,constructor);return constructor};$.widget.extend=function(target){var input=widgetSlice.call(arguments,1);var inputIndex=0;var inputLength=input.length;var key;var value;for(;inputIndex<inputLength;inputIndex++){for(key in input[inputIndex]){value=input[inputIndex][key];if(widgetHasOwnProperty.call(input[inputIndex],key)&&value!==undefined){if($.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value)}else{target[key]=value}}}}
return target};$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall=typeof options==="string";var args=widgetSlice.call(arguments,1);var returnValue=this;if(isMethodCall){if(!this.length&&options==="instance"){returnValue=undefined}else{this.each(function(){var methodValue;var instance=$.data(this,fullName);if(options==="instance"){returnValue=instance;return!1}
if(!instance){return $.error("cannot call methods on "+name+" prior to initialization; "+"attempted to call method '"+options+"'")}
if(typeof instance[options]!=="function"||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for "+name+" widget instance")}
methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return!1}})}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args))}
this.each(function(){var instance=$.data(this,fullName);if(instance){instance.option(options||{});if(instance._init){instance._init()}}else{$.data(this,fullName,new object(options,this))}})}
return returnValue}};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0];this.element=$(element);this.uuid=widgetUuid++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=$();this.hoverable=$();this.focusable=$();this.classesElementLookup={};if(element!==this){$.data(element,this.widgetFullName,this);this._on(!0,this.element,{remove:function(event){if(event.target===element){this.destroy()}}});this.document=$(element.style?element.ownerDocument:element.document||element);this.window=$(this.document[0].defaultView||this.document[0].parentWindow)}
this.options=$.widget.extend({},this.options,this._getCreateOptions(),options);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)}
this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){var that=this;this._destroy();$.each(this.classesElementLookup,function(key,value){that._removeClass(value,key)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:$.noop,widget:function(){return this.element},option:function(key,value){var options=key;var parts;var curOption;var i;if(arguments.length===0){return $.widget.extend({},this.options)}
if(typeof key==="string"){options={};parts=key.split(".");key=parts.shift();if(parts.length){curOption=options[key]=$.widget.extend({},this.options[key]);for(i=0;i<parts.length-1;i++){curOption[parts[i]]=curOption[parts[i]]||{};curOption=curOption[parts[i]]}
key=parts.pop();if(arguments.length===1){return curOption[key]===undefined?null:curOption[key]}
curOption[key]=value}else{if(arguments.length===1){return this.options[key]===undefined?null:this.options[key]}
options[key]=value}}
this._setOptions(options);return this},_setOptions:function(options){var key;for(key in options){this._setOption(key,options[key])}
return this},_setOption:function(key,value){if(key==="classes"){this._setOptionClasses(value)}
this.options[key]=value;if(key==="disabled"){this._setOptionDisabled(value)}
return this},_setOptionClasses:function(value){var classKey,elements,currentElements;for(classKey in value){currentElements=this.classesElementLookup[classKey];if(value[classKey]===this.options.classes[classKey]||!currentElements||!currentElements.length){continue}
elements=$(currentElements.get());this._removeClass(currentElements,classKey);elements.addClass(this._classes({element:elements,keys:classKey,classes:value,add:!0}))}},_setOptionDisabled:function(value){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!value);if(value){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(options){var full=[];var that=this;options=$.extend({element:this.element,classes:this.options.classes||{}},options);function bindRemoveEvent(){var nodesToBind=[];options.element.each(function(_,element){var isTracked=$.map(that.classesElementLookup,function(elements){return elements}).some(function(elements){return elements.is(element)});if(!isTracked){nodesToBind.push(element)}});that._on($(nodesToBind),{remove:"_untrackClassesElement"})}
function processClassString(classes,checkOption){var current,i;for(i=0;i<classes.length;i++){current=that.classesElementLookup[classes[i]]||$();if(options.add){bindRemoveEvent();current=$($.uniqueSort(current.get().concat(options.element.get())))}else{current=$(current.not(options.element).get())}
that.classesElementLookup[classes[i]]=current;full.push(classes[i]);if(checkOption&&options.classes[classes[i]]){full.push(options.classes[classes[i]])}}}
if(options.keys){processClassString(options.keys.match(/\S+/g)||[],!0)}
if(options.extra){processClassString(options.extra.match(/\S+/g)||[])}
return full.join(" ")},_untrackClassesElement:function(event){var that=this;$.each(that.classesElementLookup,function(key,value){if($.inArray(event.target,value)!==-1){that.classesElementLookup[key]=$(value.not(event.target).get())}});this._off($(event.target))},_removeClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,!1)},_addClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,!0)},_toggleClass:function(element,keys,extra,add){add=(typeof add==="boolean")?add:extra;var shift=(typeof element==="string"||element===null),options={extra:shift?keys:extra,keys:shift?element:keys,element:shift?this.element:element,add:add};options.element.toggleClass(this._classes(options),add);return this},_on:function(suppressDisabledCheck,element,handlers){var delegateElement;var instance=this;if(typeof suppressDisabledCheck!=="boolean"){handlers=element;element=suppressDisabledCheck;suppressDisabledCheck=!1}
if(!handlers){handlers=element;element=this.element;delegateElement=this.widget()}else{element=delegateElement=$(element);this.bindings=this.bindings.add(element)}
$.each(handlers,function(event,handler){function handlerProxy(){if(!suppressDisabledCheck&&(instance.options.disabled===!0||$(this).hasClass("ui-state-disabled"))){return}
return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments)}
if(typeof handler!=="string"){handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++}
var match=event.match(/^([\w:-]*)\s*(.*)$/);var eventName=match[1]+instance.eventNamespace;var selector=match[2];if(selector){delegateElement.on(eventName,selector,handlerProxy)}else{element.on(eventName,handlerProxy)}})},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;element.off(eventName);this.bindings=$(this.bindings.not(element).get());this.focusable=$(this.focusable.not(element).get());this.hoverable=$(this.hoverable.not(element).get())},_delay:function(handler,delay){function handlerProxy(){return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments)}
var instance=this;return setTimeout(handlerProxy,delay||0)},_hoverable:function(element){this.hoverable=this.hoverable.add(element);this._on(element,{mouseenter:function(event){this._addClass($(event.currentTarget),null,"ui-state-hover")},mouseleave:function(event){this._removeClass($(event.currentTarget),null,"ui-state-hover")}})},_focusable:function(element){this.focusable=this.focusable.add(element);this._on(element,{focusin:function(event){this._addClass($(event.currentTarget),null,"ui-state-focus")},focusout:function(event){this._removeClass($(event.currentTarget),null,"ui-state-focus")}})},_trigger:function(type,event,data){var prop,orig;var callback=this.options[type];data=data||{};event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();event.target=this.element[0];orig=event.originalEvent;if(orig){for(prop in orig){if(!(prop in event)){event[prop]=orig[prop]}}}
this.element.trigger(event,data);return!(typeof callback==="function"&&callback.apply(this.element[0],[event].concat(data))===!1||event.isDefaultPrevented())}};$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){if(typeof options==="string"){options={effect:options}}
var hasOptions;var effectName=!options?method:options===!0||typeof options==="number"?defaultEffect:options.effect||defaultEffect;options=options||{};if(typeof options==="number"){options={duration:options}}else if(options===!0){options={}}
hasOptions=!$.isEmptyObject(options);options.complete=callback;if(options.delay){element.delay(options.delay)}
if(hasOptions&&$.effects&&$.effects.effect[effectName]){element[method](options)}else if(effectName!==method&&element[effectName]){element[effectName](options.duration,options.easing,callback)}else{element.queue(function(next){$(this)[method]();if(callback){callback.call(element[0])}
next()})}}});return $.widget});(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]])}},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(!set){return}
if(!allowDisconnected&&(!instance.element[0].parentNode||instance.element[0].parentNode.nodeType===11)){return}
for(i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args)}}}}});/*!
 * jQuery UI Position 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 *
 * https://api.jqueryui.com/position/
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";(function(){var cachedScrollbarWidth,max=Math.max,abs=Math.abs,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)]}
function parseCss(element,property){return parseInt($.css(element,property),10)||0}
function isWindow(obj){return obj!=null&&obj===obj.window}
function getDimensions(elem){var raw=elem[0];if(raw.nodeType===9){return{width:elem.width(),height:elem.height(),offset:{top:0,left:0}}}
if(isWindow(raw)){return{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}}}
if(raw.preventDefault){return{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}}}
return{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()}}
$.position={scrollbarWidth:function(){if(cachedScrollbarWidth!==undefined){return cachedScrollbarWidth}
var w1,w2,div=$("<div style="+"'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>"+"<div style='height:300px;width:auto;'></div></div>"),innerDiv=div.children()[0];$("body").append(div);w1=innerDiv.offsetWidth;div.css("overflow","scroll");w2=innerDiv.offsetWidth;if(w1===w2){w2=div[0].clientWidth}
div.remove();return(cachedScrollbarWidth=w1-w2)},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),hasOverflowX=overflowX==="scroll"||(overflowX==="auto"&&within.width<within.element[0].scrollWidth),hasOverflowY=overflowY==="scroll"||(overflowY==="auto"&&within.height<within.element[0].scrollHeight);return{width:hasOverflowY?$.position.scrollbarWidth():0,height:hasOverflowX?$.position.scrollbarWidth():0}},getWithinInfo:function(element){var withinElement=$(element||window),isElemWindow=isWindow(withinElement[0]),isDocument=!!withinElement[0]&&withinElement[0].nodeType===9,hasOffset=!isElemWindow&&!isDocument;return{element:withinElement,isWindow:isElemWindow,isDocument:isDocument,offset:hasOffset?$(element).offset():{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),width:withinElement.outerWidth(),height:withinElement.outerHeight()}}};$.fn.position=function(options){if(!options||!options.of){return _position.apply(this,arguments)}
options=$.extend({},options);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,dimensions,target=typeof options.of==="string"?$(document).find(options.of):$(options.of),within=$.position.getWithinInfo(options.within),scrollInfo=$.position.getScrollInfo(within),collision=(options.collision||"flip").split(" "),offsets={};dimensions=getDimensions(target);if(target[0].preventDefault){options.at="left top"}
targetWidth=dimensions.width;targetHeight=dimensions.height;targetOffset=dimensions.offset;basePosition=$.extend({},targetOffset);$.each(["my","at"],function(){var pos=(options[this]||"").split(" "),horizontalOffset,verticalOffset;if(pos.length===1){pos=rhorizontal.test(pos[0])?pos.concat(["center"]):rvertical.test(pos[0])?["center"].concat(pos):["center","center"]}
pos[0]=rhorizontal.test(pos[0])?pos[0]:"center";pos[1]=rvertical.test(pos[1])?pos[1]:"center";horizontalOffset=roffset.exec(pos[0]);verticalOffset=roffset.exec(pos[1]);offsets[this]=[horizontalOffset?horizontalOffset[0]:0,verticalOffset?verticalOffset[0]:0];options[this]=[rposition.exec(pos[0])[0],rposition.exec(pos[1])[0]]});if(collision.length===1){collision[1]=collision[0]}
if(options.at[0]==="right"){basePosition.left+=targetWidth}else if(options.at[0]==="center"){basePosition.left+=targetWidth/2}
if(options.at[1]==="bottom"){basePosition.top+=targetHeight}else if(options.at[1]==="center"){basePosition.top+=targetHeight/2}
atOffset=getOffsets(offsets.at,targetWidth,targetHeight);basePosition.left+=atOffset[0];basePosition.top+=atOffset[1];return this.each(function(){var collisionPosition,using,elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseCss(this,"marginLeft"),marginTop=parseCss(this,"marginTop"),collisionWidth=elemWidth+marginLeft+parseCss(this,"marginRight")+scrollInfo.width,collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+scrollInfo.height,position=$.extend({},basePosition),myOffset=getOffsets(offsets.my,elem.outerWidth(),elem.outerHeight());if(options.my[0]==="right"){position.left-=elemWidth}else if(options.my[0]==="center"){position.left-=elemWidth/2}
if(options.my[1]==="bottom"){position.top-=elemHeight}else if(options.my[1]==="center"){position.top-=elemHeight/2}
position.left+=myOffset[0];position.top+=myOffset[1];collisionPosition={marginLeft:marginLeft,marginTop:marginTop};$.each(["left","top"],function(i,dir){if($.ui.position[collision[i]]){$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:[atOffset[0]+myOffset[0],atOffset[1]+myOffset[1]],my:options.my,at:options.at,within:within,elem:elem})}});if(options.using){using=function(props){var left=targetOffset.left-position.left,right=left+targetWidth-elemWidth,top=targetOffset.top-position.top,bottom=top+targetHeight-elemHeight,feedback={target:{element:target,left:targetOffset.left,top:targetOffset.top,width:targetWidth,height:targetHeight},element:{element:elem,left:position.left,top:position.top,width:elemWidth,height:elemHeight},horizontal:right<0?"left":left>0?"right":"center",vertical:bottom<0?"top":top>0?"bottom":"middle"};if(targetWidth<elemWidth&&abs(left+right)<targetWidth){feedback.horizontal="center"}
if(targetHeight<elemHeight&&abs(top+bottom)<targetHeight){feedback.vertical="middle"}
if(max(abs(left),abs(right))>max(abs(top),abs(bottom))){feedback.important="horizontal"}else{feedback.important="vertical"}
options.using.call(this,props,feedback)}}
elem.offset($.extend(position,{using:using}))})};$.ui.position={fit:{left:function(position,data){var within=data.within,withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=withinOffset-collisionPosLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset,newOverRight;if(data.collisionWidth>outerWidth){if(overLeft>0&&overRight<=0){newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-withinOffset;position.left+=overLeft-newOverRight}else if(overRight>0&&overLeft<=0){position.left=withinOffset}else{if(overLeft>overRight){position.left=withinOffset+outerWidth-data.collisionWidth}else{position.left=withinOffset}}}else if(overLeft>0){position.left+=overLeft}else if(overRight>0){position.left-=overRight}else{position.left=max(position.left-collisionPosLeft,position.left)}},top:function(position,data){var within=data.within,withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset,newOverBottom;if(data.collisionHeight>outerHeight){if(overTop>0&&overBottom<=0){newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-withinOffset;position.top+=overTop-newOverBottom}else if(overBottom>0&&overTop<=0){position.top=withinOffset}else{if(overTop>overBottom){position.top=withinOffset+outerHeight-data.collisionHeight}else{position.top=withinOffset}}}else if(overTop>0){position.top+=overTop}else if(overBottom>0){position.top-=overBottom}else{position.top=max(position.top-collisionPosTop,position.top)}}},flip:{left:function(position,data){var within=data.within,withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=collisionPosLeft-offsetLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset=data.my[0]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0,atOffset=data.at[0]==="left"?data.targetWidth:data.at[0]==="right"?-data.targetWidth:0,offset=-2*data.offset[0],newOverRight,newOverLeft;if(overLeft<0){newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-outerWidth-withinOffset;if(newOverRight<0||newOverRight<abs(overLeft)){position.left+=myOffset+atOffset+offset}}else if(overRight>0){newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+atOffset+offset-offsetLeft;if(newOverLeft>0||abs(newOverLeft)<overRight){position.left+=myOffset+atOffset+offset}}},top:function(position,data){var within=data.within,withinOffset=within.offset.top+within.scrollTop,outerHeight=within.height,offsetTop=within.isWindow?within.scrollTop:within.offset.top,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=collisionPosTop-offsetTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-offsetTop,top=data.my[1]==="top",myOffset=top?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0,atOffset=data.at[1]==="top"?data.targetHeight:data.at[1]==="bottom"?-data.targetHeight:0,offset=-2*data.offset[1],newOverTop,newOverBottom;if(overTop<0){newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-outerHeight-withinOffset;if(newOverBottom<0||newOverBottom<abs(overTop)){position.top+=myOffset+atOffset+offset}}else if(overBottom>0){newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+offset-offsetTop;if(newOverTop>0||abs(newOverTop)<overBottom){position.top+=myOffset+atOffset+offset}}}},flipfit:{left:function(){$.ui.position.flip.left.apply(this,arguments);$.ui.position.fit.left.apply(this,arguments)},top:function(){$.ui.position.flip.top.apply(this,arguments);$.ui.position.fit.top.apply(this,arguments)}}}})();return $.ui.position});/*!
 * jQuery UI :data 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.extend($.expr.pseudos,{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName)}}):function(elem,i,match){return!!$.data(elem,match[3])}})});/*!
 * jQuery UI Disable Selection 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.fn.extend({disableSelection:(function(){var eventType="onselectstart" in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(eventType+".ui-disableSelection",function(event){event.preventDefault()})}})(),enableSelection:function(){return this.off(".ui-disableSelection")}})});/*!
 * jQuery UI Focusable 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";$.ui.focusable=function(element,hasTabindex){var map,mapName,img,focusableIfVisible,fieldset,nodeName=element.nodeName.toLowerCase();if("area"===nodeName){map=element.parentNode;mapName=map.name;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return!1}
img=$("img[usemap='#"+mapName+"']");return img.length>0&&img.is(":visible")}
if(/^(input|select|textarea|button|object)$/.test(nodeName)){focusableIfVisible=!element.disabled;if(focusableIfVisible){fieldset=$(element).closest("fieldset")[0];if(fieldset){focusableIfVisible=!fieldset.disabled}}}else if("a"===nodeName){focusableIfVisible=element.href||hasTabindex}else{focusableIfVisible=hasTabindex}
return focusableIfVisible&&$(element).is(":visible")&&visible($(element))};function visible(element){var visibility=element.css("visibility");while(visibility==="inherit"){element=element.parent();visibility=element.css("visibility")}
return visibility==="visible"}
$.extend($.expr.pseudos,{focusable:function(element){return $.ui.focusable(element,$.attr(element,"tabindex")!=null)}});return $.ui.focusable});/*!
 * jQuery UI Form Reset Mixin 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./form","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.ui.formResetMixin={_formResetHandler:function(){var form=$(this);setTimeout(function(){var instances=form.data("ui-form-reset-instances");$.each(instances,function(){this.refresh()})})},_bindFormResetHandler:function(){this.form=this.element._form();if(!this.form.length){return}
var instances=this.form.data("ui-form-reset-instances")||[];if(!instances.length){this.form.on("reset.ui-form-reset",this._formResetHandler)}
instances.push(this);this.form.data("ui-form-reset-instances",instances)},_unbindFormResetHandler:function(){if(!this.form.length){return}
var instances=this.form.data("ui-form-reset-instances");instances.splice($.inArray(this,instances),1);if(instances.length){this.form.data("ui-form-reset-instances",instances)}else{this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}}});/*!
 * jQuery UI Support for jQuery core 1.8.x and newer 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 *
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";if(!$.expr.pseudos){$.expr.pseudos=$.expr[":"]}
if(!$.uniqueSort){$.uniqueSort=$.unique}
if(!$.escapeSelector){var rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;var fcssescape=function(ch,asCodePoint){if(asCodePoint){if(ch==="\0"){return"\uFFFD"}
return ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" "}
return"\\"+ch};$.escapeSelector=function(sel){return(sel+"").replace(rcssescape,fcssescape)}}
if(!$.fn.even||!$.fn.odd){$.fn.extend({even:function(){return this.filter(function(i){return i%2===0})},odd:function(){return this.filter(function(i){return i%2===1})}})}});/*!
 * jQuery UI Keycode 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});/*!
 * jQuery UI Labels 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.fn.labels=function(){var ancestor,selector,id,labels,ancestors;if(!this.length){return this.pushStack([])}
if(this[0].labels&&this[0].labels.length){return this.pushStack(this[0].labels)}
labels=this.eq(0).parents("label");id=this.attr("id");if(id){ancestor=this.eq(0).parents().last();ancestors=ancestor.add(ancestor.length?ancestor.siblings():this.siblings());selector="label[for='"+$.escapeSelector(id)+"']";labels=labels.add(ancestors.find(selector).addBack(selector))}
return this.pushStack(labels)}});/*!
 * jQuery UI Scroll Parent 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.fn.scrollParent=function(includeHidden){var position=this.css("position"),excludeStaticParent=position==="absolute",overflowRegex=includeHidden?/(auto|scroll|hidden)/:/(auto|scroll)/,scrollParent=this.parents().filter(function(){var parent=$(this);if(excludeStaticParent&&parent.css("position")==="static"){return!1}
return overflowRegex.test(parent.css("overflow")+parent.css("overflow-y")+parent.css("overflow-x"))}).eq(0);return position==="fixed"||!scrollParent.length?$(this[0].ownerDocument||document):scrollParent}});/*!
 * jQuery UI Tabbable 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version","./focusable"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.extend($.expr.pseudos,{tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),hasTabindex=tabIndex!=null;return(!hasTabindex||tabIndex>=0)&&$.ui.focusable(element,hasTabindex)}})});/*!
 * jQuery UI Unique ID 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.fn.extend({uniqueId:(function(){var uuid=0;return function(){return this.each(function(){if(!this.id){this.id="ui-id-"+(++uuid)}})}})(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id)){$(this).removeAttr("id")}})}})});/*!
 * jQuery UI Effects 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./jquery-var-for-color","./vendor/jquery-color/jquery.color","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";var dataSpace="ui-effects-",dataSpaceStyle="ui-effects-style",dataSpaceAnimated="ui-effects-animated";$.effects={effect:{}};(function(){var classAnimationActions=["add","remove","toggle"],shorthandStyles={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};$.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(_,prop){$.fx.step[prop]=function(fx){if(fx.end!=="none"&&!fx.setAttr||fx.pos===1&&!fx.setAttr){jQuery.style(fx.elem,prop,fx.end);fx.setAttr=!0}}});function camelCase(string){return string.replace(/-([\da-z])/gi,function(all,letter){return letter.toUpperCase()})}
function getElementStyles(elem){var key,len,style=elem.ownerDocument.defaultView?elem.ownerDocument.defaultView.getComputedStyle(elem,null):elem.currentStyle,styles={};if(style&&style.length&&style[0]&&style[style[0]]){len=style.length;while(len--){key=style[len];if(typeof style[key]==="string"){styles[camelCase(key)]=style[key]}}}else{for(key in style){if(typeof style[key]==="string"){styles[key]=style[key]}}}
return styles}
function styleDifference(oldStyle,newStyle){var diff={},name,value;for(name in newStyle){value=newStyle[name];if(oldStyle[name]!==value){if(!shorthandStyles[name]){if($.fx.step[name]||!isNaN(parseFloat(value))){diff[name]=value}}}}
return diff}
if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector))}}
$.effects.animateClass=function(value,duration,easing,callback){var o=$.speed(duration,easing,callback);return this.queue(function(){var animated=$(this),baseClass=animated.attr("class")||"",applyClassChange,allAnimations=o.children?animated.find("*").addBack():animated;allAnimations=allAnimations.map(function(){var el=$(this);return{el:el,start:getElementStyles(this)}});applyClassChange=function(){$.each(classAnimationActions,function(i,action){if(value[action]){animated[action+"Class"](value[action])}})};applyClassChange();allAnimations=allAnimations.map(function(){this.end=getElementStyles(this.el[0]);this.diff=styleDifference(this.start,this.end);return this});animated.attr("class",baseClass);allAnimations=allAnimations.map(function(){var styleInfo=this,dfd=$.Deferred(),opts=$.extend({},o,{queue:!1,complete:function(){dfd.resolve(styleInfo)}});this.el.animate(this.diff,opts);return dfd.promise()});$.when.apply($,allAnimations.get()).done(function(){applyClassChange();$.each(arguments,function(){var el=this.el;$.each(this.diff,function(key){el.css(key,"")})});o.complete.call(animated[0])})})};$.fn.extend({addClass:(function(orig){return function(classNames,speed,easing,callback){return speed?$.effects.animateClass.call(this,{add:classNames},speed,easing,callback):orig.apply(this,arguments)}})($.fn.addClass),removeClass:(function(orig){return function(classNames,speed,easing,callback){return arguments.length>1?$.effects.animateClass.call(this,{remove:classNames},speed,easing,callback):orig.apply(this,arguments)}})($.fn.removeClass),toggleClass:(function(orig){return function(classNames,force,speed,easing,callback){if(typeof force==="boolean"||force===undefined){if(!speed){return orig.apply(this,arguments)}else{return $.effects.animateClass.call(this,(force?{add:classNames}:{remove:classNames}),speed,easing,callback)}}else{return $.effects.animateClass.call(this,{toggle:classNames},force,speed,easing)}}})($.fn.toggleClass),switchClass:function(remove,add,speed,easing,callback){return $.effects.animateClass.call(this,{add:add,remove:remove},speed,easing,callback)}})})();(function(){if($.expr&&$.expr.pseudos&&$.expr.pseudos.animated){$.expr.pseudos.animated=(function(orig){return function(elem){return!!$(elem).data(dataSpaceAnimated)||orig(elem)}})($.expr.pseudos.animated)}
if($.uiBackCompat!==!1){$.extend($.effects,{save:function(element,set){var i=0,length=set.length;for(;i<length;i++){if(set[i]!==null){element.data(dataSpace+set[i],element[0].style[set[i]])}}},restore:function(element,set){var val,i=0,length=set.length;for(;i<length;i++){if(set[i]!==null){val=element.data(dataSpace+set[i]);element.css(set[i],val)}}},setMode:function(el,mode){if(mode==="toggle"){mode=el.is(":hidden")?"show":"hide"}
return mode},createWrapper:function(element){if(element.parent().is(".ui-effects-wrapper")){return element.parent()}
var props={width:element.outerWidth(!0),height:element.outerHeight(!0),"float":element.css("float")},wrapper=$("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),size={width:element.width(),height:element.height()},active=document.activeElement;try{active.id}catch(e){active=document.body}
element.wrap(wrapper);if(element[0]===active||$.contains(element[0],active)){$(active).trigger("focus")}
wrapper=element.parent();if(element.css("position")==="static"){wrapper.css({position:"relative"});element.css({position:"relative"})}else{$.extend(props,{position:element.css("position"),zIndex:element.css("z-index")});$.each(["top","left","bottom","right"],function(i,pos){props[pos]=element.css(pos);if(isNaN(parseInt(props[pos],10))){props[pos]="auto"}});element.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}
element.css(size);return wrapper.css(props).show()},removeWrapper:function(element){var active=document.activeElement;if(element.parent().is(".ui-effects-wrapper")){element.parent().replaceWith(element);if(element[0]===active||$.contains(element[0],active)){$(active).trigger("focus")}}
return element}})}
$.extend($.effects,{version:"1.13.3",define:function(name,mode,effect){if(!effect){effect=mode;mode="effect"}
$.effects.effect[name]=effect;$.effects.effect[name].mode=mode;return effect},scaledDimensions:function(element,percent,direction){if(percent===0){return{height:0,width:0,outerHeight:0,outerWidth:0}}
var x=direction!=="horizontal"?((percent||100)/100):1,y=direction!=="vertical"?((percent||100)/100):1;return{height:element.height()*y,width:element.width()*x,outerHeight:element.outerHeight()*y,outerWidth:element.outerWidth()*x}},clipToBox:function(animation){return{width:animation.clip.right-animation.clip.left,height:animation.clip.bottom-animation.clip.top,left:animation.clip.left,top:animation.clip.top}},unshift:function(element,queueLength,count){var queue=element.queue();if(queueLength>1){queue.splice.apply(queue,[1,0].concat(queue.splice(queueLength,count)))}
element.dequeue()},saveStyle:function(element){element.data(dataSpaceStyle,element[0].style.cssText)},restoreStyle:function(element){element[0].style.cssText=element.data(dataSpaceStyle)||"";element.removeData(dataSpaceStyle)},mode:function(element,mode){var hidden=element.is(":hidden");if(mode==="toggle"){mode=hidden?"show":"hide"}
if(hidden?mode==="hide":mode==="show"){mode="none"}
return mode},getBaseline:function(origin,original){var y,x;switch(origin[0]){case "top":y=0;break;case "middle":y=0.5;break;case "bottom":y=1;break;default:y=origin[0]/original.height}
switch(origin[1]){case "left":x=0;break;case "center":x=0.5;break;case "right":x=1;break;default:x=origin[1]/original.width}
return{x:x,y:y}},createPlaceholder:function(element){var placeholder,cssPosition=element.css("position"),position=element.position();element.css({marginTop:element.css("marginTop"),marginBottom:element.css("marginBottom"),marginLeft:element.css("marginLeft"),marginRight:element.css("marginRight")}).outerWidth(element.outerWidth()).outerHeight(element.outerHeight());if(/^(static|relative)/.test(cssPosition)){cssPosition="absolute";placeholder=$("<"+element[0].nodeName+">").insertAfter(element).css({display:/^(inline|ruby)/.test(element.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:element.css("marginTop"),marginBottom:element.css("marginBottom"),marginLeft:element.css("marginLeft"),marginRight:element.css("marginRight"),"float":element.css("float")}).outerWidth(element.outerWidth()).outerHeight(element.outerHeight()).addClass("ui-effects-placeholder");element.data(dataSpace+"placeholder",placeholder)}
element.css({position:cssPosition,left:position.left,top:position.top});return placeholder},removePlaceholder:function(element){var dataKey=dataSpace+"placeholder",placeholder=element.data(dataKey);if(placeholder){placeholder.remove();element.removeData(dataKey)}},cleanUp:function(element){$.effects.restoreStyle(element);$.effects.removePlaceholder(element)},setTransition:function(element,list,factor,value){value=value||{};$.each(list,function(i,x){var unit=element.cssUnit(x);if(unit[0]>0){value[x]=unit[0]*factor+unit[1]}});return value}});function _normalizeArguments(effect,options,speed,callback){if($.isPlainObject(effect)){options=effect;effect=effect.effect}
effect={effect:effect};if(options==null){options={}}
if(typeof options==="function"){callback=options;speed=null;options={}}
if(typeof options==="number"||$.fx.speeds[options]){callback=speed;speed=options;options={}}
if(typeof speed==="function"){callback=speed;speed=null}
if(options){$.extend(effect,options)}
speed=speed||options.duration;effect.duration=$.fx.off?0:typeof speed==="number"?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default;effect.complete=callback||options.complete;return effect}
function standardAnimationOption(option){if(!option||typeof option==="number"||$.fx.speeds[option]){return!0}
if(typeof option==="string"&&!$.effects.effect[option]){return!0}
if(typeof option==="function"){return!0}
if(typeof option==="object"&&!option.effect){return!0}
return!1}
$.fn.extend({effect:function(){var args=_normalizeArguments.apply(this,arguments),effectMethod=$.effects.effect[args.effect],defaultMode=effectMethod.mode,queue=args.queue,queueName=queue||"fx",complete=args.complete,mode=args.mode,modes=[],prefilter=function(next){var el=$(this),normalizedMode=$.effects.mode(el,mode)||defaultMode;el.data(dataSpaceAnimated,!0);modes.push(normalizedMode);if(defaultMode&&(normalizedMode==="show"||(normalizedMode===defaultMode&&normalizedMode==="hide"))){el.show()}
if(!defaultMode||normalizedMode!=="none"){$.effects.saveStyle(el)}
if(typeof next==="function"){next()}};if($.fx.off||!effectMethod){if(mode){return this[mode](args.duration,complete)}else{return this.each(function(){if(complete){complete.call(this)}})}}
function run(next){var elem=$(this);function cleanup(){elem.removeData(dataSpaceAnimated);$.effects.cleanUp(elem);if(args.mode==="hide"){elem.hide()}
done()}
function done(){if(typeof complete==="function"){complete.call(elem[0])}
if(typeof next==="function"){next()}}
args.mode=modes.shift();if($.uiBackCompat!==!1&&!defaultMode){if(elem.is(":hidden")?mode==="hide":mode==="show"){elem[mode]();done()}else{effectMethod.call(elem[0],args,done)}}else{if(args.mode==="none"){elem[mode]();done()}else{effectMethod.call(elem[0],args,cleanup)}}}
return queue===!1?this.each(prefilter).each(run):this.queue(queueName,prefilter).queue(queueName,run)},show:(function(orig){return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments)}else{var args=_normalizeArguments.apply(this,arguments);args.mode="show";return this.effect.call(this,args)}}})($.fn.show),hide:(function(orig){return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments)}else{var args=_normalizeArguments.apply(this,arguments);args.mode="hide";return this.effect.call(this,args)}}})($.fn.hide),toggle:(function(orig){return function(option){if(standardAnimationOption(option)||typeof option==="boolean"){return orig.apply(this,arguments)}else{var args=_normalizeArguments.apply(this,arguments);args.mode="toggle";return this.effect.call(this,args)}}})($.fn.toggle),cssUnit:function(key){var style=this.css(key),val=[];$.each(["em","px","%","pt"],function(i,unit){if(style.indexOf(unit)>0){val=[parseFloat(style),unit]}});return val},cssClip:function(clipObj){if(clipObj){return this.css("clip","rect("+clipObj.top+"px "+clipObj.right+"px "+clipObj.bottom+"px "+clipObj.left+"px)")}
return parseClip(this.css("clip"),this)},transfer:function(options,done){var element=$(this),target=$(options.to),targetFixed=target.css("position")==="fixed",body=$("body"),fixTop=targetFixed?body.scrollTop():0,fixLeft=targetFixed?body.scrollLeft():0,endPosition=target.offset(),animation={top:endPosition.top-fixTop,left:endPosition.left-fixLeft,height:target.innerHeight(),width:target.innerWidth()},startPosition=element.offset(),transfer=$("<div class='ui-effects-transfer'></div>");transfer.appendTo("body").addClass(options.className).css({top:startPosition.top-fixTop,left:startPosition.left-fixLeft,height:element.innerHeight(),width:element.innerWidth(),position:targetFixed?"fixed":"absolute"}).animate(animation,options.duration,options.easing,function(){transfer.remove();if(typeof done==="function"){done()}})}});function parseClip(str,element){var outerWidth=element.outerWidth(),outerHeight=element.outerHeight(),clipRegex=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,values=clipRegex.exec(str)||["",0,outerWidth,outerHeight,0];return{top:parseFloat(values[1])||0,right:values[2]==="auto"?outerWidth:parseFloat(values[2]),bottom:values[3]==="auto"?outerHeight:parseFloat(values[3]),left:parseFloat(values[4])||0}}
$.fx.step.clip=function(fx){if(!fx.clipInit){fx.start=$(fx.elem).cssClip();if(typeof fx.end==="string"){fx.end=parseClip(fx.end,fx.elem)}
fx.clipInit=!0}
$(fx.elem).cssClip({top:fx.pos*(fx.end.top-fx.start.top)+fx.start.top,right:fx.pos*(fx.end.right-fx.start.right)+fx.start.right,bottom:fx.pos*(fx.end.bottom-fx.start.bottom)+fx.start.bottom,left:fx.pos*(fx.end.left-fx.start.left)+fx.start.left})}})();(function(){var baseEasings={};$.each(["Quad","Cubic","Quart","Quint","Expo"],function(i,name){baseEasings[name]=function(p){return Math.pow(p,i+2)}});$.extend(baseEasings,{Sine:function(p){return 1-Math.cos(p*Math.PI/2)},Circ:function(p){return 1-Math.sqrt(1-p*p)},Elastic:function(p){return p===0||p===1?p:-Math.pow(2,8*(p-1))*Math.sin(((p-1)*80-7.5)*Math.PI/15)},Back:function(p){return p*p*(3*p-2)},Bounce:function(p){var pow2,bounce=4;while(p<((pow2=Math.pow(2,--bounce))-1)/11){}
return 1/Math.pow(4,3-bounce)-7.5625*Math.pow((pow2*3-2)/22-p,2)}});$.each(baseEasings,function(name,easeIn){$.easing["easeIn"+name]=easeIn;$.easing["easeOut"+name]=function(p){return 1-easeIn(1-p)};$.easing["easeInOut"+name]=function(p){return p<0.5?easeIn(p*2)/2:1-easeIn(p*-2+2)/2}})})();return $.effects});/*!
 * jQuery UI Mouse 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../ie","../version","../widget"],factory)}else{factory(jQuery)}})(function($){"use strict";var mouseHandled=!1;$(document).on("mouseup",function(){mouseHandled=!1});return $.widget("ui.mouse",{version:"1.13.3",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var that=this;this.element.on("mousedown."+this.widgetName,function(event){return that._mouseDown(event)}).on("click."+this.widgetName,function(event){if(!0===$.data(event.target,that.widgetName+".preventClickEvent")){$.removeData(event.target,that.widgetName+".preventClickEvent");event.stopImmediatePropagation();return!1}});this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(event){if(mouseHandled){return}
this._mouseMoved=!1;if(this._mouseStarted){this._mouseUp(event)}
this._mouseDownEvent=event;var that=this,btnIsLeft=(event.which===1),elIsCancel=(typeof this.options.cancel==="string"&&event.target.nodeName?$(event.target).closest(this.options.cancel).length:!1);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return!0}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){that.mouseDelayMet=!0},this.options.delay)}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==!1);if(!this._mouseStarted){event.preventDefault();return!0}}
if(!0===$.data(event.target,this.widgetName+".preventClickEvent")){$.removeData(event.target,this.widgetName+".preventClickEvent")}
this._mouseMoveDelegate=function(event){return that._mouseMove(event)};this._mouseUpDelegate=function(event){return that._mouseUp(event)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);event.preventDefault();mouseHandled=!0;return!0},_mouseMove:function(event){if(this._mouseMoved){if($.ui.ie&&(!document.documentMode||document.documentMode<9)&&!event.button){return this._mouseUp(event)}else if(!event.which){if(event.originalEvent.altKey||event.originalEvent.ctrlKey||event.originalEvent.metaKey||event.originalEvent.shiftKey){this.ignoreMissingWhich=!0}else if(!this.ignoreMissingWhich){return this._mouseUp(event)}}}
if(event.which||event.button){this._mouseMoved=!0}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault()}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==!1);if(this._mouseStarted){this._mouseDrag(event)}else{this._mouseUp(event)}}
return!this._mouseStarted},_mouseUp:function(event){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=!1;if(event.target===this._mouseDownEvent.target){$.data(event.target,this.widgetName+".preventClickEvent",!0)}
this._mouseStop(event)}
if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer}
this.ignoreMissingWhich=!1;mouseHandled=!1;event.preventDefault()},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance)},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})});/*!
 * jQuery UI Draggable 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./mouse","../data","../plugin","../safe-active-element","../safe-blur","../scroll-parent","../version","../widget"],factory)}else{factory(jQuery)}})(function($){"use strict";$.widget("ui.draggable",$.ui.mouse,{version:"1.13.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()}
if(this.options.addClasses){this._addClass("ui-draggable")}
this._setHandleClassName();this._mouseInit()},_setOption:function(key,value){this._super(key,value);if(key==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=!0;return}
this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0){return!1}
this.handle=this._getHandle(event);if(!this.handle){return!1}
this._blurActiveElement(event);this._blockFrames(o.iframeFix===!0?"iframe":o.iframeFix);return!0},_blockFrames:function(selector){this.iframeBlocks=this.document.find(selector).map(function(){var iframe=$(this);return $("<div>").css("position","absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(event){var activeElement=$.ui.safeActiveElement(this.document[0]),target=$(event.target);if(target.closest(activeElement).length){return}
$.ui.safeBlur(activeElement)},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if($.ui.ddmanager){$.ui.ddmanager.current=this}
this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(!0);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return $(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(event);this.originalPosition=this.position=this._generatePosition(event,!1);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt){this._adjustOffsetFromHelper(o.cursorAt)}
this._setContainment();if(this._trigger("start",event)===!1){this._clear();return!1}
this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}
this._mouseDrag(event,!0);if($.ui.ddmanager){$.ui.ddmanager.dragStart(this,event)}
return!0},_refreshOffsets:function(event){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:event.pageX-this.offset.left,top:event.pageY-this.offset.top}},_mouseDrag:function(event,noPropagation){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()}
this.position=this._generatePosition(event,!0);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===!1){this._mouseUp(new $.Event("mouseup",event));return!1}
this.position=ui.position}
this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if($.ui.ddmanager){$.ui.ddmanager.drag(this,event)}
return!1},_mouseStop:function(event){var that=this,dropped=!1;if($.ui.ddmanager&&!this.options.dropBehaviour){dropped=$.ui.ddmanager.drop(this,event)}
if(this.dropped){dropped=this.dropped;this.dropped=!1}
if((this.options.revert==="invalid"&&!dropped)||(this.options.revert==="valid"&&dropped)||this.options.revert===!0||(typeof this.options.revert==="function"&&this.options.revert.call(this.element,dropped))){$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(that._trigger("stop",event)!==!1){that._clear()}})}else{if(this._trigger("stop",event)!==!1){this._clear()}}
return!1},_mouseUp:function(event){this._unblockFrames();if($.ui.ddmanager){$.ui.ddmanager.dragStop(this,event)}
if(this.handleElement.is(event.target)){this.element.trigger("focus")}
return $.ui.mouse.prototype._mouseUp.call(this,event)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new $.Event("mouseup",{target:this.element[0]}))}else{this._clear()}
return this},_getHandle:function(event){return this.options.handle?!!$(event.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(event){var o=this.options,helperIsFunction=typeof o.helper==="function",helper=helperIsFunction?$(o.helper.apply(this.element[0],[event])):(o.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!helper.parents("body").length){helper.appendTo((o.appendTo==="parent"?this.element[0].parentNode:o.appendTo))}
if(helperIsFunction&&helper[0]===this.element[0]){this._setPositionRelative()}
if(helper[0]!==this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position"))){helper.css("position","absolute")}
return helper},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ")}
if(Array.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0}}
if("left" in obj){this.offset.click.left=obj.left+this.margins.left}
if("right" in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left}
if("top" in obj){this.offset.click.top=obj.top+this.margins.top}
if("bottom" in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top}},_isRootNode:function(element){return(/(html|body)/i).test(element.tagName)||element===this.document[0]},_getParentOffset:function(){var po=this.offsetParent.offset(),document=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop()}
if(this._isRootNode(this.offsetParent[0])){po={top:0,left:0}}
return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}}
var p=this.element.position(),scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+(!scrollIsRootNode?this.scrollParent.scrollTop():0),left:p.left-(parseInt(this.helper.css("left"),10)||0)+(!scrollIsRootNode?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var isUserScrollable,c,ce,o=this.options,document=this.document[0];this.relativeContainer=null;if(!o.containment){this.containment=null;return}
if(o.containment==="window"){this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()-this.helperProportions.width-this.margins.left,$(window).scrollTop()+($(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}
if(o.containment==="document"){this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}
if(o.containment.constructor===Array){this.containment=o.containment;return}
if(o.containment==="parent"){o.containment=this.helper[0].parentNode}
c=$(o.containment);ce=c[0];if(!ce){return}
isUserScrollable=/(scroll|auto)/.test(c.css("overflow"));this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(isUserScrollable?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(isUserScrollable?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=c},_convertPositionTo:function(d,pos){if(!pos){pos=this.position}
var mod=d==="absolute"?1:-1,scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:(pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-((this.cssPosition==="fixed"?-this.offset.scroll.top:(scrollIsRootNode?0:this.offset.scroll.top))*mod)),left:(pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-((this.cssPosition==="fixed"?-this.offset.scroll.left:(scrollIsRootNode?0:this.offset.scroll.left))*mod))}},_generatePosition:function(event,constrainPosition){var containment,co,top,left,o=this.options,scrollIsRootNode=this._isRootNode(this.scrollParent[0]),pageX=event.pageX,pageY=event.pageY;if(!scrollIsRootNode||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}}
if(constrainPosition){if(this.containment){if(this.relativeContainer){co=this.relativeContainer.offset();containment=[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top]}else{containment=this.containment}
if(event.pageX-this.offset.click.left<containment[0]){pageX=containment[0]+this.offset.click.left}
if(event.pageY-this.offset.click.top<containment[1]){pageY=containment[1]+this.offset.click.top}
if(event.pageX-this.offset.click.left>containment[2]){pageX=containment[2]+this.offset.click.left}
if(event.pageY-this.offset.click.top>containment[3]){pageY=containment[3]+this.offset.click.top}}
if(o.grid){top=o.grid[1]?this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY;pageY=containment?((top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3])?top:((top-this.offset.click.top>=containment[1])?top-o.grid[1]:top+o.grid[1])):top;left=o.grid[0]?this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX;pageX=containment?((left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2])?left:((left-this.offset.click.left>=containment[0])?left-o.grid[0]:left+o.grid[0])):left}
if(o.axis==="y"){pageX=this.originalPageX}
if(o.axis==="x"){pageY=this.originalPageY}}
return{top:(pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:(scrollIsRootNode?0:this.offset.scroll.top))),left:(pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:(scrollIsRootNode?0:this.offset.scroll.left)))}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}
this.helper=null;this.cancelHelperRemoval=!1;if(this.destroyOnClear){this.destroy()}},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui,this],!0);if(/^(drag|start|stop)/.test(type)){this.positionAbs=this._convertPositionTo("absolute");ui.offset=this.positionAbs}
return $.Widget.prototype._trigger.call(this,type,event,ui)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.sortables=[];$(draggable.options.connectToSortable).each(function(){var sortable=$(this).sortable("instance");if(sortable&&!sortable.options.disabled){draggable.sortables.push(sortable);sortable.refreshPositions();sortable._trigger("activate",event,uiSortable)}})},stop:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.cancelHelperRemoval=!1;$.each(draggable.sortables,function(){var sortable=this;if(sortable.isOver){sortable.isOver=0;draggable.cancelHelperRemoval=!0;sortable.cancelHelperRemoval=!1;sortable._storedCSS={position:sortable.placeholder.css("position"),top:sortable.placeholder.css("top"),left:sortable.placeholder.css("left")};sortable._mouseStop(event);sortable.options.helper=sortable.options._helper}else{sortable.cancelHelperRemoval=!0;sortable._trigger("deactivate",event,uiSortable)}})},drag:function(event,ui,draggable){$.each(draggable.sortables,function(){var innermostIntersecting=!1,sortable=this;sortable.positionAbs=draggable.positionAbs;sortable.helperProportions=draggable.helperProportions;sortable.offset.click=draggable.offset.click;if(sortable._intersectsWith(sortable.containerCache)){innermostIntersecting=!0;$.each(draggable.sortables,function(){this.positionAbs=draggable.positionAbs;this.helperProportions=draggable.helperProportions;this.offset.click=draggable.offset.click;if(this!==sortable&&this._intersectsWith(this.containerCache)&&$.contains(sortable.element[0],this.element[0])){innermostIntersecting=!1}
return innermostIntersecting})}
if(innermostIntersecting){if(!sortable.isOver){sortable.isOver=1;draggable._parent=ui.helper.parent();sortable.currentItem=ui.helper.appendTo(sortable.element).data("ui-sortable-item",!0);sortable.options._helper=sortable.options.helper;sortable.options.helper=function(){return ui.helper[0]};event.target=sortable.currentItem[0];sortable._mouseCapture(event,!0);sortable._mouseStart(event,!0,!0);sortable.offset.click.top=draggable.offset.click.top;sortable.offset.click.left=draggable.offset.click.left;sortable.offset.parent.left-=draggable.offset.parent.left-sortable.offset.parent.left;sortable.offset.parent.top-=draggable.offset.parent.top-sortable.offset.parent.top;draggable._trigger("toSortable",event);draggable.dropped=sortable.element;$.each(draggable.sortables,function(){this.refreshPositions()});draggable.currentItem=draggable.element;sortable.fromOutside=draggable}
if(sortable.currentItem){sortable._mouseDrag(event);ui.position=sortable.position}}else{if(sortable.isOver){sortable.isOver=0;sortable.cancelHelperRemoval=!0;sortable.options._revert=sortable.options.revert;sortable.options.revert=!1;sortable._trigger("out",event,sortable._uiHash(sortable));sortable._mouseStop(event,!0);sortable.options.revert=sortable.options._revert;sortable.options.helper=sortable.options._helper;if(sortable.placeholder){sortable.placeholder.remove()}
ui.helper.appendTo(draggable._parent);draggable._refreshOffsets(event);ui.position=draggable._generatePosition(event,!0);draggable._trigger("fromSortable",event);draggable.dropped=!1;$.each(draggable.sortables,function(){this.refreshPositions()})}}})}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui,instance){var t=$("body"),o=instance.options;if(t.css("cursor")){o._cursor=t.css("cursor")}
t.css("cursor",o.cursor)},stop:function(event,ui,instance){var o=instance.options;if(o._cursor){$("body").css("cursor",o._cursor)}}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("opacity")){o._opacity=t.css("opacity")}
t.css("opacity",o.opacity)},stop:function(event,ui,instance){var o=instance.options;if(o._opacity){$(ui.helper).css("opacity",o._opacity)}}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(!1)}
if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset()}},drag:function(event,ui,i){var o=i.options,scrolled=!1,scrollParent=i.scrollParentNotHidden[0],document=i.document[0];if(scrollParent!==document&&scrollParent.tagName!=="HTML"){if(!o.axis||o.axis!=="x"){if((i.overflowOffset.top+scrollParent.offsetHeight)-event.pageY<o.scrollSensitivity){scrollParent.scrollTop=scrolled=scrollParent.scrollTop+o.scrollSpeed}else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity){scrollParent.scrollTop=scrolled=scrollParent.scrollTop-o.scrollSpeed}}
if(!o.axis||o.axis!=="y"){if((i.overflowOffset.left+scrollParent.offsetWidth)-event.pageX<o.scrollSensitivity){scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft+o.scrollSpeed}else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity){scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft-o.scrollSpeed}}}else{if(!o.axis||o.axis!=="x"){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed)}else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed)}}
if(!o.axis||o.axis!=="y"){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed)}else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)}}}
if(scrolled!==!1&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(i,event)}}});$.ui.plugin.add("draggable","snap",{start:function(event,ui,i){var o=i.options;i.snapElements=[];$(o.snap.constructor!==String?(o.snap.items||":data(ui-draggable)"):o.snap).each(function(){var $t=$(this),$o=$t.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left})}})},drag:function(event,ui,inst){var ts,bs,ls,rs,l,r,t,b,i,first,o=inst.options,d=o.snapTolerance,x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(i=inst.snapElements.length-1;i>=0;i--){l=inst.snapElements[i].left-inst.margins.left;r=l+inst.snapElements[i].width;t=inst.snapElements[i].top-inst.margins.top;b=t+inst.snapElements[i].height;if(x2<l-d||x1>r+d||y2<t-d||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)){if(inst.snapElements[i].snapping){if(inst.options.snap.release){inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item}))}}
inst.snapElements[i].snapping=!1;continue}
if(o.snapMode!=="inner"){ts=Math.abs(t-y2)<=d;bs=Math.abs(b-y1)<=d;ls=Math.abs(l-x2)<=d;rs=Math.abs(r-x1)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top}
if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top}
if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left}
if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left}}
first=(ts||bs||ls||rs);if(o.snapMode!=="outer"){ts=Math.abs(t-y1)<=d;bs=Math.abs(b-y2)<=d;ls=Math.abs(l-x1)<=d;rs=Math.abs(r-x2)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top}
if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top}
if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left}
if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left}}
if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)){if(inst.options.snap.snap){inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item}))}}
inst.snapElements[i].snapping=(ts||bs||ls||rs||first)}}});$.ui.plugin.add("draggable","stack",{start:function(event,ui,instance){var min,o=instance.options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0)});if(!group.length){return}
min=parseInt($(group[0]).css("zIndex"),10)||0;$(group).each(function(i){$(this).css("zIndex",min+i)});this.css("zIndex",(min+group.length))}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("zIndex")){o._zIndex=t.css("zIndex")}
t.css("zIndex",o.zIndex)},stop:function(event,ui,instance){var o=instance.options;if(o._zIndex){$(ui.helper).css("zIndex",o._zIndex)}}});return $.ui.draggable});/*!
 * jQuery UI Droppable 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./draggable","./mouse","../version","../widget"],factory)}else{factory(jQuery)}})(function($){"use strict";$.widget("ui.droppable",{version:"1.13.3",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var proportions,o=this.options,accept=o.accept;this.isover=!1;this.isout=!0;this.accept=typeof accept==="function"?accept:function(d){return d.is(accept)};this.proportions=function(){if(arguments.length){proportions=arguments[0]}else{return proportions?proportions:proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}}};this._addToManager(o.scope);if(o.addClasses){this._addClass("ui-droppable")}},_addToManager:function(scope){$.ui.ddmanager.droppables[scope]=$.ui.ddmanager.droppables[scope]||[];$.ui.ddmanager.droppables[scope].push(this)},_splice:function(drop){var i=0;for(;i<drop.length;i++){if(drop[i]===this){drop.splice(i,1)}}},_destroy:function(){var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop)},_setOption:function(key,value){if(key==="accept"){this.accept=typeof value==="function"?value:function(d){return d.is(value)}}else if(key==="scope"){var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop);this._addToManager(value)}
this._super(key,value)},_activate:function(event){var draggable=$.ui.ddmanager.current;this._addActiveClass();if(draggable){this._trigger("activate",event,this.ui(draggable))}},_deactivate:function(event){var draggable=$.ui.ddmanager.current;this._removeActiveClass();if(draggable){this._trigger("deactivate",event,this.ui(draggable))}},_over:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return}
if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this._addHoverClass();this._trigger("over",event,this.ui(draggable))}},_out:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return}
if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this._removeHoverClass();this._trigger("out",event,this.ui(draggable))}},_drop:function(event,custom){var draggable=custom||$.ui.ddmanager.current,childrenIntersection=!1;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return!1}
this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var inst=$(this).droppable("instance");if(inst.options.greedy&&!inst.options.disabled&&inst.options.scope===draggable.options.scope&&inst.accept.call(inst.element[0],(draggable.currentItem||draggable.element))&&$.ui.intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance,event)){childrenIntersection=!0;return!1}});if(childrenIntersection){return!1}
if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",event,this.ui(draggable));return this.element}
return!1},ui:function(c){return{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,offset:c.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});$.ui.intersect=(function(){function isOverAxis(x,reference,size){return(x>=reference)&&(x<(reference+size))}
return function(draggable,droppable,toleranceMode,event){if(!droppable.offset){return!1}
var x1=(draggable.positionAbs||draggable.position.absolute).left+draggable.margins.left,y1=(draggable.positionAbs||draggable.position.absolute).top+draggable.margins.top,x2=x1+draggable.helperProportions.width,y2=y1+draggable.helperProportions.height,l=droppable.offset.left,t=droppable.offset.top,r=l+droppable.proportions().width,b=t+droppable.proportions().height;switch(toleranceMode){case "fit":return(l<=x1&&x2<=r&&t<=y1&&y2<=b);case "intersect":return(l<x1+(draggable.helperProportions.width/2)&&x2-(draggable.helperProportions.width/2)<r&&t<y1+(draggable.helperProportions.height/2)&&y2-(draggable.helperProportions.height/2)<b);case "pointer":return isOverAxis(event.pageY,t,droppable.proportions().height)&&isOverAxis(event.pageX,l,droppable.proportions().width);case "touch":return((y1>=t&&y1<=b)||(y2>=t&&y2<=b)||(y1<t&&y2>b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1<l&&x2>r));default:return!1}}})();$.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].accept.call(m[i].element[0],(t.currentItem||t.element)))){continue}
for(j=0;j<list.length;j++){if(list[j]===m[i].element[0]){m[i].proportions().height=0;continue droppablesLoop}}
m[i].visible=m[i].element.css("display")!=="none";if(!m[i].visible){continue}
if(type==="mousedown"){m[i]._activate.call(m[i],event)}
m[i].offset=m[i].element.offset();m[i].proportions({width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight})}},drop:function(draggable,event){var dropped=!1;$.each(($.ui.ddmanager.droppables[draggable.options.scope]||[]).slice(),function(){if(!this.options){return}
if(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance,event)){dropped=this._drop.call(this,event)||dropped}
if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this.isout=!0;this.isover=!1;this._deactivate.call(this,event)}});return dropped},dragStart:function(draggable,event){draggable.element.parentsUntil("body").on("scroll.droppable",function(){if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event)}})},drag:function(draggable,event){if(draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event)}
$.each($.ui.ddmanager.droppables[draggable.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}
var parentInstance,scope,parent,intersects=$.ui.intersect(draggable,this,this.options.tolerance,event),c=!intersects&&this.isover?"isout":(intersects&&!this.isover?"isover":null);if(!c){return}
if(this.options.greedy){scope=this.options.scope;parent=this.element.parents(":data(ui-droppable)").filter(function(){return $(this).droppable("instance").options.scope===scope});if(parent.length){parentInstance=$(parent[0]).droppable("instance");parentInstance.greedyChild=(c==="isover")}}
if(parentInstance&&c==="isover"){parentInstance.isover=!1;parentInstance.isout=!0;parentInstance._out.call(parentInstance,event)}
this[c]=!0;this[c==="isout"?"isover":"isout"]=!1;this[c==="isover"?"_over":"_out"].call(this,event);if(parentInstance&&c==="isout"){parentInstance.isout=!1;parentInstance.isover=!0;parentInstance._over.call(parentInstance,event)}})},dragStop:function(draggable,event){draggable.element.parentsUntil("body").off("scroll.droppable");if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event)}}};if($.uiBackCompat!==!1){$.widget("ui.droppable",$.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super();if(this.options.activeClass){this.element.addClass(this.options.activeClass)}},_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}},_addHoverClass:function(){this._super();if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}},_removeHoverClass:function(){this._super();if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}}})}
return $.ui.droppable});/*!
 * jQuery UI Selectable 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./mouse","../version","../widget"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.widget("ui.selectable",$.ui.mouse,{version:"1.13.3",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var that=this;this._addClass("ui-selectable");this.dragged=!1;this.refresh=function(){that.elementPos=$(that.element[0]).offset();that.selectees=$(that.options.filter,that.element[0]);that._addClass(that.selectees,"ui-selectee");that.selectees.each(function(){var $this=$(this),selecteeOffset=$this.offset(),pos={left:selecteeOffset.left-that.elementPos.left,top:selecteeOffset.top-that.elementPos.top};$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:!1,selected:$this.hasClass("ui-selected"),selecting:$this.hasClass("ui-selecting"),unselecting:$this.hasClass("ui-unselecting")})})};this.refresh();this._mouseInit();this.helper=$("<div>");this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item");this._mouseDestroy()},_mouseStart:function(event){var that=this,options=this.options;this.opos=[event.pageX,event.pageY];this.elementPos=$(this.element[0]).offset();if(this.options.disabled){return}
this.selectees=$(options.filter,this.element[0]);this._trigger("start",event);$(options.appendTo).append(this.helper);this.helper.css({"left":event.pageX,"top":event.pageY,"width":0,"height":0});if(options.autoRefresh){this.refresh()}
this.selectees.filter(".ui-selected").each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=!0;if(!event.metaKey&&!event.ctrlKey){that._removeClass(selectee.$element,"ui-selected");selectee.selected=!1;that._addClass(selectee.$element,"ui-unselecting");selectee.unselecting=!0;that._trigger("unselecting",event,{unselecting:selectee.element})}});$(event.target).parents().addBack().each(function(){var doSelect,selectee=$.data(this,"selectable-item");if(selectee){doSelect=(!event.metaKey&&!event.ctrlKey)||!selectee.$element.hasClass("ui-selected");that._removeClass(selectee.$element,doSelect?"ui-unselecting":"ui-selected")._addClass(selectee.$element,doSelect?"ui-selecting":"ui-unselecting");selectee.unselecting=!doSelect;selectee.selecting=doSelect;selectee.selected=doSelect;if(doSelect){that._trigger("selecting",event,{selecting:selectee.element})}else{that._trigger("unselecting",event,{unselecting:selectee.element})}
return!1}})},_mouseDrag:function(event){this.dragged=!0;if(this.options.disabled){return}
var tmp,that=this,options=this.options,x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY;if(x1>x2){tmp=x2;x2=x1;x1=tmp}
if(y1>y2){tmp=y2;y2=y1;y1=tmp}
this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"selectable-item"),hit=!1,offset={};if(!selectee||selectee.element===that.element[0]){return}
offset.left=selectee.left+that.elementPos.left;offset.right=selectee.right+that.elementPos.left;offset.top=selectee.top+that.elementPos.top;offset.bottom=selectee.bottom+that.elementPos.top;if(options.tolerance==="touch"){hit=(!(offset.left>x2||offset.right<x1||offset.top>y2||offset.bottom<y1))}else if(options.tolerance==="fit"){hit=(offset.left>x1&&offset.right<x2&&offset.top>y1&&offset.bottom<y2)}
if(hit){if(selectee.selected){that._removeClass(selectee.$element,"ui-selected");selectee.selected=!1}
if(selectee.unselecting){that._removeClass(selectee.$element,"ui-unselecting");selectee.unselecting=!1}
if(!selectee.selecting){that._addClass(selectee.$element,"ui-selecting");selectee.selecting=!0;that._trigger("selecting",event,{selecting:selectee.element})}}else{if(selectee.selecting){if((event.metaKey||event.ctrlKey)&&selectee.startselected){that._removeClass(selectee.$element,"ui-selecting");selectee.selecting=!1;that._addClass(selectee.$element,"ui-selected");selectee.selected=!0}else{that._removeClass(selectee.$element,"ui-selecting");selectee.selecting=!1;if(selectee.startselected){that._addClass(selectee.$element,"ui-unselecting");selectee.unselecting=!0}
that._trigger("unselecting",event,{unselecting:selectee.element})}}
if(selectee.selected){if(!event.metaKey&&!event.ctrlKey&&!selectee.startselected){that._removeClass(selectee.$element,"ui-selected");selectee.selected=!1;that._addClass(selectee.$element,"ui-unselecting");selectee.unselecting=!0;that._trigger("unselecting",event,{unselecting:selectee.element})}}}});return!1},_mouseStop:function(event){var that=this;this.dragged=!1;$(".ui-unselecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");that._removeClass(selectee.$element,"ui-unselecting");selectee.unselecting=!1;selectee.startselected=!1;that._trigger("unselected",event,{unselected:selectee.element})});$(".ui-selecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");that._removeClass(selectee.$element,"ui-selecting")._addClass(selectee.$element,"ui-selected");selectee.selecting=!1;selectee.selected=!0;selectee.startselected=!0;that._trigger("selected",event,{selected:selectee.element})});this._trigger("stop",event);this.helper.remove();return!1}})});/*!
 * jQuery UI Sortable 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./mouse","../data","../ie","../scroll-parent","../version","../widget"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.widget("ui.sortable",$.ui.mouse,{version:"1.13.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(x,reference,size){return(x>=reference)&&(x<(reference+size))},_isFloating:function(item){return(/left|right/).test(item.css("float"))||(/inline|table-cell/).test(item.css("display"))},_create:function(){this.containerCache={};this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=!0},_setOption:function(key,value){this._super(key,value);if(key==="handle"){this._setHandleClassName()}},_setHandleClassName:function(){var that=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");$.each(this.items,function(){that._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--){this.items[i].item.removeData(this.widgetName+"-item")}
return this},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=!1,that=this;if(this.reverting){return!1}
if(this.options.disabled||this.options.type==="static"){return!1}
this._refreshItems(event);$(event.target).parents().each(function(){if($.data(this,that.widgetName+"-item")===that){currentItem=$(this);return!1}});if($.data(event.target,that.widgetName+"-item")===that){currentItem=$(event.target)}
if(!currentItem){return!1}
if(this.options.handle&&!overrideHandle){$(this.options.handle,currentItem).find("*").addBack().each(function(){if(this===event.target){validHandle=!0}});if(!validHandle){return!1}}
this.currentItem=currentItem;this._removeCurrentsFromItems();return!0},_mouseStart:function(event,overrideHandle,noActivation){var i,body,o=this.options;this.currentContainer=this;this.refreshPositions();this.appendTo=$(o.appendTo!=="parent"?o.appendTo:this.currentItem.parent());this.helper=this._createHelper(event);this._cacheHelperProportions();this._cacheMargins();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");if(o.cursorAt){this._adjustOffsetFromHelper(o.cursorAt)}
this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide()}
this._createPlaceholder();this.scrollParent=this.placeholder.scrollParent();$.extend(this.offset,{parent:this._getParentOffset()});if(o.containment){this._setContainment()}
if(o.cursor&&o.cursor!=="auto"){body=this.document.find("body");this.storedCursor=body.css("cursor");body.css("cursor",o.cursor);this.storedStylesheet=$("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(body)}
if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}
this.helper.css("zIndex",o.zIndex)}
if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}
this.helper.css("opacity",o.opacity)}
if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()}
this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}
if(!noActivation){for(i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,this._uiHash(this))}}
if($.ui.ddmanager){$.ui.ddmanager.current=this}
if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}
this.dragging=!0;this._addClass(this.helper,"ui-sortable-helper");if(!this.helper.parent().is(this.appendTo)){this.helper.detach().appendTo(this.appendTo);this.offset.parent=this._getParentOffset()}
this.position=this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute");this._mouseDrag(event);return!0},_scroll:function(event){var o=this.options,scrolled=!1;if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed}else if(event.pageY-this.overflowOffset.top<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed}
if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed}else if(event.pageX-this.overflowOffset.left<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed}}else{if(event.pageY-this.document.scrollTop()<o.scrollSensitivity){scrolled=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed)}else if(this.window.height()-(event.pageY-this.document.scrollTop())<o.scrollSensitivity){scrolled=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)}
if(event.pageX-this.document.scrollLeft()<o.scrollSensitivity){scrolled=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed)}else if(this.window.width()-(event.pageX-this.document.scrollLeft())<o.scrollSensitivity){scrolled=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed)}}
return scrolled},_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options;this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px"}
if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px"}
if(o.scroll){if(this._scroll(event)!==!1){this._refreshItemPositions(!0);if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}}}
this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()};for(i=this.items.length-1;i>=0;i--){item=this.items[i];itemElement=item.item[0];intersection=this._intersectsWithPointer(item);if(!intersection){continue}
if(item.instance!==this.currentContainer){continue}
if(itemElement!==this.currentItem[0]&&this.placeholder[intersection===1?"next":"prev"]()[0]!==itemElement&&!$.contains(this.placeholder[0],itemElement)&&(this.options.type==="semi-dynamic"?!$.contains(this.element[0],itemElement):!0)){this.direction=intersection===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item)}else{break}
this._trigger("change",event,this._uiHash());break}}
this._contactContainers(event);if($.ui.ddmanager){$.ui.ddmanager.drag(this,event)}
this._trigger("sort",event,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(event,noPropagation){if(!event){return}
if($.ui.ddmanager&&!this.options.dropBehaviour){$.ui.ddmanager.drop(this,event)}
if(this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={};if(!axis||axis==="x"){animation.left=cur.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)}
if(!axis||axis==="y"){animation.top=cur.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)}
this.reverting=!0;$(this.helper).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event)})}else{this._clear(event,noPropagation)}
return!1},cancel:function(){if(this.dragging){this._mouseUp(new $.Event("mouseup",{target:null}));if(this.options.helper==="original"){this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else{this.currentItem.show()}
for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,this._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,this._uiHash(this));this.containers[i].containerCache.over=0}}}
if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}
if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}
$.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem)}else{$(this.domPosition.parent).prepend(this.currentItem)}}
return this},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected),str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[\-=_](.+)/));if(res){str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]))}});if(!str.length&&o.key){str.push(o.key+"=")}
return str.join("&")},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected),ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"")});return ret},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,dxClick=this.offset.click.left,isOverElementHeight=(this.options.axis==="x")||((y1+dyClick)>t&&(y1+dyClick)<b),isOverElementWidth=(this.options.axis==="y")||((x1+dxClick)>l&&(x1+dxClick)<r),isOverElement=isOverElementHeight&&isOverElementWidth;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"])){return isOverElement}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b)}},_intersectsWithPointer:function(item){var verticalDirection,horizontalDirection,isOverElementHeight=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth;if(!isOverElement){return!1}
verticalDirection=this.dragDirection.vertical;horizontalDirection=this.dragDirection.horizontal;return this.floating?((horizontalDirection==="right"||verticalDirection==="down")?2:1):(verticalDirection&&(verticalDirection==="down"?2:1))},_intersectsWithSides:function(item){var isOverBottomHalf=this._isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=this._isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this.dragDirection.vertical,horizontalDirection=this.dragDirection.horizontal;if(this.floating&&horizontalDirection){return((horizontalDirection==="right"&&isOverRightHalf)||(horizontalDirection==="left"&&!isOverRightHalf))}else{return verticalDirection&&((verticalDirection==="down"&&isOverBottomHalf)||(verticalDirection==="up"&&!isOverBottomHalf))}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!==0&&(delta>0?"down":"up")},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!==0&&(delta>0?"right":"left")},refresh:function(event){this._refreshItems(event);this._setHandleClassName();this.refreshPositions();return this},_connectWith:function(){var options=this.options;return options.connectWith.constructor===String?[options.connectWith]:options.connectWith},_getItemsAsjQuery:function(connected){var i,j,cur,inst,items=[],queries=[],connectWith=this._connectWith();if(connectWith&&connected){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i],this.document[0]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([typeof inst.options.items==="function"?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst])}}}}
queries.push([typeof this.options.items==="function"?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function addItems(){items.push(this)}
for(i=queries.length-1;i>=0;i--){queries[i][0].each(addItems)}
return $(items)},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=$.grep(this.items,function(item){for(var j=0;j<list.length;j++){if(list[j]===item.item[0]){return!1}}
return!0})},_refreshItems:function(event){this.items=[];this.containers=[this];var i,j,cur,inst,targetData,_queries,item,queriesLength,items=this.items,queries=[[typeof this.options.items==="function"?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]],connectWith=this._connectWith();if(connectWith&&this.ready){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i],this.document[0]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([typeof inst.options.items==="function"?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst)}}}}
for(i=queries.length-1;i>=0;i--){targetData=queries[i][1];_queries=queries[i][0];for(j=0,queriesLength=_queries.length;j<queriesLength;j++){item=$(_queries[j]);item.data(this.widgetName+"-item",targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0})}}},_refreshItemPositions:function(fast){var i,item,t,p;for(i=this.items.length-1;i>=0;i--){item=this.items[i];if(this.currentContainer&&item.instance!==this.currentContainer&&item.item[0]!==this.currentItem[0]){continue}
t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight()}
p=t.offset();item.left=p.left;item.top=p.top}},refreshPositions:function(fast){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):!1;if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}
this._refreshItemPositions(fast);var i,p;if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(i=this.containers.length-1;i>=0;i--){p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}}
return this},_createPlaceholder:function(that){that=that||this;var className,nodeName,o=that.options;if(!o.placeholder||o.placeholder.constructor===String){className=o.placeholder;nodeName=that.currentItem[0].nodeName.toLowerCase();o.placeholder={element:function(){var element=$("<"+nodeName+">",that.document[0]);that._addClass(element,"ui-sortable-placeholder",className||that.currentItem[0].className)._removeClass(element,"ui-sortable-helper");if(nodeName==="tbody"){that._createTrPlaceholder(that.currentItem.find("tr").eq(0),$("<tr>",that.document[0]).appendTo(element))}else if(nodeName==="tr"){that._createTrPlaceholder(that.currentItem,element)}else if(nodeName==="img"){element.attr("src",that.currentItem.attr("src"))}
if(!className){element.css("visibility","hidden")}
return element},update:function(container,p){if(className&&!o.forcePlaceholderSize){return}
if(!p.height()||(o.forcePlaceholderSize&&(nodeName==="tbody"||nodeName==="tr"))){p.height(that.currentItem.innerHeight()-parseInt(that.currentItem.css("paddingTop")||0,10)-parseInt(that.currentItem.css("paddingBottom")||0,10))}
if(!p.width()){p.width(that.currentItem.innerWidth()-parseInt(that.currentItem.css("paddingLeft")||0,10)-parseInt(that.currentItem.css("paddingRight")||0,10))}}}}
that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem));that.currentItem.after(that.placeholder);o.placeholder.update(that,that.placeholder)},_createTrPlaceholder:function(sourceTr,targetTr){var that=this;sourceTr.children().each(function(){$("<td>&#160;</td>",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(targetTr)})},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,cur,nearBottom,floating,axis,innermostContainer=null,innermostIndex=null;for(i=this.containers.length-1;i>=0;i--){if($.contains(this.currentItem[0],this.containers[i].element[0])){continue}
if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0])){continue}
innermostContainer=this.containers[i];innermostIndex=i}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0}}}
if(!innermostContainer){return}
if(this.containers.length===1){if(!this.containers[innermostIndex].containerCache.over){this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1}}else{dist=10000;itemWithLeastDistance=null;floating=innermostContainer.floating||this._isFloating(this.currentItem);posProperty=floating?"left":"top";sizeProperty=floating?"width":"height";axis=floating?"pageX":"pageY";for(j=this.items.length-1;j>=0;j--){if(!$.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])){continue}
if(this.items[j].item[0]===this.currentItem[0]){continue}
cur=this.items[j].item.offset()[posProperty];nearBottom=!1;if(event[axis]-cur>this.items[j][sizeProperty]/2){nearBottom=!0}
if(Math.abs(event[axis]-cur)<dist){dist=Math.abs(event[axis]-cur);itemWithLeastDistance=this.items[j];this.direction=nearBottom?"up":"down"}}
if(!itemWithLeastDistance&&!this.options.dropOnEmpty){return}
if(this.currentContainer===this.containers[innermostIndex]){if(!this.currentContainer.containerCache.over){this.containers[innermostIndex]._trigger("over",event,this._uiHash());this.currentContainer.containerCache.over=1}
return}
if(itemWithLeastDistance){this._rearrange(event,itemWithLeastDistance,null,!0)}else{this._rearrange(event,null,this.containers[innermostIndex].element,!0)}
this._trigger("change",event,this._uiHash());this.containers[innermostIndex]._trigger("change",event,this._uiHash(this));this.currentContainer=this.containers[innermostIndex];this.options.placeholder.update(this.currentContainer,this.placeholder);this.scrollParent=this.placeholder.scrollParent();if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()}
this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1}},_createHelper:function(event){var o=this.options,helper=typeof o.helper==="function"?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper==="clone"?this.currentItem.clone():this.currentItem);if(!helper.parents("body").length){this.appendTo[0].appendChild(helper[0])}
if(helper[0]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}
if(!helper[0].style.width||o.forceHelperSize){helper.width(this.currentItem.width())}
if(!helper[0].style.height||o.forceHelperSize){helper.height(this.currentItem.height())}
return helper},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ")}
if(Array.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0}}
if("left" in obj){this.offset.click.left=obj.left+this.margins.left}
if("right" in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left}
if("top" in obj){this.offset.click.top=obj.top+this.margins.top}
if("bottom" in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop()}
if(this.offsetParent[0]===this.document[0].body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&$.ui.ie)){po={top:0,left:0}}
return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var ce,co,over,o=this.options;if(o.containment==="parent"){o.containment=this.helper[0].parentNode}
if(o.containment==="document"||o.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,o.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(o.containment==="document"?(this.document.height()||document.body.parentNode.scrollHeight):this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}
if(!(/^(document|window|parent)$/).test(o.containment)){ce=$(o.containment)[0];co=$(o.containment).offset();over=($(ce).css("overflow")!=="hidden");this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(d,pos){if(!pos){pos=this.position}
var mod=d==="absolute"?1:-1,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))}},_generatePosition:function(event){var top,left,o=this.options,pageX=event.pageX,pageY=event.pageY,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}
if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0]){pageX=this.containment[0]+this.offset.click.left}
if(event.pageY-this.offset.click.top<this.containment[1]){pageY=this.containment[1]+this.offset.click.top}
if(event.pageX-this.offset.click.left>this.containment[2]){pageX=this.containment[2]+this.offset.click.left}
if(event.pageY-this.offset.click.top>this.containment[3]){pageY=this.containment[3]+this.offset.click.top}}
if(o.grid){top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?((top-this.offset.click.top>=this.containment[1]&&top-this.offset.click.top<=this.containment[3])?top:((top-this.offset.click.top>=this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?((left-this.offset.click.left>=this.containment[0]&&left-this.offset.click.left<=this.containment[2])?left:((left-this.offset.click.left>=this.containment[0])?left-o.grid[0]:left+o.grid[0])):left}}
return{top:(pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))}},_rearrange:function(event,i,a,hardRefresh){if(a){a[0].appendChild(this.placeholder[0])}else{i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?i.item[0]:i.item[0].nextSibling))}
this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(function(){if(counter===this.counter){this.refreshPositions(!hardRefresh)}})},_clear:function(event,noPropagation){this.reverting=!1;var i,delayedTriggers=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)}
this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]=""}}
this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else{this.currentItem.show()}
if(this.fromOutside&&!noPropagation){delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside))})}
if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!noPropagation){delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash())})}
if(this!==this.currentContainer){if(!noPropagation){delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash())});delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this))}}).call(this,this.currentContainer));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this))}}).call(this,this.currentContainer))}}
function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance))}}
for(i=this.containers.length-1;i>=0;i--){if(!noPropagation){delayedTriggers.push(delayEvent("deactivate",this,this.containers[i]))}
if(this.containers[i].containerCache.over){delayedTriggers.push(delayEvent("out",this,this.containers[i]));this.containers[i].containerCache.over=0}}
if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}
if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}
if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex)}
this.dragging=!1;if(!noPropagation){this._trigger("beforeStop",event,this._uiHash())}
this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove()}
this.helper=null}
if(!noPropagation){for(i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event)}
this._trigger("stop",event,this._uiHash())}
this.fromOutside=!1;return!this.cancelHelperRemoval},_trigger:function(){if($.Widget.prototype._trigger.apply(this,arguments)===!1){this.cancel()}},_uiHash:function(_inst){var inst=_inst||this;return{helper:inst.helper,placeholder:inst.placeholder||$([]),position:inst.position,originalPosition:inst.originalPosition,offset:inst.positionAbs,item:inst.currentItem,sender:_inst?_inst.element:null}}})});/*!
 * jQuery Color Animations v2.2.0
 * https://github.com/jquery/jquery-color
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 *
 * Date: Sun May 10 09:02:36 2020 +0200
 */
(function(root,factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports==="object"){module.exports=factory(require("jquery"))}else{factory(root.jQuery)}})(this,function(jQuery,undefined){var stepHooks="backgroundColor borderBottomColor borderLeftColor borderRightColor "+"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",class2type={},toString=class2type.toString,rplusequals=/^([\-+])=\s*(\d+\.?\d*)/,stringParsers=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1],execResult[2],execResult[3],execResult[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1]*2.55,execResult[2]*2.55,execResult[3]*2.55,execResult[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(execResult){return[parseInt(execResult[1],16),parseInt(execResult[2],16),parseInt(execResult[3],16),execResult[4]?(parseInt(execResult[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(execResult){return[parseInt(execResult[1]+execResult[1],16),parseInt(execResult[2]+execResult[2],16),parseInt(execResult[3]+execResult[3],16),execResult[4]?(parseInt(execResult[4]+execResult[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(execResult){return[execResult[1],execResult[2]/100,execResult[3]/100,execResult[4]]}}],color=jQuery.Color=function(color,green,blue,alpha){return new jQuery.Color.fn.parse(color,green,blue,alpha)},spaces={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},propTypes={"byte":{floor:!0,max:255},"percent":{max:1},"degrees":{mod:360,floor:!0}},support=color.support={},supportElem=jQuery("<p>")[0],colors,each=jQuery.each;supportElem.style.cssText="background-color:rgba(1,1,1,.5)";support.rgba=supportElem.style.backgroundColor.indexOf("rgba")>-1;each(spaces,function(spaceName,space){space.cache="_"+spaceName;space.props.alpha={idx:3,type:"percent",def:1}});jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(_i,name){class2type["[object "+name+"]"]=name.toLowerCase()});function getType(obj){if(obj==null){return obj+""}
return typeof obj==="object"?class2type[toString.call(obj)]||"object":typeof obj}
function clamp(value,prop,allowEmpty){var type=propTypes[prop.type]||{};if(value==null){return(allowEmpty||!prop.def)?null:prop.def}
value=type.floor?~~value:parseFloat(value);if(isNaN(value)){return prop.def}
if(type.mod){return(value+type.mod)%type.mod}
return Math.min(type.max,Math.max(0,value))}
function stringParse(string){var inst=color(),rgba=inst._rgba=[];string=string.toLowerCase();each(stringParsers,function(_i,parser){var parsed,match=parser.re.exec(string),values=match&&parser.parse(match),spaceName=parser.space||"rgba";if(values){parsed=inst[spaceName](values);inst[spaces[spaceName].cache]=parsed[spaces[spaceName].cache];rgba=inst._rgba=parsed._rgba;return!1}});if(rgba.length){if(rgba.join()==="0,0,0,0"){jQuery.extend(rgba,colors.transparent)}
return inst}
return colors[string]}
color.fn=jQuery.extend(color.prototype,{parse:function(red,green,blue,alpha){if(red===undefined){this._rgba=[null,null,null,null];return this}
if(red.jquery||red.nodeType){red=jQuery(red).css(green);green=undefined}
var inst=this,type=getType(red),rgba=this._rgba=[];if(green!==undefined){red=[red,green,blue,alpha];type="array"}
if(type==="string"){return this.parse(stringParse(red)||colors._default)}
if(type==="array"){each(spaces.rgba.props,function(_key,prop){rgba[prop.idx]=clamp(red[prop.idx],prop)});return this}
if(type==="object"){if(red instanceof color){each(spaces,function(_spaceName,space){if(red[space.cache]){inst[space.cache]=red[space.cache].slice()}})}else{each(spaces,function(_spaceName,space){var cache=space.cache;each(space.props,function(key,prop){if(!inst[cache]&&space.to){if(key==="alpha"||red[key]==null){return}
inst[cache]=space.to(inst._rgba)}
inst[cache][prop.idx]=clamp(red[key],prop,!0)});if(inst[cache]&&jQuery.inArray(null,inst[cache].slice(0,3))<0){if(inst[cache][3]==null){inst[cache][3]=1}
if(space.from){inst._rgba=space.from(inst[cache])}}})}
return this}},is:function(compare){var is=color(compare),same=!0,inst=this;each(spaces,function(_,space){var localCache,isCache=is[space.cache];if(isCache){localCache=inst[space.cache]||space.to&&space.to(inst._rgba)||[];each(space.props,function(_,prop){if(isCache[prop.idx]!=null){same=(isCache[prop.idx]===localCache[prop.idx]);return same}})}
return same});return same},_space:function(){var used=[],inst=this;each(spaces,function(spaceName,space){if(inst[space.cache]){used.push(spaceName)}});return used.pop()},transition:function(other,distance){var end=color(other),spaceName=end._space(),space=spaces[spaceName],startColor=this.alpha()===0?color("transparent"):this,start=startColor[space.cache]||space.to(startColor._rgba),result=start.slice();end=end[space.cache];each(space.props,function(_key,prop){var index=prop.idx,startValue=start[index],endValue=end[index],type=propTypes[prop.type]||{};if(endValue===null){return}
if(startValue===null){result[index]=endValue}else{if(type.mod){if(endValue-startValue>type.mod/2){startValue+=type.mod}else if(startValue-endValue>type.mod/2){startValue-=type.mod}}
result[index]=clamp((endValue-startValue)*distance+startValue,prop)}});return this[spaceName](result)},blend:function(opaque){if(this._rgba[3]===1){return this}
var rgb=this._rgba.slice(),a=rgb.pop(),blend=color(opaque)._rgba;return color(jQuery.map(rgb,function(v,i){return(1-a)*blend[i]+a*v}))},toRgbaString:function(){var prefix="rgba(",rgba=jQuery.map(this._rgba,function(v,i){if(v!=null){return v}
return i>2?1:0});if(rgba[3]===1){rgba.pop();prefix="rgb("}
return prefix+rgba.join()+")"},toHslaString:function(){var prefix="hsla(",hsla=jQuery.map(this.hsla(),function(v,i){if(v==null){v=i>2?1:0}
if(i&&i<3){v=Math.round(v*100)+"%"}
return v});if(hsla[3]===1){hsla.pop();prefix="hsl("}
return prefix+hsla.join()+")"},toHexString:function(includeAlpha){var rgba=this._rgba.slice(),alpha=rgba.pop();if(includeAlpha){rgba.push(~~(alpha*255))}
return"#"+jQuery.map(rgba,function(v){v=(v||0).toString(16);return v.length===1?"0"+v:v}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}});color.fn.parse.prototype=color.fn;function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6}
if(h*2<1){return q}
if(h*3<2){return p+(q-p)*((2/3)-h)*6}
return p}
spaces.hsla.to=function(rgba){if(rgba[0]==null||rgba[1]==null||rgba[2]==null){return[null,null,null,rgba[3]]}
var r=rgba[0]/255,g=rgba[1]/255,b=rgba[2]/255,a=rgba[3],max=Math.max(r,g,b),min=Math.min(r,g,b),diff=max-min,add=max+min,l=add*0.5,h,s;if(min===max){h=0}else if(r===max){h=(60*(g-b)/diff)+360}else if(g===max){h=(60*(b-r)/diff)+120}else{h=(60*(r-g)/diff)+240}
if(diff===0){s=0}else if(l<=0.5){s=diff/add}else{s=diff/(2-add)}
return[Math.round(h)%360,s,l,a==null?1:a]};spaces.hsla.from=function(hsla){if(hsla[0]==null||hsla[1]==null||hsla[2]==null){return[null,null,null,hsla[3]]}
var h=hsla[0]/360,s=hsla[1],l=hsla[2],a=hsla[3],q=l<=0.5?l*(1+s):l+s-l*s,p=2*l-q;return[Math.round(hue2rgb(p,q,h+(1/3))*255),Math.round(hue2rgb(p,q,h)*255),Math.round(hue2rgb(p,q,h-(1/3))*255),a]};each(spaces,function(spaceName,space){var props=space.props,cache=space.cache,to=space.to,from=space.from;color.fn[spaceName]=function(value){if(to&&!this[cache]){this[cache]=to(this._rgba)}
if(value===undefined){return this[cache].slice()}
var ret,type=getType(value),arr=(type==="array"||type==="object")?value:arguments,local=this[cache].slice();each(props,function(key,prop){var val=arr[type==="object"?key:prop.idx];if(val==null){val=local[prop.idx]}
local[prop.idx]=clamp(val,prop)});if(from){ret=color(from(local));ret[cache]=local;return ret}else{return color(local)}};each(props,function(key,prop){if(color.fn[key]){return}
color.fn[key]=function(value){var local,cur,match,fn,vtype=getType(value);if(key==="alpha"){fn=this._hsla?"hsla":"rgba"}else{fn=spaceName}
local=this[fn]();cur=local[prop.idx];if(vtype==="undefined"){return cur}
if(vtype==="function"){value=value.call(this,cur);vtype=getType(value)}
if(value==null&&prop.empty){return this}
if(vtype==="string"){match=rplusequals.exec(value);if(match){value=cur+parseFloat(match[2])*(match[1]==="+"?1:-1)}}
local[prop.idx]=value;return this[fn](local)}})});color.hook=function(hook){var hooks=hook.split(" ");each(hooks,function(_i,hook){jQuery.cssHooks[hook]={set:function(elem,value){var parsed,curElem,backgroundColor="";if(value!=="transparent"&&(getType(value)!=="string"||(parsed=stringParse(value)))){value=color(parsed||value);if(!support.rgba&&value._rgba[3]!==1){curElem=hook==="backgroundColor"?elem.parentNode:elem;while((backgroundColor===""||backgroundColor==="transparent")&&curElem&&curElem.style){try{backgroundColor=jQuery.css(curElem,"backgroundColor");curElem=curElem.parentNode}catch(e){}}
value=value.blend(backgroundColor&&backgroundColor!=="transparent"?backgroundColor:"_default")}
value=value.toRgbaString()}
try{elem.style[hook]=value}catch(e){}}};jQuery.fx.step[hook]=function(fx){if(!fx.colorInit){fx.start=color(fx.elem,hook);fx.end=color(fx.end);fx.colorInit=!0}
jQuery.cssHooks[hook].set(fx.elem,fx.start.transition(fx.end,fx.pos))}})};color.hook(stepHooks);jQuery.cssHooks.borderColor={expand:function(value){var expanded={};each(["Top","Right","Bottom","Left"],function(_i,part){expanded["border"+part+"Color"]=value});return expanded}};colors=jQuery.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}});/*!
 * jQuery UI Effects Drop 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../version","../effect"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.effects.define("drop","hide",function(options,done){var distance,element=$(this),mode=options.mode,show=mode==="show",direction=options.direction||"left",ref=(direction==="up"||direction==="down")?"top":"left",motion=(direction==="up"||direction==="left")?"-=":"+=",oppositeMotion=(motion==="+=")?"-=":"+=",animation={opacity:0};$.effects.createPlaceholder(element);distance=options.distance||element[ref==="top"?"outerHeight":"outerWidth"](!0)/2;animation[ref]=motion+distance;if(show){element.css(animation);animation[ref]=oppositeMotion+distance;animation.opacity=1}
element.animate(animation,{queue:!1,duration:options.duration,easing:options.easing,complete:done})})});/*!
 * jQuery UI Effects Fade 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../version","../effect"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.effects.define("fade","toggle",function(options,done){var show=options.mode==="show";$(this).css("opacity",show?0:1).animate({opacity:show?1:0},{queue:!1,duration:options.duration,easing:options.easing,complete:done})})});/*!
 * jQuery UI Effects Size 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../version","../effect"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.effects.define("size",function(options,done){var baseline,factor,temp,element=$(this),cProps=["fontSize"],vProps=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],hProps=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],mode=options.mode,restore=mode!=="effect",scale=options.scale||"both",origin=options.origin||["middle","center"],position=element.css("position"),pos=element.position(),original=$.effects.scaledDimensions(element),from=options.from||original,to=options.to||$.effects.scaledDimensions(element,0);$.effects.createPlaceholder(element);if(mode==="show"){temp=from;from=to;to=temp}
factor={from:{y:from.height/original.height,x:from.width/original.width},to:{y:to.height/original.height,x:to.width/original.width}};if(scale==="box"||scale==="both"){if(factor.from.y!==factor.to.y){from=$.effects.setTransition(element,vProps,factor.from.y,from);to=$.effects.setTransition(element,vProps,factor.to.y,to)}
if(factor.from.x!==factor.to.x){from=$.effects.setTransition(element,hProps,factor.from.x,from);to=$.effects.setTransition(element,hProps,factor.to.x,to)}}
if(scale==="content"||scale==="both"){if(factor.from.y!==factor.to.y){from=$.effects.setTransition(element,cProps,factor.from.y,from);to=$.effects.setTransition(element,cProps,factor.to.y,to)}}
if(origin){baseline=$.effects.getBaseline(origin,original);from.top=(original.outerHeight-from.outerHeight)*baseline.y+pos.top;from.left=(original.outerWidth-from.outerWidth)*baseline.x+pos.left;to.top=(original.outerHeight-to.outerHeight)*baseline.y+pos.top;to.left=(original.outerWidth-to.outerWidth)*baseline.x+pos.left}
delete from.outerHeight;delete from.outerWidth;element.css(from);if(scale==="content"||scale==="both"){vProps=vProps.concat(["marginTop","marginBottom"]).concat(cProps);hProps=hProps.concat(["marginLeft","marginRight"]);element.find("*[width]").each(function(){var child=$(this),childOriginal=$.effects.scaledDimensions(child),childFrom={height:childOriginal.height*factor.from.y,width:childOriginal.width*factor.from.x,outerHeight:childOriginal.outerHeight*factor.from.y,outerWidth:childOriginal.outerWidth*factor.from.x},childTo={height:childOriginal.height*factor.to.y,width:childOriginal.width*factor.to.x,outerHeight:childOriginal.height*factor.to.y,outerWidth:childOriginal.width*factor.to.x};if(factor.from.y!==factor.to.y){childFrom=$.effects.setTransition(child,vProps,factor.from.y,childFrom);childTo=$.effects.setTransition(child,vProps,factor.to.y,childTo)}
if(factor.from.x!==factor.to.x){childFrom=$.effects.setTransition(child,hProps,factor.from.x,childFrom);childTo=$.effects.setTransition(child,hProps,factor.to.x,childTo)}
if(restore){$.effects.saveStyle(child)}
child.css(childFrom);child.animate(childTo,options.duration,options.easing,function(){if(restore){$.effects.restoreStyle(child)}})})}
element.animate(to,{queue:!1,duration:options.duration,easing:options.easing,complete:function(){var offset=element.offset();if(to.opacity===0){element.css("opacity",from.opacity)}
if(!restore){element.css("position",position==="static"?"relative":position).offset(offset);$.effects.saveStyle(element)}
done()}})})});/*!
 * jQuery UI Effects Slide 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../version","../effect"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.effects.define("slide","show",function(options,done){var startClip,startRef,element=$(this),map={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},mode=options.mode,direction=options.direction||"left",ref=(direction==="up"||direction==="down")?"top":"left",positiveMotion=(direction==="up"||direction==="left"),distance=options.distance||element[ref==="top"?"outerHeight":"outerWidth"](!0),animation={};$.effects.createPlaceholder(element);startClip=element.cssClip();startRef=element.position()[ref];animation[ref]=(positiveMotion?-1:1)*distance+startRef;animation.clip=element.cssClip();animation.clip[map[direction][1]]=animation.clip[map[direction][0]];if(mode==="show"){element.cssClip(animation.clip);element.css(ref,animation[ref]);animation.clip=startClip;animation[ref]=startRef}
element.animate(animation,{queue:!1,duration:options.duration,easing:options.easing,complete:done})})});/*!
 * jQuery UI Effects Transfer 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../version","../effect"],factory)}else{factory(jQuery)}})(function($){"use strict";var effect;if($.uiBackCompat!==!1){effect=$.effects.define("transfer",function(options,done){$(this).transfer(options,done)})}
return effect});(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.ui.safeActiveElement=function(document){var activeElement;try{activeElement=document.activeElement}catch(error){activeElement=document.body}
if(!activeElement){activeElement=document.body}
if(!activeElement.nodeName){activeElement=document.body}
return activeElement}});/*!
 * jQuery UI Button 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./controlgroup","./checkboxradio","../keycode","../widget"],factory)}else{factory(jQuery)}})(function($){"use strict";$.widget("ui.button",{version:"1.13.3",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var disabled,options=this._super()||{};this.isInput=this.element.is("input");disabled=this.element[0].disabled;if(disabled!=null){options.disabled=disabled}
this.originalLabel=this.isInput?this.element.val():this.element.html();if(this.originalLabel){options.label=this.originalLabel}
return options},_create:function(){if(!this.option.showLabel&!this.options.icon){this.options.showLabel=!0}
if(this.options.disabled==null){this.options.disabled=this.element[0].disabled||!1}
this.hasTitle=!!this.element.attr("title");if(this.options.label&&this.options.label!==this.originalLabel){if(this.isInput){this.element.val(this.options.label)}else{this.element.html(this.options.label)}}
this._addClass("ui-button","ui-widget");this._setOption("disabled",this.options.disabled);this._enhance();if(this.element.is("a")){this._on({"keyup":function(event){if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault();if(this.element[0].click){this.element[0].click()}else{this.element.trigger("click")}}}})}},_enhance:function(){if(!this.element.is("button")){this.element.attr("role","button")}
if(this.options.icon){this._updateIcon("icon",this.options.icon);this._updateTooltip()}},_updateTooltip:function(){this.title=this.element.attr("title");if(!this.options.showLabel&&!this.title){this.element.attr("title",this.options.label)}},_updateIcon:function(option,value){var icon=option!=="iconPosition",position=icon?this.options.iconPosition:value,displayBlock=position==="top"||position==="bottom";if(!this.icon){this.icon=$("<span>");this._addClass(this.icon,"ui-button-icon","ui-icon");if(!this.options.showLabel){this._addClass("ui-button-icon-only")}}else if(icon){this._removeClass(this.icon,null,this.options.icon)}
if(icon){this._addClass(this.icon,null,value)}
this._attachIcon(position);if(displayBlock){this._addClass(this.icon,null,"ui-widget-icon-block");if(this.iconSpace){this.iconSpace.remove()}}else{if(!this.iconSpace){this.iconSpace=$("<span> </span>");this._addClass(this.iconSpace,"ui-button-icon-space")}
this._removeClass(this.icon,null,"ui-wiget-icon-block");this._attachIconSpace(position)}},_destroy:function(){this.element.removeAttr("role");if(this.icon){this.icon.remove()}
if(this.iconSpace){this.iconSpace.remove()}
if(!this.hasTitle){this.element.removeAttr("title")}},_attachIconSpace:function(iconPosition){this.icon[/^(?:end|bottom)/.test(iconPosition)?"before":"after"](this.iconSpace)},_attachIcon:function(iconPosition){this.element[/^(?:end|bottom)/.test(iconPosition)?"append":"prepend"](this.icon)},_setOptions:function(options){var newShowLabel=options.showLabel===undefined?this.options.showLabel:options.showLabel,newIcon=options.icon===undefined?this.options.icon:options.icon;if(!newShowLabel&&!newIcon){options.showLabel=!0}
this._super(options)},_setOption:function(key,value){if(key==="icon"){if(value){this._updateIcon(key,value)}else if(this.icon){this.icon.remove();if(this.iconSpace){this.iconSpace.remove()}}}
if(key==="iconPosition"){this._updateIcon(key,value)}
if(key==="showLabel"){this._toggleClass("ui-button-icon-only",null,!value);this._updateTooltip()}
if(key==="label"){if(this.isInput){this.element.val(value)}else{this.element.html(value);if(this.icon){this._attachIcon(this.options.iconPosition);this._attachIconSpace(this.options.iconPosition)}}}
this._super(key,value);if(key==="disabled"){this._toggleClass(null,"ui-state-disabled",value);this.element[0].disabled=value;if(value){this.element.trigger("blur")}}},refresh:function(){var isDisabled=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");if(isDisabled!==this.options.disabled){this._setOptions({disabled:isDisabled})}
this._updateTooltip()}});if($.uiBackCompat!==!1){$.widget("ui.button",$.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){if(this.options.showLabel&&!this.options.text){this.options.showLabel=this.options.text}
if(!this.options.showLabel&&this.options.text){this.options.text=this.options.showLabel}
if(!this.options.icon&&(this.options.icons.primary||this.options.icons.secondary)){if(this.options.icons.primary){this.options.icon=this.options.icons.primary}else{this.options.icon=this.options.icons.secondary;this.options.iconPosition="end"}}else if(this.options.icon){this.options.icons.primary=this.options.icon}
this._super()},_setOption:function(key,value){if(key==="text"){this._super("showLabel",value);return}
if(key==="showLabel"){this.options.text=value}
if(key==="icon"){this.options.icons.primary=value}
if(key==="icons"){if(value.primary){this._super("icon",value.primary);this._super("iconPosition","beginning")}else if(value.secondary){this._super("icon",value.secondary);this._super("iconPosition","end")}}
this._superApply(arguments)}});$.fn.button=(function(orig){return function(options){var isMethodCall=typeof options==="string";var args=Array.prototype.slice.call(arguments,1);var returnValue=this;if(isMethodCall){if(!this.length&&options==="instance"){returnValue=undefined}else{this.each(function(){var methodValue;var type=$(this).attr("type");var name=type!=="checkbox"&&type!=="radio"?"button":"checkboxradio";var instance=$.data(this,"ui-"+name);if(options==="instance"){returnValue=instance;return!1}
if(!instance){return $.error("cannot call methods on button"+" prior to initialization; "+"attempted to call method '"+options+"'")}
if(typeof instance[options]!=="function"||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for button"+" widget instance")}
methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return!1}})}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args))}
this.each(function(){var type=$(this).attr("type");var name=type!=="checkbox"&&type!=="radio"?"button":"checkboxradio";var instance=$.data(this,"ui-"+name);if(instance){instance.option(options||{});if(instance._init){instance._init()}}else{if(name==="button"){orig.call($(this),options);return}
$(this).checkboxradio($.extend({icon:!1},options))}})}
return returnValue}})($.fn.button);$.fn.buttonset=function(){if(!$.ui.controlgroup){$.error("Controlgroup widget missing")}
if(arguments[0]==="option"&&arguments[1]==="items"&&arguments[2]){return this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]])}
if(arguments[0]==="option"&&arguments[1]==="items"){return this.controlgroup.apply(this,[arguments[0],"items.button"])}
if(typeof arguments[0]==="object"&&arguments[0].items){arguments[0].items={button:arguments[0].items}}
return this.controlgroup.apply(this,arguments)}}
return $.ui.button});/*!
 * jQuery UI Resizable 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./mouse","../disable-selection","../plugin","../version","../widget"],factory)}else{factory(jQuery)}})(function($){"use strict";$.widget("ui.resizable",$.ui.mouse,{version:"1.13.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(value){return parseFloat(value)||0},_isNumber:function(value){return!isNaN(parseFloat(value))},_hasScroll:function(el,a){if($(el).css("overflow")==="hidden"){return!1}
var scroll=(a&&a==="left")?"scrollLeft":"scrollTop",has=!1;if(el[scroll]>0){return!0}
try{el[scroll]=1;has=(el[scroll]>0);el[scroll]=0}catch(e){}
return has},_create:function(){var margins,o=this.options,that=this;this._addClass("ui-resizable");$.extend(this,{_aspectRatio:!!(o.aspectRatio),aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap($("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=!0;margins={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(margins);this.originalElement.css("margin",0);this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css(margins);this._proportionallyResize()}
this._setupHandles();if(o.autoHide){$(this.element).on("mouseenter",function(){if(o.disabled){return}
that._removeClass("ui-resizable-autohide");that._handles.show()}).on("mouseleave",function(){if(o.disabled){return}
if(!that.resizing){that._addClass("ui-resizable-autohide");that._handles.hide()}})}
this._mouseInit()},_destroy:function(){this._mouseDestroy();this._addedHandles.remove();var wrapper,_destroy=function(exp){$(exp).removeData("resizable").removeData("ui-resizable").off(".resizable")};if(this.elementIsWrapper){_destroy(this.element);wrapper=this.element;this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper);wrapper.remove()}
this.originalElement.css("resize",this.originalResizeStyle);_destroy(this.originalElement);return this},_setOption:function(key,value){this._super(key,value);switch(key){case "handles":this._removeHandles();this._setupHandles();break;case "aspectRatio":this._aspectRatio=!!value;break;default:break}},_setupHandles:function(){var o=this.options,handle,i,n,hname,axis,that=this;this.handles=o.handles||(!$(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});this._handles=$();this._addedHandles=$();if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw"}
n=this.handles.split(",");this.handles={};for(i=0;i<n.length;i++){handle=String.prototype.trim.call(n[i]);hname="ui-resizable-"+handle;axis=$("<div>");this._addClass(axis,"ui-resizable-handle "+hname);axis.css({zIndex:o.zIndex});this.handles[handle]=".ui-resizable-"+handle;if(!this.element.children(this.handles[handle]).length){this.element.append(axis);this._addedHandles=this._addedHandles.add(axis)}}}
this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(i in this.handles){if(this.handles[i].constructor===String){this.handles[i]=this.element.children(this.handles[i]).first().show()}else if(this.handles[i].jquery||this.handles[i].nodeType){this.handles[i]=$(this.handles[i]);this._on(this.handles[i],{"mousedown":that._mouseDown})}
if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){axis=$(this.handles[i],this.element);padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");target.css(padPos,padWrapper);this._proportionallyResize()}
this._handles=this._handles.add(this.handles[i])}};this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.on("mouseover",function(){if(!that.resizing){if(this.className){axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}
that.axis=axis&&axis[1]?axis[1]:"se"}});if(o.autoHide){this._handles.hide();this._addClass("ui-resizable-autohide")}},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(event){var i,handle,capture=!1;for(i in this.handles){handle=$(this.handles[i])[0];if(handle===event.target||$.contains(handle,event.target)){capture=!0}}
return!this.options.disabled&&capture},_mouseStart:function(event){var curleft,curtop,cursor,o=this.options,el=this.element;this.resizing=!0;this._renderProxy();curleft=this._num(this.helper.css("left"));curtop=this._num(this.helper.css("top"));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0}
this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalPosition={left:curleft,top:curtop};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=(typeof o.aspectRatio==="number")?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);cursor=$(".ui-resizable-"+this.axis).css("cursor");$("body").css("cursor",cursor==="auto"?this.axis+"-resize":cursor);this._addClass("ui-resizable-resizing");this._propagate("start",event);return!0},_mouseDrag:function(event){var data,props,smp=this.originalMousePosition,a=this.axis,dx=(event.pageX-smp.left)||0,dy=(event.pageY-smp.top)||0,trigger=this._change[a];this._updatePrevProperties();if(!trigger){return!1}
data=trigger.apply(this,[event,dx,dy]);this._updateVirtualBoundaries(event.shiftKey);if(this._aspectRatio||event.shiftKey){data=this._updateRatio(data,event)}
data=this._respectSize(data,event);this._updateCache(data);this._propagate("resize",event);props=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}
if(!$.isEmptyObject(props)){this._updatePrevProperties();this._trigger("resize",event,this.ui());this._applyChanges()}
return!1},_mouseStop:function(event){this.resizing=!1;var pr,ista,soffseth,soffsetw,s,left,top,o=this.options,that=this;if(this._helper){pr=this._proportionallyResizeElements;ista=pr.length&&(/textarea/i).test(pr[0].nodeName);soffseth=ista&&this._hasScroll(pr[0],"left")?0:that.sizeDiff.height;soffsetw=ista?0:that.sizeDiff.width;s={width:(that.helper.width()-soffsetw),height:(that.helper.height()-soffseth)};left=(parseFloat(that.element.css("left"))+(that.position.left-that.originalPosition.left))||null;top=(parseFloat(that.element.css("top"))+(that.position.top-that.originalPosition.top))||null;if(!o.animate){this.element.css($.extend(s,{top:top,left:left}))}
that.helper.height(that.size.height);that.helper.width(that.size.width);if(this._helper&&!o.animate){this._proportionallyResize()}}
$("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper){this.helper.remove()}
return!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var props={};if(this.position.top!==this.prevPosition.top){props.top=this.position.top+"px"}
if(this.position.left!==this.prevPosition.left){props.left=this.position.left+"px"}
this.helper.css(props);if(this.size.width!==this.prevSize.width){props.width=this.size.width+"px";this.helper.width(props.width)}
if(this.size.height!==this.prevSize.height){props.height=this.size.height+"px";this.helper.height(props.height)}
return props},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight,pMaxHeight,b,o=this.options;b={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:Infinity,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:Infinity};if(this._aspectRatio||forceAspectRatio){pMinWidth=b.minHeight*this.aspectRatio;pMinHeight=b.minWidth/this.aspectRatio;pMaxWidth=b.maxHeight*this.aspectRatio;pMaxHeight=b.maxWidth/this.aspectRatio;if(pMinWidth>b.minWidth){b.minWidth=pMinWidth}
if(pMinHeight>b.minHeight){b.minHeight=pMinHeight}
if(pMaxWidth<b.maxWidth){b.maxWidth=pMaxWidth}
if(pMaxHeight<b.maxHeight){b.maxHeight=pMaxHeight}}
this._vBoundaries=b},_updateCache:function(data){this.offset=this.helper.offset();if(this._isNumber(data.left)){this.position.left=data.left}
if(this._isNumber(data.top)){this.position.top=data.top}
if(this._isNumber(data.height)){this.size.height=data.height}
if(this._isNumber(data.width)){this.size.width=data.width}},_updateRatio:function(data){var cpos=this.position,csize=this.size,a=this.axis;if(this._isNumber(data.height)){data.width=(data.height*this.aspectRatio)}else if(this._isNumber(data.width)){data.height=(data.width/this.aspectRatio)}
if(a==="sw"){data.left=cpos.left+(csize.width-data.width);data.top=null}
if(a==="nw"){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width)}
return data},_respectSize:function(data){var o=this._vBoundaries,a=this.axis,ismaxw=this._isNumber(data.width)&&o.maxWidth&&(o.maxWidth<data.width),ismaxh=this._isNumber(data.height)&&o.maxHeight&&(o.maxHeight<data.height),isminw=this._isNumber(data.width)&&o.minWidth&&(o.minWidth>data.width),isminh=this._isNumber(data.height)&&o.minHeight&&(o.minHeight>data.height),dw=this.originalPosition.left+this.originalSize.width,dh=this.originalPosition.top+this.originalSize.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw){data.width=o.minWidth}
if(isminh){data.height=o.minHeight}
if(ismaxw){data.width=o.maxWidth}
if(ismaxh){data.height=o.maxHeight}
if(isminw&&cw){data.left=dw-o.minWidth}
if(ismaxw&&cw){data.left=dw-o.maxWidth}
if(isminh&&ch){data.top=dh-o.minHeight}
if(ismaxh&&ch){data.top=dh-o.maxHeight}
if(!data.width&&!data.height&&!data.left&&data.top){data.top=null}else if(!data.width&&!data.height&&!data.top&&data.left){data.left=null}
return data},_getPaddingPlusBorderDimensions:function(element){var i=0,widths=[],borders=[element.css("borderTopWidth"),element.css("borderRightWidth"),element.css("borderBottomWidth"),element.css("borderLeftWidth")],paddings=[element.css("paddingTop"),element.css("paddingRight"),element.css("paddingBottom"),element.css("paddingLeft")];for(;i<4;i++){widths[i]=(parseFloat(borders[i])||0);widths[i]+=(parseFloat(paddings[i])||0)}
return{height:widths[0]+widths[2],width:widths[1]+widths[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}
var prel,i=0,element=this.helper||this.element;for(;i<this._proportionallyResizeElements.length;i++){prel=this._proportionallyResizeElements[i];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(prel)}
prel.css({height:(element.height()-this.outerDimensions.height)||0,width:(element.width()-this.outerDimensions.width)||0})}},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$("<div></div>").css({overflow:"hidden"});this._addClass(this.helper,this._helper);this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(event,dx){return{width:this.originalSize.width+dx}},w:function(event,dx){var cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx}},n:function(event,dx,dy){var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy}},s:function(event,dx,dy){return{height:this.originalSize.height+dy}},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);if(n!=="resize"){this._trigger(n,event,this.ui())}},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).resizable("instance"),o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&that._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,style={width:(that.size.width-soffsetw),height:(that.size.height-soffseth)},left=(parseFloat(that.element.css("left"))+(that.position.left-that.originalPosition.left))||null,top=(parseFloat(that.element.css("top"))+(that.position.top-that.originalPosition.top))||null;that.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseFloat(that.element.css("width")),height:parseFloat(that.element.css("height")),top:parseFloat(that.element.css("top")),left:parseFloat(that.element.css("left"))};if(pr&&pr.length){$(pr[0]).css({width:data.width,height:data.height})}
that._updateCache(data);that._propagate("resize",event)}})}});$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,ch,cw,width,height,that=$(this).resizable("instance"),o=that.options,el=that.element,oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce){return}
that.containerElement=$(ce);if(/document/.test(oc)||oc===document){that.containerOffset={left:0,top:0};that.containerPosition={left:0,top:0};that.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight}}else{element=$(ce);p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=that._num(element.css("padding"+name))});that.containerOffset=element.offset();that.containerPosition=element.position();that.containerSize={height:(element.innerHeight()-p[3]),width:(element.innerWidth()-p[1])};co=that.containerOffset;ch=that.containerSize.height;cw=that.containerSize.width;width=(that._hasScroll(ce,"left")?ce.scrollWidth:cw);height=(that._hasScroll(ce)?ce.scrollHeight:ch);that.parentData={element:ce,left:co.left,top:co.top,width:width,height:height}}},resize:function(event){var woset,hoset,isParent,isOffsetRelative,that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cp=that.position,pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement,continueResize=!0;if(ce[0]!==document&&(/static/).test(ce.css("position"))){cop=co}
if(cp.left<(that._helper?co.left:0)){that.size.width=that.size.width+(that._helper?(that.position.left-co.left):(that.position.left-cop.left));if(pRatio){that.size.height=that.size.width/that.aspectRatio;continueResize=!1}
that.position.left=o.helper?co.left:0}
if(cp.top<(that._helper?co.top:0)){that.size.height=that.size.height+(that._helper?(that.position.top-co.top):that.position.top);if(pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=!1}
that.position.top=that._helper?co.top:0}
isParent=that.containerElement.get(0)===that.element.parent().get(0);isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position"));if(isParent&&isOffsetRelative){that.offset.left=that.parentData.left+that.position.left;that.offset.top=that.parentData.top+that.position.top}else{that.offset.left=that.element.offset().left;that.offset.top=that.element.offset().top}
woset=Math.abs(that.sizeDiff.width+(that._helper?that.offset.left-cop.left:(that.offset.left-co.left)));hoset=Math.abs(that.sizeDiff.height+(that._helper?that.offset.top-cop.top:(that.offset.top-co.top)));if(woset+that.size.width>=that.parentData.width){that.size.width=that.parentData.width-woset;if(pRatio){that.size.height=that.size.width/that.aspectRatio;continueResize=!1}}
if(hoset+that.size.height>=that.parentData.height){that.size.height=that.parentData.height-hoset;if(pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=!1}}
if(!continueResize){that.position.left=that.prevPosition.left;that.position.top=that.prevPosition.top;that.size.width=that.prevSize.width;that.size.height=that.prevSize.height}},stop:function(){var that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;if(that._helper&&!o.animate&&(/relative/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}
if(that._helper&&!o.animate&&(/static/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}}});$.ui.plugin.add("resizable","alsoResize",{start:function(){var that=$(this).resizable("instance"),o=that.options;$(o.alsoResize).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseFloat(el.css("width")),height:parseFloat(el.css("height")),left:parseFloat(el.css("left")),top:parseFloat(el.css("top"))})})},resize:function(event,ui){var that=$(this).resizable("instance"),o=that.options,os=that.originalSize,op=that.originalPosition,delta={height:(that.size.height-os.height)||0,width:(that.size.width-os.width)||0,top:(that.position.top-op.top)||0,left:(that.position.left-op.left)||0};$(o.alsoResize).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),style={},css=el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0){style[prop]=sum||null}});el.css(style)})},stop:function(){$(this).removeData("ui-resizable-alsoresize")}});$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).resizable("instance"),cs=that.size;that.ghost=that.originalElement.clone();that.ghost.css({opacity:0.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0});that._addClass(that.ghost,"ui-resizable-ghost");if($.uiBackCompat!==!1&&typeof that.options.ghost==="string"){that.ghost.addClass(this.options.ghost)}
that.ghost.appendTo(that.helper)},resize:function(){var that=$(this).resizable("instance");if(that.ghost){that.ghost.css({position:"relative",height:that.size.height,width:that.size.width})}},stop:function(){var that=$(this).resizable("instance");if(that.ghost&&that.helper){that.helper.get(0).removeChild(that.ghost.get(0))}}});$.ui.plugin.add("resizable","grid",{resize:function(){var outerDimensions,that=$(this).resizable("instance"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,grid=typeof o.grid==="number"?[o.grid,o.grid]:o.grid,gridX=(grid[0]||1),gridY=(grid[1]||1),ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&(o.maxWidth<newWidth),isMaxHeight=o.maxHeight&&(o.maxHeight<newHeight),isMinWidth=o.minWidth&&(o.minWidth>newWidth),isMinHeight=o.minHeight&&(o.minHeight>newHeight);o.grid=grid;if(isMinWidth){newWidth+=gridX}
if(isMinHeight){newHeight+=gridY}
if(isMaxWidth){newWidth-=gridX}
if(isMaxHeight){newHeight-=gridY}
if(/^(se|s|e)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight}else if(/^(ne)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.top=op.top-oy}else if(/^(sw)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.left=op.left-ox}else{if(newHeight-gridY<=0||newWidth-gridX<=0){outerDimensions=that._getPaddingPlusBorderDimensions(this)}
if(newHeight-gridY>0){that.size.height=newHeight;that.position.top=op.top-oy}else{newHeight=gridY-outerDimensions.height;that.size.height=newHeight;that.position.top=op.top+os.height-newHeight}
if(newWidth-gridX>0){that.size.width=newWidth;that.position.left=op.left-ox}else{newWidth=gridX-outerDimensions.width;that.size.width=newWidth;that.position.left=op.left+os.width-newWidth}}}});return $.ui.resizable});/*!
 * jQuery UI Slider 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./mouse","../keycode","../version","../widget"],factory)}else{factory(jQuery)}})(function($){"use strict";return $.widget("ui.slider",$.ui.mouse,{version:"1.13.3",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1;this._mouseSliding=!1;this._animateOff=!0;this._handleIndex=null;this._detectOrientation();this._mouseInit();this._calculateNewMax();this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content");this._refresh();this._animateOff=!1},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue()},_createHandles:function(){var i,handleCount,options=this.options,existingHandles=this.element.find(".ui-slider-handle"),handle="<span tabindex='0'></span>",handles=[];handleCount=(options.values&&options.values.length)||1;if(existingHandles.length>handleCount){existingHandles.slice(handleCount).remove();existingHandles=existingHandles.slice(0,handleCount)}
for(i=existingHandles.length;i<handleCount;i++){handles.push(handle)}
this.handles=existingHandles.add($(handles.join("")).appendTo(this.element));this._addClass(this.handles,"ui-slider-handle","ui-state-default");this.handle=this.handles.eq(0);this.handles.each(function(i){$(this).data("ui-slider-handle-index",i).attr("tabIndex",0)})},_createRange:function(){var options=this.options;if(options.range){if(options.range===!0){if(!options.values){options.values=[this._valueMin(),this._valueMin()]}else if(options.values.length&&options.values.length!==2){options.values=[options.values[0],options.values[0]]}else if(Array.isArray(options.values)){options.values=options.values.slice(0)}}
if(!this.range||!this.range.length){this.range=$("<div>").appendTo(this.element);this._addClass(this.range,"ui-slider-range")}else{this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max");this.range.css({"left":"","bottom":""})}
if(options.range==="min"||options.range==="max"){this._addClass(this.range,"ui-slider-range-"+options.range)}}else{if(this.range){this.range.remove()}
this.range=null}},_setupEvents:function(){this._off(this.handles);this._on(this.handles,this._handleEvents);this._hoverable(this.handles);this._focusable(this.handles)},_destroy:function(){this.handles.remove();if(this.range){this.range.remove()}
this._mouseDestroy()},_mouseCapture:function(event){var position,normValue,distance,closestHandle,index,allowed,offset,mouseOverHandle,that=this,o=this.options;if(o.disabled){return!1}
this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();position={x:event.pageX,y:event.pageY};normValue=this._normValueFromMouse(position);distance=this._valueMax()-this._valueMin()+1;this.handles.each(function(i){var thisDistance=Math.abs(normValue-that.values(i));if((distance>thisDistance)||(distance===thisDistance&&(i===that._lastChangedValue||that.values(i)===o.min))){distance=thisDistance;closestHandle=$(this);index=i}});allowed=this._start(event,index);if(allowed===!1){return!1}
this._mouseSliding=!0;this._handleIndex=index;this._addClass(closestHandle,null,"ui-state-active");closestHandle.trigger("focus");offset=closestHandle.offset();mouseOverHandle=!$(event.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-(closestHandle.width()/2),top:event.pageY-offset.top-(closestHandle.height()/2)-(parseInt(closestHandle.css("borderTopWidth"),10)||0)-(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+(parseInt(closestHandle.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(event,index,normValue)}
this._animateOff=!0;return!0},_mouseStart:function(){return!0},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return!1},_mouseStop:function(event){this._removeClass(this.handles,null,"ui-state-active");this._mouseSliding=!1;this._stop(event,this._handleIndex);this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal"},_normValueFromMouse:function(position){var pixelTotal,pixelMouse,percentMouse,valueTotal,valueMouse;if(this.orientation==="horizontal"){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}
percentMouse=(pixelMouse/pixelTotal);if(percentMouse>1){percentMouse=1}
if(percentMouse<0){percentMouse=0}
if(this.orientation==="vertical"){percentMouse=1-percentMouse}
valueTotal=this._valueMax()-this._valueMin();valueMouse=this._valueMin()+percentMouse*valueTotal;return this._trimAlignValue(valueMouse)},_uiHash:function(index,value,values){var uiHash={handle:this.handles[index],handleIndex:index,value:value!==undefined?value:this.value()};if(this._hasMultipleValues()){uiHash.value=value!==undefined?value:this.values(index);uiHash.values=values||this.values()}
return uiHash},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(event,index){return this._trigger("start",event,this._uiHash(index))},_slide:function(event,index,newVal){var allowed,otherVal,currentValue=this.value(),newValues=this.values();if(this._hasMultipleValues()){otherVal=this.values(index?0:1);currentValue=this.values(index);if(this.options.values.length===2&&this.options.range===!0){newVal=index===0?Math.min(otherVal,newVal):Math.max(otherVal,newVal)}
newValues[index]=newVal}
if(newVal===currentValue){return}
allowed=this._trigger("slide",event,this._uiHash(index,newVal,newValues));if(allowed===!1){return}
if(this._hasMultipleValues()){this.values(index,newVal)}else{this.value(newVal)}},_stop:function(event,index){this._trigger("stop",event,this._uiHash(index))},_change:function(event,index){if(!this._keySliding&&!this._mouseSliding){this._lastChangedValue=index;this._trigger("change",event,this._uiHash(index))}},value:function(newValue){if(arguments.length){this.options.value=this._trimAlignValue(newValue);this._refreshValue();this._change(null,0);return}
return this._value()},values:function(index,newValue){var vals,newValues,i;if(arguments.length>1){this.options.values[index]=this._trimAlignValue(newValue);this._refreshValue();this._change(null,index);return}
if(arguments.length){if(Array.isArray(arguments[0])){vals=this.options.values;newValues=arguments[0];for(i=0;i<vals.length;i+=1){vals[i]=this._trimAlignValue(newValues[i]);this._change(null,i)}
this._refreshValue()}else{if(this._hasMultipleValues()){return this._values(index)}else{return this.value()}}}else{return this._values()}},_setOption:function(key,value){var i,valsLength=0;if(key==="range"&&this.options.range===!0){if(value==="min"){this.options.value=this._values(0);this.options.values=null}else if(value==="max"){this.options.value=this._values(this.options.values.length-1);this.options.values=null}}
if(Array.isArray(this.options.values)){valsLength=this.options.values.length}
this._super(key,value);switch(key){case "orientation":this._detectOrientation();this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation);this._refreshValue();if(this.options.range){this._refreshRange(value)}
this.handles.css(value==="horizontal"?"bottom":"left","");break;case "value":this._animateOff=!0;this._refreshValue();this._change(null,0);this._animateOff=!1;break;case "values":this._animateOff=!0;this._refreshValue();for(i=valsLength-1;i>=0;i--){this._change(null,i)}
this._animateOff=!1;break;case "step":case "min":case "max":this._animateOff=!0;this._calculateNewMax();this._refreshValue();this._animateOff=!1;break;case "range":this._animateOff=!0;this._refresh();this._animateOff=!1;break}},_setOptionDisabled:function(value){this._super(value);this._toggleClass(null,"ui-state-disabled",!!value)},_value:function(){var val=this.options.value;val=this._trimAlignValue(val);return val},_values:function(index){var val,vals,i;if(arguments.length){val=this.options.values[index];val=this._trimAlignValue(val);return val}else if(this._hasMultipleValues()){vals=this.options.values.slice();for(i=0;i<vals.length;i+=1){vals[i]=this._trimAlignValue(vals[i])}
return vals}else{return[]}},_trimAlignValue:function(val){if(val<=this._valueMin()){return this._valueMin()}
if(val>=this._valueMax()){return this._valueMax()}
var step=(this.options.step>0)?this.options.step:1,valModStep=(val-this._valueMin())%step,alignValue=val-valModStep;if(Math.abs(valModStep)*2>=step){alignValue+=(valModStep>0)?step:(-step)}
return parseFloat(alignValue.toFixed(5))},_calculateNewMax:function(){var max=this.options.max,min=this._valueMin(),step=this.options.step,aboveMin=Math.round((max-min)/step)*step;max=aboveMin+min;if(max>this.options.max){max-=step}
this.max=parseFloat(max.toFixed(this._precision()))},_precision:function(){var precision=this._precisionOf(this.options.step);if(this.options.min!==null){precision=Math.max(precision,this._precisionOf(this.options.min))}
return precision},_precisionOf:function(num){var str=num.toString(),decimal=str.indexOf(".");return decimal===-1?0:str.length-decimal-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(orientation){if(orientation==="vertical"){this.range.css({"width":"","left":""})}
if(orientation==="horizontal"){this.range.css({"height":"","bottom":""})}},_refreshValue:function(){var lastValPercent,valPercent,value,valueMin,valueMax,oRange=this.options.range,o=this.options,that=this,animate=(!this._animateOff)?o.animate:!1,_set={};if(this._hasMultipleValues()){this.handles.each(function(i){valPercent=(that.values(i)-that._valueMin())/(that._valueMax()-that._valueMin())*100;_set[that.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate);if(that.options.range===!0){if(that.orientation==="horizontal"){if(i===0){that.range.stop(1,1)[animate?"animate":"css"]({left:valPercent+"%"},o.animate)}
if(i===1){that.range[animate?"animate":"css"]({width:(valPercent-lastValPercent)+"%"},{queue:!1,duration:o.animate})}}else{if(i===0){that.range.stop(1,1)[animate?"animate":"css"]({bottom:(valPercent)+"%"},o.animate)}
if(i===1){that.range[animate?"animate":"css"]({height:(valPercent-lastValPercent)+"%"},{queue:!1,duration:o.animate})}}}
lastValPercent=valPercent})}else{value=this.value();valueMin=this._valueMin();valueMax=this._valueMax();valPercent=(valueMax!==valueMin)?(value-valueMin)/(valueMax-valueMin)*100:0;_set[this.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate);if(oRange==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:valPercent+"%"},o.animate)}
if(oRange==="max"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:(100-valPercent)+"%"},o.animate)}
if(oRange==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:valPercent+"%"},o.animate)}
if(oRange==="max"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:(100-valPercent)+"%"},o.animate)}}},_handleEvents:{keydown:function(event){var allowed,curVal,newVal,step,index=$(event.target).data("ui-slider-handle-index");switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:event.preventDefault();if(!this._keySliding){this._keySliding=!0;this._addClass($(event.target),null,"ui-state-active");allowed=this._start(event,index);if(allowed===!1){return}}
break}
step=this.options.step;if(this._hasMultipleValues()){curVal=newVal=this.values(index)}else{curVal=newVal=this.value()}
switch(event.keyCode){case $.ui.keyCode.HOME:newVal=this._valueMin();break;case $.ui.keyCode.END:newVal=this._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=this._trimAlignValue(curVal+((this._valueMax()-this._valueMin())/this.numPages));break;case $.ui.keyCode.PAGE_DOWN:newVal=this._trimAlignValue(curVal-((this._valueMax()-this._valueMin())/this.numPages));break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal===this._valueMax()){return}
newVal=this._trimAlignValue(curVal+step);break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal===this._valueMin()){return}
newVal=this._trimAlignValue(curVal-step);break}
this._slide(event,index,newVal)},keyup:function(event){var index=$(event.target).data("ui-slider-handle-index");if(this._keySliding){this._keySliding=!1;this._stop(event,index);this._change(event,index);this._removeClass($(event.target),null,"ui-state-active")}}}})});/*!
 * jQuery UI Controlgroup 1.13.3
 * https://jqueryui.com
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license.
 * https://jquery.org/license
 */
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../widget"],factory)}else{factory(jQuery)}})(function($){"use strict";var controlgroupCornerRegex=/ui-corner-([a-z]){2,6}/g;return $.widget("ui.controlgroup",{version:"1.13.3",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{"button":"input[type=button], input[type=submit], input[type=reset], button, a","controlgroupLabel":".ui-controlgroup-label","checkboxradio":"input[type='checkbox'], input[type='radio']","selectmenu":"select","spinner":".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar");this.refresh()},_destroy:function(){this._callChildMethod("destroy");this.childWidgets.removeData("ui-controlgroup-data");this.element.removeAttr("role");if(this.options.items.controlgroupLabel){this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()}},_initWidgets:function(){var that=this,childWidgets=[];$.each(this.options.items,function(widget,selector){var labels;var options={};if(!selector){return}
if(widget==="controlgroupLabel"){labels=that.element.find(selector);labels.each(function(){var element=$(this);if(element.children(".ui-controlgroup-label-contents").length){return}
element.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")});that._addClass(labels,null,"ui-widget ui-widget-content ui-state-default");childWidgets=childWidgets.concat(labels.get());return}
if(!$.fn[widget]){return}
if(that["_"+widget+"Options"]){options=that["_"+widget+"Options"]("middle")}else{options={classes:{}}}
that.element.find(selector).each(function(){var element=$(this);var instance=element[widget]("instance");var instanceOptions=$.widget.extend({},options);if(widget==="button"&&element.parent(".ui-spinner").length){return}
if(!instance){instance=element[widget]()[widget]("instance")}
if(instance){instanceOptions.classes=that._resolveClassesValues(instanceOptions.classes,instance)}
element[widget](instanceOptions);var widgetElement=element[widget]("widget");$.data(widgetElement[0],"ui-controlgroup-data",instance?instance:element[widget]("instance"));childWidgets.push(widgetElement[0])})});this.childWidgets=$($.uniqueSort(childWidgets));this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(method){this.childWidgets.each(function(){var element=$(this),data=element.data("ui-controlgroup-data");if(data&&data[method]){data[method]()}})},_updateCornerClass:function(element,position){var remove="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";var add=this._buildSimpleOptions(position,"label").classes.label;this._removeClass(element,null,remove);this._addClass(element,null,add)},_buildSimpleOptions:function(position,key){var direction=this.options.direction==="vertical";var result={classes:{}};result.classes[key]={"middle":"","first":"ui-corner-"+(direction?"top":"left"),"last":"ui-corner-"+(direction?"bottom":"right"),"only":"ui-corner-all"}[position];return result},_spinnerOptions:function(position){var options=this._buildSimpleOptions(position,"ui-spinner");options.classes["ui-spinner-up"]="";options.classes["ui-spinner-down"]="";return options},_buttonOptions:function(position){return this._buildSimpleOptions(position,"ui-button")},_checkboxradioOptions:function(position){return this._buildSimpleOptions(position,"ui-checkboxradio-label")},_selectmenuOptions:function(position){var direction=this.options.direction==="vertical";return{width:direction?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(direction?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(direction?"top":"left")},last:{"ui-selectmenu-button-open":direction?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(direction?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[position]}},_resolveClassesValues:function(classes,instance){var result={};$.each(classes,function(key){var current=instance.options.classes[key]||"";current=String.prototype.trim.call(current.replace(controlgroupCornerRegex,""));result[key]=(current+" "+classes[key]).replace(/\s+/g," ")});return result},_setOption:function(key,value){if(key==="direction"){this._removeClass("ui-controlgroup-"+this.options.direction)}
this._super(key,value);if(key==="disabled"){this._callChildMethod(value?"disable":"enable");return}
this.refresh()},refresh:function(){var children,that=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction);if(this.options.direction==="horizontal"){this._addClass(null,"ui-helper-clearfix")}
this._initWidgets();children=this.childWidgets;if(this.options.onlyVisible){children=children.filter(":visible")}
if(children.length){$.each(["first","last"],function(index,value){var instance=children[value]().data("ui-controlgroup-data");if(instance&&that["_"+instance.widgetName+"Options"]){var options=that["_"+instance.widgetName+"Options"](children.length===1?"only":value);options.classes=that._resolveClassesValues(options.classes,instance);instance.element[instance.widgetName](options)}else{that._updateCornerClass(children[value](),value)}});this._callChildMethod("refresh")}}})});/*!
 * 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,!0,!0,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,!1,!1,!1,!1,0,null);event.target.dispatchEvent(simulatedEvent)}
mouseProto._touchStart=function(event){var self=this;if(touchHandled||!self._mouseCapture(event.originalEvent.changedTouches[0])){return}
touchHandled=!0;self._touchMoved=!1;simulateMouseEvent(event,'mouseover');simulateMouseEvent(event,'mousemove');simulateMouseEvent(event,'mousedown')};mouseProto._touchMove=function(event){if(!touchHandled){return}
this._touchMoved=!0;simulateMouseEvent(event,'mousemove')};mouseProto._touchEnd=function(event){if(!touchHandled){return}
simulateMouseEvent(event,'mouseup');simulateMouseEvent(event,'mouseout');if(!this._touchMoved){simulateMouseEvent(event,'click')}
touchHandled=!1};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);jQuery.fn.extend({jQuery2Offset:function(options){if(arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this,options,i)})}
var docElem,win,elem=this[0],box={top:0,left:0},doc=elem&&elem.ownerDocument;if(!doc){return}
docElem=doc.documentElement;if(!jQuery.contains(docElem,elem)){return box}
if(typeof elem.getBoundingClientRect!==strundefined){box=elem.getBoundingClientRect()}
win=getWindow(doc);var pageYOffset=win?win.pageYOffset:0;var pageXOffset=win?win.pageXOffset:0;return{top:box.top+pageYOffset-docElem.clientTop,left:box.left+pageXOffset-docElem.clientLeft}},});(function($){return $.fn.ajaxChosen=function(settings,callback,chosenOptions){var chosenXhr,defaultOptions,options,select;if(settings==null){settings={}}
if(chosenOptions==null){chosenOptions={}}
defaultOptions={minTermLength:3,afterTypeDelay:500,jsonTermKey:"search",keepTypingMsg:mauticLang["mautic.core.lookup.keep_typing"],lookingForMsg:mauticLang["mautic.core.lookup.looking_for"]};select=this;chosenXhr=null;options=$.extend({},defaultOptions,$(select).data(),settings);this.chosen(chosenOptions?chosenOptions:{});var hasNew=!1;if($(select).find('option[value="new"]').length){hasNew=$(select).find('option[value="new"]')}
return this.each(function(){return $(this).next('.chosen-container').find(".search-field > input, .chosen-search > input").on('keyup',function(event){if(event.which===8||event.which===93||event.which===17||event.which===18){return!1}
var field,msg,success,untrimmed_val,val,search_field;untrimmed_val=$(this).val();val=$.trim($(this).val());msg=val.length<options.minTermLength?options.keepTypingMsg:options.lookingForMsg+(" '"+val+"'");select.next('.chosen-container').find('.no-results').text(msg);if(val===$(this).data('prevVal')){return!1}
$(this).data('prevVal',val);if(this.timer){clearTimeout(this.timer)}
if(val.length<options.minTermLength){return!1}
field=$(this);if(options.data==null){options.data={}}
options.data.searchKey=options.jsonTermKey;options.data[options.jsonTermKey]=val;if(options.dataCallback!=null){options.data=options.dataCallback(options.data)}
success=options.success;options.success=function(data){var items,nbItems,selected_values;if(data==null){return}
selected_values=[];select.find('option').each(function(){if(!$(this).is(":selected")){return $(this).remove()}else{return selected_values.push($(this).val()+"-"+$(this).text())}});select.find('optgroup:empty').each(function(){return $(this).remove()});items=callback!=null?callback(data,field):data;nbItems=0;var searchValue=field.val();$.each(items,function(i,element){var group,text,value;nbItems++;if(element.group){group=select.find("optgroup[label='"+element.text+"']");if(!group.length){group=$("<optgroup />")}
group.attr('label',element.text).appendTo(select);return $.each(element.items,function(i,element){var text,value;if(typeof element==="string"){value=i;text=element}else{value=element.value;text=element.text}
if($.inArray(value+"-"+text,selected_values)===-1){return $("<option />").attr('value',value).html(text).appendTo(group)}})}else{if(typeof element==="string"){value=i;text=element}else{value=element.value;text=element.text}
if($.inArray(value+"-"+text,selected_values)===-1){return $("<option />").attr('value',value).html(text).appendTo(select)}}});if(nbItems){if(hasNew){hasNew.prependTo(select)}
select.trigger("chosen:updated");setTimeout(function(){var e=$.Event("keyup.chosen");e.which=93;field.trigger(e)},5)}else{select.data().chosen.no_results_clear();select.data().chosen.no_results(field.val())}
if(settings.success!=null){settings.success(data)}
var returnVar=field.val(searchValue);div=$('<div />');div.text(untrimmed_val);$('body').append(div);w=div.width()+25;f_width=field.closest('.chosen-choices').outerWidth();if(w>f_width-10){w=f_width}
div.remove();field.css({'width':w+'px'});return returnVar};return this.timer=setTimeout(function(){if(chosenXhr){chosenXhr.abort()}
return chosenXhr=$.ajax(options)},options.afterTypeDelay)})})}})(jQuery);+function($){"use strict";$.fn.overflowNavs=function(options){var ul=$(this);var parent=$(this).closest(options.parent);var isVertical=$(this).hasClass('tabs-left')||$(this).hasClass('tabs-right');if(!options.offset){options.offset={}}
if(!isVertical){$(ul).css({'height':'42px','overflow-y':'hidden'})}
var collapse=$('div.nav-collapse').length;if(!collapse){var collapse=$('div.navbar-collapse').length}
if(collapse){var collapsed=$('.btn-navbar').is(":visible");if(!collapsed){var collapsed=$('.navbar-toggle').is(":visible")}}else{var collapsed=!1}
if(collapsed===!1){var parent_dimension=(isVertical)?$(parent).height()-(options.offset.height?parseInt(options.offset.height):0):$(parent).width()-(options.offset.width?parseInt(options.offset.width):0);var dropdown=$('li.overflow-nav',ul);if(!dropdown.length){dropdown=$('<li class="overflow-nav dropdown"></li>');if(!isVertical){dropdown.addClass('pull-right')}
dropdown.append($('<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="overflow-count"></span><b class="caret"></b></a>'));dropdown.append($('<ul class="dropdown-menu"></ul>'))}
var dimension=(isVertical)?42:100;ul.children('li').not('li.dropdown').each(function(){dimension+=(isVertical)?$(this).outerHeight(!0):$(this).outerWidth(!0)});if(dimension>=parent_dimension){$($('li',ul).not('.dropdown').get().reverse()).each(function(){var dimension=(isVertical)?42:100;ul.children('li').each(function(){var $this=$(this);dimension+=(isVertical)?$this.outerHeight(!0):$this.outerWidth(!0)});if(dimension>=parent_dimension){$(this).attr('data-original-dimension',(isVertical)?$(this).outerHeight(!0):$(this).outerWidth(!0));dropdown.children('ul.dropdown-menu').prepend(this)}})}else{dropdown.children('ul.dropdown-menu').children().each(function(){dimension+=parseInt($(this).attr('data-original-dimension'));if(dimension<parent_dimension){dropdown.before(this)}else{return!1}})}
if(!dropdown.children('ul.dropdown-menu').children().length){dropdown.remove()}else{if(!ul.children('li.overflow-nav').length){ul.append(dropdown)}}}else{var dropdown=$('li.overflow-nav',ul);if(dropdown.length){dropdown.children('ul.dropdown-menu').children().each(function(){dropdown.before(this)});dropdown.remove()}}
dropdown.find('.dropdown-toggle .overflow-count').text(dropdown.find('ul.dropdown-menu li').length+" "+options.more);if(isVertical){dropdown.find('ul.dropdown-menu').css('width','100%')}
if(!isVertical){$(ul).css({'height':'auto','overflow-y':'inherit'})}}}(window.jQuery);(function($){$.ui.ddmanager.frameOffsets={};$.ui.ddmanager.prepareOffsets=function(t,event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].accept.call(m[i].element[0],(t.currentItem||t.element)))){continue}
for(j=0;j<list.length;j++){if(list[j]===m[i].element[0]){m[i].proportions().height=0;continue droppablesLoop}}
m[i].visible=m[i].element.css("display")!=="none";if(!m[i].visible){continue}
if(type==="mousedown"){m[i]._activate.call(m[i],event)}
m[i].offset=m[i].element.offset();if(t.options.iframeId){var scrollOffset=$('#'+t.options.iframeId).contents().scrollTop();var newTop=m[i].offset.top-scrollOffset;m[i].offset={top:newTop,left:m[i].offset.left}}
m[i].proportions({width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight})}}})(jQuery);/*! ========================================================================
 * Core v1.2.0
 * Copyright 2014 pampersdry
 * ========================================================================
 *
 * pampersdry@gmail.com
 *
 * This script will be use in my other projects too.
 * Your support ensure the continuity of this script and it projects.
 * ======================================================================== */
if(typeof jQuery==="undefined"){throw new Error("This application requires jQuery")}
!function(e){jQuery.fn.extend({slimScroll:function(i){var s=e.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},i);return this.each(function(){var o,r,a,l,n,c,u,h,p="<div></div>",d=30,g=!1,f=e(this);if(f.parent().hasClass(s.wrapperClass)){var v=f.scrollTop();if(y=f.parent().find("."+s.barClass),m=f.parent().find("."+s.railClass),S(),e.isPlainObject(i)){if("height"in i&&"auto"==i.height){f.parent().css("height","auto"),f.css("height","auto");var b=f.parent().parent().height();f.parent().css("height",b),f.css("height",b)}if("scrollTo"in i)v=parseInt(s.scrollTo);else if("scrollBy"in i)v+=parseInt(s.scrollBy);else if("destroy"in i)return y.remove(),m.remove(),void f.unwrap();H(v,!1,!0)}}else{s.height="auto"==i.height?f.parent().height():i.height;var w=e(p).addClass(s.wrapperClass).css({position:"relative",overflow:"hidden",width:s.width,height:s.height});f.css({overflow:"hidden",width:s.width,height:s.height});var m=e(p).addClass(s.railClass).css({width:s.size,height:"100%",position:"absolute",top:0,display:s.alwaysVisible&&s.railVisible?"block":"none","border-radius":s.railBorderRadius,background:s.railColor,opacity:s.railOpacity,zIndex:90}),y=e(p).addClass(s.barClass).css({background:s.color,width:s.size,position:"absolute",top:0,opacity:s.opacity,display:s.alwaysVisible?"block":"none","border-radius":s.borderRadius,BorderRadius:s.borderRadius,MozBorderRadius:s.borderRadius,WebkitBorderRadius:s.borderRadius,zIndex:99}),x="right"==s.position?{right:s.distance}:{left:s.distance};m.css(x),y.css(x),f.wrap(w),f.parent().append(y),f.parent().append(m),s.railDraggable&&y.bind("mousedown",function(i){var s=e(document);return a=!0,t=parseFloat(y.css("top")),pageY=i.pageY,s.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY,y.css("top",currTop),H(0,y.position().top,!1)}),s.bind("mouseup.slimscroll",function(e){a=!1,R(),s.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(e){return e.stopPropagation(),e.preventDefault(),!1}),m.hover(function(){E()},function(){R()}),y.hover(function(){r=!0},function(){r=!1}),f.hover(function(){o=!0,E(),R()},function(){o=!1,R()}),f.bind("touchstart",function(e,t){e.originalEvent.touches.length&&(n=e.originalEvent.touches[0].pageY)}),f.bind("touchmove",function(e){(g||e.originalEvent.preventDefault(),e.originalEvent.touches.length)&&(H((n-e.originalEvent.touches[0].pageY)/s.touchScrollStep,!0),n=e.originalEvent.touches[0].pageY)}),S(),"bottom"===s.start?(y.css({top:f.outerHeight()-y.outerHeight()}),H(0,!0)):"top"!==s.start&&(H(e(s.start).position().top,null,!0),s.alwaysVisible||y.hide()),function(){window.addEventListener?(this.addEventListener("DOMMouseScroll",C,{capture:!1,passive:!1}),this.addEventListener("mousewheel",C,{capture:!1,passive:!1})):document.attachEvent("onmousewheel",C)}()}function C(t){if(o){var i=0;(t=t||window.event).wheelDelta&&(i=-t.wheelDelta/120),t.detail&&(i=t.detail/3);var r=t.target||t.srcTarget||t.srcElement;e(r).closest("."+s.wrapperClass).is(f.parent())&&H(i,!0),t.preventDefault&&!g&&t.preventDefault(),g||(t.returnValue=!1)}}function H(e,t,i){g=!1;var o=e,r=f.outerHeight()-y.outerHeight();if(t&&(o=parseInt(y.css("top"))+e*parseInt(s.wheelStep)/100*y.outerHeight(),o=Math.min(Math.max(o,0),r),o=e>0?Math.ceil(o):Math.floor(o),y.css({top:o+"px"})),o=(u=parseInt(y.css("top"))/(f.outerHeight()-y.outerHeight()))*(f[0].scrollHeight-f.outerHeight()),i){var a=(o=e)/f[0].scrollHeight*f.outerHeight();a=Math.min(Math.max(a,0),r),y.css({top:a+"px"})}f.scrollTop(o),f.trigger("slimscrolling",~~o),E(),R()}function S(){c=Math.max(f.outerHeight()/f[0].scrollHeight*f.outerHeight(),d),y.css({height:c+"px"});var e=c==f.outerHeight()?"none":"block";y.css({display:e})}function E(){if(S(),clearTimeout(l),u==~~u){if(g=s.allowPageScroll,h!=u){var e=0==~~u?"top":"bottom";f.trigger("slimscroll",e)}}else g=!1;h=u,c>=f.outerHeight()?g=!0:(y.stop(!0,!0).fadeIn("fast"),s.railVisible&&m.stop(!0,!0).fadeIn("fast"))}function R(){s.alwaysVisible||(l=setTimeout(function(){s.disableFadeOut&&o||r||a||(y.fadeOut("slow"),m.fadeOut("slow"))},1e3))}}),this}}),jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})}(jQuery);!function(a,b,c){var d=a.jQuery||a.Zepto||a.ender||a.elo;"undefined"!=typeof module&&module.exports?module.exports=c(d):a[b]=c(d)}(this,"Response",function(a){function b(a){throw new TypeError(a?S+"."+a:S)}function c(a){return a===+a}function d(a,b,c){for(var d=[],e=a.length,f=0;e>f;)d[f]=b.call(c,a[f],f++,a);return d}function e(a){return a?h("string"==typeof a?a.split(" "):a):[]}function f(a,b,c){if(null==a)return a;for(var d=a.length,e=0;d>e;)b.call(c||a[e],a[e],e++,a);return a}function g(a,b,c){null==b&&(b=""),null==c&&(c="");for(var d=[],e=a.length,f=0;e>f;f++)null==a[f]||d.push(b+a[f]+c);return d}function h(a,b,c){var d,e,f,g=[],h=0,i=0,j="function"==typeof b,k=!0===c;for(e=a&&a.length,c=k?null:c;e>i;i++)f=a[i],d=j?!b.call(c,f,i,a):b?typeof f!==b:!f,d===k&&(g[h++]=f);return g}function i(a,b){if(null==a||null==b)return a;if("object"==typeof b&&c(b.length))bb.apply(a,h(b,"undefined",!0));else for(var d in b)fb.call(b,d)&&void 0!==b[d]&&(a[d]=b[d]);return a}function j(a,b,d){return null==a?a:("object"==typeof a&&!a.nodeType&&c(a.length)?f(a,b,d):b.call(d||a,a),a)}function k(a){return function(b,c){var d=a();return d>=(b||0)&&(!c||c>=d)}}function l(a){var b=V.devicePixelRatio;return null==a?b||(l(2)?2:l(1.5)?1.5:l(1)?1:0):isFinite(a)?b&&b>0?b>=a:(a="only all and (min--moz-device-pixel-ratio:"+a+")",Cb(a).matches?!0:!!Cb(a.replace("-moz-","")).matches):!1}function m(a){return a.replace(xb,"$1").replace(wb,function(a,b){return b.toUpperCase()})}function n(a){return"data-"+(a?a.replace(xb,"$1").replace(vb,"$1-$2").toLowerCase():a)}function o(a){var b;return"string"==typeof a&&a?"false"===a?!1:"true"===a?!0:"null"===a?null:"undefined"===a||(b=+a)||0===b||"NaN"===a?b:a:a}function p(a){return a?1===a.nodeType?a:a[0]&&1===a[0].nodeType?a[0]:!1:!1}function q(a,b){var c,d=arguments.length,e=p(this),g={},h=!1;if(d){if(gb(a)&&(h=!0,a=a[0]),"string"==typeof a){if(a=n(a),1===d)return g=e.getAttribute(a),h?o(g):g;if(this===e||2>(c=this.length||1))e.setAttribute(a,b);else for(;c--;)c in this&&q.apply(this[c],arguments)}else if(a instanceof Object)for(c in a)a.hasOwnProperty(c)&&q.call(this,c,a[c]);return this}return e.dataset&&"undefined"!=typeof DOMStringMap?e.dataset:(f(e.attributes,function(a){a&&(c=String(a.name).match(xb))&&(g[m(c[1])]=a.value)}),g)}function r(a){return this&&"string"==typeof a&&(a=e(a),j(this,function(b){f(a,function(a){a&&b.removeAttribute(n(a))})})),this}function s(a){return q.apply(a,cb.call(arguments,1))}function t(a,b){return r.call(a,b)}function u(a){for(var b,c=[],d=0,e=a.length;e>d;)(b=a[d++])&&c.push("["+n(b.replace(ub,"").replace(".","\\."))+"]");return c.join()}function v(b){return a(u(e(b)))}function w(){return window.pageXOffset||X.scrollLeft}function x(){return window.pageYOffset||X.scrollTop}function y(a,b){var c=a.getBoundingClientRect?a.getBoundingClientRect():{};return b="number"==typeof b?b||0:0,{top:(c.top||0)-b,left:(c.left||0)-b,bottom:(c.bottom||0)+b,right:(c.right||0)+b}}function z(a,b){var c=y(p(a),b);return!!c&&c.right>=0&&c.left<=Db()}function A(a,b){var c=y(p(a),b);return!!c&&c.bottom>=0&&c.top<=Eb()}function B(a,b){var c=y(p(a),b);return!!c&&c.bottom>=0&&c.top<=Eb()&&c.right>=0&&c.left<=Db()}function C(a){var b={img:1,input:1,source:3,embed:3,track:3,iframe:5,audio:5,video:5,script:5},c=b[a.nodeName.toLowerCase()]||-1;return 4>c?c:null!=a.getAttribute("src")?5:-5}function D(a,c,d){var e;return a&&null!=c||b("store"),d="string"==typeof d&&d,j(a,function(a){e=d?a.getAttribute(d):0<C(a)?a.getAttribute("src"):a.innerHTML,null==e?t(a,c):s(a,c,e)}),N}function E(a,b){var c=[];return a&&b&&f(e(b),function(b){c.push(s(a,b))},a),c}function F(a,b){return"string"==typeof a&&"function"==typeof b&&(jb[a]=b,kb[a]=1),N}function G(a){return Z.on("resize",a),N}function H(a,b){var c,d,e=Ab.crossover;return"function"==typeof a&&(c=b,b=a,a=c),d=a?""+a+e:e,Z.on(d,b),N}function I(a){return j(a,function(a){Y(a),G(a)}),N}function J(a){return j(a,function(a){"object"==typeof a||b("create @args");var c,d=yb(O).configure(a),e=d.verge,g=d.breakpoints,h=zb("scroll"),i=zb("resize");g.length&&(c=g[0]||g[1]||!1,Y(function(){function a(){d.reset(),f(d.$e,function(a,b){d[b].decideValue().updateDOM()}).trigger(g)}function b(){f(d.$e,function(a,b){B(d[b].$e,e)&&d[b].updateDOM()})}var g=Ab.allLoaded,j=!!d.lazy;f(d.target().$e,function(a,b){d[b]=yb(d).prepareData(a),(!j||B(d[b].$e,e))&&d[b].updateDOM()}),d.dynamic&&(d.custom||pb>c)&&G(a,i),j&&(Z.on(h,b),d.$e.one(g,function(){Z.off(h,b)}))}))}),N}function K(a){return R[S]===N&&(R[S]=T),"function"==typeof a&&a.call(R,N),N}function L(a,b){return"function"==typeof a&&a.fn&&((b||void 0===a.fn.dataset)&&(a.fn.dataset=q),(b||void 0===a.fn.deletes)&&(a.fn.deletes=r)),N}if("function"!=typeof a)try{return void console.warn("response.js aborted due to missing dependency")}catch(M){}var N,O,P,Q,R=this,S="Response",T=R[S],U="init"+S,V=window,W=document,X=W.documentElement,Y=a.domReady||a,Z=a(V),$=V.screen,_=Array.prototype,ab=Object.prototype,bb=_.push,cb=_.slice,db=_.concat,eb=ab.toString,fb=ab.hasOwnProperty,gb=Array.isArray||function(a){return"[object Array]"===eb.call(a)},hb={width:[0,320,481,641,961,1025,1281],height:[0,481],ratio:[1,1.5,2]},ib={},jb={},kb={},lb={all:[]},mb=1,nb=$.width,ob=$.height,pb=nb>ob?nb:ob,qb=nb+ob-pb,rb=function(){return nb},sb=function(){return ob},tb=/[^a-z0-9_\-\.]/gi,ub=/^[\W\s]+|[\W\s]+$|/g,vb=/([a-z])([A-Z])/g,wb=/-(.)/g,xb=/^data-(.+)$/,yb=Object.create||function(a){function b(){}return b.prototype=a,new b},zb=function(a,b){return b=b||S,a.replace(ub,"")+"."+b.replace(ub,"")},Ab={allLoaded:zb("allLoaded"),crossover:zb("crossover")},Bb=V.matchMedia||V.msMatchMedia,Cb=Bb||function(){return{}},Db=function(){var a=X.clientWidth,b=V.innerWidth;return b>a?b:a},Eb=function(){var a=X.clientHeight,b=V.innerHeight;return b>a?b:a};return P=k(Db),Q=k(Eb),ib.band=k(rb),ib.wave=k(sb),O=function(){function c(a){return"string"==typeof a?a.toLowerCase().replace(tb,""):""}function j(a,b){return a-b}var k=Ab.crossover,l=Math.min;return{$e:0,mode:0,breakpoints:null,prefix:null,prop:"width",keys:[],dynamic:null,custom:0,values:[],fn:0,verge:null,newValue:0,currValue:1,aka:null,lazy:null,i:0,uid:null,reset:function(){for(var a=this.breakpoints,b=a.length,c=0;!c&&b--;)this.fn(a[b])&&(c=b);return c!==this.i&&(Z.trigger(k).trigger(this.prop+k),this.i=c||0),this},configure:function(a){i(this,a);var k,m,n,o,p,q=!0,r=this.prop;if(this.uid=mb++,null==this.verge&&(this.verge=l(pb,500)),this.fn=jb[r]||b("create @fn"),null==this.dynamic&&(this.dynamic="device"!==r.slice(0,6)),this.custom=kb[r],n=this.prefix?h(d(e(this.prefix),c)):["min-"+r+"-"],o=1<n.length?n.slice(1):0,this.prefix=n[0],m=this.breakpoints,gb(m)?(f(m,function(a){if(!a&&0!==a)throw"invalid breakpoint";q=q&&isFinite(a)}),q&&m.sort(j),m.length||b("create @breakpoints")):m=hb[r]||hb[r.split("-").pop()]||b("create @prop"),this.breakpoints=q?h(m,function(a){return pb>=a}):m,this.keys=g(this.breakpoints,this.prefix),this.aka=null,o){for(p=[],k=o.length;k--;)p.push(g(this.breakpoints,o[k]));this.aka=p,this.keys=db.apply(this.keys,p)}return lb.all=lb.all.concat(lb[this.uid]=this.keys),this},target:function(){return this.$e=a(u(lb[this.uid])),D(this.$e,U),this.keys.push(U),this},decideValue:function(){for(var a=null,b=this.breakpoints,c=b.length,d=c;null==a&&d--;)this.fn(b[d])&&(a=this.values[d]);return this.newValue="string"==typeof a?a:this.values[c],this},prepareData:function(b){if(this.$e=a(b),this.mode=C(b),this.values=E(this.$e,this.keys),this.aka)for(var c=this.aka.length;c--;)this.values=i(this.values,E(this.$e,this.aka[c]));return this.decideValue()},updateDOM:function(){return this.currValue===this.newValue?this:(this.currValue=this.newValue,0<this.mode?this.$e[0].setAttribute("src",this.newValue):null==this.newValue?this.$e.empty&&this.$e.empty():this.$e.html?this.$e.html(this.newValue):(this.$e.empty&&this.$e.empty(),this.$e[0].innerHTML=this.newValue),this)}}}(),jb.width=P,jb.height=Q,jb["device-width"]=ib.band,jb["device-height"]=ib.wave,jb["device-pixel-ratio"]=l,N={deviceMin:function(){return qb},deviceMax:function(){return pb},noConflict:K,bridge:L,create:J,addTest:F,datatize:n,camelize:m,render:o,store:D,access:E,target:v,object:yb,crossover:H,action:I,resize:G,ready:Y,affix:g,sift:h,dpr:l,deletes:t,scrollX:w,scrollY:x,deviceW:rb,deviceH:sb,device:ib,inX:z,inY:A,route:j,merge:i,media:Cb,wave:Q,band:P,map:d,each:f,inViewport:B,dataset:s,viewportH:Eb,viewportW:Db},Y(function(){var b=s(W.body,"responsejs"),c=V.JSON&&JSON.parse||a.parseJSON;b=b&&c?c(b):b,b&&b.create&&J(b.create),X.className=X.className.replace(/(^|\s)(no-)?responsejs(\s|$)/,"$1$3")+" responsejs "}),N});(function(k){k.transit={version:"0.9.9",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:!0,useTransitionEnd:!1};var d=document.createElement("div");var q={};function b(v){if(v in d.style){return v}var u=["Moz","Webkit","O","ms"];var r=v.charAt(0).toUpperCase()+v.substr(1);if(v in d.style){return v}for(var t=0;t<u.length;++t){var s=u[t]+r;if(s in d.style){return s}}}function e(){d.style[q.transform]="";d.style[q.transform]="rotateY(90deg)";return d.style[q.transform]!==""}var a=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;q.transition=b("transition");q.transitionDelay=b("transitionDelay");q.transform=b("transform");q.transformOrigin=b("transformOrigin");q.transform3d=e();var i={transition:"transitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"};var f=q.transitionEnd=i[q.transition]||null;for(var p in q){if(q.hasOwnProperty(p)&&typeof k.support[p]==="undefined"){k.support[p]=q[p]}}d=null;k.cssEase={_default:"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};k.cssHooks["transit:transform"]={get:function(r){return k(r).data("transform")||new j()},set:function(s,r){var t=r;if(!(t instanceof j)){t=new j(t)}if(q.transform==="WebkitTransform"&&!a){s.style[q.transform]=t.toString(!0)}else{s.style[q.transform]=t.toString()}k(s).data("transform",t)}};k.cssHooks.transform={set:k.cssHooks["transit:transform"].set};if(k.fn.jquery<"1.8"){k.cssHooks.transformOrigin={get:function(r){return r.style[q.transformOrigin]},set:function(r,s){r.style[q.transformOrigin]=s}};k.cssHooks.transition={get:function(r){return r.style[q.transition]},set:function(r,s){r.style[q.transition]=s}}}n("scale");n("translate");n("rotate");n("rotateX");n("rotateY");n("rotate3d");n("perspective");n("skewX");n("skewY");n("x",!0);n("y",!0);function j(r){if(typeof r==="string"){this.parse(r)}return this}j.prototype={setFromString:function(t,s){var r=(typeof s==="string")?s.split(","):(s.constructor===Array)?s:[s];r.unshift(t);j.prototype.set.apply(this,r)},set:function(s){var r=Array.prototype.slice.apply(arguments,[1]);if(this.setter[s]){this.setter[s].apply(this,r)}else{this[s]=r.join(",")}},get:function(r){if(this.getter[r]){return this.getter[r].apply(this)}else{return this[r]||0}},setter:{rotate:function(r){this.rotate=o(r,"deg")},rotateX:function(r){this.rotateX=o(r,"deg")},rotateY:function(r){this.rotateY=o(r,"deg")},scale:function(r,s){if(s===undefined){s=r}this.scale=r+","+s},skewX:function(r){this.skewX=o(r,"deg")},skewY:function(r){this.skewY=o(r,"deg")},perspective:function(r){this.perspective=o(r,"px")},x:function(r){this.set("translate",r,null)},y:function(r){this.set("translate",null,r)},translate:function(r,s){if(this._translateX===undefined){this._translateX=0}if(this._translateY===undefined){this._translateY=0}if(r!==null&&r!==undefined){this._translateX=o(r,"px")}if(s!==null&&s!==undefined){this._translateY=o(s,"px")}this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var r=(this.scale||"1,1").split(",");if(r[0]){r[0]=parseFloat(r[0])}if(r[1]){r[1]=parseFloat(r[1])}return(r[0]===r[1])?r[0]:r},rotate3d:function(){var t=(this.rotate3d||"0,0,0,0deg").split(",");for(var r=0;r<=3;++r){if(t[r]){t[r]=parseFloat(t[r])}}if(t[3]){t[3]=o(t[3],"deg")}return t}},parse:function(s){var r=this;s.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(t,v,u){r.setFromString(v,u)})},toString:function(t){var s=[];for(var r in this){if(this.hasOwnProperty(r)){if((!q.transform3d)&&((r==="rotateX")||(r==="rotateY")||(r==="perspective")||(r==="transformOrigin"))){continue}if(r[0]!=="_"){if(t&&(r==="scale")){s.push(r+"3d("+this[r]+",1)")}else{if(t&&(r==="translate")){s.push(r+"3d("+this[r]+",0)")}else{s.push(r+"("+this[r]+")")}}}}}return s.join(" ")}};function m(s,r,t){if(r===!0){s.queue(t)}else{if(r){s.queue(r,t)}else{t()}}}function h(s){var r=[];k.each(s,function(t){t=k.camelCase(t);t=k.transit.propertyMap[t]||k.cssProps[t]||t;t=c(t);if(k.inArray(t,r)===-1){r.push(t)}});return r}function g(s,v,x,r){var t=h(s);if(k.cssEase[x]){x=k.cssEase[x]}var w=""+l(v)+" "+x;if(parseInt(r,10)>0){w+=" "+l(r)}var u=[];k.each(t,function(z,y){u.push(y+" "+w)});return u.join(", ")}k.fn.transition=k.fn.transit=function(z,s,y,C){var D=this;var u=0;var w=!0;if(typeof s==="function"){C=s;s=undefined}if(typeof y==="function"){C=y;y=undefined}if(typeof z.easing!=="undefined"){y=z.easing;delete z.easing}if(typeof z.duration!=="undefined"){s=z.duration;delete z.duration}if(typeof z.complete!=="undefined"){C=z.complete;delete z.complete}if(typeof z.queue!=="undefined"){w=z.queue;delete z.queue}if(typeof z.delay!=="undefined"){u=z.delay;delete z.delay}if(typeof s==="undefined"){s=k.fx.speeds._default}if(typeof y==="undefined"){y=k.cssEase._default}s=l(s);var E=g(z,s,y,u);var B=k.transit.enabled&&q.transition;var t=B?(parseInt(s,10)+parseInt(u,10)):0;if(t===0){var A=function(F){D.css(z);if(C){C.apply(D)}if(F){F()}};m(D,w,A);return D}var x={};var r=function(H){var G=!1;var F=function(){if(G){D.off(f,F)}if(t>0){D.each(function(){this.style[q.transition]=(x[this]||null)})}if(typeof C==="function"){C.apply(D)}if(typeof H==="function"){H()}};if((t>0)&&(f)&&(k.transit.useTransitionEnd)){G=!0;D.on(f,F)}else{window.setTimeout(F,t)}D.each(function(){if(t>0){this.style[q.transition]=E}k(this).css(z)})};var v=function(F){this.offsetWidth;r(F)};m(D,w,v);return this};function n(s,r){if(!r){k.cssNumber[s]=!0}k.transit.propertyMap[s]=q.transform;k.cssHooks[s]={get:function(v){var u=k(v).css("transit:transform");return u.get(s)},set:function(v,w){var u=k(v).css("transit:transform");u.setFromString(s,w);k(v).css({"transit:transform":u})}}}function c(r){return r.replace(/([A-Z])/g,function(s){return"-"+s.toLowerCase()})}function o(s,r){if((typeof s==="string")&&(!s.match(/^[\-0-9\.]+$/))){return s}else{return""+s+r}}function l(s){var r=s;if(k.fx.speeds[r]){r=k.fx.speeds[r]}return o(r,"ms")}k.transit.getTransitionValue=g})(jQuery);(function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(["spin"],e):t.Ladda=e(t.Spinner)})(this,function(t){"use strict";function e(t){if(t===void 0)return console.warn("Ladda button target must be defined."),void 0;t.querySelector(".ladda-label")||(t.innerHTML='<span class="ladda-label">'+t.innerHTML+"</span>");var e=i(t),n=document.createElement("span");n.className="ladda-spinner",t.appendChild(n);var r,a={start:function(){return t.setAttribute("disabled",""),t.setAttribute("data-loading",""),clearTimeout(r),e.spin(n),this.setProgress(0),this},startAfter:function(t){return clearTimeout(r),r=setTimeout(function(){a.start()},t),this},stop:function(){return t.removeAttribute("disabled"),t.removeAttribute("data-loading"),clearTimeout(r),r=setTimeout(function(){e.stop()},1e3),this},toggle:function(){return this.isLoading()?this.stop():this.start(),this},setProgress:function(e){e=Math.max(Math.min(e,1),0);var n=t.querySelector(".ladda-progress");0===e&&n&&n.parentNode?n.parentNode.removeChild(n):(n||(n=document.createElement("div"),n.className="ladda-progress",t.appendChild(n)),n.style.width=(e||0)*t.offsetWidth+"px")},enable:function(){return this.stop(),this},disable:function(){return this.stop(),t.setAttribute("disabled",""),this},isLoading:function(){return t.hasAttribute("data-loading")}};return o.push(a),a}function n(t,n){n=n||{};var r=[];"string"==typeof t?r=a(document.querySelectorAll(t)):"object"==typeof t&&"string"==typeof t.nodeName&&(r=[t]);for(var i=0,o=r.length;o>i;i++)(function(){var t=r[i];if("function"==typeof t.addEventListener){var a=e(t),o=-1;t.addEventListener("click",function(){a.startAfter(1),"number"==typeof n.timeout&&(clearTimeout(o),o=setTimeout(a.stop,n.timeout)),"function"==typeof n.callback&&n.callback.apply(null,[a])},!1)}})()}function r(){for(var t=0,e=o.length;e>t;t++)o[t].stop()}function i(e){var n,r=e.offsetHeight;r>32&&(r*=.8),e.hasAttribute("data-spinner-size")&&(r=parseInt(e.getAttribute("data-spinner-size"),10)),e.hasAttribute("data-spinner-color")&&(n=e.getAttribute("data-spinner-color"));var i=12,a=.2*r,o=.6*a,s=7>a?2:3;return new t({color:n||"#fff",lines:i,radius:a,length:o,width:s,zIndex:"auto",top:"auto",left:"auto",className:""})}function a(t){for(var e=[],n=0;t.length>n;n++)e.push(t[n]);return e}var o=[];return{bind:n,create:e,stopAll:r}});(function($,window,document,undefined){var pluginName="Core",isScreenlg=!1,isScreenmd=!1,isScreensm=!1,isScreenxs=!1,defaults={console:!1,loader:!1,eventPrefix:"fa",breakpoint:{"lg":1200,"md":992,"sm":768,"xs":480}};function MAIN(element,options){this.element=element;this.settings=$.extend({},defaults,options);this._defaults=defaults;this._name=pluginName;this.init()}
MAIN.prototype={init:function(){this.MISC.Init();this.PLUGINS();this.VIEWPORTWATCH();this.WINLOADER()},HELPER:{Console:function(cevent){if(settings.console){$(element).on(cevent,function(e,o){console.log("----- "+cevent+" -----");console.log(o.element)})}}},WINLOADER:function(){element=this.element;settings=this.settings;if(settings.loader){NProgress.start();$(window).on('load',(function(){NProgress.done()}))}},VIEWPORTWATCH:function(){element=this.element;settings=this.settings;Response.action(function(){if(Response.band(settings.breakpoint.lg)){isScreenlg=!0;isScreenmd=!1;isScreensm=!1;isScreenxs=!1}
if(Response.band(settings.breakpoint.md,settings.breakpoint.lg-1)){isScreenlg=!1;isScreenmd=!0;isScreensm=!1;isScreenxs=!1}
if(Response.band(settings.breakpoint.sm,settings.breakpoint.md-1)){isScreenlg=!1;isScreenmd=!1;isScreensm=!0;isScreenxs=!1}
if(Response.band(0,settings.breakpoint.xs)){isScreenlg=!1;isScreenmd=!1;isScreensm=!1;isScreenxs=!0}})},MISC:{Init:function(){this.ConsoleFix();this.Scrollbar(".slimscroll");this.BsTooltip();this.BsPopover()},ConsoleFix:function(){var method,noop=function(){},methods=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],length=methods.length,console=(window.console=window.console||{});while(length--){method=methods[length];if(!console[method]){console[method]=noop}}},Scrollbar:function(elem){$(".no-touchevents "+elem).each(function(index,value){$(value).slimScroll({size:"6px",distance:"0px",wrapperClass:$(value).data("wrapper")||"scroll-wrapper",railClass:"scroll-rail",barClass:"scroll-bar",wheelStep:10,railVisible:!0,alwaysVisible:!1})})},Fastclick:function(){FastClick.attach(document.body)},Unveil:function(){$("[data-toggle~=unveil]").unveil(200,function(){$(this).on('load',(function(){$(this).addClass("unveiled")}))})},BsTooltip:function(){$("[data-toggle~=tooltip]").tooltip()},BsPopover:function(){$("[data-toggle~=popover]").popover({sanitize:!1});var hideAllPopovers=function(){$("[data-toggle~=popover]").each(function(){var popover=$(this).data('bs.popover');if(popover&&popover.tip().hasClass('in')){$(this).popover('hide')}})};$(document).on('click',function(e){if(!$(e.target).closest('.popover').length&&!$(e.target).closest('[data-toggle="popover"]').length){hideAllPopovers()}});$(document).on('mouseenter','[data-toggle="popover"][data-trigger="hover"]',function(){hideAllPopovers()})},Stellar:function(){$(window).stellar({horizontalScrolling:!1})},InputPlaceholder:function(){$("input, textarea").placeholder()}},PLUGINS:function(){element=this.element;settings=this.settings;(function(){var toggler="[data-toggle~=totop]";$(element).on("click",toggler,function(e){$("html, body").animate({scrollTop:0},200);e.preventDefault()})})();(function(){var toggler="[data-toggle~=waypoints]";$(toggler).each(function(){var wayShowAnimation,wayHideAnimation,wayOffset,wayMarker,triggerOnce;!!$(this).data("marker")?wayMarker=$(this).data("marker"):wayMarker=this;!!$(this).data("offset")?wayOffset=$(this).data("offset"):wayOffset="80%";!!$(this).data("showanim")?wayShowAnimation=$(this).data("showanim"):wayShowAnimation="fadeIn";!!$(this).data("hideanim")?wayHideAnimation=$(this).data("hideanim"):wayHideAnimation=!1;!!$(this).data("trigger-once")?triggerOnce=$(this).data("trigger-once"):triggerOnce=!1;$(wayMarker).waypoint(function(direction){if(direction==="down"){$(this).removeClass(wayHideAnimation+" animated").addClass(wayShowAnimation+" animating").on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend',function(){$(this).removeClass("animating").addClass("animated").removeClass(wayShowAnimation)})}
if((direction==="up")&&(wayHideAnimation!==!1)){$(this).removeClass(wayShowAnimation+" animated").addClass(wayHideAnimation+" animating").on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend',function(){$(this).removeClass("animating").removeClass("animated").removeClass(wayHideAnimation)})}},{offset:wayOffset,triggerOnce:triggerOnce,continuous:!0})})})();(function(){var contextual,toggler="[data-toggle~=selectrow]",target=$(toggler).data("target");var lastCheckedBox=null;$(toggler).each(function(){if($(this).is(":checked")){selectrow(this,"checked")}});updateToolbarState();$(document).on("change",toggler,function(){target=$(toggler).data("target");if($(this).is(":checked")){selectrow(this,"checked")}else{selectrow(this,"unchecked")}
updateToolbarState()});$(document).on("click",toggler,function(e){if(e.shiftKey&&lastCheckedBox!==null){var checkboxes=$(toggler);var startIndex=checkboxes.index(lastCheckedBox);var endIndex=checkboxes.index(this);var start=Math.min(startIndex,endIndex);var end=Math.max(startIndex,endIndex);var isChecked=$(this).is(":checked");checkboxes.slice(start,end+1).each(function(){if($(this).prop("checked")!==isChecked){$(this).prop("checked",isChecked).trigger("change")}})}
lastCheckedBox=this});function selectrow($this,state){!!$($this).data("contextual")?contextual=$($this).data("contextual"):contextual="active";if(state==="checked"){$($this).parentsUntil(target).addClass(contextual);$(element).trigger(settings.eventPrefix+".selectrow.selected",{"element":$($this).parentsUntil(target)})}else{$($this).parentsUntil(target).removeClass(contextual);$(element).trigger(settings.eventPrefix+".selectrow.unselected",{"element":$($this).parentsUntil(target)})}}
function updateToolbarState(){var checkedBoxes=$(toggler+":checked").length;$(".toolbar--batch-actions").toggleClass("toolbar--batch-actions--active",checkedBoxes>0);var $summaryCount=$(".toolbar--batch-summary__count");var singularText=$summaryCount.data('singular');var pluralText=$summaryCount.data('plural');var itemText=checkedBoxes===1?singularText:pluralText;$summaryCount.text(checkedBoxes+" "+itemText)}
$(document).on("click",".pagination a[data-toggle='ajax']",function(){$(".toolbar--batch-actions").removeClass("toolbar--batch-actions--active");$(".toolbar--batch-summary__count").text("0");$("[data-toggle=checkall]").prop("checked",!1)});MAIN.prototype.HELPER.Console(settings.eventPrefix+".selectrow.selected");MAIN.prototype.HELPER.Console(settings.eventPrefix+".selectrow.unselected")})();(function(){var contextual,toggler="[data-toggle~=checkall]";$(toggler).each(function(){if($(this).is(":checked")){checked()}});$(document).on("change",toggler,function(){var target=$(this).data("target");if($(this).is(":checked")){checked(target)}else{unchecked(target)}});$(document).on("click","[data-toggle=cancel-checkall]",function(){$(toggler).prop("checked",!1);$("input[data-toggle=selectrow]").each(function(){$(this).prop("checked",!1).trigger("change")})});function checked(target){$(target).find("input[type=checkbox]").each(function(){if($(this).data("toggle")==="selectrow"){if(!$(this).is(":checked")){$(this).prop("checked",!0).trigger("change")}}});$(element).trigger(settings.eventPrefix+".checkall.checked",{"element":$(target)})}
function unchecked(target){$(target).find("input[type=checkbox]").each(function(){if($(this).data("toggle")==="selectrow"){if($(this).is(":checked")){$(this).prop("checked",!1).trigger("change")}}});$(element).trigger(settings.eventPrefix+".checkall.unchecked",{"element":$(target)})}
MAIN.prototype.HELPER.Console(settings.eventPrefix+".checkall.checked");MAIN.prototype.HELPER.Console(settings.eventPrefix+".checkall.unchecked")})();(function(){var isDemo=!1,indicatorClass="indicator",toggler="[data-toggle~=panelrefresh]";$(element).on("click",toggler,function(e){var panel=$(this).parents(".panel"),indicator=panel.find("."+indicatorClass);!!$(this).hasClass("demo")?isDemo=!0:isDemo=!1;if(indicator.length!==0){indicator.addClass("show");if(isDemo){setTimeout(function(){indicator.removeClass("show")},2000)}
$(element).trigger(settings.eventPrefix+".panelrefresh.refresh",{"element":$(panel)})}else{$.error("There is no `indicator` element inside this panel.")}
e.preventDefault()});MAIN.prototype.HELPER.Console(settings.eventPrefix+".panelrefresh.refresh")})();(function(){var toggler="[data-toggle~=panelcollapse]";$(element).on("click",toggler,function(e){var panel=$(this).parents(".panel"),target=panel.children(".panel-collapse"),height=target.height();if(target.length===0){$.error("collapsable element need to be wrap inside '.panel-collapse'")}
$(target).hasClass("out")?close(this):open(this);function open(toggler){$(toggler).removeClass("down").addClass("up");$(target).removeClass("pull").addClass("pulling").css("height","0px").transition({height:height},function(){$(this).removeClass("pulling").addClass("pull out");$(this).css({"height":""})});$(element).trigger(settings.eventPrefix+".panelcollapse.open",{"element":$(panel)})}
function close(toggler){$(toggler).removeClass("up").addClass("down");$(target).removeClass("pull out").addClass("pulling").css("height",height).transition({height:"0px"},function(){$(this).removeClass("pulling").addClass("pull");$(this).css({"height":""})});$(element).trigger(settings.eventPrefix+".panelcollapse.close",{"element":$(panel)})}
e.preventDefault()});MAIN.prototype.HELPER.Console(settings.eventPrefix+".panelcollapse.open");MAIN.prototype.HELPER.Console(settings.eventPrefix+".panelcollapse.close")})();(function(){var panel,parent,handler="[data-toggle~=panelremove]";$(element).on("click",handler,function(e){panel=$(this).parents(".panel");parent=$(this).data("parent");panel.transition({scale:0},function(){if(parent){$(this).parents(parent).remove()}else{$(this).remove()}
$(element).trigger(settings.eventPrefix+".panelcollapse.remove",{"element":$(panel)})});e.preventDefault()});MAIN.prototype.HELPER.Console(settings.eventPrefix+".panelremove.remove")})();(function(){var menuHandler="[data-toggle~=menu]",submenuHandler="[data-toggle~=submenu]";function handleClick(e){var $this=$(this),parent=$this.data("parent"),target=$this.data("target");if(e.type==="click"){if($(target).hasClass("in")){$(target).collapse("hide");$this.parent().removeClass("open")}else{if(!!parent){$(parent+" .in").each(function(){$(this).collapse("hide");$(this).parent().removeClass("open")})}
$(target).collapse("show");$this.parent().addClass("open")}}}
function handleHover(e){var $this=$(this),parent=$this.children(submenuHandler).data("parent"),target=$this.children(submenuHandler).data("target")}
$(document).on("click",submenuHandler,handleClick).on("mouseenter mouseleave",menuHandler+" > li",handleHover)})();(function(){var direction,sidebar,toggler="[data-toggle~=sidebar]",openClass="sidebar-open";function toggle(){direction=$(this).data("direction");direction==="ltr"?sidebar=".sidebar-left":sidebar=".sidebar-right";if((direction===!1)||(direction==="")){$.error("missing `data-direction` value (ltr or rtl)")}
!$(element).hasClass(openClass+"-"+direction)?open():close();return!1}
function open(){$(element).addClass(openClass+"-"+direction);$(element).trigger(settings.eventPrefix+".sidebar.open",{"element":$(sidebar)})}
function close(){if($(element).hasClass(openClass+"-"+direction)){$(element).removeClass(openClass+"-"+direction);$(element).trigger(settings.eventPrefix+".sidebar.close",{"element":$(sidebar)})}}
$(document).on("click",".sidebar,"+toggler,function(e){e.stopPropagation()}).on("click",toggler,toggle);MAIN.prototype.HELPER.Console(settings.eventPrefix+".sidebar.open");MAIN.prototype.HELPER.Console(settings.eventPrefix+".sidebar.close")})();(function(){var handler="[data-toggle~=formajax]",pluginErrors=[];function ajaxForm(){var that=this,$form=$(this).parents(handler),options=$form.data("options");if(typeof options!=="object"){pluginErrors.push("`data-options` need to be a valid javascript object!")}
if(options.validate&&!jQuery().parsley){pluginErrors.push("please include `parsley` plugin for form validation!")}
if(pluginErrors.length<=0){function jqxhr(){var jxhr=$.ajax({type:options.method||"post",url:options.url,dataType:"json",data:$form.serialize()});if($(that).hasClass("ladda-button")){var ladda=Ladda.create(that).start()}else{$(that).prop("disabled",!0)}
jxhr.done(function(data){!!$(that).hasClass("ladda-button")?ladda.stop():$(that).prop("disabled",!1);$(element).trigger(settings.eventPrefix+".formajax.done",{"element":$form,"response":data})});jxhr.fail(function(data){!!$(that).hasClass("ladda-button")?ladda.stop():$(that).prop("disabled",!1);$(element).trigger(settings.eventPrefix+".formajax.fail",{"element":$form,"response":data})})}
if(options.validate===!0){if($form.parsley().validate()){jqxhr()}}else{jqxhr()}}else{$.each(pluginErrors,function(index,value){$.error(value)})}}
$(document).on("submit",handler,function(e){e.preventDefault()}).on("click",handler+" button[type=submit]",ajaxForm);MAIN.prototype.HELPER.Console(settings.eventPrefix+".formajax.always");MAIN.prototype.HELPER.Console(settings.eventPrefix+".formajax.done");MAIN.prototype.HELPER.Console(settings.eventPrefix+".formajax.fail")})();$(function(){var toggler="[data-toggle~=counterup]",pluginErrors=[];$(toggler).each(function(index,value){options=$(value).data("options");if(options!=="undefined"){}else{}
if(pluginErrors.length<=0){$(value).counterUp({delay:10,time:1000})}else{$.each(pluginErrors,function(index,value){$.error(value)})}})});$(function(){var container="[data-toggle~=offcanvas]",pluginErrors=[];$(container).each(function(index,value){var options=$(value).data("options");if(options!==undefined){if(typeof options!=="object"){pluginErrors.push("OffCanvas: `data-options` need to be a valid javascript object!")}else{optOpenerClass=options.openerClass||"offcanvas-opener",optCloserClass=options.closerClass||"offcanvas-closer"}}else{optOpenerClass="offcanvas-opener",optCloserClass="offcanvas-closer"}
if(pluginErrors.length<=0){$(value).on("click","."+optOpenerClass,function(e){var direction=!!$(this).hasClass("offcanvas-open-rtl")?"offcanvas-open-rtl":"offcanvas-open-ltr";$(value).removeClass("offcanvas-open-ltr offcanvas-open-rtl").addClass(direction);$(element).trigger(settings.eventPrefix+".offcanvas.open",{"element":$(value)});e.preventDefault()}).on("click","."+optCloserClass,function(e){$(value).removeClass("offcanvas-open-ltr offcanvas-open-rtl");$(element).trigger(settings.eventPrefix+".offcanvas.close",{"element":$(value)});e.preventDefault()})}else{$.each(pluginErrors,function(index,value){$.error(value)})}});MAIN.prototype.HELPER.Console(settings.eventPrefix+".offcanvas.open");MAIN.prototype.HELPER.Console(settings.eventPrefix+".offcanvas.close")})}};$.fn[pluginName]=function(options){return this.each(function(){if(!$.data(this,pluginName)){$.data(this,pluginName,new MAIN(this,options))}})}})(jQuery,window,document);var IdleTimer=(function($){var activityHelper={_idleTimeout:30000,_awayTimeout:600000,_idleNow:!1,_idleTimestamp:null,_idleTimer:null,_awayNow:!1,_awayTimestamp:null,_awayTimer:null,_onIdleCallback:null,_onAwayCallback:null,_onBackCallback:null,_debug:!1,_lastActive:new Date().getTime(),_sessionKeepAliveInterval:null,_keepSessionAlive:null,_makeIdle:function(){var t=new Date().getTime();if(t<this._idleTimestamp){if(this._debug)console.log('Not idle yet. Idle in '+(this._idleTimestamp-t+50));this._idleTimer=setTimeout(function(){activityHelper._makeIdle()},this._idleTimestamp-t+50);return}
if(this._debug)console.log('** IDLE **');this._idleNow=!0;try{if(this._onIdleCallback)this._onIdleCallback();}catch(err){}},_makeAway:function(){var t=new Date().getTime();if(t<this._awayTimestamp){if(this._debug)console.log('Not away yet. Away in '+(this._awayTimestamp-t+50));this._awayTimer=setTimeout(function(){activityHelper._makeAway()},this._awayTimestamp-t+50);return}
if(this._debug)console.log('** AWAY **');this._awayNow=!0;if(this._keepSessionAlive){this._sessionKeepAliveInterval=setInterval(function(){activityHelper._keepSessionAlive()},this._awayTimeout)}
try{if(this._onAwayCallback)this._onAwayCallback();}catch(err){}},_active:function(timer){var t=new Date().getTime();this._lastActive=t;this._idleTimestamp=t+this._idleTimeout;this._awayTimestamp=t+this._awayTimeout;if(this._debug)console.log('not idle.');if(this._idleNow){timer.setIdleTimeout(this._idleTimeout)}
if(this._awayNow){clearTimeout(this._sessionKeepAliveInterval);timer.setAwayTimeout(this._awayTimeout)}
try{if(this._idleNow||this._awayNow){if(this._debug)console.log('** BACK **');if(this._onBackCallback)this._onBackCallback(this._idleNow,this._awayNow);}}catch(err){}
this._idleNow=!1;this._awayNow=!1},_onStatusChange:function(url,status){$.ajax({url:url,type:'post',dataType:'json',data:'status='+status})}};return{getLastActive:function(){var t=new Date().getTime();return Math.ceil((t-activityHelper._lastActive)/1000)},isIdle:function(){return activityHelper._idleNow},isAway:function(){return activityHelper._awayNow},setIdleTimeout:function(ms){activityHelper._idleTimeout=ms;activityHelper._idleTimestamp=new Date().getTime()+ms;if(activityHelper._idleTimer!=null){clearTimeout(activityHelper._idleTimer)}
activityHelper._idleTimer=setTimeout(function(){activityHelper._makeIdle()},ms+50);if(activityHelper._debug)console.log('idle in '+ms+', tid = '+activityHelper._idleTimer);},setAwayTimeout:function(ms){activityHelper._awayTimeout=ms;activityHelper._awayTimestamp=new Date().getTime()+ms;if(activityHelper._awayTimer!=null){clearTimeout(activityHelper._awayTimer)}
activityHelper._awayTimer=setTimeout(function(){activityHelper._makeAway()},ms+50);if(activityHelper._debug)console.log('away in '+ms);},init:function(options){if(options){if(options.debug){activityHelper._debug=options.debug;console.log('IdleTimer initiated');console.log(options)}
if(options.statusChangeUrl){activityHelper._onIdleCallback=function(){activityHelper._onStatusChange(options.statusChangeUrl,'idle')};activityHelper._onAwayCallback=function(){activityHelper._onStatusChange(options.statusChangeUrl,'away')};activityHelper._onBackCallback=function(){activityHelper._onStatusChange(options.statusChangeUrl,'back')};activityHelper._keepSessionAlive=function(){activityHelper._onStatusChange(options.statusChangeUrl,'keepalive')}}
if(options.idleTimeout){this.setIdleTimeout(options.idleTimeout)}
if(options.awayTimeout){this.setAwayTimeout(options.awayTimeout)}
if(options.idle){this.setOnIdleCallback(options.idle)}
if(options.away){this.setOnAwayCallback(options.away)}
if(options.back){this.setOnBackCallback(options.back)}}
var doc=$(document);var me=this;doc.on('mousemove',function(){activityHelper._active(me)});try{doc.on('mouseenter',function(){activityHelper._active(me)})}catch(err){}
try{doc.on('scroll',function(){activityHelper._active(me)})}catch(err){}
try{doc.on('keydown',function(){activityHelper._active(me)})}catch(err){}
try{doc.on('click',function(){activityHelper._active(me)})}catch(err){}
try{doc.on('dblclick',function(){activityHelper._active(me)})}catch(err){}}}})(jQuery);jQuery.fn.vectorMap('addMap','world_mill_en',{"insets":[{"width":900,"top":0,"height":440.70631074413296,"bbox":[{"y":-12671671.123330014,"x":-20004297.151525836},{"y":6930392.02513512,"x":20026572.39474939}],"left":0}],"paths":{"BD":{"path":"M651.84,230.21l-0.6,-2.0l-1.36,-1.71l-2.31,-0.11l-0.41,0.48l0.2,0.94l-0.53,0.99l-0.72,-0.36l-0.68,0.35l-1.2,-0.36l-0.37,-2.0l-0.81,-1.86l0.39,-1.46l-0.22,-0.47l-1.14,-0.53l0.29,-0.5l1.48,-0.94l0.03,-0.65l-1.55,-1.22l0.55,-1.14l1.61,0.94l1.04,0.15l0.18,1.54l0.34,0.35l5.64,0.63l-0.84,1.64l-1.22,0.34l-0.77,1.51l0.07,0.47l1.37,1.37l0.67,-0.19l0.42,-1.39l1.21,3.84l-0.03,1.21l-0.33,-0.15l-0.4,0.28Z","name":"Bangladesh"},"BE":{"path":"M429.29,144.05l1.91,0.24l2.1,-0.63l2.63,1.99l-0.21,1.66l-0.69,0.4l-0.18,1.2l-1.66,-1.13l-1.39,0.15l-2.73,-2.7l-1.17,-0.18l-0.16,-0.52l1.54,-0.5Z","name":"Belgium"},"BF":{"path":"M421.42,247.64l-0.11,0.95l0.34,1.16l1.4,1.71l0.07,1.1l0.32,0.37l2.55,0.51l-0.04,1.28l-0.38,0.53l-1.07,0.21l-0.72,1.18l-0.63,0.21l-3.22,-0.25l-0.94,0.39l-5.4,-0.05l-0.39,0.38l0.16,2.73l-1.23,-0.43l-1.17,0.1l-0.89,0.57l-2.27,-1.72l-0.13,-1.11l0.61,-0.96l0.02,-0.93l1.87,-1.98l0.44,-1.81l0.43,-0.39l1.28,0.26l1.05,-0.52l0.47,-0.73l1.84,-1.09l0.55,-0.83l2.2,-1.0l1.15,-0.3l0.72,0.45l1.13,-0.01Z","name":"Burkina Faso"},"BG":{"path":"M491.65,168.18l-0.86,0.88l-0.91,2.17l0.48,1.34l-1.6,-0.24l-2.55,0.95l-0.28,1.51l-1.8,0.22l-2.0,-1.0l-1.92,0.79l-1.42,-0.07l-0.15,-1.63l-1.05,-0.97l0.0,-0.8l1.2,-1.57l0.01,-0.56l-1.14,-1.23l-0.05,-0.94l0.88,0.97l0.88,-0.2l1.91,0.47l3.68,0.16l1.42,-0.81l2.72,-0.66l2.55,1.24Z","name":"Bulgaria"},"BA":{"path":"M463.49,163.65l2.1,0.5l1.72,-0.03l1.52,0.68l-0.36,0.78l0.08,0.45l1.04,1.02l-0.25,0.98l-1.81,1.15l-0.38,1.38l-1.67,-0.87l-0.89,-1.2l-2.11,-1.83l-1.63,-2.22l0.23,-0.57l0.48,0.38l0.55,-0.06l0.43,-0.51l0.94,-0.06Z","name":"Bosnia and Herz."},"BN":{"path":"M707.48,273.58l0.68,-0.65l1.41,-0.91l-0.15,1.63l-0.81,-0.05l-0.61,0.58l-0.53,-0.6Z","name":"Brunei"},"BO":{"path":"M263.83,340.69l-3.09,-0.23l-0.38,0.23l-0.7,1.52l-1.31,-1.53l-3.28,-0.64l-2.37,2.4l-1.31,0.26l-0.88,-3.26l-1.3,-2.86l0.74,-2.37l-0.13,-0.43l-1.2,-1.01l-0.37,-1.89l-1.08,-1.55l1.45,-2.56l-0.96,-2.33l0.47,-1.06l-0.34,-0.73l0.91,-1.32l0.16,-3.84l0.5,-1.18l-1.81,-3.41l2.46,0.07l0.8,-0.85l3.4,-1.91l2.66,-0.35l-0.19,1.38l0.3,1.07l-0.05,1.97l2.72,2.27l2.88,0.49l0.89,0.86l1.79,0.58l0.98,0.7l1.71,0.05l1.17,0.61l0.6,2.7l-0.7,0.54l0.96,2.99l0.37,0.28l4.3,0.1l-0.25,1.2l0.27,1.02l1.43,0.9l0.5,1.35l-0.41,1.86l-0.65,1.08l0.12,1.35l-2.69,-1.65l-2.4,-0.03l-4.36,0.76l-1.49,2.5l-0.11,1.52l-0.75,2.37Z","name":"Bolivia"},"JP":{"path":"M781.12,166.87l1.81,0.68l1.62,-0.97l0.39,2.42l-3.35,0.75l-2.23,2.88l-3.63,-1.9l-0.56,0.2l-1.26,3.05l-2.16,0.03l-0.29,-2.51l1.08,-2.03l2.45,-0.16l0.37,-0.33l1.25,-5.94l2.47,2.71l2.03,1.12ZM773.56,187.34l-0.91,2.22l0.37,1.52l-1.14,1.75l-3.02,1.26l-4.58,0.27l-3.34,3.01l-1.25,-0.8l-0.09,-1.9l-0.46,-0.38l-4.35,0.62l-3.0,1.32l-2.85,0.05l-0.37,0.27l0.13,0.44l2.32,1.89l-1.54,4.34l-1.26,0.9l-0.79,-0.7l0.56,-2.27l-0.21,-0.45l-1.47,-0.75l-0.74,-1.4l2.12,-0.84l1.26,-1.7l2.45,-1.42l1.83,-1.91l4.78,-0.81l2.6,0.57l0.44,-0.21l2.39,-4.66l1.29,1.06l0.5,0.01l5.1,-4.02l1.69,-3.73l-0.38,-3.4l0.9,-1.61l2.14,-0.44l1.23,3.72l-0.07,2.18l-2.23,2.84l-0.04,3.16ZM757.78,196.26l0.19,0.56l-1.01,1.21l-1.16,-0.68l-1.28,0.65l-0.69,1.45l-1.02,-0.5l0.01,-0.93l1.14,-1.38l1.57,0.14l0.85,-0.98l1.4,0.46Z","name":"Japan"},"BI":{"path":"M495.45,295.49l-1.08,-2.99l1.14,-0.11l0.64,-1.19l0.76,0.09l0.65,1.83l-2.1,2.36Z","name":"Burundi"},"BJ":{"path":"M429.57,255.75l-0.05,0.8l0.5,1.34l-0.42,0.86l0.17,0.79l-1.81,2.12l-0.57,1.76l-0.08,5.42l-1.41,0.2l-0.48,-1.36l0.11,-5.71l-0.52,-0.7l-0.2,-1.35l-1.48,-1.48l0.21,-0.9l0.89,-0.43l0.42,-0.92l1.27,-0.36l1.22,-1.34l0.61,-0.0l1.62,1.24Z","name":"Benin"},"BT":{"path":"M650.32,213.86l0.84,0.71l-0.12,1.1l-3.76,-0.11l-1.57,0.4l-1.93,-0.87l1.48,-1.96l1.13,-0.57l1.63,0.57l1.33,0.08l0.99,0.65Z","name":"Bhutan"},"JM":{"path":"M228.38,239.28l-0.8,0.4l-2.26,-1.06l0.84,-0.23l2.14,0.3l1.17,0.56l-1.08,0.03Z","name":"Jamaica"},"BW":{"path":"M483.92,330.07l2.27,4.01l2.83,2.86l0.96,0.31l0.78,2.43l2.13,0.61l1.02,0.76l-3.0,1.64l-2.32,2.02l-1.54,2.69l-1.52,0.45l-0.64,1.94l-1.34,0.52l-1.85,-0.12l-1.21,-0.74l-1.35,-0.3l-1.22,0.62l-0.75,1.37l-2.31,1.9l-1.4,0.21l-0.35,-0.59l0.16,-1.75l-1.48,-2.54l-0.62,-0.43l-0.0,-7.1l2.08,-0.08l0.39,-0.4l0.07,-8.9l5.19,-0.93l0.8,0.89l0.51,0.07l1.5,-0.95l2.21,-0.49Z","name":"Botswana"},"BR":{"path":"M259.98,275.05l3.24,0.7l0.65,-0.53l4.55,-1.32l1.08,-1.06l-0.02,-0.63l0.55,-0.05l0.28,0.28l-0.26,0.87l0.22,0.48l0.73,0.32l0.4,0.81l-0.62,0.86l-0.4,2.13l0.82,2.56l1.69,1.43l1.43,0.2l3.17,-1.68l3.18,0.3l0.65,-0.75l-0.27,-0.92l1.9,-0.09l2.39,0.99l1.06,-0.61l0.84,0.78l1.2,-0.18l1.18,-1.06l0.84,-1.94l1.36,-2.11l0.37,-0.05l1.89,5.45l1.33,0.59l0.05,1.28l-1.77,1.94l0.02,0.56l1.02,0.87l4.07,0.36l0.08,2.16l0.66,0.29l1.74,-1.5l6.97,2.32l1.02,1.22l-0.35,1.18l0.49,0.5l2.81,-0.74l4.77,1.3l3.75,-0.08l3.57,2.0l3.29,2.86l1.93,0.72l2.12,0.12l0.71,0.62l1.21,4.51l-0.95,3.98l-4.72,5.06l-1.64,2.92l-1.72,2.05l-0.8,0.3l-0.72,2.03l0.18,4.75l-0.94,5.53l-0.81,1.13l-0.43,3.36l-2.55,3.5l-0.4,2.51l-1.86,1.04l-0.67,1.53l-2.54,0.01l-3.94,1.01l-1.83,1.2l-2.87,0.82l-3.03,2.19l-2.2,2.83l-0.36,2.0l0.4,1.58l-0.44,2.6l-0.51,1.2l-1.77,1.54l-2.75,4.78l-3.83,3.42l-1.24,2.74l-1.18,1.15l-0.36,-0.83l0.95,-1.14l0.01,-0.5l-1.52,-1.97l-4.56,-3.32l-1.03,-0.0l-2.38,-2.02l-0.81,-0.0l5.34,-5.45l3.77,-2.58l0.22,-2.46l-1.35,-1.81l-0.91,0.07l0.58,-2.33l0.01,-1.54l-1.11,-0.83l-1.75,0.3l-0.44,-3.11l-0.52,-0.95l-1.88,-0.88l-1.24,0.47l-2.17,-0.41l0.15,-3.21l-0.62,-1.34l0.66,-0.73l-0.22,-1.34l0.66,-1.13l0.44,-2.04l-0.61,-1.83l-1.4,-0.86l-0.2,-0.75l0.34,-1.39l-0.38,-0.5l-4.52,-0.1l-0.72,-2.22l0.59,-0.42l-0.03,-1.1l-0.5,-0.87l-0.32,-1.7l-1.45,-0.76l-1.63,-0.02l-1.05,-0.72l-1.6,-0.48l-1.13,-0.99l-2.69,-0.4l-2.47,-2.06l0.13,-4.35l-0.45,-0.45l-3.46,0.5l-3.44,1.94l-0.6,0.74l-2.9,-0.17l-1.47,0.42l-0.72,-0.18l0.15,-3.52l-0.63,-0.34l-1.94,1.41l-1.87,-0.06l-0.83,-1.18l-1.37,-0.26l0.21,-1.01l-1.35,-1.49l-0.88,-1.91l0.56,-0.6l-0.0,-0.81l1.29,-0.62l0.22,-0.43l-0.22,-1.19l0.61,-0.91l0.15,-0.99l2.65,-1.58l1.99,-0.47l0.42,-0.36l2.06,0.11l0.42,-0.33l1.19,-8.0l-0.41,-1.56l-1.1,-1.0l0.01,-1.33l1.91,-0.42l0.08,-0.96l-0.33,-0.43l-1.14,-0.2l-0.02,-0.83l4.47,0.05l0.82,-0.67l0.82,1.81l0.8,0.07l1.15,1.1l2.26,-0.05l0.71,-0.83l2.78,-0.96l0.48,-1.13l1.6,-0.64l0.24,-0.47l-0.48,-0.82l-1.83,-0.19l-0.36,-3.22Z","name":"Brazil"},"BS":{"path":"M226.4,223.87l-0.48,-1.15l-0.84,-0.75l0.36,-1.11l0.95,1.95l0.01,1.06ZM225.56,216.43l-1.87,0.29l-0.04,-0.22l0.74,-0.14l1.17,0.06Z","name":"Bahamas"},"BY":{"path":"M493.84,128.32l0.29,0.7l0.49,0.23l1.19,-0.38l2.09,0.72l0.19,1.26l-0.45,1.24l1.57,2.26l0.89,0.59l0.17,0.81l1.58,0.56l0.4,0.5l-0.53,0.41l-1.87,-0.11l-0.73,0.38l-0.13,0.52l1.04,2.74l-1.91,0.26l-0.89,0.99l-0.11,1.18l-2.73,-0.04l-0.53,-0.62l-0.52,-0.08l-0.75,0.46l-0.91,-0.42l-1.92,-0.07l-2.75,-0.79l-2.6,-0.28l-2.0,0.07l-1.5,0.92l-0.67,0.07l-0.08,-1.22l-0.59,-1.19l1.36,-0.88l0.01,-1.35l-0.7,-1.41l-0.07,-1.0l2.16,-0.02l2.72,-1.3l0.75,-2.04l1.91,-1.04l0.2,-0.41l-0.19,-1.25l3.8,-1.78l2.3,0.77Z","name":"Belarus"},"BZ":{"path":"M198.03,244.38l0.1,-4.49l0.69,-0.06l0.74,-1.3l0.34,0.28l-0.4,1.3l0.17,0.58l-0.34,2.25l-1.3,1.42Z","name":"Belize"},"RU":{"path":"M491.55,115.25l2.55,-1.85l-0.01,-0.65l-2.2,-1.5l7.32,-6.76l1.03,-2.11l-0.13,-0.49l-3.46,-2.52l0.86,-2.7l-2.11,-2.81l1.56,-3.67l-2.77,-4.52l2.15,-2.99l-0.08,-0.55l-3.65,-2.73l0.3,-2.54l1.81,-0.37l4.26,-1.77l2.42,-1.45l4.06,2.61l6.79,1.04l9.34,4.85l1.78,1.88l0.14,2.46l-2.55,2.02l-3.9,1.06l-11.07,-3.14l-2.06,0.53l-0.13,0.7l3.94,2.94l0.31,5.86l0.26,0.36l5.14,2.24l0.58,-0.29l0.32,-1.94l-1.35,-1.78l1.13,-1.09l6.13,2.42l2.11,-0.98l0.18,-0.56l-1.51,-2.67l5.41,-3.76l2.07,0.22l2.26,1.41l0.57,-0.16l1.46,-2.87l-0.05,-0.44l-1.92,-2.32l1.12,-2.32l-1.32,-2.27l5.87,1.16l1.04,1.75l-2.59,0.43l-0.33,0.4l0.02,2.36l2.46,1.83l3.87,-0.91l0.86,-2.8l13.69,-5.65l0.99,0.11l-1.92,2.06l0.23,0.67l3.11,0.45l2.0,-1.48l4.56,-0.12l3.64,-1.73l2.65,2.44l0.56,-0.01l2.85,-2.88l-0.01,-0.57l-2.35,-2.29l0.9,-1.01l7.14,1.3l3.41,1.36l9.05,4.97l0.51,-0.11l1.67,-2.27l-0.05,-0.53l-2.43,-2.21l-0.06,-0.78l-0.34,-0.36l-2.52,-0.36l0.64,-1.93l-1.32,-3.46l-0.06,-1.21l4.48,-4.06l1.69,-4.29l1.6,-0.81l6.23,1.18l0.44,2.21l-2.29,3.64l0.06,0.5l1.47,1.39l0.76,3.0l-0.56,6.03l2.69,2.82l-0.96,2.57l-4.86,5.95l0.23,0.64l2.86,0.61l0.42,-0.17l0.93,-1.4l2.64,-1.03l0.87,-2.24l2.09,-1.96l0.07,-0.5l-1.36,-2.28l1.09,-2.69l-0.32,-0.55l-2.47,-0.33l-0.5,-2.06l1.94,-4.38l-0.06,-0.42l-2.96,-3.4l4.12,-2.88l0.16,-0.4l-0.51,-2.93l0.54,-0.05l1.13,2.25l-0.96,4.35l0.27,0.47l2.68,0.84l0.5,-0.51l-1.02,-2.99l3.79,-1.66l5.01,-0.24l4.53,2.61l0.48,-0.06l0.07,-0.48l-2.18,-3.82l-0.23,-4.67l3.98,-0.9l5.97,0.21l5.49,-0.64l0.27,-0.65l-1.83,-2.31l2.56,-2.9l2.87,-0.17l4.8,-2.47l6.54,-0.67l1.03,-1.42l6.25,-0.45l2.32,1.11l5.53,-2.7l4.5,0.08l0.39,-0.28l0.66,-2.15l2.26,-2.12l5.69,-2.11l3.21,1.29l-2.46,0.94l-0.25,0.42l0.34,0.35l5.41,0.77l0.61,2.33l0.58,0.25l2.2,-1.22l7.13,0.07l5.51,2.47l1.79,1.72l-0.53,2.24l-9.16,4.15l-1.97,1.52l0.16,0.71l6.77,1.91l2.16,-0.78l1.13,2.74l0.67,0.11l1.01,-1.15l3.81,-0.73l7.7,0.77l0.54,1.99l0.36,0.29l10.47,0.71l0.43,-0.38l0.13,-3.23l4.87,0.78l3.95,-0.02l3.83,2.4l1.03,2.71l-1.35,1.79l0.02,0.5l3.15,3.64l4.07,1.96l0.53,-0.18l2.23,-4.47l3.95,1.93l4.16,-1.21l4.73,1.39l2.05,-1.26l3.94,0.62l0.43,-0.55l-1.68,-4.02l2.89,-1.8l22.31,3.03l2.16,2.75l6.55,3.51l10.29,-0.81l4.82,0.73l1.85,1.66l-0.29,3.08l0.25,0.41l3.08,1.26l3.56,-0.88l4.35,-0.11l4.8,0.87l4.57,-0.47l4.23,3.79l0.43,0.07l3.1,-1.4l0.16,-0.6l-1.88,-2.62l0.85,-1.52l7.71,1.21l5.22,-0.26l7.09,2.09l9.59,5.22l6.35,4.11l-0.2,2.38l1.88,1.41l0.6,-0.42l-0.48,-2.53l6.15,0.57l4.4,3.51l-1.97,1.43l-4.0,0.41l-0.36,0.39l-0.06,3.79l-0.74,0.62l-2.07,-0.11l-1.91,-1.39l-3.14,-1.11l-0.78,-1.85l-2.72,-0.68l-2.63,0.49l-1.04,-1.1l0.46,-1.31l-0.5,-0.51l-3.0,0.98l-0.22,0.58l0.99,1.7l-1.21,1.48l-3.04,1.68l-3.12,-0.28l-0.4,0.23l0.09,0.46l2.2,2.09l1.46,3.2l1.15,1.1l0.24,1.33l-0.42,0.67l-4.63,-0.77l-6.96,2.9l-2.19,0.44l-7.6,5.06l-0.84,1.45l-3.61,-2.37l-6.24,2.82l-0.94,-1.15l-0.53,-0.08l-2.28,1.52l-3.2,-0.49l-0.44,0.27l-0.78,2.37l-3.05,3.78l0.09,1.47l0.29,0.36l2.54,0.72l-0.29,4.53l-1.97,0.11l-0.35,0.26l-1.07,2.94l0.8,1.45l-3.91,1.58l-1.05,3.95l-3.48,0.77l-0.3,0.3l-0.72,3.29l-3.09,2.65l-0.7,-1.74l-2.44,-12.44l1.16,-4.71l2.04,-2.06l0.22,-1.64l3.8,-0.86l4.46,-4.61l4.28,-3.81l4.48,-3.01l2.17,-5.63l-0.42,-0.54l-3.04,0.33l-1.77,3.31l-5.86,3.86l-1.86,-4.25l-0.45,-0.23l-6.46,1.3l-6.47,6.44l-0.01,0.55l1.58,1.74l-8.24,1.17l0.15,-2.2l-0.34,-0.42l-3.89,-0.56l-3.25,1.81l-7.62,-0.62l-8.45,1.19l-17.71,15.41l0.22,0.7l3.74,0.41l1.36,2.17l2.43,0.76l1.88,-1.68l2.4,0.2l3.4,3.54l0.08,2.6l-1.95,3.42l-0.21,3.9l-1.1,5.06l-3.71,4.54l-0.87,2.21l-8.29,8.89l-3.19,1.7l-1.32,0.03l-1.45,-1.36l-0.49,-0.04l-2.27,1.5l0.41,-3.65l-0.59,-2.47l1.75,-0.89l2.91,0.53l0.42,-0.2l1.68,-3.03l0.87,-3.46l0.97,-1.18l1.32,-2.88l-0.45,-0.56l-4.14,0.95l-2.19,1.25l-3.41,-0.0l-1.06,-2.93l-2.97,-2.3l-4.28,-1.06l-1.75,-5.07l-2.66,-5.01l-2.29,-1.29l-3.75,-1.01l-3.44,0.08l-3.18,0.62l-2.24,1.77l0.05,0.66l1.18,0.69l0.02,1.43l-1.33,1.05l-2.26,3.51l-0.04,1.43l-3.16,1.84l-2.82,-1.16l-3.01,0.23l-1.35,-1.07l-1.5,-0.35l-3.9,2.31l-3.22,0.52l-2.27,0.79l-3.05,-0.51l-2.21,0.03l-1.48,-1.6l-2.6,-1.63l-2.63,-0.43l-5.46,1.01l-3.23,-1.25l-0.72,-2.57l-5.2,-1.24l-2.75,-1.36l-0.5,0.12l-2.59,3.45l0.84,2.1l-2.06,1.93l-3.41,-0.77l-2.42,-0.12l-1.83,-1.54l-2.53,-0.05l-2.42,-0.98l-3.86,1.57l-4.72,2.78l-3.3,0.75l-1.55,-1.92l-3.0,0.41l-1.11,-1.33l-1.62,-0.59l-1.31,-1.94l-1.38,-0.6l-3.7,0.79l-3.31,-1.83l-0.51,0.11l-0.99,1.29l-5.29,-8.05l-2.96,-2.48l0.65,-0.77l0.01,-0.51l-0.5,-0.11l-6.2,3.21l-1.84,0.15l0.15,-1.39l-0.26,-0.42l-3.22,-1.17l-2.46,0.7l-0.69,-3.16l-0.32,-0.31l-4.5,-0.75l-2.47,1.47l-6.19,1.27l-1.29,0.86l-9.51,1.3l-1.15,1.17l-0.03,0.53l1.47,1.9l-1.89,0.69l-0.22,0.56l0.31,0.6l-2.11,1.44l0.03,0.68l3.75,2.12l-0.39,0.98l-3.23,-0.13l-0.86,0.86l-3.09,-1.59l-3.97,0.07l-2.66,1.35l-8.32,-3.56l-4.07,0.06l-5.39,3.68l-0.39,2.0l-2.03,-1.5l-0.59,0.13l-2.0,3.59l0.57,0.93l-1.28,2.16l0.06,0.48l2.13,2.17l1.95,0.04l1.37,1.82l-0.23,1.46l0.25,0.43l0.83,0.33l-0.8,1.31l-2.49,0.62l-2.49,3.2l0.0,0.49l2.17,2.78l-0.15,2.18l2.5,3.24l-1.58,1.59l-0.7,-0.13l-1.63,-1.72l-2.29,-0.84l-0.94,-1.31l-2.34,-0.63l-1.48,0.4l-0.43,-0.47l-3.51,-1.48l-5.76,-1.01l-0.45,0.19l-2.89,-2.34l-2.9,-1.2l-1.53,-1.29l1.29,-0.43l2.08,-2.61l-0.05,-0.55l-0.89,-0.79l3.05,-1.06l0.27,-0.42l-0.07,-0.69l-0.49,-0.35l-1.73,0.39l0.04,-0.68l1.04,-0.72l2.66,-0.48l0.4,-1.32l-0.5,-1.6l0.92,-1.54l0.03,-1.17l-0.29,-0.37l-3.69,-1.06l-1.41,0.02l-1.42,-1.41l-2.19,0.38l-2.77,-1.01l-0.03,-0.59l-0.89,-1.43l-2.0,-0.32l-0.11,-0.54l0.49,-0.53l0.01,-0.53l-1.6,-1.9l-3.58,0.02l-0.88,0.73l-0.46,-0.07l-1.0,-2.79l2.22,-0.02l0.97,-0.74l0.07,-0.57l-0.9,-1.04l-1.35,-0.48l-0.11,-0.7l-0.95,-0.58l-1.38,-1.99l0.46,-0.98l-0.51,-1.96l-2.45,-0.84l-1.21,0.3l-0.46,-0.76l-2.46,-0.83l-0.72,-1.87l-0.21,-1.69l-0.99,-0.85l0.85,-1.17l-0.7,-3.21l1.66,-1.97l-0.16,-0.79ZM749.2,170.72l-0.6,0.4l-0.13,0.16l-0.01,-0.51l0.74,-0.05ZM874.85,67.94l-5.63,0.48l-0.26,-0.84l3.15,-1.89l1.94,0.01l3.19,1.16l-2.39,1.09ZM797.39,48.49l-2.0,1.36l-3.8,-0.42l-4.25,-1.8l0.35,-0.97l9.69,1.83ZM783.67,46.12l-1.63,3.09l-8.98,-0.13l-4.09,1.14l-4.54,-2.97l1.16,-3.01l3.05,-0.89l6.5,0.22l8.54,2.56ZM778.2,134.98l-0.56,-0.9l0.27,-0.12l0.29,1.01ZM778.34,135.48l0.94,3.53l-0.05,3.38l1.05,3.39l2.18,5.0l-2.89,-0.83l-0.49,0.26l-1.54,4.65l2.42,3.5l-0.04,1.13l-1.24,-1.24l-0.61,0.06l-1.09,1.61l-0.28,-1.61l0.27,-3.1l-0.28,-3.4l0.58,-2.47l0.11,-4.39l-1.46,-3.36l0.21,-4.32l2.15,-1.46l0.07,-0.34ZM771.95,56.61l1.76,-1.42l2.89,-0.42l3.28,1.71l0.14,0.6l-3.27,0.03l-4.81,-0.5ZM683.76,31.09l-13.01,1.93l4.03,-6.35l1.82,-0.56l1.73,0.34l5.99,2.98l-0.56,1.66ZM670.85,27.93l-5.08,0.64l-6.86,-1.57l-3.99,-2.05l-2.1,-4.16l-2.6,-0.87l5.72,-3.5l5.2,-1.28l4.69,2.85l5.59,5.4l-0.56,4.53ZM564.15,68.94l-0.64,0.17l-7.85,-0.57l-0.86,-2.04l-4.28,-1.17l-0.28,-1.94l2.27,-0.89l0.25,-0.39l-0.08,-2.38l4.81,-3.97l-0.15,-0.7l-1.47,-0.38l5.3,-3.81l0.15,-0.44l-0.58,-1.94l5.28,-2.51l8.21,-3.27l8.28,-0.96l4.35,-1.94l4.6,-0.64l1.36,1.61l-1.34,1.28l-16.43,4.94l-7.97,4.88l-7.74,9.63l0.66,4.14l4.16,3.27ZM548.81,18.48l-5.5,1.18l-0.58,1.02l-2.59,0.84l-2.13,-1.07l1.12,-1.42l-0.3,-0.65l-2.33,-0.07l1.68,-0.36l3.47,-0.06l0.42,1.29l0.66,0.16l1.38,-1.34l2.15,-0.88l2.94,1.01l-0.39,0.36ZM477.37,133.15l-4.08,0.05l-2.56,-0.32l0.33,-0.87l3.17,-1.03l3.24,0.96l-0.09,1.23Z","name":"Russia"},"RW":{"path":"M497.0,288.25l0.71,1.01l-0.11,1.09l-1.63,0.03l-1.04,1.39l-0.83,-0.11l0.51,-1.2l0.08,-1.34l0.42,-0.41l0.7,0.14l1.19,-0.61Z","name":"Rwanda"},"RS":{"path":"M469.4,163.99l0.42,-0.5l-0.01,-0.52l-1.15,-1.63l1.43,-0.62l1.33,0.12l1.17,1.06l0.46,1.13l1.34,0.64l0.35,1.35l1.46,0.9l0.76,-0.29l0.2,0.69l-0.48,0.78l0.22,1.12l1.05,1.22l-0.77,0.8l-0.37,1.52l-1.21,0.08l0.24,-0.64l-0.39,-0.54l-2.08,-1.64l-0.9,0.05l-0.48,0.94l-2.12,-1.37l0.53,-1.6l-1.11,-1.37l0.51,-1.1l-0.41,-0.57Z","name":"Serbia"},"LT":{"path":"M486.93,129.3l0.17,1.12l-1.81,0.98l-0.72,2.02l-2.47,1.18l-2.1,-0.02l-0.73,-1.05l-1.06,-0.3l-0.09,-1.87l-3.56,-1.13l-0.43,-2.36l2.48,-0.94l4.12,0.22l2.25,-0.31l0.52,0.69l1.24,0.21l2.19,1.56Z","name":"Lithuania"},"LU":{"path":"M436.08,149.45l-0.48,-0.07l0.3,-1.28l0.27,0.4l-0.09,0.96Z","name":"Luxembourg"},"LR":{"path":"M399.36,265.97l0.18,1.54l-0.48,0.99l0.08,0.47l2.47,1.8l-0.33,2.8l-2.65,-1.13l-5.78,-4.61l0.58,-1.32l2.1,-2.33l0.86,-0.22l0.77,1.14l-0.14,0.85l0.59,0.87l1.0,0.14l0.76,-0.99Z","name":"Liberia"},"RO":{"path":"M487.53,154.23l0.6,0.24l2.87,3.98l-0.17,2.69l0.45,1.42l1.32,0.81l1.35,-0.42l0.76,0.36l0.02,0.31l-0.83,0.45l-0.59,-0.22l-0.54,0.3l-0.62,3.3l-1.0,-0.22l-2.07,-1.13l-2.95,0.71l-1.25,0.76l-3.51,-0.15l-1.89,-0.47l-0.87,0.16l-0.82,-1.3l0.29,-0.26l-0.06,-0.64l-1.09,-0.34l-0.56,0.5l-1.05,-0.64l-0.39,-1.39l-1.36,-0.65l-0.35,-1.0l-0.83,-0.75l1.54,-0.54l2.66,-4.21l2.4,-1.24l2.96,0.34l1.48,0.73l0.79,-0.45l1.78,-0.3l0.75,-0.74l0.79,0.0Z","name":"Romania"},"GW":{"path":"M386.23,253.6l-0.29,0.84l0.15,0.6l-2.21,0.59l-0.86,0.96l-1.04,-0.83l-1.09,-0.23l-0.54,-1.06l-0.66,-0.49l2.41,-0.48l4.13,0.1Z","name":"Guinea-Bissau"},"GT":{"path":"M195.08,249.77l-2.48,-0.37l-1.03,-0.45l-1.14,-0.89l0.3,-0.99l-0.24,-0.68l0.96,-1.66l2.98,-0.01l0.4,-0.37l-0.19,-1.28l-1.67,-1.4l0.51,-0.4l0.0,-1.05l3.85,0.02l-0.21,4.53l0.4,0.43l1.46,0.38l-1.48,0.98l-0.35,0.7l0.12,0.57l-2.2,1.96Z","name":"Guatemala"},"GR":{"path":"M487.07,174.59l-0.59,1.43l-0.37,0.21l-2.84,-0.35l-3.03,0.77l-0.18,0.68l1.28,1.23l-0.61,0.23l-1.14,0.0l-1.2,-1.39l-0.63,0.03l-0.53,1.01l0.56,1.76l1.03,1.19l-0.56,0.38l-0.05,0.62l2.52,2.12l0.02,0.87l-1.78,-0.59l-0.48,0.56l0.5,1.0l-1.07,0.2l-0.3,0.53l0.75,2.01l-0.98,0.02l-1.84,-1.12l-1.37,-4.2l-2.21,-2.95l-0.11,-0.56l1.04,-1.28l0.2,-0.95l0.85,-0.66l0.03,-0.46l1.32,-0.21l1.01,-0.64l1.22,0.05l0.65,-0.56l2.26,-0.0l1.82,-0.75l1.85,1.0l2.28,-0.28l0.35,-0.39l0.01,-0.77l0.34,0.22ZM480.49,192.16l0.58,0.4l-0.68,-0.12l0.11,-0.28ZM482.52,192.82l2.51,0.06l0.24,0.32l-1.99,0.13l-0.77,-0.51Z","name":"Greece"},"GQ":{"path":"M448.79,279.62l0.02,2.22l-4.09,0.0l0.69,-2.27l3.38,0.05Z","name":"Eq. Guinea"},"GY":{"path":"M277.42,270.07l-0.32,1.83l-1.32,0.57l-0.23,0.46l-0.28,2.0l1.11,1.82l0.83,0.19l0.32,1.25l1.13,1.62l-1.21,-0.19l-1.08,0.71l-1.77,0.5l-0.44,0.46l-0.86,-0.09l-1.32,-1.01l-0.77,-2.27l0.36,-1.9l0.68,-1.23l-0.57,-1.17l-0.74,-0.43l0.12,-1.16l-0.9,-0.69l-1.1,0.09l-1.31,-1.48l0.53,-0.72l-0.04,-0.84l1.99,-0.86l0.05,-0.59l-0.71,-0.78l0.14,-0.57l1.66,-1.24l1.36,0.77l1.41,1.49l0.06,1.15l0.37,0.38l0.8,0.05l2.06,1.86Z","name":"Guyana"},"GE":{"path":"M521.71,168.93l5.29,0.89l4.07,2.01l1.41,-0.44l2.07,0.56l0.68,1.1l1.07,0.55l-0.12,0.59l0.98,1.29l-1.01,-0.13l-1.81,-0.83l-0.94,0.47l-3.23,0.43l-2.29,-1.39l-2.33,0.05l0.21,-0.97l-0.76,-2.26l-1.45,-1.12l-1.43,-0.39l-0.41,-0.42Z","name":"Georgia"},"GB":{"path":"M412.61,118.72l-2.19,3.22l-0.0,0.45l5.13,-0.3l-0.53,2.37l-2.2,3.12l0.29,0.63l2.37,0.21l2.33,4.3l1.76,0.69l2.2,5.12l2.94,0.77l-0.23,1.62l-1.15,0.88l-0.1,0.52l0.82,1.42l-1.86,1.43l-3.3,-0.02l-4.12,0.87l-1.04,-0.58l-0.47,0.06l-1.51,1.41l-2.12,-0.34l-1.86,1.18l-0.6,-0.29l3.19,-3.0l2.16,-0.69l0.28,-0.41l-0.34,-0.36l-3.73,-0.53l-0.4,-0.76l2.2,-0.87l0.17,-0.61l-1.26,-1.67l0.36,-1.7l3.38,0.28l0.43,-0.33l0.37,-1.99l-1.79,-2.49l-3.11,-0.72l-0.38,-0.59l0.79,-1.35l-0.04,-0.46l-0.82,-0.97l-0.61,0.01l-0.68,0.84l-0.1,-2.34l-1.23,-1.88l0.85,-3.47l1.77,-2.68l1.85,0.26l2.17,-0.22ZM406.26,132.86l-1.01,1.77l-1.57,-0.59l-1.16,0.01l0.37,-1.54l-0.39,-1.39l1.45,-0.1l2.3,1.84Z","name":"United Kingdom"},"GA":{"path":"M453.24,279.52l-0.08,0.98l0.7,1.29l2.36,0.24l-0.98,2.63l1.18,1.79l0.25,1.78l-0.29,1.52l-0.6,0.93l-1.84,-0.09l-1.23,-1.11l-0.66,0.23l-0.15,0.84l-1.42,0.26l-1.02,0.7l-0.11,0.52l0.77,1.35l-1.34,0.97l-3.94,-4.3l-1.44,-2.45l0.06,-0.6l0.54,-0.81l1.05,-3.46l4.17,-0.07l0.4,-0.4l-0.02,-2.66l2.39,0.21l1.25,-0.27Z","name":"Gabon"},"GN":{"path":"M391.8,254.11l0.47,0.8l1.11,-0.32l0.98,0.7l1.07,0.2l2.26,-1.22l0.64,0.44l1.13,1.56l-0.48,1.4l0.8,0.3l-0.08,0.48l0.46,0.68l-0.35,1.36l1.05,2.61l-1.0,0.69l0.03,1.41l-0.72,-0.06l-1.08,1.0l-0.24,-0.27l0.07,-1.11l-1.05,-1.54l-1.79,0.21l-0.35,-2.01l-1.6,-2.18l-2.0,-0.0l-1.31,0.54l-1.95,2.18l-1.86,-2.19l-1.2,-0.78l-0.3,-1.11l-0.8,-0.85l0.65,-0.72l0.81,-0.03l1.64,-0.8l0.23,-1.87l2.67,0.64l0.89,-0.3l1.21,0.15Z","name":"Guinea"},"GM":{"path":"M379.31,251.39l0.1,-0.35l2.43,-0.07l0.74,-0.61l0.51,-0.03l0.77,0.49l-1.03,-0.3l-1.87,0.9l-1.65,-0.04ZM384.03,250.91l0.91,0.05l0.75,-0.24l-0.59,0.31l-1.08,-0.13Z","name":"Gambia"},"GL":{"path":"M353.02,1.2l14.69,4.67l-3.68,1.89l-22.97,0.86l-0.36,0.27l0.12,0.43l1.55,1.18l8.79,-0.66l7.48,2.07l4.86,-1.77l1.66,1.73l-2.53,3.19l-0.01,0.48l0.46,0.15l6.35,-2.2l12.06,-2.31l7.24,1.13l1.09,1.99l-9.79,4.01l-1.44,1.32l-7.87,0.98l-0.35,0.41l0.38,0.38l5.07,0.24l-2.53,3.58l-2.07,3.81l0.08,6.05l2.57,3.11l-3.22,0.2l-4.12,1.66l-0.05,0.72l4.45,2.65l0.51,3.75l-2.3,0.4l-0.25,0.64l2.79,3.69l-4.82,0.31l-0.36,0.29l0.16,0.44l2.62,1.8l-0.59,1.22l-3.3,0.7l-3.45,0.01l-0.29,0.68l3.03,3.12l0.02,1.34l-4.4,-1.73l-1.72,1.35l0.15,0.66l3.31,1.15l3.13,2.71l0.81,3.16l-3.85,0.75l-4.89,-4.26l-0.47,-0.03l-0.17,0.44l0.79,2.86l-2.71,2.21l-0.13,0.44l0.37,0.27l8.73,0.34l-12.32,6.64l-7.24,1.48l-2.94,0.08l-2.69,1.75l-3.43,4.41l-5.24,2.84l-1.73,0.18l-7.12,2.1l-2.15,2.52l-0.13,2.99l-1.19,2.45l-4.01,3.09l-0.14,0.44l0.97,2.9l-2.28,6.48l-3.1,0.2l-3.83,-3.07l-4.86,-0.02l-2.25,-1.93l-1.7,-3.79l-4.3,-4.84l-1.21,-2.49l-0.44,-3.8l-3.32,-3.63l0.84,-2.86l-1.56,-1.7l2.28,-4.6l3.83,-1.74l1.03,-1.96l0.52,-3.47l-0.59,-0.41l-4.17,2.21l-2.07,0.58l-2.72,-1.28l-0.15,-2.71l0.85,-2.09l2.01,-0.06l5.06,1.2l0.46,-0.23l-0.14,-0.49l-6.54,-4.47l-2.67,0.55l-1.58,-0.86l2.56,-4.01l-0.03,-0.48l-1.5,-1.74l-4.98,-8.5l-3.13,-1.96l0.03,-1.88l-0.24,-0.37l-6.85,-3.02l-5.36,-0.38l-12.7,0.58l-2.78,-1.57l-3.66,-2.77l5.73,-1.45l5.0,-0.28l0.38,-0.38l-0.35,-0.41l-10.67,-1.38l-5.3,-2.06l0.25,-1.54l18.41,-5.26l1.22,-2.27l-0.25,-0.55l-6.14,-1.86l1.68,-1.77l8.55,-4.03l3.59,-0.63l0.3,-0.54l-0.88,-2.27l5.47,-1.47l7.65,-0.95l7.55,-0.05l3.04,1.85l6.48,-3.27l5.81,2.22l3.56,0.5l5.16,1.94l0.5,-0.21l-0.17,-0.52l-5.71,-3.13l0.28,-2.13l8.12,-3.6l8.7,0.28l3.35,-2.34l8.71,-0.6l19.93,0.8Z","name":"Greenland"},"KW":{"path":"M540.81,207.91l0.37,0.86l-0.17,0.76l0.6,1.53l-0.95,0.04l-0.82,-1.28l-1.57,-0.18l1.31,-1.88l1.22,0.17Z","name":"Kuwait"},"GH":{"path":"M420.53,257.51l-0.01,0.72l0.96,1.2l0.24,3.73l0.59,0.95l-0.51,2.1l0.19,1.41l1.02,2.21l-6.97,2.84l-1.8,-0.57l0.04,-0.89l-1.02,-2.04l0.61,-2.65l1.07,-2.32l-0.96,-6.47l5.01,0.07l0.94,-0.39l0.61,0.11Z","name":"Ghana"},"OM":{"path":"M568.09,230.93l-0.91,1.67l-1.22,0.04l-0.6,0.76l-0.41,1.51l0.27,1.58l-1.16,0.05l-1.56,0.97l-0.76,1.74l-1.62,0.05l-0.98,0.65l-0.17,1.15l-0.89,0.52l-1.49,-0.18l-2.4,0.94l-2.47,-5.4l7.35,-2.71l1.67,-5.23l-1.12,-2.09l0.05,-0.83l0.67,-1.0l0.07,-1.05l0.9,-0.42l-0.05,-2.07l0.7,-0.01l1.0,1.62l1.51,1.08l3.3,0.84l1.73,2.29l0.81,0.37l-1.23,2.35l-0.99,0.79Z","name":"Oman"},"_1":{"path":"M531.15,258.94l1.51,0.12l5.13,-0.95l5.3,-1.48l-0.01,4.4l-2.67,3.39l-1.85,0.01l-8.04,-2.94l-2.55,-3.17l1.12,-1.71l2.04,2.34Z","name":"Somaliland"},"_0":{"path":"M472.77,172.64l-1.08,-1.29l0.96,-0.77l0.29,-0.83l1.98,1.64l-0.36,0.67l-1.79,0.58Z","name":"Kosovo"},"JO":{"path":"M518.64,201.38l-5.14,1.56l-0.19,0.65l2.16,2.39l-0.89,1.14l-1.71,0.34l-1.71,1.8l-2.34,-0.37l1.21,-4.32l0.56,-4.07l2.8,0.94l4.46,-2.71l0.79,2.66Z","name":"Jordan"},"HR":{"path":"M455.59,162.84l1.09,0.07l-0.82,0.94l-0.27,-1.01ZM456.96,162.92l0.62,-0.41l1.73,0.45l0.42,-0.4l-0.01,-0.59l0.86,-0.52l0.2,-1.05l1.63,-0.68l2.57,1.68l2.07,0.6l0.87,-0.31l1.05,1.57l-0.52,0.63l-1.05,-0.56l-1.68,0.04l-2.1,-0.5l-1.29,0.06l-0.57,0.49l-0.59,-0.47l-0.62,0.16l-0.46,1.7l1.79,2.42l2.79,2.75l-1.18,-0.87l-2.21,-0.87l-1.67,-1.78l0.13,-0.63l-1.05,-1.19l-0.32,-1.27l-1.42,-0.43Z","name":"Croatia"},"HT":{"path":"M237.05,238.38l-1.16,0.43l-0.91,-0.55l0.05,-0.2l2.02,0.31ZM237.53,238.43l1.06,0.12l-0.05,0.01l-1.01,-0.12ZM239.25,238.45l0.79,-0.51l0.06,-0.62l-1.02,-1.0l0.02,-0.82l-0.3,-0.4l-0.93,-0.32l3.16,0.45l0.02,1.84l-0.48,0.34l-0.08,0.58l0.54,0.72l-1.78,-0.26Z","name":"Haiti"},"HU":{"path":"M462.08,157.89l0.65,-1.59l-0.09,-0.44l0.64,-0.0l0.39,-0.34l0.1,-0.69l1.75,0.87l2.32,-0.37l0.43,-0.66l3.49,-0.78l0.69,-0.78l0.57,-0.14l2.57,0.93l0.67,-0.23l1.03,0.65l0.08,0.37l-1.42,0.71l-2.59,4.14l-1.8,0.53l-1.68,-0.1l-2.74,1.23l-1.85,-0.54l-2.54,-1.66l-0.66,-1.1Z","name":"Hungary"},"HN":{"path":"M199.6,249.52l-1.7,-1.21l0.06,-0.94l3.04,-2.14l2.37,0.28l1.27,-0.09l1.1,-0.52l1.3,0.28l1.14,-0.25l1.38,0.37l2.23,1.37l-2.36,0.93l-1.23,-0.39l-0.88,1.3l-1.28,0.99l-0.98,-0.22l-0.42,0.52l-0.96,0.05l-0.36,0.41l0.04,0.88l-0.52,0.6l-0.3,0.04l-0.3,-0.55l-0.66,-0.31l0.11,-0.67l-0.48,-0.65l-0.87,-0.26l-0.73,0.2Z","name":"Honduras"},"PR":{"path":"M256.17,238.73l-0.26,0.27l-2.83,0.05l-0.07,-0.55l1.95,-0.1l1.22,0.33Z","name":"Puerto Rico"},"PS":{"path":"M509.21,203.07l0.1,-0.06l-0.02,0.03l-0.09,0.03ZM509.36,202.91l-0.02,-0.63l-0.33,-0.16l0.31,-1.09l0.24,0.1l-0.2,1.78Z","name":"Palestine"},"PT":{"path":"M401.84,187.38l-0.64,0.47l-1.13,-0.35l-0.91,0.17l0.28,-1.78l-0.24,-1.78l-1.25,-0.56l-0.45,-0.84l0.17,-1.66l1.01,-1.18l0.69,-2.92l-0.04,-1.39l-0.59,-1.9l1.3,-0.85l0.84,1.35l3.1,-0.3l0.46,0.99l-1.05,0.94l-0.03,2.16l-0.41,0.57l-0.08,1.1l-0.79,0.18l-0.26,0.59l0.91,1.6l-0.63,1.75l0.76,1.09l-1.1,1.52l0.07,1.05Z","name":"Portugal"},"PY":{"path":"M274.9,336.12l0.74,1.52l-0.16,3.45l0.32,0.41l2.64,0.5l1.11,-0.47l1.4,0.59l0.36,0.6l0.53,3.42l1.27,0.4l0.98,-0.38l0.51,0.27l-0.0,1.18l-1.21,5.32l-2.09,1.9l-1.8,0.4l-4.71,-0.98l2.2,-3.63l-0.32,-1.5l-2.78,-1.28l-3.03,-1.94l-2.07,-0.44l-4.34,-4.06l0.91,-2.9l0.08,-1.42l1.07,-2.04l4.13,-0.72l2.18,0.03l2.05,1.17l0.03,0.59Z","name":"Paraguay"},"PA":{"path":"M213.8,263.68l0.26,-1.52l-0.36,-0.26l-0.01,-0.49l0.44,-0.1l0.93,1.4l1.26,0.03l0.77,0.49l1.38,-0.23l2.51,-1.11l0.86,-0.72l3.45,0.85l1.4,1.18l0.41,1.74l-0.21,0.34l-0.53,-0.12l-0.47,0.29l-0.16,0.6l-0.68,-1.28l0.45,-0.49l-0.19,-0.66l-0.47,-0.13l-0.54,-0.84l-1.5,-0.75l-1.1,0.16l-0.75,0.99l-1.62,0.84l-0.18,0.96l0.85,0.97l-0.58,0.45l-0.69,0.08l-0.34,-1.18l-1.27,0.03l-0.71,-1.05l-2.59,-0.46Z","name":"Panama"},"PG":{"path":"M808.58,298.86l2.54,2.56l-0.13,0.26l-0.33,0.12l-0.87,-0.78l-1.22,-2.16ZM801.41,293.04l0.5,0.29l0.26,0.27l-0.49,-0.35l-0.27,-0.21ZM803.17,294.58l0.59,0.5l0.08,1.06l-0.29,-0.91l-0.38,-0.65ZM796.68,298.41l0.52,0.75l1.43,-0.19l2.27,-1.81l-0.01,-1.43l1.12,0.16l-0.04,1.1l-0.7,1.28l-1.12,0.18l-0.62,0.79l-2.46,1.11l-1.17,-0.0l-3.08,-1.25l3.41,0.0l0.45,-0.68ZM789.15,303.55l2.31,1.8l1.59,2.61l1.34,0.13l-0.06,0.66l0.31,0.43l1.06,0.24l0.06,0.65l2.25,1.05l-1.22,0.13l-0.72,-0.63l-4.56,-0.65l-3.22,-2.87l-1.49,-2.34l-3.27,-1.1l-2.38,0.72l-1.59,0.86l-0.2,0.42l0.27,1.55l-1.55,0.68l-1.36,-0.4l-2.21,-0.09l-0.08,-15.41l8.39,2.93l2.95,2.4l0.6,1.64l4.02,1.49l0.31,0.68l-1.76,0.21l-0.33,0.52l0.55,1.68Z","name":"Papua New Guinea"},"PE":{"path":"M244.96,295.21l-1.26,-0.07l-0.57,0.42l-1.93,0.45l-2.98,1.75l-0.36,1.36l-0.58,0.8l0.12,1.37l-1.24,0.59l-0.22,1.22l-0.62,0.84l1.04,2.27l1.28,1.44l-0.41,0.84l0.32,0.57l1.48,0.13l1.16,1.37l2.21,0.07l1.63,-1.08l-0.13,3.02l0.3,0.4l1.14,0.29l1.31,-0.34l1.9,3.59l-0.48,0.85l-0.17,3.85l-0.94,1.59l0.35,0.75l-0.47,1.07l0.98,1.97l-2.1,3.82l-0.98,0.5l-2.17,-1.28l-0.39,-1.16l-4.95,-2.58l-4.46,-2.79l-1.84,-1.51l-0.91,-1.84l0.3,-0.96l-2.11,-3.33l-4.82,-9.68l-1.04,-1.2l-0.87,-1.94l-3.4,-2.48l0.58,-1.18l-1.13,-2.23l0.66,-1.49l1.45,-1.15l-0.6,0.98l0.07,0.92l0.47,0.36l1.74,0.03l0.97,1.17l0.54,0.07l1.42,-1.03l0.6,-1.84l1.42,-2.02l3.04,-1.04l2.73,-2.62l0.86,-1.74l-0.1,-1.87l1.44,1.02l0.9,1.25l1.06,0.59l1.7,2.73l1.86,0.31l1.45,-0.61l0.96,0.39l1.36,-0.19l1.45,0.89l-1.4,2.21l0.31,0.61l0.59,0.05l0.47,0.5Z","name":"Peru"},"PK":{"path":"M615.09,192.34l-1.83,1.81l-2.6,0.39l-3.73,-0.68l-1.58,1.33l-0.09,0.42l1.77,4.39l1.7,1.23l-1.69,1.27l-0.12,2.14l-2.33,2.64l-1.6,2.8l-2.46,2.67l-3.03,-0.07l-2.76,2.83l0.05,0.6l1.5,1.11l0.26,1.9l1.44,1.5l0.37,1.68l-5.01,-0.01l-1.78,1.7l-1.42,-0.52l-0.76,-1.87l-2.27,-2.15l-11.61,0.86l0.71,-2.34l3.43,-1.32l0.25,-0.44l-0.21,-1.24l-1.2,-0.65l-0.28,-2.46l-2.29,-1.14l-1.28,-1.94l2.82,0.94l2.62,-0.38l1.42,0.33l0.76,-0.56l1.71,0.19l3.25,-1.14l0.27,-0.36l0.08,-2.19l1.18,-1.32l1.68,0.0l0.58,-0.82l1.6,-0.3l1.19,0.16l0.98,-0.78l0.02,-1.88l0.93,-1.47l1.48,-0.66l0.19,-0.55l-0.66,-1.25l2.04,-0.11l0.69,-1.01l-0.02,-1.16l1.11,-1.06l-0.17,-1.78l-0.49,-1.03l1.15,-0.98l5.42,-0.91l2.6,-0.82l1.6,1.16l0.97,2.34l3.45,0.97Z","name":"Pakistan"},"PH":{"path":"M737.01,263.84l0.39,2.97l-0.44,1.18l-0.55,-1.53l-0.67,-0.14l-1.17,1.28l0.65,2.09l-0.42,0.69l-2.48,-1.23l-0.57,-1.49l0.65,-1.03l-0.1,-0.54l-1.59,-1.19l-0.56,0.08l-0.65,0.87l-1.23,0.0l-1.58,0.97l0.83,-1.8l2.56,-1.42l0.65,0.84l0.45,0.13l1.9,-0.69l0.56,-1.11l1.5,-0.06l0.38,-0.43l-0.09,-1.19l1.21,0.71l0.36,2.02ZM733.59,256.58l0.05,0.75l0.08,0.26l-0.8,-0.42l-0.18,-0.71l0.85,0.12ZM734.08,256.1l-0.12,-1.12l-1.0,-1.27l1.36,0.03l0.53,0.73l0.51,2.04l-1.27,-0.4ZM733.76,257.68l0.38,0.98l-0.32,0.15l-0.07,-1.13ZM724.65,238.43l1.46,0.7l0.72,-0.31l-0.32,1.17l0.79,1.71l-0.57,1.84l-1.53,1.04l-0.39,2.25l0.56,2.04l1.63,0.57l1.16,-0.27l2.71,1.23l-0.19,1.08l0.76,0.84l-0.08,0.36l-1.4,-0.9l-0.88,-1.27l-0.66,0.0l-0.38,0.55l-1.6,-1.31l-2.15,0.36l-0.87,-0.39l0.07,-0.61l0.66,-0.55l-0.01,-0.62l-0.75,-0.59l-0.72,0.44l-0.74,-0.87l-0.39,-2.49l0.32,0.27l0.66,-0.28l0.26,-3.97l0.7,-2.02l1.14,0.0ZM731.03,258.87l-0.88,0.85l-1.19,1.94l-1.05,-1.19l0.93,-1.1l0.32,-1.47l0.52,-0.06l-0.27,1.15l0.22,0.45l0.49,-0.12l1.0,-1.32l-0.08,0.85ZM726.83,255.78l0.83,0.38l1.17,-0.0l-0.02,0.48l-2.0,1.4l0.03,-2.26ZM724.81,252.09l-0.38,1.27l-1.42,-1.95l1.2,0.05l0.6,0.63ZM716.55,261.82l1.1,-0.95l0.03,-0.03l-0.28,0.36l-0.85,0.61ZM719.22,259.06l0.04,-0.06l0.8,-1.53l0.16,0.75l-1.0,0.84Z","name":"Philippines"},"PL":{"path":"M468.44,149.42l-1.11,-1.54l-1.86,-0.33l-0.48,-1.05l-1.72,-0.37l-0.65,0.69l-0.72,-0.36l0.11,-0.61l-0.33,-0.46l-1.75,-0.27l-1.04,-0.93l-0.94,-1.94l0.16,-1.22l-0.62,-1.8l-0.78,-1.07l0.57,-1.04l-0.48,-1.43l1.41,-0.83l6.91,-2.71l2.14,0.5l0.52,0.91l5.51,0.44l4.55,-0.05l1.07,0.31l0.48,0.84l0.15,1.58l0.65,1.2l-0.01,0.99l-1.27,0.58l-0.19,0.54l0.73,1.48l0.08,1.55l1.2,2.76l-0.17,0.58l-1.23,0.44l-2.27,2.72l0.18,0.95l-1.97,-1.03l-1.98,0.4l-1.36,-0.28l-1.24,0.58l-1.07,-0.97l-1.16,0.24Z","name":"Poland"},"-99":{"path":"M504.91,192.87l0.34,0.01l0.27,-0.07l-0.29,0.26l-0.31,-0.2Z","name":"N. Cyprus"},"ZM":{"path":"M481.47,313.3l0.39,0.31l2.52,0.14l0.99,1.17l2.01,0.35l1.4,-0.64l0.69,1.17l1.78,0.33l1.84,2.35l2.23,0.18l0.4,-0.43l-0.21,-2.74l-0.62,-0.3l-0.48,0.32l-1.98,-1.17l0.72,-5.29l-0.51,-1.18l0.57,-1.3l3.68,-0.62l0.26,0.63l1.21,0.63l0.9,-0.22l2.16,0.67l1.33,0.71l1.07,1.02l0.56,1.87l-0.88,2.7l0.43,2.09l-0.73,0.87l-0.76,2.37l0.59,0.68l-6.6,1.83l-0.29,0.44l0.19,1.45l-1.68,0.35l-1.43,1.02l-0.38,0.87l-0.87,0.26l-3.48,3.69l-4.16,-0.53l-1.52,-1.0l-1.77,-0.13l-1.83,0.52l-3.04,-3.4l0.11,-7.59l4.82,0.03l0.39,-0.49l-0.18,-0.76l0.33,-0.83l-0.4,-1.36l0.24,-1.05Z","name":"Zambia"},"EH":{"path":"M384.42,230.28l0.25,-0.79l1.06,-1.29l0.8,-3.51l3.38,-2.78l0.7,-1.81l0.06,4.84l-1.98,0.2l-0.94,1.59l0.39,3.56l-3.7,-0.01ZM392.01,218.1l0.7,-1.8l1.77,-0.24l2.09,0.34l0.95,-0.62l1.28,-0.07l-0.0,2.51l-6.79,-0.12Z","name":"W. Sahara"},"EE":{"path":"M485.71,115.04l2.64,0.6l2.56,0.11l-1.6,1.91l0.61,3.54l-0.81,0.87l-1.78,-0.01l-3.22,-1.76l-1.8,0.45l0.21,-1.53l-0.58,-0.41l-0.69,0.34l-1.26,-1.03l-0.17,-1.63l2.83,-0.92l3.05,-0.52Z","name":"Estonia"},"EG":{"path":"M492.06,205.03l1.46,0.42l2.95,-1.64l2.04,-0.21l1.53,0.3l0.59,1.19l0.69,0.04l0.41,-0.64l1.81,0.58l1.95,0.16l1.04,-0.51l1.42,4.08l-2.03,4.54l-1.66,-1.77l-1.76,-3.85l-0.64,-0.12l-0.36,0.67l1.04,2.88l3.44,6.95l1.78,3.04l2.03,2.65l-0.36,0.53l0.23,2.01l2.7,2.19l-28.41,0.0l0.0,-18.96l-0.73,-2.2l0.59,-1.56l-0.32,-1.26l0.68,-0.99l3.06,-0.04l4.82,1.52Z","name":"Egypt"},"ZA":{"path":"M467.14,373.21l-0.13,-1.96l-0.68,-1.56l0.7,-0.68l-0.13,-2.33l-4.56,-8.19l0.77,-0.86l0.6,0.45l0.69,1.31l2.83,0.72l1.5,-0.26l2.24,-1.39l0.19,-9.55l1.35,2.3l-0.21,1.5l0.61,1.2l0.4,0.19l1.79,-0.27l2.6,-2.07l0.69,-1.32l0.96,-0.48l2.19,1.04l2.04,0.13l1.77,-0.65l0.85,-2.12l1.38,-0.33l1.59,-2.76l2.15,-1.89l3.41,-1.87l2.0,0.45l1.02,-0.28l0.99,0.2l1.75,5.29l-0.38,3.25l-0.81,-0.23l-1.0,0.46l-0.87,1.68l-0.05,1.16l1.97,1.84l1.47,-0.29l0.69,-1.18l1.09,0.01l-0.76,3.69l-0.58,1.09l-2.2,1.79l-3.17,4.76l-2.8,2.83l-3.57,2.88l-2.53,1.05l-1.22,0.14l-0.51,0.7l-1.18,-0.32l-1.39,0.5l-2.59,-0.52l-1.61,0.33l-1.18,-0.11l-2.55,1.1l-2.1,0.44l-1.6,1.07l-0.85,0.05l-0.93,-0.89l-0.93,-0.15l-0.97,-1.13l-0.25,0.05ZM491.45,364.19l0.62,-0.93l1.48,-0.59l1.18,-2.19l-0.07,-0.49l-1.99,-1.69l-1.66,0.56l-1.43,1.14l-1.34,1.73l0.02,0.51l1.88,2.11l1.31,-0.16Z","name":"South Africa"},"EC":{"path":"M231.86,285.53l0.29,1.59l-0.69,1.45l-2.61,2.51l-3.13,1.11l-1.53,2.18l-0.49,1.68l-1.0,0.73l-1.02,-1.11l-1.78,-0.16l0.67,-1.15l-0.24,-0.86l1.25,-2.13l-0.54,-1.09l-0.67,-0.08l-0.72,0.87l-0.87,-0.64l0.35,-0.69l-0.36,-1.96l0.81,-0.51l0.45,-1.51l0.92,-1.57l-0.07,-0.97l2.65,-1.33l2.75,1.35l0.77,1.05l2.12,0.35l0.76,-0.32l1.96,1.21Z","name":"Ecuador"},"AL":{"path":"M470.32,171.8l0.74,0.03l0.92,0.89l-0.17,1.95l0.36,1.28l1.01,0.82l-1.82,2.83l-0.19,-0.61l-1.25,-0.89l-0.18,-1.2l0.53,-2.82l-0.54,-1.47l0.6,-0.83Z","name":"Albania"},"AO":{"path":"M461.55,300.03l1.26,3.15l1.94,2.36l2.47,-0.53l1.25,0.32l0.44,-0.18l0.93,-1.92l1.31,-0.08l0.41,-0.44l0.47,-0.0l-0.1,0.41l0.39,0.49l2.65,-0.02l0.03,1.19l0.48,1.01l-0.34,1.52l0.18,1.55l0.83,1.04l-0.13,2.85l0.54,0.39l3.96,-0.41l-0.1,1.79l0.39,1.05l-0.24,1.43l-4.7,-0.03l-0.4,0.39l-0.12,8.13l2.92,3.49l-3.83,0.88l-5.89,-0.36l-1.88,-1.24l-10.47,0.22l-1.3,-1.01l-1.85,-0.16l-2.4,0.77l-0.15,-1.06l0.33,-2.16l1.0,-3.45l1.35,-3.2l2.24,-2.8l0.33,-2.06l-0.13,-1.53l-0.8,-1.08l-1.21,-2.87l0.87,-1.62l-1.27,-4.12l-1.17,-1.53l2.47,-0.63l7.03,0.03ZM451.71,298.87l-0.47,-1.25l1.25,-1.11l0.32,0.3l-0.99,1.03l-0.12,1.03Z","name":"Angola"},"KZ":{"path":"M552.8,172.89l0.46,-1.27l-0.48,-1.05l-2.96,-1.19l-1.06,-2.58l-1.37,-0.87l-0.03,-0.3l1.95,0.23l0.45,-0.38l0.08,-1.96l1.75,-0.41l2.1,0.45l0.48,-0.33l0.45,-3.04l-0.45,-2.09l-0.41,-0.31l-2.42,0.15l-2.36,-0.73l-2.87,1.37l-2.17,0.61l-0.85,-0.34l0.13,-1.61l-1.6,-2.12l-2.02,-0.08l-1.78,-1.82l1.29,-2.18l-0.57,-0.95l1.62,-2.91l2.21,1.63l0.63,-0.27l0.29,-2.22l4.92,-3.43l3.71,-0.08l8.4,3.6l2.92,-1.36l3.77,-0.06l3.11,1.66l0.51,-0.11l0.6,-0.81l3.31,0.13l0.39,-0.25l0.63,-1.57l-0.17,-0.5l-3.5,-1.98l1.87,-1.27l-0.13,-1.03l1.98,-0.72l0.18,-0.62l-1.59,-2.06l0.81,-0.82l9.23,-1.18l1.33,-0.88l6.18,-1.26l2.26,-1.42l4.08,0.68l0.73,3.33l0.51,0.3l2.48,-0.8l2.79,1.02l-0.17,1.56l0.43,0.44l2.55,-0.24l4.89,-2.53l0.03,0.32l3.15,2.61l5.56,8.47l0.65,0.02l1.12,-1.46l3.15,1.74l3.76,-0.78l1.15,0.49l1.14,1.8l1.84,0.76l0.99,1.29l3.35,-0.25l1.02,1.52l-1.6,1.81l-1.93,0.28l-0.34,0.38l-0.11,3.05l-1.13,1.16l-4.75,-1.0l-0.46,0.27l-1.76,5.47l-1.1,0.59l-4.91,1.23l-0.27,0.54l2.1,4.97l-1.37,0.63l-0.23,0.41l0.13,1.13l-0.88,-0.25l-1.42,-1.13l-7.89,-0.4l-0.92,0.31l-3.73,-1.22l-1.42,0.63l-0.53,1.66l-3.72,-0.94l-1.85,0.43l-0.76,1.4l-4.65,2.62l-1.13,2.08l-0.44,0.01l-0.92,-1.4l-2.87,-0.09l-0.45,-2.14l-0.38,-0.32l-0.8,-0.01l0.0,-2.96l-3.0,-2.22l-7.31,0.58l-2.35,-2.68l-6.71,-3.69l-6.45,1.83l-0.29,0.39l0.1,10.85l-0.7,0.08l-1.62,-2.17l-1.83,-0.96l-3.11,0.59l-0.64,0.51Z","name":"Kazakhstan"},"ET":{"path":"M516.04,247.79l1.1,0.84l1.63,-0.45l0.68,0.47l1.63,0.03l2.01,0.94l1.73,1.66l1.64,2.07l-1.52,2.04l0.16,1.72l0.39,0.38l2.05,0.0l-0.36,1.03l2.86,3.58l8.32,3.08l1.31,0.02l-6.32,6.75l-3.1,0.11l-2.36,1.77l-1.47,0.04l-0.86,0.79l-1.38,-0.0l-1.32,-0.81l-2.29,1.05l-0.76,0.98l-3.29,-0.41l-3.07,-2.07l-1.8,-0.07l-0.62,-0.6l0.0,-1.24l-0.28,-0.38l-1.15,-0.37l-1.4,-2.59l-1.19,-0.68l-0.47,-1.0l-1.27,-1.23l-1.16,-0.22l0.43,-0.72l1.45,-0.28l0.41,-0.95l-0.03,-2.21l0.68,-2.44l1.05,-0.63l1.43,-3.06l1.57,-1.37l1.02,-2.51l0.35,-1.88l2.52,0.46l0.44,-0.24l0.58,-1.43Z","name":"Ethiopia"},"ZW":{"path":"M498.91,341.09l-1.11,-0.22l-0.92,0.28l-2.09,-0.44l-1.5,-1.11l-1.89,-0.43l-0.62,-1.4l-0.01,-0.84l-0.3,-0.38l-0.97,-0.25l-2.71,-2.74l-1.92,-3.32l3.83,0.45l3.73,-3.82l1.08,-0.44l0.26,-0.77l1.25,-0.9l1.41,-0.26l0.5,0.89l1.99,-0.05l1.72,1.17l1.11,0.17l1.05,0.66l0.01,2.99l-0.59,3.76l0.38,0.86l-0.23,1.23l-0.39,0.35l-0.63,1.81l-2.43,2.75Z","name":"Zimbabwe"},"ES":{"path":"M416.0,169.21l1.07,1.17l4.61,1.38l1.06,-0.57l2.6,1.26l2.71,-0.3l0.09,1.12l-2.14,1.8l-3.11,0.61l-0.31,0.31l-0.2,0.89l-1.54,1.69l-0.97,2.4l0.84,1.74l-1.32,1.27l-0.48,1.68l-1.88,0.65l-1.66,2.07l-5.36,-0.01l-1.79,1.08l-0.89,0.98l-0.88,-0.17l-0.79,-0.82l-0.68,-1.59l-2.37,-0.63l-0.11,-0.5l1.21,-1.82l-0.77,-1.13l0.61,-1.68l-0.76,-1.62l0.87,-0.49l0.09,-1.25l0.42,-0.6l0.03,-2.11l0.99,-0.69l0.13,-0.5l-1.03,-1.73l-1.46,-0.11l-0.61,0.38l-1.06,0.0l-0.52,-1.23l-0.53,-0.21l-1.32,0.67l-0.01,-1.49l-0.75,-0.96l3.03,-1.88l2.99,0.53l3.32,-0.02l2.63,0.51l6.01,-0.06Z","name":"Spain"},"ER":{"path":"M520.38,246.23l3.42,2.43l3.5,3.77l0.84,0.54l-0.95,-0.01l-3.51,-3.89l-2.33,-1.15l-1.73,-0.07l-0.91,-0.51l-1.26,0.51l-1.34,-1.02l-0.61,0.17l-0.66,1.61l-2.35,-0.43l-0.17,-0.67l1.29,-5.29l0.61,-0.61l1.95,-0.53l0.87,-1.01l1.17,2.41l0.68,2.33l1.49,1.43Z","name":"Eritrea"},"ME":{"path":"M468.91,172.53l-1.22,-1.02l0.47,-1.81l0.89,-0.72l2.26,1.51l-0.5,0.57l-0.75,-0.27l-1.14,1.73Z","name":"Montenegro"},"MD":{"path":"M488.41,153.73l1.4,-0.27l1.72,0.93l1.07,0.15l0.85,0.65l-0.14,0.84l0.96,0.85l1.12,2.47l-1.15,-0.07l-0.66,-0.41l-0.52,0.25l-0.09,0.86l-1.08,1.89l-0.27,-0.86l0.25,-1.34l-0.16,-1.6l-3.29,-4.34Z","name":"Moldova"},"MG":{"path":"M545.91,319.14l0.4,3.03l0.62,1.21l-0.21,1.02l-0.57,-0.8l-0.69,-0.01l-0.47,0.76l0.41,2.12l-0.18,0.87l-0.73,0.78l-0.15,2.14l-4.71,15.2l-1.06,2.88l-3.92,1.64l-3.12,-1.49l-0.6,-1.21l-0.19,-2.4l-0.86,-2.05l-0.21,-1.77l0.38,-1.62l1.21,-0.75l0.01,-0.76l1.19,-2.04l0.23,-1.66l-1.06,-2.99l-0.19,-2.21l0.81,-1.33l0.32,-1.46l4.63,-1.22l3.44,-3.0l0.85,-1.4l-0.08,-0.7l0.78,-0.04l1.38,-1.77l0.13,-1.64l0.45,-0.61l1.16,1.69l0.59,1.6Z","name":"Madagascar"},"MA":{"path":"M378.78,230.02l0.06,-0.59l0.92,-0.73l0.82,-1.37l-0.09,-1.04l0.79,-1.7l1.31,-1.58l0.96,-0.59l0.66,-1.55l0.09,-1.47l0.81,-1.48l1.72,-1.07l1.55,-2.69l1.16,-0.96l2.44,-0.39l1.94,-1.82l1.31,-0.78l2.09,-2.28l-0.51,-3.65l1.24,-3.7l1.5,-1.75l4.46,-2.57l2.37,-4.47l1.44,0.01l1.68,1.21l2.32,-0.19l3.47,0.65l0.8,1.54l0.16,1.71l0.86,2.96l0.56,0.59l-0.26,0.61l-3.05,0.44l-1.26,1.05l-1.33,0.22l-0.33,0.37l-0.09,1.78l-2.68,1.0l-1.07,1.42l-4.47,1.13l-4.04,2.01l-0.54,4.64l-1.15,0.06l-0.92,0.61l-1.96,-0.35l-2.42,0.54l-0.74,1.9l-0.86,0.4l-1.14,3.26l-3.53,3.01l-0.8,3.55l-0.96,1.1l-0.29,0.82l-4.95,0.18Z","name":"Morocco"},"UZ":{"path":"M598.64,172.75l-1.63,1.52l0.06,0.64l1.85,1.12l1.97,-0.64l2.21,1.17l-2.52,1.68l-2.59,-0.22l-0.18,-0.41l0.46,-1.23l-0.45,-0.53l-3.35,0.69l-2.1,3.51l-1.87,-0.12l-1.03,1.51l0.22,0.55l1.64,0.62l0.46,1.83l-1.19,2.49l-2.66,-0.53l0.05,-1.36l-0.26,-0.39l-3.3,-1.23l-2.56,-1.4l-4.4,-3.34l-1.34,-3.14l-1.08,-0.6l-2.58,0.13l-0.69,-0.44l-0.47,-2.52l-3.37,-1.6l-0.43,0.05l-2.07,1.72l-2.1,1.01l-0.21,0.47l0.28,1.01l-1.91,0.03l-0.09,-10.5l5.99,-1.7l6.19,3.54l2.71,2.84l7.05,-0.67l2.71,2.01l-0.17,2.81l0.39,0.42l0.9,0.02l0.44,2.14l0.38,0.32l2.94,0.09l0.95,1.42l1.28,-0.24l1.05,-2.04l4.43,-2.5Z","name":"Uzbekistan"},"MM":{"path":"M673.9,230.21l-1.97,1.57l-0.57,0.96l-1.4,0.6l-1.36,1.05l-1.99,0.36l-1.08,2.66l-0.91,0.4l-0.19,0.55l1.21,2.27l2.52,3.43l-0.79,1.91l-0.74,0.41l-0.17,0.52l0.65,1.37l1.61,1.95l0.25,2.58l0.9,2.13l-1.92,3.57l0.68,-2.25l-0.81,-1.74l0.19,-2.65l-1.05,-1.53l-1.24,-6.17l-1.12,-2.26l-0.6,-0.13l-4.34,3.02l-2.39,-0.65l0.77,-2.84l-0.52,-2.61l-1.91,-2.96l0.25,-0.75l-0.29,-0.51l-1.33,-0.3l-1.61,-1.93l-0.1,-1.3l0.82,-0.24l0.04,-1.64l1.02,-0.52l0.21,-0.45l-0.23,-0.95l0.54,-0.96l0.08,-2.22l1.46,0.45l0.47,-0.2l1.12,-2.19l0.16,-1.35l1.33,-2.16l-0.0,-1.52l2.89,-1.66l1.63,0.44l0.5,-0.44l-0.17,-1.4l0.64,-0.36l0.08,-1.04l0.77,-0.11l0.71,1.35l1.06,0.69l-0.03,3.86l-2.38,2.37l-0.3,3.15l0.46,0.43l2.28,-0.38l0.51,2.08l1.47,0.67l-0.6,1.8l0.19,0.48l2.97,1.48l1.64,-0.55l0.02,0.32Z","name":"Myanmar"},"ML":{"path":"M392.61,254.08l-0.19,-2.37l-0.99,-0.87l-0.44,-1.3l-0.09,-1.28l0.81,-0.58l0.35,-1.24l2.37,0.65l1.31,-0.47l0.86,0.15l0.66,-0.56l9.83,-0.04l0.38,-0.28l0.56,-1.8l-0.44,-0.65l-2.35,-21.95l3.27,-0.04l16.7,11.38l0.74,1.31l2.5,1.09l0.02,1.38l0.44,0.39l2.34,-0.21l0.01,5.38l-1.28,1.61l-0.26,1.49l-5.31,0.57l-1.07,0.92l-2.9,0.1l-0.86,-0.48l-1.38,0.36l-2.4,1.08l-0.6,0.87l-1.85,1.09l-0.43,0.7l-0.79,0.39l-1.44,-0.21l-0.81,0.84l-0.34,1.64l-1.91,2.02l-0.06,1.03l-0.67,1.22l0.13,1.16l-0.97,0.39l-0.23,-0.64l-0.52,-0.24l-1.35,0.4l-0.34,0.55l-2.69,-0.28l-0.37,-0.35l-0.02,-0.9l-0.65,-0.35l0.45,-0.64l-0.03,-0.53l-2.12,-2.44l-0.76,-0.01l-2.0,1.16l-0.78,-0.15l-0.8,-0.67l-1.21,0.23Z","name":"Mali"},"MN":{"path":"M676.61,146.48l3.81,1.68l5.67,-1.0l2.37,0.41l2.34,1.5l1.79,1.75l2.29,-0.03l3.12,0.52l2.47,-0.81l3.41,-0.59l3.53,-2.21l1.25,0.29l1.53,1.13l2.27,-0.21l-2.66,5.01l0.64,1.68l0.47,0.21l1.32,-0.38l2.38,0.48l2.02,-1.11l1.76,0.89l2.06,2.02l-0.13,0.53l-1.72,-0.29l-3.77,0.46l-1.88,0.99l-1.76,1.99l-3.71,1.17l-2.45,1.6l-3.83,-0.87l-0.41,0.17l-1.31,1.99l1.04,2.24l-1.52,0.9l-1.74,1.57l-2.79,1.02l-3.78,0.13l-4.05,1.05l-2.77,1.52l-1.16,-0.85l-2.94,0.0l-3.62,-1.79l-2.58,-0.49l-3.4,0.41l-5.12,-0.67l-2.63,0.06l-1.31,-1.6l-1.4,-3.0l-1.48,-0.33l-3.13,-1.94l-6.16,-0.93l-0.71,-1.06l0.86,-3.82l-1.93,-2.71l-3.5,-1.18l-1.95,-1.58l-0.5,-1.72l2.34,-0.52l4.75,-2.8l3.62,-1.47l2.18,0.97l2.46,0.05l1.81,1.53l2.46,0.12l3.95,0.71l2.43,-2.28l0.08,-0.48l-0.9,-1.72l2.24,-2.98l2.62,1.27l4.94,1.17l0.43,2.24Z","name":"Mongolia"},"MK":{"path":"M472.8,173.98l0.49,-0.71l3.57,-0.71l1.0,0.77l0.13,1.45l-0.65,0.53l-1.15,-0.05l-1.12,0.67l-1.39,0.22l-0.79,-0.55l-0.29,-1.03l0.19,-0.6Z","name":"Macedonia"},"MW":{"path":"M505.5,309.31l0.85,1.95l0.15,2.86l-0.69,1.65l0.71,1.8l0.06,1.28l0.49,0.64l0.07,1.06l0.4,0.55l0.8,-0.23l0.55,0.61l0.69,-0.21l0.34,0.6l0.19,2.94l-1.04,0.62l-0.54,1.25l-1.11,-1.08l-0.16,-1.56l0.51,-1.31l-0.32,-1.3l-0.99,-0.65l-0.82,0.12l-2.36,-1.64l0.63,-1.96l0.82,-1.18l-0.46,-2.01l0.9,-2.86l-0.94,-2.51l0.96,0.18l0.29,0.4Z","name":"Malawi"},"MR":{"path":"M407.36,220.66l-2.58,0.03l-0.39,0.44l2.42,22.56l0.36,0.43l-0.39,1.24l-9.75,0.04l-0.56,0.53l-0.91,-0.11l-1.27,0.45l-1.61,-0.66l-0.97,0.03l-0.36,0.29l-0.38,1.35l-0.42,0.23l-2.93,-3.4l-2.96,-1.52l-1.62,-0.03l-1.27,0.54l-1.12,-0.2l-0.65,0.4l-0.08,-0.49l0.68,-1.29l0.31,-2.43l-0.57,-3.91l0.23,-1.21l-0.69,-1.5l-1.15,-1.02l0.25,-0.39l9.58,0.02l0.4,-0.45l-0.46,-3.68l0.47,-1.04l2.12,-0.21l0.36,-0.4l-0.08,-6.4l7.81,0.13l0.41,-0.4l0.01,-3.31l7.76,5.35Z","name":"Mauritania"},"UG":{"path":"M498.55,276.32l0.7,-0.46l1.65,0.5l1.96,-0.57l1.7,0.01l1.45,-0.98l0.91,1.33l1.33,3.95l-2.57,4.03l-1.46,-0.4l-2.54,0.91l-1.37,1.61l-0.01,0.81l-2.42,-0.01l-2.26,1.01l-0.17,-1.59l0.58,-1.04l0.14,-1.94l1.37,-2.28l1.78,-1.58l-0.17,-0.65l-0.72,-0.24l0.13,-2.43Z","name":"Uganda"},"MY":{"path":"M717.47,273.46l-1.39,0.65l-2.12,-0.41l-2.88,-0.0l-0.38,0.28l-0.84,2.75l-0.99,0.96l-1.21,3.29l-1.73,0.45l-2.45,-0.68l-1.39,0.31l-1.33,1.15l-1.59,-0.14l-1.41,0.44l-1.44,-1.19l-0.18,-0.73l1.34,0.53l1.93,-0.47l0.75,-2.22l4.02,-1.03l2.75,-3.21l0.82,0.94l0.64,-0.05l0.4,-0.65l0.96,0.06l0.42,-0.36l0.24,-2.68l1.81,-1.64l1.21,-1.86l0.63,-0.01l1.07,1.05l0.34,1.28l3.44,1.35l-0.06,0.35l-1.37,0.1l-0.35,0.54l0.32,0.88ZM673.68,269.59l0.17,1.09l0.47,0.33l1.65,-0.3l0.87,-0.94l1.61,1.52l0.98,1.56l-0.12,2.81l0.41,2.29l0.95,0.9l0.88,2.44l-1.27,0.12l-5.1,-3.67l-0.34,-1.29l-1.37,-1.59l-0.33,-1.97l-0.88,-1.4l0.25,-1.68l-0.46,-1.05l1.63,0.84Z","name":"Malaysia"},"MX":{"path":"M133.12,200.41l0.2,0.47l9.63,3.33l6.96,-0.02l0.4,-0.4l0.0,-0.74l3.77,0.0l3.55,2.93l1.39,2.83l1.52,1.04l2.08,0.82l0.47,-0.14l1.46,-2.0l1.73,-0.04l1.59,0.98l2.05,3.35l1.47,1.56l1.26,3.14l2.18,1.02l2.26,0.58l-1.18,3.72l-0.42,5.04l1.79,4.89l1.62,1.89l0.61,1.52l1.2,1.42l2.55,0.66l1.37,1.1l7.54,-1.89l1.86,-1.3l1.14,-4.3l4.1,-1.21l3.57,-0.11l0.32,0.3l-0.06,0.94l-1.26,1.45l-0.67,1.71l0.38,0.7l-0.72,2.27l-0.49,-0.3l-1.0,0.08l-1.0,1.39l-0.47,-0.11l-0.53,0.47l-4.26,-0.02l-0.4,0.4l-0.0,1.06l-1.1,0.26l0.1,0.44l1.82,1.44l0.56,0.91l-3.19,0.21l-1.21,2.09l0.24,0.72l-0.2,0.44l-2.24,-2.18l-1.45,-0.93l-2.22,-0.69l-1.52,0.22l-3.07,1.16l-10.55,-3.85l-2.86,-1.96l-3.78,-0.92l-1.08,-1.19l-2.62,-1.43l-1.18,-1.54l-0.38,-0.81l0.66,-0.63l-0.18,-0.53l0.52,-0.76l0.01,-0.91l-2.0,-3.82l-2.21,-2.63l-2.53,-2.09l-1.19,-1.62l-2.2,-1.17l-0.3,-0.43l0.34,-1.48l-0.21,-0.45l-1.23,-0.6l-1.36,-1.2l-0.59,-1.78l-1.54,-0.47l-2.44,-2.55l-0.16,-0.9l-1.33,-2.03l-0.84,-1.99l-0.16,-1.33l-1.81,-1.1l-0.97,0.05l-1.31,-0.7l-0.57,0.22l-0.4,1.12l0.72,3.77l3.51,3.89l0.28,0.78l0.53,0.26l0.41,1.43l1.33,1.73l1.58,1.41l0.8,2.39l1.43,2.41l0.13,1.32l0.37,0.36l1.04,0.08l1.67,2.28l-0.85,0.76l-0.66,-1.51l-1.68,-1.54l-2.91,-1.87l0.06,-1.82l-0.54,-1.68l-2.91,-2.03l-0.55,0.09l-1.95,-1.1l-0.88,-0.94l0.68,-0.08l0.93,-1.01l0.08,-1.78l-1.93,-1.94l-1.46,-0.77l-3.75,-7.56l4.88,-0.42Z","name":"Mexico"},"VU":{"path":"M839.04,322.8l0.22,1.14l-0.44,0.03l-0.2,-1.45l0.42,0.27Z","name":"Vanuatu"},"FR":{"path":"M444.48,172.62l-0.64,1.78l-0.58,-0.31l-0.49,-1.72l0.4,-0.89l1.0,-0.72l0.3,1.85ZM429.64,147.1l1.78,1.58l1.46,-0.13l2.1,1.42l1.35,0.27l1.23,0.83l3.04,0.5l-1.03,1.85l-0.3,2.12l-0.41,0.32l-0.95,-0.24l-0.5,0.43l0.06,0.61l-1.81,1.92l-0.04,1.42l0.55,0.38l0.88,-0.36l0.61,0.97l-0.03,1.0l0.57,0.91l-0.75,1.09l0.65,2.39l1.27,0.57l-0.18,0.82l-2.01,1.53l-4.77,-0.8l-3.82,1.0l-0.53,1.85l-2.49,0.34l-2.71,-1.31l-1.16,0.57l-4.31,-1.29l-0.72,-0.86l1.19,-1.78l0.39,-6.45l-2.58,-3.3l-1.9,-1.66l-3.72,-1.23l-0.19,-1.72l2.81,-0.61l4.12,0.81l0.47,-0.48l-0.6,-2.77l1.94,0.95l5.83,-2.54l0.92,-2.74l1.6,-0.49l0.24,0.78l1.36,0.33l1.05,1.19ZM289.01,278.39l-0.81,0.8l-0.78,0.12l-0.5,-0.66l-0.56,-0.1l-0.91,0.6l-0.46,-0.22l1.09,-2.96l-0.96,-1.77l-0.17,-1.49l1.07,-1.77l2.32,0.75l2.51,2.01l0.3,0.74l-2.14,3.96Z","name":"France"},"FI":{"path":"M492.17,76.39l-0.23,3.5l3.52,2.63l-2.08,2.88l-0.02,0.44l2.8,4.56l-1.59,3.31l2.16,3.24l-0.94,2.39l0.14,0.47l3.44,2.51l-0.77,1.62l-7.52,6.95l-4.5,0.31l-4.38,1.37l-3.8,0.74l-1.44,-1.96l-2.17,-1.11l0.5,-3.66l-1.16,-3.33l1.09,-2.08l2.21,-2.42l5.67,-4.32l1.64,-0.83l0.21,-0.42l-0.46,-2.02l-3.38,-1.89l-0.75,-1.43l-0.22,-6.74l-6.79,-4.8l0.8,-0.62l2.54,2.12l3.46,-0.12l3.0,0.96l2.51,-2.11l1.17,-3.08l3.55,-1.38l2.76,1.53l-0.95,2.79Z","name":"Finland"},"FJ":{"path":"M871.53,326.34l-2.8,1.05l-0.08,-0.23l2.97,-1.21l-0.1,0.39ZM867.58,329.25l0.43,0.37l-0.27,0.88l-1.24,0.28l-1.04,-0.24l-0.14,-0.66l0.63,-0.58l0.92,0.26l0.7,-0.31Z","name":"Fiji"},"FK":{"path":"M274.36,425.85l1.44,1.08l-0.47,0.73l-3.0,0.89l-0.96,-1.0l-0.52,-0.05l-1.83,1.29l-0.73,-0.88l2.46,-1.64l1.93,0.76l1.67,-1.19Z","name":"Falkland Is."},"NI":{"path":"M202.33,252.67l0.81,-0.18l1.03,-1.02l-0.04,-0.88l0.68,-0.0l0.63,-0.54l0.97,0.22l1.53,-1.26l0.58,-0.99l1.17,0.34l2.41,-0.94l0.13,1.32l-0.81,1.94l0.1,2.74l-0.36,0.37l-0.11,1.75l-0.47,0.81l0.18,1.14l-1.73,-0.85l-0.71,0.27l-1.47,-0.6l-0.52,0.16l-4.01,-3.81Z","name":"Nicaragua"},"NL":{"path":"M430.31,143.39l0.6,-0.5l2.13,-4.8l3.2,-1.33l1.74,0.08l0.33,0.8l-0.59,2.92l-0.5,0.99l-1.26,0.0l-0.4,0.45l0.33,2.7l-2.2,-1.78l-2.62,0.58l-0.75,-0.11Z","name":"Netherlands"},"NO":{"path":"M491.44,67.41l6.8,2.89l-2.29,0.86l-0.15,0.65l2.33,2.38l-4.98,1.79l0.84,-2.45l-0.18,-0.48l-3.55,-1.8l-3.89,1.52l-1.42,3.38l-2.12,1.72l-2.64,-1.0l-3.11,0.21l-2.66,-2.22l-0.5,-0.01l-1.41,1.1l-1.44,0.17l-0.35,0.35l-0.32,2.47l-4.32,-0.64l-0.44,0.29l-0.58,2.11l-2.45,0.2l-4.15,7.68l-3.88,5.76l0.78,1.62l-0.64,1.16l-2.24,-0.06l-0.38,0.24l-1.66,3.89l0.15,5.17l1.57,2.04l-0.78,4.16l-2.02,2.48l-0.85,1.63l-1.3,-1.75l-0.58,-0.07l-4.87,4.19l-3.1,0.79l-3.16,-1.7l-0.85,-3.77l-0.77,-8.55l2.14,-2.31l6.55,-3.27l5.02,-4.17l10.63,-13.84l10.98,-8.7l5.35,-1.91l4.34,0.12l3.69,-3.64l4.49,0.19l4.37,-0.89ZM484.55,20.04l4.26,1.75l-3.1,2.55l-7.1,0.65l-7.08,-0.9l-0.37,-1.31l-0.37,-0.29l-3.44,-0.1l-2.08,-2.0l6.87,-1.44l3.9,1.31l2.39,-1.64l6.13,1.4ZM481.69,33.93l-4.45,1.74l-3.54,-0.99l1.12,-0.9l0.05,-0.58l-1.06,-1.22l4.22,-0.89l1.09,1.97l2.57,0.87ZM466.44,24.04l7.43,3.77l-5.41,1.86l-1.58,4.08l-2.26,1.2l-1.12,4.11l-2.61,0.18l-4.79,-2.86l1.84,-1.54l-0.1,-0.68l-3.69,-1.53l-4.77,-4.51l-1.73,-3.89l6.11,-1.82l1.54,1.92l3.57,-0.08l1.2,-1.96l3.32,-0.18l3.05,1.92Z","name":"Norway"},"NA":{"path":"M474.26,330.66l-0.97,0.04l-0.38,0.4l-0.07,8.9l-2.09,0.08l-0.39,0.4l-0.0,17.42l-1.98,1.23l-1.17,0.17l-2.44,-0.66l-0.48,-1.13l-0.99,-0.74l-0.54,0.05l-0.9,1.01l-1.53,-1.68l-0.93,-1.88l-1.99,-8.56l-0.06,-3.12l-0.33,-1.52l-2.3,-3.34l-1.91,-4.83l-1.96,-2.43l-0.12,-1.57l2.33,-0.79l1.43,0.07l1.81,1.13l10.23,-0.25l1.84,1.23l5.87,0.35ZM474.66,330.64l6.51,-1.6l1.9,0.39l-1.69,0.4l-1.31,0.83l-1.12,-0.94l-4.29,0.92Z","name":"Namibia"},"NC":{"path":"M838.78,341.24l-0.33,0.22l-2.9,-1.75l-3.26,-3.37l1.65,0.83l4.85,4.07Z","name":"New Caledonia"},"NE":{"path":"M454.75,226.53l1.33,1.37l0.48,0.07l1.27,-0.7l0.53,3.52l0.94,0.83l0.17,0.92l0.81,0.69l-0.44,0.95l-0.96,5.26l-0.13,3.22l-3.04,2.31l-1.22,3.57l1.02,1.24l-0.0,1.46l0.39,0.4l1.13,0.04l-0.9,1.25l-1.47,-2.42l-0.86,-0.29l-2.09,1.37l-1.74,-0.67l-1.45,-0.17l-0.85,0.35l-1.36,-0.07l-1.64,1.09l-1.06,0.05l-2.94,-1.28l-1.44,0.59l-1.01,-0.03l-0.97,-0.94l-2.7,-0.98l-2.69,0.3l-0.87,0.64l-0.47,1.6l-0.75,1.16l-0.12,1.53l-1.57,-1.1l-1.31,0.24l0.03,-0.81l-0.32,-0.41l-2.59,-0.52l-0.15,-1.16l-1.35,-1.6l-0.29,-1.0l0.13,-0.84l1.29,-0.08l1.08,-0.92l3.31,-0.22l2.22,-0.41l0.32,-0.34l0.2,-1.47l1.39,-1.88l-0.01,-5.66l3.36,-1.12l7.24,-5.12l8.42,-4.92l3.69,1.06Z","name":"Niger"},"NG":{"path":"M456.32,253.89l0.64,0.65l-0.28,1.04l-2.11,2.01l-2.03,5.18l-1.37,1.16l-1.15,3.18l-1.33,0.66l-1.46,-0.97l-1.21,0.16l-1.38,1.36l-0.91,0.24l-1.79,4.06l-2.33,0.81l-1.11,-0.07l-0.86,0.5l-1.71,-0.05l-1.19,-1.39l-0.89,-1.89l-1.77,-1.66l-3.95,-0.08l0.07,-5.21l0.42,-1.43l1.95,-2.3l-0.14,-0.91l0.43,-1.18l-0.53,-1.41l0.25,-2.92l0.72,-1.07l0.32,-1.34l0.46,-0.39l2.47,-0.28l2.34,0.89l1.15,1.02l1.28,0.04l1.22,-0.58l3.03,1.27l1.49,-0.14l1.36,-1.0l1.33,0.07l0.82,-0.35l3.45,0.8l1.82,-1.32l1.84,2.67l0.66,0.16Z","name":"Nigeria"},"NZ":{"path":"M857.8,379.65l1.86,3.12l0.44,0.18l0.3,-0.38l0.03,-1.23l0.38,0.27l0.57,2.31l2.02,0.94l1.81,0.27l1.57,-1.06l0.7,0.18l-1.15,3.59l-1.98,0.11l-0.74,1.2l0.2,1.11l-2.42,3.98l-1.49,0.92l-1.04,-0.85l1.21,-2.05l-0.81,-2.01l-2.63,-1.25l0.04,-0.57l1.82,-1.19l0.43,-2.34l-0.16,-2.03l-0.95,-1.82l-0.06,-0.72l-3.11,-3.64l-0.79,-1.52l1.56,1.45l1.76,0.66l0.65,2.34ZM853.83,393.59l0.57,1.24l0.59,0.16l1.42,-0.97l0.46,0.79l0.0,1.03l-2.47,3.48l-1.26,1.2l-0.06,0.5l0.55,0.87l-1.41,0.07l-2.33,1.38l-2.03,5.02l-3.02,2.16l-2.06,-0.06l-1.71,-1.04l-2.47,-0.2l-0.27,-0.73l1.22,-2.1l3.05,-2.94l1.62,-0.59l4.02,-2.82l1.57,-1.67l1.07,-2.16l0.88,-0.7l0.48,-1.75l1.24,-0.97l0.35,0.79Z","name":"New Zealand"},"NP":{"path":"M641.14,213.62l0.01,3.19l-1.74,0.04l-4.8,-0.86l-1.58,-1.39l-3.37,-0.34l-7.65,-3.7l0.8,-2.09l2.33,-1.7l1.77,0.75l2.49,1.76l1.38,0.41l0.99,1.35l1.9,0.52l1.99,1.17l5.49,0.9Z","name":"Nepal"},"CI":{"path":"M407.4,259.27l0.86,0.42l0.56,0.9l1.13,0.53l1.19,-0.61l0.97,-0.08l1.42,0.54l0.6,3.24l-1.03,2.08l-0.65,2.84l1.06,2.33l-0.06,0.53l-2.54,-0.47l-1.66,0.03l-3.06,0.46l-4.11,1.6l0.32,-3.06l-1.18,-1.31l-1.32,-0.66l0.42,-0.85l-0.2,-1.4l0.5,-0.67l0.01,-1.59l0.84,-0.32l0.26,-0.5l-1.15,-3.01l0.12,-0.5l0.51,-0.25l0.66,0.31l1.93,0.02l0.67,-0.71l0.71,-0.14l0.25,0.69l0.57,0.22l1.4,-0.61Z","name":"C\u00f4te d'Ivoire"},"CH":{"path":"M444.62,156.35l-0.29,0.87l0.18,0.53l1.13,0.58l1.0,0.1l-0.1,0.65l-0.79,0.38l-1.72,-0.37l-0.45,0.23l-0.45,1.04l-0.75,0.06l-0.84,-0.4l-1.32,1.0l-0.96,0.12l-0.88,-0.55l-0.81,-1.3l-0.49,-0.16l-0.63,0.26l0.02,-0.65l1.71,-1.66l0.1,-0.56l0.93,0.08l0.58,-0.46l1.99,0.02l0.66,-0.61l2.19,0.79Z","name":"Switzerland"},"CO":{"path":"M242.07,254.93l-1.7,0.59l-0.59,1.18l-1.7,1.69l-0.38,1.93l-0.67,1.43l0.31,0.57l1.03,0.13l0.25,0.9l0.57,0.64l-0.04,2.34l1.64,1.42l3.16,-0.24l1.26,0.28l1.67,2.06l0.41,0.13l4.09,-0.39l0.45,0.22l-0.92,1.95l-0.2,1.8l0.52,1.83l0.75,1.05l-1.12,1.1l0.07,0.63l0.84,0.51l0.74,1.29l-0.39,-0.45l-0.59,-0.01l-0.71,0.74l-4.71,-0.05l-0.4,0.41l0.03,1.57l0.33,0.39l1.11,0.2l-1.68,0.4l-0.29,0.38l-0.01,1.82l1.16,1.14l0.34,1.25l-1.05,7.05l-1.04,-0.87l1.26,-1.99l-0.13,-0.56l-2.18,-1.23l-1.38,0.2l-1.14,-0.38l-1.27,0.61l-1.55,-0.26l-1.38,-2.46l-1.23,-0.75l-0.85,-1.2l-1.67,-1.19l-0.86,0.13l-2.11,-1.32l-1.01,0.31l-1.8,-0.29l-0.52,-0.91l-3.09,-1.68l0.77,-0.52l-0.1,-1.12l0.41,-0.64l1.34,-0.32l2.0,-2.88l-0.11,-0.57l-0.66,-0.43l0.39,-1.38l-0.52,-2.1l0.49,-0.83l-0.4,-2.13l-0.97,-1.35l0.17,-0.66l0.86,-0.08l0.47,-0.75l-0.46,-1.63l1.41,-0.07l1.8,-1.69l0.93,-0.24l0.3,-0.38l0.45,-2.76l1.22,-1.0l1.44,-0.04l0.45,-0.5l1.91,0.12l2.93,-1.84l1.15,-1.14l0.91,0.46l-0.25,0.45Z","name":"Colombia"},"CN":{"path":"M740.23,148.97l4.57,1.3l2.8,2.17l0.98,2.9l0.38,0.27l3.8,0.0l2.32,-1.28l3.29,-0.75l-0.96,2.09l-1.02,1.28l-0.85,3.4l-1.52,2.73l-2.76,-0.5l-2.4,1.13l-0.21,0.45l0.64,2.57l-0.32,3.2l-0.94,0.06l-0.37,0.89l-0.91,-1.01l-0.64,0.07l-0.92,1.57l-3.73,1.25l-0.26,0.48l0.26,1.06l-1.5,-0.08l-1.09,-0.86l-0.56,0.06l-1.67,2.06l-2.7,1.56l-2.03,1.88l-3.4,0.83l-1.93,1.4l-1.15,0.34l0.33,-0.7l-0.41,-0.89l1.79,-1.79l0.02,-0.54l-1.32,-1.56l-0.48,-0.1l-2.24,1.09l-2.83,2.06l-1.51,1.83l-2.28,0.13l-1.55,1.49l-0.04,0.5l1.32,1.97l2.0,0.58l0.31,1.35l1.98,0.84l3.0,-1.96l2.0,1.02l1.49,0.11l0.22,0.83l-3.37,0.86l-1.12,1.48l-2.5,1.52l-1.29,1.99l0.14,0.56l2.57,1.48l0.97,2.7l3.17,4.63l-0.03,1.66l-1.35,0.65l-0.2,0.51l0.6,1.47l1.4,0.91l-0.89,3.82l-1.43,0.38l-3.85,6.44l-2.27,3.11l-6.78,4.57l-2.73,0.29l-1.45,1.04l-0.62,-0.61l-0.55,-0.01l-1.36,1.25l-3.39,1.27l-2.61,0.4l-1.1,2.79l-0.81,0.09l-0.49,-1.42l0.5,-0.85l-0.25,-0.59l-3.36,-0.84l-1.3,0.4l-2.31,-0.62l-0.94,-0.84l0.33,-1.28l-0.3,-0.49l-2.19,-0.46l-1.13,-0.93l-0.47,-0.02l-2.06,1.36l-4.29,0.28l-2.76,1.05l-0.28,0.43l0.32,2.53l-0.59,-0.03l-0.19,-1.34l-0.55,-0.34l-1.68,0.7l-2.46,-1.23l0.62,-1.87l-0.26,-0.51l-1.37,-0.44l-0.54,-2.22l-0.45,-0.3l-2.13,0.35l0.24,-2.48l2.39,-2.4l0.03,-4.31l-1.19,-0.92l-0.78,-1.49l-0.41,-0.21l-1.41,0.19l-1.98,-0.3l0.46,-1.07l-1.17,-1.7l-0.55,-0.11l-1.63,1.05l-2.25,-0.57l-2.89,1.73l-2.25,1.98l-1.75,0.29l-1.17,-0.71l-3.31,-0.65l-1.48,0.79l-1.04,1.27l-0.12,-1.17l-0.54,-0.34l-1.44,0.54l-5.55,-0.86l-1.98,-1.16l-1.89,-0.54l-0.99,-1.35l-1.34,-0.37l-2.55,-1.79l-2.01,-0.84l-1.21,0.56l-5.57,-3.45l-0.53,-2.31l1.19,0.25l0.48,-0.37l0.08,-1.42l-0.98,-1.56l0.15,-2.44l-2.69,-3.32l-4.12,-1.23l-0.67,-2.0l-1.92,-1.48l-0.38,-0.7l-0.51,-3.01l-1.52,-0.66l-0.7,0.13l-0.48,-2.05l0.55,-0.51l-0.09,-0.82l2.03,-1.19l1.6,-0.54l2.56,0.38l0.42,-0.22l0.85,-1.7l3.0,-0.33l1.1,-1.26l4.05,-1.77l0.39,-0.91l-0.17,-1.44l1.45,-0.67l0.2,-0.52l-2.07,-4.9l4.51,-1.12l1.37,-0.73l1.89,-5.51l4.98,0.86l1.51,-1.7l0.11,-2.87l1.99,-0.38l1.83,-2.06l0.49,-0.13l0.68,2.08l2.23,1.77l3.44,1.16l1.55,2.29l-0.92,3.49l0.96,1.67l6.54,1.13l2.95,1.87l1.47,0.35l1.06,2.62l1.53,1.91l3.05,0.08l5.14,0.67l3.37,-0.41l2.36,0.43l3.65,1.8l3.06,0.04l1.45,0.88l2.87,-1.59l3.95,-1.02l3.83,-0.14l3.06,-1.14l1.77,-1.6l1.72,-1.01l0.17,-0.49l-1.1,-2.05l1.02,-1.54l4.02,0.8l2.45,-1.61l3.76,-1.19l1.96,-2.13l1.63,-0.83l3.51,-0.4l1.92,0.34l0.46,-0.3l0.17,-1.5l-2.27,-2.22l-2.11,-1.09l-2.18,1.11l-2.32,-0.47l-1.29,0.32l-0.4,-0.82l2.73,-5.16l3.02,1.06l3.53,-2.06l0.18,-1.68l2.16,-3.35l1.49,-1.35l-0.03,-1.85l-1.07,-0.85l1.54,-1.26l2.98,-0.59l3.23,-0.09l3.64,0.99l2.04,1.16l3.29,6.71l0.92,3.19ZM696.92,237.31l-1.87,1.08l-1.63,-0.64l-0.06,-1.79l1.03,-0.98l2.58,-0.69l1.16,0.05l0.3,0.54l-0.98,1.06l-0.53,1.37Z","name":"China"},"CM":{"path":"M457.92,257.49l1.05,1.91l-1.4,0.16l-1.05,-0.23l-0.45,0.22l-0.54,1.19l0.08,0.45l1.48,1.47l1.05,0.45l1.01,2.46l-1.52,2.99l-0.68,0.68l-0.13,3.69l2.38,3.84l1.09,0.8l0.24,2.48l-3.67,-1.14l-11.27,-0.13l0.23,-1.79l-0.98,-1.66l-1.19,-0.54l-0.44,-0.97l-0.6,-0.42l1.71,-4.27l0.75,-0.13l1.38,-1.36l0.65,-0.03l1.71,0.99l1.93,-1.12l1.14,-3.18l1.38,-1.17l2.0,-5.14l2.17,-2.13l0.3,-1.64l-0.86,-0.88l0.03,-0.33l0.94,1.28l0.07,3.22Z","name":"Cameroon"},"CL":{"path":"M246.5,429.18l-3.14,1.83l-0.57,3.16l-0.64,0.05l-2.68,-1.06l-2.82,-2.33l-3.04,-1.89l-0.69,-1.85l0.63,-2.14l-1.21,-2.11l-0.31,-5.37l1.01,-2.91l2.57,-2.38l-0.18,-0.68l-3.16,-0.77l2.05,-2.47l0.77,-4.65l2.32,0.9l0.54,-0.29l1.31,-6.31l-0.22,-0.44l-1.68,-0.8l-0.56,0.28l-0.7,3.36l-0.81,-0.22l1.56,-9.41l1.15,-2.24l-0.71,-2.82l-0.18,-2.84l1.01,-0.33l3.26,-9.14l1.07,-4.22l-0.56,-4.21l0.74,-2.34l-0.29,-3.27l1.46,-3.34l2.04,-16.59l-0.66,-7.76l1.03,-0.53l0.54,-0.9l0.79,1.14l0.32,1.78l1.25,1.16l-0.69,2.55l1.33,2.9l0.97,3.59l0.46,0.29l1.5,-0.3l0.11,0.23l-0.76,2.44l-2.57,1.23l-0.23,0.37l0.08,4.33l-0.46,0.77l0.56,1.21l-1.58,1.51l-1.68,2.62l-0.89,2.47l0.2,2.7l-1.48,2.73l1.12,5.09l0.64,0.61l-0.01,2.29l-1.38,2.68l0.01,2.4l-1.89,2.04l0.02,2.75l0.69,2.57l-1.43,1.13l-1.26,5.68l0.39,3.51l-0.97,0.89l0.58,3.5l1.02,1.14l-0.65,1.02l0.15,0.57l1.0,0.53l0.16,0.69l-1.03,0.85l0.26,1.75l-0.89,4.03l-1.31,2.66l0.24,1.75l-0.71,1.83l-1.99,1.7l0.3,3.67l0.88,1.19l1.58,0.01l0.01,2.21l1.04,1.95l5.98,0.63ZM248.69,430.79l0.0,7.33l0.4,0.4l3.52,0.05l-0.44,0.75l-1.94,0.98l-2.49,-0.37l-1.88,-1.06l-2.55,-0.49l-5.59,-3.71l-2.38,-2.63l4.1,2.48l3.32,1.23l0.45,-0.12l1.29,-1.57l0.83,-2.32l2.05,-1.24l1.31,0.29Z","name":"Chile"},"CA":{"path":"M280.06,145.6l-1.67,2.88l0.07,0.49l0.5,0.04l1.46,-0.98l1.0,0.42l-0.56,0.72l0.17,0.62l2.22,0.89l1.35,-0.71l1.95,0.78l-0.66,2.01l0.5,0.51l1.32,-0.42l0.98,3.17l-0.91,2.41l-0.8,0.08l-1.23,-0.45l0.47,-2.25l-0.89,-0.83l-0.48,0.06l-2.78,2.63l-0.34,-0.02l1.02,-0.85l-0.14,-0.69l-2.4,-0.77l-7.4,0.08l-0.17,-0.41l1.3,-0.94l0.02,-0.64l-0.73,-0.58l1.85,-1.74l2.57,-5.16l1.47,-1.79l1.99,-1.05l0.46,0.06l-1.53,2.45ZM68.32,74.16l4.13,0.95l4.02,2.14l2.61,0.4l2.47,-1.89l2.88,-1.31l3.85,0.48l3.71,-1.94l3.82,-1.04l1.56,1.68l0.49,0.08l1.87,-1.04l0.65,-1.98l1.24,0.35l4.16,3.94l0.54,0.01l2.75,-2.49l0.26,2.59l0.49,0.35l3.08,-0.73l1.04,-1.27l2.73,0.23l3.83,1.86l5.86,1.61l3.47,0.75l2.44,-0.26l2.73,1.78l-2.98,1.81l-0.19,0.41l0.31,0.32l4.53,0.92l6.87,-0.5l2.0,-0.69l2.49,2.39l0.53,0.02l2.72,-2.16l-0.02,-0.64l-2.16,-1.54l1.15,-1.06l4.83,-0.61l1.84,0.95l2.48,2.31l3.01,-0.23l4.55,1.92l3.85,-0.67l3.61,0.1l0.41,-0.44l-0.25,-2.36l1.79,-0.61l3.49,1.32l-0.01,3.77l0.31,0.39l0.45,-0.22l1.48,-3.16l1.74,0.1l0.41,-0.3l1.13,-4.37l-2.78,-3.11l-2.8,-1.74l0.19,-4.64l2.71,-3.07l2.98,0.67l2.41,1.95l3.19,4.8l-1.99,1.97l0.21,0.68l4.33,0.84l-0.01,4.15l0.25,0.37l0.44,-0.09l3.07,-3.15l2.54,2.39l-0.61,3.33l2.42,2.88l0.61,0.0l2.61,-3.08l1.88,-3.82l0.17,-4.58l6.72,0.94l3.13,2.04l0.13,1.82l-1.76,2.19l-0.01,0.49l1.66,2.16l-0.26,1.71l-4.68,2.8l-3.28,0.61l-2.47,-1.2l-0.55,0.23l-0.73,2.04l-2.38,3.43l-0.74,1.77l-2.74,2.57l-3.44,0.25l-2.21,1.78l-0.28,2.53l-2.82,0.55l-3.12,3.22l-2.72,4.31l-1.03,3.17l-0.14,4.31l0.33,0.41l3.44,0.57l2.24,5.95l0.45,0.23l3.4,-0.69l4.52,1.51l2.43,1.31l1.91,1.73l3.1,0.96l2.62,1.46l6.6,0.54l-0.35,2.74l0.81,3.53l1.81,3.78l3.83,3.3l0.45,0.04l2.1,-1.28l1.37,-3.69l-1.31,-5.38l-1.45,-1.58l3.57,-1.47l2.84,-2.46l1.52,-2.8l-0.25,-2.55l-1.7,-3.07l-2.85,-2.61l2.8,-3.95l-1.08,-3.37l-0.79,-5.67l1.36,-0.7l6.76,1.41l2.12,-0.96l5.12,3.36l1.05,1.61l4.08,0.26l-0.06,2.87l0.83,4.7l0.3,0.32l2.16,0.54l1.73,2.06l0.5,0.09l3.63,-2.03l2.52,-4.19l1.26,-1.32l7.6,11.72l-0.92,2.04l0.16,0.51l3.3,1.97l2.22,1.98l4.1,0.98l1.43,0.99l0.95,2.79l2.1,0.68l0.84,1.08l0.17,3.45l-3.37,2.26l-4.22,1.24l-3.06,2.63l-4.06,0.51l-5.35,-0.69l-6.39,0.2l-2.3,2.41l-3.26,1.51l-6.47,7.15l-0.06,0.48l0.44,0.19l2.13,-0.52l4.17,-4.24l5.12,-2.62l3.52,-0.3l1.69,1.21l-2.12,2.21l0.81,3.47l1.02,2.61l3.47,1.6l4.14,-0.45l2.15,-2.8l0.26,1.48l1.14,0.8l-2.56,1.69l-5.5,1.82l-2.54,1.27l-2.74,2.15l-1.4,-0.16l-0.07,-2.01l4.14,-2.44l0.18,-0.45l-0.39,-0.29l-6.63,0.45l-1.39,-1.49l-0.14,-4.43l-1.11,-0.91l-1.82,0.39l-0.66,-0.66l-0.6,0.03l-1.91,2.39l-0.82,2.52l-0.8,1.27l-1.67,0.56l-0.46,0.76l-8.31,0.07l-1.21,0.62l-2.35,1.97l-0.71,-0.14l-1.37,0.96l-1.12,-0.48l-4.74,1.26l-0.9,1.17l0.21,0.62l1.73,0.3l-1.81,0.31l-1.85,0.81l-2.11,-0.13l-2.95,1.78l-0.69,-0.09l1.39,-2.1l1.73,-1.21l0.1,-2.29l1.16,-1.99l0.49,0.53l2.03,0.42l1.2,-1.16l0.02,-0.47l-2.66,-3.51l-2.28,-0.61l-5.64,-0.71l-0.4,-0.57l-0.79,0.13l0.2,-0.41l-0.22,-0.55l-0.68,-0.26l0.19,-1.26l-0.78,-0.73l0.31,-0.64l-0.29,-0.57l-2.6,-0.44l-0.75,-1.63l-0.94,-0.66l-4.31,-0.65l-1.13,1.19l-1.48,0.59l-0.85,1.06l-2.83,-0.76l-2.09,0.39l-2.39,-0.97l-4.24,-0.7l-0.57,-0.4l-0.41,-1.63l-0.4,-0.3l-0.85,0.02l-0.39,0.4l-0.01,0.85l-69.13,-0.01l-6.51,-4.52l-4.5,-1.38l-1.26,-2.66l0.33,-1.93l-0.23,-0.43l-3.01,-1.35l-0.55,-2.77l-2.89,-2.38l-0.04,-1.45l1.39,-1.83l-0.28,-2.55l-4.16,-2.2l-4.07,-6.6l-4.02,-3.22l-1.3,-1.88l-0.5,-0.13l-2.51,1.21l-2.23,1.87l-3.85,-3.88l-2.44,-1.04l-2.22,-0.13l0.03,-37.49ZM260.37,148.65l3.04,0.76l2.26,1.2l-3.78,-0.95l-1.53,-1.01ZM249.4,3.81l6.68,0.49l5.32,0.79l4.26,1.57l-0.07,1.1l-5.85,2.53l-6.02,1.21l-2.39,1.39l-0.18,0.45l0.39,0.29l4.01,-0.02l-4.65,2.82l-4.2,1.74l-4.19,4.59l-5.03,0.92l-1.67,1.15l-7.47,0.59l-0.37,0.37l0.32,0.42l2.41,0.49l-0.81,0.47l-0.12,0.59l1.83,2.41l-2.02,1.59l-3.81,1.51l-1.32,2.16l-3.38,1.53l-0.22,0.48l0.35,1.19l0.4,0.29l3.88,-0.18l0.03,0.61l-6.33,2.95l-6.41,-1.4l-7.43,0.79l-3.72,-0.62l-4.4,-0.25l-0.23,-1.83l4.29,-1.11l0.28,-0.51l-1.1,-3.45l1.0,-0.25l6.58,2.28l0.47,-0.16l-0.05,-0.49l-3.41,-3.45l-3.58,-0.98l1.48,-1.55l4.34,-1.29l0.97,-2.19l-0.16,-0.48l-3.42,-2.13l-0.81,-2.26l6.2,0.22l2.24,0.58l3.91,-2.1l0.2,-0.43l-0.35,-0.32l-5.64,-0.67l-8.73,0.36l-4.26,-1.9l-2.12,-2.4l-2.78,-1.66l-0.41,-1.52l3.31,-1.03l2.93,-0.2l4.91,-0.99l3.7,-2.27l2.87,0.3l2.62,1.67l0.56,-0.14l1.82,-3.2l3.13,-0.94l4.44,-0.69l7.53,-0.26l1.48,0.67l7.19,-1.06l10.8,0.79ZM203.85,57.54l0.01,0.42l1.97,2.97l0.68,-0.02l2.24,-3.72l5.95,-1.86l4.01,4.64l-0.35,2.91l0.5,0.43l4.95,-1.36l2.32,-1.8l5.31,2.28l3.27,2.11l0.3,1.84l0.48,0.33l4.42,-0.99l2.64,2.87l5.97,1.77l2.06,1.72l2.11,3.71l-4.19,1.86l-0.01,0.73l5.9,2.83l3.94,0.94l3.78,3.95l3.46,0.25l-0.63,2.37l-4.11,4.47l-2.76,-1.56l-3.9,-3.94l-3.59,0.41l-0.33,0.34l-0.19,2.72l2.63,2.38l3.42,1.89l0.94,0.97l1.55,3.75l-0.7,2.29l-2.74,-0.92l-6.25,-3.15l-0.51,0.13l0.05,0.52l6.07,5.69l0.18,0.59l-6.09,-1.39l-5.31,-2.24l-2.63,-1.66l0.6,-0.77l-0.12,-0.6l-7.39,-4.01l-0.59,0.37l0.03,0.79l-6.73,0.6l-1.69,-1.1l1.36,-2.46l4.51,-0.07l5.15,-0.52l0.31,-0.6l-0.74,-1.3l0.78,-1.84l3.21,-4.05l-0.67,-2.35l-1.11,-1.6l-3.84,-2.1l-4.35,-1.28l0.91,-0.63l0.06,-0.61l-2.65,-2.75l-2.34,-0.36l-1.89,-1.46l-0.53,0.03l-1.24,1.23l-4.36,0.55l-9.04,-0.99l-9.26,-1.98l-1.6,-1.22l2.22,-1.77l0.13,-0.44l-0.38,-0.27l-3.22,-0.02l-0.72,-4.25l1.83,-4.04l2.42,-1.85l5.5,-1.1l-1.39,2.35ZM261.19,159.33l2.07,0.61l1.44,-0.04l-1.15,0.63l-2.94,-1.23l-0.4,-0.68l0.36,-0.37l0.61,1.07ZM230.83,84.39l-2.37,0.18l-0.49,-1.63l0.93,-2.09l1.94,-0.51l1.62,0.99l0.02,1.52l-1.66,1.54ZM229.43,58.25l0.11,0.65l-4.87,-0.21l-2.72,0.62l-3.1,-2.57l0.08,-1.26l0.86,-0.23l5.57,0.51l4.08,2.5ZM222.0,105.02l-0.72,1.49l-0.63,-0.19l-0.48,-0.84l0.81,-0.99l0.65,0.05l0.37,0.46ZM183.74,38.32l2.9,1.7l4.79,-0.01l1.84,1.46l-0.49,1.68l0.23,0.48l2.82,1.14l1.76,1.26l7.01,0.65l4.1,-1.1l5.03,-0.43l3.93,0.35l2.48,1.77l0.46,1.7l-1.3,1.1l-3.56,1.01l-3.23,-0.59l-7.17,0.76l-5.09,0.09l-3.99,-0.6l-6.42,-1.54l-0.79,-2.51l-0.3,-2.49l-2.64,-2.5l-5.32,-0.72l-2.52,-1.4l0.68,-1.57l4.78,0.31ZM207.38,91.35l0.4,1.56l0.56,0.26l1.06,-0.52l1.32,0.96l5.42,2.57l0.2,1.68l0.46,0.35l1.68,-0.28l1.15,0.85l-1.55,0.87l-3.61,-0.88l-1.32,-1.69l-0.57,-0.06l-2.45,2.1l-3.12,1.79l-0.7,-1.87l-0.42,-0.26l-2.16,0.24l1.39,-1.39l0.32,-3.14l0.76,-3.35l1.18,0.22ZM215.49,102.6l-2.67,1.95l-1.4,-0.07l-0.3,-0.58l1.53,-1.48l2.84,0.18ZM202.7,24.12l2.53,1.59l-2.87,1.4l-4.53,4.05l-4.25,0.38l-5.03,-0.68l-2.45,-2.04l0.03,-1.62l1.82,-1.37l0.14,-0.45l-0.38,-0.27l-4.45,0.04l-2.59,-1.76l-1.41,-2.29l1.57,-2.32l1.62,-1.66l2.44,-0.39l0.25,-0.65l-0.6,-0.74l4.86,-0.25l3.24,3.11l8.16,2.3l1.9,3.61ZM187.47,59.2l-2.76,3.49l-2.38,-0.15l-1.44,-3.84l0.04,-2.2l1.19,-1.88l2.3,-1.23l5.07,0.17l4.11,1.02l-3.24,3.72l-2.88,0.89ZM186.07,48.79l-1.08,1.53l-3.34,-0.34l-2.56,-1.1l1.03,-1.75l3.25,-1.23l1.95,1.58l0.75,1.3ZM185.71,35.32l-5.3,-0.2l-0.32,-0.71l4.31,0.07l1.3,0.84ZM180.68,32.48l-3.34,1.0l-1.79,-1.1l-0.98,-1.87l-0.15,-1.73l4.1,0.53l2.67,1.7l-0.51,1.47ZM180.9,76.31l-1.1,1.08l-3.13,-1.23l-2.12,0.43l-2.71,-1.57l1.72,-1.09l1.55,-1.72l3.81,1.9l1.98,2.2ZM169.74,54.87l2.96,0.97l4.17,-0.57l0.41,0.88l-2.14,2.11l0.09,0.64l3.55,1.92l-0.4,3.72l-3.79,1.65l-2.17,-0.35l-1.72,-1.74l-6.02,-3.5l0.03,-0.85l4.68,0.54l0.4,-0.21l-0.05,-0.45l-2.48,-2.81l2.46,-1.95ZM174.45,40.74l1.37,1.73l0.07,2.44l-1.05,3.45l-3.79,0.47l-2.32,-0.69l0.05,-2.64l-0.44,-0.41l-3.68,0.35l-0.12,-3.1l2.45,0.1l3.67,-1.73l3.41,0.29l0.37,-0.26ZM170.05,31.55l0.67,1.56l-3.33,-0.49l-4.22,-1.77l-4.35,-0.16l1.4,-0.94l-0.06,-0.7l-2.81,-1.23l-0.12,-1.39l4.39,0.68l6.62,1.98l1.81,2.47ZM134.5,58.13l-1.02,1.82l0.45,0.58l5.4,-1.39l3.33,2.29l0.49,-0.03l2.6,-2.23l1.94,1.32l2.0,4.5l0.7,0.06l1.3,-2.29l-1.63,-4.46l1.69,-0.54l2.31,0.71l2.65,1.81l2.49,7.92l8.48,4.27l-0.19,1.35l-3.79,0.33l-0.26,0.67l1.4,1.49l-0.58,1.1l-4.23,-0.64l-4.43,-1.19l-3.0,0.28l-4.66,1.47l-10.52,1.04l-1.43,-2.02l-3.42,-1.2l-2.21,0.43l-2.51,-2.86l4.84,-1.05l3.6,0.19l3.27,-0.78l0.31,-0.39l-0.31,-0.39l-4.84,-1.06l-8.79,0.27l-0.85,-1.07l5.26,-1.66l0.27,-0.45l-0.4,-0.34l-3.8,0.06l-3.81,-1.06l1.81,-3.01l1.66,-1.79l6.48,-2.81l1.97,0.71ZM158.7,56.61l-1.7,2.44l-3.2,-2.75l0.37,-0.3l3.11,-0.18l1.42,0.79ZM149.61,42.73l1.01,1.89l0.5,0.18l2.14,-0.82l2.23,0.19l0.36,2.04l-1.33,2.09l-8.28,0.76l-6.35,2.15l-3.41,0.1l-0.19,-0.96l4.9,-2.08l0.23,-0.46l-0.41,-0.31l-11.25,0.59l-2.89,-0.74l3.04,-4.44l2.14,-1.32l6.81,1.69l4.58,3.06l4.37,0.39l0.36,-0.63l-3.36,-4.6l1.85,-1.53l2.18,0.51l0.77,2.26ZM144.76,34.41l-4.36,1.44l-3.0,-1.4l1.46,-1.24l3.47,-0.52l2.96,0.71l-0.52,1.01ZM145.13,29.83l-1.9,0.66l-3.67,-0.0l2.27,-1.61l3.3,0.95ZM118.92,65.79l-6.03,2.02l-1.33,-1.9l-5.38,-2.28l2.59,-5.05l2.16,-3.14l-0.02,-0.48l-1.97,-2.41l7.64,-0.7l3.6,1.02l6.3,0.27l4.42,2.95l-2.53,0.98l-6.24,3.43l-3.1,3.28l-0.11,2.01ZM129.54,35.53l-0.28,3.37l-1.72,1.62l-2.33,0.28l-4.61,2.19l-3.86,0.76l-2.64,-0.87l3.72,-3.4l5.01,-3.34l3.72,0.07l3.0,-0.67ZM111.09,152.69l-0.67,0.24l-3.85,-1.37l-0.83,-1.17l-2.12,-1.07l-0.66,-1.02l-2.4,-0.55l-0.74,-1.71l6.02,1.45l2.0,2.55l2.52,1.39l0.73,1.27ZM87.8,134.64l0.89,0.29l1.86,-0.21l-0.65,3.34l1.69,2.33l-1.31,-1.33l-0.99,-1.62l-1.17,-0.98l-0.33,-1.82Z","name":"Canada"},"CG":{"path":"M466.72,276.48l-0.1,1.03l-1.25,2.97l-0.19,3.62l-0.46,1.78l-0.23,0.63l-1.61,1.19l-1.21,1.39l-1.09,2.43l0.04,2.09l-3.25,3.24l-0.5,-0.24l-0.5,-0.83l-1.36,-0.02l-0.98,0.89l-1.68,-0.99l-1.54,1.24l-1.52,-1.96l1.57,-1.14l0.11,-0.52l-0.77,-1.35l2.1,-0.66l0.39,-0.73l1.05,0.82l2.21,0.11l1.12,-1.37l0.37,-1.81l-0.27,-2.09l-1.13,-1.5l1.0,-2.69l-0.13,-0.45l-0.92,-0.58l-1.6,0.17l-0.51,-0.94l0.1,-0.61l2.75,0.09l3.97,1.24l0.51,-0.33l0.17,-1.28l1.24,-2.21l1.28,-1.14l2.76,0.49Z","name":"Congo"},"CF":{"path":"M461.16,278.2l-0.26,-1.19l-1.09,-0.77l-0.84,-1.17l-0.29,-1.0l-1.04,-1.15l0.08,-3.43l0.58,-0.49l1.16,-2.35l1.85,-0.17l0.61,-0.62l0.97,0.58l3.15,-0.96l2.48,-1.92l0.02,-0.96l2.81,0.02l2.36,-1.17l1.93,-2.85l1.16,-0.93l1.11,-0.3l0.27,0.86l1.34,1.47l-0.39,2.01l0.3,1.01l4.01,2.75l0.17,0.93l2.63,2.31l0.6,1.44l2.08,1.4l-3.84,-0.21l-1.94,0.88l-1.23,-0.49l-2.67,1.2l-1.29,-0.18l-0.51,0.36l-0.6,1.22l-3.35,-0.65l-1.57,-0.91l-2.42,-0.83l-1.45,0.91l-0.97,1.27l-0.26,1.56l-3.22,-0.43l-1.49,1.33l-0.94,1.62Z","name":"Central African Rep."},"CD":{"path":"M487.01,272.38l2.34,-0.14l1.35,1.84l1.34,0.45l0.86,-0.39l1.21,0.12l1.07,-0.41l0.54,0.89l2.04,1.54l-0.14,2.72l0.7,0.54l-1.38,1.13l-1.53,2.54l-0.17,2.05l-0.59,1.08l-0.02,1.72l-0.72,0.84l-0.66,3.01l0.63,1.32l-0.44,4.26l0.64,1.47l-0.37,1.22l0.86,1.8l1.53,1.41l0.3,1.26l0.44,0.5l-4.08,0.75l-0.92,1.81l0.51,1.34l-0.74,5.43l0.17,0.38l2.45,1.46l0.54,-0.1l0.12,1.62l-1.28,-0.01l-1.85,-2.35l-1.94,-0.45l-0.48,-1.13l-0.55,-0.2l-1.41,0.74l-1.71,-0.3l-1.01,-1.18l-2.49,-0.19l-0.44,-0.77l-1.98,-0.21l-2.88,0.36l0.11,-2.41l-0.85,-1.13l-0.16,-1.36l0.32,-1.73l-0.46,-0.89l-0.04,-1.49l-0.4,-0.39l-2.53,0.02l0.1,-0.41l-0.39,-0.49l-1.28,0.01l-0.43,0.45l-1.62,0.32l-0.83,1.79l-1.09,-0.28l-2.4,0.52l-1.37,-1.91l-1.3,-3.3l-0.38,-0.27l-7.39,-0.03l-2.46,0.42l0.5,-0.45l0.37,-1.47l0.66,-0.38l0.92,0.08l0.73,-0.82l0.87,0.02l0.31,0.68l1.4,0.36l3.59,-3.63l0.01,-2.23l1.02,-2.29l2.69,-2.39l0.43,-0.99l0.49,-1.96l0.17,-3.51l1.25,-2.95l0.36,-3.14l0.86,-1.13l1.1,-0.66l3.57,1.73l3.65,0.73l0.46,-0.21l0.8,-1.46l1.24,0.19l2.61,-1.17l0.81,0.44l1.04,-0.03l0.59,-0.66l0.7,-0.16l1.81,0.25Z","name":"Dem. Rep. Congo"},"CZ":{"path":"M458.46,144.88l1.22,1.01l1.47,0.23l0.13,0.93l1.36,0.68l0.54,-0.2l0.24,-0.55l1.15,0.25l0.53,1.09l1.68,0.18l0.6,0.84l-1.04,0.73l-0.96,1.28l-1.6,0.17l-0.55,0.56l-1.04,-0.46l-1.05,0.15l-2.12,-0.96l-1.05,0.34l-1.2,1.12l-1.56,-0.87l-2.57,-2.1l-0.53,-1.88l4.7,-2.52l0.71,0.26l0.9,-0.28Z","name":"Czech Rep."},"CY":{"path":"M504.36,193.47l0.43,0.28l-1.28,0.57l-0.92,-0.28l-0.24,-0.46l2.01,-0.13Z","name":"Cyprus"},"CR":{"path":"M211.34,258.05l0.48,0.99l1.6,1.6l-0.54,0.45l0.29,1.42l-0.25,1.19l-1.09,-0.59l-0.05,-1.25l-2.46,-1.42l-0.28,-0.77l-0.66,-0.45l-0.45,-0.0l-0.11,1.04l-1.32,-0.95l0.31,-1.3l-0.36,-0.6l0.31,-0.27l1.42,0.58l1.29,-0.14l0.56,0.56l0.74,0.17l0.55,-0.27Z","name":"Costa Rica"},"CU":{"path":"M221.21,227.25l1.27,1.02l2.19,-0.28l4.43,3.33l2.08,0.43l-0.1,0.38l0.36,0.5l1.75,0.1l1.48,0.84l-3.11,0.51l-4.15,-0.03l0.77,-0.67l-0.04,-0.64l-1.2,-0.74l-1.49,-0.16l-0.7,-0.61l-0.56,-1.4l-0.4,-0.25l-1.34,0.1l-2.2,-0.66l-0.88,-0.58l-3.18,-0.4l-0.27,-0.16l0.58,-0.74l-0.36,-0.29l-2.72,-0.05l-1.7,1.29l-0.91,0.03l-0.61,0.69l-1.01,0.22l1.11,-1.29l1.01,-0.52l3.69,-1.01l3.98,0.21l2.21,0.84Z","name":"Cuba"},"SZ":{"path":"M500.35,351.36l0.5,2.04l-0.38,0.89l-1.05,0.21l-1.23,-1.2l-0.02,-0.64l0.83,-1.57l1.34,0.27Z","name":"Swaziland"},"SY":{"path":"M511.0,199.79l0.05,-1.33l0.54,-1.36l1.28,-0.99l0.13,-0.45l-0.41,-1.11l-1.14,-0.36l-0.19,-1.74l0.52,-1.0l1.29,-1.21l0.2,-1.18l0.59,0.23l2.62,-0.76l1.36,0.52l2.06,-0.01l2.95,-1.08l3.25,-0.26l-0.67,0.94l-1.28,0.66l-0.21,0.4l0.23,2.01l-0.88,3.19l-10.15,5.73l-2.15,-0.85Z","name":"Syria"},"KG":{"path":"M621.35,172.32l-3.87,1.69l-0.96,1.18l-3.04,0.34l-1.13,1.86l-2.36,-0.35l-1.99,0.63l-2.39,1.4l0.06,0.95l-0.4,0.37l-4.52,0.43l-3.02,-0.93l-2.37,0.17l0.11,-0.79l2.32,0.42l1.13,-0.88l1.99,0.2l3.21,-2.14l-0.03,-0.69l-2.97,-1.57l-1.94,0.65l-1.22,-0.74l1.71,-1.58l-0.12,-0.67l-0.36,-0.15l0.32,-0.77l1.36,-0.35l4.02,1.02l0.49,-0.3l0.35,-1.59l1.09,-0.48l3.42,1.22l1.11,-0.31l7.64,0.39l1.16,1.0l1.23,0.39Z","name":"Kyrgyzstan"},"KE":{"path":"M506.26,284.69l1.87,-2.56l0.93,-2.15l-1.38,-4.08l-1.06,-1.6l2.82,-2.75l0.79,0.26l0.12,1.41l0.86,0.83l1.9,0.11l3.28,2.13l3.57,0.44l1.05,-1.12l1.96,-0.9l0.82,0.68l1.16,0.09l-1.78,2.45l0.03,9.12l1.3,1.94l-1.37,0.78l-0.67,1.03l-1.08,0.46l-0.34,1.67l-0.81,1.07l-0.45,1.55l-0.68,0.56l-3.2,-2.23l-0.35,-1.58l-8.86,-4.98l0.14,-1.6l-0.57,-1.04Z","name":"Kenya"},"SS":{"path":"M481.71,263.34l1.07,-0.72l1.2,-3.18l1.36,-0.26l1.61,1.99l0.87,0.34l1.1,-0.41l1.5,0.07l0.57,0.53l2.49,0.0l0.44,-0.63l1.07,-0.4l0.45,-0.84l0.59,-0.33l1.9,1.33l1.6,-0.2l2.83,-3.33l-0.32,-2.21l1.59,-0.52l-0.24,1.6l0.3,1.83l1.35,1.18l0.2,1.87l0.35,0.41l0.02,1.53l-0.23,0.47l-1.42,0.25l-0.85,1.44l0.3,0.6l1.4,0.16l1.11,1.08l0.59,1.13l1.03,0.53l1.28,2.36l-4.41,3.98l-1.74,0.01l-1.89,0.55l-1.47,-0.52l-1.15,0.57l-2.96,-2.62l-1.3,0.49l-1.06,-0.15l-0.79,0.39l-0.82,-0.22l-1.8,-2.7l-1.91,-1.1l-0.66,-1.5l-2.62,-2.32l-0.18,-0.94l-2.37,-1.6Z","name":"S. Sudan"},"SR":{"path":"M283.12,270.19l2.1,0.53l-1.08,1.95l0.2,1.72l0.93,1.49l-0.59,2.03l-0.43,0.71l-1.12,-0.42l-1.32,0.22l-0.93,-0.2l-0.46,0.26l-0.25,0.73l0.33,0.7l-0.89,-0.13l-1.39,-1.97l-0.31,-1.34l-0.97,-0.31l-0.89,-1.47l0.35,-1.61l1.45,-0.82l0.33,-1.87l2.61,0.44l0.57,-0.47l1.75,-0.16Z","name":"Suriname"},"KH":{"path":"M689.52,249.39l0.49,1.45l-0.28,2.74l-4.0,1.86l-0.16,0.6l0.68,0.95l-2.06,0.17l-2.05,0.97l-1.82,-0.32l-2.12,-3.7l-0.55,-2.85l1.4,-1.85l3.02,-0.45l2.23,0.35l2.01,0.98l0.51,-0.14l0.95,-1.48l1.74,0.74Z","name":"Cambodia"},"SV":{"path":"M195.8,250.13l1.4,-1.19l2.24,1.45l0.98,-0.27l0.44,0.2l-0.27,1.05l-1.14,-0.03l-3.64,-1.21Z","name":"El Salvador"},"SK":{"path":"M476.82,151.17l-1.14,1.9l-2.73,-0.92l-0.82,0.2l-0.74,0.8l-3.46,0.73l-0.47,0.69l-1.76,0.33l-1.88,-1.0l-0.18,-0.81l0.38,-0.75l1.87,-0.32l1.74,-1.89l0.83,0.16l0.79,-0.34l1.51,1.04l1.34,-0.63l1.25,0.3l1.65,-0.42l1.81,0.95Z","name":"Slovakia"},"KR":{"path":"M737.51,185.84l0.98,-0.1l0.87,-1.17l2.69,-0.32l0.33,-0.29l1.76,2.79l0.58,1.76l0.02,3.12l-0.8,1.32l-2.21,0.55l-1.93,1.13l-1.8,0.19l-0.2,-1.1l0.43,-2.28l-0.95,-2.56l1.43,-0.37l0.23,-0.62l-1.43,-2.06Z","name":"Korea"},"SI":{"path":"M456.18,162.07l-0.51,-1.32l0.18,-1.05l1.69,0.2l1.42,-0.71l2.09,-0.07l0.62,-0.51l0.21,0.47l-1.61,0.67l-0.44,1.34l-0.66,0.24l-0.26,0.82l-1.22,-0.49l-0.84,0.46l-0.69,-0.04Z","name":"Slovenia"},"KP":{"path":"M736.77,185.16l-0.92,-0.42l-0.88,0.62l-1.21,-0.88l0.96,-1.15l0.59,-2.59l-0.46,-0.74l-2.09,-0.77l1.64,-1.52l2.72,-1.58l1.58,-1.91l1.11,0.78l2.17,0.11l0.41,-0.5l-0.3,-1.22l3.52,-1.18l0.94,-1.4l0.98,1.08l-2.19,2.18l0.01,2.14l-1.06,0.54l-1.41,1.4l-1.7,0.52l-1.25,1.09l-0.14,1.98l0.94,0.45l1.15,1.04l-0.13,0.26l-2.6,0.29l-1.13,1.29l-1.22,0.08Z","name":"Dem. Rep. Korea"},"SO":{"path":"M525.13,288.48l-1.13,-1.57l-0.03,-8.86l2.66,-3.38l1.67,-0.13l2.13,-1.69l3.41,-0.23l7.08,-7.55l2.91,-3.69l0.08,-4.82l2.98,-0.67l1.24,-0.86l0.45,-0.0l-0.2,3.0l-1.21,3.62l-2.73,5.97l-2.13,3.65l-5.03,6.16l-8.56,6.4l-2.78,3.08l-0.8,1.56Z","name":"Somalia"},"SN":{"path":"M390.09,248.21l0.12,1.55l0.49,1.46l0.96,0.82l0.05,1.28l-1.26,-0.19l-0.75,0.33l-1.84,-0.61l-5.84,-0.13l-2.54,0.51l-0.22,-1.03l1.77,0.04l2.01,-0.91l1.03,0.48l1.09,0.04l1.29,-0.62l0.14,-0.58l-0.51,-0.74l-1.81,0.25l-1.13,-0.63l-0.79,0.04l-0.72,0.61l-2.31,0.06l-0.92,-1.77l-0.81,-0.64l0.64,-0.35l2.46,-3.74l1.04,0.19l1.38,-0.56l1.19,-0.02l2.72,1.37l3.03,3.48Z","name":"Senegal"},"SL":{"path":"M394.46,264.11l-1.73,1.98l-0.58,1.33l-2.07,-1.06l-1.22,-1.26l-0.65,-2.39l1.16,-0.96l0.67,-1.17l1.21,-0.52l1.66,0.0l1.03,1.64l0.52,2.41Z","name":"Sierra Leone"},"SB":{"path":"M826.69,311.6l-0.61,0.09l-0.2,-0.33l0.37,0.15l0.44,0.09ZM824.18,307.38l-0.26,-0.3l-0.31,-0.91l0.03,0.0l0.54,1.21ZM823.04,309.33l-1.66,-0.22l-0.2,-0.52l1.16,0.28l0.69,0.46ZM819.28,304.68l1.14,0.65l0.02,0.03l-0.81,-0.44l-0.35,-0.23Z","name":"Solomon Is."},"SA":{"path":"M537.53,210.34l2.0,0.24l0.9,1.32l1.49,-0.06l0.87,2.08l1.29,0.76l0.51,0.99l1.56,1.03l-0.1,1.9l0.32,0.9l1.58,2.47l0.76,0.53l0.7,-0.04l1.68,4.23l7.53,1.33l0.51,-0.29l0.77,1.25l-1.55,4.87l-7.29,2.52l-7.3,1.03l-2.34,1.17l-1.88,2.74l-0.76,0.28l-0.82,-0.78l-0.91,0.12l-2.88,-0.51l-3.51,0.25l-0.86,-0.56l-0.57,0.15l-0.66,1.27l0.16,1.11l-0.43,0.32l-0.93,-1.4l-0.33,-1.16l-1.23,-0.88l-1.27,-2.06l-0.78,-2.22l-1.73,-1.79l-1.14,-0.48l-1.54,-2.31l-0.21,-3.41l-1.44,-2.93l-1.27,-1.16l-1.33,-0.57l-1.31,-3.37l-0.77,-0.67l-0.97,-1.97l-2.8,-4.03l-1.06,-0.17l0.37,-1.96l0.2,-0.72l2.74,0.3l1.08,-0.84l0.6,-0.94l1.74,-0.35l0.65,-1.03l0.71,-0.4l0.1,-0.62l-2.06,-2.28l4.39,-1.22l0.48,-0.37l2.77,0.69l3.66,1.9l7.03,5.5l4.87,0.3Z","name":"Saudi Arabia"},"SE":{"path":"M480.22,89.3l-4.03,1.17l-2.43,2.86l0.26,2.57l-8.77,6.64l-1.78,5.79l1.78,2.68l2.22,1.96l-2.07,3.77l-2.72,1.13l-0.95,6.04l-1.29,3.01l-2.74,-0.31l-0.4,0.22l-1.31,2.59l-2.34,0.13l-0.75,-3.09l-2.08,-4.03l-1.83,-4.96l1.0,-1.93l2.14,-2.7l0.83,-4.45l-1.6,-2.17l-0.15,-4.94l1.48,-3.39l2.58,-0.15l0.87,-1.59l-0.78,-1.57l3.76,-5.59l4.04,-7.48l2.17,0.01l0.39,-0.29l0.57,-2.07l4.37,0.64l0.46,-0.34l0.33,-2.56l1.1,-0.13l6.94,4.87l0.06,6.32l0.66,1.36Z","name":"Sweden"},"SD":{"path":"M505.98,259.4l-0.34,-0.77l-1.17,-0.9l-0.26,-1.61l0.29,-1.81l-0.34,-0.46l-1.16,-0.17l-0.54,0.59l-1.23,0.11l-0.28,0.65l0.53,0.65l0.17,1.22l-2.44,3.0l-0.96,0.19l-2.39,-1.4l-0.95,0.52l-0.38,0.78l-1.11,0.41l-0.29,0.5l-1.94,0.0l-0.54,-0.52l-1.81,-0.09l-0.95,0.4l-2.45,-2.35l-2.07,0.54l-0.73,1.26l-0.6,2.1l-1.25,0.58l-0.75,-0.62l0.27,-2.65l-1.48,-1.78l-0.22,-1.48l-0.92,-0.96l-0.02,-1.29l-0.57,-1.16l-0.68,-0.16l0.69,-1.29l-0.18,-1.14l0.65,-0.62l0.03,-0.55l-0.36,-0.41l1.55,-2.97l1.91,0.16l0.43,-0.4l-0.1,-10.94l2.49,-0.01l0.4,-0.4l-0.0,-4.82l29.02,0.0l0.64,2.04l-0.49,0.66l0.36,2.69l0.93,3.16l2.12,1.55l-0.89,1.04l-1.72,0.39l-0.98,0.9l-1.43,5.65l0.24,1.15l-0.38,2.06l-0.96,2.38l-1.53,1.31l-1.32,2.91l-1.22,0.86l-0.37,1.34Z","name":"Sudan"},"DO":{"path":"M241.8,239.2l0.05,-0.65l-0.46,-0.73l0.42,-0.44l0.19,-1.0l-0.09,-1.53l1.66,0.01l1.99,0.63l0.33,0.67l1.28,0.19l0.33,0.76l1.0,0.08l0.8,0.62l-0.45,0.51l-1.13,-0.47l-1.88,-0.01l-1.27,0.59l-0.75,-0.55l-1.01,0.54l-0.79,1.4l-0.23,-0.61Z","name":"Dominican Rep."},"DJ":{"path":"M528.43,256.18l-0.45,0.66l-0.58,-0.25l-1.51,0.13l-0.18,-1.01l1.45,-1.95l0.83,0.17l0.77,-0.44l0.2,1.0l-1.2,0.51l-0.06,0.7l0.73,0.47Z","name":"Djibouti"},"DK":{"path":"M452.28,129.07l-1.19,2.24l-2.13,-1.6l-0.23,-0.95l2.98,-0.95l0.57,1.26ZM447.74,126.31l-0.26,0.57l-0.88,-0.07l-1.8,2.53l0.48,1.69l-1.09,0.36l-1.61,-0.39l-0.89,-1.69l-0.07,-3.43l0.96,-1.73l2.02,-0.2l1.09,-1.07l1.33,-0.67l-0.05,1.06l-0.73,1.41l0.3,1.0l1.2,0.64Z","name":"Denmark"},"DE":{"path":"M453.14,155.55l-0.55,-0.36l-1.2,-0.1l-1.87,0.57l-2.13,-0.13l-0.56,0.63l-0.86,-0.6l-0.96,0.09l-2.57,-0.93l-0.85,0.67l-1.47,-0.02l0.24,-1.75l1.23,-2.14l-0.28,-0.59l-3.52,-0.58l-0.92,-0.66l0.12,-1.2l-0.48,-0.88l0.27,-2.17l-0.37,-3.03l1.41,-0.22l0.63,-1.26l0.66,-3.19l-0.41,-1.18l0.26,-0.39l1.66,-0.15l0.33,0.54l0.62,0.07l1.7,-1.69l-0.54,-3.02l1.37,0.33l1.31,-0.37l0.31,1.18l2.25,0.71l-0.02,0.92l0.5,0.4l2.55,-0.65l1.34,-0.87l2.57,1.24l1.06,0.98l0.48,1.44l-0.57,0.74l-0.0,0.48l0.87,1.15l0.57,1.64l-0.14,1.29l0.82,1.7l-1.5,-0.07l-0.56,0.57l-4.47,2.15l-0.22,0.54l0.68,2.26l2.58,2.16l-0.66,1.11l-0.79,0.36l-0.23,0.43l0.32,1.87Z","name":"Germany"},"YE":{"path":"M528.27,246.72l0.26,-0.42l-0.22,-1.01l0.19,-1.5l0.92,-0.69l-0.07,-1.35l0.39,-0.75l1.01,0.47l3.34,-0.27l3.76,0.41l0.95,0.81l1.36,-0.58l1.74,-2.62l2.18,-1.09l6.86,-0.94l2.48,5.41l-1.64,0.76l-0.56,1.9l-6.23,2.16l-2.29,1.8l-1.93,0.05l-1.41,1.02l-4.24,0.74l-1.72,1.49l-3.28,0.19l-0.52,-1.18l0.02,-1.51l-1.34,-3.29Z","name":"Yemen"},"AT":{"path":"M462.89,152.8l0.04,2.25l-1.07,0.0l-0.33,0.63l0.36,0.51l-1.04,2.13l-2.02,0.07l-1.33,0.7l-5.29,-0.99l-0.47,-0.93l-0.44,-0.21l-2.47,0.55l-0.42,0.51l-3.18,-0.81l0.43,-0.91l1.12,0.78l0.6,-0.17l0.25,-0.58l1.93,0.12l1.86,-0.56l1.0,0.08l0.68,0.57l0.62,-0.15l0.26,-0.77l-0.3,-1.78l0.8,-0.44l0.68,-1.15l1.52,0.85l0.47,-0.06l1.34,-1.25l0.64,-0.17l1.81,0.92l1.28,-0.11l0.7,0.37Z","name":"Austria"},"DZ":{"path":"M441.46,188.44l-0.32,1.07l0.39,2.64l-0.54,2.16l-1.58,1.82l0.37,2.39l1.91,1.55l0.18,0.8l1.42,1.03l1.84,7.23l0.12,1.16l-0.57,5.0l0.2,1.51l-0.87,0.99l-0.02,0.51l1.41,1.86l0.14,1.2l0.89,1.48l0.5,0.16l0.98,-0.41l1.73,1.08l0.82,1.23l-8.22,4.81l-7.23,5.11l-3.43,1.13l-2.3,0.21l-0.28,-1.59l-2.56,-1.09l-0.67,-1.25l-26.12,-17.86l0.01,-3.47l3.77,-1.88l2.44,-0.41l2.12,-0.75l1.08,-1.42l2.81,-1.05l0.35,-2.08l1.33,-0.29l1.04,-0.94l3.47,-0.69l0.46,-1.08l-0.1,-0.45l-0.58,-0.52l-0.82,-2.81l-0.19,-1.83l-0.78,-1.49l2.03,-1.31l2.63,-0.48l1.7,-1.22l2.31,-0.84l8.24,-0.73l1.49,0.38l2.28,-1.1l2.46,-0.02l0.92,0.6l1.35,-0.05Z","name":"Algeria"},"US":{"path":"M892.72,99.2l1.31,0.53l1.41,-0.37l1.89,0.98l1.89,0.42l-1.32,0.58l-2.9,-1.53l-2.08,0.22l-0.26,-0.15l0.07,-0.67ZM183.22,150.47l0.37,1.47l1.12,0.85l4.23,0.7l2.39,0.98l2.17,-0.38l1.85,0.5l-1.55,0.65l-3.49,2.61l-0.16,0.77l0.5,0.39l2.33,-0.61l1.77,1.02l5.15,-2.4l-0.31,0.65l0.25,0.56l1.36,0.38l1.71,1.16l4.7,-0.88l0.67,0.85l1.31,0.21l0.58,0.58l-1.34,0.17l-2.18,-0.32l-3.6,0.89l-2.71,3.25l0.35,0.9l0.59,-0.0l0.55,-0.6l-1.36,4.65l0.29,3.09l0.67,1.58l0.61,0.45l1.77,-0.44l1.6,-1.96l0.14,-2.21l-0.82,-1.96l0.11,-1.13l1.19,-2.37l0.44,-0.33l0.48,0.75l0.4,-0.29l0.4,-1.37l0.6,-0.47l0.24,-0.8l1.69,0.49l1.65,1.08l-0.03,2.37l-1.27,1.13l-0.0,1.13l0.87,0.36l1.66,-1.29l0.5,0.17l0.5,2.6l-2.49,3.75l0.17,0.61l1.54,0.62l1.48,0.17l1.92,-0.44l4.72,-2.15l2.16,-1.8l-0.05,-1.24l0.75,-0.22l3.92,0.36l2.12,-1.05l0.21,-0.4l-0.28,-1.48l3.27,-2.4l8.32,-0.02l0.56,-0.82l1.9,-0.77l0.93,-1.51l0.74,-2.37l1.58,-1.98l0.92,0.62l1.47,-0.47l0.8,0.66l-0.0,4.09l1.96,2.6l-2.34,1.31l-5.37,2.09l-1.83,2.72l0.02,1.79l0.83,1.59l0.54,0.23l-6.19,0.94l-2.2,0.89l-0.23,0.48l0.45,0.29l2.99,-0.46l-2.19,0.56l-1.13,0.0l-0.15,-0.32l-0.48,0.08l-0.76,0.82l0.22,0.67l0.32,0.06l-0.41,1.62l-1.27,1.58l-1.48,-1.07l-0.49,-0.04l-0.16,0.46l0.52,1.58l0.61,0.59l0.03,0.79l-0.95,1.38l-1.21,-1.22l-0.27,-2.27l-0.35,-0.35l-0.42,0.25l-0.48,1.27l0.33,1.41l-0.97,-0.27l-0.48,0.24l0.18,0.5l1.52,0.83l0.1,2.52l0.79,0.51l0.52,3.42l-1.42,1.88l-2.47,0.8l-1.71,1.66l-1.31,0.25l-1.27,1.03l-0.43,0.99l-2.69,1.78l-2.64,3.03l-0.45,2.12l0.45,2.08l0.85,2.38l1.09,1.9l0.04,1.2l1.16,3.06l-0.18,2.69l-0.55,1.43l-0.47,0.21l-0.89,-0.23l-0.49,-1.18l-0.87,-0.56l-2.75,-5.16l0.48,-1.68l-0.72,-1.78l-2.01,-2.38l-1.12,-0.53l-2.72,1.18l-1.47,-1.35l-1.57,-0.68l-2.99,0.31l-2.17,-0.3l-2.0,0.19l-1.15,0.46l-0.19,0.58l0.39,0.63l0.14,1.34l-0.84,-0.2l-0.84,0.46l-1.58,-0.07l-2.08,-1.44l-2.09,0.33l-1.91,-0.62l-3.73,0.84l-2.39,2.07l-2.54,1.22l-1.45,1.41l-0.61,1.38l0.34,3.71l-0.29,0.02l-3.5,-1.33l-1.25,-3.11l-1.44,-1.5l-2.24,-3.56l-1.76,-1.09l-2.27,-0.01l-1.71,2.07l-1.76,-0.69l-1.16,-0.74l-1.52,-2.98l-3.93,-3.16l-4.34,-0.0l-0.4,0.4l-0.0,0.74l-6.5,0.02l-9.02,-3.14l-0.34,-0.71l-5.7,0.49l-0.43,-1.29l-1.62,-1.61l-1.14,-0.38l-0.55,-0.88l-1.28,-0.13l-1.01,-0.77l-2.22,-0.27l-0.43,-0.3l-0.36,-1.58l-2.4,-2.83l-2.01,-3.85l-0.06,-0.9l-2.92,-3.26l-0.33,-2.29l-1.3,-1.66l0.52,-2.37l-0.09,-2.57l-0.78,-2.3l0.95,-2.82l0.61,-5.68l-0.47,-4.27l-1.46,-4.08l3.19,0.79l1.26,2.83l0.69,0.08l0.69,-1.14l-1.1,-4.79l68.76,-0.0l0.4,-0.4l0.14,-0.86ZM32.44,67.52l1.73,1.97l0.55,0.05l0.99,-0.79l3.65,0.24l-0.09,0.62l0.32,0.45l3.83,0.77l2.61,-0.43l5.19,1.4l4.84,0.43l1.89,0.57l3.42,-0.7l6.14,1.87l-0.03,38.06l0.38,0.4l2.39,0.11l2.31,0.98l3.9,3.99l0.55,0.04l2.4,-2.03l2.16,-1.04l1.2,1.71l3.95,3.14l4.09,6.63l4.2,2.29l0.06,1.83l-1.02,1.23l-1.16,-1.08l-2.04,-1.03l-0.67,-2.89l-3.28,-3.03l-1.65,-3.57l-6.35,-0.32l-2.82,-1.01l-5.26,-3.85l-6.77,-2.04l-3.53,0.3l-4.81,-1.69l-3.25,-1.63l-2.78,0.8l-0.28,0.46l0.44,2.21l-3.91,0.96l-2.26,1.27l-2.3,0.65l-0.27,-1.65l1.05,-3.42l2.49,-1.09l0.16,-0.6l-0.69,-0.96l-0.55,-0.1l-3.19,2.12l-1.78,2.56l-3.55,2.61l-0.04,0.61l1.56,1.52l-2.07,2.29l-5.11,2.57l-0.77,1.66l-3.76,1.77l-0.92,1.73l-2.69,1.38l-1.81,-0.22l-6.95,3.32l-3.97,0.91l4.85,-2.5l2.59,-1.86l3.26,-0.52l1.19,-1.4l3.42,-2.1l2.59,-2.27l0.42,-2.68l1.23,-2.1l-0.04,-0.46l-0.45,-0.11l-2.68,1.03l-0.63,-0.49l-0.53,0.03l-1.05,1.04l-1.36,-1.54l-0.66,0.08l-0.32,0.62l-0.58,-1.14l-0.56,-0.16l-2.41,1.42l-1.07,-0.0l-0.17,-1.75l0.3,-1.71l-1.61,-1.33l-3.41,0.59l-1.96,-1.63l-1.57,-0.84l-0.15,-2.21l-1.7,-1.43l0.82,-1.88l1.99,-2.12l0.88,-1.92l1.71,-0.24l2.04,0.51l1.87,-1.77l1.91,0.25l1.91,-1.23l0.17,-0.43l-0.47,-1.82l-1.07,-0.7l1.39,-1.17l0.12,-0.45l-0.39,-0.26l-1.65,0.07l-2.66,0.88l-0.75,0.78l-1.92,-0.8l-3.46,0.44l-3.44,-0.91l-1.06,-1.61l-2.65,-1.99l2.91,-1.43l5.5,-2.0l1.52,0.0l-0.26,1.62l0.41,0.46l5.29,-0.16l0.3,-0.65l-2.03,-2.59l-3.14,-1.68l-1.79,-2.12l-2.4,-1.83l-3.09,-1.24l1.04,-1.69l4.23,-0.14l3.36,-2.07l0.73,-2.27l2.39,-1.99l2.42,-0.52l4.65,-1.97l2.46,0.23l3.71,-2.35l3.5,0.89ZM37.6,123.41l-2.25,1.23l-0.95,-0.69l-0.29,-1.24l3.21,-1.63l1.42,0.21l0.67,0.7l-1.8,1.42ZM31.06,234.03l0.98,0.47l0.74,0.87l-1.77,1.07l-0.44,-1.53l0.49,-0.89ZM29.34,232.07l0.18,0.05l0.08,0.05l-0.16,0.03l-0.11,-0.14ZM25.16,230.17l0.05,-0.03l0.18,0.22l-0.13,-0.01l-0.1,-0.18ZM5.89,113.26l-1.08,0.41l-2.21,-1.12l1.53,-0.4l1.62,0.28l0.14,0.83Z","name":"United States"},"LV":{"path":"M489.16,122.85l0.96,0.66l0.22,1.65l0.68,1.76l-3.65,1.7l-2.23,-1.58l-1.29,-0.26l-0.68,-0.77l-2.42,0.34l-4.16,-0.23l-2.47,0.9l0.06,-1.98l1.13,-2.06l1.95,-1.02l2.12,2.58l2.01,-0.07l0.38,-0.33l0.44,-2.52l1.76,-0.53l3.06,1.7l2.15,0.07Z","name":"Latvia"},"UY":{"path":"M286.85,372.74l-0.92,1.5l-2.59,1.44l-1.69,-0.52l-1.42,0.26l-2.39,-1.19l-1.52,0.08l-1.27,-1.3l0.16,-1.5l0.56,-0.79l-0.02,-2.73l1.21,-4.74l1.19,-0.21l2.37,2.0l1.08,0.03l4.36,3.17l1.22,1.6l-0.96,1.5l0.61,1.4Z","name":"Uruguay"},"LB":{"path":"M510.37,198.01l-0.88,0.51l1.82,-3.54l0.62,0.08l0.22,0.61l-1.13,0.88l-0.65,1.47Z","name":"Lebanon"},"LA":{"path":"M689.54,248.53l-1.76,-0.74l-0.49,0.15l-0.94,1.46l-1.32,-0.64l0.62,-0.98l0.11,-2.17l-2.04,-2.42l-0.25,-2.65l-1.9,-2.1l-2.15,-0.31l-0.78,0.91l-1.12,0.06l-1.05,-0.4l-2.06,1.2l-0.04,-1.59l0.61,-2.68l-0.36,-0.49l-1.35,-0.1l-0.11,-1.23l-0.96,-0.88l1.96,-1.89l0.39,0.36l1.33,0.07l0.42,-0.45l-0.34,-2.66l0.7,-0.21l1.28,1.81l1.11,2.35l0.36,0.23l2.82,0.02l0.71,1.67l-1.39,0.65l-0.72,0.93l0.13,0.6l2.91,1.51l3.6,5.25l1.88,1.78l0.56,1.62l-0.35,1.96Z","name":"Lao PDR"},"TW":{"path":"M724.01,226.68l-0.74,1.48l-0.9,-1.52l-0.25,-1.74l1.38,-2.44l1.73,-1.74l0.64,0.44l-1.85,5.52Z","name":"Taiwan"},"TT":{"path":"M266.64,259.32l0.28,-1.16l1.13,-0.22l-0.06,1.2l-1.35,0.18Z","name":"Trinidad and Tobago"},"TR":{"path":"M513.21,175.47l3.64,1.17l3.05,-0.44l2.1,0.26l3.11,-1.56l2.46,-0.13l2.19,1.33l0.33,0.82l-0.22,1.33l0.25,0.44l2.28,1.13l-1.17,0.57l-0.21,0.45l0.75,3.2l-0.41,1.16l1.13,1.92l-0.55,0.22l-0.9,-0.67l-2.91,-0.37l-1.24,0.46l-4.23,0.41l-2.81,1.05l-1.91,0.01l-1.52,-0.53l-2.58,0.75l-0.66,-0.45l-0.62,0.3l-0.12,1.45l-0.89,0.84l-0.47,-0.67l0.79,-1.3l-0.41,-0.2l-1.43,0.23l-2.0,-0.63l-2.02,1.65l-3.51,0.3l-2.13,-1.53l-2.7,-0.1l-0.86,1.24l-1.38,0.27l-2.29,-1.44l-2.71,-0.01l-1.37,-2.65l-1.68,-1.52l1.07,-1.99l-0.09,-0.49l-1.27,-1.12l2.37,-2.41l3.7,-0.11l1.28,-2.24l4.49,0.37l3.21,-1.97l2.81,-0.82l3.99,-0.06l4.29,2.07ZM488.79,176.72l-1.72,1.31l-0.5,-0.88l1.37,-2.57l-0.7,-0.85l1.7,-0.63l1.8,0.34l0.46,1.17l1.76,0.78l-2.87,0.32l-1.3,1.01Z","name":"Turkey"},"LK":{"path":"M624.16,268.99l-1.82,0.48l-0.99,-1.67l-0.42,-3.46l0.95,-3.43l1.21,0.98l2.26,4.19l-0.34,2.33l-0.85,0.58Z","name":"Sri Lanka"},"TN":{"path":"M448.1,188.24l-1.0,1.27l-0.02,1.32l0.84,0.88l-0.28,2.09l-1.53,1.32l-0.12,0.42l0.48,1.54l1.42,0.32l0.53,1.11l0.9,0.52l-0.11,1.67l-3.54,2.64l-0.1,2.38l-0.58,0.3l-0.96,-4.45l-1.54,-1.25l-0.16,-0.78l-1.92,-1.56l-0.18,-1.76l1.51,-1.62l0.59,-2.34l-0.38,-2.78l0.42,-1.21l2.45,-1.05l1.29,0.26l-0.06,1.11l0.58,0.38l1.47,-0.73Z","name":"Tunisia"},"TL":{"path":"M734.55,307.93l-0.1,-0.97l4.5,-0.86l-2.82,1.28l-1.59,0.55Z","name":"Timor-Leste"},"TM":{"path":"M553.03,173.76l-0.04,0.34l-0.09,-0.22l0.13,-0.12ZM555.87,172.66l0.45,-0.1l1.48,0.74l2.06,2.43l4.07,-0.18l0.38,-0.51l-0.32,-1.19l1.92,-0.94l1.91,-1.59l2.94,1.39l0.43,2.47l1.19,0.67l2.58,-0.13l0.62,0.4l1.32,3.12l4.54,3.44l2.67,1.45l3.06,1.14l-0.04,1.05l-1.33,-0.75l-0.59,0.19l-0.32,0.84l-2.2,0.81l-0.46,2.13l-1.21,0.74l-1.91,0.42l-0.73,1.33l-1.56,0.31l-2.22,-0.94l-0.2,-2.17l-0.38,-0.36l-1.73,-0.09l-2.76,-2.46l-2.14,-0.4l-2.84,-1.48l-1.78,-0.27l-1.24,0.53l-1.57,-0.08l-2.0,1.69l-1.7,0.43l-0.36,-1.58l0.36,-2.98l-0.22,-0.4l-1.65,-0.84l0.54,-1.69l-0.34,-0.52l-1.22,-0.13l0.36,-1.64l2.22,0.59l2.2,-0.95l0.12,-0.65l-1.77,-1.74l-0.66,-1.57Z","name":"Turkmenistan"},"TJ":{"path":"M597.75,178.82l-2.54,-0.44l-0.47,0.34l-0.24,1.7l0.43,0.45l2.64,-0.22l3.18,0.95l4.39,-0.41l0.56,2.37l0.52,0.29l0.67,-0.24l1.11,0.49l0.21,2.13l-3.76,-0.21l-1.8,1.32l-1.76,0.74l-0.61,-0.58l0.21,-2.23l-0.64,-0.49l-0.07,-0.93l-1.36,-0.66l-0.45,0.07l-1.08,1.01l-0.55,1.48l-1.31,-0.05l-0.95,1.16l-0.9,-0.35l-1.86,0.74l1.26,-2.83l-0.54,-2.17l-1.67,-0.82l0.33,-0.66l2.18,-0.04l1.19,-1.63l0.76,-1.79l2.43,-0.5l-0.26,1.0l0.73,1.05Z","name":"Tajikistan"},"LS":{"path":"M491.06,363.48l-0.49,0.15l-1.49,-1.67l1.1,-1.43l2.19,-1.44l1.51,1.27l-0.98,1.82l-1.23,0.38l-0.62,0.93Z","name":"Lesotho"},"TH":{"path":"M670.27,255.86l-1.41,3.87l0.15,2.0l0.38,0.36l1.38,0.07l0.9,2.04l0.55,2.34l1.4,1.44l1.61,0.38l0.96,0.97l-0.5,0.64l-1.1,0.2l-0.34,-1.18l-2.04,-1.1l-0.63,0.23l-0.63,-0.62l-0.48,-1.3l-2.56,-2.63l-0.73,0.41l0.95,-3.89l2.16,-4.22ZM670.67,254.77l-0.92,-2.18l-0.26,-2.61l-2.14,-3.06l0.71,-0.49l0.89,-2.59l-3.61,-5.45l0.87,-0.51l1.05,-2.58l1.74,-0.18l2.6,-1.59l0.76,0.56l0.13,1.39l0.37,0.36l1.23,0.09l-0.51,2.28l0.05,2.42l0.6,0.34l2.43,-1.42l0.77,0.39l1.47,-0.07l0.71,-0.88l1.48,0.14l1.71,1.88l0.25,2.65l1.92,2.11l-0.1,1.89l-0.61,0.86l-2.22,-0.33l-3.5,0.64l-1.6,2.12l0.36,2.58l-1.51,-0.79l-1.84,-0.01l0.28,-1.52l-0.4,-0.47l-2.21,0.01l-0.4,0.37l-0.19,2.74l-0.34,0.93Z","name":"Thailand"},"TF":{"path":"M596.68,420.38l-3.2,0.18l-0.05,-1.26l0.39,-1.41l1.3,0.78l2.08,0.35l-0.52,1.36Z","name":"Fr. S. Antarctic Lands"},"TG":{"path":"M422.7,257.63l-0.09,1.23l1.53,1.52l0.08,1.09l0.5,0.65l-0.11,5.62l0.49,1.47l-1.31,0.35l-1.02,-2.13l-0.18,-1.12l0.53,-2.19l-0.63,-1.16l-0.22,-3.68l-1.01,-1.4l0.07,-0.28l1.37,0.03Z","name":"Togo"},"TD":{"path":"M480.25,235.49l0.12,9.57l-2.1,0.05l-1.14,1.89l-0.69,1.63l0.34,0.73l-0.66,0.91l0.24,0.89l-0.86,1.95l0.45,0.5l0.6,-0.1l0.34,0.64l0.03,1.38l0.9,1.04l-1.45,0.43l-1.27,1.03l-1.83,2.76l-2.16,1.07l-2.31,-0.15l-0.86,0.25l-0.26,0.49l0.17,0.61l-2.11,1.68l-2.85,0.87l-1.09,-0.57l-0.73,0.66l-1.12,0.1l-1.1,-3.12l-1.25,-0.64l-1.22,-1.22l0.29,-0.64l3.01,0.04l0.35,-0.6l-1.3,-2.2l-0.08,-3.31l-0.97,-1.66l0.22,-1.04l-0.38,-0.48l-1.22,-0.04l0.0,-1.25l-0.98,-1.07l0.96,-3.01l3.25,-2.65l0.13,-3.33l0.95,-5.18l0.52,-1.07l-0.1,-0.48l-0.91,-0.78l-0.2,-0.96l-0.8,-0.58l-0.55,-3.65l2.1,-1.2l19.57,9.83Z","name":"Chad"},"LY":{"path":"M483.48,203.15l-0.75,1.1l0.29,1.39l-0.6,1.83l0.73,2.14l0.0,24.12l-2.48,0.01l-0.41,0.85l-19.41,-9.76l-4.41,2.28l-1.37,-1.33l-3.82,-1.1l-1.14,-1.65l-1.98,-1.23l-1.22,0.32l-0.66,-1.11l-0.17,-1.26l-1.28,-1.69l0.87,-1.19l-0.07,-4.34l0.43,-2.27l-0.86,-3.45l1.13,-0.76l0.22,-1.16l-0.2,-1.03l3.48,-2.61l0.29,-1.94l2.45,0.8l1.18,-0.21l1.98,0.44l3.15,1.18l1.37,2.54l5.72,1.67l2.64,1.35l1.61,-0.72l1.29,-1.34l-0.44,-2.34l0.66,-1.13l1.67,-1.21l1.57,-0.35l3.14,0.53l1.08,1.28l3.99,0.78l0.36,0.54Z","name":"Libya"},"AE":{"path":"M550.76,223.97l1.88,-0.4l3.84,0.02l4.78,-4.75l0.19,0.36l0.26,1.58l-0.81,0.01l-0.39,0.35l-0.08,2.04l-0.81,0.63l-0.01,0.96l-0.66,0.99l-0.39,1.41l-7.08,-1.25l-0.7,-1.96Z","name":"United Arab Emirates"},"VE":{"path":"M240.68,256.69l0.53,0.75l-0.02,1.06l-1.07,1.78l0.95,2.0l0.42,0.22l1.4,-0.44l0.56,-1.83l-0.77,-1.17l-0.1,-1.47l2.82,-0.93l0.26,-0.49l-0.28,-0.96l0.3,-0.28l0.66,1.31l1.96,0.26l1.4,1.22l0.08,0.68l0.39,0.35l4.81,-0.22l1.49,1.11l1.92,0.31l1.67,-0.84l0.22,-0.6l3.44,-0.14l-0.17,0.55l0.86,1.19l2.19,0.35l1.67,1.1l0.37,1.86l0.41,0.32l1.55,0.17l-1.66,1.35l-0.22,0.92l0.65,0.97l-1.67,0.54l-0.3,0.4l0.04,0.99l-0.56,0.57l-0.01,0.55l1.85,2.27l-0.66,0.69l-4.47,1.29l-0.72,0.54l-3.69,-0.9l-0.71,0.27l-0.02,0.7l0.91,0.53l-0.08,1.54l0.35,1.58l0.35,0.31l1.66,0.17l-1.3,0.52l-0.48,1.13l-2.68,0.91l-0.6,0.77l-1.57,0.13l-1.17,-1.13l-0.8,-2.52l-1.25,-1.26l1.02,-1.23l-1.29,-2.95l0.18,-1.62l1.0,-2.21l-0.2,-0.49l-1.14,-0.46l-4.02,0.36l-1.82,-2.1l-1.57,-0.33l-2.99,0.22l-1.06,-0.97l0.25,-1.23l-0.2,-1.01l-0.59,-0.69l-0.29,-1.06l-1.08,-0.39l0.78,-2.79l1.9,-2.11Z","name":"Venezuela"},"AF":{"path":"M600.7,188.88l-1.57,1.3l-0.1,0.48l0.8,2.31l-1.09,1.04l-0.03,1.27l-0.48,0.71l-2.16,-0.08l-0.37,0.59l0.78,1.48l-1.38,0.69l-1.06,1.69l0.06,1.7l-0.65,0.52l-0.91,-0.21l-1.91,0.36l-0.48,0.77l-1.88,0.13l-1.4,1.56l-0.18,2.32l-2.91,1.02l-1.65,-0.23l-0.71,0.55l-1.41,-0.3l-2.41,0.39l-3.52,-1.17l1.96,-2.35l-0.21,-1.78l-0.3,-0.34l-1.63,-0.4l-0.19,-1.58l-0.75,-2.03l0.95,-1.36l-0.19,-0.6l-0.73,-0.28l1.47,-4.8l2.14,0.9l2.12,-0.36l0.74,-1.34l1.77,-0.39l1.54,-0.92l0.63,-2.31l1.87,-0.5l0.49,-0.81l0.94,0.56l2.13,0.11l2.55,0.92l1.95,-0.83l0.65,0.43l0.56,-0.13l0.69,-1.12l1.57,-0.08l0.72,-1.66l0.79,-0.74l0.8,0.39l-0.17,0.56l0.71,0.58l-0.08,2.39l1.11,0.95ZM601.37,188.71l1.73,-0.71l1.43,-1.18l4.03,0.35l-2.23,0.74l-4.95,0.8Z","name":"Afghanistan"},"IQ":{"path":"M530.82,187.47l0.79,0.66l1.26,-0.28l1.46,3.08l1.63,0.94l0.14,1.23l-1.22,1.05l-0.53,2.52l1.73,2.67l3.12,1.62l1.15,1.88l-0.38,1.85l0.39,0.48l0.41,-0.0l0.02,1.07l0.76,0.94l-2.47,-0.1l-1.71,2.44l-4.31,-0.2l-7.02,-5.48l-3.73,-1.94l-2.88,-0.73l-0.85,-2.87l5.45,-3.02l0.95,-3.43l-0.19,-1.96l1.27,-0.7l1.22,-1.7l0.87,-0.36l2.69,0.34Z","name":"Iraq"},"IS":{"path":"M384.14,88.06l-0.37,2.61l2.54,2.51l-2.9,2.75l-9.19,3.4l-9.25,-1.66l1.7,-1.22l-0.1,-0.7l-4.05,-1.47l2.96,-0.53l0.33,-0.43l-0.11,-1.2l-0.33,-0.36l-4.67,-0.85l1.28,-2.04l3.45,-0.56l3.77,2.72l0.44,0.02l3.64,-2.16l3.3,1.08l3.98,-2.16l3.58,0.26Z","name":"Iceland"},"IR":{"path":"M533.43,187.16l-1.27,-2.15l0.42,-0.98l-0.71,-3.04l1.03,-0.5l0.33,0.83l1.26,1.35l2.05,0.51l1.11,-0.16l2.89,-2.11l0.62,-0.14l0.39,0.46l-0.72,1.2l0.06,0.49l1.56,1.53l0.65,0.04l0.67,1.81l2.56,0.83l1.87,1.48l3.69,0.49l3.91,-0.76l0.47,-0.73l2.17,-0.6l1.66,-1.54l1.51,0.08l1.18,-0.53l1.59,0.24l2.83,1.48l1.88,0.3l2.77,2.47l1.77,0.18l0.18,1.99l-1.68,5.49l0.24,0.5l0.61,0.23l-0.82,1.48l0.8,2.18l0.19,1.71l0.3,0.34l1.63,0.4l0.15,1.32l-2.15,2.35l-0.01,0.53l2.21,3.03l2.34,1.24l0.06,2.14l1.24,0.72l0.11,0.69l-3.31,1.27l-1.08,3.03l-9.68,-1.68l-0.99,-3.05l-1.43,-0.73l-2.17,0.46l-2.47,1.26l-2.83,-0.82l-2.46,-2.02l-2.41,-0.8l-3.42,-6.06l-0.48,-0.2l-1.18,0.39l-1.44,-0.82l-0.5,0.08l-0.65,0.74l-0.97,-1.01l-0.02,-1.31l-0.71,-0.39l0.26,-1.81l-1.29,-2.11l-3.13,-1.63l-1.58,-2.43l0.5,-1.9l1.31,-1.26l-0.19,-1.66l-1.74,-1.1l-1.57,-3.3Z","name":"Iran"},"AM":{"path":"M536.99,182.33l-0.28,0.03l-1.23,-2.13l-0.93,0.01l-0.62,-0.66l-0.69,-0.07l-0.96,-0.81l-1.56,-0.62l0.19,-1.12l-0.26,-0.79l2.72,-0.36l1.09,1.01l-0.17,0.92l1.02,0.78l-0.47,0.62l0.08,0.56l2.04,1.23l0.04,1.4Z","name":"Armenia"},"IT":{"path":"M451.59,158.63l3.48,0.94l-0.21,1.17l0.3,0.83l-1.49,-0.24l-2.04,1.1l-0.21,0.39l0.13,1.45l-0.25,1.12l0.82,1.57l2.39,1.63l1.31,2.54l2.79,2.43l2.05,0.08l0.21,0.23l-0.39,0.33l0.09,0.67l4.05,1.97l2.17,1.76l-0.16,0.36l-1.17,-1.08l-2.18,-0.49l-0.44,0.2l-1.05,1.91l0.14,0.54l1.57,0.95l-0.19,0.98l-1.06,0.33l-1.25,2.34l-0.37,0.08l0.0,-0.33l1.0,-2.45l-1.73,-3.17l-1.12,-0.51l-0.88,-1.33l-1.51,-0.51l-1.27,-1.25l-1.75,-0.18l-4.12,-3.21l-1.62,-1.65l-1.03,-3.19l-3.53,-1.36l-1.3,0.51l-1.69,1.41l0.16,-0.72l-0.28,-0.47l-1.14,-0.33l-0.53,-1.96l0.72,-0.78l0.04,-0.48l-0.65,-1.17l0.8,0.39l1.4,-0.23l1.11,-0.84l0.52,0.35l1.19,-0.1l0.75,-1.2l1.53,0.33l1.36,-0.56l0.35,-1.14l1.08,0.32l0.68,-0.64l1.98,-0.44l0.42,0.82ZM459.19,184.75l-0.65,1.65l0.32,1.05l-0.31,0.89l-1.5,-0.85l-4.5,-1.67l0.19,-0.82l2.67,0.23l3.78,-0.48ZM443.93,176.05l1.18,1.66l-0.3,3.32l-1.06,-0.01l-0.77,0.73l-0.53,-0.44l-0.1,-3.37l-0.39,-1.22l1.04,0.01l0.92,-0.68Z","name":"Italy"},"VN":{"path":"M690.56,230.25l-2.7,1.82l-2.09,2.46l-0.63,1.95l4.31,6.45l2.32,1.65l1.43,1.94l1.11,4.59l-0.32,4.24l-1.93,1.54l-2.84,1.61l-2.11,2.15l-2.73,2.06l-0.59,-1.05l0.63,-1.53l-0.13,-0.47l-1.34,-1.04l1.51,-0.71l2.55,-0.18l0.3,-0.63l-0.82,-1.14l4.0,-2.07l0.31,-3.05l-0.57,-1.77l0.42,-2.66l-0.73,-1.97l-1.86,-1.76l-3.63,-5.29l-2.72,-1.46l0.36,-0.47l1.5,-0.64l0.21,-0.52l-0.97,-2.27l-0.37,-0.24l-2.83,-0.02l-2.24,-3.9l0.83,-0.4l4.39,-0.29l2.06,-1.31l1.15,0.89l1.88,0.4l-0.17,1.51l1.35,1.16l1.67,0.45Z","name":"Vietnam"},"AR":{"path":"M249.29,428.93l-2.33,-0.52l-5.83,-0.43l-0.89,-1.66l0.05,-2.37l-0.45,-0.4l-1.43,0.18l-0.67,-0.91l-0.2,-3.13l1.88,-1.47l0.79,-2.04l-0.25,-1.7l1.3,-2.68l0.91,-4.15l-0.22,-1.69l0.85,-0.45l0.2,-0.44l-0.27,-1.16l-0.98,-0.68l0.59,-0.92l-0.05,-0.5l-1.04,-1.07l-0.52,-3.1l0.97,-0.86l-0.42,-3.58l1.2,-5.43l1.38,-0.98l0.16,-0.43l-0.75,-2.79l-0.01,-2.43l1.78,-1.75l0.06,-2.57l1.43,-2.85l0.01,-2.58l-0.69,-0.74l-1.09,-4.52l1.47,-2.7l-0.18,-2.79l0.85,-2.35l1.59,-2.46l1.73,-1.64l0.05,-0.52l-0.6,-0.84l0.44,-0.85l-0.07,-4.19l2.7,-1.44l0.86,-2.75l-0.21,-0.71l1.76,-2.01l2.9,0.57l1.38,1.78l0.68,-0.08l0.87,-1.87l2.39,0.09l4.95,4.77l2.17,0.49l3.0,1.92l2.47,1.0l0.25,0.82l-2.37,3.93l0.23,0.59l5.39,1.16l2.12,-0.44l2.45,-2.16l0.5,-2.38l0.76,-0.31l0.98,1.2l-0.04,1.8l-3.67,2.51l-2.85,2.66l-3.43,3.88l-1.3,5.07l0.01,2.72l-0.54,0.73l-0.36,3.28l3.14,2.64l-0.16,2.11l1.4,1.11l-0.1,1.09l-2.29,3.52l-3.55,1.49l-4.92,0.6l-2.71,-0.29l-0.43,0.51l0.5,1.65l-0.49,2.1l0.38,1.42l-1.19,0.83l-2.36,0.38l-2.3,-1.04l-1.38,0.83l0.41,3.64l1.69,0.91l1.4,-0.71l0.36,0.76l-2.04,0.86l-2.01,1.89l-0.97,4.63l-2.34,0.1l-2.09,1.78l-0.61,2.75l2.46,2.31l2.17,0.63l-0.7,2.32l-2.83,1.73l-1.73,3.86l-2.17,1.22l-1.16,1.67l0.75,3.76l1.04,1.28ZM256.71,438.88l-2.0,0.15l-1.4,-1.22l-3.82,-0.1l-0.0,-5.83l1.6,3.05l3.26,2.07l3.08,0.78l-0.71,1.1Z","name":"Argentina"},"AU":{"path":"M705.8,353.26l0.26,0.04l0.17,-0.47l-0.48,-1.42l0.92,1.11l0.45,0.15l0.27,-0.39l-0.1,-1.56l-1.98,-3.63l1.09,-3.31l-0.24,-1.57l0.34,-0.62l0.38,1.06l0.43,-0.19l0.99,-1.7l1.91,-0.83l1.29,-1.15l1.81,-0.91l0.96,-0.17l0.92,0.26l1.92,-0.95l1.47,-0.28l1.03,-0.8l1.43,0.04l2.78,-0.84l1.36,-1.15l0.71,-1.45l1.41,-1.26l0.3,-2.58l1.27,-1.59l0.78,1.65l0.54,0.19l1.07,-0.51l0.15,-0.6l-0.73,-1.0l0.45,-0.71l0.78,0.39l0.58,-0.3l0.28,-1.82l1.87,-2.14l1.12,-0.39l0.28,-0.58l0.62,0.17l0.53,-0.73l1.87,-0.57l1.65,1.05l1.35,1.48l3.39,0.38l0.43,-0.54l-0.46,-1.23l1.05,-1.79l1.04,-0.61l0.14,-0.55l-0.25,-0.41l0.88,-1.17l1.31,-0.77l1.3,0.27l2.1,-0.48l0.31,-0.4l-0.05,-1.3l-0.92,-0.77l1.48,0.56l1.41,1.07l2.11,0.65l0.81,-0.2l1.4,0.7l1.69,-0.66l0.8,0.19l0.64,-0.33l0.71,0.77l-1.33,1.94l-0.71,0.07l-0.35,0.51l0.24,0.86l-1.52,2.35l0.12,1.05l2.15,1.65l1.97,0.85l3.04,2.36l1.97,0.65l0.55,0.88l2.72,0.85l1.84,-1.1l2.07,-5.97l-0.42,-3.59l0.3,-1.73l0.47,-0.87l-0.31,-0.68l1.09,-3.28l0.46,-0.47l0.4,0.71l0.16,1.51l0.65,0.52l0.16,1.04l0.85,1.21l0.12,2.38l0.9,2.0l0.57,0.18l1.3,-0.78l1.69,1.7l-0.2,1.08l0.53,2.2l0.39,1.3l0.68,0.48l0.6,1.95l-0.19,1.48l0.81,1.76l6.01,3.69l-0.11,0.76l1.38,1.58l0.95,2.77l0.58,0.22l0.72,-0.41l0.8,0.9l0.61,0.01l0.46,2.41l4.81,4.71l0.66,2.02l-0.07,3.31l1.14,2.2l-0.13,2.24l-1.1,3.68l0.03,1.64l-0.47,1.89l-1.05,2.4l-1.9,1.47l-1.72,3.51l-2.38,6.09l-0.24,2.82l-1.14,0.8l-2.85,0.15l-2.31,1.19l-2.51,2.25l-3.09,-1.57l0.3,-1.15l-0.54,-0.47l-1.5,0.63l-2.01,1.94l-7.12,-2.18l-1.48,-1.63l-1.14,-3.74l-1.45,-1.26l-1.81,-0.26l0.56,-1.18l-0.61,-2.1l-0.72,-0.1l-1.14,1.82l-0.9,0.21l0.63,-0.82l0.36,-1.55l0.92,-1.31l-0.13,-2.34l-0.7,-0.22l-2.0,2.34l-1.51,0.93l-0.94,2.01l-1.35,-0.81l-0.02,-1.52l-1.57,-2.04l-1.09,-0.88l0.24,-0.33l-0.14,-0.59l-3.21,-1.69l-1.83,-0.12l-2.54,-1.35l-4.58,0.28l-6.02,1.9l-2.53,-0.13l-2.62,1.41l-2.13,0.63l-1.49,2.6l-3.49,0.31l-2.29,-0.5l-3.48,0.43l-1.6,1.47l-0.81,-0.04l-2.37,1.63l-3.26,-0.1l-3.72,-2.21l0.04,-1.05l1.19,-0.46l0.49,-0.89l0.21,-2.97l-0.28,-1.64l-1.34,-2.86l-0.38,-1.47l0.05,-1.72l-0.95,-1.7l-0.18,-0.97l-1.01,-0.99l-0.29,-1.98l-1.13,-1.75ZM784.92,393.44l2.65,1.02l3.23,-0.96l1.09,0.14l0.15,3.06l-0.85,1.13l-0.17,1.63l-0.87,-0.24l-1.57,1.91l-1.68,-0.18l-1.4,-2.36l-0.37,-2.04l-1.39,-2.51l0.04,-0.8l1.15,0.18Z","name":"Australia"},"IL":{"path":"M507.76,203.05l0.4,-0.78l0.18,0.4l-0.33,1.03l0.52,0.44l0.68,-0.22l-0.86,3.6l-1.16,-3.32l0.59,-0.74l-0.03,-0.41ZM508.73,200.34l0.37,-1.02l0.64,0.0l0.52,-0.51l-0.49,1.53l-0.56,-0.24l-0.48,0.23Z","name":"Israel"},"IN":{"path":"M623.34,207.03l-1.24,1.04l-0.97,2.55l0.22,0.51l8.04,3.87l3.42,0.37l1.57,1.38l4.92,0.88l2.18,-0.04l0.38,-0.3l0.29,-1.24l-0.32,-1.64l0.14,-0.87l0.82,-0.31l0.45,2.48l2.28,1.02l1.77,-0.38l4.14,0.1l0.38,-0.36l0.18,-1.66l-0.5,-0.65l1.37,-0.29l2.25,-1.99l2.7,-1.62l1.93,0.62l1.8,-0.98l0.79,1.14l-0.68,0.91l0.26,0.63l2.42,0.36l0.09,0.47l-0.83,0.75l0.13,1.07l-1.52,-0.29l-3.24,1.86l-0.13,1.78l-1.32,2.14l-0.18,1.39l-0.93,1.82l-1.64,-0.5l-0.52,0.37l-0.09,2.63l-0.56,1.11l0.19,0.81l-0.53,0.27l-1.18,-3.73l-1.08,-0.27l-0.38,0.31l-0.24,1.0l-0.66,-0.66l0.54,-1.06l1.22,-0.34l1.15,-2.25l-0.24,-0.56l-1.57,-0.47l-4.34,-0.28l-0.18,-1.56l-0.35,-0.35l-1.11,-0.12l-1.91,-1.12l-0.56,0.17l-0.88,1.82l0.11,0.49l1.36,1.07l-1.09,0.69l-0.69,1.11l0.18,0.56l1.24,0.57l-0.32,1.54l0.85,1.94l0.36,2.01l-0.22,0.59l-4.58,0.52l-0.33,0.42l0.13,1.8l-1.17,1.36l-3.65,1.81l-2.79,3.03l-4.32,3.28l-0.18,1.27l-4.65,1.79l-0.77,2.16l0.64,5.3l-1.06,2.49l-0.01,3.94l-1.24,0.28l-1.14,1.93l0.39,0.84l-1.68,0.53l-1.04,1.83l-0.65,0.47l-2.06,-2.05l-2.1,-6.02l-2.2,-3.64l-1.05,-4.75l-2.29,-3.57l-1.76,-8.2l0.01,-3.11l-0.49,-2.53l-0.55,-0.29l-3.53,1.52l-1.53,-0.27l-2.86,-2.77l0.85,-0.67l0.08,-0.55l-0.74,-1.03l-2.67,-2.06l1.24,-1.32l5.34,0.01l0.39,-0.49l-0.5,-2.29l-1.42,-1.46l-0.27,-1.93l-1.43,-1.2l2.31,-2.37l3.05,0.06l2.62,-2.85l1.6,-2.81l2.4,-2.73l0.07,-2.04l1.97,-1.48l-0.02,-0.65l-1.93,-1.31l-0.82,-1.78l-0.8,-2.21l0.9,-0.89l3.59,0.65l2.92,-0.42l2.33,-2.19l2.31,2.85l-0.24,2.13l0.99,1.59l-0.05,0.82l-1.34,-0.28l-0.47,0.48l0.7,3.06l2.62,1.99l2.99,1.65Z","name":"India"},"TZ":{"path":"M495.56,296.42l2.8,-3.12l-0.02,-0.81l-0.64,-1.3l0.68,-0.52l0.14,-1.47l-0.76,-1.25l0.31,-0.11l2.26,0.03l-0.51,2.76l0.76,1.3l0.5,0.12l1.05,-0.53l1.19,-0.12l0.61,0.24l1.43,-0.62l0.1,-0.67l-0.71,-0.62l1.57,-1.7l8.65,4.86l0.32,1.53l3.34,2.33l-1.05,2.8l0.13,1.61l1.63,1.12l-0.6,1.76l-0.01,2.33l1.89,4.03l0.57,0.43l-1.46,1.08l-2.61,0.94l-1.43,-0.04l-1.06,0.77l-2.29,0.36l-2.87,-0.68l-0.83,0.07l-0.63,-0.75l-0.31,-2.78l-1.32,-1.35l-3.25,-0.77l-3.96,-1.58l-1.18,-2.41l-0.32,-1.75l-1.76,-1.49l0.42,-1.05l-0.44,-0.89l0.08,-0.96l-0.46,-0.58l0.06,-0.56Z","name":"Tanzania"},"AZ":{"path":"M539.29,175.73l1.33,0.32l1.94,-1.8l2.3,3.34l1.43,0.43l-1.26,0.15l-0.35,0.32l-0.8,3.14l-0.99,0.96l0.05,1.11l-1.26,-1.13l0.7,-1.18l-0.04,-0.47l-0.74,-0.86l-1.48,0.15l-2.34,1.71l-0.03,-1.27l-2.03,-1.35l0.47,-0.62l-0.08,-0.56l-1.03,-0.79l0.29,-0.43l-0.14,-0.58l-1.13,-0.86l1.89,0.68l1.69,0.06l0.37,-0.87l-0.81,-1.37l0.42,0.06l1.63,1.72ZM533.78,180.57l0.61,0.46l0.69,-0.0l0.59,1.15l-0.68,-0.15l-1.21,-1.45Z","name":"Azerbaijan"},"IE":{"path":"M405.08,135.42l0.35,2.06l-1.75,2.78l-4.22,1.88l-2.84,-0.4l1.73,-3.0l-1.18,-3.53l4.6,-3.74l0.32,1.15l-0.49,1.74l0.4,0.51l1.47,-0.04l1.6,0.6Z","name":"Ireland"},"ID":{"path":"M756.47,287.89l0.69,4.01l2.79,1.78l0.51,-0.1l2.04,-2.59l2.71,-1.43l2.05,-0.0l3.9,1.73l2.46,0.45l0.08,15.12l-1.75,-1.54l-2.54,-0.51l-0.88,0.71l-2.32,0.06l0.69,-1.33l1.45,-0.64l0.23,-0.46l-0.65,-2.74l-1.24,-2.21l-5.04,-2.29l-2.09,-0.23l-3.68,-2.27l-0.55,0.13l-0.65,1.07l-0.52,0.12l-0.55,-1.89l-1.21,-0.78l1.84,-0.62l1.72,0.05l0.39,-0.52l-0.21,-0.66l-0.38,-0.28l-3.45,-0.0l-1.13,-1.48l-2.1,-0.43l-0.52,-0.6l2.69,-0.48l1.28,-0.78l3.66,0.94l0.3,0.71ZM757.91,300.34l-0.62,0.82l-0.1,-0.8l0.59,-1.12l0.13,1.1ZM747.38,292.98l0.34,0.72l-1.22,-0.57l-4.68,-0.1l0.27,-0.62l2.78,-0.09l2.52,0.67ZM741.05,285.25l-0.67,-2.88l0.64,-2.01l0.41,0.86l1.21,0.18l0.16,0.7l-0.1,1.68l-0.84,-0.16l-0.46,0.3l-0.34,1.34ZM739.05,293.5l-0.5,0.44l-1.34,-0.36l-0.17,-0.37l1.73,-0.08l0.27,0.36ZM721.45,284.51l-0.19,1.97l2.24,2.23l0.54,0.02l1.27,-1.07l2.75,-0.5l-0.9,1.21l-2.11,0.93l-0.16,0.6l2.22,3.01l-0.3,1.07l1.36,1.74l-2.26,0.85l-0.28,-0.31l0.12,-1.19l-1.64,-1.34l0.17,-2.23l-0.56,-0.39l-1.67,0.76l-0.23,0.39l0.3,6.17l-1.1,0.25l-0.69,-0.47l0.64,-2.21l-0.39,-2.42l-0.39,-0.34l-0.8,-0.01l-0.58,-1.29l0.98,-1.6l0.35,-1.96l1.32,-3.87ZM728.59,296.27l0.38,0.49l-0.02,1.28l-0.88,0.49l-0.53,-0.47l1.04,-1.79ZM729.04,286.98l0.27,-0.05l-0.02,0.13l-0.24,-0.08ZM721.68,284.05l0.16,-0.32l1.89,-1.65l1.83,0.68l3.16,0.35l2.94,-0.1l2.39,-1.66l-1.73,2.13l-1.66,0.43l-2.41,-0.48l-4.17,0.13l-2.39,0.51ZM730.55,310.47l1.11,-1.93l2.03,-0.82l0.08,0.62l-1.45,1.67l-1.77,0.46ZM728.12,305.88l-0.1,0.38l-3.46,0.66l-2.91,-0.27l-0.0,-0.25l1.54,-0.41l1.66,0.73l1.67,-0.19l1.61,-0.65ZM722.9,310.24l-0.64,0.03l-2.26,-1.2l1.11,-0.24l1.78,1.41ZM716.26,305.77l0.88,0.51l1.28,-0.17l0.2,0.35l-4.65,0.73l0.39,-0.67l1.15,-0.02l0.75,-0.73ZM711.66,293.84l-0.38,-0.16l-2.54,1.01l-1.12,-1.44l-1.69,-0.13l-1.16,-0.75l-3.04,0.77l-1.1,-1.15l-3.31,-0.11l-0.35,-3.05l-1.35,-0.95l-1.11,-1.98l-0.33,-2.06l0.27,-2.14l0.9,-1.01l0.37,1.15l2.09,1.49l1.53,-0.48l1.82,0.08l1.38,-1.19l1.0,-0.18l2.28,0.67l2.26,-0.53l1.52,-3.64l1.01,-0.99l0.78,-2.57l4.1,0.3l-1.11,1.77l0.02,0.46l1.7,2.2l-0.23,1.39l2.07,1.71l-2.33,0.42l-0.88,1.9l0.1,2.05l-2.4,1.9l-0.06,2.45l-0.7,2.79ZM692.58,302.03l0.35,0.26l4.8,0.25l0.78,-0.97l4.17,1.09l1.13,1.68l3.69,0.45l2.13,1.04l-1.8,0.6l-2.77,-0.99l-4.8,-0.12l-5.24,-1.41l-1.84,-0.25l-1.11,0.3l-4.26,-0.97l-0.7,-1.14l-1.59,-0.13l1.18,-1.65l2.74,0.13l2.87,1.13l0.26,0.68ZM685.53,299.17l-2.22,0.04l-2.06,-2.03l-3.15,-2.01l-2.93,-3.51l-3.11,-5.33l-2.2,-2.12l-1.64,-4.06l-2.32,-1.69l-1.27,-2.07l-1.96,-1.5l-2.51,-2.65l-0.11,-0.66l4.81,0.53l2.15,2.38l3.31,2.74l2.35,2.66l2.7,0.17l1.95,1.59l1.54,2.17l1.59,0.95l-0.84,1.71l0.15,0.52l1.44,0.87l0.79,0.1l0.4,1.58l0.87,1.4l1.96,0.39l1.0,1.31l-0.6,3.01l-0.09,3.5Z","name":"Indonesia"},"UA":{"path":"M492.5,162.44l1.28,-2.49l1.82,0.19l0.66,-0.23l0.09,-0.71l-0.25,-0.75l-0.79,-0.72l-0.33,-1.21l-0.86,-0.62l-0.02,-1.19l-1.13,-0.86l-1.15,-0.19l-2.04,-1.0l-1.66,0.32l-0.66,0.47l-0.92,-0.0l-0.84,0.78l-2.48,0.7l-1.18,-0.71l-3.07,-0.36l-0.89,0.43l-0.24,-0.55l-1.11,-0.7l0.35,-0.93l1.26,-1.02l-0.54,-1.23l2.04,-2.43l1.4,-0.62l0.25,-1.19l-1.04,-2.39l0.83,-0.13l1.28,-0.84l1.8,-0.07l2.47,0.26l2.86,0.81l1.88,0.06l0.86,0.44l1.04,-0.41l0.77,0.66l2.18,-0.15l0.92,0.3l0.52,-0.34l0.15,-1.53l0.56,-0.54l2.85,-0.05l0.84,-0.72l3.04,-0.18l1.23,1.46l-0.48,0.77l0.21,1.03l0.36,0.32l1.8,0.14l0.93,2.08l3.18,1.15l1.94,-0.45l1.67,1.49l1.4,-0.03l3.35,0.96l0.02,0.54l-0.96,1.59l0.47,1.97l-0.26,0.7l-2.36,0.28l-1.29,0.89l-0.23,1.38l-1.83,0.27l-1.58,0.97l-2.41,0.21l-2.16,1.17l-0.21,0.38l0.34,2.26l1.23,0.75l2.13,-0.08l-0.14,0.31l-2.65,0.53l-3.23,1.69l-0.87,-0.39l0.42,-1.1l-0.25,-0.52l-2.21,-0.73l2.35,-1.06l0.12,-0.65l-0.93,-0.82l-3.62,-0.74l-0.13,-0.89l-0.46,-0.34l-2.61,0.59l-0.91,1.69l-1.71,2.04l-0.86,-0.4l-1.62,0.27Z","name":"Ukraine"},"QA":{"path":"M549.33,221.64l-0.76,-0.23l-0.14,-1.64l0.84,-1.29l0.47,0.52l0.04,1.34l-0.45,1.3Z","name":"Qatar"},"MZ":{"path":"M508.58,318.75l-0.34,-2.57l0.51,-2.05l3.55,0.63l2.5,-0.38l1.02,-0.76l1.49,0.01l2.74,-0.98l1.66,-1.2l0.5,9.24l0.41,1.23l-0.68,1.67l-0.93,1.71l-1.5,1.5l-5.16,2.28l-2.78,2.73l-1.02,0.53l-1.71,1.8l-0.98,0.57l-0.35,2.41l1.16,1.94l0.49,2.17l0.43,0.31l-0.06,2.06l-0.39,1.17l0.5,0.72l-0.25,0.73l-0.92,0.83l-5.12,2.39l-1.22,1.36l0.21,1.13l0.58,0.39l-0.11,0.72l-1.22,-0.01l-0.73,-2.97l0.42,-3.09l-1.78,-5.37l2.49,-2.81l0.69,-1.89l0.44,-0.43l0.28,-1.53l-0.39,-0.93l0.59,-3.65l-0.01,-3.26l-1.49,-1.16l-1.2,-0.22l-1.74,-1.17l-1.92,0.01l-0.29,-2.08l7.06,-1.96l1.28,1.09l0.89,-0.1l0.67,0.44l0.1,0.73l-0.51,1.29l0.19,1.81l1.75,1.83l0.65,-0.13l0.71,-1.65l1.17,-0.86l-0.26,-3.47l-1.05,-1.85l-1.04,-0.94Z","name":"Mozambique"}},"height":440.70631074413296,"projection":{"type":"mill","centralMeridian":11.5},"width":900.0})