PageSourceSearch

https://www.columbista.com/assets/js-compress/9b7e42dd7e171f5952962238b0285c92.js?v=1785000849

js columbista.com collected 2026-10-02 17:47:13 UTC 677,953 bytes, 15,579 lines download raw bytes

vendor: 6,365 bytes, lines 1-49
1/*!
2 * jQuery JavaScript Library v3.5.1
3 * https://jquery.com/
4 *
5 * Includes Sizzle.js
6 * https://sizzlejs.com/
7 *
8 * Copyright JS Foundation and other contributors
9 * Released under the MIT license
10 * https://jquery.org/license
11 *
12 * Date: 2020-05-04T22:49Z
13 */
14(function(global,factory){"use strict";if(typeof module==="object"&&typeof module.exports==="object"){module.exports=global.document?factory(global,true):function(w){if(!w.document){throw new Error("jQuery requires a window with a document");}
15return 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";};var isWindow=function isWindow(obj){return obj!=null&&obj===obj.window;};var document=window.document;var preservedScriptAttributes={type:true,src:true,nonce:true,noModule:true};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);}}}
16doc.head.appendChild(script).parentNode.removeChild(script);}
17function toType(obj){if(obj==null){return obj+"";}
18return typeof obj==="object"||typeof obj==="function"?class2type[toString.call(obj)]||"object":typeof obj;}
19var
20version="3.5.1",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);}
21return 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=false;if(typeof target==="boolean"){deep=target;target=arguments[i]||{};i++;}
22if(typeof target!=="object"&&!isFunction(target)){target={};}
23if(i===length){target=this;i--;}
24for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){copy=options[name];if(name==="__proto__"||target===copy){continue;}
25if(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;}
26copyIsArray=false;target[name]=jQuery.extend(deep,clone,copy);}else if(copy!==undefined){target[name]=copy;}}}}
27return target;};jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:true,error:function(msg){throw new Error(msg);},noop:function(){},isPlainObject:function(obj){var proto,Ctor;if(!obj||toString.call(obj)!=="[object Object]"){return false;}
28proto=getProto(obj);if(!proto){return true;}
29Ctor=hasOwn.call(proto,"constructor")&&proto.constructor;return typeof Ctor==="function"&&fnToString.call(Ctor)===ObjectFunctionString;},isEmptyObject:function(obj){var name;for(name in obj){return false;}
30return true;},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])===false){break;}}}else{for(i in obj){if(callback.call(obj[i],i,obj[i])===false){break;}}}
31return obj;},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);}}
32return ret;},inArray:function(elem,arr,i){return arr==null?-1:indexOf.call(arr,elem,i);},merge:function(first,second){var len=+second.length,j=0,i=first.length;for(;j<len;j++){first[i++]=second[j];}
33first.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]);}}
34return 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);}}}
35return flat(ret);},guid:1,support:support});if(typeof Symbol==="function"){jQuery.fn[Symbol.iterator]=arr[Symbol.iterator];}
36jQuery.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 false;}
37return type==="array"||length===0||typeof length==="number"&&length>0&&(length-1)in obj;}
38var Sizzle=
39/*!
40 * Sizzle CSS Selector Engine v2.3.5
41 * https://sizzlejs.com/
42 *
43 * Copyright JS Foundation and other contributors
44 * Released under the MIT license
45 * https://js.foundation/
46 *
47 * Date: 2020-03-14
48 */
49(function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,
vendor: 30,065 bytes, lines 49-181
49setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date(),preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),nonnativeSelectorCache=createCache(),sortOrder=function(a,b){if(a===b){hasDuplicate=true;}
50return 0;},hasOwn=({}).hasOwnProperty,arr=[],pop=arr.pop,pushNative=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){var i=0,len=list.length;for(;i<len;i++){if(list[i]===elem){return i;}}
51return-1;},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|"+"ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",identifier="(?:\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",attributes="\\["+whitespace+"*("+identifier+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+
52whitespace+"*\\]",pseudos=":("+identifier+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|"+".*"+")\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+
53whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=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)(?:\\("+
54whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+
55whitespace+"*(\\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")},rhtml=/HTML$/i,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,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;return nonHex?nonHex:high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00);},rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,fcssescape=function(ch,asCodePoint){if(asCodePoint){if(ch==="\0"){return"\uFFFD";}
56return ch.slice(0,-1)+"\\"+
57ch.charCodeAt(ch.length-1).toString(16)+" ";}
58return"\\"+ch;},unloadHandler=function(){setDocument();},inDisabledFieldset=addCombinator(function(elem){return elem.disabled===true&&elem.nodeName.toLowerCase()==="fieldset";},{dir:"parentNode",next:"legend"});try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType;}catch(e){push={apply:arr.length?function(target,els){pushNative.apply(target,slice.call(els));}:function(target,els){var j=target.length,i=0;while((target[j++]=els[i++])){}
59target.length=j-1;}};}
60function Sizzle(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;}
61if(!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){results.push(elem);return results;}}else{return results;}}else{if(newContext&&(elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results;}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results;}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results;}}
62if(support.qsa&&!nonnativeSelectorCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))&&(nodeType!==1||context.nodeName.toLowerCase()!=="object")){newSelector=selector;newContext=context;if(nodeType===1&&(rdescend.test(selector)||rcombinators.test(selector))){newContext=rsibling.test(selector)&&testContext(context.parentNode)||context;if(newContext!==context||!support.scope){if((nid=context.getAttribute("id"))){nid=nid.replace(rcssescape,fcssescape);}else{context.setAttribute("id",(nid=expando));}}
63groups=tokenize(selector);i=groups.length;while(i--){groups[i]=(nid?"#"+nid:":scope")+" "+
64toSelector(groups[i]);}
65newSelector=groups.join(",");}
66try{push.apply(results,newContext.querySelectorAll(newSelector));return results;}catch(qsaError){nonnativeSelectorCache(selector,true);}finally{if(nid===expando){context.removeAttribute("id");}}}}}
67return select(selector.replace(rtrim,"$1"),context,results,seed);}
68function createCache(){var keys=[];function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()];}
69return(cache[key+" "]=value);}
70return cache;}
71function markFunction(fn){fn[expando]=true;return fn;}
72function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el);}catch(e){return false;}finally{if(el.parentNode){el.parentNode.removeChild(el);}
73el=null;}}
74function addHandle(attrs,handler){var arr=attrs.split("|"),i=arr.length;while(i--){Expr.attrHandle[arr[i]]=handler;}}
75function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&a.sourceIndex-b.sourceIndex;if(diff){return diff;}
76if(cur){while((cur=cur.nextSibling)){if(cur===b){return-1;}}}
77return a?1:-1;}
78function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type;};}
79function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&elem.type===type;};}
80function createDisabledPseudo(disabled){return function(elem){if("form"in elem){if(elem.parentNode&&elem.disabled===false){if("label"in elem){if("label"in elem.parentNode){return elem.parentNode.disabled===disabled;}else{return elem.disabled===disabled;}}
81return elem.isDisabled===disabled||elem.isDisabled!==!disabled&&inDisabledFieldset(elem)===disabled;}
82return elem.disabled===disabled;}else if("label"in elem){return elem.disabled===disabled;}
83return false;};}
84function 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]);}}});});}
85function testContext(context){return context&&typeof context.getElementsByTagName!=="undefined"&&context;}
86support=Sizzle.support={};isXML=Sizzle.isXML=function(elem){var namespace=elem.namespaceURI,docElem=(elem.ownerDocument||elem).documentElement;return!rhtml.test(namespace||docElem&&docElem.nodeName||"HTML");};setDocument=Sizzle.setDocument=function(node){var hasCompare,subWindow,doc=node?node.ownerDocument||node:preferredDoc;if(doc==document||doc.nodeType!==9||!doc.documentElement){return document;}
87document=doc;docElem=document.documentElement;documentIsHTML=!isXML(document);if(preferredDoc!=document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow){if(subWindow.addEventListener){subWindow.addEventListener("unload",unloadHandler,false);}else if(subWindow.attachEvent){subWindow.attachEvent("onunload",unloadHandler);}}
88support.scope=assert(function(el){docElem.appendChild(el).appendChild(document.createElement("div"));return typeof el.querySelectorAll!=="undefined"&&!el.querySelectorAll(":scope fieldset div").length;});support.attributes=assert(function(el){el.className="i";return!el.getAttribute("className");});support.getElementsByTagName=assert(function(el){el.appendChild(document.createComment(""));return!el.getElementsByTagName("*").length;});support.getElementsByClassName=rnative.test(document.getElementsByClassName);support.getById=assert(function(el){docElem.appendChild(el).id=expando;return!document.getElementsByName||!document.getElementsByName(expando).length;});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];}
89elems=context.getElementsByName(id);i=0;while((elem=elems[i++])){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem];}}}
90return[];}};}
91Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(tag);}else if(support.qsa){return context.querySelectorAll(tag);}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while((elem=results[i++])){if(elem.nodeType===1){tmp.push(elem);}}
92return tmp;}
93return results;};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(typeof context.getElementsByClassName!=="undefined"&&documentIsHTML){return context.getElementsByClassName(className);}};rbuggyMatches=[];rbuggyQSA=[];if((support.qsa=rnative.test(document.querySelectorAll))){assert(function(el){var input;docElem.appendChild(el).innerHTML="<a id='"+expando+"'></a>"+"<select id='"+expando+"-\r\\' msallowcapture=''>"+"<option selected=''></option></select>";if(el.querySelectorAll("[msallowcapture^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")");}
94if(!el.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")");}
95if(!el.querySelectorAll("[id~="+expando+"-]").length){rbuggyQSA.push("~=");}
96input=document.createElement("input");input.setAttribute("name","");el.appendChild(input);if(!el.querySelectorAll("[name='']").length){rbuggyQSA.push("\\["+whitespace+"*name"+whitespace+"*="+
97whitespace+"*(?:''|\"\")");}
98if(!el.querySelectorAll(":checked").length){rbuggyQSA.push(":checked");}
99if(!el.querySelectorAll("a#"+expando+"+*").length){rbuggyQSA.push(".#.+[+~]");}
100el.querySelectorAll("\\\f");rbuggyQSA.push("[\\r\\n\\f]");});assert(function(el){el.innerHTML="<a href='' disabled='disabled'></a>"+"<select disabled='disabled'><option/></select>";var input=document.createElement("input");input.setAttribute("type","hidden");el.appendChild(input).setAttribute("name","D");if(el.querySelectorAll("[name=d]").length){rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?=");}
101if(el.querySelectorAll(":enabled").length!==2){rbuggyQSA.push(":enabled",":disabled");}
102docElem.appendChild(el).disabled=true;if(el.querySelectorAll(":disabled").length!==2){rbuggyQSA.push(":enabled",":disabled");}
103el.querySelectorAll("*,:x");rbuggyQSA.push(",.*:");});}
104if((support.matchesSelector=rnative.test((matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)))){assert(function(el){support.disconnectedMatch=matches.call(el,"*");matches.call(el,"[s!='']:x");rbuggyMatches.push("!=",pseudos);});}
105rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));hasCompare=rnative.test(docElem.compareDocumentPosition);contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16));}:function(a,b){if(b){while((b=b.parentNode)){if(b===a){return true;}}}
106return false;};sortOrder=hasCompare?function(a,b){if(a===b){hasDuplicate=true;return 0;}
107var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(compare){return compare;}
108compare=(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&&contains(preferredDoc,a)){return-1;}
109if(b==document||b.ownerDocument==preferredDoc&&contains(preferredDoc,b)){return 1;}
110return sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;}
111return compare&4?-1:1;}:function(a,b){if(a===b){hasDuplicate=true;return 0;}
112var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup){return a==document?-1:b==document?1:aup?-1:bup?1:sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;}else if(aup===bup){return siblingCheck(a,b);}
113cur=a;while((cur=cur.parentNode)){ap.unshift(cur);}
114cur=b;while((cur=cur.parentNode)){bp.unshift(cur);}
115while(ap[i]===bp[i]){i++;}
116return i?siblingCheck(ap[i],bp[i]):ap[i]==preferredDoc?-1:bp[i]==preferredDoc?1:0;};return document;};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements);};Sizzle.matchesSelector=function(elem,expr){setDocument(elem);if(support.matchesSelector&&documentIsHTML&&!nonnativeSelectorCache[expr+" "]&&(!rbuggyMatches||!rbuggyMatches.test(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,true);}}
117return Sizzle(expr,document,null,[elem]).length>0;};Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!=document){setDocument(context);}
118return contains(context,elem);};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem)!=document){setDocument(elem);}
119var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val!==undefined?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null;};Sizzle.escape=function(sel){return(sel+"").replace(rcssescape,fcssescape);};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg);};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i);}}
120while(j--){results.splice(duplicates[j],1);}}
121sortInput=null;return results;};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){while((node=elem[i++])){ret+=getText(node);}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent;}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem);}}}else if(nodeType===3||nodeType===4){return elem.nodeValue;}
122return ret;};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{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]+" ";}
123return match.slice(0,4);},"CHILD":function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0]);}
124match[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]){Sizzle.error(match[0]);}
125return match;},"PSEUDO":function(match){var excess,unquoted=!match[6]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null;}
126if(match[3]){match[2]=match[4]||match[5]||"";}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess);}
127return match.slice(0,3);}},filter:{"TAG":function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true;}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName;};},"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=Sizzle.attr(elem,name);if(result==null){return operator==="!=";}
128if(!operator){return true;}
129result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false;};},"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,uniqueCache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=false;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false;}}
130start=dir=type==="only"&&!start&&"nextSibling";}
131return true;}
132start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){node=parent;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[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){uniqueCache[type]=[dirruns,nodeIndex,diff];break;}}}else{if(useCache){node=elem;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex;}
133if(diff===false){while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});uniqueCache[type]=[dirruns,diff];}
134if(node===elem){break;}}}}}
135diff-=last;return diff===first||(diff%first===0&&diff / first>=0);}};},"PSEUDO":function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument);}
136if(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(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i]);}}):function(elem){return fn(elem,0,args);};}
137return fn;}},pseudos:{"not":markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$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 Sizzle(selector,elem).length>0;};}),"contains":markFunction(function(text){text=text.replace(runescape,funescape);return function(elem){return(elem.textContent||getText(elem)).indexOf(text)>-1;};}),"lang":markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang);}
138lang=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 false;};}),"target":function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id;},"root":function(elem){return elem===docElem;},"focus":function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex);},"enabled":createDisabledPseudo(false),"disabled":createDisabledPseudo(true),"checked":function(elem){var nodeName=elem.nodeName.toLowerCase();return(nodeName==="input"&&!!elem.checked)||(nodeName==="option"&&!!elem.selected);},"selected":function(elem){if(elem.parentNode){elem.parentNode.selectedIndex;}
139return elem.selected===true;},"empty":function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return false;}}
140return true;},"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){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button";},"text":function(elem){var attr;return elem.nodeName.toLowerCase()==="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);}
141return matchIndexes;}),"odd":createPositionalPseudo(function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i);}
142return matchIndexes;}),"lt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument>length?length:argument;for(;--i>=0;){matchIndexes.push(i);}
143return matchIndexes;}),"gt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i);}
144return matchIndexes;})}};Expr.pseudos["nth"]=Expr.pseudos["eq"];for(i in{radio:true,checkbox:true,file:true,password:true,image:true}){Expr.pseudos[i]=createInputPseudo(i);}
145for(i in{submit:true,reset:true}){Expr.pseudos[i]=createButtonPseudo(i);}
146function setFilters(){}
147setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters();tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0);}
148soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar;}
149groups.push((tokens=[]));}
150matched=false;if((match=rcombinators.exec(soFar))){matched=match.shift();tokens.push({value:matched,type:match[0].replace(rtrim," ")});soFar=soFar.slice(matched.length);}
151for(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);}}
152if(!matched){break;}}
153return parseOnly?soFar.length:soFar?Sizzle.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;}
154return selector;}
155function 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);}}
156return false;}:function(elem,context,xml){var oldCache,uniqueCache,outerCache,newCache=[dirruns,doneName];if(xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){if(matcher(elem,context,xml)){return true;}}}}else{while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});uniqueCache=outerCache[elem.uniqueID]||(outerCache[elem.uniqueID]={});if(skip&&skip===elem.nodeName.toLowerCase()){elem=elem[dir]||elem;}else if((oldCache=uniqueCache[key])&&oldCache[0]===dirruns&&oldCache[1]===doneName){return(newCache[2]=oldCache[2]);}else{uniqueCache[key]=newCache;if((newCache[2]=matcher(elem,context,xml))){return true;}}}}}
157return false;};}
158function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false;}}
159return true;}:matchers[0];}
160function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i<len;i++){Sizzle(selector,contexts[i],results);}
161return results;}
162function 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);}}}}
163return newUnmatched;}
164function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter);}
165if(postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector);}
166return markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml):elems,matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher){matcher(matcherIn,matcherOut,context,xml);}
167if(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);}}}
168if(seed){if(postFinder||preFilter){if(postFinder){temp=[];i=matcherOut.length;while(i--){if((elem=matcherOut[i])){temp.push((matcherIn[i]=elem));}}
169postFinder(null,(matcherOut=[]),temp,xml);}
170i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(temp=postFinder?indexOf(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);}}});}
171function 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,true),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1;},implicitRelative,true),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;}}
172return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens((tokens=tokens.slice(j))),j<len&&toSelector(tokens));}
173matchers.push(matcher);}}
174return elementMatcher(matchers);}
175function 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;}
176for(;i!==len&&(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;if(!context&&elem.ownerDocument!=document){setDocument(elem);xml=!documentIsHTML;}
177while((matcher=elementMatchers[j++])){if(matcher(elem,context||document,xml)){results.push(elem);break;}}
178if(outermost){dirruns=dirrunsUnique;}}
179if(bySet){if((elem=!matcher&&elem)){matchedCount--;}
180if(seed){unmatched.push(elem);}}}
181matchedCount+=i;
vendor: 6,526 bytes, lines 181-213
181if(bySet&&i!==matchedCount){j=0;while((matcher=setMatchers[j++])){matcher(unmatched,setMatched,context,xml);}
182if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results);}}}
183setMatched=condense(setMatched);}
184push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&(matchedCount+setMatchers.length)>1){Sizzle.uniqueSort(results);}}
185if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup;}
186return unmatched;};return bySet?markFunction(superMatcher):superMatcher;}
187compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){match=tokenize(selector);}
188i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[expando]){setMatchers.push(cached);}else{elementMatchers.push(cached);}}
189cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector;}
190return cached;};select=Sizzle.select=function(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;}
191selector=selector.slice(tokens.shift().value.length);}
192i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[(type=token.type)]){break;}
193if((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;}
194break;}}}}
195(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;support.detectDuplicates=!!hasDuplicate;setDocument();support.sortDetached=assert(function(el){return el.compareDocumentPosition(document.createElement("fieldset"))&1;});if(!assert(function(el){el.innerHTML="<a href='#'></a>";return el.firstChild.getAttribute("href")==="#";})){addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,name.toLowerCase()==="type"?1:2);}});}
196if(!support.attributes||!assert(function(el){el.innerHTML="<input/>";el.firstChild.setAttribute("value","");return el.firstChild.getAttribute("value")==="";})){addHandle("value",function(elem,_name,isXML){if(!isXML&&elem.nodeName.toLowerCase()==="input"){return elem.defaultValue;}});}
197if(!assert(function(el){return el.getAttribute("disabled")==null;})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return elem[name]===true?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null;}});}
198return Sizzle;})(window);jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;jQuery.escapeSelector=Sizzle.escape;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;}
199matched.push(elem);}}
200return matched;};var siblings=function(n,elem){var matched=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){matched.push(n);}}
201return matched;};var rneedsContext=jQuery.expr.match.needsContext;function nodeName(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase();};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;});}
202if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not;});}
203if(typeof qualifier!=="string"){return jQuery.grep(elements,function(elem){return(indexOf.call(qualifier,elem)>-1)!==not;});}
204return jQuery.filter(qualifier,elements,not);}
205jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")";}
206if(elems.length===1&&elem.nodeType===1){return jQuery.find.matchesSelector(elem,expr)?[elem]:[];}
207return 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 true;}}}));}
208ret=this.pushStack([]);for(i=0;i<len;i++){jQuery.find(selector,self[i],ret);}
209return len>1?jQuery.uniqueSort(ret):ret;},filter:function(selector){return this.pushStack(winnow(this,selector||[],false));},not:function(selector){return this.pushStack(winnow(this,selector||[],true));},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length;}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector){return this;}
210root=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);}
211if(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,true));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]);}}}
212return this;}else{elem=document.getElementById(match[2]);if(elem){this[0]=elem;this.length=1;}
213return 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;}
vendor: 18,121 bytes, lines 213-299
213else if(isFunction(selector)){return root.ready!==undefined?root.ready(selector):selector(jQuery);}
214return jQuery.makeArray(selector,this);};init.prototype=jQuery.fn;rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:true,contents:true,next:true,prev:true};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 true;}}});},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;}}}}
215return 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;}
216if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0]);}
217return 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){}
218return cur;}
219jQuery.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;}
220if(nodeName(elem,"template")){elem=elem.content||elem;}
221return 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;}
222if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched);}
223if(this.length>1){if(!guaranteedUnique[name]){jQuery.uniqueSort(matched);}
224if(rparentsprev.test(name)){matched.reverse();}}
225return 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]=true;});return object;}
226jQuery.Callbacks=function(options){options=typeof options==="string"?createOptions(options):jQuery.extend({},options);var
227firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){locked=locked||options.once;fired=firing=true;for(;queue.length;firingIndex=-1){memory=queue.shift();while(++firingIndex<list.length){if(list[firingIndex].apply(memory[0],memory[1])===false&&options.stopOnFalse){firingIndex=list.length;memory=false;}}}
228if(!options.memory){memory=false;}
229firing=false;if(locked){if(memory){list=[];}else{list="";}}},self={add:function(){if(list){if(memory&&!firing){firingIndex=list.length-1;queue.push(memory);}
230(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();}}
231return 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=[];}
232return this;},disable:function(){locked=queue=[];list=memory="";return this;},disabled:function(){return!list;},lock:function(){locked=queue=[];if(!memory&&!firing){list=memory="";}
233return 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();}}
234return this;},fire:function(){self.fireWith(this,arguments);return this;},fired:function(){return!!fired;}};return self;};function Identity(v){return v;}
235function Thrower(ex){throw ex;}
236function 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]);}}
237jQuery.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;}
238returned=handler.apply(that,args);if(returned===deferred.promise()){throw new TypeError("Thenable self-resolution");}
239then=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];}
240(special||deferred.resolveWith)(that,args);}},process=special?mightThrow:function(){try{mightThrow();}catch(e){if(jQuery.Deferred.exceptionHook){jQuery.Deferred.exceptionHook(e,process.stackTrace);}
241if(depth+1>=maxDepth){if(handler!==Thrower){that=undefined;args=[e];}
242deferred.rejectWith(that,args);}}};if(depth){process();}else{if(jQuery.Deferred.getStackHook){process.stackTrace=jQuery.Deferred.getStackHook();}
243window.setTimeout(process);}};}
244return 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);}
245list.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);}
246return deferred;},when:function(singleValue){var
247remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),master=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this;resolveValues[i]=arguments.length>1?slice.call(arguments):value;if(!(--remaining)){master.resolveWith(resolveContexts,resolveValues);}};};if(remaining<=1){adoptValue(singleValue,master.done(updateFunc(i)).resolve,master.reject,!remaining);if(master.state()==="pending"||isFunction(resolveValues[i]&&resolveValues[i].then)){return master.then();}}
248while(i--){adoptValue(resolveValues[i],updateFunc(i),master.reject);}
249return master.promise();}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,stack){if(window.console&&window.console.warn&&error&&rerrorNames.test(error.name)){window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,stack);}};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:false,readyWait:1,ready:function(wait){if(wait===true?--jQuery.readyWait:jQuery.isReady){return;}
250jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return;}
251readyList.resolveWith(document,[jQuery]);}});jQuery.ready.then=readyList.then;function completed(){document.removeEventListener("DOMContentLoaded",completed);window.removeEventListener("load",completed);jQuery.ready();}
252if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){window.setTimeout(jQuery.ready);}else{document.addEventListener("DOMContentLoaded",completed);window.addEventListener("load",completed);}
253var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=key==null;if(toType(key)==="object"){chainable=true;for(i in key){access(elems,fn,i,key[i],true,emptyGet,raw);}}else if(value!==undefined){chainable=true;if(!isFunction(value)){raw=true;}
254if(bulk){if(raw){fn.call(elems,value);fn=null;}else{bulk=fn;fn=function(elem,_key,value){return bulk.call(jQuery(elem),value);};}}
255if(fn){for(;i<len;i++){fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));}}}
256if(chainable){return elems;}
257if(bulk){return fn.call(elems);}
258return len?fn(elems[0],key):emptyGet;};var rmsPrefix=/^-ms-/,rdashAlpha=/-([a-z])/g;function fcamelCase(_all,letter){return letter.toUpperCase();}
259function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);}
260var acceptData=function(owner){return owner.nodeType===1||owner.nodeType===9||!(+owner.nodeType);};function Data(){this.expando=jQuery.expando+Data.uid++;}
261Data.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:true});}}}
262return 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];}}
263return 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);}
264this.set(owner,key,value);return value!==undefined?value:key;},remove:function(owner,key){var i,cache=owner[this.expando];if(cache===undefined){return;}
265if(key!==undefined){if(Array.isArray(key)){key=key.map(camelCase);}else{key=camelCase(key);key=key in cache?[key]:(key.match(rnothtmlwhite)||[]);}
266i=key.length;while(i--){delete cache[key[i]];}}
267if(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 true;}
268if(data==="false"){return false;}
269if(data==="null"){return null;}
270if(data===+data+""){return+data;}
271if(rbrace.test(data)){return JSON.parse(data);}
272return data;}
273function 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){}
274dataUser.set(elem,key,data);}else{data=undefined;}}
275return data;}
276jQuery.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]);}}}
277dataPriv.set(elem,"hasDataAttrs",true);}}
278return data;}
279if(typeof key==="object"){return this.each(function(){dataUser.set(this,key);});}
280return access(this,function(value){var data;if(elem&&value===undefined){data=dataUser.get(elem,key);if(data!==undefined){return data;}
281data=dataAttr(elem,key);if(data!==undefined){return data;}
282return;}
283this.each(function(){dataUser.set(this,key,value);});},null,value,arguments.length>1,null,true);},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);}}
284return 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--;}
285if(fn){if(type==="fx"){queue.unshift("inprogress");}
286delete hooks.stop;fn.call(elem,next,hooks);}
287if(!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--;}
288if(arguments.length<setter){return jQuery.queue(this[0],type);}
289return 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;}
290type=type||"fx";while(i--){tmp=dataPriv.get(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve);}}
291resolve();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:true};if(documentElement.getRootNode){isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem)||elem.getRootNode(composed)===elem.ownerDocument;};}
292var 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;}
293initialInUnit=initialInUnit / scale;}
294initialInUnit=initialInUnit*2;jQuery.style(elem,prop,initialInUnit+unit);valueParts=valueParts||[];}
295if(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;}}
296return adjusted;}
297var defaultDisplayMap={};function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];if(display){return display;}
298temp=doc.body.appendChild(doc.createElement(nodeName));display=jQuery.css(temp,"display");temp.parentNode.removeChild(temp);if(display==="none"){display="block";}
299defaultDisplayMap[nodeName]=display;
vendor: 6,053 bytes, lines 299-337
299return display;}
300function showHide(elements,show){var display,elem,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(!elem.style){continue;}
301display=elem.style.display;if(show){if(display==="none"){values[index]=dataPriv.get(elem,"display")||null;if(!values[index]){elem.style.display="";}}
302if(elem.style.display===""&&isHiddenWithinTree(elem)){values[index]=getDefaultDisplay(elem);}}else{if(display!=="none"){values[index]="none";dataPriv.set(elem,"display",display);}}}
303for(index=0;index<length;index++){if(values[index]!=null){elements[index].style.display=values[index];}}
304return elements;}
305jQuery.fn.extend({show:function(){return showHide(this,true);},hide:function(){return showHide(this);},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide();}
306return 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(true).cloneNode(true).lastChild.checked;div.innerHTML="<textarea>x</textarea>";support.noCloneChecked=!!div.cloneNode(true).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>"];}
307function 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=[];}
308if(tag===undefined||tag&&nodeName(context,tag)){return jQuery.merge([context],ret);}
309return ret;}
310function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i<l;i++){dataPriv.set(elems[i],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"));}}
311var 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;}
312jQuery.merge(nodes,tmp.childNodes);tmp=fragment.firstChild;tmp.textContent="";}}}
313fragment.textContent="";i=0;while((elem=nodes[i++])){if(selection&&jQuery.inArray(elem,selection)>-1){if(ignored){ignored.push(elem);}
314continue;}
315attached=isAttached(elem);tmp=getAll(fragment.appendChild(elem),"script");if(attached){setGlobalEval(tmp);}
316if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem);}}}}
317return fragment;}
318var
319rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;function returnTrue(){return true;}
320function returnFalse(){return false;}
321function expectSync(elem,type){return(elem===safeActiveElement())===(type==="focus");}
322function safeActiveElement(){try{return document.activeElement;}catch(err){}}
323function on(elem,types,selector,data,fn,one){var origFn,type;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined;}
324for(type in types){on(elem,type,selector,data,types[type],one);}
325return elem;}
326if(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;}}
327if(fn===false){fn=returnFalse;}else if(!fn){return elem;}
328if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments);};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++);}
329return elem.each(function(){jQuery.event.add(this,types,fn,data,selector);});}
330jQuery.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;}
331if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector;}
332if(selector){jQuery.find.matchesSelector(documentElement,selector);}
333if(!handler.guid){handler.guid=jQuery.guid++;}
334if(!(events=elemData.events)){events=elemData.events=Object.create(null);}
335if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!=="undefined"&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):undefined;};}
336types=(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;}
337special=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;
vendor: 3,673 bytes, lines 337-353
337if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle);}}}
338if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}}
339if(selector){handlers.splice(handlers.delegateCount++,0,handleObj);}else{handlers.push(handleObj);}
340jQuery.event.global[type]=true;}},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;}
341types=(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,true);}
342continue;}
343special=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--;}
344if(special.remove){special.remove.call(elem,handleObj);}}}
345if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle);}
346delete events[type];}}
347if(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];}
348event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return;}
349handlerQueue=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===false||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)===false){event.preventDefault();event.stopPropagation();}}}}}
350if(special.postDispatch){special.postDispatch.call(this,event);}
351return 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===true)){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;}
352if(matchedSelectors[sel]){matchedHandlers.push(handleObj);}}
353if(matchedHandlers.length){handlerQueue.push({elem:cur,handlers:matchedHandlers});}}
vendor: 4,588 bytes, lines 353-370
353}}
354cur=this;if(delegateCount<handlers.length){handlerQueue.push({elem:cur,handlers:handlers.slice(delegateCount)});}
355return handlerQueue;},addProp:function(name,hook){Object.defineProperty(jQuery.Event.prototype,name,{enumerable:true,configurable:true,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:true,configurable:true,writable:true,value:value});}});},fix:function(originalEvent){return originalEvent[jQuery.expando]?originalEvent:new jQuery.Event(originalEvent);},special:{load:{noBubble:true},click:{setup:function(data){var el=this||data;if(rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")){leverageNative(el,"click",returnTrue);}
356return false;},trigger:function(data){var el=this||data;if(rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")){leverageNative(el,"click");}
357return true;},_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,expectSync){if(!expectSync){if(dataPriv.get(el,type)===undefined){jQuery.event.add(el,type,returnTrue);}
358return;}
359dataPriv.set(el,type,false);jQuery.event.add(el,type,{namespace:false,handler:function(event){var notAsync,result,saved=dataPriv.get(this,type);if((event.isTrigger&1)&&this[type]){if(!saved.length){saved=slice.call(arguments);dataPriv.set(this,type,saved);notAsync=expectSync(this,type);this[type]();result=dataPriv.get(this,type);if(saved!==result||notAsync){dataPriv.set(this,type,false);}else{result={};}
360if(saved!==result){event.stopImmediatePropagation();event.preventDefault();return result.value;}}else if((jQuery.event.special[type]||{}).delegateType){event.stopPropagation();}}else if(saved.length){dataPriv.set(this,type,{value:jQuery.event.trigger(jQuery.extend(saved[0],jQuery.Event.prototype),saved.slice(1),this)});event.stopImmediatePropagation();}}});}
361jQuery.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);}
362if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=src.defaultPrevented||src.defaultPrevented===undefined&&src.returnValue===false?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;}
363if(props){jQuery.extend(this,props);}
364this.timeStamp=src&&src.timeStamp||Date.now();this[jQuery.expando]=true;};jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,isSimulated:false,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();}
365this.stopPropagation();}};jQuery.each({altKey:true,bubbles:true,cancelable:true,changedTouches:true,ctrlKey:true,detail:true,eventPhase:true,metaKey:true,pageX:true,pageY:true,shiftKey:true,view:true,"char":true,code:true,charCode:true,key:true,keyCode:true,button:true,buttons:true,clientX:true,clientY:true,offsetX:true,offsetY:true,pointerId:true,pointerType:true,screenX:true,screenY:true,targetTouches:true,toElement:true,touches:true,which:function(event){var button=event.button;if(event.which==null&&rkeyEvent.test(event.type)){return event.charCode!=null?event.charCode:event.keyCode;}
366if(!event.which&&button!==undefined&&rmouseEvent.test(event.type)){if(button&1){return 1;}
367if(button&2){return 3;}
368if(button&4){return 2;}
369return 0;}
370return event.which;}},jQuery.event.addProp);jQuery.each({focus:"focusin",blur:"focusout"},function(type,delegateType){jQuery.event.special[type]={setup:function(){leverageNative(this,type,expectSync);return false;},trigger:function(){leverageNative(this,type);return true;},delegateType:delegateType};});
vendor: 4,543 bytes, lines 370-397
370jQuery.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;}
371return 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;}
372if(typeof types==="object"){for(type in types){this.off(type,selector,types[type]);}
373return this;}
374if(selector===false||typeof selector==="function"){fn=selector;selector=undefined;}
375if(fn===false){fn=returnFalse;}
376return this.each(function(){jQuery.event.remove(this,types,fn,selector);});}});var
377rnoInnerhtml=/<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;}
378return elem;}
379function disableScript(elem){elem.type=(elem.getAttribute("type")!==null)+"/"+elem.type;return elem;}
380function restoreScript(elem){if((elem.type||"").slice(0,5)==="true/"){elem.type=elem.type.slice(5);}else{elem.removeAttribute("type");}
381return elem;}
382function cloneCopyEvent(src,dest){var i,l,type,pdataOld,udataOld,udataCur,events;if(dest.nodeType!==1){return;}
383if(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]);}}}}
384if(dataUser.hasData(src)){udataOld=dataUser.access(src);udataCur=jQuery.extend({},udataOld);dataUser.set(dest,udataCur);}}
385function 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;}}
386function 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());}
387domManip(self,args,callback,ignored);});}
388if(l){fragment=buildFragment(args,collection[0].ownerDocument,false,collection,ignored);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first;}
389if(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,true,true);if(hasScripts){jQuery.merge(scripts,getAll(node,"script"));}}
390callback.call(collection[i],node,i);}
391if(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);}}}}}}
392return collection;}
393function 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));}
394if(node.parentNode){if(keepData&&isAttached(node)){setGlobalEval(getAll(node,"script"));}
395node.parentNode.removeChild(node);}}
396return elem;}
397jQuery.extend({htmlPrefilter:function(html){return html;},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(true),inPage=isAttached(elem);if(!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&
vendor: 8,373 bytes, lines 397-428
397!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i<l;i++){fixInput(srcElements[i],destElements[i]);}}
398if(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);}}
399destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"));}
400return 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);}}}
401elem[dataPriv.expando]=undefined;}
402if(elem[dataUser.expando]){elem[dataUser.expando]=undefined;}}}}});jQuery.fn.extend({detach:function(selector){return remove(this,selector,true);},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,false));elem.textContent="";}}
403return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false: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;}
404if(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,false));elem.innerHTML=value;}}
405elem=0;}catch(e){}}
406if(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(true);jQuery(insert[i])[original](elems);push.apply(ret,elems.get());}
407return this.pushStack(ret);};});var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i");var getStyles=function(elem){var view=elem.ownerDocument.defaultView;if(!view||!view.opener){view=window;}
408return 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];}
409ret=callback.call(elem);for(name in options){elem.style[name]=old[name];}
410return ret;};var rboxStyle=new RegExp(cssExpand.join("|"),"i");(function(){function computeStyleTests(){if(!div){return;}
411container.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;}
412function roundPixelMeasures(measure){return Math.round(parseFloat(measure));}
413var pixelPositionVal,boxSizingReliableVal,scrollboxSizeVal,pixelBoxStylesVal,reliableTrDimensionsVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");if(!div.style){return;}
414div.style.backgroundClip="content-box";div.cloneNode(true).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";tr.style.height="1px";trChild.style.height="9px";documentElement.appendChild(table).appendChild(tr).appendChild(trChild);trStyle=window.getComputedStyle(tr);reliableTrDimensionsVal=parseInt(trStyle.height)>3;documentElement.removeChild(table);}
415return reliableTrDimensionsVal;}});})();function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;computed=computed||getStyles(elem);if(computed){ret=computed.getPropertyValue(name)||computed[name];if(ret===""&&!isAttached(elem)){ret=jQuery.style(elem,name);}
416if(!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;}}
417return ret!==undefined?ret+"":ret;}
418function addGetHookIf(conditionFn,hookFn){return{get:function(){if(conditionFn()){delete this.get;return;}
419return(this.get=hookFn).apply(this,arguments);}};}
420var 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;}}}
421function finalPropName(name){var final=jQuery.cssProps[name]||vendorProps[name];if(final){return final;}
422if(name in emptyStyle){return name;}
423return vendorProps[name]=vendorPropName(name)||name;}
424var
425rdisplayswap=/^(none|table(?!-c[ea]).+)/,rcustomProp=/^--/,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;}
426function boxModelAdjustment(elem,dimension,box,isBorderBox,styles,computedVal){var i=dimension==="width"?1:0,extra=0,delta=0;if(box===(isBorderBox?"border":"content")){return 0;}
427for(;i<4;i+=2){if(box==="margin"){delta+=jQuery.css(elem,box+cssExpand[i],true,styles);}
428if(!isBorderBox){delta+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(box!=="padding"){delta+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}else{extra+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}else{if(box==="content"){delta-=jQuery.css(elem,"padding"+cssExpand[i],true,
vendor: 6,601 bytes, lines 428-467
428styles);}
429if(box!=="margin"){delta-=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}}
430if(!isBorderBox&&computedVal>=0){delta+=Math.max(0,Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-
431computedVal-
432delta-
433extra-
4340.5))||0;}
435return delta;}
436function getWidthOrHeight(elem,dimension,extra){var styles=getStyles(elem),boxSizingNeeded=!support.boxSizingReliable()||extra,isBorderBox=boxSizingNeeded&&jQuery.css(elem,"boxSizing",false,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;}
437val="auto";}
438if((!support.boxSizingReliable()&&isBorderBox||!support.reliableTrDimensions()&&nodeName(elem,"tr")||val==="auto"||!parseFloat(val)&&jQuery.css(elem,"display",false,styles)==="inline")&&elem.getClientRects().length){isBorderBox=jQuery.css(elem,"boxSizing",false,styles)==="border-box";valueIsBorderBox=offsetProp in elem;if(valueIsBorderBox){val=elem[offsetProp];}}
439val=parseFloat(val)||0;return(val+
440boxModelAdjustment(elem,dimension,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles,val))+"px";}
441jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret;}}}},cssNumber:{"animationIterationCount":true,"columnCount":true,"fillOpacity":true,"flexGrow":true,"flexShrink":true,"fontWeight":true,"gridArea":true,"gridColumn":true,"gridColumnEnd":true,"gridColumnStart":true,"gridRow":true,"gridRowEnd":true,"gridRowStart":true,"lineHeight":true,"opacity":true,"order":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return;}
442var ret,type,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name),style=elem.style;if(!isCustomProp){name=finalPropName(origName);}
443hooks=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";}
444if(value==null||value!==value){return;}
445if(type==="number"&&!isCustomProp){value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px");}
446if(!support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit";}
447if(!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,false,extra))!==undefined){return ret;}
448return style[name];}},css:function(elem,name,extra,styles){var val,num,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name);if(!isCustomProp){name=finalPropName(origName);}
449hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get"in hooks){val=hooks.get(elem,true,extra);}
450if(val===undefined){val=curCSS(elem,name,styles);}
451if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name];}
452if(extra===""||extra){num=parseFloat(val);return extra===true||isFinite(num)?num||0:val;}
453return 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",false,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)]-
454parseFloat(styles[dimension])-
455boxModelAdjustment(elem,dimension,"border",false,styles)-
4560.5);}
457if(subtract&&(matches=rcssNum.exec(value))&&(matches[3]||"px")!=="px"){elem.style[dimension]=value;value=jQuery.css(elem,dimension);}
458return setPositiveNumber(elem,value,subtract);}};});jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,function(elem,computed){if(computed){return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left-
459swap(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];}
460return 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],false,styles);}
461return map;}
462return 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);}
463jQuery.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;}
464this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this);}
465if(hooks&&hooks.set){hooks.set(this);}else{Tween.propHooks._default.set(this);}
466return 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];}
467result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result;}
vendor: 13,985 bytes, lines 467-531
467,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
468fxNow,inProgress,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function schedule(){if(inProgress){if(document.hidden===false&&window.requestAnimationFrame){window.requestAnimationFrame(schedule);}else{window.setTimeout(schedule,jQuery.fx.interval);}
469jQuery.fx.tick();}}
470function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return(fxNow=Date.now());}
471function 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;}
472if(includeWidth){attrs.opacity=attrs.width=type;}
473return attrs;}
474function 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;}}}
475function 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();}};}
476hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(elem,"fx").length){hooks.empty.fire();}});});}
477for(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=true;}else{continue;}}
478orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop);}}
479propTween=!jQuery.isEmptyObject(props);if(!propTween&&jQuery.isEmptyObject(orig)){return;}
480if(isBox&&elem.nodeType===1){opts.overflow=[style.overflow,style.overflowX,style.overflowY];restoreDisplay=dataShow&&dataShow.display;if(restoreDisplay==null){restoreDisplay=dataPriv.get(elem,"display");}
481display=jQuery.css(elem,"display");if(display==="none"){if(restoreDisplay){display=restoreDisplay;}else{showHide([elem],true);restoreDisplay=elem.style.display||restoreDisplay;display=jQuery.css(elem,"display");showHide([elem]);}}
482if(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;}}
483style.display="inline-block";}}}
484if(opts.overflow){style.overflow="hidden";anim.always(function(){style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2];});}
485propTween=false;for(prop in orig){if(!propTween){if(dataShow){if("hidden"in dataShow){hidden=dataShow.hidden;}}else{dataShow=dataPriv.access(elem,"fxshow",{display:restoreDisplay});}
486if(toggle){dataShow.hidden=!hidden;}
487if(hidden){showHide([elem],true);}
488anim.done(function(){if(!hidden){showHide([elem]);}
489dataPriv.remove(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop]);}});}
490propTween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop]=propTween.start;if(hidden){propTween.end=propTween.start;propTween.start=0;}}}}
491function 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];}
492if(index!==name){props[name]=value;delete props[index];}
493hooks=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;}}}
494function 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 false;}
495var 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);}
496deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){return remaining;}
497if(!length){deferred.notifyWith(elem,[animation,1,0]);}
498deferred.resolveWith(elem,[animation]);return false;},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(true,{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;}
499stopped=true;for(;index<length;index++){animation.tweens[index].run(1);}
500if(gotoEnd){deferred.notifyWith(elem,[animation,1,0]);deferred.resolveWith(elem,[animation,gotoEnd]);}else{deferred.rejectWith(elem,[animation,gotoEnd]);}
501return 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);}
502return result;}}
503jQuery.map(props,createTween,animation);if(isFunction(animation.opts.start)){animation.opts.start.call(elem,animation);}
504animation.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;}
505jQuery.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);}
506var 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;}}}
507if(opt.queue==null||opt.queue===true){opt.queue="fx";}
508opt.old=opt.complete;opt.complete=function(){if(isFunction(opt.old)){opt.old.call(this);}
509if(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(true);}};doAnimation.finish=doAnimation;return empty||optall.queue===false?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;}
510if(clearQueue){this.queue(type||"fx",[]);}
511return this.each(function(){var dequeue=true,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]);}}}
512for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);dequeue=false;timers.splice(index,1);}}
513if(dequeue||!gotoEnd){jQuery.dequeue(this,type);}});},finish:function(type){if(type!==false){type=type||"fx";}
514return 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=true;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){hooks.stop.call(this,true);}
515for(index=timers.length;index--;){if(timers[index].elem===this&&timers[index].queue===type){timers[index].anim.stop(true);timers.splice(index,1);}}
516for(index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this);}}
517delete 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,true),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);}}
518if(!timers.length){jQuery.fx.stop();}
519fxNow=undefined;};jQuery.fx.timer=function(timer){jQuery.timers.push(timer);jQuery.fx.start();};jQuery.fx.interval=13;jQuery.fx.start=function(){if(inProgress){return;}
520inProgress=true;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;}
521if(typeof elem.getAttribute==="undefined"){return jQuery.prop(elem,name,value);}
522if(nType!==1||!jQuery.isXMLDoc(elem)){hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:undefined);}
523if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);return;}
524if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}
525elem.setAttribute(name,value+"");return value;}
526if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}
527ret=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;}
528return 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===false){jQuery.removeAttr(elem,name);}else{elem.setAttribute(name,name);}
529return 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;}
530return 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;}
531if(nType!==1||!jQuery.isXMLDoc(elem)){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];}
vendor: 5,041 bytes, lines 532-563
532if(value!==undefined){if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}
533return(elem[name]=value);}
534if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}
535return elem[name];},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");if(tabindex){return parseInt(tabindex,10);}
536if(rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href){return 0;}
537return-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;}
538return null;},set:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}}};}
539jQuery.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(" ");}
540function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||"";}
541function classesToArray(value){if(Array.isArray(value)){return value;}
542if(typeof value==="string"){return value.match(rnothtmlwhite)||[];}
543return[];}
544jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)));});}
545classes=classesToArray(value);if(classes.length){while((elem=this[i++])){curValue=getClass(elem);cur=elem.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){j=0;while((clazz=classes[j++])){if(cur.indexOf(" "+clazz+" ")<0){cur+=clazz+" ";}}
546finalValue=stripAndCollapse(cur);if(curValue!==finalValue){elem.setAttribute("class",finalValue);}}}}
547return this;},removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)));});}
548if(!arguments.length){return this.attr("class","");}
549classes=classesToArray(value);if(classes.length){while((elem=this[i++])){curValue=getClass(elem);cur=elem.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){j=0;while((clazz=classes[j++])){while(cur.indexOf(" "+clazz+" ")>-1){cur=cur.replace(" "+clazz+" "," ");}}
550finalValue=stripAndCollapse(cur);if(curValue!==finalValue){elem.setAttribute("class",finalValue);}}}}
551return this;},toggleClass:function(value,stateVal){var type=typeof value,isValidValue=type==="string"||Array.isArray(value);if(typeof stateVal==="boolean"&&isValidValue){return stateVal?this.addClass(value):this.removeClass(value);}
552if(isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal);});}
553return this.each(function(){var className,i,self,classNames;if(isValidValue){i=0;self=jQuery(this);classNames=classesToArray(value);while((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);}
554if(this.setAttribute){this.setAttribute("class",className||value===false?"":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 true;}}
555return false;}});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;}
556ret=elem.value;if(typeof ret==="string"){return ret.replace(rreturn,"");}
557return ret==null?"":ret;}
558return;}
559valueIsFunction=isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return;}
560if(valueIsFunction){val=value.call(this,i,jQuery(this).val());}else{val=value;}
561if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(Array.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});}
562hooks=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;}
563for(;i<max;i++){option=options[i];if((option.selected||i===index)&&!option.disabled&&(!option.parentNode.disabled||!node
vendor: 4,224 bytes, lines 563-582
563Name(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value;}
564values.push(value);}}
565return 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=true;}}
566if(!optionSet){elem.selectedIndex=-1;}
567return 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;};}});support.focusin="onfocusin"in window;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;}
568if(rfocusMorph.test(type+jQuery.event.triggered)){return;}
569if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();}
570ontype=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;}
571data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return;}
572if(!onlyHandlers&&!special.noBubble&&!isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode;}
573for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur;}
574if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window);}}
575i=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);}
576handle=ontype&&cur[ontype];if(handle&&handle.apply&&acceptData(cur)){event.result=handle.apply(cur,data);if(event.result===false){event.preventDefault();}}}
577event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&acceptData(elem)){if(ontype&&isFunction(elem[type])&&!isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null;}
578jQuery.event.triggered=type;if(event.isPropagationStopped()){lastElement.addEventListener(type,stopPropagationCallback);}
579elem[type]();if(event.isPropagationStopped()){lastElement.removeEventListener(type,stopPropagationCallback);}
580jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp;}}}}
581return event.result;},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:true});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,true);}}});if(!support.focusin){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event));};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this.document||this,attaches=dataPriv.access(doc,fix);if(!attaches){doc.addEventListener(orig,handler,true);}
582dataPriv.access(doc,fix,(attaches||0)+1);},teardown:function(){var doc=this.ownerDocument||this.document||this,attaches=dataPriv.access(doc,fix)-1;if(!attaches){doc.removeEventListener(orig,handler,true);dataPriv.remove(doc,fix);}
vendor: 1,656 bytes, lines 582-591
582else{dataPriv.access(doc,fix,attaches);}}};});}
583var location=window.location;var nonce={guid:Date.now()};var rquery=(/\?/);jQuery.parseXML=function(data){var xml;if(!data||typeof data!=="string"){return null;}
584try{xml=(new window.DOMParser()).parseFromString(data,"text/xml");}catch(e){xml=undefined;}
585if(!xml||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data);}
586return xml;};var
587rbracket=/\[\]$/,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);}}
588jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+
589encodeURIComponent(value==null?"":value);};if(a==null){return"";}
590if(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);}}
591return 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;}
vendor: 19,321 bytes, lines 591-679
591).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;}
592if(Array.isArray(val)){return jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};});}
593return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});var
594r20=/%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="*";}
595var 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);}}}};}
596function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=(structure===transports);function inspect(dataType){var selected;inspected[dataType]=true;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 false;}else if(seekingTransport){return!(selected=dataTypeOrTransport);}});return selected;}
597return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*");}
598function 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];}}
599if(deep){jQuery.extend(true,target,deep);}
600return target;}
601function 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");}}
602if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}
603if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;}
604if(!firstDataType){firstDataType=type;}}
605finalDataType=finalDataType||firstDataType;}
606if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}
607return responses[finalDataType];}}
608function 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];}}
609current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}
610if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}
611prev=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===true){conv=converters[conv2];}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}
612break;}}}}
613if(conv!==true){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};}}}}}}
614return{state:"success",data:response};}
615jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:true,processData:true,async:true,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":true,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},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;}
616options=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]);}}
617match=responseHeaders[key.toLowerCase()+" "];}
618return 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;}
619return this;},overrideMimeType:function(type){if(completed==null){s.mimeType=type;}
620return 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]];}}}
621return this;},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText);}
622done(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=true;}}
623if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);}
624inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(completed){return jqXHR;}
625fireGlobals=jQuery.event&&s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");}
626s.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;}
627if(s.cache===false){cacheURL=cacheURL.replace(rantiCache,"$1");uncached=(rquery.test(cacheURL)?"&":"?")+"_="+(nonce.guid++)+
628uncached;}
629s.url=cacheURL+uncached;}else if(s.data&&s.processData&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0){s.data=s.data.replace(r20,"+");}
630if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]);}
631if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL]);}}
632if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);}
633jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+
634(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);}
635if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||completed)){return jqXHR.abort();}
636strAbort="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]);}
637if(completed){return jqXHR;}
638if(s.async&&s.timeout>0){timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout");},s.timeout);}
639try{completed=false;transport.send(requestHeaders,done);}catch(e){if(completed){throw e;}
640done(-1,e);}}
641function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(completed){return;}
642completed=true;if(timeoutTimer){window.clearTimeout(timeoutTimer);}
643transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses);}
644if(!isSuccess&&jQuery.inArray("script",s.dataTypes)>-1){s.converters["text script"]=function(){};}
645response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified;}
646modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified;}}
647if(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;}}}
648jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR]);}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error]);}
649jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]);}
650completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop");}}}
651return 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;}
652return 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:true,async:false,global:false,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]);}
653wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);}
654wrap.map(function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild;}
655return elem;}).append(this);}
656return this;},wrapInner:function(html){if(isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});}
657return 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];}}
658if(options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType);}
659if(!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest";}
660for(i in headers){xhr.setRequestHeader(i,headers[i]);}
661callback=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();}});}};}
662callback=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=false;}});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=false;}
663if(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]=true;return callback;}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==false&&(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!==false){s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName;}
664s.converters["script json"]=function(){if(!responseContainer){jQuery.error(callbackName+" was not called");}
665return 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;}
666if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;oldCallbacks.push(callbackName);}
667if(responseContainer&&isFunction(overwritten)){overwritten(responseContainer[0]);}
668responseContainer=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[];}
669if(typeof context==="boolean"){keepScripts=context;context=false;}
670var 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;}}
671parsed=rsingleTag.exec(data);scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])];}
672parsed=buildFragment([data],context,scripts);if(scripts&&scripts.length){jQuery(scripts).remove();}
673return 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);}
674if(isFunction(params)){callback=params;params=undefined;}else if(params&&typeof params==="object"){type="POST";}
675if(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]);});});}
676return 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";}
677curOffset=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;}
678if(isFunction(options)){options=options.call(elem,i,jQuery.extend({},curOffset));}
679if(options.top!=null){props.top=(options.top-curOffset.top)+curTop;}
vendor: 5,712 bytes, lines 680-701
680if(options.left!=null){props.left=(options.left-curOffset.left)+curLeft;}
681if("using"in options){options.using.call(elem,props);}else{if(typeof props.top==="number"){props.top+="px";}
682if(typeof props.left==="number"){props.left+="px";}
683curElem.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);});}
684var rect,win,elem=this[0];if(!elem){return;}
685if(!elem.getClientRects().length){return{top:0,left:0};}
686rect=elem.getBoundingClientRect();win=elem.ownerDocument.defaultView;return{top:rect.top+win.pageYOffset,left:rect.left+win.pageXOffset};},position:function(){if(!this[0]){return;}
687var 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;}
688if(offsetParent&&offsetParent!==elem&&offsetParent.nodeType===1){parentOffset=jQuery(offsetParent).offset();parentOffset.top+=jQuery.css(offsetParent,"borderTopWidth",true);parentOffset.left+=jQuery.css(offsetParent,"borderLeftWidth",true);}}
689return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",true),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",true)};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent;while(offsetParent&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.offsetParent;}
690return 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;}
691if(val===undefined){return win?win[prop]:elem[method];}
692if(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===true||value===true?"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];}
693if(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]);}
694return 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.mouseenter(fnOver).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]+$/g;jQuery.proxy=function(fn,context){var tmp,args,proxy;if(typeof context==="string"){tmp=fn[context];context=fn;fn=tmp;}
695if(!isFunction(fn)){return undefined;}
696args=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(true);}};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,"");};if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery;});}
697var
698_jQuery=window.jQuery,_$=window.$;jQuery.noConflict=function(deep){if(window.$===jQuery){window.$=_$;}
699if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery;}
700return jQuery;};if(typeof noGlobal==="undefined"){window.jQuery=window.$=jQuery;}
701return jQuery;});;;window.yii=(function($){var pub={reloadableScripts:[],clickableSelector:'a, button, input[type="submit"], input[type="button"], input[type="reset"], '+'input[type="image"]',changeableSelector:'select, input, textarea',getCsrfParam
701:function(){return $('meta[name=csrf-param]').attr('content');},getCsrfToken:function(){return $('meta[name=csrf-token]').attr('content');},setCsrfToken:function(name,value){$('meta[name=csrf-param]').attr('content',name);$('meta[name=csrf-token]').attr('content',value);},refreshCsrfToken:function(){var token=pub.getCsrfToken();if(token){$('form input[name="'+pub.getCsrfParam()+'"]').val(token);}},confirm:function(message,ok,cancel){if(window.confirm(message)){!ok||ok();}else{!cancel||cancel();}},handleAction:function($e,event){var $form=$e.attr('data-form')?$('#'+$e.attr('data-form')):$e.closest('form'),method=!$e.data('method')&&$form?$form.attr('method'):$e.data('method'),action=$e.attr('href'),isValidAction=action&&action!=='#',params=$e.data('params'),areValidParams=params&&$.isPlainObject(params),pjax=$e.data('pjax'),usePjax=pjax!==undefined&&pjax!==0&&$.support.pjax,pjaxContainer,pjaxOptions={},conflictParams=['submit','reset','elements','length','name','acceptCharset','action','enctype','method','target'];$.each(conflictParams,function(index,param){if(areValidParams&&params.hasOwnProperty(param)){console.error("Parameter name '"+param+"' conflicts with a same named form property. "+"Please use another name.");}});if(usePjax){pjaxContainer=$e.data('pjax-container');if(pjaxContainer===undefined||!pjaxContainer.length){pjaxContainer=$e.closest('[data-pjax-container]').attr('id')?('#'+$e.closest('[data-pjax-container]').attr('id')):'';}
702if(!pjaxContainer.length){pjaxContainer='body';}
703pjaxOptions={container:pjaxContainer,push:!!$e.data('pjax-push-state'),replace:!!$e.data('pjax-replace-state'),scrollTo:$e.data('pjax-scrollto'),pushRedirect:$e.data('pjax-push-redirect'),replaceRedirect:$e.data('pjax-replace-redirect'),skipOuterContainers:$e.data('pjax-skip-outer-containers'),timeout:$e.data('pjax-timeout'),originalEvent:event,originalTarget:$e};}
704if(method===undefined){if(isValidAction){usePjax?$.pjax.click(event,pjaxOptions):window.location.assign(action);}else if($e.is(':submit')&&$form.length){if(usePjax){$form.on('submit',function(e){$.pjax.submit(e,pjaxOptions);});}
705$form.trigger('submit');}
706return;}
707var oldMethod,oldAction,newForm=!$form.length;if(!newForm){oldMethod=$form.attr('method');$form.attr('method',method);if(isValidAction){oldAction=$form.attr('action');$form.attr('action',action);}}else{if(!isValidAction){action=pub.getCurrentUrl();}
708$form=$('<form/>',{method:method,action:action});var target=$e.attr('target');if(target){$form.attr('target',target);}
709if(!/(get|post)/i.test(method)){$form.append($('<input/>',{name:'_method',value:method,type:'hidden'}));method='post';$form.attr('method',method);}
710if(/post/i.test(method)){var csrfParam=pub.getCsrfParam();if(csrfParam){$form.append($('<input/>',{name:csrfParam,value:pub.getCsrfToken(),type:'hidden'}));}}
711$form.hide().appendTo('body');}
712var activeFormData=$form.data('yiiActiveForm');if(activeFormData){activeFormData.submitObject=$e;}
713if(areValidParams){$.each(params,function(name,value){$form.append($('<input/>').attr({name:name,value:value,type:'hidden'}));});}
714if(usePjax){$form.on('submit',function(e){$.pjax.submit(e,pjaxOptions);});}
715$form.trigger('submit');$.when($form.data('yiiSubmitFinalizePromise')).done(function(){if(newForm){$form.remove();return;}
716if(oldAction!==undefined){$form.attr('action',oldAction);}
717$form.attr('method',oldMethod);if(areValidParams){$.each(params,function(name){$('input[name="'+name+'"]',$form).remove();});}});},getQueryParams:function(url){var pos=url.indexOf('?');if(pos<0){return{};}
718var pairs=$.grep(url.substring(pos+1).split('#')[0].split('&'),function(value){return value!=='';});var params={};for(var i=0,len=pairs.length;i<len;i++){var pair=pairs[i].split('=');var name=decodeURIComponent(pair[0].replace(/\+/g,'%20'));var value=pair.length>1?decodeURIComponent(pair[1].replace(/\+/g,'%20')):'';if(!name.length){continue;}
719if(params[name]===undefined){params[name]=value||'';}else{if(!$.isArray(params[name])){params[name]=[params[name]];}
720params[name].push(value||'');}}
721return params;},initModule:function(module){if(module.isActive!==undefined&&!module.isActive){return;}
722if($.isFunction(module.init)){module.init();}
723$.each(module,function(){if($.isPlainObject(this)){pub.initModule(this);}});},init:function(){initCsrfHandler();initRedirectHandler();initAssetFilters();initDataMethods();},getBaseCurrentUrl:function(){return window.location.protocol+'//'+window.location.host;},getCurrentUrl:function(){return window.location.href;}};function initCsrfHandler(){$.ajaxPrefilter(function(options,originalOptions,xhr){if(!options.crossDomain&&pub.getCsrfParam()){xhr.setRequestHeader('X-CSRF-Token',pub.getCsrfToken());}});pub.refreshCsrfToken();}
724function initRedirectHandler(){$(document).ajaxComplete(function(event,xhr){var url=xhr&&xhr.getResponseHeader('X-Redirect');if(url){window.location.assign(url);}});}
725function initAssetFilters(){var loadedScripts={};$('script[src]').each(function(){var url=getAbsoluteUrl(this.src);loadedScripts[url]=true;});$.ajaxPrefilter('script',function(options,originalOptions,xhr){if(options.dataType=='jsonp'){return;}
726var url=getAbsoluteUrl(options.url),forbiddenRepeatedLoad=loadedScripts[url]===true&&!isReloadableAsset(url),cleanupRunning=loadedScripts[url]!==undefined&&loadedScripts[url]['xhrDone']===true;if(forbiddenRepeatedLoad||cleanupRunning){xhr.abort();return;}
727if(loadedScripts[url]===undefined||loadedScripts[url]===true){loadedScripts[url]={xhrList:[],xhrDone:false};}
728xhr.done(function(data,textStatus,jqXHR){if(loadedScripts[jqXHR.yiiUrl]['xhrDone']===true){return;}
729loadedScripts[jqXHR.yiiUrl]['xhrDone']=true;for(var i=0,len=loadedScripts[jqXHR.yiiUrl]['xhrList'].length;i<len;i++){var singleXhr=loadedScripts[jqXHR.yiiUrl]['xhrList'][i];if(singleXhr&&singleXhr.readyState!==XMLHttpRequest.DONE){singleXhr.abort();}}
730loadedScripts[jqXHR.yiiUrl]=true;}).fail(function(jqXHR,textStatus){if(textStatus==='abort'){return;}
731delete loadedScripts[jqXHR.yiiUrl]['xhrList'][jqXHR.yiiIndex];var allFailed=true;for(var i=0,len=loadedScripts[jqXHR.yiiUrl]['xhrList'].length;i<len;i++){if(loadedScripts[jqXHR.yiiUrl]['xhrList'][i]){allFailed=false;}}
732if(allFailed){delete loadedScripts[jqXHR.yiiUrl];}});xhr.yiiIndex=loadedScripts[url]['xhrList'].length;xhr.yiiUrl=url;loadedScripts[url]['xhrList'][xhr.yiiIndex]=xhr;});$(document).ajaxComplete(function(){var styleSheets=[];$('link[rel=stylesheet]').each(function(){var url=getAbsoluteUrl(this.href);if(isReloadableAsset(url)){return;}
733$.inArray(url,styleSheets)===-1?styleSheets.push(url):$(this).remove();});});}
734function initDataMethods(){var handler=function(event){var $this=$(this),method=$this.data('method'),message=$this.data('confirm'),form=$this.data('form');if(method===undefined&&message===undefined&&form===undefined){return true;}
735if(message!==undefined&&message!==false&&message!==''){$.proxy(pub.confirm,this)(message,function(){pub.handleAction($this,event);});}else{pub.handleAction($this,event);}
736event.stopImmediatePropagation();return false;};$(document).on('click.yii',pub.clickableSelector,handler).on('change.yii',pub.changeableSelector,handler);}
737function isReloadableAsset(url){for(var i=0;i<pub.reloadableScripts.length;i++){var rule=getAbsoluteUrl(pub.reloadableScripts[i]);var match=new RegExp("^"+escapeRegExp(rule).split('\\*').join('.+')+"$").test(url);if(match===true){return true;}}
738return false;}
739function escapeRegExp(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");}
740function getAbsoluteUrl(url){return url.charAt(0)==='/'?pub.getBaseCurrentUrl()+url:url;}
741return pub;})(window.jQuery);window.jQuery(function(){window.yii.initModule(window.yii);});;;
742/*!
743 * Bootstrap v3.4.1 (https://getbootstrap.com/)
744 * Copyright 2011-2019 Twitter, Inc.
745 * Licensed under the MIT license
746 */
747if(typeof jQuery==='undefined'){throw new Error('Bootstrap\'s JavaScript requires jQuery')}
748+function($){'use strict';var version=$.fn.jquery.split(' ')[0].split('.')
749if((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')
750var transEndEventNames={WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd otransitionend',transition:'transitionend'}
vendor: 33,300 bytes, lines 751-1300
751for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}
752return false}
753$.fn.emulateTransitionEnd=function(duration){var called=false
754var $el=this
755$(this).one('bsTransitionEnd',function(){called=true})
756var callback=function(){if(!called)$($el).trigger($.support.transition.end)}
757setTimeout(callback,duration)
758return this}
759$(function(){$.support.transition=transitionEnd()
760if(!$.support.transition)return
761$.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"]'
762var Alert=function(el){$(el).on('click',dismiss,this.close)}
763Alert.VERSION='3.4.1'
764Alert.TRANSITION_DURATION=150
765Alert.prototype.close=function(e){var $this=$(this)
766var selector=$this.attr('data-target')
767if(!selector){selector=$this.attr('href')
768selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
769selector=selector==='#'?[]:selector
770var $parent=$(document).find(selector)
771if(e)e.preventDefault()
772if(!$parent.length){$parent=$this.closest('.alert')}
773$parent.trigger(e=$.Event('close.bs.alert'))
774if(e.isDefaultPrevented())return
775$parent.removeClass('in')
776function removeElement(){$parent.detach().trigger('closed.bs.alert').remove()}
777$.support.transition&&$parent.hasClass('fade')?$parent.one('bsTransitionEnd',removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION):removeElement()}
778function Plugin(option){return this.each(function(){var $this=$(this)
779var data=$this.data('bs.alert')
780if(!data)$this.data('bs.alert',(data=new Alert(this)))
781if(typeof option=='string')data[option].call($this)})}
782var old=$.fn.alert
783$.fn.alert=Plugin
784$.fn.alert.Constructor=Alert
785$.fn.alert.noConflict=function(){$.fn.alert=old
786return this}
787$(document).on('click.bs.alert.data-api',dismiss,Alert.prototype.close)}(jQuery);+function($){'use strict';var Button=function(element,options){this.$element=$(element)
788this.options=$.extend({},Button.DEFAULTS,options)
789this.isLoading=false}
790Button.VERSION='3.4.1'
791Button.DEFAULTS={loadingText:'loading...'}
792Button.prototype.setState=function(state){var d='disabled'
793var $el=this.$element
794var val=$el.is('input')?'val':'html'
795var data=$el.data()
796state+='Text'
797if(data.resetText==null)$el.data('resetText',$el[val]())
798setTimeout($.proxy(function(){$el[val](data[state]==null?this.options[state]:data[state])
799if(state=='loadingText'){this.isLoading=true
800$el.addClass(d).attr(d,d).prop(d,true)}else if(this.isLoading){this.isLoading=false
801$el.removeClass(d).removeAttr(d).prop(d,false)}},this),0)}
802Button.prototype.toggle=function(){var changed=true
803var $parent=this.$element.closest('[data-toggle="buttons"]')
804if($parent.length){var $input=this.$element.find('input')
805if($input.prop('type')=='radio'){if($input.prop('checked'))changed=false
806$parent.find('.active').removeClass('active')
807this.$element.addClass('active')}else if($input.prop('type')=='checkbox'){if(($input.prop('checked'))!==this.$element.hasClass('active'))changed=false
808this.$element.toggleClass('active')}
809$input.prop('checked',this.$element.hasClass('active'))
810if(changed)$input.trigger('change')}else{this.$element.attr('aria-pressed',!this.$element.hasClass('active'))
811this.$element.toggleClass('active')}}
812function Plugin(option){return this.each(function(){var $this=$(this)
813var data=$this.data('bs.button')
814var options=typeof option=='object'&&option
815if(!data)$this.data('bs.button',(data=new Button(this,options)))
816if(option=='toggle')data.toggle()
817else if(option)data.setState(option)})}
818var old=$.fn.button
819$.fn.button=Plugin
820$.fn.button.Constructor=Button
821$.fn.button.noConflict=function(){$.fn.button=old
822return this}
823$(document).on('click.bs.button.data-api','[data-toggle^="button"]',function(e){var $btn=$(e.target).closest('.btn')
824Plugin.call($btn,'toggle')
825if(!($(e.target).is('input[type="radio"], input[type="checkbox"]'))){e.preventDefault()
826if($btn.is('input,button'))$btn.trigger('focus')
827else $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)
828this.$indicators=this.$element.find('.carousel-indicators')
829this.options=options
830this.paused=null
831this.sliding=null
832this.interval=null
833this.$active=null
834this.$items=null
835this.options.keyboard&&this.$element.on('keydown.bs.carousel',$.proxy(this.keydown,this))
836this.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))}
837Carousel.VERSION='3.4.1'
838Carousel.TRANSITION_DURATION=600
839Carousel.DEFAULTS={interval:5000,pause:'hover',wrap:true,keyboard:true}
840Carousel.prototype.keydown=function(e){if(/input|textarea/i.test(e.target.tagName))return
841switch(e.which){case 37:this.prev();break
842case 39:this.next();break
843default:return}
844e.preventDefault()}
845Carousel.prototype.cycle=function(e){e||(this.paused=false)
846this.interval&&clearInterval(this.interval)
847this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval))
848return this}
849Carousel.prototype.getItemIndex=function(item){this.$items=item.parent().children('.item')
850return this.$items.index(item||this.$active)}
851Carousel.prototype.getItemForDirection=function(direction,active){var activeIndex=this.getItemIndex(active)
852var willWrap=(direction=='prev'&&activeIndex===0)||(direction=='next'&&activeIndex==(this.$items.length-1))
853if(willWrap&&!this.options.wrap)return active
854var delta=direction=='prev'?-1:1
855var itemIndex=(activeIndex+delta)%this.$items.length
856return this.$items.eq(itemIndex)}
857Carousel.prototype.to=function(pos){var that=this
858var activeIndex=this.getItemIndex(this.$active=this.$element.find('.item.active'))
859if(pos>(this.$items.length-1)||pos<0)return
860if(this.sliding)return this.$element.one('slid.bs.carousel',function(){that.to(pos)})
861if(activeIndex==pos)return this.pause().cycle()
862return this.slide(pos>activeIndex?'next':'prev',this.$items.eq(pos))}
863Carousel.prototype.pause=function(e){e||(this.paused=true)
864if(this.$element.find('.next, .prev').length&&$.support.transition){this.$element.trigger($.support.transition.end)
865this.cycle(true)}
866this.interval=clearInterval(this.interval)
867return this}
868Carousel.prototype.next=function(){if(this.sliding)return
869return this.slide('next')}
870Carousel.prototype.prev=function(){if(this.sliding)return
871return this.slide('prev')}
872Carousel.prototype.slide=function(type,next){var $active=this.$element.find('.item.active')
873var $next=next||this.getItemForDirection(type,$active)
874var isCycling=this.interval
875var direction=type=='next'?'left':'right'
876var that=this
877if($next.hasClass('active'))return(this.sliding=false)
878var relatedTarget=$next[0]
879var slideEvent=$.Event('slide.bs.carousel',{relatedTarget:relatedTarget,direction:direction})
880this.$element.trigger(slideEvent)
881if(slideEvent.isDefaultPrevented())return
882this.sliding=true
883isCycling&&this.pause()
884if(this.$indicators.length){this.$indicators.find('.active').removeClass('active')
885var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)])
886$nextIndicator&&$nextIndicator.addClass('active')}
887var slidEvent=$.Event('slid.bs.carousel',{relatedTarget:relatedTarget,direction:direction})
888if($.support.transition&&this.$element.hasClass('slide')){$next.addClass(type)
889if(typeof $next==='object'&&$next.length){$next[0].offsetWidth}
890$active.addClass(direction)
891$next.addClass(direction)
892$active.one('bsTransitionEnd',function(){$next.removeClass([type,direction].join(' ')).addClass('active')
893$active.removeClass(['active',direction].join(' '))
894that.sliding=false
895setTimeout(function(){that.$element.trigger(slidEvent)},0)}).emulateTransitionEnd(Carousel.TRANSITION_DURATION)}else{$active.removeClass('active')
896$next.addClass('active')
897this.sliding=false
898this.$element.trigger(slidEvent)}
899isCycling&&this.cycle()
900return this}
901function Plugin(option){return this.each(function(){var $this=$(this)
902var data=$this.data('bs.carousel')
903var options=$.extend({},Carousel.DEFAULTS,$this.data(),typeof option=='object'&&option)
904var action=typeof option=='string'?option:options.slide
905if(!data)$this.data('bs.carousel',(data=new Carousel(this,options)))
906if(typeof option=='number')data.to(option)
907else if(action)data[action]()
908else if(options.interval)data.pause().cycle()})}
909var old=$.fn.carousel
910$.fn.carousel=Plugin
911$.fn.carousel.Constructor=Carousel
912$.fn.carousel.noConflict=function(){$.fn.carousel=old
913return this}
914var clickHandler=function(e){var $this=$(this)
915var href=$this.attr('href')
916if(href){href=href.replace(/.*(?=#[^\s]+$)/,'')}
917var target=$this.attr('data-target')||href
918var $target=$(document).find(target)
919if(!$target.hasClass('carousel'))return
920var options=$.extend({},$target.data(),$this.data())
921var slideIndex=$this.attr('data-slide-to')
922if(slideIndex)options.interval=false
923Plugin.call($target,options)
924if(slideIndex){$target.data('bs.carousel').to(slideIndex)}
925e.preventDefault()}
926$(document).on('click.bs.carousel.data-api','[data-slide]',clickHandler).on('click.bs.carousel.data-api','[data-slide-to]',clickHandler)
927$(window).on('load',function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this)
928Plugin.call($carousel,$carousel.data())})})}(jQuery);+function($){'use strict';var Collapse=function(element,options){this.$element=$(element)
929this.options=$.extend({},Collapse.DEFAULTS,options)
930this.$trigger=$('[data-toggle="collapse"][href="#'+element.id+'"],'+'[data-toggle="collapse"][data-target="#'+element.id+'"]')
931this.transitioning=null
932if(this.options.parent){this.$parent=this.getParent()}else{this.addAriaAndCollapsedClass(this.$element,this.$trigger)}
933if(this.options.toggle)this.toggle()}
934Collapse.VERSION='3.4.1'
935Collapse.TRANSITION_DURATION=350
936Collapse.DEFAULTS={toggle:true}
937Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass('width')
938return hasWidth?'width':'height'}
939Collapse.prototype.show=function(){if(this.transitioning||this.$element.hasClass('in'))return
940var activesData
941var actives=this.$parent&&this.$parent.children('.panel').children('.in, .collapsing')
942if(actives&&actives.length){activesData=actives.data('bs.collapse')
943if(activesData&&activesData.transitioning)return}
944var startEvent=$.Event('show.bs.collapse')
945this.$element.trigger(startEvent)
946if(startEvent.isDefaultPrevented())return
947if(actives&&actives.length){Plugin.call(actives,'hide')
948activesData||actives.data('bs.collapse',null)}
949var dimension=this.dimension()
950this.$element.removeClass('collapse').addClass('collapsing')[dimension](0).attr('aria-expanded',true)
951this.$trigger.removeClass('collapsed').attr('aria-expanded',true)
952this.transitioning=1
953var complete=function(){this.$element.removeClass('collapsing').addClass('collapse in')[dimension]('')
954this.transitioning=0
955this.$element.trigger('shown.bs.collapse')}
956if(!$.support.transition)return complete.call(this)
957var scrollSize=$.camelCase(['scroll',dimension].join('-'))
958this.$element.one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])}
959Collapse.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass('in'))return
960var startEvent=$.Event('hide.bs.collapse')
961this.$element.trigger(startEvent)
962if(startEvent.isDefaultPrevented())return
963var dimension=this.dimension()
964this.$element[dimension](this.$element[dimension]())[0].offsetHeight
965this.$element.addClass('collapsing').removeClass('collapse in').attr('aria-expanded',false)
966this.$trigger.addClass('collapsed').attr('aria-expanded',false)
967this.transitioning=1
968var complete=function(){this.transitioning=0
969this.$element.removeClass('collapsing').addClass('collapse').trigger('hidden.bs.collapse')}
970if(!$.support.transition)return complete.call(this)
971this.$element
972[dimension](0).one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)}
973Collapse.prototype.toggle=function(){this[this.$element.hasClass('in')?'hide':'show']()}
974Collapse.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)
975this.addAriaAndCollapsedClass(getTargetFromTrigger($element),$element)},this)).end()}
976Collapse.prototype.addAriaAndCollapsedClass=function($element,$trigger){var isOpen=$element.hasClass('in')
977$element.attr('aria-expanded',isOpen)
978$trigger.toggleClass('collapsed',!isOpen).attr('aria-expanded',isOpen)}
979function getTargetFromTrigger($trigger){var href
980var target=$trigger.attr('data-target')||(href=$trigger.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,'')
981return $(document).find(target)}
982function Plugin(option){return this.each(function(){var $this=$(this)
983var data=$this.data('bs.collapse')
984var options=$.extend({},Collapse.DEFAULTS,$this.data(),typeof option=='object'&&option)
985if(!data&&options.toggle&&/show|hide/.test(option))options.toggle=false
986if(!data)$this.data('bs.collapse',(data=new Collapse(this,options)))
987if(typeof option=='string')data[option]()})}
988var old=$.fn.collapse
989$.fn.collapse=Plugin
990$.fn.collapse.Constructor=Collapse
991$.fn.collapse.noConflict=function(){$.fn.collapse=old
992return this}
993$(document).on('click.bs.collapse.data-api','[data-toggle="collapse"]',function(e){var $this=$(this)
994if(!$this.attr('data-target'))e.preventDefault()
995var $target=getTargetFromTrigger($this)
996var data=$target.data('bs.collapse')
997var option=data?'toggle':$this.data()
998Plugin.call($target,option)})}(jQuery);+function($){'use strict';var backdrop='.dropdown-backdrop'
999var toggle='[data-toggle="dropdown"]'
1000var Dropdown=function(element){$(element).on('click.bs.dropdown',this.toggle)}
1001Dropdown.VERSION='3.4.1'
1002function getParent($this){var selector=$this.attr('data-target')
1003if(!selector){selector=$this.attr('href')
1004selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,'')}
1005var $parent=selector!=='#'?$(document).find(selector):null
1006return $parent&&$parent.length?$parent:$this.parent()}
1007function clearMenus(e){if(e&&e.which===3)return
1008$(backdrop).remove()
1009$(toggle).each(function(){var $this=$(this)
1010var $parent=getParent($this)
1011var relatedTarget={relatedTarget:this}
1012if(!$parent.hasClass('open'))return
1013if(e&&e.type=='click'&&/input|textarea/i.test(e.target.tagName)&&$.contains($parent[0],e.target))return
1014$parent.trigger(e=$.Event('hide.bs.dropdown',relatedTarget))
1015if(e.isDefaultPrevented())return
1016$this.attr('aria-expanded','false')
1017$parent.removeClass('open').trigger($.Event('hidden.bs.dropdown',relatedTarget))})}
1018Dropdown.prototype.toggle=function(e){var $this=$(this)
1019if($this.is('.disabled, :disabled'))return
1020var $parent=getParent($this)
1021var isActive=$parent.hasClass('open')
1022clearMenus()
1023if(!isActive){if('ontouchstart'in document.documentElement&&!$parent.closest('.navbar-nav').length){$(document.createElement('div')).addClass('dropdown-backdrop').insertAfter($(this)).on('click',clearMenus)}
1024var relatedTarget={relatedTarget:this}
1025$parent.trigger(e=$.Event('show.bs.dropdown',relatedTarget))
1026if(e.isDefaultPrevented())return
1027$this.trigger('focus').attr('aria-expanded','true')
1028$parent.toggleClass('open').trigger($.Event('shown.bs.dropdown',relatedTarget))}
1029return false}
1030Dropdown.prototype.keydown=function(e){if(!/(38|40|27|32)/.test(e.which)||/input|textarea/i.test(e.target.tagName))return
1031var $this=$(this)
1032e.preventDefault()
1033e.stopPropagation()
1034if($this.is('.disabled, :disabled'))return
1035var $parent=getParent($this)
1036var isActive=$parent.hasClass('open')
1037if(!isActive&&e.which!=27||isActive&&e.which==27){if(e.which==27)$parent.find(toggle).trigger('focus')
1038return $this.trigger('click')}
1039var desc=' li:not(.disabled):visible a'
1040var $items=$parent.find('.dropdown-menu'+desc)
1041if(!$items.length)return
1042var index=$items.index(e.target)
1043if(e.which==38&&index>0)index--
1044if(e.which==40&&index<$items.length-1)index++
1045if(!~index)index=0
1046$items.eq(index).trigger('focus')}
1047function Plugin(option){return this.each(function(){var $this=$(this)
1048var data=$this.data('bs.dropdown')
1049if(!data)$this.data('bs.dropdown',(data=new Dropdown(this)))
1050if(typeof option=='string')data[option].call($this)})}
1051var old=$.fn.dropdown
1052$.fn.dropdown=Plugin
1053$.fn.dropdown.Constructor=Dropdown
1054$.fn.dropdown.noConflict=function(){$.fn.dropdown=old
1055return this}
1056$(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
1057this.$body=$(document.body)
1058this.$element=$(element)
1059this.$dialog=this.$element.find('.modal-dialog')
1060this.$backdrop=null
1061this.isShown=null
1062this.originalBodyPad=null
1063this.scrollbarWidth=0
1064this.ignoreBackdropClick=false
1065this.fixedContent='.navbar-fixed-top, .navbar-fixed-bottom'
1066if(this.options.remote){this.$element.find('.modal-content').load(this.options.remote,$.proxy(function(){this.$element.trigger('loaded.bs.modal')},this))}}
1067Modal.VERSION='3.4.1'
1068Modal.TRANSITION_DURATION=300
1069Modal.BACKDROP_TRANSITION_DURATION=150
1070Modal.DEFAULTS={backdrop:true,keyboard:true,show:true}
1071Modal.prototype.toggle=function(_relatedTarget){return this.isShown?this.hide():this.show(_relatedTarget)}
1072Modal.prototype.show=function(_relatedTarget){var that=this
1073var e=$.Event('show.bs.modal',{relatedTarget:_relatedTarget})
1074this.$element.trigger(e)
1075if(this.isShown||e.isDefaultPrevented())return
1076this.isShown=true
1077this.checkScrollbar()
1078this.setScrollbar()
1079this.$body.addClass('modal-open')
1080this.escape()
1081this.resize()
1082this.$element.on('click.dismiss.bs.modal','[data-dismiss="modal"]',$.proxy(this.hide,this))
1083this.$dialog.on('mousedown.dismiss.bs.modal',function(){that.$element.one('mouseup.dismiss.bs.modal',function(e){if($(e.target).is(that.$element))that.ignoreBackdropClick=true})})
1084this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass('fade')
1085if(!that.$element.parent().length){that.$element.appendTo(that.$body)}
1086that.$element.show().scrollTop(0)
1087that.adjustDialog()
1088if(transition){that.$element[0].offsetWidth}
1089that.$element.addClass('in')
1090that.enforceFocus()
1091var e=$.Event('shown.bs.modal',{relatedTarget:_relatedTarget})
1092transition?that.$dialog.one('bsTransitionEnd',function(){that.$element.trigger('focus').trigger(e)}).emulateTransitionEnd(Modal.TRANSITION_DURATION):that.$element.trigger('focus').trigger(e)})}
1093Modal.prototype.hide=function(e){if(e)e.preventDefault()
1094e=$.Event('hide.bs.modal')
1095this.$element.trigger(e)
1096if(!this.isShown||e.isDefaultPrevented())return
1097this.isShown=false
1098this.escape()
1099this.resize()
1100$(document).off('focusin.bs.modal')
1101this.$element.removeClass('in').off('click.dismiss.bs.modal').off('mouseup.dismiss.bs.modal')
1102this.$dialog.off('mousedown.dismiss.bs.modal')
1103$.support.transition&&this.$element.hasClass('fade')?this.$element.one('bsTransitionEnd',$.proxy(this.hideModal,this)).emulateTransitionEnd(Modal.TRANSITION_DURATION):this.hideModal()}
1104Modal.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))}
1105Modal.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')}}
1106Modal.prototype.resize=function(){if(this.isShown){$(window).on('resize.bs.modal',$.proxy(this.handleUpdate,this))}else{$(window).off('resize.bs.modal')}}
1107Modal.prototype.hideModal=function(){var that=this
1108this.$element.hide()
1109this.backdrop(function(){that.$body.removeClass('modal-open')
1110that.resetAdjustments()
1111that.resetScrollbar()
1112that.$element.trigger('hidden.bs.modal')})}
1113Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove()
1114this.$backdrop=null}
1115Modal.prototype.backdrop=function(callback){var that=this
1116var animate=this.$element.hasClass('fade')?'fade':''
1117if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate
1118this.$backdrop=$(document.createElement('div')).addClass('modal-backdrop '+animate).appendTo(this.$body)
1119this.$element.on('click.dismiss.bs.modal',$.proxy(function(e){if(this.ignoreBackdropClick){this.ignoreBackdropClick=false
1120return}
1121if(e.target!==e.currentTarget)return
1122this.options.backdrop=='static'?this.$element[0].focus():this.hide()},this))
1123if(doAnimate)this.$backdrop[0].offsetWidth
1124this.$backdrop.addClass('in')
1125if(!callback)return
1126doAnimate?this.$backdrop.one('bsTransitionEnd',callback).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass('in')
1127var callbackRemove=function(){that.removeBackdrop()
1128callback&&callback()}
1129$.support.transition&&this.$element.hasClass('fade')?this.$backdrop.one('bsTransitionEnd',callbackRemove).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callbackRemove()}else if(callback){callback()}}
1130Modal.prototype.handleUpdate=function(){this.adjustDialog()}
1131Modal.prototype.adjustDialog=function(){var modalIsOverflowing=this.$element[0].scrollHeight>document.documentElement.clientHeight
1132this.$element.css({paddingLeft:!this.bodyIsOverflowing&&modalIsOverflowing?this.scrollbarWidth:'',paddingRight:this.bodyIsOverflowing&&!modalIsOverflowing?this.scrollbarWidth:''})}
1133Modal.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:'',paddingRight:''})}
1134Modal.prototype.checkScrollbar=function(){var fullWindowWidth=window.innerWidth
1135if(!fullWindowWidth){var documentElementRect=document.documentElement.getBoundingClientRect()
1136fullWindowWidth=documentElementRect.right-Math.abs(documentElementRect.left)}
1137this.bodyIsOverflowing=document.body.clientWidth<fullWindowWidth
1138this.scrollbarWidth=this.measureScrollbar()}
1139Modal.prototype.setScrollbar=function(){var bodyPad=parseInt((this.$body.css('padding-right')||0),10)
1140this.originalBodyPad=document.body.style.paddingRight||''
1141var scrollbarWidth=this.scrollbarWidth
1142if(this.bodyIsOverflowing){this.$body.css('padding-right',bodyPad+scrollbarWidth)
1143$(this.fixedContent).each(function(index,element){var actualPadding=element.style.paddingRight
1144var calculatedPadding=$(element).css('padding-right')
1145$(element).data('padding-right',actualPadding).css('padding-right',parseFloat(calculatedPadding)+scrollbarWidth+'px')})}}
1146Modal.prototype.resetScrollbar=function(){this.$body.css('padding-right',this.originalBodyPad)
1147$(this.fixedContent).each(function(index,element){var padding=$(element).data('padding-right')
1148$(element).removeData('padding-right')
1149element.style.paddingRight=padding?padding:''})}
1150Modal.prototype.measureScrollbar=function(){var scrollDiv=document.createElement('div')
1151scrollDiv.className='modal-scrollbar-measure'
1152this.$body.append(scrollDiv)
1153var scrollbarWidth=scrollDiv.offsetWidth-scrollDiv.clientWidth
1154this.$body[0].removeChild(scrollDiv)
1155return scrollbarWidth}
1156function Plugin(option,_relatedTarget){return this.each(function(){var $this=$(this)
1157var data=$this.data('bs.modal')
1158var options=$.extend({},Modal.DEFAULTS,$this.data(),typeof option=='object'&&option)
1159if(!data)$this.data('bs.modal',(data=new Modal(this,options)))
1160if(typeof option=='string')data[option](_relatedTarget)
1161else if(options.show)data.show(_relatedTarget)})}
1162var old=$.fn.modal
1163$.fn.modal=Plugin
1164$.fn.modal.Constructor=Modal
1165$.fn.modal.noConflict=function(){$.fn.modal=old
1166return this}
1167$(document).on('click.bs.modal.data-api','[data-toggle="modal"]',function(e){var $this=$(this)
1168var href=$this.attr('href')
1169var target=$this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/,''))
1170var $target=$(document).find(target)
1171var option=$target.data('bs.modal')?'toggle':$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data())
1172if($this.is('a'))e.preventDefault()
1173$target.one('show.bs.modal',function(showEvent){if(showEvent.isDefaultPrevented())return
1174$target.one('hidden.bs.modal',function(){$this.is(':visible')&&$this.trigger('focus')})})
1175Plugin.call($target,option,this)})}(jQuery);+function($){'use strict';var DISALLOWED_ATTRIBUTES=['sanitize','whiteList','sanitizeFn']
1176var uriAttrs=['background','cite','href','itemtype','longdesc','poster','src','xlink:href']
1177var ARIA_ATTRIBUTE_PATTERN=/^aria-[\w-]*$/i
1178var 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:[]}
1179var SAFE_URL_PATTERN=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
1180var 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
1181function allowedAttribute(attr,allowedAttributeList){var attrName=attr.nodeName.toLowerCase()
1182if($.inArray(attrName,allowedAttributeList)!==-1){if($.inArray(attrName,uriAttrs)!==-1){return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN)||attr.nodeValue.match(DATA_URL_PATTERN))}
1183return true}
1184var regExp=$(allowedAttributeList).filter(function(index,value){return value instanceof RegExp})
1185for(var i=0,l=regExp.length;i<l;i++){if(attrName.match(regExp[i])){return true}}
1186return false}
1187function sanitizeHtml(unsafeHtml,whiteList,sanitizeFn){if(unsafeHtml.length===0){return unsafeHtml}
1188if(sanitizeFn&&typeof sanitizeFn==='function'){return sanitizeFn(unsafeHtml)}
1189if(!document.implementation||!document.implementation.createHTMLDocument){return unsafeHtml}
1190var createdDocument=document.implementation.createHTMLDocument('sanitization')
1191createdDocument.body.innerHTML=unsafeHtml
1192var whitelistKeys=$.map(whiteList,function(el,i){return i})
1193var elements=$(createdDocument.body).find('*')
1194for(var i=0,len=elements.length;i<len;i++){var el=elements[i]
1195var elName=el.nodeName.toLowerCase()
1196if($.inArray(elName,whitelistKeys)===-1){el.parentNode.removeChild(el)
1197continue}
1198var attributeList=$.map(el.attributes,function(el){return el})
1199var whitelistedAttributes=[].concat(whiteList['*']||[],whiteList[elName]||[])
1200for(var j=0,len2=attributeList.length;j<len2;j++){if(!allowedAttribute(attributeList[j],whitelistedAttributes)){el.removeAttribute(attributeList[j].nodeName)}}}
1201return createdDocument.body.innerHTML}
1202var Tooltip=function(element,options){this.type=null
1203this.options=null
1204this.enabled=null
1205this.timeout=null
1206this.hoverState=null
1207this.$element=null
1208this.inState=null
1209this.init('tooltip',element,options)}
1210Tooltip.VERSION='3.4.1'
1211Tooltip.TRANSITION_DURATION=150
1212Tooltip.DEFAULTS={animation:true,placement:'top',selector:false,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:false,container:false,viewport:{selector:'body',padding:0},sanitize:true,sanitizeFn:null,whiteList:DefaultWhitelist}
1213Tooltip.prototype.init=function(type,element,options){this.enabled=true
1214this.type=type
1215this.$element=$(element)
1216this.options=this.getOptions(options)
1217this.$viewport=this.options.viewport&&$(document).find($.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):(this.options.viewport.selector||this.options.viewport))
1218this.inState={click:false,hover:false,focus:false}
1219if(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!')}
1220var triggers=this.options.trigger.split(' ')
1221for(var i=triggers.length;i--;){var trigger=triggers[i]
1222if(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'
1223var eventOut=trigger=='hover'?'mouseleave':'focusout'
1224this.$element.on(eventIn+'.'+this.type,this.options.selector,$.proxy(this.enter,this))
1225this.$element.on(eventOut+'.'+this.type,this.options.selector,$.proxy(this.leave,this))}}
1226this.options.selector?(this._options=$.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()}
1227Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS}
1228Tooltip.prototype.getOptions=function(options){var dataAttributes=this.$element.data()
1229for(var dataAttr in dataAttributes){if(dataAttributes.hasOwnProperty(dataAttr)&&$.inArray(dataAttr,DISALLOWED_ATTRIBUTES)!==-1){delete dataAttributes[dataAttr]}}
1230options=$.extend({},this.getDefaults(),dataAttributes,options)
1231if(options.delay&&typeof options.delay=='number'){options.delay={show:options.delay,hide:options.delay}}
1232if(options.sanitize){options.template=sanitizeHtml(options.template,options.whiteList,options.sanitizeFn)}
1233return options}
1234Tooltip.prototype.getDelegateOptions=function(){var options={}
1235var defaults=this.getDefaults()
1236this._options&&$.each(this._options,function(key,value){if(defaults[key]!=value)options[key]=value})
1237return options}
1238Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
1239if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
1240$(obj.currentTarget).data('bs.'+this.type,self)}
1241if(obj instanceof $.Event){self.inState[obj.type=='focusin'?'focus':'hover']=true}
1242if(self.tip().hasClass('in')||self.hoverState=='in'){self.hoverState='in'
1243return}
1244clearTimeout(self.timeout)
1245self.hoverState='in'
1246if(!self.options.delay||!self.options.delay.show)return self.show()
1247self.timeout=setTimeout(function(){if(self.hoverState=='in')self.show()},self.options.delay.show)}
1248Tooltip.prototype.isInStateTrue=function(){for(var key in this.inState){if(this.inState[key])return true}
1249return false}
1250Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
1251if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
1252$(obj.currentTarget).data('bs.'+this.type,self)}
1253if(obj instanceof $.Event){self.inState[obj.type=='focusout'?'focus':'hover']=false}
1254if(self.isInStateTrue())return
1255clearTimeout(self.timeout)
1256self.hoverState='out'
1257if(!self.options.delay||!self.options.delay.hide)return self.hide()
1258self.timeout=setTimeout(function(){if(self.hoverState=='out')self.hide()},self.options.delay.hide)}
1259Tooltip.prototype.show=function(){var e=$.Event('show.bs.'+this.type)
1260if(this.hasContent()&&this.enabled){this.$element.trigger(e)
1261var inDom=$.contains(this.$element[0].ownerDocument.documentElement,this.$element[0])
1262if(e.isDefaultPrevented()||!inDom)return
1263var that=this
1264var $tip=this.tip()
1265var tipId=this.getUID(this.type)
1266this.setContent()
1267$tip.attr('id',tipId)
1268this.$element.attr('aria-describedby',tipId)
1269if(this.options.animation)$tip.addClass('fade')
1270var placement=typeof this.options.placement=='function'?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement
1271var autoToken=/\s?auto?\s?/i
1272var autoPlace=autoToken.test(placement)
1273if(autoPlace)placement=placement.replace(autoToken,'')||'top'
1274$tip.detach().css({top:0,left:0,display:'block'}).addClass(placement).data('bs.'+this.type,this)
1275this.options.container?$tip.appendTo($(document).find(this.options.container)):$tip.insertAfter(this.$element)
1276this.$element.trigger('inserted.bs.'+this.type)
1277var pos=this.getPosition()
1278var actualWidth=$tip[0].offsetWidth
1279var actualHeight=$tip[0].offsetHeight
1280if(autoPlace){var orgPlacement=placement
1281var viewportDim=this.getPosition(this.$viewport)
1282placement=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
1283$tip.removeClass(orgPlacement).addClass(placement)}
1284var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight)
1285this.applyPlacement(calculatedOffset,placement)
1286var complete=function(){var prevHoverState=that.hoverState
1287that.$element.trigger('shown.bs.'+that.type)
1288that.hoverState=null
1289if(prevHoverState=='out')that.leave(that)}
1290$.support.transition&&this.$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()}}
1291Tooltip.prototype.applyPlacement=function(offset,placement){var $tip=this.tip()
1292var width=$tip[0].offsetWidth
1293var height=$tip[0].offsetHeight
1294var marginTop=parseInt($tip.css('margin-top'),10)
1295var marginLeft=parseInt($tip.css('margin-left'),10)
1296if(isNaN(marginTop))marginTop=0
1297if(isNaN(marginLeft))marginLeft=0
1298offset.top+=marginTop
1299offset.left+=marginLeft
1300$.offset.setOffset($tip[0],$.extend({using:function(props){$tip.css({top:Math.round(props.top),left
vendor: 4,528 bytes, lines 1300-1363
1300:Math.round(props.left)})}},offset),0)
1301$tip.addClass('in')
1302var actualWidth=$tip[0].offsetWidth
1303var actualHeight=$tip[0].offsetHeight
1304if(placement=='top'&&actualHeight!=height){offset.top=offset.top+height-actualHeight}
1305var delta=this.getViewportAdjustedDelta(placement,offset,actualWidth,actualHeight)
1306if(delta.left)offset.left+=delta.left
1307else offset.top+=delta.top
1308var isVertical=/top|bottom/.test(placement)
1309var arrowDelta=isVertical?delta.left*2-width+actualWidth:delta.top*2-height+actualHeight
1310var arrowOffsetPosition=isVertical?'offsetWidth':'offsetHeight'
1311$tip.offset(offset)
1312this.replaceArrow(arrowDelta,$tip[0][arrowOffsetPosition],isVertical)}
1313Tooltip.prototype.replaceArrow=function(delta,dimension,isVertical){this.arrow().css(isVertical?'left':'top',50*(1-delta / dimension)+'%').css(isVertical?'top':'left','')}
1314Tooltip.prototype.setContent=function(){var $tip=this.tip()
1315var title=this.getTitle()
1316if(this.options.html){if(this.options.sanitize){title=sanitizeHtml(title,this.options.whiteList,this.options.sanitizeFn)}
1317$tip.find('.tooltip-inner').html(title)}else{$tip.find('.tooltip-inner').text(title)}
1318$tip.removeClass('fade in top bottom left right')}
1319Tooltip.prototype.hide=function(callback){var that=this
1320var $tip=$(this.$tip)
1321var e=$.Event('hide.bs.'+this.type)
1322function complete(){if(that.hoverState!='in')$tip.detach()
1323if(that.$element){that.$element.removeAttr('aria-describedby').trigger('hidden.bs.'+that.type)}
1324callback&&callback()}
1325this.$element.trigger(e)
1326if(e.isDefaultPrevented())return
1327$tip.removeClass('in')
1328$.support.transition&&$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()
1329this.hoverState=null
1330return this}
1331Tooltip.prototype.fixTitle=function(){var $e=this.$element
1332if($e.attr('title')||typeof $e.attr('data-original-title')!='string'){$e.attr('data-original-title',$e.attr('title')||'').attr('title','')}}
1333Tooltip.prototype.hasContent=function(){return this.getTitle()}
1334Tooltip.prototype.getPosition=function($element){$element=$element||this.$element
1335var el=$element[0]
1336var isBody=el.tagName=='BODY'
1337var elRect=el.getBoundingClientRect()
1338if(elRect.width==null){elRect=$.extend({},elRect,{width:elRect.right-elRect.left,height:elRect.bottom-elRect.top})}
1339var isSvg=window.SVGElement&&el instanceof window.SVGElement
1340var elOffset=isBody?{top:0,left:0}:(isSvg?null:$element.offset())
1341var scroll={scroll:isBody?document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop()}
1342var outerDims=isBody?{width:$(window).width(),height:$(window).height()}:null
1343return $.extend({},elRect,scroll,outerDims,elOffset)}
1344Tooltip.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}}
1345Tooltip.prototype.getViewportAdjustedDelta=function(placement,pos,actualWidth,actualHeight){var delta={top:0,left:0}
1346if(!this.$viewport)return delta
1347var viewportPadding=this.options.viewport&&this.options.viewport.padding||0
1348var viewportDimensions=this.getPosition(this.$viewport)
1349if(/right|left/.test(placement)){var topEdgeOffset=pos.top-viewportPadding-viewportDimensions.scroll
1350var bottomEdgeOffset=pos.top+viewportPadding-viewportDimensions.scroll+actualHeight
1351if(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
1352var rightEdgeOffset=pos.left+viewportPadding+actualWidth
1353if(leftEdgeOffset<viewportDimensions.left){delta.left=viewportDimensions.left-leftEdgeOffset}else if(rightEdgeOffset>viewportDimensions.right){delta.left=viewportDimensions.left+viewportDimensions.width-rightEdgeOffset}}
1354return delta}
1355Tooltip.prototype.getTitle=function(){var title
1356var $e=this.$element
1357var o=this.options
1358title=$e.attr('data-original-title')||(typeof o.title=='function'?o.title.call($e[0]):o.title)
1359return title}
1360Tooltip.prototype.getUID=function(prefix){do prefix+=~~(Math.random()*1000000)
1361while(document.getElementById(prefix))
1362return prefix}
1363Tooltip.prototype.tip=function(){if(!this.$tip){this.$tip=$(this.options.template)
vendor: 16,543 bytes, lines 1364-1612
1364if(this.$tip.length!=1){throw new Error(this.type+' `template` option must consist of exactly 1 top-level element!')}}
1365return this.$tip}
1366Tooltip.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow'))}
1367Tooltip.prototype.enable=function(){this.enabled=true}
1368Tooltip.prototype.disable=function(){this.enabled=false}
1369Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled}
1370Tooltip.prototype.toggle=function(e){var self=this
1371if(e){self=$(e.currentTarget).data('bs.'+this.type)
1372if(!self){self=new this.constructor(e.currentTarget,this.getDelegateOptions())
1373$(e.currentTarget).data('bs.'+this.type,self)}}
1374if(e){self.inState.click=!self.inState.click
1375if(self.isInStateTrue())self.enter(self)
1376else self.leave(self)}else{self.tip().hasClass('in')?self.leave(self):self.enter(self)}}
1377Tooltip.prototype.destroy=function(){var that=this
1378clearTimeout(this.timeout)
1379this.hide(function(){that.$element.off('.'+that.type).removeData('bs.'+that.type)
1380if(that.$tip){that.$tip.detach()}
1381that.$tip=null
1382that.$arrow=null
1383that.$viewport=null
1384that.$element=null})}
1385Tooltip.prototype.sanitizeHtml=function(unsafeHtml){return sanitizeHtml(unsafeHtml,this.options.whiteList,this.options.sanitizeFn)}
1386function Plugin(option){return this.each(function(){var $this=$(this)
1387var data=$this.data('bs.tooltip')
1388var options=typeof option=='object'&&option
1389if(!data&&/destroy|hide/.test(option))return
1390if(!data)$this.data('bs.tooltip',(data=new Tooltip(this,options)))
1391if(typeof option=='string')data[option]()})}
1392var old=$.fn.tooltip
1393$.fn.tooltip=Plugin
1394$.fn.tooltip.Constructor=Tooltip
1395$.fn.tooltip.noConflict=function(){$.fn.tooltip=old
1396return this}}(jQuery);+function($){'use strict';var Popover=function(element,options){this.init('popover',element,options)}
1397if(!$.fn.tooltip)throw new Error('Popover requires tooltip.js')
1398Popover.VERSION='3.4.1'
1399Popover.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>'})
1400Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype)
1401Popover.prototype.constructor=Popover
1402Popover.prototype.getDefaults=function(){return Popover.DEFAULTS}
1403Popover.prototype.setContent=function(){var $tip=this.tip()
1404var title=this.getTitle()
1405var content=this.getContent()
1406if(this.options.html){var typeContent=typeof content
1407if(this.options.sanitize){title=this.sanitizeHtml(title)
1408if(typeContent==='string'){content=this.sanitizeHtml(content)}}
1409$tip.find('.popover-title').html(title)
1410$tip.find('.popover-content').children().detach().end()[typeContent==='string'?'html':'append'](content)}else{$tip.find('.popover-title').text(title)
1411$tip.find('.popover-content').children().detach().end().text(content)}
1412$tip.removeClass('fade top bottom left right in')
1413if(!$tip.find('.popover-title').html())$tip.find('.popover-title').hide()}
1414Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()}
1415Popover.prototype.getContent=function(){var $e=this.$element
1416var o=this.options
1417return $e.attr('data-content')||(typeof o.content=='function'?o.content.call($e[0]):o.content)}
1418Popover.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.arrow'))}
1419function Plugin(option){return this.each(function(){var $this=$(this)
1420var data=$this.data('bs.popover')
1421var options=typeof option=='object'&&option
1422if(!data&&/destroy|hide/.test(option))return
1423if(!data)$this.data('bs.popover',(data=new Popover(this,options)))
1424if(typeof option=='string')data[option]()})}
1425var old=$.fn.popover
1426$.fn.popover=Plugin
1427$.fn.popover.Constructor=Popover
1428$.fn.popover.noConflict=function(){$.fn.popover=old
1429return this}}(jQuery);+function($){'use strict';function ScrollSpy(element,options){this.$body=$(document.body)
1430this.$scrollElement=$(element).is(document.body)?$(window):$(element)
1431this.options=$.extend({},ScrollSpy.DEFAULTS,options)
1432this.selector=(this.options.target||'')+' .nav li > a'
1433this.offsets=[]
1434this.targets=[]
1435this.activeTarget=null
1436this.scrollHeight=0
1437this.$scrollElement.on('scroll.bs.scrollspy',$.proxy(this.process,this))
1438this.refresh()
1439this.process()}
1440ScrollSpy.VERSION='3.4.1'
1441ScrollSpy.DEFAULTS={offset:10}
1442ScrollSpy.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)}
1443ScrollSpy.prototype.refresh=function(){var that=this
1444var offsetMethod='offset'
1445var offsetBase=0
1446this.offsets=[]
1447this.targets=[]
1448this.scrollHeight=this.getScrollHeight()
1449if(!$.isWindow(this.$scrollElement[0])){offsetMethod='position'
1450offsetBase=this.$scrollElement.scrollTop()}
1451this.$body.find(this.selector).map(function(){var $el=$(this)
1452var href=$el.data('target')||$el.attr('href')
1453var $href=/^#./.test(href)&&$(href)
1454return($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])
1455that.targets.push(this[1])})}
1456ScrollSpy.prototype.process=function(){var scrollTop=this.$scrollElement.scrollTop()+this.options.offset
1457var scrollHeight=this.getScrollHeight()
1458var maxScroll=this.options.offset+scrollHeight-this.$scrollElement.height()
1459var offsets=this.offsets
1460var targets=this.targets
1461var activeTarget=this.activeTarget
1462var i
1463if(this.scrollHeight!=scrollHeight){this.refresh()}
1464if(scrollTop>=maxScroll){return activeTarget!=(i=targets[targets.length-1])&&this.activate(i)}
1465if(activeTarget&&scrollTop<offsets[0]){this.activeTarget=null
1466return this.clear()}
1467for(i=offsets.length;i--;){activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(offsets[i+1]===undefined||scrollTop<offsets[i+1])&&this.activate(targets[i])}}
1468ScrollSpy.prototype.activate=function(target){this.activeTarget=target
1469this.clear()
1470var selector=this.selector+'[data-target="'+target+'"],'+
1471this.selector+'[href="'+target+'"]'
1472var active=$(selector).parents('li').addClass('active')
1473if(active.parent('.dropdown-menu').length){active=active.closest('li.dropdown').addClass('active')}
1474active.trigger('activate.bs.scrollspy')}
1475ScrollSpy.prototype.clear=function(){$(this.selector).parentsUntil(this.options.target,'.active').removeClass('active')}
1476function Plugin(option){return this.each(function(){var $this=$(this)
1477var data=$this.data('bs.scrollspy')
1478var options=typeof option=='object'&&option
1479if(!data)$this.data('bs.scrollspy',(data=new ScrollSpy(this,options)))
1480if(typeof option=='string')data[option]()})}
1481var old=$.fn.scrollspy
1482$.fn.scrollspy=Plugin
1483$.fn.scrollspy.Constructor=ScrollSpy
1484$.fn.scrollspy.noConflict=function(){$.fn.scrollspy=old
1485return this}
1486$(window).on('load.bs.scrollspy.data-api',function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this)
1487Plugin.call($spy,$spy.data())})})}(jQuery);+function($){'use strict';var Tab=function(element){this.element=$(element)}
1488Tab.VERSION='3.4.1'
1489Tab.TRANSITION_DURATION=150
1490Tab.prototype.show=function(){var $this=this.element
1491var $ul=$this.closest('ul:not(.dropdown-menu)')
1492var selector=$this.data('target')
1493if(!selector){selector=$this.attr('href')
1494selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
1495if($this.parent('li').hasClass('active'))return
1496var $previous=$ul.find('.active:last a')
1497var hideEvent=$.Event('hide.bs.tab',{relatedTarget:$this[0]})
1498var showEvent=$.Event('show.bs.tab',{relatedTarget:$previous[0]})
1499$previous.trigger(hideEvent)
1500$this.trigger(showEvent)
1501if(showEvent.isDefaultPrevented()||hideEvent.isDefaultPrevented())return
1502var $target=$(document).find(selector)
1503this.activate($this.closest('li'),$ul)
1504this.activate($target,$target.parent(),function(){$previous.trigger({type:'hidden.bs.tab',relatedTarget:$this[0]})
1505$this.trigger({type:'shown.bs.tab',relatedTarget:$previous[0]})})}
1506Tab.prototype.activate=function(element,container,callback){var $active=container.find('> .active')
1507var transition=callback&&$.support.transition&&($active.length&&$active.hasClass('fade')||!!container.find('> .fade').length)
1508function next(){$active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded',false)
1509element.addClass('active').find('[data-toggle="tab"]').attr('aria-expanded',true)
1510if(transition){element[0].offsetWidth
1511element.addClass('in')}else{element.removeClass('fade')}
1512if(element.parent('.dropdown-menu').length){element.closest('li.dropdown').addClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded',true)}
1513callback&&callback()}
1514$active.length&&transition?$active.one('bsTransitionEnd',next).emulateTransitionEnd(Tab.TRANSITION_DURATION):next()
1515$active.removeClass('in')}
1516function Plugin(option){return this.each(function(){var $this=$(this)
1517var data=$this.data('bs.tab')
1518if(!data)$this.data('bs.tab',(data=new Tab(this)))
1519if(typeof option=='string')data[option]()})}
1520var old=$.fn.tab
1521$.fn.tab=Plugin
1522$.fn.tab.Constructor=Tab
1523$.fn.tab.noConflict=function(){$.fn.tab=old
1524return this}
1525var clickHandler=function(e){e.preventDefault()
1526Plugin.call($(this),'show')}
1527$(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)
1528var target=this.options.target===Affix.DEFAULTS.target?$(this.options.target):$(document).find(this.options.target)
1529this.$target=target.on('scroll.bs.affix.data-api',$.proxy(this.checkPosition,this)).on('click.bs.affix.data-api',$.proxy(this.checkPositionWithEventLoop,this))
1530this.$element=$(element)
1531this.affixed=null
1532this.unpin=null
1533this.pinnedOffset=null
1534this.checkPosition()}
1535Affix.VERSION='3.4.1'
1536Affix.RESET='affix affix-top affix-bottom'
1537Affix.DEFAULTS={offset:0,target:window}
1538Affix.prototype.getState=function(scrollHeight,height,offsetTop,offsetBottom){var scrollTop=this.$target.scrollTop()
1539var position=this.$element.offset()
1540var targetHeight=this.$target.height()
1541if(offsetTop!=null&&this.affixed=='top')return scrollTop<offsetTop?'top':false
1542if(this.affixed=='bottom'){if(offsetTop!=null)return(scrollTop+this.unpin<=position.top)?false:'bottom'
1543return(scrollTop+targetHeight<=scrollHeight-offsetBottom)?false:'bottom'}
1544var initializing=this.affixed==null
1545var colliderTop=initializing?scrollTop:position.top
1546var colliderHeight=initializing?targetHeight:height
1547if(offsetTop!=null&&scrollTop<=offsetTop)return'top'
1548if(offsetBottom!=null&&(colliderTop+colliderHeight>=scrollHeight-offsetBottom))return'bottom'
1549return false}
1550Affix.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset
1551this.$element.removeClass(Affix.RESET).addClass('affix')
1552var scrollTop=this.$target.scrollTop()
1553var position=this.$element.offset()
1554return(this.pinnedOffset=position.top-scrollTop)}
1555Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)}
1556Affix.prototype.checkPosition=function(){if(!this.$element.is(':visible'))return
1557var height=this.$element.height()
1558var offset=this.options.offset
1559var offsetTop=offset.top
1560var offsetBottom=offset.bottom
1561var scrollHeight=Math.max($(document).height(),$(document.body).height())
1562if(typeof offset!='object')offsetBottom=offsetTop=offset
1563if(typeof offsetTop=='function')offsetTop=offset.top(this.$element)
1564if(typeof offsetBottom=='function')offsetBottom=offset.bottom(this.$element)
1565var affix=this.getState(scrollHeight,height,offsetTop,offsetBottom)
1566if(this.affixed!=affix){if(this.unpin!=null)this.$element.css('top','')
1567var affixType='affix'+(affix?'-'+affix:'')
1568var e=$.Event(affixType+'.bs.affix')
1569this.$element.trigger(e)
1570if(e.isDefaultPrevented())return
1571this.affixed=affix
1572this.unpin=affix=='bottom'?this.getPinnedOffset():null
1573this.$element.removeClass(Affix.RESET).addClass(affixType).trigger(affixType.replace('affix','affixed')+'.bs.affix')}
1574if(affix=='bottom'){this.$element.offset({top:scrollHeight-height-offsetBottom})}}
1575function Plugin(option){return this.each(function(){var $this=$(this)
1576var data=$this.data('bs.affix')
1577var options=typeof option=='object'&&option
1578if(!data)$this.data('bs.affix',(data=new Affix(this,options)))
1579if(typeof option=='string')data[option]()})}
1580var old=$.fn.affix
1581$.fn.affix=Plugin
1582$.fn.affix.Constructor=Affix
1583$.fn.affix.noConflict=function(){$.fn.affix=old
1584return this}
1585$(window).on('load',function(){$('[data-spy="affix"]').each(function(){var $spy=$(this)
1586var data=$spy.data()
1587data.offset=data.offset||{}
1588if(data.offsetBottom!=null)data.offset.bottom=data.offsetBottom
1589if(data.offsetTop!=null)data.offset.top=data.offsetTop
1590Plugin.call($spy,data)})})}(jQuery);;;
1591/*! jQuery UI - v1.12.1 - 2016-09-14
1592* http://jqueryui.com
1593* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
1594* Copyright jQuery Foundation and other contributors; Licensed MIT */
1595(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else{factory(jQuery);}}(function($){$.ui=$.ui||{};var version=$.ui.version="1.12.1";
1596/*!
1597 * jQuery UI Widget 1.12.1
1598 * http://jqueryui.com
1599 *
1600 * Copyright jQuery Foundation and other contributors
1601 * Released under the MIT license.
1602 * http://jquery.org/license
1603 */
1604var widgetUuid=0;var widgetSlice=Array.prototype.slice;$.cleanData=(function(orig){return function(elems){var events,elem,i;for(i=0;(elem=elems[i])!=null;i++){try{events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler("remove");}}catch(e){}}
1605orig(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;}
1606if($.isArray(prototype)){prototype=$.extend.apply(null,[{}].concat(prototype));}
1607$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName);};$[namespace]=$[namespace]||{};existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(!this._createWidget){return new constructor(options,element);}
1608if(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(!$.isFunction(value)){proxiedPrototype[prop]=value;return;}
1609proxiedPrototype[prop]=(function(){function _super(){return base.prototype[prop].apply(this,arguments);}
1610function _superApply(args){return base.prototype[prop].apply(this,args);}
1611return 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);}
1612$.widget.bridge(name,constructor);return constructor;};$.widget.extend=function(target){var input=widgetSlice.call(arguments,1
vendor: 7,223 bytes, lines 1612-1638
1612);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(input[inputIndex].hasOwnProperty(key)&&value!==undefined){if($.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value);}else{target[key]=value;}}}}
1613return 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 false;}
1614if(!instance){return $.error("cannot call methods on "+name+" prior to initialization; "+"attempted to call method '"+options+"'");}
1615if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for "+name+" widget instance");}
1616methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args));}
1617this.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));}});}
1618return returnValue;};};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,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(true,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);}
1619this.options=$.widget.extend({},this.options,this._getCreateOptions(),options);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled);}
1620this._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);}
1621if(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]];}
1622key=parts.pop();if(arguments.length===1){return curOption[key]===undefined?null:curOption[key];}
1623curOption[key]=value;}else{if(arguments.length===1){return this.options[key]===undefined?null:this.options[key];}
1624options[key]=value;}}
1625this._setOptions(options);return this;},_setOptions:function(options){var key;for(key in options){this._setOption(key,options[key]);}
1626return this;},_setOption:function(key,value){if(key==="classes"){this._setOptionClasses(value);}
1627this.options[key]=value;if(key==="disabled"){this._setOptionDisabled(value);}
1628return 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;}
1629elements=$(currentElements.get());this._removeClass(currentElements,classKey);elements.addClass(this._classes({element:elements,keys:classKey,classes:value,add:true}));}},_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:false});},disable:function(){return this._setOptions({disabled:true});},_classes:function(options){var full=[];var that=this;options=$.extend({element:this.element,classes:this.options.classes||{}},options);function processClassString(classes,checkOption){var current,i;for(i=0;i<classes.length;i++){current=that.classesElementLookup[classes[i]]||$();if(options.add){current=$($.unique(current.get().concat(options.element.get())));}else{current=$(current.not(options.element).get());}
1630that.classesElementLookup[classes[i]]=current;full.push(classes[i]);if(checkOption&&options.classes[classes[i]]){full.push(options.classes[classes[i]]);}}}
1631this._on(options.element,{"remove":"_untrackClassesElement"});if(options.keys){processClassString(options.keys.match(/\S+/g)||[],true);}
1632if(options.extra){processClassString(options.extra.match(/\S+/g)||[]);}
1633return 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());}});},_removeClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,false);},_addClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,true);},_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=false;}
1634if(!handlers){handlers=element;element=this.element;delegateElement=this.widget();}else{element=delegateElement=$(element);this.bindings=this.bindings.add(element);}
1635$.each(handlers,function(event,handler){function handlerProxy(){if(!suppressDisabledCheck&&(instance.options.disabled===true||$(this).hasClass("ui-state-disabled"))){return;}
1636return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);}
1637if(typeof handler!=="string"){handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++;}
1638var match=event.match(/^([\w:-]*)\s*(.*)$/);var eventName=match[1]+instance.eventNamespace;var selector=match[2];
vendor: 9,377 bytes, lines 1638-1679
1638if(selector){delegateElement.on(eventName,selector,handlerProxy);}else{element.on(eventName,handlerProxy);}});},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+
1639this.eventNamespace;element.off(eventName).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);}
1640var 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];}}}
1641this.element.trigger(event,data);return!($.isFunction(callback)&&callback.apply(this.element[0],[event].concat(data))===false||event.isDefaultPrevented());}};$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){if(typeof options==="string"){options={effect:options};}
1642var hasOptions;var effectName=!options?method:options===true||typeof options==="number"?defaultEffect:options.effect||defaultEffect;options=options||{};if(typeof options==="number"){options={duration:options};}
1643hasOptions=!$.isEmptyObject(options);options.complete=callback;if(options.delay){element.delay(options.delay);}
1644if(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]);}
1645next();});}};});var widget=$.widget;
1646/*!
1647 * jQuery UI Position 1.12.1
1648 * http://jqueryui.com
1649 *
1650 * Copyright jQuery Foundation and other contributors
1651 * Released under the MIT license.
1652 * http://jquery.org/license
1653 *
1654 * http://api.jqueryui.com/position/
1655 */
1656(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)];}
1657function parseCss(element,property){return parseInt($.css(element,property),10)||0;}
1658function getDimensions(elem){var raw=elem[0];if(raw.nodeType===9){return{width:elem.width(),height:elem.height(),offset:{top:0,left:0}};}
1659if($.isWindow(raw)){return{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}};}
1660if(raw.preventDefault){return{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}};}
1661return{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()};}
1662$.position={scrollbarWidth:function(){if(cachedScrollbarWidth!==undefined){return cachedScrollbarWidth;}
1663var w1,w2,div=$("<div "+"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>"+"<div style='height:100px;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;}
1664div.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),isWindow=$.isWindow(withinElement[0]),isDocument=!!withinElement[0]&&withinElement[0].nodeType===9,hasOffset=!isWindow&&!isDocument;return{element:withinElement,isWindow:isWindow,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);}
1665options=$.extend({},options);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,dimensions,target=$(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";}
1666targetWidth=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"];}
1667pos[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];}
1668if(options.at[0]==="right"){basePosition.left+=targetWidth;}else if(options.at[0]==="center"){basePosition.left+=targetWidth / 2;}
1669if(options.at[1]==="bottom"){basePosition.top+=targetHeight;}else if(options.at[1]==="center"){basePosition.top+=targetHeight / 2;}
1670atOffset=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")+
1671scrollInfo.width,collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+
1672scrollInfo.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;}
1673if(options.my[1]==="bottom"){position.top-=elemHeight;}else if(options.my[1]==="center"){position.top-=elemHeight / 2;}
1674position.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";}
1675if(targetHeight<elemHeight&&abs(top+bottom)<targetHeight){feedback.vertical="middle";}
1676if(max(abs(left),abs(right))>max(abs(top),abs(bottom))){feedback.important="horizontal";}else{feedback.important="vertical";}
1677options.using.call(this,props,feedback);};}
1678elem.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-
1679withinOffset;position.left+=overLeft-newOverRight;}else if(overRight>
vendor: 5,355 bytes, lines 1679-1722
16790&&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-
1680withinOffset;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-
1681outerWidth-withinOffset;if(newOverRight<0||newOverRight<abs(overLeft)){position.left+=myOffset+atOffset+offset;}}else if(overRight>0){newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+
1682atOffset+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-
1683outerHeight-withinOffset;if(newOverBottom<0||newOverBottom<abs(overTop)){position.top+=myOffset+atOffset+offset;}}else if(overBottom>0){newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+
1684offset-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);}}};})();var position=$.ui.position;
1685/*!
1686 * jQuery UI :data 1.12.1
1687 * http://jqueryui.com
1688 *
1689 * Copyright jQuery Foundation and other contributors
1690 * Released under the MIT license.
1691 * http://jquery.org/license
1692 */
1693var data=$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName);};}):function(elem,i,match){return!!$.data(elem,match[3]);}});
1694/*!
1695 * jQuery UI Disable Selection 1.12.1
1696 * http://jqueryui.com
1697 *
1698 * Copyright jQuery Foundation and other contributors
1699 * Released under the MIT license.
1700 * http://jquery.org/license
1701 */
1702var disableSelection=$.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");}});
1703/*!
1704 * jQuery UI Effects 1.12.1
1705 * http://jqueryui.com
1706 *
1707 * Copyright jQuery Foundation and other contributors
1708 * Released under the MIT license.
1709 * http://jquery.org/license
1710 */
1711var dataSpace="ui-effects-",dataSpaceStyle="ui-effects-style",dataSpaceAnimated="ui-effects-animated",jQuery=$;$.effects={effect:{}};
1712/*!
1713 * jQuery Color Animations v2.1.2
1714 * https://github.com/jquery/jquery-color
1715 *
1716 * Copyright 2014 jQuery Foundation and other contributors
1717 * Released under the MIT license.
1718 * http://jquery.org/license
1719 *
1720 * Date: Wed Jan 16 08:47:09 2013 -0600
1721 */
1722(function(jQuery,undefined){var stepHooks="backgroundColor borderBottomColor borderLeftColor borderRightColor "+"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",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]];}}
vendor: 7,880 bytes, lines 1722-1762
1722,{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})/,parse:function(execResult){return[parseInt(execResult[1],16),parseInt(execResult[2],16),parseInt(execResult[3],16)];}},{re:/#([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)];}},{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:true,max:255},"percent":{max:1},"degrees":{mod:360,floor:true}},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};});function clamp(value,prop,allowEmpty){var type=propTypes[prop.type]||{};if(value==null){return(allowEmpty||!prop.def)?null:prop.def;}
1723value=type.floor?~~value:parseFloat(value);if(isNaN(value)){return prop.def;}
1724if(type.mod){return(value+type.mod)%type.mod;}
1725return 0>value?0:type.max<value?type.max:value;}
1726function 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 false;}});if(rgba.length){if(rgba.join()==="0,0,0,0"){jQuery.extend(rgba,colors.transparent);}
1727return inst;}
1728return colors[string];}
1729color.fn=jQuery.extend(color.prototype,{parse:function(red,green,blue,alpha){if(red===undefined){this._rgba=[null,null,null,null];return this;}
1730if(red.jquery||red.nodeType){red=jQuery(red).css(green);green=undefined;}
1731var inst=this,type=jQuery.type(red),rgba=this._rgba=[];if(green!==undefined){red=[red,green,blue,alpha];type="array";}
1732if(type==="string"){return this.parse(stringParse(red)||colors._default);}
1733if(type==="array"){each(spaces.rgba.props,function(key,prop){rgba[prop.idx]=clamp(red[prop.idx],prop);});return this;}
1734if(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;}
1735inst[cache]=space.to(inst._rgba);}
1736inst[cache][prop.idx]=clamp(red[key],prop,true);});if(inst[cache]&&jQuery.inArray(null,inst[cache].slice(0,3))<0){inst[cache][3]=1;if(space.from){inst._rgba=space.from(inst[cache]);}}});}
1737return this;}},is:function(compare){var is=color(compare),same=true,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;}});}
1738return 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;}
1739if(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;}}
1740result[index]=clamp((endValue-startValue)*distance+startValue,prop);}});return this[spaceName](result);},blend:function(opaque){if(this._rgba[3]===1){return this;}
1741var 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){return v==null?(i>2?1:0):v;});if(rgba[3]===1){rgba.pop();prefix="rgb(";}
1742return prefix+rgba.join()+")";},toHslaString:function(){var prefix="hsla(",hsla=jQuery.map(this.hsla(),function(v,i){if(v==null){v=i>2?1:0;}
1743if(i&&i<3){v=Math.round(v*100)+"%";}
1744return v;});if(hsla[3]===1){hsla.pop();prefix="hsl(";}
1745return prefix+hsla.join()+")";},toHexString:function(includeAlpha){var rgba=this._rgba.slice(),alpha=rgba.pop();if(includeAlpha){rgba.push(~~(alpha*255));}
1746return"#"+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;}
1747if(h*2<1){return q;}
1748if(h*3<2){return p+(q-p)*((2 / 3)-h)*6;}
1749return p;}
1750spaces.hsla.to=function(rgba){if(rgba[0]==null||rgba[1]==null||rgba[2]==null){return[null,null,null,rgba[3]];}
1751var 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;}
1752if(diff===0){s=0;}else if(l<=0.5){s=diff / add;}else{s=diff /(2-add);}
1753return[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]];}
1754var 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);}
1755if(value===undefined){return this[cache].slice();}
1756var ret,type=jQuery.type(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];}
1757local[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;}
1758color.fn[key]=function(value){var vtype=jQuery.type(value),fn=(key==="alpha"?(this._hsla?"hsla":"rgba"):spaceName),local=this[fn](),cur=local[prop.idx],match;if(vtype==="undefined"){return cur;}
1759if(vtype==="function"){value=value.call(this,cur);vtype=jQuery.type(value);}
1760if(value==null&&prop.empty){return this;}
1761if(vtype==="string"){match=rplusequals.exec(value);if(match){value=cur+parseFloat(match[2])*(match[1]==="+"?1:-1);}}
1762local[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="";
vendor: 17,954 bytes, lines 1762-1838
1762if(value!=="transparent"&&(jQuery.type(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){}}
1763value=value.blend(backgroundColor&&backgroundColor!=="transparent"?backgroundColor:"_default");}
1764value=value.toRgbaString();}
1765try{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=true;}
1766jQuery.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);(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=true;}};});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];}}}
1767return styles;}
1768function 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;}}}}
1769return diff;}
1770if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));};}
1771$.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:false,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.filters&&$.expr.filters.animated){$.expr.filters.animated=(function(orig){return function(elem){return!!$(elem).data(dataSpaceAnimated)||orig(elem);};})($.expr.filters.animated);}
1772if($.uiBackCompat!==false){$.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";}
1773return mode;},createWrapper:function(element){if(element.parent().is(".ui-effects-wrapper")){return element.parent();}
1774var props={width:element.outerWidth(true),height:element.outerHeight(true),"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;}
1775element.wrap(wrapper);if(element[0]===active||$.contains(element[0],active)){$(active).trigger("focus");}
1776wrapper=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"});}
1777element.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");}}
1778return element;}});}
1779$.extend($.effects,{version:"1.12.1",define:function(name,mode,effect){if(!effect){effect=mode;mode="effect";}
1780$.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};}
1781var 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)));}
1782element.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";}
1783if(hidden?mode==="hide":mode==="show"){mode="none";}
1784return 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;}
1785switch(origin[1]){case"left":x=0;break;case"center":x=0.5;break;case"right":x=1;break;default:x=origin[1]/ original.width;}
1786return{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);}
1787element.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;}
1788effect={effect:effect};if(options==null){options={};}
1789if($.isFunction(options)){callback=options;speed=null;options={};}
1790if(typeof options==="number"||$.fx.speeds[options]){callback=speed;speed=options;options={};}
1791if($.isFunction(speed)){callback=speed;speed=null;}
1792if(options){$.extend(effect,options);}
1793speed=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;}
1794function standardAnimationOption(option){if(!option||typeof option==="number"||$.fx.speeds[option]){return true;}
1795if(typeof option==="string"&&!$.effects.effect[option]){return true;}
1796if($.isFunction(option)){return true;}
1797if(typeof option==="object"&&!option.effect){return true;}
1798return false;}
1799$.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,true);modes.push(normalizedMode);if(defaultMode&&(normalizedMode==="show"||(normalizedMode===defaultMode&&normalizedMode==="hide"))){el.show();}
1800if(!defaultMode||normalizedMode!=="none"){$.effects.saveStyle(el);}
1801if($.isFunction(next)){next();}};if($.fx.off||!effectMethod){if(mode){return this[mode](args.duration,complete);}else{return this.each(function(){if(complete){complete.call(this);}});}}
1802function run(next){var elem=$(this);function cleanup(){elem.removeData(dataSpaceAnimated);$.effects.cleanUp(elem);if(args.mode==="hide"){elem.hide();}
1803done();}
1804function done(){if($.isFunction(complete)){complete.call(elem[0]);}
1805if($.isFunction(next)){next();}}
1806args.mode=modes.shift();if($.uiBackCompat!==false&&!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);}}}
1807return queue===false?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 "+
1808clipObj.bottom+"px "+clipObj.left+"px)");}
1809return 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>").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($.isFunction(done)){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};}
1810$.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);}
1811fx.clipInit=true;}
1812$(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){}
1813return 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;};});})();var effect=$.effects;
1814/*!
1815 * jQuery UI Effects Blind 1.12.1
1816 * http://jqueryui.com
1817 *
1818 * Copyright jQuery Foundation and other contributors
1819 * Released under the MIT license.
1820 * http://jquery.org/license
1821 */
1822var effectsEffectBlind=$.effects.define("blind","hide",function(options,done){var map={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},element=$(this),direction=options.direction||"up",start=element.cssClip(),animate={clip:$.extend({},start)},placeholder=$.effects.createPlaceholder(element);animate.clip[map[direction][0]]=animate.clip[map[direction][1]];if(options.mode==="show"){element.cssClip(animate.clip);if(placeholder){placeholder.css($.effects.clipToBox(animate));}
1823animate.clip=start;}
1824if(placeholder){placeholder.animate($.effects.clipToBox(animate),options.duration,options.easing);}
1825element.animate(animate,{queue:false,duration:options.duration,easing:options.easing,complete:done});});
1826/*!
1827 * jQuery UI Effects Bounce 1.12.1
1828 * http://jqueryui.com
1829 *
1830 * Copyright jQuery Foundation and other contributors
1831 * Released under the MIT license.
1832 * http://jquery.org/license
1833 */
1834var effectsEffectBounce=$.effects.define("bounce",function(options,done){var upAnim,downAnim,refValue,element=$(this),mode=options.mode,hide=mode==="hide",show=mode==="show",direction=options.direction||"up",distance=options.distance,times=options.times||5,anims=times*2+(show||hide?1:0),speed=options.duration / anims,easing=options.easing,ref=(direction==="up"||direction==="down")?"top":"left",motion=(direction==="up"||direction==="left"),i=0,queuelen=element.queue().length;$.effects.createPlaceholder(element);refValue=element.css(ref);if(!distance){distance=element[ref==="top"?"outerHeight":"outerWidth"]()/ 3;}
1835if(show){downAnim={opacity:1};downAnim[ref]=refValue;element.css("opacity",0).css(ref,motion?-distance*2:distance*2).animate(downAnim,speed,easing);}
1836if(hide){distance=distance / Math.pow(2,times-1);}
1837downAnim={};downAnim[ref]=refValue;for(;i<times;i++){upAnim={};upAnim[ref]=(motion?"-=":"+=")+distance;element.animate(upAnim,speed,easing).animate(downAnim,speed,easing);distance=hide?distance*2:distance / 2;}
1838if(hide){upAnim={opacity:0}
vendor: 6,602 bytes, lines 1838-1912
1838;upAnim[ref]=(motion?"-=":"+=")+distance;element.animate(upAnim,speed,easing);}
1839element.queue(done);$.effects.unshift(element,queuelen,anims+1);});
1840/*!
1841 * jQuery UI Effects Clip 1.12.1
1842 * http://jqueryui.com
1843 *
1844 * Copyright jQuery Foundation and other contributors
1845 * Released under the MIT license.
1846 * http://jquery.org/license
1847 */
1848var effectsEffectClip=$.effects.define("clip","hide",function(options,done){var start,animate={},element=$(this),direction=options.direction||"vertical",both=direction==="both",horizontal=both||direction==="horizontal",vertical=both||direction==="vertical";start=element.cssClip();animate.clip={top:vertical?(start.bottom-start.top)/ 2:start.top,right:horizontal?(start.right-start.left)/ 2:start.right,bottom:vertical?(start.bottom-start.top)/ 2:start.bottom,left:horizontal?(start.right-start.left)/ 2:start.left};$.effects.createPlaceholder(element);if(options.mode==="show"){element.cssClip(animate.clip);animate.clip=start;}
1849element.animate(animate,{queue:false,duration:options.duration,easing:options.easing,complete:done});});
1850/*!
1851 * jQuery UI Effects Drop 1.12.1
1852 * http://jqueryui.com
1853 *
1854 * Copyright jQuery Foundation and other contributors
1855 * Released under the MIT license.
1856 * http://jquery.org/license
1857 */
1858var effectsEffectDrop=$.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"](true)/ 2;animation[ref]=motion+distance;if(show){element.css(animation);animation[ref]=oppositeMotion+distance;animation.opacity=1;}
1859element.animate(animation,{queue:false,duration:options.duration,easing:options.easing,complete:done});});
1860/*!
1861 * jQuery UI Effects Explode 1.12.1
1862 * http://jqueryui.com
1863 *
1864 * Copyright jQuery Foundation and other contributors
1865 * Released under the MIT license.
1866 * http://jquery.org/license
1867 */
1868var effectsEffectExplode=$.effects.define("explode","hide",function(options,done){var i,j,left,top,mx,my,rows=options.pieces?Math.round(Math.sqrt(options.pieces)):3,cells=rows,element=$(this),mode=options.mode,show=mode==="show",offset=element.show().css("visibility","hidden").offset(),width=Math.ceil(element.outerWidth()/ cells),height=Math.ceil(element.outerHeight()/ rows),pieces=[];function childComplete(){pieces.push(this);if(pieces.length===rows*cells){animComplete();}}
1869for(i=0;i<rows;i++){top=offset.top+i*height;my=i-(rows-1)/ 2;for(j=0;j<cells;j++){left=offset.left+j*width;mx=j-(cells-1)/ 2;element.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*width,top:-i*height}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:width,height:height,left:left+(show?mx*width:0),top:top+(show?my*height:0),opacity:show?0:1}).animate({left:left+(show?0:mx*width),top:top+(show?0:my*height),opacity:show?1:0},options.duration||500,options.easing,childComplete);}}
1870function animComplete(){element.css({visibility:"visible"});$(pieces).remove();done();}});
1871/*!
1872 * jQuery UI Effects Fade 1.12.1
1873 * http://jqueryui.com
1874 *
1875 * Copyright jQuery Foundation and other contributors
1876 * Released under the MIT license.
1877 * http://jquery.org/license
1878 */
1879var effectsEffectFade=$.effects.define("fade","toggle",function(options,done){var show=options.mode==="show";$(this).css("opacity",show?0:1).animate({opacity:show?1:0},{queue:false,duration:options.duration,easing:options.easing,complete:done});});
1880/*!
1881 * jQuery UI Effects Fold 1.12.1
1882 * http://jqueryui.com
1883 *
1884 * Copyright jQuery Foundation and other contributors
1885 * Released under the MIT license.
1886 * http://jquery.org/license
1887 */
1888var effectsEffectFold=$.effects.define("fold","hide",function(options,done){var element=$(this),mode=options.mode,show=mode==="show",hide=mode==="hide",size=options.size||15,percent=/([0-9]+)%/.exec(size),horizFirst=!!options.horizFirst,ref=horizFirst?["right","bottom"]:["bottom","right"],duration=options.duration / 2,placeholder=$.effects.createPlaceholder(element),start=element.cssClip(),animation1={clip:$.extend({},start)},animation2={clip:$.extend({},start)},distance=[start[ref[0]],start[ref[1]]],queuelen=element.queue().length;if(percent){size=parseInt(percent[1],10)/ 100*distance[hide?0:1];}
1889animation1.clip[ref[0]]=size;animation2.clip[ref[0]]=size;animation2.clip[ref[1]]=0;if(show){element.cssClip(animation2.clip);if(placeholder){placeholder.css($.effects.clipToBox(animation2));}
1890animation2.clip=start;}
1891element.queue(function(next){if(placeholder){placeholder.animate($.effects.clipToBox(animation1),duration,options.easing).animate($.effects.clipToBox(animation2),duration,options.easing);}
1892next();}).animate(animation1,duration,options.easing).animate(animation2,duration,options.easing).queue(done);$.effects.unshift(element,queuelen,4);});
1893/*!
1894 * jQuery UI Effects Highlight 1.12.1
1895 * http://jqueryui.com
1896 *
1897 * Copyright jQuery Foundation and other contributors
1898 * Released under the MIT license.
1899 * http://jquery.org/license
1900 */
1901var effectsEffectHighlight=$.effects.define("highlight","show",function(options,done){var element=$(this),animation={backgroundColor:element.css("backgroundColor")};if(options.mode==="hide"){animation.opacity=0;}
1902$.effects.saveStyle(element);element.css({backgroundImage:"none",backgroundColor:options.color||"#ffff99"}).animate(animation,{queue:false,duration:options.duration,easing:options.easing,complete:done});});
1903/*!
1904 * jQuery UI Effects Size 1.12.1
1905 * http://jqueryui.com
1906 *
1907 * Copyright jQuery Foundation and other contributors
1908 * Released under the MIT license.
1909 * http://jquery.org/license
1910 */
1911var effectsEffectSize=$.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;}
1912factor={from:{y:from.height / original.height,x:from.width / original.width}
vendor: 15,336 bytes, lines 1912-2203
1912,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);}
1913if(factor.from.x!==factor.to.x){from=$.effects.setTransition(element,hProps,factor.from.x,from);to=$.effects.setTransition(element,hProps,factor.to.x,to);}}
1914if(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);}}
1915if(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;}
1916element.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);}
1917if(factor.from.x!==factor.to.x){childFrom=$.effects.setTransition(child,hProps,factor.from.x,childFrom);childTo=$.effects.setTransition(child,hProps,factor.to.x,childTo);}
1918if(restore){$.effects.saveStyle(child);}
1919child.css(childFrom);child.animate(childTo,options.duration,options.easing,function(){if(restore){$.effects.restoreStyle(child);}});});}
1920element.animate(to,{queue:false,duration:options.duration,easing:options.easing,complete:function(){var offset=element.offset();if(to.opacity===0){element.css("opacity",from.opacity);}
1921if(!restore){element.css("position",position==="static"?"relative":position).offset(offset);$.effects.saveStyle(element);}
1922done();}});});
1923/*!
1924 * jQuery UI Effects Scale 1.12.1
1925 * http://jqueryui.com
1926 *
1927 * Copyright jQuery Foundation and other contributors
1928 * Released under the MIT license.
1929 * http://jquery.org/license
1930 */
1931var effectsEffectScale=$.effects.define("scale",function(options,done){var el=$(this),mode=options.mode,percent=parseInt(options.percent,10)||(parseInt(options.percent,10)===0?0:(mode!=="effect"?0:100)),newOptions=$.extend(true,{from:$.effects.scaledDimensions(el),to:$.effects.scaledDimensions(el,percent,options.direction||"both"),origin:options.origin||["middle","center"]},options);if(options.fade){newOptions.from.opacity=1;newOptions.to.opacity=0;}
1932$.effects.effect.size.call(this,newOptions,done);});
1933/*!
1934 * jQuery UI Effects Puff 1.12.1
1935 * http://jqueryui.com
1936 *
1937 * Copyright jQuery Foundation and other contributors
1938 * Released under the MIT license.
1939 * http://jquery.org/license
1940 */
1941var effectsEffectPuff=$.effects.define("puff","hide",function(options,done){var newOptions=$.extend(true,{},options,{fade:true,percent:parseInt(options.percent,10)||150});$.effects.effect.scale.call(this,newOptions,done);});
1942/*!
1943 * jQuery UI Effects Pulsate 1.12.1
1944 * http://jqueryui.com
1945 *
1946 * Copyright jQuery Foundation and other contributors
1947 * Released under the MIT license.
1948 * http://jquery.org/license
1949 */
1950var effectsEffectPulsate=$.effects.define("pulsate","show",function(options,done){var element=$(this),mode=options.mode,show=mode==="show",hide=mode==="hide",showhide=show||hide,anims=((options.times||5)*2)+(showhide?1:0),duration=options.duration / anims,animateTo=0,i=1,queuelen=element.queue().length;if(show||!element.is(":visible")){element.css("opacity",0).show();animateTo=1;}
1951for(;i<anims;i++){element.animate({opacity:animateTo},duration,options.easing);animateTo=1-animateTo;}
1952element.animate({opacity:animateTo},duration,options.easing);element.queue(done);$.effects.unshift(element,queuelen,anims+1);});
1953/*!
1954 * jQuery UI Effects Shake 1.12.1
1955 * http://jqueryui.com
1956 *
1957 * Copyright jQuery Foundation and other contributors
1958 * Released under the MIT license.
1959 * http://jquery.org/license
1960 */
1961var effectsEffectShake=$.effects.define("shake",function(options,done){var i=1,element=$(this),direction=options.direction||"left",distance=options.distance||20,times=options.times||3,anims=times*2+1,speed=Math.round(options.duration / anims),ref=(direction==="up"||direction==="down")?"top":"left",positiveMotion=(direction==="up"||direction==="left"),animation={},animation1={},animation2={},queuelen=element.queue().length;$.effects.createPlaceholder(element);animation[ref]=(positiveMotion?"-=":"+=")+distance;animation1[ref]=(positiveMotion?"+=":"-=")+distance*2;animation2[ref]=(positiveMotion?"-=":"+=")+distance*2;element.animate(animation,speed,options.easing);for(;i<times;i++){element.animate(animation1,speed,options.easing).animate(animation2,speed,options.easing);}
1962element.animate(animation1,speed,options.easing).animate(animation,speed / 2,options.easing).queue(done);$.effects.unshift(element,queuelen,anims+1);});
1963/*!
1964 * jQuery UI Effects Slide 1.12.1
1965 * http://jqueryui.com
1966 *
1967 * Copyright jQuery Foundation and other contributors
1968 * Released under the MIT license.
1969 * http://jquery.org/license
1970 */
1971var effectsEffectSlide=$.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"](true),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;}
1972element.animate(animation,{queue:false,duration:options.duration,easing:options.easing,complete:done});});
1973/*!
1974 * jQuery UI Effects Transfer 1.12.1
1975 * http://jqueryui.com
1976 *
1977 * Copyright jQuery Foundation and other contributors
1978 * Released under the MIT license.
1979 * http://jquery.org/license
1980 */
1981var effect;if($.uiBackCompat!==false){effect=$.effects.define("transfer",function(options,done){$(this).transfer(options,done);});}
1982var effectsEffectTransfer=effect;
1983/*!
1984 * jQuery UI Focusable 1.12.1
1985 * http://jqueryui.com
1986 *
1987 * Copyright jQuery Foundation and other contributors
1988 * Released under the MIT license.
1989 * http://jquery.org/license
1990 */
1991$.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 false;}
1992img=$("img[usemap='#"+mapName+"']");return img.length>0&&img.is(":visible");}
1993if(/^(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;}
1994return focusableIfVisible&&$(element).is(":visible")&&visible($(element));};function visible(element){var visibility=element.css("visibility");while(visibility==="inherit"){element=element.parent();visibility=element.css("visibility");}
1995return visibility!=="hidden";}
1996$.extend($.expr[":"],{focusable:function(element){return $.ui.focusable(element,$.attr(element,"tabindex")!=null);}});var focusable=$.ui.focusable;var form=$.fn.form=function(){return typeof this[0].form==="string"?this.closest("form"):$(this[0].form);};
1997/*!
1998 * jQuery UI Form Reset Mixin 1.12.1
1999 * http://jqueryui.com
2000 *
2001 * Copyright jQuery Foundation and other contributors
2002 * Released under the MIT license.
2003 * http://jquery.org/license
2004 */
2005var formResetMixin=$.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;}
2006var instances=this.form.data("ui-form-reset-instances")||[];if(!instances.length){this.form.on("reset.ui-form-reset",this._formResetHandler);}
2007instances.push(this);this.form.data("ui-form-reset-instances",instances);},_unbindFormResetHandler:function(){if(!this.form.length){return;}
2008var 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");}}};
2009/*!
2010 * jQuery UI Support for jQuery core 1.7.x 1.12.1
2011 * http://jqueryui.com
2012 *
2013 * Copyright jQuery Foundation and other contributors
2014 * Released under the MIT license.
2015 * http://jquery.org/license
2016 *
2017 */
2018if($.fn.jquery.substring(0,3)==="1.7"){$.each(["Width","Height"],function(i,name){var side=name==="Width"?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};function reduce(elem,size,border,margin){$.each(side,function(){size-=parseFloat($.css(elem,"padding"+this))||0;if(border){size-=parseFloat($.css(elem,"border"+this+"Width"))||0;}
2019if(margin){size-=parseFloat($.css(elem,"margin"+this))||0;}});return size;}
2020$.fn["inner"+name]=function(size){if(size===undefined){return orig["inner"+name].call(this);}
2021return this.each(function(){$(this).css(type,reduce(this,size)+"px");});};$.fn["outer"+name]=function(size,margin){if(typeof size!=="number"){return orig["outer"+name].call(this,size);}
2022return this.each(function(){$(this).css(type,reduce(this,size,true,margin)+"px");});};});$.fn.addBack=function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));};};
2023/*!
2024 * jQuery UI Keycode 1.12.1
2025 * http://jqueryui.com
2026 *
2027 * Copyright jQuery Foundation and other contributors
2028 * Released under the MIT license.
2029 * http://jquery.org/license
2030 */
2031var keycode=$.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};var escapeSelector=$.ui.escapeSelector=(function(){var selectorEscape=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;
2032 return function( selector ) {
2033  return selector.replace( selectorEscape, "\\$1" );
2034 };
2035} )();
2036
2037
2038/*!
2039 * jQuery UI Labels 1.12.1
2040 * http://jqueryui.com
2041 *
2042 * Copyright jQuery Foundation and other contributors
2043 * Released under the MIT license.
2044 * http://jquery.org/license
2045 */
2046
2047//>>label: labels
2048//>>group: Core
2049//>>description: Find all the labels associated with a given input
2050//>>docs: http://api.jqueryui.com/labels/
2051
2052
2053
2054var labels = $.fn.labels = function() {
2055 var ancestor, selector, id, labels, ancestors;
2056
2057 // Check control.labels first
2058 if ( this[ 0 ].labels && this[ 0 ].labels.length ) {
2059  return this.pushStack( this[ 0 ].labels );
2060 }
2061
2062 // Support: IE <= 11, FF <= 37, Android <= 2.3 only
2063 // Above browsers do not support control.labels. Everything below is to support them
2064 // as well as document fragments. control.labels does not work on document fragments
2065 labels = this.eq( 0 ).parents( "label" );
2066
2067 // Look for the label based on the id
2068 id = this.attr( "id" );
2069 if ( id ) {
2070
2071  // We don't search against the document in case the element
2072  // is disconnected from the DOM
2073  ancestor = this.eq( 0 ).parents().last();
2074
2075  // Get a full set of top level ancestors
2076  ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() );
2077
2078  // Create a selector for the label based on the id
2079  selector = "label[for='" + $.ui.escapeSelector( id ) + "']";
2080
2081  labels = labels.add( ancestors.find( selector ).addBack( selector ) );
2082
2083 }
2084
2085 // Return whatever we have found for labels
2086 return this.pushStack( labels );
2087};
2088
2089
2090/*!
2091 * jQuery UI Scroll Parent 1.12.1
2092 * http://jqueryui.com
2093 *
2094 * Copyright jQuery Foundation and other contributors
2095 * Released under the MIT license.
2096 * http://jquery.org/license
2097 */
2098
2099//>>label: scrollParent
2100//>>group: Core
2101//>>description: Get the closest ancestor element that is scrollable.
2102//>>docs: http://api.jqueryui.com/scrollParent/
2103
2104
2105
2106var scrollParent = $.fn.scrollParent = function( includeHidden ) {
2107 var position = this.css( "position" ),
2108  excludeStaticParent = position === "absolute",
2109  overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
2110  scrollParent = this.parents().filter( function() {
2111   var parent = $( this );
2112   if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
2113    return false;
2114   }
2115   return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
2116    parent.css( "overflow-x" ) );
2117  } ).eq( 0 );
2118
2119 return position === "fixed" || !scrollParent.length ?
2120  $( this[ 0 ].ownerDocument || document ) :
2121  scrollParent;
2122};
2123
2124
2125/*!
2126 * jQuery UI Tabbable 1.12.1
2127 * http://jqueryui.com
2128 *
2129 * Copyright jQuery Foundation and other contributors
2130 * Released under the MIT license.
2131 * http://jquery.org/license
2132 */
2133
2134//>>label: :tabbable Selector
2135//>>group: Core
2136//>>description: Selects elements which can be tabbed to.
2137//>>docs: http://api.jqueryui.com/tabbable-selector/
2138
2139
2140
2141var tabbable = $.extend( $.expr[ ":" ], {
2142 tabbable: function( element ) {
2143  var tabIndex = $.attr( element, "tabindex" ),
2144   hasTabindex = tabIndex != null;
2145  return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
2146 }
2147} );
2148
2149
2150/*!
2151 * jQuery UI Unique ID 1.12.1
2152 * http://jqueryui.com
2153 *
2154 * Copyright jQuery Foundation and other contributors
2155 * Released under the MIT license.
2156 * http://jquery.org/license
2157 */
2158
2159//>>label: uniqueId
2160//>>group: Core
2161//>>description: Functions to generate and remove uniqueId's
2162//>>docs: http://api.jqueryui.com/uniqueId/
2163
2164
2165
2166var uniqueId = $.fn.extend( {
2167 uniqueId: ( function() {
2168  var uuid = 0;
2169
2170  return function() {
2171   return this.each( function() {
2172    if ( !this.id ) {
2173     this.id = "ui-id-" + ( ++uuid );
2174    }
2175   } );
2176  };
2177 } )(),
2178
2179 removeUniqueId: function() {
2180  return this.each( function() {
2181   if ( /^ui-id-\d+$/.test( this.id ) ) {
2182    $( this ).removeAttr( "id" );
2183   }
2184  } );
2185 }
2186} );
2187
2188
2189/*!
2190 * jQuery UI Accordion 1.12.1
2191 * http://jqueryui.com
2192 *
2193 * Copyright jQuery Foundation and other contributors
2194 * Released under the MIT license.
2195 * http://jquery.org/license
2196 */
2197
2198//>>label: Accordion
2199//>>group: Widgets
2200// jscs:disable maximumLineLength
2201//>>description: Displays collapsible content panels for presenting information in a limited amount of space.
2202// jscs:enable maximumLineLength
2203//>>
vendor: 4,172 bytes, lines 2203-2374
2203docs: http://api.jqueryui.com/accordion/
2204//>>demos: http://jqueryui.com/accordion/
2205//>>css.structure: ../../themes/base/core.css
2206//>>css.structure: ../../themes/base/accordion.css
2207//>>css.theme: ../../themes/base/theme.css
2208
2209
2210
2211var widgetsAccordion = $.widget( "ui.accordion", {
2212 version: "1.12.1",
2213 options: {
2214  active: 0,
2215  animate: {},
2216  classes: {
2217   "ui-accordion-header": "ui-corner-top",
2218   "ui-accordion-header-collapsed": "ui-corner-all",
2219   "ui-accordion-content": "ui-corner-bottom"
2220  },
2221  collapsible: false,
2222  event: "click",
2223  header: "> li > :first-child, > :not(li):even",
2224  heightStyle: "auto",
2225  icons: {
2226   activeHeader: "ui-icon-triangle-1-s",
2227   header: "ui-icon-triangle-1-e"
2228  },
2229
2230  // Callbacks
2231  activate: null,
2232  beforeActivate: null
2233 },
2234
2235 hideProps: {
2236  borderTopWidth: "hide",
2237  borderBottomWidth: "hide",
2238  paddingTop: "hide",
2239  paddingBottom: "hide",
2240  height: "hide"
2241 },
2242
2243 showProps: {
2244  borderTopWidth: "show",
2245  borderBottomWidth: "show",
2246  paddingTop: "show",
2247  paddingBottom: "show",
2248  height: "show"
2249 },
2250
2251 _create: function() {
2252  var options = this.options;
2253
2254  this.prevShow = this.prevHide = $();
2255  this._addClass( "ui-accordion", "ui-widget ui-helper-reset" );
2256  this.element.attr( "role", "tablist" );
2257
2258  // Don't allow collapsible: false and active: false / null
2259  if ( !options.collapsible && ( options.active === false || options.active == null ) ) {
2260   options.active = 0;
2261  }
2262
2263  this._processPanels();
2264
2265  // handle negative values
2266  if ( options.active < 0 ) {
2267   options.active += this.headers.length;
2268  }
2269  this._refresh();
2270 },
2271
2272 _getCreateEventData: function() {
2273  return {
2274   header: this.active,
2275   panel: !this.active.length ? $() : this.active.next()
2276  };
2277 },
2278
2279 _createIcons: function() {
2280  var icon, children,
2281   icons = this.options.icons;
2282
2283  if ( icons ) {
2284   icon = $( "<span>" );
2285   this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header );
2286   icon.prependTo( this.headers );
2287   children = this.active.children( ".ui-accordion-header-icon" );
2288   this._removeClass( children, icons.header )
2289    ._addClass( children, null, icons.activeHeader )
2290    ._addClass( this.headers, "ui-accordion-icons" );
2291  }
2292 },
2293
2294 _destroyIcons: function() {
2295  this._removeClass( this.headers, "ui-accordion-icons" );
2296  this.headers.children( ".ui-accordion-header-icon" ).remove();
2297 },
2298
2299 _destroy: function() {
2300  var contents;
2301
2302  // Clean up main element
2303  this.element.removeAttr( "role" );
2304
2305  // Clean up headers
2306  this.headers
2307   .removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" )
2308   .removeUniqueId();
2309
2310  this._destroyIcons();
2311
2312  // Clean up content panels
2313  contents = this.headers.next()
2314   .css( "display", "" )
2315   .removeAttr( "role aria-hidden aria-labelledby" )
2316   .removeUniqueId();
2317
2318  if ( this.options.heightStyle !== "content" ) {
2319   contents.css( "height", "" );
2320  }
2321 },
2322
2323 _setOption: function( key, value ) {
2324  if ( key === "active" ) {
2325
2326   // _activate() will handle invalid values and update this.options
2327   this._activate( value );
2328   return;
2329  }
2330
2331  if ( key === "event" ) {
2332   if ( this.options.event ) {
2333    this._off( this.headers, this.options.event );
2334   }
2335   this._setupEvents( value );
2336  }
2337
2338  this._super( key, value );
2339
2340  // Setting collapsible: false while collapsed; open first panel
2341  if ( key === "collapsible" && !value && this.options.active === false ) {
2342   this._activate( 0 );
2343  }
2344
2345  if ( key === "icons" ) {
2346   this._destroyIcons();
2347   if ( value ) {
2348    this._createIcons();
2349   }
2350  }
2351 },
2352
2353 _setOptionDisabled: function( value ) {
2354  this._super( value );
2355
2356  this.element.attr( "aria-disabled", value );
2357
2358  // Support: IE8 Only
2359  // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
2360  // so we need to add the disabled class to the headers and panels
2361  this._toggleClass( null, "ui-state-disabled", !!value );
2362  this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
2363   !!value );
2364 },
2365
2366 _keydown: function( event ) {
2367  if ( event.altKey || event.ctrlKey ) {
2368   return;
2369  }
2370
2371  var keyCode = $.ui.keyCode,
2372   length = this.headers.length,
2373   currentIndex = this.headers.index( event.target ),
2374   toFocus = false;
vendor: 5,396 bytes, lines 2375-2587
2375
2376  switch ( event.keyCode ) {
2377  case keyCode.RIGHT:
2378  case keyCode.DOWN:
2379   toFocus = this.headers[ ( currentIndex + 1 ) % length ];
2380   break;
2381  case keyCode.LEFT:
2382  case keyCode.UP:
2383   toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
2384   break;
2385  case keyCode.SPACE:
2386  case keyCode.ENTER:
2387   this._eventHandler( event );
2388   break;
2389  case keyCode.HOME:
2390   toFocus = this.headers[ 0 ];
2391   break;
2392  case keyCode.END:
2393   toFocus = this.headers[ length - 1 ];
2394   break;
2395  }
2396
2397  if ( toFocus ) {
2398   $( event.target ).attr( "tabIndex", -1 );
2399   $( toFocus ).attr( "tabIndex", 0 );
2400   $( toFocus ).trigger( "focus" );
2401   event.preventDefault();
2402  }
2403 },
2404
2405 _panelKeyDown: function( event ) {
2406  if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
2407   $( event.currentTarget ).prev().trigger( "focus" );
2408  }
2409 },
2410
2411 refresh: function() {
2412  var options = this.options;
2413  this._processPanels();
2414
2415  // Was collapsed or no panel
2416  if ( ( options.active === false && options.collapsible === true ) ||
2417    !this.headers.length ) {
2418   options.active = false;
2419   this.active = $();
2420
2421  // active false only when collapsible is true
2422  } else if ( options.active === false ) {
2423   this._activate( 0 );
2424
2425  // was active, but active panel is gone
2426  } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
2427
2428   // all remaining panel are disabled
2429   if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) {
2430    options.active = false;
2431    this.active = $();
2432
2433   // activate previous panel
2434   } else {
2435    this._activate( Math.max( 0, options.active - 1 ) );
2436   }
2437
2438  // was active, active panel still exists
2439  } else {
2440
2441   // make sure active index is correct
2442   options.active = this.headers.index( this.active );
2443  }
2444
2445  this._destroyIcons();
2446
2447  this._refresh();
2448 },
2449
2450 _processPanels: function() {
2451  var prevHeaders = this.headers,
2452   prevPanels = this.panels;
2453
2454  this.headers = this.element.find( this.options.header );
2455  this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed",
2456   "ui-state-default" );
2457
2458  this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide();
2459  this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" );
2460
2461  // Avoid memory leaks (#10056)
2462  if ( prevPanels ) {
2463   this._off( prevHeaders.not( this.headers ) );
2464   this._off( prevPanels.not( this.panels ) );
2465  }
2466 },
2467
2468 _refresh: function() {
2469  var maxHeight,
2470   options = this.options,
2471   heightStyle = options.heightStyle,
2472   parent = this.element.parent();
2473
2474  this.active = this._findActive( options.active );
2475  this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" )
2476   ._removeClass( this.active, "ui-accordion-header-collapsed" );
2477  this._addClass( this.active.next(), "ui-accordion-content-active" );
2478  this.active.next().show();
2479
2480  this.headers
2481   .attr( "role", "tab" )
2482   .each( function() {
2483    var header = $( this ),
2484     headerId = header.uniqueId().attr( "id" ),
2485     panel = header.next(),
2486     panelId = panel.uniqueId().attr( "id" );
2487    header.attr( "aria-controls", panelId );
2488    panel.attr( "aria-labelledby", headerId );
2489   } )
2490   .next()
2491    .attr( "role", "tabpanel" );
2492
2493  this.headers
2494   .not( this.active )
2495    .attr( {
2496     "aria-selected": "false",
2497     "aria-expanded": "false",
2498     tabIndex: -1
2499    } )
2500    .next()
2501     .attr( {
2502      "aria-hidden": "true"
2503     } )
2504     .hide();
2505
2506  // Make sure at least one header is in the tab order
2507  if ( !this.active.length ) {
2508   this.headers.eq( 0 ).attr( "tabIndex", 0 );
2509  } else {
2510   this.active.attr( {
2511    "aria-selected": "true",
2512    "aria-expanded": "true",
2513    tabIndex: 0
2514   } )
2515    .next()
2516     .attr( {
2517      "aria-hidden": "false"
2518     } );
2519  }
2520
2521  this._createIcons();
2522
2523  this._setupEvents( options.event );
2524
2525  if ( heightStyle === "fill" ) {
2526   maxHeight = parent.height();
2527   this.element.siblings( ":visible" ).each( function() {
2528    var elem = $( this ),
2529     position = elem.css( "position" );
2530
2531    if ( position === "absolute" || position === "fixed" ) {
2532     return;
2533    }
2534    maxHeight -= elem.outerHeight( true );
2535   } );
2536
2537   this.headers.each( function() {
2538    maxHeight -= $( this ).outerHeight( true );
2539   } );
2540
2541   this.headers.next()
2542    .each( function() {
2543     $( this ).height( Math.max( 0, maxHeight -
2544      $( this ).innerHeight() + $( this ).height() ) );
2545    } )
2546    .css( "overflow", "auto" );
2547  } else if ( heightStyle === "auto" ) {
2548   maxHeight = 0;
2549   this.headers.next()
2550    .each( function() {
2551     var isVisible = $( this ).is( ":visible" );
2552     if ( !isVisible ) {
2553      $( this ).show();
2554     }
2555     maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
2556     if ( !isVisible ) {
2557      $( this ).hide();
2558     }
2559    } )
2560    .height( maxHeight );
2561  }
2562 },
2563
2564 _activate: function( index ) {
2565  var active = this._findActive( index )[ 0 ];
2566
2567  // Trying to activate the already active panel
2568  if ( active === this.active[ 0 ] ) {
2569   return;
2570  }
2571
2572  // Trying to collapse, simulate a click on the currently active header
2573  active = active || this.active[ 0 ];
2574
2575  this._eventHandler( {
2576   target: active,
2577   currentTarget: active,
2578   preventDefault: $.noop
2579  } );
2580 },
2581
2582 _findActive: function( selector ) {
2583  return typeof selector === "number" ? this.headers.eq( selector ) : $();
2584 },
2585
2586 _setupEvents: function( event ) {
2587  var events = {
vendor: 7,393 bytes, lines 2588-2863
2588   keydown: "_keydown"
2589  };
2590  if ( event ) {
2591   $.each( event.split( " " ), function( index, eventName ) {
2592    events[ eventName ] = "_eventHandler";
2593   } );
2594  }
2595
2596  this._off( this.headers.add( this.headers.next() ) );
2597  this._on( this.headers, events );
2598  this._on( this.headers.next(), { keydown: "_panelKeyDown" } );
2599  this._hoverable( this.headers );
2600  this._focusable( this.headers );
2601 },
2602
2603 _eventHandler: function( event ) {
2604  var activeChildren, clickedChildren,
2605   options = this.options,
2606   active = this.active,
2607   clicked = $( event.currentTarget ),
2608   clickedIsActive = clicked[ 0 ] === active[ 0 ],
2609   collapsing = clickedIsActive && options.collapsible,
2610   toShow = collapsing ? $() : clicked.next(),
2611   toHide = active.next(),
2612   eventData = {
2613    oldHeader: active,
2614    oldPanel: toHide,
2615    newHeader: collapsing ? $() : clicked,
2616    newPanel: toShow
2617   };
2618
2619  event.preventDefault();
2620
2621  if (
2622
2623    // click on active header, but not collapsible
2624    ( clickedIsActive && !options.collapsible ) ||
2625
2626    // allow canceling activation
2627    ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
2628   return;
2629  }
2630
2631  options.active = collapsing ? false : this.headers.index( clicked );
2632
2633  // When the call to ._toggle() comes after the class changes
2634  // it causes a very odd bug in IE 8 (see #6720)
2635  this.active = clickedIsActive ? $() : clicked;
2636  this._toggle( eventData );
2637
2638  // Switch classes
2639  // corner classes on the previously active header stay after the animation
2640  this._removeClass( active, "ui-accordion-header-active", "ui-state-active" );
2641  if ( options.icons ) {
2642   activeChildren = active.children( ".ui-accordion-header-icon" );
2643   this._removeClass( activeChildren, null, options.icons.activeHeader )
2644    ._addClass( activeChildren, null, options.icons.header );
2645  }
2646
2647  if ( !clickedIsActive ) {
2648   this._removeClass( clicked, "ui-accordion-header-collapsed" )
2649    ._addClass( clicked, "ui-accordion-header-active", "ui-state-active" );
2650   if ( options.icons ) {
2651    clickedChildren = clicked.children( ".ui-accordion-header-icon" );
2652    this._removeClass( clickedChildren, null, options.icons.header )
2653     ._addClass( clickedChildren, null, options.icons.activeHeader );
2654   }
2655
2656   this._addClass( clicked.next(), "ui-accordion-content-active" );
2657  }
2658 },
2659
2660 _toggle: function( data ) {
2661  var toShow = data.newPanel,
2662   toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
2663
2664  // Handle activating a panel during the animation for another activation
2665  this.prevShow.add( this.prevHide ).stop( true, true );
2666  this.prevShow = toShow;
2667  this.prevHide = toHide;
2668
2669  if ( this.options.animate ) {
2670   this._animate( toShow, toHide, data );
2671  } else {
2672   toHide.hide();
2673   toShow.show();
2674   this._toggleComplete( data );
2675  }
2676
2677  toHide.attr( {
2678   "aria-hidden": "true"
2679  } );
2680  toHide.prev().attr( {
2681   "aria-selected": "false",
2682   "aria-expanded": "false"
2683  } );
2684
2685  // if we're switching panels, remove the old header from the tab order
2686  // if we're opening from collapsed state, remove the previous header from the tab order
2687  // if we're collapsing, then keep the collapsing header in the tab order
2688  if ( toShow.length && toHide.length ) {
2689   toHide.prev().attr( {
2690    "tabIndex": -1,
2691    "aria-expanded": "false"
2692   } );
2693  } else if ( toShow.length ) {
2694   this.headers.filter( function() {
2695    return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
2696   } )
2697    .attr( "tabIndex", -1 );
2698  }
2699
2700  toShow
2701   .attr( "aria-hidden", "false" )
2702   .prev()
2703    .attr( {
2704     "aria-selected": "true",
2705     "aria-expanded": "true",
2706     tabIndex: 0
2707    } );
2708 },
2709
2710 _animate: function( toShow, toHide, data ) {
2711  var total, easing, duration,
2712   that = this,
2713   adjust = 0,
2714   boxSizing = toShow.css( "box-sizing" ),
2715   down = toShow.length &&
2716    ( !toHide.length || ( toShow.index() < toHide.index() ) ),
2717   animate = this.options.animate || {},
2718   options = down && animate.down || animate,
2719   complete = function() {
2720    that._toggleComplete( data );
2721   };
2722
2723  if ( typeof options === "number" ) {
2724   duration = options;
2725  }
2726  if ( typeof options === "string" ) {
2727   easing = options;
2728  }
2729
2730  // fall back from options to animation in case of partial down settings
2731  easing = easing || options.easing || animate.easing;
2732  duration = duration || options.duration || animate.duration;
2733
2734  if ( !toHide.length ) {
2735   return toShow.animate( this.showProps, duration, easing, complete );
2736  }
2737  if ( !toShow.length ) {
2738   return toHide.animate( this.hideProps, duration, easing, complete );
2739  }
2740
2741  total = toShow.show().outerHeight();
2742  toHide.animate( this.hideProps, {
2743   duration: duration,
2744   easing: easing,
2745   step: function( now, fx ) {
2746    fx.now = Math.round( now );
2747   }
2748  } );
2749  toShow
2750   .hide()
2751   .animate( this.showProps, {
2752    duration: duration,
2753    easing: easing,
2754    complete: complete,
2755    step: function( now, fx ) {
2756     fx.now = Math.round( now );
2757     if ( fx.prop !== "height" ) {
2758      if ( boxSizing === "content-box" ) {
2759       adjust += fx.now;
2760      }
2761     } else if ( that.options.heightStyle !== "content" ) {
2762      fx.now = Math.round( total - toHide.outerHeight() - adjust );
2763      adjust = 0;
2764     }
2765    }
2766   } );
2767 },
2768
2769 _toggleComplete: function( data ) {
2770  var toHide = data.oldPanel,
2771   prev = toHide.prev();
2772
2773  this._removeClass( toHide, "ui-accordion-content-active" );
2774  this._removeClass( prev, "ui-accordion-header-active" )
2775   ._addClass( prev, "ui-accordion-header-collapsed" );
2776
2777  // Work around for rendering bug in IE (#5421)
2778  if ( toHide.length ) {
2779   toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
2780  }
2781  this._trigger( "activate", null, data );
2782 }
2783} );
2784
2785
2786
2787var safeActiveElement = $.ui.safeActiveElement = function( document ) {
2788 var activeElement;
2789
2790 // Support: IE 9 only
2791 // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
2792 try {
2793  activeElement = document.activeElement;
2794 } catch ( error ) {
2795  activeElement = document.body;
2796 }
2797
2798 // Support: IE 9 - 11 only
2799 // IE may return null instead of an element
2800 // Interestingly, this only seems to occur when NOT in an iframe
2801 if ( !activeElement ) {
2802  activeElement = document.body;
2803 }
2804
2805 // Support: IE 11 only
2806 // IE11 returns a seemingly empty object in some cases when accessing
2807 // document.activeElement from an <iframe>
2808 if ( !activeElement.nodeName ) {
2809  activeElement = document.body;
2810 }
2811
2812 return activeElement;
2813};
2814
2815
2816/*!
2817 * jQuery UI Menu 1.12.1
2818 * http://jqueryui.com
2819 *
2820 * Copyright jQuery Foundation and other contributors
2821 * Released under the MIT license.
2822 * http://jquery.org/license
2823 */
2824
2825//>>label: Menu
2826//>>group: Widgets
2827//>>description: Creates nestable menus.
2828//>>docs: http://api.jqueryui.com/menu/
2829//>>demos: http://jqueryui.com/menu/
2830//>>css.structure: ../../themes/base/core.css
2831//>>css.structure: ../../themes/base/menu.css
2832//>>css.theme: ../../themes/base/theme.css
2833
2834
2835
2836var widgetsMenu = $.widget( "ui.menu", {
2837 version: "1.12.1",
2838 defaultElement: "<ul>",
2839 delay: 300,
2840 options: {
2841  icons: {
2842   submenu: "ui-icon-caret-1-e"
2843  },
2844  items: "> *",
2845  menus: "ul",
2846  position: {
2847   my: "left top",
2848   at: "right top"
2849  },
2850  role: "menu",
2851
2852  // Callbacks
2853  blur: null,
2854  focus: null,
2855  select: null
2856 },
2857
2858 _create: function() {
2859  this.activeMenu = this.element;
2860
2861  // Flag used to prevent firing of the click handler
2862  // as the event bubbles up through nested menus
2863  this.mouseHandled = false;
vendor: 4,746 bytes, lines 2864-3034
2864  this.element
2865   .uniqueId()
2866   .attr( {
2867    role: this.options.role,
2868    tabIndex: 0
2869   } );
2870
2871  this._addClass( "ui-menu", "ui-widget ui-widget-content" );
2872  this._on( {
2873
2874   // Prevent focus from sticking to links inside menu after clicking
2875   // them (focus should always stay on UL during navigation).
2876   "mousedown .ui-menu-item": function( event ) {
2877    event.preventDefault();
2878   },
2879   "click .ui-menu-item": function( event ) {
2880    var target = $( event.target );
2881    var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
2882    if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
2883     this.select( event );
2884
2885     // Only set the mouseHandled flag if the event will bubble, see #9469.
2886     if ( !event.isPropagationStopped() ) {
2887      this.mouseHandled = true;
2888     }
2889
2890     // Open submenu on click
2891     if ( target.has( ".ui-menu" ).length ) {
2892      this.expand( event );
2893     } else if ( !this.element.is( ":focus" ) &&
2894       active.closest( ".ui-menu" ).length ) {
2895
2896      // Redirect focus to the menu
2897      this.element.trigger( "focus", [ true ] );
2898
2899      // If the active item is on the top level, let it stay active.
2900      // Otherwise, blur the active item since it is no longer visible.
2901      if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
2902       clearTimeout( this.timer );
2903      }
2904     }
2905    }
2906   },
2907   "mouseenter .ui-menu-item": function( event ) {
2908
2909    // Ignore mouse events while typeahead is active, see #10458.
2910    // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
2911    // is over an item in the menu
2912    if ( this.previousFilter ) {
2913     return;
2914    }
2915
2916    var actualTarget = $( event.target ).closest( ".ui-menu-item" ),
2917     target = $( event.currentTarget );
2918
2919    // Ignore bubbled events on parent items, see #11641
2920    if ( actualTarget[ 0 ] !== target[ 0 ] ) {
2921     return;
2922    }
2923
2924    // Remove ui-state-active class from siblings of the newly focused menu item
2925    // to avoid a jump caused by adjacent elements both having a class with a border
2926    this._removeClass( target.siblings().children( ".ui-state-active" ),
2927     null, "ui-state-active" );
2928    this.focus( event, target );
2929   },
2930   mouseleave: "collapseAll",
2931   "mouseleave .ui-menu": "collapseAll",
2932   focus: function( event, keepActiveItem ) {
2933
2934    // If there's already an active item, keep it active
2935    // If not, activate the first item
2936    var item = this.active || this.element.find( this.options.items ).eq( 0 );
2937
2938    if ( !keepActiveItem ) {
2939     this.focus( event, item );
2940    }
2941   },
2942   blur: function( event ) {
2943    this._delay( function() {
2944     var notContained = !$.contains(
2945      this.element[ 0 ],
2946      $.ui.safeActiveElement( this.document[ 0 ] )
2947     );
2948     if ( notContained ) {
2949      this.collapseAll( event );
2950     }
2951    } );
2952   },
2953   keydown: "_keydown"
2954  } );
2955
2956  this.refresh();
2957
2958  // Clicks outside of a menu collapse any open menus
2959  this._on( this.document, {
2960   click: function( event ) {
2961    if ( this._closeOnDocumentClick( event ) ) {
2962     this.collapseAll( event );
2963    }
2964
2965    // Reset the mouseHandled flag
2966    this.mouseHandled = false;
2967   }
2968  } );
2969 },
2970
2971 _destroy: function() {
2972  var items = this.element.find( ".ui-menu-item" )
2973    .removeAttr( "role aria-disabled" ),
2974   submenus = items.children( ".ui-menu-item-wrapper" )
2975    .removeUniqueId()
2976    .removeAttr( "tabIndex role aria-haspopup" );
2977
2978  // Destroy (sub)menus
2979  this.element
2980   .removeAttr( "aria-activedescendant" )
2981   .find( ".ui-menu" ).addBack()
2982    .removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " +
2983     "tabIndex" )
2984    .removeUniqueId()
2985    .show();
2986
2987  submenus.children().each( function() {
2988   var elem = $( this );
2989   if ( elem.data( "ui-menu-submenu-caret" ) ) {
2990    elem.remove();
2991   }
2992  } );
2993 },
2994
2995 _keydown: function( event ) {
2996  var match, prev, character, skip,
2997   preventDefault = true;
2998
2999  switch ( event.keyCode ) {
3000  case $.ui.keyCode.PAGE_UP:
3001   this.previousPage( event );
3002   break;
3003  case $.ui.keyCode.PAGE_DOWN:
3004   this.nextPage( event );
3005   break;
3006  case $.ui.keyCode.HOME:
3007   this._move( "first", "first", event );
3008   break;
3009  case $.ui.keyCode.END:
3010   this._move( "last", "last", event );
3011   break;
3012  case $.ui.keyCode.UP:
3013   this.previous( event );
3014   break;
3015  case $.ui.keyCode.DOWN:
3016   this.next( event );
3017   break;
3018  case $.ui.keyCode.LEFT:
3019   this.collapse( event );
3020   break;
3021  case $.ui.keyCode.RIGHT:
3022   if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
3023    this.expand( event );
3024   }
3025   break;
3026  case $.ui.keyCode.ENTER:
3027  case $.ui.keyCode.SPACE:
3028   this._activate( event );
3029   break;
3030  case $.ui.keyCode.ESCAPE:
3031   this.collapse( event );
3032   break;
3033  default:
3034   preventDefault = false;
vendor: 6,930 bytes, lines 3035-3283
3035   prev = this.previousFilter || "";
3036   skip = false;
3037
3038   // Support number pad values
3039   character = event.keyCode >= 96 && event.keyCode <= 105 ?
3040    ( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode );
3041
3042   clearTimeout( this.filterTimer );
3043
3044   if ( character === prev ) {
3045    skip = true;
3046   } else {
3047    character = prev + character;
3048   }
3049
3050   match = this._filterMenuItems( character );
3051   match = skip && match.index( this.active.next() ) !== -1 ?
3052    this.active.nextAll( ".ui-menu-item" ) :
3053    match;
3054
3055   // If no matches on the current filter, reset to the last character pressed
3056   // to move down the menu to the first item that starts with that character
3057   if ( !match.length ) {
3058    character = String.fromCharCode( event.keyCode );
3059    match = this._filterMenuItems( character );
3060   }
3061
3062   if ( match.length ) {
3063    this.focus( event, match );
3064    this.previousFilter = character;
3065    this.filterTimer = this._delay( function() {
3066     delete this.previousFilter;
3067    }, 1000 );
3068   } else {
3069    delete this.previousFilter;
3070   }
3071  }
3072
3073  if ( preventDefault ) {
3074   event.preventDefault();
3075  }
3076 },
3077
3078 _activate: function( event ) {
3079  if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
3080   if ( this.active.children( "[aria-haspopup='true']" ).length ) {
3081    this.expand( event );
3082   } else {
3083    this.select( event );
3084   }
3085  }
3086 },
3087
3088 refresh: function() {
3089  var menus, items, newSubmenus, newItems, newWrappers,
3090   that = this,
3091   icon = this.options.icons.submenu,
3092   submenus = this.element.find( this.options.menus );
3093
3094  this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length );
3095
3096  // Initialize nested menus
3097  newSubmenus = submenus.filter( ":not(.ui-menu)" )
3098   .hide()
3099   .attr( {
3100    role: this.options.role,
3101    "aria-hidden": "true",
3102    "aria-expanded": "false"
3103   } )
3104   .each( function() {
3105    var menu = $( this ),
3106     item = menu.prev(),
3107     submenuCaret = $( "<span>" ).data( "ui-menu-submenu-caret", true );
3108
3109    that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon );
3110    item
3111     .attr( "aria-haspopup", "true" )
3112     .prepend( submenuCaret );
3113    menu.attr( "aria-labelledby", item.attr( "id" ) );
3114   } );
3115
3116  this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" );
3117
3118  menus = submenus.add( this.element );
3119  items = menus.find( this.options.items );
3120
3121  // Initialize menu-items containing spaces and/or dashes only as dividers
3122  items.not( ".ui-menu-item" ).each( function() {
3123   var item = $( this );
3124   if ( that._isDivider( item ) ) {
3125    that._addClass( item, "ui-menu-divider", "ui-widget-content" );
3126   }
3127  } );
3128
3129  // Don't refresh list items that are already adapted
3130  newItems = items.not( ".ui-menu-item, .ui-menu-divider" );
3131  newWrappers = newItems.children()
3132   .not( ".ui-menu" )
3133    .uniqueId()
3134    .attr( {
3135     tabIndex: -1,
3136     role: this._itemRole()
3137    } );
3138  this._addClass( newItems, "ui-menu-item" )
3139   ._addClass( newWrappers, "ui-menu-item-wrapper" );
3140
3141  // Add aria-disabled attribute to any disabled menu item
3142  items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
3143
3144  // If the active item has been removed, blur the menu
3145  if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
3146   this.blur();
3147  }
3148 },
3149
3150 _itemRole: function() {
3151  return {
3152   menu: "menuitem",
3153   listbox: "option"
3154  }[ this.options.role ];
3155 },
3156
3157 _setOption: function( key, value ) {
3158  if ( key === "icons" ) {
3159   var icons = this.element.find( ".ui-menu-icon" );
3160   this._removeClass( icons, null, this.options.icons.submenu )
3161    ._addClass( icons, null, value.submenu );
3162  }
3163  this._super( key, value );
3164 },
3165
3166 _setOptionDisabled: function( value ) {
3167  this._super( value );
3168
3169  this.element.attr( "aria-disabled", String( value ) );
3170  this._toggleClass( null, "ui-state-disabled", !!value );
3171 },
3172
3173 focus: function( event, item ) {
3174  var nested, focused, activeParent;
3175  this.blur( event, event && event.type === "focus" );
3176
3177  this._scrollIntoView( item );
3178
3179  this.active = item.first();
3180
3181  focused = this.active.children( ".ui-menu-item-wrapper" );
3182  this._addClass( focused, null, "ui-state-active" );
3183
3184  // Only update aria-activedescendant if there's a role
3185  // otherwise we assume focus is managed elsewhere
3186  if ( this.options.role ) {
3187   this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
3188  }
3189
3190  // Highlight active parent menu item, if any
3191  activeParent = this.active
3192   .parent()
3193    .closest( ".ui-menu-item" )
3194     .children( ".ui-menu-item-wrapper" );
3195  this._addClass( activeParent, null, "ui-state-active" );
3196
3197  if ( event && event.type === "keydown" ) {
3198   this._close();
3199  } else {
3200   this.timer = this._delay( function() {
3201    this._close();
3202   }, this.delay );
3203  }
3204
3205  nested = item.children( ".ui-menu" );
3206  if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
3207   this._startOpening( nested );
3208  }
3209  this.activeMenu = item.parent();
3210
3211  this._trigger( "focus", event, { item: item } );
3212 },
3213
3214 _scrollIntoView: function( item ) {
3215  var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
3216  if ( this._hasScroll() ) {
3217   borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0;
3218   paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0;
3219   offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
3220   scroll = this.activeMenu.scrollTop();
3221   elementHeight = this.activeMenu.height();
3222   itemHeight = item.outerHeight();
3223
3224   if ( offset < 0 ) {
3225    this.activeMenu.scrollTop( scroll + offset );
3226   } else if ( offset + itemHeight > elementHeight ) {
3227    this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
3228   }
3229  }
3230 },
3231
3232 blur: function( event, fromFocus ) {
3233  if ( !fromFocus ) {
3234   clearTimeout( this.timer );
3235  }
3236
3237  if ( !this.active ) {
3238   return;
3239  }
3240
3241  this._removeClass( this.active.children( ".ui-menu-item-wrapper" ),
3242   null, "ui-state-active" );
3243
3244  this._trigger( "blur", event, { item: this.active } );
3245  this.active = null;
3246 },
3247
3248 _startOpening: function( submenu ) {
3249  clearTimeout( this.timer );
3250
3251  // Don't open if already open fixes a Firefox bug that caused a .5 pixel
3252  // shift in the submenu position when mousing over the caret icon
3253  if ( submenu.attr( "aria-hidden" ) !== "true" ) {
3254   return;
3255  }
3256
3257  this.timer = this._delay( function() {
3258   this._close();
3259   this._open( submenu );
3260  }, this.delay );
3261 },
3262
3263 _open: function( submenu ) {
3264  var position = $.extend( {
3265   of: this.active
3266  }, this.options.position );
3267
3268  clearTimeout( this.timer );
3269  this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
3270   .hide()
3271   .attr( "aria-hidden", "true" );
3272
3273  submenu
3274   .show()
3275   .removeAttr( "aria-hidden" )
3276   .attr( "aria-expanded", "true" )
3277   .position( position );
3278 },
3279
3280 collapseAll: function( event, all ) {
3281  clearTimeout( this.timer );
3282  this.timer = this._delay( function() {
3283
vendor: 35,660 bytes, lines 3284-4603
3284   // If we were passed an event, look for the submenu that contains the event
3285   var currentMenu = all ? this.element :
3286    $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
3287
3288   // If we found no valid submenu ancestor, use the main menu to close all
3289   // sub menus anyway
3290   if ( !currentMenu.length ) {
3291    currentMenu = this.element;
3292   }
3293
3294   this._close( currentMenu );
3295
3296   this.blur( event );
3297
3298   // Work around active item staying active after menu is blurred
3299   this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" );
3300
3301   this.activeMenu = currentMenu;
3302  }, this.delay );
3303 },
3304
3305 // With no arguments, closes the currently active menu - if nothing is active
3306 // it closes all menus.  If passed an argument, it will search for menus BELOW
3307 _close: function( startMenu ) {
3308  if ( !startMenu ) {
3309   startMenu = this.active ? this.active.parent() : this.element;
3310  }
3311
3312  startMenu.find( ".ui-menu" )
3313   .hide()
3314   .attr( "aria-hidden", "true" )
3315   .attr( "aria-expanded", "false" );
3316 },
3317
3318 _closeOnDocumentClick: function( event ) {
3319  return !$( event.target ).closest( ".ui-menu" ).length;
3320 },
3321
3322 _isDivider: function( item ) {
3323
3324  // Match hyphen, em dash, en dash
3325  return !/[^\-\u2014\u2013\s]/.test( item.text() );
3326 },
3327
3328 collapse: function( event ) {
3329  var newItem = this.active &&
3330   this.active.parent().closest( ".ui-menu-item", this.element );
3331  if ( newItem && newItem.length ) {
3332   this._close();
3333   this.focus( event, newItem );
3334  }
3335 },
3336
3337 expand: function( event ) {
3338  var newItem = this.active &&
3339   this.active
3340    .children( ".ui-menu " )
3341     .find( this.options.items )
3342      .first();
3343
3344  if ( newItem && newItem.length ) {
3345   this._open( newItem.parent() );
3346
3347   // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
3348   this._delay( function() {
3349    this.focus( event, newItem );
3350   } );
3351  }
3352 },
3353
3354 next: function( event ) {
3355  this._move( "next", "first", event );
3356 },
3357
3358 previous: function( event ) {
3359  this._move( "prev", "last", event );
3360 },
3361
3362 isFirstItem: function() {
3363  return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
3364 },
3365
3366 isLastItem: function() {
3367  return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
3368 },
3369
3370 _move: function( direction, filter, event ) {
3371  var next;
3372  if ( this.active ) {
3373   if ( direction === "first" || direction === "last" ) {
3374    next = this.active
3375     [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
3376     .eq( -1 );
3377   } else {
3378    next = this.active
3379     [ direction + "All" ]( ".ui-menu-item" )
3380     .eq( 0 );
3381   }
3382  }
3383  if ( !next || !next.length || !this.active ) {
3384   next = this.activeMenu.find( this.options.items )[ filter ]();
3385  }
3386
3387  this.focus( event, next );
3388 },
3389
3390 nextPage: function( event ) {
3391  var item, base, height;
3392
3393  if ( !this.active ) {
3394   this.next( event );
3395   return;
3396  }
3397  if ( this.isLastItem() ) {
3398   return;
3399  }
3400  if ( this._hasScroll() ) {
3401   base = this.active.offset().top;
3402   height = this.element.height();
3403   this.active.nextAll( ".ui-menu-item" ).each( function() {
3404    item = $( this );
3405    return item.offset().top - base - height < 0;
3406   } );
3407
3408   this.focus( event, item );
3409  } else {
3410   this.focus( event, this.activeMenu.find( this.options.items )
3411    [ !this.active ? "first" : "last" ]() );
3412  }
3413 },
3414
3415 previousPage: function( event ) {
3416  var item, base, height;
3417  if ( !this.active ) {
3418   this.next( event );
3419   return;
3420  }
3421  if ( this.isFirstItem() ) {
3422   return;
3423  }
3424  if ( this._hasScroll() ) {
3425   base = this.active.offset().top;
3426   height = this.element.height();
3427   this.active.prevAll( ".ui-menu-item" ).each( function() {
3428    item = $( this );
3429    return item.offset().top - base + height > 0;
3430   } );
3431
3432   this.focus( event, item );
3433  } else {
3434   this.focus( event, this.activeMenu.find( this.options.items ).first() );
3435  }
3436 },
3437
3438 _hasScroll: function() {
3439  return this.element.outerHeight() < this.element.prop( "scrollHeight" );
3440 },
3441
3442 select: function( event ) {
3443
3444  // TODO: It should never be possible to not have an active item at this
3445  // point, but the tests don't trigger mouseenter before click.
3446  this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
3447  var ui = { item: this.active };
3448  if ( !this.active.has( ".ui-menu" ).length ) {
3449   this.collapseAll( event, true );
3450  }
3451  this._trigger( "select", event, ui );
3452 },
3453
3454 _filterMenuItems: function( character ) {
3455  var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
3456   regex = new RegExp( "^" + escapedCharacter, "i" );
3457
3458  return this.activeMenu
3459   .find( this.options.items )
3460
3461    // Only match on items, not dividers or other content (#10571)
3462    .filter( ".ui-menu-item" )
3463     .filter( function() {
3464      return regex.test(
3465       $.trim( $( this ).children( ".ui-menu-item-wrapper" ).text() ) );
3466     } );
3467 }
3468} );
3469
3470
3471/*!
3472 * jQuery UI Autocomplete 1.12.1
3473 * http://jqueryui.com
3474 *
3475 * Copyright jQuery Foundation and other contributors
3476 * Released under the MIT license.
3477 * http://jquery.org/license
3478 */
3479
3480//>>label: Autocomplete
3481//>>group: Widgets
3482//>>description: Lists suggested words as the user is typing.
3483//>>docs: http://api.jqueryui.com/autocomplete/
3484//>>demos: http://jqueryui.com/autocomplete/
3485//>>css.structure: ../../themes/base/core.css
3486//>>css.structure: ../../themes/base/autocomplete.css
3487//>>css.theme: ../../themes/base/theme.css
3488
3489
3490
3491$.widget( "ui.autocomplete", {
3492 version: "1.12.1",
3493 defaultElement: "<input>",
3494 options: {
3495  appendTo: null,
3496  autoFocus: false,
3497  delay: 300,
3498  minLength: 1,
3499  position: {
3500   my: "left top",
3501   at: "left bottom",
3502   collision: "none"
3503  },
3504  source: null,
3505
3506  // Callbacks
3507  change: null,
3508  close: null,
3509  focus: null,
3510  open: null,
3511  response: null,
3512  search: null,
3513  select: null
3514 },
3515
3516 requestIndex: 0,
3517 pending: 0,
3518
3519 _create: function() {
3520
3521  // Some browsers only repeat keydown events, not keypress events,
3522  // so we use the suppressKeyPress flag to determine if we've already
3523  // handled the keydown event. #7269
3524  // Unfortunately the code for & in keypress is the same as the up arrow,
3525  // so we use the suppressKeyPressRepeat flag to avoid handling keypress
3526  // events when we know the keydown event was used to modify the
3527  // search term. #7799
3528  var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
3529   nodeName = this.element[ 0 ].nodeName.toLowerCase(),
3530   isTextarea = nodeName === "textarea",
3531   isInput = nodeName === "input";
3532
3533  // Textareas are always multi-line
3534  // Inputs are always single-line, even if inside a contentEditable element
3535  // IE also treats inputs as contentEditable
3536  // All other element types are determined by whether or not they're contentEditable
3537  this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element );
3538
3539  this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
3540  this.isNewMenu = true;
3541
3542  this._addClass( "ui-autocomplete-input" );
3543  this.element.attr( "autocomplete", "off" );
3544
3545  this._on( this.element, {
3546   keydown: function( event ) {
3547    if ( this.element.prop( "readOnly" ) ) {
3548     suppressKeyPress = true;
3549     suppressInput = true;
3550     suppressKeyPressRepeat = true;
3551     return;
3552    }
3553
3554    suppressKeyPress = false;
3555    suppressInput = false;
3556    suppressKeyPressRepeat = false;
3557    var keyCode = $.ui.keyCode;
3558    switch ( event.keyCode ) {
3559    case keyCode.PAGE_UP:
3560     suppressKeyPress = true;
3561     this._move( "previousPage", event );
3562     break;
3563    case keyCode.PAGE_DOWN:
3564     suppressKeyPress = true;
3565     this._move( "nextPage", event );
3566     break;
3567    case keyCode.UP:
3568     suppressKeyPress = true;
3569     this._keyEvent( "previous", event );
3570     break;
3571    case keyCode.DOWN:
3572     suppressKeyPress = true;
3573     this._keyEvent( "next", event );
3574     break;
3575    case keyCode.ENTER:
3576
3577     // when menu is open and has focus
3578     if ( this.menu.active ) {
3579
3580      // #6055 - Opera still allows the keypress to occur
3581      // which causes forms to submit
3582      suppressKeyPress = true;
3583      event.preventDefault();
3584      this.menu.select( event );
3585     }
3586     break;
3587    case keyCode.TAB:
3588     if ( this.menu.active ) {
3589      this.menu.select( event );
3590     }
3591     break;
3592    case keyCode.ESCAPE:
3593     if ( this.menu.element.is( ":visible" ) ) {
3594      if ( !this.isMultiLine ) {
3595       this._value( this.term );
3596      }
3597      this.close( event );
3598
3599      // Different browsers have different default behavior for escape
3600      // Single press can mean undo or clear
3601      // Double press in IE means clear the whole form
3602      event.preventDefault();
3603     }
3604     break;
3605    default:
3606     suppressKeyPressRepeat = true;
3607
3608     // search timeout should be triggered before the input value is changed
3609     this._searchTimeout( event );
3610     break;
3611    }
3612   },
3613   keypress: function( event ) {
3614    if ( suppressKeyPress ) {
3615     suppressKeyPress = false;
3616     if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
3617      event.preventDefault();
3618     }
3619     return;
3620    }
3621    if ( suppressKeyPressRepeat ) {
3622     return;
3623    }
3624
3625    // Replicate some key handlers to allow them to repeat in Firefox and Opera
3626    var keyCode = $.ui.keyCode;
3627    switch ( event.keyCode ) {
3628    case keyCode.PAGE_UP:
3629     this._move( "previousPage", event );
3630     break;
3631    case keyCode.PAGE_DOWN:
3632     this._move( "nextPage", event );
3633     break;
3634    case keyCode.UP:
3635     this._keyEvent( "previous", event );
3636     break;
3637    case keyCode.DOWN:
3638     this._keyEvent( "next", event );
3639     break;
3640    }
3641   },
3642   input: function( event ) {
3643    if ( suppressInput ) {
3644     suppressInput = false;
3645     event.preventDefault();
3646     return;
3647    }
3648    this._searchTimeout( event );
3649   },
3650   focus: function() {
3651    this.selectedItem = null;
3652    this.previous = this._value();
3653   },
3654   blur: function( event ) {
3655    if ( this.cancelBlur ) {
3656     delete this.cancelBlur;
3657     return;
3658    }
3659
3660    clearTimeout( this.searching );
3661    this.close( event );
3662    this._change( event );
3663   }
3664  } );
3665
3666  this._initSource();
3667  this.menu = $( "<ul>" )
3668   .appendTo( this._appendTo() )
3669   .menu( {
3670
3671    // disable ARIA support, the live region takes care of that
3672    role: null
3673   } )
3674   .hide()
3675   .menu( "instance" );
3676
3677  this._addClass( this.menu.element, "ui-autocomplete", "ui-front" );
3678  this._on( this.menu.element, {
3679   mousedown: function( event ) {
3680
3681    // prevent moving focus out of the text field
3682    event.preventDefault();
3683
3684    // IE doesn't prevent moving focus even with event.preventDefault()
3685    // so we set a flag to know when we should ignore the blur event
3686    this.cancelBlur = true;
3687    this._delay( function() {
3688     delete this.cancelBlur;
3689
3690     // Support: IE 8 only
3691     // Right clicking a menu item or selecting text from the menu items will
3692     // result in focus moving out of the input. However, we've already received
3693     // and ignored the blur event because of the cancelBlur flag set above. So
3694     // we restore focus to ensure that the menu closes properly based on the user's
3695     // next actions.
3696     if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
3697      this.element.trigger( "focus" );
3698     }
3699    } );
3700   },
3701   menufocus: function( event, ui ) {
3702    var label, item;
3703
3704    // support: Firefox
3705    // Prevent accidental activation of menu items in Firefox (#7024 #9118)
3706    if ( this.isNewMenu ) {
3707     this.isNewMenu = false;
3708     if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
3709      this.menu.blur();
3710
3711      this.document.one( "mousemove", function() {
3712       $( event.target ).trigger( event.originalEvent );
3713      } );
3714
3715      return;
3716     }
3717    }
3718
3719    item = ui.item.data( "ui-autocomplete-item" );
3720    if ( false !== this._trigger( "focus", event, { item: item } ) ) {
3721
3722     // use value to match what will end up in the input, if it was a key event
3723     if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
3724      this._value( item.value );
3725     }
3726    }
3727
3728    // Announce the value in the liveRegion
3729    label = ui.item.attr( "aria-label" ) || item.value;
3730    if ( label && $.trim( label ).length ) {
3731     this.liveRegion.children().hide();
3732     $( "<div>" ).text( label ).appendTo( this.liveRegion );
3733    }
3734   },
3735   menuselect: function( event, ui ) {
3736    var item = ui.item.data( "ui-autocomplete-item" ),
3737     previous = this.previous;
3738
3739    // Only trigger when focus was lost (click on menu)
3740    if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
3741     this.element.trigger( "focus" );
3742     this.previous = previous;
3743
3744     // #6109 - IE triggers two focus events and the second
3745     // is asynchronous, so we need to reset the previous
3746     // term synchronously and asynchronously :-(
3747     this._delay( function() {
3748      this.previous = previous;
3749      this.selectedItem = item;
3750     } );
3751    }
3752
3753    if ( false !== this._trigger( "select", event, { item: item } ) ) {
3754     this._value( item.value );
3755    }
3756
3757    // reset the term after the select event
3758    // this allows custom select handling to work properly
3759    this.term = this._value();
3760
3761    this.close( event );
3762    this.selectedItem = item;
3763   }
3764  } );
3765
3766  this.liveRegion = $( "<div>", {
3767   role: "status",
3768   "aria-live": "assertive",
3769   "aria-relevant": "additions"
3770  } )
3771   .appendTo( this.document[ 0 ].body );
3772
3773  this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
3774
3775  // Turning off autocomplete prevents the browser from remembering the
3776  // value when navigating through history, so we re-enable autocomplete
3777  // if the page is unloaded before the widget is destroyed. #7790
3778  this._on( this.window, {
3779   beforeunload: function() {
3780    this.element.removeAttr( "autocomplete" );
3781   }
3782  } );
3783 },
3784
3785 _destroy: function() {
3786  clearTimeout( this.searching );
3787  this.element.removeAttr( "autocomplete" );
3788  this.menu.element.remove();
3789  this.liveRegion.remove();
3790 },
3791
3792 _setOption: function( key, value ) {
3793  this._super( key, value );
3794  if ( key === "source" ) {
3795   this._initSource();
3796  }
3797  if ( key === "appendTo" ) {
3798   this.menu.element.appendTo( this._appendTo() );
3799  }
3800  if ( key === "disabled" && value && this.xhr ) {
3801   this.xhr.abort();
3802  }
3803 },
3804
3805 _isEventTargetInWidget: function( event ) {
3806  var menuElement = this.menu.element[ 0 ];
3807
3808  return event.target === this.element[ 0 ] ||
3809   event.target === menuElement ||
3810   $.contains( menuElement, event.target );
3811 },
3812
3813 _closeOnClickOutside: function( event ) {
3814  if ( !this._isEventTargetInWidget( event ) ) {
3815   this.close();
3816  }
3817 },
3818
3819 _appendTo: function() {
3820  var element = this.options.appendTo;
3821
3822  if ( element ) {
3823   element = element.jquery || element.nodeType ?
3824    $( element ) :
3825    this.document.find( element ).eq( 0 );
3826  }
3827
3828  if ( !element || !element[ 0 ] ) {
3829   element = this.element.closest( ".ui-front, dialog" );
3830  }
3831
3832  if ( !element.length ) {
3833   element = this.document[ 0 ].body;
3834  }
3835
3836  return element;
3837 },
3838
3839 _initSource: function() {
3840  var array, url,
3841   that = this;
3842  if ( $.isArray( this.options.source ) ) {
3843   array = this.options.source;
3844   this.source = function( request, response ) {
3845    response( $.ui.autocomplete.filter( array, request.term ) );
3846   };
3847  } else if ( typeof this.options.source === "string" ) {
3848   url = this.options.source;
3849   this.source = function( request, response ) {
3850    if ( that.xhr ) {
3851     that.xhr.abort();
3852    }
3853    that.xhr = $.ajax( {
3854     url: url,
3855     data: request,
3856     dataType: "json",
3857     success: function( data ) {
3858      response( data );
3859     },
3860     error: function() {
3861      response( [] );
3862     }
3863    } );
3864   };
3865  } else {
3866   this.source = this.options.source;
3867  }
3868 },
3869
3870 _searchTimeout: function( event ) {
3871  clearTimeout( this.searching );
3872  this.searching = this._delay( function() {
3873
3874   // Search if the value has changed, or if the user retypes the same value (see #7434)
3875   var equalValues = this.term === this._value(),
3876    menuVisible = this.menu.element.is( ":visible" ),
3877    modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
3878
3879   if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
3880    this.selectedItem = null;
3881    this.search( null, event );
3882   }
3883  }, this.options.delay );
3884 },
3885
3886 search: function( value, event ) {
3887  value = value != null ? value : this._value();
3888
3889  // Always save the actual value, not the one passed as an argument
3890  this.term = this._value();
3891
3892  if ( value.length < this.options.minLength ) {
3893   return this.close( event );
3894  }
3895
3896  if ( this._trigger( "search", event ) === false ) {
3897   return;
3898  }
3899
3900  return this._search( value );
3901 },
3902
3903 _search: function( value ) {
3904  this.pending++;
3905  this._addClass( "ui-autocomplete-loading" );
3906  this.cancelSearch = false;
3907
3908  this.source( { term: value }, this._response() );
3909 },
3910
3911 _response: function() {
3912  var index = ++this.requestIndex;
3913
3914  return $.proxy( function( content ) {
3915   if ( index === this.requestIndex ) {
3916    this.__response( content );
3917   }
3918
3919   this.pending--;
3920   if ( !this.pending ) {
3921    this._removeClass( "ui-autocomplete-loading" );
3922   }
3923  }, this );
3924 },
3925
3926 __response: function( content ) {
3927  if ( content ) {
3928   content = this._normalize( content );
3929  }
3930  this._trigger( "response", null, { content: content } );
3931  if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
3932   this._suggest( content );
3933   this._trigger( "open" );
3934  } else {
3935
3936   // use ._close() instead of .close() so we don't cancel future searches
3937   this._close();
3938  }
3939 },
3940
3941 close: function( event ) {
3942  this.cancelSearch = true;
3943  this._close( event );
3944 },
3945
3946 _close: function( event ) {
3947
3948  // Remove the handler that closes the menu on outside clicks
3949  this._off( this.document, "mousedown" );
3950
3951  if ( this.menu.element.is( ":visible" ) ) {
3952   this.menu.element.hide();
3953   this.menu.blur();
3954   this.isNewMenu = true;
3955   this._trigger( "close", event );
3956  }
3957 },
3958
3959 _change: function( event ) {
3960  if ( this.previous !== this._value() ) {
3961   this._trigger( "change", event, { item: this.selectedItem } );
3962  }
3963 },
3964
3965 _normalize: function( items ) {
3966
3967  // assume all items have the right format when the first item is complete
3968  if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
3969   return items;
3970  }
3971  return $.map( items, function( item ) {
3972   if ( typeof item === "string" ) {
3973    return {
3974     label: item,
3975     value: item
3976    };
3977   }
3978   return $.extend( {}, item, {
3979    label: item.label || item.value,
3980    value: item.value || item.label
3981   } );
3982  } );
3983 },
3984
3985 _suggest: function( items ) {
3986  var ul = this.menu.element.empty();
3987  this._renderMenu( ul, items );
3988  this.isNewMenu = true;
3989  this.menu.refresh();
3990
3991  // Size and position menu
3992  ul.show();
3993  this._resizeMenu();
3994  ul.position( $.extend( {
3995   of: this.element
3996  }, this.options.position ) );
3997
3998  if ( this.options.autoFocus ) {
3999   this.menu.next();
4000  }
4001
4002  // Listen for interactions outside of the widget (#6642)
4003  this._on( this.document, {
4004   mousedown: "_closeOnClickOutside"
4005  } );
4006 },
4007
4008 _resizeMenu: function() {
4009  var ul = this.menu.element;
4010  ul.outerWidth( Math.max(
4011
4012   // Firefox wraps long text (possibly a rounding bug)
4013   // so we add 1px to avoid the wrapping (#7513)
4014   ul.width( "" ).outerWidth() + 1,
4015   this.element.outerWidth()
4016  ) );
4017 },
4018
4019 _renderMenu: function( ul, items ) {
4020  var that = this;
4021  $.each( items, function( index, item ) {
4022   that._renderItemData( ul, item );
4023  } );
4024 },
4025
4026 _renderItemData: function( ul, item ) {
4027  return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
4028 },
4029
4030 _renderItem: function( ul, item ) {
4031  return $( "<li>" )
4032   .append( $( "<div>" ).text( item.label ) )
4033   .appendTo( ul );
4034 },
4035
4036 _move: function( direction, event ) {
4037  if ( !this.menu.element.is( ":visible" ) ) {
4038   this.search( null, event );
4039   return;
4040  }
4041  if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
4042    this.menu.isLastItem() && /^next/.test( direction ) ) {
4043
4044   if ( !this.isMultiLine ) {
4045    this._value( this.term );
4046   }
4047
4048   this.menu.blur();
4049   return;
4050  }
4051  this.menu[ direction ]( event );
4052 },
4053
4054 widget: function() {
4055  return this.menu.element;
4056 },
4057
4058 _value: function() {
4059  return this.valueMethod.apply( this.element, arguments );
4060 },
4061
4062 _keyEvent: function( keyEvent, event ) {
4063  if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
4064   this._move( keyEvent, event );
4065
4066   // Prevents moving cursor to beginning/end of the text field in some browsers
4067   event.preventDefault();
4068  }
4069 },
4070
4071 // Support: Chrome <=50
4072 // We should be able to just use this.element.prop( "isContentEditable" )
4073 // but hidden elements always report false in Chrome.
4074 // https://code.google.com/p/chromium/issues/detail?id=313082
4075 _isContentEditable: function( element ) {
4076  if ( !element.length ) {
4077   return false;
4078  }
4079
4080  var editable = element.prop( "contentEditable" );
4081
4082  if ( editable === "inherit" ) {
4083    return this._isContentEditable( element.parent() );
4084  }
4085
4086  return editable === "true";
4087 }
4088} );
4089
4090$.extend( $.ui.autocomplete, {
4091 escapeRegex: function( value ) {
4092  return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
4093 },
4094 filter: function( array, term ) {
4095  var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
4096  return $.grep( array, function( value ) {
4097   return matcher.test( value.label || value.value || value );
4098  } );
4099 }
4100} );
4101
4102// Live region extension, adding a `messages` option
4103// NOTE: This is an experimental API. We are still investigating
4104// a full solution for string manipulation and internationalization.
4105$.widget( "ui.autocomplete", $.ui.autocomplete, {
4106 options: {
4107  messages: {
4108   noResults: "No search results.",
4109   results: function( amount ) {
4110    return amount + ( amount > 1 ? " results are" : " result is" ) +
4111     " available, use up and down arrow keys to navigate.";
4112   }
4113  }
4114 },
4115
4116 __response: function( content ) {
4117  var message;
4118  this._superApply( arguments );
4119  if ( this.options.disabled || this.cancelSearch ) {
4120   return;
4121  }
4122  if ( content && content.length ) {
4123   message = this.options.messages.results( content.length );
4124  } else {
4125   message = this.options.messages.noResults;
4126  }
4127  this.liveRegion.children().hide();
4128  $( "<div>" ).text( message ).appendTo( this.liveRegion );
4129 }
4130} );
4131
4132var widgetsAutocomplete = $.ui.autocomplete;
4133
4134
4135/*!
4136 * jQuery UI Controlgroup 1.12.1
4137 * http://jqueryui.com
4138 *
4139 * Copyright jQuery Foundation and other contributors
4140 * Released under the MIT license.
4141 * http://jquery.org/license
4142 */
4143
4144//>>label: Controlgroup
4145//>>group: Widgets
4146//>>description: Visually groups form control widgets
4147//>>docs: http://api.jqueryui.com/controlgroup/
4148//>>demos: http://jqueryui.com/controlgroup/
4149//>>css.structure: ../../themes/base/core.css
4150//>>css.structure: ../../themes/base/controlgroup.css
4151//>>css.theme: ../../themes/base/theme.css
4152
4153
4154var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
4155
4156var widgetsControlgroup = $.widget( "ui.controlgroup", {
4157 version: "1.12.1",
4158 defaultElement: "<div>",
4159 options: {
4160  direction: "horizontal",
4161  disabled: null,
4162  onlyVisible: true,
4163  items: {
4164   "button": "input[type=button], input[type=submit], input[type=reset], button, a",
4165   "controlgroupLabel": ".ui-controlgroup-label",
4166   "checkboxradio": "input[type='checkbox'], input[type='radio']",
4167   "selectmenu": "select",
4168   "spinner": ".ui-spinner-input"
4169  }
4170 },
4171
4172 _create: function() {
4173  this._enhance();
4174 },
4175
4176 // To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
4177 _enhance: function() {
4178  this.element.attr( "role", "toolbar" );
4179  this.refresh();
4180 },
4181
4182 _destroy: function() {
4183  this._callChildMethod( "destroy" );
4184  this.childWidgets.removeData( "ui-controlgroup-data" );
4185  this.element.removeAttr( "role" );
4186  if ( this.options.items.controlgroupLabel ) {
4187   this.element
4188    .find( this.options.items.controlgroupLabel )
4189    .find( ".ui-controlgroup-label-contents" )
4190    .contents().unwrap();
4191  }
4192 },
4193
4194 _initWidgets: function() {
4195  var that = this,
4196   childWidgets = [];
4197
4198  // First we iterate over each of the items options
4199  $.each( this.options.items, function( widget, selector ) {
4200   var labels;
4201   var options = {};
4202
4203   // Make sure the widget has a selector set
4204   if ( !selector ) {
4205    return;
4206   }
4207
4208   if ( widget === "controlgroupLabel" ) {
4209    labels = that.element.find( selector );
4210    labels.each( function() {
4211     var element = $( this );
4212
4213     if ( element.children( ".ui-controlgroup-label-contents" ).length ) {
4214      return;
4215     }
4216     element.contents()
4217      .wrapAll( "<span class='ui-controlgroup-label-contents'></span>" );
4218    } );
4219    that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
4220    childWidgets = childWidgets.concat( labels.get() );
4221    return;
4222   }
4223
4224   // Make sure the widget actually exists
4225   if ( !$.fn[ widget ] ) {
4226    return;
4227   }
4228
4229   // We assume everything is in the middle to start because we can't determine
4230   // first / last elements until all enhancments are done.
4231   if ( that[ "_" + widget + "Options" ] ) {
4232    options = that[ "_" + widget + "Options" ]( "middle" );
4233   } else {
4234    options = { classes: {} };
4235   }
4236
4237   // Find instances of this widget inside controlgroup and init them
4238   that.element
4239    .find( selector )
4240    .each( function() {
4241     var element = $( this );
4242     var instance = element[ widget ]( "instance" );
4243
4244     // We need to clone the default options for this type of widget to avoid
4245     // polluting the variable options which has a wider scope than a single widget.
4246     var instanceOptions = $.widget.extend( {}, options );
4247
4248     // If the button is the child of a spinner ignore it
4249     // TODO: Find a more generic solution
4250     if ( widget === "button" && element.parent( ".ui-spinner" ).length ) {
4251      return;
4252     }
4253
4254     // Create the widget if it doesn't exist
4255     if ( !instance ) {
4256      instance = element[ widget ]()[ widget ]( "instance" );
4257     }
4258     if ( instance ) {
4259      instanceOptions.classes =
4260       that._resolveClassesValues( instanceOptions.classes, instance );
4261     }
4262     element[ widget ]( instanceOptions );
4263
4264     // Store an instance of the controlgroup to be able to reference
4265     // from the outermost element for changing options and refresh
4266     var widgetElement = element[ widget ]( "widget" );
4267     $.data( widgetElement[ 0 ], "ui-controlgroup-data",
4268      instance ? instance : element[ widget ]( "instance" ) );
4269
4270     childWidgets.push( widgetElement[ 0 ] );
4271    } );
4272  } );
4273
4274  this.childWidgets = $( $.unique( childWidgets ) );
4275  this._addClass( this.childWidgets, "ui-controlgroup-item" );
4276 },
4277
4278 _callChildMethod: function( method ) {
4279  this.childWidgets.each( function() {
4280   var element = $( this ),
4281    data = element.data( "ui-controlgroup-data" );
4282   if ( data && data[ method ] ) {
4283    data[ method ]();
4284   }
4285  } );
4286 },
4287
4288 _updateCornerClass: function( element, position ) {
4289  var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
4290  var add = this._buildSimpleOptions( position, "label" ).classes.label;
4291
4292  this._removeClass( element, null, remove );
4293  this._addClass( element, null, add );
4294 },
4295
4296 _buildSimpleOptions: function( position, key ) {
4297  var direction = this.options.direction === "vertical";
4298  var result = {
4299   classes: {}
4300  };
4301  result.classes[ key ] = {
4302   "middle": "",
4303   "first": "ui-corner-" + ( direction ? "top" : "left" ),
4304   "last": "ui-corner-" + ( direction ? "bottom" : "right" ),
4305   "only": "ui-corner-all"
4306  }[ position ];
4307
4308  return result;
4309 },
4310
4311 _spinnerOptions: function( position ) {
4312  var options = this._buildSimpleOptions( position, "ui-spinner" );
4313
4314  options.classes[ "ui-spinner-up" ] = "";
4315  options.classes[ "ui-spinner-down" ] = "";
4316
4317  return options;
4318 },
4319
4320 _buttonOptions: function( position ) {
4321  return this._buildSimpleOptions( position, "ui-button" );
4322 },
4323
4324 _checkboxradioOptions: function( position ) {
4325  return this._buildSimpleOptions( position, "ui-checkboxradio-label" );
4326 },
4327
4328 _selectmenuOptions: function( position ) {
4329  var direction = this.options.direction === "vertical";
4330  return {
4331   width: direction ? "auto" : false,
4332   classes: {
4333    middle: {
4334     "ui-selectmenu-button-open": "",
4335     "ui-selectmenu-button-closed": ""
4336    },
4337    first: {
4338     "ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ),
4339     "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" )
4340    },
4341    last: {
4342     "ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
4343     "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" )
4344    },
4345    only: {
4346     "ui-selectmenu-button-open": "ui-corner-top",
4347     "ui-selectmenu-button-closed": "ui-corner-all"
4348    }
4349
4350   }[ position ]
4351  };
4352 },
4353
4354 _resolveClassesValues: function( classes, instance ) {
4355  var result = {};
4356  $.each( classes, function( key ) {
4357   var current = instance.options.classes[ key ] || "";
4358   current = $.trim( current.replace( controlgroupCornerRegex, "" ) );
4359   result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
4360  } );
4361  return result;
4362 },
4363
4364 _setOption: function( key, value ) {
4365  if ( key === "direction" ) {
4366   this._removeClass( "ui-controlgroup-" + this.options.direction );
4367  }
4368
4369  this._super( key, value );
4370  if ( key === "disabled" ) {
4371   this._callChildMethod( value ? "disable" : "enable" );
4372   return;
4373  }
4374
4375  this.refresh();
4376 },
4377
4378 refresh: function() {
4379  var children,
4380   that = this;
4381
4382  this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction );
4383
4384  if ( this.options.direction === "horizontal" ) {
4385   this._addClass( null, "ui-helper-clearfix" );
4386  }
4387  this._initWidgets();
4388
4389  children = this.childWidgets;
4390
4391  // We filter here because we need to track all childWidgets not just the visible ones
4392  if ( this.options.onlyVisible ) {
4393   children = children.filter( ":visible" );
4394  }
4395
4396  if ( children.length ) {
4397
4398   // We do this last because we need to make sure all enhancment is done
4399   // before determining first and last
4400   $.each( [ "first", "last" ], function( index, value ) {
4401    var instance = children[ value ]().data( "ui-controlgroup-data" );
4402
4403    if ( instance && that[ "_" + instance.widgetName + "Options" ] ) {
4404     var options = that[ "_" + instance.widgetName + "Options" ](
4405      children.length === 1 ? "only" : value
4406     );
4407     options.classes = that._resolveClassesValues( options.classes, instance );
4408     instance.element[ instance.widgetName ]( options );
4409    } else {
4410     that._updateCornerClass( children[ value ](), value );
4411    }
4412   } );
4413
4414   // Finally call the refresh method on each of the child widgets.
4415   this._callChildMethod( "refresh" );
4416  }
4417 }
4418} );
4419
4420/*!
4421 * jQuery UI Checkboxradio 1.12.1
4422 * http://jqueryui.com
4423 *
4424 * Copyright jQuery Foundation and other contributors
4425 * Released under the MIT license.
4426 * http://jquery.org/license
4427 */
4428
4429//>>label: Checkboxradio
4430//>>group: Widgets
4431//>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
4432//>>docs: http://api.jqueryui.com/checkboxradio/
4433//>>demos: http://jqueryui.com/checkboxradio/
4434//>>css.structure: ../../themes/base/core.css
4435//>>css.structure: ../../themes/base/button.css
4436//>>css.structure: ../../themes/base/checkboxradio.css
4437//>>css.theme: ../../themes/base/theme.css
4438
4439
4440
4441$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
4442 version: "1.12.1",
4443 options: {
4444  disabled: null,
4445  label: null,
4446  icon: true,
4447  classes: {
4448   "ui-checkboxradio-label": "ui-corner-all",
4449   "ui-checkboxradio-icon": "ui-corner-all"
4450  }
4451 },
4452
4453 _getCreateOptions: function() {
4454  var disabled, labels;
4455  var that = this;
4456  var options = this._super() || {};
4457
4458  // We read the type here, because it makes more sense to throw a element type error first,
4459  // rather then the error for lack of a label. Often if its the wrong type, it
4460  // won't have a label (e.g. calling on a div, btn, etc)
4461  this._readType();
4462
4463  labels = this.element.labels();
4464
4465  // If there are multiple labels, use the last one
4466  this.label = $( labels[ labels.length - 1 ] );
4467  if ( !this.label.length ) {
4468   $.error( "No label found for checkboxradio widget" );
4469  }
4470
4471  this.originalLabel = "";
4472
4473  // We need to get the label text but this may also need to make sure it does not contain the
4474  // input itself.
4475  this.label.contents().not( this.element[ 0 ] ).each( function() {
4476
4477   // The label contents could be text, html, or a mix. We concat each element to get a
4478   // string representation of the label, without the input as part of it.
4479   that.originalLabel += this.nodeType === 3 ? $( this ).text() : this.outerHTML;
4480  } );
4481
4482  // Set the label option if we found label text
4483  if ( this.originalLabel ) {
4484   options.label = this.originalLabel;
4485  }
4486
4487  disabled = this.element[ 0 ].disabled;
4488  if ( disabled != null ) {
4489   options.disabled = disabled;
4490  }
4491  return options;
4492 },
4493
4494 _create: function() {
4495  var checked = this.element[ 0 ].checked;
4496
4497  this._bindFormResetHandler();
4498
4499  if ( this.options.disabled == null ) {
4500   this.options.disabled = this.element[ 0 ].disabled;
4501  }
4502
4503  this._setOption( "disabled", this.options.disabled );
4504  this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" );
4505  this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" );
4506
4507  if ( this.type === "radio" ) {
4508   this._addClass( this.label, "ui-checkboxradio-radio-label" );
4509  }
4510
4511  if ( this.options.label && this.options.label !== this.originalLabel ) {
4512   this._updateLabel();
4513  } else if ( this.originalLabel ) {
4514   this.options.label = this.originalLabel;
4515  }
4516
4517  this._enhance();
4518
4519  if ( checked ) {
4520   this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
4521   if ( this.icon ) {
4522    this._addClass( this.icon, null, "ui-state-hover" );
4523   }
4524  }
4525
4526  this._on( {
4527   change: "_toggleClasses",
4528   focus: function() {
4529    this._addClass( this.label, null, "ui-state-focus ui-visual-focus" );
4530   },
4531   blur: function() {
4532    this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" );
4533   }
4534  } );
4535 },
4536
4537 _readType: function() {
4538  var nodeName = this.element[ 0 ].nodeName.toLowerCase();
4539  this.type = this.element[ 0 ].type;
4540  if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) {
4541   $.error( "Can't create checkboxradio on element.nodeName=" + nodeName +
4542    " and element.type=" + this.type );
4543  }
4544 },
4545
4546 // Support jQuery Mobile enhanced option
4547 _enhance: function() {
4548  this._updateIcon( this.element[ 0 ].checked );
4549 },
4550
4551 widget: function() {
4552  return this.label;
4553 },
4554
4555 _getRadioGroup: function() {
4556  var group;
4557  var name = this.element[ 0 ].name;
4558  var nameSelector = "input[name='" + $.ui.escapeSelector( name ) + "']";
4559
4560  if ( !name ) {
4561   return $( [] );
4562  }
4563
4564  if ( this.form.length ) {
4565   group = $( this.form[ 0 ].elements ).filter( nameSelector );
4566  } else {
4567
4568   // Not inside a form, check all inputs that also are not inside a form
4569   group = $( nameSelector ).filter( function() {
4570    return $( this ).form().length === 0;
4571   } );
4572  }
4573
4574  return group.not( this.element );
4575 },
4576
4577 _toggleClasses: function() {
4578  var checked = this.element[ 0 ].checked;
4579  this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
4580
4581  if ( this.options.icon && this.type === "checkbox" ) {
4582   this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked )
4583    ._toggleClass( this.icon, null, "ui-icon-blank", !checked );
4584  }
4585
4586  if ( this.type === "radio" ) {
4587   this._getRadioGroup()
4588    .each( function() {
4589     var instance = $( this ).checkboxradio( "instance" );
4590
4591     if ( instance ) {
4592      instance._removeClass( instance.label,
4593       "ui-checkboxradio-checked", "ui-state-active" );
4594     }
4595    } );
4596  }
4597 },
4598
4599 _destroy: function() {
4600  this._unbindFormResetHandler();
4601
4602  if ( this.icon ) {
4603   this.icon.remove();
vendor: 4,370 bytes, lines 4604-4773
4604   this.iconSpace.remove();
4605  }
4606 },
4607
4608 _setOption: function( key, value ) {
4609
4610  // We don't allow the value to be set to nothing
4611  if ( key === "label" && !value ) {
4612   return;
4613  }
4614
4615  this._super( key, value );
4616
4617  if ( key === "disabled" ) {
4618   this._toggleClass( this.label, null, "ui-state-disabled", value );
4619   this.element[ 0 ].disabled = value;
4620
4621   // Don't refresh when setting disabled
4622   return;
4623  }
4624  this.refresh();
4625 },
4626
4627 _updateIcon: function( checked ) {
4628  var toAdd = "ui-icon ui-icon-background ";
4629
4630  if ( this.options.icon ) {
4631   if ( !this.icon ) {
4632    this.icon = $( "<span>" );
4633    this.iconSpace = $( "<span> </span>" );
4634    this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" );
4635   }
4636
4637   if ( this.type === "checkbox" ) {
4638    toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank";
4639    this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" );
4640   } else {
4641    toAdd += "ui-icon-blank";
4642   }
4643   this._addClass( this.icon, "ui-checkboxradio-icon", toAdd );
4644   if ( !checked ) {
4645    this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" );
4646   }
4647   this.icon.prependTo( this.label ).after( this.iconSpace );
4648  } else if ( this.icon !== undefined ) {
4649   this.icon.remove();
4650   this.iconSpace.remove();
4651   delete this.icon;
4652  }
4653 },
4654
4655 _updateLabel: function() {
4656
4657  // Remove the contents of the label ( minus the icon, icon space, and input )
4658  var contents = this.label.contents().not( this.element[ 0 ] );
4659  if ( this.icon ) {
4660   contents = contents.not( this.icon[ 0 ] );
4661  }
4662  if ( this.iconSpace ) {
4663   contents = contents.not( this.iconSpace[ 0 ] );
4664  }
4665  contents.remove();
4666
4667  this.label.append( this.options.label );
4668 },
4669
4670 refresh: function() {
4671  var checked = this.element[ 0 ].checked,
4672   isDisabled = this.element[ 0 ].disabled;
4673
4674  this._updateIcon( checked );
4675  this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
4676  if ( this.options.label !== null ) {
4677   this._updateLabel();
4678  }
4679
4680  if ( isDisabled !== this.options.disabled ) {
4681   this._setOptions( { "disabled": isDisabled } );
4682  }
4683 }
4684
4685} ] );
4686
4687var widgetsCheckboxradio = $.ui.checkboxradio;
4688
4689
4690/*!
4691 * jQuery UI Button 1.12.1
4692 * http://jqueryui.com
4693 *
4694 * Copyright jQuery Foundation and other contributors
4695 * Released under the MIT license.
4696 * http://jquery.org/license
4697 */
4698
4699//>>label: Button
4700//>>group: Widgets
4701//>>description: Enhances a form with themeable buttons.
4702//>>docs: http://api.jqueryui.com/button/
4703//>>demos: http://jqueryui.com/button/
4704//>>css.structure: ../../themes/base/core.css
4705//>>css.structure: ../../themes/base/button.css
4706//>>css.theme: ../../themes/base/theme.css
4707
4708
4709
4710$.widget( "ui.button", {
4711 version: "1.12.1",
4712 defaultElement: "<button>",
4713 options: {
4714  classes: {
4715   "ui-button": "ui-corner-all"
4716  },
4717  disabled: null,
4718  icon: null,
4719  iconPosition: "beginning",
4720  label: null,
4721  showLabel: true
4722 },
4723
4724 _getCreateOptions: function() {
4725  var disabled,
4726
4727   // This is to support cases like in jQuery Mobile where the base widget does have
4728   // an implementation of _getCreateOptions
4729   options = this._super() || {};
4730
4731  this.isInput = this.element.is( "input" );
4732
4733  disabled = this.element[ 0 ].disabled;
4734  if ( disabled != null ) {
4735   options.disabled = disabled;
4736  }
4737
4738  this.originalLabel = this.isInput ? this.element.val() : this.element.html();
4739  if ( this.originalLabel ) {
4740   options.label = this.originalLabel;
4741  }
4742
4743  return options;
4744 },
4745
4746 _create: function() {
4747  if ( !this.option.showLabel & !this.options.icon ) {
4748   this.options.showLabel = true;
4749  }
4750
4751  // We have to check the option again here even though we did in _getCreateOptions,
4752  // because null may have been passed on init which would override what was set in
4753  // _getCreateOptions
4754  if ( this.options.disabled == null ) {
4755   this.options.disabled = this.element[ 0 ].disabled || false;
4756  }
4757
4758  this.hasTitle = !!this.element.attr( "title" );
4759
4760  // Check to see if the label needs to be set or if its already correct
4761  if ( this.options.label && this.options.label !== this.originalLabel ) {
4762   if ( this.isInput ) {
4763    this.element.val( this.options.label );
4764   } else {
4765    this.element.html( this.options.label );
4766   }
4767  }
4768  this._addClass( "ui-button", "ui-widget" );
4769  this._setOption( "disabled", this.options.disabled );
4770  this._enhance();
4771
4772  if ( this.element.is( "a" ) ) {
4773   this._on( {
vendor: 12,041 bytes, lines 4774-5147
4774    "keyup": function( event ) {
4775     if ( event.keyCode === $.ui.keyCode.SPACE ) {
4776      event.preventDefault();
4777
4778      // Support: PhantomJS <= 1.9, IE 8 Only
4779      // If a native click is available use it so we actually cause navigation
4780      // otherwise just trigger a click event
4781      if ( this.element[ 0 ].click ) {
4782       this.element[ 0 ].click();
4783      } else {
4784       this.element.trigger( "click" );
4785      }
4786     }
4787    }
4788   } );
4789  }
4790 },
4791
4792 _enhance: function() {
4793  if ( !this.element.is( "button" ) ) {
4794   this.element.attr( "role", "button" );
4795  }
4796
4797  if ( this.options.icon ) {
4798   this._updateIcon( "icon", this.options.icon );
4799   this._updateTooltip();
4800  }
4801 },
4802
4803 _updateTooltip: function() {
4804  this.title = this.element.attr( "title" );
4805
4806  if ( !this.options.showLabel && !this.title ) {
4807   this.element.attr( "title", this.options.label );
4808  }
4809 },
4810
4811 _updateIcon: function( option, value ) {
4812  var icon = option !== "iconPosition",
4813   position = icon ? this.options.iconPosition : value,
4814   displayBlock = position === "top" || position === "bottom";
4815
4816  // Create icon
4817  if ( !this.icon ) {
4818   this.icon = $( "<span>" );
4819
4820   this._addClass( this.icon, "ui-button-icon", "ui-icon" );
4821
4822   if ( !this.options.showLabel ) {
4823    this._addClass( "ui-button-icon-only" );
4824   }
4825  } else if ( icon ) {
4826
4827   // If we are updating the icon remove the old icon class
4828   this._removeClass( this.icon, null, this.options.icon );
4829  }
4830
4831  // If we are updating the icon add the new icon class
4832  if ( icon ) {
4833   this._addClass( this.icon, null, value );
4834  }
4835
4836  this._attachIcon( position );
4837
4838  // If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove
4839  // the iconSpace if there is one.
4840  if ( displayBlock ) {
4841   this._addClass( this.icon, null, "ui-widget-icon-block" );
4842   if ( this.iconSpace ) {
4843    this.iconSpace.remove();
4844   }
4845  } else {
4846
4847   // Position is beginning or end so remove the ui-widget-icon-block class and add the
4848   // space if it does not exist
4849   if ( !this.iconSpace ) {
4850    this.iconSpace = $( "<span> </span>" );
4851    this._addClass( this.iconSpace, "ui-button-icon-space" );
4852   }
4853   this._removeClass( this.icon, null, "ui-wiget-icon-block" );
4854   this._attachIconSpace( position );
4855  }
4856 },
4857
4858 _destroy: function() {
4859  this.element.removeAttr( "role" );
4860
4861  if ( this.icon ) {
4862   this.icon.remove();
4863  }
4864  if ( this.iconSpace ) {
4865   this.iconSpace.remove();
4866  }
4867  if ( !this.hasTitle ) {
4868   this.element.removeAttr( "title" );
4869  }
4870 },
4871
4872 _attachIconSpace: function( iconPosition ) {
4873  this.icon[ /^(?:end|bottom)/.test( iconPosition ) ? "before" : "after" ]( this.iconSpace );
4874 },
4875
4876 _attachIcon: function( iconPosition ) {
4877  this.element[ /^(?:end|bottom)/.test( iconPosition ) ? "append" : "prepend" ]( this.icon );
4878 },
4879
4880 _setOptions: function( options ) {
4881  var newShowLabel = options.showLabel === undefined ?
4882    this.options.showLabel :
4883    options.showLabel,
4884   newIcon = options.icon === undefined ? this.options.icon : options.icon;
4885
4886  if ( !newShowLabel && !newIcon ) {
4887   options.showLabel = true;
4888  }
4889  this._super( options );
4890 },
4891
4892 _setOption: function( key, value ) {
4893  if ( key === "icon" ) {
4894   if ( value ) {
4895    this._updateIcon( key, value );
4896   } else if ( this.icon ) {
4897    this.icon.remove();
4898    if ( this.iconSpace ) {
4899     this.iconSpace.remove();
4900    }
4901   }
4902  }
4903
4904  if ( key === "iconPosition" ) {
4905   this._updateIcon( key, value );
4906  }
4907
4908  // Make sure we can't end up with a button that has neither text nor icon
4909  if ( key === "showLabel" ) {
4910    this._toggleClass( "ui-button-icon-only", null, !value );
4911    this._updateTooltip();
4912  }
4913
4914  if ( key === "label" ) {
4915   if ( this.isInput ) {
4916    this.element.val( value );
4917   } else {
4918
4919    // If there is an icon, append it, else nothing then append the value
4920    // this avoids removal of the icon when setting label text
4921    this.element.html( value );
4922    if ( this.icon ) {
4923     this._attachIcon( this.options.iconPosition );
4924     this._attachIconSpace( this.options.iconPosition );
4925    }
4926   }
4927  }
4928
4929  this._super( key, value );
4930
4931  if ( key === "disabled" ) {
4932   this._toggleClass( null, "ui-state-disabled", value );
4933   this.element[ 0 ].disabled = value;
4934   if ( value ) {
4935    this.element.blur();
4936   }
4937  }
4938 },
4939
4940 refresh: function() {
4941
4942  // Make sure to only check disabled if its an element that supports this otherwise
4943  // check for the disabled class to determine state
4944  var isDisabled = this.element.is( "input, button" ) ?
4945   this.element[ 0 ].disabled : this.element.hasClass( "ui-button-disabled" );
4946
4947  if ( isDisabled !== this.options.disabled ) {
4948   this._setOptions( { disabled: isDisabled } );
4949  }
4950
4951  this._updateTooltip();
4952 }
4953} );
4954
4955// DEPRECATED
4956if ( $.uiBackCompat !== false ) {
4957
4958 // Text and Icons options
4959 $.widget( "ui.button", $.ui.button, {
4960  options: {
4961   text: true,
4962   icons: {
4963    primary: null,
4964    secondary: null
4965   }
4966  },
4967
4968  _create: function() {
4969   if ( this.options.showLabel && !this.options.text ) {
4970    this.options.showLabel = this.options.text;
4971   }
4972   if ( !this.options.showLabel && this.options.text ) {
4973    this.options.text = this.options.showLabel;
4974   }
4975   if ( !this.options.icon && ( this.options.icons.primary ||
4976     this.options.icons.secondary ) ) {
4977    if ( this.options.icons.primary ) {
4978     this.options.icon = this.options.icons.primary;
4979    } else {
4980     this.options.icon = this.options.icons.secondary;
4981     this.options.iconPosition = "end";
4982    }
4983   } else if ( this.options.icon ) {
4984    this.options.icons.primary = this.options.icon;
4985   }
4986   this._super();
4987  },
4988
4989  _setOption: function( key, value ) {
4990   if ( key === "text" ) {
4991    this._super( "showLabel", value );
4992    return;
4993   }
4994   if ( key === "showLabel" ) {
4995    this.options.text = value;
4996   }
4997   if ( key === "icon" ) {
4998    this.options.icons.primary = value;
4999   }
5000   if ( key === "icons" ) {
5001    if ( value.primary ) {
5002     this._super( "icon", value.primary );
5003     this._super( "iconPosition", "beginning" );
5004    } else if ( value.secondary ) {
5005     this._super( "icon", value.secondary );
5006     this._super( "iconPosition", "end" );
5007    }
5008   }
5009   this._superApply( arguments );
5010  }
5011 } );
5012
5013 $.fn.button = ( function( orig ) {
5014  return function() {
5015   if ( !this.length || ( this.length && this[ 0 ].tagName !== "INPUT" ) ||
5016     ( this.length && this[ 0 ].tagName === "INPUT" && (
5017      this.attr( "type" ) !== "checkbox" && this.attr( "type" ) !== "radio"
5018     ) ) ) {
5019    return orig.apply( this, arguments );
5020   }
5021   if ( !$.ui.checkboxradio ) {
5022    $.error( "Checkboxradio widget missing" );
5023   }
5024   if ( arguments.length === 0 ) {
5025    return this.checkboxradio( {
5026     "icon": false
5027    } );
5028   }
5029   return this.checkboxradio.apply( this, arguments );
5030  };
5031 } )( $.fn.button );
5032
5033 $.fn.buttonset = function() {
5034  if ( !$.ui.controlgroup ) {
5035   $.error( "Controlgroup widget missing" );
5036  }
5037  if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" && arguments[ 2 ] ) {
5038   return this.controlgroup.apply( this,
5039    [ arguments[ 0 ], "items.button", arguments[ 2 ] ] );
5040  }
5041  if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" ) {
5042   return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button" ] );
5043  }
5044  if ( typeof arguments[ 0 ] === "object" && arguments[ 0 ].items ) {
5045   arguments[ 0 ].items = {
5046    button: arguments[ 0 ].items
5047   };
5048  }
5049  return this.controlgroup.apply( this, arguments );
5050 };
5051}
5052
5053var widgetsButton = $.ui.button;
5054
5055
5056// jscs:disable maximumLineLength
5057/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
5058/*!
5059 * jQuery UI Datepicker 1.12.1
5060 * http://jqueryui.com
5061 *
5062 * Copyright jQuery Foundation and other contributors
5063 * Released under the MIT license.
5064 * http://jquery.org/license
5065 */
5066
5067//>>label: Datepicker
5068//>>group: Widgets
5069//>>description: Displays a calendar from an input or inline for selecting dates.
5070//>>docs: http://api.jqueryui.com/datepicker/
5071//>>demos: http://jqueryui.com/datepicker/
5072//>>css.structure: ../../themes/base/core.css
5073//>>css.structure: ../../themes/base/datepicker.css
5074//>>css.theme: ../../themes/base/theme.css
5075
5076
5077
5078$.extend( $.ui, { datepicker: { version: "1.12.1" } } );
5079
5080var datepicker_instActive;
5081
5082function datepicker_getZindex( elem ) {
5083 var position, value;
5084 while ( elem.length && elem[ 0 ] !== document ) {
5085
5086  // Ignore z-index if position is set to a value where z-index is ignored by the browser
5087  // This makes behavior of this function consistent across browsers
5088  // WebKit always returns auto if the element is positioned
5089  position = elem.css( "position" );
5090  if ( position === "absolute" || position === "relative" || position === "fixed" ) {
5091
5092   // IE returns 0 when zIndex is not specified
5093   // other browsers return a string
5094   // we ignore the case of nested elements with an explicit value of 0
5095   // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
5096   value = parseInt( elem.css( "zIndex" ), 10 );
5097   if ( !isNaN( value ) && value !== 0 ) {
5098    return value;
5099   }
5100  }
5101  elem = elem.parent();
5102 }
5103
5104 return 0;
5105}
5106/* Date picker manager.
5107   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
5108   Settings for (groups of) date pickers are maintained in an instance object,
5109   allowing multiple different settings on the same page. */
5110
5111function Datepicker() {
5112 this._curInst = null; // The current instance in use
5113 this._keyEvent = false; // If the last event was a key event
5114 this._disabledInputs = []; // List of date picker inputs that have been disabled
5115 this._datepickerShowing = false; // True if the popup picker is showing , false if not
5116 this._inDialog = false; // True if showing within a "dialog", false if not
5117 this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
5118 this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
5119 this._appendClass = "ui-datepicker-append"; // The name of the append marker class
5120 this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
5121 this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
5122 this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
5123 this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
5124 this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
5125 this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
5126 this.regional = []; // Available regional settings, indexed by language code
5127 this.regional[ "" ] = { // Default regional settings
5128  closeText: "Done", // Display text for close link
5129  prevText: "Prev", // Display text for previous month link
5130  nextText: "Next", // Display text for next month link
5131  currentText: "Today", // Display text for current month link
5132  monthNames: [ "January","February","March","April","May","June",
5133   "July","August","September","October","November","December" ], // Names of months for drop-down and formatting
5134  monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting
5135  dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting
5136  dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting
5137  dayNamesMin: [ "Su","Mo","Tu","We","Th","Fr","Sa" ], // Column headings for days starting at Sunday
5138  weekHeader: "Wk", // Column header for week of the year
5139  dateFormat: "mm/dd/yy", // See format options on parseDate
5140  firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
5141  isRTL: false, // True if right-to-left language, false if left-to-right
5142  showMonthAfterYear: false, // True if the year select precedes month, false for month then year
5143  yearSuffix: "" // Additional text to append to the year in the month headers
5144 };
5145 this._defaults = { // Global defaults for all the date picker instances
5146  showOn: "focus", // "focus" for popup on focus,
5147   // "button" for trigger button, or "both" for either
vendor: 6,628 bytes, lines 5148-5280
5148  showAnim: "fadeIn", // Name of jQuery animation for popup
5149  showOptions: {}, // Options for enhanced animations
5150  defaultDate: null, // Used when field is blank: actual date,
5151   // +/-number for offset from today, null for today
5152  appendText: "", // Display text following the input box, e.g. showing the format
5153  buttonText: "...", // Text for trigger button
5154  buttonImage: "", // URL for trigger button image
5155  buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
5156  hideIfNoPrevNext: false, // True to hide next/previous month links
5157   // if not applicable, false to just disable them
5158  navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
5159  gotoCurrent: false, // True if today link goes back to current selection instead
5160  changeMonth: false, // True if month can be selected directly, false if only prev/next
5161  changeYear: false, // True if year can be selected directly, false if only prev/next
5162  yearRange: "c-10:c+10", // Range of years to display in drop-down,
5163   // either relative to today's year (-nn:+nn), relative to currently displayed year
5164   // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
5165  showOtherMonths: false, // True to show dates in other months, false to leave blank
5166  selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
5167  showWeek: false, // True to show week of the year, false to not show it
5168  calculateWeek: this.iso8601Week, // How to calculate the week of the year,
5169   // takes a Date and returns the number of the week for it
5170  shortYearCutoff: "+10", // Short year values < this are in the current century,
5171   // > this are in the previous century,
5172   // string value starting with "+" for current year + value
5173  minDate: null, // The earliest selectable date, or null for no limit
5174  maxDate: null, // The latest selectable date, or null for no limit
5175  duration: "fast", // Duration of display/closure
5176  beforeShowDay: null, // Function that takes a date and returns an array with
5177   // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
5178   // [2] = cell title (optional), e.g. $.datepicker.noWeekends
5179  beforeShow: null, // Function that takes an input field and
5180   // returns a set of custom settings for the date picker
5181  onSelect: null, // Define a callback function when a date is selected
5182  onChangeMonthYear: null, // Define a callback function when the month or year is changed
5183  onClose: null, // Define a callback function when the datepicker is closed
5184  numberOfMonths: 1, // Number of months to show at a time
5185  showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
5186  stepMonths: 1, // Number of months to step back/forward
5187  stepBigMonths: 12, // Number of months to step back/forward for the big links
5188  altField: "", // Selector for an alternate field to store selected dates into
5189  altFormat: "", // The date format to use for the alternate field
5190  constrainInput: true, // The input is constrained by the current date format
5191  showButtonPanel: false, // True to show button panel, false to not show it
5192  autoSize: false, // True to size the input for the date format, false to leave as is
5193  disabled: false // The initial disabled state
5194 };
5195 $.extend( this._defaults, this.regional[ "" ] );
5196 this.regional.en = $.extend( true, {}, this.regional[ "" ] );
5197 this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
5198 this.dpDiv = datepicker_bindHover( $( "<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) );
5199}
5200
5201$.extend( Datepicker.prototype, {
5202 /* Class name added to elements to indicate already configured with a date picker. */
5203 markerClassName: "hasDatepicker",
5204
5205 //Keep track of the maximum number of rows displayed (see #7043)
5206 maxRows: 4,
5207
5208 // TODO rename to "widget" when switching to widget factory
5209 _widgetDatepicker: function() {
5210  return this.dpDiv;
5211 },
5212
5213 /* Override the default settings for all instances of the date picker.
5214  * @param  settings  object - the new settings to use as defaults (anonymous object)
5215  * @return the manager object
5216  */
5217 setDefaults: function( settings ) {
5218  datepicker_extendRemove( this._defaults, settings || {} );
5219  return this;
5220 },
5221
5222 /* Attach the date picker to a jQuery selection.
5223  * @param  target element - the target input field or division or span
5224  * @param  settings  object - the new settings to use for this date picker instance (anonymous)
5225  */
5226 _attachDatepicker: function( target, settings ) {
5227  var nodeName, inline, inst;
5228  nodeName = target.nodeName.toLowerCase();
5229  inline = ( nodeName === "div" || nodeName === "span" );
5230  if ( !target.id ) {
5231   this.uuid += 1;
5232   target.id = "dp" + this.uuid;
5233  }
5234  inst = this._newInst( $( target ), inline );
5235  inst.settings = $.extend( {}, settings || {} );
5236  if ( nodeName === "input" ) {
5237   this._connectDatepicker( target, inst );
5238  } else if ( inline ) {
5239   this._inlineDatepicker( target, inst );
5240  }
5241 },
5242
5243 /* Create a new instance object. */
5244 _newInst: function( target, inline ) {
5245  var id = target[ 0 ].id.replace( /([^A-Za-z0-9_\-])/g, "\\\\$1" ); // escape jQuery meta chars
5246  return { id: id, input: target, // associated target
5247   selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
5248   drawMonth: 0, drawYear: 0, // month being drawn
5249   inline: inline, // is datepicker inline or not
5250   dpDiv: ( !inline ? this.dpDiv : // presentation div
5251   datepicker_bindHover( $( "<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ) ) };
5252 },
5253
5254 /* Attach the date picker to an input field. */
5255 _connectDatepicker: function( target, inst ) {
5256  var input = $( target );
5257  inst.append = $( [] );
5258  inst.trigger = $( [] );
5259  if ( input.hasClass( this.markerClassName ) ) {
5260   return;
5261  }
5262  this._attachments( input, inst );
5263  input.addClass( this.markerClassName ).on( "keydown", this._doKeyDown ).
5264   on( "keypress", this._doKeyPress ).on( "keyup", this._doKeyUp );
5265  this._autoSize( inst );
5266  $.data( target, "datepicker", inst );
5267
5268  //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
5269  if ( inst.settings.disabled ) {
5270   this._disableDatepicker( target );
5271  }
5272 },
5273
5274 /* Make attachments based on settings. */
5275 _attachments: function( input, inst ) {
5276  var showOn, buttonText, buttonImage,
5277   appendText = this._get( inst, "appendText" ),
5278   isRTL = this._get( inst, "isRTL" );
5279
5280  if ( inst.append ) {
vendor: 6,034 bytes, lines 5281-5438
5281   inst.append.remove();
5282  }
5283  if ( appendText ) {
5284   inst.append = $( "<span class='" + this._appendClass + "'>" + appendText + "</span>" );
5285   input[ isRTL ? "before" : "after" ]( inst.append );
5286  }
5287
5288  input.off( "focus", this._showDatepicker );
5289
5290  if ( inst.trigger ) {
5291   inst.trigger.remove();
5292  }
5293
5294  showOn = this._get( inst, "showOn" );
5295  if ( showOn === "focus" || showOn === "both" ) { // pop-up date picker when in the marked field
5296   input.on( "focus", this._showDatepicker );
5297  }
5298  if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked
5299   buttonText = this._get( inst, "buttonText" );
5300   buttonImage = this._get( inst, "buttonImage" );
5301   inst.trigger = $( this._get( inst, "buttonImageOnly" ) ?
5302    $( "<img/>" ).addClass( this._triggerClass ).
5303     attr( { src: buttonImage, alt: buttonText, title: buttonText } ) :
5304    $( "<button type='button'></button>" ).addClass( this._triggerClass ).
5305     html( !buttonImage ? buttonText : $( "<img/>" ).attr(
5306     { src:buttonImage, alt:buttonText, title:buttonText } ) ) );
5307   input[ isRTL ? "before" : "after" ]( inst.trigger );
5308   inst.trigger.on( "click", function() {
5309    if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) {
5310     $.datepicker._hideDatepicker();
5311    } else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) {
5312     $.datepicker._hideDatepicker();
5313     $.datepicker._showDatepicker( input[ 0 ] );
5314    } else {
5315     $.datepicker._showDatepicker( input[ 0 ] );
5316    }
5317    return false;
5318   } );
5319  }
5320 },
5321
5322 /* Apply the maximum length for the date format. */
5323 _autoSize: function( inst ) {
5324  if ( this._get( inst, "autoSize" ) && !inst.inline ) {
5325   var findMax, max, maxI, i,
5326    date = new Date( 2009, 12 - 1, 20 ), // Ensure double digits
5327    dateFormat = this._get( inst, "dateFormat" );
5328
5329   if ( dateFormat.match( /[DM]/ ) ) {
5330    findMax = function( names ) {
5331     max = 0;
5332     maxI = 0;
5333     for ( i = 0; i < names.length; i++ ) {
5334      if ( names[ i ].length > max ) {
5335       max = names[ i ].length;
5336       maxI = i;
5337      }
5338     }
5339     return maxI;
5340    };
5341    date.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ?
5342     "monthNames" : "monthNamesShort" ) ) ) );
5343    date.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ?
5344     "dayNames" : "dayNamesShort" ) ) ) + 20 - date.getDay() );
5345   }
5346   inst.input.attr( "size", this._formatDate( inst, date ).length );
5347  }
5348 },
5349
5350 /* Attach an inline date picker to a div. */
5351 _inlineDatepicker: function( target, inst ) {
5352  var divSpan = $( target );
5353  if ( divSpan.hasClass( this.markerClassName ) ) {
5354   return;
5355  }
5356  divSpan.addClass( this.markerClassName ).append( inst.dpDiv );
5357  $.data( target, "datepicker", inst );
5358  this._setDate( inst, this._getDefaultDate( inst ), true );
5359  this._updateDatepicker( inst );
5360  this._updateAlternate( inst );
5361
5362  //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
5363  if ( inst.settings.disabled ) {
5364   this._disableDatepicker( target );
5365  }
5366
5367  // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
5368  // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
5369  inst.dpDiv.css( "display", "block" );
5370 },
5371
5372 /* Pop-up the date picker in a "dialog" box.
5373  * @param  input element - ignored
5374  * @param  date string or Date - the initial date to display
5375  * @param  onSelect  function - the function to call when a date is selected
5376  * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
5377  * @param  pos int[2] - coordinates for the dialog's position within the screen or
5378  *     event - with x/y coordinates or
5379  *     leave empty for default (screen centre)
5380  * @return the manager object
5381  */
5382 _dialogDatepicker: function( input, date, onSelect, settings, pos ) {
5383  var id, browserWidth, browserHeight, scrollX, scrollY,
5384   inst = this._dialogInst; // internal instance
5385
5386  if ( !inst ) {
5387   this.uuid += 1;
5388   id = "dp" + this.uuid;
5389   this._dialogInput = $( "<input type='text' id='" + id +
5390    "' style='position: absolute; top: -100px; width: 0px;'/>" );
5391   this._dialogInput.on( "keydown", this._doKeyDown );
5392   $( "body" ).append( this._dialogInput );
5393   inst = this._dialogInst = this._newInst( this._dialogInput, false );
5394   inst.settings = {};
5395   $.data( this._dialogInput[ 0 ], "datepicker", inst );
5396  }
5397  datepicker_extendRemove( inst.settings, settings || {} );
5398  date = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date );
5399  this._dialogInput.val( date );
5400
5401  this._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null );
5402  if ( !this._pos ) {
5403   browserWidth = document.documentElement.clientWidth;
5404   browserHeight = document.documentElement.clientHeight;
5405   scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
5406   scrollY = document.documentElement.scrollTop || document.body.scrollTop;
5407   this._pos = // should use actual width/height below
5408    [ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ];
5409  }
5410
5411  // Move input on screen for focus, but hidden behind dialog
5412  this._dialogInput.css( "left", ( this._pos[ 0 ] + 20 ) + "px" ).css( "top", this._pos[ 1 ] + "px" );
5413  inst.settings.onSelect = onSelect;
5414  this._inDialog = true;
5415  this.dpDiv.addClass( this._dialogClass );
5416  this._showDatepicker( this._dialogInput[ 0 ] );
5417  if ( $.blockUI ) {
5418   $.blockUI( this.dpDiv );
5419  }
5420  $.data( this._dialogInput[ 0 ], "datepicker", inst );
5421  return this;
5422 },
5423
5424 /* Detach a datepicker from its control.
5425  * @param  target element - the target input field or division or span
5426  */
5427 _destroyDatepicker: function( target ) {
5428  var nodeName,
5429   $target = $( target ),
5430   inst = $.data( target, "datepicker" );
5431
5432  if ( !$target.hasClass( this.markerClassName ) ) {
5433   return;
5434  }
5435
5436  nodeName = target.nodeName.toLowerCase();
5437  $.removeData( target, "datepicker" );
5438  if ( nodeName === "input" ) {
vendor: 7,135 bytes, lines 5439-5651
5439   inst.append.remove();
5440   inst.trigger.remove();
5441   $target.removeClass( this.markerClassName ).
5442    off( "focus", this._showDatepicker ).
5443    off( "keydown", this._doKeyDown ).
5444    off( "keypress", this._doKeyPress ).
5445    off( "keyup", this._doKeyUp );
5446  } else if ( nodeName === "div" || nodeName === "span" ) {
5447   $target.removeClass( this.markerClassName ).empty();
5448  }
5449
5450  if ( datepicker_instActive === inst ) {
5451   datepicker_instActive = null;
5452  }
5453 },
5454
5455 /* Enable the date picker to a jQuery selection.
5456  * @param  target element - the target input field or division or span
5457  */
5458 _enableDatepicker: function( target ) {
5459  var nodeName, inline,
5460   $target = $( target ),
5461   inst = $.data( target, "datepicker" );
5462
5463  if ( !$target.hasClass( this.markerClassName ) ) {
5464   return;
5465  }
5466
5467  nodeName = target.nodeName.toLowerCase();
5468  if ( nodeName === "input" ) {
5469   target.disabled = false;
5470   inst.trigger.filter( "button" ).
5471    each( function() { this.disabled = false; } ).end().
5472    filter( "img" ).css( { opacity: "1.0", cursor: "" } );
5473  } else if ( nodeName === "div" || nodeName === "span" ) {
5474   inline = $target.children( "." + this._inlineClass );
5475   inline.children().removeClass( "ui-state-disabled" );
5476   inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
5477    prop( "disabled", false );
5478  }
5479  this._disabledInputs = $.map( this._disabledInputs,
5480   function( value ) { return ( value === target ? null : value ); } ); // delete entry
5481 },
5482
5483 /* Disable the date picker to a jQuery selection.
5484  * @param  target element - the target input field or division or span
5485  */
5486 _disableDatepicker: function( target ) {
5487  var nodeName, inline,
5488   $target = $( target ),
5489   inst = $.data( target, "datepicker" );
5490
5491  if ( !$target.hasClass( this.markerClassName ) ) {
5492   return;
5493  }
5494
5495  nodeName = target.nodeName.toLowerCase();
5496  if ( nodeName === "input" ) {
5497   target.disabled = true;
5498   inst.trigger.filter( "button" ).
5499    each( function() { this.disabled = true; } ).end().
5500    filter( "img" ).css( { opacity: "0.5", cursor: "default" } );
5501  } else if ( nodeName === "div" || nodeName === "span" ) {
5502   inline = $target.children( "." + this._inlineClass );
5503   inline.children().addClass( "ui-state-disabled" );
5504   inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
5505    prop( "disabled", true );
5506  }
5507  this._disabledInputs = $.map( this._disabledInputs,
5508   function( value ) { return ( value === target ? null : value ); } ); // delete entry
5509  this._disabledInputs[ this._disabledInputs.length ] = target;
5510 },
5511
5512 /* Is the first field in a jQuery collection disabled as a datepicker?
5513  * @param  target element - the target input field or division or span
5514  * @return boolean - true if disabled, false if enabled
5515  */
5516 _isDisabledDatepicker: function( target ) {
5517  if ( !target ) {
5518   return false;
5519  }
5520  for ( var i = 0; i < this._disabledInputs.length; i++ ) {
5521   if ( this._disabledInputs[ i ] === target ) {
5522    return true;
5523   }
5524  }
5525  return false;
5526 },
5527
5528 /* Retrieve the instance data for the target control.
5529  * @param  target  element - the target input field or division or span
5530  * @return  object - the associated instance data
5531  * @throws  error if a jQuery problem getting data
5532  */
5533 _getInst: function( target ) {
5534  try {
5535   return $.data( target, "datepicker" );
5536  }
5537  catch ( err ) {
5538   throw "Missing instance data for this datepicker";
5539  }
5540 },
5541
5542 /* Update or retrieve the settings for a date picker attached to an input field or division.
5543  * @param  target  element - the target input field or division or span
5544  * @param  name object - the new settings to update or
5545  *    string - the name of the setting to change or retrieve,
5546  *    when retrieving also "all" for all instance settings or
5547  *    "defaults" for all global defaults
5548  * @param  value   any - the new value for the setting
5549  *    (omit if above is an object or to retrieve a value)
5550  */
5551 _optionDatepicker: function( target, name, value ) {
5552  var settings, date, minDate, maxDate,
5553   inst = this._getInst( target );
5554
5555  if ( arguments.length === 2 && typeof name === "string" ) {
5556   return ( name === "defaults" ? $.extend( {}, $.datepicker._defaults ) :
5557    ( inst ? ( name === "all" ? $.extend( {}, inst.settings ) :
5558    this._get( inst, name ) ) : null ) );
5559  }
5560
5561  settings = name || {};
5562  if ( typeof name === "string" ) {
5563   settings = {};
5564   settings[ name ] = value;
5565  }
5566
5567  if ( inst ) {
5568   if ( this._curInst === inst ) {
5569    this._hideDatepicker();
5570   }
5571
5572   date = this._getDateDatepicker( target, true );
5573   minDate = this._getMinMaxDate( inst, "min" );
5574   maxDate = this._getMinMaxDate( inst, "max" );
5575   datepicker_extendRemove( inst.settings, settings );
5576
5577   // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
5578   if ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) {
5579    inst.settings.minDate = this._formatDate( inst, minDate );
5580   }
5581   if ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) {
5582    inst.settings.maxDate = this._formatDate( inst, maxDate );
5583   }
5584   if ( "disabled" in settings ) {
5585    if ( settings.disabled ) {
5586     this._disableDatepicker( target );
5587    } else {
5588     this._enableDatepicker( target );
5589    }
5590   }
5591   this._attachments( $( target ), inst );
5592   this._autoSize( inst );
5593   this._setDate( inst, date );
5594   this._updateAlternate( inst );
5595   this._updateDatepicker( inst );
5596  }
5597 },
5598
5599 // Change method deprecated
5600 _changeDatepicker: function( target, name, value ) {
5601  this._optionDatepicker( target, name, value );
5602 },
5603
5604 /* Redraw the date picker attached to an input field or division.
5605  * @param  target  element - the target input field or division or span
5606  */
5607 _refreshDatepicker: function( target ) {
5608  var inst = this._getInst( target );
5609  if ( inst ) {
5610   this._updateDatepicker( inst );
5611  }
5612 },
5613
5614 /* Set the dates for a jQuery selection.
5615  * @param  target element - the target input field or division or span
5616  * @param  date Date - the new date
5617  */
5618 _setDateDatepicker: function( target, date ) {
5619  var inst = this._getInst( target );
5620  if ( inst ) {
5621   this._setDate( inst, date );
5622   this._updateDatepicker( inst );
5623   this._updateAlternate( inst );
5624  }
5625 },
5626
5627 /* Get the date(s) for the first entry in a jQuery selection.
5628  * @param  target element - the target input field or division or span
5629  * @param  noDefault boolean - true if no default date is to be used
5630  * @return Date - the current date
5631  */
5632 _getDateDatepicker: function( target, noDefault ) {
5633  var inst = this._getInst( target );
5634  if ( inst && !inst.inline ) {
5635   this._setDateFromField( inst, noDefault );
5636  }
5637  return ( inst ? this._getDate( inst ) : null );
5638 },
5639
5640 /* Handle keystrokes. */
5641 _doKeyDown: function( event ) {
5642  var onSelect, dateStr, sel,
5643   inst = $.datepicker._getInst( event.target ),
5644   handled = true,
5645   isRTL = inst.dpDiv.is( ".ui-datepicker-rtl" );
5646
5647  inst._keyEvent = true;
5648  if ( $.datepicker._datepickerShowing ) {
5649   switch ( event.keyCode ) {
5650    case 9: $.datepicker._hideDatepicker();
5651      handled = false;
vendor: 4,635 bytes, lines 5652-5779
5652      break; // hide on tab out
5653    case 13: sel = $( "td." + $.datepicker._dayOverClass + ":not(." +
5654         $.datepicker._currentClass + ")", inst.dpDiv );
5655      if ( sel[ 0 ] ) {
5656       $.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] );
5657      }
5658
5659      onSelect = $.datepicker._get( inst, "onSelect" );
5660      if ( onSelect ) {
5661       dateStr = $.datepicker._formatDate( inst );
5662
5663       // Trigger custom callback
5664       onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );
5665      } else {
5666       $.datepicker._hideDatepicker();
5667      }
5668
5669      return false; // don't submit the form
5670    case 27: $.datepicker._hideDatepicker();
5671      break; // hide on escape
5672    case 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
5673       -$.datepicker._get( inst, "stepBigMonths" ) :
5674       -$.datepicker._get( inst, "stepMonths" ) ), "M" );
5675      break; // previous month/year on page up/+ ctrl
5676    case 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
5677       +$.datepicker._get( inst, "stepBigMonths" ) :
5678       +$.datepicker._get( inst, "stepMonths" ) ), "M" );
5679      break; // next month/year on page down/+ ctrl
5680    case 35: if ( event.ctrlKey || event.metaKey ) {
5681       $.datepicker._clearDate( event.target );
5682      }
5683      handled = event.ctrlKey || event.metaKey;
5684      break; // clear on ctrl or command +end
5685    case 36: if ( event.ctrlKey || event.metaKey ) {
5686       $.datepicker._gotoToday( event.target );
5687      }
5688      handled = event.ctrlKey || event.metaKey;
5689      break; // current on ctrl or command +home
5690    case 37: if ( event.ctrlKey || event.metaKey ) {
5691       $.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), "D" );
5692      }
5693      handled = event.ctrlKey || event.metaKey;
5694
5695      // -1 day on ctrl or command +left
5696      if ( event.originalEvent.altKey ) {
5697       $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
5698        -$.datepicker._get( inst, "stepBigMonths" ) :
5699        -$.datepicker._get( inst, "stepMonths" ) ), "M" );
5700      }
5701
5702      // next month/year on alt +left on Mac
5703      break;
5704    case 38: if ( event.ctrlKey || event.metaKey ) {
5705       $.datepicker._adjustDate( event.target, -7, "D" );
5706      }
5707      handled = event.ctrlKey || event.metaKey;
5708      break; // -1 week on ctrl or command +up
5709    case 39: if ( event.ctrlKey || event.metaKey ) {
5710       $.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), "D" );
5711      }
5712      handled = event.ctrlKey || event.metaKey;
5713
5714      // +1 day on ctrl or command +right
5715      if ( event.originalEvent.altKey ) {
5716       $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
5717        +$.datepicker._get( inst, "stepBigMonths" ) :
5718        +$.datepicker._get( inst, "stepMonths" ) ), "M" );
5719      }
5720
5721      // next month/year on alt +right
5722      break;
5723    case 40: if ( event.ctrlKey || event.metaKey ) {
5724       $.datepicker._adjustDate( event.target, +7, "D" );
5725      }
5726      handled = event.ctrlKey || event.metaKey;
5727      break; // +1 week on ctrl or command +down
5728    default: handled = false;
5729   }
5730  } else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home
5731   $.datepicker._showDatepicker( this );
5732  } else {
5733   handled = false;
5734  }
5735
5736  if ( handled ) {
5737   event.preventDefault();
5738   event.stopPropagation();
5739  }
5740 },
5741
5742 /* Filter entered characters - based on date format. */
5743 _doKeyPress: function( event ) {
5744  var chars, chr,
5745   inst = $.datepicker._getInst( event.target );
5746
5747  if ( $.datepicker._get( inst, "constrainInput" ) ) {
5748   chars = $.datepicker._possibleChars( $.datepicker._get( inst, "dateFormat" ) );
5749   chr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode );
5750   return event.ctrlKey || event.metaKey || ( chr < " " || !chars || chars.indexOf( chr ) > -1 );
5751  }
5752 },
5753
5754 /* Synchronise manual entry and field/alternate field. */
5755 _doKeyUp: function( event ) {
5756  var date,
5757   inst = $.datepicker._getInst( event.target );
5758
5759  if ( inst.input.val() !== inst.lastVal ) {
5760   try {
5761    date = $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
5762     ( inst.input ? inst.input.val() : null ),
5763     $.datepicker._getFormatConfig( inst ) );
5764
5765    if ( date ) { // only if valid
5766     $.datepicker._setDateFromField( inst );
5767     $.datepicker._updateAlternate( inst );
5768     $.datepicker._updateDatepicker( inst );
5769    }
5770   }
5771   catch ( err ) {
5772   }
5773  }
5774  return true;
5775 },
5776
5777 /* Pop-up the date picker for a given input field.
5778  * If false returned from beforeShow event handler do not show.
5779  * @param  input  element - the input field attached to the date picker or
vendor: 4,259 bytes, lines 5780-5901
5780  *     event - if triggered by focus
5781  */
5782 _showDatepicker: function( input ) {
5783  input = input.target || input;
5784  if ( input.nodeName.toLowerCase() !== "input" ) { // find from button/image trigger
5785   input = $( "input", input.parentNode )[ 0 ];
5786  }
5787
5788  if ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here
5789   return;
5790  }
5791
5792  var inst, beforeShow, beforeShowSettings, isFixed,
5793   offset, showAnim, duration;
5794
5795  inst = $.datepicker._getInst( input );
5796  if ( $.datepicker._curInst && $.datepicker._curInst !== inst ) {
5797   $.datepicker._curInst.dpDiv.stop( true, true );
5798   if ( inst && $.datepicker._datepickerShowing ) {
5799    $.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] );
5800   }
5801  }
5802
5803  beforeShow = $.datepicker._get( inst, "beforeShow" );
5804  beforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {};
5805  if ( beforeShowSettings === false ) {
5806   return;
5807  }
5808  datepicker_extendRemove( inst.settings, beforeShowSettings );
5809
5810  inst.lastVal = null;
5811  $.datepicker._lastInput = input;
5812  $.datepicker._setDateFromField( inst );
5813
5814  if ( $.datepicker._inDialog ) { // hide cursor
5815   input.value = "";
5816  }
5817  if ( !$.datepicker._pos ) { // position below input
5818   $.datepicker._pos = $.datepicker._findPos( input );
5819   $.datepicker._pos[ 1 ] += input.offsetHeight; // add the height
5820  }
5821
5822  isFixed = false;
5823  $( input ).parents().each( function() {
5824   isFixed |= $( this ).css( "position" ) === "fixed";
5825   return !isFixed;
5826  } );
5827
5828  offset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] };
5829  $.datepicker._pos = null;
5830
5831  //to avoid flashes on Firefox
5832  inst.dpDiv.empty();
5833
5834  // determine sizing offscreen
5835  inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px" } );
5836  $.datepicker._updateDatepicker( inst );
5837
5838  // fix width for dynamic number of date pickers
5839  // and adjust position before showing
5840  offset = $.datepicker._checkOffset( inst, offset, isFixed );
5841  inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ?
5842   "static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none",
5843   left: offset.left + "px", top: offset.top + "px" } );
5844
5845  if ( !inst.inline ) {
5846   showAnim = $.datepicker._get( inst, "showAnim" );
5847   duration = $.datepicker._get( inst, "duration" );
5848   inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
5849   $.datepicker._datepickerShowing = true;
5850
5851   if ( $.effects && $.effects.effect[ showAnim ] ) {
5852    inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration );
5853   } else {
5854    inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null );
5855   }
5856
5857   if ( $.datepicker._shouldFocusInput( inst ) ) {
5858    inst.input.trigger( "focus" );
5859   }
5860
5861   $.datepicker._curInst = inst;
5862  }
5863 },
5864
5865 /* Generate the date picker content. */
5866 _updateDatepicker: function( inst ) {
5867  this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
5868  datepicker_instActive = inst; // for delegate hover events
5869  inst.dpDiv.empty().append( this._generateHTML( inst ) );
5870  this._attachHandlers( inst );
5871
5872  var origyearshtml,
5873   numMonths = this._getNumberOfMonths( inst ),
5874   cols = numMonths[ 1 ],
5875   width = 17,
5876   activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
5877
5878  if ( activeCell.length > 0 ) {
5879   datepicker_handleMouseover.apply( activeCell.get( 0 ) );
5880  }
5881
5882  inst.dpDiv.removeClass( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ).width( "" );
5883  if ( cols > 1 ) {
5884   inst.dpDiv.addClass( "ui-datepicker-multi-" + cols ).css( "width", ( width * cols ) + "em" );
5885  }
5886  inst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? "add" : "remove" ) +
5887   "Class" ]( "ui-datepicker-multi" );
5888  inst.dpDiv[ ( this._get( inst, "isRTL" ) ? "add" : "remove" ) +
5889   "Class" ]( "ui-datepicker-rtl" );
5890
5891  if ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
5892   inst.input.trigger( "focus" );
5893  }
5894
5895  // Deffered render of the years select (to avoid flashes on Firefox)
5896  if ( inst.yearshtml ) {
5897   origyearshtml = inst.yearshtml;
5898   setTimeout( function() {
5899
5900    //assure that inst.yearshtml didn't change.
5901    if ( origyearshtml === inst.yearshtml && inst.yearshtml ) {
vendor: 5,480 bytes, lines 5902-6058
5902     inst.dpDiv.find( "select.ui-datepicker-year:first" ).replaceWith( inst.yearshtml );
5903    }
5904    origyearshtml = inst.yearshtml = null;
5905   }, 0 );
5906  }
5907 },
5908
5909 // #6694 - don't focus the input if it's already focused
5910 // this breaks the change event in IE
5911 // Support: IE and jQuery <1.9
5912 _shouldFocusInput: function( inst ) {
5913  return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
5914 },
5915
5916 /* Check positioning to remain on screen. */
5917 _checkOffset: function( inst, offset, isFixed ) {
5918  var dpWidth = inst.dpDiv.outerWidth(),
5919   dpHeight = inst.dpDiv.outerHeight(),
5920   inputWidth = inst.input ? inst.input.outerWidth() : 0,
5921   inputHeight = inst.input ? inst.input.outerHeight() : 0,
5922   viewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ),
5923   viewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() );
5924
5925  offset.left -= ( this._get( inst, "isRTL" ) ? ( dpWidth - inputWidth ) : 0 );
5926  offset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0;
5927  offset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0;
5928
5929  // Now check if datepicker is showing outside window viewport - move to a better place if so.
5930  offset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ?
5931   Math.abs( offset.left + dpWidth - viewWidth ) : 0 );
5932  offset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ?
5933   Math.abs( dpHeight + inputHeight ) : 0 );
5934
5935  return offset;
5936 },
5937
5938 /* Find an object's position on the screen. */
5939 _findPos: function( obj ) {
5940  var position,
5941   inst = this._getInst( obj ),
5942   isRTL = this._get( inst, "isRTL" );
5943
5944  while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden( obj ) ) ) {
5945   obj = obj[ isRTL ? "previousSibling" : "nextSibling" ];
5946  }
5947
5948  position = $( obj ).offset();
5949  return [ position.left, position.top ];
5950 },
5951
5952 /* Hide the date picker from view.
5953  * @param  input  element - the input field attached to the date picker
5954  */
5955 _hideDatepicker: function( input ) {
5956  var showAnim, duration, postProcess, onClose,
5957   inst = this._curInst;
5958
5959  if ( !inst || ( input && inst !== $.data( input, "datepicker" ) ) ) {
5960   return;
5961  }
5962
5963  if ( this._datepickerShowing ) {
5964   showAnim = this._get( inst, "showAnim" );
5965   duration = this._get( inst, "duration" );
5966   postProcess = function() {
5967    $.datepicker._tidyDialog( inst );
5968   };
5969
5970   // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
5971   if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
5972    inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess );
5973   } else {
5974    inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" :
5975     ( showAnim === "fadeIn" ? "fadeOut" : "hide" ) ) ]( ( showAnim ? duration : null ), postProcess );
5976   }
5977
5978   if ( !showAnim ) {
5979    postProcess();
5980   }
5981   this._datepickerShowing = false;
5982
5983   onClose = this._get( inst, "onClose" );
5984   if ( onClose ) {
5985    onClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : "" ), inst ] );
5986   }
5987
5988   this._lastInput = null;
5989   if ( this._inDialog ) {
5990    this._dialogInput.css( { position: "absolute", left: "0", top: "-100px" } );
5991    if ( $.blockUI ) {
5992     $.unblockUI();
5993     $( "body" ).append( this.dpDiv );
5994    }
5995   }
5996   this._inDialog = false;
5997  }
5998 },
5999
6000 /* Tidy up after a dialog display. */
6001 _tidyDialog: function( inst ) {
6002  inst.dpDiv.removeClass( this._dialogClass ).off( ".ui-datepicker-calendar" );
6003 },
6004
6005 /* Close date picker if clicked elsewhere. */
6006 _checkExternalClick: function( event ) {
6007  if ( !$.datepicker._curInst ) {
6008   return;
6009  }
6010
6011  var $target = $( event.target ),
6012   inst = $.datepicker._getInst( $target[ 0 ] );
6013
6014  if ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId &&
6015    $target.parents( "#" + $.datepicker._mainDivId ).length === 0 &&
6016    !$target.hasClass( $.datepicker.markerClassName ) &&
6017    !$target.closest( "." + $.datepicker._triggerClass ).length &&
6018    $.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) ||
6019   ( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) {
6020    $.datepicker._hideDatepicker();
6021  }
6022 },
6023
6024 /* Adjust one of the date sub-fields. */
6025 _adjustDate: function( id, offset, period ) {
6026  var target = $( id ),
6027   inst = this._getInst( target[ 0 ] );
6028
6029  if ( this._isDisabledDatepicker( target[ 0 ] ) ) {
6030   return;
6031  }
6032  this._adjustInstDate( inst, offset +
6033   ( period === "M" ? this._get( inst, "showCurrentAtPos" ) : 0 ), // undo positioning
6034   period );
6035  this._updateDatepicker( inst );
6036 },
6037
6038 /* Action for current link. */
6039 _gotoToday: function( id ) {
6040  var date,
6041   target = $( id ),
6042   inst = this._getInst( target[ 0 ] );
6043
6044  if ( this._get( inst, "gotoCurrent" ) && inst.currentDay ) {
6045   inst.selectedDay = inst.currentDay;
6046   inst.drawMonth = inst.selectedMonth = inst.currentMonth;
6047   inst.drawYear = inst.selectedYear = inst.currentYear;
6048  } else {
6049   date = new Date();
6050   inst.selectedDay = date.getDate();
6051   inst.drawMonth = inst.selectedMonth = date.getMonth();
6052   inst.drawYear = inst.selectedYear = date.getFullYear();
6053  }
6054  this._notifyChange( inst );
6055  this._adjustDate( target );
6056 },
6057
6058 /* Action for selecting a new month/year. */
vendor: 4,573 bytes, lines 6059-6190
6059 _selectMonthYear: function( id, select, period ) {
6060  var target = $( id ),
6061   inst = this._getInst( target[ 0 ] );
6062
6063  inst[ "selected" + ( period === "M" ? "Month" : "Year" ) ] =
6064  inst[ "draw" + ( period === "M" ? "Month" : "Year" ) ] =
6065   parseInt( select.options[ select.selectedIndex ].value, 10 );
6066
6067  this._notifyChange( inst );
6068  this._adjustDate( target );
6069 },
6070
6071 /* Action for selecting a day. */
6072 _selectDay: function( id, month, year, td ) {
6073  var inst,
6074   target = $( id );
6075
6076  if ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) {
6077   return;
6078  }
6079
6080  inst = this._getInst( target[ 0 ] );
6081  inst.selectedDay = inst.currentDay = $( "a", td ).html();
6082  inst.selectedMonth = inst.currentMonth = month;
6083  inst.selectedYear = inst.currentYear = year;
6084  this._selectDate( id, this._formatDate( inst,
6085   inst.currentDay, inst.currentMonth, inst.currentYear ) );
6086 },
6087
6088 /* Erase the input field and hide the date picker. */
6089 _clearDate: function( id ) {
6090  var target = $( id );
6091  this._selectDate( target, "" );
6092 },
6093
6094 /* Update the input field with the selected date. */
6095 _selectDate: function( id, dateStr ) {
6096  var onSelect,
6097   target = $( id ),
6098   inst = this._getInst( target[ 0 ] );
6099
6100  dateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) );
6101  if ( inst.input ) {
6102   inst.input.val( dateStr );
6103  }
6104  this._updateAlternate( inst );
6105
6106  onSelect = this._get( inst, "onSelect" );
6107  if ( onSelect ) {
6108   onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );  // trigger custom callback
6109  } else if ( inst.input ) {
6110   inst.input.trigger( "change" ); // fire the change event
6111  }
6112
6113  if ( inst.inline ) {
6114   this._updateDatepicker( inst );
6115  } else {
6116   this._hideDatepicker();
6117   this._lastInput = inst.input[ 0 ];
6118   if ( typeof( inst.input[ 0 ] ) !== "object" ) {
6119    inst.input.trigger( "focus" ); // restore focus
6120   }
6121   this._lastInput = null;
6122  }
6123 },
6124
6125 /* Update any alternate field to synchronise with the main field. */
6126 _updateAlternate: function( inst ) {
6127  var altFormat, date, dateStr,
6128   altField = this._get( inst, "altField" );
6129
6130  if ( altField ) { // update alternate field too
6131   altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" );
6132   date = this._getDate( inst );
6133   dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );
6134   $( altField ).val( dateStr );
6135  }
6136 },
6137
6138 /* Set as beforeShowDay function to prevent selection of weekends.
6139  * @param  date  Date - the date to customise
6140  * @return [boolean, string] - is this date selectable?, what is its CSS class?
6141  */
6142 noWeekends: function( date ) {
6143  var day = date.getDay();
6144  return [ ( day > 0 && day < 6 ), "" ];
6145 },
6146
6147 /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
6148  * @param  date  Date - the date to get the week for
6149  * @return  number - the number of the week within the year that contains this date
6150  */
6151 iso8601Week: function( date ) {
6152  var time,
6153   checkDate = new Date( date.getTime() );
6154
6155  // Find Thursday of this week starting on Monday
6156  checkDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) );
6157
6158  time = checkDate.getTime();
6159  checkDate.setMonth( 0 ); // Compare with Jan 1
6160  checkDate.setDate( 1 );
6161  return Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1;
6162 },
6163
6164 /* Parse a string value into a date object.
6165  * See formatDate below for the possible formats.
6166  *
6167  * @param  format string - the expected format of the date
6168  * @param  value string - the date in the above format
6169  * @param  settings Object - attributes include:
6170  *     shortYearCutoff  number - the cutoff year for determining the century (optional)
6171  *     dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
6172  *     dayNames  string[7] - names of the days from Sunday (optional)
6173  *     monthNamesShort string[12] - abbreviated names of the months (optional)
6174  *     monthNames  string[12] - names of the months (optional)
6175  * @return  Date - the extracted date value or null if value is blank
6176  */
6177 parseDate: function( format, value, settings ) {
6178  if ( format == null || value == null ) {
6179   throw "Invalid arguments";
6180  }
6181
6182  value = ( typeof value === "object" ? value.toString() : value + "" );
6183  if ( value === "" ) {
6184   return null;
6185  }
6186
6187  var iFormat, dim, extra,
6188   iValue = 0,
6189   shortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff,
6190   shortYearCutoff = ( typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp 
vendor: 16,992 bytes, lines 6190-6720
6190:
6191    new Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ),
6192   dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
6193   dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
6194   monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
6195   monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
6196   year = -1,
6197   month = -1,
6198   day = -1,
6199   doy = -1,
6200   literal = false,
6201   date,
6202
6203   // Check whether a format character is doubled
6204   lookAhead = function( match ) {
6205    var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
6206    if ( matches ) {
6207     iFormat++;
6208    }
6209    return matches;
6210   },
6211
6212   // Extract a number from the string value
6213   getNumber = function( match ) {
6214    var isDoubled = lookAhead( match ),
6215     size = ( match === "@" ? 14 : ( match === "!" ? 20 :
6216     ( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ),
6217     minSize = ( match === "y" ? size : 1 ),
6218     digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ),
6219     num = value.substring( iValue ).match( digits );
6220    if ( !num ) {
6221     throw "Missing number at position " + iValue;
6222    }
6223    iValue += num[ 0 ].length;
6224    return parseInt( num[ 0 ], 10 );
6225   },
6226
6227   // Extract a name from the string value and convert to an index
6228   getName = function( match, shortNames, longNames ) {
6229    var index = -1,
6230     names = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) {
6231      return [ [ k, v ] ];
6232     } ).sort( function( a, b ) {
6233      return -( a[ 1 ].length - b[ 1 ].length );
6234     } );
6235
6236    $.each( names, function( i, pair ) {
6237     var name = pair[ 1 ];
6238     if ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) {
6239      index = pair[ 0 ];
6240      iValue += name.length;
6241      return false;
6242     }
6243    } );
6244    if ( index !== -1 ) {
6245     return index + 1;
6246    } else {
6247     throw "Unknown name at position " + iValue;
6248    }
6249   },
6250
6251   // Confirm that a literal character matches the string value
6252   checkLiteral = function() {
6253    if ( value.charAt( iValue ) !== format.charAt( iFormat ) ) {
6254     throw "Unexpected literal at position " + iValue;
6255    }
6256    iValue++;
6257   };
6258
6259  for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
6260   if ( literal ) {
6261    if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
6262     literal = false;
6263    } else {
6264     checkLiteral();
6265    }
6266   } else {
6267    switch ( format.charAt( iFormat ) ) {
6268     case "d":
6269      day = getNumber( "d" );
6270      break;
6271     case "D":
6272      getName( "D", dayNamesShort, dayNames );
6273      break;
6274     case "o":
6275      doy = getNumber( "o" );
6276      break;
6277     case "m":
6278      month = getNumber( "m" );
6279      break;
6280     case "M":
6281      month = getName( "M", monthNamesShort, monthNames );
6282      break;
6283     case "y":
6284      year = getNumber( "y" );
6285      break;
6286     case "@":
6287      date = new Date( getNumber( "@" ) );
6288      year = date.getFullYear();
6289      month = date.getMonth() + 1;
6290      day = date.getDate();
6291      break;
6292     case "!":
6293      date = new Date( ( getNumber( "!" ) - this._ticksTo1970 ) / 10000 );
6294      year = date.getFullYear();
6295      month = date.getMonth() + 1;
6296      day = date.getDate();
6297      break;
6298     case "'":
6299      if ( lookAhead( "'" ) ) {
6300       checkLiteral();
6301      } else {
6302       literal = true;
6303      }
6304      break;
6305     default:
6306      checkLiteral();
6307    }
6308   }
6309  }
6310
6311  if ( iValue < value.length ) {
6312   extra = value.substr( iValue );
6313   if ( !/^\s+/.test( extra ) ) {
6314    throw "Extra/unparsed characters found in date: " + extra;
6315   }
6316  }
6317
6318  if ( year === -1 ) {
6319   year = new Date().getFullYear();
6320  } else if ( year < 100 ) {
6321   year += new Date().getFullYear() - new Date().getFullYear() % 100 +
6322    ( year <= shortYearCutoff ? 0 : -100 );
6323  }
6324
6325  if ( doy > -1 ) {
6326   month = 1;
6327   day = doy;
6328   do {
6329    dim = this._getDaysInMonth( year, month - 1 );
6330    if ( day <= dim ) {
6331     break;
6332    }
6333    month++;
6334    day -= dim;
6335   } while ( true );
6336  }
6337
6338  date = this._daylightSavingAdjust( new Date( year, month - 1, day ) );
6339  if ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) {
6340   throw "Invalid date"; // E.g. 31/02/00
6341  }
6342  return date;
6343 },
6344
6345 /* Standard date formats. */
6346 ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
6347 COOKIE: "D, dd M yy",
6348 ISO_8601: "yy-mm-dd",
6349 RFC_822: "D, d M y",
6350 RFC_850: "DD, dd-M-y",
6351 RFC_1036: "D, d M y",
6352 RFC_1123: "D, d M yy",
6353 RFC_2822: "D, d M yy",
6354 RSS: "D, d M y", // RFC 822
6355 TICKS: "!",
6356 TIMESTAMP: "@",
6357 W3C: "yy-mm-dd", // ISO 8601
6358
6359 _ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) +
6360  Math.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ),
6361
6362 /* Format a date object into a string value.
6363  * The format can be combinations of the following:
6364  * d  - day of month (no leading zero)
6365  * dd - day of month (two digit)
6366  * o  - day of year (no leading zeros)
6367  * oo - day of year (three digit)
6368  * D  - day name short
6369  * DD - day name long
6370  * m  - month of year (no leading zero)
6371  * mm - month of year (two digit)
6372  * M  - month name short
6373  * MM - month name long
6374  * y  - year (two digit)
6375  * yy - year (four digit)
6376  * @ - Unix timestamp (ms since 01/01/1970)
6377  * ! - Windows ticks (100ns since 01/01/0001)
6378  * "..." - literal text
6379  * '' - single quote
6380  *
6381  * @param  format string - the desired format of the date
6382  * @param  date Date - the date value to format
6383  * @param  settings Object - attributes include:
6384  *     dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
6385  *     dayNames  string[7] - names of the days from Sunday (optional)
6386  *     monthNamesShort string[12] - abbreviated names of the months (optional)
6387  *     monthNames  string[12] - names of the months (optional)
6388  * @return  string - the date in the above format
6389  */
6390 formatDate: function( format, date, settings ) {
6391  if ( !date ) {
6392   return "";
6393  }
6394
6395  var iFormat,
6396   dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
6397   dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
6398   monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
6399   monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
6400
6401   // Check whether a format character is doubled
6402   lookAhead = function( match ) {
6403    var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
6404    if ( matches ) {
6405     iFormat++;
6406    }
6407    return matches;
6408   },
6409
6410   // Format a number, with leading zero if necessary
6411   formatNumber = function( match, value, len ) {
6412    var num = "" + value;
6413    if ( lookAhead( match ) ) {
6414     while ( num.length < len ) {
6415      num = "0" + num;
6416     }
6417    }
6418    return num;
6419   },
6420
6421   // Format a name, short or long as requested
6422   formatName = function( match, value, shortNames, longNames ) {
6423    return ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] );
6424   },
6425   output = "",
6426   literal = false;
6427
6428  if ( date ) {
6429   for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
6430    if ( literal ) {
6431     if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
6432      literal = false;
6433     } else {
6434      output += format.charAt( iFormat );
6435     }
6436    } else {
6437     switch ( format.charAt( iFormat ) ) {
6438      case "d":
6439       output += formatNumber( "d", date.getDate(), 2 );
6440       break;
6441      case "D":
6442       output += formatName( "D", date.getDay(), dayNamesShort, dayNames );
6443       break;
6444      case "o":
6445       output += formatNumber( "o",
6446        Math.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 );
6447       break;
6448      case "m":
6449       output += formatNumber( "m", date.getMonth() + 1, 2 );
6450       break;
6451      case "M":
6452       output += formatName( "M", date.getMonth(), monthNamesShort, monthNames );
6453       break;
6454      case "y":
6455       output += ( lookAhead( "y" ) ? date.getFullYear() :
6456        ( date.getFullYear() % 100 < 10 ? "0" : "" ) + date.getFullYear() % 100 );
6457       break;
6458      case "@":
6459       output += date.getTime();
6460       break;
6461      case "!":
6462       output += date.getTime() * 10000 + this._ticksTo1970;
6463       break;
6464      case "'":
6465       if ( lookAhead( "'" ) ) {
6466        output += "'";
6467       } else {
6468        literal = true;
6469       }
6470       break;
6471      default:
6472       output += format.charAt( iFormat );
6473     }
6474    }
6475   }
6476  }
6477  return output;
6478 },
6479
6480 /* Extract all possible characters from the date format. */
6481 _possibleChars: function( format ) {
6482  var iFormat,
6483   chars = "",
6484   literal = false,
6485
6486   // Check whether a format character is doubled
6487   lookAhead = function( match ) {
6488    var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
6489    if ( matches ) {
6490     iFormat++;
6491    }
6492    return matches;
6493   };
6494
6495  for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
6496   if ( literal ) {
6497    if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
6498     literal = false;
6499    } else {
6500     chars += format.charAt( iFormat );
6501    }
6502   } else {
6503    switch ( format.charAt( iFormat ) ) {
6504     case "d": case "m": case "y": case "@":
6505      chars += "0123456789";
6506      break;
6507     case "D": case "M":
6508      return null; // Accept anything
6509     case "'":
6510      if ( lookAhead( "'" ) ) {
6511       chars += "'";
6512      } else {
6513       literal = true;
6514      }
6515      break;
6516     default:
6517      chars += format.charAt( iFormat );
6518    }
6519   }
6520  }
6521  return chars;
6522 },
6523
6524 /* Get a setting value, defaulting if necessary. */
6525 _get: function( inst, name ) {
6526  return inst.settings[ name ] !== undefined ?
6527   inst.settings[ name ] : this._defaults[ name ];
6528 },
6529
6530 /* Parse existing date and initialise date picker. */
6531 _setDateFromField: function( inst, noDefault ) {
6532  if ( inst.input.val() === inst.lastVal ) {
6533   return;
6534  }
6535
6536  var dateFormat = this._get( inst, "dateFormat" ),
6537   dates = inst.lastVal = inst.input ? inst.input.val() : null,
6538   defaultDate = this._getDefaultDate( inst ),
6539   date = defaultDate,
6540   settings = this._getFormatConfig( inst );
6541
6542  try {
6543   date = this.parseDate( dateFormat, dates, settings ) || defaultDate;
6544  } catch ( event ) {
6545   dates = ( noDefault ? "" : dates );
6546  }
6547  inst.selectedDay = date.getDate();
6548  inst.drawMonth = inst.selectedMonth = date.getMonth();
6549  inst.drawYear = inst.selectedYear = date.getFullYear();
6550  inst.currentDay = ( dates ? date.getDate() : 0 );
6551  inst.currentMonth = ( dates ? date.getMonth() : 0 );
6552  inst.currentYear = ( dates ? date.getFullYear() : 0 );
6553  this._adjustInstDate( inst );
6554 },
6555
6556 /* Retrieve the default date shown on opening. */
6557 _getDefaultDate: function( inst ) {
6558  return this._restrictMinMax( inst,
6559   this._determineDate( inst, this._get( inst, "defaultDate" ), new Date() ) );
6560 },
6561
6562 /* A date may be specified as an exact value or a relative one. */
6563 _determineDate: function( inst, date, defaultDate ) {
6564  var offsetNumeric = function( offset ) {
6565    var date = new Date();
6566    date.setDate( date.getDate() + offset );
6567    return date;
6568   },
6569   offsetString = function( offset ) {
6570    try {
6571     return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
6572      offset, $.datepicker._getFormatConfig( inst ) );
6573    }
6574    catch ( e ) {
6575
6576     // Ignore
6577    }
6578
6579    var date = ( offset.toLowerCase().match( /^c/ ) ?
6580     $.datepicker._getDate( inst ) : null ) || new Date(),
6581     year = date.getFullYear(),
6582     month = date.getMonth(),
6583     day = date.getDate(),
6584     pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
6585     matches = pattern.exec( offset );
6586
6587    while ( matches ) {
6588     switch ( matches[ 2 ] || "d" ) {
6589      case "d" : case "D" :
6590       day += parseInt( matches[ 1 ], 10 ); break;
6591      case "w" : case "W" :
6592       day += parseInt( matches[ 1 ], 10 ) * 7; break;
6593      case "m" : case "M" :
6594       month += parseInt( matches[ 1 ], 10 );
6595       day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
6596       break;
6597      case "y": case "Y" :
6598       year += parseInt( matches[ 1 ], 10 );
6599       day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
6600       break;
6601     }
6602     matches = pattern.exec( offset );
6603    }
6604    return new Date( year, month, day );
6605   },
6606   newDate = ( date == null || date === "" ? defaultDate : ( typeof date === "string" ? offsetString( date ) :
6607    ( typeof date === "number" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) );
6608
6609  newDate = ( newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate );
6610  if ( newDate ) {
6611   newDate.setHours( 0 );
6612   newDate.setMinutes( 0 );
6613   newDate.setSeconds( 0 );
6614   newDate.setMilliseconds( 0 );
6615  }
6616  return this._daylightSavingAdjust( newDate );
6617 },
6618
6619 /* Handle switch to/from daylight saving.
6620  * Hours may be non-zero on daylight saving cut-over:
6621  * > 12 when midnight changeover, but then cannot generate
6622  * midnight datetime, so jump to 1AM, otherwise reset.
6623  * @param  date  (Date) the date to check
6624  * @return  (Date) the corrected date
6625  */
6626 _daylightSavingAdjust: function( date ) {
6627  if ( !date ) {
6628   return null;
6629  }
6630  date.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 );
6631  return date;
6632 },
6633
6634 /* Set the date(s) directly. */
6635 _setDate: function( inst, date, noChange ) {
6636  var clear = !date,
6637   origMonth = inst.selectedMonth,
6638   origYear = inst.selectedYear,
6639   newDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) );
6640
6641  inst.selectedDay = inst.currentDay = newDate.getDate();
6642  inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
6643  inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
6644  if ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) {
6645   this._notifyChange( inst );
6646  }
6647  this._adjustInstDate( inst );
6648  if ( inst.input ) {
6649   inst.input.val( clear ? "" : this._formatDate( inst ) );
6650  }
6651 },
6652
6653 /* Retrieve the date(s) directly. */
6654 _getDate: function( inst ) {
6655  var startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === "" ) ? null :
6656   this._daylightSavingAdjust( new Date(
6657   inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
6658   return startDate;
6659 },
6660
6661 /* Attach the onxxx handlers.  These are declared statically so
6662  * they work with static code transformers like Caja.
6663  */
6664 _attachHandlers: function( inst ) {
6665  var stepMonths = this._get( inst, "stepMonths" ),
6666   id = "#" + inst.id.replace( /\\\\/g, "\\" );
6667  inst.dpDiv.find( "[data-handler]" ).map( function() {
6668   var handler = {
6669    prev: function() {
6670     $.datepicker._adjustDate( id, -stepMonths, "M" );
6671    },
6672    next: function() {
6673     $.datepicker._adjustDate( id, +stepMonths, "M" );
6674    },
6675    hide: function() {
6676     $.datepicker._hideDatepicker();
6677    },
6678    today: function() {
6679     $.datepicker._gotoToday( id );
6680    },
6681    selectDay: function() {
6682     $.datepicker._selectDay( id, +this.getAttribute( "data-month" ), +this.getAttribute( "data-year" ), this );
6683     return false;
6684    },
6685    selectMonth: function() {
6686     $.datepicker._selectMonthYear( id, this, "M" );
6687     return false;
6688    },
6689    selectYear: function() {
6690     $.datepicker._selectMonthYear( id, this, "Y" );
6691     return false;
6692    }
6693   };
6694   $( this ).on( this.getAttribute( "data-event" ), handler[ this.getAttribute( "data-handler" ) ] );
6695  } );
6696 },
6697
6698 /* Generate the HTML for the current state of the date picker. */
6699 _generateHTML: function( inst ) {
6700  var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
6701   controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
6702   monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
6703   selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
6704   cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
6705   printDate, dRow, tbody, daySettings, otherMonth, unselectable,
6706   tempDate = new Date(),
6707   today = this._daylightSavingAdjust(
6708    new Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time
6709   isRTL = this._get( inst, "isRTL" ),
6710   showButtonPanel = this._get( inst, "showButtonPanel" ),
6711   hideIfNoPrevNext = this._get( inst, "hideIfNoPrevNext" ),
6712   navigationAsDateFormat = this._get( inst, "navigationAsDateFormat" ),
6713   numMonths = this._getNumberOfMonths( inst ),
6714   showCurrentAtPos = this._get( inst, "showCurrentAtPos" ),
6715   stepMonths = this._get( inst, "stepMonths" ),
6716   isMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ),
6717   currentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) :
6718    new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ),
6719   minDate = this._getMinMaxDate( inst, "min" ),
6720   maxDate = this._getMinMaxDate( inst, "max" ),
vendor: 4,158 bytes, lines 6721-6800
6721   drawMonth = inst.drawMonth - showCurrentAtPos,
6722   drawYear = inst.drawYear;
6723
6724  if ( drawMonth < 0 ) {
6725   drawMonth += 12;
6726   drawYear--;
6727  }
6728  if ( maxDate ) {
6729   maxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(),
6730    maxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) );
6731   maxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw );
6732   while ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) {
6733    drawMonth--;
6734    if ( drawMonth < 0 ) {
6735     drawMonth = 11;
6736     drawYear--;
6737    }
6738   }
6739  }
6740  inst.drawMonth = drawMonth;
6741  inst.drawYear = drawYear;
6742
6743  prevText = this._get( inst, "prevText" );
6744  prevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText,
6745   this._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ),
6746   this._getFormatConfig( inst ) ) );
6747
6748  prev = ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ?
6749   "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
6750   " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) + "'>" + prevText + "</span></a>" :
6751   ( hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) + "'>" + prevText + "</span></a>" ) );
6752
6753  nextText = this._get( inst, "nextText" );
6754  nextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText,
6755   this._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ),
6756   this._getFormatConfig( inst ) ) );
6757
6758  next = ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ?
6759   "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
6760   " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) + "'>" + nextText + "</span></a>" :
6761   ( hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) + "'>" + nextText + "</span></a>" ) );
6762
6763  currentText = this._get( inst, "currentText" );
6764  gotoDate = ( this._get( inst, "gotoCurrent" ) && inst.currentDay ? currentDate : today );
6765  currentText = ( !navigationAsDateFormat ? currentText :
6766   this.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) );
6767
6768  controls = ( !inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
6769   this._get( inst, "closeText" ) + "</button>" : "" );
6770
6771  buttonPanel = ( showButtonPanel ) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + ( isRTL ? controls : "" ) +
6772   ( this._isInRange( inst, gotoDate ) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
6773   ">" + currentText + "</button>" : "" ) + ( isRTL ? "" : controls ) + "</div>" : "";
6774
6775  firstDay = parseInt( this._get( inst, "firstDay" ), 10 );
6776  firstDay = ( isNaN( firstDay ) ? 0 : firstDay );
6777
6778  showWeek = this._get( inst, "showWeek" );
6779  dayNames = this._get( inst, "dayNames" );
6780  dayNamesMin = this._get( inst, "dayNamesMin" );
6781  monthNames = this._get( inst, "monthNames" );
6782  monthNamesShort = this._get( inst, "monthNamesShort" );
6783  beforeShowDay = this._get( inst, "beforeShowDay" );
6784  showOtherMonths = this._get( inst, "showOtherMonths" );
6785  selectOtherMonths = this._get( inst, "selectOtherMonths" );
6786  defaultDate = this._getDefaultDate( inst );
6787  html = "";
6788
6789  for ( row = 0; row < numMonths[ 0 ]; row++ ) {
6790   group = "";
6791   this.maxRows = 4;
6792   for ( col = 0; col < numMonths[ 1 ]; col++ ) {
6793    selectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) );
6794    cornerClass = " ui-corner-all";
6795    calender = "";
6796    if ( isMultiMonth ) {
6797     calender += "<div class='ui-datepicker-group";
6798     if ( numMonths[ 1 ] > 1 ) {
6799      switch ( col ) {
6800       case 0: calender += " ui-datepicker-group-first";
vendor: 5,222 bytes, lines 6801-6879
6801        cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break;
6802       case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last";
6803        cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break;
6804       default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
6805      }
6806     }
6807     calender += "'>";
6808    }
6809    calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
6810     ( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : "" ) +
6811     ( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : "" ) +
6812     this._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate,
6813     row > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers
6814     "</div><table class='ui-datepicker-calendar'><thead>" +
6815     "<tr>";
6816    thead = ( showWeek ? "<th class='ui-datepicker-week-col'>" + this._get( inst, "weekHeader" ) + "</th>" : "" );
6817    for ( dow = 0; dow < 7; dow++ ) { // days of the week
6818     day = ( dow + firstDay ) % 7;
6819     thead += "<th scope='col'" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "" ) + ">" +
6820      "<span title='" + dayNames[ day ] + "'>" + dayNamesMin[ day ] + "</span></th>";
6821    }
6822    calender += thead + "</tr></thead><tbody>";
6823    daysInMonth = this._getDaysInMonth( drawYear, drawMonth );
6824    if ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) {
6825     inst.selectedDay = Math.min( inst.selectedDay, daysInMonth );
6826    }
6827    leadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7;
6828    curRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate
6829    numRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043)
6830    this.maxRows = numRows;
6831    printDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) );
6832    for ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows
6833     calender += "<tr>";
6834     tbody = ( !showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
6835      this._get( inst, "calculateWeek" )( printDate ) + "</td>" );
6836     for ( dow = 0; dow < 7; dow++ ) { // create date picker days
6837      daySettings = ( beforeShowDay ?
6838       beforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, "" ] );
6839      otherMonth = ( printDate.getMonth() !== drawMonth );
6840      unselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] ||
6841       ( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate );
6842      tbody += "<td class='" +
6843       ( ( dow + firstDay + 6 ) % 7 >= 5 ? " ui-datepicker-week-end" : "" ) + // highlight weekends
6844       ( otherMonth ? " ui-datepicker-other-month" : "" ) + // highlight days from other months
6845       ( ( printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent ) || // user pressed key
6846       ( defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ) ?
6847
6848       // or defaultDate is current printedDate and defaultDate is selectedDate
6849       " " + this._dayOverClass : "" ) + // highlight selected day
6850       ( unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "" ) +  // highlight unselectable days
6851       ( otherMonth && !showOtherMonths ? "" : " " + daySettings[ 1 ] + // highlight custom dates
6852       ( printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "" ) + // highlight selected day
6853       ( printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "" ) ) + "'" + // highlight today (if different)
6854       ( ( !otherMonth || showOtherMonths ) && daySettings[ 2 ] ? " title='" + daySettings[ 2 ].replace( /'/g, "&#39;" ) + "'" : "" ) + // cell title
6855       ( unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'" ) + ">" + // actions
6856       ( otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
6857       ( unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
6858       ( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) +
6859       ( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day
6860       ( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months
6861       "' href='#'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date
6862      printDate.setDate( printDate.getDate() + 1 );
6863      printDate = this._daylightSavingAdjust( printDate );
6864     }
6865     calender += tbody + "</tr>";
6866    }
6867    drawMonth++;
6868    if ( drawMonth > 11 ) {
6869     drawMonth = 0;
6870     drawYear++;
6871    }
6872    calender += "</tbody></table>" + ( isMultiMonth ? "</div>" +
6873       ( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? "<div class='ui-datepicker-row-break'></div>" : "" ) : "" );
6874    group += calender;
6875   }
6876   html += group;
6877  }
6878  html += buttonPanel;
6879  inst._keyEvent = false;
vendor: 4,329 bytes, lines 6880-6990
6880  return html;
6881 },
6882
6883 /* Generate the month and year header. */
6884 _generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate,
6885   secondary, monthNames, monthNamesShort ) {
6886
6887  var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
6888   changeMonth = this._get( inst, "changeMonth" ),
6889   changeYear = this._get( inst, "changeYear" ),
6890   showMonthAfterYear = this._get( inst, "showMonthAfterYear" ),
6891   html = "<div class='ui-datepicker-title'>",
6892   monthHtml = "";
6893
6894  // Month selection
6895  if ( secondary || !changeMonth ) {
6896   monthHtml += "<span class='ui-datepicker-month'>" + monthNames[ drawMonth ] + "</span>";
6897  } else {
6898   inMinYear = ( minDate && minDate.getFullYear() === drawYear );
6899   inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear );
6900   monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
6901   for ( month = 0; month < 12; month++ ) {
6902    if ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) {
6903     monthHtml += "<option value='" + month + "'" +
6904      ( month === drawMonth ? " selected='selected'" : "" ) +
6905      ">" + monthNamesShort[ month ] + "</option>";
6906    }
6907   }
6908   monthHtml += "</select>";
6909  }
6910
6911  if ( !showMonthAfterYear ) {
6912   html += monthHtml + ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" );
6913  }
6914
6915  // Year selection
6916  if ( !inst.yearshtml ) {
6917   inst.yearshtml = "";
6918   if ( secondary || !changeYear ) {
6919    html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
6920   } else {
6921
6922    // determine range of years to display
6923    years = this._get( inst, "yearRange" ).split( ":" );
6924    thisYear = new Date().getFullYear();
6925    determineYear = function( value ) {
6926     var year = ( value.match( /c[+\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) :
6927      ( value.match( /[+\-].*/ ) ? thisYear + parseInt( value, 10 ) :
6928      parseInt( value, 10 ) ) );
6929     return ( isNaN( year ) ? thisYear : year );
6930    };
6931    year = determineYear( years[ 0 ] );
6932    endYear = Math.max( year, determineYear( years[ 1 ] || "" ) );
6933    year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year );
6934    endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear );
6935    inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
6936    for ( ; year <= endYear; year++ ) {
6937     inst.yearshtml += "<option value='" + year + "'" +
6938      ( year === drawYear ? " selected='selected'" : "" ) +
6939      ">" + year + "</option>";
6940    }
6941    inst.yearshtml += "</select>";
6942
6943    html += inst.yearshtml;
6944    inst.yearshtml = null;
6945   }
6946  }
6947
6948  html += this._get( inst, "yearSuffix" );
6949  if ( showMonthAfterYear ) {
6950   html += ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" ) + monthHtml;
6951  }
6952  html += "</div>"; // Close datepicker_header
6953  return html;
6954 },
6955
6956 /* Adjust one of the date sub-fields. */
6957 _adjustInstDate: function( inst, offset, period ) {
6958  var year = inst.selectedYear + ( period === "Y" ? offset : 0 ),
6959   month = inst.selectedMonth + ( period === "M" ? offset : 0 ),
6960   day = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === "D" ? offset : 0 ),
6961   date = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) );
6962
6963  inst.selectedDay = date.getDate();
6964  inst.drawMonth = inst.selectedMonth = date.getMonth();
6965  inst.drawYear = inst.selectedYear = date.getFullYear();
6966  if ( period === "M" || period === "Y" ) {
6967   this._notifyChange( inst );
6968  }
6969 },
6970
6971 /* Ensure a date is within any min/max bounds. */
6972 _restrictMinMax: function( inst, date ) {
6973  var minDate = this._getMinMaxDate( inst, "min" ),
6974   maxDate = this._getMinMaxDate( inst, "max" ),
6975   newDate = ( minDate && date < minDate ? minDate : date );
6976  return ( maxDate && newDate > maxDate ? maxDate : newDate );
6977 },
6978
6979 /* Notify change of month/year. */
6980 _notifyChange: function( inst ) {
6981  var onChange = this._get( inst, "onChangeMonthYear" );
6982  if ( onChange ) {
6983   onChange.apply( ( inst.input ? inst.input[ 0 ] : null ),
6984    [ inst.selectedYear, inst.selectedMonth + 1, inst ] );
6985  }
6986 },
6987
6988 /* Determine the number of months to show. */
6989 _getNumberOfMonths: function( inst ) {
6990  var numMonths = this._get( inst, "numberOfMonths" );
vendor: 10,080 bytes, lines 6991-7291
6991  return ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === "number" ? [ 1, numMonths ] : numMonths ) );
6992 },
6993
6994 /* Determine the current maximum date - ensure no time components are set. */
6995 _getMinMaxDate: function( inst, minMax ) {
6996  return this._determineDate( inst, this._get( inst, minMax + "Date" ), null );
6997 },
6998
6999 /* Find the number of days in a given month. */
7000 _getDaysInMonth: function( year, month ) {
7001  return 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate();
7002 },
7003
7004 /* Find the day of the week of the first of a month. */
7005 _getFirstDayOfMonth: function( year, month ) {
7006  return new Date( year, month, 1 ).getDay();
7007 },
7008
7009 /* Determines if we should allow a "next/prev" month display change. */
7010 _canAdjustMonth: function( inst, offset, curYear, curMonth ) {
7011  var numMonths = this._getNumberOfMonths( inst ),
7012   date = this._daylightSavingAdjust( new Date( curYear,
7013   curMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) );
7014
7015  if ( offset < 0 ) {
7016   date.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) );
7017  }
7018  return this._isInRange( inst, date );
7019 },
7020
7021 /* Is the given date in the accepted range? */
7022 _isInRange: function( inst, date ) {
7023  var yearSplit, currentYear,
7024   minDate = this._getMinMaxDate( inst, "min" ),
7025   maxDate = this._getMinMaxDate( inst, "max" ),
7026   minYear = null,
7027   maxYear = null,
7028   years = this._get( inst, "yearRange" );
7029   if ( years ) {
7030    yearSplit = years.split( ":" );
7031    currentYear = new Date().getFullYear();
7032    minYear = parseInt( yearSplit[ 0 ], 10 );
7033    maxYear = parseInt( yearSplit[ 1 ], 10 );
7034    if ( yearSplit[ 0 ].match( /[+\-].*/ ) ) {
7035     minYear += currentYear;
7036    }
7037    if ( yearSplit[ 1 ].match( /[+\-].*/ ) ) {
7038     maxYear += currentYear;
7039    }
7040   }
7041
7042  return ( ( !minDate || date.getTime() >= minDate.getTime() ) &&
7043   ( !maxDate || date.getTime() <= maxDate.getTime() ) &&
7044   ( !minYear || date.getFullYear() >= minYear ) &&
7045   ( !maxYear || date.getFullYear() <= maxYear ) );
7046 },
7047
7048 /* Provide the configuration settings for formatting/parsing. */
7049 _getFormatConfig: function( inst ) {
7050  var shortYearCutoff = this._get( inst, "shortYearCutoff" );
7051  shortYearCutoff = ( typeof shortYearCutoff !== "string" ? shortYearCutoff :
7052   new Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) );
7053  return { shortYearCutoff: shortYearCutoff,
7054   dayNamesShort: this._get( inst, "dayNamesShort" ), dayNames: this._get( inst, "dayNames" ),
7055   monthNamesShort: this._get( inst, "monthNamesShort" ), monthNames: this._get( inst, "monthNames" ) };
7056 },
7057
7058 /* Format the given date for display. */
7059 _formatDate: function( inst, day, month, year ) {
7060  if ( !day ) {
7061   inst.currentDay = inst.selectedDay;
7062   inst.currentMonth = inst.selectedMonth;
7063   inst.currentYear = inst.selectedYear;
7064  }
7065  var date = ( day ? ( typeof day === "object" ? day :
7066   this._daylightSavingAdjust( new Date( year, month, day ) ) ) :
7067   this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
7068  return this.formatDate( this._get( inst, "dateFormat" ), date, this._getFormatConfig( inst ) );
7069 }
7070} );
7071
7072/*
7073 * Bind hover events for datepicker elements.
7074 * Done via delegate so the binding only occurs once in the lifetime of the parent div.
7075 * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
7076 */
7077function datepicker_bindHover( dpDiv ) {
7078 var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
7079 return dpDiv.on( "mouseout", selector, function() {
7080   $( this ).removeClass( "ui-state-hover" );
7081   if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
7082    $( this ).removeClass( "ui-datepicker-prev-hover" );
7083   }
7084   if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
7085    $( this ).removeClass( "ui-datepicker-next-hover" );
7086   }
7087  } )
7088  .on( "mouseover", selector, datepicker_handleMouseover );
7089}
7090
7091function datepicker_handleMouseover() {
7092 if ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) {
7093  $( this ).parents( ".ui-datepicker-calendar" ).find( "a" ).removeClass( "ui-state-hover" );
7094  $( this ).addClass( "ui-state-hover" );
7095  if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
7096   $( this ).addClass( "ui-datepicker-prev-hover" );
7097  }
7098  if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
7099   $( this ).addClass( "ui-datepicker-next-hover" );
7100  }
7101 }
7102}
7103
7104/* jQuery extend now ignores nulls! */
7105function datepicker_extendRemove( target, props ) {
7106 $.extend( target, props );
7107 for ( var name in props ) {
7108  if ( props[ name ] == null ) {
7109   target[ name ] = props[ name ];
7110  }
7111 }
7112 return target;
7113}
7114
7115/* Invoke the datepicker functionality.
7116   @param  options  string - a command, optionally followed by additional parameters or
7117     Object - settings for attaching new datepicker functionality
7118   @return  jQuery object */
7119$.fn.datepicker = function( options ) {
7120
7121 /* Verify an empty collection wasn't passed - Fixes #6976 */
7122 if ( !this.length ) {
7123  return this;
7124 }
7125
7126 /* Initialise the date picker. */
7127 if ( !$.datepicker.initialized ) {
7128  $( document ).on( "mousedown", $.datepicker._checkExternalClick );
7129  $.datepicker.initialized = true;
7130 }
7131
7132 /* Append datepicker main container to body if not exist. */
7133 if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) {
7134  $( "body" ).append( $.datepicker.dpDiv );
7135 }
7136
7137 var otherArgs = Array.prototype.slice.call( arguments, 1 );
7138 if ( typeof options === "string" && ( options === "isDisabled" || options === "getDate" || options === "widget" ) ) {
7139  return $.datepicker[ "_" + options + "Datepicker" ].
7140   apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
7141 }
7142 if ( options === "option" && arguments.length === 2 && typeof arguments[ 1 ] === "string" ) {
7143  return $.datepicker[ "_" + options + "Datepicker" ].
7144   apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
7145 }
7146 return this.each( function() {
7147  typeof options === "string" ?
7148   $.datepicker[ "_" + options + "Datepicker" ].
7149    apply( $.datepicker, [ this ].concat( otherArgs ) ) :
7150   $.datepicker._attachDatepicker( this, options );
7151 } );
7152};
7153
7154$.datepicker = new Datepicker(); // singleton instance
7155$.datepicker.initialized = false;
7156$.datepicker.uuid = new Date().getTime();
7157$.datepicker.version = "1.12.1";
7158
7159var widgetsDatepicker = $.datepicker;
7160
7161
7162
7163
7164// This file is deprecated
7165var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
7166
7167/*!
7168 * jQuery UI Mouse 1.12.1
7169 * http://jqueryui.com
7170 *
7171 * Copyright jQuery Foundation and other contributors
7172 * Released under the MIT license.
7173 * http://jquery.org/license
7174 */
7175
7176//>>label: Mouse
7177//>>group: Widgets
7178//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
7179//>>docs: http://api.jqueryui.com/mouse/
7180
7181
7182
7183var mouseHandled = false;
7184$( document ).on( "mouseup", function() {
7185 mouseHandled = false;
7186} );
7187
7188var widgetsMouse = $.widget( "ui.mouse", {
7189 version: "1.12.1",
7190 options: {
7191  cancel: "input, textarea, button, select, option",
7192  distance: 1,
7193  delay: 0
7194 },
7195 _mouseInit: function() {
7196  var that = this;
7197
7198  this.element
7199   .on( "mousedown." + this.widgetName, function( event ) {
7200    return that._mouseDown( event );
7201   } )
7202   .on( "click." + this.widgetName, function( event ) {
7203    if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
7204     $.removeData( event.target, that.widgetName + ".preventClickEvent" );
7205     event.stopImmediatePropagation();
7206     return false;
7207    }
7208   } );
7209
7210  this.started = false;
7211 },
7212
7213 // TODO: make sure destroying one instance of mouse doesn't mess with
7214 // other instances of mouse
7215 _mouseDestroy: function() {
7216  this.element.off( "." + this.widgetName );
7217  if ( this._mouseMoveDelegate ) {
7218   this.document
7219    .off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
7220    .off( "mouseup." + this.widgetName, this._mouseUpDelegate );
7221  }
7222 },
7223
7224 _mouseDown: function( event ) {
7225
7226  // don't let more than one widget handle mouseStart
7227  if ( mouseHandled ) {
7228   return;
7229  }
7230
7231  this._mouseMoved = false;
7232
7233  // We may have missed mouseup (out of window)
7234  ( this._mouseStarted && this._mouseUp( event ) );
7235
7236  this._mouseDownEvent = event;
7237
7238  var that = this,
7239   btnIsLeft = ( event.which === 1 ),
7240
7241   // event.target.nodeName works around a bug in IE 8 with
7242   // disabled inputs (#7620)
7243   elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
7244    $( event.target ).closest( this.options.cancel ).length : false );
7245  if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
7246   return true;
7247  }
7248
7249  this.mouseDelayMet = !this.options.delay;
7250  if ( !this.mouseDelayMet ) {
7251   this._mouseDelayTimer = setTimeout( function() {
7252    that.mouseDelayMet = true;
7253   }, this.options.delay );
7254  }
7255
7256  if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
7257   this._mouseStarted = ( this._mouseStart( event ) !== false );
7258   if ( !this._mouseStarted ) {
7259    event.preventDefault();
7260    return true;
7261   }
7262  }
7263
7264  // Click event may never have fired (Gecko & Opera)
7265  if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
7266   $.removeData( event.target, this.widgetName + ".preventClickEvent" );
7267  }
7268
7269  // These delegates are required to keep context
7270  this._mouseMoveDelegate = function( event ) {
7271   return that._mouseMove( event );
7272  };
7273  this._mouseUpDelegate = function( event ) {
7274   return that._mouseUp( event );
7275  };
7276
7277  this.document
7278   .on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
7279   .on( "mouseup." + this.widgetName, this._mouseUpDelegate );
7280
7281  event.preventDefault();
7282
7283  mouseHandled = true;
7284  return true;
7285 },
7286
7287 _mouseMove: function( event ) {
7288
7289  // Only check for mouseups outside the document if you've moved inside the document
7290  // at least once. This prevents the firing of mouseup in the case of IE<9, which will
7291  // fire a mousemove event if content is placed under the cursor. See #7778
vendor: 2,236 bytes, lines 7292-7371
7292  // Support: IE <9
7293  if ( this._mouseMoved ) {
7294
7295   // IE mouseup check - mouseup happened when mouse was out of window
7296   if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
7297     !event.button ) {
7298    return this._mouseUp( event );
7299
7300   // Iframe mouseup check - mouseup occurred in another document
7301   } else if ( !event.which ) {
7302
7303    // Support: Safari <=8 - 9
7304    // Safari sets which to 0 if you press any of the following keys
7305    // during a drag (#14461)
7306    if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
7307      event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
7308     this.ignoreMissingWhich = true;
7309    } else if ( !this.ignoreMissingWhich ) {
7310     return this._mouseUp( event );
7311    }
7312   }
7313  }
7314
7315  if ( event.which || event.button ) {
7316   this._mouseMoved = true;
7317  }
7318
7319  if ( this._mouseStarted ) {
7320   this._mouseDrag( event );
7321   return event.preventDefault();
7322  }
7323
7324  if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
7325   this._mouseStarted =
7326    ( this._mouseStart( this._mouseDownEvent, event ) !== false );
7327   ( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) );
7328  }
7329
7330  return !this._mouseStarted;
7331 },
7332
7333 _mouseUp: function( event ) {
7334  this.document
7335   .off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
7336   .off( "mouseup." + this.widgetName, this._mouseUpDelegate );
7337
7338  if ( this._mouseStarted ) {
7339   this._mouseStarted = false;
7340
7341   if ( event.target === this._mouseDownEvent.target ) {
7342    $.data( event.target, this.widgetName + ".preventClickEvent", true );
7343   }
7344
7345   this._mouseStop( event );
7346  }
7347
7348  if ( this._mouseDelayTimer ) {
7349   clearTimeout( this._mouseDelayTimer );
7350   delete this._mouseDelayTimer;
7351  }
7352
7353  this.ignoreMissingWhich = false;
7354  mouseHandled = false;
7355  event.preventDefault();
7356 },
7357
7358 _mouseDistanceMet: function( event ) {
7359  return ( Math.max(
7360    Math.abs( this._mouseDownEvent.pageX - event.pageX ),
7361    Math.abs( this._mouseDownEvent.pageY - event.pageY )
7362   ) >= this.options.distance
7363  );
7364 },
7365
7366 _mouseDelayMet: function( /* event */ ) {
7367  return this.mouseDelayMet;
7368 },
7369
7370 // These are placeholder methods, to be overriden by extending plugin
7371 _mouseStart: function( /* event */ ) {},
vendor: 10,390 bytes, lines 7372-7787
7372 _mouseDrag: function( /* event */ ) {},
7373 _mouseStop: function( /* event */ ) {},
7374 _mouseCapture: function( /* event */ ) { return true; }
7375} );
7376
7377
7378
7379
7380// $.ui.plugin is deprecated. Use $.widget() extensions instead.
7381var plugin = $.ui.plugin = {
7382 add: function( module, option, set ) {
7383  var i,
7384   proto = $.ui[ module ].prototype;
7385  for ( i in set ) {
7386   proto.plugins[ i ] = proto.plugins[ i ] || [];
7387   proto.plugins[ i ].push( [ option, set[ i ] ] );
7388  }
7389 },
7390 call: function( instance, name, args, allowDisconnected ) {
7391  var i,
7392   set = instance.plugins[ name ];
7393
7394  if ( !set ) {
7395   return;
7396  }
7397
7398  if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode ||
7399    instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
7400   return;
7401  }
7402
7403  for ( i = 0; i < set.length; i++ ) {
7404   if ( instance.options[ set[ i ][ 0 ] ] ) {
7405    set[ i ][ 1 ].apply( instance.element, args );
7406   }
7407  }
7408 }
7409};
7410
7411
7412
7413var safeBlur = $.ui.safeBlur = function( element ) {
7414
7415 // Support: IE9 - 10 only
7416 // If the <body> is blurred, IE will switch windows, see #9420
7417 if ( element && element.nodeName.toLowerCase() !== "body" ) {
7418  $( element ).trigger( "blur" );
7419 }
7420};
7421
7422
7423/*!
7424 * jQuery UI Draggable 1.12.1
7425 * http://jqueryui.com
7426 *
7427 * Copyright jQuery Foundation and other contributors
7428 * Released under the MIT license.
7429 * http://jquery.org/license
7430 */
7431
7432//>>label: Draggable
7433//>>group: Interactions
7434//>>description: Enables dragging functionality for any element.
7435//>>docs: http://api.jqueryui.com/draggable/
7436//>>demos: http://jqueryui.com/draggable/
7437//>>css.structure: ../../themes/base/draggable.css
7438
7439
7440
7441$.widget( "ui.draggable", $.ui.mouse, {
7442 version: "1.12.1",
7443 widgetEventPrefix: "drag",
7444 options: {
7445  addClasses: true,
7446  appendTo: "parent",
7447  axis: false,
7448  connectToSortable: false,
7449  containment: false,
7450  cursor: "auto",
7451  cursorAt: false,
7452  grid: false,
7453  handle: false,
7454  helper: "original",
7455  iframeFix: false,
7456  opacity: false,
7457  refreshPositions: false,
7458  revert: false,
7459  revertDuration: 500,
7460  scope: "default",
7461  scroll: true,
7462  scrollSensitivity: 20,
7463  scrollSpeed: 20,
7464  snap: false,
7465  snapMode: "both",
7466  snapTolerance: 20,
7467  stack: false,
7468  zIndex: false,
7469
7470  // Callbacks
7471  drag: null,
7472  start: null,
7473  stop: null
7474 },
7475 _create: function() {
7476
7477  if ( this.options.helper === "original" ) {
7478   this._setPositionRelative();
7479  }
7480  if ( this.options.addClasses ) {
7481   this._addClass( "ui-draggable" );
7482  }
7483  this._setHandleClassName();
7484
7485  this._mouseInit();
7486 },
7487
7488 _setOption: function( key, value ) {
7489  this._super( key, value );
7490  if ( key === "handle" ) {
7491   this._removeHandleClassName();
7492   this._setHandleClassName();
7493  }
7494 },
7495
7496 _destroy: function() {
7497  if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
7498   this.destroyOnClear = true;
7499   return;
7500  }
7501  this._removeHandleClassName();
7502  this._mouseDestroy();
7503 },
7504
7505 _mouseCapture: function( event ) {
7506  var o = this.options;
7507
7508  // Among others, prevent a drag on a resizable-handle
7509  if ( this.helper || o.disabled ||
7510    $( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) {
7511   return false;
7512  }
7513
7514  //Quit if we're not on a valid handle
7515  this.handle = this._getHandle( event );
7516  if ( !this.handle ) {
7517   return false;
7518  }
7519
7520  this._blurActiveElement( event );
7521
7522  this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
7523
7524  return true;
7525
7526 },
7527
7528 _blockFrames: function( selector ) {
7529  this.iframeBlocks = this.document.find( selector ).map( function() {
7530   var iframe = $( this );
7531
7532   return $( "<div>" )
7533    .css( "position", "absolute" )
7534    .appendTo( iframe.parent() )
7535    .outerWidth( iframe.outerWidth() )
7536    .outerHeight( iframe.outerHeight() )
7537    .offset( iframe.offset() )[ 0 ];
7538  } );
7539 },
7540
7541 _unblockFrames: function() {
7542  if ( this.iframeBlocks ) {
7543   this.iframeBlocks.remove();
7544   delete this.iframeBlocks;
7545  }
7546 },
7547
7548 _blurActiveElement: function( event ) {
7549  var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
7550   target = $( event.target );
7551
7552  // Don't blur if the event occurred on an element that is within
7553  // the currently focused element
7554  // See #10527, #12472
7555  if ( target.closest( activeElement ).length ) {
7556   return;
7557  }
7558
7559  // Blur any element that currently has focus, see #4261
7560  $.ui.safeBlur( activeElement );
7561 },
7562
7563 _mouseStart: function( event ) {
7564
7565  var o = this.options;
7566
7567  //Create and append the visible helper
7568  this.helper = this._createHelper( event );
7569
7570  this._addClass( this.helper, "ui-draggable-dragging" );
7571
7572  //Cache the helper size
7573  this._cacheHelperProportions();
7574
7575  //If ddmanager is used for droppables, set the global draggable
7576  if ( $.ui.ddmanager ) {
7577   $.ui.ddmanager.current = this;
7578  }
7579
7580  /*
7581   * - Position generation -
7582   * This block generates everything position related - it's the core of draggables.
7583   */
7584
7585  //Cache the margins of the original element
7586  this._cacheMargins();
7587
7588  //Store the helper's css position
7589  this.cssPosition = this.helper.css( "position" );
7590  this.scrollParent = this.helper.scrollParent( true );
7591  this.offsetParent = this.helper.offsetParent();
7592  this.hasFixedAncestor = this.helper.parents().filter( function() {
7593    return $( this ).css( "position" ) === "fixed";
7594   } ).length > 0;
7595
7596  //The element's absolute position on the page minus margins
7597  this.positionAbs = this.element.offset();
7598  this._refreshOffsets( event );
7599
7600  //Generate the original position
7601  this.originalPosition = this.position = this._generatePosition( event, false );
7602  this.originalPageX = event.pageX;
7603  this.originalPageY = event.pageY;
7604
7605  //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
7606  ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
7607
7608  //Set a containment if given in the options
7609  this._setContainment();
7610
7611  //Trigger event + callbacks
7612  if ( this._trigger( "start", event ) === false ) {
7613   this._clear();
7614   return false;
7615  }
7616
7617  //Recache the helper size
7618  this._cacheHelperProportions();
7619
7620  //Prepare the droppable offsets
7621  if ( $.ui.ddmanager && !o.dropBehaviour ) {
7622   $.ui.ddmanager.prepareOffsets( this, event );
7623  }
7624
7625  // Execute the drag once - this causes the helper not to be visible before getting its
7626  // correct position
7627  this._mouseDrag( event, true );
7628
7629  // If the ddmanager is used for droppables, inform the manager that dragging has started
7630  // (see #5003)
7631  if ( $.ui.ddmanager ) {
7632   $.ui.ddmanager.dragStart( this, event );
7633  }
7634
7635  return true;
7636 },
7637
7638 _refreshOffsets: function( event ) {
7639  this.offset = {
7640   top: this.positionAbs.top - this.margins.top,
7641   left: this.positionAbs.left - this.margins.left,
7642   scroll: false,
7643   parent: this._getParentOffset(),
7644   relative: this._getRelativeOffset()
7645  };
7646
7647  this.offset.click = {
7648   left: event.pageX - this.offset.left,
7649   top: event.pageY - this.offset.top
7650  };
7651 },
7652
7653 _mouseDrag: function( event, noPropagation ) {
7654
7655  // reset any necessary cached properties (see #5009)
7656  if ( this.hasFixedAncestor ) {
7657   this.offset.parent = this._getParentOffset();
7658  }
7659
7660  //Compute the helpers position
7661  this.position = this._generatePosition( event, true );
7662  this.positionAbs = this._convertPositionTo( "absolute" );
7663
7664  //Call plugins and callbacks and use the resulting position if something is returned
7665  if ( !noPropagation ) {
7666   var ui = this._uiHash();
7667   if ( this._trigger( "drag", event, ui ) === false ) {
7668    this._mouseUp( new $.Event( "mouseup", event ) );
7669    return false;
7670   }
7671   this.position = ui.position;
7672  }
7673
7674  this.helper[ 0 ].style.left = this.position.left + "px";
7675  this.helper[ 0 ].style.top = this.position.top + "px";
7676
7677  if ( $.ui.ddmanager ) {
7678   $.ui.ddmanager.drag( this, event );
7679  }
7680
7681  return false;
7682 },
7683
7684 _mouseStop: function( event ) {
7685
7686  //If we are using droppables, inform the manager about the drop
7687  var that = this,
7688   dropped = false;
7689  if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
7690   dropped = $.ui.ddmanager.drop( this, event );
7691  }
7692
7693  //if a drop comes from outside (a sortable)
7694  if ( this.dropped ) {
7695   dropped = this.dropped;
7696   this.dropped = false;
7697  }
7698
7699  if ( ( this.options.revert === "invalid" && !dropped ) ||
7700    ( this.options.revert === "valid" && dropped ) ||
7701    this.options.revert === true || ( $.isFunction( this.options.revert ) &&
7702    this.options.revert.call( this.element, dropped ) )
7703  ) {
7704   $( this.helper ).animate(
7705    this.originalPosition,
7706    parseInt( this.options.revertDuration, 10 ),
7707    function() {
7708     if ( that._trigger( "stop", event ) !== false ) {
7709      that._clear();
7710     }
7711    }
7712   );
7713  } else {
7714   if ( this._trigger( "stop", event ) !== false ) {
7715    this._clear();
7716   }
7717  }
7718
7719  return false;
7720 },
7721
7722 _mouseUp: function( event ) {
7723  this._unblockFrames();
7724
7725  // If the ddmanager is used for droppables, inform the manager that dragging has stopped
7726  // (see #5003)
7727  if ( $.ui.ddmanager ) {
7728   $.ui.ddmanager.dragStop( this, event );
7729  }
7730
7731  // Only need to focus if the event occurred on the draggable itself, see #10527
7732  if ( this.handleElement.is( event.target ) ) {
7733
7734   // The interaction is over; whether or not the click resulted in a drag,
7735   // focus the element
7736   this.element.trigger( "focus" );
7737  }
7738
7739  return $.ui.mouse.prototype._mouseUp.call( this, event );
7740 },
7741
7742 cancel: function() {
7743
7744  if ( this.helper.is( ".ui-draggable-dragging" ) ) {
7745   this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
7746  } else {
7747   this._clear();
7748  }
7749
7750  return this;
7751
7752 },
7753
7754 _getHandle: function( event ) {
7755  return this.options.handle ?
7756   !!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
7757   true;
7758 },
7759
7760 _setHandleClassName: function() {
7761  this.handleElement = this.options.handle ?
7762   this.element.find( this.options.handle ) : this.element;
7763  this._addClass( this.handleElement, "ui-draggable-handle" );
7764 },
7765
7766 _removeHandleClassName: function() {
7767  this._removeClass( this.handleElement, "ui-draggable-handle" );
7768 },
7769
7770 _createHelper: function( event ) {
7771
7772  var o = this.options,
7773   helperIsFunction = $.isFunction( o.helper ),
7774   helper = helperIsFunction ?
7775    $( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
7776    ( o.helper === "clone" ?
7777     this.element.clone().removeAttr( "id" ) :
7778     this.element );
7779
7780  if ( !helper.parents( "body" ).length ) {
7781   helper.appendTo( ( o.appendTo === "parent" ?
7782    this.element[ 0 ].parentNode :
7783    o.appendTo ) );
7784  }
7785
7786  // Http://bugs.jqueryui.com/ticket/9446
7787  // a helper function can return the original element
vendor: 15,265 bytes, lines 7788-8292
7788  // which wouldn't have been set to relative in _create
7789  if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
7790   this._setPositionRelative();
7791  }
7792
7793  if ( helper[ 0 ] !== this.element[ 0 ] &&
7794    !( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) {
7795   helper.css( "position", "absolute" );
7796  }
7797
7798  return helper;
7799
7800 },
7801
7802 _setPositionRelative: function() {
7803  if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
7804   this.element[ 0 ].style.position = "relative";
7805  }
7806 },
7807
7808 _adjustOffsetFromHelper: function( obj ) {
7809  if ( typeof obj === "string" ) {
7810   obj = obj.split( " " );
7811  }
7812  if ( $.isArray( obj ) ) {
7813   obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
7814  }
7815  if ( "left" in obj ) {
7816   this.offset.click.left = obj.left + this.margins.left;
7817  }
7818  if ( "right" in obj ) {
7819   this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
7820  }
7821  if ( "top" in obj ) {
7822   this.offset.click.top = obj.top + this.margins.top;
7823  }
7824  if ( "bottom" in obj ) {
7825   this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
7826  }
7827 },
7828
7829 _isRootNode: function( element ) {
7830  return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
7831 },
7832
7833 _getParentOffset: function() {
7834
7835  //Get the offsetParent and cache its position
7836  var po = this.offsetParent.offset(),
7837   document = this.document[ 0 ];
7838
7839  // This is a special case where we need to modify a offset calculated on start, since the
7840  // following happened:
7841  // 1. The position of the helper is absolute, so it's position is calculated based on the
7842  // next positioned parent
7843  // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
7844  // the document, which means that the scroll is included in the initial calculation of the
7845  // offset of the parent, and never recalculated upon drag
7846  if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document &&
7847    $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
7848   po.left += this.scrollParent.scrollLeft();
7849   po.top += this.scrollParent.scrollTop();
7850  }
7851
7852  if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
7853   po = { top: 0, left: 0 };
7854  }
7855
7856  return {
7857   top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
7858   left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
7859  };
7860
7861 },
7862
7863 _getRelativeOffset: function() {
7864  if ( this.cssPosition !== "relative" ) {
7865   return { top: 0, left: 0 };
7866  }
7867
7868  var p = this.element.position(),
7869   scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
7870
7871  return {
7872   top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
7873    ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
7874   left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
7875    ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
7876  };
7877
7878 },
7879
7880 _cacheMargins: function() {
7881  this.margins = {
7882   left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ),
7883   top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ),
7884   right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ),
7885   bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 )
7886  };
7887 },
7888
7889 _cacheHelperProportions: function() {
7890  this.helperProportions = {
7891   width: this.helper.outerWidth(),
7892   height: this.helper.outerHeight()
7893  };
7894 },
7895
7896 _setContainment: function() {
7897
7898  var isUserScrollable, c, ce,
7899   o = this.options,
7900   document = this.document[ 0 ];
7901
7902  this.relativeContainer = null;
7903
7904  if ( !o.containment ) {
7905   this.containment = null;
7906   return;
7907  }
7908
7909  if ( o.containment === "window" ) {
7910   this.containment = [
7911    $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
7912    $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
7913    $( window ).scrollLeft() + $( window ).width() -
7914     this.helperProportions.width - this.margins.left,
7915    $( window ).scrollTop() +
7916     ( $( window ).height() || document.body.parentNode.scrollHeight ) -
7917     this.helperProportions.height - this.margins.top
7918   ];
7919   return;
7920  }
7921
7922  if ( o.containment === "document" ) {
7923   this.containment = [
7924    0,
7925    0,
7926    $( document ).width() - this.helperProportions.width - this.margins.left,
7927    ( $( document ).height() || document.body.parentNode.scrollHeight ) -
7928     this.helperProportions.height - this.margins.top
7929   ];
7930   return;
7931  }
7932
7933  if ( o.containment.constructor === Array ) {
7934   this.containment = o.containment;
7935   return;
7936  }
7937
7938  if ( o.containment === "parent" ) {
7939   o.containment = this.helper[ 0 ].parentNode;
7940  }
7941
7942  c = $( o.containment );
7943  ce = c[ 0 ];
7944
7945  if ( !ce ) {
7946   return;
7947  }
7948
7949  isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
7950
7951  this.containment = [
7952   ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
7953    ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
7954   ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) +
7955    ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
7956   ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
7957    ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
7958    ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
7959    this.helperProportions.width -
7960    this.margins.left -
7961    this.margins.right,
7962   ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
7963    ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
7964    ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
7965    this.helperProportions.height -
7966    this.margins.top -
7967    this.margins.bottom
7968  ];
7969  this.relativeContainer = c;
7970 },
7971
7972 _convertPositionTo: function( d, pos ) {
7973
7974  if ( !pos ) {
7975   pos = this.position;
7976  }
7977
7978  var mod = d === "absolute" ? 1 : -1,
7979   scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
7980
7981  return {
7982   top: (
7983
7984    // The absolute mouse position
7985    pos.top +
7986
7987    // Only for relative positioned nodes: Relative offset from element to offset parent
7988    this.offset.relative.top * mod +
7989
7990    // The offsetParent's offset without borders (offset + border)
7991    this.offset.parent.top * mod -
7992    ( ( this.cssPosition === "fixed" ?
7993     -this.offset.scroll.top :
7994     ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod )
7995   ),
7996   left: (
7997
7998    // The absolute mouse position
7999    pos.left +
8000
8001    // Only for relative positioned nodes: Relative offset from element to offset parent
8002    this.offset.relative.left * mod +
8003
8004    // The offsetParent's offset without borders (offset + border)
8005    this.offset.parent.left * mod -
8006    ( ( this.cssPosition === "fixed" ?
8007     -this.offset.scroll.left :
8008     ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod )
8009   )
8010  };
8011
8012 },
8013
8014 _generatePosition: function( event, constrainPosition ) {
8015
8016  var containment, co, top, left,
8017   o = this.options,
8018   scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
8019   pageX = event.pageX,
8020   pageY = event.pageY;
8021
8022  // Cache the scroll
8023  if ( !scrollIsRootNode || !this.offset.scroll ) {
8024   this.offset.scroll = {
8025    top: this.scrollParent.scrollTop(),
8026    left: this.scrollParent.scrollLeft()
8027   };
8028  }
8029
8030  /*
8031   * - Position constraining -
8032   * Constrain the position to a mix of grid, containment.
8033   */
8034
8035  // If we are not dragging yet, we won't check for options
8036  if ( constrainPosition ) {
8037   if ( this.containment ) {
8038    if ( this.relativeContainer ) {
8039     co = this.relativeContainer.offset();
8040     containment = [
8041      this.containment[ 0 ] + co.left,
8042      this.containment[ 1 ] + co.top,
8043      this.containment[ 2 ] + co.left,
8044      this.containment[ 3 ] + co.top
8045     ];
8046    } else {
8047     containment = this.containment;
8048    }
8049
8050    if ( event.pageX - this.offset.click.left < containment[ 0 ] ) {
8051     pageX = containment[ 0 ] + this.offset.click.left;
8052    }
8053    if ( event.pageY - this.offset.click.top < containment[ 1 ] ) {
8054     pageY = containment[ 1 ] + this.offset.click.top;
8055    }
8056    if ( event.pageX - this.offset.click.left > containment[ 2 ] ) {
8057     pageX = containment[ 2 ] + this.offset.click.left;
8058    }
8059    if ( event.pageY - this.offset.click.top > containment[ 3 ] ) {
8060     pageY = containment[ 3 ] + this.offset.click.top;
8061    }
8062   }
8063
8064   if ( o.grid ) {
8065
8066    //Check for grid elements set to 0 to prevent divide by 0 error causing invalid
8067    // argument errors in IE (see ticket #6950)
8068    top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY -
8069     this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY;
8070    pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] ||
8071     top - this.offset.click.top > containment[ 3 ] ) ?
8072      top :
8073      ( ( top - this.offset.click.top >= containment[ 1 ] ) ?
8074       top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top;
8075
8076    left = o.grid[ 0 ] ? this.originalPageX +
8077     Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] :
8078     this.originalPageX;
8079    pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] ||
8080     left - this.offset.click.left > containment[ 2 ] ) ?
8081      left :
8082      ( ( left - this.offset.click.left >= containment[ 0 ] ) ?
8083       left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left;
8084   }
8085
8086   if ( o.axis === "y" ) {
8087    pageX = this.originalPageX;
8088   }
8089
8090   if ( o.axis === "x" ) {
8091    pageY = this.originalPageY;
8092   }
8093  }
8094
8095  return {
8096   top: (
8097
8098    // The absolute mouse position
8099    pageY -
8100
8101    // Click offset (relative to the element)
8102    this.offset.click.top -
8103
8104    // Only for relative positioned nodes: Relative offset from element to offset parent
8105    this.offset.relative.top -
8106
8107    // The offsetParent's offset without borders (offset + border)
8108    this.offset.parent.top +
8109    ( this.cssPosition === "fixed" ?
8110     -this.offset.scroll.top :
8111     ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
8112   ),
8113   left: (
8114
8115    // The absolute mouse position
8116    pageX -
8117
8118    // Click offset (relative to the element)
8119    this.offset.click.left -
8120
8121    // Only for relative positioned nodes: Relative offset from element to offset parent
8122    this.offset.relative.left -
8123
8124    // The offsetParent's offset without borders (offset + border)
8125    this.offset.parent.left +
8126    ( this.cssPosition === "fixed" ?
8127     -this.offset.scroll.left :
8128     ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
8129   )
8130  };
8131
8132 },
8133
8134 _clear: function() {
8135  this._removeClass( this.helper, "ui-draggable-dragging" );
8136  if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) {
8137   this.helper.remove();
8138  }
8139  this.helper = null;
8140  this.cancelHelperRemoval = false;
8141  if ( this.destroyOnClear ) {
8142   this.destroy();
8143  }
8144 },
8145
8146 // From now on bulk stuff - mainly helpers
8147
8148 _trigger: function( type, event, ui ) {
8149  ui = ui || this._uiHash();
8150  $.ui.plugin.call( this, type, [ event, ui, this ], true );
8151
8152  // Absolute position and offset (see #6884 ) have to be recalculated after plugins
8153  if ( /^(drag|start|stop)/.test( type ) ) {
8154   this.positionAbs = this._convertPositionTo( "absolute" );
8155   ui.offset = this.positionAbs;
8156  }
8157  return $.Widget.prototype._trigger.call( this, type, event, ui );
8158 },
8159
8160 plugins: {},
8161
8162 _uiHash: function() {
8163  return {
8164   helper: this.helper,
8165   position: this.position,
8166   originalPosition: this.originalPosition,
8167   offset: this.positionAbs
8168  };
8169 }
8170
8171} );
8172
8173$.ui.plugin.add( "draggable", "connectToSortable", {
8174 start: function( event, ui, draggable ) {
8175  var uiSortable = $.extend( {}, ui, {
8176   item: draggable.element
8177  } );
8178
8179  draggable.sortables = [];
8180  $( draggable.options.connectToSortable ).each( function() {
8181   var sortable = $( this ).sortable( "instance" );
8182
8183   if ( sortable && !sortable.options.disabled ) {
8184    draggable.sortables.push( sortable );
8185
8186    // RefreshPositions is called at drag start to refresh the containerCache
8187    // which is used in drag. This ensures it's initialized and synchronized
8188    // with any changes that might have happened on the page since initialization.
8189    sortable.refreshPositions();
8190    sortable._trigger( "activate", event, uiSortable );
8191   }
8192  } );
8193 },
8194 stop: function( event, ui, draggable ) {
8195  var uiSortable = $.extend( {}, ui, {
8196   item: draggable.element
8197  } );
8198
8199  draggable.cancelHelperRemoval = false;
8200
8201  $.each( draggable.sortables, function() {
8202   var sortable = this;
8203
8204   if ( sortable.isOver ) {
8205    sortable.isOver = 0;
8206
8207    // Allow this sortable to handle removing the helper
8208    draggable.cancelHelperRemoval = true;
8209    sortable.cancelHelperRemoval = false;
8210
8211    // Use _storedCSS To restore properties in the sortable,
8212    // as this also handles revert (#9675) since the draggable
8213    // may have modified them in unexpected ways (#8809)
8214    sortable._storedCSS = {
8215     position: sortable.placeholder.css( "position" ),
8216     top: sortable.placeholder.css( "top" ),
8217     left: sortable.placeholder.css( "left" )
8218    };
8219
8220    sortable._mouseStop( event );
8221
8222    // Once drag has ended, the sortable should return to using
8223    // its original helper, not the shared helper from draggable
8224    sortable.options.helper = sortable.options._helper;
8225   } else {
8226
8227    // Prevent this Sortable from removing the helper.
8228    // However, don't set the draggable to remove the helper
8229    // either as another connected Sortable may yet handle the removal.
8230    sortable.cancelHelperRemoval = true;
8231
8232    sortable._trigger( "deactivate", event, uiSortable );
8233   }
8234  } );
8235 },
8236 drag: function( event, ui, draggable ) {
8237  $.each( draggable.sortables, function() {
8238   var innermostIntersecting = false,
8239    sortable = this;
8240
8241   // Copy over variables that sortable's _intersectsWith uses
8242   sortable.positionAbs = draggable.positionAbs;
8243   sortable.helperProportions = draggable.helperProportions;
8244   sortable.offset.click = draggable.offset.click;
8245
8246   if ( sortable._intersectsWith( sortable.containerCache ) ) {
8247    innermostIntersecting = true;
8248
8249    $.each( draggable.sortables, function() {
8250
8251     // Copy over variables that sortable's _intersectsWith uses
8252     this.positionAbs = draggable.positionAbs;
8253     this.helperProportions = draggable.helperProportions;
8254     this.offset.click = draggable.offset.click;
8255
8256     if ( this !== sortable &&
8257       this._intersectsWith( this.containerCache ) &&
8258       $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
8259      innermostIntersecting = false;
8260     }
8261
8262     return innermostIntersecting;
8263    } );
8264   }
8265
8266   if ( innermostIntersecting ) {
8267
8268    // If it intersects, we use a little isOver variable and set it once,
8269    // so that the move-in stuff gets fired only once.
8270    if ( !sortable.isOver ) {
8271     sortable.isOver = 1;
8272
8273     // Store draggable's parent in case we need to reappend to it later.
8274     draggable._parent = ui.helper.parent();
8275
8276     sortable.currentItem = ui.helper
8277      .appendTo( sortable.element )
8278      .data( "ui-sortable-item", true );
8279
8280     // Store helper option to later restore it
8281     sortable.options._helper = sortable.options.helper;
8282
8283     sortable.options.helper = function() {
8284      return ui.helper[ 0 ];
8285     };
8286
8287     // Fire the start events of the sortable with our passed browser event,
8288     // and our own helper (so it doesn't create a new one)
8289     event.target = sortable.currentItem[ 0 ];
8290     sortable._mouseCapture( event, true );
8291     sortable._mouseStart( event, true, true );
8292
vendor: 7,687 bytes, lines 8293-8528
8293     // Because the browser event is way off the new appended portlet,
8294     // modify necessary variables to reflect the changes
8295     sortable.offset.click.top = draggable.offset.click.top;
8296     sortable.offset.click.left = draggable.offset.click.left;
8297     sortable.offset.parent.left -= draggable.offset.parent.left -
8298      sortable.offset.parent.left;
8299     sortable.offset.parent.top -= draggable.offset.parent.top -
8300      sortable.offset.parent.top;
8301
8302     draggable._trigger( "toSortable", event );
8303
8304     // Inform draggable that the helper is in a valid drop zone,
8305     // used solely in the revert option to handle "valid/invalid".
8306     draggable.dropped = sortable.element;
8307
8308     // Need to refreshPositions of all sortables in the case that
8309     // adding to one sortable changes the location of the other sortables (#9675)
8310     $.each( draggable.sortables, function() {
8311      this.refreshPositions();
8312     } );
8313
8314     // Hack so receive/update callbacks work (mostly)
8315     draggable.currentItem = draggable.element;
8316     sortable.fromOutside = draggable;
8317    }
8318
8319    if ( sortable.currentItem ) {
8320     sortable._mouseDrag( event );
8321
8322     // Copy the sortable's position because the draggable's can potentially reflect
8323     // a relative position, while sortable is always absolute, which the dragged
8324     // element has now become. (#8809)
8325     ui.position = sortable.position;
8326    }
8327   } else {
8328
8329    // If it doesn't intersect with the sortable, and it intersected before,
8330    // we fake the drag stop of the sortable, but make sure it doesn't remove
8331    // the helper by using cancelHelperRemoval.
8332    if ( sortable.isOver ) {
8333
8334     sortable.isOver = 0;
8335     sortable.cancelHelperRemoval = true;
8336
8337     // Calling sortable's mouseStop would trigger a revert,
8338     // so revert must be temporarily false until after mouseStop is called.
8339     sortable.options._revert = sortable.options.revert;
8340     sortable.options.revert = false;
8341
8342     sortable._trigger( "out", event, sortable._uiHash( sortable ) );
8343     sortable._mouseStop( event, true );
8344
8345     // Restore sortable behaviors that were modfied
8346     // when the draggable entered the sortable area (#9481)
8347     sortable.options.revert = sortable.options._revert;
8348     sortable.options.helper = sortable.options._helper;
8349
8350     if ( sortable.placeholder ) {
8351      sortable.placeholder.remove();
8352     }
8353
8354     // Restore and recalculate the draggable's offset considering the sortable
8355     // may have modified them in unexpected ways. (#8809, #10669)
8356     ui.helper.appendTo( draggable._parent );
8357     draggable._refreshOffsets( event );
8358     ui.position = draggable._generatePosition( event, true );
8359
8360     draggable._trigger( "fromSortable", event );
8361
8362     // Inform draggable that the helper is no longer in a valid drop zone
8363     draggable.dropped = false;
8364
8365     // Need to refreshPositions of all sortables just in case removing
8366     // from one sortable changes the location of other sortables (#9675)
8367     $.each( draggable.sortables, function() {
8368      this.refreshPositions();
8369     } );
8370    }
8371   }
8372  } );
8373 }
8374} );
8375
8376$.ui.plugin.add( "draggable", "cursor", {
8377 start: function( event, ui, instance ) {
8378  var t = $( "body" ),
8379   o = instance.options;
8380
8381  if ( t.css( "cursor" ) ) {
8382   o._cursor = t.css( "cursor" );
8383  }
8384  t.css( "cursor", o.cursor );
8385 },
8386 stop: function( event, ui, instance ) {
8387  var o = instance.options;
8388  if ( o._cursor ) {
8389   $( "body" ).css( "cursor", o._cursor );
8390  }
8391 }
8392} );
8393
8394$.ui.plugin.add( "draggable", "opacity", {
8395 start: function( event, ui, instance ) {
8396  var t = $( ui.helper ),
8397   o = instance.options;
8398  if ( t.css( "opacity" ) ) {
8399   o._opacity = t.css( "opacity" );
8400  }
8401  t.css( "opacity", o.opacity );
8402 },
8403 stop: function( event, ui, instance ) {
8404  var o = instance.options;
8405  if ( o._opacity ) {
8406   $( ui.helper ).css( "opacity", o._opacity );
8407  }
8408 }
8409} );
8410
8411$.ui.plugin.add( "draggable", "scroll", {
8412 start: function( event, ui, i ) {
8413  if ( !i.scrollParentNotHidden ) {
8414   i.scrollParentNotHidden = i.helper.scrollParent( false );
8415  }
8416
8417  if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
8418    i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
8419   i.overflowOffset = i.scrollParentNotHidden.offset();
8420  }
8421 },
8422 drag: function( event, ui, i  ) {
8423
8424  var o = i.options,
8425   scrolled = false,
8426   scrollParent = i.scrollParentNotHidden[ 0 ],
8427   document = i.document[ 0 ];
8428
8429  if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
8430   if ( !o.axis || o.axis !== "x" ) {
8431    if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY <
8432      o.scrollSensitivity ) {
8433     scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
8434    } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
8435     scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
8436    }
8437   }
8438
8439   if ( !o.axis || o.axis !== "y" ) {
8440    if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX <
8441      o.scrollSensitivity ) {
8442     scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
8443    } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
8444     scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
8445    }
8446   }
8447
8448  } else {
8449
8450   if ( !o.axis || o.axis !== "x" ) {
8451    if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) {
8452     scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed );
8453    } else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) <
8454      o.scrollSensitivity ) {
8455     scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed );
8456    }
8457   }
8458
8459   if ( !o.axis || o.axis !== "y" ) {
8460    if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) {
8461     scrolled = $( document ).scrollLeft(
8462      $( document ).scrollLeft() - o.scrollSpeed
8463     );
8464    } else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) <
8465      o.scrollSensitivity ) {
8466     scrolled = $( document ).scrollLeft(
8467      $( document ).scrollLeft() + o.scrollSpeed
8468     );
8469    }
8470   }
8471
8472  }
8473
8474  if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
8475   $.ui.ddmanager.prepareOffsets( i, event );
8476  }
8477
8478 }
8479} );
8480
8481$.ui.plugin.add( "draggable", "snap", {
8482 start: function( event, ui, i ) {
8483
8484  var o = i.options;
8485
8486  i.snapElements = [];
8487
8488  $( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap )
8489   .each( function() {
8490    var $t = $( this ),
8491     $o = $t.offset();
8492    if ( this !== i.element[ 0 ] ) {
8493     i.snapElements.push( {
8494      item: this,
8495      width: $t.outerWidth(), height: $t.outerHeight(),
8496      top: $o.top, left: $o.left
8497     } );
8498    }
8499   } );
8500
8501 },
8502 drag: function( event, ui, inst ) {
8503
8504  var ts, bs, ls, rs, l, r, t, b, i, first,
8505   o = inst.options,
8506   d = o.snapTolerance,
8507   x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
8508   y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
8509
8510  for ( i = inst.snapElements.length - 1; i >= 0; i-- ) {
8511
8512   l = inst.snapElements[ i ].left - inst.margins.left;
8513   r = l + inst.snapElements[ i ].width;
8514   t = inst.snapElements[ i ].top - inst.margins.top;
8515   b = t + inst.snapElements[ i ].height;
8516
8517   if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
8518     !$.contains( inst.snapElements[ i ].item.ownerDocument,
8519     inst.snapElements[ i ].item ) ) {
8520    if ( inst.snapElements[ i ].snapping ) {
8521     ( inst.options.snap.release &&
8522      inst.options.snap.release.call(
8523       inst.element,
8524       event,
8525       $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } )
8526      ) );
8527    }
8528    inst.snapElements[ i ].snapping = false;
vendor: 9,603 bytes, lines 8529-8934
8529    continue;
8530   }
8531
8532   if ( o.snapMode !== "inner" ) {
8533    ts = Math.abs( t - y2 ) <= d;
8534    bs = Math.abs( b - y1 ) <= d;
8535    ls = Math.abs( l - x2 ) <= d;
8536    rs = Math.abs( r - x1 ) <= d;
8537    if ( ts ) {
8538     ui.position.top = inst._convertPositionTo( "relative", {
8539      top: t - inst.helperProportions.height,
8540      left: 0
8541     } ).top;
8542    }
8543    if ( bs ) {
8544     ui.position.top = inst._convertPositionTo( "relative", {
8545      top: b,
8546      left: 0
8547     } ).top;
8548    }
8549    if ( ls ) {
8550     ui.position.left = inst._convertPositionTo( "relative", {
8551      top: 0,
8552      left: l - inst.helperProportions.width
8553     } ).left;
8554    }
8555    if ( rs ) {
8556     ui.position.left = inst._convertPositionTo( "relative", {
8557      top: 0,
8558      left: r
8559     } ).left;
8560    }
8561   }
8562
8563   first = ( ts || bs || ls || rs );
8564
8565   if ( o.snapMode !== "outer" ) {
8566    ts = Math.abs( t - y1 ) <= d;
8567    bs = Math.abs( b - y2 ) <= d;
8568    ls = Math.abs( l - x1 ) <= d;
8569    rs = Math.abs( r - x2 ) <= d;
8570    if ( ts ) {
8571     ui.position.top = inst._convertPositionTo( "relative", {
8572      top: t,
8573      left: 0
8574     } ).top;
8575    }
8576    if ( bs ) {
8577     ui.position.top = inst._convertPositionTo( "relative", {
8578      top: b - inst.helperProportions.height,
8579      left: 0
8580     } ).top;
8581    }
8582    if ( ls ) {
8583     ui.position.left = inst._convertPositionTo( "relative", {
8584      top: 0,
8585      left: l
8586     } ).left;
8587    }
8588    if ( rs ) {
8589     ui.position.left = inst._convertPositionTo( "relative", {
8590      top: 0,
8591      left: r - inst.helperProportions.width
8592     } ).left;
8593    }
8594   }
8595
8596   if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) {
8597    ( inst.options.snap.snap &&
8598     inst.options.snap.snap.call(
8599      inst.element,
8600      event,
8601      $.extend( inst._uiHash(), {
8602       snapItem: inst.snapElements[ i ].item
8603      } ) ) );
8604   }
8605   inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );
8606
8607  }
8608
8609 }
8610} );
8611
8612$.ui.plugin.add( "draggable", "stack", {
8613 start: function( event, ui, instance ) {
8614  var min,
8615   o = instance.options,
8616   group = $.makeArray( $( o.stack ) ).sort( function( a, b ) {
8617    return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) -
8618     ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
8619   } );
8620
8621  if ( !group.length ) { return; }
8622
8623  min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
8624  $( group ).each( function( i ) {
8625   $( this ).css( "zIndex", min + i );
8626  } );
8627  this.css( "zIndex", ( min + group.length ) );
8628 }
8629} );
8630
8631$.ui.plugin.add( "draggable", "zIndex", {
8632 start: function( event, ui, instance ) {
8633  var t = $( ui.helper ),
8634   o = instance.options;
8635
8636  if ( t.css( "zIndex" ) ) {
8637   o._zIndex = t.css( "zIndex" );
8638  }
8639  t.css( "zIndex", o.zIndex );
8640 },
8641 stop: function( event, ui, instance ) {
8642  var o = instance.options;
8643
8644  if ( o._zIndex ) {
8645   $( ui.helper ).css( "zIndex", o._zIndex );
8646  }
8647 }
8648} );
8649
8650var widgetsDraggable = $.ui.draggable;
8651
8652
8653/*!
8654 * jQuery UI Resizable 1.12.1
8655 * http://jqueryui.com
8656 *
8657 * Copyright jQuery Foundation and other contributors
8658 * Released under the MIT license.
8659 * http://jquery.org/license
8660 */
8661
8662//>>label: Resizable
8663//>>group: Interactions
8664//>>description: Enables resize functionality for any element.
8665//>>docs: http://api.jqueryui.com/resizable/
8666//>>demos: http://jqueryui.com/resizable/
8667//>>css.structure: ../../themes/base/core.css
8668//>>css.structure: ../../themes/base/resizable.css
8669//>>css.theme: ../../themes/base/theme.css
8670
8671
8672
8673$.widget( "ui.resizable", $.ui.mouse, {
8674 version: "1.12.1",
8675 widgetEventPrefix: "resize",
8676 options: {
8677  alsoResize: false,
8678  animate: false,
8679  animateDuration: "slow",
8680  animateEasing: "swing",
8681  aspectRatio: false,
8682  autoHide: false,
8683  classes: {
8684   "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
8685  },
8686  containment: false,
8687  ghost: false,
8688  grid: false,
8689  handles: "e,s,se",
8690  helper: false,
8691  maxHeight: null,
8692  maxWidth: null,
8693  minHeight: 10,
8694  minWidth: 10,
8695
8696  // See #7960
8697  zIndex: 90,
8698
8699  // Callbacks
8700  resize: null,
8701  start: null,
8702  stop: null
8703 },
8704
8705 _num: function( value ) {
8706  return parseFloat( value ) || 0;
8707 },
8708
8709 _isNumber: function( value ) {
8710  return !isNaN( parseFloat( value ) );
8711 },
8712
8713 _hasScroll: function( el, a ) {
8714
8715  if ( $( el ).css( "overflow" ) === "hidden" ) {
8716   return false;
8717  }
8718
8719  var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
8720   has = false;
8721
8722  if ( el[ scroll ] > 0 ) {
8723   return true;
8724  }
8725
8726  // TODO: determine which cases actually cause this to happen
8727  // if the element doesn't have the scroll set, see if it's possible to
8728  // set the scroll
8729  el[ scroll ] = 1;
8730  has = ( el[ scroll ] > 0 );
8731  el[ scroll ] = 0;
8732  return has;
8733 },
8734
8735 _create: function() {
8736
8737  var margins,
8738   o = this.options,
8739   that = this;
8740  this._addClass( "ui-resizable" );
8741
8742  $.extend( this, {
8743   _aspectRatio: !!( o.aspectRatio ),
8744   aspectRatio: o.aspectRatio,
8745   originalElement: this.element,
8746   _proportionallyResizeElements: [],
8747   _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
8748  } );
8749
8750  // Wrap the element if it cannot hold child nodes
8751  if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) {
8752
8753   this.element.wrap(
8754    $( "<div class='ui-wrapper' style='overflow: hidden;'></div>" ).css( {
8755     position: this.element.css( "position" ),
8756     width: this.element.outerWidth(),
8757     height: this.element.outerHeight(),
8758     top: this.element.css( "top" ),
8759     left: this.element.css( "left" )
8760    } )
8761   );
8762
8763   this.element = this.element.parent().data(
8764    "ui-resizable", this.element.resizable( "instance" )
8765   );
8766
8767   this.elementIsWrapper = true;
8768
8769   margins = {
8770    marginTop: this.originalElement.css( "marginTop" ),
8771    marginRight: this.originalElement.css( "marginRight" ),
8772    marginBottom: this.originalElement.css( "marginBottom" ),
8773    marginLeft: this.originalElement.css( "marginLeft" )
8774   };
8775
8776   this.element.css( margins );
8777   this.originalElement.css( "margin", 0 );
8778
8779   // support: Safari
8780   // Prevent Safari textarea resize
8781   this.originalResizeStyle = this.originalElement.css( "resize" );
8782   this.originalElement.css( "resize", "none" );
8783
8784   this._proportionallyResizeElements.push( this.originalElement.css( {
8785    position: "static",
8786    zoom: 1,
8787    display: "block"
8788   } ) );
8789
8790   // Support: IE9
8791   // avoid IE jump (hard set the margin)
8792   this.originalElement.css( margins );
8793
8794   this._proportionallyResize();
8795  }
8796
8797  this._setupHandles();
8798
8799  if ( o.autoHide ) {
8800   $( this.element )
8801    .on( "mouseenter", function() {
8802     if ( o.disabled ) {
8803      return;
8804     }
8805     that._removeClass( "ui-resizable-autohide" );
8806     that._handles.show();
8807    } )
8808    .on( "mouseleave", function() {
8809     if ( o.disabled ) {
8810      return;
8811     }
8812     if ( !that.resizing ) {
8813      that._addClass( "ui-resizable-autohide" );
8814      that._handles.hide();
8815     }
8816    } );
8817  }
8818
8819  this._mouseInit();
8820 },
8821
8822 _destroy: function() {
8823
8824  this._mouseDestroy();
8825
8826  var wrapper,
8827   _destroy = function( exp ) {
8828    $( exp )
8829     .removeData( "resizable" )
8830     .removeData( "ui-resizable" )
8831     .off( ".resizable" )
8832     .find( ".ui-resizable-handle" )
8833      .remove();
8834   };
8835
8836  // TODO: Unwrap at same DOM position
8837  if ( this.elementIsWrapper ) {
8838   _destroy( this.element );
8839   wrapper = this.element;
8840   this.originalElement.css( {
8841    position: wrapper.css( "position" ),
8842    width: wrapper.outerWidth(),
8843    height: wrapper.outerHeight(),
8844    top: wrapper.css( "top" ),
8845    left: wrapper.css( "left" )
8846   } ).insertAfter( wrapper );
8847   wrapper.remove();
8848  }
8849
8850  this.originalElement.css( "resize", this.originalResizeStyle );
8851  _destroy( this.originalElement );
8852
8853  return this;
8854 },
8855
8856 _setOption: function( key, value ) {
8857  this._super( key, value );
8858
8859  switch ( key ) {
8860  case "handles":
8861   this._removeHandles();
8862   this._setupHandles();
8863   break;
8864  default:
8865   break;
8866  }
8867 },
8868
8869 _setupHandles: function() {
8870  var o = this.options, handle, i, n, hname, axis, that = this;
8871  this.handles = o.handles ||
8872   ( !$( ".ui-resizable-handle", this.element ).length ?
8873    "e,s,se" : {
8874     n: ".ui-resizable-n",
8875     e: ".ui-resizable-e",
8876     s: ".ui-resizable-s",
8877     w: ".ui-resizable-w",
8878     se: ".ui-resizable-se",
8879     sw: ".ui-resizable-sw",
8880     ne: ".ui-resizable-ne",
8881     nw: ".ui-resizable-nw"
8882    } );
8883
8884  this._handles = $();
8885  if ( this.handles.constructor === String ) {
8886
8887   if ( this.handles === "all" ) {
8888    this.handles = "n,e,s,w,se,sw,ne,nw";
8889   }
8890
8891   n = this.handles.split( "," );
8892   this.handles = {};
8893
8894   for ( i = 0; i < n.length; i++ ) {
8895
8896    handle = $.trim( n[ i ] );
8897    hname = "ui-resizable-" + handle;
8898    axis = $( "<div>" );
8899    this._addClass( axis, "ui-resizable-handle " + hname );
8900
8901    axis.css( { zIndex: o.zIndex } );
8902
8903    this.handles[ handle ] = ".ui-resizable-" + handle;
8904    this.element.append( axis );
8905   }
8906
8907  }
8908
8909  this._renderAxis = function( target ) {
8910
8911   var i, axis, padPos, padWrapper;
8912
8913   target = target || this.element;
8914
8915   for ( i in this.handles ) {
8916
8917    if ( this.handles[ i ].constructor === String ) {
8918     this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show();
8919    } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
8920     this.handles[ i ] = $( this.handles[ i ] );
8921     this._on( this.handles[ i ], { "mousedown": that._mouseDown } );
8922    }
8923
8924    if ( this.elementIsWrapper &&
8925      this.originalElement[ 0 ]
8926       .nodeName
8927       .match( /^(textarea|input|select|button)$/i ) ) {
8928     axis = $( this.handles[ i ], this.element );
8929
8930     padWrapper = /sw|ne|nw|se|n|s/.test( i ) ?
8931      axis.outerHeight() :
8932      axis.outerWidth();
8933
8934     padPos = [ "padding",
vendor: 4,497 bytes, lines 8935-9115
8935      /ne|nw|n/.test( i ) ? "Top" :
8936      /se|sw|s/.test( i ) ? "Bottom" :
8937      /^e$/.test( i ) ? "Right" : "Left" ].join( "" );
8938
8939     target.css( padPos, padWrapper );
8940
8941     this._proportionallyResize();
8942    }
8943
8944    this._handles = this._handles.add( this.handles[ i ] );
8945   }
8946  };
8947
8948  // TODO: make renderAxis a prototype function
8949  this._renderAxis( this.element );
8950
8951  this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
8952  this._handles.disableSelection();
8953
8954  this._handles.on( "mouseover", function() {
8955   if ( !that.resizing ) {
8956    if ( this.className ) {
8957     axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i );
8958    }
8959    that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se";
8960   }
8961  } );
8962
8963  if ( o.autoHide ) {
8964   this._handles.hide();
8965   this._addClass( "ui-resizable-autohide" );
8966  }
8967 },
8968
8969 _removeHandles: function() {
8970  this._handles.remove();
8971 },
8972
8973 _mouseCapture: function( event ) {
8974  var i, handle,
8975   capture = false;
8976
8977  for ( i in this.handles ) {
8978   handle = $( this.handles[ i ] )[ 0 ];
8979   if ( handle === event.target || $.contains( handle, event.target ) ) {
8980    capture = true;
8981   }
8982  }
8983
8984  return !this.options.disabled && capture;
8985 },
8986
8987 _mouseStart: function( event ) {
8988
8989  var curleft, curtop, cursor,
8990   o = this.options,
8991   el = this.element;
8992
8993  this.resizing = true;
8994
8995  this._renderProxy();
8996
8997  curleft = this._num( this.helper.css( "left" ) );
8998  curtop = this._num( this.helper.css( "top" ) );
8999
9000  if ( o.containment ) {
9001   curleft += $( o.containment ).scrollLeft() || 0;
9002   curtop += $( o.containment ).scrollTop() || 0;
9003  }
9004
9005  this.offset = this.helper.offset();
9006  this.position = { left: curleft, top: curtop };
9007
9008  this.size = this._helper ? {
9009    width: this.helper.width(),
9010    height: this.helper.height()
9011   } : {
9012    width: el.width(),
9013    height: el.height()
9014   };
9015
9016  this.originalSize = this._helper ? {
9017    width: el.outerWidth(),
9018    height: el.outerHeight()
9019   } : {
9020    width: el.width(),
9021    height: el.height()
9022   };
9023
9024  this.sizeDiff = {
9025   width: el.outerWidth() - el.width(),
9026   height: el.outerHeight() - el.height()
9027  };
9028
9029  this.originalPosition = { left: curleft, top: curtop };
9030  this.originalMousePosition = { left: event.pageX, top: event.pageY };
9031
9032  this.aspectRatio = ( typeof o.aspectRatio === "number" ) ?
9033   o.aspectRatio :
9034   ( ( this.originalSize.width / this.originalSize.height ) || 1 );
9035
9036  cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" );
9037  $( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor );
9038
9039  this._addClass( "ui-resizable-resizing" );
9040  this._propagate( "start", event );
9041  return true;
9042 },
9043
9044 _mouseDrag: function( event ) {
9045
9046  var data, props,
9047   smp = this.originalMousePosition,
9048   a = this.axis,
9049   dx = ( event.pageX - smp.left ) || 0,
9050   dy = ( event.pageY - smp.top ) || 0,
9051   trigger = this._change[ a ];
9052
9053  this._updatePrevProperties();
9054
9055  if ( !trigger ) {
9056   return false;
9057  }
9058
9059  data = trigger.apply( this, [ event, dx, dy ] );
9060
9061  this._updateVirtualBoundaries( event.shiftKey );
9062  if ( this._aspectRatio || event.shiftKey ) {
9063   data = this._updateRatio( data, event );
9064  }
9065
9066  data = this._respectSize( data, event );
9067
9068  this._updateCache( data );
9069
9070  this._propagate( "resize", event );
9071
9072  props = this._applyChanges();
9073
9074  if ( !this._helper && this._proportionallyResizeElements.length ) {
9075   this._proportionallyResize();
9076  }
9077
9078  if ( !$.isEmptyObject( props ) ) {
9079   this._updatePrevProperties();
9080   this._trigger( "resize", event, this.ui() );
9081   this._applyChanges();
9082  }
9083
9084  return false;
9085 },
9086
9087 _mouseStop: function( event ) {
9088
9089  this.resizing = false;
9090  var pr, ista, soffseth, soffsetw, s, left, top,
9091   o = this.options, that = this;
9092
9093  if ( this._helper ) {
9094
9095   pr = this._proportionallyResizeElements;
9096   ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName );
9097   soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height;
9098   soffsetw = ista ? 0 : that.sizeDiff.width;
9099
9100   s = {
9101    width: ( that.helper.width()  - soffsetw ),
9102    height: ( that.helper.height() - soffseth )
9103   };
9104   left = ( parseFloat( that.element.css( "left" ) ) +
9105    ( that.position.left - that.originalPosition.left ) ) || null;
9106   top = ( parseFloat( that.element.css( "top" ) ) +
9107    ( that.position.top - that.originalPosition.top ) ) || null;
9108
9109   if ( !o.animate ) {
9110    this.element.css( $.extend( s, { top: top, left: left } ) );
9111   }
9112
9113   that.helper.height( that.size.height );
9114   that.helper.width( that.size.width );
9115
vendor: 15,644 bytes, lines 9116-9721
9116   if ( this._helper && !o.animate ) {
9117    this._proportionallyResize();
9118   }
9119  }
9120
9121  $( "body" ).css( "cursor", "auto" );
9122
9123  this._removeClass( "ui-resizable-resizing" );
9124
9125  this._propagate( "stop", event );
9126
9127  if ( this._helper ) {
9128   this.helper.remove();
9129  }
9130
9131  return false;
9132
9133 },
9134
9135 _updatePrevProperties: function() {
9136  this.prevPosition = {
9137   top: this.position.top,
9138   left: this.position.left
9139  };
9140  this.prevSize = {
9141   width: this.size.width,
9142   height: this.size.height
9143  };
9144 },
9145
9146 _applyChanges: function() {
9147  var props = {};
9148
9149  if ( this.position.top !== this.prevPosition.top ) {
9150   props.top = this.position.top + "px";
9151  }
9152  if ( this.position.left !== this.prevPosition.left ) {
9153   props.left = this.position.left + "px";
9154  }
9155  if ( this.size.width !== this.prevSize.width ) {
9156   props.width = this.size.width + "px";
9157  }
9158  if ( this.size.height !== this.prevSize.height ) {
9159   props.height = this.size.height + "px";
9160  }
9161
9162  this.helper.css( props );
9163
9164  return props;
9165 },
9166
9167 _updateVirtualBoundaries: function( forceAspectRatio ) {
9168  var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
9169   o = this.options;
9170
9171  b = {
9172   minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0,
9173   maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity,
9174   minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0,
9175   maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity
9176  };
9177
9178  if ( this._aspectRatio || forceAspectRatio ) {
9179   pMinWidth = b.minHeight * this.aspectRatio;
9180   pMinHeight = b.minWidth / this.aspectRatio;
9181   pMaxWidth = b.maxHeight * this.aspectRatio;
9182   pMaxHeight = b.maxWidth / this.aspectRatio;
9183
9184   if ( pMinWidth > b.minWidth ) {
9185    b.minWidth = pMinWidth;
9186   }
9187   if ( pMinHeight > b.minHeight ) {
9188    b.minHeight = pMinHeight;
9189   }
9190   if ( pMaxWidth < b.maxWidth ) {
9191    b.maxWidth = pMaxWidth;
9192   }
9193   if ( pMaxHeight < b.maxHeight ) {
9194    b.maxHeight = pMaxHeight;
9195   }
9196  }
9197  this._vBoundaries = b;
9198 },
9199
9200 _updateCache: function( data ) {
9201  this.offset = this.helper.offset();
9202  if ( this._isNumber( data.left ) ) {
9203   this.position.left = data.left;
9204  }
9205  if ( this._isNumber( data.top ) ) {
9206   this.position.top = data.top;
9207  }
9208  if ( this._isNumber( data.height ) ) {
9209   this.size.height = data.height;
9210  }
9211  if ( this._isNumber( data.width ) ) {
9212   this.size.width = data.width;
9213  }
9214 },
9215
9216 _updateRatio: function( data ) {
9217
9218  var cpos = this.position,
9219   csize = this.size,
9220   a = this.axis;
9221
9222  if ( this._isNumber( data.height ) ) {
9223   data.width = ( data.height * this.aspectRatio );
9224  } else if ( this._isNumber( data.width ) ) {
9225   data.height = ( data.width / this.aspectRatio );
9226  }
9227
9228  if ( a === "sw" ) {
9229   data.left = cpos.left + ( csize.width - data.width );
9230   data.top = null;
9231  }
9232  if ( a === "nw" ) {
9233   data.top = cpos.top + ( csize.height - data.height );
9234   data.left = cpos.left + ( csize.width - data.width );
9235  }
9236
9237  return data;
9238 },
9239
9240 _respectSize: function( data ) {
9241
9242  var o = this._vBoundaries,
9243   a = this.axis,
9244   ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ),
9245   ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ),
9246   isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ),
9247   isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ),
9248   dw = this.originalPosition.left + this.originalSize.width,
9249   dh = this.originalPosition.top + this.originalSize.height,
9250   cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a );
9251  if ( isminw ) {
9252   data.width = o.minWidth;
9253  }
9254  if ( isminh ) {
9255   data.height = o.minHeight;
9256  }
9257  if ( ismaxw ) {
9258   data.width = o.maxWidth;
9259  }
9260  if ( ismaxh ) {
9261   data.height = o.maxHeight;
9262  }
9263
9264  if ( isminw && cw ) {
9265   data.left = dw - o.minWidth;
9266  }
9267  if ( ismaxw && cw ) {
9268   data.left = dw - o.maxWidth;
9269  }
9270  if ( isminh && ch ) {
9271   data.top = dh - o.minHeight;
9272  }
9273  if ( ismaxh && ch ) {
9274   data.top = dh - o.maxHeight;
9275  }
9276
9277  // Fixing jump error on top/left - bug #2330
9278  if ( !data.width && !data.height && !data.left && data.top ) {
9279   data.top = null;
9280  } else if ( !data.width && !data.height && !data.top && data.left ) {
9281   data.left = null;
9282  }
9283
9284  return data;
9285 },
9286
9287 _getPaddingPlusBorderDimensions: function( element ) {
9288  var i = 0,
9289   widths = [],
9290   borders = [
9291    element.css( "borderTopWidth" ),
9292    element.css( "borderRightWidth" ),
9293    element.css( "borderBottomWidth" ),
9294    element.css( "borderLeftWidth" )
9295   ],
9296   paddings = [
9297    element.css( "paddingTop" ),
9298    element.css( "paddingRight" ),
9299    element.css( "paddingBottom" ),
9300    element.css( "paddingLeft" )
9301   ];
9302
9303  for ( ; i < 4; i++ ) {
9304   widths[ i ] = ( parseFloat( borders[ i ] ) || 0 );
9305   widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 );
9306  }
9307
9308  return {
9309   height: widths[ 0 ] + widths[ 2 ],
9310   width: widths[ 1 ] + widths[ 3 ]
9311  };
9312 },
9313
9314 _proportionallyResize: function() {
9315
9316  if ( !this._proportionallyResizeElements.length ) {
9317   return;
9318  }
9319
9320  var prel,
9321   i = 0,
9322   element = this.helper || this.element;
9323
9324  for ( ; i < this._proportionallyResizeElements.length; i++ ) {
9325
9326   prel = this._proportionallyResizeElements[ i ];
9327
9328   // TODO: Seems like a bug to cache this.outerDimensions
9329   // considering that we are in a loop.
9330   if ( !this.outerDimensions ) {
9331    this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
9332   }
9333
9334   prel.css( {
9335    height: ( element.height() - this.outerDimensions.height ) || 0,
9336    width: ( element.width() - this.outerDimensions.width ) || 0
9337   } );
9338
9339  }
9340
9341 },
9342
9343 _renderProxy: function() {
9344
9345  var el = this.element, o = this.options;
9346  this.elementOffset = el.offset();
9347
9348  if ( this._helper ) {
9349
9350   this.helper = this.helper || $( "<div style='overflow:hidden;'></div>" );
9351
9352   this._addClass( this.helper, this._helper );
9353   this.helper.css( {
9354    width: this.element.outerWidth(),
9355    height: this.element.outerHeight(),
9356    position: "absolute",
9357    left: this.elementOffset.left + "px",
9358    top: this.elementOffset.top + "px",
9359    zIndex: ++o.zIndex //TODO: Don't modify option
9360   } );
9361
9362   this.helper
9363    .appendTo( "body" )
9364    .disableSelection();
9365
9366  } else {
9367   this.helper = this.element;
9368  }
9369
9370 },
9371
9372 _change: {
9373  e: function( event, dx ) {
9374   return { width: this.originalSize.width + dx };
9375  },
9376  w: function( event, dx ) {
9377   var cs = this.originalSize, sp = this.originalPosition;
9378   return { left: sp.left + dx, width: cs.width - dx };
9379  },
9380  n: function( event, dx, dy ) {
9381   var cs = this.originalSize, sp = this.originalPosition;
9382   return { top: sp.top + dy, height: cs.height - dy };
9383  },
9384  s: function( event, dx, dy ) {
9385   return { height: this.originalSize.height + dy };
9386  },
9387  se: function( event, dx, dy ) {
9388   return $.extend( this._change.s.apply( this, arguments ),
9389    this._change.e.apply( this, [ event, dx, dy ] ) );
9390  },
9391  sw: function( event, dx, dy ) {
9392   return $.extend( this._change.s.apply( this, arguments ),
9393    this._change.w.apply( this, [ event, dx, dy ] ) );
9394  },
9395  ne: function( event, dx, dy ) {
9396   return $.extend( this._change.n.apply( this, arguments ),
9397    this._change.e.apply( this, [ event, dx, dy ] ) );
9398  },
9399  nw: function( event, dx, dy ) {
9400   return $.extend( this._change.n.apply( this, arguments ),
9401    this._change.w.apply( this, [ event, dx, dy ] ) );
9402  }
9403 },
9404
9405 _propagate: function( n, event ) {
9406  $.ui.plugin.call( this, n, [ event, this.ui() ] );
9407  ( n !== "resize" && this._trigger( n, event, this.ui() ) );
9408 },
9409
9410 plugins: {},
9411
9412 ui: function() {
9413  return {
9414   originalElement: this.originalElement,
9415   element: this.element,
9416   helper: this.helper,
9417   position: this.position,
9418   size: this.size,
9419   originalSize: this.originalSize,
9420   originalPosition: this.originalPosition
9421  };
9422 }
9423
9424} );
9425
9426/*
9427 * Resizable Extensions
9428 */
9429
9430$.ui.plugin.add( "resizable", "animate", {
9431
9432 stop: function( event ) {
9433  var that = $( this ).resizable( "instance" ),
9434   o = that.options,
9435   pr = that._proportionallyResizeElements,
9436   ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ),
9437   soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height,
9438   soffsetw = ista ? 0 : that.sizeDiff.width,
9439   style = {
9440    width: ( that.size.width - soffsetw ),
9441    height: ( that.size.height - soffseth )
9442   },
9443   left = ( parseFloat( that.element.css( "left" ) ) +
9444    ( that.position.left - that.originalPosition.left ) ) || null,
9445   top = ( parseFloat( that.element.css( "top" ) ) +
9446    ( that.position.top - that.originalPosition.top ) ) || null;
9447
9448  that.element.animate(
9449   $.extend( style, top && left ? { top: top, left: left } : {} ), {
9450    duration: o.animateDuration,
9451    easing: o.animateEasing,
9452    step: function() {
9453
9454     var data = {
9455      width: parseFloat( that.element.css( "width" ) ),
9456      height: parseFloat( that.element.css( "height" ) ),
9457      top: parseFloat( that.element.css( "top" ) ),
9458      left: parseFloat( that.element.css( "left" ) )
9459     };
9460
9461     if ( pr && pr.length ) {
9462      $( pr[ 0 ] ).css( { width: data.width, height: data.height } );
9463     }
9464
9465     // Propagating resize, and updating values for each animation step
9466     that._updateCache( data );
9467     that._propagate( "resize", event );
9468
9469    }
9470   }
9471  );
9472 }
9473
9474} );
9475
9476$.ui.plugin.add( "resizable", "containment", {
9477
9478 start: function() {
9479  var element, p, co, ch, cw, width, height,
9480   that = $( this ).resizable( "instance" ),
9481   o = that.options,
9482   el = that.element,
9483   oc = o.containment,
9484   ce = ( oc instanceof $ ) ?
9485    oc.get( 0 ) :
9486    ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
9487
9488  if ( !ce ) {
9489   return;
9490  }
9491
9492  that.containerElement = $( ce );
9493
9494  if ( /document/.test( oc ) || oc === document ) {
9495   that.containerOffset = {
9496    left: 0,
9497    top: 0
9498   };
9499   that.containerPosition = {
9500    left: 0,
9501    top: 0
9502   };
9503
9504   that.parentData = {
9505    element: $( document ),
9506    left: 0,
9507    top: 0,
9508    width: $( document ).width(),
9509    height: $( document ).height() || document.body.parentNode.scrollHeight
9510   };
9511  } else {
9512   element = $( ce );
9513   p = [];
9514   $( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) {
9515    p[ i ] = that._num( element.css( "padding" + name ) );
9516   } );
9517
9518   that.containerOffset = element.offset();
9519   that.containerPosition = element.position();
9520   that.containerSize = {
9521    height: ( element.innerHeight() - p[ 3 ] ),
9522    width: ( element.innerWidth() - p[ 1 ] )
9523   };
9524
9525   co = that.containerOffset;
9526   ch = that.containerSize.height;
9527   cw = that.containerSize.width;
9528   width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
9529   height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
9530
9531   that.parentData = {
9532    element: ce,
9533    left: co.left,
9534    top: co.top,
9535    width: width,
9536    height: height
9537   };
9538  }
9539 },
9540
9541 resize: function( event ) {
9542  var woset, hoset, isParent, isOffsetRelative,
9543   that = $( this ).resizable( "instance" ),
9544   o = that.options,
9545   co = that.containerOffset,
9546   cp = that.position,
9547   pRatio = that._aspectRatio || event.shiftKey,
9548   cop = {
9549    top: 0,
9550    left: 0
9551   },
9552   ce = that.containerElement,
9553   continueResize = true;
9554
9555  if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
9556   cop = co;
9557  }
9558
9559  if ( cp.left < ( that._helper ? co.left : 0 ) ) {
9560   that.size.width = that.size.width +
9561    ( that._helper ?
9562     ( that.position.left - co.left ) :
9563     ( that.position.left - cop.left ) );
9564
9565   if ( pRatio ) {
9566    that.size.height = that.size.width / that.aspectRatio;
9567    continueResize = false;
9568   }
9569   that.position.left = o.helper ? co.left : 0;
9570  }
9571
9572  if ( cp.top < ( that._helper ? co.top : 0 ) ) {
9573   that.size.height = that.size.height +
9574    ( that._helper ?
9575     ( that.position.top - co.top ) :
9576     that.position.top );
9577
9578   if ( pRatio ) {
9579    that.size.width = that.size.height * that.aspectRatio;
9580    continueResize = false;
9581   }
9582   that.position.top = that._helper ? co.top : 0;
9583  }
9584
9585  isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
9586  isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
9587
9588  if ( isParent && isOffsetRelative ) {
9589   that.offset.left = that.parentData.left + that.position.left;
9590   that.offset.top = that.parentData.top + that.position.top;
9591  } else {
9592   that.offset.left = that.element.offset().left;
9593   that.offset.top = that.element.offset().top;
9594  }
9595
9596  woset = Math.abs( that.sizeDiff.width +
9597   ( that._helper ?
9598    that.offset.left - cop.left :
9599    ( that.offset.left - co.left ) ) );
9600
9601  hoset = Math.abs( that.sizeDiff.height +
9602   ( that._helper ?
9603    that.offset.top - cop.top :
9604    ( that.offset.top - co.top ) ) );
9605
9606  if ( woset + that.size.width >= that.parentData.width ) {
9607   that.size.width = that.parentData.width - woset;
9608   if ( pRatio ) {
9609    that.size.height = that.size.width / that.aspectRatio;
9610    continueResize = false;
9611   }
9612  }
9613
9614  if ( hoset + that.size.height >= that.parentData.height ) {
9615   that.size.height = that.parentData.height - hoset;
9616   if ( pRatio ) {
9617    that.size.width = that.size.height * that.aspectRatio;
9618    continueResize = false;
9619   }
9620  }
9621
9622  if ( !continueResize ) {
9623   that.position.left = that.prevPosition.left;
9624   that.position.top = that.prevPosition.top;
9625   that.size.width = that.prevSize.width;
9626   that.size.height = that.prevSize.height;
9627  }
9628 },
9629
9630 stop: function() {
9631  var that = $( this ).resizable( "instance" ),
9632   o = that.options,
9633   co = that.containerOffset,
9634   cop = that.containerPosition,
9635   ce = that.containerElement,
9636   helper = $( that.helper ),
9637   ho = helper.offset(),
9638   w = helper.outerWidth() - that.sizeDiff.width,
9639   h = helper.outerHeight() - that.sizeDiff.height;
9640
9641  if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
9642   $( this ).css( {
9643    left: ho.left - cop.left - co.left,
9644    width: w,
9645    height: h
9646   } );
9647  }
9648
9649  if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
9650   $( this ).css( {
9651    left: ho.left - cop.left - co.left,
9652    width: w,
9653    height: h
9654   } );
9655  }
9656 }
9657} );
9658
9659$.ui.plugin.add( "resizable", "alsoResize", {
9660
9661 start: function() {
9662  var that = $( this ).resizable( "instance" ),
9663   o = that.options;
9664
9665  $( o.alsoResize ).each( function() {
9666   var el = $( this );
9667   el.data( "ui-resizable-alsoresize", {
9668    width: parseFloat( el.width() ), height: parseFloat( el.height() ),
9669    left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
9670   } );
9671  } );
9672 },
9673
9674 resize: function( event, ui ) {
9675  var that = $( this ).resizable( "instance" ),
9676   o = that.options,
9677   os = that.originalSize,
9678   op = that.originalPosition,
9679   delta = {
9680    height: ( that.size.height - os.height ) || 0,
9681    width: ( that.size.width - os.width ) || 0,
9682    top: ( that.position.top - op.top ) || 0,
9683    left: ( that.position.left - op.left ) || 0
9684   };
9685
9686   $( o.alsoResize ).each( function() {
9687    var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {},
9688     css = el.parents( ui.originalElement[ 0 ] ).length ?
9689       [ "width", "height" ] :
9690       [ "width", "height", "top", "left" ];
9691
9692    $.each( css, function( i, prop ) {
9693     var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 );
9694     if ( sum && sum >= 0 ) {
9695      style[ prop ] = sum || null;
9696     }
9697    } );
9698
9699    el.css( style );
9700   } );
9701 },
9702
9703 stop: function() {
9704  $( this ).removeData( "ui-resizable-alsoresize" );
9705 }
9706} );
9707
9708$.ui.plugin.add( "resizable", "ghost", {
9709
9710 start: function() {
9711
9712  var that = $( this ).resizable( "instance" ), cs = that.size;
9713
9714  that.ghost = that.originalElement.clone();
9715  that.ghost.css( {
9716   opacity: 0.25,
9717   display: "block",
9718   position: "relative",
9719   height: cs.height,
9720   width: cs.width,
9721   margin: 0,
vendor: 5,192 bytes, lines 9722-9945
9722   left: 0,
9723   top: 0
9724  } );
9725
9726  that._addClass( that.ghost, "ui-resizable-ghost" );
9727
9728  // DEPRECATED
9729  // TODO: remove after 1.12
9730  if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) {
9731
9732   // Ghost option
9733   that.ghost.addClass( this.options.ghost );
9734  }
9735
9736  that.ghost.appendTo( that.helper );
9737
9738 },
9739
9740 resize: function() {
9741  var that = $( this ).resizable( "instance" );
9742  if ( that.ghost ) {
9743   that.ghost.css( {
9744    position: "relative",
9745    height: that.size.height,
9746    width: that.size.width
9747   } );
9748  }
9749 },
9750
9751 stop: function() {
9752  var that = $( this ).resizable( "instance" );
9753  if ( that.ghost && that.helper ) {
9754   that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) );
9755  }
9756 }
9757
9758} );
9759
9760$.ui.plugin.add( "resizable", "grid", {
9761
9762 resize: function() {
9763  var outerDimensions,
9764   that = $( this ).resizable( "instance" ),
9765   o = that.options,
9766   cs = that.size,
9767   os = that.originalSize,
9768   op = that.originalPosition,
9769   a = that.axis,
9770   grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
9771   gridX = ( grid[ 0 ] || 1 ),
9772   gridY = ( grid[ 1 ] || 1 ),
9773   ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX,
9774   oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY,
9775   newWidth = os.width + ox,
9776   newHeight = os.height + oy,
9777   isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ),
9778   isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ),
9779   isMinWidth = o.minWidth && ( o.minWidth > newWidth ),
9780   isMinHeight = o.minHeight && ( o.minHeight > newHeight );
9781
9782  o.grid = grid;
9783
9784  if ( isMinWidth ) {
9785   newWidth += gridX;
9786  }
9787  if ( isMinHeight ) {
9788   newHeight += gridY;
9789  }
9790  if ( isMaxWidth ) {
9791   newWidth -= gridX;
9792  }
9793  if ( isMaxHeight ) {
9794   newHeight -= gridY;
9795  }
9796
9797  if ( /^(se|s|e)$/.test( a ) ) {
9798   that.size.width = newWidth;
9799   that.size.height = newHeight;
9800  } else if ( /^(ne)$/.test( a ) ) {
9801   that.size.width = newWidth;
9802   that.size.height = newHeight;
9803   that.position.top = op.top - oy;
9804  } else if ( /^(sw)$/.test( a ) ) {
9805   that.size.width = newWidth;
9806   that.size.height = newHeight;
9807   that.position.left = op.left - ox;
9808  } else {
9809   if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) {
9810    outerDimensions = that._getPaddingPlusBorderDimensions( this );
9811   }
9812
9813   if ( newHeight - gridY > 0 ) {
9814    that.size.height = newHeight;
9815    that.position.top = op.top - oy;
9816   } else {
9817    newHeight = gridY - outerDimensions.height;
9818    that.size.height = newHeight;
9819    that.position.top = op.top + os.height - newHeight;
9820   }
9821   if ( newWidth - gridX > 0 ) {
9822    that.size.width = newWidth;
9823    that.position.left = op.left - ox;
9824   } else {
9825    newWidth = gridX - outerDimensions.width;
9826    that.size.width = newWidth;
9827    that.position.left = op.left + os.width - newWidth;
9828   }
9829  }
9830 }
9831
9832} );
9833
9834var widgetsResizable = $.ui.resizable;
9835
9836
9837/*!
9838 * jQuery UI Dialog 1.12.1
9839 * http://jqueryui.com
9840 *
9841 * Copyright jQuery Foundation and other contributors
9842 * Released under the MIT license.
9843 * http://jquery.org/license
9844 */
9845
9846//>>label: Dialog
9847//>>group: Widgets
9848//>>description: Displays customizable dialog windows.
9849//>>docs: http://api.jqueryui.com/dialog/
9850//>>demos: http://jqueryui.com/dialog/
9851//>>css.structure: ../../themes/base/core.css
9852//>>css.structure: ../../themes/base/dialog.css
9853//>>css.theme: ../../themes/base/theme.css
9854
9855
9856
9857$.widget( "ui.dialog", {
9858 version: "1.12.1",
9859 options: {
9860  appendTo: "body",
9861  autoOpen: true,
9862  buttons: [],
9863  classes: {
9864   "ui-dialog": "ui-corner-all",
9865   "ui-dialog-titlebar": "ui-corner-all"
9866  },
9867  closeOnEscape: true,
9868  closeText: "Close",
9869  draggable: true,
9870  hide: null,
9871  height: "auto",
9872  maxHeight: null,
9873  maxWidth: null,
9874  minHeight: 150,
9875  minWidth: 150,
9876  modal: false,
9877  position: {
9878   my: "center",
9879   at: "center",
9880   of: window,
9881   collision: "fit",
9882
9883   // Ensure the titlebar is always visible
9884   using: function( pos ) {
9885    var topOffset = $( this ).css( pos ).offset().top;
9886    if ( topOffset < 0 ) {
9887     $( this ).css( "top", pos.top - topOffset );
9888    }
9889   }
9890  },
9891  resizable: true,
9892  show: null,
9893  title: null,
9894  width: 300,
9895
9896  // Callbacks
9897  beforeClose: null,
9898  close: null,
9899  drag: null,
9900  dragStart: null,
9901  dragStop: null,
9902  focus: null,
9903  open: null,
9904  resize: null,
9905  resizeStart: null,
9906  resizeStop: null
9907 },
9908
9909 sizeRelatedOptions: {
9910  buttons: true,
9911  height: true,
9912  maxHeight: true,
9913  maxWidth: true,
9914  minHeight: true,
9915  minWidth: true,
9916  width: true
9917 },
9918
9919 resizableRelatedOptions: {
9920  maxHeight: true,
9921  maxWidth: true,
9922  minHeight: true,
9923  minWidth: true
9924 },
9925
9926 _create: function() {
9927  this.originalCss = {
9928   display: this.element[ 0 ].style.display,
9929   width: this.element[ 0 ].style.width,
9930   minHeight: this.element[ 0 ].style.minHeight,
9931   maxHeight: this.element[ 0 ].style.maxHeight,
9932   height: this.element[ 0 ].style.height
9933  };
9934  this.originalPosition = {
9935   parent: this.element.parent(),
9936   index: this.element.parent().children().index( this.element )
9937  };
9938  this.originalTitle = this.element.attr( "title" );
9939  if ( this.options.title == null && this.originalTitle != null ) {
9940   this.options.title = this.originalTitle;
9941  }
9942
9943  // Dialogs can't be disabled
9944  if ( this.options.disabled ) {
9945   this.options.disabled = false;
vendor: 33,190 bytes, lines 9946-11245
9946  }
9947
9948  this._createWrapper();
9949
9950  this.element
9951   .show()
9952   .removeAttr( "title" )
9953   .appendTo( this.uiDialog );
9954
9955  this._addClass( "ui-dialog-content", "ui-widget-content" );
9956
9957  this._createTitlebar();
9958  this._createButtonPane();
9959
9960  if ( this.options.draggable && $.fn.draggable ) {
9961   this._makeDraggable();
9962  }
9963  if ( this.options.resizable && $.fn.resizable ) {
9964   this._makeResizable();
9965  }
9966
9967  this._isOpen = false;
9968
9969  this._trackFocus();
9970 },
9971
9972 _init: function() {
9973  if ( this.options.autoOpen ) {
9974   this.open();
9975  }
9976 },
9977
9978 _appendTo: function() {
9979  var element = this.options.appendTo;
9980  if ( element && ( element.jquery || element.nodeType ) ) {
9981   return $( element );
9982  }
9983  return this.document.find( element || "body" ).eq( 0 );
9984 },
9985
9986 _destroy: function() {
9987  var next,
9988   originalPosition = this.originalPosition;
9989
9990  this._untrackInstance();
9991  this._destroyOverlay();
9992
9993  this.element
9994   .removeUniqueId()
9995   .css( this.originalCss )
9996
9997   // Without detaching first, the following becomes really slow
9998   .detach();
9999
10000  this.uiDialog.remove();
10001
10002  if ( this.originalTitle ) {
10003   this.element.attr( "title", this.originalTitle );
10004  }
10005
10006  next = originalPosition.parent.children().eq( originalPosition.index );
10007
10008  // Don't try to place the dialog next to itself (#8613)
10009  if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
10010   next.before( this.element );
10011  } else {
10012   originalPosition.parent.append( this.element );
10013  }
10014 },
10015
10016 widget: function() {
10017  return this.uiDialog;
10018 },
10019
10020 disable: $.noop,
10021 enable: $.noop,
10022
10023 close: function( event ) {
10024  var that = this;
10025
10026  if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
10027   return;
10028  }
10029
10030  this._isOpen = false;
10031  this._focusedElement = null;
10032  this._destroyOverlay();
10033  this._untrackInstance();
10034
10035  if ( !this.opener.filter( ":focusable" ).trigger( "focus" ).length ) {
10036
10037   // Hiding a focused element doesn't trigger blur in WebKit
10038   // so in case we have nothing to focus on, explicitly blur the active element
10039   // https://bugs.webkit.org/show_bug.cgi?id=47182
10040   $.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) );
10041  }
10042
10043  this._hide( this.uiDialog, this.options.hide, function() {
10044   that._trigger( "close", event );
10045  } );
10046 },
10047
10048 isOpen: function() {
10049  return this._isOpen;
10050 },
10051
10052 moveToTop: function() {
10053  this._moveToTop();
10054 },
10055
10056 _moveToTop: function( event, silent ) {
10057  var moved = false,
10058   zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map( function() {
10059    return +$( this ).css( "z-index" );
10060   } ).get(),
10061   zIndexMax = Math.max.apply( null, zIndices );
10062
10063  if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
10064   this.uiDialog.css( "z-index", zIndexMax + 1 );
10065   moved = true;
10066  }
10067
10068  if ( moved && !silent ) {
10069   this._trigger( "focus", event );
10070  }
10071  return moved;
10072 },
10073
10074 open: function() {
10075  var that = this;
10076  if ( this._isOpen ) {
10077   if ( this._moveToTop() ) {
10078    this._focusTabbable();
10079   }
10080   return;
10081  }
10082
10083  this._isOpen = true;
10084  this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
10085
10086  this._size();
10087  this._position();
10088  this._createOverlay();
10089  this._moveToTop( null, true );
10090
10091  // Ensure the overlay is moved to the top with the dialog, but only when
10092  // opening. The overlay shouldn't move after the dialog is open so that
10093  // modeless dialogs opened after the modal dialog stack properly.
10094  if ( this.overlay ) {
10095   this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
10096  }
10097
10098  this._show( this.uiDialog, this.options.show, function() {
10099   that._focusTabbable();
10100   that._trigger( "focus" );
10101  } );
10102
10103  // Track the dialog immediately upon openening in case a focus event
10104  // somehow occurs outside of the dialog before an element inside the
10105  // dialog is focused (#10152)
10106  this._makeFocusTarget();
10107
10108  this._trigger( "open" );
10109 },
10110
10111 _focusTabbable: function() {
10112
10113  // Set focus to the first match:
10114  // 1. An element that was focused previously
10115  // 2. First element inside the dialog matching [autofocus]
10116  // 3. Tabbable element inside the content element
10117  // 4. Tabbable element inside the buttonpane
10118  // 5. The close button
10119  // 6. The dialog itself
10120  var hasFocus = this._focusedElement;
10121  if ( !hasFocus ) {
10122   hasFocus = this.element.find( "[autofocus]" );
10123  }
10124  if ( !hasFocus.length ) {
10125   hasFocus = this.element.find( ":tabbable" );
10126  }
10127  if ( !hasFocus.length ) {
10128   hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
10129  }
10130  if ( !hasFocus.length ) {
10131   hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
10132  }
10133  if ( !hasFocus.length ) {
10134   hasFocus = this.uiDialog;
10135  }
10136  hasFocus.eq( 0 ).trigger( "focus" );
10137 },
10138
10139 _keepFocus: function( event ) {
10140  function checkFocus() {
10141   var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
10142    isActive = this.uiDialog[ 0 ] === activeElement ||
10143     $.contains( this.uiDialog[ 0 ], activeElement );
10144   if ( !isActive ) {
10145    this._focusTabbable();
10146   }
10147  }
10148  event.preventDefault();
10149  checkFocus.call( this );
10150
10151  // support: IE
10152  // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
10153  // so we check again later
10154  this._delay( checkFocus );
10155 },
10156
10157 _createWrapper: function() {
10158  this.uiDialog = $( "<div>" )
10159   .hide()
10160   .attr( {
10161
10162    // Setting tabIndex makes the div focusable
10163    tabIndex: -1,
10164    role: "dialog"
10165   } )
10166   .appendTo( this._appendTo() );
10167
10168  this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" );
10169  this._on( this.uiDialog, {
10170   keydown: function( event ) {
10171    if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
10172      event.keyCode === $.ui.keyCode.ESCAPE ) {
10173     event.preventDefault();
10174     this.close( event );
10175     return;
10176    }
10177
10178    // Prevent tabbing out of dialogs
10179    if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
10180     return;
10181    }
10182    var tabbables = this.uiDialog.find( ":tabbable" ),
10183     first = tabbables.filter( ":first" ),
10184     last = tabbables.filter( ":last" );
10185
10186    if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) &&
10187      !event.shiftKey ) {
10188     this._delay( function() {
10189      first.trigger( "focus" );
10190     } );
10191     event.preventDefault();
10192    } else if ( ( event.target === first[ 0 ] ||
10193      event.target === this.uiDialog[ 0 ] ) && event.shiftKey ) {
10194     this._delay( function() {
10195      last.trigger( "focus" );
10196     } );
10197     event.preventDefault();
10198    }
10199   },
10200   mousedown: function( event ) {
10201    if ( this._moveToTop( event ) ) {
10202     this._focusTabbable();
10203    }
10204   }
10205  } );
10206
10207  // We assume that any existing aria-describedby attribute means
10208  // that the dialog content is marked up properly
10209  // otherwise we brute force the content as the description
10210  if ( !this.element.find( "[aria-describedby]" ).length ) {
10211   this.uiDialog.attr( {
10212    "aria-describedby": this.element.uniqueId().attr( "id" )
10213   } );
10214  }
10215 },
10216
10217 _createTitlebar: function() {
10218  var uiDialogTitle;
10219
10220  this.uiDialogTitlebar = $( "<div>" );
10221  this._addClass( this.uiDialogTitlebar,
10222   "ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix" );
10223  this._on( this.uiDialogTitlebar, {
10224   mousedown: function( event ) {
10225
10226    // Don't prevent click on close button (#8838)
10227    // Focusing a dialog that is partially scrolled out of view
10228    // causes the browser to scroll it into view, preventing the click event
10229    if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
10230
10231     // Dialog isn't getting focus when dragging (#8063)
10232     this.uiDialog.trigger( "focus" );
10233    }
10234   }
10235  } );
10236
10237  // Support: IE
10238  // Use type="button" to prevent enter keypresses in textboxes from closing the
10239  // dialog in IE (#9312)
10240  this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
10241   .button( {
10242    label: $( "<a>" ).text( this.options.closeText ).html(),
10243    icon: "ui-icon-closethick",
10244    showLabel: false
10245   } )
10246   .appendTo( this.uiDialogTitlebar );
10247
10248  this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" );
10249  this._on( this.uiDialogTitlebarClose, {
10250   click: function( event ) {
10251    event.preventDefault();
10252    this.close( event );
10253   }
10254  } );
10255
10256  uiDialogTitle = $( "<span>" ).uniqueId().prependTo( this.uiDialogTitlebar );
10257  this._addClass( uiDialogTitle, "ui-dialog-title" );
10258  this._title( uiDialogTitle );
10259
10260  this.uiDialogTitlebar.prependTo( this.uiDialog );
10261
10262  this.uiDialog.attr( {
10263   "aria-labelledby": uiDialogTitle.attr( "id" )
10264  } );
10265 },
10266
10267 _title: function( title ) {
10268  if ( this.options.title ) {
10269   title.text( this.options.title );
10270  } else {
10271   title.html( "&#160;" );
10272  }
10273 },
10274
10275 _createButtonPane: function() {
10276  this.uiDialogButtonPane = $( "<div>" );
10277  this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane",
10278   "ui-widget-content ui-helper-clearfix" );
10279
10280  this.uiButtonSet = $( "<div>" )
10281   .appendTo( this.uiDialogButtonPane );
10282  this._addClass( this.uiButtonSet, "ui-dialog-buttonset" );
10283
10284  this._createButtons();
10285 },
10286
10287 _createButtons: function() {
10288  var that = this,
10289   buttons = this.options.buttons;
10290
10291  // If we already have a button pane, remove it
10292  this.uiDialogButtonPane.remove();
10293  this.uiButtonSet.empty();
10294
10295  if ( $.isEmptyObject( buttons ) || ( $.isArray( buttons ) && !buttons.length ) ) {
10296   this._removeClass( this.uiDialog, "ui-dialog-buttons" );
10297   return;
10298  }
10299
10300  $.each( buttons, function( name, props ) {
10301   var click, buttonOptions;
10302   props = $.isFunction( props ) ?
10303    { click: props, text: name } :
10304    props;
10305
10306   // Default to a non-submitting button
10307   props = $.extend( { type: "button" }, props );
10308
10309   // Change the context for the click callback to be the main element
10310   click = props.click;
10311   buttonOptions = {
10312    icon: props.icon,
10313    iconPosition: props.iconPosition,
10314    showLabel: props.showLabel,
10315
10316    // Deprecated options
10317    icons: props.icons,
10318    text: props.text
10319   };
10320
10321   delete props.click;
10322   delete props.icon;
10323   delete props.iconPosition;
10324   delete props.showLabel;
10325
10326   // Deprecated options
10327   delete props.icons;
10328   if ( typeof props.text === "boolean" ) {
10329    delete props.text;
10330   }
10331
10332   $( "<button></button>", props )
10333    .button( buttonOptions )
10334    .appendTo( that.uiButtonSet )
10335    .on( "click", function() {
10336     click.apply( that.element[ 0 ], arguments );
10337    } );
10338  } );
10339  this._addClass( this.uiDialog, "ui-dialog-buttons" );
10340  this.uiDialogButtonPane.appendTo( this.uiDialog );
10341 },
10342
10343 _makeDraggable: function() {
10344  var that = this,
10345   options = this.options;
10346
10347  function filteredUi( ui ) {
10348   return {
10349    position: ui.position,
10350    offset: ui.offset
10351   };
10352  }
10353
10354  this.uiDialog.draggable( {
10355   cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
10356   handle: ".ui-dialog-titlebar",
10357   containment: "document",
10358   start: function( event, ui ) {
10359    that._addClass( $( this ), "ui-dialog-dragging" );
10360    that._blockFrames();
10361    that._trigger( "dragStart", event, filteredUi( ui ) );
10362   },
10363   drag: function( event, ui ) {
10364    that._trigger( "drag", event, filteredUi( ui ) );
10365   },
10366   stop: function( event, ui ) {
10367    var left = ui.offset.left - that.document.scrollLeft(),
10368     top = ui.offset.top - that.document.scrollTop();
10369
10370    options.position = {
10371     my: "left top",
10372     at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
10373      "top" + ( top >= 0 ? "+" : "" ) + top,
10374     of: that.window
10375    };
10376    that._removeClass( $( this ), "ui-dialog-dragging" );
10377    that._unblockFrames();
10378    that._trigger( "dragStop", event, filteredUi( ui ) );
10379   }
10380  } );
10381 },
10382
10383 _makeResizable: function() {
10384  var that = this,
10385   options = this.options,
10386   handles = options.resizable,
10387
10388   // .ui-resizable has position: relative defined in the stylesheet
10389   // but dialogs have to use absolute or fixed positioning
10390   position = this.uiDialog.css( "position" ),
10391   resizeHandles = typeof handles === "string" ?
10392    handles :
10393    "n,e,s,w,se,sw,ne,nw";
10394
10395  function filteredUi( ui ) {
10396   return {
10397    originalPosition: ui.originalPosition,
10398    originalSize: ui.originalSize,
10399    position: ui.position,
10400    size: ui.size
10401   };
10402  }
10403
10404  this.uiDialog.resizable( {
10405   cancel: ".ui-dialog-content",
10406   containment: "document",
10407   alsoResize: this.element,
10408   maxWidth: options.maxWidth,
10409   maxHeight: options.maxHeight,
10410   minWidth: options.minWidth,
10411   minHeight: this._minHeight(),
10412   handles: resizeHandles,
10413   start: function( event, ui ) {
10414    that._addClass( $( this ), "ui-dialog-resizing" );
10415    that._blockFrames();
10416    that._trigger( "resizeStart", event, filteredUi( ui ) );
10417   },
10418   resize: function( event, ui ) {
10419    that._trigger( "resize", event, filteredUi( ui ) );
10420   },
10421   stop: function( event, ui ) {
10422    var offset = that.uiDialog.offset(),
10423     left = offset.left - that.document.scrollLeft(),
10424     top = offset.top - that.document.scrollTop();
10425
10426    options.height = that.uiDialog.height();
10427    options.width = that.uiDialog.width();
10428    options.position = {
10429     my: "left top",
10430     at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
10431      "top" + ( top >= 0 ? "+" : "" ) + top,
10432     of: that.window
10433    };
10434    that._removeClass( $( this ), "ui-dialog-resizing" );
10435    that._unblockFrames();
10436    that._trigger( "resizeStop", event, filteredUi( ui ) );
10437   }
10438  } )
10439   .css( "position", position );
10440 },
10441
10442 _trackFocus: function() {
10443  this._on( this.widget(), {
10444   focusin: function( event ) {
10445    this._makeFocusTarget();
10446    this._focusedElement = $( event.target );
10447   }
10448  } );
10449 },
10450
10451 _makeFocusTarget: function() {
10452  this._untrackInstance();
10453  this._trackingInstances().unshift( this );
10454 },
10455
10456 _untrackInstance: function() {
10457  var instances = this._trackingInstances(),
10458   exists = $.inArray( this, instances );
10459  if ( exists !== -1 ) {
10460   instances.splice( exists, 1 );
10461  }
10462 },
10463
10464 _trackingInstances: function() {
10465  var instances = this.document.data( "ui-dialog-instances" );
10466  if ( !instances ) {
10467   instances = [];
10468   this.document.data( "ui-dialog-instances", instances );
10469  }
10470  return instances;
10471 },
10472
10473 _minHeight: function() {
10474  var options = this.options;
10475
10476  return options.height === "auto" ?
10477   options.minHeight :
10478   Math.min( options.minHeight, options.height );
10479 },
10480
10481 _position: function() {
10482
10483  // Need to show the dialog to get the actual offset in the position plugin
10484  var isVisible = this.uiDialog.is( ":visible" );
10485  if ( !isVisible ) {
10486   this.uiDialog.show();
10487  }
10488  this.uiDialog.position( this.options.position );
10489  if ( !isVisible ) {
10490   this.uiDialog.hide();
10491  }
10492 },
10493
10494 _setOptions: function( options ) {
10495  var that = this,
10496   resize = false,
10497   resizableOptions = {};
10498
10499  $.each( options, function( key, value ) {
10500   that._setOption( key, value );
10501
10502   if ( key in that.sizeRelatedOptions ) {
10503    resize = true;
10504   }
10505   if ( key in that.resizableRelatedOptions ) {
10506    resizableOptions[ key ] = value;
10507   }
10508  } );
10509
10510  if ( resize ) {
10511   this._size();
10512   this._position();
10513  }
10514  if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
10515   this.uiDialog.resizable( "option", resizableOptions );
10516  }
10517 },
10518
10519 _setOption: function( key, value ) {
10520  var isDraggable, isResizable,
10521   uiDialog = this.uiDialog;
10522
10523  if ( key === "disabled" ) {
10524   return;
10525  }
10526
10527  this._super( key, value );
10528
10529  if ( key === "appendTo" ) {
10530   this.uiDialog.appendTo( this._appendTo() );
10531  }
10532
10533  if ( key === "buttons" ) {
10534   this._createButtons();
10535  }
10536
10537  if ( key === "closeText" ) {
10538   this.uiDialogTitlebarClose.button( {
10539
10540    // Ensure that we always pass a string
10541    label: $( "<a>" ).text( "" + this.options.closeText ).html()
10542   } );
10543  }
10544
10545  if ( key === "draggable" ) {
10546   isDraggable = uiDialog.is( ":data(ui-draggable)" );
10547   if ( isDraggable && !value ) {
10548    uiDialog.draggable( "destroy" );
10549   }
10550
10551   if ( !isDraggable && value ) {
10552    this._makeDraggable();
10553   }
10554  }
10555
10556  if ( key === "position" ) {
10557   this._position();
10558  }
10559
10560  if ( key === "resizable" ) {
10561
10562   // currently resizable, becoming non-resizable
10563   isResizable = uiDialog.is( ":data(ui-resizable)" );
10564   if ( isResizable && !value ) {
10565    uiDialog.resizable( "destroy" );
10566   }
10567
10568   // Currently resizable, changing handles
10569   if ( isResizable && typeof value === "string" ) {
10570    uiDialog.resizable( "option", "handles", value );
10571   }
10572
10573   // Currently non-resizable, becoming resizable
10574   if ( !isResizable && value !== false ) {
10575    this._makeResizable();
10576   }
10577  }
10578
10579  if ( key === "title" ) {
10580   this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
10581  }
10582 },
10583
10584 _size: function() {
10585
10586  // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
10587  // divs will both have width and height set, so we need to reset them
10588  var nonContentHeight, minContentHeight, maxContentHeight,
10589   options = this.options;
10590
10591  // Reset content sizing
10592  this.element.show().css( {
10593   width: "auto",
10594   minHeight: 0,
10595   maxHeight: "none",
10596   height: 0
10597  } );
10598
10599  if ( options.minWidth > options.width ) {
10600   options.width = options.minWidth;
10601  }
10602
10603  // Reset wrapper sizing
10604  // determine the height of all the non-content elements
10605  nonContentHeight = this.uiDialog.css( {
10606   height: "auto",
10607   width: options.width
10608  } )
10609   .outerHeight();
10610  minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
10611  maxContentHeight = typeof options.maxHeight === "number" ?
10612   Math.max( 0, options.maxHeight - nonContentHeight ) :
10613   "none";
10614
10615  if ( options.height === "auto" ) {
10616   this.element.css( {
10617    minHeight: minContentHeight,
10618    maxHeight: maxContentHeight,
10619    height: "auto"
10620   } );
10621  } else {
10622   this.element.height( Math.max( 0, options.height - nonContentHeight ) );
10623  }
10624
10625  if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
10626   this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
10627  }
10628 },
10629
10630 _blockFrames: function() {
10631  this.iframeBlocks = this.document.find( "iframe" ).map( function() {
10632   var iframe = $( this );
10633
10634   return $( "<div>" )
10635    .css( {
10636     position: "absolute",
10637     width: iframe.outerWidth(),
10638     height: iframe.outerHeight()
10639    } )
10640    .appendTo( iframe.parent() )
10641    .offset( iframe.offset() )[ 0 ];
10642  } );
10643 },
10644
10645 _unblockFrames: function() {
10646  if ( this.iframeBlocks ) {
10647   this.iframeBlocks.remove();
10648   delete this.iframeBlocks;
10649  }
10650 },
10651
10652 _allowInteraction: function( event ) {
10653  if ( $( event.target ).closest( ".ui-dialog" ).length ) {
10654   return true;
10655  }
10656
10657  // TODO: Remove hack when datepicker implements
10658  // the .ui-front logic (#8989)
10659  return !!$( event.target ).closest( ".ui-datepicker" ).length;
10660 },
10661
10662 _createOverlay: function() {
10663  if ( !this.options.modal ) {
10664   return;
10665  }
10666
10667  // We use a delay in case the overlay is created from an
10668  // event that we're going to be cancelling (#2804)
10669  var isOpening = true;
10670  this._delay( function() {
10671   isOpening = false;
10672  } );
10673
10674  if ( !this.document.data( "ui-dialog-overlays" ) ) {
10675
10676   // Prevent use of anchors and inputs
10677   // Using _on() for an event handler shared across many instances is
10678   // safe because the dialogs stack and must be closed in reverse order
10679   this._on( this.document, {
10680    focusin: function( event ) {
10681     if ( isOpening ) {
10682      return;
10683     }
10684
10685     if ( !this._allowInteraction( event ) ) {
10686      event.preventDefault();
10687      this._trackingInstances()[ 0 ]._focusTabbable();
10688     }
10689    }
10690   } );
10691  }
10692
10693  this.overlay = $( "<div>" )
10694   .appendTo( this._appendTo() );
10695
10696  this._addClass( this.overlay, null, "ui-widget-overlay ui-front" );
10697  this._on( this.overlay, {
10698   mousedown: "_keepFocus"
10699  } );
10700  this.document.data( "ui-dialog-overlays",
10701   ( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 );
10702 },
10703
10704 _destroyOverlay: function() {
10705  if ( !this.options.modal ) {
10706   return;
10707  }
10708
10709  if ( this.overlay ) {
10710   var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
10711
10712   if ( !overlays ) {
10713    this._off( this.document, "focusin" );
10714    this.document.removeData( "ui-dialog-overlays" );
10715   } else {
10716    this.document.data( "ui-dialog-overlays", overlays );
10717   }
10718
10719   this.overlay.remove();
10720   this.overlay = null;
10721  }
10722 }
10723} );
10724
10725// DEPRECATED
10726// TODO: switch return back to widget declaration at top of file when this is removed
10727if ( $.uiBackCompat !== false ) {
10728
10729 // Backcompat for dialogClass option
10730 $.widget( "ui.dialog", $.ui.dialog, {
10731  options: {
10732   dialogClass: ""
10733  },
10734  _createWrapper: function() {
10735   this._super();
10736   this.uiDialog.addClass( this.options.dialogClass );
10737  },
10738  _setOption: function( key, value ) {
10739   if ( key === "dialogClass" ) {
10740    this.uiDialog
10741     .removeClass( this.options.dialogClass )
10742     .addClass( value );
10743   }
10744   this._superApply( arguments );
10745  }
10746 } );
10747}
10748
10749var widgetsDialog = $.ui.dialog;
10750
10751
10752/*!
10753 * jQuery UI Droppable 1.12.1
10754 * http://jqueryui.com
10755 *
10756 * Copyright jQuery Foundation and other contributors
10757 * Released under the MIT license.
10758 * http://jquery.org/license
10759 */
10760
10761//>>label: Droppable
10762//>>group: Interactions
10763//>>description: Enables drop targets for draggable elements.
10764//>>docs: http://api.jqueryui.com/droppable/
10765//>>demos: http://jqueryui.com/droppable/
10766
10767
10768
10769$.widget( "ui.droppable", {
10770 version: "1.12.1",
10771 widgetEventPrefix: "drop",
10772 options: {
10773  accept: "*",
10774  addClasses: true,
10775  greedy: false,
10776  scope: "default",
10777  tolerance: "intersect",
10778
10779  // Callbacks
10780  activate: null,
10781  deactivate: null,
10782  drop: null,
10783  out: null,
10784  over: null
10785 },
10786 _create: function() {
10787
10788  var proportions,
10789   o = this.options,
10790   accept = o.accept;
10791
10792  this.isover = false;
10793  this.isout = true;
10794
10795  this.accept = $.isFunction( accept ) ? accept : function( d ) {
10796   return d.is( accept );
10797  };
10798
10799  this.proportions = function( /* valueToWrite */ ) {
10800   if ( arguments.length ) {
10801
10802    // Store the droppable's proportions
10803    proportions = arguments[ 0 ];
10804   } else {
10805
10806    // Retrieve or derive the droppable's proportions
10807    return proportions ?
10808     proportions :
10809     proportions = {
10810      width: this.element[ 0 ].offsetWidth,
10811      height: this.element[ 0 ].offsetHeight
10812     };
10813   }
10814  };
10815
10816  this._addToManager( o.scope );
10817
10818  o.addClasses && this._addClass( "ui-droppable" );
10819
10820 },
10821
10822 _addToManager: function( scope ) {
10823
10824  // Add the reference and positions to the manager
10825  $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
10826  $.ui.ddmanager.droppables[ scope ].push( this );
10827 },
10828
10829 _splice: function( drop ) {
10830  var i = 0;
10831  for ( ; i < drop.length; i++ ) {
10832   if ( drop[ i ] === this ) {
10833    drop.splice( i, 1 );
10834   }
10835  }
10836 },
10837
10838 _destroy: function() {
10839  var drop = $.ui.ddmanager.droppables[ this.options.scope ];
10840
10841  this._splice( drop );
10842 },
10843
10844 _setOption: function( key, value ) {
10845
10846  if ( key === "accept" ) {
10847   this.accept = $.isFunction( value ) ? value : function( d ) {
10848    return d.is( value );
10849   };
10850  } else if ( key === "scope" ) {
10851   var drop = $.ui.ddmanager.droppables[ this.options.scope ];
10852
10853   this._splice( drop );
10854   this._addToManager( value );
10855  }
10856
10857  this._super( key, value );
10858 },
10859
10860 _activate: function( event ) {
10861  var draggable = $.ui.ddmanager.current;
10862
10863  this._addActiveClass();
10864  if ( draggable ) {
10865   this._trigger( "activate", event, this.ui( draggable ) );
10866  }
10867 },
10868
10869 _deactivate: function( event ) {
10870  var draggable = $.ui.ddmanager.current;
10871
10872  this._removeActiveClass();
10873  if ( draggable ) {
10874   this._trigger( "deactivate", event, this.ui( draggable ) );
10875  }
10876 },
10877
10878 _over: function( event ) {
10879
10880  var draggable = $.ui.ddmanager.current;
10881
10882  // Bail if draggable and droppable are same element
10883  if ( !draggable || ( draggable.currentItem ||
10884    draggable.element )[ 0 ] === this.element[ 0 ] ) {
10885   return;
10886  }
10887
10888  if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
10889    draggable.element ) ) ) {
10890   this._addHoverClass();
10891   this._trigger( "over", event, this.ui( draggable ) );
10892  }
10893
10894 },
10895
10896 _out: function( event ) {
10897
10898  var draggable = $.ui.ddmanager.current;
10899
10900  // Bail if draggable and droppable are same element
10901  if ( !draggable || ( draggable.currentItem ||
10902    draggable.element )[ 0 ] === this.element[ 0 ] ) {
10903   return;
10904  }
10905
10906  if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
10907    draggable.element ) ) ) {
10908   this._removeHoverClass();
10909   this._trigger( "out", event, this.ui( draggable ) );
10910  }
10911
10912 },
10913
10914 _drop: function( event, custom ) {
10915
10916  var draggable = custom || $.ui.ddmanager.current,
10917   childrenIntersection = false;
10918
10919  // Bail if draggable and droppable are same element
10920  if ( !draggable || ( draggable.currentItem ||
10921    draggable.element )[ 0 ] === this.element[ 0 ] ) {
10922   return false;
10923  }
10924
10925  this.element
10926   .find( ":data(ui-droppable)" )
10927   .not( ".ui-draggable-dragging" )
10928   .each( function() {
10929    var inst = $( this ).droppable( "instance" );
10930    if (
10931     inst.options.greedy &&
10932     !inst.options.disabled &&
10933     inst.options.scope === draggable.options.scope &&
10934     inst.accept.call(
10935      inst.element[ 0 ], ( draggable.currentItem || draggable.element )
10936     ) &&
10937     intersect(
10938      draggable,
10939      $.extend( inst, { offset: inst.element.offset() } ),
10940      inst.options.tolerance, event
10941     )
10942    ) {
10943     childrenIntersection = true;
10944     return false; }
10945   } );
10946  if ( childrenIntersection ) {
10947   return false;
10948  }
10949
10950  if ( this.accept.call( this.element[ 0 ],
10951    ( draggable.currentItem || draggable.element ) ) ) {
10952   this._removeActiveClass();
10953   this._removeHoverClass();
10954
10955   this._trigger( "drop", event, this.ui( draggable ) );
10956   return this.element;
10957  }
10958
10959  return false;
10960
10961 },
10962
10963 ui: function( c ) {
10964  return {
10965   draggable: ( c.currentItem || c.element ),
10966   helper: c.helper,
10967   position: c.position,
10968   offset: c.positionAbs
10969  };
10970 },
10971
10972 // Extension points just to make backcompat sane and avoid duplicating logic
10973 // TODO: Remove in 1.13 along with call to it below
10974 _addHoverClass: function() {
10975  this._addClass( "ui-droppable-hover" );
10976 },
10977
10978 _removeHoverClass: function() {
10979  this._removeClass( "ui-droppable-hover" );
10980 },
10981
10982 _addActiveClass: function() {
10983  this._addClass( "ui-droppable-active" );
10984 },
10985
10986 _removeActiveClass: function() {
10987  this._removeClass( "ui-droppable-active" );
10988 }
10989} );
10990
10991var intersect = $.ui.intersect = ( function() {
10992 function isOverAxis( x, reference, size ) {
10993  return ( x >= reference ) && ( x < ( reference + size ) );
10994 }
10995
10996 return function( draggable, droppable, toleranceMode, event ) {
10997
10998  if ( !droppable.offset ) {
10999   return false;
11000  }
11001
11002  var x1 = ( draggable.positionAbs ||
11003    draggable.position.absolute ).left + draggable.margins.left,
11004   y1 = ( draggable.positionAbs ||
11005    draggable.position.absolute ).top + draggable.margins.top,
11006   x2 = x1 + draggable.helperProportions.width,
11007   y2 = y1 + draggable.helperProportions.height,
11008   l = droppable.offset.left,
11009   t = droppable.offset.top,
11010   r = l + droppable.proportions().width,
11011   b = t + droppable.proportions().height;
11012
11013  switch ( toleranceMode ) {
11014  case "fit":
11015   return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
11016  case "intersect":
11017   return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
11018    x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
11019    t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
11020    y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
11021  case "pointer":
11022   return isOverAxis( event.pageY, t, droppable.proportions().height ) &&
11023    isOverAxis( event.pageX, l, droppable.proportions().width );
11024  case "touch":
11025   return (
11026    ( y1 >= t && y1 <= b ) || // Top edge touching
11027    ( y2 >= t && y2 <= b ) || // Bottom edge touching
11028    ( y1 < t && y2 > b ) // Surrounded vertically
11029   ) && (
11030    ( x1 >= l && x1 <= r ) || // Left edge touching
11031    ( x2 >= l && x2 <= r ) || // Right edge touching
11032    ( x1 < l && x2 > r ) // Surrounded horizontally
11033   );
11034  default:
11035   return false;
11036  }
11037 };
11038} )();
11039
11040/*
11041 This manager tracks offsets of draggables and droppables
11042*/
11043$.ui.ddmanager = {
11044 current: null,
11045 droppables: { "default": [] },
11046 prepareOffsets: function( t, event ) {
11047
11048  var i, j,
11049   m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
11050   type = event ? event.type : null, // workaround for #2317
11051   list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
11052
11053  droppablesLoop: for ( i = 0; i < m.length; i++ ) {
11054
11055   // No disabled and non-accepted
11056   if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ],
11057     ( t.currentItem || t.element ) ) ) ) {
11058    continue;
11059   }
11060
11061   // Filter out elements in the current dragged item
11062   for ( j = 0; j < list.length; j++ ) {
11063    if ( list[ j ] === m[ i ].element[ 0 ] ) {
11064     m[ i ].proportions().height = 0;
11065     continue droppablesLoop;
11066    }
11067   }
11068
11069   m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
11070   if ( !m[ i ].visible ) {
11071    continue;
11072   }
11073
11074   // Activate the droppable if used directly from draggables
11075   if ( type === "mousedown" ) {
11076    m[ i ]._activate.call( m[ i ], event );
11077   }
11078
11079   m[ i ].offset = m[ i ].element.offset();
11080   m[ i ].proportions( {
11081    width: m[ i ].element[ 0 ].offsetWidth,
11082    height: m[ i ].element[ 0 ].offsetHeight
11083   } );
11084
11085  }
11086
11087 },
11088 drop: function( draggable, event ) {
11089
11090  var dropped = false;
11091
11092  // Create a copy of the droppables in case the list changes during the drop (#9116)
11093  $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
11094
11095   if ( !this.options ) {
11096    return;
11097   }
11098   if ( !this.options.disabled && this.visible &&
11099     intersect( draggable, this, this.options.tolerance, event ) ) {
11100    dropped = this._drop.call( this, event ) || dropped;
11101   }
11102
11103   if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ],
11104     ( draggable.currentItem || draggable.element ) ) ) {
11105    this.isout = true;
11106    this.isover = false;
11107    this._deactivate.call( this, event );
11108   }
11109
11110  } );
11111  return dropped;
11112
11113 },
11114 dragStart: function( draggable, event ) {
11115
11116  // Listen for scrolling so that if the dragging causes scrolling the position of the
11117  // droppables can be recalculated (see #5003)
11118  draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() {
11119   if ( !draggable.options.refreshPositions ) {
11120    $.ui.ddmanager.prepareOffsets( draggable, event );
11121   }
11122  } );
11123 },
11124 drag: function( draggable, event ) {
11125
11126  // If you have a highly dynamic page, you might try this option. It renders positions
11127  // every time you move the mouse.
11128  if ( draggable.options.refreshPositions ) {
11129   $.ui.ddmanager.prepareOffsets( draggable, event );
11130  }
11131
11132  // Run through all droppables and check their positions based on specific tolerance options
11133  $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
11134
11135   if ( this.options.disabled || this.greedyChild || !this.visible ) {
11136    return;
11137   }
11138
11139   var parentInstance, scope, parent,
11140    intersects = intersect( draggable, this, this.options.tolerance, event ),
11141    c = !intersects && this.isover ?
11142     "isout" :
11143     ( intersects && !this.isover ? "isover" : null );
11144   if ( !c ) {
11145    return;
11146   }
11147
11148   if ( this.options.greedy ) {
11149
11150    // find droppable parents with same scope
11151    scope = this.options.scope;
11152    parent = this.element.parents( ":data(ui-droppable)" ).filter( function() {
11153     return $( this ).droppable( "instance" ).options.scope === scope;
11154    } );
11155
11156    if ( parent.length ) {
11157     parentInstance = $( parent[ 0 ] ).droppable( "instance" );
11158     parentInstance.greedyChild = ( c === "isover" );
11159    }
11160   }
11161
11162   // We just moved into a greedy child
11163   if ( parentInstance && c === "isover" ) {
11164    parentInstance.isover = false;
11165    parentInstance.isout = true;
11166    parentInstance._out.call( parentInstance, event );
11167   }
11168
11169   this[ c ] = true;
11170   this[ c === "isout" ? "isover" : "isout" ] = false;
11171   this[ c === "isover" ? "_over" : "_out" ].call( this, event );
11172
11173   // We just moved out of a greedy child
11174   if ( parentInstance && c === "isout" ) {
11175    parentInstance.isout = false;
11176    parentInstance.isover = true;
11177    parentInstance._over.call( parentInstance, event );
11178   }
11179  } );
11180
11181 },
11182 dragStop: function( draggable, event ) {
11183  draggable.element.parentsUntil( "body" ).off( "scroll.droppable" );
11184
11185  // Call prepareOffsets one final time since IE does not fire return scroll events when
11186  // overflow was caused by drag (see #5003)
11187  if ( !draggable.options.refreshPositions ) {
11188   $.ui.ddmanager.prepareOffsets( draggable, event );
11189  }
11190 }
11191};
11192
11193// DEPRECATED
11194// TODO: switch return back to widget declaration at top of file when this is removed
11195if ( $.uiBackCompat !== false ) {
11196
11197 // Backcompat for activeClass and hoverClass options
11198 $.widget( "ui.droppable", $.ui.droppable, {
11199  options: {
11200   hoverClass: false,
11201   activeClass: false
11202  },
11203  _addActiveClass: function() {
11204   this._super();
11205   if ( this.options.activeClass ) {
11206    this.element.addClass( this.options.activeClass );
11207   }
11208  },
11209  _removeActiveClass: function() {
11210   this._super();
11211   if ( this.options.activeClass ) {
11212    this.element.removeClass( this.options.activeClass );
11213   }
11214  },
11215  _addHoverClass: function() {
11216   this._super();
11217   if ( this.options.hoverClass ) {
11218    this.element.addClass( this.options.hoverClass );
11219   }
11220  },
11221  _removeHoverClass: function() {
11222   this._super();
11223   if ( this.options.hoverClass ) {
11224    this.element.removeClass( this.options.hoverClass );
11225   }
11226  }
11227 } );
11228}
11229
11230var widgetsDroppable = $.ui.droppable;
11231
11232
11233/*!
11234 * jQuery UI Progressbar 1.12.1
11235 * http://jqueryui.com
11236 *
11237 * Copyright jQuery Foundation and other contributors
11238 * Released under the MIT license.
11239 * http://jquery.org/license
11240 */
11241
11242//>>label: Progressbar
11243//>>group: Widgets
11244// jscs:disable maximumLineLength
11245//>>
vendor: 15,214 bytes, lines 11245-11838
11245description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
11246// jscs:enable maximumLineLength
11247//>>docs: http://api.jqueryui.com/progressbar/
11248//>>demos: http://jqueryui.com/progressbar/
11249//>>css.structure: ../../themes/base/core.css
11250//>>css.structure: ../../themes/base/progressbar.css
11251//>>css.theme: ../../themes/base/theme.css
11252
11253
11254
11255var widgetsProgressbar = $.widget( "ui.progressbar", {
11256 version: "1.12.1",
11257 options: {
11258  classes: {
11259   "ui-progressbar": "ui-corner-all",
11260   "ui-progressbar-value": "ui-corner-left",
11261   "ui-progressbar-complete": "ui-corner-right"
11262  },
11263  max: 100,
11264  value: 0,
11265
11266  change: null,
11267  complete: null
11268 },
11269
11270 min: 0,
11271
11272 _create: function() {
11273
11274  // Constrain initial value
11275  this.oldValue = this.options.value = this._constrainedValue();
11276
11277  this.element.attr( {
11278
11279   // Only set static values; aria-valuenow and aria-valuemax are
11280   // set inside _refreshValue()
11281   role: "progressbar",
11282   "aria-valuemin": this.min
11283  } );
11284  this._addClass( "ui-progressbar", "ui-widget ui-widget-content" );
11285
11286  this.valueDiv = $( "<div>" ).appendTo( this.element );
11287  this._addClass( this.valueDiv, "ui-progressbar-value", "ui-widget-header" );
11288  this._refreshValue();
11289 },
11290
11291 _destroy: function() {
11292  this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" );
11293
11294  this.valueDiv.remove();
11295 },
11296
11297 value: function( newValue ) {
11298  if ( newValue === undefined ) {
11299   return this.options.value;
11300  }
11301
11302  this.options.value = this._constrainedValue( newValue );
11303  this._refreshValue();
11304 },
11305
11306 _constrainedValue: function( newValue ) {
11307  if ( newValue === undefined ) {
11308   newValue = this.options.value;
11309  }
11310
11311  this.indeterminate = newValue === false;
11312
11313  // Sanitize value
11314  if ( typeof newValue !== "number" ) {
11315   newValue = 0;
11316  }
11317
11318  return this.indeterminate ? false :
11319   Math.min( this.options.max, Math.max( this.min, newValue ) );
11320 },
11321
11322 _setOptions: function( options ) {
11323
11324  // Ensure "value" option is set after other values (like max)
11325  var value = options.value;
11326  delete options.value;
11327
11328  this._super( options );
11329
11330  this.options.value = this._constrainedValue( value );
11331  this._refreshValue();
11332 },
11333
11334 _setOption: function( key, value ) {
11335  if ( key === "max" ) {
11336
11337   // Don't allow a max less than min
11338   value = Math.max( this.min, value );
11339  }
11340  this._super( key, value );
11341 },
11342
11343 _setOptionDisabled: function( value ) {
11344  this._super( value );
11345
11346  this.element.attr( "aria-disabled", value );
11347  this._toggleClass( null, "ui-state-disabled", !!value );
11348 },
11349
11350 _percentage: function() {
11351  return this.indeterminate ?
11352   100 :
11353   100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
11354 },
11355
11356 _refreshValue: function() {
11357  var value = this.options.value,
11358   percentage = this._percentage();
11359
11360  this.valueDiv
11361   .toggle( this.indeterminate || value > this.min )
11362   .width( percentage.toFixed( 0 ) + "%" );
11363
11364  this
11365   ._toggleClass( this.valueDiv, "ui-progressbar-complete", null,
11366    value === this.options.max )
11367   ._toggleClass( "ui-progressbar-indeterminate", null, this.indeterminate );
11368
11369  if ( this.indeterminate ) {
11370   this.element.removeAttr( "aria-valuenow" );
11371   if ( !this.overlayDiv ) {
11372    this.overlayDiv = $( "<div>" ).appendTo( this.valueDiv );
11373    this._addClass( this.overlayDiv, "ui-progressbar-overlay" );
11374   }
11375  } else {
11376   this.element.attr( {
11377    "aria-valuemax": this.options.max,
11378    "aria-valuenow": value
11379   } );
11380   if ( this.overlayDiv ) {
11381    this.overlayDiv.remove();
11382    this.overlayDiv = null;
11383   }
11384  }
11385
11386  if ( this.oldValue !== value ) {
11387   this.oldValue = value;
11388   this._trigger( "change" );
11389  }
11390  if ( value === this.options.max ) {
11391   this._trigger( "complete" );
11392  }
11393 }
11394} );
11395
11396
11397/*!
11398 * jQuery UI Selectable 1.12.1
11399 * http://jqueryui.com
11400 *
11401 * Copyright jQuery Foundation and other contributors
11402 * Released under the MIT license.
11403 * http://jquery.org/license
11404 */
11405
11406//>>label: Selectable
11407//>>group: Interactions
11408//>>description: Allows groups of elements to be selected with the mouse.
11409//>>docs: http://api.jqueryui.com/selectable/
11410//>>demos: http://jqueryui.com/selectable/
11411//>>css.structure: ../../themes/base/selectable.css
11412
11413
11414
11415var widgetsSelectable = $.widget( "ui.selectable", $.ui.mouse, {
11416 version: "1.12.1",
11417 options: {
11418  appendTo: "body",
11419  autoRefresh: true,
11420  distance: 0,
11421  filter: "*",
11422  tolerance: "touch",
11423
11424  // Callbacks
11425  selected: null,
11426  selecting: null,
11427  start: null,
11428  stop: null,
11429  unselected: null,
11430  unselecting: null
11431 },
11432 _create: function() {
11433  var that = this;
11434
11435  this._addClass( "ui-selectable" );
11436
11437  this.dragged = false;
11438
11439  // Cache selectee children based on filter
11440  this.refresh = function() {
11441   that.elementPos = $( that.element[ 0 ] ).offset();
11442   that.selectees = $( that.options.filter, that.element[ 0 ] );
11443   that._addClass( that.selectees, "ui-selectee" );
11444   that.selectees.each( function() {
11445    var $this = $( this ),
11446     selecteeOffset = $this.offset(),
11447     pos = {
11448      left: selecteeOffset.left - that.elementPos.left,
11449      top: selecteeOffset.top - that.elementPos.top
11450     };
11451    $.data( this, "selectable-item", {
11452     element: this,
11453     $element: $this,
11454     left: pos.left,
11455     top: pos.top,
11456     right: pos.left + $this.outerWidth(),
11457     bottom: pos.top + $this.outerHeight(),
11458     startselected: false,
11459     selected: $this.hasClass( "ui-selected" ),
11460     selecting: $this.hasClass( "ui-selecting" ),
11461     unselecting: $this.hasClass( "ui-unselecting" )
11462    } );
11463   } );
11464  };
11465  this.refresh();
11466
11467  this._mouseInit();
11468
11469  this.helper = $( "<div>" );
11470  this._addClass( this.helper, "ui-selectable-helper" );
11471 },
11472
11473 _destroy: function() {
11474  this.selectees.removeData( "selectable-item" );
11475  this._mouseDestroy();
11476 },
11477
11478 _mouseStart: function( event ) {
11479  var that = this,
11480   options = this.options;
11481
11482  this.opos = [ event.pageX, event.pageY ];
11483  this.elementPos = $( this.element[ 0 ] ).offset();
11484
11485  if ( this.options.disabled ) {
11486   return;
11487  }
11488
11489  this.selectees = $( options.filter, this.element[ 0 ] );
11490
11491  this._trigger( "start", event );
11492
11493  $( options.appendTo ).append( this.helper );
11494
11495  // position helper (lasso)
11496  this.helper.css( {
11497   "left": event.pageX,
11498   "top": event.pageY,
11499   "width": 0,
11500   "height": 0
11501  } );
11502
11503  if ( options.autoRefresh ) {
11504   this.refresh();
11505  }
11506
11507  this.selectees.filter( ".ui-selected" ).each( function() {
11508   var selectee = $.data( this, "selectable-item" );
11509   selectee.startselected = true;
11510   if ( !event.metaKey && !event.ctrlKey ) {
11511    that._removeClass( selectee.$element, "ui-selected" );
11512    selectee.selected = false;
11513    that._addClass( selectee.$element, "ui-unselecting" );
11514    selectee.unselecting = true;
11515
11516    // selectable UNSELECTING callback
11517    that._trigger( "unselecting", event, {
11518     unselecting: selectee.element
11519    } );
11520   }
11521  } );
11522
11523  $( event.target ).parents().addBack().each( function() {
11524   var doSelect,
11525    selectee = $.data( this, "selectable-item" );
11526   if ( selectee ) {
11527    doSelect = ( !event.metaKey && !event.ctrlKey ) ||
11528     !selectee.$element.hasClass( "ui-selected" );
11529    that._removeClass( selectee.$element, doSelect ? "ui-unselecting" : "ui-selected" )
11530     ._addClass( selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting" );
11531    selectee.unselecting = !doSelect;
11532    selectee.selecting = doSelect;
11533    selectee.selected = doSelect;
11534
11535    // selectable (UN)SELECTING callback
11536    if ( doSelect ) {
11537     that._trigger( "selecting", event, {
11538      selecting: selectee.element
11539     } );
11540    } else {
11541     that._trigger( "unselecting", event, {
11542      unselecting: selectee.element
11543     } );
11544    }
11545    return false;
11546   }
11547  } );
11548
11549 },
11550
11551 _mouseDrag: function( event ) {
11552
11553  this.dragged = true;
11554
11555  if ( this.options.disabled ) {
11556   return;
11557  }
11558
11559  var tmp,
11560   that = this,
11561   options = this.options,
11562   x1 = this.opos[ 0 ],
11563   y1 = this.opos[ 1 ],
11564   x2 = event.pageX,
11565   y2 = event.pageY;
11566
11567  if ( x1 > x2 ) { tmp = x2; x2 = x1; x1 = tmp; }
11568  if ( y1 > y2 ) { tmp = y2; y2 = y1; y1 = tmp; }
11569  this.helper.css( { left: x1, top: y1, width: x2 - x1, height: y2 - y1 } );
11570
11571  this.selectees.each( function() {
11572   var selectee = $.data( this, "selectable-item" ),
11573    hit = false,
11574    offset = {};
11575
11576   //prevent helper from being selected if appendTo: selectable
11577   if ( !selectee || selectee.element === that.element[ 0 ] ) {
11578    return;
11579   }
11580
11581   offset.left   = selectee.left   + that.elementPos.left;
11582   offset.right  = selectee.right  + that.elementPos.left;
11583   offset.top    = selectee.top    + that.elementPos.top;
11584   offset.bottom = selectee.bottom + that.elementPos.top;
11585
11586   if ( options.tolerance === "touch" ) {
11587    hit = ( !( offset.left > x2 || offset.right < x1 || offset.top > y2 ||
11588                    offset.bottom < y1 ) );
11589   } else if ( options.tolerance === "fit" ) {
11590    hit = ( offset.left > x1 && offset.right < x2 && offset.top > y1 &&
11591                    offset.bottom < y2 );
11592   }
11593
11594   if ( hit ) {
11595
11596    // SELECT
11597    if ( selectee.selected ) {
11598     that._removeClass( selectee.$element, "ui-selected" );
11599     selectee.selected = false;
11600    }
11601    if ( selectee.unselecting ) {
11602     that._removeClass( selectee.$element, "ui-unselecting" );
11603     selectee.unselecting = false;
11604    }
11605    if ( !selectee.selecting ) {
11606     that._addClass( selectee.$element, "ui-selecting" );
11607     selectee.selecting = true;
11608
11609     // selectable SELECTING callback
11610     that._trigger( "selecting", event, {
11611      selecting: selectee.element
11612     } );
11613    }
11614   } else {
11615
11616    // UNSELECT
11617    if ( selectee.selecting ) {
11618     if ( ( event.metaKey || event.ctrlKey ) && selectee.startselected ) {
11619      that._removeClass( selectee.$element, "ui-selecting" );
11620      selectee.selecting = false;
11621      that._addClass( selectee.$element, "ui-selected" );
11622      selectee.selected = true;
11623     } else {
11624      that._removeClass( selectee.$element, "ui-selecting" );
11625      selectee.selecting = false;
11626      if ( selectee.startselected ) {
11627       that._addClass( selectee.$element, "ui-unselecting" );
11628       selectee.unselecting = true;
11629      }
11630
11631      // selectable UNSELECTING callback
11632      that._trigger( "unselecting", event, {
11633       unselecting: selectee.element
11634      } );
11635     }
11636    }
11637    if ( selectee.selected ) {
11638     if ( !event.metaKey && !event.ctrlKey && !selectee.startselected ) {
11639      that._removeClass( selectee.$element, "ui-selected" );
11640      selectee.selected = false;
11641
11642      that._addClass( selectee.$element, "ui-unselecting" );
11643      selectee.unselecting = true;
11644
11645      // selectable UNSELECTING callback
11646      that._trigger( "unselecting", event, {
11647       unselecting: selectee.element
11648      } );
11649     }
11650    }
11651   }
11652  } );
11653
11654  return false;
11655 },
11656
11657 _mouseStop: function( event ) {
11658  var that = this;
11659
11660  this.dragged = false;
11661
11662  $( ".ui-unselecting", this.element[ 0 ] ).each( function() {
11663   var selectee = $.data( this, "selectable-item" );
11664   that._removeClass( selectee.$element, "ui-unselecting" );
11665   selectee.unselecting = false;
11666   selectee.startselected = false;
11667   that._trigger( "unselected", event, {
11668    unselected: selectee.element
11669   } );
11670  } );
11671  $( ".ui-selecting", this.element[ 0 ] ).each( function() {
11672   var selectee = $.data( this, "selectable-item" );
11673   that._removeClass( selectee.$element, "ui-selecting" )
11674    ._addClass( selectee.$element, "ui-selected" );
11675   selectee.selecting = false;
11676   selectee.selected = true;
11677   selectee.startselected = true;
11678   that._trigger( "selected", event, {
11679    selected: selectee.element
11680   } );
11681  } );
11682  this._trigger( "stop", event );
11683
11684  this.helper.remove();
11685
11686  return false;
11687 }
11688
11689} );
11690
11691
11692/*!
11693 * jQuery UI Selectmenu 1.12.1
11694 * http://jqueryui.com
11695 *
11696 * Copyright jQuery Foundation and other contributors
11697 * Released under the MIT license.
11698 * http://jquery.org/license
11699 */
11700
11701//>>label: Selectmenu
11702//>>group: Widgets
11703// jscs:disable maximumLineLength
11704//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
11705// jscs:enable maximumLineLength
11706//>>docs: http://api.jqueryui.com/selectmenu/
11707//>>demos: http://jqueryui.com/selectmenu/
11708//>>css.structure: ../../themes/base/core.css
11709//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css
11710//>>css.theme: ../../themes/base/theme.css
11711
11712
11713
11714var widgetsSelectmenu = $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
11715 version: "1.12.1",
11716 defaultElement: "<select>",
11717 options: {
11718  appendTo: null,
11719  classes: {
11720   "ui-selectmenu-button-open": "ui-corner-top",
11721   "ui-selectmenu-button-closed": "ui-corner-all"
11722  },
11723  disabled: null,
11724  icons: {
11725   button: "ui-icon-triangle-1-s"
11726  },
11727  position: {
11728   my: "left top",
11729   at: "left bottom",
11730   collision: "none"
11731  },
11732  width: false,
11733
11734  // Callbacks
11735  change: null,
11736  close: null,
11737  focus: null,
11738  open: null,
11739  select: null
11740 },
11741
11742 _create: function() {
11743  var selectmenuId = this.element.uniqueId().attr( "id" );
11744  this.ids = {
11745   element: selectmenuId,
11746   button: selectmenuId + "-button",
11747   menu: selectmenuId + "-menu"
11748  };
11749
11750  this._drawButton();
11751  this._drawMenu();
11752  this._bindFormResetHandler();
11753
11754  this._rendered = false;
11755  this.menuItems = $();
11756 },
11757
11758 _drawButton: function() {
11759  var icon,
11760   that = this,
11761   item = this._parseOption(
11762    this.element.find( "option:selected" ),
11763    this.element[ 0 ].selectedIndex
11764   );
11765
11766  // Associate existing label with the new button
11767  this.labels = this.element.labels().attr( "for", this.ids.button );
11768  this._on( this.labels, {
11769   click: function( event ) {
11770    this.button.focus();
11771    event.preventDefault();
11772   }
11773  } );
11774
11775  // Hide original select element
11776  this.element.hide();
11777
11778  // Create button
11779  this.button = $( "<span>", {
11780   tabindex: this.options.disabled ? -1 : 0,
11781   id: this.ids.button,
11782   role: "combobox",
11783   "aria-expanded": "false",
11784   "aria-autocomplete": "list",
11785   "aria-owns": this.ids.menu,
11786   "aria-haspopup": "true",
11787   title: this.element.attr( "title" )
11788  } )
11789   .insertAfter( this.element );
11790
11791  this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
11792   "ui-button ui-widget" );
11793
11794  icon = $( "<span>" ).appendTo( this.button );
11795  this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button );
11796  this.buttonItem = this._renderButtonItem( item )
11797   .appendTo( this.button );
11798
11799  if ( this.options.width !== false ) {
11800   this._resizeButton();
11801  }
11802
11803  this._on( this.button, this._buttonEvents );
11804  this.button.one( "focusin", function() {
11805
11806   // Delay rendering the menu items until the button receives focus.
11807   // The menu may have already been rendered via a programmatic open.
11808   if ( !that._rendered ) {
11809    that._refreshMenu();
11810   }
11811  } );
11812 },
11813
11814 _drawMenu: function() {
11815  var that = this;
11816
11817  // Create menu
11818  this.menu = $( "<ul>", {
11819   "aria-hidden": "true",
11820   "aria-labelledby": this.ids.button,
11821   id: this.ids.menu
11822  } );
11823
11824  // Wrap menu
11825  this.menuWrap = $( "<div>" ).append( this.menu );
11826  this._addClass( this.menuWrap, "ui-selectmenu-menu", "ui-front" );
11827  this.menuWrap.appendTo( this._appendTo() );
11828
11829  // Initialize menu widget
11830  this.menuInstance = this.menu
11831   .menu( {
11832    classes: {
11833     "ui-menu": "ui-corner-bottom"
11834    },
11835    role: "listbox",
11836    select: function( event, ui ) {
11837     event.preventDefault();
11838
vendor: 6,761 bytes, lines 11839-12133
11839     // Support: IE8
11840     // If the item was selected via a click, the text selection
11841     // will be destroyed in IE
11842     that._setSelection();
11843
11844     that._select( ui.item.data( "ui-selectmenu-item" ), event );
11845    },
11846    focus: function( event, ui ) {
11847     var item = ui.item.data( "ui-selectmenu-item" );
11848
11849     // Prevent inital focus from firing and check if its a newly focused item
11850     if ( that.focusIndex != null && item.index !== that.focusIndex ) {
11851      that._trigger( "focus", event, { item: item } );
11852      if ( !that.isOpen ) {
11853       that._select( item, event );
11854      }
11855     }
11856     that.focusIndex = item.index;
11857
11858     that.button.attr( "aria-activedescendant",
11859      that.menuItems.eq( item.index ).attr( "id" ) );
11860    }
11861   } )
11862   .menu( "instance" );
11863
11864  // Don't close the menu on mouseleave
11865  this.menuInstance._off( this.menu, "mouseleave" );
11866
11867  // Cancel the menu's collapseAll on document click
11868  this.menuInstance._closeOnDocumentClick = function() {
11869   return false;
11870  };
11871
11872  // Selects often contain empty items, but never contain dividers
11873  this.menuInstance._isDivider = function() {
11874   return false;
11875  };
11876 },
11877
11878 refresh: function() {
11879  this._refreshMenu();
11880  this.buttonItem.replaceWith(
11881   this.buttonItem = this._renderButtonItem(
11882
11883    // Fall back to an empty object in case there are no options
11884    this._getSelectedItem().data( "ui-selectmenu-item" ) || {}
11885   )
11886  );
11887  if ( this.options.width === null ) {
11888   this._resizeButton();
11889  }
11890 },
11891
11892 _refreshMenu: function() {
11893  var item,
11894   options = this.element.find( "option" );
11895
11896  this.menu.empty();
11897
11898  this._parseOptions( options );
11899  this._renderMenu( this.menu, this.items );
11900
11901  this.menuInstance.refresh();
11902  this.menuItems = this.menu.find( "li" )
11903   .not( ".ui-selectmenu-optgroup" )
11904    .find( ".ui-menu-item-wrapper" );
11905
11906  this._rendered = true;
11907
11908  if ( !options.length ) {
11909   return;
11910  }
11911
11912  item = this._getSelectedItem();
11913
11914  // Update the menu to have the correct item focused
11915  this.menuInstance.focus( null, item );
11916  this._setAria( item.data( "ui-selectmenu-item" ) );
11917
11918  // Set disabled state
11919  this._setOption( "disabled", this.element.prop( "disabled" ) );
11920 },
11921
11922 open: function( event ) {
11923  if ( this.options.disabled ) {
11924   return;
11925  }
11926
11927  // If this is the first time the menu is being opened, render the items
11928  if ( !this._rendered ) {
11929   this._refreshMenu();
11930  } else {
11931
11932   // Menu clears focus on close, reset focus to selected item
11933   this._removeClass( this.menu.find( ".ui-state-active" ), null, "ui-state-active" );
11934   this.menuInstance.focus( null, this._getSelectedItem() );
11935  }
11936
11937  // If there are no options, don't open the menu
11938  if ( !this.menuItems.length ) {
11939   return;
11940  }
11941
11942  this.isOpen = true;
11943  this._toggleAttr();
11944  this._resizeMenu();
11945  this._position();
11946
11947  this._on( this.document, this._documentClick );
11948
11949  this._trigger( "open", event );
11950 },
11951
11952 _position: function() {
11953  this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
11954 },
11955
11956 close: function( event ) {
11957  if ( !this.isOpen ) {
11958   return;
11959  }
11960
11961  this.isOpen = false;
11962  this._toggleAttr();
11963
11964  this.range = null;
11965  this._off( this.document );
11966
11967  this._trigger( "close", event );
11968 },
11969
11970 widget: function() {
11971  return this.button;
11972 },
11973
11974 menuWidget: function() {
11975  return this.menu;
11976 },
11977
11978 _renderButtonItem: function( item ) {
11979  var buttonItem = $( "<span>" );
11980
11981  this._setText( buttonItem, item.label );
11982  this._addClass( buttonItem, "ui-selectmenu-text" );
11983
11984  return buttonItem;
11985 },
11986
11987 _renderMenu: function( ul, items ) {
11988  var that = this,
11989   currentOptgroup = "";
11990
11991  $.each( items, function( index, item ) {
11992   var li;
11993
11994   if ( item.optgroup !== currentOptgroup ) {
11995    li = $( "<li>", {
11996     text: item.optgroup
11997    } );
11998    that._addClass( li, "ui-selectmenu-optgroup", "ui-menu-divider" +
11999     ( item.element.parent( "optgroup" ).prop( "disabled" ) ?
12000      " ui-state-disabled" :
12001      "" ) );
12002
12003    li.appendTo( ul );
12004
12005    currentOptgroup = item.optgroup;
12006   }
12007
12008   that._renderItemData( ul, item );
12009  } );
12010 },
12011
12012 _renderItemData: function( ul, item ) {
12013  return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
12014 },
12015
12016 _renderItem: function( ul, item ) {
12017  var li = $( "<li>" ),
12018   wrapper = $( "<div>", {
12019    title: item.element.attr( "title" )
12020   } );
12021
12022  if ( item.disabled ) {
12023   this._addClass( li, null, "ui-state-disabled" );
12024  }
12025  this._setText( wrapper, item.label );
12026
12027  return li.append( wrapper ).appendTo( ul );
12028 },
12029
12030 _setText: function( element, value ) {
12031  if ( value ) {
12032   element.text( value );
12033  } else {
12034   element.html( "&#160;" );
12035  }
12036 },
12037
12038 _move: function( direction, event ) {
12039  var item, next,
12040   filter = ".ui-menu-item";
12041
12042  if ( this.isOpen ) {
12043   item = this.menuItems.eq( this.focusIndex ).parent( "li" );
12044  } else {
12045   item = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
12046   filter += ":not(.ui-state-disabled)";
12047  }
12048
12049  if ( direction === "first" || direction === "last" ) {
12050   next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
12051  } else {
12052   next = item[ direction + "All" ]( filter ).eq( 0 );
12053  }
12054
12055  if ( next.length ) {
12056   this.menuInstance.focus( event, next );
12057  }
12058 },
12059
12060 _getSelectedItem: function() {
12061  return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
12062 },
12063
12064 _toggle: function( event ) {
12065  this[ this.isOpen ? "close" : "open" ]( event );
12066 },
12067
12068 _setSelection: function() {
12069  var selection;
12070
12071  if ( !this.range ) {
12072   return;
12073  }
12074
12075  if ( window.getSelection ) {
12076   selection = window.getSelection();
12077   selection.removeAllRanges();
12078   selection.addRange( this.range );
12079
12080  // Support: IE8
12081  } else {
12082   this.range.select();
12083  }
12084
12085  // Support: IE
12086  // Setting the text selection kills the button focus in IE, but
12087  // restoring the focus doesn't kill the selection.
12088  this.button.focus();
12089 },
12090
12091 _documentClick: {
12092  mousedown: function( event ) {
12093   if ( !this.isOpen ) {
12094    return;
12095   }
12096
12097   if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
12098     $.ui.escapeSelector( this.ids.button ) ).length ) {
12099    this.close( event );
12100   }
12101  }
12102 },
12103
12104 _buttonEvents: {
12105
12106  // Prevent text selection from being reset when interacting with the selectmenu (#10144)
12107  mousedown: function() {
12108   var selection;
12109
12110   if ( window.getSelection ) {
12111    selection = window.getSelection();
12112    if ( selection.rangeCount ) {
12113     this.range = selection.getRangeAt( 0 );
12114    }
12115
12116   // Support: IE8
12117   } else {
12118    this.range = document.selection.createRange();
12119   }
12120  },
12121
12122  click: function( event ) {
12123   this._setSelection();
12124   this._toggle( event );
12125  },
12126
12127  keydown: function( event ) {
12128   var preventDefault = true;
12129   switch ( event.keyCode ) {
12130   case $.ui.keyCode.TAB:
12131   case $.ui.keyCode.ESCAPE:
12132    this.close( event );
12133    preventDefault = false;
vendor: 4,286 bytes, lines 12134-12309
12134    break;
12135   case $.ui.keyCode.ENTER:
12136    if ( this.isOpen ) {
12137     this._selectFocusedItem( event );
12138    }
12139    break;
12140   case $.ui.keyCode.UP:
12141    if ( event.altKey ) {
12142     this._toggle( event );
12143    } else {
12144     this._move( "prev", event );
12145    }
12146    break;
12147   case $.ui.keyCode.DOWN:
12148    if ( event.altKey ) {
12149     this._toggle( event );
12150    } else {
12151     this._move( "next", event );
12152    }
12153    break;
12154   case $.ui.keyCode.SPACE:
12155    if ( this.isOpen ) {
12156     this._selectFocusedItem( event );
12157    } else {
12158     this._toggle( event );
12159    }
12160    break;
12161   case $.ui.keyCode.LEFT:
12162    this._move( "prev", event );
12163    break;
12164   case $.ui.keyCode.RIGHT:
12165    this._move( "next", event );
12166    break;
12167   case $.ui.keyCode.HOME:
12168   case $.ui.keyCode.PAGE_UP:
12169    this._move( "first", event );
12170    break;
12171   case $.ui.keyCode.END:
12172   case $.ui.keyCode.PAGE_DOWN:
12173    this._move( "last", event );
12174    break;
12175   default:
12176    this.menu.trigger( event );
12177    preventDefault = false;
12178   }
12179
12180   if ( preventDefault ) {
12181    event.preventDefault();
12182   }
12183  }
12184 },
12185
12186 _selectFocusedItem: function( event ) {
12187  var item = this.menuItems.eq( this.focusIndex ).parent( "li" );
12188  if ( !item.hasClass( "ui-state-disabled" ) ) {
12189   this._select( item.data( "ui-selectmenu-item" ), event );
12190  }
12191 },
12192
12193 _select: function( item, event ) {
12194  var oldIndex = this.element[ 0 ].selectedIndex;
12195
12196  // Change native select element
12197  this.element[ 0 ].selectedIndex = item.index;
12198  this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) );
12199  this._setAria( item );
12200  this._trigger( "select", event, { item: item } );
12201
12202  if ( item.index !== oldIndex ) {
12203   this._trigger( "change", event, { item: item } );
12204  }
12205
12206  this.close( event );
12207 },
12208
12209 _setAria: function( item ) {
12210  var id = this.menuItems.eq( item.index ).attr( "id" );
12211
12212  this.button.attr( {
12213   "aria-labelledby": id,
12214   "aria-activedescendant": id
12215  } );
12216  this.menu.attr( "aria-activedescendant", id );
12217 },
12218
12219 _setOption: function( key, value ) {
12220  if ( key === "icons" ) {
12221   var icon = this.button.find( "span.ui-icon" );
12222   this._removeClass( icon, null, this.options.icons.button )
12223    ._addClass( icon, null, value.button );
12224  }
12225
12226  this._super( key, value );
12227
12228  if ( key === "appendTo" ) {
12229   this.menuWrap.appendTo( this._appendTo() );
12230  }
12231
12232  if ( key === "width" ) {
12233   this._resizeButton();
12234  }
12235 },
12236
12237 _setOptionDisabled: function( value ) {
12238  this._super( value );
12239
12240  this.menuInstance.option( "disabled", value );
12241  this.button.attr( "aria-disabled", value );
12242  this._toggleClass( this.button, null, "ui-state-disabled", value );
12243
12244  this.element.prop( "disabled", value );
12245  if ( value ) {
12246   this.button.attr( "tabindex", -1 );
12247   this.close();
12248  } else {
12249   this.button.attr( "tabindex", 0 );
12250  }
12251 },
12252
12253 _appendTo: function() {
12254  var element = this.options.appendTo;
12255
12256  if ( element ) {
12257   element = element.jquery || element.nodeType ?
12258    $( element ) :
12259    this.document.find( element ).eq( 0 );
12260  }
12261
12262  if ( !element || !element[ 0 ] ) {
12263   element = this.element.closest( ".ui-front, dialog" );
12264  }
12265
12266  if ( !element.length ) {
12267   element = this.document[ 0 ].body;
12268  }
12269
12270  return element;
12271 },
12272
12273 _toggleAttr: function() {
12274  this.button.attr( "aria-expanded", this.isOpen );
12275
12276  // We can't use two _toggleClass() calls here, because we need to make sure
12277  // we always remove classes first and add them second, otherwise if both classes have the
12278  // same theme class, it will be removed after we add it.
12279  this._removeClass( this.button, "ui-selectmenu-button-" +
12280   ( this.isOpen ? "closed" : "open" ) )
12281   ._addClass( this.button, "ui-selectmenu-button-" +
12282    ( this.isOpen ? "open" : "closed" ) )
12283   ._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen );
12284
12285  this.menu.attr( "aria-hidden", !this.isOpen );
12286 },
12287
12288 _resizeButton: function() {
12289  var width = this.options.width;
12290
12291  // For `width:false`, just remove inline style and stop
12292  if ( width === false ) {
12293   this.button.css( "width", "" );
12294   return;
12295  }
12296
12297  // For `width:null`, match the width of the original element
12298  if ( width === null ) {
12299   width = this.element.show().outerWidth();
12300   this.element.hide();
12301  }
12302
12303  this.button.outerWidth( width );
12304 },
12305
12306 _resizeMenu: function() {
12307  this.menu.outerWidth( Math.max(
12308   this.button.outerWidth(),
12309
vendor: 5,177 bytes, lines 12310-12523
12310   // Support: IE10
12311   // IE10 wraps long text (possibly a rounding bug)
12312   // so we add 1px to avoid the wrapping
12313   this.menu.width( "" ).outerWidth() + 1
12314  ) );
12315 },
12316
12317 _getCreateOptions: function() {
12318  var options = this._super();
12319
12320  options.disabled = this.element.prop( "disabled" );
12321
12322  return options;
12323 },
12324
12325 _parseOptions: function( options ) {
12326  var that = this,
12327   data = [];
12328  options.each( function( index, item ) {
12329   data.push( that._parseOption( $( item ), index ) );
12330  } );
12331  this.items = data;
12332 },
12333
12334 _parseOption: function( option, index ) {
12335  var optgroup = option.parent( "optgroup" );
12336
12337  return {
12338   element: option,
12339   index: index,
12340   value: option.val(),
12341   label: option.text(),
12342   optgroup: optgroup.attr( "label" ) || "",
12343   disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
12344  };
12345 },
12346
12347 _destroy: function() {
12348  this._unbindFormResetHandler();
12349  this.menuWrap.remove();
12350  this.button.remove();
12351  this.element.show();
12352  this.element.removeUniqueId();
12353  this.labels.attr( "for", this.ids.element );
12354 }
12355} ] );
12356
12357
12358/*!
12359 * jQuery UI Slider 1.12.1
12360 * http://jqueryui.com
12361 *
12362 * Copyright jQuery Foundation and other contributors
12363 * Released under the MIT license.
12364 * http://jquery.org/license
12365 */
12366
12367//>>label: Slider
12368//>>group: Widgets
12369//>>description: Displays a flexible slider with ranges and accessibility via keyboard.
12370//>>docs: http://api.jqueryui.com/slider/
12371//>>demos: http://jqueryui.com/slider/
12372//>>css.structure: ../../themes/base/core.css
12373//>>css.structure: ../../themes/base/slider.css
12374//>>css.theme: ../../themes/base/theme.css
12375
12376
12377
12378var widgetsSlider = $.widget( "ui.slider", $.ui.mouse, {
12379 version: "1.12.1",
12380 widgetEventPrefix: "slide",
12381
12382 options: {
12383  animate: false,
12384  classes: {
12385   "ui-slider": "ui-corner-all",
12386   "ui-slider-handle": "ui-corner-all",
12387
12388   // Note: ui-widget-header isn't the most fittingly semantic framework class for this
12389   // element, but worked best visually with a variety of themes
12390   "ui-slider-range": "ui-corner-all ui-widget-header"
12391  },
12392  distance: 0,
12393  max: 100,
12394  min: 0,
12395  orientation: "horizontal",
12396  range: false,
12397  step: 1,
12398  value: 0,
12399  values: null,
12400
12401  // Callbacks
12402  change: null,
12403  slide: null,
12404  start: null,
12405  stop: null
12406 },
12407
12408 // Number of pages in a slider
12409 // (how many times can you page up/down to go through the whole range)
12410 numPages: 5,
12411
12412 _create: function() {
12413  this._keySliding = false;
12414  this._mouseSliding = false;
12415  this._animateOff = true;
12416  this._handleIndex = null;
12417  this._detectOrientation();
12418  this._mouseInit();
12419  this._calculateNewMax();
12420
12421  this._addClass( "ui-slider ui-slider-" + this.orientation,
12422   "ui-widget ui-widget-content" );
12423
12424  this._refresh();
12425
12426  this._animateOff = false;
12427 },
12428
12429 _refresh: function() {
12430  this._createRange();
12431  this._createHandles();
12432  this._setupEvents();
12433  this._refreshValue();
12434 },
12435
12436 _createHandles: function() {
12437  var i, handleCount,
12438   options = this.options,
12439   existingHandles = this.element.find( ".ui-slider-handle" ),
12440   handle = "<span tabindex='0'></span>",
12441   handles = [];
12442
12443  handleCount = ( options.values && options.values.length ) || 1;
12444
12445  if ( existingHandles.length > handleCount ) {
12446   existingHandles.slice( handleCount ).remove();
12447   existingHandles = existingHandles.slice( 0, handleCount );
12448  }
12449
12450  for ( i = existingHandles.length; i < handleCount; i++ ) {
12451   handles.push( handle );
12452  }
12453
12454  this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
12455
12456  this._addClass( this.handles, "ui-slider-handle", "ui-state-default" );
12457
12458  this.handle = this.handles.eq( 0 );
12459
12460  this.handles.each( function( i ) {
12461   $( this )
12462    .data( "ui-slider-handle-index", i )
12463    .attr( "tabIndex", 0 );
12464  } );
12465 },
12466
12467 _createRange: function() {
12468  var options = this.options;
12469
12470  if ( options.range ) {
12471   if ( options.range === true ) {
12472    if ( !options.values ) {
12473     options.values = [ this._valueMin(), this._valueMin() ];
12474    } else if ( options.values.length && options.values.length !== 2 ) {
12475     options.values = [ options.values[ 0 ], options.values[ 0 ] ];
12476    } else if ( $.isArray( options.values ) ) {
12477     options.values = options.values.slice( 0 );
12478    }
12479   }
12480
12481   if ( !this.range || !this.range.length ) {
12482    this.range = $( "<div>" )
12483     .appendTo( this.element );
12484
12485    this._addClass( this.range, "ui-slider-range" );
12486   } else {
12487    this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" );
12488
12489    // Handle range switching from true to min/max
12490    this.range.css( {
12491     "left": "",
12492     "bottom": ""
12493    } );
12494   }
12495   if ( options.range === "min" || options.range === "max" ) {
12496    this._addClass( this.range, "ui-slider-range-" + options.range );
12497   }
12498  } else {
12499   if ( this.range ) {
12500    this.range.remove();
12501   }
12502   this.range = null;
12503  }
12504 },
12505
12506 _setupEvents: function() {
12507  this._off( this.handles );
12508  this._on( this.handles, this._handleEvents );
12509  this._hoverable( this.handles );
12510  this._focusable( this.handles );
12511 },
12512
12513 _destroy: function() {
12514  this.handles.remove();
12515  if ( this.range ) {
12516   this.range.remove();
12517  }
12518
12519  this._mouseDestroy();
12520 },
12521
12522 _mouseCapture: function( event ) {
12523  var position, normValue, distance, closestHandle, index, allowed, offset, mou
vendor: 17,814 bytes, lines 12523-13221
12523seOverHandle,
12524   that = this,
12525   o = this.options;
12526
12527  if ( o.disabled ) {
12528   return false;
12529  }
12530
12531  this.elementSize = {
12532   width: this.element.outerWidth(),
12533   height: this.element.outerHeight()
12534  };
12535  this.elementOffset = this.element.offset();
12536
12537  position = { x: event.pageX, y: event.pageY };
12538  normValue = this._normValueFromMouse( position );
12539  distance = this._valueMax() - this._valueMin() + 1;
12540  this.handles.each( function( i ) {
12541   var thisDistance = Math.abs( normValue - that.values( i ) );
12542   if ( ( distance > thisDistance ) ||
12543    ( distance === thisDistance &&
12544     ( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) {
12545    distance = thisDistance;
12546    closestHandle = $( this );
12547    index = i;
12548   }
12549  } );
12550
12551  allowed = this._start( event, index );
12552  if ( allowed === false ) {
12553   return false;
12554  }
12555  this._mouseSliding = true;
12556
12557  this._handleIndex = index;
12558
12559  this._addClass( closestHandle, null, "ui-state-active" );
12560  closestHandle.trigger( "focus" );
12561
12562  offset = closestHandle.offset();
12563  mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
12564  this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
12565   left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
12566   top: event.pageY - offset.top -
12567    ( closestHandle.height() / 2 ) -
12568    ( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) -
12569    ( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) +
12570    ( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 )
12571  };
12572
12573  if ( !this.handles.hasClass( "ui-state-hover" ) ) {
12574   this._slide( event, index, normValue );
12575  }
12576  this._animateOff = true;
12577  return true;
12578 },
12579
12580 _mouseStart: function() {
12581  return true;
12582 },
12583
12584 _mouseDrag: function( event ) {
12585  var position = { x: event.pageX, y: event.pageY },
12586   normValue = this._normValueFromMouse( position );
12587
12588  this._slide( event, this._handleIndex, normValue );
12589
12590  return false;
12591 },
12592
12593 _mouseStop: function( event ) {
12594  this._removeClass( this.handles, null, "ui-state-active" );
12595  this._mouseSliding = false;
12596
12597  this._stop( event, this._handleIndex );
12598  this._change( event, this._handleIndex );
12599
12600  this._handleIndex = null;
12601  this._clickOffset = null;
12602  this._animateOff = false;
12603
12604  return false;
12605 },
12606
12607 _detectOrientation: function() {
12608  this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
12609 },
12610
12611 _normValueFromMouse: function( position ) {
12612  var pixelTotal,
12613   pixelMouse,
12614   percentMouse,
12615   valueTotal,
12616   valueMouse;
12617
12618  if ( this.orientation === "horizontal" ) {
12619   pixelTotal = this.elementSize.width;
12620   pixelMouse = position.x - this.elementOffset.left -
12621    ( this._clickOffset ? this._clickOffset.left : 0 );
12622  } else {
12623   pixelTotal = this.elementSize.height;
12624   pixelMouse = position.y - this.elementOffset.top -
12625    ( this._clickOffset ? this._clickOffset.top : 0 );
12626  }
12627
12628  percentMouse = ( pixelMouse / pixelTotal );
12629  if ( percentMouse > 1 ) {
12630   percentMouse = 1;
12631  }
12632  if ( percentMouse < 0 ) {
12633   percentMouse = 0;
12634  }
12635  if ( this.orientation === "vertical" ) {
12636   percentMouse = 1 - percentMouse;
12637  }
12638
12639  valueTotal = this._valueMax() - this._valueMin();
12640  valueMouse = this._valueMin() + percentMouse * valueTotal;
12641
12642  return this._trimAlignValue( valueMouse );
12643 },
12644
12645 _uiHash: function( index, value, values ) {
12646  var uiHash = {
12647   handle: this.handles[ index ],
12648   handleIndex: index,
12649   value: value !== undefined ? value : this.value()
12650  };
12651
12652  if ( this._hasMultipleValues() ) {
12653   uiHash.value = value !== undefined ? value : this.values( index );
12654   uiHash.values = values || this.values();
12655  }
12656
12657  return uiHash;
12658 },
12659
12660 _hasMultipleValues: function() {
12661  return this.options.values && this.options.values.length;
12662 },
12663
12664 _start: function( event, index ) {
12665  return this._trigger( "start", event, this._uiHash( index ) );
12666 },
12667
12668 _slide: function( event, index, newVal ) {
12669  var allowed, otherVal,
12670   currentValue = this.value(),
12671   newValues = this.values();
12672
12673  if ( this._hasMultipleValues() ) {
12674   otherVal = this.values( index ? 0 : 1 );
12675   currentValue = this.values( index );
12676
12677   if ( this.options.values.length === 2 && this.options.range === true ) {
12678    newVal =  index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal );
12679   }
12680
12681   newValues[ index ] = newVal;
12682  }
12683
12684  if ( newVal === currentValue ) {
12685   return;
12686  }
12687
12688  allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) );
12689
12690  // A slide can be canceled by returning false from the slide callback
12691  if ( allowed === false ) {
12692   return;
12693  }
12694
12695  if ( this._hasMultipleValues() ) {
12696   this.values( index, newVal );
12697  } else {
12698   this.value( newVal );
12699  }
12700 },
12701
12702 _stop: function( event, index ) {
12703  this._trigger( "stop", event, this._uiHash( index ) );
12704 },
12705
12706 _change: function( event, index ) {
12707  if ( !this._keySliding && !this._mouseSliding ) {
12708
12709   //store the last changed value index for reference when handles overlap
12710   this._lastChangedValue = index;
12711   this._trigger( "change", event, this._uiHash( index ) );
12712  }
12713 },
12714
12715 value: function( newValue ) {
12716  if ( arguments.length ) {
12717   this.options.value = this._trimAlignValue( newValue );
12718   this._refreshValue();
12719   this._change( null, 0 );
12720   return;
12721  }
12722
12723  return this._value();
12724 },
12725
12726 values: function( index, newValue ) {
12727  var vals,
12728   newValues,
12729   i;
12730
12731  if ( arguments.length > 1 ) {
12732   this.options.values[ index ] = this._trimAlignValue( newValue );
12733   this._refreshValue();
12734   this._change( null, index );
12735   return;
12736  }
12737
12738  if ( arguments.length ) {
12739   if ( $.isArray( arguments[ 0 ] ) ) {
12740    vals = this.options.values;
12741    newValues = arguments[ 0 ];
12742    for ( i = 0; i < vals.length; i += 1 ) {
12743     vals[ i ] = this._trimAlignValue( newValues[ i ] );
12744     this._change( null, i );
12745    }
12746    this._refreshValue();
12747   } else {
12748    if ( this._hasMultipleValues() ) {
12749     return this._values( index );
12750    } else {
12751     return this.value();
12752    }
12753   }
12754  } else {
12755   return this._values();
12756  }
12757 },
12758
12759 _setOption: function( key, value ) {
12760  var i,
12761   valsLength = 0;
12762
12763  if ( key === "range" && this.options.range === true ) {
12764   if ( value === "min" ) {
12765    this.options.value = this._values( 0 );
12766    this.options.values = null;
12767   } else if ( value === "max" ) {
12768    this.options.value = this._values( this.options.values.length - 1 );
12769    this.options.values = null;
12770   }
12771  }
12772
12773  if ( $.isArray( this.options.values ) ) {
12774   valsLength = this.options.values.length;
12775  }
12776
12777  this._super( key, value );
12778
12779  switch ( key ) {
12780   case "orientation":
12781    this._detectOrientation();
12782    this._removeClass( "ui-slider-horizontal ui-slider-vertical" )
12783     ._addClass( "ui-slider-" + this.orientation );
12784    this._refreshValue();
12785    if ( this.options.range ) {
12786     this._refreshRange( value );
12787    }
12788
12789    // Reset positioning from previous orientation
12790    this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
12791    break;
12792   case "value":
12793    this._animateOff = true;
12794    this._refreshValue();
12795    this._change( null, 0 );
12796    this._animateOff = false;
12797    break;
12798   case "values":
12799    this._animateOff = true;
12800    this._refreshValue();
12801
12802    // Start from the last handle to prevent unreachable handles (#9046)
12803    for ( i = valsLength - 1; i >= 0; i-- ) {
12804     this._change( null, i );
12805    }
12806    this._animateOff = false;
12807    break;
12808   case "step":
12809   case "min":
12810   case "max":
12811    this._animateOff = true;
12812    this._calculateNewMax();
12813    this._refreshValue();
12814    this._animateOff = false;
12815    break;
12816   case "range":
12817    this._animateOff = true;
12818    this._refresh();
12819    this._animateOff = false;
12820    break;
12821  }
12822 },
12823
12824 _setOptionDisabled: function( value ) {
12825  this._super( value );
12826
12827  this._toggleClass( null, "ui-state-disabled", !!value );
12828 },
12829
12830 //internal value getter
12831 // _value() returns value trimmed by min and max, aligned by step
12832 _value: function() {
12833  var val = this.options.value;
12834  val = this._trimAlignValue( val );
12835
12836  return val;
12837 },
12838
12839 //internal values getter
12840 // _values() returns array of values trimmed by min and max, aligned by step
12841 // _values( index ) returns single value trimmed by min and max, aligned by step
12842 _values: function( index ) {
12843  var val,
12844   vals,
12845   i;
12846
12847  if ( arguments.length ) {
12848   val = this.options.values[ index ];
12849   val = this._trimAlignValue( val );
12850
12851   return val;
12852  } else if ( this._hasMultipleValues() ) {
12853
12854   // .slice() creates a copy of the array
12855   // this copy gets trimmed by min and max and then returned
12856   vals = this.options.values.slice();
12857   for ( i = 0; i < vals.length; i += 1 ) {
12858    vals[ i ] = this._trimAlignValue( vals[ i ] );
12859   }
12860
12861   return vals;
12862  } else {
12863   return [];
12864  }
12865 },
12866
12867 // Returns the step-aligned value that val is closest to, between (inclusive) min and max
12868 _trimAlignValue: function( val ) {
12869  if ( val <= this._valueMin() ) {
12870   return this._valueMin();
12871  }
12872  if ( val >= this._valueMax() ) {
12873   return this._valueMax();
12874  }
12875  var step = ( this.options.step > 0 ) ? this.options.step : 1,
12876   valModStep = ( val - this._valueMin() ) % step,
12877   alignValue = val - valModStep;
12878
12879  if ( Math.abs( valModStep ) * 2 >= step ) {
12880   alignValue += ( valModStep > 0 ) ? step : ( -step );
12881  }
12882
12883  // Since JavaScript has problems with large floats, round
12884  // the final value to 5 digits after the decimal point (see #4124)
12885  return parseFloat( alignValue.toFixed( 5 ) );
12886 },
12887
12888 _calculateNewMax: function() {
12889  var max = this.options.max,
12890   min = this._valueMin(),
12891   step = this.options.step,
12892   aboveMin = Math.round( ( max - min ) / step ) * step;
12893  max = aboveMin + min;
12894  if ( max > this.options.max ) {
12895
12896   //If max is not divisible by step, rounding off may increase its value
12897   max -= step;
12898  }
12899  this.max = parseFloat( max.toFixed( this._precision() ) );
12900 },
12901
12902 _precision: function() {
12903  var precision = this._precisionOf( this.options.step );
12904  if ( this.options.min !== null ) {
12905   precision = Math.max( precision, this._precisionOf( this.options.min ) );
12906  }
12907  return precision;
12908 },
12909
12910 _precisionOf: function( num ) {
12911  var str = num.toString(),
12912   decimal = str.indexOf( "." );
12913  return decimal === -1 ? 0 : str.length - decimal - 1;
12914 },
12915
12916 _valueMin: function() {
12917  return this.options.min;
12918 },
12919
12920 _valueMax: function() {
12921  return this.max;
12922 },
12923
12924 _refreshRange: function( orientation ) {
12925  if ( orientation === "vertical" ) {
12926   this.range.css( { "width": "", "left": "" } );
12927  }
12928  if ( orientation === "horizontal" ) {
12929   this.range.css( { "height": "", "bottom": "" } );
12930  }
12931 },
12932
12933 _refreshValue: function() {
12934  var lastValPercent, valPercent, value, valueMin, valueMax,
12935   oRange = this.options.range,
12936   o = this.options,
12937   that = this,
12938   animate = ( !this._animateOff ) ? o.animate : false,
12939   _set = {};
12940
12941  if ( this._hasMultipleValues() ) {
12942   this.handles.each( function( i ) {
12943    valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() -
12944     that._valueMin() ) * 100;
12945    _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
12946    $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
12947    if ( that.options.range === true ) {
12948     if ( that.orientation === "horizontal" ) {
12949      if ( i === 0 ) {
12950       that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
12951        left: valPercent + "%"
12952       }, o.animate );
12953      }
12954      if ( i === 1 ) {
12955       that.range[ animate ? "animate" : "css" ]( {
12956        width: ( valPercent - lastValPercent ) + "%"
12957       }, {
12958        queue: false,
12959        duration: o.animate
12960       } );
12961      }
12962     } else {
12963      if ( i === 0 ) {
12964       that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
12965        bottom: ( valPercent ) + "%"
12966       }, o.animate );
12967      }
12968      if ( i === 1 ) {
12969       that.range[ animate ? "animate" : "css" ]( {
12970        height: ( valPercent - lastValPercent ) + "%"
12971       }, {
12972        queue: false,
12973        duration: o.animate
12974       } );
12975      }
12976     }
12977    }
12978    lastValPercent = valPercent;
12979   } );
12980  } else {
12981   value = this.value();
12982   valueMin = this._valueMin();
12983   valueMax = this._valueMax();
12984   valPercent = ( valueMax !== valueMin ) ?
12985     ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
12986     0;
12987   _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
12988   this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
12989
12990   if ( oRange === "min" && this.orientation === "horizontal" ) {
12991    this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
12992     width: valPercent + "%"
12993    }, o.animate );
12994   }
12995   if ( oRange === "max" && this.orientation === "horizontal" ) {
12996    this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
12997     width: ( 100 - valPercent ) + "%"
12998    }, o.animate );
12999   }
13000   if ( oRange === "min" && this.orientation === "vertical" ) {
13001    this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
13002     height: valPercent + "%"
13003    }, o.animate );
13004   }
13005   if ( oRange === "max" && this.orientation === "vertical" ) {
13006    this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
13007     height: ( 100 - valPercent ) + "%"
13008    }, o.animate );
13009   }
13010  }
13011 },
13012
13013 _handleEvents: {
13014  keydown: function( event ) {
13015   var allowed, curVal, newVal, step,
13016    index = $( event.target ).data( "ui-slider-handle-index" );
13017
13018   switch ( event.keyCode ) {
13019    case $.ui.keyCode.HOME:
13020    case $.ui.keyCode.END:
13021    case $.ui.keyCode.PAGE_UP:
13022    case $.ui.keyCode.PAGE_DOWN:
13023    case $.ui.keyCode.UP:
13024    case $.ui.keyCode.RIGHT:
13025    case $.ui.keyCode.DOWN:
13026    case $.ui.keyCode.LEFT:
13027     event.preventDefault();
13028     if ( !this._keySliding ) {
13029      this._keySliding = true;
13030      this._addClass( $( event.target ), null, "ui-state-active" );
13031      allowed = this._start( event, index );
13032      if ( allowed === false ) {
13033       return;
13034      }
13035     }
13036     break;
13037   }
13038
13039   step = this.options.step;
13040   if ( this._hasMultipleValues() ) {
13041    curVal = newVal = this.values( index );
13042   } else {
13043    curVal = newVal = this.value();
13044   }
13045
13046   switch ( event.keyCode ) {
13047    case $.ui.keyCode.HOME:
13048     newVal = this._valueMin();
13049     break;
13050    case $.ui.keyCode.END:
13051     newVal = this._valueMax();
13052     break;
13053    case $.ui.keyCode.PAGE_UP:
13054     newVal = this._trimAlignValue(
13055      curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
13056     );
13057     break;
13058    case $.ui.keyCode.PAGE_DOWN:
13059     newVal = this._trimAlignValue(
13060      curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) );
13061     break;
13062    case $.ui.keyCode.UP:
13063    case $.ui.keyCode.RIGHT:
13064     if ( curVal === this._valueMax() ) {
13065      return;
13066     }
13067     newVal = this._trimAlignValue( curVal + step );
13068     break;
13069    case $.ui.keyCode.DOWN:
13070    case $.ui.keyCode.LEFT:
13071     if ( curVal === this._valueMin() ) {
13072      return;
13073     }
13074     newVal = this._trimAlignValue( curVal - step );
13075     break;
13076   }
13077
13078   this._slide( event, index, newVal );
13079  },
13080  keyup: function( event ) {
13081   var index = $( event.target ).data( "ui-slider-handle-index" );
13082
13083   if ( this._keySliding ) {
13084    this._keySliding = false;
13085    this._stop( event, index );
13086    this._change( event, index );
13087    this._removeClass( $( event.target ), null, "ui-state-active" );
13088   }
13089  }
13090 }
13091} );
13092
13093
13094/*!
13095 * jQuery UI Sortable 1.12.1
13096 * http://jqueryui.com
13097 *
13098 * Copyright jQuery Foundation and other contributors
13099 * Released under the MIT license.
13100 * http://jquery.org/license
13101 */
13102
13103//>>label: Sortable
13104//>>group: Interactions
13105//>>description: Enables items in a list to be sorted using the mouse.
13106//>>docs: http://api.jqueryui.com/sortable/
13107//>>demos: http://jqueryui.com/sortable/
13108//>>css.structure: ../../themes/base/sortable.css
13109
13110
13111
13112var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, {
13113 version: "1.12.1",
13114 widgetEventPrefix: "sort",
13115 ready: false,
13116 options: {
13117  appendTo: "parent",
13118  axis: false,
13119  connectWith: false,
13120  containment: false,
13121  cursor: "auto",
13122  cursorAt: false,
13123  dropOnEmpty: true,
13124  forcePlaceholderSize: false,
13125  forceHelperSize: false,
13126  grid: false,
13127  handle: false,
13128  helper: "original",
13129  items: "> *",
13130  opacity: false,
13131  placeholder: false,
13132  revert: false,
13133  scroll: true,
13134  scrollSensitivity: 20,
13135  scrollSpeed: 20,
13136  scope: "default",
13137  tolerance: "intersect",
13138  zIndex: 1000,
13139
13140  // Callbacks
13141  activate: null,
13142  beforeStop: null,
13143  change: null,
13144  deactivate: null,
13145  out: null,
13146  over: null,
13147  receive: null,
13148  remove: null,
13149  sort: null,
13150  start: null,
13151  stop: null,
13152  update: null
13153 },
13154
13155 _isOverAxis: function( x, reference, size ) {
13156  return ( x >= reference ) && ( x < ( reference + size ) );
13157 },
13158
13159 _isFloating: function( item ) {
13160  return ( /left|right/ ).test( item.css( "float" ) ) ||
13161   ( /inline|table-cell/ ).test( item.css( "display" ) );
13162 },
13163
13164 _create: function() {
13165  this.containerCache = {};
13166  this._addClass( "ui-sortable" );
13167
13168  //Get the items
13169  this.refresh();
13170
13171  //Let's determine the parent's offset
13172  this.offset = this.element.offset();
13173
13174  //Initialize mouse events for interaction
13175  this._mouseInit();
13176
13177  this._setHandleClassName();
13178
13179  //We're ready to go
13180  this.ready = true;
13181
13182 },
13183
13184 _setOption: function( key, value ) {
13185  this._super( key, value );
13186
13187  if ( key === "handle" ) {
13188   this._setHandleClassName();
13189  }
13190 },
13191
13192 _setHandleClassName: function() {
13193  var that = this;
13194  this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" );
13195  $.each( this.items, function() {
13196   that._addClass(
13197    this.instance.options.handle ?
13198     this.item.find( this.instance.options.handle ) :
13199     this.item,
13200    "ui-sortable-handle"
13201   );
13202  } );
13203 },
13204
13205 _destroy: function() {
13206  this._mouseDestroy();
13207
13208  for ( var i = this.items.length - 1; i >= 0; i-- ) {
13209   this.items[ i ].item.removeData( this.widgetName + "-item" );
13210  }
13211
13212  return this;
13213 },
13214
13215 _mouseCapture: function( event, overrideHandle ) {
13216  var currentItem = null,
13217   validHandle = false,
13218   that = this;
13219
13220  if ( this.reverting ) {
13221   return false;
vendor: 5,189 bytes, lines 13222-13411
13222  }
13223
13224  if ( this.options.disabled || this.options.type === "static" ) {
13225   return false;
13226  }
13227
13228  //We have to refresh the items data once first
13229  this._refreshItems( event );
13230
13231  //Find out if the clicked node (or one of its parents) is a actual item in this.items
13232  $( event.target ).parents().each( function() {
13233   if ( $.data( this, that.widgetName + "-item" ) === that ) {
13234    currentItem = $( this );
13235    return false;
13236   }
13237  } );
13238  if ( $.data( event.target, that.widgetName + "-item" ) === that ) {
13239   currentItem = $( event.target );
13240  }
13241
13242  if ( !currentItem ) {
13243   return false;
13244  }
13245  if ( this.options.handle && !overrideHandle ) {
13246   $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() {
13247    if ( this === event.target ) {
13248     validHandle = true;
13249    }
13250   } );
13251   if ( !validHandle ) {
13252    return false;
13253   }
13254  }
13255
13256  this.currentItem = currentItem;
13257  this._removeCurrentsFromItems();
13258  return true;
13259
13260 },
13261
13262 _mouseStart: function( event, overrideHandle, noActivation ) {
13263
13264  var i, body,
13265   o = this.options;
13266
13267  this.currentContainer = this;
13268
13269  //We only need to call refreshPositions, because the refreshItems call has been moved to
13270  // mouseCapture
13271  this.refreshPositions();
13272
13273  //Create and append the visible helper
13274  this.helper = this._createHelper( event );
13275
13276  //Cache the helper size
13277  this._cacheHelperProportions();
13278
13279  /*
13280   * - Position generation -
13281   * This block generates everything position related - it's the core of draggables.
13282   */
13283
13284  //Cache the margins of the original element
13285  this._cacheMargins();
13286
13287  //Get the next scrolling parent
13288  this.scrollParent = this.helper.scrollParent();
13289
13290  //The element's absolute position on the page minus margins
13291  this.offset = this.currentItem.offset();
13292  this.offset = {
13293   top: this.offset.top - this.margins.top,
13294   left: this.offset.left - this.margins.left
13295  };
13296
13297  $.extend( this.offset, {
13298   click: { //Where the click happened, relative to the element
13299    left: event.pageX - this.offset.left,
13300    top: event.pageY - this.offset.top
13301   },
13302   parent: this._getParentOffset(),
13303
13304   // This is a relative to absolute position minus the actual position calculation -
13305   // only used for relative positioned helper
13306   relative: this._getRelativeOffset()
13307  } );
13308
13309  // Only after we got the offset, we can change the helper's position to absolute
13310  // TODO: Still need to figure out a way to make relative sorting possible
13311  this.helper.css( "position", "absolute" );
13312  this.cssPosition = this.helper.css( "position" );
13313
13314  //Generate the original position
13315  this.originalPosition = this._generatePosition( event );
13316  this.originalPageX = event.pageX;
13317  this.originalPageY = event.pageY;
13318
13319  //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
13320  ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
13321
13322  //Cache the former DOM position
13323  this.domPosition = {
13324   prev: this.currentItem.prev()[ 0 ],
13325   parent: this.currentItem.parent()[ 0 ]
13326  };
13327
13328  // If the helper is not the original, hide the original so it's not playing any role during
13329  // the drag, won't cause anything bad this way
13330  if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
13331   this.currentItem.hide();
13332  }
13333
13334  //Create the placeholder
13335  this._createPlaceholder();
13336
13337  //Set a containment if given in the options
13338  if ( o.containment ) {
13339   this._setContainment();
13340  }
13341
13342  if ( o.cursor && o.cursor !== "auto" ) { // cursor option
13343   body = this.document.find( "body" );
13344
13345   // Support: IE
13346   this.storedCursor = body.css( "cursor" );
13347   body.css( "cursor", o.cursor );
13348
13349   this.storedStylesheet =
13350    $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
13351  }
13352
13353  if ( o.opacity ) { // opacity option
13354   if ( this.helper.css( "opacity" ) ) {
13355    this._storedOpacity = this.helper.css( "opacity" );
13356   }
13357   this.helper.css( "opacity", o.opacity );
13358  }
13359
13360  if ( o.zIndex ) { // zIndex option
13361   if ( this.helper.css( "zIndex" ) ) {
13362    this._storedZIndex = this.helper.css( "zIndex" );
13363   }
13364   this.helper.css( "zIndex", o.zIndex );
13365  }
13366
13367  //Prepare scrolling
13368  if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
13369    this.scrollParent[ 0 ].tagName !== "HTML" ) {
13370   this.overflowOffset = this.scrollParent.offset();
13371  }
13372
13373  //Call callbacks
13374  this._trigger( "start", event, this._uiHash() );
13375
13376  //Recache the helper size
13377  if ( !this._preserveHelperProportions ) {
13378   this._cacheHelperProportions();
13379  }
13380
13381  //Post "activate" events to possible containers
13382  if ( !noActivation ) {
13383   for ( i = this.containers.length - 1; i >= 0; i-- ) {
13384    this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
13385   }
13386  }
13387
13388  //Prepare possible droppables
13389  if ( $.ui.ddmanager ) {
13390   $.ui.ddmanager.current = this;
13391  }
13392
13393  if ( $.ui.ddmanager && !o.dropBehaviour ) {
13394   $.ui.ddmanager.prepareOffsets( this, event );
13395  }
13396
13397  this.dragging = true;
13398
13399  this._addClass( this.helper, "ui-sortable-helper" );
13400
13401  // Execute the drag once - this causes the helper not to be visiblebefore getting its
13402  // correct position
13403  this._mouseDrag( event );
13404  return true;
13405
13406 },
13407
13408 _mouseDrag: function( event ) {
13409  var i, item, itemElement, intersection,
13410   o = this.options,
13411   scrolled = false;
vendor: 4,358 bytes, lines 13412-13541
13412
13413  //Compute the helpers position
13414  this.position = this._generatePosition( event );
13415  this.positionAbs = this._convertPositionTo( "absolute" );
13416
13417  if ( !this.lastPositionAbs ) {
13418   this.lastPositionAbs = this.positionAbs;
13419  }
13420
13421  //Do scrolling
13422  if ( this.options.scroll ) {
13423   if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
13424     this.scrollParent[ 0 ].tagName !== "HTML" ) {
13425
13426    if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) -
13427      event.pageY < o.scrollSensitivity ) {
13428     this.scrollParent[ 0 ].scrollTop =
13429      scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
13430    } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) {
13431     this.scrollParent[ 0 ].scrollTop =
13432      scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
13433    }
13434
13435    if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) -
13436      event.pageX < o.scrollSensitivity ) {
13437     this.scrollParent[ 0 ].scrollLeft = scrolled =
13438      this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
13439    } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) {
13440     this.scrollParent[ 0 ].scrollLeft = scrolled =
13441      this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
13442    }
13443
13444   } else {
13445
13446    if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) {
13447     scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed );
13448    } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) <
13449      o.scrollSensitivity ) {
13450     scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed );
13451    }
13452
13453    if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) {
13454     scrolled = this.document.scrollLeft(
13455      this.document.scrollLeft() - o.scrollSpeed
13456     );
13457    } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) <
13458      o.scrollSensitivity ) {
13459     scrolled = this.document.scrollLeft(
13460      this.document.scrollLeft() + o.scrollSpeed
13461     );
13462    }
13463
13464   }
13465
13466   if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
13467    $.ui.ddmanager.prepareOffsets( this, event );
13468   }
13469  }
13470
13471  //Regenerate the absolute position used for position checks
13472  this.positionAbs = this._convertPositionTo( "absolute" );
13473
13474  //Set the helper position
13475  if ( !this.options.axis || this.options.axis !== "y" ) {
13476   this.helper[ 0 ].style.left = this.position.left + "px";
13477  }
13478  if ( !this.options.axis || this.options.axis !== "x" ) {
13479   this.helper[ 0 ].style.top = this.position.top + "px";
13480  }
13481
13482  //Rearrange
13483  for ( i = this.items.length - 1; i >= 0; i-- ) {
13484
13485   //Cache variables and intersection, continue if no intersection
13486   item = this.items[ i ];
13487   itemElement = item.item[ 0 ];
13488   intersection = this._intersectsWithPointer( item );
13489   if ( !intersection ) {
13490    continue;
13491   }
13492
13493   // Only put the placeholder inside the current Container, skip all
13494   // items from other containers. This works because when moving
13495   // an item from one container to another the
13496   // currentContainer is switched before the placeholder is moved.
13497   //
13498   // Without this, moving items in "sub-sortables" can cause
13499   // the placeholder to jitter between the outer and inner container.
13500   if ( item.instance !== this.currentContainer ) {
13501    continue;
13502   }
13503
13504   // Cannot intersect with itself
13505   // no useless actions that have been done before
13506   // no action if the item moved is the parent of the item checked
13507   if ( itemElement !== this.currentItem[ 0 ] &&
13508    this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement &&
13509    !$.contains( this.placeholder[ 0 ], itemElement ) &&
13510    ( this.options.type === "semi-dynamic" ?
13511     !$.contains( this.element[ 0 ], itemElement ) :
13512     true
13513    )
13514   ) {
13515
13516    this.direction = intersection === 1 ? "down" : "up";
13517
13518    if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) {
13519     this._rearrange( event, item );
13520    } else {
13521     break;
13522    }
13523
13524    this._trigger( "change", event, this._uiHash() );
13525    break;
13526   }
13527  }
13528
13529  //Post events to containers
13530  this._contactContainers( event );
13531
13532  //Interconnect with droppables
13533  if ( $.ui.ddmanager ) {
13534   $.ui.ddmanager.drag( this, event );
13535  }
13536
13537  //Call callbacks
13538  this._trigger( "sort", event, this._uiHash() );
13539
13540  this.lastPositionAbs = this.positionAbs;
13541  return false;
vendor: 3,193 bytes, lines 13542-13677
13542
13543 },
13544
13545 _mouseStop: function( event, noPropagation ) {
13546
13547  if ( !event ) {
13548   return;
13549  }
13550
13551  //If we are using droppables, inform the manager about the drop
13552  if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
13553   $.ui.ddmanager.drop( this, event );
13554  }
13555
13556  if ( this.options.revert ) {
13557   var that = this,
13558    cur = this.placeholder.offset(),
13559    axis = this.options.axis,
13560    animation = {};
13561
13562   if ( !axis || axis === "x" ) {
13563    animation.left = cur.left - this.offset.parent.left - this.margins.left +
13564     ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
13565      0 :
13566      this.offsetParent[ 0 ].scrollLeft
13567     );
13568   }
13569   if ( !axis || axis === "y" ) {
13570    animation.top = cur.top - this.offset.parent.top - this.margins.top +
13571     ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
13572      0 :
13573      this.offsetParent[ 0 ].scrollTop
13574     );
13575   }
13576   this.reverting = true;
13577   $( this.helper ).animate(
13578    animation,
13579    parseInt( this.options.revert, 10 ) || 500,
13580    function() {
13581     that._clear( event );
13582    }
13583   );
13584  } else {
13585   this._clear( event, noPropagation );
13586  }
13587
13588  return false;
13589
13590 },
13591
13592 cancel: function() {
13593
13594  if ( this.dragging ) {
13595
13596   this._mouseUp( new $.Event( "mouseup", { target: null } ) );
13597
13598   if ( this.options.helper === "original" ) {
13599    this.currentItem.css( this._storedCSS );
13600    this._removeClass( this.currentItem, "ui-sortable-helper" );
13601   } else {
13602    this.currentItem.show();
13603   }
13604
13605   //Post deactivating events to containers
13606   for ( var i = this.containers.length - 1; i >= 0; i-- ) {
13607    this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) );
13608    if ( this.containers[ i ].containerCache.over ) {
13609     this.containers[ i ]._trigger( "out", null, this._uiHash( this ) );
13610     this.containers[ i ].containerCache.over = 0;
13611    }
13612   }
13613
13614  }
13615
13616  if ( this.placeholder ) {
13617
13618   //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
13619   // it unbinds ALL events from the original node!
13620   if ( this.placeholder[ 0 ].parentNode ) {
13621    this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
13622   }
13623   if ( this.options.helper !== "original" && this.helper &&
13624     this.helper[ 0 ].parentNode ) {
13625    this.helper.remove();
13626   }
13627
13628   $.extend( this, {
13629    helper: null,
13630    dragging: false,
13631    reverting: false,
13632    _noFinalSort: null
13633   } );
13634
13635   if ( this.domPosition.prev ) {
13636    $( this.domPosition.prev ).after( this.currentItem );
13637   } else {
13638    $( this.domPosition.parent ).prepend( this.currentItem );
13639   }
13640  }
13641
13642  return this;
13643
13644 },
13645
13646 serialize: function( o ) {
13647
13648  var items = this._getItemsAsjQuery( o && o.connected ),
13649   str = [];
13650  o = o || {};
13651
13652  $( items ).each( function() {
13653   var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" )
13654    .match( o.expression || ( /(.+)[\-=_](.+)/ ) );
13655   if ( res ) {
13656    str.push(
13657     ( o.key || res[ 1 ] + "[]" ) +
13658     "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) );
13659   }
13660  } );
13661
13662  if ( !str.length && o.key ) {
13663   str.push( o.key + "=" );
13664  }
13665
13666  return str.join( "&" );
13667
13668 },
13669
13670 toArray: function( o ) {
13671
13672  var items = this._getItemsAsjQuery( o && o.connected ),
13673   ret = [];
13674
13675  o = o || {};
13676
13677  items.each( function() {
vendor: 9,452 bytes, lines 13678-13984
13678   ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" );
13679  } );
13680  return ret;
13681
13682 },
13683
13684 /* Be careful with the following core functions */
13685 _intersectsWith: function( item ) {
13686
13687  var x1 = this.positionAbs.left,
13688   x2 = x1 + this.helperProportions.width,
13689   y1 = this.positionAbs.top,
13690   y2 = y1 + this.helperProportions.height,
13691   l = item.left,
13692   r = l + item.width,
13693   t = item.top,
13694   b = t + item.height,
13695   dyClick = this.offset.click.top,
13696   dxClick = this.offset.click.left,
13697   isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t &&
13698    ( y1 + dyClick ) < b ),
13699   isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l &&
13700    ( x1 + dxClick ) < r ),
13701   isOverElement = isOverElementHeight && isOverElementWidth;
13702
13703  if ( this.options.tolerance === "pointer" ||
13704   this.options.forcePointerForContainers ||
13705   ( this.options.tolerance !== "pointer" &&
13706    this.helperProportions[ this.floating ? "width" : "height" ] >
13707    item[ this.floating ? "width" : "height" ] )
13708  ) {
13709   return isOverElement;
13710  } else {
13711
13712   return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half
13713    x2 - ( this.helperProportions.width / 2 ) < r && // Left Half
13714    t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half
13715    y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half
13716
13717  }
13718 },
13719
13720 _intersectsWithPointer: function( item ) {
13721  var verticalDirection, horizontalDirection,
13722   isOverElementHeight = ( this.options.axis === "x" ) ||
13723    this._isOverAxis(
13724     this.positionAbs.top + this.offset.click.top, item.top, item.height ),
13725   isOverElementWidth = ( this.options.axis === "y" ) ||
13726    this._isOverAxis(
13727     this.positionAbs.left + this.offset.click.left, item.left, item.width ),
13728   isOverElement = isOverElementHeight && isOverElementWidth;
13729
13730  if ( !isOverElement ) {
13731   return false;
13732  }
13733
13734  verticalDirection = this._getDragVerticalDirection();
13735  horizontalDirection = this._getDragHorizontalDirection();
13736
13737  return this.floating ?
13738   ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 )
13739   : ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) );
13740
13741 },
13742
13743 _intersectsWithSides: function( item ) {
13744
13745  var isOverBottomHalf = this._isOverAxis( this.positionAbs.top +
13746    this.offset.click.top, item.top + ( item.height / 2 ), item.height ),
13747   isOverRightHalf = this._isOverAxis( this.positionAbs.left +
13748    this.offset.click.left, item.left + ( item.width / 2 ), item.width ),
13749   verticalDirection = this._getDragVerticalDirection(),
13750   horizontalDirection = this._getDragHorizontalDirection();
13751
13752  if ( this.floating && horizontalDirection ) {
13753   return ( ( horizontalDirection === "right" && isOverRightHalf ) ||
13754    ( horizontalDirection === "left" && !isOverRightHalf ) );
13755  } else {
13756   return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) ||
13757    ( verticalDirection === "up" && !isOverBottomHalf ) );
13758  }
13759
13760 },
13761
13762 _getDragVerticalDirection: function() {
13763  var delta = this.positionAbs.top - this.lastPositionAbs.top;
13764  return delta !== 0 && ( delta > 0 ? "down" : "up" );
13765 },
13766
13767 _getDragHorizontalDirection: function() {
13768  var delta = this.positionAbs.left - this.lastPositionAbs.left;
13769  return delta !== 0 && ( delta > 0 ? "right" : "left" );
13770 },
13771
13772 refresh: function( event ) {
13773  this._refreshItems( event );
13774  this._setHandleClassName();
13775  this.refreshPositions();
13776  return this;
13777 },
13778
13779 _connectWith: function() {
13780  var options = this.options;
13781  return options.connectWith.constructor === String ?
13782   [ options.connectWith ] :
13783   options.connectWith;
13784 },
13785
13786 _getItemsAsjQuery: function( connected ) {
13787
13788  var i, j, cur, inst,
13789   items = [],
13790   queries = [],
13791   connectWith = this._connectWith();
13792
13793  if ( connectWith && connected ) {
13794   for ( i = connectWith.length - 1; i >= 0; i-- ) {
13795    cur = $( connectWith[ i ], this.document[ 0 ] );
13796    for ( j = cur.length - 1; j >= 0; j-- ) {
13797     inst = $.data( cur[ j ], this.widgetFullName );
13798     if ( inst && inst !== this && !inst.options.disabled ) {
13799      queries.push( [ $.isFunction( inst.options.items ) ?
13800       inst.options.items.call( inst.element ) :
13801       $( inst.options.items, inst.element )
13802        .not( ".ui-sortable-helper" )
13803        .not( ".ui-sortable-placeholder" ), inst ] );
13804     }
13805    }
13806   }
13807  }
13808
13809  queries.push( [ $.isFunction( this.options.items ) ?
13810   this.options.items
13811    .call( this.element, null, { options: this.options, item: this.currentItem } ) :
13812   $( this.options.items, this.element )
13813    .not( ".ui-sortable-helper" )
13814    .not( ".ui-sortable-placeholder" ), this ] );
13815
13816  function addItems() {
13817   items.push( this );
13818  }
13819  for ( i = queries.length - 1; i >= 0; i-- ) {
13820   queries[ i ][ 0 ].each( addItems );
13821  }
13822
13823  return $( items );
13824
13825 },
13826
13827 _removeCurrentsFromItems: function() {
13828
13829  var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" );
13830
13831  this.items = $.grep( this.items, function( item ) {
13832   for ( var j = 0; j < list.length; j++ ) {
13833    if ( list[ j ] === item.item[ 0 ] ) {
13834     return false;
13835    }
13836   }
13837   return true;
13838  } );
13839
13840 },
13841
13842 _refreshItems: function( event ) {
13843
13844  this.items = [];
13845  this.containers = [ this ];
13846
13847  var i, j, cur, inst, targetData, _queries, item, queriesLength,
13848   items = this.items,
13849   queries = [ [ $.isFunction( this.options.items ) ?
13850    this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) :
13851    $( this.options.items, this.element ), this ] ],
13852   connectWith = this._connectWith();
13853
13854  //Shouldn't be run the first time through due to massive slow-down
13855  if ( connectWith && this.ready ) {
13856   for ( i = connectWith.length - 1; i >= 0; i-- ) {
13857    cur = $( connectWith[ i ], this.document[ 0 ] );
13858    for ( j = cur.length - 1; j >= 0; j-- ) {
13859     inst = $.data( cur[ j ], this.widgetFullName );
13860     if ( inst && inst !== this && !inst.options.disabled ) {
13861      queries.push( [ $.isFunction( inst.options.items ) ?
13862       inst.options.items
13863        .call( inst.element[ 0 ], event, { item: this.currentItem } ) :
13864       $( inst.options.items, inst.element ), inst ] );
13865      this.containers.push( inst );
13866     }
13867    }
13868   }
13869  }
13870
13871  for ( i = queries.length - 1; i >= 0; i-- ) {
13872   targetData = queries[ i ][ 1 ];
13873   _queries = queries[ i ][ 0 ];
13874
13875   for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) {
13876    item = $( _queries[ j ] );
13877
13878    // Data for target checking (mouse manager)
13879    item.data( this.widgetName + "-item", targetData );
13880
13881    items.push( {
13882     item: item,
13883     instance: targetData,
13884     width: 0, height: 0,
13885     left: 0, top: 0
13886    } );
13887   }
13888  }
13889
13890 },
13891
13892 refreshPositions: function( fast ) {
13893
13894  // Determine whether items are being displayed horizontally
13895  this.floating = this.items.length ?
13896   this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
13897   false;
13898
13899  //This has to be redone because due to the item being moved out/into the offsetParent,
13900  // the offsetParent's position will change
13901  if ( this.offsetParent && this.helper ) {
13902   this.offset.parent = this._getParentOffset();
13903  }
13904
13905  var i, item, t, p;
13906
13907  for ( i = this.items.length - 1; i >= 0; i-- ) {
13908   item = this.items[ i ];
13909
13910   //We ignore calculating positions of all connected containers when we're not over them
13911   if ( item.instance !== this.currentContainer && this.currentContainer &&
13912     item.item[ 0 ] !== this.currentItem[ 0 ] ) {
13913    continue;
13914   }
13915
13916   t = this.options.toleranceElement ?
13917    $( this.options.toleranceElement, item.item ) :
13918    item.item;
13919
13920   if ( !fast ) {
13921    item.width = t.outerWidth();
13922    item.height = t.outerHeight();
13923   }
13924
13925   p = t.offset();
13926   item.left = p.left;
13927   item.top = p.top;
13928  }
13929
13930  if ( this.options.custom && this.options.custom.refreshContainers ) {
13931   this.options.custom.refreshContainers.call( this );
13932  } else {
13933   for ( i = this.containers.length - 1; i >= 0; i-- ) {
13934    p = this.containers[ i ].element.offset();
13935    this.containers[ i ].containerCache.left = p.left;
13936    this.containers[ i ].containerCache.top = p.top;
13937    this.containers[ i ].containerCache.width =
13938     this.containers[ i ].element.outerWidth();
13939    this.containers[ i ].containerCache.height =
13940     this.containers[ i ].element.outerHeight();
13941   }
13942  }
13943
13944  return this;
13945 },
13946
13947 _createPlaceholder: function( that ) {
13948  that = that || this;
13949  var className,
13950   o = that.options;
13951
13952  if ( !o.placeholder || o.placeholder.constructor === String ) {
13953   className = o.placeholder;
13954   o.placeholder = {
13955    element: function() {
13956
13957     var nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(),
13958      element = $( "<" + nodeName + ">", that.document[ 0 ] );
13959
13960      that._addClass( element, "ui-sortable-placeholder",
13961        className || that.currentItem[ 0 ].className )
13962       ._removeClass( element, "ui-sortable-helper" );
13963
13964     if ( nodeName === "tbody" ) {
13965      that._createTrPlaceholder(
13966       that.currentItem.find( "tr" ).eq( 0 ),
13967       $( "<tr>", that.document[ 0 ] ).appendTo( element )
13968      );
13969     } else if ( nodeName === "tr" ) {
13970      that._createTrPlaceholder( that.currentItem, element );
13971     } else if ( nodeName === "img" ) {
13972      element.attr( "src", that.currentItem.attr( "src" ) );
13973     }
13974
13975     if ( !className ) {
13976      element.css( "visibility", "hidden" );
13977     }
13978
13979     return element;
13980    },
13981    update: function( container, p ) {
13982
13983     // 1. If a className is set as 'placeholder option, we don't force sizes -
13984     // the class is responsible for that
vendor: 8,088 bytes, lines 13985-14226
13985     // 2. The option 'forcePlaceholderSize can be enabled to force it even if a
13986     // class name is specified
13987     if ( className && !o.forcePlaceholderSize ) {
13988      return;
13989     }
13990
13991     //If the element doesn't have a actual height by itself (without styles coming
13992     // from a stylesheet), it receives the inline height from the dragged item
13993     if ( !p.height() ) {
13994      p.height(
13995       that.currentItem.innerHeight() -
13996       parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) -
13997       parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) );
13998     }
13999     if ( !p.width() ) {
14000      p.width(
14001       that.currentItem.innerWidth() -
14002       parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) -
14003       parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) );
14004     }
14005    }
14006   };
14007  }
14008
14009  //Create the placeholder
14010  that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) );
14011
14012  //Append it after the actual current item
14013  that.currentItem.after( that.placeholder );
14014
14015  //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
14016  o.placeholder.update( that, that.placeholder );
14017
14018 },
14019
14020 _createTrPlaceholder: function( sourceTr, targetTr ) {
14021  var that = this;
14022
14023  sourceTr.children().each( function() {
14024   $( "<td>&#160;</td>", that.document[ 0 ] )
14025    .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
14026    .appendTo( targetTr );
14027  } );
14028 },
14029
14030 _contactContainers: function( event ) {
14031  var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
14032   floating, axis,
14033   innermostContainer = null,
14034   innermostIndex = null;
14035
14036  // Get innermost container that intersects with item
14037  for ( i = this.containers.length - 1; i >= 0; i-- ) {
14038
14039   // Never consider a container that's located within the item itself
14040   if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) {
14041    continue;
14042   }
14043
14044   if ( this._intersectsWith( this.containers[ i ].containerCache ) ) {
14045
14046    // If we've already found a container and it's more "inner" than this, then continue
14047    if ( innermostContainer &&
14048      $.contains(
14049       this.containers[ i ].element[ 0 ],
14050       innermostContainer.element[ 0 ] ) ) {
14051     continue;
14052    }
14053
14054    innermostContainer = this.containers[ i ];
14055    innermostIndex = i;
14056
14057   } else {
14058
14059    // container doesn't intersect. trigger "out" event if necessary
14060    if ( this.containers[ i ].containerCache.over ) {
14061     this.containers[ i ]._trigger( "out", event, this._uiHash( this ) );
14062     this.containers[ i ].containerCache.over = 0;
14063    }
14064   }
14065
14066  }
14067
14068  // If no intersecting containers found, return
14069  if ( !innermostContainer ) {
14070   return;
14071  }
14072
14073  // Move the item into the container if it's not there already
14074  if ( this.containers.length === 1 ) {
14075   if ( !this.containers[ innermostIndex ].containerCache.over ) {
14076    this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
14077    this.containers[ innermostIndex ].containerCache.over = 1;
14078   }
14079  } else {
14080
14081   // When entering a new container, we will find the item with the least distance and
14082   // append our item near it
14083   dist = 10000;
14084   itemWithLeastDistance = null;
14085   floating = innermostContainer.floating || this._isFloating( this.currentItem );
14086   posProperty = floating ? "left" : "top";
14087   sizeProperty = floating ? "width" : "height";
14088   axis = floating ? "pageX" : "pageY";
14089
14090   for ( j = this.items.length - 1; j >= 0; j-- ) {
14091    if ( !$.contains(
14092      this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] )
14093    ) {
14094     continue;
14095    }
14096    if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) {
14097     continue;
14098    }
14099
14100    cur = this.items[ j ].item.offset()[ posProperty ];
14101    nearBottom = false;
14102    if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
14103     nearBottom = true;
14104    }
14105
14106    if ( Math.abs( event[ axis ] - cur ) < dist ) {
14107     dist = Math.abs( event[ axis ] - cur );
14108     itemWithLeastDistance = this.items[ j ];
14109     this.direction = nearBottom ? "up" : "down";
14110    }
14111   }
14112
14113   //Check if dropOnEmpty is enabled
14114   if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) {
14115    return;
14116   }
14117
14118   if ( this.currentContainer === this.containers[ innermostIndex ] ) {
14119    if ( !this.currentContainer.containerCache.over ) {
14120     this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
14121     this.currentContainer.containerCache.over = 1;
14122    }
14123    return;
14124   }
14125
14126   itemWithLeastDistance ?
14127    this._rearrange( event, itemWithLeastDistance, null, true ) :
14128    this._rearrange( event, null, this.containers[ innermostIndex ].element, true );
14129   this._trigger( "change", event, this._uiHash() );
14130   this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) );
14131   this.currentContainer = this.containers[ innermostIndex ];
14132
14133   //Update the placeholder
14134   this.options.placeholder.update( this.currentContainer, this.placeholder );
14135
14136   this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
14137   this.containers[ innermostIndex ].containerCache.over = 1;
14138  }
14139
14140 },
14141
14142 _createHelper: function( event ) {
14143
14144  var o = this.options,
14145   helper = $.isFunction( o.helper ) ?
14146    $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) :
14147    ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem );
14148
14149  //Add the helper to the DOM if that didn't happen already
14150  if ( !helper.parents( "body" ).length ) {
14151   $( o.appendTo !== "parent" ?
14152    o.appendTo :
14153    this.currentItem[ 0 ].parentNode )[ 0 ].appendChild( helper[ 0 ] );
14154  }
14155
14156  if ( helper[ 0 ] === this.currentItem[ 0 ] ) {
14157   this._storedCSS = {
14158    width: this.currentItem[ 0 ].style.width,
14159    height: this.currentItem[ 0 ].style.height,
14160    position: this.currentItem.css( "position" ),
14161    top: this.currentItem.css( "top" ),
14162    left: this.currentItem.css( "left" )
14163   };
14164  }
14165
14166  if ( !helper[ 0 ].style.width || o.forceHelperSize ) {
14167   helper.width( this.currentItem.width() );
14168  }
14169  if ( !helper[ 0 ].style.height || o.forceHelperSize ) {
14170   helper.height( this.currentItem.height() );
14171  }
14172
14173  return helper;
14174
14175 },
14176
14177 _adjustOffsetFromHelper: function( obj ) {
14178  if ( typeof obj === "string" ) {
14179   obj = obj.split( " " );
14180  }
14181  if ( $.isArray( obj ) ) {
14182   obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
14183  }
14184  if ( "left" in obj ) {
14185   this.offset.click.left = obj.left + this.margins.left;
14186  }
14187  if ( "right" in obj ) {
14188   this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
14189  }
14190  if ( "top" in obj ) {
14191   this.offset.click.top = obj.top + this.margins.top;
14192  }
14193  if ( "bottom" in obj ) {
14194   this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
14195  }
14196 },
14197
14198 _getParentOffset: function() {
14199
14200  //Get the offsetParent and cache its position
14201  this.offsetParent = this.helper.offsetParent();
14202  var po = this.offsetParent.offset();
14203
14204  // This is a special case where we need to modify a offset calculated on start, since the
14205  // following happened:
14206  // 1. The position of the helper is absolute, so it's position is calculated based on the
14207  // next positioned parent
14208  // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
14209  // the document, which means that the scroll is included in the initial calculation of the
14210  // offset of the parent, and never recalculated upon drag
14211  if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] &&
14212    $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
14213   po.left += this.scrollParent.scrollLeft();
14214   po.top += this.scrollParent.scrollTop();
14215  }
14216
14217  // This needs to be actually done for all browsers, since pageX/pageY includes this
14218  // information with an ugly IE fix
14219  if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ||
14220    ( this.offsetParent[ 0 ].tagName &&
14221    this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) {
14222   po = { top: 0, left: 0 };
14223  }
14224
14225  return {
14226   top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
vendor: 4,356 bytes, lines 14227-14362
14227   left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
14228  };
14229
14230 },
14231
14232 _getRelativeOffset: function() {
14233
14234  if ( this.cssPosition === "relative" ) {
14235   var p = this.currentItem.position();
14236   return {
14237    top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
14238     this.scrollParent.scrollTop(),
14239    left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
14240     this.scrollParent.scrollLeft()
14241   };
14242  } else {
14243   return { top: 0, left: 0 };
14244  }
14245
14246 },
14247
14248 _cacheMargins: function() {
14249  this.margins = {
14250   left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ),
14251   top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 )
14252  };
14253 },
14254
14255 _cacheHelperProportions: function() {
14256  this.helperProportions = {
14257   width: this.helper.outerWidth(),
14258   height: this.helper.outerHeight()
14259  };
14260 },
14261
14262 _setContainment: function() {
14263
14264  var ce, co, over,
14265   o = this.options;
14266  if ( o.containment === "parent" ) {
14267   o.containment = this.helper[ 0 ].parentNode;
14268  }
14269  if ( o.containment === "document" || o.containment === "window" ) {
14270   this.containment = [
14271    0 - this.offset.relative.left - this.offset.parent.left,
14272    0 - this.offset.relative.top - this.offset.parent.top,
14273    o.containment === "document" ?
14274     this.document.width() :
14275     this.window.width() - this.helperProportions.width - this.margins.left,
14276    ( o.containment === "document" ?
14277     ( this.document.height() || document.body.parentNode.scrollHeight ) :
14278     this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight
14279    ) - this.helperProportions.height - this.margins.top
14280   ];
14281  }
14282
14283  if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) {
14284   ce = $( o.containment )[ 0 ];
14285   co = $( o.containment ).offset();
14286   over = ( $( ce ).css( "overflow" ) !== "hidden" );
14287
14288   this.containment = [
14289    co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) +
14290     ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left,
14291    co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) +
14292     ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top,
14293    co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
14294     ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) -
14295     ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) -
14296     this.helperProportions.width - this.margins.left,
14297    co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
14298     ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) -
14299     ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) -
14300     this.helperProportions.height - this.margins.top
14301   ];
14302  }
14303
14304 },
14305
14306 _convertPositionTo: function( d, pos ) {
14307
14308  if ( !pos ) {
14309   pos = this.position;
14310  }
14311  var mod = d === "absolute" ? 1 : -1,
14312   scroll = this.cssPosition === "absolute" &&
14313    !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
14314    $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
14315     this.offsetParent :
14316     this.scrollParent,
14317   scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
14318
14319  return {
14320   top: (
14321
14322    // The absolute mouse position
14323    pos.top +
14324
14325    // Only for relative positioned nodes: Relative offset from element to offset parent
14326    this.offset.relative.top * mod +
14327
14328    // The offsetParent's offset without borders (offset + border)
14329    this.offset.parent.top * mod -
14330    ( ( this.cssPosition === "fixed" ?
14331     -this.scrollParent.scrollTop() :
14332     ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod )
14333   ),
14334   left: (
14335
14336    // The absolute mouse position
14337    pos.left +
14338
14339    // Only for relative positioned nodes: Relative offset from element to offset parent
14340    this.offset.relative.left * mod +
14341
14342    // The offsetParent's offset without borders (offset + border)
14343    this.offset.parent.left * mod -
14344    ( ( this.cssPosition === "fixed" ?
14345     -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
14346     scroll.scrollLeft() ) * mod )
14347   )
14348  };
14349
14350 },
14351
14352 _generatePosition: function( event ) {
14353
14354  var top, left,
14355   o = this.options,
14356   pageX = event.pageX,
14357   pageY = event.pageY,
14358   scroll = this.cssPosition === "absolute" &&
14359    !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
14360    $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
14361     this.offsetParent :
14362     this.scrollParent,
vendor: 4,209 bytes, lines 14363-14486
14363    scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
14364
14365  // This is another very weird special case that only happens for relative elements:
14366  // 1. If the css position is relative
14367  // 2. and the scroll parent is the document or similar to the offset parent
14368  // we have to refresh the relative offset during the scroll so there are no jumps
14369  if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
14370    this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) {
14371   this.offset.relative = this._getRelativeOffset();
14372  }
14373
14374  /*
14375   * - Position constraining -
14376   * Constrain the position to a mix of grid, containment.
14377   */
14378
14379  if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options
14380
14381   if ( this.containment ) {
14382    if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) {
14383     pageX = this.containment[ 0 ] + this.offset.click.left;
14384    }
14385    if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) {
14386     pageY = this.containment[ 1 ] + this.offset.click.top;
14387    }
14388    if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) {
14389     pageX = this.containment[ 2 ] + this.offset.click.left;
14390    }
14391    if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) {
14392     pageY = this.containment[ 3 ] + this.offset.click.top;
14393    }
14394   }
14395
14396   if ( o.grid ) {
14397    top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) /
14398     o.grid[ 1 ] ) * o.grid[ 1 ];
14399    pageY = this.containment ?
14400     ( ( top - this.offset.click.top >= this.containment[ 1 ] &&
14401      top - this.offset.click.top <= this.containment[ 3 ] ) ?
14402       top :
14403       ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ?
14404        top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) :
14405        top;
14406
14407    left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) /
14408     o.grid[ 0 ] ) * o.grid[ 0 ];
14409    pageX = this.containment ?
14410     ( ( left - this.offset.click.left >= this.containment[ 0 ] &&
14411      left - this.offset.click.left <= this.containment[ 2 ] ) ?
14412       left :
14413       ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ?
14414        left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) :
14415        left;
14416   }
14417
14418  }
14419
14420  return {
14421   top: (
14422
14423    // The absolute mouse position
14424    pageY -
14425
14426    // Click offset (relative to the element)
14427    this.offset.click.top -
14428
14429    // Only for relative positioned nodes: Relative offset from element to offset parent
14430    this.offset.relative.top -
14431
14432    // The offsetParent's offset without borders (offset + border)
14433    this.offset.parent.top +
14434    ( ( this.cssPosition === "fixed" ?
14435     -this.scrollParent.scrollTop() :
14436     ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) )
14437   ),
14438   left: (
14439
14440    // The absolute mouse position
14441    pageX -
14442
14443    // Click offset (relative to the element)
14444    this.offset.click.left -
14445
14446    // Only for relative positioned nodes: Relative offset from element to offset parent
14447    this.offset.relative.left -
14448
14449    // The offsetParent's offset without borders (offset + border)
14450    this.offset.parent.left +
14451    ( ( this.cssPosition === "fixed" ?
14452     -this.scrollParent.scrollLeft() :
14453     scrollIsRootNode ? 0 : scroll.scrollLeft() ) )
14454   )
14455  };
14456
14457 },
14458
14459 _rearrange: function( event, i, a, hardRefresh ) {
14460
14461  a ? a[ 0 ].appendChild( this.placeholder[ 0 ] ) :
14462   i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ],
14463    ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) );
14464
14465  //Various things done here to improve the performance:
14466  // 1. we create a setTimeout, that calls refreshPositions
14467  // 2. on the instance, we have a counter variable, that get's higher after every append
14468  // 3. on the local scope, we copy the counter variable, and check in the timeout,
14469  // if it's still the same
14470  // 4. this lets only the last addition to the timeout stack through
14471  this.counter = this.counter ? ++this.counter : 1;
14472  var counter = this.counter;
14473
14474  this._delay( function() {
14475   if ( counter === this.counter ) {
14476
14477    //Precompute after each DOM insertion, NOT on mousemove
14478    this.refreshPositions( !hardRefresh );
14479   }
14480  } );
14481
14482 },
14483
14484 _clear: function( event, noPropagation ) {
14485
14486  this.reverting = false;
vendor: 8,609 bytes, lines 14487-14797
14487
14488  // We delay all events that have to be triggered to after the point where the placeholder
14489  // has been removed and everything else normalized again
14490  var i,
14491   delayedTriggers = [];
14492
14493  // We first have to update the dom position of the actual currentItem
14494  // Note: don't do it if the current item is already removed (by a user), or it gets
14495  // reappended (see #4088)
14496  if ( !this._noFinalSort && this.currentItem.parent().length ) {
14497   this.placeholder.before( this.currentItem );
14498  }
14499  this._noFinalSort = null;
14500
14501  if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) {
14502   for ( i in this._storedCSS ) {
14503    if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) {
14504     this._storedCSS[ i ] = "";
14505    }
14506   }
14507   this.currentItem.css( this._storedCSS );
14508   this._removeClass( this.currentItem, "ui-sortable-helper" );
14509  } else {
14510   this.currentItem.show();
14511  }
14512
14513  if ( this.fromOutside && !noPropagation ) {
14514   delayedTriggers.push( function( event ) {
14515    this._trigger( "receive", event, this._uiHash( this.fromOutside ) );
14516   } );
14517  }
14518  if ( ( this.fromOutside ||
14519    this.domPosition.prev !==
14520    this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] ||
14521    this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) {
14522
14523   // Trigger update callback if the DOM position has changed
14524   delayedTriggers.push( function( event ) {
14525    this._trigger( "update", event, this._uiHash() );
14526   } );
14527  }
14528
14529  // Check if the items Container has Changed and trigger appropriate
14530  // events.
14531  if ( this !== this.currentContainer ) {
14532   if ( !noPropagation ) {
14533    delayedTriggers.push( function( event ) {
14534     this._trigger( "remove", event, this._uiHash() );
14535    } );
14536    delayedTriggers.push( ( function( c ) {
14537     return function( event ) {
14538      c._trigger( "receive", event, this._uiHash( this ) );
14539     };
14540    } ).call( this, this.currentContainer ) );
14541    delayedTriggers.push( ( function( c ) {
14542     return function( event ) {
14543      c._trigger( "update", event, this._uiHash( this ) );
14544     };
14545    } ).call( this, this.currentContainer ) );
14546   }
14547  }
14548
14549  //Post events to containers
14550  function delayEvent( type, instance, container ) {
14551   return function( event ) {
14552    container._trigger( type, event, instance._uiHash( instance ) );
14553   };
14554  }
14555  for ( i = this.containers.length - 1; i >= 0; i-- ) {
14556   if ( !noPropagation ) {
14557    delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
14558   }
14559   if ( this.containers[ i ].containerCache.over ) {
14560    delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
14561    this.containers[ i ].containerCache.over = 0;
14562   }
14563  }
14564
14565  //Do what was originally in plugins
14566  if ( this.storedCursor ) {
14567   this.document.find( "body" ).css( "cursor", this.storedCursor );
14568   this.storedStylesheet.remove();
14569  }
14570  if ( this._storedOpacity ) {
14571   this.helper.css( "opacity", this._storedOpacity );
14572  }
14573  if ( this._storedZIndex ) {
14574   this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex );
14575  }
14576
14577  this.dragging = false;
14578
14579  if ( !noPropagation ) {
14580   this._trigger( "beforeStop", event, this._uiHash() );
14581  }
14582
14583  //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
14584  // it unbinds ALL events from the original node!
14585  this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
14586
14587  if ( !this.cancelHelperRemoval ) {
14588   if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
14589    this.helper.remove();
14590   }
14591   this.helper = null;
14592  }
14593
14594  if ( !noPropagation ) {
14595   for ( i = 0; i < delayedTriggers.length; i++ ) {
14596
14597    // Trigger all delayed events
14598    delayedTriggers[ i ].call( this, event );
14599   }
14600   this._trigger( "stop", event, this._uiHash() );
14601  }
14602
14603  this.fromOutside = false;
14604  return !this.cancelHelperRemoval;
14605
14606 },
14607
14608 _trigger: function() {
14609  if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) {
14610   this.cancel();
14611  }
14612 },
14613
14614 _uiHash: function( _inst ) {
14615  var inst = _inst || this;
14616  return {
14617   helper: inst.helper,
14618   placeholder: inst.placeholder || $( [] ),
14619   position: inst.position,
14620   originalPosition: inst.originalPosition,
14621   offset: inst.positionAbs,
14622   item: inst.currentItem,
14623   sender: _inst ? _inst.element : null
14624  };
14625 }
14626
14627} );
14628
14629
14630/*!
14631 * jQuery UI Spinner 1.12.1
14632 * http://jqueryui.com
14633 *
14634 * Copyright jQuery Foundation and other contributors
14635 * Released under the MIT license.
14636 * http://jquery.org/license
14637 */
14638
14639//>>label: Spinner
14640//>>group: Widgets
14641//>>description: Displays buttons to easily input numbers via the keyboard or mouse.
14642//>>docs: http://api.jqueryui.com/spinner/
14643//>>demos: http://jqueryui.com/spinner/
14644//>>css.structure: ../../themes/base/core.css
14645//>>css.structure: ../../themes/base/spinner.css
14646//>>css.theme: ../../themes/base/theme.css
14647
14648
14649
14650function spinnerModifer( fn ) {
14651 return function() {
14652  var previous = this.element.val();
14653  fn.apply( this, arguments );
14654  this._refresh();
14655  if ( previous !== this.element.val() ) {
14656   this._trigger( "change" );
14657  }
14658 };
14659}
14660
14661$.widget( "ui.spinner", {
14662 version: "1.12.1",
14663 defaultElement: "<input>",
14664 widgetEventPrefix: "spin",
14665 options: {
14666  classes: {
14667   "ui-spinner": "ui-corner-all",
14668   "ui-spinner-down": "ui-corner-br",
14669   "ui-spinner-up": "ui-corner-tr"
14670  },
14671  culture: null,
14672  icons: {
14673   down: "ui-icon-triangle-1-s",
14674   up: "ui-icon-triangle-1-n"
14675  },
14676  incremental: true,
14677  max: null,
14678  min: null,
14679  numberFormat: null,
14680  page: 10,
14681  step: 1,
14682
14683  change: null,
14684  spin: null,
14685  start: null,
14686  stop: null
14687 },
14688
14689 _create: function() {
14690
14691  // handle string values that need to be parsed
14692  this._setOption( "max", this.options.max );
14693  this._setOption( "min", this.options.min );
14694  this._setOption( "step", this.options.step );
14695
14696  // Only format if there is a value, prevents the field from being marked
14697  // as invalid in Firefox, see #9573.
14698  if ( this.value() !== "" ) {
14699
14700   // Format the value, but don't constrain.
14701   this._value( this.element.val(), true );
14702  }
14703
14704  this._draw();
14705  this._on( this._events );
14706  this._refresh();
14707
14708  // Turning off autocomplete prevents the browser from remembering the
14709  // value when navigating through history, so we re-enable autocomplete
14710  // if the page is unloaded before the widget is destroyed. #7790
14711  this._on( this.window, {
14712   beforeunload: function() {
14713    this.element.removeAttr( "autocomplete" );
14714   }
14715  } );
14716 },
14717
14718 _getCreateOptions: function() {
14719  var options = this._super();
14720  var element = this.element;
14721
14722  $.each( [ "min", "max", "step" ], function( i, option ) {
14723   var value = element.attr( option );
14724   if ( value != null && value.length ) {
14725    options[ option ] = value;
14726   }
14727  } );
14728
14729  return options;
14730 },
14731
14732 _events: {
14733  keydown: function( event ) {
14734   if ( this._start( event ) && this._keydown( event ) ) {
14735    event.preventDefault();
14736   }
14737  },
14738  keyup: "_stop",
14739  focus: function() {
14740   this.previous = this.element.val();
14741  },
14742  blur: function( event ) {
14743   if ( this.cancelBlur ) {
14744    delete this.cancelBlur;
14745    return;
14746   }
14747
14748   this._stop();
14749   this._refresh();
14750   if ( this.previous !== this.element.val() ) {
14751    this._trigger( "change", event );
14752   }
14753  },
14754  mousewheel: function( event, delta ) {
14755   if ( !delta ) {
14756    return;
14757   }
14758   if ( !this.spinning && !this._start( event ) ) {
14759    return false;
14760   }
14761
14762   this._spin( ( delta > 0 ? 1 : -1 ) * this.options.step, event );
14763   clearTimeout( this.mousewheelTimer );
14764   this.mousewheelTimer = this._delay( function() {
14765    if ( this.spinning ) {
14766     this._stop( event );
14767    }
14768   }, 100 );
14769   event.preventDefault();
14770  },
14771  "mousedown .ui-spinner-button": function( event ) {
14772   var previous;
14773
14774   // We never want the buttons to have focus; whenever the user is
14775   // interacting with the spinner, the focus should be on the input.
14776   // If the input is focused then this.previous is properly set from
14777   // when the input first received focus. If the input is not focused
14778   // then we need to set this.previous based on the value before spinning.
14779   previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ?
14780    this.previous : this.element.val();
14781   function checkFocus() {
14782    var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] );
14783    if ( !isActive ) {
14784     this.element.trigger( "focus" );
14785     this.previous = previous;
14786
14787     // support: IE
14788     // IE sets focus asynchronously, so we need to check if focus
14789     // moved off of the input because the user clicked on the button.
14790     this._delay( function() {
14791      this.previous = previous;
14792     } );
14793    }
14794   }
14795
14796   // Ensure focus is on (or stays on) the text field
14797   event.preventDefault();
vendor: 5,445 bytes, lines 14798-15014
14798   checkFocus.call( this );
14799
14800   // Support: IE
14801   // IE doesn't prevent moving focus even with event.preventDefault()
14802   // so we set a flag to know when we should ignore the blur event
14803   // and check (again) if focus moved off of the input.
14804   this.cancelBlur = true;
14805   this._delay( function() {
14806    delete this.cancelBlur;
14807    checkFocus.call( this );
14808   } );
14809
14810   if ( this._start( event ) === false ) {
14811    return;
14812   }
14813
14814   this._repeat( null, $( event.currentTarget )
14815    .hasClass( "ui-spinner-up" ) ? 1 : -1, event );
14816  },
14817  "mouseup .ui-spinner-button": "_stop",
14818  "mouseenter .ui-spinner-button": function( event ) {
14819
14820   // button will add ui-state-active if mouse was down while mouseleave and kept down
14821   if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
14822    return;
14823   }
14824
14825   if ( this._start( event ) === false ) {
14826    return false;
14827   }
14828   this._repeat( null, $( event.currentTarget )
14829    .hasClass( "ui-spinner-up" ) ? 1 : -1, event );
14830  },
14831
14832  // TODO: do we really want to consider this a stop?
14833  // shouldn't we just stop the repeater and wait until mouseup before
14834  // we trigger the stop event?
14835  "mouseleave .ui-spinner-button": "_stop"
14836 },
14837
14838 // Support mobile enhanced option and make backcompat more sane
14839 _enhance: function() {
14840  this.uiSpinner = this.element
14841   .attr( "autocomplete", "off" )
14842   .wrap( "<span>" )
14843   .parent()
14844
14845    // Add buttons
14846    .append(
14847     "<a></a><a></a>"
14848    );
14849 },
14850
14851 _draw: function() {
14852  this._enhance();
14853
14854  this._addClass( this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content" );
14855  this._addClass( "ui-spinner-input" );
14856
14857  this.element.attr( "role", "spinbutton" );
14858
14859  // Button bindings
14860  this.buttons = this.uiSpinner.children( "a" )
14861   .attr( "tabIndex", -1 )
14862   .attr( "aria-hidden", true )
14863   .button( {
14864    classes: {
14865     "ui-button": ""
14866    }
14867   } );
14868
14869  // TODO: Right now button does not support classes this is already updated in button PR
14870  this._removeClass( this.buttons, "ui-corner-all" );
14871
14872  this._addClass( this.buttons.first(), "ui-spinner-button ui-spinner-up" );
14873  this._addClass( this.buttons.last(), "ui-spinner-button ui-spinner-down" );
14874  this.buttons.first().button( {
14875   "icon": this.options.icons.up,
14876   "showLabel": false
14877  } );
14878  this.buttons.last().button( {
14879   "icon": this.options.icons.down,
14880   "showLabel": false
14881  } );
14882
14883  // IE 6 doesn't understand height: 50% for the buttons
14884  // unless the wrapper has an explicit height
14885  if ( this.buttons.height() > Math.ceil( this.uiSpinner.height() * 0.5 ) &&
14886    this.uiSpinner.height() > 0 ) {
14887   this.uiSpinner.height( this.uiSpinner.height() );
14888  }
14889 },
14890
14891 _keydown: function( event ) {
14892  var options = this.options,
14893   keyCode = $.ui.keyCode;
14894
14895  switch ( event.keyCode ) {
14896  case keyCode.UP:
14897   this._repeat( null, 1, event );
14898   return true;
14899  case keyCode.DOWN:
14900   this._repeat( null, -1, event );
14901   return true;
14902  case keyCode.PAGE_UP:
14903   this._repeat( null, options.page, event );
14904   return true;
14905  case keyCode.PAGE_DOWN:
14906   this._repeat( null, -options.page, event );
14907   return true;
14908  }
14909
14910  return false;
14911 },
14912
14913 _start: function( event ) {
14914  if ( !this.spinning && this._trigger( "start", event ) === false ) {
14915   return false;
14916  }
14917
14918  if ( !this.counter ) {
14919   this.counter = 1;
14920  }
14921  this.spinning = true;
14922  return true;
14923 },
14924
14925 _repeat: function( i, steps, event ) {
14926  i = i || 500;
14927
14928  clearTimeout( this.timer );
14929  this.timer = this._delay( function() {
14930   this._repeat( 40, steps, event );
14931  }, i );
14932
14933  this._spin( steps * this.options.step, event );
14934 },
14935
14936 _spin: function( step, event ) {
14937  var value = this.value() || 0;
14938
14939  if ( !this.counter ) {
14940   this.counter = 1;
14941  }
14942
14943  value = this._adjustValue( value + step * this._increment( this.counter ) );
14944
14945  if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false ) {
14946   this._value( value );
14947   this.counter++;
14948  }
14949 },
14950
14951 _increment: function( i ) {
14952  var incremental = this.options.incremental;
14953
14954  if ( incremental ) {
14955   return $.isFunction( incremental ) ?
14956    incremental( i ) :
14957    Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
14958  }
14959
14960  return 1;
14961 },
14962
14963 _precision: function() {
14964  var precision = this._precisionOf( this.options.step );
14965  if ( this.options.min !== null ) {
14966   precision = Math.max( precision, this._precisionOf( this.options.min ) );
14967  }
14968  return precision;
14969 },
14970
14971 _precisionOf: function( num ) {
14972  var str = num.toString(),
14973   decimal = str.indexOf( "." );
14974  return decimal === -1 ? 0 : str.length - decimal - 1;
14975 },
14976
14977 _adjustValue: function( value ) {
14978  var base, aboveMin,
14979   options = this.options;
14980
14981  // Make sure we're at a valid step
14982  // - find out where we are relative to the base (min or 0)
14983  base = options.min !== null ? options.min : 0;
14984  aboveMin = value - base;
14985
14986  // - round to the nearest step
14987  aboveMin = Math.round( aboveMin / options.step ) * options.step;
14988
14989  // - rounding is based on 0, so adjust back to our base
14990  value = base + aboveMin;
14991
14992  // Fix precision from bad JS floating point math
14993  value = parseFloat( value.toFixed( this._precision() ) );
14994
14995  // Clamp the value
14996  if ( options.max !== null && value > options.max ) {
14997   return options.max;
14998  }
14999  if ( options.min !== null && value < options.min ) {
15000   return options.min;
15001  }
15002
15003  return value;
15004 },
15005
15006 _stop: function( event ) {
15007  if ( !this.spinning ) {
15008   return;
15009  }
15010
15011  clearTimeout( this.timer );
15012  clearTimeout( this.mousewheelTimer );
15013  this.counter = 0;
15014  this.spinning = false;
vendor: 12,000 bytes, lines 15015-15484
15015  this._trigger( "stop", event );
15016 },
15017
15018 _setOption: function( key, value ) {
15019  var prevValue, first, last;
15020
15021  if ( key === "culture" || key === "numberFormat" ) {
15022   prevValue = this._parse( this.element.val() );
15023   this.options[ key ] = value;
15024   this.element.val( this._format( prevValue ) );
15025   return;
15026  }
15027
15028  if ( key === "max" || key === "min" || key === "step" ) {
15029   if ( typeof value === "string" ) {
15030    value = this._parse( value );
15031   }
15032  }
15033  if ( key === "icons" ) {
15034   first = this.buttons.first().find( ".ui-icon" );
15035   this._removeClass( first, null, this.options.icons.up );
15036   this._addClass( first, null, value.up );
15037   last = this.buttons.last().find( ".ui-icon" );
15038   this._removeClass( last, null, this.options.icons.down );
15039   this._addClass( last, null, value.down );
15040  }
15041
15042  this._super( key, value );
15043 },
15044
15045 _setOptionDisabled: function( value ) {
15046  this._super( value );
15047
15048  this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value );
15049  this.element.prop( "disabled", !!value );
15050  this.buttons.button( value ? "disable" : "enable" );
15051 },
15052
15053 _setOptions: spinnerModifer( function( options ) {
15054  this._super( options );
15055 } ),
15056
15057 _parse: function( val ) {
15058  if ( typeof val === "string" && val !== "" ) {
15059   val = window.Globalize && this.options.numberFormat ?
15060    Globalize.parseFloat( val, 10, this.options.culture ) : +val;
15061  }
15062  return val === "" || isNaN( val ) ? null : val;
15063 },
15064
15065 _format: function( value ) {
15066  if ( value === "" ) {
15067   return "";
15068  }
15069  return window.Globalize && this.options.numberFormat ?
15070   Globalize.format( value, this.options.numberFormat, this.options.culture ) :
15071   value;
15072 },
15073
15074 _refresh: function() {
15075  this.element.attr( {
15076   "aria-valuemin": this.options.min,
15077   "aria-valuemax": this.options.max,
15078
15079   // TODO: what should we do with values that can't be parsed?
15080   "aria-valuenow": this._parse( this.element.val() )
15081  } );
15082 },
15083
15084 isValid: function() {
15085  var value = this.value();
15086
15087  // Null is invalid
15088  if ( value === null ) {
15089   return false;
15090  }
15091
15092  // If value gets adjusted, it's invalid
15093  return value === this._adjustValue( value );
15094 },
15095
15096 // Update the value without triggering change
15097 _value: function( value, allowAny ) {
15098  var parsed;
15099  if ( value !== "" ) {
15100   parsed = this._parse( value );
15101   if ( parsed !== null ) {
15102    if ( !allowAny ) {
15103     parsed = this._adjustValue( parsed );
15104    }
15105    value = this._format( parsed );
15106   }
15107  }
15108  this.element.val( value );
15109  this._refresh();
15110 },
15111
15112 _destroy: function() {
15113  this.element
15114   .prop( "disabled", false )
15115   .removeAttr( "autocomplete role aria-valuemin aria-valuemax aria-valuenow" );
15116
15117  this.uiSpinner.replaceWith( this.element );
15118 },
15119
15120 stepUp: spinnerModifer( function( steps ) {
15121  this._stepUp( steps );
15122 } ),
15123 _stepUp: function( steps ) {
15124  if ( this._start() ) {
15125   this._spin( ( steps || 1 ) * this.options.step );
15126   this._stop();
15127  }
15128 },
15129
15130 stepDown: spinnerModifer( function( steps ) {
15131  this._stepDown( steps );
15132 } ),
15133 _stepDown: function( steps ) {
15134  if ( this._start() ) {
15135   this._spin( ( steps || 1 ) * -this.options.step );
15136   this._stop();
15137  }
15138 },
15139
15140 pageUp: spinnerModifer( function( pages ) {
15141  this._stepUp( ( pages || 1 ) * this.options.page );
15142 } ),
15143
15144 pageDown: spinnerModifer( function( pages ) {
15145  this._stepDown( ( pages || 1 ) * this.options.page );
15146 } ),
15147
15148 value: function( newVal ) {
15149  if ( !arguments.length ) {
15150   return this._parse( this.element.val() );
15151  }
15152  spinnerModifer( this._value ).call( this, newVal );
15153 },
15154
15155 widget: function() {
15156  return this.uiSpinner;
15157 }
15158} );
15159
15160// DEPRECATED
15161// TODO: switch return back to widget declaration at top of file when this is removed
15162if ( $.uiBackCompat !== false ) {
15163
15164 // Backcompat for spinner html extension points
15165 $.widget( "ui.spinner", $.ui.spinner, {
15166  _enhance: function() {
15167   this.uiSpinner = this.element
15168    .attr( "autocomplete", "off" )
15169    .wrap( this._uiSpinnerHtml() )
15170    .parent()
15171
15172     // Add buttons
15173     .append( this._buttonHtml() );
15174  },
15175  _uiSpinnerHtml: function() {
15176   return "<span>";
15177  },
15178
15179  _buttonHtml: function() {
15180   return "<a></a><a></a>";
15181  }
15182 } );
15183}
15184
15185var widgetsSpinner = $.ui.spinner;
15186
15187
15188/*!
15189 * jQuery UI Tabs 1.12.1
15190 * http://jqueryui.com
15191 *
15192 * Copyright jQuery Foundation and other contributors
15193 * Released under the MIT license.
15194 * http://jquery.org/license
15195 */
15196
15197//>>label: Tabs
15198//>>group: Widgets
15199//>>description: Transforms a set of container elements into a tab structure.
15200//>>docs: http://api.jqueryui.com/tabs/
15201//>>demos: http://jqueryui.com/tabs/
15202//>>css.structure: ../../themes/base/core.css
15203//>>css.structure: ../../themes/base/tabs.css
15204//>>css.theme: ../../themes/base/theme.css
15205
15206
15207
15208$.widget( "ui.tabs", {
15209 version: "1.12.1",
15210 delay: 300,
15211 options: {
15212  active: null,
15213  classes: {
15214   "ui-tabs": "ui-corner-all",
15215   "ui-tabs-nav": "ui-corner-all",
15216   "ui-tabs-panel": "ui-corner-bottom",
15217   "ui-tabs-tab": "ui-corner-top"
15218  },
15219  collapsible: false,
15220  event: "click",
15221  heightStyle: "content",
15222  hide: null,
15223  show: null,
15224
15225  // Callbacks
15226  activate: null,
15227  beforeActivate: null,
15228  beforeLoad: null,
15229  load: null
15230 },
15231
15232 _isLocal: ( function() {
15233  var rhash = /#.*$/;
15234
15235  return function( anchor ) {
15236   var anchorUrl, locationUrl;
15237
15238   anchorUrl = anchor.href.replace( rhash, "" );
15239   locationUrl = location.href.replace( rhash, "" );
15240
15241   // Decoding may throw an error if the URL isn't UTF-8 (#9518)
15242   try {
15243    anchorUrl = decodeURIComponent( anchorUrl );
15244   } catch ( error ) {}
15245   try {
15246    locationUrl = decodeURIComponent( locationUrl );
15247   } catch ( error ) {}
15248
15249   return anchor.hash.length > 1 && anchorUrl === locationUrl;
15250  };
15251 } )(),
15252
15253 _create: function() {
15254  var that = this,
15255   options = this.options;
15256
15257  this.running = false;
15258
15259  this._addClass( "ui-tabs", "ui-widget ui-widget-content" );
15260  this._toggleClass( "ui-tabs-collapsible", null, options.collapsible );
15261
15262  this._processTabs();
15263  options.active = this._initialActive();
15264
15265  // Take disabling tabs via class attribute from HTML
15266  // into account and update option properly.
15267  if ( $.isArray( options.disabled ) ) {
15268   options.disabled = $.unique( options.disabled.concat(
15269    $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
15270     return that.tabs.index( li );
15271    } )
15272   ) ).sort();
15273  }
15274
15275  // Check for length avoids error when initializing empty list
15276  if ( this.options.active !== false && this.anchors.length ) {
15277   this.active = this._findActive( options.active );
15278  } else {
15279   this.active = $();
15280  }
15281
15282  this._refresh();
15283
15284  if ( this.active.length ) {
15285   this.load( options.active );
15286  }
15287 },
15288
15289 _initialActive: function() {
15290  var active = this.options.active,
15291   collapsible = this.options.collapsible,
15292   locationHash = location.hash.substring( 1 );
15293
15294  if ( active === null ) {
15295
15296   // check the fragment identifier in the URL
15297   if ( locationHash ) {
15298    this.tabs.each( function( i, tab ) {
15299     if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
15300      active = i;
15301      return false;
15302     }
15303    } );
15304   }
15305
15306   // Check for a tab marked active via a class
15307   if ( active === null ) {
15308    active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
15309   }
15310
15311   // No active tab, set to false
15312   if ( active === null || active === -1 ) {
15313    active = this.tabs.length ? 0 : false;
15314   }
15315  }
15316
15317  // Handle numbers: negative, out of range
15318  if ( active !== false ) {
15319   active = this.tabs.index( this.tabs.eq( active ) );
15320   if ( active === -1 ) {
15321    active = collapsible ? false : 0;
15322   }
15323  }
15324
15325  // Don't allow collapsible: false and active: false
15326  if ( !collapsible && active === false && this.anchors.length ) {
15327   active = 0;
15328  }
15329
15330  return active;
15331 },
15332
15333 _getCreateEventData: function() {
15334  return {
15335   tab: this.active,
15336   panel: !this.active.length ? $() : this._getPanelForTab( this.active )
15337  };
15338 },
15339
15340 _tabKeydown: function( event ) {
15341  var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ),
15342   selectedIndex = this.tabs.index( focusedTab ),
15343   goingForward = true;
15344
15345  if ( this._handlePageNav( event ) ) {
15346   return;
15347  }
15348
15349  switch ( event.keyCode ) {
15350  case $.ui.keyCode.RIGHT:
15351  case $.ui.keyCode.DOWN:
15352   selectedIndex++;
15353   break;
15354  case $.ui.keyCode.UP:
15355  case $.ui.keyCode.LEFT:
15356   goingForward = false;
15357   selectedIndex--;
15358   break;
15359  case $.ui.keyCode.END:
15360   selectedIndex = this.anchors.length - 1;
15361   break;
15362  case $.ui.keyCode.HOME:
15363   selectedIndex = 0;
15364   break;
15365  case $.ui.keyCode.SPACE:
15366
15367   // Activate only, no collapsing
15368   event.preventDefault();
15369   clearTimeout( this.activating );
15370   this._activate( selectedIndex );
15371   return;
15372  case $.ui.keyCode.ENTER:
15373
15374   // Toggle (cancel delayed activation, allow collapsing)
15375   event.preventDefault();
15376   clearTimeout( this.activating );
15377
15378   // Determine if we should collapse or activate
15379   this._activate( selectedIndex === this.options.active ? false : selectedIndex );
15380   return;
15381  default:
15382   return;
15383  }
15384
15385  // Focus the appropriate tab, based on which key was pressed
15386  event.preventDefault();
15387  clearTimeout( this.activating );
15388  selectedIndex = this._focusNextTab( selectedIndex, goingForward );
15389
15390  // Navigating with control/command key will prevent automatic activation
15391  if ( !event.ctrlKey && !event.metaKey ) {
15392
15393   // Update aria-selected immediately so that AT think the tab is already selected.
15394   // Otherwise AT may confuse the user by stating that they need to activate the tab,
15395   // but the tab will already be activated by the time the announcement finishes.
15396   focusedTab.attr( "aria-selected", "false" );
15397   this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
15398
15399   this.activating = this._delay( function() {
15400    this.option( "active", selectedIndex );
15401   }, this.delay );
15402  }
15403 },
15404
15405 _panelKeydown: function( event ) {
15406  if ( this._handlePageNav( event ) ) {
15407   return;
15408  }
15409
15410  // Ctrl+up moves focus to the current tab
15411  if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
15412   event.preventDefault();
15413   this.active.trigger( "focus" );
15414  }
15415 },
15416
15417 // Alt+page up/down moves focus to the previous/next tab (and activates)
15418 _handlePageNav: function( event ) {
15419  if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
15420   this._activate( this._focusNextTab( this.options.active - 1, false ) );
15421   return true;
15422  }
15423  if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
15424   this._activate( this._focusNextTab( this.options.active + 1, true ) );
15425   return true;
15426  }
15427 },
15428
15429 _findNextTab: function( index, goingForward ) {
15430  var lastTabIndex = this.tabs.length - 1;
15431
15432  function constrain() {
15433   if ( index > lastTabIndex ) {
15434    index = 0;
15435   }
15436   if ( index < 0 ) {
15437    index = lastTabIndex;
15438   }
15439   return index;
15440  }
15441
15442  while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
15443   index = goingForward ? index + 1 : index - 1;
15444  }
15445
15446  return index;
15447 },
15448
15449 _focusNextTab: function( index, goingForward ) {
15450  index = this._findNextTab( index, goingForward );
15451  this.tabs.eq( index ).trigger( "focus" );
15452  return index;
15453 },
15454
15455 _setOption: function( key, value ) {
15456  if ( key === "active" ) {
15457
15458   // _activate() will handle invalid values and update this.options
15459   this._activate( value );
15460   return;
15461  }
15462
15463  this._super( key, value );
15464
15465  if ( key === "collapsible" ) {
15466   this._toggleClass( "ui-tabs-collapsible", null, value );
15467
15468   // Setting collapsible: false while collapsed; open first panel
15469   if ( !value && this.options.active === false ) {
15470    this._activate( 0 );
15471   }
15472  }
15473
15474  if ( key === "event" ) {
15475   this._setupEvents( value );
15476  }
15477
15478  if ( key === "heightStyle" ) {
15479   this._setupHeightStyle( value );
15480  }
15481 },
15482
15483 _sanitizeSelector: function( hash ) {
15484  return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):"";},refresh:function(){var options=this.options,lis=this.tablist.children(":has(a[href])");options.disabled=$.map(lis.filter(".ui-state-disabled"),function(tab){return lis.index(tab);});this._processTabs();if(options.active===false||!this.anchors.length){options.active=false;this.active=$();}else if(this.active.length&&!$.contains(this.tablist[0],this.active[0])
vendor: 16,237 bytes, lines 15484-15546
15484){if(this.tabs.length===options.disabled.length){options.active=false;this.active=$();}else{this._activate(this._findNextTab(Math.max(0,options.active-1),false));}}else{options.active=this.tabs.index(this.active);}
15485this._refresh();},_refresh:function(){this._setOptionDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"});if(!this.active.length){this.tabs.eq(0).attr("tabIndex",0);}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});this._addClass(this.active,"ui-tabs-active","ui-state-active");this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"});}},_processTabs:function(){var that=this,prevTabs=this.tabs,prevAnchors=this.anchors,prevPanels=this.panels;this.tablist=this._getList().attr("role","tablist");this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header");this.tablist.on("mousedown"+this.eventNamespace,"> li",function(event){if($(this).is(".ui-state-disabled")){event.preventDefault();}}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){if($(this).closest("li").is(".ui-state-disabled")){this.blur();}});this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1});this._addClass(this.tabs,"ui-tabs-tab","ui-state-default");this.anchors=this.tabs.map(function(){return $("a",this)[0];}).attr({role:"presentation",tabIndex:-1});this._addClass(this.anchors,"ui-tabs-anchor");this.panels=$();this.anchors.each(function(i,anchor){var selector,panel,panelId,anchorId=$(anchor).uniqueId().attr("id"),tab=$(anchor).closest("li"),originalAriaControls=tab.attr("aria-controls");if(that._isLocal(anchor)){selector=anchor.hash;panelId=selector.substring(1);panel=that.element.find(that._sanitizeSelector(selector));}else{panelId=tab.attr("aria-controls")||$({}).uniqueId()[0].id;selector="#"+panelId;panel=that.element.find(selector);if(!panel.length){panel=that._createPanel(panelId);panel.insertAfter(that.panels[i-1]||that.tablist);}
15486panel.attr("aria-live","polite");}
15487if(panel.length){that.panels=that.panels.add(panel);}
15488if(originalAriaControls){tab.data("ui-tabs-aria-controls",originalAriaControls);}
15489tab.attr({"aria-controls":panelId,"aria-labelledby":anchorId});panel.attr("aria-labelledby",anchorId);});this.panels.attr("role","tabpanel");this._addClass(this.panels,"ui-tabs-panel","ui-widget-content");if(prevTabs){this._off(prevTabs.not(this.tabs));this._off(prevAnchors.not(this.anchors));this._off(prevPanels.not(this.panels));}},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0);},_createPanel:function(id){return $("<div>").attr("id",id).data("ui-tabs-destroy",true);},_setOptionDisabled:function(disabled){var currentItem,li,i;if($.isArray(disabled)){if(!disabled.length){disabled=false;}else if(disabled.length===this.anchors.length){disabled=true;}}
15490for(i=0;(li=this.tabs[i]);i++){currentItem=$(li);if(disabled===true||$.inArray(i,disabled)!==-1){currentItem.attr("aria-disabled","true");this._addClass(currentItem,null,"ui-state-disabled");}else{currentItem.removeAttr("aria-disabled");this._removeClass(currentItem,null,"ui-state-disabled");}}
15491this.options.disabled=disabled;this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,disabled===true);},_setupEvents:function(event){var events={};if(event){$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler";});}
15492this._off(this.anchors.add(this.tabs).add(this.panels));this._on(true,this.anchors,{click:function(event){event.preventDefault();}});this._on(this.anchors,events);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs);},_setupHeightStyle:function(heightStyle){var maxHeight,parent=this.element.parent();if(heightStyle==="fill"){maxHeight=parent.height();maxHeight-=this.element.outerHeight()-this.element.height();this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");if(position==="absolute"||position==="fixed"){return;}
15493maxHeight-=elem.outerHeight(true);});this.element.children().not(this.panels).each(function(){maxHeight-=$(this).outerHeight(true);});this.panels.each(function(){$(this).height(Math.max(0,maxHeight-
15494$(this).innerHeight()+$(this).height()));}).css("overflow","auto");}else if(heightStyle==="auto"){maxHeight=0;this.panels.each(function(){maxHeight=Math.max(maxHeight,$(this).height("").height());}).height(maxHeight);}},_eventHandler:function(event){var options=this.options,active=this.active,anchor=$(event.currentTarget),tab=anchor.closest("li"),clickedIsActive=tab[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():this._getPanelForTab(tab),toHide=!active.length?$():this._getPanelForTab(active),eventData={oldTab:active,oldPanel:toHide,newTab:collapsing?$():tab,newPanel:toShow};event.preventDefault();if(tab.hasClass("ui-state-disabled")||tab.hasClass("ui-tabs-loading")||this.running||(clickedIsActive&&!options.collapsible)||(this._trigger("beforeActivate",event,eventData)===false)){return;}
15495options.active=collapsing?false:this.tabs.index(tab);this.active=clickedIsActive?$():tab;if(this.xhr){this.xhr.abort();}
15496if(!toHide.length&&!toShow.length){$.error("jQuery UI Tabs: Mismatching fragment identifier.");}
15497if(toShow.length){this.load(this.tabs.index(tab),event);}
15498this._toggle(event,eventData);},_toggle:function(event,eventData){var that=this,toShow=eventData.newPanel,toHide=eventData.oldPanel;this.running=true;function complete(){that.running=false;that._trigger("activate",event,eventData);}
15499function show(){that._addClass(eventData.newTab.closest("li"),"ui-tabs-active","ui-state-active");if(toShow.length&&that.options.show){that._show(toShow,that.options.show,complete);}else{toShow.show();complete();}}
15500if(toHide.length&&this.options.hide){this._hide(toHide,this.options.hide,function(){that._removeClass(eventData.oldTab.closest("li"),"ui-tabs-active","ui-state-active");show();});}else{this._removeClass(eventData.oldTab.closest("li"),"ui-tabs-active","ui-state-active");toHide.hide();show();}
15501toHide.attr("aria-hidden","true");eventData.oldTab.attr({"aria-selected":"false","aria-expanded":"false"});if(toShow.length&&toHide.length){eventData.oldTab.attr("tabIndex",-1);}else if(toShow.length){this.tabs.filter(function(){return $(this).attr("tabIndex")===0;}).attr("tabIndex",-1);}
15502toShow.attr("aria-hidden","false");eventData.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});},_activate:function(index){var anchor,active=this._findActive(index);if(active[0]===this.active[0]){return;}
15503if(!active.length){active=this.active;}
15504anchor=active.find(".ui-tabs-anchor")[0];this._eventHandler({target:anchor,currentTarget:anchor,preventDefault:$.noop});},_findActive:function(index){return index===false?$():this.tabs.eq(index);},_getIndex:function(index){if(typeof index==="string"){index=this.anchors.index(this.anchors.filter("[href$='"+
15505$.ui.escapeSelector(index)+"']"));}
15506return index;},_destroy:function(){if(this.xhr){this.xhr.abort();}
15507this.tablist.removeAttr("role").off(this.eventNamespace);this.anchors.removeAttr("role tabIndex").removeUniqueId();this.tabs.add(this.panels).each(function(){if($.data(this,"ui-tabs-destroy")){$(this).remove();}else{$(this).removeAttr("role tabIndex "+"aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded");}});this.tabs.each(function(){var li=$(this),prev=li.data("ui-tabs-aria-controls");if(prev){li.attr("aria-controls",prev).removeData("ui-tabs-aria-controls");}else{li.removeAttr("aria-controls");}});this.panels.show();if(this.options.heightStyle!=="content"){this.panels.css("height","");}},enable:function(index){var disabled=this.options.disabled;if(disabled===false){return;}
15508if(index===undefined){disabled=false;}else{index=this._getIndex(index);if($.isArray(disabled)){disabled=$.map(disabled,function(num){return num!==index?num:null;});}else{disabled=$.map(this.tabs,function(li,num){return num!==index?num:null;});}}
15509this._setOptionDisabled(disabled);},disable:function(index){var disabled=this.options.disabled;if(disabled===true){return;}
15510if(index===undefined){disabled=true;}else{index=this._getIndex(index);if($.inArray(index,disabled)!==-1){return;}
15511if($.isArray(disabled)){disabled=$.merge([index],disabled).sort();}else{disabled=[index];}}
15512this._setOptionDisabled(disabled);},load:function(index,event){index=this._getIndex(index);var that=this,tab=this.tabs.eq(index),anchor=tab.find(".ui-tabs-anchor"),panel=this._getPanelForTab(tab),eventData={tab:tab,panel:panel},complete=function(jqXHR,status){if(status==="abort"){that.panels.stop(false,true);}
15513that._removeClass(tab,"ui-tabs-loading");panel.removeAttr("aria-busy");if(jqXHR===that.xhr){delete that.xhr;}};if(this._isLocal(anchor[0])){return;}
15514this.xhr=$.ajax(this._ajaxSettings(anchor,event,eventData));if(this.xhr&&this.xhr.statusText!=="canceled"){this._addClass(tab,"ui-tabs-loading");panel.attr("aria-busy","true");this.xhr.done(function(response,status,jqXHR){setTimeout(function(){panel.html(response);that._trigger("load",event,eventData);complete(jqXHR,status);},1);}).fail(function(jqXHR,status){setTimeout(function(){complete(jqXHR,status);},1);});}},_ajaxSettings:function(anchor,event,eventData){var that=this;return{url:anchor.attr("href").replace(/#.*$/,""),beforeSend:function(jqXHR,settings){return that._trigger("beforeLoad",event,$.extend({jqXHR:jqXHR,ajaxSettings:settings},eventData));}};},_getPanelForTab:function(tab){var id=$(tab).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+id));}});if($.uiBackCompat!==false){$.widget("ui.tabs",$.ui.tabs,{_processTabs:function(){this._superApply(arguments);this._addClass(this.tabs,"ui-tab");}});}
15515var widgetsTabs=$.ui.tabs;
15516/*!
15517 * jQuery UI Tooltip 1.12.1
15518 * http://jqueryui.com
15519 *
15520 * Copyright jQuery Foundation and other contributors
15521 * Released under the MIT license.
15522 * http://jquery.org/license
15523 */
15524$.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var title=$(this).attr("title")||"";return $("<a>").text(title).html();},hide:true,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:true,track:false,close:null,open:null},_addDescribedBy:function(elem,id){var describedby=(elem.attr("aria-describedby")||"").split(/\s+/);describedby.push(id);elem.data("ui-tooltip-id",id).attr("aria-describedby",$.trim(describedby.join(" ")));},_removeDescribedBy:function(elem){var id=elem.data("ui-tooltip-id"),describedby=(elem.attr("aria-describedby")||"").split(/\s+/),index=$.inArray(id,describedby);if(index!==-1){describedby.splice(index,1);}
15525elem.removeData("ui-tooltip-id");describedby=$.trim(describedby.join(" "));if(describedby){elem.attr("aria-describedby",describedby);}else{elem.removeAttr("aria-describedby");}},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};this.liveRegion=$("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this.disabledTitles=$([]);},_setOption:function(key,value){var that=this;this._super(key,value);if(key==="content"){$.each(this.tooltips,function(id,tooltipData){that._updateContent(tooltipData.element);});}},_setOptionDisabled:function(value){this[value?"_disable":"_enable"]();},_disable:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur");event.target=event.currentTarget=tooltipData.element[0];that.close(event,true);});this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var element=$(this);if(element.is("[title]")){return element.data("ui-tooltip-title",element.attr("title")).removeAttr("title");}}));},_enable:function(){this.disabledTitles.each(function(){var element=$(this);if(element.data("ui-tooltip-title")){element.attr("title",element.data("ui-tooltip-title"));}});this.disabledTitles=$([]);},open:function(event){var that=this,target=$(event?event.target:this.element).closest(this.options.items);if(!target.length||target.data("ui-tooltip-id")){return;}
15526if(target.attr("title")){target.data("ui-tooltip-title",target.attr("title"));}
15527target.data("ui-tooltip-open",true);if(event&&event.type==="mouseover"){target.parents().each(function(){var parent=$(this),blurEvent;if(parent.data("ui-tooltip-open")){blurEvent=$.Event("blur");blurEvent.target=blurEvent.currentTarget=this;that.close(blurEvent,true);}
15528if(parent.attr("title")){parent.uniqueId();that.parents[this.id]={element:this,title:parent.attr("title")};parent.attr("title","");}});}
15529this._registerCloseHandlers(event,target);this._updateContent(target,event);},_updateContent:function(target,event){var content,contentOption=this.options.content,that=this,eventType=event?event.type:null;if(typeof contentOption==="string"||contentOption.nodeType||contentOption.jquery){return this._open(event,target,contentOption);}
15530content=contentOption.call(target[0],function(response){that._delay(function(){if(!target.data("ui-tooltip-open")){return;}
15531if(event){event.type=eventType;}
15532this._open(event,target,response);});});if(content){this._open(event,target,content);}},_open:function(event,target,content){var tooltipData,tooltip,delayedShow,a11yContent,positionOption=$.extend({},this.options.position);if(!content){return;}
15533tooltipData=this._find(target);if(tooltipData){tooltipData.tooltip.find(".ui-tooltip-content").html(content);return;}
15534if(target.is("[title]")){if(event&&event.type==="mouseover"){target.attr("title","");}else{target.removeAttr("title");}}
15535tooltipData=this._tooltip(target);tooltip=tooltipData.tooltip;this._addDescribedBy(target,tooltip.attr("id"));tooltip.find(".ui-tooltip-content").html(content);this.liveRegion.children().hide();a11yContent=$("<div>").html(tooltip.find(".ui-tooltip-content").html());a11yContent.removeAttr("name").find("[name]").removeAttr("name");a11yContent.removeAttr("id").find("[id]").removeAttr("id");a11yContent.appendTo(this.liveRegion);function position(event){positionOption.of=event;if(tooltip.is(":hidden")){return;}
15536tooltip.position(positionOption);}
15537if(this.options.track&&event&&/^mouse/.test(event.type)){this._on(this.document,{mousemove:position});position(event);}else{tooltip.position($.extend({of:target},this.options.position));}
15538tooltip.hide();this._show(tooltip,this.options.show);if(this.options.track&&this.options.show&&this.options.show.delay){delayedShow=this.delayedShow=setInterval(function(){if(tooltip.is(":visible")){position(positionOption.of);clearInterval(delayedShow);}},$.fx.interval);}
15539this._trigger("open",event,{tooltip:tooltip});},_registerCloseHandlers:function(event,target){var events={keyup:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){var fakeEvent=$.Event(event);fakeEvent.currentTarget=target[0];this.close(fakeEvent,true);}}};if(target[0]!==this.element[0]){events.remove=function(){this._removeTooltip(this._find(target).tooltip);};}
15540if(!event||event.type==="mouseover"){events.mouseleave="close";}
15541if(!event||event.type==="focusin"){events.focusout="close";}
15542this._on(true,target,events);},close:function(event){var tooltip,that=this,target=$(event?event.currentTarget:this.element),tooltipData=this._find(target);if(!tooltipData){target.removeData("ui-tooltip-open");return;}
15543tooltip=tooltipData.tooltip;if(tooltipData.closing){return;}
15544clearInterval(this.delayedShow);if(target.data("ui-tooltip-title")&&!target.attr("title")){target.attr("title",target.data("ui-tooltip-title"));}
15545this._removeDescribedBy(target);tooltipData.hiding=true;tooltip.stop(true);this._hide(tooltip,this.options.hide,function(){that._removeTooltip($(this));});target.removeData("ui-tooltip-open");this._off(target,"mouseleave focusout keyup");if(target[0]!==this.element[0]){this._off(target,"remove");}
15546this._off(this.document,"mousemove");
15546if(event&&event.type==="mouseleave"){$.each(this.parents,function(id,parent){$(parent.element).attr("title",parent.title);delete that.parents[id];});}
15547tooltipData.closing=true;this._trigger("close",event,{tooltip:tooltip});if(!tooltipData.hiding){tooltipData.closing=false;}},_tooltip:function(element){var tooltip=$("<div>").attr("role","tooltip"),content=$("<div>").appendTo(tooltip),id=tooltip.uniqueId().attr("id");this._addClass(content,"ui-tooltip-content");this._addClass(tooltip,"ui-tooltip","ui-widget ui-widget-content");tooltip.appendTo(this._appendTo(element));return this.tooltips[id]={element:element,tooltip:tooltip};},_find:function(target){var id=target.data("ui-tooltip-id");return id?this.tooltips[id]:null;},_removeTooltip:function(tooltip){tooltip.remove();delete this.tooltips[tooltip.attr("id")];},_appendTo:function(target){var element=target.closest(".ui-front, dialog");if(!element.length){element=this.document[0].body;}
15548return element;},_destroy:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur"),element=tooltipData.element;event.target=event.currentTarget=element[0];that.close(event,true);$("#"+id).remove();if(element.data("ui-tooltip-title")){if(!element.attr("title")){element.attr("title",element.data("ui-tooltip-title"));}
15549element.removeData("ui-tooltip-title");}});this.liveRegion.remove();}});if($.uiBackCompat!==false){$.widget("ui.tooltip",$.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var tooltipData=this._superApply(arguments);if(this.options.tooltipClass){tooltipData.tooltip.addClass(this.options.tooltipClass);}
15550return tooltipData;}});}
15551var widgetsTooltip=$.ui.tooltip;}));;;$('#cookiesAccept').click(function(){Cookies.set('CookiesAccepted',true);$('.cookie_agreement').hide();});;;$(function(){$("#header_search").autocomplete({source:"/search/json/",minLength:3,select:function(event,ui){location.href='/ru/'+ui.item.type+'/'+ui.item.url;}}).autocomplete("instance")._renderItem=function(ul,item){var typeStr='';switch(item.type){case'country':typeStr='Страна';break;case'city':typeStr='Город';break;case'showplace':typeStr='Достопримечательность';break;default:typeStr='';}
15552if(typeStr!==''){typeStr='<small><b>'+typeStr+':</b></small><br />';}
15553return $("<li>").append("<div>"+typeStr+item.label+"<br /><small>
15553"+item.shortDesc+"</small></div>").appendTo(ul);};});;;$('.currenciesMenu li').click(function(){var code=$(this).attr('id');$.get("/setCurrency",{currencyCode:code},onAjaxSuccess);function onAjaxSuccess(data){location.reload();}});;;(function(){var burger=document.getElementById('cxBurger');var header=document.querySelector('.cx-header');if(!burger||!header)return;burger.addEventListener('click',function(){var open=header.classList.toggle('is-open');burger.setAttribute('aria-expanded',open?'true':'false');});header.querySelectorAll('.cx-nav a').forEach(function(link){link.addEventListener('click',function(){header.classList.remove('is-open');burger.setAttribute('aria-expanded','false');});});})();;;;;$('#more-tags-link').click(function(){$.get('/ru/blog/more-tags/',function(data){$('#more-tags-link').remove();$('#more-tags-link-clearfix').remove();$.each(data,function(i,item){var liStr="<a href='/ru/blog/tag/"+item.slug+"'>"+item.tag+"</a>";$('.tagcloud').append(liStr);});if(typeof setWidgetTopPosition!=="undefined"){setWidgetTopPosition();}});});;;
15554/*!
15555 * JavaScript Cookie v2.2.0
15556 * https://github.com/js-cookie/js-cookie
15557 *
15558 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
15559 * Released under the MIT license
15560 */;(function(factory){var registeredInModuleLoader=false;if(typeof define==='function'&&define.amd){define(factory);registeredInModuleLoader=true;}
15561if(typeof exports==='object'){module.exports=factory();registeredInModuleLoader=true;}
15562if(!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];}}
15563return result;}
15564function init(converter){function api(key,value,attributes){var result;if(typeof document==='undefined'){return;}
15565if(arguments.length>1){attributes=extend({path:'/'},api.defaults,attributes);if(typeof attributes.expires==='number'){var expires=new Date();expires.setMilliseconds(expires.getMilliseconds()+attributes.expires*864e+5);attributes.expires=expires;}
15566attributes.expires=attributes.expires?attributes.expires.toUTCString():'';try{result=JSON.stringify(value);if(/^[\{\[]/.test(result)){value=result;}}catch(e){}
15567if(!converter.write){value=encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);}else{value=converter.write(value,key);}
15568key=encodeURIComponent(String(key));key=key.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent);key=key.replace(/[\(\)]/g,escape);var stringifiedAttributes='';for(var attributeName in attributes){if(!attributes[attributeName]){continue;}
15569stringifiedAttributes+='; '+attributeName;if(attributes[attributeName]===true){continue;}
15570stringifiedAttributes+='='+attributes[attributeName];}
15571return(document.cookie=key+'='+value+stringifiedAttributes);}
15572if(!key){result={};}
15573var cookies=document.cookie?document.cookie.split('; '):[];var rdecode=/(%[0-9A-Z]{2})+/g;var i=0;for(;i<cookies.length;i++){var parts=cookies[i].split('=');var cookie=parts.slice(1).join('=');if(!this.json&&cookie.charAt(0)==='"'){cookie=cookie.slice(1,-1);}
15574try{var name=parts[0].replace(rdecode,decodeURIComponent);cookie=converter.read?converter.read(cookie,name):converter(cookie,name)||cookie.replace(rdecode,decodeURIComponent);if(this.json){try{cookie=JSON.parse(cookie);}catch(e){}}
15575if(key===name){result=cookie;break;}
15576if(!key){result[name]=cookie;}}catch(e){}}
15577return result;}
15578api.set=api;api.get=function(key){return api.call(api,key);};api.getJSON=function(){return api.apply({json:true},[].slice.call(arguments));};api.defaults={};api.remove=function(key,attributes){api(key,'',extend(attributes,{expires:-1}));};api.withConverter=init;return api;}
15579return init(function(){});}));;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.