
/*-----/js/jquery/jquery-1.11.2.min.js / start -----*/

!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.2",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=mb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=nb(b);function qb(){}qb.prototype=d.filters=d.pseudos,d.setFilters=new qb,g=gb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?gb.error(a):z(a,i).slice(0)};function rb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)
}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});

/*-----/js/jquery/jquery-1.11.2.min.js / end -----*/

/*-----/js/jquery/jquery-migrate-1.2.1.min.js / start -----*/

jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
/*-----/js/jquery/jquery-migrate-1.2.1.min.js / end -----*/

/*-----/js/jquery/jquery-browser-plugin.min.js / start -----*/
!function(a){"function"==typeof define&&define.amd?define(["jquery"],function(b){return a(b)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(window.jQuery)}(function(a){"use strict";function b(a){void 0===a&&(a=window.navigator.userAgent),a=a.toLowerCase();var b=/(edge)\/([\w.]+)/.exec(a)||/(opr)[\/]([\w.]+)/.exec(a)||/(chrome)[ \/]([\w.]+)/.exec(a)||/(iemobile)[\/]([\w.]+)/.exec(a)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[],c=/(ipad)/.exec(a)||/(ipod)/.exec(a)||/(windows phone)/.exec(a)||/(iphone)/.exec(a)||/(kindle)/.exec(a)||/(silk)/.exec(a)||/(android)/.exec(a)||/(win)/.exec(a)||/(mac)/.exec(a)||/(linux)/.exec(a)||/(cros)/.exec(a)||/(playbook)/.exec(a)||/(bb)/.exec(a)||/(blackberry)/.exec(a)||[],d={},e={browser:b[5]||b[3]||b[1]||"",version:b[2]||b[4]||"0",versionNumber:b[4]||b[2]||"0",platform:c[0]||""};if(e.browser&&(d[e.browser]=!0,d.version=e.version,d.versionNumber=parseInt(e.versionNumber,10)),e.platform&&(d[e.platform]=!0),(d.android||d.bb||d.blackberry||d.ipad||d.iphone||d.ipod||d.kindle||d.playbook||d.silk||d["windows phone"])&&(d.mobile=!0),(d.cros||d.mac||d.linux||d.win)&&(d.desktop=!0),(d.chrome||d.opr||d.safari)&&(d.webkit=!0),d.rv||d.iemobile){var f="msie";e.browser=f,d[f]=!0}if(d.edge){delete d.edge;var g="msedge";e.browser=g,d[g]=!0}if(d.safari&&d.blackberry){var h="blackberry";e.browser=h,d[h]=!0}if(d.safari&&d.playbook){var i="playbook";e.browser=i,d[i]=!0}if(d.bb){var j="blackberry";e.browser=j,d[j]=!0}if(d.opr){var k="opera";e.browser=k,d[k]=!0}if(d.safari&&d.android){var l="android";e.browser=l,d[l]=!0}if(d.safari&&d.kindle){var m="kindle";e.browser=m,d[m]=!0}if(d.safari&&d.silk){var n="silk";e.browser=n,d[n]=!0}return d.name=e.browser,d.platform=e.platform,d}return window.jQBrowser=b(window.navigator.userAgent),window.jQBrowser.uaMatch=b,a&&(a.browser=window.jQBrowser),window.jQBrowser});

$("html").addClass([$.browser.name, $.browser.name + $.browser.versionNumber].join(' '));
/*-----/js/jquery/jquery-browser-plugin.min.js / end -----*/

/*-----/js/jquery/jquery.mousewheel.min.js / start -----*/

!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
/*-----/js/jquery/jquery.mousewheel.min.js / end -----*/

/*-----/js/jquery/jquery.jscrollpane.js / start -----*/


// Script: jScrollPane - cross browser customisable scrollbars
//
// *Version: 2.0.21, Last updated: 2015-02-24*
//
// Project Home - http://jscrollpane.kelvinluck.com/
// GitHub       - http://github.com/vitch/jScrollPane
// Source       - http://github.com/vitch/jScrollPane/raw/master/script/jquery.jscrollpane.js
// (Minified)   - http://github.com/vitch/jScrollPane/raw/master/script/jquery.jscrollpane.min.js
//
// About: License
//
// Copyright (c) 2014 Kelvin Luck
// Dual licensed under the MIT or GPL Version 2 licenses.
// http://jscrollpane.kelvinluck.com/MIT-LICENSE.txt
// http://jscrollpane.kelvinluck.com/GPL-LICENSE.txt
//
// About: Examples
//
// All examples and demos are available through the jScrollPane example site at:
// http://jscrollpane.kelvinluck.com/
//
// About: Support and Testing
//
// This plugin is tested on the browsers below and has been found to work reliably on them. If you run
// into a problem on one of the supported browsers then please visit the support section on the jScrollPane
// website (http://jscrollpane.kelvinluck.com/) for more information on getting support. You are also
// welcome to fork the project on GitHub if you can contribute a fix for a given issue.
//
// jQuery Versions - tested in 1.4.2+ - reported to work in 1.3.x
// Browsers Tested - Firefox 3.6.8, Safari 5, Opera 10.6, Chrome 5.0, IE 6, 7, 8
//
// About: Release History
//
// 2.0.21 - (2015-02-24) Simplify UMD pattern: fixes browserify when loading jQuery outside of bundle
// 2.0.20 - (2014-10-23) Adds AMD support (thanks @carlosrberto) and support for overflow-x/overflow-y (thanks @darimpulso)
// 2.0.19 - (2013-11-16) Changes for more reliable scroll amount with latest mousewheel plugin (thanks @brandonaaron)
// 2.0.18 - (2013-10-23) Fix for issue with gutters and scrollToElement (thanks @Dubiy)
// 2.0.17 - (2013-08-17) Working correctly when box-sizing is set to border-box (thanks @pieht)
// 2.0.16 - (2013-07-30) Resetting left position when scroll is removed. Fixes #189
// 2.0.15 - (2013-07-29) Fixed issue with scrollToElement where the destX and destY are undefined.
// 2.0.14 - (2013-05-01) Updated to most recent mouse wheel plugin (see #106) and related changes for sensible scroll speed
// 2.0.13 - (2013-05-01) Switched to semver compatible version name
// 2.0.0beta12 - (2012-09-27) fix for jQuery 1.8+
// 2.0.0beta11 - (2012-05-14)
// 2.0.0beta10 - (2011-04-17) cleaner required size calculation, improved keyboard support, stickToBottom/Left, other small fixes
// 2.0.0beta9 - (2011-01-31) new API methods, bug fixes and correct keyboard support for FF/OSX
// 2.0.0beta8 - (2011-01-29) touchscreen support, improved keyboard support
// 2.0.0beta7 - (2011-01-23) scroll speed consistent (thanks Aivo Paas)
// 2.0.0beta6 - (2010-12-07) scrollToElement horizontal support
// 2.0.0beta5 - (2010-10-18) jQuery 1.4.3 support, various bug fixes
// 2.0.0beta4 - (2010-09-17) clickOnTrack support, bug fixes
// 2.0.0beta3 - (2010-08-27) Horizontal mousewheel, mwheelIntent, keyboard support, bug fixes
// 2.0.0beta2 - (2010-08-21) Bug fixes
// 2.0.0beta1 - (2010-08-17) Rewrite to follow modern best practices and enable horizontal scrolling, initially hidden
//							 elements and dynamically sized elements.
// 1.x - (2006-12-31 - 2010-07-31) Initial version, hosted at googlecode, deprecated

(function (factory) {
  if ( typeof define === 'function' && define.amd ) {
      // AMD. Register as an anonymous module.
      define(['jquery'], factory);
  } else if (typeof exports === 'object') {
      // Node/CommonJS style for Browserify
      module.exports = factory(require('jquery'));
  } else {
      // Browser globals
      factory(jQuery);
  }
}(function($){

	$.fn.jScrollPane = function(settings)
	{
		// JScrollPane "class" - public methods are available through $('selector').data('jsp')
		function JScrollPane(elem, s)
		{
			var settings, jsp = this, pane, paneWidth, paneHeight, container, contentWidth, contentHeight,
				percentInViewH, percentInViewV, isScrollableV, isScrollableH, verticalDrag, dragMaxY,
				verticalDragPosition, horizontalDrag, dragMaxX, horizontalDragPosition,
				verticalBar, verticalTrack, scrollbarWidth, verticalTrackHeight, verticalDragHeight, arrowUp, arrowDown,
				horizontalBar, horizontalTrack, horizontalTrackWidth, horizontalDragWidth, arrowLeft, arrowRight,
				reinitialiseInterval, originalPadding, originalPaddingTotalWidth, previousContentWidth,
				wasAtTop = true, wasAtLeft = true, wasAtBottom = false, wasAtRight = false,
				originalElement = elem.clone(false, false).empty(),
				mwEvent = $.fn.mwheelIntent ? 'mwheelIntent.jsp' : 'mousewheel.jsp';

			if (elem.css('box-sizing') === 'border-box') {
				originalPadding = 0;
				originalPaddingTotalWidth = 0;
			} else {
				originalPadding = elem.css('paddingTop') + ' ' +
									elem.css('paddingRight') + ' ' +
									elem.css('paddingBottom') + ' ' +
									elem.css('paddingLeft');
				originalPaddingTotalWidth = (parseInt(elem.css('paddingLeft'), 10) || 0) +
											(parseInt(elem.css('paddingRight'), 10) || 0);
			}

			function initialise(s)
			{

				var isMaintainingPositon, lastContentX, lastContentY,
						hasContainingSpaceChanged, originalScrollTop, originalScrollLeft,
						maintainAtBottom = false, maintainAtRight = false;

				settings = s;

				if (pane === undefined) {
					originalScrollTop = elem.scrollTop();
					originalScrollLeft = elem.scrollLeft();

					elem.css(
						{
							overflow: 'hidden',
							padding: 0
						}
					);
					// TODO: Deal with where width/ height is 0 as it probably means the element is hidden and we should
					// come back to it later and check once it is unhidden...
					paneWidth = elem.innerWidth() + originalPaddingTotalWidth;
					paneHeight = elem.innerHeight();

					elem.width(paneWidth);

					pane = $('<div class="jspPane" />').css('padding', originalPadding).append(elem.children());
					container = $('<div class="jspContainer" />')
						.css({
							'width': paneWidth + 'px',
							'height': paneHeight + 'px'
						}
					).append(pane).appendTo(elem);

					
				} else {
					elem.css('width', '');

					maintainAtBottom = settings.stickToBottom && isCloseToBottom();
					maintainAtRight  = settings.stickToRight  && isCloseToRight();

					hasContainingSpaceChanged = elem.innerWidth() + originalPaddingTotalWidth != paneWidth || elem.outerHeight() != paneHeight;

					if (hasContainingSpaceChanged) {
						paneWidth = elem.innerWidth() + originalPaddingTotalWidth;
						paneHeight = elem.innerHeight();
						container.css({
							width: paneWidth + 'px',
							height: paneHeight + 'px'
						});
					}

					// If nothing changed since last check...
					if (!hasContainingSpaceChanged && previousContentWidth == contentWidth && pane.outerHeight() == contentHeight) {
						elem.width(paneWidth);
						return;
					}
					previousContentWidth = contentWidth;

					pane.css('width', '');
					elem.width(paneWidth);

					container.find('>.jspVerticalBar,>.jspHorizontalBar').remove().end();
				}

				pane.css('overflow', 'auto');
				if (s.contentWidth) {
					contentWidth = s.contentWidth;
				} else {
					contentWidth = pane[0].scrollWidth;
				}
				contentHeight = pane[0].scrollHeight;
				pane.css('overflow', '');

				percentInViewH = contentWidth / paneWidth;
				percentInViewV = contentHeight / paneHeight;
				isScrollableV = percentInViewV > 1;

				isScrollableH = percentInViewH > 1;

				//console.log(paneWidth, paneHeight, contentWidth, contentHeight, percentInViewH, percentInViewV, isScrollableH, isScrollableV);

				if (!(isScrollableH || isScrollableV)) {
					elem.removeClass('jspScrollable');
					pane.css({
            top: 0,
            left: 0,
						width: container.width() - originalPaddingTotalWidth
					});
					removeMousewheel();
					removeFocusHandler();
					removeKeyboardNav();
					removeClickOnTrack();
				} else {
					elem.addClass('jspScrollable');

					isMaintainingPositon = settings.maintainPosition && (verticalDragPosition || horizontalDragPosition);
					if (isMaintainingPositon) {
						lastContentX = contentPositionX();
						lastContentY = contentPositionY();
					}

					initialiseVerticalScroll();
					initialiseHorizontalScroll();
					resizeScrollbars();

					if (isMaintainingPositon) {
						scrollToX(maintainAtRight  ? (contentWidth  - paneWidth ) : lastContentX, false);
						scrollToY(maintainAtBottom ? (contentHeight - paneHeight) : lastContentY, false);
					}

					initFocusHandler();
					initMousewheel();
					initTouch();

					if (settings.enableKeyboardNavigation) {
						initKeyboardNav();
					}
					if (settings.clickOnTrack) {
						initClickOnTrack();
					}

					observeHash();
					if (settings.hijackInternalLinks) {
						hijackInternalLinks();
					}
				}

				if (settings.autoReinitialise && !reinitialiseInterval) {
					reinitialiseInterval = setInterval(
						function()
						{
							initialise(settings);
						},
						settings.autoReinitialiseDelay
					);
				} else if (!settings.autoReinitialise && reinitialiseInterval) {
					clearInterval(reinitialiseInterval);
				}

				originalScrollTop && elem.scrollTop(0) && scrollToY(originalScrollTop, false);
				originalScrollLeft && elem.scrollLeft(0) && scrollToX(originalScrollLeft, false);

				elem.trigger('jsp-initialised', [isScrollableH || isScrollableV]);
			}

			function initialiseVerticalScroll()
			{
				if (isScrollableV) {

					container.append(
						$('<div class="jspVerticalBar" '+(settings.isVerticalScrollBarHide ? 'style="display:none;"' : "" )+' />').append(
							$('<div class="jspCap jspCapTop" />'),
							$('<div class="jspTrack" />').append(
								$('<div class="jspDrag" />').append(
									$('<div class="jspDragTop" />'),
									$('<div class="jspDragBottom" />')
								)
							),
							$('<div class="jspCap jspCapBottom" />')
						)
					);

					verticalBar = container.find('>.jspVerticalBar');
					verticalTrack = verticalBar.find('>.jspTrack');
					verticalDrag = verticalTrack.find('>.jspDrag');

					if (settings.showArrows) {
						arrowUp = $('<a class="jspArrow jspArrowUp" />').bind(
							'mousedown.jsp', getArrowScroll(0, -1)
						).bind('click.jsp', nil);
						arrowDown = $('<a class="jspArrow jspArrowDown" />').bind(
							'mousedown.jsp', getArrowScroll(0, 1)
						).bind('click.jsp', nil);
						if (settings.arrowScrollOnHover) {
							arrowUp.bind('mouseover.jsp', getArrowScroll(0, -1, arrowUp));
							arrowDown.bind('mouseover.jsp', getArrowScroll(0, 1, arrowDown));
						}

						appendArrows(verticalTrack, settings.verticalArrowPositions, arrowUp, arrowDown);
					}

					verticalTrackHeight = paneHeight;
					container.find('>.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow').each(
						function()
						{
							verticalTrackHeight -= $(this).outerHeight();
						}
					);


					verticalDrag.hover(
						function()
						{
							verticalDrag.addClass('jspHover');
						},
						function()
						{
							verticalDrag.removeClass('jspHover');
						}
					).bind(
						'mousedown.jsp',
						function(e)
						{
							// Stop IE from allowing text selection
							$('html').bind('dragstart.jsp selectstart.jsp', nil);

							verticalDrag.addClass('jspActive');

							var startY = e.pageY - verticalDrag.position().top;

							$('html').bind(
								'mousemove.jsp',
								function(e)
								{
									positionDragY(e.pageY - startY, false);
								}
							).bind('mouseup.jsp mouseleave.jsp', cancelDrag);
							return false;
						}
					);
					sizeVerticalScrollbar();
				}
			}

			function sizeVerticalScrollbar()
			{
				verticalTrack.height(verticalTrackHeight + 'px');
				verticalDragPosition = 0;
				scrollbarWidth = settings.verticalGutter + verticalTrack.outerWidth();

				// Make the pane thinner to allow for the vertical scrollbar
				pane.width(paneWidth - scrollbarWidth - originalPaddingTotalWidth);

				// Add margin to the left of the pane if scrollbars are on that side (to position
				// the scrollbar on the left or right set it's left or right property in CSS)
				try {
					if (verticalBar.position().left === 0) {
						pane.css('margin-left', scrollbarWidth + 'px');
					}
				} catch (err) {
				}
			}

			function initialiseHorizontalScroll()
			{
				if (isScrollableH) {

					container.append(
						$('<div class="jspHorizontalBar" />').append(
							$('<div class="jspCap jspCapLeft" />'),
							$('<div class="jspTrack" />').append(
								$('<div class="jspDrag" />').append(
									$('<div class="jspDragLeft" />'),
									$('<div class="jspDragRight" />')
								)
							),
							$('<div class="jspCap jspCapRight" />')
						)
					);

					horizontalBar = container.find('>.jspHorizontalBar');
					horizontalTrack = horizontalBar.find('>.jspTrack');
					horizontalDrag = horizontalTrack.find('>.jspDrag');

					if (settings.showArrows) {
						arrowLeft = $('<a class="jspArrow jspArrowLeft" />').bind(
							'mousedown.jsp', getArrowScroll(-1, 0)
						).bind('click.jsp', nil);
						arrowRight = $('<a class="jspArrow jspArrowRight" />').bind(
							'mousedown.jsp', getArrowScroll(1, 0)
						).bind('click.jsp', nil);
						if (settings.arrowScrollOnHover) {
							arrowLeft.bind('mouseover.jsp', getArrowScroll(-1, 0, arrowLeft));
							arrowRight.bind('mouseover.jsp', getArrowScroll(1, 0, arrowRight));
						}
						appendArrows(horizontalTrack, settings.horizontalArrowPositions, arrowLeft, arrowRight);
					}

					horizontalDrag.hover(
						function()
						{
							horizontalDrag.addClass('jspHover');
						},
						function()
						{
							horizontalDrag.removeClass('jspHover');
						}
					).bind(
						'mousedown.jsp',
						function(e)
						{
							// Stop IE from allowing text selection
							$('html').bind('dragstart.jsp selectstart.jsp', nil);

							horizontalDrag.addClass('jspActive');

							var startX = e.pageX - horizontalDrag.position().left;

							$('html').bind(
								'mousemove.jsp',
								function(e)
								{
									positionDragX(e.pageX - startX, false);
								}
							).bind('mouseup.jsp mouseleave.jsp', cancelDrag);
							return false;
						}
					);
					horizontalTrackWidth = container.innerWidth();
					sizeHorizontalScrollbar();
				}
			}

			function sizeHorizontalScrollbar()
			{
				container.find('>.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow').each(
					function()
					{
						horizontalTrackWidth -= $(this).outerWidth();
					}
				);

				horizontalTrack.width(horizontalTrackWidth + 'px');
				horizontalDragPosition = 0;
			}

			function resizeScrollbars()
			{
				if (isScrollableH && isScrollableV) {
					var horizontalTrackHeight = horizontalTrack.outerHeight(),
						verticalTrackWidth = verticalTrack.outerWidth();
					verticalTrackHeight -= horizontalTrackHeight;
					$(horizontalBar).find('>.jspCap:visible,>.jspArrow').each(
						function()
						{
							horizontalTrackWidth += $(this).outerWidth();
						}
					);
					horizontalTrackWidth -= verticalTrackWidth;
					paneHeight -= verticalTrackWidth;
					paneWidth -= horizontalTrackHeight;
					horizontalTrack.parent().append(
						$('<div class="jspCorner" />').css('width', horizontalTrackHeight + 'px')
					);
					sizeVerticalScrollbar();
					sizeHorizontalScrollbar();
				}
				// reflow content
				if (isScrollableH) {
					pane.width((container.outerWidth() - originalPaddingTotalWidth) + 'px');
				}
				contentHeight = pane.outerHeight();
				percentInViewV = contentHeight / paneHeight;

				if (isScrollableH) {
					horizontalDragWidth = Math.ceil(1 / percentInViewH * horizontalTrackWidth);
					if (horizontalDragWidth > settings.horizontalDragMaxWidth) {
						horizontalDragWidth = settings.horizontalDragMaxWidth;
					} else if (horizontalDragWidth < settings.horizontalDragMinWidth) {
						horizontalDragWidth = settings.horizontalDragMinWidth;
					}
					horizontalDrag.width(horizontalDragWidth + 'px');
					dragMaxX = horizontalTrackWidth - horizontalDragWidth;
					_positionDragX(horizontalDragPosition); // To update the state for the arrow buttons
				}
				if (isScrollableV) {
					verticalDragHeight = Math.ceil(1 / percentInViewV * verticalTrackHeight);
					if (verticalDragHeight > settings.verticalDragMaxHeight) {
						verticalDragHeight = settings.verticalDragMaxHeight;
					} else if (verticalDragHeight < settings.verticalDragMinHeight) {
						verticalDragHeight = settings.verticalDragMinHeight;
					}
					verticalDrag.height(verticalDragHeight + 'px');
					dragMaxY = verticalTrackHeight - verticalDragHeight;
					_positionDragY(verticalDragPosition); // To update the state for the arrow buttons
				}
			}

			function appendArrows(ele, p, a1, a2)
			{
				var p1 = "before", p2 = "after", aTemp;

				// Sniff for mac... Is there a better way to determine whether the arrows would naturally appear
				// at the top or the bottom of the bar?
				if (p == "os") {
					p = /Mac/.test(navigator.platform) ? "after" : "split";
				}
				if (p == p1) {
					p2 = p;
				} else if (p == p2) {
					p1 = p;
					aTemp = a1;
					a1 = a2;
					a2 = aTemp;
				}

				ele[p1](a1)[p2](a2);
			}

			function getArrowScroll(dirX, dirY, ele)
			{
				return function()
				{
					arrowScroll(dirX, dirY, this, ele);
					this.blur();
					return false;
				};
			}

			function arrowScroll(dirX, dirY, arrow, ele)
			{
				arrow = $(arrow).addClass('jspActive');

				var eve,
					scrollTimeout,
					isFirst = true,
					doScroll = function()
					{
						if (dirX !== 0) {
							jsp.scrollByX(dirX * settings.arrowButtonSpeed);
						}
						if (dirY !== 0) {
							jsp.scrollByY(dirY * settings.arrowButtonSpeed);
						}
						scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.arrowRepeatFreq);
						isFirst = false;
					};

				doScroll();

				eve = ele ? 'mouseout.jsp' : 'mouseup.jsp';
				ele = ele || $('html');
				ele.bind(
					eve,
					function()
					{
						arrow.removeClass('jspActive');
						scrollTimeout && clearTimeout(scrollTimeout);
						scrollTimeout = null;
						ele.unbind(eve);
					}
				);
			}

			function initClickOnTrack()
			{
				removeClickOnTrack();
				if (isScrollableV) {
					verticalTrack.bind(
						'mousedown.jsp',
						function(e)
						{
							if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) {
								var clickedTrack = $(this),
									offset = clickedTrack.offset(),
									direction = e.pageY - offset.top - verticalDragPosition,
									scrollTimeout,
									isFirst = true,
									doScroll = function()
									{
										var offset = clickedTrack.offset(),
											pos = e.pageY - offset.top - verticalDragHeight / 2,
											contentDragY = paneHeight * settings.scrollPagePercent,
											dragY = dragMaxY * contentDragY / (contentHeight - paneHeight);
										if (direction < 0) {
											if (verticalDragPosition - dragY > pos) {
												jsp.scrollByY(-contentDragY);
											} else {
												positionDragY(pos);
											}
										} else if (direction > 0) {
											if (verticalDragPosition + dragY < pos) {
												jsp.scrollByY(contentDragY);
											} else {
												positionDragY(pos);
											}
										} else {
											cancelClick();
											return;
										}
										scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq);
										isFirst = false;
									},
									cancelClick = function()
									{
										scrollTimeout && clearTimeout(scrollTimeout);
										scrollTimeout = null;
										$(document).unbind('mouseup.jsp', cancelClick);
									};
								doScroll();
								$(document).bind('mouseup.jsp', cancelClick);
								return false;
							}
						}
					);
				}

				if (isScrollableH) {
					horizontalTrack.bind(
						'mousedown.jsp',
						function(e)
						{
							if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) {
								var clickedTrack = $(this),
									offset = clickedTrack.offset(),
									direction = e.pageX - offset.left - horizontalDragPosition,
									scrollTimeout,
									isFirst = true,
									doScroll = function()
									{
										var offset = clickedTrack.offset(),
											pos = e.pageX - offset.left - horizontalDragWidth / 2,
											contentDragX = paneWidth * settings.scrollPagePercent,
											dragX = dragMaxX * contentDragX / (contentWidth - paneWidth);
										if (direction < 0) {
											if (horizontalDragPosition - dragX > pos) {
												jsp.scrollByX(-contentDragX);
											} else {
												positionDragX(pos);
											}
										} else if (direction > 0) {
											if (horizontalDragPosition + dragX < pos) {
												jsp.scrollByX(contentDragX);
											} else {
												positionDragX(pos);
											}
										} else {
											cancelClick();
											return;
										}
										scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq);
										isFirst = false;
									},
									cancelClick = function()
									{
										scrollTimeout && clearTimeout(scrollTimeout);
										scrollTimeout = null;
										$(document).unbind('mouseup.jsp', cancelClick);
									};
								doScroll();
								$(document).bind('mouseup.jsp', cancelClick);
								return false;
							}
						}
					);
				}
			}

			function removeClickOnTrack()
			{
				if (horizontalTrack) {
					horizontalTrack.unbind('mousedown.jsp');
				}
				if (verticalTrack) {
					verticalTrack.unbind('mousedown.jsp');
				}
			}

			function cancelDrag()
			{
				$('html').unbind('dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp');

				if (verticalDrag) {
					verticalDrag.removeClass('jspActive');
				}
				if (horizontalDrag) {
					horizontalDrag.removeClass('jspActive');
				}
			}

			function positionDragY(destY, animate)
			{
				if (!isScrollableV) {
					return;
				}
				if (destY < 0) {
					destY = 0;
				} else if (destY > dragMaxY) {
					destY = dragMaxY;
				}

				// can't just check if(animate) because false is a valid value that could be passed in...
				if (animate === undefined) {
					animate = settings.animateScroll;
				}
				if (animate) {
					jsp.animate(verticalDrag, 'top', destY,	_positionDragY);
				} else {
					verticalDrag.css('top', destY);
					_positionDragY(destY);
				}

			}

			function _positionDragY(destY)
			{
				if (destY === undefined) {
					destY = verticalDrag.position().top;
				}

				container.scrollTop(0);
				verticalDragPosition = destY || 0;

				var isAtTop = verticalDragPosition === 0,
					isAtBottom = verticalDragPosition == dragMaxY,
					percentScrolled = destY/ dragMaxY,
					destTop = -percentScrolled * (contentHeight - paneHeight);

				if (wasAtTop != isAtTop || wasAtBottom != isAtBottom) {
					wasAtTop = isAtTop;
					wasAtBottom = isAtBottom;
					elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]);
				}

				updateVerticalArrows(isAtTop, isAtBottom);
				pane.css('top', destTop);
				// elem.trigger('jsp-scroll-y', [-destTop, isAtTop, isAtBottom]).trigger('scroll');
			}

			function positionDragX(destX, animate)
			{
				if (!isScrollableH) {
					return;
				}
				if (destX < 0) {
					destX = 0;
				} else if (destX > dragMaxX) {
					destX = dragMaxX;
				}

				if (animate === undefined) {
					animate = settings.animateScroll;
				}
				if (animate) {
					jsp.animate(horizontalDrag, 'left', destX,	_positionDragX);
				} else {
					horizontalDrag.css('left', destX);
					_positionDragX(destX);
				}
			}

			function _positionDragX(destX)
			{
				if (destX === undefined) {
					destX = horizontalDrag.position().left;
				}

				container.scrollTop(0);
				horizontalDragPosition = destX ||0;

				var isAtLeft = horizontalDragPosition === 0,
					isAtRight = horizontalDragPosition == dragMaxX,
					percentScrolled = destX / dragMaxX,
					destLeft = -percentScrolled * (contentWidth - paneWidth);

				if (wasAtLeft != isAtLeft || wasAtRight != isAtRight) {
					wasAtLeft = isAtLeft;
					wasAtRight = isAtRight;
					elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]);
				}

				updateHorizontalArrows(isAtLeft, isAtRight);
				pane.css('left', destLeft);
				elem.trigger('jsp-scroll-x', [-destLeft, isAtLeft, isAtRight]).trigger('scroll');
			}

			function updateVerticalArrows(isAtTop, isAtBottom)
			{
				if (settings.showArrows) {
					arrowUp[isAtTop ? 'addClass' : 'removeClass']('jspDisabled');
					arrowDown[isAtBottom ? 'addClass' : 'removeClass']('jspDisabled');
				}
			}

			function updateHorizontalArrows(isAtLeft, isAtRight)
			{
				if (settings.showArrows) {
					arrowLeft[isAtLeft ? 'addClass' : 'removeClass']('jspDisabled');
					arrowRight[isAtRight ? 'addClass' : 'removeClass']('jspDisabled');
				}
			}

			function scrollToY(destY, animate)
			{
				var percentScrolled = destY / (contentHeight - paneHeight);
				positionDragY(percentScrolled * dragMaxY, animate);
			}

			function scrollToX(destX, animate)
			{
				var percentScrolled = destX / (contentWidth - paneWidth);
				positionDragX(percentScrolled * dragMaxX, animate);
			}

			function scrollToElement(ele, stickToTop, animate)
			{
				var e, eleHeight, eleWidth, eleTop = 0, eleLeft = 0, viewportTop, viewportLeft, maxVisibleEleTop, maxVisibleEleLeft, destY, destX;

				// Legal hash values aren't necessarily legal jQuery selectors so we need to catch any
				// errors from the lookup...
				try {
					e = $(ele);
				} catch (err) {
					return;
				}
				eleHeight = e.outerHeight();
				eleWidth= e.outerWidth();

				container.scrollTop(0);
				container.scrollLeft(0);

				// loop through parents adding the offset top of any elements that are relatively positioned between
				// the focused element and the jspPane so we can get the true distance from the top
				// of the focused element to the top of the scrollpane...
				while (!e.is('.jspPane')) {
					eleTop += e.position().top;
					eleLeft += e.position().left;
					e = e.offsetParent();
					if (/^body|html$/i.test(e[0].nodeName)) {
						// we ended up too high in the document structure. Quit!
						return;
					}
				}

				viewportTop = contentPositionY();
				maxVisibleEleTop = viewportTop + paneHeight;
				if (eleTop < viewportTop || stickToTop) { // element is above viewport
					destY = eleTop - settings.horizontalGutter;
				} else if (eleTop + eleHeight > maxVisibleEleTop) { // element is below viewport
					destY = eleTop - paneHeight + eleHeight + settings.horizontalGutter;
				}
				if (!isNaN(destY)) {
					scrollToY(destY, animate);
				}

				viewportLeft = contentPositionX();
	            maxVisibleEleLeft = viewportLeft + paneWidth;
	            if (eleLeft < viewportLeft || stickToTop) { // element is to the left of viewport
	                destX = eleLeft - settings.horizontalGutter;
	            } else if (eleLeft + eleWidth > maxVisibleEleLeft) { // element is to the right viewport
	                destX = eleLeft - paneWidth + eleWidth + settings.horizontalGutter;
	            }
	            if (!isNaN(destX)) {
	                scrollToX(destX, animate);
	            }

			}

			function contentPositionX()
			{
				return -pane.position().left;
			}

			function contentPositionY()
			{
				return -pane.position().top;
			}

			function isCloseToBottom()
			{
				var scrollableHeight = contentHeight - paneHeight;
				return (scrollableHeight > 20) && (scrollableHeight - contentPositionY() < 10);
			}

			function isCloseToRight()
			{
				var scrollableWidth = contentWidth - paneWidth;
				return (scrollableWidth > 20) && (scrollableWidth - contentPositionX() < 10);
			}

			function initMousewheel()
			{
				container.unbind(mwEvent).bind(
					mwEvent,
					function (event, delta, deltaX, deltaY) {
						
						if(settings.mouseWheelPreventDefault)
							event.preventDefault();

                        if (!horizontalDragPosition) horizontalDragPosition = 0;
                        if (!verticalDragPosition) verticalDragPosition = 0;

						var dX = horizontalDragPosition, dY = verticalDragPosition, factor = event.deltaFactor || settings.mouseWheelSpeed;
						factor = Math.max(factor, settings.mouseWheelSpeed); // ie에서 deltaFactor 값이 3이 나와서 너무 느림.
						
						if(navigator.userAgent.toUpperCase().indexOf("MAC OS") >= 0){
							factor = 1;
						}
						
						jsp.scrollBy(deltaX * factor, -deltaY * factor, false);
						// return true if there was no movement so rest of screen can scroll
						return dX == horizontalDragPosition && dY == verticalDragPosition;
					}
				);
			}

			function removeMousewheel()
			{
				container.unbind(mwEvent);
			}

			function nil()
			{
				return false;
			}

			function initFocusHandler()
			{
				pane.find(':input,a').unbind('focus.jsp').bind(
					'focus.jsp',
					function(e)
					{
						scrollToElement(e.target, false);
					}
				);
			}

			function removeFocusHandler()
			{
				pane.find(':input,a').unbind('focus.jsp');
			}

			function initKeyboardNav()
			{
				var keyDown, elementHasScrolled, validParents = [];
				isScrollableH && validParents.push(horizontalBar[0]);
				isScrollableV && validParents.push(verticalBar[0]);

				// IE also focuses elements that don't have tabindex set.
				pane.focus(
					function()
					{
						elem.focus();
					}
				);

				elem.attr('tabindex', 0)
					.unbind('keydown.jsp keypress.jsp')
					.bind(
						'keydown.jsp',
						function(e)
						{
							if (e.target !== this && !(validParents.length && $(e.target).closest(validParents).length)){
								return;
							}
							var dX = horizontalDragPosition, dY = verticalDragPosition;
							switch(e.keyCode) {
								case 40: // down
								case 38: // up
								case 34: // page down
								case 32: // space
								case 33: // page up
								case 39: // right
								case 37: // left
									keyDown = e.keyCode;
									keyDownHandler();
									break;
								case 35: // end
									scrollToY(contentHeight - paneHeight);
									keyDown = null;
									break;
								case 36: // home
									scrollToY(0);
									keyDown = null;
									break;
							}

							elementHasScrolled = e.keyCode == keyDown && dX != horizontalDragPosition || dY != verticalDragPosition;
							return !elementHasScrolled;
						}
					).bind(
						'keypress.jsp', // For FF/ OSX so that we can cancel the repeat key presses if the JSP scrolls...
						function(e)
						{
							if (e.keyCode == keyDown) {
								keyDownHandler();
							}
							return !elementHasScrolled;
						}
					);

				if (settings.hideFocus) {
					elem.css('outline', 'none');
					if ('hideFocus' in container[0]){
						elem.attr('hideFocus', true);
					}
				} else {
					elem.css('outline', '');
					if ('hideFocus' in container[0]){
						elem.attr('hideFocus', false);
					}
				}

				function keyDownHandler()
				{
					var dX = horizontalDragPosition, dY = verticalDragPosition;
					switch(keyDown) {
						case 40: // down
							jsp.scrollByY(settings.keyboardSpeed, false);
							break;
						case 38: // up
							jsp.scrollByY(-settings.keyboardSpeed, false);
							break;
						case 34: // page down
						case 32: // space
							jsp.scrollByY(paneHeight * settings.scrollPagePercent, false);
							break;
						case 33: // page up
							jsp.scrollByY(-paneHeight * settings.scrollPagePercent, false);
							break;
						case 39: // right
							jsp.scrollByX(settings.keyboardSpeed, false);
							break;
						case 37: // left
							jsp.scrollByX(-settings.keyboardSpeed, false);
							break;
					}

					elementHasScrolled = dX != horizontalDragPosition || dY != verticalDragPosition;
					return elementHasScrolled;
				}
			}

			function removeKeyboardNav()
			{
				elem.attr('tabindex', '-1')
					.removeAttr('tabindex')
					.unbind('keydown.jsp keypress.jsp');
			}

			function observeHash()
			{
				if (location.hash && location.hash.length > 1) {
					var e,
						retryInt,
						hash = escape(location.hash.substr(1)) // hash must be escaped to prevent XSS
						;
					try {
						e = $('#' + hash + ', a[name="' + hash + '"]');
					} catch (err) {
						return;
					}

					if (e.length && pane.find(hash)) {
						// nasty workaround but it appears to take a little while before the hash has done its thing
						// to the rendered page so we just wait until the container's scrollTop has been messed up.
						if (container.scrollTop() === 0) {
							retryInt = setInterval(
								function()
								{
									if (container.scrollTop() > 0) {
										scrollToElement(e, true);
										$(document).scrollTop(container.position().top);
										clearInterval(retryInt);
									}
								},
								50
							);
						} else {
							scrollToElement(e, true);
							$(document).scrollTop(container.position().top);
						}
					}
				}
			}

			function hijackInternalLinks()
			{
				// only register the link handler once
				if ($(document.body).data('jspHijack')) {
					return;
				}

				// remember that the handler was bound
				$(document.body).data('jspHijack', true);

				// use live handler to also capture newly created links
				$(document.body).delegate('a[href*=#]', 'click', function(event) {
					// does the link point to the same page?
					// this also takes care of cases with a <base>-Tag or Links not starting with the hash #
					// e.g. <a href="index.html#test"> when the current url already is index.html
					var href = this.href.substr(0, this.href.indexOf('#')),
						locationHref = location.href,
						hash,
						element,
						container,
						jsp,
						scrollTop,
						elementTop;
					if (location.href.indexOf('#') !== -1) {
						locationHref = location.href.substr(0, location.href.indexOf('#'));
					}
					if (href !== locationHref) {
						// the link points to another page
						return;
					}

					// check if jScrollPane should handle this click event
					hash = escape(this.href.substr(this.href.indexOf('#') + 1));

					// find the element on the page
					element;
					try {
						element = $('#' + hash + ', a[name="' + hash + '"]');
					} catch (e) {
						// hash is not a valid jQuery identifier
						return;
					}

					if (!element.length) {
						// this link does not point to an element on this page
						return;
					}

					container = element.closest('.jspScrollable');
					jsp = container.data('jsp');

					// jsp might be another jsp instance than the one, that bound this event
					// remember: this event is only bound once for all instances.
					jsp.scrollToElement(element, true);

					if (container[0].scrollIntoView) {
						// also scroll to the top of the container (if it is not visible)
						scrollTop = $(window).scrollTop();
						elementTop = element.offset().top;
						if (elementTop < scrollTop || elementTop > scrollTop + $(window).height()) {
							container[0].scrollIntoView();
						}
					}

					// jsp handled this event, prevent the browser default (scrolling :P)
					event.preventDefault();
				});
			}

			// Init touch on iPad, iPhone, iPod, Android
			function initTouch()
			{
				var startX,
					startY,
					touchStartX,
					touchStartY,
					moved,
					moving = false;

				container.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind(
					'touchstart.jsp',
					function(e)
					{
						var touch = e.originalEvent.touches[0];
						startX = contentPositionX();
						startY = contentPositionY();
						touchStartX = touch.pageX;
						touchStartY = touch.pageY;
						moved = false;
						moving = true;
					}
				).bind(
					'touchmove.jsp',
					function(ev)
					{
						if(!moving) {
							return;
						}

						var touchPos = ev.originalEvent.touches[0],
							dX = horizontalDragPosition, dY = verticalDragPosition;

						jsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY);

						moved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5;

						// return true if there was no movement so rest of screen can scroll
						return dX == horizontalDragPosition && dY == verticalDragPosition;
					}
				).bind(
					'touchend.jsp',
					function(e)
					{
						moving = false;
						
					}
				).bind(
					'click.jsp-touchclick',
					function(e)
					{
						if(moved) {
							moved = false;
							return false;
						}
					}
				);
			}

			function destroy(){
				var currentY = contentPositionY(),
					currentX = contentPositionX();
				elem.removeClass('jspScrollable').unbind('.jsp');
				elem.replaceWith(originalElement.append(pane.children()));
				originalElement.scrollTop(currentY);
				originalElement.scrollLeft(currentX);

				// clear reinitialize timer if active
				if (reinitialiseInterval) {
					clearInterval(reinitialiseInterval);
				}
			}

			// Public API
			$.extend(
				jsp,
				{
					// Reinitialises the scroll pane (if it's internal dimensions have changed since the last time it
					// was initialised). The settings object which is passed in will override any settings from the
					// previous time it was initialised - if you don't pass any settings then the ones from the previous
					// initialisation will be used.
					reinitialise: function(s)
					{
						s = $.extend({}, settings, s);
						initialise(s);
					},
					// Scrolls the specified element (a jQuery object, DOM node or jQuery selector string) into view so
					// that it can be seen within the viewport. If stickToTop is true then the element will appear at
					// the top of the viewport, if it is false then the viewport will scroll as little as possible to
					// show the element. You can also specify if you want animation to occur. If you don't provide this
					// argument then the animateScroll value from the settings object is used instead.
					scrollToElement: function(ele, stickToTop, animate)
					{
						scrollToElement(ele, stickToTop, animate);
					},
					// Scrolls the pane so that the specified co-ordinates within the content are at the top left
					// of the viewport. animate is optional and if not passed then the value of animateScroll from
					// the settings object this jScrollPane was initialised with is used.
					scrollTo: function(destX, destY, animate)
					{
						scrollToX(destX, animate);
						scrollToY(destY, animate);
					},
					// Scrolls the pane so that the specified co-ordinate within the content is at the left of the
					// viewport. animate is optional and if not passed then the value of animateScroll from the settings
					// object this jScrollPane was initialised with is used.
					scrollToX: function(destX, animate)
					{
						scrollToX(destX, animate);
					},
					// Scrolls the pane so that the specified co-ordinate within the content is at the top of the
					// viewport. animate is optional and if not passed then the value of animateScroll from the settings
					// object this jScrollPane was initialised with is used.
					scrollToY: function(destY, animate)
					{
						scrollToY(destY, animate);
					},
					// Scrolls the pane to the specified percentage of its maximum horizontal scroll position. animate
					// is optional and if not passed then the value of animateScroll from the settings object this
					// jScrollPane was initialised with is used.
					scrollToPercentX: function(destPercentX, animate)
					{
						scrollToX(destPercentX * (contentWidth - paneWidth), animate);
					},
					// Scrolls the pane to the specified percentage of its maximum vertical scroll position. animate
					// is optional and if not passed then the value of animateScroll from the settings object this
					// jScrollPane was initialised with is used.
					scrollToPercentY: function(destPercentY, animate)
					{
						scrollToY(destPercentY * (contentHeight - paneHeight), animate);
					},
					// Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then
					// the value of animateScroll from the settings object this jScrollPane was initialised with is used.
					scrollBy: function(deltaX, deltaY, animate)
					{
						jsp.scrollByX(deltaX, animate);
						jsp.scrollByY(deltaY, animate);
					},
					// Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then
					// the value of animateScroll from the settings object this jScrollPane was initialised with is used.
					scrollByX: function(deltaX, animate)
					{
						var destX = contentPositionX() + Math[deltaX<0 ? 'floor' : 'ceil'](deltaX),
							percentScrolled = destX / (contentWidth - paneWidth);
						positionDragX(percentScrolled * dragMaxX, animate);
					},
					// Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then
					// the value of animateScroll from the settings object this jScrollPane was initialised with is used.
					scrollByY: function(deltaY, animate)
					{
						var destY = contentPositionY() + Math[deltaY<0 ? 'floor' : 'ceil'](deltaY),
							percentScrolled = destY / (contentHeight - paneHeight);
						positionDragY(percentScrolled * dragMaxY, animate);
					},
					// Positions the horizontal drag at the specified x position (and updates the viewport to reflect
					// this). animate is optional and if not passed then the value of animateScroll from the settings
					// object this jScrollPane was initialised with is used.
					positionDragX: function(x, animate)
					{
						positionDragX(x, animate);
					},
					// Positions the vertical drag at the specified y position (and updates the viewport to reflect
					// this). animate is optional and if not passed then the value of animateScroll from the settings
					// object this jScrollPane was initialised with is used.
					positionDragY: function(y, animate)
					{
						positionDragY(y, animate);
					},
					// This method is called when jScrollPane is trying to animate to a new position. You can override
					// it if you want to provide advanced animation functionality. It is passed the following arguments:
					//  * ele          - the element whose position is being animated
					//  * prop         - the property that is being animated
					//  * value        - the value it's being animated to
					//  * stepCallback - a function that you must execute each time you update the value of the property
					// You can use the default implementation (below) as a starting point for your own implementation.
					animate: function(ele, prop, value, stepCallback)
					{
						var params = {};
						params[prop] = value;
						ele.animate(
							params,
							{
								'duration'	: settings.animateDuration,
								'easing'	: settings.animateEase,
								'queue'		: false,
								'step'		: stepCallback
							}
						);
					},
					// Returns the current x position of the viewport with regards to the content pane.
					getContentPositionX: function()
					{
						return contentPositionX();
					},
					// Returns the current y position of the viewport with regards to the content pane.
					getContentPositionY: function()
					{
						return contentPositionY();
					},
					// Returns the width of the content within the scroll pane.
					getContentWidth: function()
					{
						return contentWidth;
					},
					// Returns the height of the content within the scroll pane.
					getContentHeight: function()
					{
						return contentHeight;
					},
					// Returns the horizontal position of the viewport within the pane content.
					getPercentScrolledX: function()
					{
						return contentPositionX() / (contentWidth - paneWidth);
					},
					// Returns the vertical position of the viewport within the pane content.
					getPercentScrolledY: function()
					{
						return contentPositionY() / (contentHeight - paneHeight);
					},
					// Returns whether or not this scrollpane has a horizontal scrollbar.
					getIsScrollableH: function()
					{
						return isScrollableH;
					},
					// Returns whether or not this scrollpane has a vertical scrollbar.
					getIsScrollableV: function()
					{
						return isScrollableV;
					},
					// Gets a reference to the content pane. It is important that you use this method if you want to
					// edit the content of your jScrollPane as if you access the element directly then you may have some
					// problems (as your original element has had additional elements for the scrollbars etc added into
					// it).
					getContentPane: function()
					{
						return pane;
					},
					// Scrolls this jScrollPane down as far as it can currently scroll. If animate isn't passed then the
					// animateScroll value from settings is used instead.
					scrollToBottom: function(animate)
					{
						positionDragY(dragMaxY, animate);
					},
					// Hijacks the links on the page which link to content inside the scrollpane. If you have changed
					// the content of your page (e.g. via AJAX) and want to make sure any new anchor links to the
					// contents of your scroll pane will work then call this function.
					hijackInternalLinks: $.noop,
					// Removes the jScrollPane and returns the page to the state it was in before jScrollPane was
					// initialised.
					destroy: function()
					{
							destroy();
					}
				}
			);

			initialise(s);
		}

		// Pluginifying code...
		settings = $.extend({}, $.fn.jScrollPane.defaults, settings);

		// Apply default speed
		$.each(['arrowButtonSpeed', 'trackClickSpeed', 'keyboardSpeed'], function() {
			settings[this] = settings[this] || settings.speed;
		});

		return this.each(
			function()
			{
				var elem = $(this), jspApi = elem.data('jsp');
				if (jspApi) {
					jspApi.reinitialise(settings);
				} else {
					$("script",elem).filter('[type="text/javascript"],:not([type])').remove();
					jspApi = new JScrollPane(elem, settings);
					elem.data('jsp', jspApi);
				}
			}
		);
	};

	$.fn.jScrollPane.defaults = {
		showArrows					: false,
		maintainPosition			: true,
		stickToBottom				: false,
		stickToRight				: false,
		clickOnTrack				: true,
		autoReinitialise			: false,
		autoReinitialiseDelay		: 500,
		verticalDragMinHeight		: 0,
		verticalDragMaxHeight		: 99999,
		horizontalDragMinWidth		: 0,
		horizontalDragMaxWidth		: 99999,
		contentWidth				: undefined,
		animateScroll				: false,
		animateDuration				: 300,
		animateEase					: 'linear',
		hijackInternalLinks			: false,
		verticalGutter				: 4,
		horizontalGutter			: 4,
		mouseWheelSpeed				: 100,
		arrowButtonSpeed			: 0,
		arrowRepeatFreq				: 50,
		arrowScrollOnHover			: false,
		trackClickSpeed				: 0,
		trackClickRepeatFreq		: 70,
		verticalArrowPositions		: 'split',
		horizontalArrowPositions	: 'split',
		enableKeyboardNavigation	: true,
		hideFocus					: false,
		keyboardSpeed				: 0,
		initialDelay                : 300,        // Delay before starting repeating
		speed						: 30,		// Default speed when others falsey
		scrollPagePercent			: .8,		// Percent of visible area scrolled when pageUp/Down or track area pressed
		mouseWheelPreventDefault	: false,   //마우스휠 이벤트 버블링 차단용. 막으려면 true
		isVerticalScrollBarHide		: false		//스크롤바 생성 시 버티칼 스크롤바 영역을 display:none; 하기 위해서 추가 숨기려면 true
	};

}));

/*-----/js/jquery/jquery.jscrollpane.js / end -----*/

/*-----/js/jquery/jquery-ui-1.11.4.js / start -----*/
	
	
	(function( factory ) {
		if ( typeof define === "function" && define.amd ) {
	
			// AMD. Register as an anonymous module.
			define([ "jquery" ], factory );
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}(function( $ ) {
	
	
	
	// $.ui might exist from components with no dependencies, e.g., $.ui.position
	$.ui = $.ui || {};
	
	$.extend( $.ui, {
		version: "1.11.4",
	
		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
		}
	});
	
	// plugins
	$.fn.extend({
		scrollParent: function( includeHidden ) {
			var position = this.css( "position" ),
				excludeStaticParent = position === "absolute",
				overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
				scrollParent = this.parents().filter( function() {
					var parent = $( this );
					if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
						return false;
					}
					return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
				}).eq( 0 );
	
			return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
		},
	
		uniqueId: (function() {
			var uuid = 0;
	
			return function() {
				return this.each(function() {
					if ( !this.id ) {
						this.id = "ui-id-" + ( ++uuid );
					}
				});
			};
		})(),
	
		removeUniqueId: function() {
			return this.each(function() {
				if ( /^ui-id-\d+$/.test( this.id ) ) {
					$( this ).removeAttr( "id" );
				}
			});
		}
	});
	
	// selectors
	function focusable( element, isTabIndexNotNaN ) {
		var map, mapName, img,
			nodeName = element.nodeName.toLowerCase();
		if ( "area" === nodeName ) {
			map = element.parentNode;
			mapName = map.name;
			if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
				return false;
			}
			img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
			return !!img && visible( img );
		}
		return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
			!element.disabled :
			"a" === nodeName ?
				element.href || isTabIndexNotNaN :
				isTabIndexNotNaN) &&
			// the element and all of its ancestors must be visible
			visible( element );
	}
	
	function visible( element ) {
		return $.expr.filters.visible( element ) &&
			!$( element ).parents().addBack().filter(function() {
				return $.css( this, "visibility" ) === "hidden";
			}).length;
	}
	
	$.extend( $.expr[ ":" ], {
		data: $.expr.createPseudo ?
			$.expr.createPseudo(function( dataName ) {
				return function( elem ) {
					return !!$.data( elem, dataName );
				};
			}) :
			// support: jQuery <1.8
			function( elem, i, match ) {
				return !!$.data( elem, match[ 3 ] );
			},
	
		focusable: function( element ) {
			return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
		},
	
		tabbable: function( element ) {
			var tabIndex = $.attr( element, "tabindex" ),
				isTabIndexNaN = isNaN( tabIndex );
			return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
		}
	});
	
	// support: jQuery <1.8
	if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
		$.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;
					}
					if ( margin ) {
						size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
					}
				});
				return size;
			}
	
			$.fn[ "inner" + name ] = function( size ) {
				if ( size === undefined ) {
					return orig[ "inner" + name ].call( this );
				}
	
				return 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 );
				}
	
				return this.each(function() {
					$( this).css( type, reduce( this, size, true, margin ) + "px" );
				});
			};
		});
	}
	
	// support: jQuery <1.8
	if ( !$.fn.addBack ) {
		$.fn.addBack = function( selector ) {
			return this.add( selector == null ?
				this.prevObject : this.prevObject.filter( selector )
			);
		};
	}
	
	// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
	if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
		$.fn.removeData = (function( removeData ) {
			return function( key ) {
				if ( arguments.length ) {
					return removeData.call( this, $.camelCase( key ) );
				} else {
					return removeData.call( this );
				}
			};
		})( $.fn.removeData );
	}
	
	// deprecated
	$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
	
	$.fn.extend({
		focus: (function( orig ) {
			return function( delay, fn ) {
				return typeof delay === "number" ?
					this.each(function() {
						var elem = this;
						setTimeout(function() {
							$( elem ).focus();
							if ( fn ) {
								fn.call( elem );
							}
						}, delay );
					}) :
					orig.apply( this, arguments );
			};
		})( $.fn.focus ),
	
		disableSelection: (function() {
			var eventType = "onselectstart" in document.createElement( "div" ) ?
				"selectstart" :
				"mousedown";
	
			return function() {
				return this.bind( eventType + ".ui-disableSelection", function( event ) {
					event.preventDefault();
				});
			};
		})(),
	
		enableSelection: function() {
			return this.unbind( ".ui-disableSelection" );
		},
	
		zIndex: function( zIndex ) {
			if ( zIndex !== undefined ) {
				return this.css( "zIndex", zIndex );
			}
	
			if ( this.length ) {
				var elem = $( this[ 0 ] ), position, value;
				while ( elem.length && elem[ 0 ] !== document ) {
					// Ignore z-index if position is set to a value where z-index is ignored by the browser
					// This makes behavior of this function consistent across browsers
					// WebKit always returns auto if the element is positioned
					position = elem.css( "position" );
					if ( position === "absolute" || position === "relative" || position === "fixed" ) {
						// IE returns 0 when zIndex is not specified
						// other browsers return a string
						// we ignore the case of nested elements with an explicit value of 0
						// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
						value = parseInt( elem.css( "zIndex" ), 10 );
						if ( !isNaN( value ) && value !== 0 ) {
							return value;
						}
					}
					elem = elem.parent();
				}
			}
	
			return 0;
		}
	});
	
	// $.ui.plugin is deprecated. Use $.widget() extensions instead.
	$.ui.plugin = {
		add: function( module, option, set ) {
			var i,
				proto = $.ui[ module ].prototype;
			for ( i in set ) {
				proto.plugins[ i ] = proto.plugins[ i ] || [];
				proto.plugins[ i ].push( [ option, set[ i ] ] );
			}
		},
		call: function( instance, name, args, allowDisconnected ) {
			var i,
				set = instance.plugins[ name ];
	
			if ( !set ) {
				return;
			}
	
			if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
				return;
			}
	
			for ( i = 0; i < set.length; i++ ) {
				if ( instance.options[ set[ i ][ 0 ] ] ) {
					set[ i ][ 1 ].apply( instance.element, args );
				}
			}
		}
	};
	
	
	
	
	
	var widget_uuid = 0,
		widget_slice = Array.prototype.slice;
	
	$.cleanData = (function( orig ) {
		return function( elems ) {
			var events, elem, i;
			for ( i = 0; (elem = elems[i]) != null; i++ ) {
				try {
	
					// Only trigger remove when necessary to save time
					events = $._data( elem, "events" );
					if ( events && events.remove ) {
						$( elem ).triggerHandler( "remove" );
					}
	
				// http://bugs.jquery.com/ticket/8235
				} catch ( e ) {}
			}
			orig( elems );
		};
	})( $.cleanData );
	
	$.widget = function( name, base, prototype ) {
		var fullName, existingConstructor, constructor, basePrototype,
			// proxiedPrototype allows the provided prototype to remain unmodified
			// so that it can be used as a mixin for multiple widgets (#8876)
			proxiedPrototype = {},
			namespace = name.split( "." )[ 0 ];
	
		name = name.split( "." )[ 1 ];
		fullName = namespace + "-" + name;
	
		if ( !prototype ) {
			prototype = base;
			base = $.Widget;
		}
	
		// create selector for plugin
		$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
			return !!$.data( elem, fullName );
		};
	
		$[ namespace ] = $[ namespace ] || {};
		existingConstructor = $[ namespace ][ name ];
		constructor = $[ namespace ][ name ] = function( options, element ) {
			// allow instantiation without "new" keyword
			if ( !this._createWidget ) {
				return new constructor( options, element );
			}
	
			// allow instantiation without initializing for simple inheritance
			// must use "new" keyword (the code above always passes args)
			if ( arguments.length ) {
				this._createWidget( options, element );
			}
		};
		// extend with the existing constructor to carry over any static properties
		$.extend( constructor, existingConstructor, {
			version: prototype.version,
			// copy the object used to create the prototype in case we need to
			// redefine the widget later
			_proto: $.extend( {}, prototype ),
			// track widgets that inherit from this widget in case this widget is
			// redefined after a widget inherits from it
			_childConstructors: []
		});
	
		basePrototype = new base();
		// we need to make the options hash a property directly on the new instance
		// otherwise we'll modify the options hash on the prototype that we're
		// inheriting from
		basePrototype.options = $.widget.extend( {}, basePrototype.options );
		$.each( prototype, function( prop, value ) {
			if ( !$.isFunction( value ) ) {
				proxiedPrototype[ prop ] = value;
				return;
			}
			proxiedPrototype[ prop ] = (function() {
				var _super = function() {
						return base.prototype[ prop ].apply( this, arguments );
					},
					_superApply = function( args ) {
						return base.prototype[ prop ].apply( this, args );
					};
				return function() {
					var __super = this._super,
						__superApply = this._superApply,
						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, {
			// TODO: remove support for widgetEventPrefix
			// always use the name + a colon as the prefix, e.g., draggable:start
			// don't prefix for widgets that aren't DOM-based
			widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
		}, proxiedPrototype, {
			constructor: constructor,
			namespace: namespace,
			widgetName: name,
			widgetFullName: fullName
		});
	
		// If this widget is being redefined then we need to find all widgets that
		// are inheriting from it and redefine all of them so that they inherit from
		// the new version of this widget. We're essentially trying to replace one
		// level in the prototype chain.
		if ( existingConstructor ) {
			$.each( existingConstructor._childConstructors, function( i, child ) {
				var childPrototype = child.prototype;
	
				// redefine the child widget using the same prototype that was
				// originally used, but inherit from the new version of the base
				$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
			});
			// remove the list of existing child constructors from the old constructor
			// so the old child constructors can be garbage collected
			delete existingConstructor._childConstructors;
		} else {
			base._childConstructors.push( constructor );
		}
	
		$.widget.bridge( name, constructor );
	
		return constructor;
	};
	
	$.widget.extend = function( target ) {
		var input = widget_slice.call( arguments, 1 ),
			inputIndex = 0,
			inputLength = input.length,
			key,
			value;
		for ( ; inputIndex < inputLength; inputIndex++ ) {
			for ( key in input[ inputIndex ] ) {
				value = input[ inputIndex ][ key ];
				if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
					// Clone objects
					if ( $.isPlainObject( value ) ) {
						target[ key ] = $.isPlainObject( target[ key ] ) ?
							$.widget.extend( {}, target[ key ], value ) :
							// Don't extend strings, arrays, etc. with objects
							$.widget.extend( {}, value );
					// Copy everything else by reference
					} else {
						target[ key ] = value;
					}
				}
			}
		}
		return target;
	};
	
	$.widget.bridge = function( name, object ) {
		var fullName = object.prototype.widgetFullName || name;
		$.fn[ name ] = function( options ) {
			var isMethodCall = typeof options === "string",
				args = widget_slice.call( arguments, 1 ),
				returnValue = this;
	
			if ( isMethodCall ) {
				this.each(function() {
					var methodValue,
						instance = $.data( this, fullName );
					if ( options === "instance" ) {
						returnValue = instance;
						return false;
					}
					if ( !instance ) {
						return $.error( "cannot call methods on " + name + " prior to initialization; " +
							"attempted to call method '" + options + "'" );
					}
					if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
						return $.error( "no such method '" + options + "' for " + name + " widget instance" );
					}
					methodValue = instance[ options ].apply( instance, args );
					if ( methodValue !== instance && methodValue !== undefined ) {
						returnValue = methodValue && methodValue.jquery ?
							returnValue.pushStack( methodValue.get() ) :
							methodValue;
						return false;
					}
				});
			} else {
	
				// Allow multiple hashes to be passed on init
				if ( args.length ) {
					options = $.widget.extend.apply( null, [ options ].concat(args) );
				}
	
				this.each(function() {
					var instance = $.data( this, fullName );
					if ( instance ) {
						instance.option( options || {} );
						if ( instance._init ) {
							instance._init();
						}
					} else {
						$.data( this, fullName, new object( options, this ) );
					}
				});
			}
	
			return returnValue;
		};
	};
	
	$.Widget = function(  ) {};
	$.Widget._childConstructors = [];
	
	$.Widget.prototype = {
		widgetName: "widget",
		widgetEventPrefix: "",
		defaultElement: "<div>",
		options: {
			disabled: false,
	
			// callbacks
			create: null
		},
		_createWidget: function( options, element ) {
			element = $( element || this.defaultElement || this )[ 0 ];
			this.element = $( element );
			this.uuid = widget_uuid++;
			this.eventNamespace = "." + this.widgetName + this.uuid;
	
			this.bindings = $();
			this.hoverable = $();
			this.focusable = $();
	
			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 within the document
					element.ownerDocument :
					// element is window or document
					element.document || element );
				this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
			}
	
			this.options = $.widget.extend( {},
				this.options,
				this._getCreateOptions(),
				options );
	
			this._create();
			this._trigger( "create", null, this._getCreateEventData() );
			this._init();
		},
		_getCreateOptions: $.noop,
		_getCreateEventData: $.noop,
		_create: $.noop,
		_init: $.noop,
	
		destroy: function() {
			this._destroy();
			// we can probably remove the unbind calls in 2.0
			// all event bindings should go through this._on()
			this.element
				.unbind( this.eventNamespace )
				.removeData( this.widgetFullName )
				// support: jquery <1.6.3
				// http://bugs.jquery.com/ticket/9413
				.removeData( $.camelCase( this.widgetFullName ) );
			this.widget()
				.unbind( this.eventNamespace )
				.removeAttr( "aria-disabled" )
				.removeClass(
					this.widgetFullName + "-disabled " +
					"ui-state-disabled" );
	
			// clean up events and states
			this.bindings.unbind( this.eventNamespace );
			this.hoverable.removeClass( "ui-state-hover" );
			this.focusable.removeClass( "ui-state-focus" );
		},
		_destroy: $.noop,
	
		widget: function() {
			return this.element;
		},
	
		option: function( key, value ) {
			var options = key,
				parts,
				curOption,
				i;
	
			if ( arguments.length === 0 ) {
				// don't return a reference to the internal hash
				return $.widget.extend( {}, this.options );
			}
	
			if ( typeof key === "string" ) {
				// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
				options = {};
				parts = key.split( "." );
				key = parts.shift();
				if ( parts.length ) {
					curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
					for ( i = 0; i < parts.length - 1; i++ ) {
						curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
						curOption = curOption[ parts[ i ] ];
					}
					key = parts.pop();
					if ( arguments.length === 1 ) {
						return curOption[ key ] === undefined ? null : curOption[ key ];
					}
					curOption[ key ] = value;
				} else {
					if ( arguments.length === 1 ) {
						return this.options[ key ] === undefined ? null : this.options[ key ];
					}
					options[ key ] = value;
				}
			}
	
			this._setOptions( options );
	
			return this;
		},
		_setOptions: function( options ) {
			var key;
	
			for ( key in options ) {
				this._setOption( key, options[ key ] );
			}
	
			return this;
		},
		_setOption: function( key, value ) {
			this.options[ key ] = value;
	
			if ( key === "disabled" ) {
				this.widget()
					.toggleClass( this.widgetFullName + "-disabled", !!value );
	
				// If the widget is becoming disabled, then nothing is interactive
				if ( value ) {
					this.hoverable.removeClass( "ui-state-hover" );
					this.focusable.removeClass( "ui-state-focus" );
				}
			}
	
			return this;
		},
	
		enable: function() {
			return this._setOptions({ disabled: false });
		},
		disable: function() {
			return this._setOptions({ disabled: true });
		},
	
		_on: function( suppressDisabledCheck, element, handlers ) {
			var delegateElement,
				instance = this;
	
			// no suppressDisabledCheck flag, shuffle arguments
			if ( typeof suppressDisabledCheck !== "boolean" ) {
				handlers = element;
				element = suppressDisabledCheck;
				suppressDisabledCheck = false;
			}
	
			// no element argument, shuffle and use this.element
			if ( !handlers ) {
				handlers = element;
				element = this.element;
				delegateElement = this.widget();
			} else {
				element = delegateElement = $( element );
				this.bindings = this.bindings.add( element );
			}
	
			$.each( handlers, function( event, handler ) {
				function handlerProxy() {
					// allow widgets to customize the disabled handling
					// - disabled as an array instead of boolean
					// - disabled class as method for disabling individual parts
					if ( !suppressDisabledCheck &&
							( instance.options.disabled === true ||
								$( this ).hasClass( "ui-state-disabled" ) ) ) {
						return;
					}
					return ( typeof handler === "string" ? instance[ handler ] : handler )
						.apply( instance, arguments );
				}
	
				// copy the guid so direct unbinding works
				if ( typeof handler !== "string" ) {
					handlerProxy.guid = handler.guid =
						handler.guid || handlerProxy.guid || $.guid++;
				}
	
				var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
					eventName = match[1] + instance.eventNamespace,
					selector = match[2];
				if ( selector ) {
					delegateElement.delegate( selector, eventName, handlerProxy );
				} else {
					element.bind( eventName, handlerProxy );
				}
			});
		},
	
		_off: function( element, eventName ) {
			eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
				this.eventNamespace;
			element.unbind( eventName ).undelegate( eventName );
	
			// Clear the stack to avoid memory leaks (#10056)
			this.bindings = $( this.bindings.not( element ).get() );
			this.focusable = $( this.focusable.not( element ).get() );
			this.hoverable = $( this.hoverable.not( element ).get() );
		},
	
		_delay: function( handler, delay ) {
			function handlerProxy() {
				return ( typeof handler === "string" ? instance[ handler ] : handler )
					.apply( instance, arguments );
			}
			var instance = this;
			return setTimeout( handlerProxy, delay || 0 );
		},
	
		_hoverable: function( element ) {
			this.hoverable = this.hoverable.add( element );
			this._on( element, {
				mouseenter: function( event ) {
					$( event.currentTarget ).addClass( "ui-state-hover" );
				},
				mouseleave: function( event ) {
					$( event.currentTarget ).removeClass( "ui-state-hover" );
				}
			});
		},
	
		_focusable: function( element ) {
			this.focusable = this.focusable.add( element );
			this._on( element, {
				focusin: function( event ) {
					$( event.currentTarget ).addClass( "ui-state-focus" );
				},
				focusout: function( event ) {
					$( event.currentTarget ).removeClass( "ui-state-focus" );
				}
			});
		},
	
		_trigger: function( type, event, data ) {
			var prop, orig,
				callback = this.options[ type ];
	
			data = data || {};
			event = $.Event( event );
			event.type = ( type === this.widgetEventPrefix ?
				type :
				this.widgetEventPrefix + type ).toLowerCase();
			// the original event may come from any element
			// so we need to reset the target on the new event
			event.target = this.element[ 0 ];
	
			// copy original event properties over to the new event
			orig = event.originalEvent;
			if ( orig ) {
				for ( prop in orig ) {
					if ( !( prop in event ) ) {
						event[ prop ] = orig[ prop ];
					}
				}
			}
	
			this.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 };
			}
			var hasOptions,
				effectName = !options ?
					method :
					options === true || typeof options === "number" ?
						defaultEffect :
						options.effect || defaultEffect;
			options = options || {};
			if ( typeof options === "number" ) {
				options = { duration: options };
			}
			hasOptions = !$.isEmptyObject( options );
			options.complete = callback;
			if ( options.delay ) {
				element.delay( options.delay );
			}
			if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
				element[ method ]( options );
			} else if ( effectName !== method && element[ effectName ] ) {
				element[ effectName ]( options.duration, options.easing, callback );
			} else {
				element.queue(function( next ) {
					$( this )[ method ]();
					if ( callback ) {
						callback.call( element[ 0 ] );
					}
					next();
				});
			}
		};
	});
	
	var widget = $.widget;
	
	
	
	
	
	var mouseHandled = false;
	$( document ).mouseup( function() {
		mouseHandled = false;
	});
	
	var mouse = $.widget("ui.mouse", {
		version: "1.11.4",
		options: {
			cancel: "input,textarea,button,select,option",
			distance: 1,
			delay: 0
		},
		_mouseInit: function() {
			var that = this;
	
			this.element
				.bind("mousedown." + this.widgetName, function(event) {
					return that._mouseDown(event);
				})
				.bind("click." + this.widgetName, function(event) {
					if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
						$.removeData(event.target, that.widgetName + ".preventClickEvent");
						event.stopImmediatePropagation();
						return false;
					}
				});
	
			this.started = false;
		},
	
		// TODO: make sure destroying one instance of mouse doesn't mess with
		// other instances of mouse
		_mouseDestroy: function() {
			this.element.unbind("." + this.widgetName);
			if ( this._mouseMoveDelegate ) {
				this.document
					.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
					.unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
			}
		},
	
		_mouseDown: function(event) {
			// don't let more than one widget handle mouseStart
			if ( mouseHandled ) {
				return;
			}
	
			this._mouseMoved = false;
	
			// we may have missed mouseup (out of window)
			(this._mouseStarted && this._mouseUp(event));
	
			this._mouseDownEvent = event;
	
			var that = this,
				btnIsLeft = (event.which === 1),
				// event.target.nodeName works around a bug in IE 8 with
				// disabled inputs (#7620)
				elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
			if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
				return true;
			}
	
			this.mouseDelayMet = !this.options.delay;
			if (!this.mouseDelayMet) {
				this._mouseDelayTimer = setTimeout(function() {
					that.mouseDelayMet = true;
				}, this.options.delay);
			}
	
			if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
				this._mouseStarted = (this._mouseStart(event) !== false);
				if (!this._mouseStarted) {
					event.preventDefault();
					return true;
				}
			}
	
			// Click event may never have fired (Gecko & Opera)
			if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
				$.removeData(event.target, this.widgetName + ".preventClickEvent");
			}
	
			// these delegates are required to keep context
			this._mouseMoveDelegate = function(event) {
				return that._mouseMove(event);
			};
			this._mouseUpDelegate = function(event) {
				return that._mouseUp(event);
			};
	
			this.document
				.bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
				.bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
	
			event.preventDefault();
	
			mouseHandled = true;
			return true;
		},
	
		_mouseMove: function(event) {
			// Only check for mouseups outside the document if you've moved inside the document
			// at least once. This prevents the firing of mouseup in the case of IE<9, which will
			// fire a mousemove event if content is placed under the cursor. See #7778
			// Support: IE <9
			if ( this._mouseMoved ) {
				// IE mouseup check - mouseup happened when mouse was out of window
				if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
					return this._mouseUp(event);
	
				// Iframe mouseup check - mouseup occurred in another document
				} else if ( !event.which ) {
					return this._mouseUp( event );
				}
			}
	
			if ( event.which || event.button ) {
				this._mouseMoved = true;
			}
	
			if (this._mouseStarted) {
				this._mouseDrag(event);
				return event.preventDefault();
			}
	
			if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
				this._mouseStarted =
					(this._mouseStart(this._mouseDownEvent, event) !== false);
				(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
			}
	
			return !this._mouseStarted;
		},
	
		_mouseUp: function(event) {
			this.document
				.unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
				.unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
	
			if (this._mouseStarted) {
				this._mouseStarted = false;
	
				if (event.target === this._mouseDownEvent.target) {
					$.data(event.target, this.widgetName + ".preventClickEvent", true);
				}
	
				this._mouseStop(event);
			}
	
			mouseHandled = false;
			return false;
		},
	
		_mouseDistanceMet: function(event) {
			return (Math.max(
					Math.abs(this._mouseDownEvent.pageX - event.pageX),
					Math.abs(this._mouseDownEvent.pageY - event.pageY)
				) >= this.options.distance
			);
		},
	
		_mouseDelayMet: function() {
			return this.mouseDelayMet;
		},
	
		// These are placeholder methods, to be overriden by extending plugin
		_mouseStart: function() {},
		_mouseDrag: function() {},
		_mouseStop: function() {},
		_mouseCapture: function() { return true; }
	});
	
	
	
	
	(function() {
	
	$.ui = $.ui || {};
	
	var cachedScrollbarWidth, supportsOffsetFractions,
		max = Math.max,
		abs = Math.abs,
		round = Math.round,
		rhorizontal = /left|center|right/,
		rvertical = /top|center|bottom/,
		roffset = /[\+\-]\d+(\.[\d]+)?%?/,
		rposition = /^\w+/,
		rpercent = /%$/,
		_position = $.fn.position;
	
	function getOffsets( offsets, width, height ) {
		return [
			parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
			parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
		];
	}
	
	function parseCss( element, property ) {
		return parseInt( $.css( element, property ), 10 ) || 0;
	}
	
	function getDimensions( elem ) {
		var raw = elem[0];
		if ( raw.nodeType === 9 ) {
			return {
				width: elem.width(),
				height: elem.height(),
				offset: { top: 0, left: 0 }
			};
		}
		if ( $.isWindow( raw ) ) {
			return {
				width: elem.width(),
				height: elem.height(),
				offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
			};
		}
		if ( raw.preventDefault ) {
			return {
				width: 0,
				height: 0,
				offset: { top: raw.pageY, left: raw.pageX }
			};
		}
		return {
			width: elem.outerWidth(),
			height: elem.outerHeight(),
			offset: elem.offset()
		};
	}
	
	$.position = {
		scrollbarWidth: function() {
			if ( cachedScrollbarWidth !== undefined ) {
				return cachedScrollbarWidth;
			}
			var w1, w2,
				div = $( "<div style='display:block;position:absolute;width: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;
			}
	
			div.remove();
	
			return (cachedScrollbarWidth = w1 - w2);
		},
		getScrollInfo: function( within ) {
			var overflowX = within.isWindow || within.isDocument ? "" :
					within.element.css( "overflow-x" ),
				overflowY = within.isWindow || within.isDocument ? "" :
					within.element.css( "overflow-y" ),
				hasOverflowX = overflowX === "scroll" ||
					( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
				hasOverflowY = overflowY === "scroll" ||
					( overflowY === "auto" && within.height < within.element[0].scrollHeight );
			return {
				width: hasOverflowY ? $.position.scrollbarWidth() : 0,
				height: hasOverflowX ? $.position.scrollbarWidth() : 0
			};
		},
		getWithinInfo: function( element ) {
			var withinElement = $( element || window ),
				isWindow = $.isWindow( withinElement[0] ),
				isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
			return {
				element: withinElement,
				isWindow: isWindow,
				isDocument: isDocument,
				offset: withinElement.offset() || { left: 0, top: 0 },
				scrollLeft: withinElement.scrollLeft(),
				scrollTop: withinElement.scrollTop(),
	
				// support: jQuery 1.6.x
				// jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
				width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
				height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
			};
		}
	};
	
	$.fn.position = function( options ) {
		if ( !options || !options.of ) {
			return _position.apply( this, arguments );
		}
	
		// make a copy, we don't want to modify arguments
		options = $.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 ) {
			// force left top to allow flipping
			options.at = "left top";
		}
		targetWidth = dimensions.width;
		targetHeight = dimensions.height;
		targetOffset = dimensions.offset;
		// clone to reuse original targetOffset later
		basePosition = $.extend( {}, targetOffset );
	
		// force my and at to have valid horizontal and vertical positions
		// if a value is missing or invalid, it will be converted to center
		$.each( [ "my", "at" ], function() {
			var pos = ( options[ this ] || "" ).split( " " ),
				horizontalOffset,
				verticalOffset;
	
			if ( pos.length === 1) {
				pos = rhorizontal.test( pos[ 0 ] ) ?
					pos.concat( [ "center" ] ) :
					rvertical.test( pos[ 0 ] ) ?
						[ "center" ].concat( pos ) :
						[ "center", "center" ];
			}
			pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
			pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
	
			// calculate offsets
			horizontalOffset = roffset.exec( pos[ 0 ] );
			verticalOffset = roffset.exec( pos[ 1 ] );
			offsets[ this ] = [
				horizontalOffset ? horizontalOffset[ 0 ] : 0,
				verticalOffset ? verticalOffset[ 0 ] : 0
			];
	
			// reduce to just the positions without the offsets
			options[ this ] = [
				rposition.exec( pos[ 0 ] )[ 0 ],
				rposition.exec( pos[ 1 ] )[ 0 ]
			];
		});
	
		// normalize collision option
		if ( collision.length === 1 ) {
			collision[ 1 ] = collision[ 0 ];
		}
	
		if ( options.at[ 0 ] === "right" ) {
			basePosition.left += targetWidth;
		} else if ( options.at[ 0 ] === "center" ) {
			basePosition.left += targetWidth / 2;
		}
	
		if ( options.at[ 1 ] === "bottom" ) {
			basePosition.top += targetHeight;
		} else if ( options.at[ 1 ] === "center" ) {
			basePosition.top += targetHeight / 2;
		}
	
		atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
		basePosition.left += atOffset[ 0 ];
		basePosition.top += atOffset[ 1 ];
	
		return this.each(function() {
			var collisionPosition, using,
				elem = $( this ),
				elemWidth = elem.outerWidth(),
				elemHeight = elem.outerHeight(),
				marginLeft = parseCss( this, "marginLeft" ),
				marginTop = parseCss( this, "marginTop" ),
				collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
				collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
				position = $.extend( {}, basePosition ),
				myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
	
			if ( options.my[ 0 ] === "right" ) {
				position.left -= elemWidth;
			} else if ( options.my[ 0 ] === "center" ) {
				position.left -= elemWidth / 2;
			}
	
			if ( options.my[ 1 ] === "bottom" ) {
				position.top -= elemHeight;
			} else if ( options.my[ 1 ] === "center" ) {
				position.top -= elemHeight / 2;
			}
	
			position.left += myOffset[ 0 ];
			position.top += myOffset[ 1 ];
	
			// if the browser doesn't support fractions, then round for consistent results
			if ( !supportsOffsetFractions ) {
				position.left = round( position.left );
				position.top = round( position.top );
			}
	
			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 ) {
				// adds feedback as second argument to using callback, if present
				using = function( props ) {
					var left = targetOffset.left - position.left,
						right = left + targetWidth - elemWidth,
						top = targetOffset.top - position.top,
						bottom = top + targetHeight - elemHeight,
						feedback = {
							target: {
								element: target,
								left: targetOffset.left,
								top: targetOffset.top,
								width: targetWidth,
								height: targetHeight
							},
							element: {
								element: elem,
								left: position.left,
								top: position.top,
								width: elemWidth,
								height: elemHeight
							},
							horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
							vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
						};
					if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
						feedback.horizontal = "center";
					}
					if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
						feedback.vertical = "middle";
					}
					if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
						feedback.important = "horizontal";
					} else {
						feedback.important = "vertical";
					}
					options.using.call( this, props, feedback );
				};
			}
	
			elem.offset( $.extend( position, { using: using } ) );
		});
	};
	
	$.ui.position = {
		fit: {
			left: function( position, data ) {
				var within = data.within,
					withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
					outerWidth = within.width,
					collisionPosLeft = position.left - data.collisionPosition.marginLeft,
					overLeft = withinOffset - collisionPosLeft,
					overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
					newOverRight;
	
				// element is wider than within
				if ( data.collisionWidth > outerWidth ) {
					// element is initially over the left side of within
					if ( overLeft > 0 && overRight <= 0 ) {
						newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
						position.left += overLeft - newOverRight;
					// element is initially over right side of within
					} else if ( overRight > 0 && overLeft <= 0 ) {
						position.left = withinOffset;
					// element is initially over both left and right sides of within
					} else {
						if ( overLeft > overRight ) {
							position.left = withinOffset + outerWidth - data.collisionWidth;
						} else {
							position.left = withinOffset;
						}
					}
				// too far left -> align with left edge
				} else if ( overLeft > 0 ) {
					position.left += overLeft;
				// too far right -> align with right edge
				} else if ( overRight > 0 ) {
					position.left -= overRight;
				// adjust based on position and margin
				} 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;
	
				// element is taller than within
				if ( data.collisionHeight > outerHeight ) {
					// element is initially over the top of within
					if ( overTop > 0 && overBottom <= 0 ) {
						newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
						position.top += overTop - newOverBottom;
					// element is initially over bottom of within
					} else if ( overBottom > 0 && overTop <= 0 ) {
						position.top = withinOffset;
					// element is initially over both top and bottom of within
					} else {
						if ( overTop > overBottom ) {
							position.top = withinOffset + outerHeight - data.collisionHeight;
						} else {
							position.top = withinOffset;
						}
					}
				// too far up -> align with top
				} else if ( overTop > 0 ) {
					position.top += overTop;
				// too far down -> align with bottom edge
				} else if ( overBottom > 0 ) {
					position.top -= overBottom;
				// adjust based on position and margin
				} else {
					position.top = max( position.top - collisionPosTop, position.top );
				}
			}
		},
		flip: {
			left: function( position, data ) {
				var within = data.within,
					withinOffset = within.offset.left + within.scrollLeft,
					outerWidth = within.width,
					offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
					collisionPosLeft = position.left - data.collisionPosition.marginLeft,
					overLeft = collisionPosLeft - offsetLeft,
					overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
					myOffset = data.my[ 0 ] === "left" ?
						-data.elemWidth :
						data.my[ 0 ] === "right" ?
							data.elemWidth :
							0,
					atOffset = data.at[ 0 ] === "left" ?
						data.targetWidth :
						data.at[ 0 ] === "right" ?
							-data.targetWidth :
							0,
					offset = -2 * data.offset[ 0 ],
					newOverRight,
					newOverLeft;
	
				if ( overLeft < 0 ) {
					newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
					if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
						position.left += myOffset + atOffset + offset;
					}
				} else if ( overRight > 0 ) {
					newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
					if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
						position.left += myOffset + atOffset + offset;
					}
				}
			},
			top: function( position, data ) {
				var within = data.within,
					withinOffset = within.offset.top + within.scrollTop,
					outerHeight = within.height,
					offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
					collisionPosTop = position.top - data.collisionPosition.marginTop,
					overTop = collisionPosTop - offsetTop,
					overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
					top = data.my[ 1 ] === "top",
					myOffset = top ?
						-data.elemHeight :
						data.my[ 1 ] === "bottom" ?
							data.elemHeight :
							0,
					atOffset = data.at[ 1 ] === "top" ?
						data.targetHeight :
						data.at[ 1 ] === "bottom" ?
							-data.targetHeight :
							0,
					offset = -2 * data.offset[ 1 ],
					newOverTop,
					newOverBottom;
				if ( overTop < 0 ) {
					newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
					if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
						position.top += myOffset + atOffset + offset;
					}
				} else if ( overBottom > 0 ) {
					newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
					if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
						position.top += myOffset + atOffset + offset;
					}
				}
			}
		},
		flipfit: {
			left: function() {
				$.ui.position.flip.left.apply( this, arguments );
				$.ui.position.fit.left.apply( this, arguments );
			},
			top: function() {
				$.ui.position.flip.top.apply( this, arguments );
				$.ui.position.fit.top.apply( this, arguments );
			}
		}
	};
	
	// fraction support test
	(function() {
		var testElement, testElementParent, testElementStyle, offsetLeft, i,
			body = document.getElementsByTagName( "body" )[ 0 ],
			div = document.createElement( "div" );
	
		//Create a "fake body" for testing based on method used in jQuery.support
		testElement = document.createElement( body ? "div" : "body" );
		testElementStyle = {
			visibility: "hidden",
			width: 0,
			height: 0,
			border: 0,
			margin: 0,
			background: "none"
		};
		if ( body ) {
			$.extend( testElementStyle, {
				position: "absolute",
				left: "-1000px",
				top: "-1000px"
			});
		}
		for ( i in testElementStyle ) {
			testElement.style[ i ] = testElementStyle[ i ];
		}
		testElement.appendChild( div );
		testElementParent = body || document.documentElement;
		testElementParent.insertBefore( testElement, testElementParent.firstChild );
	
		div.style.cssText = "position: absolute; left: 10.7432222px;";
	
		offsetLeft = $( div ).offset().left;
		supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
	
		testElement.innerHTML = "";
		testElementParent.removeChild( testElement );
	})();
	
	})();
	
	var position = $.ui.position;
	
	
	
	
	
	var accordion = $.widget( "ui.accordion", {
		version: "1.11.4",
		options: {
			active: 0,
			animate: {},
			collapsible: false,
			event: "click",
			header: "> li > :first-child,> :not(li):even",
			heightStyle: "auto",
			icons: {
				activeHeader: "ui-icon-triangle-1-s",
				header: "ui-icon-triangle-1-e"
			},
	
			// callbacks
			activate: null,
			beforeActivate: null
		},
	
		hideProps: {
			borderTopWidth: "hide",
			borderBottomWidth: "hide",
			paddingTop: "hide",
			paddingBottom: "hide",
			height: "hide"
		},
	
		showProps: {
			borderTopWidth: "show",
			borderBottomWidth: "show",
			paddingTop: "show",
			paddingBottom: "show",
			height: "show"
		},
	
		_create: function() {
			var options = this.options;
			this.prevShow = this.prevHide = $();
			this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
				// ARIA
				.attr( "role", "tablist" );
	
			// don't allow collapsible: false and active: false / null
			if ( !options.collapsible && (options.active === false || options.active == null) ) {
				options.active = 0;
			}
	
			this._processPanels();
			// handle negative values
			if ( options.active < 0 ) {
				options.active += this.headers.length;
			}
			this._refresh();
		},
	
		_getCreateEventData: function() {
			return {
				header: this.active,
				panel: !this.active.length ? $() : this.active.next()
			};
		},
	
		_createIcons: function() {
			var icons = this.options.icons;
			if ( icons ) {
				$( "<span>" )
					.addClass( "ui-accordion-header-icon ui-icon " + icons.header )
					.prependTo( this.headers );
				this.active.children( ".ui-accordion-header-icon" )
					.removeClass( icons.header )
					.addClass( icons.activeHeader );
				this.headers.addClass( "ui-accordion-icons" );
			}
		},
	
		_destroyIcons: function() {
			this.headers
				.removeClass( "ui-accordion-icons" )
				.children( ".ui-accordion-header-icon" )
					.remove();
		},
	
		_destroy: function() {
			var contents;
	
			// clean up main element
			this.element
				.removeClass( "ui-accordion ui-widget ui-helper-reset" )
				.removeAttr( "role" );
	
			// clean up headers
			this.headers
				.removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
					"ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
				.removeAttr( "role" )
				.removeAttr( "aria-expanded" )
				.removeAttr( "aria-selected" )
				.removeAttr( "aria-controls" )
				.removeAttr( "tabIndex" )
				.removeUniqueId();
	
			this._destroyIcons();
	
			// clean up content panels
			contents = this.headers.next()
				.removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
					"ui-accordion-content ui-accordion-content-active ui-state-disabled" )
				.css( "display", "" )
				.removeAttr( "role" )
				.removeAttr( "aria-hidden" )
				.removeAttr( "aria-labelledby" )
				.removeUniqueId();
	
			if ( this.options.heightStyle !== "content" ) {
				contents.css( "height", "" );
			}
		},
	
		_setOption: function( key, value ) {
			if ( key === "active" ) {
				// _activate() will handle invalid values and update this.options
				this._activate( value );
				return;
			}
	
			if ( key === "event" ) {
				if ( this.options.event ) {
					this._off( this.headers, this.options.event );
				}
				this._setupEvents( value );
			}
	
			this._super( key, value );
	
			// setting collapsible: false while collapsed; open first panel
			if ( key === "collapsible" && !value && this.options.active === false ) {
				this._activate( 0 );
			}
	
			if ( key === "icons" ) {
				this._destroyIcons();
				if ( value ) {
					this._createIcons();
				}
			}
	
			// #5332 - opacity doesn't cascade to positioned elements in IE
			// so we need to add the disabled class to the headers and panels
			if ( key === "disabled" ) {
				this.element
					.toggleClass( "ui-state-disabled", !!value )
					.attr( "aria-disabled", value );
				this.headers.add( this.headers.next() )
					.toggleClass( "ui-state-disabled", !!value );
			}
		},
	
		_keydown: function( event ) {
			if ( event.altKey || event.ctrlKey ) {
				return;
			}
	
			var keyCode = $.ui.keyCode,
				length = this.headers.length,
				currentIndex = this.headers.index( event.target ),
				toFocus = false;
	
			switch ( event.keyCode ) {
				case keyCode.RIGHT:
				case keyCode.DOWN:
					toFocus = this.headers[ ( currentIndex + 1 ) % length ];
					break;
				case keyCode.LEFT:
				case keyCode.UP:
					toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
					break;
				case keyCode.SPACE:
				case keyCode.ENTER:
					this._eventHandler( event );
					break;
				case keyCode.HOME:
					toFocus = this.headers[ 0 ];
					break;
				case keyCode.END:
					toFocus = this.headers[ length - 1 ];
					break;
			}
	
			if ( toFocus ) {
				$( event.target ).attr( "tabIndex", -1 );
				$( toFocus ).attr( "tabIndex", 0 );
				toFocus.focus();
				event.preventDefault();
			}
		},
	
		_panelKeyDown: function( event ) {
			if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
				$( event.currentTarget ).prev().focus();
			}
		},
	
		refresh: function() {
			var options = this.options;
			this._processPanels();
	
			// was collapsed or no panel
			if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
				options.active = false;
				this.active = $();
			// active false only when collapsible is true
			} else if ( options.active === false ) {
				this._activate( 0 );
			// was active, but active panel is gone
			} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
				// all remaining panel are disabled
				if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
					options.active = false;
					this.active = $();
				// activate previous panel
				} else {
					this._activate( Math.max( 0, options.active - 1 ) );
				}
			// was active, active panel still exists
			} else {
				// make sure active index is correct
				options.active = this.headers.index( this.active );
			}
	
			this._destroyIcons();
	
			this._refresh();
		},
	
		_processPanels: function() {
			var prevHeaders = this.headers,
				prevPanels = this.panels;
	
			this.headers = this.element.find( this.options.header )
				.addClass( "ui-accordion-header ui-state-default ui-corner-all" );
	
			this.panels = this.headers.next()
				.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
				.filter( ":not(.ui-accordion-content-active)" )
				.hide();
	
			// Avoid memory leaks (#10056)
			if ( prevPanels ) {
				this._off( prevHeaders.not( this.headers ) );
				this._off( prevPanels.not( this.panels ) );
			}
		},
	
		_refresh: function() {
			var maxHeight,
				options = this.options,
				heightStyle = options.heightStyle,
				parent = this.element.parent();
	
			this.active = this._findActive( options.active )
				.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
				.removeClass( "ui-corner-all" );
			this.active.next()
				.addClass( "ui-accordion-content-active" )
				.show();
	
			this.headers
				.attr( "role", "tab" )
				.each(function() {
					var header = $( this ),
						headerId = header.uniqueId().attr( "id" ),
						panel = header.next(),
						panelId = panel.uniqueId().attr( "id" );
					header.attr( "aria-controls", panelId );
					panel.attr( "aria-labelledby", headerId );
				})
				.next()
					.attr( "role", "tabpanel" );
	
			this.headers
				.not( this.active )
				.attr({
					"aria-selected": "false",
					"aria-expanded": "false",
					tabIndex: -1
				})
				.next()
					.attr({
						"aria-hidden": "true"
					})
					.hide();
	
			// make sure at least one header is in the tab order
			if ( !this.active.length ) {
				this.headers.eq( 0 ).attr( "tabIndex", 0 );
			} else {
				this.active.attr({
					"aria-selected": "true",
					"aria-expanded": "true",
					tabIndex: 0
				})
				.next()
					.attr({
						"aria-hidden": "false"
					});
			}
	
			this._createIcons();
	
			this._setupEvents( options.event );
	
			if ( heightStyle === "fill" ) {
				maxHeight = parent.height();
				this.element.siblings( ":visible" ).each(function() {
					var elem = $( this ),
						position = elem.css( "position" );
	
					if ( position === "absolute" || position === "fixed" ) {
						return;
					}
					maxHeight -= elem.outerHeight( true );
				});
	
				this.headers.each(function() {
					maxHeight -= $( this ).outerHeight( true );
				});
	
				this.headers.next()
					.each(function() {
						$( this ).height( Math.max( 0, maxHeight -
							$( this ).innerHeight() + $( this ).height() ) );
					})
					.css( "overflow", "auto" );
			} else if ( heightStyle === "auto" ) {
				maxHeight = 0;
				this.headers.next()
					.each(function() {
						maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
					})
					.height( maxHeight );
			}
		},
	
		_activate: function( index ) {
			var active = this._findActive( index )[ 0 ];
	
			// trying to activate the already active panel
			if ( active === this.active[ 0 ] ) {
				return;
			}
	
			// trying to collapse, simulate a click on the currently active header
			active = active || this.active[ 0 ];
	
			this._eventHandler({
				target: active,
				currentTarget: active,
				preventDefault: $.noop
			});
		},
	
		_findActive: function( selector ) {
			return typeof selector === "number" ? this.headers.eq( selector ) : $();
		},
	
		_setupEvents: function( event ) {
			var events = {
				keydown: "_keydown"
			};
			if ( event ) {
				$.each( event.split( " " ), function( index, eventName ) {
					events[ eventName ] = "_eventHandler";
				});
			}
	
			this._off( this.headers.add( this.headers.next() ) );
			this._on( this.headers, events );
			this._on( this.headers.next(), { keydown: "_panelKeyDown" });
			this._hoverable( this.headers );
			this._focusable( this.headers );
		},
	
		_eventHandler: function( event ) {
			var options = this.options,
				active = this.active,
				clicked = $( event.currentTarget ),
				clickedIsActive = clicked[ 0 ] === active[ 0 ],
				collapsing = clickedIsActive && options.collapsible,
				toShow = collapsing ? $() : clicked.next(),
				toHide = active.next(),
				eventData = {
					oldHeader: active,
					oldPanel: toHide,
					newHeader: collapsing ? $() : clicked,
					newPanel: toShow
				};
	
			event.preventDefault();
	
			if (
					// click on active header, but not collapsible
					( clickedIsActive && !options.collapsible ) ||
					// allow canceling activation
					( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
				return;
			}
	
			options.active = collapsing ? false : this.headers.index( clicked );
	
			// when the call to ._toggle() comes after the class changes
			// it causes a very odd bug in IE 8 (see #6720)
			this.active = clickedIsActive ? $() : clicked;
			this._toggle( eventData );
	
			// switch classes
			// corner classes on the previously active header stay after the animation
			active.removeClass( "ui-accordion-header-active ui-state-active" );
			if ( options.icons ) {
				active.children( ".ui-accordion-header-icon" )
					.removeClass( options.icons.activeHeader )
					.addClass( options.icons.header );
			}
	
			if ( !clickedIsActive ) {
				clicked
					.removeClass( "ui-corner-all" )
					.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
				if ( options.icons ) {
					clicked.children( ".ui-accordion-header-icon" )
						.removeClass( options.icons.header )
						.addClass( options.icons.activeHeader );
				}
	
				clicked
					.next()
					.addClass( "ui-accordion-content-active" );
			}
		},
	
		_toggle: function( data ) {
			var toShow = data.newPanel,
				toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
	
			// handle activating a panel during the animation for another activation
			this.prevShow.add( this.prevHide ).stop( true, true );
			this.prevShow = toShow;
			this.prevHide = toHide;
	
			if ( this.options.animate ) {
				this._animate( toShow, toHide, data );
			} else {
				toHide.hide();
				toShow.show();
				this._toggleComplete( data );
			}
	
			toHide.attr({
				"aria-hidden": "true"
			});
			toHide.prev().attr({
				"aria-selected": "false",
				"aria-expanded": "false"
			});
			// if we're switching panels, remove the old header from the tab order
			// if we're opening from collapsed state, remove the previous header from the tab order
			// if we're collapsing, then keep the collapsing header in the tab order
			if ( toShow.length && toHide.length ) {
				toHide.prev().attr({
					"tabIndex": -1,
					"aria-expanded": "false"
				});
			} else if ( toShow.length ) {
				this.headers.filter(function() {
					return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
				})
				.attr( "tabIndex", -1 );
			}
	
			toShow
				.attr( "aria-hidden", "false" )
				.prev()
					.attr({
						"aria-selected": "true",
						"aria-expanded": "true",
						tabIndex: 0
					});
		},
	
		_animate: function( toShow, toHide, data ) {
			var total, easing, duration,
				that = this,
				adjust = 0,
				boxSizing = toShow.css( "box-sizing" ),
				down = toShow.length &&
					( !toHide.length || ( toShow.index() < toHide.index() ) ),
				animate = this.options.animate || {},
				options = down && animate.down || animate,
				complete = function() {
					that._toggleComplete( data );
				};
	
			if ( typeof options === "number" ) {
				duration = options;
			}
			if ( typeof options === "string" ) {
				easing = options;
			}
			// fall back from options to animation in case of partial down settings
			easing = easing || options.easing || animate.easing;
			duration = duration || options.duration || animate.duration;
	
			if ( !toHide.length ) {
				return toShow.animate( this.showProps, duration, easing, complete );
			}
			if ( !toShow.length ) {
				return toHide.animate( this.hideProps, duration, easing, complete );
			}
	
			total = toShow.show().outerHeight();
			toHide.animate( this.hideProps, {
				duration: duration,
				easing: easing,
				step: function( now, fx ) {
					fx.now = Math.round( now );
				}
			});
			toShow
				.hide()
				.animate( this.showProps, {
					duration: duration,
					easing: easing,
					complete: complete,
					step: function( now, fx ) {
						fx.now = Math.round( now );
						if ( fx.prop !== "height" ) {
							if ( boxSizing === "content-box" ) {
								adjust += fx.now;
							}
						} else if ( that.options.heightStyle !== "content" ) {
							fx.now = Math.round( total - toHide.outerHeight() - adjust );
							adjust = 0;
						}
					}
				});
		},
	
		_toggleComplete: function( data ) {
			var toHide = data.oldPanel;
	
			toHide
				.removeClass( "ui-accordion-content-active" )
				.prev()
					.removeClass( "ui-corner-top" )
					.addClass( "ui-corner-all" );
	
			// Work around for rendering bug in IE (#5421)
			if ( toHide.length ) {
				toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
			}
			this._trigger( "activate", null, data );
		}
	});
	
	
	
	
	
	var menu = $.widget( "ui.menu", {
		version: "1.11.4",
		defaultElement: "<ul>",
		delay: 300,
		options: {
			icons: {
				submenu: "ui-icon-carat-1-e"
			},
			items: "> *",
			menus: "ul",
			position: {
				my: "left-1 top",
				at: "right top"
			},
			role: "menu",
	
			// callbacks
			blur: null,
			focus: null,
			select: null
		},
	
		_create: function() {
			this.activeMenu = this.element;
	
			// Flag used to prevent firing of the click handler
			// as the event bubbles up through nested menus
			this.mouseHandled = false;
			this.element
				.uniqueId()
				.addClass( "ui-menu ui-widget ui-widget-content" )
				.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
				.attr({
					role: this.options.role,
					tabIndex: 0
				});
	
			if ( this.options.disabled ) {
				this.element
					.addClass( "ui-state-disabled" )
					.attr( "aria-disabled", "true" );
			}
	
			this._on({
				// Prevent focus from sticking to links inside menu after clicking
				// them (focus should always stay on UL during navigation).
				"mousedown .ui-menu-item": function( event ) {
					event.preventDefault();
				},
				"click .ui-menu-item": function( event ) {
					var target = $( event.target );
					if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
						this.select( event );
	
						// Only set the mouseHandled flag if the event will bubble, see #9469.
						if ( !event.isPropagationStopped() ) {
							this.mouseHandled = true;
						}
	
						// Open submenu on click
						if ( target.has( ".ui-menu" ).length ) {
							this.expand( event );
						} else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
	
							// Redirect focus to the menu
							this.element.trigger( "focus", [ true ] );
	
							// If the active item is on the top level, let it stay active.
							// Otherwise, blur the active item since it is no longer visible.
							if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
								clearTimeout( this.timer );
							}
						}
					}
				},
				"mouseenter .ui-menu-item": function( event ) {
					// Ignore mouse events while typeahead is active, see #10458.
					// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
					// is over an item in the menu
					if ( this.previousFilter ) {
						return;
					}
					var target = $( event.currentTarget );
					// Remove ui-state-active class from siblings of the newly focused menu item
					// to avoid a jump caused by adjacent elements both having a class with a border
					target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
					this.focus( event, target );
				},
				mouseleave: "collapseAll",
				"mouseleave .ui-menu": "collapseAll",
				focus: function( event, keepActiveItem ) {
					// If there's already an active item, keep it active
					// If not, activate the first item
					var item = this.active || this.element.find( this.options.items ).eq( 0 );
	
					if ( !keepActiveItem ) {
						this.focus( event, item );
					}
				},
				blur: function( event ) {
					this._delay(function() {
						if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
							this.collapseAll( event );
						}
					});
				},
				keydown: "_keydown"
			});
	
			this.refresh();
	
			// Clicks outside of a menu collapse any open menus
			this._on( this.document, {
				click: function( event ) {
					if ( this._closeOnDocumentClick( event ) ) {
						this.collapseAll( event );
					}
	
					// Reset the mouseHandled flag
					this.mouseHandled = false;
				}
			});
		},
	
		_destroy: function() {
			// Destroy (sub)menus
			this.element
				.removeAttr( "aria-activedescendant" )
				.find( ".ui-menu" ).addBack()
					.removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
					.removeAttr( "role" )
					.removeAttr( "tabIndex" )
					.removeAttr( "aria-labelledby" )
					.removeAttr( "aria-expanded" )
					.removeAttr( "aria-hidden" )
					.removeAttr( "aria-disabled" )
					.removeUniqueId()
					.show();
	
			// Destroy menu items
			this.element.find( ".ui-menu-item" )
				.removeClass( "ui-menu-item" )
				.removeAttr( "role" )
				.removeAttr( "aria-disabled" )
				.removeUniqueId()
				.removeClass( "ui-state-hover" )
				.removeAttr( "tabIndex" )
				.removeAttr( "role" )
				.removeAttr( "aria-haspopup" )
				.children().each( function() {
					var elem = $( this );
					if ( elem.data( "ui-menu-submenu-carat" ) ) {
						elem.remove();
					}
				});
	
			// Destroy menu dividers
			this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
		},
	
		_keydown: function( event ) {
			var match, prev, character, skip,
				preventDefault = true;
	
			switch ( event.keyCode ) {
			case $.ui.keyCode.PAGE_UP:
				this.previousPage( event );
				break;
			case $.ui.keyCode.PAGE_DOWN:
				this.nextPage( event );
				break;
			case $.ui.keyCode.HOME:
				this._move( "first", "first", event );
				break;
			case $.ui.keyCode.END:
				this._move( "last", "last", event );
				break;
			case $.ui.keyCode.UP:
				this.previous( event );
				break;
			case $.ui.keyCode.DOWN:
				this.next( event );
				break;
			case $.ui.keyCode.LEFT:
				this.collapse( event );
				break;
			case $.ui.keyCode.RIGHT:
				if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
					this.expand( event );
				}
				break;
			case $.ui.keyCode.ENTER:
			case $.ui.keyCode.SPACE:
				this._activate( event );
				break;
			case $.ui.keyCode.ESCAPE:
				this.collapse( event );
				break;
			default:
				preventDefault = false;
				prev = this.previousFilter || "";
				character = String.fromCharCode( event.keyCode );
				skip = false;
	
				clearTimeout( this.filterTimer );
	
				if ( character === prev ) {
					skip = true;
				} else {
					character = prev + character;
				}
	
				match = this._filterMenuItems( character );
				match = skip && match.index( this.active.next() ) !== -1 ?
					this.active.nextAll( ".ui-menu-item" ) :
					match;
	
				// If no matches on the current filter, reset to the last character pressed
				// to move down the menu to the first item that starts with that character
				if ( !match.length ) {
					character = String.fromCharCode( event.keyCode );
					match = this._filterMenuItems( character );
				}
	
				if ( match.length ) {
					this.focus( event, match );
					this.previousFilter = character;
					this.filterTimer = this._delay(function() {
						delete this.previousFilter;
					}, 1000 );
				} else {
					delete this.previousFilter;
				}
			}
	
			if ( preventDefault ) {
				event.preventDefault();
			}
		},
	
		_activate: function( event ) {
			if ( !this.active.is( ".ui-state-disabled" ) ) {
				if ( this.active.is( "[aria-haspopup='true']" ) ) {
					this.expand( event );
				} else {
					this.select( event );
				}
			}
		},
	
		refresh: function() {
			var menus, items,
				that = this,
				icon = this.options.icons.submenu,
				submenus = this.element.find( this.options.menus );
	
			this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
	
			// Initialize nested menus
			submenus.filter( ":not(.ui-menu)" )
				.addClass( "ui-menu ui-widget ui-widget-content ui-front" )
				.hide()
				.attr({
					role: this.options.role,
					"aria-hidden": "true",
					"aria-expanded": "false"
				})
				.each(function() {
					var menu = $( this ),
						item = menu.parent(),
						submenuCarat = $( "<span>" )
							.addClass( "ui-menu-icon ui-icon " + icon )
							.data( "ui-menu-submenu-carat", true );
	
					item
						.attr( "aria-haspopup", "true" )
						.prepend( submenuCarat );
					menu.attr( "aria-labelledby", item.attr( "id" ) );
				});
	
			menus = submenus.add( this.element );
			items = menus.find( this.options.items );
	
			// Initialize menu-items containing spaces and/or dashes only as dividers
			items.not( ".ui-menu-item" ).each(function() {
				var item = $( this );
				if ( that._isDivider( item ) ) {
					item.addClass( "ui-widget-content ui-menu-divider" );
				}
			});
	
			// Don't refresh list items that are already adapted
			items.not( ".ui-menu-item, .ui-menu-divider" )
				.addClass( "ui-menu-item" )
				.uniqueId()
				.attr({
					tabIndex: -1,
					role: this._itemRole()
				});
	
			// Add aria-disabled attribute to any disabled menu item
			items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
	
			// If the active item has been removed, blur the menu
			if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
				this.blur();
			}
		},
	
		_itemRole: function() {
			return {
				menu: "menuitem",
				listbox: "option"
			}[ this.options.role ];
		},
	
		_setOption: function( key, value ) {
			if ( key === "icons" ) {
				this.element.find( ".ui-menu-icon" )
					.removeClass( this.options.icons.submenu )
					.addClass( value.submenu );
			}
			if ( key === "disabled" ) {
				this.element
					.toggleClass( "ui-state-disabled", !!value )
					.attr( "aria-disabled", value );
			}
			this._super( key, value );
		},
	
		focus: function( event, item ) {
			var nested, focused;
			this.blur( event, event && event.type === "focus" );
	
			this._scrollIntoView( item );
	
			this.active = item.first();
			focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
			// Only update aria-activedescendant if there's a role
			// otherwise we assume focus is managed elsewhere
			if ( this.options.role ) {
				this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
			}
	
			// Highlight active parent menu item, if any
			this.active
				.parent()
				.closest( ".ui-menu-item" )
				.addClass( "ui-state-active" );
	
			if ( event && event.type === "keydown" ) {
				this._close();
			} else {
				this.timer = this._delay(function() {
					this._close();
				}, this.delay );
			}
	
			nested = item.children( ".ui-menu" );
			if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
				this._startOpening(nested);
			}
			this.activeMenu = item.parent();
	
			this._trigger( "focus", event, { item: item } );
		},
	
		_scrollIntoView: function( item ) {
			var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
			if ( this._hasScroll() ) {
				borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
				paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
				offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
				scroll = this.activeMenu.scrollTop();
				elementHeight = this.activeMenu.height();
				itemHeight = item.outerHeight();
	
				if ( offset < 0 ) {
					this.activeMenu.scrollTop( scroll + offset );
				} else if ( offset + itemHeight > elementHeight ) {
					this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
				}
			}
		},
	
		blur: function( event, fromFocus ) {
			if ( !fromFocus ) {
				clearTimeout( this.timer );
			}
	
			if ( !this.active ) {
				return;
			}
	
			this.active.removeClass( "ui-state-focus" );
			this.active = null;
	
			this._trigger( "blur", event, { item: this.active } );
		},
	
		_startOpening: function( submenu ) {
			clearTimeout( this.timer );
	
			// Don't open if already open fixes a Firefox bug that caused a .5 pixel
			// shift in the submenu position when mousing over the carat icon
			if ( submenu.attr( "aria-hidden" ) !== "true" ) {
				return;
			}
	
			this.timer = this._delay(function() {
				this._close();
				this._open( submenu );
			}, this.delay );
		},
	
		_open: function( submenu ) {
			var position = $.extend({
				of: this.active
			}, this.options.position );
	
			clearTimeout( this.timer );
			this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
				.hide()
				.attr( "aria-hidden", "true" );
	
			submenu
				.show()
				.removeAttr( "aria-hidden" )
				.attr( "aria-expanded", "true" )
				.position( position );
		},
	
		collapseAll: function( event, all ) {
			clearTimeout( this.timer );
			this.timer = this._delay(function() {
				// If we were passed an event, look for the submenu that contains the event
				var currentMenu = all ? this.element :
					$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
	
				// If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
				if ( !currentMenu.length ) {
					currentMenu = this.element;
				}
	
				this._close( currentMenu );
	
				this.blur( event );
				this.activeMenu = currentMenu;
			}, this.delay );
		},
	
		// With no arguments, closes the currently active menu - if nothing is active
		// it closes all menus.  If passed an argument, it will search for menus BELOW
		_close: function( startMenu ) {
			if ( !startMenu ) {
				startMenu = this.active ? this.active.parent() : this.element;
			}
	
			startMenu
				.find( ".ui-menu" )
					.hide()
					.attr( "aria-hidden", "true" )
					.attr( "aria-expanded", "false" )
				.end()
				.find( ".ui-state-active" ).not( ".ui-state-focus" )
					.removeClass( "ui-state-active" );
		},
	
		_closeOnDocumentClick: function( event ) {
			return !$( event.target ).closest( ".ui-menu" ).length;
		},
	
		_isDivider: function( item ) {
	
			// Match hyphen, em dash, en dash
			return !/[^\-\u2014\u2013\s]/.test( item.text() );
		},
	
		collapse: function( event ) {
			var newItem = this.active &&
				this.active.parent().closest( ".ui-menu-item", this.element );
			if ( newItem && newItem.length ) {
				this._close();
				this.focus( event, newItem );
			}
		},
	
		expand: function( event ) {
			var newItem = this.active &&
				this.active
					.children( ".ui-menu " )
					.find( this.options.items )
					.first();
	
			if ( newItem && newItem.length ) {
				this._open( newItem.parent() );
	
				// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
				this._delay(function() {
					this.focus( event, newItem );
				});
			}
		},
	
		next: function( event ) {
			this._move( "next", "first", event );
		},
	
		previous: function( event ) {
			this._move( "prev", "last", event );
		},
	
		isFirstItem: function() {
			return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
		},
	
		isLastItem: function() {
			return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
		},
	
		_move: function( direction, filter, event ) {
			var next;
			if ( this.active ) {
				if ( direction === "first" || direction === "last" ) {
					next = this.active
						[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
						.eq( -1 );
				} else {
					next = this.active
						[ direction + "All" ]( ".ui-menu-item" )
						.eq( 0 );
				}
			}
			if ( !next || !next.length || !this.active ) {
				next = this.activeMenu.find( this.options.items )[ filter ]();
			}
	
			this.focus( event, next );
		},
	
		nextPage: function( event ) {
			var item, base, height;
	
			if ( !this.active ) {
				this.next( event );
				return;
			}
			if ( this.isLastItem() ) {
				return;
			}
			if ( this._hasScroll() ) {
				base = this.active.offset().top;
				height = this.element.height();
				this.active.nextAll( ".ui-menu-item" ).each(function() {
					item = $( this );
					return item.offset().top - base - height < 0;
				});
	
				this.focus( event, item );
			} else {
				this.focus( event, this.activeMenu.find( this.options.items )
					[ !this.active ? "first" : "last" ]() );
			}
		},
	
		previousPage: function( event ) {
			var item, base, height;
			if ( !this.active ) {
				this.next( event );
				return;
			}
			if ( this.isFirstItem() ) {
				return;
			}
			if ( this._hasScroll() ) {
				base = this.active.offset().top;
				height = this.element.height();
				this.active.prevAll( ".ui-menu-item" ).each(function() {
					item = $( this );
					return item.offset().top - base + height > 0;
				});
	
				this.focus( event, item );
			} else {
				this.focus( event, this.activeMenu.find( this.options.items ).first() );
			}
		},
	
		_hasScroll: function() {
			return this.element.outerHeight() < this.element.prop( "scrollHeight" );
		},
	
		select: function( event ) {
			// TODO: It should never be possible to not have an active item at this
			// point, but the tests don't trigger mouseenter before click.
			this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
			var ui = { item: this.active };
			if ( !this.active.has( ".ui-menu" ).length ) {
				this.collapseAll( event, true );
			}
			this._trigger( "select", event, ui );
		},
	
		_filterMenuItems: function(character) {
			var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
				regex = new RegExp( "^" + escapedCharacter, "i" );
	
			return this.activeMenu
				.find( this.options.items )
	
				// Only match on items, not dividers or other content (#10571)
				.filter( ".ui-menu-item" )
				.filter(function() {
					return regex.test( $.trim( $( this ).text() ) );
				});
		}
	});
	
	
	
	
	
	$.widget( "ui.autocomplete", {
		version: "1.11.4",
		defaultElement: "<input>",
		options: {
			appendTo: null,
			autoFocus: false,
			delay: 300,
			minLength: 1,
			position: {
				my: "left top",
				at: "left bottom",
				collision: "none"
			},
			source: null,
	
			// callbacks
			change: null,
			close: null,
			focus: null,
			open: null,
			response: null,
			search: null,
			select: null
		},
	
		requestIndex: 0,
		pending: 0,
	
		_create: function() {
			// Some browsers only repeat keydown events, not keypress events,
			// so we use the suppressKeyPress flag to determine if we've already
			// handled the keydown event. #7269
			// Unfortunately the code for & in keypress is the same as the up arrow,
			// so we use the suppressKeyPressRepeat flag to avoid handling keypress
			// events when we know the keydown event was used to modify the
			// search term. #7799
			var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
				nodeName = this.element[ 0 ].nodeName.toLowerCase(),
				isTextarea = nodeName === "textarea",
				isInput = nodeName === "input";
	
			this.isMultiLine =
				// Textareas are always multi-line
				isTextarea ? true :
				// Inputs are always single-line, even if inside a contentEditable element
				// IE also treats inputs as contentEditable
				isInput ? false :
				// All other element types are determined by whether or not they're contentEditable
				this.element.prop( "isContentEditable" );
	
			this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
			this.isNewMenu = true;
	
			this.element
				.addClass( "ui-autocomplete-input" )
				.attr( "autocomplete", "off" );
	
			this._on( this.element, {
				keydown: function( event ) {
					if ( this.element.prop( "readOnly" ) ) {
						suppressKeyPress = true;
						suppressInput = true;
						suppressKeyPressRepeat = true;
						return;
					}
	
					suppressKeyPress = false;
					suppressInput = false;
					suppressKeyPressRepeat = false;
					var keyCode = $.ui.keyCode;
					switch ( event.keyCode ) {
					case keyCode.PAGE_UP:
						suppressKeyPress = true;
						this._move( "previousPage", event );
						break;
					case keyCode.PAGE_DOWN:
						suppressKeyPress = true;
						this._move( "nextPage", event );
						break;
					case keyCode.UP:
						suppressKeyPress = true;
						this._keyEvent( "previous", event );
						break;
					case keyCode.DOWN:
						suppressKeyPress = true;
						this._keyEvent( "next", event );
						break;
					case keyCode.ENTER:
						// when menu is open and has focus
						if ( this.menu.active ) {
							// #6055 - Opera still allows the keypress to occur
							// which causes forms to submit
							suppressKeyPress = true;
							event.preventDefault();
							this.menu.select( event );
						}
						break;
					case keyCode.TAB:
						if ( this.menu.active ) {
							this.menu.select( event );
						}
						break;
					case keyCode.ESCAPE:
						if ( this.menu.element.is( ":visible" ) ) {
							if ( !this.isMultiLine ) {
								this._value( this.term );
							}
							this.close( event );
							// Different browsers have different default behavior for escape
							// Single press can mean undo or clear
							// Double press in IE means clear the whole form
							event.preventDefault();
						}
						break;
					default:
						suppressKeyPressRepeat = true;
						// search timeout should be triggered before the input value is changed
						this._searchTimeout( event );
						break;
					}
				},
				keypress: function( event ) {
					if ( suppressKeyPress ) {
						suppressKeyPress = false;
						if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
							event.preventDefault();
						}
						return;
					}
					if ( suppressKeyPressRepeat ) {
						return;
					}
	
					// replicate some key handlers to allow them to repeat in Firefox and Opera
					var keyCode = $.ui.keyCode;
					switch ( event.keyCode ) {
					case keyCode.PAGE_UP:
						this._move( "previousPage", event );
						break;
					case keyCode.PAGE_DOWN:
						this._move( "nextPage", event );
						break;
					case keyCode.UP:
						this._keyEvent( "previous", event );
						break;
					case keyCode.DOWN:
						this._keyEvent( "next", event );
						break;
					}
				},
				input: function( event ) {
					if ( suppressInput ) {
						suppressInput = false;
						event.preventDefault();
						return;
					}
					this._searchTimeout( event );
				},
				focus: function() {
					this.selectedItem = null;
					this.previous = this._value();
				},
				blur: function( event ) {
					if ( this.cancelBlur ) {
						delete this.cancelBlur;
						return;
					}
	
					clearTimeout( this.searching );
					this.close( event );
					this._change( event );
				}
			});
	
			this._initSource();
			this.menu = $( "<ul>" )
				.addClass( "ui-autocomplete ui-front" )
				.appendTo( this._appendTo() )
				.menu({
					// disable ARIA support, the live region takes care of that
					role: null
				})
				.hide()
				.menu( "instance" );
	
			this._on( this.menu.element, {
				mousedown: function( event ) {
					// prevent moving focus out of the text field
					event.preventDefault();
	
					// IE doesn't prevent moving focus even with event.preventDefault()
					// so we set a flag to know when we should ignore the blur event
					this.cancelBlur = true;
					this._delay(function() {
						delete this.cancelBlur;
					});
	
					// clicking on the scrollbar causes focus to shift to the body
					// but we can't detect a mouseup or a click immediately afterward
					// so we have to track the next mousedown and close the menu if
					// the user clicks somewhere outside of the autocomplete
					var menuElement = this.menu.element[ 0 ];
					if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
						this._delay(function() {
							var that = this;
							this.document.one( "mousedown", function( event ) {
								if ( event.target !== that.element[ 0 ] &&
										event.target !== menuElement &&
										!$.contains( menuElement, event.target ) ) {
									that.close();
								}
							});
						});
					}
				},
				menufocus: function( event, ui ) {
					var label, item;
					// support: Firefox
					// Prevent accidental activation of menu items in Firefox (#7024 #9118)
					if ( this.isNewMenu ) {
						this.isNewMenu = false;
						if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
							this.menu.blur();
	
							this.document.one( "mousemove", function() {
								$( event.target ).trigger( event.originalEvent );
							});
	
							return;
						}
					}
	
					item = ui.item.data( "ui-autocomplete-item" );
					if ( false !== this._trigger( "focus", event, { item: item } ) ) {
						// use value to match what will end up in the input, if it was a key event
						if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
							this._value( item.value );
						}
					}
	
					// Announce the value in the liveRegion
					label = ui.item.attr( "aria-label" ) || item.value;
					if ( label && $.trim( label ).length ) {
						this.liveRegion.children().hide();
						$( "<div>" ).text( label ).appendTo( this.liveRegion );
					}
				},
				menuselect: function( event, ui ) {
					var item = ui.item.data( "ui-autocomplete-item" ),
						previous = this.previous;
	
					// only trigger when focus was lost (click on menu)
					if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
						this.element.focus();
						this.previous = previous;
						// #6109 - IE triggers two focus events and the second
						// is asynchronous, so we need to reset the previous
						// term synchronously and asynchronously :-(
						this._delay(function() {
							this.previous = previous;
							this.selectedItem = item;
						});
					}
	
					if ( false !== this._trigger( "select", event, { item: item } ) ) {
						this._value( item.value );
					}
					// reset the term after the select event
					// this allows custom select handling to work properly
					this.term = this._value();
	
					this.close( event );
					this.selectedItem = item;
				}
			});
	
			this.liveRegion = $( "<span>", {
					role: "status",
					"aria-live": "assertive",
					"aria-relevant": "additions"
				})
				.addClass( "ui-helper-hidden-accessible" )
				.appendTo( this.document[ 0 ].body );
	
			// turning off autocomplete prevents the browser from remembering the
			// value when navigating through history, so we re-enable autocomplete
			// if the page is unloaded before the widget is destroyed. #7790
			this._on( this.window, {
				beforeunload: function() {
					this.element.removeAttr( "autocomplete" );
				}
			});
		},
	
		_destroy: function() {
			clearTimeout( this.searching );
			this.element
				.removeClass( "ui-autocomplete-input" )
				.removeAttr( "autocomplete" );
			this.menu.element.remove();
			this.liveRegion.remove();
		},
	
		_setOption: function( key, value ) {
			this._super( key, value );
			if ( key === "source" ) {
				this._initSource();
			}
			if ( key === "appendTo" ) {
				this.menu.element.appendTo( this._appendTo() );
			}
			if ( key === "disabled" && value && this.xhr ) {
				this.xhr.abort();
			}
		},
	
		_appendTo: function() {
			var element = this.options.appendTo;
	
			if ( element ) {
				element = element.jquery || element.nodeType ?
					$( element ) :
					this.document.find( element ).eq( 0 );
			}
	
			if ( !element || !element[ 0 ] ) {
				element = this.element.closest( ".ui-front" );
			}
	
			if ( !element.length ) {
				element = this.document[ 0 ].body;
			}
	
			return element;
		},
	
		_initSource: function() {
			var array, url,
				that = this;
			if ( $.isArray( this.options.source ) ) {
				array = this.options.source;
				this.source = function( request, response ) {
					response( $.ui.autocomplete.filter( array, request.term ) );
				};
			} else if ( typeof this.options.source === "string" ) {
				url = this.options.source;
				this.source = function( request, response ) {
					if ( that.xhr ) {
						that.xhr.abort();
					}
					that.xhr = $.ajax({
						url: url,
						data: request,
						dataType: "json",
						success: function( data ) {
							response( data );
						},
						error: function() {
							response([]);
						}
					});
				};
			} else {
				this.source = this.options.source;
			}
		},
	
		_searchTimeout: function( event ) {
			clearTimeout( this.searching );
			this.searching = this._delay(function() {
	
				// Search if the value has changed, or if the user retypes the same value (see #7434)
				var equalValues = this.term === this._value(),
					menuVisible = this.menu.element.is( ":visible" ),
					modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
	
				if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
					this.selectedItem = null;
					this.search( null, event );
				}
			}, this.options.delay );
		},
	
		search: function( value, event ) {
			value = value != null ? value : this._value();
	
			// always save the actual value, not the one passed as an argument
			this.term = this._value();
	
			if ( value.length < this.options.minLength ) {
				return this.close( event );
			}
	
			if ( this._trigger( "search", event ) === false ) {
				return;
			}
	
			return this._search( value );
		},
	
		_search: function( value ) {
			this.pending++;
			this.element.addClass( "ui-autocomplete-loading" );
			this.cancelSearch = false;
	
			this.source( { term: value }, this._response() );
		},
	
		_response: function() {
			var index = ++this.requestIndex;
	
			return $.proxy(function( content ) {
				if ( index === this.requestIndex ) {
					this.__response( content );
				}
	
				this.pending--;
				if ( !this.pending ) {
					this.element.removeClass( "ui-autocomplete-loading" );
				}
			}, this );
		},
	
		__response: function( content ) {
			if ( content ) {
				content = this._normalize( content );
			}
			this._trigger( "response", null, { content: content } );
			if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
				this._suggest( content );
				this._trigger( "open" );
			} else {
				// use ._close() instead of .close() so we don't cancel future searches
				this._close();
			}
		},
	
		close: function( event ) {
			this.cancelSearch = true;
			this._close( event );
		},
	
		_close: function( event ) {
			if ( this.menu.element.is( ":visible" ) ) {
				this.menu.element.hide();
				this.menu.blur();
				this.isNewMenu = true;
				this._trigger( "close", event );
			}
		},
	
		_change: function( event ) {
			if ( this.previous !== this._value() ) {
				this._trigger( "change", event, { item: this.selectedItem } );
			}
		},
	
		_normalize: function( items ) {
			// assume all items have the right format when the first item is complete
			if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
				return items;
			}
			return $.map( items, function( item ) {
				if ( typeof item === "string" ) {
					return {
						label: item,
						value: item
					};
				}
				return $.extend( {}, item, {
					label: item.label || item.value,
					value: item.value || item.label
				});
			});
		},
	
		_suggest: function( items ) {
			var ul = this.menu.element.empty();
			this._renderMenu( ul, items );
			this.isNewMenu = true;
			this.menu.refresh();
	
			// size and position menu
			ul.show();
			this._resizeMenu();
			ul.position( $.extend({
				of: this.element
			}, this.options.position ) );
	
			if ( this.options.autoFocus ) {
				this.menu.next();
			}
		},
	
		_resizeMenu: function() {
			var ul = this.menu.element;
			ul.outerWidth( Math.max(
				// Firefox wraps long text (possibly a rounding bug)
				// so we add 1px to avoid the wrapping (#7513)
				ul.width( "" ).outerWidth() + 1,
				this.element.outerWidth()
			) );
		},
	
		_renderMenu: function( ul, items ) {
			var that = this;
			$.each( items, function( index, item ) {
				that._renderItemData( ul, item );
			});
		},
	
		_renderItemData: function( ul, item ) {
			return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
		},
	
		_renderItem: function( ul, item ) {
			return $( "<li>" ).text( item.label ).appendTo( ul );
		},
	
		_move: function( direction, event ) {
			if ( !this.menu.element.is( ":visible" ) ) {
				this.search( null, event );
				return;
			}
			if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
					this.menu.isLastItem() && /^next/.test( direction ) ) {
	
				if ( !this.isMultiLine ) {
					this._value( this.term );
				}
	
				this.menu.blur();
				return;
			}
			this.menu[ direction ]( event );
		},
	
		widget: function() {
			return this.menu.element;
		},
	
		_value: function() {
			return this.valueMethod.apply( this.element, arguments );
		},
	
		_keyEvent: function( keyEvent, event ) {
			if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
				this._move( keyEvent, event );
	
				// prevents moving cursor to beginning/end of the text field in some browsers
				event.preventDefault();
			}
		}
	});
	
	$.extend( $.ui.autocomplete, {
		escapeRegex: function( value ) {
			return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
		},
		filter: function( array, term ) {
			var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
			return $.grep( array, function( value ) {
				return matcher.test( value.label || value.value || value );
			});
		}
	});
	
	// live region extension, adding a `messages` option
	// NOTE: This is an experimental API. We are still investigating
	// a full solution for string manipulation and internationalization.
	$.widget( "ui.autocomplete", $.ui.autocomplete, {
		options: {
			messages: {
				noResults: "No search results.",
				results: function( amount ) {
					return amount + ( amount > 1 ? " results are" : " result is" ) +
						" available, use up and down arrow keys to navigate.";
				}
			}
		},
	
		__response: function( content ) {
			var message;
			this._superApply( arguments );
			if ( this.options.disabled || this.cancelSearch ) {
				return;
			}
			if ( content && content.length ) {
				message = this.options.messages.results( content.length );
			} else {
				message = this.options.messages.noResults;
			}
			this.liveRegion.children().hide();
			$( "<div>" ).text( message ).appendTo( this.liveRegion );
		}
	});
	
	var autocomplete = $.ui.autocomplete;
	
	
	
	
	
	var lastActive,
		baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
		typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
		formResetHandler = function() {
			var form = $( this );
			setTimeout(function() {
				form.find( ":ui-button" ).button( "refresh" );
			}, 1 );
		},
		radioGroup = function( radio ) {
			var name = radio.name,
				form = radio.form,
				radios = $( [] );
			if ( name ) {
				name = name.replace( /'/g, "\\'" );
				if ( form ) {
					radios = $( form ).find( "[name='" + name + "'][type=radio]" );
				} else {
					radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
						.filter(function() {
							return !this.form;
						});
				}
			}
			return radios;
		};
	
	$.widget( "ui.button", {
		version: "1.11.4",
		defaultElement: "<button>",
		options: {
			disabled: null,
			text: true,
			label: null,
			icons: {
				primary: null,
				secondary: null
			}
		},
		_create: function() {
			this.element.closest( "form" )
				.unbind( "reset" + this.eventNamespace )
				.bind( "reset" + this.eventNamespace, formResetHandler );
	
			if ( typeof this.options.disabled !== "boolean" ) {
				this.options.disabled = !!this.element.prop( "disabled" );
			} else {
				this.element.prop( "disabled", this.options.disabled );
			}
	
			this._determineButtonType();
			this.hasTitle = !!this.buttonElement.attr( "title" );
	
			var that = this,
				options = this.options,
				toggleButton = this.type === "checkbox" || this.type === "radio",
				activeClass = !toggleButton ? "ui-state-active" : "";
	
			if ( options.label === null ) {
				options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
			}
	
			this._hoverable( this.buttonElement );
	
			this.buttonElement
				.addClass( baseClasses )
				.attr( "role", "button" )
				.bind( "mouseenter" + this.eventNamespace, function() {
					if ( options.disabled ) {
						return;
					}
					if ( this === lastActive ) {
						$( this ).addClass( "ui-state-active" );
					}
				})
				.bind( "mouseleave" + this.eventNamespace, function() {
					if ( options.disabled ) {
						return;
					}
					$( this ).removeClass( activeClass );
				})
				.bind( "click" + this.eventNamespace, function( event ) {
					if ( options.disabled ) {
						event.preventDefault();
						event.stopImmediatePropagation();
					}
				});
	
			// Can't use _focusable() because the element that receives focus
			// and the element that gets the ui-state-focus class are different
			this._on({
				focus: function() {
					this.buttonElement.addClass( "ui-state-focus" );
				},
				blur: function() {
					this.buttonElement.removeClass( "ui-state-focus" );
				}
			});
	
			if ( toggleButton ) {
				this.element.bind( "change" + this.eventNamespace, function() {
					that.refresh();
				});
			}
	
			if ( this.type === "checkbox" ) {
				this.buttonElement.bind( "click" + this.eventNamespace, function() {
					if ( options.disabled ) {
						return false;
					}
				});
			} else if ( this.type === "radio" ) {
				this.buttonElement.bind( "click" + this.eventNamespace, function() {
					if ( options.disabled ) {
						return false;
					}
					$( this ).addClass( "ui-state-active" );
					that.buttonElement.attr( "aria-pressed", "true" );
	
					var radio = that.element[ 0 ];
					radioGroup( radio )
						.not( radio )
						.map(function() {
							return $( this ).button( "widget" )[ 0 ];
						})
						.removeClass( "ui-state-active" )
						.attr( "aria-pressed", "false" );
				});
			} else {
				this.buttonElement
					.bind( "mousedown" + this.eventNamespace, function() {
						if ( options.disabled ) {
							return false;
						}
						$( this ).addClass( "ui-state-active" );
						lastActive = this;
						that.document.one( "mouseup", function() {
							lastActive = null;
						});
					})
					.bind( "mouseup" + this.eventNamespace, function() {
						if ( options.disabled ) {
							return false;
						}
						$( this ).removeClass( "ui-state-active" );
					})
					.bind( "keydown" + this.eventNamespace, function(event) {
						if ( options.disabled ) {
							return false;
						}
						if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
							$( this ).addClass( "ui-state-active" );
						}
					})
					// see #8559, we bind to blur here in case the button element loses
					// focus between keydown and keyup, it would be left in an "active" state
					.bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
						$( this ).removeClass( "ui-state-active" );
					});
	
				if ( this.buttonElement.is("a") ) {
					this.buttonElement.keyup(function(event) {
						if ( event.keyCode === $.ui.keyCode.SPACE ) {
							// TODO pass through original event correctly (just as 2nd argument doesn't work)
							$( this ).click();
						}
					});
				}
			}
	
			this._setOption( "disabled", options.disabled );
			this._resetButton();
		},
	
		_determineButtonType: function() {
			var ancestor, labelSelector, checked;
	
			if ( this.element.is("[type=checkbox]") ) {
				this.type = "checkbox";
			} else if ( this.element.is("[type=radio]") ) {
				this.type = "radio";
			} else if ( this.element.is("input") ) {
				this.type = "input";
			} else {
				this.type = "button";
			}
	
			if ( this.type === "checkbox" || this.type === "radio" ) {
				// we don't search against the document in case the element
				// is disconnected from the DOM
				ancestor = this.element.parents().last();
				labelSelector = "label[for='" + this.element.attr("id") + "']";
				this.buttonElement = ancestor.find( labelSelector );
				if ( !this.buttonElement.length ) {
					ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
					this.buttonElement = ancestor.filter( labelSelector );
					if ( !this.buttonElement.length ) {
						this.buttonElement = ancestor.find( labelSelector );
					}
				}
				this.element.addClass( "ui-helper-hidden-accessible" );
	
				checked = this.element.is( ":checked" );
				if ( checked ) {
					this.buttonElement.addClass( "ui-state-active" );
				}
				this.buttonElement.prop( "aria-pressed", checked );
			} else {
				this.buttonElement = this.element;
			}
		},
	
		widget: function() {
			return this.buttonElement;
		},
	
		_destroy: function() {
			this.element
				.removeClass( "ui-helper-hidden-accessible" );
			this.buttonElement
				.removeClass( baseClasses + " ui-state-active " + typeClasses )
				.removeAttr( "role" )
				.removeAttr( "aria-pressed" )
				.html( this.buttonElement.find(".ui-button-text").html() );
	
			if ( !this.hasTitle ) {
				this.buttonElement.removeAttr( "title" );
			}
		},
	
		_setOption: function( key, value ) {
			this._super( key, value );
			if ( key === "disabled" ) {
				this.widget().toggleClass( "ui-state-disabled", !!value );
				this.element.prop( "disabled", !!value );
				if ( value ) {
					if ( this.type === "checkbox" || this.type === "radio" ) {
						this.buttonElement.removeClass( "ui-state-focus" );
					} else {
						this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
					}
				}
				return;
			}
			this._resetButton();
		},
	
		refresh: function() {
			//See #8237 & #8828
			var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
	
			if ( isDisabled !== this.options.disabled ) {
				this._setOption( "disabled", isDisabled );
			}
			if ( this.type === "radio" ) {
				radioGroup( this.element[0] ).each(function() {
					if ( $( this ).is( ":checked" ) ) {
						$( this ).button( "widget" )
							.addClass( "ui-state-active" )
							.attr( "aria-pressed", "true" );
					} else {
						$( this ).button( "widget" )
							.removeClass( "ui-state-active" )
							.attr( "aria-pressed", "false" );
					}
				});
			} else if ( this.type === "checkbox" ) {
				if ( this.element.is( ":checked" ) ) {
					this.buttonElement
						.addClass( "ui-state-active" )
						.attr( "aria-pressed", "true" );
				} else {
					this.buttonElement
						.removeClass( "ui-state-active" )
						.attr( "aria-pressed", "false" );
				}
			}
		},
	
		_resetButton: function() {
			if ( this.type === "input" ) {
				if ( this.options.label ) {
					this.element.val( this.options.label );
				}
				return;
			}
			var buttonElement = this.buttonElement.removeClass( typeClasses ),
				buttonText = $( "<span></span>", this.document[0] )
					.addClass( "ui-button-text" )
					.html( this.options.label )
					.appendTo( buttonElement.empty() )
					.text(),
				icons = this.options.icons,
				multipleIcons = icons.primary && icons.secondary,
				buttonClasses = [];
	
			if ( icons.primary || icons.secondary ) {
				if ( this.options.text ) {
					buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
				}
	
				if ( icons.primary ) {
					buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
				}
	
				if ( icons.secondary ) {
					buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
				}
	
				if ( !this.options.text ) {
					buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
	
					if ( !this.hasTitle ) {
						buttonElement.attr( "title", $.trim( buttonText ) );
					}
				}
			} else {
				buttonClasses.push( "ui-button-text-only" );
			}
			buttonElement.addClass( buttonClasses.join( " " ) );
		}
	});
	
	$.widget( "ui.buttonset", {
		version: "1.11.4",
		options: {
			items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
		},
	
		_create: function() {
			this.element.addClass( "ui-buttonset" );
		},
	
		_init: function() {
			this.refresh();
		},
	
		_setOption: function( key, value ) {
			if ( key === "disabled" ) {
				this.buttons.button( "option", key, value );
			}
	
			this._super( key, value );
		},
	
		refresh: function() {
			var rtl = this.element.css( "direction" ) === "rtl",
				allButtons = this.element.find( this.options.items ),
				existingButtons = allButtons.filter( ":ui-button" );
	
			// Initialize new buttons
			allButtons.not( ":ui-button" ).button();
	
			// Refresh existing buttons
			existingButtons.button( "refresh" );
	
			this.buttons = allButtons
				.map(function() {
					return $( this ).button( "widget" )[ 0 ];
				})
					.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
					.filter( ":first" )
						.addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
					.end()
					.filter( ":last" )
						.addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
					.end()
				.end();
		},
	
		_destroy: function() {
			this.element.removeClass( "ui-buttonset" );
			this.buttons
				.map(function() {
					return $( this ).button( "widget" )[ 0 ];
				})
					.removeClass( "ui-corner-left ui-corner-right" )
				.end()
				.button( "destroy" );
		}
	});
	
	var button = $.ui.button;
	
	
	
	
	
	$.extend($.ui, { datepicker: { version: "1.11.4" } });
	
	var datepicker_instActive;
	
	function datepicker_getZindex( elem ) {
		var position, value;
		while ( elem.length && elem[ 0 ] !== document ) {
			// Ignore z-index if position is set to a value where z-index is ignored by the browser
			// This makes behavior of this function consistent across browsers
			// WebKit always returns auto if the element is positioned
			position = elem.css( "position" );
			if ( position === "absolute" || position === "relative" || position === "fixed" ) {
				// IE returns 0 when zIndex is not specified
				// other browsers return a string
				// we ignore the case of nested elements with an explicit value of 0
				// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
				value = parseInt( elem.css( "zIndex" ), 10 );
				if ( !isNaN( value ) && value !== 0 ) {
					return value;
				}
			}
			elem = elem.parent();
		}
	
		return 0;
	}
	
	
	function Datepicker() {
		this._curInst = null; // The current instance in use
		this._keyEvent = false; // If the last event was a key event
		this._disabledInputs = []; // List of date picker inputs that have been disabled
		this._datepickerShowing = false; // True if the popup picker is showing , false if not
		this._inDialog = false; // True if showing within a "dialog", false if not
		this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
		this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
		this._appendClass = "ui-datepicker-append"; // The name of the append marker class
		this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
		this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
		this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
		this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
		this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
		this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
		this.regional = []; // Available regional settings, indexed by language code
		this.regional[""] = { // Default regional settings
			closeText: "Done", // Display text for close link
			prevText: "Prev", // Display text for previous month link
			nextText: "Next", // Display text for next month link
			currentText: "Today", // Display text for current month link
			monthNames: ["January","February","March","April","May","June",
				"July","August","September","October","November","December"], // Names of months for drop-down and formatting
			monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
			dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
			dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
			dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
			weekHeader: "Wk", // Column header for week of the year
			dateFormat: "mm/dd/yy", // See format options on parseDate
			firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
			isRTL: false, // True if right-to-left language, false if left-to-right
			showMonthAfterYear: false, // True if the year select precedes month, false for month then year
			yearSuffix: "" // Additional text to append to the year in the month headers
		};
		this._defaults = { // Global defaults for all the date picker instances
			showOn: "focus", // "focus" for popup on focus,
				// "button" for trigger button, or "both" for either
			showAnim: "fadeIn", // Name of jQuery animation for popup
			showOptions: {}, // Options for enhanced animations
			defaultDate: null, // Used when field is blank: actual date,
				// +/-number for offset from today, null for today
			appendText: "", // Display text following the input box, e.g. showing the format
			buttonText: "...", // Text for trigger button
			buttonImage: "", // URL for trigger button image
			buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
			hideIfNoPrevNext: false, // True to hide next/previous month links
				// if not applicable, false to just disable them
			navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
			gotoCurrent: false, // True if today link goes back to current selection instead
			changeMonth: false, // True if month can be selected directly, false if only prev/next
			changeYear: false, // True if year can be selected directly, false if only prev/next
			yearRange: "c-10:c+10", // Range of years to display in drop-down,
				// either relative to today's year (-nn:+nn), relative to currently displayed year
				// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
			showOtherMonths: false, // True to show dates in other months, false to leave blank
			selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
			showWeek: false, // True to show week of the year, false to not show it
			calculateWeek: this.iso8601Week, // How to calculate the week of the year,
				// takes a Date and returns the number of the week for it
			shortYearCutoff: "+10", // Short year values < this are in the current century,
				// > this are in the previous century,
				// string value starting with "+" for current year + value
			minDate: null, // The earliest selectable date, or null for no limit
			maxDate: null, // The latest selectable date, or null for no limit
			currentPeriodStartDate: null, 
			currentPeriodEndDate: null, 		
			duration: "fast", // Duration of display/closure
			beforeShowDay: null, // Function that takes a date and returns an array with
				// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
				// [2] = cell title (optional), e.g. $.datepicker.noWeekends
			beforeShow: null, // Function that takes an input field and
				// returns a set of custom settings for the date picker
			onSelect: null, // Define a callback function when a date is selected
			onChangeMonthYear: null, // Define a callback function when the month or year is changed
			onClose: null, // Define a callback function when the datepicker is closed
			numberOfMonths: 1, // Number of months to show at a time
			showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
			stepMonths: 1, // Number of months to step back/forward
			stepBigMonths: 12, // Number of months to step back/forward for the big links
			altField: "", // Selector for an alternate field to store selected dates into
			altFormat: "", // The date format to use for the alternate field
			constrainInput: true, // The input is constrained by the current date format
			showButtonPanel: false, // True to show button panel, false to not show it
			autoSize: false, // True to size the input for the date format, false to leave as is
			disabled: false, // The initial disabled state
			bugsWeek: false
		};
		$.extend(this._defaults, this.regional[""]);
		this.regional.en = $.extend( true, {}, this.regional[ "" ]);
		this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
		this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
	}
	
	$.extend(Datepicker.prototype, {
		
		markerClassName: "hasDatepicker",
	
		//Keep track of the maximum number of rows displayed (see #7043)
		maxRows: 4,
	
		// TODO rename to "widget" when switching to widget factory
		_widgetDatepicker: function() {
			return this.dpDiv;
		},
	
		
		setDefaults: function(settings) {
			datepicker_extendRemove(this._defaults, settings || {});
			return this;
		},
	
		
		_attachDatepicker: function(target, settings) {
			var nodeName, inline, inst;
			nodeName = target.nodeName.toLowerCase();
			inline = (nodeName === "div" || nodeName === "span");
			if (!target.id) {
				this.uuid += 1;
				target.id = "dp" + this.uuid;
			}
			inst = this._newInst($(target), inline);
			inst.settings = $.extend({}, settings || {});
			if (nodeName === "input") {
				this._connectDatepicker(target, inst);
			} else if (inline) {
				this._inlineDatepicker(target, inst);
			}
		},
	
		
		_newInst: function(target, inline) {
			var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
			return {id: id, input: target, // associated target
				selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
				drawMonth: 0, drawYear: 0, // month being drawn
				inline: inline, // is datepicker inline or not
				dpDiv: (!inline ? this.dpDiv : // presentation div
				datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
		},
	
		
		_connectDatepicker: function(target, inst) {
			var input = $(target);
			inst.append = $([]);
			inst.trigger = $([]);
			if (input.hasClass(this.markerClassName)) {
				return;
			}
			this._attachments(input, inst);
			input.addClass(this.markerClassName).keydown(this._doKeyDown).
				keypress(this._doKeyPress).keyup(this._doKeyUp);
			this._autoSize(inst);
			$.data(target, "datepicker", inst);
			//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
			if( inst.settings.disabled ) {
				this._disableDatepicker( target );
			}
		},
	
		
		_attachments: function(input, inst) {
			var showOn, buttonText, buttonImage,
				appendText = this._get(inst, "appendText"),
				isRTL = this._get(inst, "isRTL");
	
			if (inst.append) {
				inst.append.remove();
			}
			if (appendText) {
				inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
				input[isRTL ? "before" : "after"](inst.append);
			}
	
			input.unbind("focus", this._showDatepicker);
	
			if (inst.trigger) {
				inst.trigger.remove();
			}
	
			showOn = this._get(inst, "showOn");
			if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
				input.focus(this._showDatepicker);
			}
			if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
				buttonText = this._get(inst, "buttonText");
				buttonImage = this._get(inst, "buttonImage");
				inst.trigger = $(this._get(inst, "buttonImageOnly") ?
					$("<img/>").addClass(this._triggerClass).
						attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
					$("<button type='button'></button>").addClass(this._triggerClass).
						html(!buttonImage ? buttonText : $("<img/>").attr(
						{ src:buttonImage, alt:buttonText, title:buttonText })));
				input[isRTL ? "before" : "after"](inst.trigger);
				inst.trigger.click(function() {
					if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
						$.datepicker._hideDatepicker();
					} else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
						$.datepicker._hideDatepicker();
						$.datepicker._showDatepicker(input[0]);
					} else {
						$.datepicker._showDatepicker(input[0]);
					}
					return false;
				});
			}
		},
	
		
		_autoSize: function(inst) {
			if (this._get(inst, "autoSize") && !inst.inline) {
				var findMax, max, maxI, i,
					date = new Date(2009, 12 - 1, 20), // Ensure double digits
					dateFormat = this._get(inst, "dateFormat");
	
				if (dateFormat.match(/[DM]/)) {
					findMax = function(names) {
						max = 0;
						maxI = 0;
						for (i = 0; i < names.length; i++) {
							if (names[i].length > max) {
								max = names[i].length;
								maxI = i;
							}
						}
						return maxI;
					};
					date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
						"monthNames" : "monthNamesShort"))));
					date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
						"dayNames" : "dayNamesShort"))) + 20 - date.getDay());
				}
				inst.input.attr("size", this._formatDate(inst, date).length);
			}
		},
	
		
		_inlineDatepicker: function(target, inst) {
			var divSpan = $(target);
			if (divSpan.hasClass(this.markerClassName)) {
				return;
			}
			divSpan.addClass(this.markerClassName).append(inst.dpDiv);
			$.data(target, "datepicker", inst);
			this._setDate(inst, this._getDefaultDate(inst), true);
			this._updateDatepicker(inst);
			this._updateAlternate(inst);
			//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
			if( inst.settings.disabled ) {
				this._disableDatepicker( target );
			}
			// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
			// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
			inst.dpDiv.css( "display", "block" );
		},
	
		
		_dialogDatepicker: function(input, date, onSelect, settings, pos) {
			var id, browserWidth, browserHeight, scrollX, scrollY,
				inst = this._dialogInst; // internal instance
	
			if (!inst) {
				this.uuid += 1;
				id = "dp" + this.uuid;
				this._dialogInput = $("<input type='text' id='" + id +
					"' style='position: absolute; top: -100px; width: 0px;'/>");
				this._dialogInput.keydown(this._doKeyDown);
				$("body").append(this._dialogInput);
				inst = this._dialogInst = this._newInst(this._dialogInput, false);
				inst.settings = {};
				$.data(this._dialogInput[0], "datepicker", inst);
			}
			datepicker_extendRemove(inst.settings, settings || {});
			date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
			this._dialogInput.val(date);
	
			this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
			if (!this._pos) {
				browserWidth = document.documentElement.clientWidth;
				browserHeight = document.documentElement.clientHeight;
				scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
				scrollY = document.documentElement.scrollTop || document.body.scrollTop;
				this._pos = // should use actual width/height below
					[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
			}
	
			// move input on screen for focus, but hidden behind dialog
			this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
			inst.settings.onSelect = onSelect;
			this._inDialog = true;
			this.dpDiv.addClass(this._dialogClass);
			this._showDatepicker(this._dialogInput[0]);
			if ($.blockUI) {
				$.blockUI(this.dpDiv);
			}
			$.data(this._dialogInput[0], "datepicker", inst);
			return this;
		},
	
		
		_destroyDatepicker: function(target) {
			var nodeName,
				$target = $(target),
				inst = $.data(target, "datepicker");
	
			if (!$target.hasClass(this.markerClassName)) {
				return;
			}
	
			nodeName = target.nodeName.toLowerCase();
			$.removeData(target, "datepicker");
			if (nodeName === "input") {
				inst.append.remove();
				inst.trigger.remove();
				$target.removeClass(this.markerClassName).
					unbind("focus", this._showDatepicker).
					unbind("keydown", this._doKeyDown).
					unbind("keypress", this._doKeyPress).
					unbind("keyup", this._doKeyUp);
			} else if (nodeName === "div" || nodeName === "span") {
				$target.removeClass(this.markerClassName).empty();
			}
	
			if ( datepicker_instActive === inst ) {
				datepicker_instActive = null;
			}
		},
	
		
		_enableDatepicker: function(target) {
			var nodeName, inline,
				$target = $(target),
				inst = $.data(target, "datepicker");
	
			if (!$target.hasClass(this.markerClassName)) {
				return;
			}
	
			nodeName = target.nodeName.toLowerCase();
			if (nodeName === "input") {
				target.disabled = false;
				inst.trigger.filter("button").
					each(function() { this.disabled = false; }).end().
					filter("img").css({opacity: "1.0", cursor: ""});
			} else if (nodeName === "div" || nodeName === "span") {
				inline = $target.children("." + this._inlineClass);
				inline.children().removeClass("ui-state-disabled");
				inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
					prop("disabled", false);
			}
			this._disabledInputs = $.map(this._disabledInputs,
				function(value) { return (value === target ? null : value); }); // delete entry
		},
	
		
		_disableDatepicker: function(target) {
			var nodeName, inline,
				$target = $(target),
				inst = $.data(target, "datepicker");
	
			if (!$target.hasClass(this.markerClassName)) {
				return;
			}
	
			nodeName = target.nodeName.toLowerCase();
			if (nodeName === "input") {
				target.disabled = true;
				inst.trigger.filter("button").
					each(function() { this.disabled = true; }).end().
					filter("img").css({opacity: "0.5", cursor: "default"});
			} else if (nodeName === "div" || nodeName === "span") {
				inline = $target.children("." + this._inlineClass);
				inline.children().addClass("ui-state-disabled");
				inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
					prop("disabled", true);
			}
			this._disabledInputs = $.map(this._disabledInputs,
				function(value) { return (value === target ? null : value); }); // delete entry
			this._disabledInputs[this._disabledInputs.length] = target;
		},
	
		
		_isDisabledDatepicker: function(target) {
			if (!target) {
				return false;
			}
			for (var i = 0; i < this._disabledInputs.length; i++) {
				if (this._disabledInputs[i] === target) {
					return true;
				}
			}
			return false;
		},
	
		
		_getInst: function(target) {
			try {
				return $.data(target, "datepicker");
			}
			catch (err) {
				throw "Missing instance data for this datepicker";
			}
		},
	
		
		_optionDatepicker: function(target, name, value) {
			var settings, date, minDate, maxDate,
				inst = this._getInst(target);
	
			if (arguments.length === 2 && typeof name === "string") {
				return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
					(inst ? (name === "all" ? $.extend({}, inst.settings) :
					this._get(inst, name)) : null));
			}
	
			settings = name || {};
			if (typeof name === "string") {
				settings = {};
				settings[name] = value;
			}
	
			if (inst) {
				if (this._curInst === inst) {
					this._hideDatepicker();
				}
	
				date = this._getDateDatepicker(target, true);
				minDate = this._getMinMaxDate(inst, "min");
				maxDate = this._getMinMaxDate(inst, "max");
				datepicker_extendRemove(inst.settings, settings);
				// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
				if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
					inst.settings.minDate = this._formatDate(inst, minDate);
				}
				if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
					inst.settings.maxDate = this._formatDate(inst, maxDate);
				}
				if ( "disabled" in settings ) {
					if ( settings.disabled ) {
						this._disableDatepicker(target);
					} else {
						this._enableDatepicker(target);
					}
				}
				this._attachments($(target), inst);
				this._autoSize(inst);
				this._setDate(inst, date);
				this._updateAlternate(inst);
				this._updateDatepicker(inst);
			}
		},
	
		// change method deprecated
		_changeDatepicker: function(target, name, value) {
			this._optionDatepicker(target, name, value);
		},
	
		
		_refreshDatepicker: function(target) {
			var inst = this._getInst(target);
			if (inst) {
				this._updateDatepicker(inst);
			}
		},
	
		
		_setDateDatepicker: function(target, date) {
			var inst = this._getInst(target);
			if (inst) {
				this._setDate(inst, date);
				this._updateDatepicker(inst);
				this._updateAlternate(inst);
			}
		},
	
		
		_getDateDatepicker: function(target, noDefault) {
			var inst = this._getInst(target);
			if (inst && !inst.inline) {
				this._setDateFromField(inst, noDefault);
			}
			return (inst ? this._getDate(inst) : null);
		},
	
		
		_doKeyDown: function(event) {
			var onSelect, dateStr, sel,
				inst = $.datepicker._getInst(event.target),
				handled = true,
				isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
	
			inst._keyEvent = true;
			if ($.datepicker._datepickerShowing) {
				switch (event.keyCode) {
					case 9: $.datepicker._hideDatepicker();
							handled = false;
							break; // hide on tab out
					case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
										$.datepicker._currentClass + ")", inst.dpDiv);
							if (sel[0]) {
								$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
							}
	
							onSelect = $.datepicker._get(inst, "onSelect");
							if (onSelect) {
								dateStr = $.datepicker._formatDate(inst);
	
								// trigger custom callback
								onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
							} else {
								$.datepicker._hideDatepicker();
							}
	
							return false; // don't submit the form
					case 27: $.datepicker._hideDatepicker();
							break; // hide on escape
					case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
								-$.datepicker._get(inst, "stepBigMonths") :
								-$.datepicker._get(inst, "stepMonths")), "M");
							break; // previous month/year on page up/+ ctrl
					case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
								+$.datepicker._get(inst, "stepBigMonths") :
								+$.datepicker._get(inst, "stepMonths")), "M");
							break; // next month/year on page down/+ ctrl
					case 35: if (event.ctrlKey || event.metaKey) {
								$.datepicker._clearDate(event.target);
							}
							handled = event.ctrlKey || event.metaKey;
							break; // clear on ctrl or command +end
					case 36: if (event.ctrlKey || event.metaKey) {
								$.datepicker._gotoToday(event.target);
							}
							handled = event.ctrlKey || event.metaKey;
							break; // current on ctrl or command +home
					case 37: if (event.ctrlKey || event.metaKey) {
								$.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
							}
							handled = event.ctrlKey || event.metaKey;
							// -1 day on ctrl or command +left
							if (event.originalEvent.altKey) {
								$.datepicker._adjustDate(event.target, (event.ctrlKey ?
									-$.datepicker._get(inst, "stepBigMonths") :
									-$.datepicker._get(inst, "stepMonths")), "M");
							}
							// next month/year on alt +left on Mac
							break;
					case 38: if (event.ctrlKey || event.metaKey) {
								$.datepicker._adjustDate(event.target, -7, "D");
							}
							handled = event.ctrlKey || event.metaKey;
							break; // -1 week on ctrl or command +up
					case 39: if (event.ctrlKey || event.metaKey) {
								$.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
							}
							handled = event.ctrlKey || event.metaKey;
							// +1 day on ctrl or command +right
							if (event.originalEvent.altKey) {
								$.datepicker._adjustDate(event.target, (event.ctrlKey ?
									+$.datepicker._get(inst, "stepBigMonths") :
									+$.datepicker._get(inst, "stepMonths")), "M");
							}
							// next month/year on alt +right
							break;
					case 40: if (event.ctrlKey || event.metaKey) {
								$.datepicker._adjustDate(event.target, +7, "D");
							}
							handled = event.ctrlKey || event.metaKey;
							break; // +1 week on ctrl or command +down
					default: handled = false;
				}
			} else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
				$.datepicker._showDatepicker(this);
			} else {
				handled = false;
			}
	
			if (handled) {
				event.preventDefault();
				event.stopPropagation();
			}
		},
	
		
		_doKeyPress: function(event) {
			var chars, chr,
				inst = $.datepicker._getInst(event.target);
	
			if ($.datepicker._get(inst, "constrainInput")) {
				chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
				chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
				return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
			}
		},
	
		
		_doKeyUp: function(event) {
			var date,
				inst = $.datepicker._getInst(event.target);
	
			if (inst.input.val() !== inst.lastVal) {
				try {
					date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
						(inst.input ? inst.input.val() : null),
						$.datepicker._getFormatConfig(inst));
	
					if (date) { // only if valid
						$.datepicker._setDateFromField(inst);
						$.datepicker._updateAlternate(inst);
						$.datepicker._updateDatepicker(inst);
					}
				}
				catch (err) {
				}
			}
			return true;
		},
	
		
		_showDatepicker: function(input) {
			input = input.target || input;
			if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
				input = $("input", input.parentNode)[0];
			}
	
			if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
				return;
			}
	
			var inst, beforeShow, beforeShowSettings, isFixed,
				offset, showAnim, duration;
	
			inst = $.datepicker._getInst(input);
			if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
				$.datepicker._curInst.dpDiv.stop(true, true);
				if ( inst && $.datepicker._datepickerShowing ) {
					$.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
				}
			}
	
			beforeShow = $.datepicker._get(inst, "beforeShow");
			beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
			if(beforeShowSettings === false){
				return;
			}
			datepicker_extendRemove(inst.settings, beforeShowSettings);
	
			inst.lastVal = null;
			$.datepicker._lastInput = input;
			$.datepicker._setDateFromField(inst);
	
			if ($.datepicker._inDialog) { // hide cursor
				input.value = "";
			}
			if (!$.datepicker._pos) { // position below input
				$.datepicker._pos = $.datepicker._findPos(input);
				$.datepicker._pos[1] += input.offsetHeight; // add the height
			}
	
			isFixed = false;
			$(input).parents().each(function() {
				isFixed |= $(this).css("position") === "fixed";
				return !isFixed;
			});
			
			var minusLeftPixel = 0;
			if (location.href.indexOf("/day") != -1) {
				if (location.href.indexOf("/genre/chart/") != -1) minusLeftPixel = 200;
				else minusLeftPixel = 170;
			} else if (location.href.indexOf("/week") != -1) {
				if (location.href.indexOf("/genre/chart/") != -1) minusLeftPixel = 262;
				else minusLeftPixel = 230;
			} else if (location.href.indexOf("/maniachart/") != -1) {
				minusLeftPixel = 170;
			}
			
			offset = {left: $.datepicker._pos[0]- minusLeftPixel, top: $.datepicker._pos[1] + 20}; 
			$.datepicker._pos = null;
			//to avoid flashes on Firefox
			inst.dpDiv.empty();
			// determine sizing offscreen
			inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
			$.datepicker._updateDatepicker(inst);
			// fix width for dynamic number of date pickers
			// and adjust position before showing
			offset = $.datepicker._checkOffset(inst, offset, isFixed);
			inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
				"static" : (isFixed ? "fixed" : "absolute")), display: "none",
				left: offset.left + "px", top: offset.top + "px"});
	
			if (!inst.inline) {
				showAnim = $.datepicker._get(inst, "showAnim");
				duration = $.datepicker._get(inst, "duration");
				inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
				$.datepicker._datepickerShowing = true;
	
				if ( $.effects && $.effects.effect[ showAnim ] ) {
					inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
				} else {
					inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
				}
	
				if ( $.datepicker._shouldFocusInput( inst ) ) {
					inst.input.focus();
				}
	
				$.datepicker._curInst = inst;
				
	
			}
			isShowed = true;
		},
	
		
		_updateDatepicker: function(inst) {
			this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
			datepicker_instActive = inst; // for delegate hover events
			inst.dpDiv.empty().append(this._generateHTML(inst));
			this._attachHandlers(inst);
	
			datepicker_showBugsWeek(true);
	
			var origyearshtml,
				numMonths = this._getNumberOfMonths(inst),
				cols = numMonths[1],
				width = 17,
				activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
	
			if ( activeCell.length > 0 ) {
				datepicker_handleMouseover.apply( activeCell.get( 0 ) );
			}
	
			inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
			if (cols > 1) {
				inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
			}
			inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
				"Class"]("ui-datepicker-multi");
			inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
				"Class"]("ui-datepicker-rtl");
	
			if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
				inst.input.focus();
			}
	
			// deffered render of the years select (to avoid flashes on Firefox)
			if( inst.yearshtml ){
				origyearshtml = inst.yearshtml;
				setTimeout(function(){
					//assure that inst.yearshtml didn't change.
					if( origyearshtml === inst.yearshtml && inst.yearshtml ){
						inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
					}
					origyearshtml = inst.yearshtml = null;
				}, 0);
			}
			bugs.layerFocusNavi.add(inst.dpDiv,$('a.btnSelect'), null);
		},
	
		// #6694 - don't focus the input if it's already focused
		// this breaks the change event in IE
		// Support: IE and jQuery <1.9
		_shouldFocusInput: function( inst ) {
			return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
		},
	
		
		_checkOffset: function(inst, offset, isFixed) {
			var dpWidth = inst.dpDiv.outerWidth(),
				dpHeight = inst.dpDiv.outerHeight(),
				inputWidth = inst.input ? inst.input.outerWidth() : 0,
				inputHeight = inst.input ? inst.input.outerHeight() : 0,
				viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
				viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
	
			offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
			offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
			offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
	
			// now check if datepicker is showing outside window viewport - move to a better place if so.
			offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
				Math.abs(offset.left + dpWidth - viewWidth) : 0);
			offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
				Math.abs(dpHeight + inputHeight) : 0);
	
			return offset;
		},
	
		
		_findPos: function(obj) {
			var position,
				inst = this._getInst(obj),
				isRTL = this._get(inst, "isRTL");
	
			while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
				obj = obj[isRTL ? "previousSibling" : "nextSibling"];
			}
	
			position = $(obj).offset();
			return [position.left, position.top];
		},
	
		
		_hideDatepicker: function(input) {
			var showAnim, duration, postProcess, onClose,
				inst = this._curInst;
	
			if (!inst || (input && inst !== $.data(input, "datepicker"))) {
				return;
			}
	
			if (this._datepickerShowing) {
				showAnim = this._get(inst, "showAnim");
				duration = this._get(inst, "duration");
				postProcess = function() {
					$.datepicker._tidyDialog(inst);
				};
	
				// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
				if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
					inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
				} else {
					inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
						(showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
				}
	
				if (!showAnim) {
					postProcess();
				}
				this._datepickerShowing = false;
	
				onClose = this._get(inst, "onClose");
				if (onClose) {
					onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
				}
	
				this._lastInput = null;
				if (this._inDialog) {
					this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
					if ($.blockUI) {
						$.unblockUI();
						$("body").append(this.dpDiv);
					}
				}
				this._inDialog = false;
			}
			isShowed = false;
		},
	
		
		_tidyDialog: function(inst) {
			inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
		},
	
		
		_checkExternalClick: function(event) {
			if (!$.datepicker._curInst) {
				return;
			}
	
			var $target = $(event.target),
				inst = $.datepicker._getInst($target[0]);
	
			if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
					$target.parents("#" + $.datepicker._mainDivId).length === 0 &&
					!$target.hasClass($.datepicker.markerClassName) &&
					!$target.closest("." + $.datepicker._triggerClass).length &&
					$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
				( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
					$.datepicker._hideDatepicker();
			}
		},
	
		
		_adjustDate: function(id, offset, period) {
			var target = $(id),
				inst = this._getInst(target[0]);
	
			if (this._isDisabledDatepicker(target[0])) {
				return;
			}
			this._adjustInstDate(inst, offset +
				(period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
				period);
			this._updateDatepicker(inst);
		},
	
		
		_gotoToday: function(id) {
			var date,
				target = $(id),
				inst = this._getInst(target[0]);
	
			if (this._get(inst, "gotoCurrent") && inst.currentDay) {
				inst.selectedDay = inst.currentDay;
				inst.drawMonth = inst.selectedMonth = inst.currentMonth;
				inst.drawYear = inst.selectedYear = inst.currentYear;
			} else {
				date = new Date();
				inst.selectedDay = date.getDate();
				inst.drawMonth = inst.selectedMonth = date.getMonth();
				inst.drawYear = inst.selectedYear = date.getFullYear();
			}
			this._notifyChange(inst);
			this._adjustDate(target);
		},
	
		
		_selectMonthYear: function(id, select, period) {
			var target = $(id),
				inst = this._getInst(target[0]);
	
			inst["selected" + (period === "M" ? "Month" : "Year")] =
			inst["draw" + (period === "M" ? "Month" : "Year")] =
				parseInt(select.options[select.selectedIndex].value,10);
	
			this._notifyChange(inst);
			this._adjustDate(target);
		},
	
		
		_selectDay: function(id, month, year, td) {
			var inst,
				target = $(id);
	
			if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
				return;
			}
	
			inst = this._getInst(target[0]);
			inst.selectedDay = inst.currentDay = $("a", td).html();
			inst.selectedMonth = inst.currentMonth = month;
			inst.selectedYear = inst.currentYear = year;
			this._selectDate(id, this._formatDate(inst,
				inst.currentDay, inst.currentMonth, inst.currentYear));
		},
	
		
		_clearDate: function(id) {
			var target = $(id);
			this._selectDate(target, "");
		},
	
		
		_selectDate: function(id, dateStr) {
			var onSelect,
				target = $(id),
				inst = this._getInst(target[0]);
	
			dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
			if (inst.input) {
				inst.input.val(dateStr);
			}
			this._updateAlternate(inst);
	
			onSelect = this._get(inst, "onSelect");
			if (onSelect) {
				onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
			} else if (inst.input) {
				inst.input.trigger("change"); // fire the change event
			}
	
			if (inst.inline){
				this._updateDatepicker(inst);
			} else {
				this._hideDatepicker();
				this._lastInput = inst.input[0];
				if (typeof(inst.input[0]) !== "object") {
					inst.input.focus(); // restore focus
				}
				this._lastInput = null;
			}
		},
	
		
		_updateAlternate: function(inst) {
			var altFormat, date, dateStr,
				altField = this._get(inst, "altField");
	
			if (altField) { // update alternate field too
				altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
				date = this._getDate(inst);
				dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
				$(altField).each(function() { $(this).val(dateStr); });
			}
		},
	
		
		noWeekends: function(date) {
			var day = date.getDay();
			return [(day > 0 && day < 6), ""];
		},
	
		
		iso8601Week: function(date) {
			var time,
				checkDate = new Date(date.getTime());
	
			// Find Thursday of this week starting on Monday
			checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
	
			time = checkDate.getTime();
			checkDate.setMonth(0); // Compare with Jan 1
			checkDate.setDate(1);
			return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
		},
	
		
		parseDate: function (format, value, settings) {
			if (format == null || value == null) {
				throw "Invalid arguments";
			}
	
			value = (typeof value === "object" ? value.toString() : value + "");
			if (value === "") {
				return null;
			}
	
			var iFormat, dim, extra,
				iValue = 0,
				shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
				shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
					new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
				dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
				dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
				monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
				monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
				year = -1,
				month = -1,
				day = -1,
				doy = -1,
				literal = false,
				date,
				// Check whether a format character is doubled
				lookAhead = function(match) {
					var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
					if (matches) {
						iFormat++;
					}
					return matches;
				},
				// Extract a number from the string value
				getNumber = function(match) {
					var isDoubled = lookAhead(match),
						size = (match === "@" ? 14 : (match === "!" ? 20 :
						(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
						minSize = (match === "y" ? size : 1),
						digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
						num = value.substring(iValue).match(digits);
					if (!num) {
						throw "Missing number at position " + iValue;
					}
					iValue += num[0].length;
					return parseInt(num[0], 10);
				},
				// Extract a name from the string value and convert to an index
				getName = function(match, shortNames, longNames) {
					var index = -1,
						names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
							return [ [k, v] ];
						}).sort(function (a, b) {
							return -(a[1].length - b[1].length);
						});
	
					$.each(names, function (i, pair) {
						var name = pair[1];
						if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
							index = pair[0];
							iValue += name.length;
							return false;
						}
					});
					if (index !== -1) {
						return index + 1;
					} else {
						throw "Unknown name at position " + iValue;
					}
				},
				// Confirm that a literal character matches the string value
				checkLiteral = function() {
					if (value.charAt(iValue) !== format.charAt(iFormat)) {
						throw "Unexpected literal at position " + iValue;
					}
					iValue++;
				};
	
			for (iFormat = 0; iFormat < format.length; iFormat++) {
				if (literal) {
					if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
						literal = false;
					} else {
						checkLiteral();
					}
				} else {
					switch (format.charAt(iFormat)) {
						case "d":
							day = getNumber("d");
							break;
						case "D":
							getName("D", dayNamesShort, dayNames);
							break;
						case "o":
							doy = getNumber("o");
							break;
						case "m":
							month = getNumber("m");
							break;
						case "M":
							month = getName("M", monthNamesShort, monthNames);
							break;
						case "y":
							year = getNumber("y");
							break;
						case "@":
							date = new Date(getNumber("@"));
							year = date.getFullYear();
							month = date.getMonth() + 1;
							day = date.getDate();
							break;
						case "!":
							date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
							year = date.getFullYear();
							month = date.getMonth() + 1;
							day = date.getDate();
							break;
						case "'":
							if (lookAhead("'")){
								checkLiteral();
							} else {
								literal = true;
							}
							break;
						default:
							checkLiteral();
					}
				}
			}
	
			if (iValue < value.length){
				extra = value.substr(iValue);
				if (!/^\s+/.test(extra)) {
					throw "Extra/unparsed characters found in date: " + extra;
				}
			}
	
			if (year === -1) {
				year = new Date().getFullYear();
			} else if (year < 100) {
				year += new Date().getFullYear() - new Date().getFullYear() % 100 +
					(year <= shortYearCutoff ? 0 : -100);
			}
	
			if (doy > -1) {
				month = 1;
				day = doy;
				do {
					dim = this._getDaysInMonth(year, month - 1);
					if (day <= dim) {
						break;
					}
					month++;
					day -= dim;
				} while (true);
			}
	
			date = this._daylightSavingAdjust(new Date(year, month - 1, day));
			if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
				throw "Invalid date"; // E.g. 31/02/00
			}
			return date;
		},
	
		
		ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
		COOKIE: "D, dd M yy",
		ISO_8601: "yy-mm-dd",
		RFC_822: "D, d M y",
		RFC_850: "DD, dd-M-y",
		RFC_1036: "D, d M y",
		RFC_1123: "D, d M yy",
		RFC_2822: "D, d M yy",
		RSS: "D, d M y", // RFC 822
		TICKS: "!",
		TIMESTAMP: "@",
		W3C: "yy-mm-dd", // ISO 8601
	
		_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
			Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
	
		
		formatDate: function (format, date, settings) {
			if (!date) {
				return "";
			}
	
			var iFormat,
				dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
				dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
				monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
				monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
				// Check whether a format character is doubled
				lookAhead = function(match) {
					var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
					if (matches) {
						iFormat++;
					}
					return matches;
				},
				// Format a number, with leading zero if necessary
				formatNumber = function(match, value, len) {
					var num = "" + value;
					if (lookAhead(match)) {
						while (num.length < len) {
							num = "0" + num;
						}
					}
					return num;
				},
				// Format a name, short or long as requested
				formatName = function(match, value, shortNames, longNames) {
					return (lookAhead(match) ? longNames[value] : shortNames[value]);
				},
				output = "",
				literal = false;
	
			if (date) {
				for (iFormat = 0; iFormat < format.length; iFormat++) {
					if (literal) {
						if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
							literal = false;
						} else {
							output += format.charAt(iFormat);
						}
					} else {
						switch (format.charAt(iFormat)) {
							case "d":
								output += formatNumber("d", date.getDate(), 2);
								break;
							case "D":
								output += formatName("D", date.getDay(), dayNamesShort, dayNames);
								break;
							case "o":
								output += formatNumber("o",
									Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
								break;
							case "m":
								output += formatNumber("m", date.getMonth() + 1, 2);
								break;
							case "M":
								output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
								break;
							case "y":
								output += (lookAhead("y") ? date.getFullYear() :
									(date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
								break;
							case "@":
								output += date.getTime();
								break;
							case "!":
								output += date.getTime() * 10000 + this._ticksTo1970;
								break;
							case "'":
								if (lookAhead("'")) {
									output += "'";
								} else {
									literal = true;
								}
								break;
							default:
								output += format.charAt(iFormat);
						}
					}
				}
			}
			return output;
		},
	
		
		_possibleChars: function (format) {
			var iFormat,
				chars = "",
				literal = false,
				// Check whether a format character is doubled
				lookAhead = function(match) {
					var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
					if (matches) {
						iFormat++;
					}
					return matches;
				};
	
			for (iFormat = 0; iFormat < format.length; iFormat++) {
				if (literal) {
					if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
						literal = false;
					} else {
						chars += format.charAt(iFormat);
					}
				} else {
					switch (format.charAt(iFormat)) {
						case "d": case "m": case "y": case "@":
							chars += "0123456789";
							break;
						case "D": case "M":
							return null; // Accept anything
						case "'":
							if (lookAhead("'")) {
								chars += "'";
							} else {
								literal = true;
							}
							break;
						default:
							chars += format.charAt(iFormat);
					}
				}
			}
			return chars;
		},
	
		
		_get: function(inst, name) {
			return inst.settings[name] !== undefined ?
				inst.settings[name] : this._defaults[name];
		},
	
		
		_setDateFromField: function(inst, noDefault) {
			if (inst.input.val() === inst.lastVal) {
				return;
			}
	
			var dateFormat = this._get(inst, "dateFormat"),
				dates = inst.lastVal = inst.input ? inst.input.val() : null,
				defaultDate = this._getDefaultDate(inst),
				date = defaultDate,
				settings = this._getFormatConfig(inst);
	
			try {
				date = this.parseDate(dateFormat, dates, settings) || defaultDate;
			} catch (event) {
				dates = (noDefault ? "" : dates);
			}
			inst.selectedDay = date.getDate();
			inst.drawMonth = inst.selectedMonth = date.getMonth();
			inst.drawYear = inst.selectedYear = date.getFullYear();
			inst.currentDay = (dates ? date.getDate() : 0);
			inst.currentMonth = (dates ? date.getMonth() : 0);
			inst.currentYear = (dates ? date.getFullYear() : 0);
			this._adjustInstDate(inst);
		},
	
		
		_getDefaultDate: function(inst) {
			return this._restrictMinMax(inst,
				this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
		},
	
		
		_determineDate: function(inst, date, defaultDate) {
			var offsetNumeric = function(offset) {
					var date = new Date();
					date.setDate(date.getDate() + offset);
					return date;
				},
				offsetString = function(offset) {
					try {
						return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
							offset, $.datepicker._getFormatConfig(inst));
					}
					catch (e) {
						// Ignore
					}
	
					var date = (offset.toLowerCase().match(/^c/) ?
						$.datepicker._getDate(inst) : null) || new Date(),
						year = date.getFullYear(),
						month = date.getMonth(),
						day = date.getDate(),
						pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
						matches = pattern.exec(offset);
	
					while (matches) {
						switch (matches[2] || "d") {
							case "d" : case "D" :
								day += parseInt(matches[1],10); break;
							case "w" : case "W" :
								day += parseInt(matches[1],10) * 7; break;
							case "m" : case "M" :
								month += parseInt(matches[1],10);
								day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
								break;
							case "y": case "Y" :
								year += parseInt(matches[1],10);
								day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
								break;
						}
						matches = pattern.exec(offset);
					}
					return new Date(year, month, day);
				},
				newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
					(typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
	
			newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
			if (newDate) {
				newDate.setHours(0);
				newDate.setMinutes(0);
				newDate.setSeconds(0);
				newDate.setMilliseconds(0);
			}
			return this._daylightSavingAdjust(newDate);
		},
	
		
		_daylightSavingAdjust: function(date) {
			if (!date) {
				return null;
			}
			date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
			return date;
		},
	
		
		_setDate: function(inst, date, noChange) {
			var clear = !date,
				origMonth = inst.selectedMonth,
				origYear = inst.selectedYear,
				newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
	
			inst.selectedDay = inst.currentDay = newDate.getDate();
			inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
			inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
			if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
				this._notifyChange(inst);
			}
			this._adjustInstDate(inst);
			if (inst.input) {
				inst.input.val(clear ? "" : this._formatDate(inst));
			}
		},
	
		
		_getDate: function(inst) {
			var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
				this._daylightSavingAdjust(new Date(
				inst.currentYear, inst.currentMonth, inst.currentDay)));
				return startDate;
		},
	
		
		_attachHandlers: function(inst) {
			var stepMonths = this._get(inst, "stepMonths"),
				id = "#" + inst.id.replace( /\\\\/g, "\\" );
			inst.dpDiv.find("[data-handler]").map(function () {
				var handler = {
					prev: function () {
						$.datepicker._adjustDate(id, -stepMonths, "M");
					},
					next: function () {
						$.datepicker._adjustDate(id, +stepMonths, "M");
					},
					hide: function () {
						$.datepicker._hideDatepicker();
					},
					today: function () {
						$.datepicker._gotoToday(id);
					},
					selectDay: function () {
						$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
						return false;
					},
					selectMonth: function () {
						$.datepicker._selectMonthYear(id, this, "M");
						return false;
					},
					selectYear: function () {
						$.datepicker._selectMonthYear(id, this, "Y");
						return false;
					}
				};
				$(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
			});
		},
	
		
		_generateHTML: function(inst) {
			var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
				controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
				monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
				selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
				cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
				printDate, dRow, tbody, daySettings, otherMonth, unselectable,
				tempDate = new Date(),
				today = this._daylightSavingAdjust(
					new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
				isRTL = this._get(inst, "isRTL"),
				showButtonPanel = this._get(inst, "showButtonPanel"),
				hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
				navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
				numMonths = this._getNumberOfMonths(inst),
				showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
				stepMonths = this._get(inst, "stepMonths"),
				isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
				currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
					new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
				minDate = this._getMinMaxDate(inst, "min"),
				maxDate = this._getMinMaxDate(inst, "max"),
				currentPeriodStartDate = this._get(inst, "currentPeriodStartDate"),
				currentPeriodEndDate = this._get(inst, "currentPeriodEndDate"),
				drawMonth = inst.drawMonth - showCurrentAtPos,
				drawYear = inst.drawYear;
	
			if (drawMonth < 0) {
				drawMonth += 12;
				drawYear--;
			}
			if (maxDate) {
				maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
					maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
				maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
				while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
					drawMonth--;
					if (drawMonth < 0) {
						drawMonth = 11;
						drawYear--;
					}
				}
			}
			inst.drawMonth = drawMonth;
			inst.drawYear = drawYear;
	
			prevText = this._get(inst, "prevText");
			prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
				this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
				this._getFormatConfig(inst)));
	
			prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
				"<a href='javascript:void(0);' class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
				" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
				(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>"));
	
			nextText = this._get(inst, "nextText");
			nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
				this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
				this._getFormatConfig(inst)));
	
			next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
				"<a href='javascript:void(0);' class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
				" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
				(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>"));
	
			currentText = this._get(inst, "currentText");
			gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
			currentText = (!navigationAsDateFormat ? currentText :
				this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
	
			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'>" +
				this._get(inst, "closeText") + "</button>" : "");
	
			buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
				(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'" +
				">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
	
			firstDay = parseInt(this._get(inst, "firstDay"),10);
			firstDay = (isNaN(firstDay) ? 0 : firstDay);
	
			showWeek = this._get(inst, "showWeek");
			dayNames = this._get(inst, "dayNames");
			dayNamesMin = this._get(inst, "dayNamesMin");
			monthNames = this._get(inst, "monthNames");
			monthNamesShort = this._get(inst, "monthNamesShort");
			beforeShowDay = this._get(inst, "beforeShowDay");
			showOtherMonths = this._get(inst, "showOtherMonths");
			selectOtherMonths = this._get(inst, "selectOtherMonths");
			defaultDate = this._getDefaultDate(inst);
			 html = "<div class='box-shadow'></div>";
			dow;
			for (row = 0; row < numMonths[0]; row++) {
				group = "";
				this.maxRows = 4;
				for (col = 0; col < numMonths[1]; col++) {
					selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
					cornerClass = " ui-corner-all";
					calender = "";
					if (isMultiMonth) {
						calender += "<div class='ui-datepicker-group";
						if (numMonths[1] > 1) {
							switch (col) {
								case 0: calender += " ui-datepicker-group-first";
									cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
								case numMonths[1]-1: calender += " ui-datepicker-group-last";
									cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
								default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
							}
						}
						calender += "'>";
					}
					calender += "<div class='ui-datepicker-header ui-helper-clearfix" + cornerClass + "'>" +
						(/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
						(/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
						this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
						row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
						"</div><table class=''><thead>" +
						"<tr>";
					thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
					for (dow = 0; dow < 7; dow++) { // days of the week
						day = (dow + firstDay) % 7;
						thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
							"<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
					}
					calender += thead + "</tr></thead><tbody>";
					daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
					if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
						inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
					}
					leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
					curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
					numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
					this.maxRows = numRows;
					printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
					
					
					for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
						calender += "<tr>";
						tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
							this._get(inst, "calculateWeek")(printDate) + "</td>");
						for (dow = 0; dow < 7; dow++) { // create date picker days
							daySettings = (beforeShowDay ?
								beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
							otherMonth = (printDate.getMonth() !== drawMonth);
							unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
								(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
							isInCurrentPeriod = (currentPeriodStartDate && printDate.getTime() >= currentPeriodStartDate.getTime()) && (currentPeriodEndDate && printDate.getTime() <= currentPeriodEndDate.getTime());
							
							tbody += "<td class='" +
								((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
								(otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
								((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
								(defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
								// or defaultDate is current printedDate and defaultDate is selectedDate
								" " + this._dayOverClass : "") + // highlight selected day
								(unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") +  // highlight unselectable days
								(otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
								(printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
								(printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
								((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
								(unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
								(otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
								(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
								//(printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
								(isInCurrentPeriod ? " ui-state-active" : "") +
								(printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
								(otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
								"' href='javascript:void(0);'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
							printDate.setDate(printDate.getDate() + 1);
							printDate = this._daylightSavingAdjust(printDate);
						}
						calender += tbody + "</tr>";
					}
					drawMonth++;
					if (drawMonth > 11) {
						drawMonth = 0;
						drawYear++;
					}
					calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
								((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
					group += calender;
				}
				html += group;
			}
			html += buttonPanel;
			inst._keyEvent = false;
			return html;
		},
	
		
		_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
				secondary, monthNames, monthNamesShort) {
	
			var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
				changeMonth = this._get(inst, "changeMonth"),
				changeYear = this._get(inst, "changeYear"),
				showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
				html = "<div class='ui-datepicker-title'>",
				monthHtml = "";
	
			// month selection
			if (secondary || !changeMonth) {
				monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
			} else {
				inMinYear = (minDate && minDate.getFullYear() === drawYear);
				inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
				monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
				for ( month = 0; month < 12; month++) {
					if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
						monthHtml += "<option value='" + month + "'" +
							(month === drawMonth ? " selected='selected'" : "") +
							">" + monthNamesShort[month] + "</option>";
					}
				}
				monthHtml += "</select>";
			}
	
			if (!showMonthAfterYear) {
				html += monthHtml + (secondary || !(changeMonth && changeYear) ? "" : "");
			}
	
			// year selection
			if ( !inst.yearshtml ) {
				inst.yearshtml = "";
				if (secondary || !changeYear) {
					html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
				} else {
					// determine range of years to display
					years = this._get(inst, "yearRange").split(":");
					thisYear = new Date().getFullYear();
					determineYear = function(value) {
						var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
							(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
							parseInt(value, 10)));
						return (isNaN(year) ? thisYear : year);
					};
					year = determineYear(years[0]);
					endYear = Math.max(year, determineYear(years[1] || ""));
					year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
					endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
					inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
					for (; year <= endYear; year++) {
						inst.yearshtml += "<option value='" + year + "'" +
							(year === drawYear ? " selected='selected'" : "") +
							">" + year + "</option>";
					}
					inst.yearshtml += "</select>";
	
					html += inst.yearshtml;
					inst.yearshtml = null;
				}
			}
	
			html += this._get(inst, "yearSuffix");
			if (showMonthAfterYear) {
				html += (secondary || !(changeMonth && changeYear) ? "" : "") + "." + monthHtml;
			}
			html += "</div>"; // Close datepicker_header
			return html;
		},
	
		
		_adjustInstDate: function(inst, offset, period) {
			var year = inst.drawYear + (period === "Y" ? offset : 0),
				month = inst.drawMonth + (period === "M" ? offset : 0),
				day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
				date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
	
			inst.selectedDay = date.getDate();
			inst.drawMonth = inst.selectedMonth = date.getMonth();
			inst.drawYear = inst.selectedYear = date.getFullYear();
			if (period === "M" || period === "Y") {
				this._notifyChange(inst);
			}
		},
	
		
		_restrictMinMax: function(inst, date) {
			var minDate = this._getMinMaxDate(inst, "min"),
				maxDate = this._getMinMaxDate(inst, "max"),
				newDate = (minDate && date < minDate ? minDate : date);
			return (maxDate && newDate > maxDate ? maxDate : newDate);
		},
	
		
		_notifyChange: function(inst) {
			var onChange = this._get(inst, "onChangeMonthYear");
			if (onChange) {
				onChange.apply((inst.input ? inst.input[0] : null),
					[inst.selectedYear, inst.selectedMonth + 1, inst]);
			}
		},
	
		
		_getNumberOfMonths: function(inst) {
			var numMonths = this._get(inst, "numberOfMonths");
			return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
		},
	
		
		_getMinMaxDate: function(inst, minMax) {
			return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
		},
	
		
		_getDaysInMonth: function(year, month) {
			return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
		},
	
		
		_getFirstDayOfMonth: function(year, month) {
			return new Date(year, month, 1).getDay();
		},
	
		
		_canAdjustMonth: function(inst, offset, curYear, curMonth) {
			var numMonths = this._getNumberOfMonths(inst),
				date = this._daylightSavingAdjust(new Date(curYear,
				curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
	
			if (offset < 0) {
				date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
			}
			return this._isInRange(inst, date);
		},
	
		
		_isInRange: function(inst, date) {
			var yearSplit, currentYear,
				minDate = this._getMinMaxDate(inst, "min"),
				maxDate = this._getMinMaxDate(inst, "max"),
				minYear = null,
				maxYear = null,
				years = this._get(inst, "yearRange");
				if (years){
					yearSplit = years.split(":");
					currentYear = new Date().getFullYear();
					minYear = parseInt(yearSplit[0], 10);
					maxYear = parseInt(yearSplit[1], 10);
					if ( yearSplit[0].match(/[+\-].*/) ) {
						minYear += currentYear;
					}
					if ( yearSplit[1].match(/[+\-].*/) ) {
						maxYear += currentYear;
					}
				}
	
			return ((!minDate || date.getTime() >= minDate.getTime()) &&
				(!maxDate || date.getTime() <= maxDate.getTime()) &&
				(!minYear || date.getFullYear() >= minYear) &&
				(!maxYear || date.getFullYear() <= maxYear));
		},
	
		
		_getFormatConfig: function(inst) {
			var shortYearCutoff = this._get(inst, "shortYearCutoff");
			shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
				new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
			return {shortYearCutoff: shortYearCutoff,
				dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
				monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
		},
	
		
		_formatDate: function(inst, day, month, year) {
			if (!day) {
				inst.currentDay = inst.selectedDay;
				inst.currentMonth = inst.selectedMonth;
				inst.currentYear = inst.selectedYear;
			}
			var date = (day ? (typeof day === "object" ? day :
				this._daylightSavingAdjust(new Date(year, month, day))) :
				this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
			return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
		}
	});
	
	
	function datepicker_bindHover(dpDiv) {
		var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
		return dpDiv.delegate(selector, "mouseout", function() {
				$(this).removeClass("ui-state-hover");
				if (this.className.indexOf("ui-datepicker-prev") !== -1) {
					$(this).removeClass("ui-datepicker-prev-hover");
				}
				if (this.className.indexOf("ui-datepicker-next") !== -1) {
					$(this).removeClass("ui-datepicker-next-hover");
				}
				
				if(datepicker_instActive.settings.bugsWeek){
					//$(this).closest("tr").css("border", "");
					datepicker_showBugsWeek(false, $(this));
				}
			})
			.delegate( selector, "mouseover", datepicker_handleMouseover );
	}
	
	function datepicker_handleMouseover() {
	
		if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
			$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
			$(this).addClass("ui-state-hover");
			if (this.className.indexOf("ui-datepicker-prev") !== -1) {
				$(this).addClass("ui-datepicker-prev-hover");
			}
			if (this.className.indexOf("ui-datepicker-next") !== -1) {
				$(this).addClass("ui-datepicker-next-hover");
			}
		}
		
		if(datepicker_instActive.settings.bugsWeek){
			//$(this).closest("tr").css("border", "solid 1px red");
			datepicker_showBugsWeek(true, $(this));
		}
	
	}
	
	
	function datepicker_extendRemove(target, props) {
		$.extend(target, props);
		for (var name in props) {
			if (props[name] == null) {
				target[name] = props[name];
			}
		}
		return target;
	}
	
	function datepicker_showBugsWeek(isShow, target){
		if(!datepicker_instActive.settings.bugsWeek)
			return;
		
		var cTarget = target || $("." + $.datepicker._currentClass);
		
		var inAllDay = cTarget.closest("tbody").find("td");
		if(inAllDay.data("originStyle") == null){
			var originStyle = {
				"background-color":inAllDay.css("background-color")
			};
			inAllDay.data("originStyle", originStyle);
		}
	
		inAllDay.css(inAllDay.data("originStyle"));
		
		if(isShow){
			var inLineDay = cTarget.closest("tr").find("td");
			var overCss = {
				"background-color":"orange"	
			};
			inLineDay.css(overCss);
		}
	}
	
	
	$.fn.datepicker = function(options){
	
		
		if ( !this.length ) {
			return this;
		}
	
		
		if (!$.datepicker.initialized) {
			$(document).mousedown($.datepicker._checkExternalClick);
			$.datepicker.initialized = true;
		}
	
		
		if ($("#"+$.datepicker._mainDivId).length === 0) {
			$("body").append($.datepicker.dpDiv);
		}
	
		var otherArgs = Array.prototype.slice.call(arguments, 1);
		if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
			return $.datepicker["_" + options + "Datepicker"].
				apply($.datepicker, [this[0]].concat(otherArgs));
		}
		if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
			return $.datepicker["_" + options + "Datepicker"].
				apply($.datepicker, [this[0]].concat(otherArgs));
		}
		return this.each(function() {
			typeof options === "string" ?
				$.datepicker["_" + options + "Datepicker"].
					apply($.datepicker, [this].concat(otherArgs)) :
				$.datepicker._attachDatepicker(this, options);
		});
	};
	
	$.datepicker = new Datepicker(); // singleton instance
	$.datepicker.initialized = false;
	$.datepicker.uuid = new Date().getTime();
	$.datepicker.version = "1.11.4";
	
	var datepicker = $.datepicker;
	
	
	
	
	
	$.widget("ui.draggable", $.ui.mouse, {
		version: "1.11.4",
		widgetEventPrefix: "drag",
		options: {
			addClasses: true,
			appendTo: "parent",
			axis: false,
			connectToSortable: false,
			containment: false,
			cursor: "auto",
			cursorAt: false,
			grid: false,
			handle: false,
			helper: "original",
			iframeFix: false,
			opacity: false,
			refreshPositions: false,
			revert: false,
			revertDuration: 500,
			scope: "default",
			scroll: true,
			scrollSensitivity: 20,
			scrollSpeed: 20,
			snap: false,
			snapMode: "both",
			snapTolerance: 20,
			stack: false,
			zIndex: false,
	
			// callbacks
			drag: null,
			start: null,
			stop: null
		},
		_create: function() {
	
			if ( this.options.helper === "original" ) {
				this._setPositionRelative();
			}
			if (this.options.addClasses){
				this.element.addClass("ui-draggable");
			}
			if (this.options.disabled){
				this.element.addClass("ui-draggable-disabled");
			}
			this._setHandleClassName();
	
			this._mouseInit();
		},
	
		_setOption: function( key, value ) {
			this._super( key, value );
			if ( key === "handle" ) {
				this._removeHandleClassName();
				this._setHandleClassName();
			}
		},
	
		_destroy: function() {
			if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
				this.destroyOnClear = true;
				return;
			}
			this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
			this._removeHandleClassName();
			this._mouseDestroy();
		},
	
		_mouseCapture: function(event) {
			var o = this.options;
	
			this._blurActiveElement( event );
	
			// among others, prevent a drag on a resizable-handle
			if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
				return false;
			}
	
			//Quit if we're not on a valid handle
			this.handle = this._getHandle(event);
			if (!this.handle) {
				return false;
			}
	
			this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
	
			return true;
	
		},
	
		_blockFrames: function( selector ) {
			this.iframeBlocks = this.document.find( selector ).map(function() {
				var iframe = $( this );
	
				return $( "<div>" )
					.css( "position", "absolute" )
					.appendTo( iframe.parent() )
					.outerWidth( iframe.outerWidth() )
					.outerHeight( iframe.outerHeight() )
					.offset( iframe.offset() )[ 0 ];
			});
		},
	
		_unblockFrames: function() {
			if ( this.iframeBlocks ) {
				this.iframeBlocks.remove();
				delete this.iframeBlocks;
			}
		},
	
		_blurActiveElement: function( event ) {
			var document = this.document[ 0 ];
	
			// Only need to blur if the event occurred on the draggable itself, see #10527
			if ( !this.handleElement.is( event.target ) ) {
				return;
			}
	
			// support: IE9
			// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
			try {
	
				// Support: IE9, IE10
				// If the <body> is blurred, IE will switch windows, see #9520
				if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
	
					// Blur any element that currently has focus, see #4261
					$( document.activeElement ).blur();
				}
			} catch ( error ) {}
		},
	
		_mouseStart: function(event) {
	
			var o = this.options;
	
			//Create and append the visible helper
			this.helper = this._createHelper(event);
	
			this.helper.addClass("ui-draggable-dragging");
	
			//Cache the helper size
			this._cacheHelperProportions();
	
			//If ddmanager is used for droppables, set the global draggable
			if ($.ui.ddmanager) {
				$.ui.ddmanager.current = this;
			}
	
			
	
			//Cache the margins of the original element
			this._cacheMargins();
	
			//Store the helper's css position
			this.cssPosition = this.helper.css( "position" );
			this.scrollParent = this.helper.scrollParent( true );
			this.offsetParent = this.helper.offsetParent();
			this.hasFixedAncestor = this.helper.parents().filter(function() {
					return $( this ).css( "position" ) === "fixed";
				}).length > 0;
	
			//The element's absolute position on the page minus margins
			this.positionAbs = this.element.offset();
			this._refreshOffsets( event );
	
			//Generate the original position
			this.originalPosition = this.position = this._generatePosition( event, false );
			this.originalPageX = event.pageX;
			this.originalPageY = event.pageY;
	
			//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
			(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
	
			//Set a containment if given in the options
			this._setContainment();
	
			//Trigger event + callbacks
			if (this._trigger("start", event) === false) {
				this._clear();
				return false;
			}
	
			//Recache the helper size
			this._cacheHelperProportions();
	
			//Prepare the droppable offsets
			if ($.ui.ddmanager && !o.dropBehaviour) {
				$.ui.ddmanager.prepareOffsets(this, event);
			}
	
			// Reset helper's right/bottom css if they're set and set explicit width/height instead
			// as this prevents resizing of elements with right/bottom set (see #7772)
			this._normalizeRightBottom();
	
			this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
	
			//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
			if ( $.ui.ddmanager ) {
				$.ui.ddmanager.dragStart(this, event);
			}
	
			return true;
		},
	
		_refreshOffsets: function( event ) {
			this.offset = {
				top: this.positionAbs.top - this.margins.top,
				left: this.positionAbs.left - this.margins.left,
				scroll: false,
				parent: this._getParentOffset(),
				relative: this._getRelativeOffset()
			};
	
			this.offset.click = {
				left: event.pageX - this.offset.left,
				top: event.pageY - this.offset.top
			};
		},
	
		_mouseDrag: function(event, noPropagation) {
			// reset any necessary cached properties (see #5009)
			if ( this.hasFixedAncestor ) {
				this.offset.parent = this._getParentOffset();
			}
	
			//Compute the helpers position
			this.position = this._generatePosition( event, true );
			this.positionAbs = this._convertPositionTo("absolute");
	
			//Call plugins and callbacks and use the resulting position if something is returned
			if (!noPropagation) {
				var ui = this._uiHash();
				if (this._trigger("drag", event, ui) === false) {
					this._mouseUp({});
					return false;
				}
				this.position = ui.position;
			}
	
			this.helper[ 0 ].style.left = this.position.left + "px";
			this.helper[ 0 ].style.top = this.position.top + "px";
	
			if ($.ui.ddmanager) {
				$.ui.ddmanager.drag(this, event);
			}
	
			return false;
		},
	
		_mouseStop: function(event) {
	
			//If we are using droppables, inform the manager about the drop
			var that = this,
				dropped = false;
			if ($.ui.ddmanager && !this.options.dropBehaviour) {
				dropped = $.ui.ddmanager.drop(this, event);
			}
	
			//if a drop comes from outside (a sortable)
			if (this.dropped) {
				dropped = this.dropped;
				this.dropped = false;
			}
	
			if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
				$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
					if (that._trigger("stop", event) !== false) {
						that._clear();
					}
				});
			} else {
				if (this._trigger("stop", event) !== false) {
					this._clear();
				}
			}
	
			return false;
		},
	
		_mouseUp: function( event ) {
			this._unblockFrames();
	
			//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
			if ( $.ui.ddmanager ) {
				$.ui.ddmanager.dragStop(this, event);
			}
	
			// Only need to focus if the event occurred on the draggable itself, see #10527
			if ( this.handleElement.is( event.target ) ) {
				// The interaction is over; whether or not the click resulted in a drag, focus the element
				this.element.focus();
			}
	
			return $.ui.mouse.prototype._mouseUp.call(this, event);
		},
	
		cancel: function() {
	
			if (this.helper.is(".ui-draggable-dragging")) {
				this._mouseUp({});
			} else {
				this._clear();
			}
	
			return this;
	
		},
	
		_getHandle: function(event) {
			return this.options.handle ?
				!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
				true;
		},
	
		_setHandleClassName: function() {
			this.handleElement = this.options.handle ?
				this.element.find( this.options.handle ) : this.element;
			this.handleElement.addClass( "ui-draggable-handle" );
		},
	
		_removeHandleClassName: function() {
			this.handleElement.removeClass( "ui-draggable-handle" );
		},
	
		_createHelper: function(event) {
	
			var o = this.options,
				helperIsFunction = $.isFunction( o.helper ),
				helper = helperIsFunction ?
					$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
					( o.helper === "clone" ?
						this.element.clone().removeAttr( "id" ) :
						this.element );
	
			if (!helper.parents("body").length) {
				helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
			}
	
			// http://bugs.jqueryui.com/ticket/9446
			// a helper function can return the original element
			// which wouldn't have been set to relative in _create
			if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
				this._setPositionRelative();
			}
	
			if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
				helper.css("position", "absolute");
			}
	
			return helper;
	
		},
	
		_setPositionRelative: function() {
			if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
				this.element[ 0 ].style.position = "relative";
			}
		},
	
		_adjustOffsetFromHelper: function(obj) {
			if (typeof obj === "string") {
				obj = obj.split(" ");
			}
			if ($.isArray(obj)) {
				obj = { left: +obj[0], top: +obj[1] || 0 };
			}
			if ("left" in obj) {
				this.offset.click.left = obj.left + this.margins.left;
			}
			if ("right" in obj) {
				this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
			}
			if ("top" in obj) {
				this.offset.click.top = obj.top + this.margins.top;
			}
			if ("bottom" in obj) {
				this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
			}
		},
	
		_isRootNode: function( element ) {
			return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
		},
	
		_getParentOffset: function() {
	
			//Get the offsetParent and cache its position
			var po = this.offsetParent.offset(),
				document = this.document[ 0 ];
	
			// This is a special case where we need to modify a offset calculated on start, since the following happened:
			// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
			// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
			//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
			if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
				po.left += this.scrollParent.scrollLeft();
				po.top += this.scrollParent.scrollTop();
			}
	
			if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
				po = { top: 0, left: 0 };
			}
	
			return {
				top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
				left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
			};
	
		},
	
		_getRelativeOffset: function() {
			if ( this.cssPosition !== "relative" ) {
				return { top: 0, left: 0 };
			}
	
			var p = this.element.position(),
				scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
	
			return {
				top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
				left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
			};
	
		},
	
		_cacheMargins: function() {
			this.margins = {
				left: (parseInt(this.element.css("marginLeft"), 10) || 0),
				top: (parseInt(this.element.css("marginTop"), 10) || 0),
				right: (parseInt(this.element.css("marginRight"), 10) || 0),
				bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
			};
		},
	
		_cacheHelperProportions: function() {
			this.helperProportions = {
				width: this.helper.outerWidth(),
				height: this.helper.outerHeight()
			};
		},
	
		_setContainment: function() {
	
			var isUserScrollable, c, ce,
				o = this.options,
				document = this.document[ 0 ];
	
			this.relativeContainer = null;
	
			if ( !o.containment ) {
				this.containment = null;
				return;
			}
	
			if ( o.containment === "window" ) {
				this.containment = [
					$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
					$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
					$( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
					$( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
				];
				return;
			}
	
			if ( o.containment === "document") {
				this.containment = [
					0,
					0,
					$( document ).width() - this.helperProportions.width - this.margins.left,
					( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
				];
				return;
			}
	
			if ( o.containment.constructor === Array ) {
				this.containment = o.containment;
				return;
			}
	
			if ( o.containment === "parent" ) {
				o.containment = this.helper[ 0 ].parentNode;
			}
	
			c = $( o.containment );
			ce = c[ 0 ];
	
			if ( !ce ) {
				return;
			}
	
			isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
	
			this.containment = [
				( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
				( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
				( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
					( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
					( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
					this.helperProportions.width -
					this.margins.left -
					this.margins.right,
				( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
					( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
					( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
					this.helperProportions.height -
					this.margins.top -
					this.margins.bottom
			];
			this.relativeContainer = c;
		},
	
		_convertPositionTo: function(d, pos) {
	
			if (!pos) {
				pos = this.position;
			}
	
			var mod = d === "absolute" ? 1 : -1,
				scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
	
			return {
				top: (
					pos.top	+																// The absolute mouse position
					this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.parent.top * mod -										// The offsetParent's offset without borders (offset + border)
					( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
				),
				left: (
					pos.left +																// The absolute mouse position
					this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
					( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
				)
			};
	
		},
	
		_generatePosition: function( event, constrainPosition ) {
	
			var containment, co, top, left,
				o = this.options,
				scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
				pageX = event.pageX,
				pageY = event.pageY;
	
			// Cache the scroll
			if ( !scrollIsRootNode || !this.offset.scroll ) {
				this.offset.scroll = {
					top: this.scrollParent.scrollTop(),
					left: this.scrollParent.scrollLeft()
				};
			}
	
			
	
			// If we are not dragging yet, we won't check for options
			if ( constrainPosition ) {
				if ( this.containment ) {
					if ( this.relativeContainer ){
						co = this.relativeContainer.offset();
						containment = [
							this.containment[ 0 ] + co.left,
							this.containment[ 1 ] + co.top,
							this.containment[ 2 ] + co.left,
							this.containment[ 3 ] + co.top
						];
					} else {
						containment = this.containment;
					}
	
					if (event.pageX - this.offset.click.left < containment[0]) {
						pageX = containment[0] + this.offset.click.left;
					}
					if (event.pageY - this.offset.click.top < containment[1]) {
						pageY = containment[1] + this.offset.click.top;
					}
					if (event.pageX - this.offset.click.left > containment[2]) {
						pageX = containment[2] + this.offset.click.left;
					}
					if (event.pageY - this.offset.click.top > containment[3]) {
						pageY = containment[3] + this.offset.click.top;
					}
				}
	
				if (o.grid) {
					//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
					top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
					pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
	
					left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
					pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
				}
	
				if ( o.axis === "y" ) {
					pageX = this.originalPageX;
				}
	
				if ( o.axis === "x" ) {
					pageY = this.originalPageY;
				}
			}
	
			return {
				top: (
					pageY -																	// The absolute mouse position
					this.offset.click.top	-												// Click offset (relative to the element)
					this.offset.relative.top -												// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
					( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
				),
				left: (
					pageX -																	// The absolute mouse position
					this.offset.click.left -												// Click offset (relative to the element)
					this.offset.relative.left -												// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
					( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
				)
			};
	
		},
	
		_clear: function() {
			this.helper.removeClass("ui-draggable-dragging");
			if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
				this.helper.remove();
			}
			this.helper = null;
			this.cancelHelperRemoval = false;
			if ( this.destroyOnClear ) {
				this.destroy();
			}
		},
	
		_normalizeRightBottom: function() {
			if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
				this.helper.width( this.helper.width() );
				this.helper.css( "right", "auto" );
			}
			if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
				this.helper.height( this.helper.height() );
				this.helper.css( "bottom", "auto" );
			}
		},
	
		// From now on bulk stuff - mainly helpers
	
		_trigger: function( type, event, ui ) {
			ui = ui || this._uiHash();
			$.ui.plugin.call( this, type, [ event, ui, this ], true );
	
			// Absolute position and offset (see #6884 ) have to be recalculated after plugins
			if ( /^(drag|start|stop)/.test( type ) ) {
				this.positionAbs = this._convertPositionTo( "absolute" );
				ui.offset = this.positionAbs;
			}
			return $.Widget.prototype._trigger.call( this, type, event, ui );
		},
	
		plugins: {},
	
		_uiHash: function() {
			return {
				helper: this.helper,
				position: this.position,
				originalPosition: this.originalPosition,
				offset: this.positionAbs
			};
		}
	
	});
	
	$.ui.plugin.add( "draggable", "connectToSortable", {
		start: function( event, ui, draggable ) {
			var uiSortable = $.extend( {}, ui, {
				item: draggable.element
			});
	
			draggable.sortables = [];
			$( draggable.options.connectToSortable ).each(function() {
				var sortable = $( this ).sortable( "instance" );
	
				if ( sortable && !sortable.options.disabled ) {
					draggable.sortables.push( sortable );
	
					// refreshPositions is called at drag start to refresh the containerCache
					// which is used in drag. This ensures it's initialized and synchronized
					// with any changes that might have happened on the page since initialization.
					sortable.refreshPositions();
					sortable._trigger("activate", event, uiSortable);
				}
			});
		},
		stop: function( event, ui, draggable ) {
			var uiSortable = $.extend( {}, ui, {
				item: draggable.element
			});
	
			draggable.cancelHelperRemoval = false;
	
			$.each( draggable.sortables, function() {
				var sortable = this;
	
				if ( sortable.isOver ) {
					sortable.isOver = 0;
	
					// Allow this sortable to handle removing the helper
					draggable.cancelHelperRemoval = true;
					sortable.cancelHelperRemoval = false;
	
					// Use _storedCSS To restore properties in the sortable,
					// as this also handles revert (#9675) since the draggable
					// may have modified them in unexpected ways (#8809)
					sortable._storedCSS = {
						position: sortable.placeholder.css( "position" ),
						top: sortable.placeholder.css( "top" ),
						left: sortable.placeholder.css( "left" )
					};
	
					sortable._mouseStop(event);
	
					// Once drag has ended, the sortable should return to using
					// its original helper, not the shared helper from draggable
					sortable.options.helper = sortable.options._helper;
				} else {
					// Prevent this Sortable from removing the helper.
					// However, don't set the draggable to remove the helper
					// either as another connected Sortable may yet handle the removal.
					sortable.cancelHelperRemoval = true;
	
					sortable._trigger( "deactivate", event, uiSortable );
				}
			});
		},
		drag: function( event, ui, draggable ) {
			$.each( draggable.sortables, function() {
				var innermostIntersecting = false,
					sortable = this;
	
				// Copy over variables that sortable's _intersectsWith uses
				sortable.positionAbs = draggable.positionAbs;
				sortable.helperProportions = draggable.helperProportions;
				sortable.offset.click = draggable.offset.click;
	
				if ( sortable._intersectsWith( sortable.containerCache ) ) {
					innermostIntersecting = true;
	
					$.each( draggable.sortables, function() {
						// Copy over variables that sortable's _intersectsWith uses
						this.positionAbs = draggable.positionAbs;
						this.helperProportions = draggable.helperProportions;
						this.offset.click = draggable.offset.click;
	
						if ( this !== sortable &&
								this._intersectsWith( this.containerCache ) &&
								$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
							innermostIntersecting = false;
						}
	
						return innermostIntersecting;
					});
				}
	
				if ( innermostIntersecting ) {
					// If it intersects, we use a little isOver variable and set it once,
					// so that the move-in stuff gets fired only once.
					if ( !sortable.isOver ) {
						sortable.isOver = 1;
	
						// Store draggable's parent in case we need to reappend to it later.
						draggable._parent = ui.helper.parent();
	
						sortable.currentItem = ui.helper
							.appendTo( sortable.element )
							.data( "ui-sortable-item", true );
	
						// Store helper option to later restore it
						sortable.options._helper = sortable.options.helper;
	
						sortable.options.helper = function() {
							return ui.helper[ 0 ];
						};
	
						// Fire the start events of the sortable with our passed browser event,
						// and our own helper (so it doesn't create a new one)
						event.target = sortable.currentItem[ 0 ];
						sortable._mouseCapture( event, true );
						sortable._mouseStart( event, true, true );
	
						// Because the browser event is way off the new appended portlet,
						// modify necessary variables to reflect the changes
						sortable.offset.click.top = draggable.offset.click.top;
						sortable.offset.click.left = draggable.offset.click.left;
						sortable.offset.parent.left -= draggable.offset.parent.left -
							sortable.offset.parent.left;
						sortable.offset.parent.top -= draggable.offset.parent.top -
							sortable.offset.parent.top;
	
						draggable._trigger( "toSortable", event );
	
						// Inform draggable that the helper is in a valid drop zone,
						// used solely in the revert option to handle "valid/invalid".
						draggable.dropped = sortable.element;
	
						// Need to refreshPositions of all sortables in the case that
						// adding to one sortable changes the location of the other sortables (#9675)
						$.each( draggable.sortables, function() {
							this.refreshPositions();
						});
	
						// hack so receive/update callbacks work (mostly)
						draggable.currentItem = draggable.element;
						sortable.fromOutside = draggable;
					}
	
					if ( sortable.currentItem ) {
						sortable._mouseDrag( event );
						// Copy the sortable's position because the draggable's can potentially reflect
						// a relative position, while sortable is always absolute, which the dragged
						// element has now become. (#8809)
						ui.position = sortable.position;
					}
				} else {
					// If it doesn't intersect with the sortable, and it intersected before,
					// we fake the drag stop of the sortable, but make sure it doesn't remove
					// the helper by using cancelHelperRemoval.
					if ( sortable.isOver ) {
	
						sortable.isOver = 0;
						sortable.cancelHelperRemoval = true;
	
						// Calling sortable's mouseStop would trigger a revert,
						// so revert must be temporarily false until after mouseStop is called.
						sortable.options._revert = sortable.options.revert;
						sortable.options.revert = false;
	
						sortable._trigger( "out", event, sortable._uiHash( sortable ) );
						sortable._mouseStop( event, true );
	
						// restore sortable behaviors that were modfied
						// when the draggable entered the sortable area (#9481)
						sortable.options.revert = sortable.options._revert;
						sortable.options.helper = sortable.options._helper;
	
						if ( sortable.placeholder ) {
							sortable.placeholder.remove();
						}
	
						// Restore and recalculate the draggable's offset considering the sortable
						// may have modified them in unexpected ways. (#8809, #10669)
						ui.helper.appendTo( draggable._parent );
						draggable._refreshOffsets( event );
						ui.position = draggable._generatePosition( event, true );
	
						draggable._trigger( "fromSortable", event );
	
						// Inform draggable that the helper is no longer in a valid drop zone
						draggable.dropped = false;
	
						// Need to refreshPositions of all sortables just in case removing
						// from one sortable changes the location of other sortables (#9675)
						$.each( draggable.sortables, function() {
							this.refreshPositions();
						});
					}
				}
			});
		}
	});
	
	$.ui.plugin.add("draggable", "cursor", {
		start: function( event, ui, instance ) {
			var t = $( "body" ),
				o = instance.options;
	
			if (t.css("cursor")) {
				o._cursor = t.css("cursor");
			}
			t.css("cursor", o.cursor);
		},
		stop: function( event, ui, instance ) {
			var o = instance.options;
			if (o._cursor) {
				$("body").css("cursor", o._cursor);
			}
		}
	});
	
	$.ui.plugin.add("draggable", "opacity", {
		start: function( event, ui, instance ) {
			var t = $( ui.helper ),
				o = instance.options;
			if (t.css("opacity")) {
				o._opacity = t.css("opacity");
			}
			t.css("opacity", o.opacity);
		},
		stop: function( event, ui, instance ) {
			var o = instance.options;
			if (o._opacity) {
				$(ui.helper).css("opacity", o._opacity);
			}
		}
	});
	
	$.ui.plugin.add("draggable", "scroll", {
		start: function( event, ui, i ) {
			if ( !i.scrollParentNotHidden ) {
				i.scrollParentNotHidden = i.helper.scrollParent( false );
			}
	
			if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
				i.overflowOffset = i.scrollParentNotHidden.offset();
			}
		},
		drag: function( event, ui, i  ) {
	
			var o = i.options,
				scrolled = false,
				scrollParent = i.scrollParentNotHidden[ 0 ],
				document = i.document[ 0 ];
	
			if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
				if ( !o.axis || o.axis !== "x" ) {
					if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
						scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
					} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
						scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
					}
				}
	
				if ( !o.axis || o.axis !== "y" ) {
					if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
						scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
					} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
						scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
					}
				}
	
			} else {
	
				if (!o.axis || o.axis !== "x") {
					if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
						scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
					} else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
						scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
					}
				}
	
				if (!o.axis || o.axis !== "y") {
					if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
						scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
					} else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
						scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
					}
				}
	
			}
	
			if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
				$.ui.ddmanager.prepareOffsets(i, event);
			}
	
		}
	});
	
	$.ui.plugin.add("draggable", "snap", {
		start: function( event, ui, i ) {
	
			var o = i.options;
	
			i.snapElements = [];
	
			$(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
				var $t = $(this),
					$o = $t.offset();
				if (this !== i.element[0]) {
					i.snapElements.push({
						item: this,
						width: $t.outerWidth(), height: $t.outerHeight(),
						top: $o.top, left: $o.left
					});
				}
			});
	
		},
		drag: function( event, ui, inst ) {
	
			var ts, bs, ls, rs, l, r, t, b, i, first,
				o = inst.options,
				d = o.snapTolerance,
				x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
				y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
	
			for (i = inst.snapElements.length - 1; i >= 0; i--){
	
				l = inst.snapElements[i].left - inst.margins.left;
				r = l + inst.snapElements[i].width;
				t = inst.snapElements[i].top - inst.margins.top;
				b = t + inst.snapElements[i].height;
	
				if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
					if (inst.snapElements[i].snapping) {
						(inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
					}
					inst.snapElements[i].snapping = false;
					continue;
				}
	
				if (o.snapMode !== "inner") {
					ts = Math.abs(t - y2) <= d;
					bs = Math.abs(b - y1) <= d;
					ls = Math.abs(l - x2) <= d;
					rs = Math.abs(r - x1) <= d;
					if (ts) {
						ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
					}
					if (bs) {
						ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
					}
					if (ls) {
						ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
					}
					if (rs) {
						ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
					}
				}
	
				first = (ts || bs || ls || rs);
	
				if (o.snapMode !== "outer") {
					ts = Math.abs(t - y1) <= d;
					bs = Math.abs(b - y2) <= d;
					ls = Math.abs(l - x1) <= d;
					rs = Math.abs(r - x2) <= d;
					if (ts) {
						ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
					}
					if (bs) {
						ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
					}
					if (ls) {
						ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
					}
					if (rs) {
						ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
					}
				}
	
				if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
					(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
				}
				inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
	
			}
	
		}
	});
	
	$.ui.plugin.add("draggable", "stack", {
		start: function( event, ui, instance ) {
			var min,
				o = instance.options,
				group = $.makeArray($(o.stack)).sort(function(a, b) {
					return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
				});
	
			if (!group.length) { return; }
	
			min = parseInt($(group[0]).css("zIndex"), 10) || 0;
			$(group).each(function(i) {
				$(this).css("zIndex", min + i);
			});
			this.css("zIndex", (min + group.length));
		}
	});
	
	$.ui.plugin.add("draggable", "zIndex", {
		start: function( event, ui, instance ) {
			var t = $( ui.helper ),
				o = instance.options;
	
			if (t.css("zIndex")) {
				o._zIndex = t.css("zIndex");
			}
			t.css("zIndex", o.zIndex);
		},
		stop: function( event, ui, instance ) {
			var o = instance.options;
	
			if (o._zIndex) {
				$(ui.helper).css("zIndex", o._zIndex);
			}
		}
	});
	
	var draggable = $.ui.draggable;
	
	
	
	
	
	$.widget("ui.resizable", $.ui.mouse, {
		version: "1.11.4",
		widgetEventPrefix: "resize",
		options: {
			alsoResize: false,
			animate: false,
			animateDuration: "slow",
			animateEasing: "swing",
			aspectRatio: false,
			autoHide: false,
			containment: false,
			ghost: false,
			grid: false,
			handles: "e,s,se",
			helper: false,
			maxHeight: null,
			maxWidth: null,
			minHeight: 10,
			minWidth: 10,
			// See #7960
			zIndex: 90,
	
			// callbacks
			resize: null,
			start: null,
			stop: null
		},
	
		_num: function( value ) {
			return parseInt( value, 10 ) || 0;
		},
	
		_isNumber: function( value ) {
			return !isNaN( parseInt( value, 10 ) );
		},
	
		_hasScroll: function( el, a ) {
	
			if ( $( el ).css( "overflow" ) === "hidden") {
				return false;
			}
	
			var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
				has = false;
	
			if ( el[ scroll ] > 0 ) {
				return true;
			}
	
			// TODO: determine which cases actually cause this to happen
			// if the element doesn't have the scroll set, see if it's possible to
			// set the scroll
			el[ scroll ] = 1;
			has = ( el[ scroll ] > 0 );
			el[ scroll ] = 0;
			return has;
		},
	
		_create: function() {
	
			var n, i, handle, axis, hname,
				that = this,
				o = this.options;
			this.element.addClass("ui-resizable");
	
			$.extend(this, {
				_aspectRatio: !!(o.aspectRatio),
				aspectRatio: o.aspectRatio,
				originalElement: this.element,
				_proportionallyResizeElements: [],
				_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
			});
	
			// Wrap the element if it cannot hold child nodes
			if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
	
				this.element.wrap(
					$("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
						position: this.element.css("position"),
						width: this.element.outerWidth(),
						height: this.element.outerHeight(),
						top: this.element.css("top"),
						left: this.element.css("left")
					})
				);
	
				this.element = this.element.parent().data(
					"ui-resizable", this.element.resizable( "instance" )
				);
	
				this.elementIsWrapper = true;
	
				this.element.css({
					marginLeft: this.originalElement.css("marginLeft"),
					marginTop: this.originalElement.css("marginTop"),
					marginRight: this.originalElement.css("marginRight"),
					marginBottom: this.originalElement.css("marginBottom")
				});
				this.originalElement.css({
					marginLeft: 0,
					marginTop: 0,
					marginRight: 0,
					marginBottom: 0
				});
				// support: Safari
				// Prevent Safari textarea resize
				this.originalResizeStyle = this.originalElement.css("resize");
				this.originalElement.css("resize", "none");
	
				this._proportionallyResizeElements.push( this.originalElement.css({
					position: "static",
					zoom: 1,
					display: "block"
				}) );
	
				// support: IE9
				// avoid IE jump (hard set the margin)
				this.originalElement.css({ margin: this.originalElement.css("margin") });
	
				this._proportionallyResize();
			}
	
			this.handles = o.handles ||
				( !$(".ui-resizable-handle", this.element).length ?
					"e,s,se" : {
						n: ".ui-resizable-n",
						e: ".ui-resizable-e",
						s: ".ui-resizable-s",
						w: ".ui-resizable-w",
						se: ".ui-resizable-se",
						sw: ".ui-resizable-sw",
						ne: ".ui-resizable-ne",
						nw: ".ui-resizable-nw"
					} );
	
			this._handles = $();
			if ( this.handles.constructor === String ) {
	
				if ( this.handles === "all") {
					this.handles = "n,e,s,w,se,sw,ne,nw";
				}
	
				n = this.handles.split(",");
				this.handles = {};
	
				for (i = 0; i < n.length; i++) {
	
					handle = $.trim(n[i]);
					hname = "ui-resizable-" + handle;
					axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
	
					axis.css({ zIndex: o.zIndex });
	
					// TODO : What's going on here?
					if ("se" === handle) {
						axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
					}
	
					this.handles[handle] = ".ui-resizable-" + handle;
					this.element.append(axis);
				}
	
			}
	
			this._renderAxis = function(target) {
	
				var i, axis, padPos, padWrapper;
	
				target = target || this.element;
	
				for (i in this.handles) {
	
					if (this.handles[i].constructor === String) {
						this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
					} else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
						this.handles[ i ] = $( this.handles[ i ] );
						this._on( this.handles[ i ], { "mousedown": that._mouseDown });
					}
	
					if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
	
						axis = $(this.handles[i], this.element);
	
						padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
	
						padPos = [ "padding",
							/ne|nw|n/.test(i) ? "Top" :
							/se|sw|s/.test(i) ? "Bottom" :
							/^e$/.test(i) ? "Right" : "Left" ].join("");
	
						target.css(padPos, padWrapper);
	
						this._proportionallyResize();
					}
	
					this._handles = this._handles.add( this.handles[ i ] );
				}
			};
	
			// TODO: make renderAxis a prototype function
			this._renderAxis(this.element);
	
			this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
			this._handles.disableSelection();
	
			this._handles.mouseover(function() {
				if (!that.resizing) {
					if (this.className) {
						axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
					}
					that.axis = axis && axis[1] ? axis[1] : "se";
				}
			});
	
			if (o.autoHide) {
				this._handles.hide();
				$(this.element)
					.addClass("ui-resizable-autohide")
					.mouseenter(function() {
						if (o.disabled) {
							return;
						}
						$(this).removeClass("ui-resizable-autohide");
						that._handles.show();
					})
					.mouseleave(function() {
						if (o.disabled) {
							return;
						}
						if (!that.resizing) {
							$(this).addClass("ui-resizable-autohide");
							that._handles.hide();
						}
					});
			}
	
			this._mouseInit();
		},
	
		_destroy: function() {
	
			this._mouseDestroy();
	
			var wrapper,
				_destroy = function(exp) {
					$(exp)
						.removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
						.removeData("resizable")
						.removeData("ui-resizable")
						.unbind(".resizable")
						.find(".ui-resizable-handle")
							.remove();
				};
	
			// TODO: Unwrap at same DOM position
			if (this.elementIsWrapper) {
				_destroy(this.element);
				wrapper = this.element;
				this.originalElement.css({
					position: wrapper.css("position"),
					width: wrapper.outerWidth(),
					height: wrapper.outerHeight(),
					top: wrapper.css("top"),
					left: wrapper.css("left")
				}).insertAfter( wrapper );
				wrapper.remove();
			}
	
			this.originalElement.css("resize", this.originalResizeStyle);
			_destroy(this.originalElement);
	
			return this;
		},
	
		_mouseCapture: function(event) {
			var i, handle,
				capture = false;
	
			for (i in this.handles) {
				handle = $(this.handles[i])[0];
				if (handle === event.target || $.contains(handle, event.target)) {
					capture = true;
				}
			}
	
			return !this.options.disabled && capture;
		},
	
		_mouseStart: function(event) {
	
			var curleft, curtop, cursor,
				o = this.options,
				el = this.element;
	
			this.resizing = true;
	
			this._renderProxy();
	
			curleft = this._num(this.helper.css("left"));
			curtop = this._num(this.helper.css("top"));
	
			if (o.containment) {
				curleft += $(o.containment).scrollLeft() || 0;
				curtop += $(o.containment).scrollTop() || 0;
			}
	
			this.offset = this.helper.offset();
			this.position = { left: curleft, top: curtop };
	
			this.size = this._helper ? {
					width: this.helper.width(),
					height: this.helper.height()
				} : {
					width: el.width(),
					height: el.height()
				};
	
			this.originalSize = this._helper ? {
					width: el.outerWidth(),
					height: el.outerHeight()
				} : {
					width: el.width(),
					height: el.height()
				};
	
			this.sizeDiff = {
				width: el.outerWidth() - el.width(),
				height: el.outerHeight() - el.height()
			};
	
			this.originalPosition = { left: curleft, top: curtop };
			this.originalMousePosition = { left: event.pageX, top: event.pageY };
	
			this.aspectRatio = (typeof o.aspectRatio === "number") ?
				o.aspectRatio :
				((this.originalSize.width / this.originalSize.height) || 1);
	
			cursor = $(".ui-resizable-" + this.axis).css("cursor");
			$("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
	
			el.addClass("ui-resizable-resizing");
			this._propagate("start", event);
			return true;
		},
	
		_mouseDrag: function(event) {
	
			var data, props,
				smp = this.originalMousePosition,
				a = this.axis,
				dx = (event.pageX - smp.left) || 0,
				dy = (event.pageY - smp.top) || 0,
				trigger = this._change[a];
	
			this._updatePrevProperties();
	
			if (!trigger) {
				return false;
			}
	
			data = trigger.apply(this, [ event, dx, dy ]);
	
			this._updateVirtualBoundaries(event.shiftKey);
			if (this._aspectRatio || event.shiftKey) {
				data = this._updateRatio(data, event);
			}
	
			data = this._respectSize(data, event);
	
			this._updateCache(data);
	
			this._propagate("resize", event);
	
			props = this._applyChanges();
	
			if ( !this._helper && this._proportionallyResizeElements.length ) {
				this._proportionallyResize();
			}
	
			if ( !$.isEmptyObject( props ) ) {
				this._updatePrevProperties();
				this._trigger( "resize", event, this.ui() );
				this._applyChanges();
			}
	
			return false;
		},
	
		_mouseStop: function(event) {
	
			this.resizing = false;
			var pr, ista, soffseth, soffsetw, s, left, top,
				o = this.options, that = this;
	
			if (this._helper) {
	
				pr = this._proportionallyResizeElements;
				ista = pr.length && (/textarea/i).test(pr[0].nodeName);
				soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
				soffsetw = ista ? 0 : that.sizeDiff.width;
	
				s = {
					width: (that.helper.width()  - soffsetw),
					height: (that.helper.height() - soffseth)
				};
				left = (parseInt(that.element.css("left"), 10) +
					(that.position.left - that.originalPosition.left)) || null;
				top = (parseInt(that.element.css("top"), 10) +
					(that.position.top - that.originalPosition.top)) || null;
	
				if (!o.animate) {
					this.element.css($.extend(s, { top: top, left: left }));
				}
	
				that.helper.height(that.size.height);
				that.helper.width(that.size.width);
	
				if (this._helper && !o.animate) {
					this._proportionallyResize();
				}
			}
	
			$("body").css("cursor", "auto");
	
			this.element.removeClass("ui-resizable-resizing");
	
			this._propagate("stop", event);
	
			if (this._helper) {
				this.helper.remove();
			}
	
			return false;
	
		},
	
		_updatePrevProperties: function() {
			this.prevPosition = {
				top: this.position.top,
				left: this.position.left
			};
			this.prevSize = {
				width: this.size.width,
				height: this.size.height
			};
		},
	
		_applyChanges: function() {
			var props = {};
	
			if ( this.position.top !== this.prevPosition.top ) {
				props.top = this.position.top + "px";
			}
			if ( this.position.left !== this.prevPosition.left ) {
				props.left = this.position.left + "px";
			}
			if ( this.size.width !== this.prevSize.width ) {
				props.width = this.size.width + "px";
			}
			if ( this.size.height !== this.prevSize.height ) {
				props.height = this.size.height + "px";
			}
	
			this.helper.css( props );
	
			return props;
		},
	
		_updateVirtualBoundaries: function(forceAspectRatio) {
			var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
				o = this.options;
	
			b = {
				minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
				maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
				minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
				maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
			};
	
			if (this._aspectRatio || forceAspectRatio) {
				pMinWidth = b.minHeight * this.aspectRatio;
				pMinHeight = b.minWidth / this.aspectRatio;
				pMaxWidth = b.maxHeight * this.aspectRatio;
				pMaxHeight = b.maxWidth / this.aspectRatio;
	
				if (pMinWidth > b.minWidth) {
					b.minWidth = pMinWidth;
				}
				if (pMinHeight > b.minHeight) {
					b.minHeight = pMinHeight;
				}
				if (pMaxWidth < b.maxWidth) {
					b.maxWidth = pMaxWidth;
				}
				if (pMaxHeight < b.maxHeight) {
					b.maxHeight = pMaxHeight;
				}
			}
			this._vBoundaries = b;
		},
	
		_updateCache: function(data) {
			this.offset = this.helper.offset();
			if (this._isNumber(data.left)) {
				this.position.left = data.left;
			}
			if (this._isNumber(data.top)) {
				this.position.top = data.top;
			}
			if (this._isNumber(data.height)) {
				this.size.height = data.height;
			}
			if (this._isNumber(data.width)) {
				this.size.width = data.width;
			}
		},
	
		_updateRatio: function( data ) {
	
			var cpos = this.position,
				csize = this.size,
				a = this.axis;
	
			if (this._isNumber(data.height)) {
				data.width = (data.height * this.aspectRatio);
			} else if (this._isNumber(data.width)) {
				data.height = (data.width / this.aspectRatio);
			}
	
			if (a === "sw") {
				data.left = cpos.left + (csize.width - data.width);
				data.top = null;
			}
			if (a === "nw") {
				data.top = cpos.top + (csize.height - data.height);
				data.left = cpos.left + (csize.width - data.width);
			}
	
			return data;
		},
	
		_respectSize: function( data ) {
	
			var o = this._vBoundaries,
				a = this.axis,
				ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width),
				ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
				isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width),
				isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
				dw = this.originalPosition.left + this.originalSize.width,
				dh = this.position.top + this.size.height,
				cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
			if (isminw) {
				data.width = o.minWidth;
			}
			if (isminh) {
				data.height = o.minHeight;
			}
			if (ismaxw) {
				data.width = o.maxWidth;
			}
			if (ismaxh) {
				data.height = o.maxHeight;
			}
	
			if (isminw && cw) {
				data.left = dw - o.minWidth;
			}
			if (ismaxw && cw) {
				data.left = dw - o.maxWidth;
			}
			if (isminh && ch) {
				data.top = dh - o.minHeight;
			}
			if (ismaxh && ch) {
				data.top = dh - o.maxHeight;
			}
	
			// Fixing jump error on top/left - bug #2330
			if (!data.width && !data.height && !data.left && data.top) {
				data.top = null;
			} else if (!data.width && !data.height && !data.top && data.left) {
				data.left = null;
			}
	
			return data;
		},
	
		_getPaddingPlusBorderDimensions: function( element ) {
			var i = 0,
				widths = [],
				borders = [
					element.css( "borderTopWidth" ),
					element.css( "borderRightWidth" ),
					element.css( "borderBottomWidth" ),
					element.css( "borderLeftWidth" )
				],
				paddings = [
					element.css( "paddingTop" ),
					element.css( "paddingRight" ),
					element.css( "paddingBottom" ),
					element.css( "paddingLeft" )
				];
	
			for ( ; i < 4; i++ ) {
				widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 );
				widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 );
			}
	
			return {
				height: widths[ 0 ] + widths[ 2 ],
				width: widths[ 1 ] + widths[ 3 ]
			};
		},
	
		_proportionallyResize: function() {
	
			if (!this._proportionallyResizeElements.length) {
				return;
			}
	
			var prel,
				i = 0,
				element = this.helper || this.element;
	
			for ( ; i < this._proportionallyResizeElements.length; i++) {
	
				prel = this._proportionallyResizeElements[i];
	
				// TODO: Seems like a bug to cache this.outerDimensions
				// considering that we are in a loop.
				if (!this.outerDimensions) {
					this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
				}
	
				prel.css({
					height: (element.height() - this.outerDimensions.height) || 0,
					width: (element.width() - this.outerDimensions.width) || 0
				});
	
			}
	
		},
	
		_renderProxy: function() {
	
			var el = this.element, o = this.options;
			this.elementOffset = el.offset();
	
			if (this._helper) {
	
				this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
	
				this.helper.addClass(this._helper).css({
					width: this.element.outerWidth() - 1,
					height: this.element.outerHeight() - 1,
					position: "absolute",
					left: this.elementOffset.left + "px",
					top: this.elementOffset.top + "px",
					zIndex: ++o.zIndex //TODO: Don't modify option
				});
	
				this.helper
					.appendTo("body")
					.disableSelection();
	
			} else {
				this.helper = this.element;
			}
	
		},
	
		_change: {
			e: function(event, dx) {
				return { width: this.originalSize.width + dx };
			},
			w: function(event, dx) {
				var cs = this.originalSize, sp = this.originalPosition;
				return { left: sp.left + dx, width: cs.width - dx };
			},
			n: function(event, dx, dy) {
				var cs = this.originalSize, sp = this.originalPosition;
				return { top: sp.top + dy, height: cs.height - dy };
			},
			s: function(event, dx, dy) {
				return { height: this.originalSize.height + dy };
			},
			se: function(event, dx, dy) {
				return $.extend(this._change.s.apply(this, arguments),
					this._change.e.apply(this, [ event, dx, dy ]));
			},
			sw: function(event, dx, dy) {
				return $.extend(this._change.s.apply(this, arguments),
					this._change.w.apply(this, [ event, dx, dy ]));
			},
			ne: function(event, dx, dy) {
				return $.extend(this._change.n.apply(this, arguments),
					this._change.e.apply(this, [ event, dx, dy ]));
			},
			nw: function(event, dx, dy) {
				return $.extend(this._change.n.apply(this, arguments),
					this._change.w.apply(this, [ event, dx, dy ]));
			}
		},
	
		_propagate: function(n, event) {
			$.ui.plugin.call(this, n, [ event, this.ui() ]);
			(n !== "resize" && this._trigger(n, event, this.ui()));
		},
	
		plugins: {},
	
		ui: function() {
			return {
				originalElement: this.originalElement,
				element: this.element,
				helper: this.helper,
				position: this.position,
				size: this.size,
				originalSize: this.originalSize,
				originalPosition: this.originalPosition
			};
		}
	
	});
	
	
	
	$.ui.plugin.add("resizable", "animate", {
	
		stop: function( event ) {
			var that = $(this).resizable( "instance" ),
				o = that.options,
				pr = that._proportionallyResizeElements,
				ista = pr.length && (/textarea/i).test(pr[0].nodeName),
				soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
				soffsetw = ista ? 0 : that.sizeDiff.width,
				style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
				left = (parseInt(that.element.css("left"), 10) +
					(that.position.left - that.originalPosition.left)) || null,
				top = (parseInt(that.element.css("top"), 10) +
					(that.position.top - that.originalPosition.top)) || null;
	
			that.element.animate(
				$.extend(style, top && left ? { top: top, left: left } : {}), {
					duration: o.animateDuration,
					easing: o.animateEasing,
					step: function() {
	
						var data = {
							width: parseInt(that.element.css("width"), 10),
							height: parseInt(that.element.css("height"), 10),
							top: parseInt(that.element.css("top"), 10),
							left: parseInt(that.element.css("left"), 10)
						};
	
						if (pr && pr.length) {
							$(pr[0]).css({ width: data.width, height: data.height });
						}
	
						// propagating resize, and updating values for each animation step
						that._updateCache(data);
						that._propagate("resize", event);
	
					}
				}
			);
		}
	
	});
	
	$.ui.plugin.add( "resizable", "containment", {
	
		start: function() {
			var element, p, co, ch, cw, width, height,
				that = $( this ).resizable( "instance" ),
				o = that.options,
				el = that.element,
				oc = o.containment,
				ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
	
			if ( !ce ) {
				return;
			}
	
			that.containerElement = $( ce );
	
			if ( /document/.test( oc ) || oc === document ) {
				that.containerOffset = {
					left: 0,
					top: 0
				};
				that.containerPosition = {
					left: 0,
					top: 0
				};
	
				that.parentData = {
					element: $( document ),
					left: 0,
					top: 0,
					width: $( document ).width(),
					height: $( document ).height() || document.body.parentNode.scrollHeight
				};
			} else {
				element = $( ce );
				p = [];
				$([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
					p[ i ] = that._num( element.css( "padding" + name ) );
				});
	
				that.containerOffset = element.offset();
				that.containerPosition = element.position();
				that.containerSize = {
					height: ( element.innerHeight() - p[ 3 ] ),
					width: ( element.innerWidth() - p[ 1 ] )
				};
	
				co = that.containerOffset;
				ch = that.containerSize.height;
				cw = that.containerSize.width;
				width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
				height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
	
				that.parentData = {
					element: ce,
					left: co.left,
					top: co.top,
					width: width,
					height: height
				};
			}
		},
	
		resize: function( event ) {
			var woset, hoset, isParent, isOffsetRelative,
				that = $( this ).resizable( "instance" ),
				o = that.options,
				co = that.containerOffset,
				cp = that.position,
				pRatio = that._aspectRatio || event.shiftKey,
				cop = {
					top: 0,
					left: 0
				},
				ce = that.containerElement,
				continueResize = true;
	
			if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
				cop = co;
			}
	
			if ( cp.left < ( that._helper ? co.left : 0 ) ) {
				that.size.width = that.size.width +
					( that._helper ?
						( that.position.left - co.left ) :
						( that.position.left - cop.left ) );
	
				if ( pRatio ) {
					that.size.height = that.size.width / that.aspectRatio;
					continueResize = false;
				}
				that.position.left = o.helper ? co.left : 0;
			}
	
			if ( cp.top < ( that._helper ? co.top : 0 ) ) {
				that.size.height = that.size.height +
					( that._helper ?
						( that.position.top - co.top ) :
						that.position.top );
	
				if ( pRatio ) {
					that.size.width = that.size.height * that.aspectRatio;
					continueResize = false;
				}
				that.position.top = that._helper ? co.top : 0;
			}
	
			isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
			isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
	
			if ( isParent && isOffsetRelative ) {
				that.offset.left = that.parentData.left + that.position.left;
				that.offset.top = that.parentData.top + that.position.top;
			} else {
				that.offset.left = that.element.offset().left;
				that.offset.top = that.element.offset().top;
			}
	
			woset = Math.abs( that.sizeDiff.width +
				(that._helper ?
					that.offset.left - cop.left :
					(that.offset.left - co.left)) );
	
			hoset = Math.abs( that.sizeDiff.height +
				(that._helper ?
					that.offset.top - cop.top :
					(that.offset.top - co.top)) );
	
			if ( woset + that.size.width >= that.parentData.width ) {
				that.size.width = that.parentData.width - woset;
				if ( pRatio ) {
					that.size.height = that.size.width / that.aspectRatio;
					continueResize = false;
				}
			}
	
			if ( hoset + that.size.height >= that.parentData.height ) {
				that.size.height = that.parentData.height - hoset;
				if ( pRatio ) {
					that.size.width = that.size.height * that.aspectRatio;
					continueResize = false;
				}
			}
	
			if ( !continueResize ) {
				that.position.left = that.prevPosition.left;
				that.position.top = that.prevPosition.top;
				that.size.width = that.prevSize.width;
				that.size.height = that.prevSize.height;
			}
		},
	
		stop: function() {
			var that = $( this ).resizable( "instance" ),
				o = that.options,
				co = that.containerOffset,
				cop = that.containerPosition,
				ce = that.containerElement,
				helper = $( that.helper ),
				ho = helper.offset(),
				w = helper.outerWidth() - that.sizeDiff.width,
				h = helper.outerHeight() - that.sizeDiff.height;
	
			if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
				$( this ).css({
					left: ho.left - cop.left - co.left,
					width: w,
					height: h
				});
			}
	
			if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
				$( this ).css({
					left: ho.left - cop.left - co.left,
					width: w,
					height: h
				});
			}
		}
	});
	
	$.ui.plugin.add("resizable", "alsoResize", {
	
		start: function() {
			var that = $(this).resizable( "instance" ),
				o = that.options;
	
			$(o.alsoResize).each(function() {
				var el = $(this);
				el.data("ui-resizable-alsoresize", {
					width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
					left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
				});
			});
		},
	
		resize: function(event, ui) {
			var that = $(this).resizable( "instance" ),
				o = that.options,
				os = that.originalSize,
				op = that.originalPosition,
				delta = {
					height: (that.size.height - os.height) || 0,
					width: (that.size.width - os.width) || 0,
					top: (that.position.top - op.top) || 0,
					left: (that.position.left - op.left) || 0
				};
	
				$(o.alsoResize).each(function() {
					var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
						css = el.parents(ui.originalElement[0]).length ?
								[ "width", "height" ] :
								[ "width", "height", "top", "left" ];
	
					$.each(css, function(i, prop) {
						var sum = (start[prop] || 0) + (delta[prop] || 0);
						if (sum && sum >= 0) {
							style[prop] = sum || null;
						}
					});
	
					el.css(style);
				});
		},
	
		stop: function() {
			$(this).removeData("resizable-alsoresize");
		}
	});
	
	$.ui.plugin.add("resizable", "ghost", {
	
		start: function() {
	
			var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
	
			that.ghost = that.originalElement.clone();
			that.ghost
				.css({
					opacity: 0.25,
					display: "block",
					position: "relative",
					height: cs.height,
					width: cs.width,
					margin: 0,
					left: 0,
					top: 0
				})
				.addClass("ui-resizable-ghost")
				.addClass(typeof o.ghost === "string" ? o.ghost : "");
	
			that.ghost.appendTo(that.helper);
	
		},
	
		resize: function() {
			var that = $(this).resizable( "instance" );
			if (that.ghost) {
				that.ghost.css({
					position: "relative",
					height: that.size.height,
					width: that.size.width
				});
			}
		},
	
		stop: function() {
			var that = $(this).resizable( "instance" );
			if (that.ghost && that.helper) {
				that.helper.get(0).removeChild(that.ghost.get(0));
			}
		}
	
	});
	
	$.ui.plugin.add("resizable", "grid", {
	
		resize: function() {
			var outerDimensions,
				that = $(this).resizable( "instance" ),
				o = that.options,
				cs = that.size,
				os = that.originalSize,
				op = that.originalPosition,
				a = that.axis,
				grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
				gridX = (grid[0] || 1),
				gridY = (grid[1] || 1),
				ox = Math.round((cs.width - os.width) / gridX) * gridX,
				oy = Math.round((cs.height - os.height) / gridY) * gridY,
				newWidth = os.width + ox,
				newHeight = os.height + oy,
				isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
				isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
				isMinWidth = o.minWidth && (o.minWidth > newWidth),
				isMinHeight = o.minHeight && (o.minHeight > newHeight);
	
			o.grid = grid;
	
			if (isMinWidth) {
				newWidth += gridX;
			}
			if (isMinHeight) {
				newHeight += gridY;
			}
			if (isMaxWidth) {
				newWidth -= gridX;
			}
			if (isMaxHeight) {
				newHeight -= gridY;
			}
	
			if (/^(se|s|e)$/.test(a)) {
				that.size.width = newWidth;
				that.size.height = newHeight;
			} else if (/^(ne)$/.test(a)) {
				that.size.width = newWidth;
				that.size.height = newHeight;
				that.position.top = op.top - oy;
			} else if (/^(sw)$/.test(a)) {
				that.size.width = newWidth;
				that.size.height = newHeight;
				that.position.left = op.left - ox;
			} else {
				if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) {
					outerDimensions = that._getPaddingPlusBorderDimensions( this );
				}
	
				if ( newHeight - gridY > 0 ) {
					that.size.height = newHeight;
					that.position.top = op.top - oy;
				} else {
					newHeight = gridY - outerDimensions.height;
					that.size.height = newHeight;
					that.position.top = op.top + os.height - newHeight;
				}
				if ( newWidth - gridX > 0 ) {
					that.size.width = newWidth;
					that.position.left = op.left - ox;
				} else {
					newWidth = gridX - outerDimensions.width;
					that.size.width = newWidth;
					that.position.left = op.left + os.width - newWidth;
				}
			}
		}
	
	});
	
	var resizable = $.ui.resizable;
	
	
	
	
	
	var dialog = $.widget( "ui.dialog", {
		version: "1.11.4",
		options: {
			appendTo: "body",
			autoOpen: true,
			buttons: [],
			closeOnEscape: true,
			closeText: "Close",
			dialogClass: "",
			draggable: true,
			hide: null,
			height: "auto",
			maxHeight: null,
			maxWidth: null,
			minHeight: 150,
			minWidth: 150,
			modal: false,
			position: {
				my: "center",
				at: "center",
				of: window,
				collision: "fit",
				// Ensure the titlebar is always visible
				using: function( pos ) {
					var topOffset = $( this ).css( pos ).offset().top;
					if ( topOffset < 0 ) {
						$( this ).css( "top", pos.top - topOffset );
					}
				}
			},
			resizable: true,
			show: null,
			title: null,
			width: 300,
	
			// callbacks
			beforeClose: null,
			close: null,
			drag: null,
			dragStart: null,
			dragStop: null,
			focus: null,
			open: null,
			resize: null,
			resizeStart: null,
			resizeStop: null
		},
	
		sizeRelatedOptions: {
			buttons: true,
			height: true,
			maxHeight: true,
			maxWidth: true,
			minHeight: true,
			minWidth: true,
			width: true
		},
	
		resizableRelatedOptions: {
			maxHeight: true,
			maxWidth: true,
			minHeight: true,
			minWidth: true
		},
	
		_create: function() {
			this.originalCss = {
				display: this.element[ 0 ].style.display,
				width: this.element[ 0 ].style.width,
				minHeight: this.element[ 0 ].style.minHeight,
				maxHeight: this.element[ 0 ].style.maxHeight,
				height: this.element[ 0 ].style.height
			};
			this.originalPosition = {
				parent: this.element.parent(),
				index: this.element.parent().children().index( this.element )
			};
			this.originalTitle = this.element.attr( "title" );
			this.options.title = this.options.title || this.originalTitle;
	
			this._createWrapper();
	
			this.element
				.show()
				.removeAttr( "title" )
				.addClass( "ui-dialog-content ui-widget-content" )
				.appendTo( this.uiDialog );
	
			this._createTitlebar();
			this._createButtonPane();
	
			if ( this.options.draggable && $.fn.draggable ) {
				this._makeDraggable();
			}
			if ( this.options.resizable && $.fn.resizable ) {
				this._makeResizable();
			}
	
			this._isOpen = false;
	
			this._trackFocus();
		},
	
		_init: function() {
			if ( this.options.autoOpen ) {
				this.open();
			}
		},
	
		_appendTo: function() {
			var element = this.options.appendTo;
			if ( element && (element.jquery || element.nodeType) ) {
				return $( element );
			}
			return this.document.find( element || "body" ).eq( 0 );
		},
	
		_destroy: function() {
			var next,
				originalPosition = this.originalPosition;
	
			this._untrackInstance();
			this._destroyOverlay();
	
			this.element
				.removeUniqueId()
				.removeClass( "ui-dialog-content ui-widget-content" )
				.css( this.originalCss )
				// Without detaching first, the following becomes really slow
				.detach();
	
			this.uiDialog.stop( true, true ).remove();
	
			if ( this.originalTitle ) {
				this.element.attr( "title", this.originalTitle );
			}
	
			next = originalPosition.parent.children().eq( originalPosition.index );
			// Don't try to place the dialog next to itself (#8613)
			if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
				next.before( this.element );
			} else {
				originalPosition.parent.append( this.element );
			}
		},
	
		widget: function() {
			return this.uiDialog;
		},
	
		disable: $.noop,
		enable: $.noop,
	
		close: function( event ) {
			var activeElement,
				that = this;
	
			if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
				return;
			}
	
			this._isOpen = false;
			this._focusedElement = null;
			this._destroyOverlay();
			this._untrackInstance();
	
			if ( !this.opener.filter( ":focusable" ).focus().length ) {
	
				// support: IE9
				// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
				try {
					activeElement = this.document[ 0 ].activeElement;
	
					// Support: IE9, IE10
					// If the <body> is blurred, IE will switch windows, see #4520
					if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
	
						// Hiding a focused element doesn't trigger blur in WebKit
						// so in case we have nothing to focus on, explicitly blur the active element
						// https://bugs.webkit.org/show_bug.cgi?id=47182
						$( activeElement ).blur();
					}
				} catch ( error ) {}
			}
	
			this._hide( this.uiDialog, this.options.hide, function() {
				that._trigger( "close", event );
			});
		},
	
		isOpen: function() {
			return this._isOpen;
		},
	
		moveToTop: function() {
			this._moveToTop();
		},
	
		_moveToTop: function( event, silent ) {
			var moved = false,
				zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map(function() {
					return +$( this ).css( "z-index" );
				}).get(),
				zIndexMax = Math.max.apply( null, zIndices );
	
			if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
				this.uiDialog.css( "z-index", zIndexMax + 1 );
				moved = true;
			}
	
			if ( moved && !silent ) {
				this._trigger( "focus", event );
			}
			return moved;
		},
	
		open: function() {
			var that = this;
			if ( this._isOpen ) {
				if ( this._moveToTop() ) {
					this._focusTabbable();
				}
				return;
			}
	
			this._isOpen = true;
			this.opener = $( this.document[ 0 ].activeElement );
	
			this._size();
			this._position();
			this._createOverlay();
			this._moveToTop( null, true );
	
			// Ensure the overlay is moved to the top with the dialog, but only when
			// opening. The overlay shouldn't move after the dialog is open so that
			// modeless dialogs opened after the modal dialog stack properly.
			if ( this.overlay ) {
				this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
			}
	
			this._show( this.uiDialog, this.options.show, function() {
				that._focusTabbable();
				that._trigger( "focus" );
			});
	
			// Track the dialog immediately upon openening in case a focus event
			// somehow occurs outside of the dialog before an element inside the
			// dialog is focused (#10152)
			this._makeFocusTarget();
	
			this._trigger( "open" );
		},
	
		_focusTabbable: function() {
			// Set focus to the first match:
			// 1. An element that was focused previously
			// 2. First element inside the dialog matching [autofocus]
			// 3. Tabbable element inside the content element
			// 4. Tabbable element inside the buttonpane
			// 5. The close button
			// 6. The dialog itself
			var hasFocus = this._focusedElement;
			if ( !hasFocus ) {
				hasFocus = this.element.find( "[autofocus]" );
			}
			if ( !hasFocus.length ) {
				hasFocus = this.element.find( ":tabbable" );
			}
			if ( !hasFocus.length ) {
				hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
			}
			if ( !hasFocus.length ) {
				hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
			}
			if ( !hasFocus.length ) {
				hasFocus = this.uiDialog;
			}
			hasFocus.eq( 0 ).focus();
		},
	
		_keepFocus: function( event ) {
			function checkFocus() {
				var activeElement = this.document[0].activeElement,
					isActive = this.uiDialog[0] === activeElement ||
						$.contains( this.uiDialog[0], activeElement );
				if ( !isActive ) {
					this._focusTabbable();
				}
			}
			event.preventDefault();
			checkFocus.call( this );
			// support: IE
			// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
			// so we check again later
			this._delay( checkFocus );
		},
	
		_createWrapper: function() {
			this.uiDialog = $("<div>")
				.addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
					this.options.dialogClass )
				.hide()
				.attr({
					// Setting tabIndex makes the div focusable
					tabIndex: -1,
					role: "dialog"
				})
				.appendTo( this._appendTo() );
	
			this._on( this.uiDialog, {
				keydown: function( event ) {
					if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
							event.keyCode === $.ui.keyCode.ESCAPE ) {
						event.preventDefault();
						this.close( event );
						return;
					}
	
					// prevent tabbing out of dialogs
					if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
						return;
					}
					var tabbables = this.uiDialog.find( ":tabbable" ),
						first = tabbables.filter( ":first" ),
						last = tabbables.filter( ":last" );
	
					if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
						this._delay(function() {
							first.focus();
						});
						event.preventDefault();
					} else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
						this._delay(function() {
							last.focus();
						});
						event.preventDefault();
					}
				},
				mousedown: function( event ) {
					if ( this._moveToTop( event ) ) {
						this._focusTabbable();
					}
				}
			});
	
			// We assume that any existing aria-describedby attribute means
			// that the dialog content is marked up properly
			// otherwise we brute force the content as the description
			if ( !this.element.find( "[aria-describedby]" ).length ) {
				this.uiDialog.attr({
					"aria-describedby": this.element.uniqueId().attr( "id" )
				});
			}
		},
	
		_createTitlebar: function() {
			var uiDialogTitle;
	
			this.uiDialogTitlebar = $( "<div>" )
				.addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
				.prependTo( this.uiDialog );
			this._on( this.uiDialogTitlebar, {
				mousedown: function( event ) {
					// Don't prevent click on close button (#8838)
					// Focusing a dialog that is partially scrolled out of view
					// causes the browser to scroll it into view, preventing the click event
					if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
						// Dialog isn't getting focus when dragging (#8063)
						this.uiDialog.focus();
					}
				}
			});
	
			// support: IE
			// Use type="button" to prevent enter keypresses in textboxes from closing the
			// dialog in IE (#9312)
			this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
				.button({
					label: this.options.closeText,
					icons: {
						primary: "ui-icon-closethick"
					},
					text: false
				})
				.addClass( "ui-dialog-titlebar-close" )
				.appendTo( this.uiDialogTitlebar );
			this._on( this.uiDialogTitlebarClose, {
				click: function( event ) {
					event.preventDefault();
					this.close( event );
				}
			});
	
			uiDialogTitle = $( "<span>" )
				.uniqueId()
				.addClass( "ui-dialog-title" )
				.prependTo( this.uiDialogTitlebar );
			this._title( uiDialogTitle );
	
			this.uiDialog.attr({
				"aria-labelledby": uiDialogTitle.attr( "id" )
			});
		},
	
		_title: function( title ) {
			if ( !this.options.title ) {
				title.html( "&#160;" );
			}
			title.text( this.options.title );
		},
	
		_createButtonPane: function() {
			this.uiDialogButtonPane = $( "<div>" )
				.addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
	
			this.uiButtonSet = $( "<div>" )
				.addClass( "ui-dialog-buttonset" )
				.appendTo( this.uiDialogButtonPane );
	
			this._createButtons();
		},
	
		_createButtons: function() {
			var that = this,
				buttons = this.options.buttons;
	
			// if we already have a button pane, remove it
			this.uiDialogButtonPane.remove();
			this.uiButtonSet.empty();
	
			if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
				this.uiDialog.removeClass( "ui-dialog-buttons" );
				return;
			}
	
			$.each( buttons, function( name, props ) {
				var click, buttonOptions;
				props = $.isFunction( props ) ?
					{ click: props, text: name } :
					props;
				// Default to a non-submitting button
				props = $.extend( { type: "button" }, props );
				// Change the context for the click callback to be the main element
				click = props.click;
				props.click = function() {
					click.apply( that.element[ 0 ], arguments );
				};
				buttonOptions = {
					icons: props.icons,
					text: props.showText
				};
				delete props.icons;
				delete props.showText;
				$( "<button></button>", props )
					.button( buttonOptions )
					.appendTo( that.uiButtonSet );
			});
			this.uiDialog.addClass( "ui-dialog-buttons" );
			this.uiDialogButtonPane.appendTo( this.uiDialog );
		},
	
		_makeDraggable: function() {
			var that = this,
				options = this.options;
	
			function filteredUi( ui ) {
				return {
					position: ui.position,
					offset: ui.offset
				};
			}
	
			this.uiDialog.draggable({
				cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
				handle: ".ui-dialog-titlebar",
				containment: "document",
				start: function( event, ui ) {
					$( this ).addClass( "ui-dialog-dragging" );
					that._blockFrames();
					that._trigger( "dragStart", event, filteredUi( ui ) );
				},
				drag: function( event, ui ) {
					that._trigger( "drag", event, filteredUi( ui ) );
				},
				stop: function( event, ui ) {
					var left = ui.offset.left - that.document.scrollLeft(),
						top = ui.offset.top - that.document.scrollTop();
	
					options.position = {
						my: "left top",
						at: "left" + (left >= 0 ? "+" : "") + left + " " +
							"top" + (top >= 0 ? "+" : "") + top,
						of: that.window
					};
					$( this ).removeClass( "ui-dialog-dragging" );
					that._unblockFrames();
					that._trigger( "dragStop", event, filteredUi( ui ) );
				}
			});
		},
	
		_makeResizable: function() {
			var that = this,
				options = this.options,
				handles = options.resizable,
				// .ui-resizable has position: relative defined in the stylesheet
				// but dialogs have to use absolute or fixed positioning
				position = this.uiDialog.css("position"),
				resizeHandles = typeof handles === "string" ?
					handles	:
					"n,e,s,w,se,sw,ne,nw";
	
			function filteredUi( ui ) {
				return {
					originalPosition: ui.originalPosition,
					originalSize: ui.originalSize,
					position: ui.position,
					size: ui.size
				};
			}
	
			this.uiDialog.resizable({
				cancel: ".ui-dialog-content",
				containment: "document",
				alsoResize: this.element,
				maxWidth: options.maxWidth,
				maxHeight: options.maxHeight,
				minWidth: options.minWidth,
				minHeight: this._minHeight(),
				handles: resizeHandles,
				start: function( event, ui ) {
					$( this ).addClass( "ui-dialog-resizing" );
					that._blockFrames();
					that._trigger( "resizeStart", event, filteredUi( ui ) );
				},
				resize: function( event, ui ) {
					that._trigger( "resize", event, filteredUi( ui ) );
				},
				stop: function( event, ui ) {
					var offset = that.uiDialog.offset(),
						left = offset.left - that.document.scrollLeft(),
						top = offset.top - that.document.scrollTop();
	
					options.height = that.uiDialog.height();
					options.width = that.uiDialog.width();
					options.position = {
						my: "left top",
						at: "left" + (left >= 0 ? "+" : "") + left + " " +
							"top" + (top >= 0 ? "+" : "") + top,
						of: that.window
					};
					$( this ).removeClass( "ui-dialog-resizing" );
					that._unblockFrames();
					that._trigger( "resizeStop", event, filteredUi( ui ) );
				}
			})
			.css( "position", position );
		},
	
		_trackFocus: function() {
			this._on( this.widget(), {
				focusin: function( event ) {
					this._makeFocusTarget();
					this._focusedElement = $( event.target );
				}
			});
		},
	
		_makeFocusTarget: function() {
			this._untrackInstance();
			this._trackingInstances().unshift( this );
		},
	
		_untrackInstance: function() {
			var instances = this._trackingInstances(),
				exists = $.inArray( this, instances );
			if ( exists !== -1 ) {
				instances.splice( exists, 1 );
			}
		},
	
		_trackingInstances: function() {
			var instances = this.document.data( "ui-dialog-instances" );
			if ( !instances ) {
				instances = [];
				this.document.data( "ui-dialog-instances", instances );
			}
			return instances;
		},
	
		_minHeight: function() {
			var options = this.options;
	
			return options.height === "auto" ?
				options.minHeight :
				Math.min( options.minHeight, options.height );
		},
	
		_position: function() {
			// Need to show the dialog to get the actual offset in the position plugin
			var isVisible = this.uiDialog.is( ":visible" );
			if ( !isVisible ) {
				this.uiDialog.show();
			}
			this.uiDialog.position( this.options.position );
			if ( !isVisible ) {
				this.uiDialog.hide();
			}
		},
	
		_setOptions: function( options ) {
			var that = this,
				resize = false,
				resizableOptions = {};
	
			$.each( options, function( key, value ) {
				that._setOption( key, value );
	
				if ( key in that.sizeRelatedOptions ) {
					resize = true;
				}
				if ( key in that.resizableRelatedOptions ) {
					resizableOptions[ key ] = value;
				}
			});
	
			if ( resize ) {
				this._size();
				this._position();
			}
			if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
				this.uiDialog.resizable( "option", resizableOptions );
			}
		},
	
		_setOption: function( key, value ) {
			var isDraggable, isResizable,
				uiDialog = this.uiDialog;
	
			if ( key === "dialogClass" ) {
				uiDialog
					.removeClass( this.options.dialogClass )
					.addClass( value );
			}
	
			if ( key === "disabled" ) {
				return;
			}
	
			this._super( key, value );
	
			if ( key === "appendTo" ) {
				this.uiDialog.appendTo( this._appendTo() );
			}
	
			if ( key === "buttons" ) {
				this._createButtons();
			}
	
			if ( key === "closeText" ) {
				this.uiDialogTitlebarClose.button({
					// Ensure that we always pass a string
					label: "" + value
				});
			}
	
			if ( key === "draggable" ) {
				isDraggable = uiDialog.is( ":data(ui-draggable)" );
				if ( isDraggable && !value ) {
					uiDialog.draggable( "destroy" );
				}
	
				if ( !isDraggable && value ) {
					this._makeDraggable();
				}
			}
	
			if ( key === "position" ) {
				this._position();
			}
	
			if ( key === "resizable" ) {
				// currently resizable, becoming non-resizable
				isResizable = uiDialog.is( ":data(ui-resizable)" );
				if ( isResizable && !value ) {
					uiDialog.resizable( "destroy" );
				}
	
				// currently resizable, changing handles
				if ( isResizable && typeof value === "string" ) {
					uiDialog.resizable( "option", "handles", value );
				}
	
				// currently non-resizable, becoming resizable
				if ( !isResizable && value !== false ) {
					this._makeResizable();
				}
			}
	
			if ( key === "title" ) {
				this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
			}
		},
	
		_size: function() {
			// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
			// divs will both have width and height set, so we need to reset them
			var nonContentHeight, minContentHeight, maxContentHeight,
				options = this.options;
	
			// Reset content sizing
			this.element.show().css({
				width: "auto",
				minHeight: 0,
				maxHeight: "none",
				height: 0
			});
	
			if ( options.minWidth > options.width ) {
				options.width = options.minWidth;
			}
	
			// reset wrapper sizing
			// determine the height of all the non-content elements
			nonContentHeight = this.uiDialog.css({
					height: "auto",
					width: options.width
				})
				.outerHeight();
			minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
			maxContentHeight = typeof options.maxHeight === "number" ?
				Math.max( 0, options.maxHeight - nonContentHeight ) :
				"none";
	
			if ( options.height === "auto" ) {
				this.element.css({
					minHeight: minContentHeight,
					maxHeight: maxContentHeight,
					height: "auto"
				});
			} else {
				this.element.height( Math.max( 0, options.height - nonContentHeight ) );
			}
	
			if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
				this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
			}
		},
	
		_blockFrames: function() {
			this.iframeBlocks = this.document.find( "iframe" ).map(function() {
				var iframe = $( this );
	
				return $( "<div>" )
					.css({
						position: "absolute",
						width: iframe.outerWidth(),
						height: iframe.outerHeight()
					})
					.appendTo( iframe.parent() )
					.offset( iframe.offset() )[0];
			});
		},
	
		_unblockFrames: function() {
			if ( this.iframeBlocks ) {
				this.iframeBlocks.remove();
				delete this.iframeBlocks;
			}
		},
	
		_allowInteraction: function( event ) {
			if ( $( event.target ).closest( ".ui-dialog" ).length ) {
				return true;
			}
	
			// TODO: Remove hack when datepicker implements
			// the .ui-front logic (#8989)
			return !!$( event.target ).closest( ".ui-datepicker" ).length;
		},
	
		_createOverlay: function() {
			if ( !this.options.modal ) {
				return;
			}
	
			// We use a delay in case the overlay is created from an
			// event that we're going to be cancelling (#2804)
			var isOpening = true;
			this._delay(function() {
				isOpening = false;
			});
	
			if ( !this.document.data( "ui-dialog-overlays" ) ) {
	
				// Prevent use of anchors and inputs
				// Using _on() for an event handler shared across many instances is
				// safe because the dialogs stack and must be closed in reverse order
				this._on( this.document, {
					focusin: function( event ) {
						if ( isOpening ) {
							return;
						}
	
						if ( !this._allowInteraction( event ) ) {
							event.preventDefault();
							this._trackingInstances()[ 0 ]._focusTabbable();
						}
					}
				});
			}
	
			this.overlay = $( "<div>" )
				.addClass( "ui-widget-overlay ui-front" )
				.appendTo( this._appendTo() );
			this._on( this.overlay, {
				mousedown: "_keepFocus"
			});
			this.document.data( "ui-dialog-overlays",
				(this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
		},
	
		_destroyOverlay: function() {
			if ( !this.options.modal ) {
				return;
			}
	
			if ( this.overlay ) {
				var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
	
				if ( !overlays ) {
					this.document
						.unbind( "focusin" )
						.removeData( "ui-dialog-overlays" );
				} else {
					this.document.data( "ui-dialog-overlays", overlays );
				}
	
				this.overlay.remove();
				this.overlay = null;
			}
		}
	});
	
	
	
	
	
	$.widget( "ui.droppable", {
		version: "1.11.4",
		widgetEventPrefix: "drop",
		options: {
			accept: "*",
			activeClass: false,
			addClasses: true,
			greedy: false,
			hoverClass: false,
			scope: "default",
			tolerance: "intersect",
	
			// callbacks
			activate: null,
			deactivate: null,
			drop: null,
			out: null,
			over: null
		},
		_create: function() {
	
			var proportions,
				o = this.options,
				accept = o.accept;
	
			this.isover = false;
			this.isout = true;
	
			this.accept = $.isFunction( accept ) ? accept : function( d ) {
				return d.is( accept );
			};
	
			this.proportions = function(  ) {
				if ( arguments.length ) {
					// Store the droppable's proportions
					proportions = arguments[ 0 ];
				} else {
					// Retrieve or derive the droppable's proportions
					return proportions ?
						proportions :
						proportions = {
							width: this.element[ 0 ].offsetWidth,
							height: this.element[ 0 ].offsetHeight
						};
				}
			};
	
			this._addToManager( o.scope );
	
			o.addClasses && this.element.addClass( "ui-droppable" );
	
		},
	
		_addToManager: function( scope ) {
			// Add the reference and positions to the manager
			$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
			$.ui.ddmanager.droppables[ scope ].push( this );
		},
	
		_splice: function( drop ) {
			var i = 0;
			for ( ; i < drop.length; i++ ) {
				if ( drop[ i ] === this ) {
					drop.splice( i, 1 );
				}
			}
		},
	
		_destroy: function() {
			var drop = $.ui.ddmanager.droppables[ this.options.scope ];
	
			this._splice( drop );
	
			this.element.removeClass( "ui-droppable ui-droppable-disabled" );
		},
	
		_setOption: function( key, value ) {
	
			if ( key === "accept" ) {
				this.accept = $.isFunction( value ) ? value : function( d ) {
					return d.is( value );
				};
			} else if ( key === "scope" ) {
				var drop = $.ui.ddmanager.droppables[ this.options.scope ];
	
				this._splice( drop );
				this._addToManager( value );
			}
	
			this._super( key, value );
		},
	
		_activate: function( event ) {
			var draggable = $.ui.ddmanager.current;
			if ( this.options.activeClass ) {
				this.element.addClass( this.options.activeClass );
			}
			if ( draggable ){
				this._trigger( "activate", event, this.ui( draggable ) );
			}
		},
	
		_deactivate: function( event ) {
			var draggable = $.ui.ddmanager.current;
			if ( this.options.activeClass ) {
				this.element.removeClass( this.options.activeClass );
			}
			if ( draggable ){
				this._trigger( "deactivate", event, this.ui( draggable ) );
			}
		},
	
		_over: function( event ) {
	
			var draggable = $.ui.ddmanager.current;
	
			// Bail if draggable and droppable are same element
			if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
				return;
			}
	
			if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
				if ( this.options.hoverClass ) {
					this.element.addClass( this.options.hoverClass );
				}
				this._trigger( "over", event, this.ui( draggable ) );
			}
	
		},
	
		_out: function( event ) {
	
			var draggable = $.ui.ddmanager.current;
	
			// Bail if draggable and droppable are same element
			if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
				return;
			}
	
			if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
				if ( this.options.hoverClass ) {
					this.element.removeClass( this.options.hoverClass );
				}
				this._trigger( "out", event, this.ui( draggable ) );
			}
	
		},
	
		_drop: function( event, custom ) {
	
			var draggable = custom || $.ui.ddmanager.current,
				childrenIntersection = false;
	
			// Bail if draggable and droppable are same element
			if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
				return false;
			}
	
			this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
				var inst = $( this ).droppable( "instance" );
				if (
					inst.options.greedy &&
					!inst.options.disabled &&
					inst.options.scope === draggable.options.scope &&
					inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
					$.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
				) { childrenIntersection = true; return false; }
			});
			if ( childrenIntersection ) {
				return false;
			}
	
			if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
				if ( this.options.activeClass ) {
					this.element.removeClass( this.options.activeClass );
				}
				if ( this.options.hoverClass ) {
					this.element.removeClass( this.options.hoverClass );
				}
				this._trigger( "drop", event, this.ui( draggable ) );
				return this.element;
			}
	
			return false;
	
		},
	
		ui: function( c ) {
			return {
				draggable: ( c.currentItem || c.element ),
				helper: c.helper,
				position: c.position,
				offset: c.positionAbs
			};
		}
	
	});
	
	$.ui.intersect = (function() {
		function isOverAxis( x, reference, size ) {
			return ( x >= reference ) && ( x < ( reference + size ) );
		}
	
		return function( draggable, droppable, toleranceMode, event ) {
	
			if ( !droppable.offset ) {
				return false;
			}
	
			var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
				y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
				x2 = x1 + draggable.helperProportions.width,
				y2 = y1 + draggable.helperProportions.height,
				l = droppable.offset.left,
				t = droppable.offset.top,
				r = l + droppable.proportions().width,
				b = t + droppable.proportions().height;
	
			switch ( toleranceMode ) {
			case "fit":
				return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
			case "intersect":
				return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
					x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
					t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
					y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
			case "pointer":
				return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width );
			case "touch":
				return (
					( y1 >= t && y1 <= b ) || // Top edge touching
					( y2 >= t && y2 <= b ) || // Bottom edge touching
					( y1 < t && y2 > b ) // Surrounded vertically
				) && (
					( x1 >= l && x1 <= r ) || // Left edge touching
					( x2 >= l && x2 <= r ) || // Right edge touching
					( x1 < l && x2 > r ) // Surrounded horizontally
				);
			default:
				return false;
			}
		};
	})();
	
	
	$.ui.ddmanager = {
		current: null,
		droppables: { "default": [] },
		prepareOffsets: function( t, event ) {
	
			var i, j,
				m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
				type = event ? event.type : null, // workaround for #2317
				list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
	
			droppablesLoop: for ( i = 0; i < m.length; i++ ) {
	
				// No disabled and non-accepted
				if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
					continue;
				}
	
				// Filter out elements in the current dragged item
				for ( j = 0; j < list.length; j++ ) {
					if ( list[ j ] === m[ i ].element[ 0 ] ) {
						m[ i ].proportions().height = 0;
						continue droppablesLoop;
					}
				}
	
				m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
				if ( !m[ i ].visible ) {
					continue;
				}
	
				// Activate the droppable if used directly from draggables
				if ( type === "mousedown" ) {
					m[ i ]._activate.call( m[ i ], event );
				}
	
				m[ i ].offset = m[ i ].element.offset();
				m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
	
			}
	
		},
		drop: function( draggable, event ) {
	
			var dropped = false;
			// Create a copy of the droppables in case the list changes during the drop (#9116)
			$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
	
				if ( !this.options ) {
					return;
				}
				if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
					dropped = this._drop.call( this, event ) || dropped;
				}
	
				if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
					this.isout = true;
					this.isover = false;
					this._deactivate.call( this, event );
				}
	
			});
			return dropped;
	
		},
		dragStart: function( draggable, event ) {
			// Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
			draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
				if ( !draggable.options.refreshPositions ) {
					$.ui.ddmanager.prepareOffsets( draggable, event );
				}
			});
		},
		drag: function( draggable, event ) {
	
			// If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
			if ( draggable.options.refreshPositions ) {
				$.ui.ddmanager.prepareOffsets( draggable, event );
			}
	
			// Run through all droppables and check their positions based on specific tolerance options
			$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
	
				if ( this.options.disabled || this.greedyChild || !this.visible ) {
					return;
				}
	
				var parentInstance, scope, parent,
					intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
					c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
				if ( !c ) {
					return;
				}
	
				if ( this.options.greedy ) {
					// find droppable parents with same scope
					scope = this.options.scope;
					parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
						return $( this ).droppable( "instance" ).options.scope === scope;
					});
	
					if ( parent.length ) {
						parentInstance = $( parent[ 0 ] ).droppable( "instance" );
						parentInstance.greedyChild = ( c === "isover" );
					}
				}
	
				// we just moved into a greedy child
				if ( parentInstance && c === "isover" ) {
					parentInstance.isover = false;
					parentInstance.isout = true;
					parentInstance._out.call( parentInstance, event );
				}
	
				this[ c ] = true;
				this[c === "isout" ? "isover" : "isout"] = false;
				this[c === "isover" ? "_over" : "_out"].call( this, event );
	
				// we just moved out of a greedy child
				if ( parentInstance && c === "isout" ) {
					parentInstance.isout = false;
					parentInstance.isover = true;
					parentInstance._over.call( parentInstance, event );
				}
			});
	
		},
		dragStop: function( draggable, event ) {
			draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
			// Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
			if ( !draggable.options.refreshPositions ) {
				$.ui.ddmanager.prepareOffsets( draggable, event );
			}
		}
	};
	
	var droppable = $.ui.droppable;
	
	
	
	
	
	var dataSpace = "ui-effects-",
	
		// Create a local jQuery because jQuery Color relies on it and the
		// global may not exist with AMD and a custom build (#10199)
		jQuery = $;
	
	$.effects = {
		effect: {}
	};
	
	
	(function( jQuery, undefined ) {
	
		var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
	
		// plusequals test for += 100 -= 100
		rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
		// a set of RE's that can match strings and generate color tuples.
		stringParsers = [ {
				re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
				parse: function( execResult ) {
					return [
						execResult[ 1 ],
						execResult[ 2 ],
						execResult[ 3 ],
						execResult[ 4 ]
					];
				}
			}, {
				re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
				parse: function( execResult ) {
					return [
						execResult[ 1 ] * 2.55,
						execResult[ 2 ] * 2.55,
						execResult[ 3 ] * 2.55,
						execResult[ 4 ]
					];
				}
			}, {
				// this regex ignores A-F because it's compared against an already lowercased string
				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 )
					];
				}
			}, {
				// this regex ignores A-F because it's compared against an already lowercased string
				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 ]
					];
				}
			} ],
	
		// jQuery.Color( )
		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 = {},
	
		// element for support tests
		supportElem = jQuery( "<p>" )[ 0 ],
	
		// colors = jQuery.Color.names
		colors,
	
		// local aliases of functions called often
		each = jQuery.each;
	
	// determine rgba support immediately
	supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
	support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
	
	// define cache name and alpha properties
	// for rgba and hsla spaces
	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;
		}
	
		// ~~ is an short way of doing floor for positive numbers
		value = type.floor ? ~~value : parseFloat( value );
	
		// IE will pass in empty strings as value for alpha,
		// which will hit this case
		if ( isNaN( value ) ) {
			return prop.def;
		}
	
		if ( type.mod ) {
			// we add mod before modding to make sure that negatives values
			// get converted properly: -10 -> 350
			return (value + type.mod) % type.mod;
		}
	
		// for now all property types without mod have min and max
		return 0 > value ? 0 : type.max < value ? type.max : value;
	}
	
	function stringParse( string ) {
		var inst = color(),
			rgba = inst._rgba = [];
	
		string = string.toLowerCase();
	
		each( stringParsers, function( i, parser ) {
			var parsed,
				match = parser.re.exec( string ),
				values = match && parser.parse( match ),
				spaceName = parser.space || "rgba";
	
			if ( values ) {
				parsed = inst[ spaceName ]( values );
	
				// if this was an rgba parse the assignment might happen twice
				// oh well....
				inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
				rgba = inst._rgba = parsed._rgba;
	
				// exit each( stringParsers ) here because we matched
				return false;
			}
		});
	
		// Found a stringParser that handled it
		if ( rgba.length ) {
	
			// if this came from a parsed string, force "transparent" when alpha is 0
			// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
			if ( rgba.join() === "0,0,0,0" ) {
				jQuery.extend( rgba, colors.transparent );
			}
			return inst;
		}
	
		// named colors
		return colors[ string ];
	}
	
	color.fn = jQuery.extend( color.prototype, {
		parse: function( red, green, blue, alpha ) {
			if ( red === undefined ) {
				this._rgba = [ null, null, null, null ];
				return this;
			}
			if ( red.jquery || red.nodeType ) {
				red = jQuery( red ).css( green );
				green = undefined;
			}
	
			var inst = this,
				type = jQuery.type( red ),
				rgba = this._rgba = [];
	
			// more than 1 argument specified - assume ( red, green, blue, alpha )
			if ( green !== undefined ) {
				red = [ red, green, blue, alpha ];
				type = "array";
			}
	
			if ( type === "string" ) {
				return this.parse( stringParse( red ) || colors._default );
			}
	
			if ( type === "array" ) {
				each( spaces.rgba.props, function( key, prop ) {
					rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
				});
				return this;
			}
	
			if ( type === "object" ) {
				if ( red instanceof color ) {
					each( spaces, function( spaceName, space ) {
						if ( red[ space.cache ] ) {
							inst[ space.cache ] = red[ space.cache ].slice();
						}
					});
				} else {
					each( spaces, function( spaceName, space ) {
						var cache = space.cache;
						each( space.props, function( key, prop ) {
	
							// if the cache doesn't exist, and we know how to convert
							if ( !inst[ cache ] && space.to ) {
	
								// if the value was null, we don't need to copy it
								// if the key was alpha, we don't need to copy it either
								if ( key === "alpha" || red[ key ] == null ) {
									return;
								}
								inst[ cache ] = space.to( inst._rgba );
							}
	
							// this is the only case where we allow nulls for ALL properties.
							// call clamp with alwaysAllowEmpty
							inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
						});
	
						// everything defined but alpha?
						if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
							// use the default of 1
							inst[ cache ][ 3 ] = 1;
							if ( space.from ) {
								inst._rgba = space.from( inst[ cache ] );
							}
						}
					});
				}
				return 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;
						}
					});
				}
				return same;
			});
			return same;
		},
		_space: function() {
			var used = [],
				inst = this;
			each( spaces, function( spaceName, space ) {
				if ( inst[ space.cache ] ) {
					used.push( spaceName );
				}
			});
			return used.pop();
		},
		transition: function( other, distance ) {
			var end = color( other ),
				spaceName = end._space(),
				space = spaces[ spaceName ],
				startColor = this.alpha() === 0 ? color( "transparent" ) : this,
				start = startColor[ space.cache ] || space.to( startColor._rgba ),
				result = start.slice();
	
			end = end[ space.cache ];
			each( space.props, function( key, prop ) {
				var index = prop.idx,
					startValue = start[ index ],
					endValue = end[ index ],
					type = propTypes[ prop.type ] || {};
	
				// if null, don't override start value
				if ( endValue === null ) {
					return;
				}
				// if null - use end
				if ( startValue === null ) {
					result[ index ] = endValue;
				} else {
					if ( type.mod ) {
						if ( endValue - startValue > type.mod / 2 ) {
							startValue += type.mod;
						} else if ( startValue - endValue > type.mod / 2 ) {
							startValue -= type.mod;
						}
					}
					result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
				}
			});
			return this[ spaceName ]( result );
		},
		blend: function( opaque ) {
			// if we are already opaque - return ourself
			if ( this._rgba[ 3 ] === 1 ) {
				return this;
			}
	
			var rgb = this._rgba.slice(),
				a = rgb.pop(),
				blend = color( opaque )._rgba;
	
			return color( jQuery.map( rgb, function( v, i ) {
				return ( 1 - a ) * blend[ i ] + a * v;
			}));
		},
		toRgbaString: function() {
			var prefix = "rgba(",
				rgba = jQuery.map( this._rgba, function( v, i ) {
					return v == null ? ( i > 2 ? 1 : 0 ) : v;
				});
	
			if ( rgba[ 3 ] === 1 ) {
				rgba.pop();
				prefix = "rgb(";
			}
	
			return prefix + rgba.join() + ")";
		},
		toHslaString: function() {
			var prefix = "hsla(",
				hsla = jQuery.map( this.hsla(), function( v, i ) {
					if ( v == null ) {
						v = i > 2 ? 1 : 0;
					}
	
					// catch 1 and 2
					if ( i && i < 3 ) {
						v = Math.round( v * 100 ) + "%";
					}
					return v;
				});
	
			if ( hsla[ 3 ] === 1 ) {
				hsla.pop();
				prefix = "hsl(";
			}
			return prefix + hsla.join() + ")";
		},
		toHexString: function( includeAlpha ) {
			var rgba = this._rgba.slice(),
				alpha = rgba.pop();
	
			if ( includeAlpha ) {
				rgba.push( ~~( alpha * 255 ) );
			}
	
			return "#" + jQuery.map( rgba, function( v ) {
	
				// default to 0 when nulls exist
				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;
	
	// hsla conversions adapted from:
	// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
	
	function hue2rgb( p, q, h ) {
		h = ( h + 1 ) % 1;
		if ( h * 6 < 1 ) {
			return p + ( q - p ) * h * 6;
		}
		if ( h * 2 < 1) {
			return q;
		}
		if ( h * 3 < 2 ) {
			return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
		}
		return p;
	}
	
	spaces.hsla.to = function( rgba ) {
		if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
			return [ null, null, null, rgba[ 3 ] ];
		}
		var r = rgba[ 0 ] / 255,
			g = rgba[ 1 ] / 255,
			b = rgba[ 2 ] / 255,
			a = rgba[ 3 ],
			max = Math.max( r, g, b ),
			min = Math.min( r, g, b ),
			diff = max - min,
			add = max + min,
			l = add * 0.5,
			h, s;
	
		if ( min === max ) {
			h = 0;
		} else if ( r === max ) {
			h = ( 60 * ( g - b ) / diff ) + 360;
		} else if ( g === max ) {
			h = ( 60 * ( b - r ) / diff ) + 120;
		} else {
			h = ( 60 * ( r - g ) / diff ) + 240;
		}
	
		// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
		// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
		if ( diff === 0 ) {
			s = 0;
		} else if ( l <= 0.5 ) {
			s = diff / add;
		} else {
			s = diff / ( 2 - add );
		}
		return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
	};
	
	spaces.hsla.from = function( hsla ) {
		if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
			return [ null, null, null, hsla[ 3 ] ];
		}
		var h = hsla[ 0 ] / 360,
			s = hsla[ 1 ],
			l = hsla[ 2 ],
			a = hsla[ 3 ],
			q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
			p = 2 * l - q;
	
		return [
			Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
			Math.round( hue2rgb( p, q, h ) * 255 ),
			Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
			a
		];
	};
	
	each( spaces, function( spaceName, space ) {
		var props = space.props,
			cache = space.cache,
			to = space.to,
			from = space.from;
	
		// makes rgba() and hsla()
		color.fn[ spaceName ] = function( value ) {
	
			// generate a cache for this space if it doesn't exist
			if ( to && !this[ cache ] ) {
				this[ cache ] = to( this._rgba );
			}
			if ( value === undefined ) {
				return this[ cache ].slice();
			}
	
			var 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 ];
				}
				local[ prop.idx ] = clamp( val, prop );
			});
	
			if ( from ) {
				ret = color( from( local ) );
				ret[ cache ] = local;
				return ret;
			} else {
				return color( local );
			}
		};
	
		// makes red() green() blue() alpha() hue() saturation() lightness()
		each( props, function( key, prop ) {
			// alpha is included in more than one space
			if ( color.fn[ key ] ) {
				return;
			}
			color.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;
				}
	
				if ( vtype === "function" ) {
					value = value.call( this, cur );
					vtype = jQuery.type( value );
				}
				if ( value == null && prop.empty ) {
					return this;
				}
				if ( vtype === "string" ) {
					match = rplusequals.exec( value );
					if ( match ) {
						value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
					}
				}
				local[ prop.idx ] = value;
				return this[ fn ]( local );
			};
		});
	});
	
	// add cssHook and .fx.step function for each named hook.
	// accept a space separated string of properties
	color.hook = function( hook ) {
		var hooks = hook.split( " " );
		each( hooks, function( i, hook ) {
			jQuery.cssHooks[ hook ] = {
				set: function( elem, value ) {
					var parsed, curElem,
						backgroundColor = "";
	
					if ( value !== "transparent" && ( 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 ) {
								}
							}
	
							value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
								backgroundColor :
								"_default" );
						}
	
						value = value.toRgbaString();
					}
					try {
						elem.style[ hook ] = value;
					} catch ( e ) {
						// wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
					}
				}
			};
			jQuery.fx.step[ hook ] = function( fx ) {
				if ( !fx.colorInit ) {
					fx.start = color( fx.elem, hook );
					fx.end = color( fx.end );
					fx.colorInit = true;
				}
				jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
			};
		});
	
	};
	
	color.hook( stepHooks );
	
	jQuery.cssHooks.borderColor = {
		expand: function( value ) {
			var expanded = {};
	
			each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
				expanded[ "border" + part + "Color" ] = value;
			});
			return expanded;
		}
	};
	
	// Basic color names only.
	// Usage of any of the other color names requires adding yourself or including
	// jquery.color.svg-names.js.
	colors = jQuery.Color.names = {
		// 4.1. Basic color keywords
		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",
	
		// 4.2.3. "transparent" color keyword
		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 ];
				}
			}
		// support: Opera, IE <9
		} else {
			for ( key in style ) {
				if ( typeof style[ key ] === "string" ) {
					styles[ key ] = style[ key ];
				}
			}
		}
	
		return styles;
	}
	
	function styleDifference( oldStyle, newStyle ) {
		var diff = {},
			name, value;
	
		for ( name in newStyle ) {
			value = newStyle[ name ];
			if ( oldStyle[ name ] !== value ) {
				if ( !shorthandStyles[ name ] ) {
					if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
						diff[ name ] = value;
					}
				}
			}
		}
	
		return diff;
	}
	
	// support: jQuery <1.8
	if ( !$.fn.addBack ) {
		$.fn.addBack = function( selector ) {
			return this.add( selector == null ?
				this.prevObject : this.prevObject.filter( selector )
			);
		};
	}
	
	$.effects.animateClass = function( value, duration, easing, callback ) {
		var o = $.speed( duration, easing, callback );
	
		return this.queue( function() {
			var animated = $( this ),
				baseClass = animated.attr( "class" ) || "",
				applyClassChange,
				allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
	
			// map the animated objects to store the original styles.
			allAnimations = allAnimations.map(function() {
				var el = $( this );
				return {
					el: el,
					start: getElementStyles( this )
				};
			});
	
			// apply class change
			applyClassChange = function() {
				$.each( classAnimationActions, function(i, action) {
					if ( value[ action ] ) {
						animated[ action + "Class" ]( value[ action ] );
					}
				});
			};
			applyClassChange();
	
			// map all animated objects again - calculate new styles and diff
			allAnimations = allAnimations.map(function() {
				this.end = getElementStyles( this.el[ 0 ] );
				this.diff = styleDifference( this.start, this.end );
				return this;
			});
	
			// apply original class
			animated.attr( "class", baseClass );
	
			// map all animated objects again - this time collecting a promise
			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();
			});
	
			// once all animations have completed:
			$.when.apply( $, allAnimations.get() ).done(function() {
	
				// set the final class
				applyClassChange();
	
				// for each animated element,
				// clear all css properties that were animated
				$.each( arguments, function() {
					var el = this.el;
					$.each( this.diff, function(key) {
						el.css( key, "" );
					});
				});
	
				// this is guarnteed to be there if you use jQuery.speed()
				// it also handles dequeuing the next anim...
				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 ) {
						// without speed parameter
						return orig.apply( this, arguments );
					} else {
						return $.effects.animateClass.call( this,
							(force ? { add: classNames } : { remove: classNames }),
							speed, easing, callback );
					}
				} else {
					// without force parameter
					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() {
	
	$.extend( $.effects, {
		version: "1.11.4",
	
		// Saves a set of properties in a data storage
		save: function( element, set ) {
			for ( var i = 0; i < set.length; i++ ) {
				if ( set[ i ] !== null ) {
					element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
				}
			}
		},
	
		// Restores a set of previously saved properties from a data storage
		restore: function( element, set ) {
			var val, i;
			for ( i = 0; i < set.length; i++ ) {
				if ( set[ i ] !== null ) {
					val = element.data( dataSpace + set[ i ] );
					// support: jQuery 1.6.2
					// http://bugs.jquery.com/ticket/9917
					// jQuery 1.6.2 incorrectly returns undefined for any falsy value.
					// We can't differentiate between "" and 0 here, so we just assume
					// empty string since it's likely to be a more common value...
					if ( val === undefined ) {
						val = "";
					}
					element.css( set[ i ], val );
				}
			}
		},
	
		setMode: function( el, mode ) {
			if (mode === "toggle") {
				mode = el.is( ":hidden" ) ? "show" : "hide";
			}
			return mode;
		},
	
		// Translates a [top,left] array into a baseline value
		// this should be a little more flexible in the future to handle a string & hash
		getBaseline: function( origin, original ) {
			var y, x;
			switch ( origin[ 0 ] ) {
				case "top": y = 0; break;
				case "middle": y = 0.5; break;
				case "bottom": y = 1; break;
				default: y = origin[ 0 ] / original.height;
			}
			switch ( origin[ 1 ] ) {
				case "left": x = 0; break;
				case "center": x = 0.5; break;
				case "right": x = 1; break;
				default: x = origin[ 1 ] / original.width;
			}
			return {
				x: x,
				y: y
			};
		},
	
		// Wraps the element around a wrapper that copies position properties
		createWrapper: function( element ) {
	
			// if the element is already wrapped, return it
			if ( element.parent().is( ".ui-effects-wrapper" )) {
				return element.parent();
			}
	
			// wrap the element
			var 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
					}),
				// Store the size in case width/height are defined in % - Fixes #5245
				size = {
					width: element.width(),
					height: element.height()
				},
				active = document.activeElement;
	
			// support: Firefox
			// Firefox incorrectly exposes anonymous content
			// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
			try {
				active.id;
			} catch ( e ) {
				active = document.body;
			}
	
			element.wrap( wrapper );
	
			// Fixes #7595 - Elements lose focus when wrapped.
			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
				$( active ).focus();
			}
	
			wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
	
			// transfer positioning properties to the wrapper
			if ( element.css( "position" ) === "static" ) {
				wrapper.css({ position: "relative" });
				element.css({ position: "relative" });
			} else {
				$.extend( props, {
					position: element.css( "position" ),
					zIndex: element.css( "z-index" )
				});
				$.each([ "top", "left", "bottom", "right" ], function(i, pos) {
					props[ pos ] = element.css( pos );
					if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
						props[ pos ] = "auto";
					}
				});
				element.css({
					position: "relative",
					top: 0,
					left: 0,
					right: "auto",
					bottom: "auto"
				});
			}
			element.css(size);
	
			return wrapper.css( props ).show();
		},
	
		removeWrapper: function( element ) {
			var active = document.activeElement;
	
			if ( element.parent().is( ".ui-effects-wrapper" ) ) {
				element.parent().replaceWith( element );
	
				// Fixes #7595 - Elements lose focus when wrapped.
				if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
					$( active ).focus();
				}
			}
	
			return 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;
		}
	});
	
	// return an effect options object for the given parameters:
	function _normalizeArguments( effect, options, speed, callback ) {
	
		// allow passing all options as the first parameter
		if ( $.isPlainObject( effect ) ) {
			options = effect;
			effect = effect.effect;
		}
	
		// convert to an object
		effect = { effect: effect };
	
		// catch (effect, null, ...)
		if ( options == null ) {
			options = {};
		}
	
		// catch (effect, callback)
		if ( $.isFunction( options ) ) {
			callback = options;
			speed = null;
			options = {};
		}
	
		// catch (effect, speed, ?)
		if ( typeof options === "number" || $.fx.speeds[ options ] ) {
			callback = speed;
			speed = options;
			options = {};
		}
	
		// catch (effect, options, callback)
		if ( $.isFunction( speed ) ) {
			callback = speed;
			speed = null;
		}
	
		// add options to effect
		if ( options ) {
			$.extend( effect, options );
		}
	
		speed = speed || options.duration;
		effect.duration = $.fx.off ? 0 :
			typeof speed === "number" ? speed :
			speed in $.fx.speeds ? $.fx.speeds[ speed ] :
			$.fx.speeds._default;
	
		effect.complete = callback || options.complete;
	
		return effect;
	}
	
	function standardAnimationOption( option ) {
		// Valid standard speeds (nothing, number, named speed)
		if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
			return true;
		}
	
		// Invalid strings - treat as "normal" speed
		if ( typeof option === "string" && !$.effects.effect[ option ] ) {
			return true;
		}
	
		// Complete callback
		if ( $.isFunction( option ) ) {
			return true;
		}
	
		// Options hash (but not naming an effect)
		if ( typeof option === "object" && !option.effect ) {
			return true;
		}
	
		// Didn't match any standard API
		return false;
	}
	
	$.fn.extend({
		effect: function(  ) {
			var args = _normalizeArguments.apply( this, arguments ),
				mode = args.mode,
				queue = args.queue,
				effectMethod = $.effects.effect[ args.effect ];
	
			if ( $.fx.off || !effectMethod ) {
				// delegate to the original method (e.g., .show()) if possible
				if ( mode ) {
					return this[ mode ]( args.duration, args.complete );
				} else {
					return this.each( function() {
						if ( args.complete ) {
							args.complete.call( this );
						}
					});
				}
			}
	
			function run( next ) {
				var elem = $( this ),
					complete = args.complete,
					mode = args.mode;
	
				function done() {
					if ( $.isFunction( complete ) ) {
						complete.call( elem[0] );
					}
					if ( $.isFunction( next ) ) {
						next();
					}
				}
	
				// If the element already has the correct final state, delegate to
				// the core methods so the internal tracking of "olddisplay" works.
				if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
					elem[ mode ]();
					done();
				} else {
					effectMethod.call( elem[0], args, done );
				}
			}
	
			return queue === false ? this.each( run ) : this.queue( queue || "fx", 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 ),
	
		// helper functions
		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;
		}
	});
	
	})();
	
	
	
	
	
	(function() {
	
	// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
	
	var baseEasings = {};
	
	$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
		baseEasings[ name ] = function( p ) {
			return Math.pow( p, i + 2 );
		};
	});
	
	$.extend( baseEasings, {
		Sine: function( p ) {
			return 1 - Math.cos( p * Math.PI / 2 );
		},
		Circ: function( p ) {
			return 1 - Math.sqrt( 1 - p * p );
		},
		Elastic: function( p ) {
			return p === 0 || p === 1 ? p :
				-Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
		},
		Back: function( p ) {
			return p * p * ( 3 * p - 2 );
		},
		Bounce: function( p ) {
			var pow2,
				bounce = 4;
	
			while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
			return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
		}
	});
	
	$.each( baseEasings, function( name, easeIn ) {
		$.easing[ "easeIn" + name ] = easeIn;
		$.easing[ "easeOut" + name ] = function( p ) {
			return 1 - easeIn( 1 - p );
		};
		$.easing[ "easeInOut" + name ] = function( p ) {
			return p < 0.5 ?
				easeIn( p * 2 ) / 2 :
				1 - easeIn( p * -2 + 2 ) / 2;
		};
	});
	
	})();
	
	var effect = $.effects;
	
	
	
	
	
	var effectBlind = $.effects.effect.blind = function( o, done ) {
		// Create element
		var el = $( this ),
			rvertical = /up|down|vertical/,
			rpositivemotion = /up|left|vertical|horizontal/,
			props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
			mode = $.effects.setMode( el, o.mode || "hide" ),
			direction = o.direction || "up",
			vertical = rvertical.test( direction ),
			ref = vertical ? "height" : "width",
			ref2 = vertical ? "top" : "left",
			motion = rpositivemotion.test( direction ),
			animation = {},
			show = mode === "show",
			wrapper, distance, margin;
	
		// if already wrapped, the wrapper's properties are my property. #6245
		if ( el.parent().is( ".ui-effects-wrapper" ) ) {
			$.effects.save( el.parent(), props );
		} else {
			$.effects.save( el, props );
		}
		el.show();
		wrapper = $.effects.createWrapper( el ).css({
			overflow: "hidden"
		});
	
		distance = wrapper[ ref ]();
		margin = parseFloat( wrapper.css( ref2 ) ) || 0;
	
		animation[ ref ] = show ? distance : 0;
		if ( !motion ) {
			el
				.css( vertical ? "bottom" : "right", 0 )
				.css( vertical ? "top" : "left", "auto" )
				.css({ position: "absolute" });
	
			animation[ ref2 ] = show ? margin : distance + margin;
		}
	
		// start at 0 if we are showing
		if ( show ) {
			wrapper.css( ref, 0 );
			if ( !motion ) {
				wrapper.css( ref2, margin + distance );
			}
		}
	
		// Animate
		wrapper.animate( animation, {
			duration: o.duration,
			easing: o.easing,
			queue: false,
			complete: function() {
				if ( mode === "hide" ) {
					el.hide();
				}
				$.effects.restore( el, props );
				$.effects.removeWrapper( el );
				done();
			}
		});
	};
	
	
	
	
	
	var effectBounce = $.effects.effect.bounce = function( o, done ) {
		var el = $( this ),
			props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
	
			// defaults:
			mode = $.effects.setMode( el, o.mode || "effect" ),
			hide = mode === "hide",
			show = mode === "show",
			direction = o.direction || "up",
			distance = o.distance,
			times = o.times || 5,
	
			// number of internal animations
			anims = times * 2 + ( show || hide ? 1 : 0 ),
			speed = o.duration / anims,
			easing = o.easing,
	
			// utility:
			ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
			motion = ( direction === "up" || direction === "left" ),
			i,
			upAnim,
			downAnim,
	
			// we will need to re-assemble the queue to stack our animations in place
			queue = el.queue(),
			queuelen = queue.length;
	
		// Avoid touching opacity to prevent clearType and PNG issues in IE
		if ( show || hide ) {
			props.push( "opacity" );
		}
	
		$.effects.save( el, props );
		el.show();
		$.effects.createWrapper( el ); // Create Wrapper
	
		// default distance for the BIGGEST bounce is the outer Distance / 3
		if ( !distance ) {
			distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
		}
	
		if ( show ) {
			downAnim = { opacity: 1 };
			downAnim[ ref ] = 0;
	
			// if we are showing, force opacity 0 and set the initial position
			// then do the "first" animation
			el.css( "opacity", 0 )
				.css( ref, motion ? -distance * 2 : distance * 2 )
				.animate( downAnim, speed, easing );
		}
	
		// start at the smallest distance if we are hiding
		if ( hide ) {
			distance = distance / Math.pow( 2, times - 1 );
		}
	
		downAnim = {};
		downAnim[ ref ] = 0;
		// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
		for ( i = 0; i < times; i++ ) {
			upAnim = {};
			upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
	
			el.animate( upAnim, speed, easing )
				.animate( downAnim, speed, easing );
	
			distance = hide ? distance * 2 : distance / 2;
		}
	
		// Last Bounce when Hiding
		if ( hide ) {
			upAnim = { opacity: 0 };
			upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
	
			el.animate( upAnim, speed, easing );
		}
	
		el.queue(function() {
			if ( hide ) {
				el.hide();
			}
			$.effects.restore( el, props );
			$.effects.removeWrapper( el );
			done();
		});
	
		// inject all the animations we just queued to be first in line (after "inprogress")
		if ( queuelen > 1) {
			queue.splice.apply( queue,
				[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
		}
		el.dequeue();
	
	};
	
	
	
	
	
	var effectClip = $.effects.effect.clip = function( o, done ) {
		// Create element
		var el = $( this ),
			props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
			mode = $.effects.setMode( el, o.mode || "hide" ),
			show = mode === "show",
			direction = o.direction || "vertical",
			vert = direction === "vertical",
			size = vert ? "height" : "width",
			position = vert ? "top" : "left",
			animation = {},
			wrapper, animate, distance;
	
		// Save & Show
		$.effects.save( el, props );
		el.show();
	
		// Create Wrapper
		wrapper = $.effects.createWrapper( el ).css({
			overflow: "hidden"
		});
		animate = ( el[0].tagName === "IMG" ) ? wrapper : el;
		distance = animate[ size ]();
	
		// Shift
		if ( show ) {
			animate.css( size, 0 );
			animate.css( position, distance / 2 );
		}
	
		// Create Animation Object:
		animation[ size ] = show ? distance : 0;
		animation[ position ] = show ? 0 : distance / 2;
	
		// Animate
		animate.animate( animation, {
			queue: false,
			duration: o.duration,
			easing: o.easing,
			complete: function() {
				if ( !show ) {
					el.hide();
				}
				$.effects.restore( el, props );
				$.effects.removeWrapper( el );
				done();
			}
		});
	
	};
	
	
	
	
	
	var effectDrop = $.effects.effect.drop = function( o, done ) {
	
		var el = $( this ),
			props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
			mode = $.effects.setMode( el, o.mode || "hide" ),
			show = mode === "show",
			direction = o.direction || "left",
			ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
			motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
			animation = {
				opacity: show ? 1 : 0
			},
			distance;
	
		// Adjust
		$.effects.save( el, props );
		el.show();
		$.effects.createWrapper( el );
	
		distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
	
		if ( show ) {
			el
				.css( "opacity", 0 )
				.css( ref, motion === "pos" ? -distance : distance );
		}
	
		// Animation
		animation[ ref ] = ( show ?
			( motion === "pos" ? "+=" : "-=" ) :
			( motion === "pos" ? "-=" : "+=" ) ) +
			distance;
	
		// Animate
		el.animate( animation, {
			queue: false,
			duration: o.duration,
			easing: o.easing,
			complete: function() {
				if ( mode === "hide" ) {
					el.hide();
				}
				$.effects.restore( el, props );
				$.effects.removeWrapper( el );
				done();
			}
		});
	};
	
	
	
	
	
	var effectExplode = $.effects.effect.explode = function( o, done ) {
	
		var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
			cells = rows,
			el = $( this ),
			mode = $.effects.setMode( el, o.mode || "hide" ),
			show = mode === "show",
	
			// show and then visibility:hidden the element before calculating offset
			offset = el.show().css( "visibility", "hidden" ).offset(),
	
			// width and height of a piece
			width = Math.ceil( el.outerWidth() / cells ),
			height = Math.ceil( el.outerHeight() / rows ),
			pieces = [],
	
			// loop
			i, j, left, top, mx, my;
	
		// children animate complete:
		function childComplete() {
			pieces.push( this );
			if ( pieces.length === rows * cells ) {
				animComplete();
			}
		}
	
		// clone the element for each row and cell.
		for ( 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 ;
	
				// Create a clone of the now hidden main element that will be absolute positioned
				// within a wrapper div off the -left and -top equal to size of our pieces
				el
					.clone()
					.appendTo( "body" )
					.wrap( "<div></div>" )
					.css({
						position: "absolute",
						visibility: "visible",
						left: -j * width,
						top: -i * height
					})
	
				// select the wrapper - make it overflow: hidden and absolute positioned based on
				// where the original was located +left and +top equal to the size of pieces
					.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
					}, o.duration || 500, o.easing, childComplete );
			}
		}
	
		function animComplete() {
			el.css({
				visibility: "visible"
			});
			$( pieces ).remove();
			if ( !show ) {
				el.hide();
			}
			done();
		}
	};
	
	
	
	
	
	var effectFade = $.effects.effect.fade = function( o, done ) {
		var el = $( this ),
			mode = $.effects.setMode( el, o.mode || "toggle" );
	
		el.animate({
			opacity: mode
		}, {
			queue: false,
			duration: o.duration,
			easing: o.easing,
			complete: done
		});
	};
	
	
	
	
	
	var effectFold = $.effects.effect.fold = function( o, done ) {
	
		// Create element
		var el = $( this ),
			props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
			mode = $.effects.setMode( el, o.mode || "hide" ),
			show = mode === "show",
			hide = mode === "hide",
			size = o.size || 15,
			percent = /([0-9]+)%/.exec( size ),
			horizFirst = !!o.horizFirst,
			widthFirst = show !== horizFirst,
			ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],
			duration = o.duration / 2,
			wrapper, distance,
			animation1 = {},
			animation2 = {};
	
		$.effects.save( el, props );
		el.show();
	
		// Create Wrapper
		wrapper = $.effects.createWrapper( el ).css({
			overflow: "hidden"
		});
		distance = widthFirst ?
			[ wrapper.width(), wrapper.height() ] :
			[ wrapper.height(), wrapper.width() ];
	
		if ( percent ) {
			size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
		}
		if ( show ) {
			wrapper.css( horizFirst ? {
				height: 0,
				width: size
			} : {
				height: size,
				width: 0
			});
		}
	
		// Animation
		animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
		animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
	
		// Animate
		wrapper
			.animate( animation1, duration, o.easing )
			.animate( animation2, duration, o.easing, function() {
				if ( hide ) {
					el.hide();
				}
				$.effects.restore( el, props );
				$.effects.removeWrapper( el );
				done();
			});
	
	};
	
	
	
	
	
	var effectHighlight = $.effects.effect.highlight = function( o, done ) {
		var elem = $( this ),
			props = [ "backgroundImage", "backgroundColor", "opacity" ],
			mode = $.effects.setMode( elem, o.mode || "show" ),
			animation = {
				backgroundColor: elem.css( "backgroundColor" )
			};
	
		if (mode === "hide") {
			animation.opacity = 0;
		}
	
		$.effects.save( elem, props );
	
		elem
			.show()
			.css({
				backgroundImage: "none",
				backgroundColor: o.color || "#ffff99"
			})
			.animate( animation, {
				queue: false,
				duration: o.duration,
				easing: o.easing,
				complete: function() {
					if ( mode === "hide" ) {
						elem.hide();
					}
					$.effects.restore( elem, props );
					done();
				}
			});
	};
	
	
	
	
	
	var effectSize = $.effects.effect.size = function( o, done ) {
	
		// Create element
		var original, baseline, factor,
			el = $( this ),
			props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
	
			// Always restore
			props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
	
			// Copy for children
			props2 = [ "width", "height", "overflow" ],
			cProps = [ "fontSize" ],
			vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
			hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
	
			// Set options
			mode = $.effects.setMode( el, o.mode || "effect" ),
			restore = o.restore || mode !== "effect",
			scale = o.scale || "both",
			origin = o.origin || [ "middle", "center" ],
			position = el.css( "position" ),
			props = restore ? props0 : props1,
			zero = {
				height: 0,
				width: 0,
				outerHeight: 0,
				outerWidth: 0
			};
	
		if ( mode === "show" ) {
			el.show();
		}
		original = {
			height: el.height(),
			width: el.width(),
			outerHeight: el.outerHeight(),
			outerWidth: el.outerWidth()
		};
	
		if ( o.mode === "toggle" && mode === "show" ) {
			el.from = o.to || zero;
			el.to = o.from || original;
		} else {
			el.from = o.from || ( mode === "show" ? zero : original );
			el.to = o.to || ( mode === "hide" ? zero : original );
		}
	
		// Set scaling factor
		factor = {
			from: {
				y: el.from.height / original.height,
				x: el.from.width / original.width
			},
			to: {
				y: el.to.height / original.height,
				x: el.to.width / original.width
			}
		};
	
		// Scale the css box
		if ( scale === "box" || scale === "both" ) {
	
			// Vertical props scaling
			if ( factor.from.y !== factor.to.y ) {
				props = props.concat( vProps );
				el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
				el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
			}
	
			// Horizontal props scaling
			if ( factor.from.x !== factor.to.x ) {
				props = props.concat( hProps );
				el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
				el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
			}
		}
	
		// Scale the content
		if ( scale === "content" || scale === "both" ) {
	
			// Vertical props scaling
			if ( factor.from.y !== factor.to.y ) {
				props = props.concat( cProps ).concat( props2 );
				el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
				el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
			}
		}
	
		$.effects.save( el, props );
		el.show();
		$.effects.createWrapper( el );
		el.css( "overflow", "hidden" ).css( el.from );
	
		// Adjust
		if (origin) { // Calculate baseline shifts
			baseline = $.effects.getBaseline( origin, original );
			el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
			el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
			el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
			el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
		}
		el.css( el.from ); // set top & left
	
		// Animate
		if ( scale === "content" || scale === "both" ) { // Scale the children
	
			// Add margins/font-size
			vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
			hProps = hProps.concat([ "marginLeft", "marginRight" ]);
			props2 = props0.concat(vProps).concat(hProps);
	
			el.find( "*[width]" ).each( function() {
				var child = $( this ),
					c_original = {
						height: child.height(),
						width: child.width(),
						outerHeight: child.outerHeight(),
						outerWidth: child.outerWidth()
					};
				if (restore) {
					$.effects.save(child, props2);
				}
	
				child.from = {
					height: c_original.height * factor.from.y,
					width: c_original.width * factor.from.x,
					outerHeight: c_original.outerHeight * factor.from.y,
					outerWidth: c_original.outerWidth * factor.from.x
				};
				child.to = {
					height: c_original.height * factor.to.y,
					width: c_original.width * factor.to.x,
					outerHeight: c_original.height * factor.to.y,
					outerWidth: c_original.width * factor.to.x
				};
	
				// Vertical props scaling
				if ( factor.from.y !== factor.to.y ) {
					child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
					child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
				}
	
				// Horizontal props scaling
				if ( factor.from.x !== factor.to.x ) {
					child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
					child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
				}
	
				// Animate children
				child.css( child.from );
				child.animate( child.to, o.duration, o.easing, function() {
	
					// Restore children
					if ( restore ) {
						$.effects.restore( child, props2 );
					}
				});
			});
		}
	
		// Animate
		el.animate( el.to, {
			queue: false,
			duration: o.duration,
			easing: o.easing,
			complete: function() {
				if ( el.to.opacity === 0 ) {
					el.css( "opacity", el.from.opacity );
				}
				if ( mode === "hide" ) {
					el.hide();
				}
				$.effects.restore( el, props );
				if ( !restore ) {
	
					// we need to calculate our new positioning based on the scaling
					if ( position === "static" ) {
						el.css({
							position: "relative",
							top: el.to.top,
							left: el.to.left
						});
					} else {
						$.each([ "top", "left" ], function( idx, pos ) {
							el.css( pos, function( _, str ) {
								var val = parseInt( str, 10 ),
									toRef = idx ? el.to.left : el.to.top;
	
								// if original was "auto", recalculate the new value from wrapper
								if ( str === "auto" ) {
									return toRef + "px";
								}
	
								return val + toRef + "px";
							});
						});
					}
				}
	
				$.effects.removeWrapper( el );
				done();
			}
		});
	
	};
	
	
	
	
	
	var effectScale = $.effects.effect.scale = function( o, done ) {
	
		// Create element
		var el = $( this ),
			options = $.extend( true, {}, o ),
			mode = $.effects.setMode( el, o.mode || "effect" ),
			percent = parseInt( o.percent, 10 ) ||
				( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
			direction = o.direction || "both",
			origin = o.origin,
			original = {
				height: el.height(),
				width: el.width(),
				outerHeight: el.outerHeight(),
				outerWidth: el.outerWidth()
			},
			factor = {
				y: direction !== "horizontal" ? (percent / 100) : 1,
				x: direction !== "vertical" ? (percent / 100) : 1
			};
	
		// We are going to pass this effect to the size effect:
		options.effect = "size";
		options.queue = false;
		options.complete = done;
	
		// Set default origin and restore for show/hide
		if ( mode !== "effect" ) {
			options.origin = origin || [ "middle", "center" ];
			options.restore = true;
		}
	
		options.from = o.from || ( mode === "show" ? {
			height: 0,
			width: 0,
			outerHeight: 0,
			outerWidth: 0
		} : original );
		options.to = {
			height: original.height * factor.y,
			width: original.width * factor.x,
			outerHeight: original.outerHeight * factor.y,
			outerWidth: original.outerWidth * factor.x
		};
	
		// Fade option to support puff
		if ( options.fade ) {
			if ( mode === "show" ) {
				options.from.opacity = 0;
				options.to.opacity = 1;
			}
			if ( mode === "hide" ) {
				options.from.opacity = 1;
				options.to.opacity = 0;
			}
		}
	
		// Animate
		el.effect( options );
	
	};
	
	
	
	
	
	var effectPuff = $.effects.effect.puff = function( o, done ) {
		var elem = $( this ),
			mode = $.effects.setMode( elem, o.mode || "hide" ),
			hide = mode === "hide",
			percent = parseInt( o.percent, 10 ) || 150,
			factor = percent / 100,
			original = {
				height: elem.height(),
				width: elem.width(),
				outerHeight: elem.outerHeight(),
				outerWidth: elem.outerWidth()
			};
	
		$.extend( o, {
			effect: "scale",
			queue: false,
			fade: true,
			mode: mode,
			complete: done,
			percent: hide ? percent : 100,
			from: hide ?
				original :
				{
					height: original.height * factor,
					width: original.width * factor,
					outerHeight: original.outerHeight * factor,
					outerWidth: original.outerWidth * factor
				}
		});
	
		elem.effect( o );
	};
	
	
	
	
	
	var effectPulsate = $.effects.effect.pulsate = function( o, done ) {
		var elem = $( this ),
			mode = $.effects.setMode( elem, o.mode || "show" ),
			show = mode === "show",
			hide = mode === "hide",
			showhide = ( show || mode === "hide" ),
	
			// showing or hiding leaves of the "last" animation
			anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
			duration = o.duration / anims,
			animateTo = 0,
			queue = elem.queue(),
			queuelen = queue.length,
			i;
	
		if ( show || !elem.is(":visible")) {
			elem.css( "opacity", 0 ).show();
			animateTo = 1;
		}
	
		// anims - 1 opacity "toggles"
		for ( i = 1; i < anims; i++ ) {
			elem.animate({
				opacity: animateTo
			}, duration, o.easing );
			animateTo = 1 - animateTo;
		}
	
		elem.animate({
			opacity: animateTo
		}, duration, o.easing);
	
		elem.queue(function() {
			if ( hide ) {
				elem.hide();
			}
			done();
		});
	
		// We just queued up "anims" animations, we need to put them next in the queue
		if ( queuelen > 1 ) {
			queue.splice.apply( queue,
				[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
		}
		elem.dequeue();
	};
	
	
	
	
	
	var effectShake = $.effects.effect.shake = function( o, done ) {
	
		var el = $( this ),
			props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
			mode = $.effects.setMode( el, o.mode || "effect" ),
			direction = o.direction || "left",
			distance = o.distance || 20,
			times = o.times || 3,
			anims = times * 2 + 1,
			speed = Math.round( o.duration / anims ),
			ref = (direction === "up" || direction === "down") ? "top" : "left",
			positiveMotion = (direction === "up" || direction === "left"),
			animation = {},
			animation1 = {},
			animation2 = {},
			i,
	
			// we will need to re-assemble the queue to stack our animations in place
			queue = el.queue(),
			queuelen = queue.length;
	
		$.effects.save( el, props );
		el.show();
		$.effects.createWrapper( el );
	
		// Animation
		animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
		animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
		animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
	
		// Animate
		el.animate( animation, speed, o.easing );
	
		// Shakes
		for ( i = 1; i < times; i++ ) {
			el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
		}
		el
			.animate( animation1, speed, o.easing )
			.animate( animation, speed / 2, o.easing )
			.queue(function() {
				if ( mode === "hide" ) {
					el.hide();
				}
				$.effects.restore( el, props );
				$.effects.removeWrapper( el );
				done();
			});
	
		// inject all the animations we just queued to be first in line (after "inprogress")
		if ( queuelen > 1) {
			queue.splice.apply( queue,
				[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
		}
		el.dequeue();
	
	};
	
	
	
	
	
	var effectSlide = $.effects.effect.slide = function( o, done ) {
	
		// Create element
		var el = $( this ),
			props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
			mode = $.effects.setMode( el, o.mode || "show" ),
			show = mode === "show",
			direction = o.direction || "left",
			ref = (direction === "up" || direction === "down") ? "top" : "left",
			positiveMotion = (direction === "up" || direction === "left"),
			distance,
			animation = {};
	
		// Adjust
		$.effects.save( el, props );
		el.show();
		distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
	
		$.effects.createWrapper( el ).css({
			overflow: "hidden"
		});
	
		if ( show ) {
			el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
		}
	
		// Animation
		animation[ ref ] = ( show ?
			( positiveMotion ? "+=" : "-=") :
			( positiveMotion ? "-=" : "+=")) +
			distance;
	
		// Animate
		el.animate( animation, {
			queue: false,
			duration: o.duration,
			easing: o.easing,
			complete: function() {
				if ( mode === "hide" ) {
					el.hide();
				}
				$.effects.restore( el, props );
				$.effects.removeWrapper( el );
				done();
			}
		});
	};
	
	
	
	
	
	var effectTransfer = $.effects.effect.transfer = function( o, done ) {
		var elem = $( this ),
			target = $( o.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 = elem.offset(),
			transfer = $( "<div class='ui-effects-transfer'></div>" )
				.appendTo( document.body )
				.addClass( o.className )
				.css({
					top: startPosition.top - fixTop,
					left: startPosition.left - fixLeft,
					height: elem.innerHeight(),
					width: elem.innerWidth(),
					position: targetFixed ? "fixed" : "absolute"
				})
				.animate( animation, o.duration, o.easing, function() {
					transfer.remove();
					done();
				});
	};
	
	
	
	
	
	var progressbar = $.widget( "ui.progressbar", {
		version: "1.11.4",
		options: {
			max: 100,
			value: 0,
	
			change: null,
			complete: null
		},
	
		min: 0,
	
		_create: function() {
			// Constrain initial value
			this.oldValue = this.options.value = this._constrainedValue();
	
			this.element
				.addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
				.attr({
					// Only set static values, aria-valuenow and aria-valuemax are
					// set inside _refreshValue()
					role: "progressbar",
					"aria-valuemin": this.min
				});
	
			this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
				.appendTo( this.element );
	
			this._refreshValue();
		},
	
		_destroy: function() {
			this.element
				.removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
				.removeAttr( "role" )
				.removeAttr( "aria-valuemin" )
				.removeAttr( "aria-valuemax" )
				.removeAttr( "aria-valuenow" );
	
			this.valueDiv.remove();
		},
	
		value: function( newValue ) {
			if ( newValue === undefined ) {
				return this.options.value;
			}
	
			this.options.value = this._constrainedValue( newValue );
			this._refreshValue();
		},
	
		_constrainedValue: function( newValue ) {
			if ( newValue === undefined ) {
				newValue = this.options.value;
			}
	
			this.indeterminate = newValue === false;
	
			// sanitize value
			if ( typeof newValue !== "number" ) {
				newValue = 0;
			}
	
			return this.indeterminate ? false :
				Math.min( this.options.max, Math.max( this.min, newValue ) );
		},
	
		_setOptions: function( options ) {
			// Ensure "value" option is set after other values (like max)
			var value = options.value;
			delete options.value;
	
			this._super( options );
	
			this.options.value = this._constrainedValue( value );
			this._refreshValue();
		},
	
		_setOption: function( key, value ) {
			if ( key === "max" ) {
				// Don't allow a max less than min
				value = Math.max( this.min, value );
			}
			if ( key === "disabled" ) {
				this.element
					.toggleClass( "ui-state-disabled", !!value )
					.attr( "aria-disabled", value );
			}
			this._super( key, value );
		},
	
		_percentage: function() {
			return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
		},
	
		_refreshValue: function() {
			var value = this.options.value,
				percentage = this._percentage();
	
			this.valueDiv
				.toggle( this.indeterminate || value > this.min )
				.toggleClass( "ui-corner-right", value === this.options.max )
				.width( percentage.toFixed(0) + "%" );
	
			this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
	
			if ( this.indeterminate ) {
				this.element.removeAttr( "aria-valuenow" );
				if ( !this.overlayDiv ) {
					this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
				}
			} else {
				this.element.attr({
					"aria-valuemax": this.options.max,
					"aria-valuenow": value
				});
				if ( this.overlayDiv ) {
					this.overlayDiv.remove();
					this.overlayDiv = null;
				}
			}
	
			if ( this.oldValue !== value ) {
				this.oldValue = value;
				this._trigger( "change" );
			}
			if ( value === this.options.max ) {
				this._trigger( "complete" );
			}
		}
	});
	
	
	
	
	
	var selectable = $.widget("ui.selectable", $.ui.mouse, {
		version: "1.11.4",
		options: {
			appendTo: "body",
			autoRefresh: true,
			distance: 0,
			filter: "*",
			tolerance: "touch",
	
			// callbacks
			selected: null,
			selecting: null,
			start: null,
			stop: null,
			unselected: null,
			unselecting: null
		},
		_create: function() {
			var selectees,
				that = this;
	
			this.element.addClass("ui-selectable");
	
			this.dragged = false;
	
			// cache selectee children based on filter
			this.refresh = function() {
				selectees = $(that.options.filter, that.element[0]);
				selectees.addClass("ui-selectee");
				selectees.each(function() {
					var $this = $(this),
						pos = $this.offset();
					$.data(this, "selectable-item", {
						element: this,
						$element: $this,
						left: pos.left,
						top: pos.top,
						right: pos.left + $this.outerWidth(),
						bottom: pos.top + $this.outerHeight(),
						startselected: false,
						selected: $this.hasClass("ui-selected"),
						selecting: $this.hasClass("ui-selecting"),
						unselecting: $this.hasClass("ui-unselecting")
					});
				});
			};
			this.refresh();
	
			this.selectees = selectees.addClass("ui-selectee");
	
			this._mouseInit();
	
			this.helper = $("<div class='ui-selectable-helper'></div>");
		},
	
		_destroy: function() {
			this.selectees
				.removeClass("ui-selectee")
				.removeData("selectable-item");
			this.element
				.removeClass("ui-selectable ui-selectable-disabled");
			this._mouseDestroy();
		},
	
		_mouseStart: function(event) {
			var that = this,
				options = this.options;
	
			this.opos = [ event.pageX, event.pageY ];
	
			if (this.options.disabled) {
				return;
			}
	
			this.selectees = $(options.filter, this.element[0]);
	
			this._trigger("start", event);
	
			$(options.appendTo).append(this.helper);
			// position helper (lasso)
			this.helper.css({
				"left": event.pageX,
				"top": event.pageY,
				"width": 0,
				"height": 0
			});
	
			if (options.autoRefresh) {
				this.refresh();
			}
	
			this.selectees.filter(".ui-selected").each(function() {
				var selectee = $.data(this, "selectable-item");
				selectee.startselected = true;
				if (!event.metaKey && !event.ctrlKey) {
					selectee.$element.removeClass("ui-selected");
					selectee.selected = false;
					selectee.$element.addClass("ui-unselecting");
					selectee.unselecting = true;
					// selectable UNSELECTING callback
					that._trigger("unselecting", event, {
						unselecting: selectee.element
					});
				}
			});
	
			$(event.target).parents().addBack().each(function() {
				var doSelect,
					selectee = $.data(this, "selectable-item");
				if (selectee) {
					doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
					selectee.$element
						.removeClass(doSelect ? "ui-unselecting" : "ui-selected")
						.addClass(doSelect ? "ui-selecting" : "ui-unselecting");
					selectee.unselecting = !doSelect;
					selectee.selecting = doSelect;
					selectee.selected = doSelect;
					// selectable (UN)SELECTING callback
					if (doSelect) {
						that._trigger("selecting", event, {
							selecting: selectee.element
						});
					} else {
						that._trigger("unselecting", event, {
							unselecting: selectee.element
						});
					}
					return false;
				}
			});
	
		},
	
		_mouseDrag: function(event) {
	
			this.dragged = true;
	
			if (this.options.disabled) {
				return;
			}
	
			var tmp,
				that = this,
				options = this.options,
				x1 = this.opos[0],
				y1 = this.opos[1],
				x2 = event.pageX,
				y2 = event.pageY;
	
			if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
			if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
			this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
	
			this.selectees.each(function() {
				var selectee = $.data(this, "selectable-item"),
					hit = false;
	
				//prevent helper from being selected if appendTo: selectable
				if (!selectee || selectee.element === that.element[0]) {
					return;
				}
	
				if (options.tolerance === "touch") {
					hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
				} else if (options.tolerance === "fit") {
					hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
				}
	
				if (hit) {
					// SELECT
					if (selectee.selected) {
						selectee.$element.removeClass("ui-selected");
						selectee.selected = false;
					}
					if (selectee.unselecting) {
						selectee.$element.removeClass("ui-unselecting");
						selectee.unselecting = false;
					}
					if (!selectee.selecting) {
						selectee.$element.addClass("ui-selecting");
						selectee.selecting = true;
						// selectable SELECTING callback
						that._trigger("selecting", event, {
							selecting: selectee.element
						});
					}
				} else {
					// UNSELECT
					if (selectee.selecting) {
						if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
							selectee.$element.removeClass("ui-selecting");
							selectee.selecting = false;
							selectee.$element.addClass("ui-selected");
							selectee.selected = true;
						} else {
							selectee.$element.removeClass("ui-selecting");
							selectee.selecting = false;
							if (selectee.startselected) {
								selectee.$element.addClass("ui-unselecting");
								selectee.unselecting = true;
							}
							// selectable UNSELECTING callback
							that._trigger("unselecting", event, {
								unselecting: selectee.element
							});
						}
					}
					if (selectee.selected) {
						if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
							selectee.$element.removeClass("ui-selected");
							selectee.selected = false;
	
							selectee.$element.addClass("ui-unselecting");
							selectee.unselecting = true;
							// selectable UNSELECTING callback
							that._trigger("unselecting", event, {
								unselecting: selectee.element
							});
						}
					}
				}
			});
	
			return false;
		},
	
		_mouseStop: function(event) {
			var that = this;
	
			this.dragged = false;
	
			$(".ui-unselecting", this.element[0]).each(function() {
				var selectee = $.data(this, "selectable-item");
				selectee.$element.removeClass("ui-unselecting");
				selectee.unselecting = false;
				selectee.startselected = false;
				that._trigger("unselected", event, {
					unselected: selectee.element
				});
			});
			$(".ui-selecting", this.element[0]).each(function() {
				var selectee = $.data(this, "selectable-item");
				selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
				selectee.selecting = false;
				selectee.selected = true;
				selectee.startselected = true;
				that._trigger("selected", event, {
					selected: selectee.element
				});
			});
			this._trigger("stop", event);
	
			this.helper.remove();
	
			return false;
		}
	
	});
	
	
	
	
	
	var selectmenu = $.widget( "ui.selectmenu", {
		version: "1.11.4",
		defaultElement: "<select>",
		options: {
			appendTo: null,
			disabled: null,
			icons: {
				button: "ui-icon-triangle-1-s"
			},
			position: {
				my: "left top",
				at: "left bottom",
				collision: "none"
			},
			width: null,
	
			// callbacks
			change: null,
			close: null,
			focus: null,
			open: null,
			select: null
		},
	
		_create: function() {
			var selectmenuId = this.element.uniqueId().attr( "id" );
			this.ids = {
				element: selectmenuId,
				button: selectmenuId + "-button",
				menu: selectmenuId + "-menu"
			};
	
			this._drawButton();
			this._drawMenu();
	
			if ( this.options.disabled ) {
				this.disable();
			}
		},
	
		_drawButton: function() {
			var that = this;
	
			// Associate existing label with the new button
			this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
			this._on( this.label, {
				click: function( event ) {
					this.button.focus();
					event.preventDefault();
				}
			});
	
			// Hide original select element
			this.element.hide();
	
			// Create button
			this.button = $( "<span>", {
				"class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
				tabindex: this.options.disabled ? -1 : 0,
				id: this.ids.button,
				role: "combobox",
				"aria-expanded": "false",
				"aria-autocomplete": "list",
				"aria-owns": this.ids.menu,
				"aria-haspopup": "true"
			})
				.insertAfter( this.element );
	
			$( "<span>", {
				"class": "ui-icon " + this.options.icons.button
			})
				.prependTo( this.button );
	
			this.buttonText = $( "<span>", {
				"class": "ui-selectmenu-text"
			})
				.appendTo( this.button );
	
			this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
			this._resizeButton();
	
			this._on( this.button, this._buttonEvents );
			this.button.one( "focusin", function() {
	
				// Delay rendering the menu items until the button receives focus.
				// The menu may have already been rendered via a programmatic open.
				if ( !that.menuItems ) {
					that._refreshMenu();
				}
			});
			this._hoverable( this.button );
			this._focusable( this.button );
		},
	
		_drawMenu: function() {
			var that = this;
	
			// Create menu
			this.menu = $( "<ul>", {
				"aria-hidden": "true",
				"aria-labelledby": this.ids.button,
				id: this.ids.menu
			});
	
			// Wrap menu
			this.menuWrap = $( "<div>", {
				"class": "ui-selectmenu-menu ui-front"
			})
				.append( this.menu )
				.appendTo( this._appendTo() );
	
			// Initialize menu widget
			this.menuInstance = this.menu
				.menu({
					role: "listbox",
					select: function( event, ui ) {
						event.preventDefault();
	
						// support: IE8
						// If the item was selected via a click, the text selection
						// will be destroyed in IE
						that._setSelection();
	
						that._select( ui.item.data( "ui-selectmenu-item" ), event );
					},
					focus: function( event, ui ) {
						var item = ui.item.data( "ui-selectmenu-item" );
	
						// Prevent inital focus from firing and check if its a newly focused item
						if ( that.focusIndex != null && item.index !== that.focusIndex ) {
							that._trigger( "focus", event, { item: item } );
							if ( !that.isOpen ) {
								that._select( item, event );
							}
						}
						that.focusIndex = item.index;
	
						that.button.attr( "aria-activedescendant",
							that.menuItems.eq( item.index ).attr( "id" ) );
					}
				})
				.menu( "instance" );
	
			// Adjust menu styles to dropdown
			this.menu
				.addClass( "ui-corner-bottom" )
				.removeClass( "ui-corner-all" );
	
			// Don't close the menu on mouseleave
			this.menuInstance._off( this.menu, "mouseleave" );
	
			// Cancel the menu's collapseAll on document click
			this.menuInstance._closeOnDocumentClick = function() {
				return false;
			};
	
			// Selects often contain empty items, but never contain dividers
			this.menuInstance._isDivider = function() {
				return false;
			};
		},
	
		refresh: function() {
			this._refreshMenu();
			this._setText( this.buttonText, this._getSelectedItem().text() );
			if ( !this.options.width ) {
				this._resizeButton();
			}
		},
	
		_refreshMenu: function() {
			this.menu.empty();
	
			var item,
				options = this.element.find( "option" );
	
			if ( !options.length ) {
				return;
			}
	
			this._parseOptions( options );
			this._renderMenu( this.menu, this.items );
	
			this.menuInstance.refresh();
			this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
	
			item = this._getSelectedItem();
	
			// Update the menu to have the correct item focused
			this.menuInstance.focus( null, item );
			this._setAria( item.data( "ui-selectmenu-item" ) );
	
			// Set disabled state
			this._setOption( "disabled", this.element.prop( "disabled" ) );
		},
	
		open: function( event ) {
			if ( this.options.disabled ) {
				return;
			}
	
			// If this is the first time the menu is being opened, render the items
			if ( !this.menuItems ) {
				this._refreshMenu();
			} else {
	
				// Menu clears focus on close, reset focus to selected item
				this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
				this.menuInstance.focus( null, this._getSelectedItem() );
			}
	
			this.isOpen = true;
			this._toggleAttr();
			this._resizeMenu();
			this._position();
	
			this._on( this.document, this._documentClick );
	
			this._trigger( "open", event );
		},
	
		_position: function() {
			this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
		},
	
		close: function( event ) {
			if ( !this.isOpen ) {
				return;
			}
	
			this.isOpen = false;
			this._toggleAttr();
	
			this.range = null;
			this._off( this.document );
	
			this._trigger( "close", event );
		},
	
		widget: function() {
			return this.button;
		},
	
		menuWidget: function() {
			return this.menu;
		},
	
		_renderMenu: function( ul, items ) {
			var that = this,
				currentOptgroup = "";
	
			$.each( items, function( index, item ) {
				if ( item.optgroup !== currentOptgroup ) {
					$( "<li>", {
						"class": "ui-selectmenu-optgroup ui-menu-divider" +
							( item.element.parent( "optgroup" ).prop( "disabled" ) ?
								" ui-state-disabled" :
								"" ),
						text: item.optgroup
					})
						.appendTo( ul );
	
					currentOptgroup = item.optgroup;
				}
	
				that._renderItemData( ul, item );
			});
		},
	
		_renderItemData: function( ul, item ) {
			return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
		},
	
		_renderItem: function( ul, item ) {
			var li = $( "<li>" );
	
			if ( item.disabled ) {
				li.addClass( "ui-state-disabled" );
			}
			this._setText( li, item.label );
	
			return li.appendTo( ul );
		},
	
		_setText: function( element, value ) {
			if ( value ) {
				element.text( value );
			} else {
				element.html( "&#160;" );
			}
		},
	
		_move: function( direction, event ) {
			var item, next,
				filter = ".ui-menu-item";
	
			if ( this.isOpen ) {
				item = this.menuItems.eq( this.focusIndex );
			} else {
				item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
				filter += ":not(.ui-state-disabled)";
			}
	
			if ( direction === "first" || direction === "last" ) {
				next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
			} else {
				next = item[ direction + "All" ]( filter ).eq( 0 );
			}
	
			if ( next.length ) {
				this.menuInstance.focus( event, next );
			}
		},
	
		_getSelectedItem: function() {
			return this.menuItems.eq( this.element[ 0 ].selectedIndex );
		},
	
		_toggle: function( event ) {
			this[ this.isOpen ? "close" : "open" ]( event );
		},
	
		_setSelection: function() {
			var selection;
	
			if ( !this.range ) {
				return;
			}
	
			if ( window.getSelection ) {
				selection = window.getSelection();
				selection.removeAllRanges();
				selection.addRange( this.range );
	
			// support: IE8
			} else {
				this.range.select();
			}
	
			// support: IE
			// Setting the text selection kills the button focus in IE, but
			// restoring the focus doesn't kill the selection.
			this.button.focus();
		},
	
		_documentClick: {
			mousedown: function( event ) {
				if ( !this.isOpen ) {
					return;
				}
	
				if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
					this.close( event );
				}
			}
		},
	
		_buttonEvents: {
	
			// Prevent text selection from being reset when interacting with the selectmenu (#10144)
			mousedown: function() {
				var selection;
	
				if ( window.getSelection ) {
					selection = window.getSelection();
					if ( selection.rangeCount ) {
						this.range = selection.getRangeAt( 0 );
					}
	
				// support: IE8
				} else {
					this.range = document.selection.createRange();
				}
			},
	
			click: function( event ) {
				this._setSelection();
				this._toggle( event );
			},
	
			keydown: function( event ) {
				var preventDefault = true;
				switch ( event.keyCode ) {
					case $.ui.keyCode.TAB:
					case $.ui.keyCode.ESCAPE:
						this.close( event );
						preventDefault = false;
						break;
					case $.ui.keyCode.ENTER:
						if ( this.isOpen ) {
							this._selectFocusedItem( event );
						}
						break;
					case $.ui.keyCode.UP:
						if ( event.altKey ) {
							this._toggle( event );
						} else {
							this._move( "prev", event );
						}
						break;
					case $.ui.keyCode.DOWN:
						if ( event.altKey ) {
							this._toggle( event );
						} else {
							this._move( "next", event );
						}
						break;
					case $.ui.keyCode.SPACE:
						if ( this.isOpen ) {
							this._selectFocusedItem( event );
						} else {
							this._toggle( event );
						}
						break;
					case $.ui.keyCode.LEFT:
						this._move( "prev", event );
						break;
					case $.ui.keyCode.RIGHT:
						this._move( "next", event );
						break;
					case $.ui.keyCode.HOME:
					case $.ui.keyCode.PAGE_UP:
						this._move( "first", event );
						break;
					case $.ui.keyCode.END:
					case $.ui.keyCode.PAGE_DOWN:
						this._move( "last", event );
						break;
					default:
						this.menu.trigger( event );
						preventDefault = false;
				}
	
				if ( preventDefault ) {
					event.preventDefault();
				}
			}
		},
	
		_selectFocusedItem: function( event ) {
			var item = this.menuItems.eq( this.focusIndex );
			if ( !item.hasClass( "ui-state-disabled" ) ) {
				this._select( item.data( "ui-selectmenu-item" ), event );
			}
		},
	
		_select: function( item, event ) {
			var oldIndex = this.element[ 0 ].selectedIndex;
	
			// Change native select element
			this.element[ 0 ].selectedIndex = item.index;
			this._setText( this.buttonText, item.label );
			this._setAria( item );
			this._trigger( "select", event, { item: item } );
	
			if ( item.index !== oldIndex ) {
				this._trigger( "change", event, { item: item } );
			}
	
			this.close( event );
		},
	
		_setAria: function( item ) {
			var id = this.menuItems.eq( item.index ).attr( "id" );
	
			this.button.attr({
				"aria-labelledby": id,
				"aria-activedescendant": id
			});
			this.menu.attr( "aria-activedescendant", id );
		},
	
		_setOption: function( key, value ) {
			if ( key === "icons" ) {
				this.button.find( "span.ui-icon" )
					.removeClass( this.options.icons.button )
					.addClass( value.button );
			}
	
			this._super( key, value );
	
			if ( key === "appendTo" ) {
				this.menuWrap.appendTo( this._appendTo() );
			}
	
			if ( key === "disabled" ) {
				this.menuInstance.option( "disabled", value );
				this.button
					.toggleClass( "ui-state-disabled", value )
					.attr( "aria-disabled", value );
	
				this.element.prop( "disabled", value );
				if ( value ) {
					this.button.attr( "tabindex", -1 );
					this.close();
				} else {
					this.button.attr( "tabindex", 0 );
				}
			}
	
			if ( key === "width" ) {
				this._resizeButton();
			}
		},
	
		_appendTo: function() {
			var element = this.options.appendTo;
	
			if ( element ) {
				element = element.jquery || element.nodeType ?
					$( element ) :
					this.document.find( element ).eq( 0 );
			}
	
			if ( !element || !element[ 0 ] ) {
				element = this.element.closest( ".ui-front" );
			}
	
			if ( !element.length ) {
				element = this.document[ 0 ].body;
			}
	
			return element;
		},
	
		_toggleAttr: function() {
			this.button
				.toggleClass( "ui-corner-top", this.isOpen )
				.toggleClass( "ui-corner-all", !this.isOpen )
				.attr( "aria-expanded", this.isOpen );
			this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen );
			this.menu.attr( "aria-hidden", !this.isOpen );
		},
	
		_resizeButton: function() {
			var width = this.options.width;
	
			if ( !width ) {
				width = this.element.show().outerWidth();
				this.element.hide();
			}
	
			this.button.outerWidth( width );
		},
	
		_resizeMenu: function() {
			this.menu.outerWidth( Math.max(
				this.button.outerWidth(),
	
				// support: IE10
				// IE10 wraps long text (possibly a rounding bug)
				// so we add 1px to avoid the wrapping
				this.menu.width( "" ).outerWidth() + 1
			) );
		},
	
		_getCreateOptions: function() {
			return { disabled: this.element.prop( "disabled" ) };
		},
	
		_parseOptions: function( options ) {
			var data = [];
			options.each(function( index, item ) {
				var option = $( item ),
					optgroup = option.parent( "optgroup" );
				data.push({
					element: option,
					index: index,
					value: option.val(),
					label: option.text(),
					optgroup: optgroup.attr( "label" ) || "",
					disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
				});
			});
			this.items = data;
		},
	
		_destroy: function() {
			this.menuWrap.remove();
			this.button.remove();
			this.element.show();
			this.element.removeUniqueId();
			this.label.attr( "for", this.ids.element );
		}
	});
	
	
	
	
	
	var slider = $.widget( "ui.slider", $.ui.mouse, {
		version: "1.11.4",
		widgetEventPrefix: "slide",
	
		options: {
			animate: false,
			distance: 0,
			max: 100,
			min: 0,
			orientation: "horizontal",
			range: false,
			step: 1,
			value: 0,
			values: null,
	
			// callbacks
			change: null,
			slide: null,
			start: null,
			stop: null
		},
	
		// number of pages in a slider
		// (how many times can you page up/down to go through the whole range)
		numPages: 5,
	
		_create: function() {
			this._keySliding = false;
			this._mouseSliding = false;
			this._animateOff = true;
			this._handleIndex = null;
			this._detectOrientation();
			this._mouseInit();
			this._calculateNewMax();
	
			this.element
				.addClass( "ui-slider" +
					" ui-slider-" + this.orientation +
					" ui-widget" +
					" ui-widget-content" +
					" ui-corner-all");
	
			this._refresh();
			this._setOption( "disabled", this.options.disabled );
	
			this._animateOff = false;
		},
	
		_refresh: function() {
			this._createRange();
			this._createHandles();
			this._setupEvents();
			this._refreshValue();
		},
	
		_createHandles: function() {
			var i, handleCount,
				options = this.options,
				existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
				handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
				handles = [];
	
			handleCount = ( options.values && options.values.length ) || 1;
	
			if ( existingHandles.length > handleCount ) {
				existingHandles.slice( handleCount ).remove();
				existingHandles = existingHandles.slice( 0, handleCount );
			}
	
			for ( i = existingHandles.length; i < handleCount; i++ ) {
				handles.push( handle );
			}
	
			this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
	
			this.handle = this.handles.eq( 0 );
	
			this.handles.each(function( i ) {
				$( this ).data( "ui-slider-handle-index", i );
			});
		},
	
		_createRange: function() {
			var options = this.options,
				classes = "";
	
			if ( options.range ) {
				if ( options.range === true ) {
					if ( !options.values ) {
						options.values = [ this._valueMin(), this._valueMin() ];
					} else if ( options.values.length && options.values.length !== 2 ) {
						options.values = [ options.values[0], options.values[0] ];
					} else if ( $.isArray( options.values ) ) {
						options.values = options.values.slice(0);
					}
				}
	
				if ( !this.range || !this.range.length ) {
					this.range = $( "<div></div>" )
						.appendTo( this.element );
	
					classes = "ui-slider-range" +
					// note: this isn't the most fittingly semantic framework class for this element,
					// but worked best visually with a variety of themes
					" ui-widget-header ui-corner-all";
				} else {
					this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
						// Handle range switching from true to min/max
						.css({
							"left": "",
							"bottom": ""
						});
				}
	
				this.range.addClass( classes +
					( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
			} else {
				if ( this.range ) {
					this.range.remove();
				}
				this.range = null;
			}
		},
	
		_setupEvents: function() {
			this._off( this.handles );
			this._on( this.handles, this._handleEvents );
			this._hoverable( this.handles );
			this._focusable( this.handles );
		},
	
		_destroy: function() {
			this.handles.remove();
			if ( this.range ) {
				this.range.remove();
			}
	
			this.element
				.removeClass( "ui-slider" +
					" ui-slider-horizontal" +
					" ui-slider-vertical" +
					" ui-widget" +
					" ui-widget-content" +
					" ui-corner-all" );
	
			this._mouseDestroy();
		},
	
		_mouseCapture: function( event ) {
			var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
				that = this,
				o = this.options;
	
			if ( o.disabled ) {
				return false;
			}
	
			this.elementSize = {
				width: this.element.outerWidth(),
				height: this.element.outerHeight()
			};
			this.elementOffset = this.element.offset();
	
			position = { x: event.pageX, y: event.pageY };
			normValue = this._normValueFromMouse( position );
			distance = this._valueMax() - this._valueMin() + 1;
			this.handles.each(function( i ) {
				var thisDistance = Math.abs( normValue - that.values(i) );
				if (( distance > thisDistance ) ||
					( distance === thisDistance &&
						(i === that._lastChangedValue || that.values(i) === o.min ))) {
					distance = thisDistance;
					closestHandle = $( this );
					index = i;
				}
			});
	
			allowed = this._start( event, index );
			if ( allowed === false ) {
				return false;
			}
			this._mouseSliding = true;
	
			this._handleIndex = index;
	
			closestHandle
				.addClass( "ui-state-active" )
				.focus();
	
			offset = closestHandle.offset();
			mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
			this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
				left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
				top: event.pageY - offset.top -
					( closestHandle.height() / 2 ) -
					( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
					( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
					( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
			};
	
			if ( !this.handles.hasClass( "ui-state-hover" ) ) {
				this._slide( event, index, normValue );
			}
			this._animateOff = true;
			return true;
		},
	
		_mouseStart: function() {
			return true;
		},
	
		_mouseDrag: function( event ) {
			var position = { x: event.pageX, y: event.pageY },
				normValue = this._normValueFromMouse( position );
	
			this._slide( event, this._handleIndex, normValue );
	
			return false;
		},
	
		_mouseStop: function( event ) {
			this.handles.removeClass( "ui-state-active" );
			this._mouseSliding = false;
	
			this._stop( event, this._handleIndex );
			this._change( event, this._handleIndex );
	
			this._handleIndex = null;
			this._clickOffset = null;
			this._animateOff = false;
	
			return false;
		},
	
		_detectOrientation: function() {
			this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
		},
	
		_normValueFromMouse: function( position ) {
			var pixelTotal,
				pixelMouse,
				percentMouse,
				valueTotal,
				valueMouse;
	
			if ( this.orientation === "horizontal" ) {
				pixelTotal = this.elementSize.width;
				pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
			} else {
				pixelTotal = this.elementSize.height;
				pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
			}
	
			percentMouse = ( pixelMouse / pixelTotal );
			if ( percentMouse > 1 ) {
				percentMouse = 1;
			}
			if ( percentMouse < 0 ) {
				percentMouse = 0;
			}
			if ( this.orientation === "vertical" ) {
				percentMouse = 1 - percentMouse;
			}
	
			valueTotal = this._valueMax() - this._valueMin();
			valueMouse = this._valueMin() + percentMouse * valueTotal;
	
			return this._trimAlignValue( valueMouse );
		},
	
		_start: function( event, index ) {
			var uiHash = {
				handle: this.handles[ index ],
				value: this.value()
			};
			if ( this.options.values && this.options.values.length ) {
				uiHash.value = this.values( index );
				uiHash.values = this.values();
			}
			return this._trigger( "start", event, uiHash );
		},
	
		_slide: function( event, index, newVal ) {
			var otherVal,
				newValues,
				allowed;
	
			if ( this.options.values && this.options.values.length ) {
				otherVal = this.values( index ? 0 : 1 );
	
				if ( ( this.options.values.length === 2 && this.options.range === true ) &&
						( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
					) {
					newVal = otherVal;
				}
	
				if ( newVal !== this.values( index ) ) {
					newValues = this.values();
					newValues[ index ] = newVal;
					// A slide can be canceled by returning false from the slide callback
					allowed = this._trigger( "slide", event, {
						handle: this.handles[ index ],
						value: newVal,
						values: newValues
					} );
					otherVal = this.values( index ? 0 : 1 );
					if ( allowed !== false ) {
						this.values( index, newVal );
					}
				}
			} else {
				if ( newVal !== this.value() ) {
					// A slide can be canceled by returning false from the slide callback
					allowed = this._trigger( "slide", event, {
						handle: this.handles[ index ],
						value: newVal
					} );
					if ( allowed !== false ) {
						this.value( newVal );
					}
				}
			}
		},
	
		_stop: function( event, index ) {
			var uiHash = {
				handle: this.handles[ index ],
				value: this.value()
			};
			if ( this.options.values && this.options.values.length ) {
				uiHash.value = this.values( index );
				uiHash.values = this.values();
			}
	
			this._trigger( "stop", event, uiHash );
		},
	
		_change: function( event, index ) {
			if ( !this._keySliding && !this._mouseSliding ) {
				var uiHash = {
					handle: this.handles[ index ],
					value: this.value()
				};
				if ( this.options.values && this.options.values.length ) {
					uiHash.value = this.values( index );
					uiHash.values = this.values();
				}
	
				//store the last changed value index for reference when handles overlap
				this._lastChangedValue = index;
	
				this._trigger( "change", event, uiHash );
			}
		},
	
		value: function( newValue ) {
			if ( arguments.length ) {
				this.options.value = this._trimAlignValue( newValue );
				this._refreshValue();
				this._change( null, 0 );
				return;
			}
	
			return this._value();
		},
	
		values: function( index, newValue ) {
			var vals,
				newValues,
				i;
	
			if ( arguments.length > 1 ) {
				this.options.values[ index ] = this._trimAlignValue( newValue );
				this._refreshValue();
				this._change( null, index );
				return;
			}
	
			if ( arguments.length ) {
				if ( $.isArray( arguments[ 0 ] ) ) {
					vals = this.options.values;
					newValues = arguments[ 0 ];
					for ( i = 0; i < vals.length; i += 1 ) {
						vals[ i ] = this._trimAlignValue( newValues[ i ] );
						this._change( null, i );
					}
					this._refreshValue();
				} else {
					if ( this.options.values && this.options.values.length ) {
						return this._values( index );
					} else {
						return this.value();
					}
				}
			} else {
				return this._values();
			}
		},
	
		_setOption: function( key, value ) {
			var i,
				valsLength = 0;
	
			if ( key === "range" && this.options.range === true ) {
				if ( value === "min" ) {
					this.options.value = this._values( 0 );
					this.options.values = null;
				} else if ( value === "max" ) {
					this.options.value = this._values( this.options.values.length - 1 );
					this.options.values = null;
				}
			}
	
			if ( $.isArray( this.options.values ) ) {
				valsLength = this.options.values.length;
			}
	
			if ( key === "disabled" ) {
				this.element.toggleClass( "ui-state-disabled", !!value );
			}
	
			this._super( key, value );
	
			switch ( key ) {
				case "orientation":
					this._detectOrientation();
					this.element
						.removeClass( "ui-slider-horizontal ui-slider-vertical" )
						.addClass( "ui-slider-" + this.orientation );
					this._refreshValue();
	
					// Reset positioning from previous orientation
					this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
					break;
				case "value":
					this._animateOff = true;
					this._refreshValue();
					this._change( null, 0 );
					this._animateOff = false;
					break;
				case "values":
					this._animateOff = true;
					this._refreshValue();
					for ( i = 0; i < valsLength; i += 1 ) {
						this._change( null, i );
					}
					this._animateOff = false;
					break;
				case "step":
				case "min":
				case "max":
					this._animateOff = true;
					this._calculateNewMax();
					this._refreshValue();
					this._animateOff = false;
					break;
				case "range":
					this._animateOff = true;
					this._refresh();
					this._animateOff = false;
					break;
			}
		},
	
		//internal value getter
		// _value() returns value trimmed by min and max, aligned by step
		_value: function() {
			var val = this.options.value;
			val = this._trimAlignValue( val );
	
			return val;
		},
	
		//internal values getter
		// _values() returns array of values trimmed by min and max, aligned by step
		// _values( index ) returns single value trimmed by min and max, aligned by step
		_values: function( index ) {
			var val,
				vals,
				i;
	
			if ( arguments.length ) {
				val = this.options.values[ index ];
				val = this._trimAlignValue( val );
	
				return val;
			} else if ( this.options.values && this.options.values.length ) {
				// .slice() creates a copy of the array
				// this copy gets trimmed by min and max and then returned
				vals = this.options.values.slice();
				for ( i = 0; i < vals.length; i += 1) {
					vals[ i ] = this._trimAlignValue( vals[ i ] );
				}
	
				return vals;
			} else {
				return [];
			}
		},
	
		// returns the step-aligned value that val is closest to, between (inclusive) min and max
		_trimAlignValue: function( val ) {
			if ( val <= this._valueMin() ) {
				return this._valueMin();
			}
			if ( val >= this._valueMax() ) {
				return this._valueMax();
			}
			var step = ( this.options.step > 0 ) ? this.options.step : 1,
				valModStep = (val - this._valueMin()) % step,
				alignValue = val - valModStep;
	
			if ( Math.abs(valModStep) * 2 >= step ) {
				alignValue += ( valModStep > 0 ) ? step : ( -step );
			}
	
			// Since JavaScript has problems with large floats, round
			// the final value to 5 digits after the decimal point (see #4124)
			return parseFloat( alignValue.toFixed(5) );
		},
	
		_calculateNewMax: function() {
			var max = this.options.max,
				min = this._valueMin(),
				step = this.options.step,
				aboveMin = Math.floor( ( +( max - min ).toFixed( this._precision() ) ) / step ) * step;
			max = aboveMin + min;
			this.max = parseFloat( max.toFixed( this._precision() ) );
		},
	
		_precision: function() {
			var precision = this._precisionOf( this.options.step );
			if ( this.options.min !== null ) {
				precision = Math.max( precision, this._precisionOf( this.options.min ) );
			}
			return precision;
		},
	
		_precisionOf: function( num ) {
			var str = num.toString(),
				decimal = str.indexOf( "." );
			return decimal === -1 ? 0 : str.length - decimal - 1;
		},
	
		_valueMin: function() {
			return this.options.min;
		},
	
		_valueMax: function() {
			return this.max;
		},
	
		_refreshValue: function() {
			var lastValPercent, valPercent, value, valueMin, valueMax,
				oRange = this.options.range,
				o = this.options,
				that = this,
				animate = ( !this._animateOff ) ? o.animate : false,
				_set = {};
	
			if ( this.options.values && this.options.values.length ) {
				this.handles.each(function( i ) {
					valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
					_set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
					$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
					if ( that.options.range === true ) {
						if ( that.orientation === "horizontal" ) {
							if ( i === 0 ) {
								that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
							}
							if ( i === 1 ) {
								that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
							}
						} else {
							if ( i === 0 ) {
								that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
							}
							if ( i === 1 ) {
								that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
							}
						}
					}
					lastValPercent = valPercent;
				});
			} else {
				value = this.value();
				valueMin = this._valueMin();
				valueMax = this._valueMax();
				valPercent = ( valueMax !== valueMin ) ?
						( value - valueMin ) / ( valueMax - valueMin ) * 100 :
						0;
				_set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
				this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
	
				if ( oRange === "min" && this.orientation === "horizontal" ) {
					this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
				}
				if ( oRange === "max" && this.orientation === "horizontal" ) {
					this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
				}
				if ( oRange === "min" && this.orientation === "vertical" ) {
					this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
				}
				if ( oRange === "max" && this.orientation === "vertical" ) {
					this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
				}
			}
		},
	
		_handleEvents: {
			keydown: function( event ) {
				var allowed, curVal, newVal, step,
					index = $( event.target ).data( "ui-slider-handle-index" );
	
				switch ( event.keyCode ) {
					case $.ui.keyCode.HOME:
					case $.ui.keyCode.END:
					case $.ui.keyCode.PAGE_UP:
					case $.ui.keyCode.PAGE_DOWN:
					case $.ui.keyCode.UP:
					case $.ui.keyCode.RIGHT:
					case $.ui.keyCode.DOWN:
					case $.ui.keyCode.LEFT:
						event.preventDefault();
						if ( !this._keySliding ) {
							this._keySliding = true;
							$( event.target ).addClass( "ui-state-active" );
							allowed = this._start( event, index );
							if ( allowed === false ) {
								return;
							}
						}
						break;
				}
	
				step = this.options.step;
				if ( this.options.values && this.options.values.length ) {
					curVal = newVal = this.values( index );
				} else {
					curVal = newVal = this.value();
				}
	
				switch ( event.keyCode ) {
					case $.ui.keyCode.HOME:
						newVal = this._valueMin();
						break;
					case $.ui.keyCode.END:
						newVal = this._valueMax();
						break;
					case $.ui.keyCode.PAGE_UP:
						newVal = this._trimAlignValue(
							curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
						);
						break;
					case $.ui.keyCode.PAGE_DOWN:
						newVal = this._trimAlignValue(
							curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) );
						break;
					case $.ui.keyCode.UP:
					case $.ui.keyCode.RIGHT:
						if ( curVal === this._valueMax() ) {
							return;
						}
						newVal = this._trimAlignValue( curVal + step );
						break;
					case $.ui.keyCode.DOWN:
					case $.ui.keyCode.LEFT:
						if ( curVal === this._valueMin() ) {
							return;
						}
						newVal = this._trimAlignValue( curVal - step );
						break;
				}
	
				this._slide( event, index, newVal );
			},
			keyup: function( event ) {
				var index = $( event.target ).data( "ui-slider-handle-index" );
	
				if ( this._keySliding ) {
					this._keySliding = false;
					this._stop( event, index );
					this._change( event, index );
					$( event.target ).removeClass( "ui-state-active" );
				}
			}
		}
	});
	
	
	
	
	
	var sortable = $.widget("ui.sortable", $.ui.mouse, {
		version: "1.11.4",
		widgetEventPrefix: "sort",
		ready: false,
		options: {
			appendTo: "parent",
			axis: false,
			connectWith: false,
			containment: false,
			cursor: "auto",
			cursorAt: false,
			dropOnEmpty: true,
			forcePlaceholderSize: false,
			forceHelperSize: false,
			grid: false,
			handle: false,
			helper: "original",
			items: "> *",
			opacity: false,
			placeholder: false,
			revert: false,
			scroll: true,
			scrollSensitivity: 20,
			scrollSpeed: 20,
			scope: "default",
			tolerance: "intersect",
			zIndex: 1000,
	
			// callbacks
			activate: null,
			beforeStop: null,
			change: null,
			deactivate: null,
			out: null,
			over: null,
			receive: null,
			remove: null,
			sort: null,
			start: null,
			stop: null,
			update: null
		},
	
		_isOverAxis: function( x, reference, size ) {
			return ( x >= reference ) && ( x < ( reference + size ) );
		},
	
		_isFloating: function( item ) {
			return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
		},
	
		_create: function() {
			this.containerCache = {};
			this.element.addClass("ui-sortable");
	
			//Get the items
			this.refresh();
	
			//Let's determine the parent's offset
			this.offset = this.element.offset();
	
			//Initialize mouse events for interaction
			this._mouseInit();
	
			this._setHandleClassName();
	
			//We're ready to go
			this.ready = true;
	
		},
	
		_setOption: function( key, value ) {
			this._super( key, value );
	
			if ( key === "handle" ) {
				this._setHandleClassName();
			}
		},
	
		_setHandleClassName: function() {
			this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
			$.each( this.items, function() {
				( this.instance.options.handle ?
					this.item.find( this.instance.options.handle ) : this.item )
					.addClass( "ui-sortable-handle" );
			});
		},
	
		_destroy: function() {
			this.element
				.removeClass( "ui-sortable ui-sortable-disabled" )
				.find( ".ui-sortable-handle" )
					.removeClass( "ui-sortable-handle" );
			this._mouseDestroy();
	
			for ( var i = this.items.length - 1; i >= 0; i-- ) {
				this.items[i].item.removeData(this.widgetName + "-item");
			}
	
			return this;
		},
	
		_mouseCapture: function(event, overrideHandle) {
			var currentItem = null,
				validHandle = false,
				that = this;
	
			if (this.reverting) {
				return false;
			}
	
			if(this.options.disabled || this.options.type === "static") {
				return false;
			}
	
			//We have to refresh the items data once first
			this._refreshItems(event);
	
			//Find out if the clicked node (or one of its parents) is a actual item in this.items
			$(event.target).parents().each(function() {
				if($.data(this, that.widgetName + "-item") === that) {
					currentItem = $(this);
					return false;
				}
			});
			if($.data(event.target, that.widgetName + "-item") === that) {
				currentItem = $(event.target);
			}
	
			if(!currentItem) {
				return false;
			}
			if(this.options.handle && !overrideHandle) {
				$(this.options.handle, currentItem).find("*").addBack().each(function() {
					if(this === event.target) {
						validHandle = true;
					}
				});
				if(!validHandle) {
					return false;
				}
			}
	
			this.currentItem = currentItem;
			this._removeCurrentsFromItems();
			return true;
	
		},
	
		_mouseStart: function(event, overrideHandle, noActivation) {
	
			var i, body,
				o = this.options;
	
			this.currentContainer = this;
	
			//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
			this.refreshPositions();
	
			//Create and append the visible helper
			this.helper = this._createHelper(event);
	
			//Cache the helper size
			this._cacheHelperProportions();
	
			
	
			//Cache the margins of the original element
			this._cacheMargins();
	
			//Get the next scrolling parent
			this.scrollParent = this.helper.scrollParent();
	
			//The element's absolute position on the page minus margins
			this.offset = this.currentItem.offset();
			this.offset = {
				top: this.offset.top - this.margins.top,
				left: this.offset.left - this.margins.left
			};
	
			$.extend(this.offset, {
				click: { //Where the click happened, relative to the element
					left: event.pageX - this.offset.left,
					top: event.pageY - this.offset.top
				},
				parent: this._getParentOffset(),
				relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
			});
	
			// Only after we got the offset, we can change the helper's position to absolute
			// TODO: Still need to figure out a way to make relative sorting possible
			this.helper.css("position", "absolute");
			this.cssPosition = this.helper.css("position");
	
			//Generate the original position
			this.originalPosition = this._generatePosition(event);
			this.originalPageX = event.pageX;
			this.originalPageY = event.pageY;
	
			//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
			(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
	
			//Cache the former DOM position
			this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
	
			//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
			if(this.helper[0] !== this.currentItem[0]) {
				this.currentItem.hide();
			}
	
			//Create the placeholder
			this._createPlaceholder();
	
			//Set a containment if given in the options
			if(o.containment) {
				this._setContainment();
			}
	
			if( o.cursor && o.cursor !== "auto" ) { // cursor option
				body = this.document.find( "body" );
	
				// support: IE
				this.storedCursor = body.css( "cursor" );
				body.css( "cursor", o.cursor );
	
				this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
			}
	
			if(o.opacity) { // opacity option
				if (this.helper.css("opacity")) {
					this._storedOpacity = this.helper.css("opacity");
				}
				this.helper.css("opacity", o.opacity);
			}
	
			if(o.zIndex) { // zIndex option
				if (this.helper.css("zIndex")) {
					this._storedZIndex = this.helper.css("zIndex");
				}
				this.helper.css("zIndex", o.zIndex);
			}
	
			//Prepare scrolling
			if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
				this.overflowOffset = this.scrollParent.offset();
			}
	
			//Call callbacks
			this._trigger("start", event, this._uiHash());
	
			//Recache the helper size
			if(!this._preserveHelperProportions) {
				this._cacheHelperProportions();
			}
	
	
			//Post "activate" events to possible containers
			if( !noActivation ) {
				for ( i = this.containers.length - 1; i >= 0; i-- ) {
					this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
				}
			}
	
			//Prepare possible droppables
			if($.ui.ddmanager) {
				$.ui.ddmanager.current = this;
			}
	
			if ($.ui.ddmanager && !o.dropBehaviour) {
				$.ui.ddmanager.prepareOffsets(this, event);
			}
	
			this.dragging = true;
	
			this.helper.addClass("ui-sortable-helper");
			this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
			return true;
	
		},
	
		_mouseDrag: function(event) {
			var i, item, itemElement, intersection,
				o = this.options,
				scrolled = false;
	
			//Compute the helpers position
			this.position = this._generatePosition(event);
			this.positionAbs = this._convertPositionTo("absolute");
	
			if (!this.lastPositionAbs) {
				this.lastPositionAbs = this.positionAbs;
			}
	
			//Do scrolling
			if(this.options.scroll) {
				if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
	
					if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
						this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
					} else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
						this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
					}
	
					if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
						this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
					} else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
						this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
					}
	
				} else {
	
					if(event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
						scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
					} else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
						scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
					}
	
					if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
						scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
					} else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
						scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
					}
	
				}
	
				if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
					$.ui.ddmanager.prepareOffsets(this, event);
				}
			}
	
			//Regenerate the absolute position used for position checks
			this.positionAbs = this._convertPositionTo("absolute");
	
			//Set the helper position
			if(!this.options.axis || this.options.axis !== "y") {
				this.helper[0].style.left = this.position.left+"px";
			}
			if(!this.options.axis || this.options.axis !== "x") {
				this.helper[0].style.top = this.position.top+"px";
			}
	
			//Rearrange
			for (i = this.items.length - 1; i >= 0; i--) {
	
				//Cache variables and intersection, continue if no intersection
				item = this.items[i];
				itemElement = item.item[0];
				intersection = this._intersectsWithPointer(item);
				if (!intersection) {
					continue;
				}
	
				// Only put the placeholder inside the current Container, skip all
				// items from other containers. This works because when moving
				// an item from one container to another the
				// currentContainer is switched before the placeholder is moved.
				//
				// Without this, moving items in "sub-sortables" can cause
				// the placeholder to jitter between the outer and inner container.
				if (item.instance !== this.currentContainer) {
					continue;
				}
	
				// cannot intersect with itself
				// no useless actions that have been done before
				// no action if the item moved is the parent of the item checked
				if (itemElement !== this.currentItem[0] &&
					this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
					!$.contains(this.placeholder[0], itemElement) &&
					(this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
				) {
	
					this.direction = intersection === 1 ? "down" : "up";
	
					if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
						this._rearrange(event, item);
					} else {
						break;
					}
	
					this._trigger("change", event, this._uiHash());
					break;
				}
			}
	
			//Post events to containers
			this._contactContainers(event);
	
			//Interconnect with droppables
			if($.ui.ddmanager) {
				$.ui.ddmanager.drag(this, event);
			}
	
			//Call callbacks
			this._trigger("sort", event, this._uiHash());
	
			this.lastPositionAbs = this.positionAbs;
			return false;
	
		},
	
		_mouseStop: function(event, noPropagation) {
	
			if(!event) {
				return;
			}
	
			//If we are using droppables, inform the manager about the drop
			if ($.ui.ddmanager && !this.options.dropBehaviour) {
				$.ui.ddmanager.drop(this, event);
			}
	
			if(this.options.revert) {
				var that = this,
					cur = this.placeholder.offset(),
					axis = this.options.axis,
					animation = {};
	
				if ( !axis || axis === "x" ) {
					animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
				}
				if ( !axis || axis === "y" ) {
					animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
				}
				this.reverting = true;
				$(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
					that._clear(event);
				});
			} else {
				this._clear(event, noPropagation);
			}
	
			return false;
	
		},
	
		cancel: function() {
	
			if(this.dragging) {
	
				this._mouseUp({ target: null });
	
				if(this.options.helper === "original") {
					this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
				} else {
					this.currentItem.show();
				}
	
				//Post deactivating events to containers
				for (var i = this.containers.length - 1; i >= 0; i--){
					this.containers[i]._trigger("deactivate", null, this._uiHash(this));
					if(this.containers[i].containerCache.over) {
						this.containers[i]._trigger("out", null, this._uiHash(this));
						this.containers[i].containerCache.over = 0;
					}
				}
	
			}
	
			if (this.placeholder) {
				//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
				if(this.placeholder[0].parentNode) {
					this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
				}
				if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
					this.helper.remove();
				}
	
				$.extend(this, {
					helper: null,
					dragging: false,
					reverting: false,
					_noFinalSort: null
				});
	
				if(this.domPosition.prev) {
					$(this.domPosition.prev).after(this.currentItem);
				} else {
					$(this.domPosition.parent).prepend(this.currentItem);
				}
			}
	
			return this;
	
		},
	
		serialize: function(o) {
	
			var items = this._getItemsAsjQuery(o && o.connected),
				str = [];
			o = o || {};
	
			$(items).each(function() {
				var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
				if (res) {
					str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
				}
			});
	
			if(!str.length && o.key) {
				str.push(o.key + "=");
			}
	
			return str.join("&");
	
		},
	
		toArray: function(o) {
	
			var items = this._getItemsAsjQuery(o && o.connected),
				ret = [];
	
			o = o || {};
	
			items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
			return ret;
	
		},
	
		
		_intersectsWith: function(item) {
	
			var x1 = this.positionAbs.left,
				x2 = x1 + this.helperProportions.width,
				y1 = this.positionAbs.top,
				y2 = y1 + this.helperProportions.height,
				l = item.left,
				r = l + item.width,
				t = item.top,
				b = t + item.height,
				dyClick = this.offset.click.top,
				dxClick = this.offset.click.left,
				isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
				isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
				isOverElement = isOverElementHeight && isOverElementWidth;
	
			if ( this.options.tolerance === "pointer" ||
				this.options.forcePointerForContainers ||
				(this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
			) {
				return isOverElement;
			} else {
	
				return (l < x1 + (this.helperProportions.width / 2) && // Right Half
					x2 - (this.helperProportions.width / 2) < r && // Left Half
					t < y1 + (this.helperProportions.height / 2) && // Bottom Half
					y2 - (this.helperProportions.height / 2) < b ); // Top Half
	
			}
		},
	
		_intersectsWithPointer: function(item) {
	
			var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
				isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
				isOverElement = isOverElementHeight && isOverElementWidth,
				verticalDirection = this._getDragVerticalDirection(),
				horizontalDirection = this._getDragHorizontalDirection();
	
			if (!isOverElement) {
				return false;
			}
	
			return this.floating ?
				( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
				: ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
	
		},
	
		_intersectsWithSides: function(item) {
	
			var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
				isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
				verticalDirection = this._getDragVerticalDirection(),
				horizontalDirection = this._getDragHorizontalDirection();
	
			if (this.floating && horizontalDirection) {
				return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
			} else {
				return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
			}
	
		},
	
		_getDragVerticalDirection: function() {
			var delta = this.positionAbs.top - this.lastPositionAbs.top;
			return delta !== 0 && (delta > 0 ? "down" : "up");
		},
	
		_getDragHorizontalDirection: function() {
			var delta = this.positionAbs.left - this.lastPositionAbs.left;
			return delta !== 0 && (delta > 0 ? "right" : "left");
		},
	
		refresh: function(event) {
			this._refreshItems(event);
			this._setHandleClassName();
			this.refreshPositions();
			return this;
		},
	
		_connectWith: function() {
			var options = this.options;
			return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
		},
	
		_getItemsAsjQuery: function(connected) {
	
			var i, j, cur, inst,
				items = [],
				queries = [],
				connectWith = this._connectWith();
	
			if(connectWith && connected) {
				for (i = connectWith.length - 1; i >= 0; i--){
					cur = $(connectWith[i], this.document[0]);
					for ( j = cur.length - 1; j >= 0; j--){
						inst = $.data(cur[j], this.widgetFullName);
						if(inst && inst !== this && !inst.options.disabled) {
							queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
						}
					}
				}
			}
	
			queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
	
			function addItems() {
				items.push( this );
			}
			for (i = queries.length - 1; i >= 0; i--){
				queries[i][0].each( addItems );
			}
	
			return $(items);
	
		},
	
		_removeCurrentsFromItems: function() {
	
			var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
	
			this.items = $.grep(this.items, function (item) {
				for (var j=0; j < list.length; j++) {
					if(list[j] === item.item[0]) {
						return false;
					}
				}
				return true;
			});
	
		},
	
		_refreshItems: function(event) {
	
			this.items = [];
			this.containers = [this];
	
			var i, j, cur, inst, targetData, _queries, item, queriesLength,
				items = this.items,
				queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
				connectWith = this._connectWith();
	
			if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
				for (i = connectWith.length - 1; i >= 0; i--){
					cur = $(connectWith[i], this.document[0]);
					for (j = cur.length - 1; j >= 0; j--){
						inst = $.data(cur[j], this.widgetFullName);
						if(inst && inst !== this && !inst.options.disabled) {
							queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
							this.containers.push(inst);
						}
					}
				}
			}
	
			for (i = queries.length - 1; i >= 0; i--) {
				targetData = queries[i][1];
				_queries = queries[i][0];
	
				for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
					item = $(_queries[j]);
	
					item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
	
					items.push({
						item: item,
						instance: targetData,
						width: 0, height: 0,
						left: 0, top: 0
					});
				}
			}
	
		},
	
		refreshPositions: function(fast) {
	
			// Determine whether items are being displayed horizontally
			this.floating = this.items.length ?
				this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
				false;
	
			//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
			if(this.offsetParent && this.helper) {
				this.offset.parent = this._getParentOffset();
			}
	
			var i, item, t, p;
	
			for (i = this.items.length - 1; i >= 0; i--){
				item = this.items[i];
	
				//We ignore calculating positions of all connected containers when we're not over them
				if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
					continue;
				}
	
				t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
	
				if (!fast) {
					item.width = t.outerWidth();
					item.height = t.outerHeight();
				}
	
				p = t.offset();
				item.left = p.left;
				item.top = p.top;
			}
	
			if(this.options.custom && this.options.custom.refreshContainers) {
				this.options.custom.refreshContainers.call(this);
			} else {
				for (i = this.containers.length - 1; i >= 0; i--){
					p = this.containers[i].element.offset();
					this.containers[i].containerCache.left = p.left;
					this.containers[i].containerCache.top = p.top;
					this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
					this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
				}
			}
	
			return this;
		},
	
		_createPlaceholder: function(that) {
			that = that || this;
			var className,
				o = that.options;
	
			if(!o.placeholder || o.placeholder.constructor === String) {
				className = o.placeholder;
				o.placeholder = {
					element: function() {
	
						var nodeName = that.currentItem[0].nodeName.toLowerCase(),
							element = $( "<" + nodeName + ">", that.document[0] )
								.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
								.removeClass("ui-sortable-helper");
	
						if ( nodeName === "tbody" ) {
							that._createTrPlaceholder(
								that.currentItem.find( "tr" ).eq( 0 ),
								$( "<tr>", that.document[ 0 ] ).appendTo( element )
							);
						} else if ( nodeName === "tr" ) {
							that._createTrPlaceholder( that.currentItem, element );
						} else if ( nodeName === "img" ) {
							element.attr( "src", that.currentItem.attr( "src" ) );
						}
	
						if ( !className ) {
							element.css( "visibility", "hidden" );
						}
	
						return element;
					},
					update: function(container, p) {
	
						// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
						// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
						if(className && !o.forcePlaceholderSize) {
							return;
						}
	
						//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
						if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
						if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
					}
				};
			}
	
			//Create the placeholder
			that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
	
			//Append it after the actual current item
			that.currentItem.after(that.placeholder);
	
			//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
			o.placeholder.update(that, that.placeholder);
	
		},
	
		_createTrPlaceholder: function( sourceTr, targetTr ) {
			var that = this;
	
			sourceTr.children().each(function() {
				$( "<td>&#160;</td>", that.document[ 0 ] )
					.attr( "colspan", $( this ).attr( "colspan" ) || 1 )
					.appendTo( targetTr );
			});
		},
	
		_contactContainers: function(event) {
			var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
				innermostContainer = null,
				innermostIndex = null;
	
			// get innermost container that intersects with item
			for (i = this.containers.length - 1; i >= 0; i--) {
	
				// never consider a container that's located within the item itself
				if($.contains(this.currentItem[0], this.containers[i].element[0])) {
					continue;
				}
	
				if(this._intersectsWith(this.containers[i].containerCache)) {
	
					// if we've already found a container and it's more "inner" than this, then continue
					if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
						continue;
					}
	
					innermostContainer = this.containers[i];
					innermostIndex = i;
	
				} else {
					// container doesn't intersect. trigger "out" event if necessary
					if(this.containers[i].containerCache.over) {
						this.containers[i]._trigger("out", event, this._uiHash(this));
						this.containers[i].containerCache.over = 0;
					}
				}
	
			}
	
			// if no intersecting containers found, return
			if(!innermostContainer) {
				return;
			}
	
			// move the item into the container if it's not there already
			if(this.containers.length === 1) {
				if (!this.containers[innermostIndex].containerCache.over) {
					this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
					this.containers[innermostIndex].containerCache.over = 1;
				}
			} else {
	
				//When entering a new container, we will find the item with the least distance and append our item near it
				dist = 10000;
				itemWithLeastDistance = null;
				floating = innermostContainer.floating || this._isFloating(this.currentItem);
				posProperty = floating ? "left" : "top";
				sizeProperty = floating ? "width" : "height";
				axis = floating ? "clientX" : "clientY";
	
				for (j = this.items.length - 1; j >= 0; j--) {
					if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
						continue;
					}
					if(this.items[j].item[0] === this.currentItem[0]) {
						continue;
					}
	
					cur = this.items[j].item.offset()[posProperty];
					nearBottom = false;
					if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
						nearBottom = true;
					}
	
					if ( Math.abs( event[ axis ] - cur ) < dist ) {
						dist = Math.abs( event[ axis ] - cur );
						itemWithLeastDistance = this.items[ j ];
						this.direction = nearBottom ? "up": "down";
					}
				}
	
				//Check if dropOnEmpty is enabled
				if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
					return;
				}
	
				if(this.currentContainer === this.containers[innermostIndex]) {
					if ( !this.currentContainer.containerCache.over ) {
						this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
						this.currentContainer.containerCache.over = 1;
					}
					return;
				}
	
				itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
				this._trigger("change", event, this._uiHash());
				this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
				this.currentContainer = this.containers[innermostIndex];
	
				//Update the placeholder
				this.options.placeholder.update(this.currentContainer, this.placeholder);
	
				this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
				this.containers[innermostIndex].containerCache.over = 1;
			}
	
	
		},
	
		_createHelper: function(event) {
	
			var o = this.options,
				helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
	
			//Add the helper to the DOM if that didn't happen already
			if(!helper.parents("body").length) {
				$(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
			}
	
			if(helper[0] === this.currentItem[0]) {
				this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
			}
	
			if(!helper[0].style.width || o.forceHelperSize) {
				helper.width(this.currentItem.width());
			}
			if(!helper[0].style.height || o.forceHelperSize) {
				helper.height(this.currentItem.height());
			}
	
			return helper;
	
		},
	
		_adjustOffsetFromHelper: function(obj) {
			if (typeof obj === "string") {
				obj = obj.split(" ");
			}
			if ($.isArray(obj)) {
				obj = {left: +obj[0], top: +obj[1] || 0};
			}
			if ("left" in obj) {
				this.offset.click.left = obj.left + this.margins.left;
			}
			if ("right" in obj) {
				this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
			}
			if ("top" in obj) {
				this.offset.click.top = obj.top + this.margins.top;
			}
			if ("bottom" in obj) {
				this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
			}
		},
	
		_getParentOffset: function() {
	
	
			//Get the offsetParent and cache its position
			this.offsetParent = this.helper.offsetParent();
			var po = this.offsetParent.offset();
	
			// This is a special case where we need to modify a offset calculated on start, since the following happened:
			// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
			// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
			//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
			if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
				po.left += this.scrollParent.scrollLeft();
				po.top += this.scrollParent.scrollTop();
			}
	
			// This needs to be actually done for all browsers, since pageX/pageY includes this information
			// with an ugly IE fix
			if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
				po = { top: 0, left: 0 };
			}
	
			return {
				top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
				left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
			};
	
		},
	
		_getRelativeOffset: function() {
	
			if(this.cssPosition === "relative") {
				var p = this.currentItem.position();
				return {
					top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
					left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
				};
			} else {
				return { top: 0, left: 0 };
			}
	
		},
	
		_cacheMargins: function() {
			this.margins = {
				left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
				top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
			};
		},
	
		_cacheHelperProportions: function() {
			this.helperProportions = {
				width: this.helper.outerWidth(),
				height: this.helper.outerHeight()
			};
		},
	
		_setContainment: function() {
	
			var ce, co, over,
				o = this.options;
			if(o.containment === "parent") {
				o.containment = this.helper[0].parentNode;
			}
			if(o.containment === "document" || o.containment === "window") {
				this.containment = [
					0 - this.offset.relative.left - this.offset.parent.left,
					0 - this.offset.relative.top - this.offset.parent.top,
					o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
					(o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
				];
			}
	
			if(!(/^(document|window|parent)$/).test(o.containment)) {
				ce = $(o.containment)[0];
				co = $(o.containment).offset();
				over = ($(ce).css("overflow") !== "hidden");
	
				this.containment = [
					co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
					co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
					co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
					co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
				];
			}
	
		},
	
		_convertPositionTo: function(d, pos) {
	
			if(!pos) {
				pos = this.position;
			}
			var mod = d === "absolute" ? 1 : -1,
				scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
				scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
	
			return {
				top: (
					pos.top	+																// The absolute mouse position
					this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.parent.top * mod -											// The offsetParent's offset without borders (offset + border)
					( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
				),
				left: (
					pos.left +																// The absolute mouse position
					this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
					( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
				)
			};
	
		},
	
		_generatePosition: function(event) {
	
			var top, left,
				o = this.options,
				pageX = event.pageX,
				pageY = event.pageY,
				scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
	
			// This is another very weird special case that only happens for relative elements:
			// 1. If the css position is relative
			// 2. and the scroll parent is the document or similar to the offset parent
			// we have to refresh the relative offset during the scroll so there are no jumps
			if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
				this.offset.relative = this._getRelativeOffset();
			}
	
			
	
			if(this.originalPosition) { //If we are not dragging yet, we won't check for options
	
				if(this.containment) {
					if(event.pageX - this.offset.click.left < this.containment[0]) {
						pageX = this.containment[0] + this.offset.click.left;
					}
					if(event.pageY - this.offset.click.top < this.containment[1]) {
						pageY = this.containment[1] + this.offset.click.top;
					}
					if(event.pageX - this.offset.click.left > this.containment[2]) {
						pageX = this.containment[2] + this.offset.click.left;
					}
					if(event.pageY - this.offset.click.top > this.containment[3]) {
						pageY = this.containment[3] + this.offset.click.top;
					}
				}
	
				if(o.grid) {
					top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
					pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
	
					left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
					pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
				}
	
			}
	
			return {
				top: (
					pageY -																// The absolute mouse position
					this.offset.click.top -													// Click offset (relative to the element)
					this.offset.relative.top	-											// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
					( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
				),
				left: (
					pageX -																// The absolute mouse position
					this.offset.click.left -												// Click offset (relative to the element)
					this.offset.relative.left	-											// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
					( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
				)
			};
	
		},
	
		_rearrange: function(event, i, a, hardRefresh) {
	
			a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
	
			//Various things done here to improve the performance:
			// 1. we create a setTimeout, that calls refreshPositions
			// 2. on the instance, we have a counter variable, that get's higher after every append
			// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
			// 4. this lets only the last addition to the timeout stack through
			this.counter = this.counter ? ++this.counter : 1;
			var counter = this.counter;
	
			this._delay(function() {
				if(counter === this.counter) {
					this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
				}
			});
	
		},
	
		_clear: function(event, noPropagation) {
	
			this.reverting = false;
			// We delay all events that have to be triggered to after the point where the placeholder has been removed and
			// everything else normalized again
			var i,
				delayedTriggers = [];
	
			// We first have to update the dom position of the actual currentItem
			// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
			if(!this._noFinalSort && this.currentItem.parent().length) {
				this.placeholder.before(this.currentItem);
			}
			this._noFinalSort = null;
	
			if(this.helper[0] === this.currentItem[0]) {
				for(i in this._storedCSS) {
					if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
						this._storedCSS[i] = "";
					}
				}
				this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
			} else {
				this.currentItem.show();
			}
	
			if(this.fromOutside && !noPropagation) {
				delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
			}
			if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
				delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
			}
	
			// Check if the items Container has Changed and trigger appropriate
			// events.
			if (this !== this.currentContainer) {
				if(!noPropagation) {
					delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
					delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer));
					delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer));
				}
			}
	
	
			//Post events to containers
			function delayEvent( type, instance, container ) {
				return function( event ) {
					container._trigger( type, event, instance._uiHash( instance ) );
				};
			}
			for (i = this.containers.length - 1; i >= 0; i--){
				if (!noPropagation) {
					delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
				}
				if(this.containers[i].containerCache.over) {
					delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
					this.containers[i].containerCache.over = 0;
				}
			}
	
			//Do what was originally in plugins
			if ( this.storedCursor ) {
				this.document.find( "body" ).css( "cursor", this.storedCursor );
				this.storedStylesheet.remove();
			}
			if(this._storedOpacity) {
				this.helper.css("opacity", this._storedOpacity);
			}
			if(this._storedZIndex) {
				this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
			}
	
			this.dragging = false;
	
			if(!noPropagation) {
				this._trigger("beforeStop", event, this._uiHash());
			}
	
			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
			this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
	
			if ( !this.cancelHelperRemoval ) {
				if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
					this.helper.remove();
				}
				this.helper = null;
			}
	
			if(!noPropagation) {
				for (i=0; i < delayedTriggers.length; i++) {
					delayedTriggers[i].call(this, event);
				} //Trigger all delayed events
				this._trigger("stop", event, this._uiHash());
			}
	
			this.fromOutside = false;
			return !this.cancelHelperRemoval;
	
		},
	
		_trigger: function() {
			if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
				this.cancel();
			}
		},
	
		_uiHash: function(_inst) {
			var inst = _inst || this;
			return {
				helper: inst.helper,
				placeholder: inst.placeholder || $([]),
				position: inst.position,
				originalPosition: inst.originalPosition,
				offset: inst.positionAbs,
				item: inst.currentItem,
				sender: _inst ? _inst.element : null
			};
		}
	
	});
	
	
	
	
	
	function spinner_modifier( fn ) {
		return function() {
			var previous = this.element.val();
			fn.apply( this, arguments );
			this._refresh();
			if ( previous !== this.element.val() ) {
				this._trigger( "change" );
			}
		};
	}
	
	var spinner = $.widget( "ui.spinner", {
		version: "1.11.4",
		defaultElement: "<input>",
		widgetEventPrefix: "spin",
		options: {
			culture: null,
			icons: {
				down: "ui-icon-triangle-1-s",
				up: "ui-icon-triangle-1-n"
			},
			incremental: true,
			max: null,
			min: null,
			numberFormat: null,
			page: 10,
			step: 1,
	
			change: null,
			spin: null,
			start: null,
			stop: null
		},
	
		_create: function() {
			// handle string values that need to be parsed
			this._setOption( "max", this.options.max );
			this._setOption( "min", this.options.min );
			this._setOption( "step", this.options.step );
	
			// Only format if there is a value, prevents the field from being marked
			// as invalid in Firefox, see #9573.
			if ( this.value() !== "" ) {
				// Format the value, but don't constrain.
				this._value( this.element.val(), true );
			}
	
			this._draw();
			this._on( this._events );
			this._refresh();
	
			// turning off autocomplete prevents the browser from remembering the
			// value when navigating through history, so we re-enable autocomplete
			// if the page is unloaded before the widget is destroyed. #7790
			this._on( this.window, {
				beforeunload: function() {
					this.element.removeAttr( "autocomplete" );
				}
			});
		},
	
		_getCreateOptions: function() {
			var options = {},
				element = this.element;
	
			$.each( [ "min", "max", "step" ], function( i, option ) {
				var value = element.attr( option );
				if ( value !== undefined && value.length ) {
					options[ option ] = value;
				}
			});
	
			return options;
		},
	
		_events: {
			keydown: function( event ) {
				if ( this._start( event ) && this._keydown( event ) ) {
					event.preventDefault();
				}
			},
			keyup: "_stop",
			focus: function() {
				this.previous = this.element.val();
			},
			blur: function( event ) {
				if ( this.cancelBlur ) {
					delete this.cancelBlur;
					return;
				}
	
				this._stop();
				this._refresh();
				if ( this.previous !== this.element.val() ) {
					this._trigger( "change", event );
				}
			},
			mousewheel: function( event, delta ) {
				if ( !delta ) {
					return;
				}
				if ( !this.spinning && !this._start( event ) ) {
					return false;
				}
	
				this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );
				clearTimeout( this.mousewheelTimer );
				this.mousewheelTimer = this._delay(function() {
					if ( this.spinning ) {
						this._stop( event );
					}
				}, 100 );
				event.preventDefault();
			},
			"mousedown .ui-spinner-button": function( event ) {
				var previous;
	
				// We never want the buttons to have focus; whenever the user is
				// interacting with the spinner, the focus should be on the input.
				// If the input is focused then this.previous is properly set from
				// when the input first received focus. If the input is not focused
				// then we need to set this.previous based on the value before spinning.
				previous = this.element[0] === this.document[0].activeElement ?
					this.previous : this.element.val();
				function checkFocus() {
					var isActive = this.element[0] === this.document[0].activeElement;
					if ( !isActive ) {
						this.element.focus();
						this.previous = previous;
						// support: IE
						// IE sets focus asynchronously, so we need to check if focus
						// moved off of the input because the user clicked on the button.
						this._delay(function() {
							this.previous = previous;
						});
					}
				}
	
				// ensure focus is on (or stays on) the text field
				event.preventDefault();
				checkFocus.call( this );
	
				// support: IE
				// IE doesn't prevent moving focus even with event.preventDefault()
				// so we set a flag to know when we should ignore the blur event
				// and check (again) if focus moved off of the input.
				this.cancelBlur = true;
				this._delay(function() {
					delete this.cancelBlur;
					checkFocus.call( this );
				});
	
				if ( this._start( event ) === false ) {
					return;
				}
	
				this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
			},
			"mouseup .ui-spinner-button": "_stop",
			"mouseenter .ui-spinner-button": function( event ) {
				// button will add ui-state-active if mouse was down while mouseleave and kept down
				if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
					return;
				}
	
				if ( this._start( event ) === false ) {
					return false;
				}
				this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
			},
			// TODO: do we really want to consider this a stop?
			// shouldn't we just stop the repeater and wait until mouseup before
			// we trigger the stop event?
			"mouseleave .ui-spinner-button": "_stop"
		},
	
		_draw: function() {
			var uiSpinner = this.uiSpinner = this.element
				.addClass( "ui-spinner-input" )
				.attr( "autocomplete", "off" )
				.wrap( this._uiSpinnerHtml() )
				.parent()
					// add buttons
					.append( this._buttonHtml() );
	
			this.element.attr( "role", "spinbutton" );
	
			// button bindings
			this.buttons = uiSpinner.find( ".ui-spinner-button" )
				.attr( "tabIndex", -1 )
				.button()
				.removeClass( "ui-corner-all" );
	
			// IE 6 doesn't understand height: 50% for the buttons
			// unless the wrapper has an explicit height
			if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) &&
					uiSpinner.height() > 0 ) {
				uiSpinner.height( uiSpinner.height() );
			}
	
			// disable spinner if element was already disabled
			if ( this.options.disabled ) {
				this.disable();
			}
		},
	
		_keydown: function( event ) {
			var options = this.options,
				keyCode = $.ui.keyCode;
	
			switch ( event.keyCode ) {
			case keyCode.UP:
				this._repeat( null, 1, event );
				return true;
			case keyCode.DOWN:
				this._repeat( null, -1, event );
				return true;
			case keyCode.PAGE_UP:
				this._repeat( null, options.page, event );
				return true;
			case keyCode.PAGE_DOWN:
				this._repeat( null, -options.page, event );
				return true;
			}
	
			return false;
		},
	
		_uiSpinnerHtml: function() {
			return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";
		},
	
		_buttonHtml: function() {
			return "" +
				"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" +
					"<span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" +
				"</a>" +
				"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
					"<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
				"</a>";
		},
	
		_start: function( event ) {
			if ( !this.spinning && this._trigger( "start", event ) === false ) {
				return false;
			}
	
			if ( !this.counter ) {
				this.counter = 1;
			}
			this.spinning = true;
			return true;
		},
	
		_repeat: function( i, steps, event ) {
			i = i || 500;
	
			clearTimeout( this.timer );
			this.timer = this._delay(function() {
				this._repeat( 40, steps, event );
			}, i );
	
			this._spin( steps * this.options.step, event );
		},
	
		_spin: function( step, event ) {
			var value = this.value() || 0;
	
			if ( !this.counter ) {
				this.counter = 1;
			}
	
			value = this._adjustValue( value + step * this._increment( this.counter ) );
	
			if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) {
				this._value( value );
				this.counter++;
			}
		},
	
		_increment: function( i ) {
			var incremental = this.options.incremental;
	
			if ( incremental ) {
				return $.isFunction( incremental ) ?
					incremental( i ) :
					Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
			}
	
			return 1;
		},
	
		_precision: function() {
			var precision = this._precisionOf( this.options.step );
			if ( this.options.min !== null ) {
				precision = Math.max( precision, this._precisionOf( this.options.min ) );
			}
			return precision;
		},
	
		_precisionOf: function( num ) {
			var str = num.toString(),
				decimal = str.indexOf( "." );
			return decimal === -1 ? 0 : str.length - decimal - 1;
		},
	
		_adjustValue: function( value ) {
			var base, aboveMin,
				options = this.options;
	
			// make sure we're at a valid step
			// - find out where we are relative to the base (min or 0)
			base = options.min !== null ? options.min : 0;
			aboveMin = value - base;
			// - round to the nearest step
			aboveMin = Math.round(aboveMin / options.step) * options.step;
			// - rounding is based on 0, so adjust back to our base
			value = base + aboveMin;
	
			// fix precision from bad JS floating point math
			value = parseFloat( value.toFixed( this._precision() ) );
	
			// clamp the value
			if ( options.max !== null && value > options.max) {
				return options.max;
			}
			if ( options.min !== null && value < options.min ) {
				return options.min;
			}
	
			return value;
		},
	
		_stop: function( event ) {
			if ( !this.spinning ) {
				return;
			}
	
			clearTimeout( this.timer );
			clearTimeout( this.mousewheelTimer );
			this.counter = 0;
			this.spinning = false;
			this._trigger( "stop", event );
		},
	
		_setOption: function( key, value ) {
			if ( key === "culture" || key === "numberFormat" ) {
				var prevValue = this._parse( this.element.val() );
				this.options[ key ] = value;
				this.element.val( this._format( prevValue ) );
				return;
			}
	
			if ( key === "max" || key === "min" || key === "step" ) {
				if ( typeof value === "string" ) {
					value = this._parse( value );
				}
			}
			if ( key === "icons" ) {
				this.buttons.first().find( ".ui-icon" )
					.removeClass( this.options.icons.up )
					.addClass( value.up );
				this.buttons.last().find( ".ui-icon" )
					.removeClass( this.options.icons.down )
					.addClass( value.down );
			}
	
			this._super( key, value );
	
			if ( key === "disabled" ) {
				this.widget().toggleClass( "ui-state-disabled", !!value );
				this.element.prop( "disabled", !!value );
				this.buttons.button( value ? "disable" : "enable" );
			}
		},
	
		_setOptions: spinner_modifier(function( options ) {
			this._super( options );
		}),
	
		_parse: function( val ) {
			if ( typeof val === "string" && val !== "" ) {
				val = window.Globalize && this.options.numberFormat ?
					Globalize.parseFloat( val, 10, this.options.culture ) : +val;
			}
			return val === "" || isNaN( val ) ? null : val;
		},
	
		_format: function( value ) {
			if ( value === "" ) {
				return "";
			}
			return window.Globalize && this.options.numberFormat ?
				Globalize.format( value, this.options.numberFormat, this.options.culture ) :
				value;
		},
	
		_refresh: function() {
			this.element.attr({
				"aria-valuemin": this.options.min,
				"aria-valuemax": this.options.max,
				// TODO: what should we do with values that can't be parsed?
				"aria-valuenow": this._parse( this.element.val() )
			});
		},
	
		isValid: function() {
			var value = this.value();
	
			// null is invalid
			if ( value === null ) {
				return false;
			}
	
			// if value gets adjusted, it's invalid
			return value === this._adjustValue( value );
		},
	
		// update the value without triggering change
		_value: function( value, allowAny ) {
			var parsed;
			if ( value !== "" ) {
				parsed = this._parse( value );
				if ( parsed !== null ) {
					if ( !allowAny ) {
						parsed = this._adjustValue( parsed );
					}
					value = this._format( parsed );
				}
			}
			this.element.val( value );
			this._refresh();
		},
	
		_destroy: function() {
			this.element
				.removeClass( "ui-spinner-input" )
				.prop( "disabled", false )
				.removeAttr( "autocomplete" )
				.removeAttr( "role" )
				.removeAttr( "aria-valuemin" )
				.removeAttr( "aria-valuemax" )
				.removeAttr( "aria-valuenow" );
			this.uiSpinner.replaceWith( this.element );
		},
	
		stepUp: spinner_modifier(function( steps ) {
			this._stepUp( steps );
		}),
		_stepUp: function( steps ) {
			if ( this._start() ) {
				this._spin( (steps || 1) * this.options.step );
				this._stop();
			}
		},
	
		stepDown: spinner_modifier(function( steps ) {
			this._stepDown( steps );
		}),
		_stepDown: function( steps ) {
			if ( this._start() ) {
				this._spin( (steps || 1) * -this.options.step );
				this._stop();
			}
		},
	
		pageUp: spinner_modifier(function( pages ) {
			this._stepUp( (pages || 1) * this.options.page );
		}),
	
		pageDown: spinner_modifier(function( pages ) {
			this._stepDown( (pages || 1) * this.options.page );
		}),
	
		value: function( newVal ) {
			if ( !arguments.length ) {
				return this._parse( this.element.val() );
			}
			spinner_modifier( this._value ).call( this, newVal );
		},
	
		widget: function() {
			return this.uiSpinner;
		}
	});
	
	
	
	
	
	var tabs = $.widget( "ui.tabs", {
		version: "1.11.4",
		delay: 300,
		options: {
			active: null,
			collapsible: false,
			event: "click",
			heightStyle: "content",
			hide: null,
			show: null,
	
			// callbacks
			activate: null,
			beforeActivate: null,
			beforeLoad: null,
			load: null
		},
	
		_isLocal: (function() {
			var rhash = /#.*$/;
	
			return function( anchor ) {
				var anchorUrl, locationUrl;
	
				// support: IE7
				// IE7 doesn't normalize the href property when set via script (#9317)
				anchor = anchor.cloneNode( false );
	
				anchorUrl = anchor.href.replace( rhash, "" );
				locationUrl = location.href.replace( rhash, "" );
	
				// decoding may throw an error if the URL isn't UTF-8 (#9518)
				try {
					anchorUrl = decodeURIComponent( anchorUrl );
				} catch ( error ) {}
				try {
					locationUrl = decodeURIComponent( locationUrl );
				} catch ( error ) {}
	
				return anchor.hash.length > 1 && anchorUrl === locationUrl;
			};
		})(),
	
		_create: function() {
			var that = this,
				options = this.options;
	
			this.running = false;
	
			this.element
				.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
				.toggleClass( "ui-tabs-collapsible", options.collapsible );
	
			this._processTabs();
			options.active = this._initialActive();
	
			// Take disabling tabs via class attribute from HTML
			// into account and update option properly.
			if ( $.isArray( options.disabled ) ) {
				options.disabled = $.unique( options.disabled.concat(
					$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
						return that.tabs.index( li );
					})
				) ).sort();
			}
	
			// check for length avoids error when initializing empty list
			if ( this.options.active !== false && this.anchors.length ) {
				this.active = this._findActive( options.active );
			} else {
				this.active = $();
			}
	
			this._refresh();
	
			if ( this.active.length ) {
				this.load( options.active );
			}
		},
	
		_initialActive: function() {
			var active = this.options.active,
				collapsible = this.options.collapsible,
				locationHash = location.hash.substring( 1 );
	
			if ( active === null ) {
				// check the fragment identifier in the URL
				if ( locationHash ) {
					this.tabs.each(function( i, tab ) {
						if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
							active = i;
							return false;
						}
					});
				}
	
				// check for a tab marked active via a class
				if ( active === null ) {
					active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
				}
	
				// no active tab, set to false
				if ( active === null || active === -1 ) {
					active = this.tabs.length ? 0 : false;
				}
			}
	
			// handle numbers: negative, out of range
			if ( active !== false ) {
				active = this.tabs.index( this.tabs.eq( active ) );
				if ( active === -1 ) {
					active = collapsible ? false : 0;
				}
			}
	
			// don't allow collapsible: false and active: false
			if ( !collapsible && active === false && this.anchors.length ) {
				active = 0;
			}
	
			return active;
		},
	
		_getCreateEventData: function() {
			return {
				tab: this.active,
				panel: !this.active.length ? $() : this._getPanelForTab( this.active )
			};
		},
	
		_tabKeydown: function( event ) {
			var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
				selectedIndex = this.tabs.index( focusedTab ),
				goingForward = true;
	
			if ( this._handlePageNav( event ) ) {
				return;
			}
	
			switch ( event.keyCode ) {
				case $.ui.keyCode.RIGHT:
				case $.ui.keyCode.DOWN:
					selectedIndex++;
					break;
				case $.ui.keyCode.UP:
				case $.ui.keyCode.LEFT:
					goingForward = false;
					selectedIndex--;
					break;
				case $.ui.keyCode.END:
					selectedIndex = this.anchors.length - 1;
					break;
				case $.ui.keyCode.HOME:
					selectedIndex = 0;
					break;
				case $.ui.keyCode.SPACE:
					// Activate only, no collapsing
					event.preventDefault();
					clearTimeout( this.activating );
					this._activate( selectedIndex );
					return;
				case $.ui.keyCode.ENTER:
					// Toggle (cancel delayed activation, allow collapsing)
					event.preventDefault();
					clearTimeout( this.activating );
					// Determine if we should collapse or activate
					this._activate( selectedIndex === this.options.active ? false : selectedIndex );
					return;
				default:
					return;
			}
	
			// Focus the appropriate tab, based on which key was pressed
			event.preventDefault();
			clearTimeout( this.activating );
			selectedIndex = this._focusNextTab( selectedIndex, goingForward );
	
			// Navigating with control/command key will prevent automatic activation
			if ( !event.ctrlKey && !event.metaKey ) {
	
				// Update aria-selected immediately so that AT think the tab is already selected.
				// Otherwise AT may confuse the user by stating that they need to activate the tab,
				// but the tab will already be activated by the time the announcement finishes.
				focusedTab.attr( "aria-selected", "false" );
				this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
	
				this.activating = this._delay(function() {
					this.option( "active", selectedIndex );
				}, this.delay );
			}
		},
	
		_panelKeydown: function( event ) {
			if ( this._handlePageNav( event ) ) {
				return;
			}
	
			// Ctrl+up moves focus to the current tab
			if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
				event.preventDefault();
				this.active.focus();
			}
		},
	
		// Alt+page up/down moves focus to the previous/next tab (and activates)
		_handlePageNav: function( event ) {
			if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
				this._activate( this._focusNextTab( this.options.active - 1, false ) );
				return true;
			}
			if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
				this._activate( this._focusNextTab( this.options.active + 1, true ) );
				return true;
			}
		},
	
		_findNextTab: function( index, goingForward ) {
			var lastTabIndex = this.tabs.length - 1;
	
			function constrain() {
				if ( index > lastTabIndex ) {
					index = 0;
				}
				if ( index < 0 ) {
					index = lastTabIndex;
				}
				return index;
			}
	
			while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
				index = goingForward ? index + 1 : index - 1;
			}
	
			return index;
		},
	
		_focusNextTab: function( index, goingForward ) {
			index = this._findNextTab( index, goingForward );
			this.tabs.eq( index ).focus();
			return index;
		},
	
		_setOption: function( key, value ) {
			if ( key === "active" ) {
				// _activate() will handle invalid values and update this.options
				this._activate( value );
				return;
			}
	
			if ( key === "disabled" ) {
				// don't use the widget factory's disabled handling
				this._setupDisabled( value );
				return;
			}
	
			this._super( key, value);
	
			if ( key === "collapsible" ) {
				this.element.toggleClass( "ui-tabs-collapsible", value );
				// Setting collapsible: false while collapsed; open first panel
				if ( !value && this.options.active === false ) {
					this._activate( 0 );
				}
			}
	
			if ( key === "event" ) {
				this._setupEvents( value );
			}
	
			if ( key === "heightStyle" ) {
				this._setupHeightStyle( value );
			}
		},
	
		_sanitizeSelector: function( hash ) {
			return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
		},
	
		refresh: function() {
			var options = this.options,
				lis = this.tablist.children( ":has(a[href])" );
	
			// get disabled tabs from class attribute from HTML
			// this will get converted to a boolean if needed in _refresh()
			options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
				return lis.index( tab );
			});
	
			this._processTabs();
	
			// was collapsed or no tabs
			if ( options.active === false || !this.anchors.length ) {
				options.active = false;
				this.active = $();
			// was active, but active tab is gone
			} else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
				// all remaining tabs are disabled
				if ( this.tabs.length === options.disabled.length ) {
					options.active = false;
					this.active = $();
				// activate previous tab
				} else {
					this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
				}
			// was active, active tab still exists
			} else {
				// make sure active index is correct
				options.active = this.tabs.index( this.active );
			}
	
			this._refresh();
		},
	
		_refresh: function() {
			this._setupDisabled( 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"
				});
	
			// Make sure one tab is in the tab order
			if ( !this.active.length ) {
				this.tabs.eq( 0 ).attr( "tabIndex", 0 );
			} else {
				this.active
					.addClass( "ui-tabs-active ui-state-active" )
					.attr({
						"aria-selected": "true",
						"aria-expanded": "true",
						tabIndex: 0
					});
				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()
				.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
				.attr( "role", "tablist" )
	
				// Prevent users from focusing disabled tabs via click
				.delegate( "> li", "mousedown" + this.eventNamespace, function( event ) {
					if ( $( this ).is( ".ui-state-disabled" ) ) {
						event.preventDefault();
					}
				})
	
				// support: IE <9
				// Preventing the default action in mousedown doesn't prevent IE
				// from focusing the element, so if the anchor gets focused, blur.
				// We don't have to worry about focusing the previously focused
				// element since clicking on a non-focusable element should focus
				// the body anyway.
				.delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
					if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
						this.blur();
					}
				});
	
			this.tabs = this.tablist.find( "> li:has(a[href])" )
				.addClass( "ui-state-default ui-corner-top" )
				.attr({
					role: "tab",
					tabIndex: -1
				});
	
			this.anchors = this.tabs.map(function() {
					return $( "a", this )[ 0 ];
				})
				.addClass( "ui-tabs-anchor" )
				.attr({
					role: "presentation",
					tabIndex: -1
				});
	
			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" );
	
				// inline tab
				if ( that._isLocal( anchor ) ) {
					selector = anchor.hash;
					panelId = selector.substring( 1 );
					panel = that.element.find( that._sanitizeSelector( selector ) );
				// remote tab
				} else {
					// If the tab doesn't already have aria-controls,
					// generate an id by using a throw-away element
					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 );
					}
					panel.attr( "aria-live", "polite" );
				}
	
				if ( panel.length) {
					that.panels = that.panels.add( panel );
				}
				if ( originalAriaControls ) {
					tab.data( "ui-tabs-aria-controls", originalAriaControls );
				}
				tab.attr({
					"aria-controls": panelId,
					"aria-labelledby": anchorId
				});
				panel.attr( "aria-labelledby", anchorId );
			});
	
			this.panels
				.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
				.attr( "role", "tabpanel" );
	
			// Avoid memory leaks (#10056)
			if ( prevTabs ) {
				this._off( prevTabs.not( this.tabs ) );
				this._off( prevAnchors.not( this.anchors ) );
				this._off( prevPanels.not( this.panels ) );
			}
		},
	
		// allow overriding how to find the list for rare usage scenarios (#7715)
		_getList: function() {
			return this.tablist || this.element.find( "ol,ul" ).eq( 0 );
		},
	
		_createPanel: function( id ) {
			return $( "<div>" )
				.attr( "id", id )
				.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
				.data( "ui-tabs-destroy", true );
		},
	
		_setupDisabled: function( disabled ) {
			if ( $.isArray( disabled ) ) {
				if ( !disabled.length ) {
					disabled = false;
				} else if ( disabled.length === this.anchors.length ) {
					disabled = true;
				}
			}
	
			// disable tabs
			for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
				if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
					$( li )
						.addClass( "ui-state-disabled" )
						.attr( "aria-disabled", "true" );
				} else {
					$( li )
						.removeClass( "ui-state-disabled" )
						.removeAttr( "aria-disabled" );
				}
			}
	
			this.options.disabled = disabled;
		},
	
		_setupEvents: function( event ) {
			var events = {};
			if ( event ) {
				$.each( event.split(" "), function( index, eventName ) {
					events[ eventName ] = "_eventHandler";
				});
			}
	
			this._off( this.anchors.add( this.tabs ).add( this.panels ) );
			// Always prevent the default action, even when disabled
			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;
					}
					maxHeight -= 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 -
						$( 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 is already loading
					tab.hasClass( "ui-tabs-loading" ) ||
					// can't switch durning an animation
					this.running ||
					// click on active header, but not collapsible
					( clickedIsActive && !options.collapsible ) ||
					// allow canceling activation
					( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
				return;
			}
	
			options.active = collapsing ? false : this.tabs.index( tab );
	
			this.active = clickedIsActive ? $() : tab;
			if ( this.xhr ) {
				this.xhr.abort();
			}
	
			if ( !toHide.length && !toShow.length ) {
				$.error( "jQuery UI Tabs: Mismatching fragment identifier." );
			}
	
			if ( toShow.length ) {
				this.load( this.tabs.index( tab ), event );
			}
			this._toggle( event, eventData );
		},
	
		// handles show/hide for selecting tabs
		_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 );
			}
	
			function show() {
				eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
	
				if ( toShow.length && that.options.show ) {
					that._show( toShow, that.options.show, complete );
				} else {
					toShow.show();
					complete();
				}
			}
	
			// start out by hiding, then showing, then completing
			if ( toHide.length && this.options.hide ) {
				this._hide( toHide, this.options.hide, function() {
					eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
					show();
				});
			} else {
				eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
				toHide.hide();
				show();
			}
	
			toHide.attr( "aria-hidden", "true" );
			eventData.oldTab.attr({
				"aria-selected": "false",
				"aria-expanded": "false"
			});
			// If we're switching tabs, remove the old tab from the tab order.
			// If we're opening from collapsed state, remove the previous tab from the tab order.
			// If we're collapsing, then keep the collapsing tab in the tab order.
			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 );
			}
	
			toShow.attr( "aria-hidden", "false" );
			eventData.newTab.attr({
				"aria-selected": "true",
				"aria-expanded": "true",
				tabIndex: 0
			});
		},
	
		_activate: function( index ) {
			var anchor,
				active = this._findActive( index );
	
			// trying to activate the already active panel
			if ( active[ 0 ] === this.active[ 0 ] ) {
				return;
			}
	
			// trying to collapse, simulate a click on the current active header
			if ( !active.length ) {
				active = this.active;
			}
	
			anchor = 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 ) {
			// meta-function to give users option to provide a href string instead of a numerical index.
			if ( typeof index === "string" ) {
				index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
			}
	
			return index;
		},
	
		_destroy: function() {
			if ( this.xhr ) {
				this.xhr.abort();
			}
	
			this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
	
			this.tablist
				.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
				.removeAttr( "role" );
	
			this.anchors
				.removeClass( "ui-tabs-anchor" )
				.removeAttr( "role" )
				.removeAttr( "tabIndex" )
				.removeUniqueId();
	
			this.tablist.unbind( this.eventNamespace );
	
			this.tabs.add( this.panels ).each(function() {
				if ( $.data( this, "ui-tabs-destroy" ) ) {
					$( this ).remove();
				} else {
					$( this )
						.removeClass( "ui-state-default ui-state-active ui-state-disabled " +
							"ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
						.removeAttr( "tabIndex" )
						.removeAttr( "aria-live" )
						.removeAttr( "aria-busy" )
						.removeAttr( "aria-selected" )
						.removeAttr( "aria-labelledby" )
						.removeAttr( "aria-hidden" )
						.removeAttr( "aria-expanded" )
						.removeAttr( "role" );
				}
			});
	
			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;
			}
	
			if ( 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;
					});
				}
			}
			this._setupDisabled( disabled );
		},
	
		disable: function( index ) {
			var disabled = this.options.disabled;
			if ( disabled === true ) {
				return;
			}
	
			if ( index === undefined ) {
				disabled = true;
			} else {
				index = this._getIndex( index );
				if ( $.inArray( index, disabled ) !== -1 ) {
					return;
				}
				if ( $.isArray( disabled ) ) {
					disabled = $.merge( [ index ], disabled ).sort();
				} else {
					disabled = [ index ];
				}
			}
			this._setupDisabled( 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 );
					}
	
					tab.removeClass( "ui-tabs-loading" );
					panel.removeAttr( "aria-busy" );
	
					if ( jqXHR === that.xhr ) {
						delete that.xhr;
					}
				};
	
			// not remote
			if ( this._isLocal( anchor[ 0 ] ) ) {
				return;
			}
	
			this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
	
			// support: jQuery <1.8
			// jQuery <1.8 returns false if the request is canceled in beforeSend,
			// but as of 1.8, $.ajax() always returns a jqXHR object.
			if ( this.xhr && this.xhr.statusText !== "canceled" ) {
				tab.addClass( "ui-tabs-loading" );
				panel.attr( "aria-busy", "true" );
	
				this.xhr
					.done(function( response, status, jqXHR ) {
						// support: jQuery <1.8
						// http://bugs.jquery.com/ticket/11778
						setTimeout(function() {
							panel.html( response );
							that._trigger( "load", event, eventData );
	
							complete( jqXHR, status );
						}, 1 );
					})
					.fail(function( jqXHR, status ) {
						// support: jQuery <1.8
						// http://bugs.jquery.com/ticket/11778
						setTimeout(function() {
							complete( jqXHR, status );
						}, 1 );
					});
			}
		},
	
		_ajaxSettings: function( anchor, event, eventData ) {
			var that = this;
			return {
				url: anchor.attr( "href" ),
				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 ) );
		}
	});
	
	
	
	
	
	var tooltip = $.widget( "ui.tooltip", {
		version: "1.11.4",
		options: {
			content: function() {
				// support: IE<9, Opera in jQuery <1.7
				// .text() can't accept undefined, so coerce to a string
				var title = $( this ).attr( "title" ) || "";
				// Escape title, since we're going from an attribute to raw HTML
				return $( "<a>" ).text( title ).html();
			},
			hide: true,
			// Disabled elements have inconsistent behavior across browsers (#8661)
			items: "[title]:not([disabled])",
			position: {
				my: "left top+15",
				at: "left bottom",
				collision: "flipfit flip"
			},
			show: true,
			tooltipClass: null,
			track: false,
	
			// callbacks
			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 );
			}
	
			elem.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"
			});
	
			// IDs of generated tooltips, needed for destroy
			this.tooltips = {};
	
			// IDs of parent tooltips where we removed the title attribute
			this.parents = {};
	
			if ( this.options.disabled ) {
				this._disable();
			}
	
			// Append the aria-live region so tooltips announce correctly
			this.liveRegion = $( "<div>" )
				.attr({
					role: "log",
					"aria-live": "assertive",
					"aria-relevant": "additions"
				})
				.addClass( "ui-helper-hidden-accessible" )
				.appendTo( this.document[ 0 ].body );
		},
	
		_setOption: function( key, value ) {
			var that = this;
	
			if ( key === "disabled" ) {
				this[ value ? "_disable" : "_enable" ]();
				this.options[ key ] = value;
				// disable element style changes
				return;
			}
	
			this._super( key, value );
	
			if ( key === "content" ) {
				$.each( this.tooltips, function( id, tooltipData ) {
					that._updateContent( tooltipData.element );
				});
			}
		},
	
		_disable: function() {
			var that = this;
	
			// close open tooltips
			$.each( this.tooltips, function( id, tooltipData ) {
				var event = $.Event( "blur" );
				event.target = event.currentTarget = tooltipData.element[ 0 ];
				that.close( event, true );
			});
	
			// remove title attributes to prevent native tooltips
			this.element.find( this.options.items ).addBack().each(function() {
				var element = $( this );
				if ( element.is( "[title]" ) ) {
					element
						.data( "ui-tooltip-title", element.attr( "title" ) )
						.removeAttr( "title" );
				}
			});
		},
	
		_enable: function() {
			// restore title attributes
			this.element.find( this.options.items ).addBack().each(function() {
				var element = $( this );
				if ( element.data( "ui-tooltip-title" ) ) {
					element.attr( "title", element.data( "ui-tooltip-title" ) );
				}
			});
		},
	
		open: function( event ) {
			var that = this,
				target = $( event ? event.target : this.element )
					// we need closest here due to mouseover bubbling,
					// but always pointing at the same event target
					.closest( this.options.items );
	
			// No element to show a tooltip for or the tooltip is already open
			if ( !target.length || target.data( "ui-tooltip-id" ) ) {
				return;
			}
	
			if ( target.attr( "title" ) ) {
				target.data( "ui-tooltip-title", target.attr( "title" ) );
			}
	
			target.data( "ui-tooltip-open", true );
	
			// kill parent tooltips, custom or native, for hover
			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 );
					}
					if ( parent.attr( "title" ) ) {
						parent.uniqueId();
						that.parents[ this.id ] = {
							element: this,
							title: parent.attr( "title" )
						};
						parent.attr( "title", "" );
					}
				});
			}
	
			this._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" ) {
				return this._open( event, target, contentOption );
			}
	
			content = contentOption.call( target[0], function( response ) {
	
				// IE may instantly serve a cached response for ajax requests
				// delay this call to _open so the other call to _open runs first
				that._delay(function() {
	
					// Ignore async response if tooltip was closed already
					if ( !target.data( "ui-tooltip-open" ) ) {
						return;
					}
	
					// jQuery creates a special event for focusin when it doesn't
					// exist natively. To improve performance, the native event
					// object is reused and the type is changed. Therefore, we can't
					// rely on the type being correct after the event finished
					// bubbling, so we set it back to the previous value. (#8740)
					if ( event ) {
						event.type = eventType;
					}
					this._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;
			}
	
			// Content can be updated multiple times. If the tooltip already
			// exists, then just update the content and bail.
			tooltipData = this._find( target );
			if ( tooltipData ) {
				tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
				return;
			}
	
			// if we have a title, clear it to prevent the native tooltip
			// we have to check first to avoid defining a title if none exists
			// (we don't want to cause an element to start matching [title])
			//
			// We use removeAttr only for key events, to allow IE to export the correct
			// accessible attributes. For mouse events, set to empty string to avoid
			// native tooltip showing up (happens only when removing inside mouseover).
			if ( target.is( "[title]" ) ) {
				if ( event && event.type === "mouseover" ) {
					target.attr( "title", "" );
				} else {
					target.removeAttr( "title" );
				}
			}
	
			tooltipData = this._tooltip( target );
			tooltip = tooltipData.tooltip;
			this._addDescribedBy( target, tooltip.attr( "id" ) );
			tooltip.find( ".ui-tooltip-content" ).html( content );
	
			// Support: Voiceover on OS X, JAWS on IE <= 9
			// JAWS announces deletions even when aria-relevant="additions"
			// Voiceover will sometimes re-read the entire log region's contents from the beginning
			this.liveRegion.children().hide();
			if ( content.clone ) {
				a11yContent = content.clone();
				a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
			} else {
				a11yContent = content;
			}
			$( "<div>" ).html( a11yContent ).appendTo( this.liveRegion );
	
			function position( event ) {
				positionOption.of = event;
				if ( tooltip.is( ":hidden" ) ) {
					return;
				}
				tooltip.position( positionOption );
			}
			if ( this.options.track && event && /^mouse/.test( event.type ) ) {
				this._on( this.document, {
					mousemove: position
				});
				// trigger once to override element-relative positioning
				position( event );
			} else {
				tooltip.position( $.extend({
					of: target
				}, this.options.position ) );
			}
	
			tooltip.hide();
	
			this._show( tooltip, this.options.show );
			// Handle tracking tooltips that are shown with a delay (#8644). As soon
			// as the tooltip is visible, position the tooltip using the most recent
			// event.
			if ( this.options.show && this.options.show.delay ) {
				delayedShow = this.delayedShow = setInterval(function() {
					if ( tooltip.is( ":visible" ) ) {
						position( positionOption.of );
						clearInterval( delayedShow );
					}
				}, $.fx.interval );
			}
	
			this._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 );
					}
				}
			};
	
			// Only bind remove handler for delegated targets. Non-delegated
			// tooltips will handle this in destroy.
			if ( target[ 0 ] !== this.element[ 0 ] ) {
				events.remove = function() {
					this._removeTooltip( this._find( target ).tooltip );
				};
			}
	
			if ( !event || event.type === "mouseover" ) {
				events.mouseleave = "close";
			}
			if ( !event || event.type === "focusin" ) {
				events.focusout = "close";
			}
			this._on( true, target, events );
		},
	
		close: function( event ) {
			var tooltip,
				that = this,
				target = $( event ? event.currentTarget : this.element ),
				tooltipData = this._find( target );
	
			// The tooltip may already be closed
			if ( !tooltipData ) {
	
				// We set ui-tooltip-open immediately upon open (in open()), but only set the
				// additional data once there's actually content to show (in _open()). So even if the
				// tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
				// the period between open() and _open().
				target.removeData( "ui-tooltip-open" );
				return;
			}
	
			tooltip = tooltipData.tooltip;
	
			// disabling closes the tooltip, so we need to track when we're closing
			// to avoid an infinite loop in case the tooltip becomes disabled on close
			if ( tooltipData.closing ) {
				return;
			}
	
			// Clear the interval for delayed tracking tooltips
			clearInterval( this.delayedShow );
	
			// only set title if we had one before (see comment in _open())
			// If the title attribute has changed since open(), don't restore
			if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
				target.attr( "title", target.data( "ui-tooltip-title" ) );
			}
	
			this._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" );
	
			// Remove 'remove' binding only on delegated targets
			if ( target[ 0 ] !== this.element[ 0 ] ) {
				this._off( target, "remove" );
			}
			this._off( this.document, "mousemove" );
	
			if ( event && event.type === "mouseleave" ) {
				$.each( this.parents, function( id, parent ) {
					$( parent.element ).attr( "title", parent.title );
					delete that.parents[ id ];
				});
			}
	
			tooltipData.closing = true;
			this._trigger( "close", event, { tooltip: tooltip } );
			if ( !tooltipData.hiding ) {
				tooltipData.closing = false;
			}
		},
	
		_tooltip: function( element ) {
			var tooltip = $( "<div>" )
					.attr( "role", "tooltip" )
					.addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
						( this.options.tooltipClass || "" ) ),
				id = tooltip.uniqueId().attr( "id" );
	
			$( "<div>" )
				.addClass( "ui-tooltip-content" )
				.appendTo( tooltip );
	
			tooltip.appendTo( this.document[0].body );
	
			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" ) ];
		},
	
		_destroy: function() {
			var that = this;
	
			// close open tooltips
			$.each( this.tooltips, function( id, tooltipData ) {
				// Delegate to close method to handle common cleanup
				var event = $.Event( "blur" ),
					element = tooltipData.element;
				event.target = event.currentTarget = element[ 0 ];
				that.close( event, true );
	
				// Remove immediately; destroying an open tooltip doesn't use the
				// hide animation
				$( "#" + id ).remove();
	
				// Restore the title
				if ( element.data( "ui-tooltip-title" ) ) {
					// If the title attribute has changed since open(), don't restore
					if ( !element.attr( "title" ) ) {
						element.attr( "title", element.data( "ui-tooltip-title" ) );
					}
					element.removeData( "ui-tooltip-title" );
				}
			});
			this.liveRegion.remove();
		}
	});
	
	
	
	}));
/*-----/js/jquery/jquery-ui-1.11.4.js / end -----*/

/*-----/js/jquery/jquery-bugs-extends.js / start -----*/
$.fn.outerHTML = function() {
    var el = $(this);
    if( !el[0] ) return "";
 
    if (el[0].outerHTML) {
        return el[0].outerHTML;
    } else {
        var content = el.wrap('<p/>').parent().html();
        el.unwrap();
        return content;
    }
};

$.fn.changeElementType = function(newType) {
    var attrs = {};

    $.each(this[0].attributes, function(idx, attr) {
    	if(attr.nodeValue)
    		attrs[attr.nodeName] = attr.nodeValue;
    });

    this.replaceWith(function() {
        return $("<" + newType + "/>").attr(attrs).append($(this).contents());
    });
};

$.fn.resizeImage = function(option){
	
	option = option || {};
	
	$.each(this, function(){
		if(!$(this).is("img"))
			return true;//continue
		
		if($(this).data("resize_option")){
			//return;
		}
		else{
			
			$(this).data("resize_option", option);
			
			$(this).load(function(){
				if($(this).width() < 5)
					return;
				
				var tOption = $(this).data("resize_option");
				
				var maxW = tOption.maxWidth || $(this).attr("maxWidth") || $(this).parent().width() || 99999;
				var maxH = tOption.maxHeight || $(this).attr("maxHeight") || $(this).parent().height() || 99999;
				
				$(this).css("visibility","hidden");
				$(this).css("width", "auto");
				$(this).css("height", "auto");
				$(this).removeAttr("width");
				$(this).removeAttr("height");
				
				if($(this).width() == maxW || $(this).height() == maxH){
					$(this).css("visibility","");
					return;
				}
				
				var aspectW = ($(this).width() / $(this).height()) * maxW;
				var apsectH = ($(this).height() / $(this).width()) * maxH;
				
				if(aspectW > maxW){
					$(this).height( Math.ceil(apsectH) );
				}
				else{
					$(this).width( Math.ceil(aspectW) );
				}
				$(this).css("visibility","");
				
				if(typeof(tOption.complete) == "function")
					tOption.complete();
			});
		}
		
		$(this).load();
		
		
	});
	
	return this;
};
/*-----/js/jquery/jquery-bugs-extends.js / end -----*/

/*-----/js/jquery/jquery.animateSprite.min.js / start -----*/

(function(t,i,n){"use strict";var e=function(i){return this.each(function(){var e=t(this),a=e.data("animateSprite"),r=function(t){var i=e.css("background-image").replace(/url\((['"])?(.*?)\1\)/gi,"$2"),n=new Image;n.onload=function(){var i=n.width,e=n.height;t(i,e)},n.src=i};a||(e.data("animateSprite",{settings:t.extend({width:e.width(),height:e.height(),totalFrames:!1,columns:!1,fps:12,complete:function(){},loop:!1,autoplay:!0},i),currentFrame:0,controlAnimation:function(){var t=function(t,i){return t++,t>=i?this.settings.loop===!0?(t=0,a.controlTimer()):this.settings.complete():a.controlTimer(),t};if(this.settings.animations===n)e.animateSprite("frame",this.currentFrame),this.currentFrame=t.call(this,this.currentFrame,this.settings.totalFrames);else{if(this.currentAnimation===n)for(var i in this.settings.animations){this.currentAnimation=this.settings.animations[i];break}var r=this.currentAnimation[this.currentFrame];e.animateSprite("frame",r),this.currentFrame=t.call(this,this.currentFrame,this.currentAnimation.length)}},controlTimer:function(){var t=1e3/a.settings.fps;a.settings.duration!==n&&(t=a.settings.duration/a.settings.totalFrames),a.interval=setTimeout(function(){a.controlAnimation()},t)}}),a=e.data("animateSprite"),a.settings.columns?a.settings.autoplay&&a.controlTimer():r(function(t,i){if(a.settings.columns=Math.round(t/a.settings.width),!a.settings.totalFrames){var n=Math.round(i/a.settings.height);a.settings.totalFrames=a.settings.columns*n}a.settings.autoplay&&a.controlTimer()}))})},a=function(i){return this.each(function(){if(t(this).data("animateSprite")!==n){var e=t(this),a=e.data("animateSprite"),r=Math.floor(i/a.settings.columns),s=i%a.settings.columns;e.css("background-position",-a.settings.width*s+"px "+-a.settings.height*r+"px")}})},r=function(){return this.each(function(){var i=t(this),n=i.data("animateSprite");clearTimeout(n.interval)})},s=function(){return this.each(function(){var i=t(this),n=i.data("animateSprite");i.animateSprite("stopAnimation"),n.controlTimer()})},o=function(){return this.each(function(){var i=t(this),n=i.data("animateSprite");i.animateSprite("stopAnimation"),n.currentFrame=0,n.controlTimer()})},m=function(i){return this.each(function(){var n=t(this),e=n.data("animateSprite");"string"==typeof i?(n.animateSprite("stopAnimation"),e.settings.animations[i]!==e.currentAnimation&&(e.currentFrame=0,e.currentAnimation=e.settings.animations[i]),e.controlTimer()):(n.animateSprite("stopAnimation"),e.controlTimer())})},c=function(i){return this.each(function(){var n=t(this),e=n.data("animateSprite");e.settings.fps=i})},u={init:e,frame:a,stop:r,resume:s,restart:o,play:m,stopAnimation:r,resumeAnimation:s,restartAnimation:o,fps:c};t.fn.animateSprite=function(i){return u[i]?u[i].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof i&&i?(t.error("Method "+i+" does not exist on jQuery.animateSprite"),n):u.init.apply(this,arguments)}})(jQuery,window);
/*-----/js/jquery/jquery.animateSprite.min.js / end -----*/

/*-----/js/jquery/jquery.dotdotdot.min.js / start -----*/

!function(t,e){function n(t,e,n){var r=t.children(),o=!1;t.empty();for(var i=0,d=r.length;d>i;i++){var l=r.eq(i);if(t.append(l),n&&t.append(n),a(t,e)){l.remove(),o=!0;break}n&&n.detach()}return o}function r(e,n,i,d,l){var s=!1,c="a, table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style",u="script, .dotdotdot-keep";return e.contents().detach().each(function(){var h=this,f=t(h);if("undefined"==typeof h)return!0;if(f.is(u))e.append(f);else{if(s)return!0;e.append(f),!l||f.is(d.after)||f.find(d.after).length||e[e.is(c)?"after":"append"](l),a(i,d)&&(s=3==h.nodeType?o(f,n,i,d,l):r(f,n,i,d,l)),s||l&&l.detach()}}),n.addClass("is-truncated"),s}function o(e,n,r,o,d){var c=e[0];if(!c)return!1;var h=s(c),f=-1!==h.indexOf(" ")?" ":"　",p="letter"==o.wrap?"":f,g=h.split(p),v=-1,w=-1,b=0,m=g.length-1;for(o.fallbackToLetter&&0==b&&0==m&&(p="",g=h.split(p),m=g.length-1);m>=b&&(0!=b||0!=m);){var y=Math.floor((b+m)/2);if(y==w)break;w=y,l(c,g.slice(0,w+1).join(p)+o.ellipsis),r.children().each(function(){t(this).toggle().toggle()}),a(r,o)?(m=w,o.fallbackToLetter&&0==b&&0==m&&(p="",g=g[0].split(p),v=-1,w=-1,b=0,m=g.length-1)):(v=w,b=w)}if(-1==v||1==g.length&&0==g[0].length){var x=e.parent();e.detach();var C=d&&d.closest(x).length?d.length:0;if(x.contents().length>C?c=u(x.contents().eq(-1-C),n):(c=u(x,n,!0),C||x.detach()),c&&(h=i(s(c),o),l(c,h),C&&d)){var T=d.parent();t(c).parent().append(d),t.trim(T.html())||T.remove()}}else h=i(g.slice(0,v+1).join(p),o),l(c,h);return!0}function a(t,e){return t.innerHeight()>e.maxHeight}function i(e,n){for(;t.inArray(e.slice(-1),n.lastCharacter.remove)>-1;)e=e.slice(0,-1);return t.inArray(e.slice(-1),n.lastCharacter.noEllipsis)<0&&(e+=n.ellipsis),e}function d(t){return{width:t.innerWidth(),height:t.innerHeight()}}function l(t,e){t.innerText?t.innerText=e:t.nodeValue?t.nodeValue=e:t.textContent&&(t.textContent=e)}function s(t){return t.innerText?t.innerText:t.nodeValue?t.nodeValue:t.textContent?t.textContent:""}function c(t){do t=t.previousSibling;while(t&&1!==t.nodeType&&3!==t.nodeType);return t}function u(e,n,r){var o,a=e&&e[0];if(a){if(!r){if(3===a.nodeType)return a;if(t.trim(e.text()))return u(e.contents().last(),n)}for(o=c(a);!o;){if(e=e.parent(),e.is(n)||!e.length)return!1;o=c(e[0])}if(o)return u(t(o),n)}return!1}function h(e,n){return e?"string"==typeof e?(e=t(e,n),e.length?e:!1):e.jquery?e:!1:!1}function f(t){for(var e=t.innerHeight(),n=["paddingTop","paddingBottom"],r=0,o=n.length;o>r;r++){var a=parseInt(t.css(n[r]),10);isNaN(a)&&(a=0),e-=a}return e}if(!t.fn.dotdotdot){t.fn.dotdotdot=function(e){if(0==this.length)return t.fn.dotdotdot.debug('No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){t(this).dotdotdot(e)});var o=this,i=o.contents();o.data("dotdotdot")&&o.trigger("destroy.dot"),o.data("dotdotdot-style",o.attr("style")||""),o.css("word-wrap","break-word"),"nowrap"===o.css("white-space")&&o.css("white-space","normal"),o.bind_events=function(){return o.bind("update.dot",function(e,d){switch(o.removeClass("is-truncated"),e.preventDefault(),e.stopPropagation(),typeof l.height){case"number":l.maxHeight=l.height;break;case"function":l.maxHeight=l.height.call(o[0]);break;default:l.maxHeight=f(o)}l.maxHeight+=l.tolerance,"undefined"!=typeof d&&(("string"==typeof d||"nodeType"in d&&1===d.nodeType)&&(d=t("<div />").append(d).contents()),d instanceof t&&(i=d)),g=o.wrapInner('<div class="dotdotdot" />').children(),g.contents().detach().end().append(i.clone(!0)).find("br").replaceWith("  <br />  ").end().css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var c=!1,u=!1;return s.afterElement&&(c=s.afterElement.clone(!0),c.show(),s.afterElement.detach()),a(g,l)&&(u="children"==l.wrap?n(g,l,c):r(g,o,g,l,c)),g.replaceWith(g.contents()),g=null,t.isFunction(l.callback)&&l.callback.call(o[0],u,i),s.isTruncated=u,u}).bind("isTruncated.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(o[0],s.isTruncated),s.isTruncated}).bind("originalContent.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(o[0],i),i}).bind("destroy.dot",function(t){t.preventDefault(),t.stopPropagation(),o.unwatch().unbind_events().contents().detach().end().append(i).attr("style",o.data("dotdotdot-style")||"").removeClass("is-truncated").data("dotdotdot",!1)}),o},o.unbind_events=function(){return o.unbind(".dot"),o},o.watch=function(){if(o.unwatch(),"window"==l.watch){var e=t(window),n=e.width(),r=e.height();e.bind("resize.dot"+s.dotId,function(){n==e.width()&&r==e.height()&&l.windowResizeFix||(n=e.width(),r=e.height(),u&&clearInterval(u),u=setTimeout(function(){o.trigger("update.dot")},100))})}else c=d(o),u=setInterval(function(){if(o.is(":visible")){var t=d(o);c.width==t.width&&c.height==t.height||(o.trigger("update.dot"),c=t)}},500);return o},o.unwatch=function(){return t(window).unbind("resize.dot"+s.dotId),u&&clearInterval(u),o};var l=t.extend(!0,{},t.fn.dotdotdot.defaults,e),s={},c={},u=null,g=null;return l.lastCharacter.remove instanceof Array||(l.lastCharacter.remove=t.fn.dotdotdot.defaultArrays.lastCharacter.remove),l.lastCharacter.noEllipsis instanceof Array||(l.lastCharacter.noEllipsis=t.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),s.afterElement=h(l.after,o),s.isTruncated=!1,s.dotId=p++,o.data("dotdotdot",!0).bind_events().trigger("update.dot"),l.watch&&o.watch(),o},t.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0},t.fn.dotdotdot.defaultArrays={lastCharacter:{remove:[" ","　",",",";",".","!","?"],noEllipsis:[]}},t.fn.dotdotdot.debug=function(t){};var p=1,g=t.fn.html;t.fn.html=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?this.trigger("update",[n]):g.apply(this,arguments)};var v=t.fn.text;t.fn.text=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?(n=t("<div />").text(n).html(),this.trigger("update",[n])):v.apply(this,arguments)}}}(jQuery),jQuery(document).ready(function(t){t(".dot-ellipsis").each(function(){var e=t(this).hasClass("dot-resize-update"),n=t(this).hasClass("dot-timer-update"),r=0,o=t(this).attr("class").split(/\s+/);t.each(o,function(t,e){var n=e.match(/^dot-height-(\d+)$/);null!==n&&(r=Number(n[1]))});var a=new Object;n&&(a.watch=!0),e&&(a.watch="window"),r>0&&(a.height=r),t(this).dotdotdot(a)})}),jQuery(window).on("load",function(){jQuery(".dot-ellipsis.dot-load-update").trigger("update.dot")});
/*-----/js/jquery/jquery.dotdotdot.min.js / end -----*/

/*-----/js/jquery/jquery.json.min-2.5.1.js / start -----*/

!function($){"use strict";var escape=/["\\\x00-\x1f\x7f-\x9f]/g,meta={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},hasOwn=Object.prototype.hasOwnProperty;$.toJSON="object"==typeof JSON&&JSON.stringify?JSON.stringify:function(a){if(null===a)return"null";var b,c,d,e,f=$.type(a);if("undefined"===f)return void 0;if("number"===f||"boolean"===f)return String(a);if("string"===f)return $.quoteString(a);if("function"==typeof a.toJSON)return $.toJSON(a.toJSON());if("date"===f){var g=a.getUTCMonth()+1,h=a.getUTCDate(),i=a.getUTCFullYear(),j=a.getUTCHours(),k=a.getUTCMinutes(),l=a.getUTCSeconds(),m=a.getUTCMilliseconds();return 10>g&&(g="0"+g),10>h&&(h="0"+h),10>j&&(j="0"+j),10>k&&(k="0"+k),10>l&&(l="0"+l),100>m&&(m="0"+m),10>m&&(m="0"+m),'"'+i+"-"+g+"-"+h+"T"+j+":"+k+":"+l+"."+m+'Z"'}if(b=[],$.isArray(a)){for(c=0;c<a.length;c++)b.push($.toJSON(a[c])||"null");return"["+b.join(",")+"]"}if("object"==typeof a){for(c in a)if(hasOwn.call(a,c)){if(f=typeof c,"number"===f)d='"'+c+'"';else{if("string"!==f)continue;d=$.quoteString(c)}f=typeof a[c],"function"!==f&&"undefined"!==f&&(e=$.toJSON(a[c]),b.push(d+":"+e))}return"{"+b.join(",")+"}"}},$.evalJSON="object"==typeof JSON&&JSON.parse?JSON.parse:function(str){return eval("("+str+")")},$.secureEvalJSON="object"==typeof JSON&&JSON.parse?JSON.parse:function(str){var filtered=str.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(filtered))return eval("("+str+")");throw new SyntaxError("Error parsing JSON, source is not valid.")},$.quoteString=function(a){return a.match(escape)?'"'+a.replace(escape,function(a){var b=meta[a];return"string"==typeof b?b:(b=a.charCodeAt(),"\\u00"+Math.floor(b/16).toString(16)+(b%16).toString(16))})+'"':'"'+a+'"'}}(jQuery);
/*-----/js/jquery/jquery.json.min-2.5.1.js / end -----*/

/*-----/js/jquery/jquery.easing-1.3.min.js / start -----*/
jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,a,c,b,d){return jQuery.easing[jQuery.easing.def](e,a,c,b,d)},easeInQuad:function(e,a,c,b,d){return b*(a/=d)*a+c},easeOutQuad:function(e,a,c,b,d){return-b*(a/=d)*(a-2)+c},easeInOutQuad:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a+c;return-b/2*(--a*(a-2)-1)+c},easeInCubic:function(e,a,c,b,d){return b*(a/=d)*a*a+c},easeOutCubic:function(e,a,c,b,d){return b*((a=a/d-1)*a*a+1)+c},easeInOutCubic:function(e,a,c,b,d){if((a/=d/2)<1)return b/
2*a*a*a+c;return b/2*((a-=2)*a*a+2)+c},easeInQuart:function(e,a,c,b,d){return b*(a/=d)*a*a*a+c},easeOutQuart:function(e,a,c,b,d){return-b*((a=a/d-1)*a*a*a-1)+c},easeInOutQuart:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a*a*a+c;return-b/2*((a-=2)*a*a*a-2)+c},easeInQuint:function(e,a,c,b,d){return b*(a/=d)*a*a*a*a+c},easeOutQuint:function(e,a,c,b,d){return b*((a=a/d-1)*a*a*a*a+1)+c},easeInOutQuint:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a*a*a*a+c;return b/2*((a-=2)*a*a*a*a+2)+c},easeInSine:function(e,
a,c,b,d){return-b*Math.cos(a/d*(Math.PI/2))+b+c},easeOutSine:function(e,a,c,b,d){return b*Math.sin(a/d*(Math.PI/2))+c},easeInOutSine:function(e,a,c,b,d){return-b/2*(Math.cos(Math.PI*a/d)-1)+c},easeInExpo:function(e,a,c,b,d){return a==0?c:b*Math.pow(2,10*(a/d-1))+c},easeOutExpo:function(e,a,c,b,d){return a==d?c+b:b*(-Math.pow(2,-10*a/d)+1)+c},easeInOutExpo:function(e,a,c,b,d){if(a==0)return c;if(a==d)return c+b;if((a/=d/2)<1)return b/2*Math.pow(2,10*(a-1))+c;return b/2*(-Math.pow(2,-10*--a)+2)+c},
easeInCirc:function(e,a,c,b,d){return-b*(Math.sqrt(1-(a/=d)*a)-1)+c},easeOutCirc:function(e,a,c,b,d){return b*Math.sqrt(1-(a=a/d-1)*a)+c},easeInOutCirc:function(e,a,c,b,d){if((a/=d/2)<1)return-b/2*(Math.sqrt(1-a*a)-1)+c;return b/2*(Math.sqrt(1-(a-=2)*a)+1)+c},easeInElastic:function(e,a,c,b,d){e=1.70158;var f=0,g=b;if(a==0)return c;if((a/=d)==1)return c+b;f||(f=d*0.3);if(g<Math.abs(b)){g=b;e=f/4}else e=f/(2*Math.PI)*Math.asin(b/g);return-(g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f))+c},easeOutElastic:function(e,
a,c,b,d){e=1.70158;var f=0,g=b;if(a==0)return c;if((a/=d)==1)return c+b;f||(f=d*0.3);if(g<Math.abs(b)){g=b;e=f/4}else e=f/(2*Math.PI)*Math.asin(b/g);return g*Math.pow(2,-10*a)*Math.sin((a*d-e)*2*Math.PI/f)+b+c},easeInOutElastic:function(e,a,c,b,d){e=1.70158;var f=0,g=b;if(a==0)return c;if((a/=d/2)==2)return c+b;f||(f=d*0.3*1.5);if(g<Math.abs(b)){g=b;e=f/4}else e=f/(2*Math.PI)*Math.asin(b/g);if(a<1)return-0.5*g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f)+c;return g*Math.pow(2,-10*(a-=1))*Math.sin((a*
d-e)*2*Math.PI/f)*0.5+b+c},easeInBack:function(e,a,c,b,d,f){if(f==undefined)f=1.70158;return b*(a/=d)*a*((f+1)*a-f)+c},easeOutBack:function(e,a,c,b,d,f){if(f==undefined)f=1.70158;return b*((a=a/d-1)*a*((f+1)*a+f)+1)+c},easeInOutBack:function(e,a,c,b,d,f){if(f==undefined)f=1.70158;if((a/=d/2)<1)return b/2*a*a*(((f*=1.525)+1)*a-f)+c;return b/2*((a-=2)*a*(((f*=1.525)+1)*a+f)+2)+c},easeInBounce:function(e,a,c,b,d){return b-jQuery.easing.easeOutBounce(e,d-a,0,b,d)+c},easeOutBounce:function(e,a,c,b,d){return(a/=
d)<1/2.75?b*7.5625*a*a+c:a<2/2.75?b*(7.5625*(a-=1.5/2.75)*a+0.75)+c:a<2.5/2.75?b*(7.5625*(a-=2.25/2.75)*a+0.9375)+c:b*(7.5625*(a-=2.625/2.75)*a+0.984375)+c},easeInOutBounce:function(e,a,c,b,d){if(a<d/2)return jQuery.easing.easeInBounce(e,a*2,0,b,d)*0.5+c;return jQuery.easing.easeOutBounce(e,a*2-d,0,b,d)*0.5+b*0.5+c}});
/*-----/js/jquery/jquery.easing-1.3.min.js / end -----*/

/*-----/js/jquery/swiper.jquery.js / start -----*/

(function () {
    'use strict';
    var $;
    
    var Swiper = function (container, params) {
        if (!(this instanceof Swiper)) return new Swiper(container, params);

        var defaults = {
            direction: 'horizontal',
            touchEventsTarget: 'container',
            initialSlide: 0,
            speed: 300,
            // autoplay
            autoplay: false,
            autoplayDisableOnInteraction: true,
            autoplayStopOnLast: false,
            // To support iOS's swipe-to-go-back gesture (when being used in-app, with UIWebView).
            iOSEdgeSwipeDetection: false,
            iOSEdgeSwipeThreshold: 20,
            // Free mode
            freeMode: false,
            freeModeMomentum: true,
            freeModeMomentumRatio: 1,
            freeModeMomentumBounce: true,
            freeModeMomentumBounceRatio: 1,
            freeModeSticky: false,
            freeModeMinimumVelocity: 0.02,
            // Autoheight
            autoHeight: false,
            // Set wrapper width
            setWrapperSize: false,
            // Virtual Translate
            virtualTranslate: false,
            // Effects
            effect: 'slide', // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
            coverflow: {
                rotate: 50,
                stretch: 0,
                depth: 100,
                modifier: 1,
                slideShadows : true
            },
            flip: {
                slideShadows : true,
                limitRotation: true
            },
            cube: {
                slideShadows: true,
                shadow: true,
                shadowOffset: 20,
                shadowScale: 0.94
            },
            fade: {
                crossFade: false
            },
            // Parallax
            parallax: false,
            // Scrollbar
            scrollbar: null,
            scrollbarHide: true,
            scrollbarDraggable: false,
            scrollbarSnapOnRelease: false,
            // Keyboard Mousewheel
            keyboardControl: false,
            mousewheelControl: false,
            mousewheelReleaseOnEdges: false,
            mousewheelInvert: false,
            mousewheelForceToAxis: false,
            mousewheelSensitivity: 1,
            // Hash Navigation
            hashnav: false,
            // Breakpoints
            breakpoints: undefined,
            // Slides grid
            spaceBetween: 0,
            slidesPerView: 1,
            slidesPerColumn: 1,
            slidesPerColumnFill: 'column',
            slidesPerGroup: 1,
            centeredSlides: false,
            slidesOffsetBefore: 0, // in px
            slidesOffsetAfter: 0, // in px
            // Round length
            roundLengths: false,
            // Touches
            touchRatio: 1,
            touchAngle: 45,
            simulateTouch: true,
            shortSwipes: true,
            longSwipes: true,
            longSwipesRatio: 0.5,
            longSwipesMs: 300,
            followFinger: true,
            onlyExternal: false,
            threshold: 0,
            touchMoveStopPropagation: true,
            // Unique Navigation Elements
            uniqueNavElements: true,
            // Pagination
            pagination: null,
            paginationElement: 'span',
            paginationClickable: false,
            paginationHide: false,
            paginationBulletRender: null,
            paginationProgressRender: null,
            paginationFractionRender: null,
            paginationCustomRender: null,
            paginationType: 'bullets', // 'bullets' or 'progress' or 'fraction' or 'custom'
            // Resistance
            resistance: true,
            resistanceRatio: 0.85,
            // Next/prev buttons
            nextButton: null,
            prevButton: null,
            // Progress
            watchSlidesProgress: false,
            watchSlidesVisibility: false,
            // Cursor
            grabCursor: false,
            // Clicks
            preventClicks: true,
            preventClicksPropagation: true,
            slideToClickedSlide: false,
            // Lazy Loading
            lazyLoading: false,
            lazyLoadingInPrevNext: false,
            lazyLoadingInPrevNextAmount: 1,
            lazyLoadingOnTransitionStart: false,
            // Images
            preloadImages: true,
            updateOnImagesReady: true,
            // loop
            loop: false,
            loopAdditionalSlides: 0,
            loopedSlides: null,
            // Control
            control: undefined,
            controlInverse: false,
            controlBy: 'slide', //or 'container'
            // Swiping/no swiping
            allowSwipeToPrev: true,
            allowSwipeToNext: true,
            swipeHandler: null, //'.swipe-handler',
            noSwiping: true,
            noSwipingClass: 'swiper-no-swiping',
            // NS
            slideClass: 'swiper-slide',
            slideActiveClass: 'swiper-slide-active',
            slideVisibleClass: 'swiper-slide-visible',
            slideDuplicateClass: 'swiper-slide-duplicate',
            slideNextClass: 'swiper-slide-next',
            slidePrevClass: 'swiper-slide-prev',
            wrapperClass: 'swiper-wrapper',
            bulletClass: 'swiper-pagination-bullet',
            bulletActiveClass: 'swiper-pagination-bullet-active',
            buttonDisabledClass: 'swiper-button-disabled',
            paginationCurrentClass: 'swiper-pagination-current',
            paginationTotalClass: 'swiper-pagination-total',
            paginationHiddenClass: 'swiper-pagination-hidden',
            paginationProgressbarClass: 'swiper-pagination-progressbar',
            // Observer
            observer: false,
            observeParents: false,
            // Accessibility
            a11y: false,
            prevSlideMessage: 'Previous slide',
            nextSlideMessage: 'Next slide',
            firstSlideMessage: 'This is the first slide',
            lastSlideMessage: 'This is the last slide',
            paginationBulletMessage: 'Go to slide {{index}}',
            // Callbacks
            runCallbacksOnInit: true
            
        
        };
        var initialVirtualTranslate = params && params.virtualTranslate;
        
        params = params || {};
        var originalParams = {};
        for (var param in params) {
            if (typeof params[param] === 'object' && params[param] !== null && !(params[param].nodeType || params[param] === window || params[param] === document || (typeof Dom7 !== 'undefined' && params[param] instanceof Dom7) || (typeof jQuery !== 'undefined' && params[param] instanceof jQuery))) {
                originalParams[param] = {};
                for (var deepParam in params[param]) {
                    originalParams[param][deepParam] = params[param][deepParam];
                }
            }
            else {
                originalParams[param] = params[param];
            }
        }
        for (var def in defaults) {
            if (typeof params[def] === 'undefined') {
                params[def] = defaults[def];
            }
            else if (typeof params[def] === 'object') {
                for (var deepDef in defaults[def]) {
                    if (typeof params[def][deepDef] === 'undefined') {
                        params[def][deepDef] = defaults[def][deepDef];
                    }
                }
            }
        }
        
        // Swiper
        var s = this;
        
        // Params
        s.params = params;
        s.originalParams = originalParams;
        
        // Classname
        s.classNames = [];
        
        if (typeof $ !== 'undefined' && typeof Dom7 !== 'undefined'){
            $ = Dom7;
        }
        if (typeof $ === 'undefined') {
            if (typeof Dom7 === 'undefined') {
                $ = window.Dom7 || window.Zepto || window.jQuery;
            }
            else {
                $ = Dom7;
            }
            if (!$) return;
        }
        // Export it to Swiper instance
        s.$ = $;
        
        
        s.currentBreakpoint = undefined;
        s.getActiveBreakpoint = function () {
            //Get breakpoint for window width
            if (!s.params.breakpoints) return false;
            var breakpoint = false;
            var points = [], point;
            for ( point in s.params.breakpoints ) {
                if (s.params.breakpoints.hasOwnProperty(point)) {
                    points.push(point);
                }
            }
            points.sort(function (a, b) {
                return parseInt(a, 10) > parseInt(b, 10);
            });
            for (var i = 0; i < points.length; i++) {
                point = points[i];
                if (point >= window.innerWidth && !breakpoint) {
                    breakpoint = point;
                }
            }
            return breakpoint || 'max';
        };
        s.setBreakpoint = function () {
            //Set breakpoint for window width and update parameters
            var breakpoint = s.getActiveBreakpoint();
            if (breakpoint && s.currentBreakpoint !== breakpoint) {
                var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams;
                var needsReLoop = s.params.loop && (breakPointsParams.slidesPerView !== s.params.slidesPerView);
                for ( var param in breakPointsParams ) {
                    s.params[param] = breakPointsParams[param];
                }
                s.currentBreakpoint = breakpoint;
                if(needsReLoop && s.destroyLoop) {
                    s.reLoop(true);
                }
            }
        };
        // Set breakpoint on load
        if (s.params.breakpoints) {
            s.setBreakpoint();
        }
        
        
        s.container = $(container);
        if (s.container.length === 0) return;
        if (s.container.length > 1) {
            var swipers = [];
            s.container.each(function () {
                var container = this;
                swipers.push(new Swiper(this, params));
            });
            return swipers;
        }
        
        // Save instance in container HTML Element and in data
        s.container[0].swiper = s;
        s.container.data('swiper', s);
        
        s.classNames.push('swiper-container-' + s.params.direction);
        
        if (s.params.freeMode) {
            s.classNames.push('swiper-container-free-mode');
        }
        if (!s.support.flexbox) {
            s.classNames.push('swiper-container-no-flexbox');
            s.params.slidesPerColumn = 1;
        }
        if (s.params.autoHeight) {
            s.classNames.push('swiper-container-autoheight');
        }
        // Enable slides progress when required
        if (s.params.parallax || s.params.watchSlidesVisibility) {
            s.params.watchSlidesProgress = true;
        }
        // Coverflow / 3D
        if (['cube', 'coverflow', 'flip'].indexOf(s.params.effect) >= 0) {
            if (s.support.transforms3d) {
                s.params.watchSlidesProgress = true;
                s.classNames.push('swiper-container-3d');
            }
            else {
                s.params.effect = 'slide';
            }
        }
        if (s.params.effect !== 'slide') {
            s.classNames.push('swiper-container-' + s.params.effect);
        }
        if (s.params.effect === 'cube') {
            s.params.resistanceRatio = 0;
            s.params.slidesPerView = 1;
            s.params.slidesPerColumn = 1;
            s.params.slidesPerGroup = 1;
            s.params.centeredSlides = false;
            s.params.spaceBetween = 0;
            s.params.virtualTranslate = true;
            s.params.setWrapperSize = false;
        }
        if (s.params.effect === 'fade' || s.params.effect === 'flip') {
            s.params.slidesPerView = 1;
            s.params.slidesPerColumn = 1;
            s.params.slidesPerGroup = 1;
            s.params.watchSlidesProgress = true;
            s.params.spaceBetween = 0;
            s.params.setWrapperSize = false;
            if (typeof initialVirtualTranslate === 'undefined') {
                s.params.virtualTranslate = true;
            }
        }
        
        // Grab Cursor
        if (s.params.grabCursor && s.support.touch) {
            s.params.grabCursor = false;
        }
        
        // Wrapper
        s.wrapper = s.container.children('.' + s.params.wrapperClass);
        
        // Pagination
        if (s.params.pagination) {
            s.paginationContainer = $(s.params.pagination);
            if (s.params.uniqueNavElements && typeof s.params.pagination === 'string' && s.paginationContainer.length > 1 && s.container.find(s.params.pagination).length === 1) {
                s.paginationContainer = s.container.find(s.params.pagination);
            }
        
            if (s.params.paginationType === 'bullets' && s.params.paginationClickable) {
                s.paginationContainer.addClass('swiper-pagination-clickable');
            }
            else {
                s.params.paginationClickable = false;
            }
            s.paginationContainer.addClass('swiper-pagination-' + s.params.paginationType);
        }
        // Next/Prev Buttons
        if (s.params.nextButton || s.params.prevButton) {
            if (s.params.nextButton) {
                s.nextButton = $(s.params.nextButton);
                if (s.params.uniqueNavElements && typeof s.params.nextButton === 'string' && s.nextButton.length > 1 && s.container.find(s.params.nextButton).length === 1) {
                    s.nextButton = s.container.find(s.params.nextButton);
                }
            }
            if (s.params.prevButton) {
                s.prevButton = $(s.params.prevButton);
                if (s.params.uniqueNavElements && typeof s.params.prevButton === 'string' && s.prevButton.length > 1 && s.container.find(s.params.prevButton).length === 1) {
                    s.prevButton = s.container.find(s.params.prevButton);
                }
            }
        }
        
        // Is Horizontal
        s.isHorizontal = function () {
            return s.params.direction === 'horizontal';
        };
        // s.isH = isH;
        
        // RTL
        s.rtl = s.isHorizontal() && (s.container[0].dir.toLowerCase() === 'rtl' || s.container.css('direction') === 'rtl');
        if (s.rtl) {
            s.classNames.push('swiper-container-rtl');
        }
        
        // Wrong RTL support
        if (s.rtl) {
            s.wrongRTL = s.wrapper.css('display') === '-webkit-box';
        }
        
        // Columns
        if (s.params.slidesPerColumn > 1) {
            s.classNames.push('swiper-container-multirow');
        }
        
        // Check for Android
        if (s.device.android) {
            s.classNames.push('swiper-container-android');
        }
        
        // Add classes
        s.container.addClass(s.classNames.join(' '));
        
        // Translate
        s.translate = 0;
        
        // Progress
        s.progress = 0;
        
        // Velocity
        s.velocity = 0;
        
        
        s.lockSwipeToNext = function () {
            s.params.allowSwipeToNext = false;
        };
        s.lockSwipeToPrev = function () {
            s.params.allowSwipeToPrev = false;
        };
        s.lockSwipes = function () {
            s.params.allowSwipeToNext = s.params.allowSwipeToPrev = false;
        };
        s.unlockSwipeToNext = function () {
            s.params.allowSwipeToNext = true;
        };
        s.unlockSwipeToPrev = function () {
            s.params.allowSwipeToPrev = true;
        };
        s.unlockSwipes = function () {
            s.params.allowSwipeToNext = s.params.allowSwipeToPrev = true;
        };
        
        
        function round(a) {
            return Math.floor(a);
        }
        
        if (s.params.grabCursor) {
            s.container[0].style.cursor = 'move';
            s.container[0].style.cursor = '-webkit-grab';
            s.container[0].style.cursor = '-moz-grab';
            s.container[0].style.cursor = 'grab';
        }
        
        s.imagesToLoad = [];
        s.imagesLoaded = 0;
        
        s.loadImage = function (imgElement, src, srcset, checkForComplete, callback) {
            var image;
            function onReady () {
                if (callback) callback();
            }
            if (!imgElement.complete || !checkForComplete) {
                if (src) {
                    image = new window.Image();
                    image.onload = onReady;
                    image.onerror = onReady;
                    if (srcset) {
                        image.srcset = srcset;
                    }
                    if (src) {
                        image.src = src;
                    }
                } else {
                    onReady();
                }
        
            } else {//image already loaded...
                onReady();
            }
        };
        s.preloadImages = function () {
            s.imagesToLoad = s.container.find('img');
            function _onReady() {
                if (typeof s === 'undefined' || s === null) return;
                if (s.imagesLoaded !== undefined) s.imagesLoaded++;
                if (s.imagesLoaded === s.imagesToLoad.length) {
                    if (s.params.updateOnImagesReady) s.update();
                    s.emit('onImagesReady', s);
                }
            }
            for (var i = 0; i < s.imagesToLoad.length; i++) {
                s.loadImage(s.imagesToLoad[i], (s.imagesToLoad[i].currentSrc || s.imagesToLoad[i].getAttribute('src')), (s.imagesToLoad[i].srcset || s.imagesToLoad[i].getAttribute('srcset')), true, _onReady);
            }
        };
        
        
        s.autoplayTimeoutId = undefined;
        s.autoplaying = false;
        s.autoplayPaused = false;
        function autoplay() {
            s.autoplayTimeoutId = setTimeout(function () {
                if (s.params.loop) {
                    s.fixLoop();
                    s._slideNext();
                    s.emit('onAutoplay', s);
                }
                else {
                    if (!s.isEnd) {
                        s._slideNext();
                        s.emit('onAutoplay', s);
                    }
                    else {
                        if (!params.autoplayStopOnLast) {
                            s._slideTo(0);
                            s.emit('onAutoplay', s);
                        }
                        else {
                            s.stopAutoplay();
                        }
                    }
                }
            }, s.params.autoplay);
        }
        s.startAutoplay = function () {
            if (typeof s.autoplayTimeoutId !== 'undefined') return false;
            if (!s.params.autoplay) return false;
            if (s.autoplaying) return false;
            s.autoplaying = true;
            s.emit('onAutoplayStart', s);
            autoplay();
        };
        s.stopAutoplay = function (internal) {
            if (!s.autoplayTimeoutId) return;
            if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId);
            s.autoplaying = false;
            s.autoplayTimeoutId = undefined;
            s.emit('onAutoplayStop', s);
        };
        s.pauseAutoplay = function (speed) {
            if (s.autoplayPaused) return;
            if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId);
            s.autoplayPaused = true;
            if (speed === 0) {
                s.autoplayPaused = false;
                autoplay();
            }
            else {
                s.wrapper.transitionEnd(function () {
                    if (!s) return;
                    s.autoplayPaused = false;
                    if (!s.autoplaying) {
                        s.stopAutoplay();
                    }
                    else {
                        autoplay();
                    }
                });
            }
        };
        
        s.minTranslate = function () {
            return (-s.snapGrid[0]);
        };
        s.maxTranslate = function () {
            return (-s.snapGrid[s.snapGrid.length - 1]);
        };
        
        s.updateAutoHeight = function () {
            // Update Height
            var slide = s.slides.eq(s.activeIndex)[0];
            if (typeof slide !== 'undefined') {
                var newHeight = slide.offsetHeight;
                if (newHeight) s.wrapper.css('height', newHeight + 'px');
            }
        };
        s.updateContainerSize = function () {
            var width, height;
            if (typeof s.params.width !== 'undefined') {
                width = s.params.width;
            }
            else {
                width = s.container[0].clientWidth;
            }
            if (typeof s.params.height !== 'undefined') {
                height = s.params.height;
            }
            else {
                height = s.container[0].clientHeight;
            }
            if (width === 0 && s.isHorizontal() || height === 0 && !s.isHorizontal()) {
                return;
            }
        
            //Subtract paddings
            width = width - parseInt(s.container.css('padding-left'), 10) - parseInt(s.container.css('padding-right'), 10);
            height = height - parseInt(s.container.css('padding-top'), 10) - parseInt(s.container.css('padding-bottom'), 10);
        
            // Store values
            s.width = width;
            s.height = height;
            s.size = s.isHorizontal() ? s.width : s.height;
        };
        
        s.updateSlidesSize = function () {
            s.slides = s.wrapper.children('.' + s.params.slideClass);
            s.snapGrid = [];
            s.slidesGrid = [];
            s.slidesSizesGrid = [];
        
            var spaceBetween = s.params.spaceBetween,
                slidePosition = -s.params.slidesOffsetBefore,
                i,
                prevSlideSize = 0,
                index = 0;
            if (typeof s.size === 'undefined') return;
            if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
                spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size;
            }
        
            s.virtualSize = -spaceBetween;
            // reset margins
            if (s.rtl) s.slides.css({marginLeft: '', marginTop: ''});
            else s.slides.css({marginRight: '', marginBottom: ''});
        
            var slidesNumberEvenToRows;
            if (s.params.slidesPerColumn > 1) {
                if (Math.floor(s.slides.length / s.params.slidesPerColumn) === s.slides.length / s.params.slidesPerColumn) {
                    slidesNumberEvenToRows = s.slides.length;
                }
                else {
                    slidesNumberEvenToRows = Math.ceil(s.slides.length / s.params.slidesPerColumn) * s.params.slidesPerColumn;
                }
                if (s.params.slidesPerView !== 'auto' && s.params.slidesPerColumnFill === 'row') {
                    slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, s.params.slidesPerView * s.params.slidesPerColumn);
                }
            }
        
            // Calc slides
            var slideSize;
            var slidesPerColumn = s.params.slidesPerColumn;
            var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;
            var numFullColumns = slidesPerRow - (s.params.slidesPerColumn * slidesPerRow - s.slides.length);
            for (i = 0; i < s.slides.length; i++) {
                slideSize = 0;
                var slide = s.slides.eq(i);
                if (s.params.slidesPerColumn > 1) {
                    // Set slides order
                    var newSlideOrderIndex;
                    var column, row;
                    if (s.params.slidesPerColumnFill === 'column') {
                        column = Math.floor(i / slidesPerColumn);
                        row = i - column * slidesPerColumn;
                        if (column > numFullColumns || (column === numFullColumns && row === slidesPerColumn-1)) {
                            if (++row >= slidesPerColumn) {
                                row = 0;
                                column++;
                            }
                        }
                        newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn;
                        slide
                            .css({
                                '-webkit-box-ordinal-group': newSlideOrderIndex,
                                '-moz-box-ordinal-group': newSlideOrderIndex,
                                '-ms-flex-order': newSlideOrderIndex,
                                '-webkit-order': newSlideOrderIndex,
                                'order': newSlideOrderIndex
                            });
                    }
                    else {
                        row = Math.floor(i / slidesPerRow);
                        column = i - row * slidesPerRow;
                    }
                    slide
                        .css({
                            'margin-top': (row !== 0 && s.params.spaceBetween) && (s.params.spaceBetween + 'px')
                        })
                        .attr('data-swiper-column', column)
                        .attr('data-swiper-row', row);
        
                }
                if (slide.css('display') === 'none') continue;
                if (s.params.slidesPerView === 'auto') {
                    slideSize = s.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);
                    if (s.params.roundLengths) slideSize = round(slideSize);
                }
                else {
                    slideSize = (s.size - (s.params.slidesPerView - 1) * spaceBetween) / s.params.slidesPerView;
                    if (s.params.roundLengths) slideSize = round(slideSize);
        
                    if (s.isHorizontal()) {
                        s.slides[i].style.width = slideSize + 'px';
                    }
                    else {
                        s.slides[i].style.height = slideSize + 'px';
                    }
                }
                s.slides[i].swiperSlideSize = slideSize;
                s.slidesSizesGrid.push(slideSize);
        
        
                if (s.params.centeredSlides) {
                    slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
                    if (i === 0) slidePosition = slidePosition - s.size / 2 - spaceBetween;
                    if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
                    if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition);
                    s.slidesGrid.push(slidePosition);
                }
                else {
                    if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition);
                    s.slidesGrid.push(slidePosition);
                    slidePosition = slidePosition + slideSize + spaceBetween;
                }
        
                s.virtualSize += slideSize + spaceBetween;
        
                prevSlideSize = slideSize;
        
                index ++;
            }
            s.virtualSize = Math.max(s.virtualSize, s.size) + s.params.slidesOffsetAfter;
            var newSlidesGrid;
        
            if (
                s.rtl && s.wrongRTL && (s.params.effect === 'slide' || s.params.effect === 'coverflow')) {
                s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});
            }
            if (!s.support.flexbox || s.params.setWrapperSize) {
                if (s.isHorizontal()) s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});
                else s.wrapper.css({height: s.virtualSize + s.params.spaceBetween + 'px'});
            }
        
            if (s.params.slidesPerColumn > 1) {
                s.virtualSize = (slideSize + s.params.spaceBetween) * slidesNumberEvenToRows;
                s.virtualSize = Math.ceil(s.virtualSize / s.params.slidesPerColumn) - s.params.spaceBetween;
                s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});
                if (s.params.centeredSlides) {
                    newSlidesGrid = [];
                    for (i = 0; i < s.snapGrid.length; i++) {
                        if (s.snapGrid[i] < s.virtualSize + s.snapGrid[0]) newSlidesGrid.push(s.snapGrid[i]);
                    }
                    s.snapGrid = newSlidesGrid;
                }
            }
        
            // Remove last grid elements depending on width
            if (!s.params.centeredSlides) {
                newSlidesGrid = [];
                for (i = 0; i < s.snapGrid.length; i++) {
                    if (s.snapGrid[i] <= s.virtualSize - s.size) {
                        newSlidesGrid.push(s.snapGrid[i]);
                    }
                }
                s.snapGrid = newSlidesGrid;
                if (Math.floor(s.virtualSize - s.size) - Math.floor(s.snapGrid[s.snapGrid.length - 1]) > 1) {
                    s.snapGrid.push(s.virtualSize - s.size);
                }
            }
            if (s.snapGrid.length === 0) s.snapGrid = [0];
        
            if (s.params.spaceBetween !== 0) {
                if (s.isHorizontal()) {
                    if (s.rtl) s.slides.css({marginLeft: spaceBetween + 'px'});
                    else s.slides.css({marginRight: spaceBetween + 'px'});
                }
                else s.slides.css({marginBottom: spaceBetween + 'px'});
            }
            if (s.params.watchSlidesProgress) {
                s.updateSlidesOffset();
            }
        };
        s.updateSlidesOffset = function () {
            for (var i = 0; i < s.slides.length; i++) {
                s.slides[i].swiperSlideOffset = s.isHorizontal() ? s.slides[i].offsetLeft : s.slides[i].offsetTop;
            }
        };
        
        
        s.updateSlidesProgress = function (translate) {
            if (typeof translate === 'undefined') {
                translate = s.translate || 0;
            }
            if (s.slides.length === 0) return;
            if (typeof s.slides[0].swiperSlideOffset === 'undefined') s.updateSlidesOffset();
        
            var offsetCenter = -translate;
            if (s.rtl) offsetCenter = translate;
        
            // Visible Slides
            s.slides.removeClass(s.params.slideVisibleClass);
            for (var i = 0; i < s.slides.length; i++) {
                var slide = s.slides[i];
                var slideProgress = (offsetCenter - slide.swiperSlideOffset) / (slide.swiperSlideSize + s.params.spaceBetween);
                if (s.params.watchSlidesVisibility) {
                    var slideBefore = -(offsetCenter - slide.swiperSlideOffset);
                    var slideAfter = slideBefore + s.slidesSizesGrid[i];
                    var isVisible =
                        (slideBefore >= 0 && slideBefore < s.size) ||
                        (slideAfter > 0 && slideAfter <= s.size) ||
                        (slideBefore <= 0 && slideAfter >= s.size);
                    if (isVisible) {
                        s.slides.eq(i).addClass(s.params.slideVisibleClass);
                    }
                }
                slide.progress = s.rtl ? -slideProgress : slideProgress;
            }
        };
        s.updateProgress = function (translate) {
            if (typeof translate === 'undefined') {
                translate = s.translate || 0;
            }
            var translatesDiff = s.maxTranslate() - s.minTranslate();
            var wasBeginning = s.isBeginning;
            var wasEnd = s.isEnd;
            if (translatesDiff === 0) {
                s.progress = 0;
                s.isBeginning = s.isEnd = true;
            }
            else {
                s.progress = (translate - s.minTranslate()) / (translatesDiff);
                s.isBeginning = s.progress <= 0;
                s.isEnd = s.progress >= 1;
            }
            if (s.isBeginning && !wasBeginning) s.emit('onReachBeginning', s);
            if (s.isEnd && !wasEnd) s.emit('onReachEnd', s);
        
            if (s.params.watchSlidesProgress) s.updateSlidesProgress(translate);
            s.emit('onProgress', s, s.progress);
        };
        s.updateActiveIndex = function () {
            var translate = s.rtl ? s.translate : -s.translate;
            var newActiveIndex, i, snapIndex;
            for (i = 0; i < s.slidesGrid.length; i ++) {
                if (typeof s.slidesGrid[i + 1] !== 'undefined') {
                    if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1] - (s.slidesGrid[i + 1] - s.slidesGrid[i]) / 2) {
                        newActiveIndex = i;
                    }
                    else if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1]) {
                        newActiveIndex = i + 1;
                    }
                }
                else {
                    if (translate >= s.slidesGrid[i]) {
                        newActiveIndex = i;
                    }
                }
            }
            // Normalize slideIndex
            if (newActiveIndex < 0 || typeof newActiveIndex === 'undefined') newActiveIndex = 0;
            // for (i = 0; i < s.slidesGrid.length; i++) {
                // if (- translate >= s.slidesGrid[i]) {
                    // newActiveIndex = i;
                // }
            // }
            snapIndex = Math.floor(newActiveIndex / s.params.slidesPerGroup);
            if (snapIndex >= s.snapGrid.length) snapIndex = s.snapGrid.length - 1;
        
            if (newActiveIndex === s.activeIndex) {
                return;
            }
            s.snapIndex = snapIndex;
            s.previousIndex = s.activeIndex;
            s.activeIndex = newActiveIndex;
            s.updateClasses();
        };
        
        
        s.updateClasses = function () {
            s.slides.removeClass(s.params.slideActiveClass + ' ' + s.params.slideNextClass + ' ' + s.params.slidePrevClass);
            var activeSlide = s.slides.eq(s.activeIndex);
            // Active classes
            activeSlide.addClass(s.params.slideActiveClass);
            // Next Slide
            var nextSlide = activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass);
            if (s.params.loop && nextSlide.length === 0) {
                s.slides.eq(0).addClass(s.params.slideNextClass);
            }
            // Prev Slide
            var prevSlide = activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass);
            if (s.params.loop && prevSlide.length === 0) {
                s.slides.eq(-1).addClass(s.params.slidePrevClass);
            }
        
            // Pagination
            if (s.paginationContainer && s.paginationContainer.length > 0) {
                // Current/Total
                var current,
                    total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;
                if (s.params.loop) {
                    current = Math.ceil((s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup);
                    if (current > s.slides.length - 1 - s.loopedSlides * 2) {
                        current = current - (s.slides.length - s.loopedSlides * 2);
                    }
                    if (current > total - 1) current = current - total;
                    if (current < 0 && s.params.paginationType !== 'bullets') current = total + current;
                }
                else {
                    if (typeof s.snapIndex !== 'undefined') {
                        current = s.snapIndex;
                    }
                    else {
                        current = s.activeIndex || 0;
                    }
                }
                // Types
                if (s.params.paginationType === 'bullets' && s.bullets && s.bullets.length > 0) {
                    s.bullets.removeClass(s.params.bulletActiveClass);
                    if (s.paginationContainer.length > 1) {
                        s.bullets.each(function () {
                            if ($(this).index() === current) $(this).addClass(s.params.bulletActiveClass);
                        });
                    }
                    else {
                        s.bullets.eq(current).addClass(s.params.bulletActiveClass);
                    }
                }
                if (s.params.paginationType === 'fraction') {
                    s.paginationContainer.find('.' + s.params.paginationCurrentClass).text(current + 1);
                    s.paginationContainer.find('.' + s.params.paginationTotalClass).text(total);
                }
                if (s.params.paginationType === 'progress') {
                    var scale = (current + 1) / total,
                        scaleX = scale,
                        scaleY = 1;
                    if (!s.isHorizontal()) {
                        scaleY = scale;
                        scaleX = 1;
                    }
                    s.paginationContainer.find('.' + s.params.paginationProgressbarClass).transform('translate3d(0,0,0) scaleX(' + scaleX + ') scaleY(' + scaleY + ')').transition(s.params.speed);
                }
                if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) {
                    s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total));
                    s.emit('onPaginationRendered', s, s.paginationContainer[0]);
                }
            }
        
            // Next/active buttons
            if (!s.params.loop) {
                if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
                    if (s.isBeginning) {
                        s.prevButton.addClass(s.params.buttonDisabledClass);
                        if (s.params.a11y && s.a11y) s.a11y.disable(s.prevButton);
                    }
                    else {
                        s.prevButton.removeClass(s.params.buttonDisabledClass);
                        if (s.params.a11y && s.a11y) s.a11y.enable(s.prevButton);
                    }
                }
                if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
                    if (s.isEnd) {
                        s.nextButton.addClass(s.params.buttonDisabledClass);
                        if (s.params.a11y && s.a11y) s.a11y.disable(s.nextButton);
                    }
                    else {
                        s.nextButton.removeClass(s.params.buttonDisabledClass);
                        if (s.params.a11y && s.a11y) s.a11y.enable(s.nextButton);
                    }
                }
            }
        };
        
        
        s.updatePagination = function () {
            if (!s.params.pagination) return;
            if (s.paginationContainer && s.paginationContainer.length > 0) {
                var paginationHTML = '';
                if (s.params.paginationType === 'bullets') {
                    var numberOfBullets = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;
                    for (var i = 0; i < numberOfBullets; i++) {
                        if (s.params.paginationBulletRender) {
                            paginationHTML += s.params.paginationBulletRender(i, s.params.bulletClass);
                        }
                        else {
                            paginationHTML += '<' + s.params.paginationElement+' class="' + s.params.bulletClass + '"></' + s.params.paginationElement + '>';
                        }
                    }
                    s.paginationContainer.html(paginationHTML);
                    s.bullets = s.paginationContainer.find('.' + s.params.bulletClass);
                    if (s.params.paginationClickable && s.params.a11y && s.a11y) {
                        s.a11y.initPagination();
                    }
                }
                if (s.params.paginationType === 'fraction') {
                    if (s.params.paginationFractionRender) {
                        paginationHTML = s.params.paginationFractionRender(s, s.params.paginationCurrentClass, s.params.paginationTotalClass);
                    }
                    else {
                        paginationHTML =
                            '<span class="' + s.params.paginationCurrentClass + '"></span>' +
                            ' / ' +
                            '<span class="' + s.params.paginationTotalClass+'"></span>';
                    }
                    s.paginationContainer.html(paginationHTML);
                }
                if (s.params.paginationType === 'progress') {
                    if (s.params.paginationProgressRender) {
                        paginationHTML = s.params.paginationProgressRender(s, s.params.paginationProgressbarClass);
                    }
                    else {
                        paginationHTML = '<span class="' + s.params.paginationProgressbarClass + '"></span>';
                    }
                    s.paginationContainer.html(paginationHTML);
                }
                if (s.params.paginationType !== 'custom') {
                    s.emit('onPaginationRendered', s, s.paginationContainer[0]);
                }
            }
        };
        
        s.update = function (updateTranslate) {
            s.updateContainerSize();
            s.updateSlidesSize();
            s.updateProgress();
            s.updatePagination();
            s.updateClasses();
            if (s.params.scrollbar && s.scrollbar) {
                s.scrollbar.set();
            }
            function forceSetTranslate() {
                newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());
                s.setWrapperTranslate(newTranslate);
                s.updateActiveIndex();
                s.updateClasses();
            }
            if (updateTranslate) {
                var translated, newTranslate;
                if (s.controller && s.controller.spline) {
                    s.controller.spline = undefined;
                }
                if (s.params.freeMode) {
                    forceSetTranslate();
                    if (s.params.autoHeight) {
                        s.updateAutoHeight();
                    }
                }
                else {
                    if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {
                        translated = s.slideTo(s.slides.length - 1, 0, false, true);
                    }
                    else {
                        translated = s.slideTo(s.activeIndex, 0, false, true);
                    }
                    if (!translated) {
                        forceSetTranslate();
                    }
                }
            }
            else if (s.params.autoHeight) {
                s.updateAutoHeight();
            }
        };
        
        
        s.onResize = function (forceUpdatePagination) {
            //Breakpoints
            if (s.params.breakpoints) {
                s.setBreakpoint();
            }
        
            // Disable locks on resize
            var allowSwipeToPrev = s.params.allowSwipeToPrev;
            var allowSwipeToNext = s.params.allowSwipeToNext;
            s.params.allowSwipeToPrev = s.params.allowSwipeToNext = true;
        
            s.updateContainerSize();
            s.updateSlidesSize();
            if (s.params.slidesPerView === 'auto' || s.params.freeMode || forceUpdatePagination) s.updatePagination();
            if (s.params.scrollbar && s.scrollbar) {
                s.scrollbar.set();
            }
            if (s.controller && s.controller.spline) {
                s.controller.spline = undefined;
            }
            var slideChangedBySlideTo = false;
            if (s.params.freeMode) {
                var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());
                s.setWrapperTranslate(newTranslate);
                s.updateActiveIndex();
                s.updateClasses();
        
                if (s.params.autoHeight) {
                    s.updateAutoHeight();
                }
            }
            else {
                s.updateClasses();
                if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {
                    slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true);
                }
                else {
                    slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true);
                }
            }
            if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) {
                s.lazy.load();
            }
            // Return locks after resize
            s.params.allowSwipeToPrev = allowSwipeToPrev;
            s.params.allowSwipeToNext = allowSwipeToNext;
        };
        
        
        
        //Define Touch Events
        var desktopEvents = ['mousedown', 'mousemove', 'mouseup'];
        if (window.navigator.pointerEnabled) desktopEvents = ['pointerdown', 'pointermove', 'pointerup'];
        else if (window.navigator.msPointerEnabled) desktopEvents = ['MSPointerDown', 'MSPointerMove', 'MSPointerUp'];
        s.touchEvents = {
            start : s.support.touch || !s.params.simulateTouch  ? 'touchstart' : desktopEvents[0],
            move : s.support.touch || !s.params.simulateTouch ? 'touchmove' : desktopEvents[1],
            end : s.support.touch || !s.params.simulateTouch ? 'touchend' : desktopEvents[2]
        };
        
        
        // WP8 Touch Events Fix
        if (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) {
            (s.params.touchEventsTarget === 'container' ? s.container : s.wrapper).addClass('swiper-wp8-' + s.params.direction);
        }
        
        // Attach/detach events
        s.initEvents = function (detach) {
            var actionDom = detach ? 'off' : 'on';
            var action = detach ? 'removeEventListener' : 'addEventListener';
            var touchEventsTarget = s.params.touchEventsTarget === 'container' ? s.container[0] : s.wrapper[0];
            var target = s.support.touch ? touchEventsTarget : document;
        
            var moveCapture = s.params.nested ? true : false;
        
            //Touch Events
            if (s.browser.ie) {
                touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, false);
                target[action](s.touchEvents.move, s.onTouchMove, moveCapture);
                target[action](s.touchEvents.end, s.onTouchEnd, false);
            }
            else {
                if (s.support.touch) {
                    touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, false);
                    touchEventsTarget[action](s.touchEvents.move, s.onTouchMove, moveCapture);
                    touchEventsTarget[action](s.touchEvents.end, s.onTouchEnd, false);
                }
                if (params.simulateTouch && !s.device.ios && !s.device.android) {
                    touchEventsTarget[action]('mousedown', s.onTouchStart, false);
                    document[action]('mousemove', s.onTouchMove, moveCapture);
                    document[action]('mouseup', s.onTouchEnd, false);
                }
            }
            window[action]('resize', s.onResize);
        
            // Next, Prev, Index
            if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
                s.nextButton[actionDom]('click', s.onClickNext);
                if (s.params.a11y && s.a11y) s.nextButton[actionDom]('keydown', s.a11y.onEnterKey);
            }
            if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
                s.prevButton[actionDom]('click', s.onClickPrev);
                if (s.params.a11y && s.a11y) s.prevButton[actionDom]('keydown', s.a11y.onEnterKey);
            }
            if (s.params.pagination && s.params.paginationClickable) {
                s.paginationContainer[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex);
                if (s.params.a11y && s.a11y) s.paginationContainer[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey);
            }
        
            // Prevent Links Clicks
            if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true);
        };
        s.attachEvents = function () {
            s.initEvents();
        };
        s.detachEvents = function () {
            s.initEvents(true);
        };
        
        
        // Prevent Clicks
        s.allowClick = true;
        s.preventClicks = function (e) {
            if (!s.allowClick) {
                if (s.params.preventClicks) e.preventDefault();
                if (s.params.preventClicksPropagation && s.animating) {
                    e.stopPropagation();
                    e.stopImmediatePropagation();
                }
            }
        };
        // Clicks
        s.onClickNext = function (e) {
            e.preventDefault();
            if (s.isEnd && !s.params.loop) return;
            s.slideNext();
        };
        s.onClickPrev = function (e) {
            e.preventDefault();
            if (s.isBeginning && !s.params.loop) return;
            s.slidePrev();
        };
        s.onClickIndex = function (e) {
            e.preventDefault();
            var index = $(this).index() * s.params.slidesPerGroup;
            if (s.params.loop) index = index + s.loopedSlides;
            s.slideTo(index);
        };
        
        
        function findElementInEvent(e, selector) {
            var el = $(e.target);
            if (!el.is(selector)) {
                if (typeof selector === 'string') {
                    el = el.parents(selector);
                }
                else if (selector.nodeType) {
                    var found;
                    el.parents().each(function (index, _el) {
                        if (_el === selector) found = selector;
                    });
                    if (!found) return undefined;
                    else return selector;
                }
            }
            if (el.length === 0) {
                return undefined;
            }
            return el[0];
        }
        s.updateClickedSlide = function (e) {
            var slide = findElementInEvent(e, '.' + s.params.slideClass);
            var slideFound = false;
            if (slide) {
                for (var i = 0; i < s.slides.length; i++) {
                    if (s.slides[i] === slide) slideFound = true;
                }
            }
        
            if (slide && slideFound) {
                s.clickedSlide = slide;
                s.clickedIndex = $(slide).index();
            }
            else {
                s.clickedSlide = undefined;
                s.clickedIndex = undefined;
                return;
            }
            if (s.params.slideToClickedSlide && s.clickedIndex !== undefined && s.clickedIndex !== s.activeIndex) {
                var slideToIndex = s.clickedIndex,
                    realIndex,
                    duplicatedSlides;
                if (s.params.loop) {
                    if (s.animating) return;
                    realIndex = $(s.clickedSlide).attr('data-swiper-slide-index');
                    if (s.params.centeredSlides) {
                        if ((slideToIndex < s.loopedSlides - s.params.slidesPerView/2) || (slideToIndex > s.slides.length - s.loopedSlides + s.params.slidesPerView/2)) {
                            s.fixLoop();
                            slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index="' + realIndex + '"]:not(.swiper-slide-duplicate)').eq(0).index();
                            setTimeout(function () {
                                s.slideTo(slideToIndex);
                            }, 0);
                        }
                        else {
                            s.slideTo(slideToIndex);
                        }
                    }
                    else {
                        if (slideToIndex > s.slides.length - s.params.slidesPerView) {
                            s.fixLoop();
                            slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index="' + realIndex + '"]:not(.swiper-slide-duplicate)').eq(0).index();
                            setTimeout(function () {
                                s.slideTo(slideToIndex);
                            }, 0);
                        }
                        else {
                            s.slideTo(slideToIndex);
                        }
                    }
                }
                else {
                    s.slideTo(slideToIndex);
                }
            }
        };
        
        var isTouched,
            isMoved,
            allowTouchCallbacks,
            touchStartTime,
            isScrolling,
            currentTranslate,
            startTranslate,
            allowThresholdMove,
            // Form elements to match
            formElements = 'input, select, textarea, button',
            // Last click time
            lastClickTime = Date.now(), clickTimeout,
            //Velocities
            velocities = [],
            allowMomentumBounce;
        
        // Animating Flag
        s.animating = false;
        
        // Touches information
        s.touches = {
            startX: 0,
            startY: 0,
            currentX: 0,
            currentY: 0,
            diff: 0
        };
        
        // Touch handlers
        var isTouchEvent, startMoving;
        s.onTouchStart = function (e) {
            if (e.originalEvent) e = e.originalEvent;
            isTouchEvent = e.type === 'touchstart';
            if (!isTouchEvent && 'which' in e && e.which === 3) return;
            if (s.params.noSwiping && findElementInEvent(e, '.' + s.params.noSwipingClass)) {
                s.allowClick = true;
                return;
            }
            if (s.params.swipeHandler) {
                if (!findElementInEvent(e, s.params.swipeHandler)) return;
            }
        
            var startX = s.touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
            var startY = s.touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
        
            // Do NOT start if iOS edge swipe is detected. Otherwise iOS app (UIWebView) cannot swipe-to-go-back anymore
            if(s.device.ios && s.params.iOSEdgeSwipeDetection && startX <= s.params.iOSEdgeSwipeThreshold) {
                return;
            }
        
            isTouched = true;
            isMoved = false;
            allowTouchCallbacks = true;
            isScrolling = undefined;
            startMoving = undefined;
            s.touches.startX = startX;
            s.touches.startY = startY;
            touchStartTime = Date.now();
            s.allowClick = true;
            s.updateContainerSize();
            s.swipeDirection = undefined;
            if (s.params.threshold > 0) allowThresholdMove = false;
            if (e.type !== 'touchstart') {
                var preventDefault = true;
                if ($(e.target).is(formElements)) preventDefault = false;
                if (document.activeElement && $(document.activeElement).is(formElements)) {
                    document.activeElement.blur();
                }
                if (preventDefault) {
                    e.preventDefault();
                }
            }
            s.emit('onTouchStart', s, e);
        };
        
        s.onTouchMove = function (e) {
            if (e.originalEvent) e = e.originalEvent;
            if (isTouchEvent && e.type === 'mousemove') return;
            if (e.preventedByNestedSwiper) {
                s.touches.startX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
                s.touches.startY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
                return;
            }
            if (s.params.onlyExternal) {
                // isMoved = true;
                s.allowClick = false;
                if (isTouched) {
                    s.touches.startX = s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
                    s.touches.startY = s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
                    touchStartTime = Date.now();
                }
                return;
            }
            if (isTouchEvent && document.activeElement) {
                if (e.target === document.activeElement && $(e.target).is(formElements)) {
                    isMoved = true;
                    s.allowClick = false;
                    return;
                }
            }
            if (allowTouchCallbacks) {
                s.emit('onTouchMove', s, e);
            }
            if (e.targetTouches && e.targetTouches.length > 1) return;
        
            s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
            s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
        
            if (typeof isScrolling === 'undefined') {
                var touchAngle = Math.atan2(Math.abs(s.touches.currentY - s.touches.startY), Math.abs(s.touches.currentX - s.touches.startX)) * 180 / Math.PI;
                isScrolling = s.isHorizontal() ? touchAngle > s.params.touchAngle : (90 - touchAngle > s.params.touchAngle);
            }
            if (isScrolling) {
                s.emit('onTouchMoveOpposite', s, e);
            }
            if (typeof startMoving === 'undefined' && s.browser.ieTouch) {
                if (s.touches.currentX !== s.touches.startX || s.touches.currentY !== s.touches.startY) {
                    startMoving = true;
                }
            }
            if (!isTouched) return;
            if (isScrolling)  {
                isTouched = false;
                return;
            }
            if (!startMoving && s.browser.ieTouch) {
                return;
            }
            s.allowClick = false;
            s.emit('onSliderMove', s, e);
            e.preventDefault();
            if (s.params.touchMoveStopPropagation && !s.params.nested) {
                e.stopPropagation();
            }
        
            if (!isMoved) {
                if (params.loop) {
                    s.fixLoop();
                }
                startTranslate = s.getWrapperTranslate();
                s.setWrapperTransition(0);
                if (s.animating) {
                    s.wrapper.trigger('webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd');
                }
                if (s.params.autoplay && s.autoplaying) {
                    if (s.params.autoplayDisableOnInteraction) {
                        s.stopAutoplay();
                    }
                    else {
                        s.pauseAutoplay();
                    }
                }
                allowMomentumBounce = false;
                //Grab Cursor
                if (s.params.grabCursor) {
                    s.container[0].style.cursor = 'move';
                    s.container[0].style.cursor = '-webkit-grabbing';
                    s.container[0].style.cursor = '-moz-grabbin';
                    s.container[0].style.cursor = 'grabbing';
                }
            }
            isMoved = true;
        
            var diff = s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY;
        
            diff = diff * s.params.touchRatio;
            if (s.rtl) diff = -diff;
        
            s.swipeDirection = diff > 0 ? 'prev' : 'next';
            currentTranslate = diff + startTranslate;
        
            var disableParentSwiper = true;
            if ((diff > 0 && currentTranslate > s.minTranslate())) {
                disableParentSwiper = false;
                if (s.params.resistance) currentTranslate = s.minTranslate() - 1 + Math.pow(-s.minTranslate() + startTranslate + diff, s.params.resistanceRatio);
            }
            else if (diff < 0 && currentTranslate < s.maxTranslate()) {
                disableParentSwiper = false;
                if (s.params.resistance) currentTranslate = s.maxTranslate() + 1 - Math.pow(s.maxTranslate() - startTranslate - diff, s.params.resistanceRatio);
            }
        
            if (disableParentSwiper) {
                e.preventedByNestedSwiper = true;
            }
        
            // Directions locks
            if (!s.params.allowSwipeToNext && s.swipeDirection === 'next' && currentTranslate < startTranslate) {
                currentTranslate = startTranslate;
            }
            if (!s.params.allowSwipeToPrev && s.swipeDirection === 'prev' && currentTranslate > startTranslate) {
                currentTranslate = startTranslate;
            }
        
            if (!s.params.followFinger) return;
        
            // Threshold
            if (s.params.threshold > 0) {
                if (Math.abs(diff) > s.params.threshold || allowThresholdMove) {
                    if (!allowThresholdMove) {
                        allowThresholdMove = true;
                        s.touches.startX = s.touches.currentX;
                        s.touches.startY = s.touches.currentY;
                        currentTranslate = startTranslate;
                        s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY;
                        return;
                    }
                }
                else {
                    currentTranslate = startTranslate;
                    return;
                }
            }
            // Update active index in free mode
            if (s.params.freeMode || s.params.watchSlidesProgress) {
                s.updateActiveIndex();
            }
            if (s.params.freeMode) {
                //Velocity
                if (velocities.length === 0) {
                    velocities.push({
                        position: s.touches[s.isHorizontal() ? 'startX' : 'startY'],
                        time: touchStartTime
                    });
                }
                velocities.push({
                    position: s.touches[s.isHorizontal() ? 'currentX' : 'currentY'],
                    time: (new window.Date()).getTime()
                });
            }
            // Update progress
            s.updateProgress(currentTranslate);
            // Update translate
            s.setWrapperTranslate(currentTranslate);
        };
        s.onTouchEnd = function (e) {
            if (e.originalEvent) e = e.originalEvent;
            if (allowTouchCallbacks) {
                s.emit('onTouchEnd', s, e);
            }
            allowTouchCallbacks = false;
            if (!isTouched) return;
            //Return Grab Cursor
            if (s.params.grabCursor && isMoved && isTouched) {
                s.container[0].style.cursor = 'move';
                s.container[0].style.cursor = '-webkit-grab';
                s.container[0].style.cursor = '-moz-grab';
                s.container[0].style.cursor = 'grab';
            }
        
            // Time diff
            var touchEndTime = Date.now();
            var timeDiff = touchEndTime - touchStartTime;
        
            // Tap, doubleTap, Click
            if (s.allowClick) {
                s.updateClickedSlide(e);
                s.emit('onTap', s, e);
                if (timeDiff < 300 && (touchEndTime - lastClickTime) > 300) {
                    if (clickTimeout) clearTimeout(clickTimeout);
                    clickTimeout = setTimeout(function () {
                        if (!s) return;
                        if (s.params.paginationHide && s.paginationContainer.length > 0 && !$(e.target).hasClass(s.params.bulletClass)) {
                            s.paginationContainer.toggleClass(s.params.paginationHiddenClass);
                        }
                        s.emit('onClick', s, e);
                    }, 300);
        
                }
                if (timeDiff < 300 && (touchEndTime - lastClickTime) < 300) {
                    if (clickTimeout) clearTimeout(clickTimeout);
                    s.emit('onDoubleTap', s, e);
                }
            }
        
            lastClickTime = Date.now();
            setTimeout(function () {
                if (s) s.allowClick = true;
            }, 0);
        
            if (!isTouched || !isMoved || !s.swipeDirection || s.touches.diff === 0 || currentTranslate === startTranslate) {
                isTouched = isMoved = false;
                return;
            }
            isTouched = isMoved = false;
        
            var currentPos;
            if (s.params.followFinger) {
                currentPos = s.rtl ? s.translate : -s.translate;
            }
            else {
                currentPos = -currentTranslate;
            }
            if (s.params.freeMode) {
                if (currentPos < -s.minTranslate()) {
                    s.slideTo(s.activeIndex);
                    return;
                }
                else if (currentPos > -s.maxTranslate()) {
                    if (s.slides.length < s.snapGrid.length) {
                        s.slideTo(s.snapGrid.length - 1);
                    }
                    else {
                        s.slideTo(s.slides.length - 1);
                    }
                    return;
                }
        
                if (s.params.freeModeMomentum) {
                    if (velocities.length > 1) {
                        var lastMoveEvent = velocities.pop(), velocityEvent = velocities.pop();
        
                        var distance = lastMoveEvent.position - velocityEvent.position;
                        var time = lastMoveEvent.time - velocityEvent.time;
                        s.velocity = distance / time;
                        s.velocity = s.velocity / 2;
                        if (Math.abs(s.velocity) < s.params.freeModeMinimumVelocity) {
                            s.velocity = 0;
                        }
                        // this implies that the user stopped moving a finger then released.
                        // There would be no events with distance zero, so the last event is stale.
                        if (time > 150 || (new window.Date().getTime() - lastMoveEvent.time) > 300) {
                            s.velocity = 0;
                        }
                    } else {
                        s.velocity = 0;
                    }
        
                    velocities.length = 0;
                    var momentumDuration = 1000 * s.params.freeModeMomentumRatio;
                    var momentumDistance = s.velocity * momentumDuration;
        
                    var newPosition = s.translate + momentumDistance;
                    if (s.rtl) newPosition = - newPosition;
                    var doBounce = false;
                    var afterBouncePosition;
                    var bounceAmount = Math.abs(s.velocity) * 20 * s.params.freeModeMomentumBounceRatio;
                    if (newPosition < s.maxTranslate()) {
                        if (s.params.freeModeMomentumBounce) {
                            if (newPosition + s.maxTranslate() < -bounceAmount) {
                                newPosition = s.maxTranslate() - bounceAmount;
                            }
                            afterBouncePosition = s.maxTranslate();
                            doBounce = true;
                            allowMomentumBounce = true;
                        }
                        else {
                            newPosition = s.maxTranslate();
                        }
                    }
                    else if (newPosition > s.minTranslate()) {
                        if (s.params.freeModeMomentumBounce) {
                            if (newPosition - s.minTranslate() > bounceAmount) {
                                newPosition = s.minTranslate() + bounceAmount;
                            }
                            afterBouncePosition = s.minTranslate();
                            doBounce = true;
                            allowMomentumBounce = true;
                        }
                        else {
                            newPosition = s.minTranslate();
                        }
                    }
                    else if (s.params.freeModeSticky) {
                        var j = 0,
                            nextSlide;
                        for (j = 0; j < s.snapGrid.length; j += 1) {
                            if (s.snapGrid[j] > -newPosition) {
                                nextSlide = j;
                                break;
                            }
        
                        }
                        if (Math.abs(s.snapGrid[nextSlide] - newPosition) < Math.abs(s.snapGrid[nextSlide - 1] - newPosition) || s.swipeDirection === 'next') {
                            newPosition = s.snapGrid[nextSlide];
                        } else {
                            newPosition = s.snapGrid[nextSlide - 1];
                        }
                        if (!s.rtl) newPosition = - newPosition;
                    }
                    //Fix duration
                    if (s.velocity !== 0) {
                        if (s.rtl) {
                            momentumDuration = Math.abs((-newPosition - s.translate) / s.velocity);
                        }
                        else {
                            momentumDuration = Math.abs((newPosition - s.translate) / s.velocity);
                        }
                    }
                    else if (s.params.freeModeSticky) {
                        s.slideReset();
                        return;
                    }
        
                    if (s.params.freeModeMomentumBounce && doBounce) {
                        s.updateProgress(afterBouncePosition);
                        s.setWrapperTransition(momentumDuration);
                        s.setWrapperTranslate(newPosition);
                        s.onTransitionStart();
                        s.animating = true;
                        s.wrapper.transitionEnd(function () {
                            if (!s || !allowMomentumBounce) return;
                            s.emit('onMomentumBounce', s);
        
                            s.setWrapperTransition(s.params.speed);
                            s.setWrapperTranslate(afterBouncePosition);
                            s.wrapper.transitionEnd(function () {
                                if (!s) return;
                                s.onTransitionEnd();
                            });
                        });
                    } else if (s.velocity) {
                        s.updateProgress(newPosition);
                        s.setWrapperTransition(momentumDuration);
                        s.setWrapperTranslate(newPosition);
                        s.onTransitionStart();
                        if (!s.animating) {
                            s.animating = true;
                            s.wrapper.transitionEnd(function () {
                                if (!s) return;
                                s.onTransitionEnd();
                            });
                        }
        
                    } else {
                        s.updateProgress(newPosition);
                    }
        
                    s.updateActiveIndex();
                }
                if (!s.params.freeModeMomentum || timeDiff >= s.params.longSwipesMs) {
                    s.updateProgress();
                    s.updateActiveIndex();
                }
                return;
            }
        
            // Find current slide
            var i, stopIndex = 0, groupSize = s.slidesSizesGrid[0];
            for (i = 0; i < s.slidesGrid.length; i += s.params.slidesPerGroup) {
                if (typeof s.slidesGrid[i + s.params.slidesPerGroup] !== 'undefined') {
                    if (currentPos >= s.slidesGrid[i] && currentPos < s.slidesGrid[i + s.params.slidesPerGroup]) {
                        stopIndex = i;
                        groupSize = s.slidesGrid[i + s.params.slidesPerGroup] - s.slidesGrid[i];
                    }
                }
                else {
                    if (currentPos >= s.slidesGrid[i]) {
                        stopIndex = i;
                        groupSize = s.slidesGrid[s.slidesGrid.length - 1] - s.slidesGrid[s.slidesGrid.length - 2];
                    }
                }
            }
        
            // Find current slide size
            var ratio = (currentPos - s.slidesGrid[stopIndex]) / groupSize;
        
            if (timeDiff > s.params.longSwipesMs) {
                // Long touches
                if (!s.params.longSwipes) {
                    s.slideTo(s.activeIndex);
                    return;
                }
                if (s.swipeDirection === 'next') {
                    if (ratio >= s.params.longSwipesRatio) s.slideTo(stopIndex + s.params.slidesPerGroup);
                    else s.slideTo(stopIndex);
        
                }
                if (s.swipeDirection === 'prev') {
                    if (ratio > (1 - s.params.longSwipesRatio)) s.slideTo(stopIndex + s.params.slidesPerGroup);
                    else s.slideTo(stopIndex);
                }
            }
            else {
                // Short swipes
                if (!s.params.shortSwipes) {
                    s.slideTo(s.activeIndex);
                    return;
                }
                if (s.swipeDirection === 'next') {
                    s.slideTo(stopIndex + s.params.slidesPerGroup);
        
                }
                if (s.swipeDirection === 'prev') {
                    s.slideTo(stopIndex);
                }
            }
        };
        
        s._slideTo = function (slideIndex, speed) {
            return s.slideTo(slideIndex, speed, true, true);
        };
        s.slideTo = function (slideIndex, speed, runCallbacks, internal) {
            if (typeof runCallbacks === 'undefined') runCallbacks = true;
            if (typeof slideIndex === 'undefined') slideIndex = 0;
            if (slideIndex < 0) slideIndex = 0;
            s.snapIndex = Math.floor(slideIndex / s.params.slidesPerGroup);
            if (s.snapIndex >= s.snapGrid.length) s.snapIndex = s.snapGrid.length - 1;
        
            var translate = - s.snapGrid[s.snapIndex];
            // Stop autoplay
            if (s.params.autoplay && s.autoplaying) {
                if (internal || !s.params.autoplayDisableOnInteraction) {
                    s.pauseAutoplay(speed);
                }
                else {
                    s.stopAutoplay();
                }
            }
            // Update progress
            s.updateProgress(translate);
        
            // Normalize slideIndex
            for (var i = 0; i < s.slidesGrid.length; i++) {
                if (- Math.floor(translate * 100) >= Math.floor(s.slidesGrid[i] * 100)) {
                    slideIndex = i;
                }
            }
        
            // Directions locks
            if (!s.params.allowSwipeToNext && translate < s.translate && translate < s.minTranslate()) {
                return false;
            }
            if (!s.params.allowSwipeToPrev && translate > s.translate && translate > s.maxTranslate()) {
                if ((s.activeIndex || 0) !== slideIndex ) return false;
            }
        
            // Update Index
            if (typeof speed === 'undefined') speed = s.params.speed;
            s.previousIndex = s.activeIndex || 0;
            s.activeIndex = slideIndex;
        
            if ((s.rtl && -translate === s.translate) || (!s.rtl && translate === s.translate)) {
                // Update Height
                if (s.params.autoHeight) {
                    s.updateAutoHeight();
                }
                s.updateClasses();
                if (s.params.effect !== 'slide') {
                    s.setWrapperTranslate(translate);
                }
                return false;
            }
            s.updateClasses();
            s.onTransitionStart(runCallbacks);
        
            if (speed === 0) {
                s.setWrapperTranslate(translate);
                s.setWrapperTransition(0);
                s.onTransitionEnd(runCallbacks);
            }
            else {
                s.setWrapperTranslate(translate);
                s.setWrapperTransition(speed);
                if (!s.animating) {
                    s.animating = true;
                    s.wrapper.transitionEnd(function () {
                        if (!s) return;
                        s.onTransitionEnd(runCallbacks);
                    });
                }
        
            }
        
            return true;
        };
        
        s.onTransitionStart = function (runCallbacks) {
            if (typeof runCallbacks === 'undefined') runCallbacks = true;
            if (s.params.autoHeight) {
                s.updateAutoHeight();
            }
            if (s.lazy) s.lazy.onTransitionStart();
            if (runCallbacks) {
                s.emit('onTransitionStart', s);
                if (s.activeIndex !== s.previousIndex) {
                    s.emit('onSlideChangeStart', s);
                    if (s.activeIndex > s.previousIndex) {
                        s.emit('onSlideNextStart', s);
                    }
                    else {
                        s.emit('onSlidePrevStart', s);
                    }
                }
        
            }
        };
        s.onTransitionEnd = function (runCallbacks) {
            s.animating = false;
            s.setWrapperTransition(0);
            if (typeof runCallbacks === 'undefined') runCallbacks = true;
            if (s.lazy) s.lazy.onTransitionEnd();
            if (runCallbacks) {
                s.emit('onTransitionEnd', s);
                if (s.activeIndex !== s.previousIndex) {
                    s.emit('onSlideChangeEnd', s);
                    if (s.activeIndex > s.previousIndex) {
                        s.emit('onSlideNextEnd', s);
                    }
                    else {
                        s.emit('onSlidePrevEnd', s);
                    }
                }
            }
            if (s.params.hashnav && s.hashnav) {
                s.hashnav.setHash();
            }
        
        };
        s.slideNext = function (runCallbacks, speed, internal) {
            if (s.params.loop) {
                if (s.animating) return false;
                s.fixLoop();
                var clientLeft = s.container[0].clientLeft;
                return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal);
            }
            else return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal);
        };
        s._slideNext = function (speed) {
            return s.slideNext(true, speed, true);
        };
        s.slidePrev = function (runCallbacks, speed, internal) {
            if (s.params.loop) {
                if (s.animating) return false;
                s.fixLoop();
                var clientLeft = s.container[0].clientLeft;
                return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal);
            }
            else return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal);
        };
        s._slidePrev = function (speed) {
            return s.slidePrev(true, speed, true);
        };
        s.slideReset = function (runCallbacks, speed, internal) {
            return s.slideTo(s.activeIndex, speed, runCallbacks);
        };
        
        
        s.setWrapperTransition = function (duration, byController) {
            s.wrapper.transition(duration);
            if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {
                s.effects[s.params.effect].setTransition(duration);
            }
            if (s.params.parallax && s.parallax) {
                s.parallax.setTransition(duration);
            }
            if (s.params.scrollbar && s.scrollbar) {
                s.scrollbar.setTransition(duration);
            }
            if (s.params.control && s.controller) {
                s.controller.setTransition(duration, byController);
            }
            s.emit('onSetTransition', s, duration);
        };
        s.setWrapperTranslate = function (translate, updateActiveIndex, byController) {
            var x = 0, y = 0, z = 0;
            if (s.isHorizontal()) {
                x = s.rtl ? -translate : translate;
            }
            else {
                y = translate;
            }
        
            if (s.params.roundLengths) {
                x = round(x);
                y = round(y);
            }
        
            if (!s.params.virtualTranslate) {
                if (s.support.transforms3d) s.wrapper.transform('translate3d(' + x + 'px, ' + y + 'px, ' + z + 'px)');
                else s.wrapper.transform('translate(' + x + 'px, ' + y + 'px)');
            }
        
            s.translate = s.isHorizontal() ? x : y;
        
            // Check if we need to update progress
            var progress;
            var translatesDiff = s.maxTranslate() - s.minTranslate();
            if (translatesDiff === 0) {
                progress = 0;
            }
            else {
                progress = (translate - s.minTranslate()) / (translatesDiff);
            }
            if (progress !== s.progress) {
                s.updateProgress(translate);
            }
        
            if (updateActiveIndex) s.updateActiveIndex();
            if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {
                s.effects[s.params.effect].setTranslate(s.translate);
            }
            if (s.params.parallax && s.parallax) {
                s.parallax.setTranslate(s.translate);
            }
            if (s.params.scrollbar && s.scrollbar) {
                s.scrollbar.setTranslate(s.translate);
            }
            if (s.params.control && s.controller) {
                s.controller.setTranslate(s.translate, byController);
            }
            s.emit('onSetTranslate', s, s.translate);
        };
        
        s.getTranslate = function (el, axis) {
            var matrix, curTransform, curStyle, transformMatrix;
        
            // automatic axis detection
            if (typeof axis === 'undefined') {
                axis = 'x';
            }
        
            if (s.params.virtualTranslate) {
                return s.rtl ? -s.translate : s.translate;
            }
        
            curStyle = window.getComputedStyle(el, null);
            if (window.WebKitCSSMatrix) {
                curTransform = curStyle.transform || curStyle.webkitTransform;
                if (curTransform.split(',').length > 6) {
                    curTransform = curTransform.split(', ').map(function(a){
                        return a.replace(',','.');
                    }).join(', ');
                }
                // Some old versions of Webkit choke when 'none' is passed; pass
                // empty string instead in this case
                transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
            }
            else {
                transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform  || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
                matrix = transformMatrix.toString().split(',');
            }
        
            if (axis === 'x') {
                //Latest Chrome and webkits Fix
                if (window.WebKitCSSMatrix)
                    curTransform = transformMatrix.m41;
                //Crazy IE10 Matrix
                else if (matrix.length === 16)
                    curTransform = parseFloat(matrix[12]);
                //Normal Browsers
                else
                    curTransform = parseFloat(matrix[4]);
            }
            if (axis === 'y') {
                //Latest Chrome and webkits Fix
                if (window.WebKitCSSMatrix)
                    curTransform = transformMatrix.m42;
                //Crazy IE10 Matrix
                else if (matrix.length === 16)
                    curTransform = parseFloat(matrix[13]);
                //Normal Browsers
                else
                    curTransform = parseFloat(matrix[5]);
            }
            if (s.rtl && curTransform) curTransform = -curTransform;
            return curTransform || 0;
        };
        s.getWrapperTranslate = function (axis) {
            if (typeof axis === 'undefined') {
                axis = s.isHorizontal() ? 'x' : 'y';
            }
            return s.getTranslate(s.wrapper[0], axis);
        };
        
        
        s.observers = [];
        function initObserver(target, options) {
            options = options || {};
            // create an observer instance
            var ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
            var observer = new ObserverFunc(function (mutations) {
                mutations.forEach(function (mutation) {
                    s.onResize(true);
                    s.emit('onObserverUpdate', s, mutation);
                });
            });
        
            observer.observe(target, {
                attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
                childList: typeof options.childList === 'undefined' ? true : options.childList,
                characterData: typeof options.characterData === 'undefined' ? true : options.characterData
            });
        
            s.observers.push(observer);
        }
        s.initObservers = function () {
            if (s.params.observeParents) {
                var containerParents = s.container.parents();
                for (var i = 0; i < containerParents.length; i++) {
                    initObserver(containerParents[i]);
                }
            }
        
            // Observe container
            initObserver(s.container[0], {childList: false});
        
            // Observe wrapper
            initObserver(s.wrapper[0], {attributes: false});
        };
        s.disconnectObservers = function () {
            for (var i = 0; i < s.observers.length; i++) {
                s.observers[i].disconnect();
            }
            s.observers = [];
        };
        
        // Create looped slides
        s.createLoop = function () {
            // Remove duplicated slides
            s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();
        
            var slides = s.wrapper.children('.' + s.params.slideClass);
        
            if(s.params.slidesPerView === 'auto' && !s.params.loopedSlides) s.params.loopedSlides = slides.length;
        
            s.loopedSlides = parseInt(s.params.loopedSlides || s.params.slidesPerView, 10);
            s.loopedSlides = s.loopedSlides + s.params.loopAdditionalSlides;
            if (s.loopedSlides > slides.length) {
                s.loopedSlides = slides.length;
            }
        
            var prependSlides = [], appendSlides = [], i;
            slides.each(function (index, el) {
                var slide = $(this);
                if (index < s.loopedSlides) appendSlides.push(el);
                if (index < slides.length && index >= slides.length - s.loopedSlides) prependSlides.push(el);
                slide.attr('data-swiper-slide-index', index);
            });
            for (i = 0; i < appendSlides.length; i++) {
                s.wrapper.append($(appendSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass));
            }
            for (i = prependSlides.length - 1; i >= 0; i--) {
                s.wrapper.prepend($(prependSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass));
            }
        };
        s.destroyLoop = function () {
            s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();
            s.slides.removeAttr('data-swiper-slide-index');
        };
        s.reLoop = function (updatePosition) {
            var oldIndex = s.activeIndex - s.loopedSlides;
            s.destroyLoop();
            s.createLoop();
            s.updateSlidesSize();
            if (updatePosition) {
                s.slideTo(oldIndex + s.loopedSlides, 0, false);
            }
        
        };
        s.fixLoop = function () {
            var newIndex;
            //Fix For Negative Oversliding
            if (s.activeIndex < s.loopedSlides) {
                newIndex = s.slides.length - s.loopedSlides * 3 + s.activeIndex;
                newIndex = newIndex + s.loopedSlides;
                s.slideTo(newIndex, 0, false, true);
            }
            //Fix For Positive Oversliding
            else if ((s.params.slidesPerView === 'auto' && s.activeIndex >= s.loopedSlides * 2) || (s.activeIndex > s.slides.length - s.params.slidesPerView * 2)) {
                newIndex = -s.slides.length + s.activeIndex + s.loopedSlides;
                newIndex = newIndex + s.loopedSlides;
                s.slideTo(newIndex, 0, false, true);
            }
        };
        
        s.appendSlide = function (slides) {
            if (s.params.loop) {
                s.destroyLoop();
            }
            if (typeof slides === 'object' && slides.length) {
                for (var i = 0; i < slides.length; i++) {
                    if (slides[i]) s.wrapper.append(slides[i]);
                }
            }
            else {
                s.wrapper.append(slides);
            }
            if (s.params.loop) {
                s.createLoop();
            }
            if (!(s.params.observer && s.support.observer)) {
                s.update(true);
            }
        };
        s.prependSlide = function (slides) {
            if (s.params.loop) {
                s.destroyLoop();
            }
            var newActiveIndex = s.activeIndex + 1;
            if (typeof slides === 'object' && slides.length) {
                for (var i = 0; i < slides.length; i++) {
                    if (slides[i]) s.wrapper.prepend(slides[i]);
                }
                newActiveIndex = s.activeIndex + slides.length;
            }
            else {
                s.wrapper.prepend(slides);
            }
            if (s.params.loop) {
                s.createLoop();
            }
            if (!(s.params.observer && s.support.observer)) {
                s.update(true);
            }
            s.slideTo(newActiveIndex, 0, false);
        };
        s.removeSlide = function (slidesIndexes) {
            if (s.params.loop) {
                s.destroyLoop();
                s.slides = s.wrapper.children('.' + s.params.slideClass);
            }
            var newActiveIndex = s.activeIndex,
                indexToRemove;
            if (typeof slidesIndexes === 'object' && slidesIndexes.length) {
                for (var i = 0; i < slidesIndexes.length; i++) {
                    indexToRemove = slidesIndexes[i];
                    if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove();
                    if (indexToRemove < newActiveIndex) newActiveIndex--;
                }
                newActiveIndex = Math.max(newActiveIndex, 0);
            }
            else {
                indexToRemove = slidesIndexes;
                if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove();
                if (indexToRemove < newActiveIndex) newActiveIndex--;
                newActiveIndex = Math.max(newActiveIndex, 0);
            }
        
            if (s.params.loop) {
                s.createLoop();
            }
        
            if (!(s.params.observer && s.support.observer)) {
                s.update(true);
            }
            if (s.params.loop) {
                s.slideTo(newActiveIndex + s.loopedSlides, 0, false);
            }
            else {
                s.slideTo(newActiveIndex, 0, false);
            }
        
        };
        s.removeAllSlides = function () {
            var slidesIndexes = [];
            for (var i = 0; i < s.slides.length; i++) {
                slidesIndexes.push(i);
            }
            s.removeSlide(slidesIndexes);
        };
        

        
        s.effects = {
            fade: {
                setTranslate: function () {
                    for (var i = 0; i < s.slides.length; i++) {
                        var slide = s.slides.eq(i);
                        var offset = slide[0].swiperSlideOffset;
                        var tx = -offset;
                        if (!s.params.virtualTranslate) tx = tx - s.translate;
                        var ty = 0;
                        if (!s.isHorizontal()) {
                            ty = tx;
                            tx = 0;
                        }
                        var slideOpacity = s.params.fade.crossFade ?
                                Math.max(1 - Math.abs(slide[0].progress), 0) :
                                1 + Math.min(Math.max(slide[0].progress, -1), 0);
                        slide
                            .css({
                                opacity: slideOpacity
                            })
                            .transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px)');
        
                    }
        
                },
                setTransition: function (duration) {
                    s.slides.transition(duration);
                    if (s.params.virtualTranslate && duration !== 0) {
                        var eventTriggered = false;
                        s.slides.transitionEnd(function () {
                            if (eventTriggered) return;
                            if (!s) return;
                            eventTriggered = true;
                            s.animating = false;
                            var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];
                            for (var i = 0; i < triggerEvents.length; i++) {
                                s.wrapper.trigger(triggerEvents[i]);
                            }
                        });
                    }
                }
            },
            flip: {
                setTranslate: function () {
                    for (var i = 0; i < s.slides.length; i++) {
                        var slide = s.slides.eq(i);
                        var progress = slide[0].progress;
                        if (s.params.flip.limitRotation) {
                            progress = Math.max(Math.min(slide[0].progress, 1), -1);
                        }
                        var offset = slide[0].swiperSlideOffset;
                        var rotate = -180 * progress,
                            rotateY = rotate,
                            rotateX = 0,
                            tx = -offset,
                            ty = 0;
                        if (!s.isHorizontal()) {
                            ty = tx;
                            tx = 0;
                            rotateX = -rotateY;
                            rotateY = 0;
                        }
                        else if (s.rtl) {
                            rotateY = -rotateY;
                        }
        
                        slide[0].style.zIndex = -Math.abs(Math.round(progress)) + s.slides.length;
        
                        if (s.params.flip.slideShadows) {
                            //Set shadows
                            var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
                            var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
                            if (shadowBefore.length === 0) {
                                shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
                                slide.append(shadowBefore);
                            }
                            if (shadowAfter.length === 0) {
                                shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
                                slide.append(shadowAfter);
                            }
                            if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
                            if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
                        }
        
                        slide
                            .transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)');
                    }
                },
                setTransition: function (duration) {
                    s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
                    if (s.params.virtualTranslate && duration !== 0) {
                        var eventTriggered = false;
                        s.slides.eq(s.activeIndex).transitionEnd(function () {
                            if (eventTriggered) return;
                            if (!s) return;
                            if (!$(this).hasClass(s.params.slideActiveClass)) return;
                            eventTriggered = true;
                            s.animating = false;
                            var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];
                            for (var i = 0; i < triggerEvents.length; i++) {
                                s.wrapper.trigger(triggerEvents[i]);
                            }
                        });
                    }
                }
            },
            cube: {
                setTranslate: function () {
                    var wrapperRotate = 0, cubeShadow;
                    if (s.params.cube.shadow) {
                        if (s.isHorizontal()) {
                            cubeShadow = s.wrapper.find('.swiper-cube-shadow');
                            if (cubeShadow.length === 0) {
                                cubeShadow = $('<div class="swiper-cube-shadow"></div>');
                                s.wrapper.append(cubeShadow);
                            }
                            cubeShadow.css({height: s.width + 'px'});
                        }
                        else {
                            cubeShadow = s.container.find('.swiper-cube-shadow');
                            if (cubeShadow.length === 0) {
                                cubeShadow = $('<div class="swiper-cube-shadow"></div>');
                                s.container.append(cubeShadow);
                            }
                        }
                    }
                    for (var i = 0; i < s.slides.length; i++) {
                        var slide = s.slides.eq(i);
                        var slideAngle = i * 90;
                        var round = Math.floor(slideAngle / 360);
                        if (s.rtl) {
                            slideAngle = -slideAngle;
                            round = Math.floor(-slideAngle / 360);
                        }
                        var progress = Math.max(Math.min(slide[0].progress, 1), -1);
                        var tx = 0, ty = 0, tz = 0;
                        if (i % 4 === 0) {
                            tx = - round * 4 * s.size;
                            tz = 0;
                        }
                        else if ((i - 1) % 4 === 0) {
                            tx = 0;
                            tz = - round * 4 * s.size;
                        }
                        else if ((i - 2) % 4 === 0) {
                            tx = s.size + round * 4 * s.size;
                            tz = s.size;
                        }
                        else if ((i - 3) % 4 === 0) {
                            tx = - s.size;
                            tz = 3 * s.size + s.size * 4 * round;
                        }
                        if (s.rtl) {
                            tx = -tx;
                        }
        
                        if (!s.isHorizontal()) {
                            ty = tx;
                            tx = 0;
                        }
        
                        var transform = 'rotateX(' + (s.isHorizontal() ? 0 : -slideAngle) + 'deg) rotateY(' + (s.isHorizontal() ? slideAngle : 0) + 'deg) translate3d(' + tx + 'px, ' + ty + 'px, ' + tz + 'px)';
                        if (progress <= 1 && progress > -1) {
                            wrapperRotate = i * 90 + progress * 90;
                            if (s.rtl) wrapperRotate = -i * 90 - progress * 90;
                        }
                        slide.transform(transform);
                        if (s.params.cube.slideShadows) {
                            //Set shadows
                            var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
                            var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
                            if (shadowBefore.length === 0) {
                                shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
                                slide.append(shadowBefore);
                            }
                            if (shadowAfter.length === 0) {
                                shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
                                slide.append(shadowAfter);
                            }
                            if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
                            if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
                        }
                    }
                    s.wrapper.css({
                        '-webkit-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
                        '-moz-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
                        '-ms-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
                        'transform-origin': '50% 50% -' + (s.size / 2) + 'px'
                    });
        
                    if (s.params.cube.shadow) {
                        if (s.isHorizontal()) {
                            cubeShadow.transform('translate3d(0px, ' + (s.width / 2 + s.params.cube.shadowOffset) + 'px, ' + (-s.width / 2) + 'px) rotateX(90deg) rotateZ(0deg) scale(' + (s.params.cube.shadowScale) + ')');
                        }
                        else {
                            var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;
                            var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);
                            var scale1 = s.params.cube.shadowScale,
                                scale2 = s.params.cube.shadowScale / multiplier,
                                offset = s.params.cube.shadowOffset;
                            cubeShadow.transform('scale3d(' + scale1 + ', 1, ' + scale2 + ') translate3d(0px, ' + (s.height / 2 + offset) + 'px, ' + (-s.height / 2 / scale2) + 'px) rotateX(-90deg)');
                        }
                    }
                    var zFactor = (s.isSafari || s.isUiWebView) ? (-s.size / 2) : 0;
                    s.wrapper.transform('translate3d(0px,0,' + zFactor + 'px) rotateX(' + (s.isHorizontal() ? 0 : wrapperRotate) + 'deg) rotateY(' + (s.isHorizontal() ? -wrapperRotate : 0) + 'deg)');
                },
                setTransition: function (duration) {
                    s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
                    if (s.params.cube.shadow && !s.isHorizontal()) {
                        s.container.find('.swiper-cube-shadow').transition(duration);
                    }
                }
            },
            coverflow: {
                setTranslate: function () {
                    var transform = s.translate;
                    var center = s.isHorizontal() ? -transform + s.width / 2 : -transform + s.height / 2;
                    var rotate = s.isHorizontal() ? s.params.coverflow.rotate: -s.params.coverflow.rotate;
                    var translate = s.params.coverflow.depth;
                    //Each slide offset from center
                    for (var i = 0, length = s.slides.length; i < length; i++) {
                        var slide = s.slides.eq(i);
                        var slideSize = s.slidesSizesGrid[i];
                        var slideOffset = slide[0].swiperSlideOffset;
                        var offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * s.params.coverflow.modifier;
        
                        var rotateY = s.isHorizontal() ? rotate * offsetMultiplier : 0;
                        var rotateX = s.isHorizontal() ? 0 : rotate * offsetMultiplier;
                        // var rotateZ = 0
                        var translateZ = -translate * Math.abs(offsetMultiplier);
        
                        var translateY = s.isHorizontal() ? 0 : s.params.coverflow.stretch * (offsetMultiplier);
                        var translateX = s.isHorizontal() ? s.params.coverflow.stretch * (offsetMultiplier) : 0;
        
                        //Fix for ultra small values
                        if (Math.abs(translateX) < 0.001) translateX = 0;
                        if (Math.abs(translateY) < 0.001) translateY = 0;
                        if (Math.abs(translateZ) < 0.001) translateZ = 0;
                        if (Math.abs(rotateY) < 0.001) rotateY = 0;
                        if (Math.abs(rotateX) < 0.001) rotateX = 0;
        
                        var slideTransform = 'translate3d(' + translateX + 'px,' + translateY + 'px,' + translateZ + 'px)  rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)';
        
                        slide.transform(slideTransform);
                        slide[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
                        if (s.params.coverflow.slideShadows) {
                            //Set shadows
                            var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
                            var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
                            if (shadowBefore.length === 0) {
                                shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
                                slide.append(shadowBefore);
                            }
                            if (shadowAfter.length === 0) {
                                shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
                                slide.append(shadowAfter);
                            }
                            if (shadowBefore.length) shadowBefore[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;
                            if (shadowAfter.length) shadowAfter[0].style.opacity = (-offsetMultiplier) > 0 ? -offsetMultiplier : 0;
                        }
                    }
        
                    //Set correct perspective for IE10
                    if (s.browser.ie) {
                        var ws = s.wrapper[0].style;
                        ws.perspectiveOrigin = center + 'px 50%';
                    }
                },
                setTransition: function (duration) {
                    s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
                }
            }
        };

        
        s.lazy = {
            initialImageLoaded: false,
            loadImageInSlide: function (index, loadInDuplicate) {
                if (typeof index === 'undefined') return;
                if (typeof loadInDuplicate === 'undefined') loadInDuplicate = true;
                if (s.slides.length === 0) return;
        
                var slide = s.slides.eq(index);
                var img = slide.find('.swiper-lazy:not(.swiper-lazy-loaded):not(.swiper-lazy-loading)');
                if (slide.hasClass('swiper-lazy') && !slide.hasClass('swiper-lazy-loaded') && !slide.hasClass('swiper-lazy-loading')) {
                    img = img.add(slide[0]);
                }
                if (img.length === 0) return;
        
                img.each(function () {
                    var _img = $(this);
                    _img.addClass('swiper-lazy-loading');
                    var background = _img.attr('data-background');
                    var src = _img.attr('data-src'),
                        srcset = _img.attr('data-srcset');
                    s.loadImage(_img[0], (src || background), srcset, false, function () {
                        if (background) {
                            _img.css('background-image', 'url("' + background + '")');
                            _img.removeAttr('data-background');
                        }
                        else {
                            if (srcset) {
                                _img.attr('srcset', srcset);
                                _img.removeAttr('data-srcset');
                            }
                            if (src) {
                                _img.attr('src', src);
                                _img.removeAttr('data-src');
                            }
        
                        }
        
                        _img.addClass('swiper-lazy-loaded').removeClass('swiper-lazy-loading');
                        slide.find('.swiper-lazy-preloader, .preloader').remove();
                        if (s.params.loop && loadInDuplicate) {
                            var slideOriginalIndex = slide.attr('data-swiper-slide-index');
                            if (slide.hasClass(s.params.slideDuplicateClass)) {
                                var originalSlide = s.wrapper.children('[data-swiper-slide-index="' + slideOriginalIndex + '"]:not(.' + s.params.slideDuplicateClass + ')');
                                s.lazy.loadImageInSlide(originalSlide.index(), false);
                            }
                            else {
                                var duplicatedSlide = s.wrapper.children('.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + slideOriginalIndex + '"]');
                                s.lazy.loadImageInSlide(duplicatedSlide.index(), false);
                            }
                        }
                        s.emit('onLazyImageReady', s, slide[0], _img[0]);
                    });
        
                    s.emit('onLazyImageLoad', s, slide[0], _img[0]);
                });
        
            },
            load: function () {
                var i;
                if (s.params.watchSlidesVisibility) {
                    s.wrapper.children('.' + s.params.slideVisibleClass).each(function () {
                        s.lazy.loadImageInSlide($(this).index());
                    });
                }
                else {
                    if (s.params.slidesPerView > 1) {
                        for (i = s.activeIndex; i < s.activeIndex + s.params.slidesPerView ; i++) {
                            if (s.slides[i]) s.lazy.loadImageInSlide(i);
                        }
                    }
                    else {
                        s.lazy.loadImageInSlide(s.activeIndex);
                    }
                }
                if (s.params.lazyLoadingInPrevNext) {
                    if (s.params.slidesPerView > 1 || (s.params.lazyLoadingInPrevNextAmount && s.params.lazyLoadingInPrevNextAmount > 1)) {
                        var amount = s.params.lazyLoadingInPrevNextAmount;
                        var spv = s.params.slidesPerView;
                        var maxIndex = Math.min(s.activeIndex + spv + Math.max(amount, spv), s.slides.length);
                        var minIndex = Math.max(s.activeIndex - Math.max(spv, amount), 0);
                        // Next Slides
                        for (i = s.activeIndex + s.params.slidesPerView; i < maxIndex; i++) {
                            if (s.slides[i]) s.lazy.loadImageInSlide(i);
                        }
                        // Prev Slides
                        for (i = minIndex; i < s.activeIndex ; i++) {
                            if (s.slides[i]) s.lazy.loadImageInSlide(i);
                        }
                    }
                    else {
                        var nextSlide = s.wrapper.children('.' + s.params.slideNextClass);
                        if (nextSlide.length > 0) s.lazy.loadImageInSlide(nextSlide.index());
        
                        var prevSlide = s.wrapper.children('.' + s.params.slidePrevClass);
                        if (prevSlide.length > 0) s.lazy.loadImageInSlide(prevSlide.index());
                    }
                }
            },
            onTransitionStart: function () {
                if (s.params.lazyLoading) {
                    if (s.params.lazyLoadingOnTransitionStart || (!s.params.lazyLoadingOnTransitionStart && !s.lazy.initialImageLoaded)) {
                        s.lazy.load();
                    }
                }
            },
            onTransitionEnd: function () {
                if (s.params.lazyLoading && !s.params.lazyLoadingOnTransitionStart) {
                    s.lazy.load();
                }
            }
        };
        

        
        s.scrollbar = {
            isTouched: false,
            setDragPosition: function (e) {
                var sb = s.scrollbar;
                var x = 0, y = 0;
                var translate;
                var pointerPosition = s.isHorizontal() ?
                    ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageX : e.pageX || e.clientX) :
                    ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageY : e.pageY || e.clientY) ;
                var position = (pointerPosition) - sb.track.offset()[s.isHorizontal() ? 'left' : 'top'] - sb.dragSize / 2;
                var positionMin = -s.minTranslate() * sb.moveDivider;
                var positionMax = -s.maxTranslate() * sb.moveDivider;
                if (position < positionMin) {
                    position = positionMin;
                }
                else if (position > positionMax) {
                    position = positionMax;
                }
                position = -position / sb.moveDivider;
                s.updateProgress(position);
                s.setWrapperTranslate(position, true);
            },
            dragStart: function (e) {
                var sb = s.scrollbar;
                sb.isTouched = true;
                e.preventDefault();
                e.stopPropagation();
        
                sb.setDragPosition(e);
                clearTimeout(sb.dragTimeout);
        
                sb.track.transition(0);
                if (s.params.scrollbarHide) {
                    sb.track.css('opacity', 1);
                }
                s.wrapper.transition(100);
                sb.drag.transition(100);
                s.emit('onScrollbarDragStart', s);
            },
            dragMove: function (e) {
                var sb = s.scrollbar;
                if (!sb.isTouched) return;
                if (e.preventDefault) e.preventDefault();
                else e.returnValue = false;
                sb.setDragPosition(e);
                s.wrapper.transition(0);
                sb.track.transition(0);
                sb.drag.transition(0);
                s.emit('onScrollbarDragMove', s);
            },
            dragEnd: function (e) {
                var sb = s.scrollbar;
                if (!sb.isTouched) return;
                sb.isTouched = false;
                if (s.params.scrollbarHide) {
                    clearTimeout(sb.dragTimeout);
                    sb.dragTimeout = setTimeout(function () {
                        sb.track.css('opacity', 0);
                        sb.track.transition(400);
                    }, 1000);
        
                }
                s.emit('onScrollbarDragEnd', s);
                if (s.params.scrollbarSnapOnRelease) {
                    s.slideReset();
                }
            },
            enableDraggable: function () {
                var sb = s.scrollbar;
                var target = s.support.touch ? sb.track : document;
                $(sb.track).on(s.touchEvents.start, sb.dragStart);
                $(target).on(s.touchEvents.move, sb.dragMove);
                $(target).on(s.touchEvents.end, sb.dragEnd);
            },
            disableDraggable: function () {
                var sb = s.scrollbar;
                var target = s.support.touch ? sb.track : document;
                $(sb.track).off(s.touchEvents.start, sb.dragStart);
                $(target).off(s.touchEvents.move, sb.dragMove);
                $(target).off(s.touchEvents.end, sb.dragEnd);
            },
            set: function () {
                if (!s.params.scrollbar) return;
                var sb = s.scrollbar;
                sb.track = $(s.params.scrollbar);
                if (s.params.uniqueNavElements && typeof s.params.scrollbar === 'string' && sb.track.length > 1 && s.container.find(s.params.scrollbar).length === 1) {
                    sb.track = s.container.find(s.params.scrollbar);
                }
                sb.drag = sb.track.find('.swiper-scrollbar-drag');
                if (sb.drag.length === 0) {
                    sb.drag = $('<div class="swiper-scrollbar-drag"></div>');
                    sb.track.append(sb.drag);
                }
                sb.drag[0].style.width = '';
                sb.drag[0].style.height = '';
                sb.trackSize = s.isHorizontal() ? sb.track[0].offsetWidth : sb.track[0].offsetHeight;
        
                sb.divider = s.size / s.virtualSize;
                sb.moveDivider = sb.divider * (sb.trackSize / s.size);
                sb.dragSize = sb.trackSize * sb.divider;
        
                if (s.isHorizontal()) {
                    sb.drag[0].style.width = sb.dragSize + 'px';
                }
                else {
                    sb.drag[0].style.height = sb.dragSize + 'px';
                }
        
                if (sb.divider >= 1) {
                    sb.track[0].style.display = 'none';
                }
                else {
                    sb.track[0].style.display = '';
                }
                if (s.params.scrollbarHide) {
                    sb.track[0].style.opacity = 0;
                }
            },
            setTranslate: function () {
                if (!s.params.scrollbar) return;
                var diff;
                var sb = s.scrollbar;
                var translate = s.translate || 0;
                var newPos;
        
                var newSize = sb.dragSize;
                newPos = (sb.trackSize - sb.dragSize) * s.progress;
                if (s.rtl && s.isHorizontal()) {
                    newPos = -newPos;
                    if (newPos > 0) {
                        newSize = sb.dragSize - newPos;
                        newPos = 0;
                    }
                    else if (-newPos + sb.dragSize > sb.trackSize) {
                        newSize = sb.trackSize + newPos;
                    }
                }
                else {
                    if (newPos < 0) {
                        newSize = sb.dragSize + newPos;
                        newPos = 0;
                    }
                    else if (newPos + sb.dragSize > sb.trackSize) {
                        newSize = sb.trackSize - newPos;
                    }
                }
                if (s.isHorizontal()) {
                    if (s.support.transforms3d) {
                        sb.drag.transform('translate3d(' + (newPos) + 'px, 0, 0)');
                    }
                    else {
                        sb.drag.transform('translateX(' + (newPos) + 'px)');
                    }
                    sb.drag[0].style.width = newSize + 'px';
                }
                else {
                    if (s.support.transforms3d) {
                        sb.drag.transform('translate3d(0px, ' + (newPos) + 'px, 0)');
                    }
                    else {
                        sb.drag.transform('translateY(' + (newPos) + 'px)');
                    }
                    sb.drag[0].style.height = newSize + 'px';
                }
                if (s.params.scrollbarHide) {
                    clearTimeout(sb.timeout);
                    sb.track[0].style.opacity = 1;
                    sb.timeout = setTimeout(function () {
                        sb.track[0].style.opacity = 0;
                        sb.track.transition(400);
                    }, 1000);
                }
            },
            setTransition: function (duration) {
                if (!s.params.scrollbar) return;
                s.scrollbar.drag.transition(duration);
            }
        };

        
        s.controller = {
            LinearSpline: function (x, y) {
                this.x = x;
                this.y = y;
                this.lastIndex = x.length - 1;
                // Given an x value (x2), return the expected y2 value:
                // (x1,y1) is the known point before given value,
                // (x3,y3) is the known point after given value.
                var i1, i3;
                var l = this.x.length;
        
                this.interpolate = function (x2) {
                    if (!x2) return 0;
        
                    // Get the indexes of x1 and x3 (the array indexes before and after given x2):
                    i3 = binarySearch(this.x, x2);
                    i1 = i3 - 1;
        
                    // We have our indexes i1 & i3, so we can calculate already:
                    // y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
                    return ((x2 - this.x[i1]) * (this.y[i3] - this.y[i1])) / (this.x[i3] - this.x[i1]) + this.y[i1];
                };
        
                var binarySearch = (function() {
                    var maxIndex, minIndex, guess;
                    return function(array, val) {
                        minIndex = -1;
                        maxIndex = array.length;
                        while (maxIndex - minIndex > 1)
                            if (array[guess = maxIndex + minIndex >> 1] <= val) {
                                minIndex = guess;
                            } else {
                                maxIndex = guess;
                            }
                        return maxIndex;
                    };
                })();
            },
            //xxx: for now i will just save one spline function to to
            getInterpolateFunction: function(c){
                if(!s.controller.spline) s.controller.spline = s.params.loop ?
                    new s.controller.LinearSpline(s.slidesGrid, c.slidesGrid) :
                    new s.controller.LinearSpline(s.snapGrid, c.snapGrid);
            },
            setTranslate: function (translate, byController) {
               var controlled = s.params.control;
               var multiplier, controlledTranslate;
               function setControlledTranslate(c) {
                    // this will create an Interpolate function based on the snapGrids
                    // x is the Grid of the scrolled scroller and y will be the controlled scroller
                    // it makes sense to create this only once and recall it for the interpolation
                    // the function does a lot of value caching for performance
                    translate = c.rtl && c.params.direction === 'horizontal' ? -s.translate : s.translate;
                    if (s.params.controlBy === 'slide') {
                        s.controller.getInterpolateFunction(c);
                        // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
                        // but it did not work out
                        controlledTranslate = -s.controller.spline.interpolate(-translate);
                    }
        
                    if(!controlledTranslate || s.params.controlBy === 'container'){
                        multiplier = (c.maxTranslate() - c.minTranslate()) / (s.maxTranslate() - s.minTranslate());
                        controlledTranslate = (translate - s.minTranslate()) * multiplier + c.minTranslate();
                    }
        
                    if (s.params.controlInverse) {
                        controlledTranslate = c.maxTranslate() - controlledTranslate;
                    }
                    c.updateProgress(controlledTranslate);
                    c.setWrapperTranslate(controlledTranslate, false, s);
                    c.updateActiveIndex();
               }
               if (s.isArray(controlled)) {
                   for (var i = 0; i < controlled.length; i++) {
                       if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
                           setControlledTranslate(controlled[i]);
                       }
                   }
               }
               else if (controlled instanceof Swiper && byController !== controlled) {
        
                   setControlledTranslate(controlled);
               }
            },
            setTransition: function (duration, byController) {
                var controlled = s.params.control;
                var i;
                function setControlledTransition(c) {
                    c.setWrapperTransition(duration, s);
                    if (duration !== 0) {
                        c.onTransitionStart();
                        c.wrapper.transitionEnd(function(){
                            if (!controlled) return;
                            if (c.params.loop && s.params.controlBy === 'slide') {
                                c.fixLoop();
                            }
                            c.onTransitionEnd();
        
                        });
                    }
                }
                if (s.isArray(controlled)) {
                    for (i = 0; i < controlled.length; i++) {
                        if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
                            setControlledTransition(controlled[i]);
                        }
                    }
                }
                else if (controlled instanceof Swiper && byController !== controlled) {
                    setControlledTransition(controlled);
                }
            }
        };

        
        s.hashnav = {
            init: function () {
                if (!s.params.hashnav) return;
                s.hashnav.initialized = true;
                var hash = document.location.hash.replace('#', '');
                if (!hash) return;
                var speed = 0;
                for (var i = 0, length = s.slides.length; i < length; i++) {
                    var slide = s.slides.eq(i);
                    var slideHash = slide.attr('data-hash');
                    if (slideHash === hash && !slide.hasClass(s.params.slideDuplicateClass)) {
                        var index = slide.index();
                        s.slideTo(index, speed, s.params.runCallbacksOnInit, true);
                    }
                }
            },
            setHash: function () {
                if (!s.hashnav.initialized || !s.params.hashnav) return;
                document.location.hash = s.slides.eq(s.activeIndex).attr('data-hash') || '';
            }
        };

        
        function handleKeyboard(e) {
            if (e.originalEvent) e = e.originalEvent; //jquery fix
            var kc = e.keyCode || e.charCode;
            // Directions locks
            if (!s.params.allowSwipeToNext && (s.isHorizontal() && kc === 39 || !s.isHorizontal() && kc === 40)) {
                return false;
            }
            if (!s.params.allowSwipeToPrev && (s.isHorizontal() && kc === 37 || !s.isHorizontal() && kc === 38)) {
                return false;
            }
            if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
                return;
            }
            if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
                return;
            }
            if (kc === 37 || kc === 39 || kc === 38 || kc === 40) {
                var inView = false;
                //Check that swiper should be inside of visible area of window
                if (s.container.parents('.swiper-slide').length > 0 && s.container.parents('.swiper-slide-active').length === 0) {
                    return;
                }
                var windowScroll = {
                    left: window.pageXOffset,
                    top: window.pageYOffset
                };
                var windowWidth = window.innerWidth;
                var windowHeight = window.innerHeight;
                var swiperOffset = s.container.offset();
                if (s.rtl) swiperOffset.left = swiperOffset.left - s.container[0].scrollLeft;
                var swiperCoord = [
                    [swiperOffset.left, swiperOffset.top],
                    [swiperOffset.left + s.width, swiperOffset.top],
                    [swiperOffset.left, swiperOffset.top + s.height],
                    [swiperOffset.left + s.width, swiperOffset.top + s.height]
                ];
                for (var i = 0; i < swiperCoord.length; i++) {
                    var point = swiperCoord[i];
                    if (
                        point[0] >= windowScroll.left && point[0] <= windowScroll.left + windowWidth &&
                        point[1] >= windowScroll.top && point[1] <= windowScroll.top + windowHeight
                    ) {
                        inView = true;
                    }
        
                }
                if (!inView) return;
            }
            if (s.isHorizontal()) {
                if (kc === 37 || kc === 39) {
                    if (e.preventDefault) e.preventDefault();
                    else e.returnValue = false;
                }
                if ((kc === 39 && !s.rtl) || (kc === 37 && s.rtl)) s.slideNext();
                if ((kc === 37 && !s.rtl) || (kc === 39 && s.rtl)) s.slidePrev();
            }
            else {
                if (kc === 38 || kc === 40) {
                    if (e.preventDefault) e.preventDefault();
                    else e.returnValue = false;
                }
                if (kc === 40) s.slideNext();
                if (kc === 38) s.slidePrev();
            }
        }
        s.disableKeyboardControl = function () {
            s.params.keyboardControl = false;
            $(document).off('keydown', handleKeyboard);
        };
        s.enableKeyboardControl = function () {
            s.params.keyboardControl = true;
            $(document).on('keydown', handleKeyboard);
        };
        

        
        s.mousewheel = {
            event: false,
            lastScrollTime: (new window.Date()).getTime()
        };
        if (s.params.mousewheelControl) {
            try {
                new window.WheelEvent('wheel');
                s.mousewheel.event = 'wheel';
            } catch (e) {
                if (window.WheelEvent || (s.container[0] && 'wheel' in s.container[0])) {
                    s.mousewheel.event = 'wheel';
                }
            }
            if (!s.mousewheel.event && window.WheelEvent) {
        
            }
            if (!s.mousewheel.event && document.onmousewheel !== undefined) {
                s.mousewheel.event = 'mousewheel';
            }
            if (!s.mousewheel.event) {
                s.mousewheel.event = 'DOMMouseScroll';
            }
        }
        function handleMousewheel(e) {
            if (e.originalEvent) e = e.originalEvent; //jquery fix
            var we = s.mousewheel.event;
            var delta = 0;
            var rtlFactor = s.rtl ? -1 : 1;
        
            //WebKits
            if (we === 'mousewheel') {
                if (s.params.mousewheelForceToAxis) {
                    if (s.isHorizontal()) {
                        if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor;
                        else return;
                    }
                    else {
                        if (Math.abs(e.wheelDeltaY) > Math.abs(e.wheelDeltaX)) delta = e.wheelDeltaY;
                        else return;
                    }
                }
                else {
                    delta = Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY) ? - e.wheelDeltaX * rtlFactor : - e.wheelDeltaY;
                }
            }
            //Old FireFox
            else if (we === 'DOMMouseScroll') delta = -e.detail;
            //New FireFox
            else if (we === 'wheel') {
                if (s.params.mousewheelForceToAxis) {
                    if (s.isHorizontal()) {
                        if (Math.abs(e.deltaX) > Math.abs(e.deltaY)) delta = -e.deltaX * rtlFactor;
                        else return;
                    }
                    else {
                        if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) delta = -e.deltaY;
                        else return;
                    }
                }
                else {
                    delta = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? - e.deltaX * rtlFactor : - e.deltaY;
                }
            }
            if (delta === 0) return;
        
            if (s.params.mousewheelInvert) delta = -delta;
        
            if (!s.params.freeMode) {
                if ((new window.Date()).getTime() - s.mousewheel.lastScrollTime > 60) {
                    if (delta < 0) {
                        if ((!s.isEnd || s.params.loop) && !s.animating) s.slideNext();
                        else if (s.params.mousewheelReleaseOnEdges) return true;
                    }
                    else {
                        if ((!s.isBeginning || s.params.loop) && !s.animating) s.slidePrev();
                        else if (s.params.mousewheelReleaseOnEdges) return true;
                    }
                }
                s.mousewheel.lastScrollTime = (new window.Date()).getTime();
        
            }
            else {
                //Freemode or scrollContainer:
                var position = s.getWrapperTranslate() + delta * s.params.mousewheelSensitivity;
                var wasBeginning = s.isBeginning,
                    wasEnd = s.isEnd;
        
                if (position >= s.minTranslate()) position = s.minTranslate();
                if (position <= s.maxTranslate()) position = s.maxTranslate();
        
                s.setWrapperTransition(0);
                s.setWrapperTranslate(position);
                s.updateProgress();
                s.updateActiveIndex();
        
                if (!wasBeginning && s.isBeginning || !wasEnd && s.isEnd) {
                    s.updateClasses();
                }
        
                if (s.params.freeModeSticky) {
                    clearTimeout(s.mousewheel.timeout);
                    s.mousewheel.timeout = setTimeout(function () {
                        s.slideReset();
                    }, 300);
                }
                else {
                    if (s.params.lazyLoading && s.lazy) {
                        s.lazy.load();
                    }
                }
        
                // Return page scroll on edge positions
                if (position === 0 || position === s.maxTranslate()) return;
            }
            if (s.params.autoplay) s.stopAutoplay();
        
            if (e.preventDefault) e.preventDefault();
            else e.returnValue = false;
            return false;
        }
        s.disableMousewheelControl = function () {
            if (!s.mousewheel.event) return false;
            s.container.off(s.mousewheel.event, handleMousewheel);
            return true;
        };
        
        s.enableMousewheelControl = function () {
            if (!s.mousewheel.event) return false;
            s.container.on(s.mousewheel.event, handleMousewheel);
            return true;
        };
        

        
        function setParallaxTransform(el, progress) {
            el = $(el);
            var p, pX, pY;
            var rtlFactor = s.rtl ? -1 : 1;
        
            p = el.attr('data-swiper-parallax') || '0';
            pX = el.attr('data-swiper-parallax-x');
            pY = el.attr('data-swiper-parallax-y');
            if (pX || pY) {
                pX = pX || '0';
                pY = pY || '0';
            }
            else {
                if (s.isHorizontal()) {
                    pX = p;
                    pY = '0';
                }
                else {
                    pY = p;
                    pX = '0';
                }
            }
        
            if ((pX).indexOf('%') >= 0) {
                pX = parseInt(pX, 10) * progress * rtlFactor + '%';
            }
            else {
                pX = pX * progress * rtlFactor + 'px' ;
            }
            if ((pY).indexOf('%') >= 0) {
                pY = parseInt(pY, 10) * progress + '%';
            }
            else {
                pY = pY * progress + 'px' ;
            }
        
            el.transform('translate3d(' + pX + ', ' + pY + ',0px)');
        }
        s.parallax = {
            setTranslate: function () {
                s.container.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){
                    setParallaxTransform(this, s.progress);
        
                });
                s.slides.each(function () {
                    var slide = $(this);
                    slide.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function () {
                        var progress = Math.min(Math.max(slide[0].progress, -1), 1);
                        setParallaxTransform(this, progress);
                    });
                });
            },
            setTransition: function (duration) {
                if (typeof duration === 'undefined') duration = s.params.speed;
                s.container.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){
                    var el = $(this);
                    var parallaxDuration = parseInt(el.attr('data-swiper-parallax-duration'), 10) || duration;
                    if (duration === 0) parallaxDuration = 0;
                    el.transition(parallaxDuration);
                });
            }
        };
        

        
        s._plugins = [];
        for (var plugin in s.plugins) {
            var p = s.plugins[plugin](s, s.params[plugin]);
            if (p) s._plugins.push(p);
        }
        // Method to call all plugins event/method
        s.callPlugins = function (eventName) {
            for (var i = 0; i < s._plugins.length; i++) {
                if (eventName in s._plugins[i]) {
                    s._plugins[i][eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
                }
            }
        };

        
        function normalizeEventName (eventName) {
            if (eventName.indexOf('on') !== 0) {
                if (eventName[0] !== eventName[0].toUpperCase()) {
                    eventName = 'on' + eventName[0].toUpperCase() + eventName.substring(1);
                }
                else {
                    eventName = 'on' + eventName;
                }
            }
            return eventName;
        }
        s.emitterEventListeners = {
        
        };
        s.emit = function (eventName) {
            // Trigger callbacks
            if (s.params[eventName]) {
                s.params[eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
            }
            var i;
            // Trigger events
            if (s.emitterEventListeners[eventName]) {
                for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {
                    s.emitterEventListeners[eventName][i](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
                }
            }
            // Trigger plugins
            if (s.callPlugins) s.callPlugins(eventName, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
        };
        s.on = function (eventName, handler) {
            eventName = normalizeEventName(eventName);
            if (!s.emitterEventListeners[eventName]) s.emitterEventListeners[eventName] = [];
            s.emitterEventListeners[eventName].push(handler);
            return s;
        };
        s.off = function (eventName, handler) {
            var i;
            eventName = normalizeEventName(eventName);
            if (typeof handler === 'undefined') {
                // Remove all handlers for such event
                s.emitterEventListeners[eventName] = [];
                return s;
            }
            if (!s.emitterEventListeners[eventName] || s.emitterEventListeners[eventName].length === 0) return;
            for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {
                if(s.emitterEventListeners[eventName][i] === handler) s.emitterEventListeners[eventName].splice(i, 1);
            }
            return s;
        };
        s.once = function (eventName, handler) {
            eventName = normalizeEventName(eventName);
            var _handler = function () {
                handler(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
                s.off(eventName, _handler);
            };
            s.on(eventName, _handler);
            return s;
        };

        // Accessibility tools
        s.a11y = {
            makeFocusable: function ($el) {
                $el.attr('tabIndex', '0');
                return $el;
            },
            addRole: function ($el, role) {
                $el.attr('role', role);
                return $el;
            },
        
            addLabel: function ($el, label) {
                $el.attr('aria-label', label);
                return $el;
            },
        
            disable: function ($el) {
                $el.attr('aria-disabled', true);
                return $el;
            },
        
            enable: function ($el) {
                $el.attr('aria-disabled', false);
                return $el;
            },
        
            onEnterKey: function (event) {
                if (event.keyCode !== 13) return;
                if ($(event.target).is(s.params.nextButton)) {
                    s.onClickNext(event);
                    if (s.isEnd) {
                        s.a11y.notify(s.params.lastSlideMessage);
                    }
                    else {
                        s.a11y.notify(s.params.nextSlideMessage);
                    }
                }
                else if ($(event.target).is(s.params.prevButton)) {
                    s.onClickPrev(event);
                    if (s.isBeginning) {
                        s.a11y.notify(s.params.firstSlideMessage);
                    }
                    else {
                        s.a11y.notify(s.params.prevSlideMessage);
                    }
                }
                if ($(event.target).is('.' + s.params.bulletClass)) {
                    $(event.target)[0].click();
                }
            },
        
            liveRegion: $('<span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span>'),
        
            notify: function (message) {
                var notification = s.a11y.liveRegion;
                if (notification.length === 0) return;
                notification.html('');
                notification.html(message);
            },
            init: function () {
                // Setup accessibility
                if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
                    s.a11y.makeFocusable(s.nextButton);
                    s.a11y.addRole(s.nextButton, 'button');
                    s.a11y.addLabel(s.nextButton, s.params.nextSlideMessage);
                }
                if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
                    s.a11y.makeFocusable(s.prevButton);
                    s.a11y.addRole(s.prevButton, 'button');
                    s.a11y.addLabel(s.prevButton, s.params.prevSlideMessage);
                }
        
                $(s.container).append(s.a11y.liveRegion);
            },
            initPagination: function () {
                if (s.params.pagination && s.params.paginationClickable && s.bullets && s.bullets.length) {
                    s.bullets.each(function () {
                        var bullet = $(this);
                        s.a11y.makeFocusable(bullet);
                        s.a11y.addRole(bullet, 'button');
                        s.a11y.addLabel(bullet, s.params.paginationBulletMessage.replace(/{{index}}/, bullet.index() + 1));
                    });
                }
            },
            destroy: function () {
                if (s.a11y.liveRegion && s.a11y.liveRegion.length > 0) s.a11y.liveRegion.remove();
            }
        };
        

        
        s.init = function () {
            if (s.params.loop) s.createLoop();
            s.updateContainerSize();
            s.updateSlidesSize();
            s.updatePagination();
            if (s.params.scrollbar && s.scrollbar) {
                s.scrollbar.set();
                if (s.params.scrollbarDraggable) {
                    s.scrollbar.enableDraggable();
                }
            }
            if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {
                if (!s.params.loop) s.updateProgress();
                s.effects[s.params.effect].setTranslate();
            }
            if (s.params.loop) {
                s.slideTo(s.params.initialSlide + s.loopedSlides, 0, s.params.runCallbacksOnInit);
            }
            else {
                s.slideTo(s.params.initialSlide, 0, s.params.runCallbacksOnInit);
                if (s.params.initialSlide === 0) {
                    if (s.parallax && s.params.parallax) s.parallax.setTranslate();
                    if (s.lazy && s.params.lazyLoading) {
                        s.lazy.load();
                        s.lazy.initialImageLoaded = true;
                    }
                }
            }
            s.attachEvents();
            if (s.params.observer && s.support.observer) {
                s.initObservers();
            }
            if (s.params.preloadImages && !s.params.lazyLoading) {
                s.preloadImages();
            }
            if (s.params.autoplay) {
                s.startAutoplay();
            }
            if (s.params.keyboardControl) {
                if (s.enableKeyboardControl) s.enableKeyboardControl();
            }
            if (s.params.mousewheelControl) {
                if (s.enableMousewheelControl) s.enableMousewheelControl();
            }
            if (s.params.hashnav) {
                if (s.hashnav) s.hashnav.init();
            }
            if (s.params.a11y && s.a11y) s.a11y.init();
            s.emit('onInit', s);
        };
        
        // Cleanup dynamic styles
        s.cleanupStyles = function () {
            // Container
            s.container.removeClass(s.classNames.join(' ')).removeAttr('style');
        
            // Wrapper
            s.wrapper.removeAttr('style');
        
            // Slides
            if (s.slides && s.slides.length) {
                s.slides
                    .removeClass([
                      s.params.slideVisibleClass,
                      s.params.slideActiveClass,
                      s.params.slideNextClass,
                      s.params.slidePrevClass
                    ].join(' '))
                    .removeAttr('style')
                    .removeAttr('data-swiper-column')
                    .removeAttr('data-swiper-row');
            }
        
            // Pagination/Bullets
            if (s.paginationContainer && s.paginationContainer.length) {
                s.paginationContainer.removeClass(s.params.paginationHiddenClass);
            }
            if (s.bullets && s.bullets.length) {
                s.bullets.removeClass(s.params.bulletActiveClass);
            }
        
            // Buttons
            if (s.params.prevButton) $(s.params.prevButton).removeClass(s.params.buttonDisabledClass);
            if (s.params.nextButton) $(s.params.nextButton).removeClass(s.params.buttonDisabledClass);
        
            // Scrollbar
            if (s.params.scrollbar && s.scrollbar) {
                if (s.scrollbar.track && s.scrollbar.track.length) s.scrollbar.track.removeAttr('style');
                if (s.scrollbar.drag && s.scrollbar.drag.length) s.scrollbar.drag.removeAttr('style');
            }
        };
        
        // Destroy
        s.destroy = function (deleteInstance, cleanupStyles) {
            // Detach evebts
            s.detachEvents();
            // Stop autoplay
            s.stopAutoplay();
            // Disable draggable
            if (s.params.scrollbar && s.scrollbar) {
                if (s.params.scrollbarDraggable) {
                    s.scrollbar.disableDraggable();
                }
            }
            // Destroy loop
            if (s.params.loop) {
                s.destroyLoop();
            }
            // Cleanup styles
            if (cleanupStyles) {
                s.cleanupStyles();
            }
            // Disconnect observer
            s.disconnectObservers();
            // Disable keyboard/mousewheel
            if (s.params.keyboardControl) {
                if (s.disableKeyboardControl) s.disableKeyboardControl();
            }
            if (s.params.mousewheelControl) {
                if (s.disableMousewheelControl) s.disableMousewheelControl();
            }
            // Disable a11y
            if (s.params.a11y && s.a11y) s.a11y.destroy();
            // Destroy callback
            s.emit('onDestroy');
            // Delete instance
            if (deleteInstance !== false) s = null;
        };
        
        s.init();
        

    
        // Return swiper instance
        return s;
    };
    

    
    Swiper.prototype = {
        isSafari: (function () {
            var ua = navigator.userAgent.toLowerCase();
            return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0);
        })(),
        isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),
        isArray: function (arr) {
            return Object.prototype.toString.apply(arr) === '[object Array]';
        },
        
        browser: {
            ie: window.navigator.pointerEnabled || window.navigator.msPointerEnabled,
            ieTouch: (window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 1) || (window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 1)
        },
        
        device: (function () {
            var ua = navigator.userAgent;
            var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
            var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
            var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
            var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
            return {
                ios: ipad || iphone || ipod,
                android: android
            };
        })(),
        
        support: {
            touch : (window.Modernizr && Modernizr.touch === true) || (function () {
                return !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch);
            })(),
    
            transforms3d : (window.Modernizr && Modernizr.csstransforms3d === true) || (function () {
                var div = document.createElement('div').style;
                return ('webkitPerspective' in div || 'MozPerspective' in div || 'OPerspective' in div || 'MsPerspective' in div || 'perspective' in div);
            })(),
    
            flexbox: (function () {
                var div = document.createElement('div').style;
                var styles = ('alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient').split(' ');
                for (var i = 0; i < styles.length; i++) {
                    if (styles[i] in div) return true;
                }
            })(),
    
            observer: (function () {
                return ('MutationObserver' in window || 'WebkitMutationObserver' in window);
            })()
        },
        
        plugins: {}
    };
    

    
    var swiperDomPlugins = ['jQuery', 'Zepto', 'Dom7'];
    for (var i = 0; i < swiperDomPlugins.length; i++) {
    	if (window[swiperDomPlugins[i]]) {
    		addLibraryPlugin(window[swiperDomPlugins[i]]);
    	}
    }
    // Required DOM Plugins
    var domLib;
    if (typeof Dom7 === 'undefined') {
    	domLib = window.Dom7 || window.Zepto || window.jQuery;
    }
    else {
    	domLib = Dom7;
    }

    
    function addLibraryPlugin(lib) {
        lib.fn.swiper = function (params) {
            var firstInstance;
            lib(this).each(function () {
                var s = new Swiper(this, params);
                if (!firstInstance) firstInstance = s;
            });
            return firstInstance;
        };
    }
    
    if (domLib) {
        if (!('transitionEnd' in domLib.fn)) {
            domLib.fn.transitionEnd = function (callback) {
                var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'],
                    i, j, dom = this;
                function fireCallBack(e) {
                    
                    if (e.target !== this) return;
                    callback.call(this, e);
                    for (i = 0; i < events.length; i++) {
                        dom.off(events[i], fireCallBack);
                    }
                }
                if (callback) {
                    for (i = 0; i < events.length; i++) {
                        dom.on(events[i], fireCallBack);
                    }
                }
                return this;
            };
        }
        if (!('transform' in domLib.fn)) {
            domLib.fn.transform = function (transform) {
                for (var i = 0; i < this.length; i++) {
                    var elStyle = this[i].style;
                    elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform;
                }
                return this;
            };
        }
        if (!('transition' in domLib.fn)) {
            domLib.fn.transition = function (duration) {
                if (typeof duration !== 'string') {
                    duration = duration + 'ms';
                }
                for (var i = 0; i < this.length; i++) {
                    var elStyle = this[i].style;
                    elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration;
                }
                return this;
            };
        }
    }

    window.Swiper = Swiper;
})();

if (typeof(module) !== 'undefined')
{
    module.exports = window.Swiper;
}
else if (typeof define === 'function' && define.amd) {
    define([], function () {
        'use strict';
        return window.Swiper;
    });
}

/*-----/js/jquery/swiper.jquery.js / end -----*/

/*-----/js/lib/js.cookie-1.5.1.js / start -----*/

(function (factory) {
	var jQuery;
	if (typeof define === 'function' && define.amd) {
		// AMD (Register as an anonymous module)
		define(['jquery'], factory);
	} else if (typeof exports === 'object') {
		// Node/CommonJS
		try {
			jQuery = require('jquery');
		} catch(e) {}
		module.exports = factory(jQuery);
	} else {
		// Browser globals
		var _OldCookies = window.Cookies;
		var api = window.Cookies = factory(window.jQuery);
		api.noConflict = function() {
			window.Cookies = _OldCookies;
			return api;
		};
	}
}(function ($) {

	var pluses = /\+/g;

	function encode(s) {
		return api.raw ? s : encodeURIComponent(s);
	}

	function decode(s) {
		return api.raw ? s : decodeURIComponent(s);
	}

	function stringifyCookieValue(value) {
		return encode(api.json ? JSON.stringify(value) : String(value));
	}

	function parseCookieValue(s) {
		if (s.indexOf('"') === 0) {
			// This is a quoted cookie as according to RFC2068, unescape...
			s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
		}

		try {
			// Replace server-side written pluses with spaces.
			// If we can't decode the cookie, ignore it, it's unusable.
			// If we can't parse the cookie, ignore it, it's unusable.
			s = decodeURIComponent(s.replace(pluses, ' '));
			return api.json ? JSON.parse(s) : s;
		} catch(e) {}
	}

	function read(s, converter) {
		var value = api.raw ? s : parseCookieValue(s);
		return isFunction(converter) ? converter(value) : value;
	}

	function extend() {
		var key, options;
		var i = 0;
		var result = {};
		for (; i < arguments.length; i++) {
			options = arguments[ i ];
			for (key in options) {
				result[key] = options[key];
			}
		}
		return result;
	}

	function isFunction(obj) {
		return Object.prototype.toString.call(obj) === '[object Function]';
	}

	var api = function (key, value, options) {

		// Write

		if (arguments.length > 1 && !isFunction(value)) {
			options = extend(api.defaults, options);

			if (typeof options.expires === 'number') {
				var days = options.expires, t = options.expires = new Date();
				t.setMilliseconds(t.getMilliseconds() + days * 864e+5);
			}

			return (document.cookie = [
				encode(key), '=', stringifyCookieValue(value),
				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
				options.path    ? '; path=' + options.path : '',
				options.domain  ? '; domain=' + options.domain : '',
				options.secure  ? '; secure' : ''
			].join(''));
		}

		// Read

		var result = key ? undefined : {},
			// To prevent the for loop in the first place assign an empty array
			// in case there are no cookies at all. Also prevents odd result when
			// calling "get()".
			cookies = document.cookie ? document.cookie.split('; ') : [],
			i = 0,
			l = cookies.length;

		for (; i < l; i++) {
			var parts = cookies[i].split('='),
				name = decode(parts.shift()),
				cookie = parts.join('=');

			if (key === name) {
				// If second argument (value) is a function it's a converter...
				result = read(cookie, value);
				break;
			}

			// Prevent storing a cookie that we couldn't decode.
			if (!key && (cookie = read(cookie)) !== undefined) {
				result[name] = cookie;
			}
		}

		return result;
	};

	api.get = api.set = api;
	api.defaults = {};

	api.remove = function (key, options) {
		// Must not alter options, thus extending a fresh object...
		api(key, '', extend(options, { expires: -1 }));
		return !api(key);
	};

	if ( $ ) {
		$.cookie = api;
		$.removeCookie = api.remove;
	}

	return api;
}));

/*-----/js/lib/js.cookie-1.5.1.js / end -----*/

/*-----/js/jquery/jquery.form.min.js / start -----*/

(function(e){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(typeof jQuery!="undefined"?jQuery:window.Zepto)}})(function(e){"use strict";function r(t){var n=t.data;if(!t.isDefaultPrevented()){t.preventDefault();e(t.target).ajaxSubmit(n)}}function i(t){var n=t.target;var r=e(n);if(!r.is("[type=submit],[type=image]")){var i=r.closest("[type=submit]");if(i.length===0){return}n=i[0]}var s=this;s.clk=n;if(n.type=="image"){if(t.offsetX!==undefined){s.clk_x=t.offsetX;s.clk_y=t.offsetY}else if(typeof e.fn.offset=="function"){var o=r.offset();s.clk_x=t.pageX-o.left;s.clk_y=t.pageY-o.top}else{s.clk_x=t.pageX-n.offsetLeft;s.clk_y=t.pageY-n.offsetTop}}setTimeout(function(){s.clk=s.clk_x=s.clk_y=null},100)}function s(){if(!e.fn.ajaxSubmit.debug){return}var t="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(t)}else if(window.opera&&window.opera.postError){window.opera.postError(t)}}var t={};t.fileapi=e("<input type='file'/>").get(0).files!==undefined;t.formdata=window.FormData!==undefined;var n=!!e.fn.prop;e.fn.attr2=function(){if(!n){return this.attr.apply(this,arguments)}var e=this.prop.apply(this,arguments);if(e&&e.jquery||typeof e==="string"){return e}return this.attr.apply(this,arguments)};e.fn.ajaxSubmit=function(r){function k(t){var n=e.param(t,r.traditional).split("&");var i=n.length;var s=[];var o,u;for(o=0;o<i;o++){n[o]=n[o].replace(/\+/g," ");u=n[o].split("=");s.push([decodeURIComponent(u[0]),decodeURIComponent(u[1])])}return s}function L(t){var n=new FormData;for(var s=0;s<t.length;s++){n.append(t[s].name,t[s].value)}if(r.extraData){var o=k(r.extraData);for(s=0;s<o.length;s++){if(o[s]){n.append(o[s][0],o[s][1])}}}r.data=null;var u=e.extend(true,{},e.ajaxSettings,r,{contentType:false,processData:false,cache:false,type:i||"POST"});if(r.uploadProgress){u.xhr=function(){var t=e.ajaxSettings.xhr();if(t.upload){t.upload.addEventListener("progress",function(e){var t=0;var n=e.loaded||e.position;var i=e.total;if(e.lengthComputable){t=Math.ceil(n/i*100)}r.uploadProgress(e,n,i,t)},false)}return t}}u.data=null;var a=u.beforeSend;u.beforeSend=function(e,t){if(r.formData){t.data=r.formData}else{t.data=n}if(a){a.call(this,e,t)}};return e.ajax(u)}function A(t){function T(e){var t=null;try{if(e.contentWindow){t=e.contentWindow.document}}catch(n){s("cannot get iframe.contentWindow document: "+n)}if(t){return t}try{t=e.contentDocument?e.contentDocument:e.document}catch(n){s("cannot get iframe.contentDocument: "+n);t=e.document}return t}function k(){function f(){try{var e=T(v).readyState;s("state = "+e);if(e&&e.toLowerCase()=="uninitialized"){setTimeout(f,50)}}catch(t){s("Server abort: ",t," (",t.name,")");_(x);if(w){clearTimeout(w)}w=undefined}}var t=a.attr2("target"),n=a.attr2("action"),r="multipart/form-data",u=a.attr("enctype")||a.attr("encoding")||r;o.setAttribute("target",p);if(!i||/post/i.test(i)){o.setAttribute("method","POST")}if(n!=l.url){o.setAttribute("action",l.url)}if(!l.skipEncodingOverride&&(!i||/post/i.test(i))){a.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(l.timeout){w=setTimeout(function(){b=true;_(S)},l.timeout)}var c=[];try{if(l.extraData){for(var h in l.extraData){if(l.extraData.hasOwnProperty(h)){if(e.isPlainObject(l.extraData[h])&&l.extraData[h].hasOwnProperty("name")&&l.extraData[h].hasOwnProperty("value")){c.push(e('<input type="hidden" name="'+l.extraData[h].name+'">').val(l.extraData[h].value).appendTo(o)[0])}else{c.push(e('<input type="hidden" name="'+h+'">').val(l.extraData[h]).appendTo(o)[0])}}}}if(!l.iframeTarget){d.appendTo("body")}if(v.attachEvent){v.attachEvent("onload",_)}else{v.addEventListener("load",_,false)}setTimeout(f,15);try{o.submit()}catch(m){var g=document.createElement("form").submit;g.apply(o)}}finally{o.setAttribute("action",n);o.setAttribute("enctype",u);if(t){o.setAttribute("target",t)}else{a.removeAttr("target")}e(c).remove()}}function _(t){if(m.aborted||M){return}A=T(v);if(!A){s("cannot access response document");t=x}if(t===S&&m){m.abort("timeout");E.reject(m,"timeout");return}else if(t==x&&m){m.abort("server abort");E.reject(m,"error","server abort");return}if(!A||A.location.href==l.iframeSrc){if(!b){return}}if(v.detachEvent){v.detachEvent("onload",_)}else{v.removeEventListener("load",_,false)}var n="success",r;try{if(b){throw"timeout"}var i=l.dataType=="xml"||A.XMLDocument||e.isXMLDoc(A);s("isXml="+i);if(!i&&window.opera&&(A.body===null||!A.body.innerHTML)){if(--O){s("requeing onLoad callback, DOM not available");setTimeout(_,250);return}}var o=A.body?A.body:A.documentElement;m.responseText=o?o.innerHTML:null;m.responseXML=A.XMLDocument?A.XMLDocument:A;if(i){l.dataType="xml"}m.getResponseHeader=function(e){var t={"content-type":l.dataType};return t[e.toLowerCase()]};if(o){m.status=Number(o.getAttribute("status"))||m.status;m.statusText=o.getAttribute("statusText")||m.statusText}var u=(l.dataType||"").toLowerCase();var a=/(json|script|text)/.test(u);if(a||l.textarea){var f=A.getElementsByTagName("textarea")[0];if(f){m.responseText=f.value;m.status=Number(f.getAttribute("status"))||m.status;m.statusText=f.getAttribute("statusText")||m.statusText}else if(a){var c=A.getElementsByTagName("pre")[0];var p=A.getElementsByTagName("body")[0];if(c){m.responseText=c.textContent?c.textContent:c.innerText}else if(p){m.responseText=p.textContent?p.textContent:p.innerText}}}else if(u=="xml"&&!m.responseXML&&m.responseText){m.responseXML=D(m.responseText)}try{L=H(m,u,l)}catch(g){n="parsererror";m.error=r=g||n}}catch(g){s("error caught: ",g);n="error";m.error=r=g||n}if(m.aborted){s("upload aborted");n=null}if(m.status){n=m.status>=200&&m.status<300||m.status===304?"success":"error"}if(n==="success"){if(l.success){l.success.call(l.context,L,"success",m)}E.resolve(m.responseText,"success",m);if(h){e.event.trigger("ajaxSuccess",[m,l])}}else if(n){if(r===undefined){r=m.statusText}if(l.error){l.error.call(l.context,m,n,r)}E.reject(m,"error",r);if(h){e.event.trigger("ajaxError",[m,l,r])}}if(h){e.event.trigger("ajaxComplete",[m,l])}if(h&&!--e.active){e.event.trigger("ajaxStop")}if(l.complete){l.complete.call(l.context,m,n)}M=true;if(l.timeout){clearTimeout(w)}setTimeout(function(){if(!l.iframeTarget){d.remove()}else{d.attr("src",l.iframeSrc)}m.responseXML=null},100)}var o=a[0],u,f,l,h,p,d,v,m,g,y,b,w;var E=e.Deferred();E.abort=function(e){m.abort(e)};if(t){for(f=0;f<c.length;f++){u=e(c[f]);if(n){u.prop("disabled",false)}else{u.removeAttr("disabled")}}}l=e.extend(true,{},e.ajaxSettings,r);l.context=l.context||l;p="jqFormIO"+(new Date).getTime();if(l.iframeTarget){d=e(l.iframeTarget);y=d.attr2("name");if(!y){d.attr2("name",p)}else{p=y}}else{d=e('<iframe name="'+p+'" src="'+l.iframeSrc+'" />');d.css({position:"absolute",top:"-1000px",left:"-1000px"})}v=d[0];m={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var n=t==="timeout"?"timeout":"aborted";s("aborting upload... "+n);this.aborted=1;try{if(v.contentWindow.document.execCommand){v.contentWindow.document.execCommand("Stop")}}catch(r){}d.attr("src",l.iframeSrc);m.error=n;if(l.error){l.error.call(l.context,m,n,t)}if(h){e.event.trigger("ajaxError",[m,l,n])}if(l.complete){l.complete.call(l.context,m,n)}}};h=l.global;if(h&&0===e.active++){e.event.trigger("ajaxStart")}if(h){e.event.trigger("ajaxSend",[m,l])}if(l.beforeSend&&l.beforeSend.call(l.context,m,l)===false){if(l.global){e.active--}E.reject();return E}if(m.aborted){E.reject();return E}g=o.clk;if(g){y=g.name;if(y&&!g.disabled){l.extraData=l.extraData||{};l.extraData[y]=g.value;if(g.type=="image"){l.extraData[y+".x"]=o.clk_x;l.extraData[y+".y"]=o.clk_y}}}var S=1;var x=2;var N=e("meta[name=csrf-token]").attr("content");var C=e("meta[name=csrf-param]").attr("content");if(C&&N){l.extraData=l.extraData||{};l.extraData[C]=N}if(l.forceSync){k()}else{setTimeout(k,10)}var L,A,O=50,M;var D=e.parseXML||function(e,t){if(window.ActiveXObject){t=new ActiveXObject("Microsoft.XMLDOM");t.async="false";t.loadXML(e)}else{t=(new DOMParser).parseFromString(e,"text/xml")}return t&&t.documentElement&&t.documentElement.nodeName!="parsererror"?t:null};var P=e.parseJSON||function(e){return window["eval"]("("+e+")")};var H=function(t,n,r){var i=t.getResponseHeader("content-type")||"",s=n==="xml"||!n&&i.indexOf("xml")>=0,o=s?t.responseXML:t.responseText;if(s&&o.documentElement.nodeName==="parsererror"){if(e.error){e.error("parsererror")}}if(r&&r.dataFilter){o=r.dataFilter(o,n)}if(typeof o==="string"){if(n==="json"||!n&&i.indexOf("json")>=0){o=P(o)}else if(n==="script"||!n&&i.indexOf("javascript")>=0){e.globalEval(o)}}return o};return E}if(!this.length){s("ajaxSubmit: skipping submit process - no element selected");return this}var i,o,u,a=this;if(typeof r=="function"){r={success:r}}else if(r===undefined){r={}}i=r.type||this.attr2("method");o=r.url||this.attr2("action");u=typeof o==="string"?e.trim(o):"";u=u||window.location.href||"";if(u){u=(u.match(/^([^#]+)/)||[])[1]}r=e.extend(true,{url:u,success:e.ajaxSettings.success,type:i||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},r);var f={};this.trigger("form-pre-serialize",[this,r,f]);if(f.veto){s("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(r.beforeSerialize&&r.beforeSerialize(this,r)===false){s("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var l=r.traditional;if(l===undefined){l=e.ajaxSettings.traditional}var c=[];var h,p=this.formToArray(r.semantic,c);if(r.data){r.extraData=r.data;h=e.param(r.data,l)}if(r.beforeSubmit&&r.beforeSubmit(p,this,r)===false){s("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[p,this,r,f]);if(f.veto){s("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var d=e.param(p,l);if(h){d=d?d+"&"+h:h}if(r.type.toUpperCase()=="GET"){r.url+=(r.url.indexOf("?")>=0?"&":"?")+d;r.data=null}else{r.data=d}var v=[];if(r.resetForm){v.push(function(){a.resetForm()})}if(r.clearForm){v.push(function(){a.clearForm(r.includeHidden)})}if(!r.dataType&&r.target){var m=r.success||function(){};v.push(function(t){var n=r.replaceTarget?"replaceWith":"html";e(r.target)[n](t).each(m,arguments)})}else if(r.success){v.push(r.success)}r.success=function(e,t,n){var i=r.context||this;for(var s=0,o=v.length;s<o;s++){v[s].apply(i,[e,t,n||a,a])}};if(r.error){var g=r.error;r.error=function(e,t,n){var i=r.context||this;g.apply(i,[e,t,n,a])}}if(r.complete){var y=r.complete;r.complete=function(e,t){var n=r.context||this;y.apply(n,[e,t,a])}}var b=e("input[type=file]:enabled",this).filter(function(){return e(this).val()!==""});var w=b.length>0;var E="multipart/form-data";var S=a.attr("enctype")==E||a.attr("encoding")==E;var x=t.fileapi&&t.formdata;s("fileAPI :"+x);var T=(w||S)&&!x;var N;if(r.iframe!==false&&(r.iframe||T)){if(r.closeKeepAlive){e.get(r.closeKeepAlive,function(){N=A(p)})}else{N=A(p)}}else if((w||S)&&x){N=L(p)}else{N=e.ajax(r)}a.removeData("jqxhr").data("jqxhr",N);for(var C=0;C<c.length;C++){c[C]=null}this.trigger("form-submit-notify",[this,r]);return this};e.fn.ajaxForm=function(t){t=t||{};t.delegation=t.delegation&&e.isFunction(e.fn.on);if(!t.delegation&&this.length===0){var n={s:this.selector,c:this.context};if(!e.isReady&&n.s){s("DOM not ready, queuing ajaxForm");e(function(){e(n.s,n.c).ajaxForm(t)});return this}s("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)"));return this}if(t.delegation){e(document).off("submit.form-plugin",this.selector,r).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,t,r).on("click.form-plugin",this.selector,t,i);return this}return this.ajaxFormUnbind().bind("submit.form-plugin",t,r).bind("click.form-plugin",t,i)};e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};e.fn.formToArray=function(n,r){var i=[];if(this.length===0){return i}var s=this[0];var o=this.attr("id");var u=n?s.getElementsByTagName("*"):s.elements;var a;if(u&&!/MSIE [678]/.test(navigator.userAgent)){u=e(u).get()}if(o){a=e(':input[form="'+o+'"]').get();if(a.length){u=(u||[]).concat(a)}}if(!u||!u.length){return i}var f,l,c,h,p,d,v;for(f=0,d=u.length;f<d;f++){p=u[f];c=p.name;if(!c||p.disabled){continue}if(n&&s.clk&&p.type=="image"){if(s.clk==p){i.push({name:c,value:e(p).val(),type:p.type});i.push({name:c+".x",value:s.clk_x},{name:c+".y",value:s.clk_y})}continue}h=e.fieldValue(p,true);if(h&&h.constructor==Array){if(r){r.push(p)}for(l=0,v=h.length;l<v;l++){i.push({name:c,value:h[l]})}}else if(t.fileapi&&p.type=="file"){if(r){r.push(p)}var m=p.files;if(m.length){for(l=0;l<m.length;l++){i.push({name:c,value:m[l],type:p.type})}}else{i.push({name:c,value:"",type:p.type})}}else if(h!==null&&typeof h!="undefined"){if(r){r.push(p)}i.push({name:c,value:h,type:p.type,required:p.required})}}if(!n&&s.clk){var g=e(s.clk),y=g[0];c=y.name;if(c&&!y.disabled&&y.type=="image"){i.push({name:c,value:g.val()});i.push({name:c+".x",value:s.clk_x},{name:c+".y",value:s.clk_y})}}return i};e.fn.formSerialize=function(t){return e.param(this.formToArray(t))};e.fn.fieldSerialize=function(t){var n=[];this.each(function(){var r=this.name;if(!r){return}var i=e.fieldValue(this,t);if(i&&i.constructor==Array){for(var s=0,o=i.length;s<o;s++){n.push({name:r,value:i[s]})}}else if(i!==null&&typeof i!="undefined"){n.push({name:this.name,value:i})}});return e.param(n)};e.fn.fieldValue=function(t){for(var n=[],r=0,i=this.length;r<i;r++){var s=this[r];var o=e.fieldValue(s,t);if(o===null||typeof o=="undefined"||o.constructor==Array&&!o.length){continue}if(o.constructor==Array){e.merge(n,o)}else{n.push(o)}}return n};e.fieldValue=function(t,n){var r=t.name,i=t.type,s=t.tagName.toLowerCase();if(n===undefined){n=true}if(n&&(!r||t.disabled||i=="reset"||i=="button"||(i=="checkbox"||i=="radio")&&!t.checked||(i=="submit"||i=="image")&&t.form&&t.form.clk!=t||s=="select"&&t.selectedIndex==-1)){return null}if(s=="select"){var o=t.selectedIndex;if(o<0){return null}var u=[],a=t.options;var f=i=="select-one";var l=f?o+1:a.length;for(var c=f?o:0;c<l;c++){var h=a[c];if(h.selected){var p=h.value;if(!p){p=h.attributes&&h.attributes.value&&!h.attributes.value.specified?h.text:h.value}if(f){return p}u.push(p)}}return u}return e(t).val()};e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})};e.fn.clearFields=e.fn.clearInputs=function(t){var n=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var r=this.type,i=this.tagName.toLowerCase();if(n.test(r)||i=="textarea"){this.value=""}else if(r=="checkbox"||r=="radio"){this.checked=false}else if(i=="select"){this.selectedIndex=-1}else if(r=="file"){if(/MSIE/.test(navigator.userAgent)){e(this).replaceWith(e(this).clone(true))}else{e(this).val("")}}else if(t){if(t===true&&/hidden/.test(r)||typeof t=="string"&&e(this).is(t)){this.value=""}}})};e.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType){this.reset()}})};e.fn.enable=function(e){if(e===undefined){e=true}return this.each(function(){this.disabled=!e})};e.fn.selected=function(t){if(t===undefined){t=true}return this.each(function(){var n=this.type;if(n=="checkbox"||n=="radio"){this.checked=t}else if(this.tagName.toLowerCase()=="option"){var r=e(this).parent("select");if(t&&r[0]&&r[0].type=="select-one"){r.find("option").selected(false)}this.selected=t}})};e.fn.ajaxSubmit.debug=false})

/*-----/js/jquery/jquery.form.min.js / end -----*/

/*-----/js/jquery/jquery.fileupload.js / start -----*/





;(function (factory) {
    'use strict';
    if (typeof define === 'function' && define.amd) {
        // Register as an anonymous AMD module:
        define([
            'jquery',
            'jquery-ui/ui/widget'
        ], factory);
    } else if (typeof exports === 'object') {
        // Node/CommonJS:
        factory(
            require('jquery'),
            require('./vendor/jquery.ui.widget')
        );
    } else {
        // Browser globals:
        factory(window.jQuery);
    }
}(function ($) {
    'use strict';

    // Detect file input support, based on
    // http://viljamis.com/blog/2012/file-upload-support-on-mobile/
    $.support.fileInput = !(new RegExp(
        // Handle devices which give false positives for the feature detection:
        '(Android (1\\.[0156]|2\\.[01]))' +
            '|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' +
            '|(w(eb)?OSBrowser)|(webOS)' +
            '|(Kindle/(1\\.0|2\\.[05]|3\\.0))'
    ).test(window.navigator.userAgent) ||
        // Feature detection for all other devices:
        $('<input type="file">').prop('disabled'));

    // The FileReader API is not actually used, but works as feature detection,
    // as some Safari versions (5?) support XHR file uploads via the FormData API,
    // but not non-multipart XHR file uploads.
    // window.XMLHttpRequestUpload is not available on IE10, so we check for
    // window.ProgressEvent instead to detect XHR2 file upload capability:
    $.support.xhrFileUpload = !!(window.ProgressEvent && window.FileReader);
    $.support.xhrFormDataFileUpload = !!window.FormData;

    // Detect support for Blob slicing (required for chunked uploads):
    $.support.blobSlice = window.Blob && (Blob.prototype.slice ||
        Blob.prototype.webkitSlice || Blob.prototype.mozSlice);

    // Helper function to create drag handlers for dragover/dragenter/dragleave:
    function getDragHandler(type) {
        var isDragOver = type === 'dragover';
        return function (e) {
            e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
            var dataTransfer = e.dataTransfer;
            if (dataTransfer && $.inArray('Files', dataTransfer.types) !== -1 &&
                    this._trigger(
                        type,
                        $.Event(type, {delegatedEvent: e})
                    ) !== false) {
                e.preventDefault();
                if (isDragOver) {
                    dataTransfer.dropEffect = 'copy';
                }
            }
        };
    }

    // The fileupload widget listens for change events on file input fields defined
    // via fileInput setting and paste or drop events of the given dropZone.
    // In addition to the default jQuery Widget methods, the fileupload widget
    // exposes the "add" and "send" methods, to add or directly send files using
    // the fileupload API.
    // By default, files added via file input selection, paste, drag & drop or
    // "add" method are uploaded immediately, but it is possible to override
    // the "add" callback option to queue file uploads.
    $.widget('blueimp.fileupload', {

        options: {
            // The drop target element(s), by the default the complete document.
            // Set to null to disable drag & drop support:
            dropZone: $(document),
            // The paste target element(s), by the default undefined.
            // Set to a DOM node or jQuery object to enable file pasting:
            pasteZone: undefined,
            // The file input field(s), that are listened to for change events.
            // If undefined, it is set to the file input fields inside
            // of the widget element on plugin initialization.
            // Set to null to disable the change listener.
            fileInput: undefined,
            // By default, the file input field is replaced with a clone after
            // each input field change event. This is required for iframe transport
            // queues and allows change events to be fired for the same file
            // selection, but can be disabled by setting the following option to false:
            replaceFileInput: true,
            // The parameter name for the file form data (the request argument name).
            // If undefined or empty, the name property of the file input field is
            // used, or "files[]" if the file input name property is also empty,
            // can be a string or an array of strings:
            paramName: undefined,
            // By default, each file of a selection is uploaded using an individual
            // request for XHR type uploads. Set to false to upload file
            // selections in one request each:
            singleFileUploads: true,
            // To limit the number of files uploaded with one XHR request,
            // set the following option to an integer greater than 0:
            limitMultiFileUploads: undefined,
            // The following option limits the number of files uploaded with one
            // XHR request to keep the request size under or equal to the defined
            // limit in bytes:
            limitMultiFileUploadSize: undefined,
            // Multipart file uploads add a number of bytes to each uploaded file,
            // therefore the following option adds an overhead for each file used
            // in the limitMultiFileUploadSize configuration:
            limitMultiFileUploadSizeOverhead: 512,
            // Set the following option to true to issue all file upload requests
            // in a sequential order:
            sequentialUploads: false,
            // To limit the number of concurrent uploads,
            // set the following option to an integer greater than 0:
            limitConcurrentUploads: undefined,
            // Set the following option to true to force iframe transport uploads:
            forceIframeTransport: false,
            // Set the following option to the location of a redirect url on the
            // origin server, for cross-domain iframe transport uploads:
            redirect: undefined,
            // The parameter name for the redirect url, sent as part of the form
            // data and set to 'redirect' if this option is empty:
            redirectParamName: undefined,
            // Set the following option to the location of a postMessage window,
            // to enable postMessage transport uploads:
            postMessage: undefined,
            // By default, XHR file uploads are sent as multipart/form-data.
            // The iframe transport is always using multipart/form-data.
            // Set to false to enable non-multipart XHR uploads:
            multipart: true,
            // To upload large files in smaller chunks, set the following option
            // to a preferred maximum chunk size. If set to 0, null or undefined,
            // or the browser does not support the required Blob API, files will
            // be uploaded as a whole.
            maxChunkSize: undefined,
            // When a non-multipart upload or a chunked multipart upload has been
            // aborted, this option can be used to resume the upload by setting
            // it to the size of the already uploaded bytes. This option is most
            // useful when modifying the options object inside of the "add" or
            // "send" callbacks, as the options are cloned for each file upload.
            uploadedBytes: undefined,
            // By default, failed (abort or error) file uploads are removed from the
            // global progress calculation. Set the following option to false to
            // prevent recalculating the global progress data:
            recalculateProgress: true,
            // Interval in milliseconds to calculate and trigger progress events:
            progressInterval: 100,
            // Interval in milliseconds to calculate progress bitrate:
            bitrateInterval: 500,
            // By default, uploads are started automatically when adding files:
            autoUpload: true,

            // Error and info messages:
            messages: {
                uploadedBytes: 'Uploaded bytes exceed file size'
            },

            // Translation function, gets the message key to be translated
            // and an object with context specific data as arguments:
            i18n: function (message, context) {
                message = this.messages[message] || message.toString();
                if (context) {
                    $.each(context, function (key, value) {
                        message = message.replace('{' + key + '}', value);
                    });
                }
                return message;
            },

            // Additional form data to be sent along with the file uploads can be set
            // using this option, which accepts an array of objects with name and
            // value properties, a function returning such an array, a FormData
            // object (for XHR file uploads), or a simple object.
            // The form of the first fileInput is given as parameter to the function:
            formData: function (form) {
                return form.serializeArray();
            },

            // The add callback is invoked as soon as files are added to the fileupload
            // widget (via file input selection, drag & drop, paste or add API call).
            // If the singleFileUploads option is enabled, this callback will be
            // called once for each file in the selection for XHR file uploads, else
            // once for each file selection.
            //
            // The upload starts when the submit method is invoked on the data parameter.
            // The data object contains a files property holding the added files
            // and allows you to override plugin options as well as define ajax settings.
            //
            // Listeners for this callback can also be bound the following way:
            // .bind('fileuploadadd', func);
            //
            // data.submit() returns a Promise object and allows to attach additional
            // handlers using jQuery's Deferred callbacks:
            // data.submit().done(func).fail(func).always(func);
            add: function (e, data) {
                if (e.isDefaultPrevented()) {
                    return false;
                }
                if (data.autoUpload || (data.autoUpload !== false &&
                        $(this).fileupload('option', 'autoUpload'))) {
                    data.process().done(function () {
                        data.submit();
                    });
                }
            },

            // Other callbacks:

            // Callback for the submit event of each file upload:
            // submit: function (e, data) {}, // .bind('fileuploadsubmit', func);

            // Callback for the start of each file upload request:
            // send: function (e, data) {}, // .bind('fileuploadsend', func);

            // Callback for successful uploads:
            // done: function (e, data) {}, // .bind('fileuploaddone', func);

            // Callback for failed (abort or error) uploads:
            // fail: function (e, data) {}, // .bind('fileuploadfail', func);

            // Callback for completed (success, abort or error) requests:
            // always: function (e, data) {}, // .bind('fileuploadalways', func);

            // Callback for upload progress events:
            // progress: function (e, data) {}, // .bind('fileuploadprogress', func);

            // Callback for global upload progress events:
            // progressall: function (e, data) {}, // .bind('fileuploadprogressall', func);

            // Callback for uploads start, equivalent to the global ajaxStart event:
            // start: function (e) {}, // .bind('fileuploadstart', func);

            // Callback for uploads stop, equivalent to the global ajaxStop event:
            // stop: function (e) {}, // .bind('fileuploadstop', func);

            // Callback for change events of the fileInput(s):
            // change: function (e, data) {}, // .bind('fileuploadchange', func);

            // Callback for paste events to the pasteZone(s):
            // paste: function (e, data) {}, // .bind('fileuploadpaste', func);

            // Callback for drop events of the dropZone(s):
            // drop: function (e, data) {}, // .bind('fileuploaddrop', func);

            // Callback for dragover events of the dropZone(s):
            // dragover: function (e) {}, // .bind('fileuploaddragover', func);

            // Callback for the start of each chunk upload request:
            // chunksend: function (e, data) {}, // .bind('fileuploadchunksend', func);

            // Callback for successful chunk uploads:
            // chunkdone: function (e, data) {}, // .bind('fileuploadchunkdone', func);

            // Callback for failed (abort or error) chunk uploads:
            // chunkfail: function (e, data) {}, // .bind('fileuploadchunkfail', func);

            // Callback for completed (success, abort or error) chunk upload requests:
            // chunkalways: function (e, data) {}, // .bind('fileuploadchunkalways', func);

            // The plugin options are used as settings object for the ajax calls.
            // The following are jQuery ajax settings required for the file uploads:
            processData: false,
            contentType: false,
            cache: false,
            timeout: 0
        },

        // A list of options that require reinitializing event listeners and/or
        // special initialization code:
        _specialOptions: [
            'fileInput',
            'dropZone',
            'pasteZone',
            'multipart',
            'forceIframeTransport'
        ],

        _blobSlice: $.support.blobSlice && function () {
            var slice = this.slice || this.webkitSlice || this.mozSlice;
            return slice.apply(this, arguments);
        },

        _BitrateTimer: function () {
            this.timestamp = ((Date.now) ? Date.now() : (new Date()).getTime());
            this.loaded = 0;
            this.bitrate = 0;
            this.getBitrate = function (now, loaded, interval) {
                var timeDiff = now - this.timestamp;
                if (!this.bitrate || !interval || timeDiff > interval) {
                    this.bitrate = (loaded - this.loaded) * (1000 / timeDiff) * 8;
                    this.loaded = loaded;
                    this.timestamp = now;
                }
                return this.bitrate;
            };
        },

        _isXHRUpload: function (options) {
            return !options.forceIframeTransport &&
                ((!options.multipart && $.support.xhrFileUpload) ||
                $.support.xhrFormDataFileUpload);
        },

        _getFormData: function (options) {
            var formData;
            if ($.type(options.formData) === 'function') {
                return options.formData(options.form);
            }
            if ($.isArray(options.formData)) {
                return options.formData;
            }
            if ($.type(options.formData) === 'object') {
                formData = [];
                $.each(options.formData, function (name, value) {
                    formData.push({name: name, value: value});
                });
                return formData;
            }
            return [];
        },

        _getTotal: function (files) {
            var total = 0;
            $.each(files, function (index, file) {
                total += file.size || 1;
            });
            return total;
        },

        _initProgressObject: function (obj) {
            var progress = {
                loaded: 0,
                total: 0,
                bitrate: 0
            };
            if (obj._progress) {
                $.extend(obj._progress, progress);
            } else {
                obj._progress = progress;
            }
        },

        _initResponseObject: function (obj) {
            var prop;
            if (obj._response) {
                for (prop in obj._response) {
                    if (obj._response.hasOwnProperty(prop)) {
                        delete obj._response[prop];
                    }
                }
            } else {
                obj._response = {};
            }
        },

        _onProgress: function (e, data) {
            if (e.lengthComputable) {
                var now = ((Date.now) ? Date.now() : (new Date()).getTime()),
                    loaded;
                if (data._time && data.progressInterval &&
                        (now - data._time < data.progressInterval) &&
                        e.loaded !== e.total) {
                    return;
                }
                data._time = now;
                loaded = Math.floor(
                    e.loaded / e.total * (data.chunkSize || data._progress.total)
                ) + (data.uploadedBytes || 0);
                // Add the difference from the previously loaded state
                // to the global loaded counter:
                this._progress.loaded += (loaded - data._progress.loaded);
                this._progress.bitrate = this._bitrateTimer.getBitrate(
                    now,
                    this._progress.loaded,
                    data.bitrateInterval
                );
                data._progress.loaded = data.loaded = loaded;
                data._progress.bitrate = data.bitrate = data._bitrateTimer.getBitrate(
                    now,
                    loaded,
                    data.bitrateInterval
                );
                // Trigger a custom progress event with a total data property set
                // to the file size(s) of the current upload and a loaded data
                // property calculated accordingly:
                this._trigger(
                    'progress',
                    $.Event('progress', {delegatedEvent: e}),
                    data
                );
                // Trigger a global progress event for all current file uploads,
                // including ajax calls queued for sequential file uploads:
                this._trigger(
                    'progressall',
                    $.Event('progressall', {delegatedEvent: e}),
                    this._progress
                );
            }
        },

        _initProgressListener: function (options) {
            var that = this,
                xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
            // Accesss to the native XHR object is required to add event listeners
            // for the upload progress event:
            if (xhr.upload) {
                $(xhr.upload).bind('progress', function (e) {
                    var oe = e.originalEvent;
                    // Make sure the progress event properties get copied over:
                    e.lengthComputable = oe.lengthComputable;
                    e.loaded = oe.loaded;
                    e.total = oe.total;
                    that._onProgress(e, options);
                });
                options.xhr = function () {
                    return xhr;
                };
            }
        },

        _isInstanceOf: function (type, obj) {
            // Cross-frame instanceof check
            return Object.prototype.toString.call(obj) === '[object ' + type + ']';
        },

        _initXHRData: function (options) {
            var that = this,
                formData,
                file = options.files[0],
                // Ignore non-multipart setting if not supported:
                multipart = options.multipart || !$.support.xhrFileUpload,
                paramName = $.type(options.paramName) === 'array' ?
                    options.paramName[0] : options.paramName;
            options.headers = $.extend({}, options.headers);
            if (options.contentRange) {
                options.headers['Content-Range'] = options.contentRange;
            }
            if (!multipart || options.blob || !this._isInstanceOf('File', file)) {
                options.headers['Content-Disposition'] = 'attachment; filename="' +
                    encodeURI(file.name) + '"';
            }
            if (!multipart) {
                options.contentType = file.type || 'application/octet-stream';
                options.data = options.blob || file;
            } else if ($.support.xhrFormDataFileUpload) {
                if (options.postMessage) {
                    // window.postMessage does not allow sending FormData
                    // objects, so we just add the File/Blob objects to
                    // the formData array and let the postMessage window
                    // create the FormData object out of this array:
                    formData = this._getFormData(options);
                    if (options.blob) {
                        formData.push({
                            name: paramName,
                            value: options.blob
                        });
                    } else {
                        $.each(options.files, function (index, file) {
                            formData.push({
                                name: ($.type(options.paramName) === 'array' &&
                                    options.paramName[index]) || paramName,
                                value: file
                            });
                        });
                    }
                } else {
                    if (that._isInstanceOf('FormData', options.formData)) {
                        formData = options.formData;
                    } else {
                        formData = new FormData();
                        $.each(this._getFormData(options), function (index, field) {
                            formData.append(field.name, field.value);
                        });
                    }
                    if (options.blob) {
                        formData.append(paramName, options.blob, file.name);
                    } else {
                        $.each(options.files, function (index, file) {
                            // This check allows the tests to run with
                            // dummy objects:
                            if (that._isInstanceOf('File', file) ||
                                    that._isInstanceOf('Blob', file)) {
                                formData.append(
                                    ($.type(options.paramName) === 'array' &&
                                        options.paramName[index]) || paramName,
                                    file,
                                    file.uploadName || file.name
                                );
                            }
                        });
                    }
                }
                options.data = formData;
            }
            // Blob reference is not needed anymore, free memory:
            options.blob = null;
        },

        _initIframeSettings: function (options) {
            var targetHost = $('<a></a>').prop('href', options.url).prop('host');
            // Setting the dataType to iframe enables the iframe transport:
            options.dataType = 'iframe ' + (options.dataType || '');
            // The iframe transport accepts a serialized array as form data:
            options.formData = this._getFormData(options);
            // Add redirect url to form data on cross-domain uploads:
            if (options.redirect && targetHost && targetHost !== location.host) {
                options.formData.push({
                    name: options.redirectParamName || 'redirect',
                    value: options.redirect
                });
            }
        },

        _initDataSettings: function (options) {
            if (this._isXHRUpload(options)) {
                if (!this._chunkedUpload(options, true)) {
                    if (!options.data) {
                        this._initXHRData(options);
                    }
                    this._initProgressListener(options);
                }
                if (options.postMessage) {
                    // Setting the dataType to postmessage enables the
                    // postMessage transport:
                    options.dataType = 'postmessage ' + (options.dataType || '');
                }
            } else {
                this._initIframeSettings(options);
            }
        },

        _getParamName: function (options) {
            var fileInput = $(options.fileInput),
                paramName = options.paramName;
            if (!paramName) {
                paramName = [];
                fileInput.each(function () {
                    var input = $(this),
                        name = input.prop('name') || 'files[]',
                        i = (input.prop('files') || [1]).length;
                    while (i) {
                        paramName.push(name);
                        i -= 1;
                    }
                });
                if (!paramName.length) {
                    paramName = [fileInput.prop('name') || 'files[]'];
                }
            } else if (!$.isArray(paramName)) {
                paramName = [paramName];
            }
            return paramName;
        },

        _initFormSettings: function (options) {
            // Retrieve missing options from the input field and the
            // associated form, if available:
            if (!options.form || !options.form.length) {
                options.form = $(options.fileInput.prop('form'));
                // If the given file input doesn't have an associated form,
                // use the default widget file input's form:
                if (!options.form.length) {
                    options.form = $(this.options.fileInput.prop('form'));
                }
            }
            options.paramName = this._getParamName(options);
            if (!options.url) {
                options.url = options.form.prop('action') || location.href;
            }
            // The HTTP request method must be "POST" or "PUT":
            options.type = (options.type ||
                ($.type(options.form.prop('method')) === 'string' &&
                    options.form.prop('method')) || ''
                ).toUpperCase();
            if (options.type !== 'POST' && options.type !== 'PUT' &&
                    options.type !== 'PATCH') {
                options.type = 'POST';
            }
            if (!options.formAcceptCharset) {
                options.formAcceptCharset = options.form.attr('accept-charset');
            }
        },

        _getAJAXSettings: function (data) {
            var options = $.extend({}, this.options, data);
            this._initFormSettings(options);
            this._initDataSettings(options);
            return options;
        },

        // jQuery 1.6 doesn't provide .state(),
        // while jQuery 1.8+ removed .isRejected() and .isResolved():
        _getDeferredState: function (deferred) {
            if (deferred.state) {
                return deferred.state();
            }
            if (deferred.isResolved()) {
                return 'resolved';
            }
            if (deferred.isRejected()) {
                return 'rejected';
            }
            return 'pending';
        },

        // Maps jqXHR callbacks to the equivalent
        // methods of the given Promise object:
        _enhancePromise: function (promise) {
            promise.success = promise.done;
            promise.error = promise.fail;
            promise.complete = promise.always;
            return promise;
        },

        // Creates and returns a Promise object enhanced with
        // the jqXHR methods abort, success, error and complete:
        _getXHRPromise: function (resolveOrReject, context, args) {
            var dfd = $.Deferred(),
                promise = dfd.promise();
            context = context || this.options.context || promise;
            if (resolveOrReject === true) {
                dfd.resolveWith(context, args);
            } else if (resolveOrReject === false) {
                dfd.rejectWith(context, args);
            }
            promise.abort = dfd.promise;
            return this._enhancePromise(promise);
        },

        // Adds convenience methods to the data callback argument:
        _addConvenienceMethods: function (e, data) {
            var that = this,
                getPromise = function (args) {
                    return $.Deferred().resolveWith(that, args).promise();
                };
            data.process = function (resolveFunc, rejectFunc) {
                if (resolveFunc || rejectFunc) {
                    data._processQueue = this._processQueue =
                        (this._processQueue || getPromise([this])).then(
                            function () {
                                if (data.errorThrown) {
                                    return $.Deferred()
                                        .rejectWith(that, [data]).promise();
                                }
                                return getPromise(arguments);
                            }
                        ).then(resolveFunc, rejectFunc);
                }
                return this._processQueue || getPromise([this]);
            };
            data.submit = function () {
                if (this.state() !== 'pending') {
                    data.jqXHR = this.jqXHR =
                        (that._trigger(
                            'submit',
                            $.Event('submit', {delegatedEvent: e}),
                            this
                        ) !== false) && that._onSend(e, this);
                }
                return this.jqXHR || that._getXHRPromise();
            };
            data.abort = function () {
                if (this.jqXHR) {
                    return this.jqXHR.abort();
                }
                this.errorThrown = 'abort';
                that._trigger('fail', null, this);
                return that._getXHRPromise(false);
            };
            data.state = function () {
                if (this.jqXHR) {
                    return that._getDeferredState(this.jqXHR);
                }
                if (this._processQueue) {
                    return that._getDeferredState(this._processQueue);
                }
            };
            data.processing = function () {
                return !this.jqXHR && this._processQueue && that
                    ._getDeferredState(this._processQueue) === 'pending';
            };
            data.progress = function () {
                return this._progress;
            };
            data.response = function () {
                return this._response;
            };
        },

        // Parses the Range header from the server response
        // and returns the uploaded bytes:
        _getUploadedBytes: function (jqXHR) {
            var range = jqXHR.getResponseHeader('Range'),
                parts = range && range.split('-'),
                upperBytesPos = parts && parts.length > 1 &&
                    parseInt(parts[1], 10);
            return upperBytesPos && upperBytesPos + 1;
        },

        // Uploads a file in multiple, sequential requests
        // by splitting the file up in multiple blob chunks.
        // If the second parameter is true, only tests if the file
        // should be uploaded in chunks, but does not invoke any
        // upload requests:
        _chunkedUpload: function (options, testOnly) {
            options.uploadedBytes = options.uploadedBytes || 0;
            var that = this,
                file = options.files[0],
                fs = file.size,
                ub = options.uploadedBytes,
                mcs = options.maxChunkSize || fs,
                slice = this._blobSlice,
                dfd = $.Deferred(),
                promise = dfd.promise(),
                jqXHR,
                upload;
            if (!(this._isXHRUpload(options) && slice && (ub || mcs < fs)) ||
                    options.data) {
                return false;
            }
            if (testOnly) {
                return true;
            }
            if (ub >= fs) {
                file.error = options.i18n('uploadedBytes');
                return this._getXHRPromise(
                    false,
                    options.context,
                    [null, 'error', file.error]
                );
            }
            // The chunk upload method:
            upload = function () {
                // Clone the options object for each chunk upload:
                var o = $.extend({}, options),
                    currentLoaded = o._progress.loaded;
                o.blob = slice.call(
                    file,
                    ub,
                    ub + mcs,
                    file.type
                );
                // Store the current chunk size, as the blob itself
                // will be dereferenced after data processing:
                o.chunkSize = o.blob.size;
                // Expose the chunk bytes position range:
                o.contentRange = 'bytes ' + ub + '-' +
                    (ub + o.chunkSize - 1) + '/' + fs;
                // Process the upload data (the blob and potential form data):
                that._initXHRData(o);
                // Add progress listeners for this chunk upload:
                that._initProgressListener(o);
                jqXHR = ((that._trigger('chunksend', null, o) !== false && $.ajax(o)) ||
                        that._getXHRPromise(false, o.context))
                    .done(function (result, textStatus, jqXHR) {
                        ub = that._getUploadedBytes(jqXHR) ||
                            (ub + o.chunkSize);
                        // Create a progress event if no final progress event
                        // with loaded equaling total has been triggered
                        // for this chunk:
                        if (currentLoaded + o.chunkSize - o._progress.loaded) {
                            that._onProgress($.Event('progress', {
                                lengthComputable: true,
                                loaded: ub - o.uploadedBytes,
                                total: ub - o.uploadedBytes
                            }), o);
                        }
                        options.uploadedBytes = o.uploadedBytes = ub;
                        o.result = result;
                        o.textStatus = textStatus;
                        o.jqXHR = jqXHR;
                        that._trigger('chunkdone', null, o);
                        that._trigger('chunkalways', null, o);
                        if (ub < fs) {
                            // File upload not yet complete,
                            // continue with the next chunk:
                            upload();
                        } else {
                            dfd.resolveWith(
                                o.context,
                                [result, textStatus, jqXHR]
                            );
                        }
                    })
                    .fail(function (jqXHR, textStatus, errorThrown) {
                        o.jqXHR = jqXHR;
                        o.textStatus = textStatus;
                        o.errorThrown = errorThrown;
                        that._trigger('chunkfail', null, o);
                        that._trigger('chunkalways', null, o);
                        dfd.rejectWith(
                            o.context,
                            [jqXHR, textStatus, errorThrown]
                        );
                    });
            };
            this._enhancePromise(promise);
            promise.abort = function () {
                return jqXHR.abort();
            };
            upload();
            return promise;
        },

        _beforeSend: function (e, data) {
            if (this._active === 0) {
                // the start callback is triggered when an upload starts
                // and no other uploads are currently running,
                // equivalent to the global ajaxStart event:
                this._trigger('start');
                // Set timer for global bitrate progress calculation:
                this._bitrateTimer = new this._BitrateTimer();
                // Reset the global progress values:
                this._progress.loaded = this._progress.total = 0;
                this._progress.bitrate = 0;
            }
            // Make sure the container objects for the .response() and
            // .progress() methods on the data object are available
            // and reset to their initial state:
            this._initResponseObject(data);
            this._initProgressObject(data);
            data._progress.loaded = data.loaded = data.uploadedBytes || 0;
            data._progress.total = data.total = this._getTotal(data.files) || 1;
            data._progress.bitrate = data.bitrate = 0;
            this._active += 1;
            // Initialize the global progress values:
            this._progress.loaded += data.loaded;
            this._progress.total += data.total;
        },

        _onDone: function (result, textStatus, jqXHR, options) {
            var total = options._progress.total,
                response = options._response;
            if (options._progress.loaded < total) {
                // Create a progress event if no final progress event
                // with loaded equaling total has been triggered:
                this._onProgress($.Event('progress', {
                    lengthComputable: true,
                    loaded: total,
                    total: total
                }), options);
            }
            response.result = options.result = result;
            response.textStatus = options.textStatus = textStatus;
            response.jqXHR = options.jqXHR = jqXHR;
            this._trigger('done', null, options);
        },

        _onFail: function (jqXHR, textStatus, errorThrown, options) {
            var response = options._response;
            if (options.recalculateProgress) {
                // Remove the failed (error or abort) file upload from
                // the global progress calculation:
                this._progress.loaded -= options._progress.loaded;
                this._progress.total -= options._progress.total;
            }
            response.jqXHR = options.jqXHR = jqXHR;
            response.textStatus = options.textStatus = textStatus;
            response.errorThrown = options.errorThrown = errorThrown;
            this._trigger('fail', null, options);
        },

        _onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options) {
            // jqXHRorResult, textStatus and jqXHRorError are added to the
            // options object via done and fail callbacks
            this._trigger('always', null, options);
        },

        _onSend: function (e, data) {
            if (!data.submit) {
                this._addConvenienceMethods(e, data);
            }
            var that = this,
                jqXHR,
                aborted,
                slot,
                pipe,
                options = that._getAJAXSettings(data),
                send = function () {
                    that._sending += 1;
                    // Set timer for bitrate progress calculation:
                    options._bitrateTimer = new that._BitrateTimer();
                    jqXHR = jqXHR || (
                        ((aborted || that._trigger(
                            'send',
                            $.Event('send', {delegatedEvent: e}),
                            options
                        ) === false) &&
                        that._getXHRPromise(false, options.context, aborted)) ||
                        that._chunkedUpload(options) || $.ajax(options)
                    ).done(function (result, textStatus, jqXHR) {
                        that._onDone(result, textStatus, jqXHR, options);
                    }).fail(function (jqXHR, textStatus, errorThrown) {
                        that._onFail(jqXHR, textStatus, errorThrown, options);
                    }).always(function (jqXHRorResult, textStatus, jqXHRorError) {
                        that._onAlways(
                            jqXHRorResult,
                            textStatus,
                            jqXHRorError,
                            options
                        );
                        that._sending -= 1;
                        that._active -= 1;
                        if (options.limitConcurrentUploads &&
                                options.limitConcurrentUploads > that._sending) {
                            // Start the next queued upload,
                            // that has not been aborted:
                            var nextSlot = that._slots.shift();
                            while (nextSlot) {
                                if (that._getDeferredState(nextSlot) === 'pending') {
                                    nextSlot.resolve();
                                    break;
                                }
                                nextSlot = that._slots.shift();
                            }
                        }
                        if (that._active === 0) {
                            // The stop callback is triggered when all uploads have
                            // been completed, equivalent to the global ajaxStop event:
                            that._trigger('stop');
                        }
                    });
                    return jqXHR;
                };
            this._beforeSend(e, options);
            if (this.options.sequentialUploads ||
                    (this.options.limitConcurrentUploads &&
                    this.options.limitConcurrentUploads <= this._sending)) {
                if (this.options.limitConcurrentUploads > 1) {
                    slot = $.Deferred();
                    this._slots.push(slot);
                    pipe = slot.then(send);
                } else {
                    this._sequence = this._sequence.then(send, send);
                    pipe = this._sequence;
                }
                // Return the piped Promise object, enhanced with an abort method,
                // which is delegated to the jqXHR object of the current upload,
                // and jqXHR callbacks mapped to the equivalent Promise methods:
                pipe.abort = function () {
                    aborted = [undefined, 'abort', 'abort'];
                    if (!jqXHR) {
                        if (slot) {
                            slot.rejectWith(options.context, aborted);
                        }
                        return send();
                    }
                    return jqXHR.abort();
                };
                return this._enhancePromise(pipe);
            }
            return send();
        },

        _onAdd: function (e, data) {
            var that = this,
                result = true,
                options = $.extend({}, this.options, data),
                files = data.files,
                filesLength = files.length,
                limit = options.limitMultiFileUploads,
                limitSize = options.limitMultiFileUploadSize,
                overhead = options.limitMultiFileUploadSizeOverhead,
                batchSize = 0,
                paramName = this._getParamName(options),
                paramNameSet,
                paramNameSlice,
                fileSet,
                i,
                j = 0;
            if (!filesLength) {
                return false;
            }
            if (limitSize && files[0].size === undefined) {
                limitSize = undefined;
            }
            if (!(options.singleFileUploads || limit || limitSize) ||
                    !this._isXHRUpload(options)) {
                fileSet = [files];
                paramNameSet = [paramName];
            } else if (!(options.singleFileUploads || limitSize) && limit) {
                fileSet = [];
                paramNameSet = [];
                for (i = 0; i < filesLength; i += limit) {
                    fileSet.push(files.slice(i, i + limit));
                    paramNameSlice = paramName.slice(i, i + limit);
                    if (!paramNameSlice.length) {
                        paramNameSlice = paramName;
                    }
                    paramNameSet.push(paramNameSlice);
                }
            } else if (!options.singleFileUploads && limitSize) {
                fileSet = [];
                paramNameSet = [];
                for (i = 0; i < filesLength; i = i + 1) {
                    batchSize += files[i].size + overhead;
                    if (i + 1 === filesLength ||
                            ((batchSize + files[i + 1].size + overhead) > limitSize) ||
                            (limit && i + 1 - j >= limit)) {
                        fileSet.push(files.slice(j, i + 1));
                        paramNameSlice = paramName.slice(j, i + 1);
                        if (!paramNameSlice.length) {
                            paramNameSlice = paramName;
                        }
                        paramNameSet.push(paramNameSlice);
                        j = i + 1;
                        batchSize = 0;
                    }
                }
            } else {
                paramNameSet = paramName;
            }
            data.originalFiles = files;
            $.each(fileSet || files, function (index, element) {
                var newData = $.extend({}, data);
                newData.files = fileSet ? element : [element];
                newData.paramName = paramNameSet[index];
                that._initResponseObject(newData);
                that._initProgressObject(newData);
                that._addConvenienceMethods(e, newData);
                result = that._trigger(
                    'add',
                    $.Event('add', {delegatedEvent: e}),
                    newData
                );
                return result;
            });
            return result;
        },

        _replaceFileInput: function (data) {
            var input = data.fileInput,
                inputClone = input.clone(true),
                restoreFocus = input.is(document.activeElement);
            // Add a reference for the new cloned file input to the data argument:
            data.fileInputClone = inputClone;
            $('<form></form>').append(inputClone)[0].reset();
            // Detaching allows to insert the fileInput on another form
            // without loosing the file input value:
            input.after(inputClone).detach();
            // If the fileInput had focus before it was detached,
            // restore focus to the inputClone.
            if (restoreFocus) {
                inputClone.focus();
            }
            // Avoid memory leaks with the detached file input:
            $.cleanData(input.unbind('remove'));
            // Replace the original file input element in the fileInput
            // elements set with the clone, which has been copied including
            // event handlers:
            this.options.fileInput = this.options.fileInput.map(function (i, el) {
                if (el === input[0]) {
                    return inputClone[0];
                }
                return el;
            });
            // If the widget has been initialized on the file input itself,
            // override this.element with the file input clone:
            if (input[0] === this.element[0]) {
                this.element = inputClone;
            }
        },

        _handleFileTreeEntry: function (entry, path) {
            var that = this,
                dfd = $.Deferred(),
                entries = [],
                dirReader,
                errorHandler = function (e) {
                    if (e && !e.entry) {
                        e.entry = entry;
                    }
                    // Since $.when returns immediately if one
                    // Deferred is rejected, we use resolve instead.
                    // This allows valid files and invalid items
                    // to be returned together in one set:
                    dfd.resolve([e]);
                },
                successHandler = function (entries) {
                    that._handleFileTreeEntries(
                        entries,
                        path + entry.name + '/'
                    ).done(function (files) {
                        dfd.resolve(files);
                    }).fail(errorHandler);
                },
                readEntries = function () {
                    dirReader.readEntries(function (results) {
                        if (!results.length) {
                            successHandler(entries);
                        } else {
                            entries = entries.concat(results);
                            readEntries();
                        }
                    }, errorHandler);
                };
            path = path || '';
            if (entry.isFile) {
                if (entry._file) {
                    // Workaround for Chrome bug #149735
                    entry._file.relativePath = path;
                    dfd.resolve(entry._file);
                } else {
                    entry.file(function (file) {
                        file.relativePath = path;
                        dfd.resolve(file);
                    }, errorHandler);
                }
            } else if (entry.isDirectory) {
                dirReader = entry.createReader();
                readEntries();
            } else {
                // Return an empy list for file system items
                // other than files or directories:
                dfd.resolve([]);
            }
            return dfd.promise();
        },

        _handleFileTreeEntries: function (entries, path) {
            var that = this;
            return $.when.apply(
                $,
                $.map(entries, function (entry) {
                    return that._handleFileTreeEntry(entry, path);
                })
            ).then(function () {
                return Array.prototype.concat.apply(
                    [],
                    arguments
                );
            });
        },

        _getDroppedFiles: function (dataTransfer) {
            dataTransfer = dataTransfer || {};
            var items = dataTransfer.items;
            if (items && items.length && (items[0].webkitGetAsEntry ||
                    items[0].getAsEntry)) {
                return this._handleFileTreeEntries(
                    $.map(items, function (item) {
                        var entry;
                        if (item.webkitGetAsEntry) {
                            entry = item.webkitGetAsEntry();
                            if (entry) {
                                // Workaround for Chrome bug #149735:
                                entry._file = item.getAsFile();
                            }
                            return entry;
                        }
                        return item.getAsEntry();
                    })
                );
            }
            return $.Deferred().resolve(
                $.makeArray(dataTransfer.files)
            ).promise();
        },

        _getSingleFileInputFiles: function (fileInput) {
            fileInput = $(fileInput);
            var entries = fileInput.prop('webkitEntries') ||
                    fileInput.prop('entries'),
                files,
                value;
            if (entries && entries.length) {
                return this._handleFileTreeEntries(entries);
            }
            files = $.makeArray(fileInput.prop('files'));
            if (!files.length) {
                value = fileInput.prop('value');
                if (!value) {
                    return $.Deferred().resolve([]).promise();
                }
                // If the files property is not available, the browser does not
                // support the File API and we add a pseudo File object with
                // the input value as name with path information removed:
                files = [{name: value.replace(/^.*\\/, '')}];
            } else if (files[0].name === undefined && files[0].fileName) {
                // File normalization for Safari 4 and Firefox 3:
                $.each(files, function (index, file) {
                    file.name = file.fileName;
                    file.size = file.fileSize;
                });
            }
            return $.Deferred().resolve(files).promise();
        },

        _getFileInputFiles: function (fileInput) {
            if (!(fileInput instanceof $) || fileInput.length === 1) {
                return this._getSingleFileInputFiles(fileInput);
            }
            return $.when.apply(
                $,
                $.map(fileInput, this._getSingleFileInputFiles)
            ).then(function () {
                return Array.prototype.concat.apply(
                    [],
                    arguments
                );
            });
        },

        _onChange: function (e) {
            var that = this,
                data = {
                    fileInput: $(e.target),
                    form: $(e.target.form)
                };
            this._getFileInputFiles(data.fileInput).always(function (files) {
                data.files = files;
                if (that.options.replaceFileInput) {
                    that._replaceFileInput(data);
                }
                if (that._trigger(
                        'change',
                        $.Event('change', {delegatedEvent: e}),
                        data
                    ) !== false) {
                    that._onAdd(e, data);
                }
            });
        },

        _onPaste: function (e) {
            var items = e.originalEvent && e.originalEvent.clipboardData &&
                    e.originalEvent.clipboardData.items,
                data = {files: []};
            if (items && items.length) {
                $.each(items, function (index, item) {
                    var file = item.getAsFile && item.getAsFile();
                    if (file) {
                        data.files.push(file);
                    }
                });
                if (this._trigger(
                        'paste',
                        $.Event('paste', {delegatedEvent: e}),
                        data
                    ) !== false) {
                    this._onAdd(e, data);
                }
            }
        },

        _onDrop: function (e) {
            e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
            var that = this,
                dataTransfer = e.dataTransfer,
                data = {};
            if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {
                e.preventDefault();
                this._getDroppedFiles(dataTransfer).always(function (files) {
                    data.files = files;
                    if (that._trigger(
                            'drop',
                            $.Event('drop', {delegatedEvent: e}),
                            data
                        ) !== false) {
                        that._onAdd(e, data);
                    }
                });
            }
        },

        _onDragOver: getDragHandler('dragover'),

        _onDragEnter: getDragHandler('dragenter'),

        _onDragLeave: getDragHandler('dragleave'),

        _initEventHandlers: function () {
            if (this._isXHRUpload(this.options)) {
                this._on(this.options.dropZone, {
                    dragover: this._onDragOver,
                    drop: this._onDrop,
                    // event.preventDefault() on dragenter is required for IE10+:
                    dragenter: this._onDragEnter,
                    // dragleave is not required, but added for completeness:
                    dragleave: this._onDragLeave
                });
                this._on(this.options.pasteZone, {
                    paste: this._onPaste
                });
            }
            if ($.support.fileInput) {
                this._on(this.options.fileInput, {
                    change: this._onChange
                });
            }
        },

        _destroyEventHandlers: function () {
            this._off(this.options.dropZone, 'dragenter dragleave dragover drop');
            this._off(this.options.pasteZone, 'paste');
            this._off(this.options.fileInput, 'change');
        },

        _destroy: function () {
            this._destroyEventHandlers();
        },

        _setOption: function (key, value) {
            var reinit = $.inArray(key, this._specialOptions) !== -1;
            if (reinit) {
                this._destroyEventHandlers();
            }
            this._super(key, value);
            if (reinit) {
                this._initSpecialOptions();
                this._initEventHandlers();
            }
        },

        _initSpecialOptions: function () {
            var options = this.options;
            if (options.fileInput === undefined) {
                options.fileInput = this.element.is('input[type="file"]') ?
                        this.element : this.element.find('input[type="file"]');
            } else if (!(options.fileInput instanceof $)) {
                options.fileInput = $(options.fileInput);
            }
            if (!(options.dropZone instanceof $)) {
                options.dropZone = $(options.dropZone);
            }
            if (!(options.pasteZone instanceof $)) {
                options.pasteZone = $(options.pasteZone);
            }
        },

        _getRegExp: function (str) {
            var parts = str.split('/'),
                modifiers = parts.pop();
            parts.shift();
            return new RegExp(parts.join('/'), modifiers);
        },

        _isRegExpOption: function (key, value) {
            return key !== 'url' && $.type(value) === 'string' &&
                /^\/.*\/[igm]{0,3}$/.test(value);
        },

        _initDataAttributes: function () {
            var that = this,
                options = this.options,
                data = this.element.data();
            // Initialize options set via HTML5 data-attributes:
            $.each(
                this.element[0].attributes,
                function (index, attr) {
                    var key = attr.name.toLowerCase(),
                        value;
                    if (/^data-/.test(key)) {
                        // Convert hyphen-ated key to camelCase:
                        key = key.slice(5).replace(/-[a-z]/g, function (str) {
                            return str.charAt(1).toUpperCase();
                        });
                        value = data[key];
                        if (that._isRegExpOption(key, value)) {
                            value = that._getRegExp(value);
                        }
                        options[key] = value;
                    }
                }
            );
        },

        _create: function () {
            this._initDataAttributes();
            this._initSpecialOptions();
            this._slots = [];
            this._sequence = this._getXHRPromise(true);
            this._sending = this._active = 0;
            this._initProgressObject(this);
            this._initEventHandlers();
        },

        // This method is exposed to the widget API and allows to query
        // the number of active uploads:
        active: function () {
            return this._active;
        },

        // This method is exposed to the widget API and allows to query
        // the widget upload progress.
        // It returns an object with loaded, total and bitrate properties
        // for the running uploads:
        progress: function () {
            return this._progress;
        },

        // This method is exposed to the widget API and allows adding files
        // using the fileupload API. The data parameter accepts an object which
        // must have a files property and can contain additional options:
        // .fileupload('add', {files: filesList});
        add: function (data) {
            var that = this;
            if (!data || this.options.disabled) {
                return;
            }
            if (data.fileInput && !data.files) {
                this._getFileInputFiles(data.fileInput).always(function (files) {
                    data.files = files;
                    that._onAdd(null, data);
                });
            } else {
                data.files = $.makeArray(data.files);
                this._onAdd(null, data);
            }
        },

        // This method is exposed to the widget API and allows sending files
        // using the fileupload API. The data parameter accepts an object which
        // must have a files or fileInput property and can contain additional options:
        // .fileupload('send', {files: filesList});
        // The method returns a Promise object for the file upload call.
        send: function (data) {
            if (data && !this.options.disabled) {
                if (data.fileInput && !data.files) {
                    var that = this,
                        dfd = $.Deferred(),
                        promise = dfd.promise(),
                        jqXHR,
                        aborted;
                    promise.abort = function () {
                        aborted = true;
                        if (jqXHR) {
                            return jqXHR.abort();
                        }
                        dfd.reject(null, 'abort', 'abort');
                        return promise;
                    };
                    this._getFileInputFiles(data.fileInput).always(
                        function (files) {
                            if (aborted) {
                                return;
                            }
                            if (!files.length) {
                                dfd.reject();
                                return;
                            }
                            data.files = files;
                            jqXHR = that._onSend(null, data);
                            jqXHR.then(
                                function (result, textStatus, jqXHR) {
                                    dfd.resolve(result, textStatus, jqXHR);
                                },
                                function (jqXHR, textStatus, errorThrown) {
                                    dfd.reject(jqXHR, textStatus, errorThrown);
                                }
                            );
                        }
                    );
                    return this._enhancePromise(promise);
                }
                data.files = $.makeArray(data.files);
                if (data.files.length) {
                    return this._onSend(null, data);
                }
            }
            return this._getXHRPromise(false, data && data.context);
        }

    });

}));
/*-----/js/jquery/jquery.fileupload.js / end -----*/

/*-----/js/jquery/jquery.iframe-transport.js / start -----*/




;(function (factory) {
    'use strict';
    if (typeof define === 'function' && define.amd) {
        // Register as an anonymous AMD module:
        define(['jquery'], factory);
    } else if (typeof exports === 'object') {
        // Node/CommonJS:
        factory(require('jquery'));
    } else {
        // Browser globals:
        factory(window.jQuery);
    }
}(function ($) {
    'use strict';

    // Helper variable to create unique names for the transport iframes:
    var counter = 0,
        jsonAPI = $,
        jsonParse = 'parseJSON';

    if ('JSON' in window && 'parse' in JSON) {
      jsonAPI = JSON;
      jsonParse = 'parse';
    }

    // The iframe transport accepts four additional options:
    // options.fileInput: a jQuery collection of file input fields
    // options.paramName: the parameter name for the file form data,
    //  overrides the name property of the file input field(s),
    //  can be a string or an array of strings.
    // options.formData: an array of objects with name and value properties,
    //  equivalent to the return data of .serializeArray(), e.g.:
    //  [{name: 'a', value: 1}, {name: 'b', value: 2}]
    // options.initialIframeSrc: the URL of the initial iframe src,
    //  by default set to "javascript:false;"
    $.ajaxTransport('iframe', function (options) {
        if (options.async) {
            // javascript:false as initial iframe src
            // prevents warning popups on HTTPS in IE6:
            
            var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
            
                form,
                iframe,
                addParamChar;
            return {
                send: function (_, completeCallback) {
                    form = $('<form style="display:none;"></form>');
                    form.attr('accept-charset', options.formAcceptCharset);
                    addParamChar = /\?/.test(options.url) ? '&' : '?';
                    // XDomainRequest only supports GET and POST:
                    if (options.type === 'DELETE') {
                        options.url = options.url + addParamChar + '_method=DELETE';
                        options.type = 'POST';
                    } else if (options.type === 'PUT') {
                        options.url = options.url + addParamChar + '_method=PUT';
                        options.type = 'POST';
                    } else if (options.type === 'PATCH') {
                        options.url = options.url + addParamChar + '_method=PATCH';
                        options.type = 'POST';
                    }
                    // IE versions below IE8 cannot set the name property of
                    // elements that have already been added to the DOM,
                    // so we set the name along with the iframe HTML markup:
                    counter += 1;
                    iframe = $(
                        '<iframe src="' + initialIframeSrc +
                            '" name="iframe-transport-' + counter + '"></iframe>'
                    ).bind('load', function () {
                        var fileInputClones,
                            paramNames = $.isArray(options.paramName) ?
                                    options.paramName : [options.paramName];
                        iframe
                            .unbind('load')
                            .bind('load', function () {
                                var response;
                                // Wrap in a try/catch block to catch exceptions thrown
                                // when trying to access cross-domain iframe contents:
                                try {
                                    response = iframe.contents();
                                    // Google Chrome and Firefox do not throw an
                                    // exception when calling iframe.contents() on
                                    // cross-domain requests, so we unify the response:
                                    if (!response.length || !response[0].firstChild) {
                                        throw new Error();
                                    }
                                } catch (e) {
                                    response = undefined;
                                }
                                // The complete callback returns the
                                // iframe content document as response object:
                                completeCallback(
                                    200,
                                    'success',
                                    {'iframe': response}
                                );
                                // Fix for IE endless progress bar activity bug
                                // (happens on form submits to iframe targets):
                                $('<iframe src="' + initialIframeSrc + '"></iframe>')
                                    .appendTo(form);
                                window.setTimeout(function () {
                                    // Removing the form in a setTimeout call
                                    // allows Chrome's developer tools to display
                                    // the response result
                                    form.remove();
                                }, 0);
                            });
                        form
                            .prop('target', iframe.prop('name'))
                            .prop('action', options.url)
                            .prop('method', options.type);
                        if (options.formData) {
                            $.each(options.formData, function (index, field) {
                                $('<input type="hidden"/>')
                                    .prop('name', field.name)
                                    .val(field.value)
                                    .appendTo(form);
                            });
                        }
                        if (options.fileInput && options.fileInput.length &&
                                options.type === 'POST') {
                            fileInputClones = options.fileInput.clone();
                            // Insert a clone for each file input field:
                            options.fileInput.after(function (index) {
                                return fileInputClones[index];
                            });
                            if (options.paramName) {
                                options.fileInput.each(function (index) {
                                    $(this).prop(
                                        'name',
                                        paramNames[index] || options.paramName
                                    );
                                });
                            }
                            // Appending the file input fields to the hidden form
                            // removes them from their original location:
                            form
                                .append(options.fileInput)
                                .prop('enctype', 'multipart/form-data')
                                // enctype must be set as encoding for IE:
                                .prop('encoding', 'multipart/form-data');
                            // Remove the HTML5 form attribute from the input(s):
                            options.fileInput.removeAttr('form');
                        }
                        form.submit();
                        // Insert the file input fields at their original location
                        // by replacing the clones with the originals:
                        if (fileInputClones && fileInputClones.length) {
                            options.fileInput.each(function (index, input) {
                                var clone = $(fileInputClones[index]);
                                // Restore the original name and form properties:
                                $(input)
                                    .prop('name', clone.prop('name'))
                                    .attr('form', clone.attr('form'));
                                clone.replaceWith(input);
                            });
                        }
                    });
                    form.append(iframe).appendTo(document.body);
                },
                abort: function () {
                    if (iframe) {
                        // javascript:false as iframe src aborts the request
                        // and prevents warning popups on HTTPS in IE6.
                        // concat is used to avoid the "Script URL" JSLint error:
                        iframe
                            .unbind('load')
                            .prop('src', initialIframeSrc);
                    }
                    if (form) {
                        form.remove();
                    }
                }
            };
        }
    });

    // The iframe transport returns the iframe content document as response.
    // The following adds converters from iframe to text, json, html, xml
    // and script.
    // Please note that the Content-Type for JSON responses has to be text/plain
    // or text/html, if the browser doesn't include application/json in the
    // Accept header, else IE will show a download dialog.
    // The Content-Type for XML responses on the other hand has to be always
    // application/xml or text/xml, so IE properly parses the XML response.
    // See also
    // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
    $.ajaxSetup({
        converters: {
            'iframe text': function (iframe) {
                return iframe && $(iframe[0].body).text();
            },
            'iframe json': function (iframe) {
                return iframe && jsonAPI[jsonParse]($(iframe[0].body).text());
            },
            'iframe html': function (iframe) {
                return iframe && $(iframe[0].body).html();
            },
            'iframe xml': function (iframe) {
                var xmlDoc = iframe && iframe[0];
                return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
                        $.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
                            $(xmlDoc.body).html());
            },
            'iframe script': function (iframe) {
                return iframe && $.globalEval($(iframe[0].body).text());
            }
        }
    });

}));
/*-----/js/jquery/jquery.iframe-transport.js / end -----*/

/*-----/js/html5/html5shiv.min.js / start -----*/

!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document);
/*-----/js/html5/html5shiv.min.js / end -----*/

/*-----/js/toast/tui.chart/code-snippet.min.js / start -----*/

!function(a){"use strict";a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var b=Array.prototype.slice,c=function(b,c,d){var e,f=[];for(a.util.isUndefined(c)&&(c=b||0,b=0),d=d||1,e=0>d?-1:1,c*=e;c>b*e;b+=d)f.push(b);return f},d=function(){var c=b.call(arguments),d=[];return a.util.forEach(c,function(b){a.util.forEach(b,function(a,b){d[b]||(d[b]=[]),d[b].push(a)})}),d};a.util.range=c,a.util.zip=d}(window.tui),function(a){"use strict";a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var b,c,d={chrome:!1,firefox:!1,safari:!1,msie:!1,others:!1,version:0},e=window.navigator,f=e.appName.replace(/\s/g,"_"),g=e.userAgent,h=/MSIE\s([0-9]+[.0-9]*)/,i=/Trident.*rv:11\./,j={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d\.]+)\sSafari\/(\d+)/},k={Microsoft_Internet_Explorer:function(){d.msie=!0,d.version=parseFloat(g.match(h)[1])},Netscape:function(){var a=!1;if(i.exec(g))d.msie=!0,d.version=11;else for(b in j)if(j.hasOwnProperty(b)&&(c=g.match(j[b]),c&&c.length>1)){d[b]=a=!0,d.version=parseFloat(c[1]||0);break}a||(d.others=!0)}};k[f](),a.util.browser=d}(window.tui),function(a){"use strict";function b(a,b,c){var d=0,e=a.length;for(c=c||null;e>d&&b.call(c,a[d],d,a)!==!1;d++);}function c(a,b,c){var d;c=c||null;for(d in a)if(a.hasOwnProperty(d)&&b.call(c,a[d],d,a)===!1)break}function d(b,c,d){a.util.isArray(b)?a.util.forEachArray(b,c,d):a.util.forEachOwnProperties(b,c,d)}function e(b,c,d){var e=[];return d=d||null,a.util.forEach(b,function(){e.push(c.apply(d,arguments))}),e}function f(b,c,d){var e,f,g,h=0;for(d=d||null,a.util.isArray(b)||(e=a.util.keys(b)),f=e?e.length:b.length,g=b[e?e[h++]:h++];f>h;h++)g=c.call(d,g,b[e?e[h]:h]);return g}function g(a){var c;try{c=Array.prototype.slice.call(a)}catch(d){c=[],b(a,function(a){c.push(a)})}return c}a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var h=!!Array.prototype.indexOf,i=function(b,c,d){var e,f;if(d=d||null,!a.util.isObject(b)||!a.util.isFunction(c))throw new Error("wrong parameter");return a.util.isArray(b)?(e=[],f=function(a,b){a.push(b[0])}):(e={},f=function(a,b){a[b[1]]=b[0]}),a.util.forEach(b,function(){c.apply(d,arguments)&&f(e,arguments)},d),e},j=function(b,c,d){if(!a.util.isArray(c))return-1;if(h)return Array.prototype.indexOf.call(c,b,d);var e,f=c.length;if(a.util.isUndefined(d))d=0;else if(d>=f||0>d)return-1;for(e=d;f>e;e++)if(c[e]===b)return e;return-1},k=function(b,c){var d=a.util.map(b,function(a){return a[c]});return d};a.util.forEachOwnProperties=c,a.util.forEachArray=b,a.util.forEach=d,a.util.toArray=g,a.util.map=e,a.util.reduce=f,a.util.filter=i,a.util.inArray=j,a.util.pluck=k}(window.tui),function(a){"use strict";function b(){this.events=null,this.contexts=null}a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var c=/\s+/g;b.mixin=function(c){a.util.extend(c.prototype,b.prototype)},b.prototype._getHandlerItem=function(a,b){var c={handler:a};return b&&(c.context=b),c},b.prototype._safeEvent=function(a){var b,c=this.events;return c||(c=this.events={}),a&&(b=c[a],b||(b=[],c[a]=b),c=b),c},b.prototype._safeContext=function(){var a=this.contexts;return a||(a=this.contexts=[]),a},b.prototype._indexOfContext=function(a){for(var b=this._safeContext(),c=0;b[c];){if(a===b[c][0])return c;c+=1}return-1},b.prototype._memorizeContext=function(b){var c,d;a.util.isExisty(b)&&(c=this._safeContext(),d=this._indexOfContext(b),d>-1?c[d][1]+=1:c.push([b,1]))},b.prototype._forgetContext=function(b){var c,d;a.util.isExisty(b)&&(c=this._safeContext(),d=this._indexOfContext(b),d>-1&&(c[d][1]-=1,c[d][1]<=0&&c.splice(d,1)))},b.prototype._bindEvent=function(a,b,c){var d=this._safeEvent(a);this._memorizeContext(c),d.push(this._getHandlerItem(b,c))},b.prototype.on=function(b,d,e){var f=this;a.util.isString(b)?(b=b.split(c),a.util.forEach(b,function(a){f._bindEvent(a,d,e)})):a.util.isObject(b)&&(e=d,a.util.forEach(b,function(a,b){f.on(b,a,e)}))},b.prototype.once=function(b,c,d){function e(){c.apply(d,arguments),f.off(b,e,d)}var f=this;return a.util.isObject(b)?(d=c,void a.util.forEach(b,function(a,b){f.once(b,a,d)})):void this.on(b,e,d)},b.prototype._spliceMatches=function(b,c){var d,e;if(a.util.isArray(b))for(d=0,e=b.length;e>d;d+=1)c(b[d])===!0&&(b.splice(d,1),e-=1,d-=1)},b.prototype._matchHandler=function(a){var b=this;return function(c){var d=a===c.handler;return d&&b._forgetContext(c.context),d}},b.prototype._matchContext=function(a){var b=this;return function(c){var d=a===c.context;return d&&b._forgetContext(c.context),d}},b.prototype._matchHandlerAndContext=function(a,b){var c=this;return function(d){var e=a===d.handler,f=b===d.context,g=e&&f;return g&&c._forgetContext(d.context),g}},b.prototype._offByEventName=function(b,d){var e=this,f=a.util.forEachArray,g=a.util.isFunction(d),h=e._matchHandler(d);b=b.split(c),f(b,function(a){var b=e._safeEvent(a);g?e._spliceMatches(b,h):(f(b,function(a){e._forgetContext(a.context)}),e.events[a]=[])})},b.prototype._offByHandler=function(b){var c=this,d=this._matchHandler(b);a.util.forEach(this._safeEvent(),function(a){c._spliceMatches(a,d)})},b.prototype._offByObject=function(b,c){var d,e=this;this._indexOfContext(b)<0?a.util.forEach(b,function(a,b){e.off(b,a)}):a.util.isString(c)?(d=this._matchContext(b),e._spliceMatches(this._safeEvent(c),d)):a.util.isFunction(c)?(d=this._matchHandlerAndContext(c,b),a.util.forEach(this._safeEvent(),function(a){e._spliceMatches(a,d)})):(d=this._matchContext(b),a.util.forEach(this._safeEvent(),function(a){e._spliceMatches(a,d)}))},b.prototype.off=function(b,c){a.util.isString(b)?this._offByEventName(b,c):arguments.length?a.util.isFunction(b)?this._offByHandler(b):a.util.isObject(b)&&this._offByObject(b,c):(this.events={},this.contexts=[])},b.prototype.fire=function(a){this.invoke.apply(this,arguments)},b.prototype.invoke=function(a){var b,c,d,e;if(!this.hasListener(a))return!0;for(b=this._safeEvent(a),c=Array.prototype.slice.call(arguments,1),d=0;b[d];){if(e=b[d],e.handler.apply(e.context,c)===!1)return!1;d+=1}return!0},b.prototype.hasListener=function(a){return this.getListenerLength(a)>0},b.prototype.getListenerLength=function(a){var b=this._safeEvent(a);return b.length},a.util.CustomEvents=b}(window.tui),function(a){"use strict";a||(a=window.tui={}),a.util||(a.util=window.tui.util={}),a.util.defineClass=function(b,c){var d;return c||(c=b,b=null),d=c.init||function(){},b&&a.util.inherit(d,b),c.hasOwnProperty("static")&&(a.util.extend(d,c["static"]),delete c["static"]),a.util.extend(d.prototype,c),d}}(window.tui),function(a){"use strict";function b(a,b){var e=b||{};return c.isFunction(e[d])&&(e[d](),delete e[d]),c.defineNamespace(a,e,!0)}a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var c=a.util,d="initialize";a.util.defineModule=b}(window.tui),function(a){"use strict";a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var b=function(b,e,f){var g,h,i,j=c(b);return!f&&d(j)?j:(g=b.split("."),h=g.pop(),g.unshift(window),i=a.util.reduce(g,function(a,b){return a[b]=a[b]||{},a[b]}),i[h]=d(e)?e:{},i[h])},c=function(b){var c,d;return c=b.split("."),c.unshift(window),d=a.util.reduce(c,function(a,b){return a&&a[b]})},d=function(b){return a.util.isObject(b)||a.util.isFunction(b)};a.util.defineNamespace=b}(window.tui),function(a){"use strict";function b(a){a&&this.set.apply(this,arguments)}a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var c=function(){try{return Object.defineProperty({},"x",{}),!0}catch(a){return!1}}(),d=0;b.prototype.set=function(b){var c=this;a.util.isArray(b)||(b=a.util.toArray(arguments)),a.util.forEach(b,function(a){c._addItem(a)})},b.prototype.getName=function(b){var c,d=this;return a.util.forEach(this,function(a,e){return d._isEnumItem(e)&&b===a?(c=e,!1):void 0}),c},b.prototype._addItem=function(a){var b;this.hasOwnProperty(a)||(b=this._makeEnumValue(),c?Object.defineProperty(this,a,{enumerable:!0,configurable:!1,writable:!1,value:b}):this[a]=b)},b.prototype._makeEnumValue=function(){var a;return a=d,d+=1,a},b.prototype._isEnumItem=function(b){return a.util.isNumber(this[b])},a.util.Enum=b}(window.tui),function(a){"use strict";function b(a){this._map=new c.Map(a),this.size=this._map.size}a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var c=a.util,d=["get","has","forEach","keys","values","entries"],e=["delete","clear"];c.forEachArray(d,function(a){b.prototype[a]=function(){return this._map[a].apply(this._map,arguments)}}),c.forEachArray(e,function(a){b.prototype[a]=function(){var b=this._map[a].apply(this._map,arguments);return this.size=this._map.size,b}}),b.prototype.set=function(){return this._map.set.apply(this._map,arguments),this.size=this._map.size,this},b.prototype.setObject=function(a){c.forEachOwnProperties(a,function(a,b){this.set(b,a)},this)},b.prototype.deleteByKeys=function(a){c.forEachArray(a,function(a){this["delete"](a)},this)},b.prototype.merge=function(a){a.forEach(function(a,b){this.set(b,a)},this)},b.prototype.filter=function(a){var c=new b;return this.forEach(function(b,d){a(b,d)&&c.set(d,b)}),c},c.ExMap=b}(window.tui),function(a){"use strict";function b(a,b,c){var d,e,g,h;return a=Number(a),b=Number(b),c=Number(c),d=a>-1&&100>a||a>1969&&2070>a,e=b>0&&13>b,d&&e?(h=f[b],2===b&&a%4===0&&(a%100===0&&a%400!==0||(h=29)),g=c>0&&h>=c):!1}function c(c,e){var f,h,i;return h=a.util.isDate(e)?{year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate(),hour:e.getHours(),minute:e.getMinutes()}:{year:e.year,month:e.month,date:e.date,hour:e.hour,minute:e.minute},b(h.year,h.month,h.date)?(h.meridian="",/[^\\][aA]\b/g.test(c)&&(f=h.hour>12?"PM":"AM",h.hour%=12,h.meridian=f),i=c.replace(d,function(a){return a.indexOf("\\")>-1?a.replace(/\\/g,""):g[a](h)||""})):!1}var d=/[\\]*YYYY|[\\]*YY|[\\]*MMMM|[\\]*MMM|[\\]*MM|[\\]*M|[\\]*DD|[\\]*D|[\\]*HH|[\\]*H|[\\]*A/gi,e=["Invalid month","January","February","March","April","May","June","July","August","September","October","November","December"],f=[0,31,28,31,30,31,30,31,31,30,31,30,31],g={M:function(a){return Number(a.month)},MM:function(a){var b=a.month;return Number(b)<10?"0"+b:b},MMM:function(a){return e[Number(a.month)].substr(0,3)},MMMM:function(a){return e[Number(a.month)]},D:function(a){return Number(a.date)},d:function(a){return g.D(a)},DD:function(a){var b=a.date;return Number(b)<10?"0"+b:b},dd:function(a){return g.DD(a)},YY:function(a){return Number(a.year)%100},yy:function(a){return g.YY(a)},YYYY:function(a){var b="20",c=a.year;return c>69&&100>c&&(b="19"),Number(c)<100?b+String(c):c},yyyy:function(a){return g.YYYY(a)},A:function(a){return a.meridian},a:function(a){return a.meridian.toLowerCase()},hh:function(a){var b=a.hour;return Number(b)<10?"0"+b:b},HH:function(a){return g.hh(a)},h:function(a){return String(Number(a.hour))},H:function(a){return g.h(a)},m:function(a){return String(Number(a.minute))},mm:function(a){var b=a.minute;return Number(b)<10?"0"+b:b}};a||(a=window.tui={}),a.util||(a.util=window.tui.util={}),a.util.formatDate=c}(window.tui),function(a){"use strict";function b(a,b){var c=Array.prototype.slice;if(a.bind)return a.bind.apply(a,c.call(arguments,1));var d=c.call(arguments,2);return function(){return a.apply(b,d.length?d.concat(c.call(arguments)):arguments)}}a||(a=window.tui={}),a.util||(a.util=window.tui.util={}),a.util.bind=b}(window.tui),function(a){"use strict";function b(a){this.length=0,a&&this.setObject(a)}a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var c="å";b.prototype.set=function(a,b){2===arguments.length?this.setKeyValue(a,b):this.setObject(a)},b.prototype.setKeyValue=function(a,b){this.has(a)||(this.length+=1),this[this.encodeKey(a)]=b},b.prototype.setObject=function(b){var c=this;a.util.forEachOwnProperties(b,function(a,b){c.setKeyValue(b,a)})},b.prototype.merge=function(a){var b=this;a.each(function(a,c){b.setKeyValue(c,a)})},b.prototype.encodeKey=function(a){return c+a},b.prototype.decodeKey=function(a){var b=a.split(c);return b[b.length-1]},b.prototype.get=function(a){return this[this.encodeKey(a)]},b.prototype.has=function(a){return this.hasOwnProperty(this.encodeKey(a))},b.prototype.remove=function(b){return arguments.length>1&&(b=a.util.toArray(arguments)),a.util.isArray(b)?this.removeByKeyArray(b):this.removeByKey(b)},b.prototype.removeByKey=function(a){var b=this.has(a)?this.get(a):null;return null!==b&&(delete this[this.encodeKey(a)],this.length-=1),b},b.prototype.removeByKeyArray=function(b){var c=[],d=this;return a.util.forEach(b,function(a){c.push(d.removeByKey(a))}),c},b.prototype.removeAll=function(){var a=this;this.each(function(b,c){a.remove(c)})},b.prototype.each=function(b){var d,e=this;a.util.forEachOwnProperties(this,function(a,f){return f.charAt(0)===c&&(d=b(a,e.decodeKey(f))),d===!1?d:void 0})},b.prototype.keys=function(){var a=[],b=this;return this.each(function(c,d){a.push(b.decodeKey(d))}),a},b.prototype.find=function(a){var b=[];return this.each(function(c,d){a(c,d)&&b.push(c)}),b},b.prototype.toArray=function(){var a=[];return this.each(function(b){a.push(b)}),a},a.util.HashMap=b}(window.tui),function(a){"use strict";function b(){function a(){}return function(b){return a.prototype=b,new a}}function c(b,c){var d=a.util.createObject(c.prototype);d.constructor=b,b.prototype=d}a||(a=window.tui={}),a.util||(a.util=window.tui.util={}),a.util.createObject=b(),a.util.inherit=c}(window.tui),function(a){"use strict";function b(a,b){this._keys=a,this._valueGetter=b,this._length=this._keys.length,this._index=-1,this._done=!1}function c(a){this._valuesForString={},this._valuesForIndex={},this._keys=[],a&&this._setInitData(a),this.size=0}a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var d=a.util,e={},f={};b.prototype.next=function(){var a={};do this._index+=1;while(d.isUndefined(this._keys[this._index])&&this._index<this._length);return this._index>=this._length?a.done=!0:(a.done=!1,a.value=this._valueGetter(this._keys[this._index],this._index)),a},c.prototype._setInitData=function(a){if(!d.isArray(a))throw new Error("Only Array is supported.");d.forEachArray(a,function(a){this.set(a[0],a[1])},this)},c.prototype._isNaN=function(a){return"number"==typeof a&&a!==a},c.prototype._getKeyIndex=function(a){var b,c=-1;return d.isString(a)?(b=this._valuesForString[a],b&&(c=b.keyIndex)):c=d.inArray(a,this._keys),c},c.prototype._getOriginKey=function(a){var b=a;return a===e?b=void 0:a===f&&(b=NaN),b},c.prototype._getUniqueKey=function(a){var b=a;return d.isUndefined(a)?b=e:this._isNaN(a)&&(b=f),b},c.prototype._getValueObject=function(a,b){return d.isString(a)?this._valuesForString[a]:(d.isUndefined(b)&&(b=this._getKeyIndex(a)),b>=0?this._valuesForIndex[b]:void 0)},c.prototype._getOriginValue=function(a,b){return this._getValueObject(a,b).origin},c.prototype._getKeyValuePair=function(a,b){return[this._getOriginKey(a),this._getOriginValue(a,b)]},c.prototype._createValueObject=function(a,b){return{keyIndex:b,origin:a}},c.prototype.set=function(a,b){var c,e=this._getUniqueKey(a),f=this._getKeyIndex(e);return 0>f&&(f=this._keys.push(e)-1,this.size+=1),c=this._createValueObject(b,f),d.isString(a)?this._valuesForString[a]=c:this._valuesForIndex[f]=c,this},c.prototype.get=function(a){var b=this._getUniqueKey(a),c=this._getValueObject(b);return c&&c.origin},c.prototype.keys=function(){return new b(this._keys,d.bind(this._getOriginKey,this))},c.prototype.values=function(){return new b(this._keys,d.bind(this._getOriginValue,this))},c.prototype.entries=function(){return new b(this._keys,d.bind(this._getKeyValuePair,this))},c.prototype.has=function(a){return!!this._getValueObject(a)},c.prototype["delete"]=function(a){var b;d.isString(a)?this._valuesForString[a]&&(b=this._valuesForString[a].keyIndex,delete this._valuesForString[a]):(b=this._getKeyIndex(a),b>=0&&delete this._valuesForIndex[b]),b>=0&&(delete this._keys[b],this.size-=1)},c.prototype.forEach=function(a,b){b=b||this,d.forEachArray(this._keys,function(c){d.isUndefined(c)||a.call(b,this._getValueObject(c).origin,c,this)},this)},c.prototype.clear=function(){c.call(this)},function(){var a=d.browser;window.Map&&(a.firefox&&a.version>=37||a.chrome&&a.version>=42)&&(c=window.Map)}(),d.Map=c}(window.tui),function(a){"use strict";function b(a,b){var c,d,e,f,g=Object.prototype.hasOwnProperty;for(e=1,f=arguments.length;f>e;e++){c=arguments[e];for(d in c)g.call(c,d)&&(a[d]=c[d])}return a}function c(a){return a.__fe_id=a.__fe_id||++i,a.__fe_id}function d(b){return a.util.isExisty(a.util.pick(b,"__fe_id"))}function e(){i=0}function f(a){var b,c=[];for(b in a)a.hasOwnProperty(b)&&c.push(b);return c}function g(b){function c(b,f){var g;if(isNaN(b)&&isNaN(f)&&a.util.isNumber(b)&&a.util.isNumber(f))return!0;if(b===f)return!0;if(a.util.isFunction(b)&&a.util.isFunction(f)||b instanceof Date&&f instanceof Date||b instanceof RegExp&&f instanceof RegExp||b instanceof String&&f instanceof String||b instanceof Number&&f instanceof Number)return b.toString()===f.toString();if(!(b instanceof Object&&f instanceof Object))return!1;if(b.isPrototypeOf(f)||f.isPrototypeOf(b)||b.constructor!==f.constructor||b.prototype!==f.prototype)return!1;if(a.util.inArray(b,d)>-1||a.util.inArray(f,e)>-1)return!1;for(g in f){if(f.hasOwnProperty(g)!==b.hasOwnProperty(g))return!1;if(typeof f[g]!=typeof b[g])return!1}for(g in b){if(f.hasOwnProperty(g)!==b.hasOwnProperty(g))return!1;if(typeof f[g]!=typeof b[g])return!1;if("object"==typeof b[g]||"function"==typeof b[g]){if(d.push(b),e.push(f),!c(b[g],f[g]))return!1;d.pop(),e.pop()}else if(b[g]!==f[g])return!1}return!0}var d,e,f,g=arguments.length;if(1>g)return!0;for(f=1;g>f;f++)if(d=[],e=[],!c(arguments[0],arguments[f]))return!1;return!0}function h(a,b){var c,d=arguments,e=d[0],f=d.length;try{for(c=1;f>c;c++)e=e[d[c]];return e}catch(g){return}}a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var i=0;a.util.extend=b,a.util.stamp=c,a.util.hasStamp=d,a.util._resetLastId=e,a.util.keys=Object.keys||f,a.util.compareJSON=g,a.util.pick=h}(window.tui),function(a){"use strict";function b(a){var b={"&quot;":'"',"&amp;":"&","&lt;":"<","&gt;":">","&#39;":"'","&nbsp;":" "};return a.replace(/&amp;|&lt;|&gt;|&quot;|&#39;|&nbsp;/g,function(a){return b[a]?b[a]:a})}function c(a){var b={'"':"quot","&":"amp","<":"lt",">":"gt","'":"#39"};return a.replace(/[<>&"']/g,function(a){return b[a]?"&"+b[a]+";":a})}function d(a){return/[<>&"']/.test(a)}function e(b,c){for(var d,e,f=0,g=b.length,h={};g>f;f+=1)e=b.charAt(f),h[e]=1;for(f=0,g=c.length;g>f;f+=1)e=c.charAt(f),h[e]&&(h[e]+=1);return h=a.util.filter(h,function(a){return a>1}),h=a.util.keys(h).sort(),d=h.join("")}a||(a=window.tui={}),a.util||(a.util=window.tui.util={}),a.util.decodeHTMLEntity=b,a.util.encodeHTMLEntity=c,a.util.hasEncodableString=d,a.util.getDuplicatedChar=e}(window.tui),function(a){"use strict";function b(a,b){function c(){f=e.call(arguments),window.clearTimeout(d),d=window.setTimeout(function(){a.apply(null,f)},b)}var d,f;return b=b||0,c}function c(){return+new Date}function d(b,c){function d(){return j=e.call(arguments),l?(m(j),void(l=!1)):(i=k(),g=g||i,h(j),void(i-g>=c&&m(j)))}function f(){l=!0,g=null}var g,h,i,j,k=a.util.timestamp,l=!0,m=function(a){b.apply(null,a),g=null};return c=c||0,h=a.util.debounce(m,c),d.reset=f,d}var e=Array.prototype.slice;a||(a=window.tui={}),a.util||(a.util=window.tui.util={}),a.util.timestamp=c,a.util.debounce=b,a.util.throttle=d}(window.tui),function(a){"use strict";function b(a){return null!=a}function c(a){return void 0===a}function d(a){return null===a}function e(a){return b(a)&&a!==!1}function f(a){return!e(a)}function g(a){var c=b(a)&&("[object Arguments]"===y.call(a)||!!a.callee);return c}function h(a){return a instanceof Array}function i(a){return a===Object(a)}function j(a){return a instanceof Function}function k(a){return"number"==typeof a||a instanceof Number}function l(a){return"string"==typeof a||a instanceof String}function m(a){return"boolean"==typeof a||a instanceof Boolean}function n(a){return"[object Array]"===y.call(a)}function o(a){return"[object Function]"===y.call(a)}function p(a){return"[object Number]"===y.call(a)}function q(a){return"[object String]"===y.call(a)}function r(a){return"[object Boolean]"===y.call(a)}function s(a){return"object"==typeof HTMLElement?a&&(a instanceof HTMLElement||!!a.nodeType):!(!a||!a.nodeType)}function t(a){return"object"==typeof HTMLElement?a&&a instanceof HTMLElement:!(!a||!a.nodeType||1!==a.nodeType)}function u(c){var d=!1;return b(c)?l(c)&&""===c?!0:h(c)||g(c)?0===c.length:i(c)&&!j(c)?(a.util.forEachOwnProperties(c,function(){return d=!0,!1}),!d):!0:!0}function v(a){return!u(a)}function w(a){return a instanceof Date}function x(a){return"[object Date]"===y.call(a)}a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var y=Object.prototype.toString;a.util.isExisty=b,a.util.isUndefined=c,a.util.isNull=d,a.util.isTruthy=e,a.util.isFalsy=f,a.util.isArguments=g,a.util.isArray=Array.isArray||h,a.util.isArraySafe=Array.isArray||n,a.util.isObject=i,a.util.isFunction=j,a.util.isFunctionSafe=o,a.util.isNumber=k,a.util.isNumberSafe=p,a.util.isDate=w,a.util.isDateSafe=x,a.util.isString=l,a.util.isStringSafe=q,a.util.isBoolean=m,a.util.isBooleanSafe=r,a.util.isHTMLNode=s,a.util.isHTMLTag=t,a.util.isEmpty=u,a.util.isNotEmpty=v}(window.tui),function(a){"use strict";function b(){this.openedPopup={},this.closeWithParentPopup={},this.postBridgeUrl=""}a||(a=window.tui={}),a.util||(a.util=window.tui.util={});var c=0;b.prototype.getPopupList=function(b){var c;return c=a.util.isExisty(b)?this.openedPopup[b]:this.openedPopup},b.prototype.openPopup=function(b,d){d=a.util.extend({popupName:"popup_"+c+"_"+ +new Date,popupOptionStr:"",useReload:!0,closeWithParent:!0,method:"get",param:{}},d||{}),d.method=d.method.toUpperCase(),this.postBridgeUrl=d.postBridgeUrl||this.postBridgeUrl;var e,f,g="POST"===d.method&&d.param&&a.util.browser.msie&&11===a.util.browser.version;if(!a.util.isExisty(b))throw new Error("Popup#open() need popup url.");c+=1,d.param&&("GET"===d.method?b=b+(/\?/.test(b)?"&":"?")+this._parameterize(d.param):"POST"===d.method&&(g||(f=this.createForm(b,d.param,d.method,d.popupName),b="about:blank"))),e=this.openedPopup[d.popupName],a.util.isExisty(e)?e.closed?this.openedPopup[d.popupName]=e=this._open(g,d.param,b,d.popupName,d.popupOptionStr):(d.useReload&&e.location.replace(b),e.focus()):this.openedPopup[d.popupName]=e=this._open(g,d.param,b,d.popupName,d.popupOptionStr),this.closeWithParentPopup[d.popupName]=d.closeWithParent,(!e||e.closed||a.util.isUndefined(e.closed))&&alert("please enable popup windows for this website"),d.param&&"POST"===d.method&&!g&&(e&&f.submit(),f.parentNode&&f.parentNode.removeChild(f)),window.onunload=a.util.bind(this.closeAllPopup,this)},b.prototype.close=function(b,c){b=a.util.isExisty(b)?b:!1;var d=c||window;b&&(window.onunload=null),d.closed||(d.opener=window.location.href,d.close())},b.prototype.closeAllPopup=function(b){var c=a.util.isExisty(b);a.util.forEachOwnProperties(this.openedPopup,function(a,b){(c&&this.closeWithParentPopup[b]||!c)&&this.close(!1,a)},this)},b.prototype.focus=function(a){this.getPopupList(a).focus()},b.prototype.parseQuery=function(){var b,c,d={};return b=window.location.search.substr(1),a.util.forEachArray(b.split("&"),function(a){c=a.split("="),d[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}),d},b.prototype.createForm=function(b,c,d,e,f){var g,h=document.createElement("form");return f=f||document.body,h.method=d||"POST",h.action=b||"",h.target=e||"",h.style.display="none",a.util.forEachOwnProperties(c,function(a,b){g=document.createElement("input"),g.name=b,g.type="hidden",g.value=a,h.appendChild(g)}),f.appendChild(h),h},b.prototype._parameterize=function(b){var c=[];return a.util.forEachOwnProperties(b,function(a,b){c.push(encodeURIComponent(b)+"="+encodeURIComponent(a))}),c.join("&")},b.prototype._open=function(a,b,c,d,e){var f;return a?(f=window.open(this.postBridgeUrl,d,e),setTimeout(function(){f.redirect(c,b)},100)):f=window.open(c,d,e),f},a.util.popup=new b}(window.tui);
/*-----/js/toast/tui.chart/code-snippet.min.js / end -----*/

/*-----/js/toast/tui.chart/raphael.min.js / start -----*/
// ┌───────────────────────────────────────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.2.0 - JavaScript Vector Library                                                             │ \\
// ├───────────────────────────────────────────────────────────────────────────────────────────────────────┤ \\
// │ Copyright © 2008-2016 Dmitry Baranovskiy (http://raphaeljs.com)                                       │ \\
// │ Copyright © 2008-2016 Sencha Labs (http://sencha.com)                                                 │ \\
// ├───────────────────────────────────────────────────────────────────────────────────────────────────────┤ \\
// │ Licensed under the MIT (https://github.com/DmitryBaranovskiy/raphael/blob/master/license.txt) license.│ \\
// └───────────────────────────────────────────────────────────────────────────────────────────────────────┘ \\
!function t(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.Raphael=r():e.Raphael=r()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){var i,n;i=[r(1),r(3),r(4)],n=function(t){return t}.apply(e,i),!(void 0!==n&&(t.exports=n))},function(t,e,r){var i,n;i=[r(2)],n=function(t){function e(r){if(e.is(r,"function"))return w?r():t.on("raphael.DOMload",r);if(e.is(r,Q))return e._engine.create[z](e,r.splice(0,3+e.is(r[0],$))).add(r);var i=Array.prototype.slice.call(arguments,0);if(e.is(i[i.length-1],"function")){var n=i.pop();return w?n.call(e._engine.create[z](e,i)):t.on("raphael.DOMload",function(){n.call(e._engine.create[z](e,i))})}return e._engine.create[z](e,arguments)}function r(t){if("function"==typeof t||Object(t)!==t)return t;var e=new t.constructor;for(var i in t)t[A](i)&&(e[i]=r(t[i]));return e}function i(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return t.push(t.splice(r,1)[0])}function n(t,e,r){function n(){var a=Array.prototype.slice.call(arguments,0),s=a.join("␀"),o=n.cache=n.cache||{},l=n.count=n.count||[];return o[A](s)?(i(l,s),r?r(o[s]):o[s]):(l.length>=1e3&&delete o[l.shift()],l.push(s),o[s]=t[z](e,a),r?r(o[s]):o[s])}return n}function a(){return this.hex}function s(t,e){for(var r=[],i=0,n=t.length;n-2*!e>i;i+=2){var a=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?n-4==i?a[3]={x:+t[0],y:+t[1]}:n-2==i&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[n-2],y:+t[n-1]}:n-4==i?a[3]=a[2]:i||(a[0]={x:+t[i],y:+t[i+1]}),r.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return r}function o(t,e,r,i,n){var a=-3*e+9*r-9*i+3*n,s=t*a+6*e-12*r+6*i;return t*s-3*e+3*r}function l(t,e,r,i,n,a,s,l,h){null==h&&(h=1),h=h>1?1:h<0?0:h;for(var u=h/2,c=12,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,g=0;g<c;g++){var v=u*f[g]+u,x=o(v,t,r,n,s),y=o(v,e,i,a,l),m=x*x+y*y;d+=p[g]*Y.sqrt(m)}return u*d}function h(t,e,r,i,n,a,s,o,h){if(!(h<0||l(t,e,r,i,n,a,s,o)<h)){var u=1,c=u/2,f=u-c,p,d=.01;for(p=l(t,e,r,i,n,a,s,o,f);H(p-h)>d;)c/=2,f+=(p<h?1:-1)*c,p=l(t,e,r,i,n,a,s,o,f);return f}}function u(t,e,r,i,n,a,s,o){if(!(W(t,r)<G(n,s)||G(t,r)>W(n,s)||W(e,i)<G(a,o)||G(e,i)>W(a,o))){var l=(t*i-e*r)*(n-s)-(t-r)*(n*o-a*s),h=(t*i-e*r)*(a-o)-(e-i)*(n*o-a*s),u=(t-r)*(a-o)-(e-i)*(n-s);if(u){var c=l/u,f=h/u,p=+c.toFixed(2),d=+f.toFixed(2);if(!(p<+G(t,r).toFixed(2)||p>+W(t,r).toFixed(2)||p<+G(n,s).toFixed(2)||p>+W(n,s).toFixed(2)||d<+G(e,i).toFixed(2)||d>+W(e,i).toFixed(2)||d<+G(a,o).toFixed(2)||d>+W(a,o).toFixed(2)))return{x:c,y:f}}}}function c(t,e){return p(t,e)}function f(t,e){return p(t,e,1)}function p(t,r,i){var n=e.bezierBBox(t),a=e.bezierBBox(r);if(!e.isBBoxIntersect(n,a))return i?0:[];for(var s=l.apply(0,t),o=l.apply(0,r),h=W(~~(s/5),1),c=W(~~(o/5),1),f=[],p=[],d={},g=i?0:[],v=0;v<h+1;v++){var x=e.findDotsAtSegment.apply(e,t.concat(v/h));f.push({x:x.x,y:x.y,t:v/h})}for(v=0;v<c+1;v++)x=e.findDotsAtSegment.apply(e,r.concat(v/c)),p.push({x:x.x,y:x.y,t:v/c});for(v=0;v<h;v++)for(var y=0;y<c;y++){var m=f[v],b=f[v+1],_=p[y],w=p[y+1],k=H(b.x-m.x)<.001?"y":"x",B=H(w.x-_.x)<.001?"y":"x",C=u(m.x,m.y,b.x,b.y,_.x,_.y,w.x,w.y);if(C){if(d[C.x.toFixed(4)]==C.y.toFixed(4))continue;d[C.x.toFixed(4)]=C.y.toFixed(4);var S=m.t+H((C[k]-m[k])/(b[k]-m[k]))*(b.t-m.t),A=_.t+H((C[B]-_[B])/(w[B]-_[B]))*(w.t-_.t);S>=0&&S<=1.001&&A>=0&&A<=1.001&&(i?g++:g.push({x:C.x,y:C.y,t1:G(S,1),t2:G(A,1)}))}}return g}function d(t,r,i){t=e._path2curve(t),r=e._path2curve(r);for(var n,a,s,o,l,h,u,c,f,d,g=i?0:[],v=0,x=t.length;v<x;v++){var y=t[v];if("M"==y[0])n=l=y[1],a=h=y[2];else{"C"==y[0]?(f=[n,a].concat(y.slice(1)),n=f[6],a=f[7]):(f=[n,a,n,a,l,h,l,h],n=l,a=h);for(var m=0,b=r.length;m<b;m++){var _=r[m];if("M"==_[0])s=u=_[1],o=c=_[2];else{"C"==_[0]?(d=[s,o].concat(_.slice(1)),s=d[6],o=d[7]):(d=[s,o,s,o,u,c,u,c],s=u,o=c);var w=p(f,d,i);if(i)g+=w;else{for(var k=0,B=w.length;k<B;k++)w[k].segment1=v,w[k].segment2=m,w[k].bez1=f,w[k].bez2=d;g=g.concat(w)}}}}}return g}function g(t,e,r,i,n,a){null!=t?(this.a=+t,this.b=+e,this.c=+r,this.d=+i,this.e=+n,this.f=+a):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function v(){return this.x+j+this.y}function x(){return this.x+j+this.y+j+this.width+" × "+this.height}function y(t,e,r,i,n,a){function s(t){return((c*t+u)*t+h)*t}function o(t,e){var r=l(t,e);return((d*r+p)*r+f)*r}function l(t,e){var r,i,n,a,o,l;for(n=t,l=0;l<8;l++){if(a=s(n)-t,H(a)<e)return n;if(o=(3*c*n+2*u)*n+h,H(o)<1e-6)break;n-=a/o}if(r=0,i=1,n=t,n<r)return r;if(n>i)return i;for(;r<i;){if(a=s(n),H(a-t)<e)return n;t>a?r=n:i=n,n=(i-r)/2+r}return n}var h=3*e,u=3*(i-e)-h,c=1-h-u,f=3*r,p=3*(n-r)-f,d=1-f-p;return o(t,1/(200*a))}function m(t,e){var r=[],i={};if(this.ms=e,this.times=1,t){for(var n in t)t[A](n)&&(i[ht(n)]=t[n],r.push(ht(n)));r.sort(Bt)}this.anim=i,this.top=r[r.length-1],this.percents=r}function b(r,i,n,a,s,o){n=ht(n);var l,h,u,c=[],f,p,d,v=r.ms,x={},m={},b={};if(a)for(w=0,B=Ee.length;w<B;w++){var _=Ee[w];if(_.el.id==i.id&&_.anim==r){_.percent!=n?(Ee.splice(w,1),u=1):h=_,i.attr(_.totalOrigin);break}}else a=+m;for(var w=0,B=r.percents.length;w<B;w++){if(r.percents[w]==n||r.percents[w]>a*r.top){n=r.percents[w],p=r.percents[w-1]||0,v=v/r.top*(n-p),f=r.percents[w+1],l=r.anim[n];break}a&&i.attr(r.anim[r.percents[w]])}if(l){if(h)h.initstatus=a,h.start=new Date-h.ms*a;else{for(var C in l)if(l[A](C)&&(pt[A](C)||i.paper.customAttributes[A](C)))switch(x[C]=i.attr(C),null==x[C]&&(x[C]=ft[C]),m[C]=l[C],pt[C]){case $:b[C]=(m[C]-x[C])/v;break;case"colour":x[C]=e.getRGB(x[C]);var S=e.getRGB(m[C]);b[C]={r:(S.r-x[C].r)/v,g:(S.g-x[C].g)/v,b:(S.b-x[C].b)/v};break;case"path":var T=Qt(x[C],m[C]),E=T[1];for(x[C]=T[0],b[C]=[],w=0,B=x[C].length;w<B;w++){b[C][w]=[0];for(var M=1,N=x[C][w].length;M<N;M++)b[C][w][M]=(E[w][M]-x[C][w][M])/v}break;case"transform":var L=i._,z=le(L[C],m[C]);if(z)for(x[C]=z.from,m[C]=z.to,b[C]=[],b[C].real=!0,w=0,B=x[C].length;w<B;w++)for(b[C][w]=[x[C][w][0]],M=1,N=x[C][w].length;M<N;M++)b[C][w][M]=(m[C][w][M]-x[C][w][M])/v;else{var F=i.matrix||new g,R={_:{transform:L.transform},getBBox:function(){return i.getBBox(1)}};x[C]=[F.a,F.b,F.c,F.d,F.e,F.f],se(R,m[C]),m[C]=R._.transform,b[C]=[(R.matrix.a-F.a)/v,(R.matrix.b-F.b)/v,(R.matrix.c-F.c)/v,(R.matrix.d-F.d)/v,(R.matrix.e-F.e)/v,(R.matrix.f-F.f)/v]}break;case"csv":var j=I(l[C])[q](k),D=I(x[C])[q](k);if("clip-rect"==C)for(x[C]=D,b[C]=[],w=D.length;w--;)b[C][w]=(j[w]-x[C][w])/v;m[C]=j;break;default:for(j=[][P](l[C]),D=[][P](x[C]),b[C]=[],w=i.paper.customAttributes[C].length;w--;)b[C][w]=((j[w]||0)-(D[w]||0))/v}var V=l.easing,O=e.easing_formulas[V];if(!O)if(O=I(V).match(st),O&&5==O.length){var Y=O;O=function(t){return y(t,+Y[1],+Y[2],+Y[3],+Y[4],v)}}else O=St;if(d=l.start||r.start||+new Date,_={anim:r,percent:n,timestamp:d,start:d+(r.del||0),status:0,initstatus:a||0,stop:!1,ms:v,easing:O,from:x,diff:b,to:m,el:i,callback:l.callback,prev:p,next:f,repeat:o||r.times,origin:i.attr(),totalOrigin:s},Ee.push(_),a&&!h&&!u&&(_.stop=!0,_.start=new Date-v*a,1==Ee.length))return Ne();u&&(_.start=new Date-_.ms*a),1==Ee.length&&Me(Ne)}t("raphael.anim.start."+i.id,i,r)}}function _(t){for(var e=0;e<Ee.length;e++)Ee[e].el.paper==t&&Ee.splice(e--,1)}e.version="2.2.0",e.eve=t;var w,k=/[, ]+/,B={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},C=/\{(\d+)\}/g,S="prototype",A="hasOwnProperty",T={doc:document,win:window},E={was:Object.prototype[A].call(T.win,"Raphael"),is:T.win.Raphael},M=function(){this.ca=this.customAttributes={}},N,L="appendChild",z="apply",P="concat",F="ontouchstart"in T.win||T.win.DocumentTouch&&T.doc instanceof DocumentTouch,R="",j=" ",I=String,q="split",D="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[q](j),V={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},O=I.prototype.toLowerCase,Y=Math,W=Y.max,G=Y.min,H=Y.abs,X=Y.pow,U=Y.PI,$="number",Z="string",Q="array",J="toString",K="fill",tt=Object.prototype.toString,et={},rt="push",it=e._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,nt=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,at={NaN:1,Infinity:1,"-Infinity":1},st=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,ot=Y.round,lt="setAttribute",ht=parseFloat,ut=parseInt,ct=I.prototype.toUpperCase,ft=e._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,"class":""},pt=e._availableAnimAttrs={blur:$,"clip-rect":"csv",cx:$,cy:$,fill:"colour","fill-opacity":$,"font-size":$,height:$,opacity:$,path:"path",r:$,rx:$,ry:$,stroke:"colour","stroke-opacity":$,"stroke-width":$,transform:"transform",width:$,x:$,y:$},dt=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]/g,gt=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,vt={hs:1,rg:1},xt=/,?([achlmqrstvxz]),?/gi,yt=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,mt=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,bt=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,_t=e._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,wt={},kt=function(t,e){return t.key-e.key},Bt=function(t,e){return ht(t)-ht(e)},Ct=function(){},St=function(t){return t},At=e._rectPath=function(t,e,r,i,n){return n?[["M",t+n,e],["l",r-2*n,0],["a",n,n,0,0,1,n,n],["l",0,i-2*n],["a",n,n,0,0,1,-n,n],["l",2*n-r,0],["a",n,n,0,0,1,-n,-n],["l",0,2*n-i],["a",n,n,0,0,1,n,-n],["z"]]:[["M",t,e],["l",r,0],["l",0,i],["l",-r,0],["z"]]},Tt=function(t,e,r,i){return null==i&&(i=r),[["M",t,e],["m",0,-i],["a",r,i,0,1,1,0,2*i],["a",r,i,0,1,1,0,-2*i],["z"]]},Et=e._getPath={path:function(t){return t.attr("path")},circle:function(t){var e=t.attrs;return Tt(e.cx,e.cy,e.r)},ellipse:function(t){var e=t.attrs;return Tt(e.cx,e.cy,e.rx,e.ry)},rect:function(t){var e=t.attrs;return At(e.x,e.y,e.width,e.height,e.r)},image:function(t){var e=t.attrs;return At(e.x,e.y,e.width,e.height)},text:function(t){var e=t._getBBox();return At(e.x,e.y,e.width,e.height)},set:function(t){var e=t._getBBox();return At(e.x,e.y,e.width,e.height)}},Mt=e.mapPath=function(t,e){if(!e)return t;var r,i,n,a,s,o,l;for(t=Qt(t),n=0,s=t.length;n<s;n++)for(l=t[n],a=1,o=l.length;a<o;a+=2)r=e.x(l[a],l[a+1]),i=e.y(l[a],l[a+1]),l[a]=r,l[a+1]=i;return t};if(e._g=T,e.type=T.win.SVGAngle||T.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==e.type){var Nt=T.doc.createElement("div"),Lt;if(Nt.innerHTML='<v:shape adj="1"/>',Lt=Nt.firstChild,Lt.style.behavior="url(#default#VML)",!Lt||"object"!=typeof Lt.adj)return e.type=R;Nt=null}e.svg=!(e.vml="VML"==e.type),e._Paper=M,e.fn=N=M.prototype=e.prototype,e._id=0,e.is=function(t,e){return e=O.call(e),"finite"==e?!at[A](+t):"array"==e?t instanceof Array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||"array"==e&&Array.isArray&&Array.isArray(t)||tt.call(t).slice(8,-1).toLowerCase()==e},e.angle=function(t,r,i,n,a,s){if(null==a){var o=t-i,l=r-n;return o||l?(180+180*Y.atan2(-l,-o)/U+360)%360:0}return e.angle(t,r,a,s)-e.angle(i,n,a,s)},e.rad=function(t){return t%360*U/180},e.deg=function(t){return Math.round(180*t/U%360*1e3)/1e3},e.snapTo=function(t,r,i){if(i=e.is(i,"finite")?i:10,e.is(t,Q)){for(var n=t.length;n--;)if(H(t[n]-r)<=i)return t[n]}else{t=+t;var a=r%t;if(a<i)return r-a;if(a>t-i)return r-a+t}return r};var zt=e.createUUID=function(t,e){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(t,e).toUpperCase()}}(/[xy]/g,function(t){var e=16*Y.random()|0,r="x"==t?e:3&e|8;return r.toString(16)});e.setWindow=function(r){t("raphael.setWindow",e,T.win,r),T.win=r,T.doc=T.win.document,e._engine.initWin&&e._engine.initWin(T.win)};var Pt=function(t){if(e.vml){var r=/^\s+|\s+$/g,i;try{var a=new ActiveXObject("htmlfile");a.write("<body>"),a.close(),i=a.body}catch(s){i=createPopup().document.body}var o=i.createTextRange();Pt=n(function(t){try{i.style.color=I(t).replace(r,R);var e=o.queryCommandValue("ForeColor");return e=(255&e)<<16|65280&e|(16711680&e)>>>16,"#"+("000000"+e.toString(16)).slice(-6)}catch(n){return"none"}})}else{var l=T.doc.createElement("i");l.title="Raphaël Colour Picker",l.style.display="none",T.doc.body.appendChild(l),Pt=n(function(t){return l.style.color=t,T.doc.defaultView.getComputedStyle(l,R).getPropertyValue("color")})}return Pt(t)},Ft=function(){return"hsb("+[this.h,this.s,this.b]+")"},Rt=function(){return"hsl("+[this.h,this.s,this.l]+")"},jt=function(){return this.hex},It=function(t,r,i){if(null==r&&e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(i=t.b,r=t.g,t=t.r),null==r&&e.is(t,Z)){var n=e.getRGB(t);t=n.r,r=n.g,i=n.b}return(t>1||r>1||i>1)&&(t/=255,r/=255,i/=255),[t,r,i]},qt=function(t,r,i,n){t*=255,r*=255,i*=255;var a={r:t,g:r,b:i,hex:e.rgb(t,r,i),toString:jt};return e.is(n,"finite")&&(a.opacity=n),a};e.color=function(t){var r;return e.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(r=e.hsb2rgb(t),t.r=r.r,t.g=r.g,t.b=r.b,t.hex=r.hex):e.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(r=e.hsl2rgb(t),t.r=r.r,t.g=r.g,t.b=r.b,t.hex=r.hex):(e.is(t,"string")&&(t=e.getRGB(t)),e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(r=e.rgb2hsl(t),t.h=r.h,t.s=r.s,t.l=r.l,r=e.rgb2hsb(t),t.v=r.b):(t={hex:"none"},t.r=t.g=t.b=t.h=t.s=t.v=t.l=-1)),t.toString=jt,t},e.hsb2rgb=function(t,e,r,i){this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(r=t.b,e=t.s,i=t.o,t=t.h),t*=360;var n,a,s,o,l;return t=t%360/60,l=r*e,o=l*(1-H(t%2-1)),n=a=s=r-l,t=~~t,n+=[l,o,0,0,o,l][t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],qt(n,a,s,i)},e.hsl2rgb=function(t,e,r,i){this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(r=t.l,e=t.s,t=t.h),(t>1||e>1||r>1)&&(t/=360,e/=100,r/=100),t*=360;var n,a,s,o,l;return t=t%360/60,l=2*e*(r<.5?r:1-r),o=l*(1-H(t%2-1)),n=a=s=r-l/2,t=~~t,n+=[l,o,0,0,o,l][t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],qt(n,a,s,i)},e.rgb2hsb=function(t,e,r){r=It(t,e,r),t=r[0],e=r[1],r=r[2];var i,n,a,s;return a=W(t,e,r),s=a-G(t,e,r),i=0==s?null:a==t?(e-r)/s:a==e?(r-t)/s+2:(t-e)/s+4,i=(i+360)%6*60/360,n=0==s?0:s/a,{h:i,s:n,b:a,toString:Ft}},e.rgb2hsl=function(t,e,r){r=It(t,e,r),t=r[0],e=r[1],r=r[2];var i,n,a,s,o,l;return s=W(t,e,r),o=G(t,e,r),l=s-o,i=0==l?null:s==t?(e-r)/l:s==e?(r-t)/l+2:(t-e)/l+4,i=(i+360)%6*60/360,a=(s+o)/2,n=0==l?0:a<.5?l/(2*a):l/(2-2*a),{h:i,s:n,l:a,toString:Rt}},e._path2string=function(){return this.join(",").replace(xt,"$1")};var Dt=e._preload=function(t,e){var r=T.doc.createElement("img");r.style.cssText="position:absolute;left:-9999em;top:-9999em",r.onload=function(){e.call(this),this.onload=null,T.doc.body.removeChild(this)},r.onerror=function(){T.doc.body.removeChild(this)},T.doc.body.appendChild(r),r.src=t};e.getRGB=n(function(t){if(!t||(t=I(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:a};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:a};!(vt[A](t.toLowerCase().substring(0,2))||"#"==t.charAt())&&(t=Pt(t));var r,i,n,s,o,l,h,u=t.match(nt);return u?(u[2]&&(s=ut(u[2].substring(5),16),n=ut(u[2].substring(3,5),16),i=ut(u[2].substring(1,3),16)),u[3]&&(s=ut((l=u[3].charAt(3))+l,16),n=ut((l=u[3].charAt(2))+l,16),i=ut((l=u[3].charAt(1))+l,16)),u[4]&&(h=u[4][q](gt),i=ht(h[0]),"%"==h[0].slice(-1)&&(i*=2.55),n=ht(h[1]),"%"==h[1].slice(-1)&&(n*=2.55),s=ht(h[2]),"%"==h[2].slice(-1)&&(s*=2.55),"rgba"==u[1].toLowerCase().slice(0,4)&&(o=ht(h[3])),h[3]&&"%"==h[3].slice(-1)&&(o/=100)),u[5]?(h=u[5][q](gt),i=ht(h[0]),"%"==h[0].slice(-1)&&(i*=2.55),n=ht(h[1]),"%"==h[1].slice(-1)&&(n*=2.55),s=ht(h[2]),"%"==h[2].slice(-1)&&(s*=2.55),("deg"==h[0].slice(-3)||"°"==h[0].slice(-1))&&(i/=360),"hsba"==u[1].toLowerCase().slice(0,4)&&(o=ht(h[3])),h[3]&&"%"==h[3].slice(-1)&&(o/=100),e.hsb2rgb(i,n,s,o)):u[6]?(h=u[6][q](gt),i=ht(h[0]),"%"==h[0].slice(-1)&&(i*=2.55),n=ht(h[1]),"%"==h[1].slice(-1)&&(n*=2.55),s=ht(h[2]),"%"==h[2].slice(-1)&&(s*=2.55),("deg"==h[0].slice(-3)||"°"==h[0].slice(-1))&&(i/=360),"hsla"==u[1].toLowerCase().slice(0,4)&&(o=ht(h[3])),h[3]&&"%"==h[3].slice(-1)&&(o/=100),e.hsl2rgb(i,n,s,o)):(u={r:i,g:n,b:s,toString:a},u.hex="#"+(16777216|s|n<<8|i<<16).toString(16).slice(1),e.is(o,"finite")&&(u.opacity=o),u)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:a}},e),e.hsb=n(function(t,r,i){return e.hsb2rgb(t,r,i).hex}),e.hsl=n(function(t,r,i){return e.hsl2rgb(t,r,i).hex}),e.rgb=n(function(t,e,r){function i(t){return t+.5|0}return"#"+(16777216|i(r)|i(e)<<8|i(t)<<16).toString(16).slice(1)}),e.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},r=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),r.hex},e.getColor.reset=function(){delete this.start},e.parsePathString=function(t){if(!t)return null;var r=Vt(t);if(r.arr)return Yt(r.arr);var i={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},n=[];return e.is(t,Q)&&e.is(t[0],Q)&&(n=Yt(t)),n.length||I(t).replace(yt,function(t,e,r){var a=[],s=e.toLowerCase();if(r.replace(bt,function(t,e){e&&a.push(+e)}),"m"==s&&a.length>2&&(n.push([e][P](a.splice(0,2))),s="l",e="m"==e?"l":"L"),"r"==s)n.push([e][P](a));else for(;a.length>=i[s]&&(n.push([e][P](a.splice(0,i[s]))),i[s]););}),n.toString=e._path2string,r.arr=Yt(n),n},e.parseTransformString=n(function(t){if(!t)return null;var r={r:3,s:4,t:2,m:6},i=[];return e.is(t,Q)&&e.is(t[0],Q)&&(i=Yt(t)),i.length||I(t).replace(mt,function(t,e,r){var n=[],a=O.call(e);r.replace(bt,function(t,e){e&&n.push(+e)}),i.push([e][P](n))}),i.toString=e._path2string,i});var Vt=function(t){var e=Vt.ps=Vt.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var r in e)e[A](r)&&r!=t&&(e[r].sleep--,!e[r].sleep&&delete e[r])}),e[t]};e.findDotsAtSegment=function(t,e,r,i,n,a,s,o,l){var h=1-l,u=X(h,3),c=X(h,2),f=l*l,p=f*l,d=u*t+3*c*l*r+3*h*l*l*n+p*s,g=u*e+3*c*l*i+3*h*l*l*a+p*o,v=t+2*l*(r-t)+f*(n-2*r+t),x=e+2*l*(i-e)+f*(a-2*i+e),y=r+2*l*(n-r)+f*(s-2*n+r),m=i+2*l*(a-i)+f*(o-2*a+i),b=h*t+l*r,_=h*e+l*i,w=h*n+l*s,k=h*a+l*o,B=90-180*Y.atan2(v-y,x-m)/U;return(v>y||x<m)&&(B+=180),{x:d,y:g,m:{x:v,y:x},n:{x:y,y:m},start:{x:b,y:_},end:{x:w,y:k},alpha:B}},e.bezierBBox=function(t,r,i,n,a,s,o,l){e.is(t,"array")||(t=[t,r,i,n,a,s,o,l]);var h=Zt.apply(null,t);return{x:h.min.x,y:h.min.y,x2:h.max.x,y2:h.max.y,width:h.max.x-h.min.x,height:h.max.y-h.min.y}},e.isPointInsideBBox=function(t,e,r){return e>=t.x&&e<=t.x2&&r>=t.y&&r<=t.y2},e.isBBoxIntersect=function(t,r){var i=e.isPointInsideBBox;return i(r,t.x,t.y)||i(r,t.x2,t.y)||i(r,t.x,t.y2)||i(r,t.x2,t.y2)||i(t,r.x,r.y)||i(t,r.x2,r.y)||i(t,r.x,r.y2)||i(t,r.x2,r.y2)||(t.x<r.x2&&t.x>r.x||r.x<t.x2&&r.x>t.x)&&(t.y<r.y2&&t.y>r.y||r.y<t.y2&&r.y>t.y)},e.pathIntersection=function(t,e){return d(t,e)},e.pathIntersectionNumber=function(t,e){return d(t,e,1)},e.isPointInsidePath=function(t,r,i){var n=e.pathBBox(t);return e.isPointInsideBBox(n,r,i)&&d(t,[["M",r,i],["H",n.x2+10]],1)%2==1},e._removedFactory=function(e){return function(){t("raphael.log",null,"Raphaël: you are calling to method “"+e+"” of removed object",e)}};var Ot=e.pathBBox=function(t){var e=Vt(t);if(e.bbox)return r(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};t=Qt(t);for(var i=0,n=0,a=[],s=[],o,l=0,h=t.length;l<h;l++)if(o=t[l],"M"==o[0])i=o[1],n=o[2],a.push(i),s.push(n);else{var u=Zt(i,n,o[1],o[2],o[3],o[4],o[5],o[6]);a=a[P](u.min.x,u.max.x),s=s[P](u.min.y,u.max.y),i=o[5],n=o[6]}var c=G[z](0,a),f=G[z](0,s),p=W[z](0,a),d=W[z](0,s),g=p-c,v=d-f,x={x:c,y:f,x2:p,y2:d,width:g,height:v,cx:c+g/2,cy:f+v/2};return e.bbox=r(x),x},Yt=function(t){var i=r(t);return i.toString=e._path2string,i},Wt=e._pathToRelative=function(t){var r=Vt(t);if(r.rel)return Yt(r.rel);e.is(t,Q)&&e.is(t&&t[0],Q)||(t=e.parsePathString(t));var i=[],n=0,a=0,s=0,o=0,l=0;"M"==t[0][0]&&(n=t[0][1],a=t[0][2],s=n,o=a,l++,i.push(["M",n,a]));for(var h=l,u=t.length;h<u;h++){var c=i[h]=[],f=t[h];if(f[0]!=O.call(f[0]))switch(c[0]=O.call(f[0]),c[0]){case"a":c[1]=f[1],c[2]=f[2],c[3]=f[3],c[4]=f[4],c[5]=f[5],c[6]=+(f[6]-n).toFixed(3),c[7]=+(f[7]-a).toFixed(3);break;case"v":c[1]=+(f[1]-a).toFixed(3);break;case"m":s=f[1],o=f[2];default:for(var p=1,d=f.length;p<d;p++)c[p]=+(f[p]-(p%2?n:a)).toFixed(3)}else{c=i[h]=[],"m"==f[0]&&(s=f[1]+n,o=f[2]+a);for(var g=0,v=f.length;g<v;g++)i[h][g]=f[g]}var x=i[h].length;switch(i[h][0]){case"z":n=s,a=o;break;case"h":n+=+i[h][x-1];break;case"v":a+=+i[h][x-1];break;default:n+=+i[h][x-2],a+=+i[h][x-1]}}return i.toString=e._path2string,r.rel=Yt(i),i},Gt=e._pathToAbsolute=function(t){var r=Vt(t);if(r.abs)return Yt(r.abs);if(e.is(t,Q)&&e.is(t&&t[0],Q)||(t=e.parsePathString(t)),!t||!t.length)return[["M",0,0]];var i=[],n=0,a=0,o=0,l=0,h=0;"M"==t[0][0]&&(n=+t[0][1],a=+t[0][2],o=n,l=a,h++,i[0]=["M",n,a]);for(var u=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),c,f,p=h,d=t.length;p<d;p++){if(i.push(c=[]),f=t[p],f[0]!=ct.call(f[0]))switch(c[0]=ct.call(f[0]),c[0]){case"A":c[1]=f[1],c[2]=f[2],c[3]=f[3],c[4]=f[4],c[5]=f[5],c[6]=+(f[6]+n),c[7]=+(f[7]+a);break;case"V":c[1]=+f[1]+a;break;case"H":c[1]=+f[1]+n;break;case"R":for(var g=[n,a][P](f.slice(1)),v=2,x=g.length;v<x;v++)g[v]=+g[v]+n,g[++v]=+g[v]+a;i.pop(),i=i[P](s(g,u));break;case"M":o=+f[1]+n,l=+f[2]+a;default:for(v=1,x=f.length;v<x;v++)c[v]=+f[v]+(v%2?n:a)}else if("R"==f[0])g=[n,a][P](f.slice(1)),i.pop(),i=i[P](s(g,u)),c=["R"][P](f.slice(-2));else for(var y=0,m=f.length;y<m;y++)c[y]=f[y];switch(c[0]){case"Z":n=o,a=l;break;case"H":n=c[1];break;case"V":a=c[1];break;case"M":o=c[c.length-2],l=c[c.length-1];default:n=c[c.length-2],a=c[c.length-1]}}return i.toString=e._path2string,r.abs=Yt(i),i},Ht=function(t,e,r,i){return[t,e,r,i,r,i]},Xt=function(t,e,r,i,n,a){var s=1/3,o=2/3;return[s*t+o*r,s*e+o*i,s*n+o*r,s*a+o*i,n,a]},Ut=function(t,e,r,i,a,s,o,l,h,u){var c=120*U/180,f=U/180*(+a||0),p=[],d,g=n(function(t,e,r){var i=t*Y.cos(r)-e*Y.sin(r),n=t*Y.sin(r)+e*Y.cos(r);return{x:i,y:n}});if(u)S=u[0],A=u[1],B=u[2],C=u[3];else{d=g(t,e,-f),t=d.x,e=d.y,d=g(l,h,-f),l=d.x,h=d.y;var v=Y.cos(U/180*a),x=Y.sin(U/180*a),y=(t-l)/2,m=(e-h)/2,b=y*y/(r*r)+m*m/(i*i);b>1&&(b=Y.sqrt(b),r=b*r,i=b*i);var _=r*r,w=i*i,k=(s==o?-1:1)*Y.sqrt(H((_*w-_*m*m-w*y*y)/(_*m*m+w*y*y))),B=k*r*m/i+(t+l)/2,C=k*-i*y/r+(e+h)/2,S=Y.asin(((e-C)/i).toFixed(9)),A=Y.asin(((h-C)/i).toFixed(9));S=t<B?U-S:S,A=l<B?U-A:A,S<0&&(S=2*U+S),A<0&&(A=2*U+A),o&&S>A&&(S-=2*U),!o&&A>S&&(A-=2*U)}var T=A-S;if(H(T)>c){var E=A,M=l,N=h;A=S+c*(o&&A>S?1:-1),l=B+r*Y.cos(A),h=C+i*Y.sin(A),p=Ut(l,h,r,i,a,0,o,M,N,[A,E,B,C])}T=A-S;var L=Y.cos(S),z=Y.sin(S),F=Y.cos(A),R=Y.sin(A),j=Y.tan(T/4),I=4/3*r*j,D=4/3*i*j,V=[t,e],O=[t+I*z,e-D*L],W=[l+I*R,h-D*F],G=[l,h];if(O[0]=2*V[0]-O[0],O[1]=2*V[1]-O[1],u)return[O,W,G][P](p);p=[O,W,G][P](p).join()[q](",");for(var X=[],$=0,Z=p.length;$<Z;$++)X[$]=$%2?g(p[$-1],p[$],f).y:g(p[$],p[$+1],f).x;return X},$t=function(t,e,r,i,n,a,s,o,l){var h=1-l;return{x:X(h,3)*t+3*X(h,2)*l*r+3*h*l*l*n+X(l,3)*s,y:X(h,3)*e+3*X(h,2)*l*i+3*h*l*l*a+X(l,3)*o}},Zt=n(function(t,e,r,i,n,a,s,o){var l=n-2*r+t-(s-2*n+r),h=2*(r-t)-2*(n-r),u=t-r,c=(-h+Y.sqrt(h*h-4*l*u))/2/l,f=(-h-Y.sqrt(h*h-4*l*u))/2/l,p=[e,o],d=[t,s],g;return H(c)>"1e12"&&(c=.5),H(f)>"1e12"&&(f=.5),c>0&&c<1&&(g=$t(t,e,r,i,n,a,s,o,c),d.push(g.x),p.push(g.y)),f>0&&f<1&&(g=$t(t,e,r,i,n,a,s,o,f),d.push(g.x),p.push(g.y)),l=a-2*i+e-(o-2*a+i),h=2*(i-e)-2*(a-i),u=e-i,c=(-h+Y.sqrt(h*h-4*l*u))/2/l,f=(-h-Y.sqrt(h*h-4*l*u))/2/l,H(c)>"1e12"&&(c=.5),H(f)>"1e12"&&(f=.5),c>0&&c<1&&(g=$t(t,e,r,i,n,a,s,o,c),d.push(g.x),p.push(g.y)),f>0&&f<1&&(g=$t(t,e,r,i,n,a,s,o,f),d.push(g.x),p.push(g.y)),{min:{x:G[z](0,d),y:G[z](0,p)},max:{x:W[z](0,d),y:W[z](0,p)}}}),Qt=e._path2curve=n(function(t,e){var r=!e&&Vt(t);if(!e&&r.curve)return Yt(r.curve);for(var i=Gt(t),n=e&&Gt(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=(function(t,e,r){var i,n,a={T:1,Q:1};if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in a)&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][P](Ut[z](0,[e.x,e.y][P](t.slice(1))));break;case"S":"C"==r||"S"==r?(i=2*e.x-e.bx,n=2*e.y-e.by):(i=e.x,n=e.y),t=["C",i,n][P](t.slice(1));break;case"T":"Q"==r||"T"==r?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"][P](Xt(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][P](Xt(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][P](Ht(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][P](Ht(e.x,e.y,t[1],e.y));break;case"V":t=["C"][P](Ht(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][P](Ht(e.x,e.y,e.X,e.Y))}return t}),l=function(t,e){if(t[e].length>7){t[e].shift();for(var r=t[e];r.length;)u[e]="A",n&&(c[e]="A"),t.splice(e++,0,["C"][P](r.splice(0,6)));t.splice(e,1),g=W(i.length,n&&n.length||0)}},h=function(t,e,r,a,s){t&&e&&"M"==t[s][0]&&"M"!=e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),r.bx=0,r.by=0,r.x=t[s][1],r.y=t[s][2],g=W(i.length,n&&n.length||0))},u=[],c=[],f="",p="",d=0,g=W(i.length,n&&n.length||0);d<g;d++){i[d]&&(f=i[d][0]),"C"!=f&&(u[d]=f,d&&(p=u[d-1])),i[d]=o(i[d],a,p),"A"!=u[d]&&"C"==f&&(u[d]="C"),l(i,d),n&&(n[d]&&(f=n[d][0]),"C"!=f&&(c[d]=f,d&&(p=c[d-1])),n[d]=o(n[d],s,p),"A"!=c[d]&&"C"==f&&(c[d]="C"),l(n,d)),h(i,n,a,s,d),h(n,i,s,a,d);var v=i[d],x=n&&n[d],y=v.length,m=n&&x.length;a.x=v[y-2],a.y=v[y-1],a.bx=ht(v[y-4])||a.x,a.by=ht(v[y-3])||a.y,s.bx=n&&(ht(x[m-4])||s.x),s.by=n&&(ht(x[m-3])||s.y),s.x=n&&x[m-2],s.y=n&&x[m-1]}return n||(r.curve=Yt(i)),n?[i,n]:i},null,Yt),Jt=e._parseDots=n(function(t){for(var r=[],i=0,n=t.length;i<n;i++){var a={},s=t[i].match(/^([^:]*):?([\d\.]*)/);if(a.color=e.getRGB(s[1]),a.color.error)return null;a.opacity=a.color.opacity,a.color=a.color.hex,s[2]&&(a.offset=s[2]+"%"),r.push(a)}for(i=1,n=r.length-1;i<n;i++)if(!r[i].offset){for(var o=ht(r[i-1].offset||0),l=0,h=i+1;h<n;h++)if(r[h].offset){l=r[h].offset;break}l||(l=100,h=n),l=ht(l);for(var u=(l-o)/(h-i+1);i<h;i++)o+=u,r[i].offset=o+"%"}return r}),Kt=e._tear=function(t,e){t==e.top&&(e.top=t.prev),t==e.bottom&&(e.bottom=t.next),t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next)},te=e._tofront=function(t,e){e.top!==t&&(Kt(t,e),t.next=null,t.prev=e.top,e.top.next=t,e.top=t)},ee=e._toback=function(t,e){e.bottom!==t&&(Kt(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},re=e._insertafter=function(t,e,r){Kt(t,r),e==r.top&&(r.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},ie=e._insertbefore=function(t,e,r){Kt(t,r),e==r.bottom&&(r.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},ne=e.toMatrix=function(t,e){var r=Ot(t),i={_:{transform:R},getBBox:function(){return r}};return se(i,e),i.matrix},ae=e.transformPath=function(t,e){return Mt(t,ne(t,e))},se=e._extractTransform=function(t,r){if(null==r)return t._.transform;r=I(r).replace(/\.{3}|\u2026/g,t._.transform||R);var i=e.parseTransformString(r),n=0,a=0,s=0,o=1,l=1,h=t._,u=new g;if(h.transform=i||[],i)for(var c=0,f=i.length;c<f;c++){var p=i[c],d=p.length,v=I(p[0]).toLowerCase(),x=p[0]!=v,y=x?u.invert():0,m,b,_,w,k;"t"==v&&3==d?x?(m=y.x(0,0),b=y.y(0,0),_=y.x(p[1],p[2]),w=y.y(p[1],p[2]),u.translate(_-m,w-b)):u.translate(p[1],p[2]):"r"==v?2==d?(k=k||t.getBBox(1),u.rotate(p[1],k.x+k.width/2,k.y+k.height/2),n+=p[1]):4==d&&(x?(_=y.x(p[2],p[3]),w=y.y(p[2],p[3]),u.rotate(p[1],_,w)):u.rotate(p[1],p[2],p[3]),n+=p[1]):"s"==v?2==d||3==d?(k=k||t.getBBox(1),u.scale(p[1],p[d-1],k.x+k.width/2,k.y+k.height/2),o*=p[1],l*=p[d-1]):5==d&&(x?(_=y.x(p[3],p[4]),w=y.y(p[3],p[4]),u.scale(p[1],p[2],_,w)):u.scale(p[1],p[2],p[3],p[4]),o*=p[1],l*=p[2]):"m"==v&&7==d&&u.add(p[1],p[2],p[3],p[4],p[5],p[6]),h.dirtyT=1,t.matrix=u}t.matrix=u,h.sx=o,h.sy=l,h.deg=n,h.dx=a=u.e,h.dy=s=u.f,1==o&&1==l&&!n&&h.bbox?(h.bbox.x+=+a,h.bbox.y+=+s):h.dirtyT=1},oe=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},le=e._equaliseTransform=function(t,r){r=I(r).replace(/\.{3}|\u2026/g,t),t=e.parseTransformString(t)||[],r=e.parseTransformString(r)||[];for(var i=W(t.length,r.length),n=[],a=[],s=0,o,l,h,u;s<i;s++){if(h=t[s]||oe(r[s]),u=r[s]||oe(h),h[0]!=u[0]||"r"==h[0].toLowerCase()&&(h[2]!=u[2]||h[3]!=u[3])||"s"==h[0].toLowerCase()&&(h[3]!=u[3]||h[4]!=u[4]))return;for(n[s]=[],a[s]=[],o=0,l=W(h.length,u.length);o<l;o++)o in h&&(n[s][o]=h[o]),o in u&&(a[s][o]=u[o])}return{from:n,to:a}};e._getContainer=function(t,r,i,n){var a;if(a=null!=n||e.is(t,"object")?t:T.doc.getElementById(t),null!=a)return a.tagName?null==r?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:r,height:i}:{container:1,x:t,y:r,width:i,height:n}},e.pathToRelative=Wt,e._engine={},e.path2curve=Qt,e.matrix=function(t,e,r,i,n,a){return new g(t,e,r,i,n,a)},function(t){function r(t){return t[0]*t[0]+t[1]*t[1]}function i(t){var e=Y.sqrt(r(t));t[0]&&(t[0]/=e),t[1]&&(t[1]/=e)}t.add=function(t,e,r,i,n,a){var s=[[],[],[]],o=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],l=[[t,r,n],[e,i,a],[0,0,1]],h,u,c,f;for(t&&t instanceof g&&(l=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),h=0;h<3;h++)for(u=0;u<3;u++){for(f=0,c=0;c<3;c++)f+=o[h][c]*l[c][u];s[h][u]=f}this.a=s[0][0],this.b=s[1][0],this.c=s[0][1],this.d=s[1][1],this.e=s[0][2],this.f=s[1][2]},t.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new g(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},t.clone=function(){return new g(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(t,e){
this.add(1,0,0,1,t,e)},t.scale=function(t,e,r,i){null==e&&(e=t),(r||i)&&this.add(1,0,0,1,r,i),this.add(t,0,0,e,0,0),(r||i)&&this.add(1,0,0,1,-r,-i)},t.rotate=function(t,r,i){t=e.rad(t),r=r||0,i=i||0;var n=+Y.cos(t).toFixed(9),a=+Y.sin(t).toFixed(9);this.add(n,a,-a,n,r,i),this.add(1,0,0,1,-r,-i)},t.x=function(t,e){return t*this.a+e*this.c+this.e},t.y=function(t,e){return t*this.b+e*this.d+this.f},t.get=function(t){return+this[I.fromCharCode(97+t)].toFixed(4)},t.toString=function(){return e.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},t.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var n=[[this.a,this.c],[this.b,this.d]];t.scalex=Y.sqrt(r(n[0])),i(n[0]),t.shear=n[0][0]*n[1][0]+n[0][1]*n[1][1],n[1]=[n[1][0]-n[0][0]*t.shear,n[1][1]-n[0][1]*t.shear],t.scaley=Y.sqrt(r(n[1])),i(n[1]),t.shear/=t.scaley;var a=-n[0][1],s=n[1][1];return s<0?(t.rotate=e.deg(Y.acos(s)),a<0&&(t.rotate=360-t.rotate)):t.rotate=e.deg(Y.asin(a)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(t){var e=t||this[q]();return e.isSimple?(e.scalex=+e.scalex.toFixed(4),e.scaley=+e.scaley.toFixed(4),e.rotate=+e.rotate.toFixed(4),(e.dx||e.dy?"t"+[e.dx,e.dy]:R)+(1!=e.scalex||1!=e.scaley?"s"+[e.scalex,e.scaley,0,0]:R)+(e.rotate?"r"+[e.rotate,0,0]:R)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(g.prototype);for(var he=function(){this.returnValue=!1},ue=function(){return this.originalEvent.preventDefault()},ce=function(){this.cancelBubble=!0},fe=function(){return this.originalEvent.stopPropagation()},pe=function(t){var e=T.doc.documentElement.scrollTop||T.doc.body.scrollTop,r=T.doc.documentElement.scrollLeft||T.doc.body.scrollLeft;return{x:t.clientX+r,y:t.clientY+e}},de=function(){return T.doc.addEventListener?function(t,e,r,i){var n=function(t){var e=pe(t);return r.call(i,t,e.x,e.y)};if(t.addEventListener(e,n,!1),F&&V[e]){var a=function(e){for(var n=pe(e),a=e,s=0,o=e.targetTouches&&e.targetTouches.length;s<o;s++)if(e.targetTouches[s].target==t){e=e.targetTouches[s],e.originalEvent=a,e.preventDefault=ue,e.stopPropagation=fe;break}return r.call(i,e,n.x,n.y)};t.addEventListener(V[e],a,!1)}return function(){return t.removeEventListener(e,n,!1),F&&V[e]&&t.removeEventListener(V[e],a,!1),!0}}:T.doc.attachEvent?function(t,e,r,i){var n=function(t){t=t||T.win.event;var e=T.doc.documentElement.scrollTop||T.doc.body.scrollTop,n=T.doc.documentElement.scrollLeft||T.doc.body.scrollLeft,a=t.clientX+n,s=t.clientY+e;return t.preventDefault=t.preventDefault||he,t.stopPropagation=t.stopPropagation||ce,r.call(i,t,a,s)};t.attachEvent("on"+e,n);var a=function(){return t.detachEvent("on"+e,n),!0};return a}:void 0}(),ge=[],ve=function(e){for(var r=e.clientX,i=e.clientY,n=T.doc.documentElement.scrollTop||T.doc.body.scrollTop,a=T.doc.documentElement.scrollLeft||T.doc.body.scrollLeft,s,o=ge.length;o--;){if(s=ge[o],F&&e.touches){for(var l=e.touches.length,h;l--;)if(h=e.touches[l],h.identifier==s.el._drag.id){r=h.clientX,i=h.clientY,(e.originalEvent?e.originalEvent:e).preventDefault();break}}else e.preventDefault();var u=s.el.node,c,f=u.nextSibling,p=u.parentNode,d=u.style.display;T.win.opera&&p.removeChild(u),u.style.display="none",c=s.el.paper.getElementByPoint(r,i),u.style.display=d,T.win.opera&&(f?p.insertBefore(u,f):p.appendChild(u)),c&&t("raphael.drag.over."+s.el.id,s.el,c),r+=a,i+=n,t("raphael.drag.move."+s.el.id,s.move_scope||s.el,r-s.el._drag.x,i-s.el._drag.y,r,i,e)}},xe=function(r){e.unmousemove(ve).unmouseup(xe);for(var i=ge.length,n;i--;)n=ge[i],n.el._drag={},t("raphael.drag.end."+n.el.id,n.end_scope||n.start_scope||n.move_scope||n.el,r);ge=[]},ye=e.el={},me=D.length;me--;)!function(t){e[t]=ye[t]=function(r,i){return e.is(r,"function")&&(this.events=this.events||[],this.events.push({name:t,f:r,unbind:de(this.shape||this.node||T.doc,t,r,i||this)})),this},e["un"+t]=ye["un"+t]=function(r){for(var i=this.events||[],n=i.length;n--;)i[n].name!=t||!e.is(r,"undefined")&&i[n].f!=r||(i[n].unbind(),i.splice(n,1),!i.length&&delete this.events);return this}}(D[me]);ye.data=function(r,i){var n=wt[this.id]=wt[this.id]||{};if(0==arguments.length)return n;if(1==arguments.length){if(e.is(r,"object")){for(var a in r)r[A](a)&&this.data(a,r[a]);return this}return t("raphael.data.get."+this.id,this,n[r],r),n[r]}return n[r]=i,t("raphael.data.set."+this.id,this,i,r),this},ye.removeData=function(t){return null==t?wt[this.id]={}:wt[this.id]&&delete wt[this.id][t],this},ye.getData=function(){return r(wt[this.id]||{})},ye.hover=function(t,e,r,i){return this.mouseover(t,r).mouseout(e,i||r)},ye.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var be=[];ye.drag=function(r,i,n,a,s,o){function l(l){(l.originalEvent||l).preventDefault();var h=l.clientX,u=l.clientY,c=T.doc.documentElement.scrollTop||T.doc.body.scrollTop,f=T.doc.documentElement.scrollLeft||T.doc.body.scrollLeft;if(this._drag.id=l.identifier,F&&l.touches)for(var p=l.touches.length,d;p--;)if(d=l.touches[p],this._drag.id=d.identifier,d.identifier==this._drag.id){h=d.clientX,u=d.clientY;break}this._drag.x=h+f,this._drag.y=u+c,!ge.length&&e.mousemove(ve).mouseup(xe),ge.push({el:this,move_scope:a,start_scope:s,end_scope:o}),i&&t.on("raphael.drag.start."+this.id,i),r&&t.on("raphael.drag.move."+this.id,r),n&&t.on("raphael.drag.end."+this.id,n),t("raphael.drag.start."+this.id,s||a||this,l.clientX+f,l.clientY+c,l)}return this._drag={},be.push({el:this,start:l}),this.mousedown(l),this},ye.onDragOver=function(e){e?t.on("raphael.drag.over."+this.id,e):t.unbind("raphael.drag.over."+this.id)},ye.undrag=function(){for(var r=be.length;r--;)be[r].el==this&&(this.unmousedown(be[r].start),be.splice(r,1),t.unbind("raphael.drag.*."+this.id));!be.length&&e.unmousemove(ve).unmouseup(xe),ge=[]},N.circle=function(t,r,i){var n=e._engine.circle(this,t||0,r||0,i||0);return this.__set__&&this.__set__.push(n),n},N.rect=function(t,r,i,n,a){var s=e._engine.rect(this,t||0,r||0,i||0,n||0,a||0);return this.__set__&&this.__set__.push(s),s},N.ellipse=function(t,r,i,n){var a=e._engine.ellipse(this,t||0,r||0,i||0,n||0);return this.__set__&&this.__set__.push(a),a},N.path=function(t){t&&!e.is(t,Z)&&!e.is(t[0],Q)&&(t+=R);var r=e._engine.path(e.format[z](e,arguments),this);return this.__set__&&this.__set__.push(r),r},N.image=function(t,r,i,n,a){var s=e._engine.image(this,t||"about:blank",r||0,i||0,n||0,a||0);return this.__set__&&this.__set__.push(s),s},N.text=function(t,r,i){var n=e._engine.text(this,t||0,r||0,I(i));return this.__set__&&this.__set__.push(n),n},N.set=function(t){!e.is(t,"array")&&(t=Array.prototype.splice.call(arguments,0,arguments.length));var r=new ze(t);return this.__set__&&this.__set__.push(r),r.paper=this,r.type="set",r},N.setStart=function(t){this.__set__=t||this.set()},N.setFinish=function(t){var e=this.__set__;return delete this.__set__,e},N.getSize=function(){var t=this.canvas.parentNode;return{width:t.offsetWidth,height:t.offsetHeight}},N.setSize=function(t,r){return e._engine.setSize.call(this,t,r)},N.setViewBox=function(t,r,i,n,a){return e._engine.setViewBox.call(this,t,r,i,n,a)},N.top=N.bottom=null,N.raphael=e;var _e=function(t){var e=t.getBoundingClientRect(),r=t.ownerDocument,i=r.body,n=r.documentElement,a=n.clientTop||i.clientTop||0,s=n.clientLeft||i.clientLeft||0,o=e.top+(T.win.pageYOffset||n.scrollTop||i.scrollTop)-a,l=e.left+(T.win.pageXOffset||n.scrollLeft||i.scrollLeft)-s;return{y:o,x:l}};N.getElementByPoint=function(t,e){var r=this,i=r.canvas,n=T.doc.elementFromPoint(t,e);if(T.win.opera&&"svg"==n.tagName){var a=_e(i),s=i.createSVGRect();s.x=t-a.x,s.y=e-a.y,s.width=s.height=1;var o=i.getIntersectionList(s,null);o.length&&(n=o[o.length-1])}if(!n)return null;for(;n.parentNode&&n!=i.parentNode&&!n.raphael;)n=n.parentNode;return n==r.canvas.parentNode&&(n=i),n=n&&n.raphael?r.getById(n.raphaelid):null},N.getElementsByBBox=function(t){var r=this.set();return this.forEach(function(i){e.isBBoxIntersect(i.getBBox(),t)&&r.push(i)}),r},N.getById=function(t){for(var e=this.bottom;e;){if(e.id==t)return e;e=e.next}return null},N.forEach=function(t,e){for(var r=this.bottom;r;){if(t.call(e,r)===!1)return this;r=r.next}return this},N.getElementsByPoint=function(t,e){var r=this.set();return this.forEach(function(i){i.isPointInside(t,e)&&r.push(i)}),r},ye.isPointInside=function(t,r){var i=this.realPath=Et[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(i=e.transformPath(i,this.attr("transform"))),e.isPointInsidePath(i,t,r)},ye.getBBox=function(t){if(this.removed)return{};var e=this._;return t?(!e.dirty&&e.bboxwt||(this.realPath=Et[this.type](this),e.bboxwt=Ot(this.realPath),e.bboxwt.toString=x,e.dirty=0),e.bboxwt):((e.dirty||e.dirtyT||!e.bbox)&&(!e.dirty&&this.realPath||(e.bboxwt=0,this.realPath=Et[this.type](this)),e.bbox=Ot(Mt(this.realPath,this.matrix)),e.bbox.toString=x,e.dirty=e.dirtyT=0),e.bbox)},ye.clone=function(){if(this.removed)return null;var t=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(t),t},ye.glow=function(t){if("text"==this.type)return null;t=t||{};var e={width:(t.width||10)+(+this.attr("stroke-width")||1),fill:t.fill||!1,opacity:null==t.opacity?.5:t.opacity,offsetx:t.offsetx||0,offsety:t.offsety||0,color:t.color||"#000"},r=e.width/2,i=this.paper,n=i.set(),a=this.realPath||Et[this.type](this);a=this.matrix?Mt(a,this.matrix):a;for(var s=1;s<r+1;s++)n.push(i.path(a).attr({stroke:e.color,fill:e.fill?e.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/r*s).toFixed(3),opacity:+(e.opacity/r).toFixed(3)}));return n.insertBefore(this).translate(e.offsetx,e.offsety)};var we={},ke=function(t,r,i,n,a,s,o,u,c){return null==c?l(t,r,i,n,a,s,o,u):e.findDotsAtSegment(t,r,i,n,a,s,o,u,h(t,r,i,n,a,s,o,u,c))},Be=function(t,r){return function(i,n,a){i=Qt(i);for(var s,o,l,h,u="",c={},f,p=0,d=0,g=i.length;d<g;d++){if(l=i[d],"M"==l[0])s=+l[1],o=+l[2];else{if(h=ke(s,o,l[1],l[2],l[3],l[4],l[5],l[6]),p+h>n){if(r&&!c.start){if(f=ke(s,o,l[1],l[2],l[3],l[4],l[5],l[6],n-p),u+=["C"+f.start.x,f.start.y,f.m.x,f.m.y,f.x,f.y],a)return u;c.start=u,u=["M"+f.x,f.y+"C"+f.n.x,f.n.y,f.end.x,f.end.y,l[5],l[6]].join(),p+=h,s=+l[5],o=+l[6];continue}if(!t&&!r)return f=ke(s,o,l[1],l[2],l[3],l[4],l[5],l[6],n-p),{x:f.x,y:f.y,alpha:f.alpha}}p+=h,s=+l[5],o=+l[6]}u+=l.shift()+l}return c.end=u,f=t?p:r?c:e.findDotsAtSegment(s,o,l[0],l[1],l[2],l[3],l[4],l[5],1),f.alpha&&(f={x:f.x,y:f.y,alpha:f.alpha}),f}},Ce=Be(1),Se=Be(),Ae=Be(0,1);e.getTotalLength=Ce,e.getPointAtLength=Se,e.getSubpath=function(t,e,r){if(this.getTotalLength(t)-r<1e-6)return Ae(t,e).end;var i=Ae(t,r,1);return e?Ae(i,e).end:i},ye.getTotalLength=function(){var t=this.getPath();if(t)return this.node.getTotalLength?this.node.getTotalLength():Ce(t)},ye.getPointAtLength=function(t){var e=this.getPath();if(e)return Se(e,t)},ye.getPath=function(){var t,r=e._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return r&&(t=r(this)),t},ye.getSubpath=function(t,r){var i=this.getPath();if(i)return e.getSubpath(i,t,r)};var Te=e.easing_formulas={linear:function(t){return t},"<":function(t){return X(t,1.7)},">":function(t){return X(t,.48)},"<>":function(t){var e=.48-t/1.04,r=Y.sqrt(.1734+e*e),i=r-e,n=X(H(i),1/3)*(i<0?-1:1),a=-r-e,s=X(H(a),1/3)*(a<0?-1:1),o=n+s+.5;return 3*(1-o)*o*o+o*o*o},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){t-=1;var e=1.70158;return t*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:X(2,-10*t)*Y.sin((t-.075)*(2*U)/.3)+1},bounce:function(t){var e=7.5625,r=2.75,i;return t<1/r?i=e*t*t:t<2/r?(t-=1.5/r,i=e*t*t+.75):t<2.5/r?(t-=2.25/r,i=e*t*t+.9375):(t-=2.625/r,i=e*t*t+.984375),i}};Te.easeIn=Te["ease-in"]=Te["<"],Te.easeOut=Te["ease-out"]=Te[">"],Te.easeInOut=Te["ease-in-out"]=Te["<>"],Te["back-in"]=Te.backIn,Te["back-out"]=Te.backOut;var Ee=[],Me=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,16)},Ne=function(){for(var r=+new Date,i=0;i<Ee.length;i++){var n=Ee[i];if(!n.el.removed&&!n.paused){var a=r-n.start,s=n.ms,o=n.easing,l=n.from,h=n.diff,u=n.to,c=n.t,f=n.el,p={},d,g={},v;if(n.initstatus?(a=(n.initstatus*n.anim.top-n.prev)/(n.percent-n.prev)*s,n.status=n.initstatus,delete n.initstatus,n.stop&&Ee.splice(i--,1)):n.status=(n.prev+(n.percent-n.prev)*(a/s))/n.anim.top,!(a<0))if(a<s){var x=o(a/s);for(var y in l)if(l[A](y)){switch(pt[y]){case $:d=+l[y]+x*s*h[y];break;case"colour":d="rgb("+[Le(ot(l[y].r+x*s*h[y].r)),Le(ot(l[y].g+x*s*h[y].g)),Le(ot(l[y].b+x*s*h[y].b))].join(",")+")";break;case"path":d=[];for(var m=0,_=l[y].length;m<_;m++){d[m]=[l[y][m][0]];for(var w=1,k=l[y][m].length;w<k;w++)d[m][w]=+l[y][m][w]+x*s*h[y][m][w];d[m]=d[m].join(j)}d=d.join(j);break;case"transform":if(h[y].real)for(d=[],m=0,_=l[y].length;m<_;m++)for(d[m]=[l[y][m][0]],w=1,k=l[y][m].length;w<k;w++)d[m][w]=l[y][m][w]+x*s*h[y][m][w];else{var B=function(t){return+l[y][t]+x*s*h[y][t]};d=[["m",B(0),B(1),B(2),B(3),B(4),B(5)]]}break;case"csv":if("clip-rect"==y)for(d=[],m=4;m--;)d[m]=+l[y][m]+x*s*h[y][m];break;default:var C=[][P](l[y]);for(d=[],m=f.paper.customAttributes[y].length;m--;)d[m]=+C[m]+x*s*h[y][m]}p[y]=d}f.attr(p),function(e,r,i){setTimeout(function(){t("raphael.anim.frame."+e,r,i)})}(f.id,f,n.anim)}else{if(function(r,i,n){setTimeout(function(){t("raphael.anim.frame."+i.id,i,n),t("raphael.anim.finish."+i.id,i,n),e.is(r,"function")&&r.call(i)})}(n.callback,f,n.anim),f.attr(u),Ee.splice(i--,1),n.repeat>1&&!n.next){for(v in u)u[A](v)&&(g[v]=n.totalOrigin[v]);n.el.attr(g),b(n.anim,n.el,n.anim.percents[0],null,n.totalOrigin,n.repeat-1)}n.next&&!n.stop&&b(n.anim,n.el,n.next,null,n.totalOrigin,n.repeat)}}}Ee.length&&Me(Ne)},Le=function(t){return t>255?255:t<0?0:t};ye.animateWith=function(t,r,i,n,a,s){var o=this;if(o.removed)return s&&s.call(o),o;var l=i instanceof m?i:e.animation(i,n,a,s),h,u;b(l,o,l.percents[0],null,o.attr());for(var c=0,f=Ee.length;c<f;c++)if(Ee[c].anim==r&&Ee[c].el==t){Ee[f-1].start=Ee[c].start;break}return o},ye.onAnimation=function(e){return e?t.on("raphael.anim.frame."+this.id,e):t.unbind("raphael.anim.frame."+this.id),this},m.prototype.delay=function(t){var e=new m(this.anim,this.ms);return e.times=this.times,e.del=+t||0,e},m.prototype.repeat=function(t){var e=new m(this.anim,this.ms);return e.del=this.del,e.times=Y.floor(W(t,0))||1,e},e.animation=function(t,r,i,n){if(t instanceof m)return t;!e.is(i,"function")&&i||(n=n||i||null,i=null),t=Object(t),r=+r||0;var a={},s,o;for(o in t)t[A](o)&&ht(o)!=o&&ht(o)+"%"!=o&&(s=!0,a[o]=t[o]);if(s)return i&&(a.easing=i),n&&(a.callback=n),new m({100:a},r);if(n){var l=0;for(var h in t){var u=ut(h);t[A](h)&&u>l&&(l=u)}l+="%",!t[l].callback&&(t[l].callback=n)}return new m(t,r)},ye.animate=function(t,r,i,n){var a=this;if(a.removed)return n&&n.call(a),a;var s=t instanceof m?t:e.animation(t,r,i,n);return b(s,a,s.percents[0],null,a.attr()),a},ye.setTime=function(t,e){return t&&null!=e&&this.status(t,G(e,t.ms)/t.ms),this},ye.status=function(t,e){var r=[],i=0,n,a;if(null!=e)return b(t,this,-1,G(e,1)),this;for(n=Ee.length;i<n;i++)if(a=Ee[i],a.el.id==this.id&&(!t||a.anim==t)){if(t)return a.status;r.push({anim:a.anim,status:a.status})}return t?0:r},ye.pause=function(e){for(var r=0;r<Ee.length;r++)Ee[r].el.id!=this.id||e&&Ee[r].anim!=e||t("raphael.anim.pause."+this.id,this,Ee[r].anim)!==!1&&(Ee[r].paused=!0);return this},ye.resume=function(e){for(var r=0;r<Ee.length;r++)if(Ee[r].el.id==this.id&&(!e||Ee[r].anim==e)){var i=Ee[r];t("raphael.anim.resume."+this.id,this,i.anim)!==!1&&(delete i.paused,this.status(i.anim,i.status))}return this},ye.stop=function(e){for(var r=0;r<Ee.length;r++)Ee[r].el.id!=this.id||e&&Ee[r].anim!=e||t("raphael.anim.stop."+this.id,this,Ee[r].anim)!==!1&&Ee.splice(r--,1);return this},t.on("raphael.remove",_),t.on("raphael.clear",_),ye.toString=function(){return"Raphaël’s object"};var ze=function(t){if(this.items=[],this.length=0,this.type="set",t)for(var e=0,r=t.length;e<r;e++)!t[e]||t[e].constructor!=ye.constructor&&t[e].constructor!=ze||(this[this.items.length]=this.items[this.items.length]=t[e],this.length++)},Pe=ze.prototype;Pe.push=function(){for(var t,e,r=0,i=arguments.length;r<i;r++)t=arguments[r],!t||t.constructor!=ye.constructor&&t.constructor!=ze||(e=this.items.length,this[e]=this.items[e]=t,this.length++);return this},Pe.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},Pe.forEach=function(t,e){for(var r=0,i=this.items.length;r<i;r++)if(t.call(e,this.items[r],r)===!1)return this;return this};for(var Fe in ye)ye[A](Fe)&&(Pe[Fe]=function(t){return function(){var e=arguments;return this.forEach(function(r){r[t][z](r,e)})}}(Fe));return Pe.attr=function(t,r){if(t&&e.is(t,Q)&&e.is(t[0],"object"))for(var i=0,n=t.length;i<n;i++)this.items[i].attr(t[i]);else for(var a=0,s=this.items.length;a<s;a++)this.items[a].attr(t,r);return this},Pe.clear=function(){for(;this.length;)this.pop()},Pe.splice=function(t,e,r){t=t<0?W(this.length+t,0):t,e=W(0,G(this.length-t,e));var i=[],n=[],a=[],s;for(s=2;s<arguments.length;s++)a.push(arguments[s]);for(s=0;s<e;s++)n.push(this[t+s]);for(;s<this.length-t;s++)i.push(this[t+s]);var o=a.length;for(s=0;s<o+i.length;s++)this.items[t+s]=this[t+s]=s<o?a[s]:i[s-o];for(s=this.items.length=this.length-=e-o;this[s];)delete this[s++];return new ze(n)},Pe.exclude=function(t){for(var e=0,r=this.length;e<r;e++)if(this[e]==t)return this.splice(e,1),!0},Pe.animate=function(t,r,i,n){(e.is(i,"function")||!i)&&(n=i||null);var a=this.items.length,s=a,o,l=this,h;if(!a)return this;n&&(h=function(){!--a&&n.call(l)}),i=e.is(i,Z)?i:h;var u=e.animation(t,r,i,h);for(o=this.items[--s].animate(u);s--;)this.items[s]&&!this.items[s].removed&&this.items[s].animateWith(o,u,u),this.items[s]&&!this.items[s].removed||a--;return this},Pe.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},Pe.getBBox=function(){for(var t=[],e=[],r=[],i=[],n=this.items.length;n--;)if(!this.items[n].removed){var a=this.items[n].getBBox();t.push(a.x),e.push(a.y),r.push(a.x+a.width),i.push(a.y+a.height)}return t=G[z](0,t),e=G[z](0,e),r=W[z](0,r),i=W[z](0,i),{x:t,y:e,x2:r,y2:i,width:r-t,height:i-e}},Pe.clone=function(t){t=this.paper.set();for(var e=0,r=this.items.length;e<r;e++)t.push(this.items[e].clone());return t},Pe.toString=function(){return"Raphaël‘s set"},Pe.glow=function(t){var e=this.paper.set();return this.forEach(function(r,i){var n=r.glow(t);null!=n&&n.forEach(function(t,r){e.push(t)})}),e},Pe.isPointInside=function(t,e){var r=!1;return this.forEach(function(i){if(i.isPointInside(t,e))return r=!0,!1}),r},e.registerFont=function(t){if(!t.face)return t;this.fonts=this.fonts||{};var e={w:t.w,face:{},glyphs:{}},r=t.face["font-family"];for(var i in t.face)t.face[A](i)&&(e.face[i]=t.face[i]);if(this.fonts[r]?this.fonts[r].push(e):this.fonts[r]=[e],!t.svg){e.face["units-per-em"]=ut(t.face["units-per-em"],10);for(var n in t.glyphs)if(t.glyphs[A](n)){var a=t.glyphs[n];if(e.glyphs[n]={w:a.w,k:{},d:a.d&&"M"+a.d.replace(/[mlcxtrv]/g,function(t){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[t]||"M"})+"z"},a.k)for(var s in a.k)a[A](s)&&(e.glyphs[n].k[s]=a.k[s])}}return t},N.getFont=function(t,r,i,n){if(n=n||"normal",i=i||"normal",r=+r||{normal:400,bold:700,lighter:300,bolder:800}[r]||400,e.fonts){var a=e.fonts[t];if(!a){var s=new RegExp("(^|\\s)"+t.replace(/[^\w\d\s+!~.:_-]/g,R)+"(\\s|$)","i");for(var o in e.fonts)if(e.fonts[A](o)&&s.test(o)){a=e.fonts[o];break}}var l;if(a)for(var h=0,u=a.length;h<u&&(l=a[h],l.face["font-weight"]!=r||l.face["font-style"]!=i&&l.face["font-style"]||l.face["font-stretch"]!=n);h++);return l}},N.print=function(t,r,i,n,a,s,o,l){s=s||"middle",o=W(G(o||0,1),-1),l=W(G(l||1,3),1);var h=I(i)[q](R),u=0,c=0,f=R,p;if(e.is(n,"string")&&(n=this.getFont(n)),n){p=(a||16)/n.face["units-per-em"];for(var d=n.face.bbox[q](k),g=+d[0],v=d[3]-d[1],x=0,y=+d[1]+("baseline"==s?v+ +n.face.descent:v/2),m=0,b=h.length;m<b;m++){if("\n"==h[m])u=0,w=0,c=0,x+=v*l;else{var _=c&&n.glyphs[h[m-1]]||{},w=n.glyphs[h[m]];u+=c?(_.w||n.w)+(_.k&&_.k[h[m]]||0)+n.w*o:0,c=1}w&&w.d&&(f+=e.transformPath(w.d,["t",u*p,x*p,"s",p,p,g,y,"t",(t-g)/p,(r-y)/p]))}}return this.path(f).attr({fill:"#000",stroke:"none"})},N.add=function(t){if(e.is(t,"array"))for(var r=this.set(),i=0,n=t.length,a;i<n;i++)a=t[i]||{},B[A](a.type)&&r.push(this[a.type]().attr(a));return r},e.format=function(t,r){var i=e.is(r,Q)?[0][P](r):arguments;return t&&e.is(t,Z)&&i.length-1&&(t=t.replace(C,function(t,e){return null==i[++e]?R:i[e]})),t||R},e.fullfill=function(){var t=/\{([^\}]+)\}/g,e=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,r=function(t,r,i){var n=i;return r.replace(e,function(t,e,r,i,a){e=e||i,n&&(e in n&&(n=n[e]),"function"==typeof n&&a&&(n=n()))}),n=(null==n||n==i?t:n)+""};return function(e,i){return String(e).replace(t,function(t,e){return r(t,e,i)})}}(),e.ninja=function(){if(E.was)T.win.Raphael=E.is;else{window.Raphael=void 0;try{delete window.Raphael}catch(t){}}return e},e.st=Pe,t.on("raphael.DOMload",function(){w=!0}),function(t,r,i){function n(){/in/.test(t.readyState)?setTimeout(n,9):e.eve("raphael.DOMload")}null==t.readyState&&t.addEventListener&&(t.addEventListener(r,i=function(){t.removeEventListener(r,i,!1),t.readyState="complete"},!1),t.readyState="loading"),n()}(document,"DOMContentLoaded"),e}.apply(e,i),!(void 0!==n&&(t.exports=n))},function(t,e,r){var i,n;!function(r){var a="0.5.0",s="hasOwnProperty",o=/[\.\/]/,l=/\s*,\s*/,h="*",u=function(){},c=function(t,e){return t-e},f,p,d={n:{}},g=function(){for(var t=0,e=this.length;t<e;t++)if("undefined"!=typeof this[t])return this[t]},v=function(){for(var t=this.length;--t;)if("undefined"!=typeof this[t])return this[t]},x=Object.prototype.toString,y=String,m=Array.isArray||function(t){return t instanceof Array||"[object Array]"==x.call(t)};eve=function(t,e){var r=d,i=p,n=Array.prototype.slice.call(arguments,2),a=eve.listeners(t),s=0,o=!1,l,h=[],u={},x=[],y=f,m=[];x.firstDefined=g,x.lastDefined=v,f=t,p=0;for(var b=0,_=a.length;b<_;b++)"zIndex"in a[b]&&(h.push(a[b].zIndex),a[b].zIndex<0&&(u[a[b].zIndex]=a[b]));for(h.sort(c);h[s]<0;)if(l=u[h[s++]],x.push(l.apply(e,n)),p)return p=i,x;for(b=0;b<_;b++)if(l=a[b],"zIndex"in l)if(l.zIndex==h[s]){if(x.push(l.apply(e,n)),p)break;do if(s++,l=u[h[s]],l&&x.push(l.apply(e,n)),p)break;while(l)}else u[l.zIndex]=l;else if(x.push(l.apply(e,n)),p)break;return p=i,f=y,x},eve._events=d,eve.listeners=function(t){var e=m(t)?t:t.split(o),r=d,i,n,a,s,l,u,c,f,p=[r],g=[];for(s=0,l=e.length;s<l;s++){for(f=[],u=0,c=p.length;u<c;u++)for(r=p[u].n,n=[r[e[s]],r[h]],a=2;a--;)i=n[a],i&&(f.push(i),g=g.concat(i.f||[]));p=f}return g},eve.separator=function(t){t?(t=y(t).replace(/(?=[\.\^\]\[\-])/g,"\\"),t="["+t+"]",o=new RegExp(t)):o=/[\.\/]/},eve.on=function(t,e){if("function"!=typeof e)return function(){};for(var r=m(t)?m(t[0])?t:[t]:y(t).split(l),i=0,n=r.length;i<n;i++)!function(t){for(var r=m(t)?t:y(t).split(o),i=d,n,a=0,s=r.length;a<s;a++)i=i.n,i=i.hasOwnProperty(r[a])&&i[r[a]]||(i[r[a]]={n:{}});for(i.f=i.f||[],a=0,s=i.f.length;a<s;a++)if(i.f[a]==e){n=!0;break}!n&&i.f.push(e)}(r[i]);return function(t){+t==+t&&(e.zIndex=+t)}},eve.f=function(t){var e=[].slice.call(arguments,1);return function(){eve.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},eve.stop=function(){p=1},eve.nt=function(t){var e=m(f)?f.join("."):f;return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},eve.nts=function(){return m(f)?f:f.split(o)},eve.off=eve.unbind=function(t,e){if(!t)return void(eve._events=d={n:{}});var r=m(t)?m(t[0])?t:[t]:y(t).split(l);if(r.length>1)for(var i=0,n=r.length;i<n;i++)eve.off(r[i],e);else{r=m(t)?t:y(t).split(o);var a,u,c,i,n,f,p,g=[d];for(i=0,n=r.length;i<n;i++)for(f=0;f<g.length;f+=c.length-2){if(c=[f,1],a=g[f].n,r[i]!=h)a[r[i]]&&c.push(a[r[i]]);else for(u in a)a[s](u)&&c.push(a[u]);g.splice.apply(g,c)}for(i=0,n=g.length;i<n;i++)for(a=g[i];a.n;){if(e){if(a.f){for(f=0,p=a.f.length;f<p;f++)if(a.f[f]==e){a.f.splice(f,1);break}!a.f.length&&delete a.f}for(u in a.n)if(a.n[s](u)&&a.n[u].f){var v=a.n[u].f;for(f=0,p=v.length;f<p;f++)if(v[f]==e){v.splice(f,1);break}!v.length&&delete a.n[u].f}}else{delete a.f;for(u in a.n)a.n[s](u)&&a.n[u].f&&delete a.n[u].f}a=a.n}}},eve.once=function(t,e){var r=function(){return eve.off(t,r),e.apply(this,arguments)};return eve.on(t,r)},eve.version=a,eve.toString=function(){return"You are running Eve "+a},"undefined"!=typeof t&&t.exports?t.exports=eve:(i=[],n=function(){return eve}.apply(e,i),!(void 0!==n&&(t.exports=n)))}(this)},function(t,e,r){var i,n;i=[r(1)],n=function(t){if(!t||t.svg){var e="hasOwnProperty",r=String,i=parseFloat,n=parseInt,a=Math,s=a.max,o=a.abs,l=a.pow,h=/[, ]+/,u=t.eve,c="",f=" ",p="http://www.w3.org/1999/xlink",d={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},g={};t.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var v=function(i,n){if(n){"string"==typeof i&&(i=v(i));for(var a in n)n[e](a)&&("xlink:"==a.substring(0,6)?i.setAttributeNS(p,a.substring(6),r(n[a])):i.setAttribute(a,r(n[a])))}else i=t._g.doc.createElementNS("http://www.w3.org/2000/svg",i),i.style&&(i.style.webkitTapHighlightColor="rgba(0,0,0,0)");return i},x=function(e,n){var h="linear",u=e.id+n,f=.5,p=.5,d=e.node,g=e.paper,x=d.style,y=t._g.doc.getElementById(u);if(!y){if(n=r(n).replace(t._radial_gradient,function(t,e,r){if(h="radial",e&&r){f=i(e),p=i(r);var n=2*(p>.5)-1;l(f-.5,2)+l(p-.5,2)>.25&&(p=a.sqrt(.25-l(f-.5,2))*n+.5)&&.5!=p&&(p=p.toFixed(5)-1e-5*n)}return c}),n=n.split(/\s*\-\s*/),"linear"==h){var b=n.shift();if(b=-i(b),isNaN(b))return null;var _=[0,0,a.cos(t.rad(b)),a.sin(t.rad(b))],w=1/(s(o(_[2]),o(_[3]))||1);_[2]*=w,_[3]*=w,_[2]<0&&(_[0]=-_[2],_[2]=0),_[3]<0&&(_[1]=-_[3],_[3]=0)}var k=t._parseDots(n);if(!k)return null;if(u=u.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&u!=e.gradient.id&&(g.defs.removeChild(e.gradient),delete e.gradient),!e.gradient){y=v(h+"Gradient",{id:u}),e.gradient=y,v(y,"radial"==h?{fx:f,fy:p}:{x1:_[0],y1:_[1],x2:_[2],y2:_[3],gradientTransform:e.matrix.invert()}),g.defs.appendChild(y);for(var B=0,C=k.length;B<C;B++)y.appendChild(v("stop",{offset:k[B].offset?k[B].offset:B?"100%":"0%","stop-color":k[B].color||"#fff","stop-opacity":isFinite(k[B].opacity)?k[B].opacity:1}))}}return v(d,{fill:m(u),opacity:1,"fill-opacity":1}),x.fill=c,x.opacity=1,x.fillOpacity=1,1},y=function(){var t=document.documentMode;return t&&(9===t||10===t)},m=function(t){if(y())return"url('#"+t+"')";var e=document.location,r=e.protocol+"//"+e.host+e.pathname+e.search;return"url('"+r+"#"+t+"')"},b=function(t){var e=t.getBBox(1);v(t.pattern,{patternTransform:t.matrix.invert()+" translate("+e.x+","+e.y+")"})},_=function(i,n,a){if("path"==i.type){for(var s=r(n).toLowerCase().split("-"),o=i.paper,l=a?"end":"start",h=i.node,u=i.attrs,f=u["stroke-width"],p=s.length,x="classic",y,m,b,_,w,k=3,B=3,C=5;p--;)switch(s[p]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":x=s[p];break;case"wide":B=5;break;case"narrow":B=2;break;case"long":k=5;break;case"short":k=2}if("open"==x?(k+=2,B+=2,C+=2,b=1,_=a?4:1,w={fill:"none",stroke:u.stroke}):(_=b=k/2,w={fill:u.stroke,stroke:"none"}),i._.arrows?a?(i._.arrows.endPath&&g[i._.arrows.endPath]--,i._.arrows.endMarker&&g[i._.arrows.endMarker]--):(i._.arrows.startPath&&g[i._.arrows.startPath]--,i._.arrows.startMarker&&g[i._.arrows.startMarker]--):i._.arrows={},"none"!=x){var S="raphael-marker-"+x,A="raphael-marker-"+l+x+k+B+"-obj"+i.id;t._g.doc.getElementById(S)?g[S]++:(o.defs.appendChild(v(v("path"),{"stroke-linecap":"round",d:d[x],id:S})),g[S]=1);var T=t._g.doc.getElementById(A),E;T?(g[A]++,E=T.getElementsByTagName("use")[0]):(T=v(v("marker"),{id:A,markerHeight:B,markerWidth:k,orient:"auto",refX:_,refY:B/2}),E=v(v("use"),{"xlink:href":"#"+S,transform:(a?"rotate(180 "+k/2+" "+B/2+") ":c)+"scale("+k/C+","+B/C+")","stroke-width":(1/((k/C+B/C)/2)).toFixed(4)}),T.appendChild(E),o.defs.appendChild(T),g[A]=1),v(E,w);var M=b*("diamond"!=x&&"oval"!=x);a?(y=i._.arrows.startdx*f||0,m=t.getTotalLength(u.path)-M*f):(y=M*f,m=t.getTotalLength(u.path)-(i._.arrows.enddx*f||0)),w={},w["marker-"+l]="url(#"+A+")",(m||y)&&(w.d=t.getSubpath(u.path,y,m)),v(h,w),i._.arrows[l+"Path"]=S,i._.arrows[l+"Marker"]=A,i._.arrows[l+"dx"]=M,i._.arrows[l+"Type"]=x,i._.arrows[l+"String"]=n}else a?(y=i._.arrows.startdx*f||0,m=t.getTotalLength(u.path)-y):(y=0,m=t.getTotalLength(u.path)-(i._.arrows.enddx*f||0)),i._.arrows[l+"Path"]&&v(h,{d:t.getSubpath(u.path,y,m)}),delete i._.arrows[l+"Path"],delete i._.arrows[l+"Marker"],delete i._.arrows[l+"dx"],delete i._.arrows[l+"Type"],delete i._.arrows[l+"String"];for(w in g)if(g[e](w)&&!g[w]){var N=t._g.doc.getElementById(w);N&&N.parentNode.removeChild(N)}}},w={"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},k=function(t,e,i){if(e=w[r(e).toLowerCase()]){for(var n=t.attrs["stroke-width"]||"1",a={round:n,square:n,butt:0}[t.attrs["stroke-linecap"]||i["stroke-linecap"]]||0,s=[],o=e.length;o--;)s[o]=e[o]*n+(o%2?1:-1)*a;v(t.node,{"stroke-dasharray":s.join(",")})}else v(t.node,{"stroke-dasharray":"none"})},B=function(i,a){var l=i.node,u=i.attrs,f=l.style.visibility;l.style.visibility="hidden";for(var d in a)if(a[e](d)){if(!t._availableAttrs[e](d))continue;var g=a[d];switch(u[d]=g,d){case"blur":i.blur(g);break;case"title":var y=l.getElementsByTagName("title");if(y.length&&(y=y[0]))y.firstChild.nodeValue=g;else{y=v("title");var m=t._g.doc.createTextNode(g);y.appendChild(m),l.appendChild(y)}break;case"href":case"target":var w=l.parentNode;if("a"!=w.tagName.toLowerCase()){var B=v("a");w.insertBefore(B,l),B.appendChild(l),w=B}"target"==d?w.setAttributeNS(p,"show","blank"==g?"new":g):w.setAttributeNS(p,d,g);break;case"cursor":l.style.cursor=g;break;case"transform":i.transform(g);break;case"arrow-start":_(i,g);break;case"arrow-end":_(i,g,1);break;case"clip-rect":var C=r(g).split(h);if(4==C.length){i.clip&&i.clip.parentNode.parentNode.removeChild(i.clip.parentNode);var A=v("clipPath"),T=v("rect");A.id=t.createUUID(),v(T,{x:C[0],y:C[1],width:C[2],height:C[3]}),A.appendChild(T),i.paper.defs.appendChild(A),v(l,{"clip-path":"url(#"+A.id+")"}),i.clip=T}if(!g){var E=l.getAttribute("clip-path");if(E){var M=t._g.doc.getElementById(E.replace(/(^url\(#|\)$)/g,c));M&&M.parentNode.removeChild(M),v(l,{"clip-path":c}),delete i.clip}}break;case"path":"path"==i.type&&(v(l,{d:g?u.path=t._pathToAbsolute(g):"M0,0"}),i._.dirty=1,i._.arrows&&("startString"in i._.arrows&&_(i,i._.arrows.startString),"endString"in i._.arrows&&_(i,i._.arrows.endString,1)));break;case"width":if(l.setAttribute(d,g),i._.dirty=1,!u.fx)break;d="x",g=u.x;case"x":u.fx&&(g=-u.x-(u.width||0));case"rx":if("rx"==d&&"rect"==i.type)break;case"cx":l.setAttribute(d,g),i.pattern&&b(i),i._.dirty=1;break;case"height":if(l.setAttribute(d,g),i._.dirty=1,!u.fy)break;d="y",g=u.y;case"y":u.fy&&(g=-u.y-(u.height||0));case"ry":if("ry"==d&&"rect"==i.type)break;case"cy":l.setAttribute(d,g),i.pattern&&b(i),i._.dirty=1;break;case"r":"rect"==i.type?v(l,{rx:g,ry:g}):l.setAttribute(d,g),i._.dirty=1;break;case"src":"image"==i.type&&l.setAttributeNS(p,"href",g);break;case"stroke-width":1==i._.sx&&1==i._.sy||(g/=s(o(i._.sx),o(i._.sy))||1),i.paper._vbSize&&(g*=i.paper._vbSize),l.setAttribute(d,g),
u["stroke-dasharray"]&&k(i,u["stroke-dasharray"],a),i._.arrows&&("startString"in i._.arrows&&_(i,i._.arrows.startString),"endString"in i._.arrows&&_(i,i._.arrows.endString,1));break;case"stroke-dasharray":k(i,g,a);break;case"fill":var N=r(g).match(t._ISURL);if(N){A=v("pattern");var L=v("image");A.id=t.createUUID(),v(A,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),v(L,{x:0,y:0,"xlink:href":N[1]}),A.appendChild(L),function(e){t._preload(N[1],function(){var t=this.offsetWidth,r=this.offsetHeight;v(e,{width:t,height:r}),v(L,{width:t,height:r})})}(A),i.paper.defs.appendChild(A),v(l,{fill:"url(#"+A.id+")"}),i.pattern=A,i.pattern&&b(i);break}var z=t.getRGB(g);if(z.error){if(("circle"==i.type||"ellipse"==i.type||"r"!=r(g).charAt())&&x(i,g)){if("opacity"in u||"fill-opacity"in u){var P=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,c));if(P){var F=P.getElementsByTagName("stop");v(F[F.length-1],{"stop-opacity":("opacity"in u?u.opacity:1)*("fill-opacity"in u?u["fill-opacity"]:1)})}}u.gradient=g,u.fill="none";break}}else delete a.gradient,delete u.gradient,!t.is(u.opacity,"undefined")&&t.is(a.opacity,"undefined")&&v(l,{opacity:u.opacity}),!t.is(u["fill-opacity"],"undefined")&&t.is(a["fill-opacity"],"undefined")&&v(l,{"fill-opacity":u["fill-opacity"]});z[e]("opacity")&&v(l,{"fill-opacity":z.opacity>1?z.opacity/100:z.opacity});case"stroke":z=t.getRGB(g),l.setAttribute(d,z.hex),"stroke"==d&&z[e]("opacity")&&v(l,{"stroke-opacity":z.opacity>1?z.opacity/100:z.opacity}),"stroke"==d&&i._.arrows&&("startString"in i._.arrows&&_(i,i._.arrows.startString),"endString"in i._.arrows&&_(i,i._.arrows.endString,1));break;case"gradient":("circle"==i.type||"ellipse"==i.type||"r"!=r(g).charAt())&&x(i,g);break;case"opacity":u.gradient&&!u[e]("stroke-opacity")&&v(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){P=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,c)),P&&(F=P.getElementsByTagName("stop"),v(F[F.length-1],{"stop-opacity":g}));break}default:"font-size"==d&&(g=n(g,10)+"px");var R=d.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[R]=g,i._.dirty=1,l.setAttribute(d,g)}}S(i,a),l.style.visibility=f},C=1.2,S=function(i,a){if("text"==i.type&&(a[e]("text")||a[e]("font")||a[e]("font-size")||a[e]("x")||a[e]("y"))){var s=i.attrs,o=i.node,l=o.firstChild?n(t._g.doc.defaultView.getComputedStyle(o.firstChild,c).getPropertyValue("font-size"),10):10;if(a[e]("text")){for(s.text=a.text;o.firstChild;)o.removeChild(o.firstChild);for(var h=r(a.text).split("\n"),u=[],f,p=0,d=h.length;p<d;p++)f=v("tspan"),p&&v(f,{dy:l*C,x:s.x}),f.appendChild(t._g.doc.createTextNode(h[p])),o.appendChild(f),u[p]=f}else for(u=o.getElementsByTagName("tspan"),p=0,d=u.length;p<d;p++)p?v(u[p],{dy:l*C,x:s.x}):v(u[0],{dy:0});v(o,{x:s.x,y:s.y}),i._.dirty=1;var g=i._getBBox(),x=s.y-(g.y+8*g.height/10);g.height&&x&&t.is(x,"finite")&&v(u[0],{dy:x})}},A=function(t){return t.parentNode&&"a"===t.parentNode.tagName.toLowerCase()?t.parentNode:t},T=function(e,r){function i(){return("0000"+(Math.random()*Math.pow(36,5)<<0).toString(36)).slice(-5)}var n=0,a=0;this[0]=this.node=e,e.raphael=!0,this.id=i(),e.raphaelid=this.id,this.matrix=t.matrix(),this.realPath=null,this.paper=r,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!r.bottom&&(r.bottom=this),this.prev=r.top,r.top&&(r.top.next=this),r.top=this,this.next=null},E=t.el;T.prototype=E,E.constructor=T,t._engine.path=function(t,e){var r=v("path");e.canvas&&e.canvas.appendChild(r);var i=new T(r,e);return i.type="path",B(i,{fill:"none",stroke:"#000",path:t}),i},E.rotate=function(t,e,n){if(this.removed)return this;if(t=r(t).split(h),t.length-1&&(e=i(t[1]),n=i(t[2])),t=i(t[0]),null==n&&(e=n),null==e||null==n){var a=this.getBBox(1);e=a.x+a.width/2,n=a.y+a.height/2}return this.transform(this._.transform.concat([["r",t,e,n]])),this},E.scale=function(t,e,n,a){if(this.removed)return this;if(t=r(t).split(h),t.length-1&&(e=i(t[1]),n=i(t[2]),a=i(t[3])),t=i(t[0]),null==e&&(e=t),null==a&&(n=a),null==n||null==a)var s=this.getBBox(1);return n=null==n?s.x+s.width/2:n,a=null==a?s.y+s.height/2:a,this.transform(this._.transform.concat([["s",t,e,n,a]])),this},E.translate=function(t,e){return this.removed?this:(t=r(t).split(h),t.length-1&&(e=i(t[1])),t=i(t[0])||0,e=+e||0,this.transform(this._.transform.concat([["t",t,e]])),this)},E.transform=function(r){var i=this._;if(null==r)return i.transform;if(t._extractTransform(this,r),this.clip&&v(this.clip,{transform:this.matrix.invert()}),this.pattern&&b(this),this.node&&v(this.node,{transform:this.matrix}),1!=i.sx||1!=i.sy){var n=this.attrs[e]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":n})}return this},E.hide=function(){return this.removed||(this.node.style.display="none"),this},E.show=function(){return this.removed||(this.node.style.display=""),this},E.remove=function(){var e=A(this.node);if(!this.removed&&e.parentNode){var r=this.paper;r.__set__&&r.__set__.exclude(this),u.unbind("raphael.*.*."+this.id),this.gradient&&r.defs.removeChild(this.gradient),t._tear(this,r),e.parentNode.removeChild(e),this.removeData();for(var i in this)this[i]="function"==typeof this[i]?t._removedFactory(i):null;this.removed=!0}},E._getBBox=function(){if("none"==this.node.style.display){this.show();var t=!0}var e=!1,r;this.paper.canvas.parentElement?r=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(r=this.paper.canvas.parentNode.style),r&&"none"==r.display&&(e=!0,r.display="");var i={};try{i=this.node.getBBox()}catch(n){i={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{i=i||{},e&&(r.display="none")}return t&&this.hide(),i},E.attr=function(r,i){if(this.removed)return this;if(null==r){var n={};for(var a in this.attrs)this.attrs[e](a)&&(n[a]=this.attrs[a]);return n.gradient&&"none"==n.fill&&(n.fill=n.gradient)&&delete n.gradient,n.transform=this._.transform,n}if(null==i&&t.is(r,"string")){if("fill"==r&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==r)return this._.transform;for(var s=r.split(h),o={},l=0,c=s.length;l<c;l++)r=s[l],r in this.attrs?o[r]=this.attrs[r]:t.is(this.paper.customAttributes[r],"function")?o[r]=this.paper.customAttributes[r].def:o[r]=t._availableAttrs[r];return c-1?o:o[s[0]]}if(null==i&&t.is(r,"array")){for(o={},l=0,c=r.length;l<c;l++)o[r[l]]=this.attr(r[l]);return o}if(null!=i){var f={};f[r]=i}else null!=r&&t.is(r,"object")&&(f=r);for(var p in f)u("raphael.attr."+p+"."+this.id,this,f[p]);for(p in this.paper.customAttributes)if(this.paper.customAttributes[e](p)&&f[e](p)&&t.is(this.paper.customAttributes[p],"function")){var d=this.paper.customAttributes[p].apply(this,[].concat(f[p]));this.attrs[p]=f[p];for(var g in d)d[e](g)&&(f[g]=d[g])}return B(this,f),this},E.toFront=function(){if(this.removed)return this;var e=A(this.node);e.parentNode.appendChild(e);var r=this.paper;return r.top!=this&&t._tofront(this,r),this},E.toBack=function(){if(this.removed)return this;var e=A(this.node),r=e.parentNode;r.insertBefore(e,r.firstChild),t._toback(this,this.paper);var i=this.paper;return this},E.insertAfter=function(e){if(this.removed||!e)return this;var r=A(this.node),i=A(e.node||e[e.length-1].node);return i.nextSibling?i.parentNode.insertBefore(r,i.nextSibling):i.parentNode.appendChild(r),t._insertafter(this,e,this.paper),this},E.insertBefore=function(e){if(this.removed||!e)return this;var r=A(this.node),i=A(e.node||e[0].node);return i.parentNode.insertBefore(r,i),t._insertbefore(this,e,this.paper),this},E.blur=function(e){var r=this;if(0!==+e){var i=v("filter"),n=v("feGaussianBlur");r.attrs.blur=e,i.id=t.createUUID(),v(n,{stdDeviation:+e||1.5}),i.appendChild(n),r.paper.defs.appendChild(i),r._blur=i,v(r.node,{filter:"url(#"+i.id+")"})}else r._blur&&(r._blur.parentNode.removeChild(r._blur),delete r._blur,delete r.attrs.blur),r.node.removeAttribute("filter");return r},t._engine.circle=function(t,e,r,i){var n=v("circle");t.canvas&&t.canvas.appendChild(n);var a=new T(n,t);return a.attrs={cx:e,cy:r,r:i,fill:"none",stroke:"#000"},a.type="circle",v(n,a.attrs),a},t._engine.rect=function(t,e,r,i,n,a){var s=v("rect");t.canvas&&t.canvas.appendChild(s);var o=new T(s,t);return o.attrs={x:e,y:r,width:i,height:n,rx:a||0,ry:a||0,fill:"none",stroke:"#000"},o.type="rect",v(s,o.attrs),o},t._engine.ellipse=function(t,e,r,i,n){var a=v("ellipse");t.canvas&&t.canvas.appendChild(a);var s=new T(a,t);return s.attrs={cx:e,cy:r,rx:i,ry:n,fill:"none",stroke:"#000"},s.type="ellipse",v(a,s.attrs),s},t._engine.image=function(t,e,r,i,n,a){var s=v("image");v(s,{x:r,y:i,width:n,height:a,preserveAspectRatio:"none"}),s.setAttributeNS(p,"href",e),t.canvas&&t.canvas.appendChild(s);var o=new T(s,t);return o.attrs={x:r,y:i,width:n,height:a,src:e},o.type="image",o},t._engine.text=function(e,r,i,n){var a=v("text");e.canvas&&e.canvas.appendChild(a);var s=new T(a,e);return s.attrs={x:r,y:i,"text-anchor":"middle",text:n,"font-family":t._availableAttrs["font-family"],"font-size":t._availableAttrs["font-size"],stroke:"none",fill:"#000"},s.type="text",B(s,s.attrs),s},t._engine.setSize=function(t,e){return this.width=t||this.width,this.height=e||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},t._engine.create=function(){var e=t._getContainer.apply(0,arguments),r=e&&e.container,i=e.x,n=e.y,a=e.width,s=e.height;if(!r)throw new Error("SVG container not found.");var o=v("svg"),l="overflow:hidden;",h;return i=i||0,n=n||0,a=a||512,s=s||342,v(o,{height:s,version:1.1,width:a,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),1==r?(o.style.cssText=l+"position:absolute;left:"+i+"px;top:"+n+"px",t._g.doc.body.appendChild(o),h=1):(o.style.cssText=l+"position:relative",r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),r=new t._Paper,r.width=a,r.height=s,r.canvas=o,r.clear(),r._left=r._top=0,h&&(r.renderfix=function(){}),r.renderfix(),r},t._engine.setViewBox=function(t,e,r,i,n){u("raphael.setViewBox",this,this._viewBox,[t,e,r,i,n]);var a=this.getSize(),o=s(r/a.width,i/a.height),l=this.top,h=n?"xMidYMid meet":"xMinYMin",c,p;for(null==t?(this._vbSize&&(o=1),delete this._vbSize,c="0 0 "+this.width+f+this.height):(this._vbSize=o,c=t+f+e+f+r+f+i),v(this.canvas,{viewBox:c,preserveAspectRatio:h});o&&l;)p="stroke-width"in l.attrs?l.attrs["stroke-width"]:1,l.attr({"stroke-width":p}),l._.dirty=1,l._.dirtyT=1,l=l.prev;return this._viewBox=[t,e,r,i,!!n],this},t.prototype.renderfix=function(){var t=this.canvas,e=t.style,r;try{r=t.getScreenCTM()||t.createSVGMatrix()}catch(i){r=t.createSVGMatrix()}var n=-r.e%1,a=-r.f%1;(n||a)&&(n&&(this._left=(this._left+n)%1,e.left=this._left+"px"),a&&(this._top=(this._top+a)%1,e.top=this._top+"px"))},t.prototype.clear=function(){t.eve("raphael.clear",this);for(var e=this.canvas;e.firstChild;)e.removeChild(e.firstChild);this.bottom=this.top=null,(this.desc=v("desc")).appendChild(t._g.doc.createTextNode("Created with Raphaël "+t.version)),e.appendChild(this.desc),e.appendChild(this.defs=v("defs"))},t.prototype.remove=function(){u("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null};var M=t.st;for(var N in E)E[e](N)&&!M[e](N)&&(M[N]=function(t){return function(){var e=arguments;return this.forEach(function(r){r[t].apply(r,e)})}}(N))}}.apply(e,i),!(void 0!==n&&(t.exports=n))},function(t,e,r){var i,n;i=[r(1)],n=function(t){if(!t||t.vml){var e="hasOwnProperty",r=String,i=parseFloat,n=Math,a=n.round,s=n.max,o=n.min,l=n.abs,h="fill",u=/[, ]+/,c=t.eve,f=" progid:DXImageTransform.Microsoft",p=" ",d="",g={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},v=/([clmz]),?([^clmz]*)/gi,x=/ progid:\S+Blur\([^\)]+\)/g,y=/-?[^,\s-]+/g,m="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",b=21600,_={path:1,rect:1,image:1},w={circle:1,ellipse:1},k=function(e){var i=/[ahqstv]/gi,n=t._pathToAbsolute;if(r(e).match(i)&&(n=t._path2curve),i=/[clmz]/g,n==t._pathToAbsolute&&!r(e).match(i)){var s=r(e).replace(v,function(t,e,r){var i=[],n="m"==e.toLowerCase(),s=g[e];return r.replace(y,function(t){n&&2==i.length&&(s+=i+g["m"==e?"l":"L"],i=[]),i.push(a(t*b))}),s+i});return s}var o=n(e),l,h;s=[];for(var u=0,c=o.length;u<c;u++){l=o[u],h=o[u][0].toLowerCase(),"z"==h&&(h="x");for(var f=1,x=l.length;f<x;f++)h+=a(l[f]*b)+(f!=x-1?",":d);s.push(h)}return s.join(p)},B=function(e,r,i){var n=t.matrix();return n.rotate(-e,.5,.5),{dx:n.x(r,i),dy:n.y(r,i)}},C=function(t,e,r,i,n,a){var s=t._,o=t.matrix,u=s.fillpos,c=t.node,f=c.style,d=1,g="",v,x=b/e,y=b/r;if(f.visibility="hidden",e&&r){if(c.coordsize=l(x)+p+l(y),f.rotation=a*(e*r<0?-1:1),a){var m=B(a,i,n);i=m.dx,n=m.dy}if(e<0&&(g+="x"),r<0&&(g+=" y")&&(d=-1),f.flip=g,c.coordorigin=i*-x+p+n*-y,u||s.fillsize){var _=c.getElementsByTagName(h);_=_&&_[0],c.removeChild(_),u&&(m=B(a,o.x(u[0],u[1]),o.y(u[0],u[1])),_.position=m.dx*d+p+m.dy*d),s.fillsize&&(_.size=s.fillsize[0]*l(e)+p+s.fillsize[1]*l(r)),c.appendChild(_)}f.visibility="visible"}};t.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var S=function(t,e,i){for(var n=r(e).toLowerCase().split("-"),a=i?"end":"start",s=n.length,o="classic",l="medium",h="medium";s--;)switch(n[s]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":o=n[s];break;case"wide":case"narrow":h=n[s];break;case"long":case"short":l=n[s]}var u=t.node.getElementsByTagName("stroke")[0];u[a+"arrow"]=o,u[a+"arrowlength"]=l,u[a+"arrowwidth"]=h},A=function(n,l){n.attrs=n.attrs||{};var c=n.node,f=n.attrs,g=c.style,v,x=_[n.type]&&(l.x!=f.x||l.y!=f.y||l.width!=f.width||l.height!=f.height||l.cx!=f.cx||l.cy!=f.cy||l.rx!=f.rx||l.ry!=f.ry||l.r!=f.r),y=w[n.type]&&(f.cx!=l.cx||f.cy!=l.cy||f.r!=l.r||f.rx!=l.rx||f.ry!=l.ry),m=n;for(var B in l)l[e](B)&&(f[B]=l[B]);if(x&&(f.path=t._getPath[n.type](n),n._.dirty=1),l.href&&(c.href=l.href),l.title&&(c.title=l.title),l.target&&(c.target=l.target),l.cursor&&(g.cursor=l.cursor),"blur"in l&&n.blur(l.blur),(l.path&&"path"==n.type||x)&&(c.path=k(~r(f.path).toLowerCase().indexOf("r")?t._pathToAbsolute(f.path):f.path),n._.dirty=1,"image"==n.type&&(n._.fillpos=[f.x,f.y],n._.fillsize=[f.width,f.height],C(n,1,1,0,0,0))),"transform"in l&&n.transform(l.transform),y){var A=+f.cx,E=+f.cy,M=+f.rx||+f.r||0,L=+f.ry||+f.r||0;c.path=t.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",a((A-M)*b),a((E-L)*b),a((A+M)*b),a((E+L)*b),a(A*b)),n._.dirty=1}if("clip-rect"in l){var z=r(l["clip-rect"]).split(u);if(4==z.length){z[2]=+z[2]+ +z[0],z[3]=+z[3]+ +z[1];var P=c.clipRect||t._g.doc.createElement("div"),F=P.style;F.clip=t.format("rect({1}px {2}px {3}px {0}px)",z),c.clipRect||(F.position="absolute",F.top=0,F.left=0,F.width=n.paper.width+"px",F.height=n.paper.height+"px",c.parentNode.insertBefore(P,c),P.appendChild(c),c.clipRect=P)}l["clip-rect"]||c.clipRect&&(c.clipRect.style.clip="auto")}if(n.textpath){var R=n.textpath.style;l.font&&(R.font=l.font),l["font-family"]&&(R.fontFamily='"'+l["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,d)+'"'),l["font-size"]&&(R.fontSize=l["font-size"]),l["font-weight"]&&(R.fontWeight=l["font-weight"]),l["font-style"]&&(R.fontStyle=l["font-style"])}if("arrow-start"in l&&S(m,l["arrow-start"]),"arrow-end"in l&&S(m,l["arrow-end"],1),null!=l.opacity||null!=l.fill||null!=l.src||null!=l.stroke||null!=l["stroke-width"]||null!=l["stroke-opacity"]||null!=l["fill-opacity"]||null!=l["stroke-dasharray"]||null!=l["stroke-miterlimit"]||null!=l["stroke-linejoin"]||null!=l["stroke-linecap"]){var j=c.getElementsByTagName(h),I=!1;if(j=j&&j[0],!j&&(I=j=N(h)),"image"==n.type&&l.src&&(j.src=l.src),l.fill&&(j.on=!0),null!=j.on&&"none"!=l.fill&&null!==l.fill||(j.on=!1),j.on&&l.fill){var q=r(l.fill).match(t._ISURL);if(q){j.parentNode==c&&c.removeChild(j),j.rotate=!0,j.src=q[1],j.type="tile";var D=n.getBBox(1);j.position=D.x+p+D.y,n._.fillpos=[D.x,D.y],t._preload(q[1],function(){n._.fillsize=[this.offsetWidth,this.offsetHeight]})}else j.color=t.getRGB(l.fill).hex,j.src=d,j.type="solid",t.getRGB(l.fill).error&&(m.type in{circle:1,ellipse:1}||"r"!=r(l.fill).charAt())&&T(m,l.fill,j)&&(f.fill="none",f.gradient=l.fill,j.rotate=!1)}if("fill-opacity"in l||"opacity"in l){var V=((+f["fill-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+t.getRGB(l.fill).o+1||2)-1);V=o(s(V,0),1),j.opacity=V,j.src&&(j.color="none")}c.appendChild(j);var O=c.getElementsByTagName("stroke")&&c.getElementsByTagName("stroke")[0],Y=!1;!O&&(Y=O=N("stroke")),(l.stroke&&"none"!=l.stroke||l["stroke-width"]||null!=l["stroke-opacity"]||l["stroke-dasharray"]||l["stroke-miterlimit"]||l["stroke-linejoin"]||l["stroke-linecap"])&&(O.on=!0),("none"==l.stroke||null===l.stroke||null==O.on||0==l.stroke||0==l["stroke-width"])&&(O.on=!1);var W=t.getRGB(l.stroke);O.on&&l.stroke&&(O.color=W.hex),V=((+f["stroke-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+W.o+1||2)-1);var G=.75*(i(l["stroke-width"])||1);if(V=o(s(V,0),1),null==l["stroke-width"]&&(G=f["stroke-width"]),l["stroke-width"]&&(O.weight=G),G&&G<1&&(V*=G)&&(O.weight=1),O.opacity=V,l["stroke-linejoin"]&&(O.joinstyle=l["stroke-linejoin"]||"miter"),O.miterlimit=l["stroke-miterlimit"]||8,l["stroke-linecap"]&&(O.endcap="butt"==l["stroke-linecap"]?"flat":"square"==l["stroke-linecap"]?"square":"round"),"stroke-dasharray"in l){var H={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};O.dashstyle=H[e](l["stroke-dasharray"])?H[l["stroke-dasharray"]]:d}Y&&c.appendChild(O)}if("text"==m.type){m.paper.canvas.style.display=d;var X=m.paper.span,U=100,$=f.font&&f.font.match(/\d+(?:\.\d*)?(?=px)/);g=X.style,f.font&&(g.font=f.font),f["font-family"]&&(g.fontFamily=f["font-family"]),f["font-weight"]&&(g.fontWeight=f["font-weight"]),f["font-style"]&&(g.fontStyle=f["font-style"]),$=i(f["font-size"]||$&&$[0])||10,g.fontSize=$*U+"px",m.textpath.string&&(X.innerHTML=r(m.textpath.string).replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>"));var Z=X.getBoundingClientRect();m.W=f.w=(Z.right-Z.left)/U,m.H=f.h=(Z.bottom-Z.top)/U,m.X=f.x,m.Y=f.y+m.H/2,("x"in l||"y"in l)&&(m.path.v=t.format("m{0},{1}l{2},{1}",a(f.x*b),a(f.y*b),a(f.x*b)+1));for(var Q=["x","y","text","font","font-family","font-weight","font-style","font-size"],J=0,K=Q.length;J<K;J++)if(Q[J]in l){m._.dirty=1;break}switch(f["text-anchor"]){case"start":m.textpath.style["v-text-align"]="left",m.bbx=m.W/2;break;case"end":m.textpath.style["v-text-align"]="right",m.bbx=-m.W/2;break;default:m.textpath.style["v-text-align"]="center",m.bbx=0}m.textpath.style["v-text-kern"]=!0}},T=function(e,a,s){e.attrs=e.attrs||{};var o=e.attrs,l=Math.pow,h,u,c="linear",f=".5 .5";if(e.attrs.gradient=a,a=r(a).replace(t._radial_gradient,function(t,e,r){return c="radial",e&&r&&(e=i(e),r=i(r),l(e-.5,2)+l(r-.5,2)>.25&&(r=n.sqrt(.25-l(e-.5,2))*(2*(r>.5)-1)+.5),f=e+p+r),d}),a=a.split(/\s*\-\s*/),"linear"==c){var g=a.shift();if(g=-i(g),isNaN(g))return null}var v=t._parseDots(a);if(!v)return null;if(e=e.shape||e.node,v.length){e.removeChild(s),s.on=!0,s.method="none",s.color=v[0].color,s.color2=v[v.length-1].color;for(var x=[],y=0,m=v.length;y<m;y++)v[y].offset&&x.push(v[y].offset+p+v[y].color);s.colors=x.length?x.join():"0% "+s.color,"radial"==c?(s.type="gradientTitle",s.focus="100%",s.focussize="0 0",s.focusposition=f,s.angle=0):(s.type="gradient",s.angle=(270-g)%360),e.appendChild(s)}return 1},E=function(e,r){this[0]=this.node=e,e.raphael=!0,this.id=t._oid++,e.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=r,this.matrix=t.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!r.bottom&&(r.bottom=this),this.prev=r.top,r.top&&(r.top.next=this),r.top=this,this.next=null},M=t.el;E.prototype=M,M.constructor=E,M.transform=function(e){if(null==e)return this._.transform;var i=this.paper._viewBoxShift,n=i?"s"+[i.scale,i.scale]+"-1-1t"+[i.dx,i.dy]:d,a;i&&(a=e=r(e).replace(/\.{3}|\u2026/g,this._.transform||d)),t._extractTransform(this,n+e);var s=this.matrix.clone(),o=this.skew,l=this.node,h,u=~r(this.attrs.fill).indexOf("-"),c=!r(this.attrs.fill).indexOf("url(");if(s.translate(1,1),c||u||"image"==this.type)if(o.matrix="1 0 0 1",o.offset="0 0",h=s.split(),u&&h.noRotation||!h.isSimple){l.style.filter=s.toFilter();var f=this.getBBox(),g=this.getBBox(1),v=f.x-g.x,x=f.y-g.y;l.coordorigin=v*-b+p+x*-b,C(this,1,1,v,x,0)}else l.style.filter=d,C(this,h.scalex,h.scaley,h.dx,h.dy,h.rotate);else l.style.filter=d,o.matrix=r(s),o.offset=s.offset();return null!==a&&(this._.transform=a,t._extractTransform(this,a)),this},M.rotate=function(t,e,n){if(this.removed)return this;if(null!=t){if(t=r(t).split(u),t.length-1&&(e=i(t[1]),n=i(t[2])),t=i(t[0]),null==n&&(e=n),null==e||null==n){var a=this.getBBox(1);e=a.x+a.width/2,n=a.y+a.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",t,e,n]])),this}},M.translate=function(t,e){return this.removed?this:(t=r(t).split(u),t.length-1&&(e=i(t[1])),t=i(t[0])||0,e=+e||0,this._.bbox&&(this._.bbox.x+=t,this._.bbox.y+=e),this.transform(this._.transform.concat([["t",t,e]])),this)},M.scale=function(t,e,n,a){if(this.removed)return this;if(t=r(t).split(u),t.length-1&&(e=i(t[1]),n=i(t[2]),a=i(t[3]),isNaN(n)&&(n=null),isNaN(a)&&(a=null)),t=i(t[0]),null==e&&(e=t),null==a&&(n=a),null==n||null==a)var s=this.getBBox(1);return n=null==n?s.x+s.width/2:n,a=null==a?s.y+s.height/2:a,this.transform(this._.transform.concat([["s",t,e,n,a]])),this._.dirtyT=1,this},M.hide=function(){return!this.removed&&(this.node.style.display="none"),this},M.show=function(){return!this.removed&&(this.node.style.display=d),this},M.auxGetBBox=t.el.getBBox,M.getBBox=function(){var t=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var e={},r=1/this.paper._viewBoxShift.scale;return e.x=t.x-this.paper._viewBoxShift.dx,e.x*=r,e.y=t.y-this.paper._viewBoxShift.dy,e.y*=r,e.width=t.width*r,e.height=t.height*r,e.x2=e.x+e.width,e.y2=e.y+e.height,e}return t},M._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},M.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),t.eve.unbind("raphael.*.*."+this.id),t._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;this.removed=!0}},M.attr=function(r,i){if(this.removed)return this;if(null==r){var n={};for(var a in this.attrs)this.attrs[e](a)&&(n[a]=this.attrs[a]);return n.gradient&&"none"==n.fill&&(n.fill=n.gradient)&&delete n.gradient,n.transform=this._.transform,n}if(null==i&&t.is(r,"string")){if(r==h&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var s=r.split(u),o={},l=0,f=s.length;l<f;l++)r=s[l],r in this.attrs?o[r]=this.attrs[r]:t.is(this.paper.customAttributes[r],"function")?o[r]=this.paper.customAttributes[r].def:o[r]=t._availableAttrs[r];return f-1?o:o[s[0]]}if(this.attrs&&null==i&&t.is(r,"array")){for(o={},l=0,f=r.length;l<f;l++)o[r[l]]=this.attr(r[l]);return o}var p;null!=i&&(p={},p[r]=i),null==i&&t.is(r,"object")&&(p=r);for(var d in p)c("raphael.attr."+d+"."+this.id,this,p[d]);if(p){for(d in this.paper.customAttributes)if(this.paper.customAttributes[e](d)&&p[e](d)&&t.is(this.paper.customAttributes[d],"function")){var g=this.paper.customAttributes[d].apply(this,[].concat(p[d]));this.attrs[d]=p[d];for(var v in g)g[e](v)&&(p[v]=g[v])}p.text&&"text"==this.type&&(this.textpath.string=p.text),A(this,p)}return this},M.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&t._tofront(this,this.paper),this},M.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),t._toback(this,this.paper)),this)},M.insertAfter=function(e){return this.removed?this:(e.constructor==t.st.constructor&&(e=e[e.length-1]),e.node.nextSibling?e.node.parentNode.insertBefore(this.node,e.node.nextSibling):e.node.parentNode.appendChild(this.node),t._insertafter(this,e,this.paper),this)},M.insertBefore=function(e){return this.removed?this:(e.constructor==t.st.constructor&&(e=e[0]),e.node.parentNode.insertBefore(this.node,e.node),t._insertbefore(this,e,this.paper),this)},M.blur=function(e){var r=this.node.runtimeStyle,i=r.filter;return i=i.replace(x,d),0!==+e?(this.attrs.blur=e,r.filter=i+p+f+".Blur(pixelradius="+(+e||1.5)+")",r.margin=t.format("-{0}px 0 0 -{0}px",a(+e||1.5))):(r.filter=i,r.margin=0,delete this.attrs.blur),this},t._engine.path=function(t,e){var r=N("shape");r.style.cssText=m,r.coordsize=b+p+b,r.coordorigin=e.coordorigin;var i=new E(r,e),n={fill:"none",stroke:"#000"};t&&(n.path=t),i.type="path",i.path=[],i.Path=d,A(i,n),e.canvas&&e.canvas.appendChild(r);var a=N("skew");return a.on=!0,r.appendChild(a),i.skew=a,i.transform(d),i},t._engine.rect=function(e,r,i,n,a,s){var o=t._rectPath(r,i,n,a,s),l=e.path(o),h=l.attrs;return l.X=h.x=r,l.Y=h.y=i,l.W=h.width=n,l.H=h.height=a,h.r=s,h.path=o,l.type="rect",l},t._engine.ellipse=function(t,e,r,i,n){var a=t.path(),s=a.attrs;return a.X=e-i,a.Y=r-n,a.W=2*i,a.H=2*n,a.type="ellipse",A(a,{cx:e,cy:r,rx:i,ry:n}),a},t._engine.circle=function(t,e,r,i){var n=t.path(),a=n.attrs;return n.X=e-i,n.Y=r-i,n.W=n.H=2*i,n.type="circle",A(n,{cx:e,cy:r,r:i}),n},t._engine.image=function(e,r,i,n,a,s){var o=t._rectPath(i,n,a,s),l=e.path(o).attr({stroke:"none"}),u=l.attrs,c=l.node,f=c.getElementsByTagName(h)[0];return u.src=r,l.X=u.x=i,l.Y=u.y=n,l.W=u.width=a,l.H=u.height=s,u.path=o,l.type="image",f.parentNode==c&&c.removeChild(f),f.rotate=!0,f.src=r,f.type="tile",l._.fillpos=[i,n],l._.fillsize=[a,s],c.appendChild(f),C(l,1,1,0,0,0),l},t._engine.text=function(e,i,n,s){var o=N("shape"),l=N("path"),h=N("textpath");i=i||0,n=n||0,s=s||"",l.v=t.format("m{0},{1}l{2},{1}",a(i*b),a(n*b),a(i*b)+1),l.textpathok=!0,h.string=r(s),h.on=!0,o.style.cssText=m,o.coordsize=b+p+b,o.coordorigin="0 0";var u=new E(o,e),c={fill:"#000",stroke:"none",font:t._availableAttrs.font,text:s};u.shape=o,u.path=l,u.textpath=h,u.type="text",u.attrs.text=r(s),u.attrs.x=i,u.attrs.y=n,u.attrs.w=1,u.attrs.h=1,A(u,c),o.appendChild(h),o.appendChild(l),e.canvas.appendChild(o);var f=N("skew");return f.on=!0,o.appendChild(f),u.skew=f,u.transform(d),u},t._engine.setSize=function(e,r){var i=this.canvas.style;return this.width=e,this.height=r,e==+e&&(e+="px"),r==+r&&(r+="px"),i.width=e,i.height=r,i.clip="rect(0 "+e+" "+r+" 0)",this._viewBox&&t._engine.setViewBox.apply(this,this._viewBox),this},t._engine.setViewBox=function(e,r,i,n,a){t.eve("raphael.setViewBox",this,this._viewBox,[e,r,i,n,a]);var o=this.width,l=this.height,h=1/s(i/o,n/l),u,c;return a&&(u=l/n,c=o/i,i*u<o&&(e-=(o-i*u)/2/u),n*c<l&&(r-=(l-n*c)/2/c)),this._viewBox=[e,r,i,n,!!a],this._viewBoxShift={dx:-e,dy:-r,scale:h},this.forEach(function(t){t.transform("")}),this};var N;t._engine.initWin=function(t){var e=t.document;e.styleSheets.length<31?e.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):e.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!e.namespaces.rvml&&e.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),N=function(t){return e.createElement("<rvml:"+t+' class="rvml">')}}catch(r){N=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},t._engine.initWin(t._g.win),t._engine.create=function(){var e=t._getContainer.apply(0,arguments),r=e.container,i=e.height,n,a=e.width,s=e.x,o=e.y;if(!r)throw new Error("VML container not found.");var l=new t._Paper,h=l.canvas=t._g.doc.createElement("div"),u=h.style;return s=s||0,o=o||0,a=a||512,i=i||342,l.width=a,l.height=i,a==+a&&(a+="px"),i==+i&&(i+="px"),l.coordsize=1e3*b+p+1e3*b,l.coordorigin="0 0",l.span=t._g.doc.createElement("span"),l.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",h.appendChild(l.span),u.cssText=t.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",a,i),1==r?(t._g.doc.body.appendChild(h),u.left=s+"px",u.top=o+"px",u.position="absolute"):r.firstChild?r.insertBefore(h,r.firstChild):r.appendChild(h),l.renderfix=function(){},l},t.prototype.clear=function(){t.eve("raphael.clear",this),this.canvas.innerHTML=d,this.span=t._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},t.prototype.remove=function(){t.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;return!0};var L=t.st;for(var z in M)M[e](z)&&!L[e](z)&&(L[z]=function(t){return function(){var e=arguments;return this.forEach(function(r){r[t].apply(r,e)})}}(z))}}.apply(e,i),!(void 0!==n&&(t.exports=n))}])});
/*-----/js/toast/tui.chart/raphael.min.js / end -----*/

/*-----/js/toast/tui.chart/chart.min.js / start -----*/

!function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=t,i.c=e,i.p="/dist/",i(0)}([function(t,e,i){"use strict";var n=i(2),o=i(3),a=i(7),r=i(8),s=i(10),h=i(11),u=i(12),l=i(13);function c(t,e,i,a){var s,l,c,d;return e||(e={}),e.table&&(e=u.makeDataWithTable(e.table)),e.series||(e.series=[]),e=h.deepCopy(e),"combo"!==a&&(d=e.series,e.series={},e.series[a]=d),(i=i?h.deepCopy(i):{}).chartType=a,s=i.theme||n.DEFAULT_THEME_NAME,l=r.get(s,a,e.series),(c=o.get(i.chartType,e,l,i)).render(t),c.animateChart(),c}i(15),i(17),i(18),i(123),tui.util.defineNamespace("tui.chart"),tui.chart.barChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_BAR)},tui.chart.columnChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_COLUMN)},tui.chart.lineChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_LINE)},tui.chart.areaChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_AREA)},tui.chart.bubbleChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_BUBBLE)},tui.chart.scatterChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_SCATTER)},tui.chart.heatmapChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_HEATMAP)},tui.chart.treemapChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_TREEMAP)},tui.chart.comboChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_COMBO)},tui.chart.pieChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_PIE)},tui.chart.mapChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_MAP)},tui.chart.radialChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_RADIAL)},tui.chart.boxplotChart=function(t,e,i){return c(t,e,i,n.CHART_TYPE_BOXPLOT)},tui.chart.registerTheme=function(t,e){r.register(t,e)},tui.chart.registerMap=function(t,e){s.register(t,e)},tui.chart.registerPlugin=function(t,e,i){a.register(t,e),l.addRendererType(t,i)},i(124)},,function(t,e){"use strict";var i={CLASS_NAME_LEGEND_LABEL:"tui-chart-legend-label",CLASS_NAME_LEGEND_CHECKBOX:"tui-chart-legend-checkbox",CLASS_NAME_SERIES_LABEL:"tui-chart-series-label",CLASS_NAME_SERIES_LEGEND:"tui-chart-series-legend",CLASS_NAME_RESET_ZOOM_BTN:"tui-chart-reset-zoom-btn",CLASS_NAME_CHART_EXPORT_MENU_AREA:"tui-chart-chartExportMenu-area",CLASS_NAME_CHART_EXPORT_MENU_ITEM:"tui-chart-chartExportMenu-item",CLASS_NAME_CHART_EXPORT_MENU_BUTTON:"tui-chart-chartExportMenu-button",CHART_TYPE_BAR:"bar",CHART_TYPE_COLUMN:"column",CHART_TYPE_LINE:"line",CHART_TYPE_AREA:"area",CHART_TYPE_COMBO:"combo",CHART_TYPE_COLUMN_LINE_COMBO:"columnLineCombo",CHART_TYPE_LINE_SCATTER_COMBO:"lineScatterCombo",CHART_TYPE_LINE_AREA_COMBO:"lineAreaCombo",CHART_TYPE_PIE_DONUT_COMBO:"pieDonutCombo",CHART_TYPE_PIE:"pie",CHART_TYPE_BUBBLE:"bubble",CHART_TYPE_SCATTER:"scatter",CHART_TYPE_HEATMAP:"heatmap",CHART_TYPE_TREEMAP:"treemap",CHART_TYPE_MAP:"map",CHART_TYPE_RADIAL:"radial",CHART_TYPE_BOXPLOT:"boxplot",CHART_PADDING:10,CHART_DEFAULT_WIDTH:500,CHART_DEFAULT_HEIGHT:400,OVERLAPPING_WIDTH:1,TEXT_PADDING:2,SERIES_EXPAND_SIZE:10,SERIES_LABEL_PADDING:5,DEFAULT_TITLE_FONT_SIZE:14,DEFAULT_AXIS_TITLE_FONT_SIZE:10,DEFAULT_LABEL_FONT_SIZE:12,DEFAULT_SERIES_LABEL_FONT_SIZE:11,DEFAULT_PLUGIN:"Raphael",DEFAULT_TICK_COLOR:"black",DEFAULT_THEME_NAME:"default",MAX_HEIGHT_WORLD:"A",NORMAL_STACK_TYPE:"normal",PERCENT_STACK_TYPE:"percent",DEFAULT_STACK:"___DEFAULT___STACK___",DUMMY_KEY:"___DUMMY___KEY___",TREEMAP_ROOT_ID:"___TUI_TREEMAP_ROOT___",TREEMAP_ID_PREFIX:"___TUI_TREEMAP_ID___",TREEMAP_DEPTH_KEY_PREFIX:"___TUI_TREEMAP_DEPTH___",TREEMAP_PARENT_KEY_PREFIX:"___TUI_TREEMAP_PARENT___",TREEMAP_LEAF_KEY_PREFIX:"___TUI_TREEMAP_LEAF___",TREEMAP_LIMIT_DEPTH_KEY_PREFIX:"___TUI_TREEMAP_LIMIT_DEPTH___",TREEMAP_DEFAULT_BORDER:"#ccc",EMPTY_AXIS_LABEL:"",ANGLE_85:85,ANGLE_90:90,ANGLE_360:360,RAD:Math.PI/180,RERENDER_TIME:700,ADDING_DATA_ANIMATION_DURATION:300,LABEL_ALIGN_OUTER:"outer",LEGEND_ALIGN_TOP:"top",LEGEND_ALIGN_BOTTOM:"bottom",LEGEND_ALIGN_LEFT:"left",SERIES_OUTER_LABEL_PADDING:20,PIE_GRAPH_DEFAULT_RATIO:.9,PIE_GRAPH_SMALL_RATIO:.75,SPECTRUM_LEGEND_TICK_COUNT:4,MAP_CHART_LABEL_DEFAULT_POSITION_RATIO:{x:.5,y:.5},DOT_RADIUS:4,SCATTER_RADIUS:5,THEME_PROPS_MAP:{yAxis:["tickColor","title","label"],series:["label","colors","borderColor","borderWidth","selectionColor","startColor","endColor","overColor","dot"]},TITLE_AREA_WIDTH_PADDING:20,XAXIS_LABEL_TOP_MARGIN:10,V_LABEL_RIGHT_PADDING:10,TOOLTIP_PREFIX:"tui-chart-tooltip",TOOLTIP_ZINDEX:500,TOOLTIP_ANIMATION_TIME:100,TOOLTIP_PIE_ANIMATION_TIME:50,MIN_PIXEL_TYPE_STEP_SIZE:45,MAX_PIXEL_TYPE_STEP_SIZE:65,PERCENT_STACKED_AXIS_SCALE:{limit:{min:0,max:100},step:25,labels:[0,25,50,75,100]},MINUS_PERCENT_STACKED_AXIS_SCALE:{limit:{min:-100,max:0},step:25,labels:[0,-25,-50,-75,-100]},DUAL_PERCENT_STACKED_AXIS_SCALE:{limit:{min:-100,max:100},step:25,labels:[-100,-75,-50,-25,0,25,50,75,100]},DIVERGING_PERCENT_STACKED_AXIS_SCALE:{limit:{min:-100,max:100},step:25,labels:[100,75,50,25,0,25,50,75,100]},AXIS_TYPE_DATETIME:"datetime",DEFAULT_DATE_FORMAT:"YYYY.MM.DD hh:mm:dd",DATE_TYPE_YEAR:"year",DATE_TYPE_MONTH:"month",DATE_TYPE_WEEK:"week",DATE_TYPE_DATE:"date",DATE_TYPE_HOUR:"hour",DATE_TYPE_MINUTE:"minute",DATE_TYPE_SECOND:"second",TITLE_PADDING:10,LEGEND_AREA_PADDING:10,LEGEND_CHECKBOX_WIDTH:10,LEGEND_ICON_WIDTH:40,LEGEND_ICON_HEIGHT:15,LEGEND_LABEL_LEFT_PADDING:5,MIN_LEGEND_WIDTH:100,MAP_LEGEND_SIZE:200,MAP_LEGEND_GRAPH_SIZE:25,MAP_LEGEND_LABEL_PADDING:10,CIRCLE_LEGEND_LABEL_FONT_SIZE:9,CIRCLE_LEGEND_PADDING:10,HALF_RATIO:.5,AXIS_LABEL_PADDING:7,DEGREE_CANDIDATES:[25,45,65,85],TICK_INTERVAL_AUTO:"auto",YAXIS_ALIGN_CENTER:"center",XAXIS_LABEL_COMPARE_MARGIN:20,XAXIS_LABEL_GUTTER:2,AXIS_STANDARD_MULTIPLE_NUMS:[1,2,5,10,20,50,100],AXIS_LAST_STANDARD_MULTIPLE_NUM:100,LABEL_PADDING_TOP:3,LINE_MARGIN_TOP:5,TOOLTIP_GAP:5,TOOLTIP_DIRECTION_FORWARD:"forword",TOOLTIP_DIRECTION_CENTER:"center",TOOLTIP_DIRECTION_BACKWARD:"backword",TOOLTIP_DEFAULT_ALIGN_OPTION:"center top",TOOLTIP_DEFAULT_HORIZONTAL_ALIGN_OPTION:"right middle",TOOLTIP_DEFAULT_GROUP_ALIGN_OPTION:"right middle",TOOLTIP_DEFAULT_GROUP_HORIZONTAL_ALIGN_OPTION:"center bottom",HIDE_DELAY:200,OLD_BROWSER_OPACITY_100:100,SERIES_LABEL_OPACITY:.3,WHEEL_TICK:120,MAX_ZOOM_MAGN:5,FF_WHEELDELTA_ADJUSTING_VALUE:-40,IE7_ROTATION_FILTER_STYLE_MAP:{25:" style=\"filter: progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.9063077870366499, M12=0.42261826174069944, M21=-0.42261826174069944, M22=0.9063077870366499)\"",45:" style=\"filter: progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=0.7071067811865475, M21=-0.7071067811865475, M22=0.7071067811865476)\"",65:" style=\"filter: progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.42261826174069944, M12=0.9063077870366499, M21=-0.9063077870366499, M22=0.42261826174069944)\"",85:" style=\"filter: progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.08715574274765814, M12=0.9961946980917455, M21=-0.9961946980917455, M22=0.08715574274765814)\""},PUBLIC_EVENT_PREFIX:"public_",PUBLIC_EVENT_MAP:{load:!0,selectLegend:!0,selectSeries:!0,unselectSeries:!0,beforeShowTooltip:!0,afterShowTooltip:!0,beforeHideTooltip:!0,zoom:!0},RADIAL_PLOT_PADDING:15,RADIAL_MARGIN_FOR_CATEGORY:60,RADIAL_CATEGORY_PADDING:20,COMPONENT_TYPE_DOM:"DOM",COMPONENT_TYPE_RAPHAEL:"Raphael",IMAGE_EXTENSIONS:["png","jpeg"],DATA_EXTENSIONS:["xls","csv"],GUIDE_AREACHART_AREAOPACITY_TYPE:"areaOpacity should be a number between 0 and 1"};t.exports=i},function(t,e,i){"use strict";var n=i(2),o=i(4),a=i(5),r={},s={_findKey:function(t,e){var i,r=null;return a.isComboChart(t)?(i=o.getChartTypeMap(e))[n.CHART_TYPE_COLUMN]&&i[n.CHART_TYPE_LINE]?r=n.CHART_TYPE_COLUMN_LINE_COMBO:i[n.CHART_TYPE_LINE]&&i[n.CHART_TYPE_SCATTER]?r=n.CHART_TYPE_LINE_SCATTER_COMBO:i[n.CHART_TYPE_AREA]&&i[n.CHART_TYPE_LINE]?r=n.CHART_TYPE_LINE_AREA_COMBO:i[n.CHART_TYPE_PIE]&&(r=n.CHART_TYPE_PIE_DONUT_COMBO):r=t,r},get:function(t,e,i,n){var o=this._findKey(t,e),a=r[o];if(!a)throw new Error("Not exist "+t+" chart.");return new a(e,i,n)},register:function(t,e){r[t]=e}};t.exports=s},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(6),r={pickStacks:function(t,e){var i,o,r;return i=tui.util.map(t,function(t){return t.stack}),o=a.unique(i),e&&(o=o.slice(0,2)),(r=tui.util.filter(o,function(t){return!!t})).length<o.length&&r.push(n.DEFAULT_STACK),r},_sortSeriesData:function(t,e){var i=[];return e||(e=this.pickStacks(t)),tui.util.forEachArray(e,function(e){var o=tui.util.filter(t,function(t){return(t.stack||n.DEFAULT_STACK)===e});i=i.concat(o)}),i},removeSeriesStack:function(t){tui.util.forEachArray(t,function(t){delete t.stack})},findChartType:function(t,e){var i;return t&&(i=t[e]),i||e},getChartTypeMap:function(t){var e=this,i={};return tui.util.isObject(t.series)&&tui.util.forEach(t.series,function(n,o){i[e.findChartType(t.seriesAlias,o)]=!0}),i},_createMinusValues:function(t){return tui.util.map(t,function(t){return t<0?0:-t})},_createPlusValues:function(t){return tui.util.map(t,function(t){return t<0?0:t})},_makeNormalDivergingRawSeriesData:function(t){return t.length=Math.min(t.length,2),t[0].data=this._createMinusValues(t[0].data),t[1]&&(t[1].data=this._createPlusValues(t[1].data)),t},_makeRawSeriesDataForStackedDiverging:function(t){var e=this,i=this.pickStacks(t,!0),o=[],a=i[0],r=i[1];return t=this._sortSeriesData(t,i),tui.util.forEachArray(t,function(t){var i=t.stack||n.DEFAULT_STACK;i===a?(t.data=e._createMinusValues(t.data),o.push(t)):i===r&&(t.data=e._createPlusValues(t.data),o.push(t))}),o},_makeRawSeriesDataForDiverging:function(t,e){return t=o.isValidStackOption(e)?this._makeRawSeriesDataForStackedDiverging(t):this._makeNormalDivergingRawSeriesData(t)},updateRawSeriesDataByOptions:function(t,e){var i=this;e=e||{},o.isValidStackOption(e.stackType)&&tui.util.forEach(t.series,function(e,n){t.series[n]=i._sortSeriesData(t.series[n])}),e.diverging&&tui.util.forEach(t.series,function(n,o){t.series[o]=i._makeRawSeriesDataForDiverging(n,e.stackType)})},appendOutliersToSeriesData:function(t){var e=t.series.boxplot;tui.util.forEach(e,function(t){var e=t.outliers;e&&e.length&&tui.util.forEach(e,function(e){t.data[e[0]].push(e[1])})})},filterCheckedRawData:function(t,e){var i=JSON.parse(JSON.stringify(t));return e&&tui.util.forEach(i.series,function(t,n){e[n]?e[n].length&&(i.series[n]=tui.util.filter(t,function(t,i){return e[n][i]})):i.series[n]=[]}),i}};t.exports=r},function(t,e,i){"use strict";var n=i(2),o=i(6),a={isBarChart:function(t){return t===n.CHART_TYPE_BAR},isColumnChart:function(t){return t===n.CHART_TYPE_COLUMN},isBarTypeChart:function(t){return a.isBarChart(t)||a.isColumnChart(t)},isBoxplotChart:function(t){return t===n.CHART_TYPE_BOXPLOT},isRadialChart:function(t){return t===n.CHART_TYPE_RADIAL},isDivergingChart:function(t,e){return this.isBarTypeChart(t)&&e},isNormalStackChart:function(t,e){var i=a.isAllowedStackOption(t),n=a.isNormalStack(e);return i&&n},isPercentStackChart:function(t,e){var i=a.isAllowedStackOption(t),n=a.isPercentStack(e);return i&&n},isComboChart:function(t){return t===n.CHART_TYPE_COMBO},isPieDonutComboChart:function(t,e){var i=o.all(e,function(t){return a.isPieChart(t)});return a.isComboChart(t)&&i},isLineChart:function(t){return t===n.CHART_TYPE_LINE},isAreaChart:function(t){return t===n.CHART_TYPE_AREA},isLineAreaComboChart:function(t,e){var i=o.all(e||[],function(t){return a.isLineChart(t)||a.isAreaChart(t)});return a.isComboChart(t)&&i},hasLineChart:function(t,e){var i=o.any(e||[],function(t){return a.isLineChart(t)});return a.isComboChart(t)&&i},isLineScatterComboChart:function(t,e){var i=o.all(e||[],function(t){return a.isLineChart(t)||a.isScatterChart(t)});return a.isComboChart(t)&&i},isLineTypeChart:function(t,e){return a.isLineChart(t)||a.isAreaChart(t)||a.isLineAreaComboChart(t,e)},isBubbleChart:function(t){return t===n.CHART_TYPE_BUBBLE},isScatterChart:function(t){return t===n.CHART_TYPE_SCATTER},isHeatmapChart:function(t){return t===n.CHART_TYPE_HEATMAP},isTreemapChart:function(t){return t===n.CHART_TYPE_TREEMAP},isBoxTypeChart:function(t){return a.isHeatmapChart(t)||a.isTreemapChart(t)},isPieChart:function(t){return t&&-1!==t.indexOf(n.CHART_TYPE_PIE)},isMapChart:function(t){return t===n.CHART_TYPE_MAP},isCoordinateTypeChart:function(t){return a.isBubbleChart(t)||a.isScatterChart(t)},allowMinusPointRender:function(t){return a.isLineTypeChart(t)||a.isCoordinateTypeChart(t)||a.isBoxTypeChart(t)},isChartToDetectMouseEventOnSeries:function(t){return a.isPieChart(t)||a.isMapChart(t)||a.isCoordinateTypeChart(t)},isLabelAlignOuter:function(t){return t===n.LABEL_ALIGN_OUTER},isShowLabel:function(t){return t.showLabel||t.showLegend},isShowOuterLabel:function(t){return a.isShowLabel(t)&&a.isLabelAlignOuter(t.labelAlign)},isLegendAlignLeft:function(t){return t===n.LEGEND_ALIGN_LEFT},isLegendAlignTop:function(t){return t===n.LEGEND_ALIGN_TOP},isLegendAlignBottom:function(t){return t===n.LEGEND_ALIGN_BOTTOM},isHorizontalLegend:function(t){return a.isLegendAlignTop(t)||a.isLegendAlignBottom(t)},isVerticalLegend:function(t){return!a.isHorizontalLegend(t)},isAllowedStackOption:function(t){return a.isBarChart(t)||a.isColumnChart(t)||a.isAreaChart(t)},isNormalStack:function(t){return t===n.NORMAL_STACK_TYPE},isPercentStack:function(t){return t===n.PERCENT_STACK_TYPE},isValidStackOption:function(t){return t&&(a.isNormalStack(t)||a.isPercentStack(t))},isAllowRangeData:function(t){return a.isBarTypeChart(t)||a.isAreaChart(t)},isYAxisAlignCenter:function(t,e){return!t&&e===n.YAXIS_ALIGN_CENTER},isMinusLimit:function(t){return t.min<=0&&t.max<=0},isAutoTickInterval:function(t){return t===n.TICK_INTERVAL_AUTO},isValidLabelInterval:function(t,e){return t&&t>1&&!e},isDatetimeType:function(t){return t===n.AXIS_TYPE_DATETIME},isSupportPublicShowTooptipAPI:function(t){return this.isBarChart(t)||this.isColumnChart(t)||this.isLineChart(t)||this.isAreaChart(t)||this.isBoxplotChart(t)},isSupportPublicHideTooptipAPI:function(t){return this.isBarChart(t)||this.isColumnChart(t)||this.isLineChart(t)||this.isAreaChart(t)||this.isBoxplotChart(t)}};t.exports=a},function(t,e){"use strict";var i=function(t,e,i){var n,o,a;return e?(n=t[0],o=e.call(i,n,0),a=t.slice(1),tui.util.forEachArray(a,function(t,a){var r=e.call(i,t,a+1);r>o&&(o=r,n=t)})):n=Math.max.apply(null,t),n},n={min:function(t,e,i){var n,o,a;return e?(n=t[0],o=e.call(i,n,0),a=t.slice(1),tui.util.forEachArray(a,function(t,a){var r=e.call(i,t,a+1);r<o&&(o=r,n=t)})):n=Math.min.apply(null,t),n},max:i,any:function(t,e,i){var n=!1;return tui.util.forEach(t,function(o,a){return e.call(i,o,a,t)&&(n=!0),!n}),n},all:function(t,e,i){var n=!!(t||[]).length;return tui.util.forEach(t,function(o,a){return e.call(i,o,a,t)||(n=!1),!1!==n}),n},unique:function(t,e,i,n){var o,a=[];return tui.util.isBoolean(e)||(n=i,i=e,e=!1),i=i||function(t){return t},e?tui.util.forEachArray(t,function(e,r){e=i.call(n,e,r,t),r&&o===e||a.push(e),o=e}):tui.util.forEachArray(t,function(e,o){e=i.call(n,e,o,t),-1===tui.util.inArray(e,a)&&a.push(e)}),a},pivot:function(t){var e,n=[],o=i(tui.util.map(t,function(t){return t.length}));return tui.util.forEachArray(t,function(t){for(e=0;e<o;e+=1)n[e]||(n[e]=[]),n[e].push(t[e])}),n}};tui.util.defineNamespace("tui.chart"),tui.chart.arrayUtil=n,t.exports=n},function(t,e,i){"use strict";var n=i(2),o={},a={get:function(t,e){var i,a=o[t||n.DEFAULT_PLUGIN];if(!a)throw new Error("Not exist "+t+" plugin.");if(!(i=a[e]))throw new Error("Not exist "+e+" chart renderer.");return new i},register:function(t,e){o[t]=e}};t.exports=a},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(9),r={};t.exports={register:function(t,e){e=JSON.parse(JSON.stringify(e)),r[t]=e},_pickSeriesNames:function(t,e){var i=[];return o.isComboChart(t)?tui.util.forEach(e,function(t,e){i.push(e)}):i.push(t),i},_overwriteTheme:function(t,e){var i=this;tui.util.forEach(e,function(n,o){var a=t[o];(a||0===a)&&(tui.util.isArray(a)?e[o]=a.slice():tui.util.isObject(a)?i._overwriteTheme(a,n):e[o]=a)})},_pickValidTheme:function(t,e){var i={};return tui.util.forEachArray(n.THEME_PROPS_MAP[e],function(e){tui.util.isExisty(t[e])&&(i[e]=t[e])}),i},_createComponentThemeWithSeriesName:function(t,e,i,n){var o=this,r={};return e=e||{},tui.util.forEachArray(t,function(t){var s=e[t]||o._pickValidTheme(e,n);tui.util.keys(s).length?(r[t]=JSON.parse(JSON.stringify(a[n])),o._overwriteTheme(s,r[t])):r[t]=JSON.parse(JSON.stringify(i))}),r},_makeEachSeriesColors:function(t,e,i){var n,o=[],a=t.length,r=i||0;for(n=0;n<e;n+=1)o.push(t[r]),(r+=1)>=a&&(r=0);return o},_setSeriesColors:function(t,e,i,n){var o,r,s,h,u=this,l=0;i=i||{},tui.util.forEachArray(t,function(t){i[t]?(o=i[t].colors,s=!0):(o=i.colors||a.series.colors,s=!1),h=n[t],r=h&&h.length?h[0]&&h[0].data&&h[0].data.length?Math.max(h.length,h[0].data.length):h.length:0,e[t].colors=u._makeEachSeriesColors(o,r,!s&&l),s||(l=(r+l)%o.length)})},_initTheme:function(t,e,i,o){var r;return t!==n.DEFAULT_THEME_NAME?(r=JSON.parse(JSON.stringify(a)),this._overwriteTheme(e,r)):r=JSON.parse(JSON.stringify(e)),r.yAxis=this._createComponentThemeWithSeriesName(i,e.yAxis,r.yAxis,"yAxis"),r.series=this._createComponentThemeWithSeriesName(i,e.series,r.series,"series"),this._setSeriesColors(i,r.series,e.series,o),r},_createTargetThemesForFontInherit:function(t){var e=[t.title,t.xAxis.title,t.xAxis.label,t.legend.label,t.plot.label];return tui.util.forEach(t.yAxis,function(t){e.push(t.title,t.label)}),tui.util.forEach(t.series,function(t){e.push(t.label)}),e},_inheritThemeFont:function(t){var e=this._createTargetThemesForFontInherit(t),i=t.chart.fontFamily;tui.util.forEachArray(e,function(t){t.fontFamily||(t.fontFamily=i)})},_copySeriesColorTheme:function(t,e,i){e[i]={colors:t.colors,borderColor:t.borderColor,selectionColor:t.selectionColor}},_copySeriesColorThemeToOther:function(t){var e=this;tui.util.forEach(t.series,function(i,n){e._copySeriesColorTheme(i,t.legend,n),e._copySeriesColorTheme(i,t.tooltip,n)})},get:function(t,e,i){var n,o,a=r[t];if(!a)throw new Error("Not exist "+t+" theme.");return o=this._pickSeriesNames(e,i),n=this._initTheme(t,a,o,i),this._inheritThemeFont(n,o),this._copySeriesColorThemeToOther(n),n}}},function(t,e){"use strict";var i="#000000",n="normal",o={tickColor:i,title:{fontSize:12,fontFamily:"",color:i,fontWeight:n},label:{fontSize:12,fontFamily:"",color:i,fontWeight:n}},a={chart:{background:{color:"#ffffff",opacity:1},fontFamily:"Verdana"},title:{fontSize:18,fontFamily:"",color:i,fontWeight:n},yAxis:o,xAxis:o,plot:{lineColor:"#dddddd",background:"#ffffff",label:{fontSize:11,fontFamily:"",color:"#888"}},series:{label:{fontSize:11,fontFamily:"",color:i,fontWeight:n},colors:["#ac4142","#d28445","#f4bf75","#90a959","#75b5aa","#6a9fb5","#aa759f","#8f5536"],borderColor:"",borderWidth:"",selectionColor:"",startColor:"#F4F4F4",endColor:"#345391",overColor:"#F0C952",dot:{fillColor:"",fillOpacity:1,strokeColor:"",strokeOpacity:1,strokeWidth:2,radius:2,hover:{fillColor:"",fillOpacity:1,strokeColor:"",strokeOpacity:.8,strokeWidth:3,radius:4}}},legend:{label:{fontSize:12,fontFamily:"",color:i,fontWeight:n}},tooltip:{},chartExportMenu:{backgroundColor:"#fff",borderRadius:0,borderWidth:1,color:"#000"}};t.exports=a},function(t,e){"use strict";var i={};t.exports={get:function(t){var e=i[t];if(!e)throw new Error("Not exist "+t+" map.");return e},register:function(t,e){i[t]=e}}},function(t,e){"use strict";var i=function(t){var e;return tui.util.isArray(t)?(e=[],tui.util.forEachArray(t,function(t,n){e[n]=i(t)})):tui.util.isFunction(t)||tui.util.isDate(t)?e=t:tui.util.isObject(t)?(e={},tui.util.forEach(t,function(t,n){e[n]=i(t)})):e=t,e},n={deepCopy:i};t.exports=n},function(t,e,i){"use strict";var n=i(6);t.exports={makeDataWithTable:function(t){var e,i,o,a,r,s,h;return t.element&&"TABLE"===t.element.tagName?e=t.element:t.elementId&&(e=document.getElementById(t.elementId)),r=[],s=[],h=[],(a=e)&&(r=tui.util.toArray(a.getElementsByTagName("TR")),tui.util.forEach(r,function(t,e){var i=0===e?"TH":"TD",n=tui.util.toArray(t.getElementsByTagName(i)),o=tui.util.pluck(n,"innerText");s.push(o)}),s[0].length<s[1].length&&s[0].unshift(""),h=n.pivot(s)),(i=h).length>0&&((o={}).categories=[],o.series=[],o.categories=i.shift().slice(1),tui.util.forEach(i,function(t){var e={};e.name=t[0],e.data=t.slice(1),o.series.push(e)})),o}}},function(t,e,i){"use strict";var n=i(14),o={DOM:function(t){var e=n.create("DIV");return n.append(t,e),e}},a=tui.util.defineClass({initDimension:function(t){this.dimension=t},getPaper:function(t,e){var i=this[e+"Paper"],a=tui.util.isExisty(t)&&i&&n.findParentByClass(i.canvas,"tui-chart")!==t;return i&&!a||(i=o[e].call(this,t,this.dimension),"DOM"!==e&&(this[e+"Paper"]=i)),i}});a.addRendererType=function(t,e){o[t]=e},t.exports=a},function(t,e){"use strict";var i=Array.prototype.slice,n={create:function(t,e){var i=document.createElement(t);return e&&this.addClass(i,e),i},_getClassNames:function(t){var e;return t.classList?i.call(t.classList):(e=t.className||"")&&tui.util.isString(e)?e.split(" "):[]},addClass:function(t,e){var i;t&&e&&(i=this._getClassNames(t),tui.util.inArray(e,i)>-1||(i.push(e),t.className=i.join(" ")))},removeClass:function(t,e){var i=this._getClassNames(t),n=tui.util.inArray(e,i);-1!==n&&(i.splice(n,1),t.className=i.join(" "))},hasClass:function(t,e){var i=this._getClassNames(t);return tui.util.inArray(e,i)>-1},findParentByClass:function(t,e,i){var n=t.parentNode;return n?this.hasClass(n,e)?n:"BODY"===n.nodeName||this.hasClass(n,i)?null:this.findParentByClass(n,e,i):null},append:function(t,e){t&&e&&(e=tui.util.isArray(e)?e:[e],tui.util.forEachArray(e,function(e){e&&t.appendChild(e)}))}};t.exports=n},function(t,e){},,function(module,exports){var Lh,Mh,Nh,Oh,Ph,Zh;window.JSON||(window.JSON={parse:function(sJSON){return eval("("+sJSON+")")},stringify:(Lh=Object.prototype.toString,Mh=Array.isArray||function(t){return"[object Array]"===Lh.call(t)},Nh={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Oh=function(t){return Nh[t]||"\\u"+(t.charCodeAt(0)+65536).toString(16).substr(1)},Ph=/[\\"\u0000-\u001F\u2028\u2029]/g,function t(e){if(null==e)return"null";if("number"==typeof e)return isFinite(e)?e.toString():"null";if("boolean"==typeof e)return e.toString();if("object"==typeof e){if("function"==typeof e.toJSON)return t(e.toJSON());if(Mh(e)){for(var i="[",n=0;n<e.length;n++)i+=(n?", ":"")+t(e[n]);return i+"]"}if("[object Object]"===Lh.call(e)){var o=[];for(var a in e)e.hasOwnProperty(a)&&o.push(t(a)+": "+t(e[a]));return"{"+o.join(", ")+"}"}}return'"'+e.toString().replace(Ph,Oh)+'"'})}),"function"!=typeof Object.create&&(Object.create=(Zh=function(){},function(t,e){if(t!==Object(t)&&null!==t)throw TypeError("Argument must be an object, or null");Zh.prototype=t||{},void 0!==e&&Object.defineProperties(Zh.prototype,e);var i=new Zh;return Zh.prototype=null,null===t&&(i.__proto__=null),i})),function(){for(var t=0,e=["ms","moz","webkit","o"],i=0;i<e.length&&!window.requestAnimationFrame;++i)window.requestAnimationFrame=window[e[i]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[i]+"CancelAnimationFrame"]||window[e[i]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e){var i=(new Date).getTime(),n=Math.max(0,16-(i-t)),o=window.setTimeout(function(){e(i+n)},n);return t=i+n,o}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}()},function(t,e,i){"use strict";var n=i(2),o=i(3),a=i(19),r=i(102),s=i(103),h=i(105),u=i(106),l=i(108),c=i(109),d=i(110),p=i(111),f=i(112),m=i(113),g=i(114),_=i(117),T=i(118),v=i(121),x=i(122);o.register(n.CHART_TYPE_BAR,a),o.register(n.CHART_TYPE_COLUMN,r),o.register(n.CHART_TYPE_LINE,s),o.register(n.CHART_TYPE_AREA,h),o.register(n.CHART_TYPE_COLUMN_LINE_COMBO,u),o.register(n.CHART_TYPE_LINE_SCATTER_COMBO,l),o.register(n.CHART_TYPE_LINE_AREA_COMBO,c),o.register(n.CHART_TYPE_PIE_DONUT_COMBO,d),o.register(n.CHART_TYPE_PIE,p),o.register(n.CHART_TYPE_BUBBLE,f),o.register(n.CHART_TYPE_SCATTER,m),o.register(n.CHART_TYPE_HEATMAP,g),o.register(n.CHART_TYPE_TREEMAP,_),o.register(n.CHART_TYPE_MAP,T),o.register(n.CHART_TYPE_RADIAL,v),o.register(n.CHART_TYPE_BOXPLOT,x)},function(t,e,i){"use strict";var n=i(20),o=i(2),a=i(4),r=i(5),s=tui.util.defineClass(n,{className:"tui-bar-chart",init:function(t,e,i){a.updateRawSeriesDataByOptions(t,i.series),this._updateOptionsRelatedDiverging(i),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0})},_updateOptionsRelatedDiverging:function(t){var e;t.series=t.series||{},this.hasRightYAxis=!1,t.series.diverging&&(t.yAxis=t.yAxis||{},t.xAxis=t.xAxis||{},t.plot=t.plot||{},t.series.stackType=t.series.stackType||o.NORMAL_STACK_TYPE,this.hasRightYAxis=tui.util.isArray(t.yAxis)&&t.yAxis.length>1,e=r.isYAxisAlignCenter(this.hasRightYAxis,t.yAxis.align),t.yAxis.isCenter=e,t.xAxis.divided=e,t.series.divided=e,t.plot.divided=e)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("barSeries","barSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.hasRightYAxis&&this.componentManager.register("rightYAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){return{xAxis:!0}},onChangeCheckedLegends:function(t){var e;this.hasRightYAxis&&(e={optionChartTypes:["bar","bar"]}),n.prototype.onChangeCheckedLegends.call(this,t,null,e)},addDataRatios:function(t){var e=this.options.series||{},i=this.chartType,n=(e[i]||e).stackType;this.dataProcessor.addDataRatios(t[i],n,i)}});t.exports=s},function(t,e,i){"use strict";var n=i(2),o=i(21),a=i(80),r=i(4),s=i(14),h=i(24),u=i(90),l=i(5),c=tui.util.defineClass({init:function(t){this.theme=t.theme,this._initializeOptions(t.options),this.chartType=this.options.chartType,this.hasAxes=t.hasAxes,this.isVertical=!!t.isVertical,this.dataProcessor=this._createDataProcessor(t),this.eventBus=new tui.util.CustomEvents,this.prevXAxisData=null,this.componentManager=this._createComponentManager(),this.addComponents(),this._attachToEventBus()},_attachToEventBus:function(){this.eventBus.on("changeCheckedLegends",this.onChangeCheckedLegends,this),this.onZoom&&this.eventBus.on({zoom:this.onZoom,resetZoom:this.onResetZoom},this)},_setOffsetProperty:function(t,e,i){tui.util.isExisty(t[e])&&(t.offset=t.offset||{},t.offset[i]=t[e],delete t[e])},_initializeOffset:function(t){t&&(this._setOffsetProperty(t,"offsetX","x"),this._setOffsetProperty(t,"offsetY","y"))},_initializeTitleOptions:function(t){var e,i=this;t&&(e=tui.util.isArray(t)?t:[t],tui.util.forEachArray(e,function(t){var e=t.title;tui.util.isString(e)&&(t.title={text:e}),i._initializeOffset(t.title)}))},_initializeTooltipOptions:function(t){var e=t.position;t.grouped=!!t.grouped,this._initializeOffset(t),!t.offset&&e&&(t.offset={x:e.left,y:e.top}),delete t.position},_initializeOptions:function(t){t.chartTypes=this.charTypes,t.xAxis=t.xAxis||{},t.series=t.series||{},t.tooltip=t.tooltip||{},t.legend=t.legend||{},t.chartExportMenu=t.chartExportMenu||{},this._initializeTitleOptions(t.chart),this._initializeTitleOptions(t.xAxis),this._initializeTitleOptions(t.yAxis),tui.util.isUndefined(t.legend.visible)&&(t.legend.visible=!0),tui.util.isUndefined(t.chartExportMenu.visible)&&(t.chartExportMenu.visible=!0),this._initializeTooltipOptions(t.tooltip),this.options=t},_createDataProcessor:function(t){return new(t.DataProcessor||a)(t.rawData,this.chartType,t.options,this.seriesTypes)},_createComponentManager:function(){return new o({options:this.options,theme:this.theme,dataProcessor:this.dataProcessor,hasAxes:this.hasAxes,eventBus:this.eventBus,isVertical:this.isVertical,seriesTypes:this.seriesTypes||[this.chartType]})},addComponents:function(){},getScaleOption:function(){},_buildBoundsAndScaleData:function(t,e){return u.build(this.dataProcessor,this.componentManager,{chartType:this.chartType,seriesTypes:this.seriesTypes,options:this.options,theme:this.theme,hasAxes:this.hasAxes,scaleOption:this.getScaleOption(),isVertical:this.isVertical,hasRightYAxis:this.hasRightYAxis,addedDataCount:this._dynamicDataHelper?this._dynamicDataHelper.addedDataCount:null,prevXAxisData:t,addingDataMode:e})},addDataRatios:function(){},readyForRender:function(t){var e=this._buildBoundsAndScaleData(this.prevXAxisData,t);return e.axisDataMap.xAxis&&(this.prevXAxisData=e.axisDataMap.xAxis),this.addDataRatios(e.limitMap),e},render:function(t){var e,i=s.create("DIV","tui-chart "+this.className),o=this.componentManager,a=this.dataProcessor,u=a.getLegendVisibility(),l=r.filterCheckedRawData(a.rawData,u),c=o.drawingToolPicker.getPaper(i,n.COMPONENT_TYPE_RAPHAEL);this.dataProcessor.initData(l),c.changeChartBackgroundColor(this.theme.chart.background.color),c.changeChartBackgroundOpacity(this.theme.chart.background.opacity),h.renderFontFamily(i,this.theme.chart.fontFamily),s.append(t,i),e=this.readyForRender(),h.renderDimension(i,e.dimensionMap.chart),o.render("render",e,{checkedLegends:u},i),this.chartContainer=i,this.paper=c},rerender:function(t,e){var i,n=this.dataProcessor;e||(e=r.filterCheckedRawData(n.getZoomedRawData(),t)),this.dataProcessor.initData(e),i=this.readyForRender(),this.componentManager.render("rerender",i,{checkedLegends:t},this.chartContainer)},onChangeCheckedLegends:function(t,e,i){this.rerender(t,e,i)},animateChart:function(){this.componentManager.execute("animateComponent")},on:function(t,e){n.PUBLIC_EVENT_MAP[t]&&this.eventBus.on(n.PUBLIC_EVENT_PREFIX+t,e)},off:function(t,e){n.PUBLIC_EVENT_MAP[t]&&this.eventBus.off(n.PUBLIC_EVENT_PREFIX+t,e)},_updateChartDimension:function(t){var e=!1,i=this.options;return i.chart=i.chart||{},t.width&&t.width>0&&i.chart.width!==t.width&&(i.chart.width=t.width,e=!0),t.height&&t.height>0&&i.chart.height!==t.height&&(i.chart.height=t.height,e=!0),e},resize:function(t){var e,i;t&&this._updateChartDimension(t)&&(i=(e=this.readyForRender()).dimensionMap.chart,h.renderDimension(this.chartContainer,i),this.paper.resizeBackground(i.width,i.height),this.componentManager.render("resize",e))},setTooltipAlign:function(t){this.componentManager.get("tooltip").setAlign(t)},setTooltipOffset:function(t){this.componentManager.get("tooltip").setOffset(t)},setTooltipPosition:function(t){this.componentManager.get("tooltip").setPosition(t)},resetTooltipAlign:function(){this.componentManager.get("tooltip").resetAlign()},resetTooltipOffset:function(){this.componentManager.get("tooltip").resetOffset()},resetTooltipPosition:function(){this.resetTooltipOffset()},showSeriesLabel:function(){var t=this.componentManager.where({componentType:"series"});tui.util.forEachArray(t,function(t){t.showLabel()})},hideSeriesLabel:function(){var t=this.componentManager.where({componentType:"series"});tui.util.forEachArray(t,function(t){t.hideLabel()})},addData:function(){},addPlotLine:function(){},addPlotBand:function(){},removePlotLine:function(){},removePlotBand:function(){},_getSeriesData:function(t,e,i){var n={index:t,seriesIndex:e,outlierIndex:i};return e<0?null:this.componentManager.get("mouseEventDetector").findDataByIndexes(n)},_findSeriesIndexByLabel:function(t,e){for(var i=this.dataProcessor.getLegendLabels(t),n=-1,o=0,a=i?i.length:0;o<a;o+=1)if(i[o]===e){n=o;break}return n},_findDataByIndexes:function(t,e){return this.componentManager.get("mouseEventDetector").findDataByIndexes(t,e)},showTooltip:function(t){var e,i,n,o;l.isSupportPublicShowTooptipAPI(this.chartType)&&(e=this.options.tooltip&&this.options.tooltip.grouped,i=this.componentManager.get("mouseEventDetector"),e?o={indexes:{groupIndex:t.index}}:(n=this._findSeriesIndexByLabel(t.chartType,t.legend),o=this._getSeriesData(t.index,n,t.outlierIndex)),o?(o.silent=!0,e||(i.prevFoundData=o),i._showTooltip(o)):this.hideTooltip())},hideTooltip:function(){var t,e;l.isSupportPublicShowTooptipAPI(this.chartType)&&(t=this.options.tooltip&&this.options.tooltip.grouped,e=this.componentManager.get("mouseEventDetector"),(t&&e.prevIndex>=0||!t&&e.prevFoundData)&&e._hideTooltip({silent:!0}))}});t.exports=c},function(t,e,i){"use strict";var n=i(2),o=i(14),a=i(22),r=i(25),s=i(26),h=i(27),u=i(29),l=i(13),c={axis:a,plot:r,radialPlot:h,legend:i(35),spectrumLegend:i(37),circleLegend:i(38),tooltip:i(39),groupTooltip:i(45),mapChartTooltip:i(47),mapChartEventDetector:i(48),mouseEventDetector:i(52),barSeries:i(59),columnSeries:i(64),lineSeries:i(65),radialSeries:i(67),areaSeries:i(68),bubbleSeries:i(69),scatterSeries:i(71),mapSeries:i(72),pieSeries:i(73),heatmapSeries:i(74),treemapSeries:i(75),boxplotSeries:i(77),zoom:i(78),chartExportMenu:u,title:s},d=tui.util.defineClass({init:function(t){var e=t.options.chart,i=tui.util.pick(e,"width")||n.CHART_DEFAULT_WIDTH,o=tui.util.pick(e,"height")||n.CHART_DEFAULT_HEIGHT;this.components=[],this.componentMap={},this.theme=t.theme||{},this.options=t.options||{},this.dataProcessor=t.dataProcessor,this.hasAxes=t.hasAxes,this.isVertical=t.isVertical,this.eventBus=t.eventBus,this.drawingToolPicker=new l,this.drawingToolPicker.initDimension({width:i,height:o}),this.seriesTypes=t.seriesTypes},_makeComponentOptions:function(t,e,i,n){return t=t||this.options[e],t=tui.util.isArray(t)?t[n]:t||{}},register:function(t,e,i){var n,o,a,r,s;(i=i||{}).name=t,n=i.index||0,a=(r=c[e]).componentType,i.chartTheme=this.theme,i.chartOptions=this.options,i.seriesTypes=this.seriesTypes,s="axis"===a?t:a,i.theme=this.theme[s],i.theme||"rightYAxis"!==s||(i.theme=this.theme.yAxis),i.options=this.options[s],"series"===s&&tui.util.forEach(this.seriesTypes,function(e){return 0!==t.indexOf(e)||(i.options=i.options[e]||i.options,i.theme=i.theme[e],tui.util.isArray(i.options)&&(i.options=i.options[n]||{}),!1)}),i.dataProcessor=this.dataProcessor,i.hasAxes=this.hasAxes,i.isVertical=this.isVertical,i.eventBus=this.eventBus,i.alternativeModel=this.alternativeModel,(o=r(i))&&(o.componentName=t,o.componentType=a,this.components.push(o),this.componentMap[t]=o)},_makeDataForRendering:function(t,e,i,n,o){var a=tui.util.extend({paper:i},o);return n&&(tui.util.extend(a,n),a.layout={dimension:a.dimensionMap[t]||a.dimensionMap[e],position:a.positionMap[t]||a.positionMap[e]}),a},render:function(t,e,i,n){var a,r,s=this,h=tui.util.map(this.components,function(o){var h,u,l,c=null;return o[t]&&(a=o.componentName,r=o.componentType,l=s.drawingToolPicker.getPaper(n,o.drawingType),h=s._makeDataForRendering(a,r,l,e,i),(u=o[t](h))&&!u.paper&&(c=u)),c});n&&o.append(n,h)},where:function(t){return tui.util.filter(this.components,function(e){var i=!0;return tui.util.forEach(t,function(t,n){return e[n]!==t&&(i=!1),i}),i})},execute:function(t){var e=Array.prototype.slice.call(arguments,1);tui.util.forEachArray(this.components,function(i){i[t]&&i[t].apply(i,e)})},get:function(t){return this.componentMap[t]},has:function(t){return!!this.get(t)}});t.exports=d},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(23),r=i(7),s=i(24),h=tui.util.defineClass({init:function(t){this.className="tui-chart-axis-area",this.dataProcessor=t.dataProcessor,this.options=t.options||{},this.theme=tui.util.extend({},t.theme,{background:t.chartTheme.chart.background}),this.isLabelAxis=!1,this.isYAxis=t.isYAxis,this.shifting=t.shifting,this.data={},this.layout=null,this.dimensionMap=null,this.axisDataMap=null,this.graphRenderer=r.get(n.COMPONENT_TYPE_RAPHAEL,"axis"),this.drawingType=n.COMPONENT_TYPE_RAPHAEL,this.paperAdditionalWidth=0,this.paperAdditionalHeight=0,this._elBg=null},_renderBackground:function(){var t=tui.util.extend({},this.layout.dimension),e=tui.util.extend({},this.layout.position);this.isYAxis&&(t.height=this.dimensionMap.chart.height,e.top=0),this._elBg&&this._elBg.remove(),this._elBg=this.graphRenderer.renderBackground(this.paper,e,t,this.theme.background)},_renderChildContainers:function(t,e,i,n){var o=this.isYAxis&&this.data.aligned;this.isYAxis&&!this.data.isPositionRight&&!this.options.isCenter&&this.shifting&&this._renderBackground(),this._renderTitleArea(),this._renderLabelArea(t,e,i,n),o||this._renderTickArea(t,e,n)},_renderDividedAxis:function(t){var e=this.data,i=Math.round(t.width/2),n=t.width-i-1,o=e.tickCount,a=parseInt(o/2,10)+1,r=e.labels,s=r.slice(0,a),h=r.slice(a-1,o),u=i/a,l=i+this.dimensionMap.yAxis.width-1;this.paperAdditionalWidth=u,this._renderChildContainers(i,a,s,0),this._renderChildContainers(n+1,a,h,l)},_renderNotDividedAxis:function(t){var e=this.data,i=this.isYAxis?t.height:t.width,n=0;e.positionRatio&&(n=i*e.positionRatio),this._renderChildContainers(i,e.tickCount,e.labels,n)},_renderAxisArea:function(){var t=this.layout.dimension,e=this.data;this.isLabelAxis=e.isLabelAxis,this.options.divided?(this.containerWidth=t.width+this.dimensionMap.yAxis.width,this._renderDividedAxis(t),t.width=this.containerWidth):(t.width+=this.options.isCenter?1:0,this._renderNotDividedAxis(t))},_setDataForRendering:function(t){this.layout=t.layout,this.dimensionMap=t.dimensionMap,this.data=t.axisDataMap[this.componentName],this.options=this.data.options},render:function(t){this.paper=t.paper,this.axisSet=t.paper.set(),this._setDataForRendering(t),this._renderAxisArea()},rerender:function(t){this.axisSet.remove(),this.render(t)},resize:function(t){this.rerender(t)},zoom:function(t){this.rerender(t)},_renderTitleArea:function(){var t=this.options.title||{};t.text&&this.graphRenderer.renderTitle(this.paper,{text:t.text,offset:t.offset,theme:this.theme.title,rotationInfo:{rotateTitle:this.options.rotateTitle,isVertical:this.isYAxis,isPositionRight:this.data.isPositionRight,isCenter:this.options.isCenter},layout:this.layout,set:this.axisSet})},_renderTickLine:function(t,e,i){this.graphRenderer.renderTickLine({areaSize:t,additionalSize:i,additionalWidth:this.paperAdditionalWidth,additionalHeight:this.paperAdditionalHeight,isPositionRight:this.data.isPositionRight,isCenter:this.data.options.isCenter,isNotDividedXAxis:e,isVertical:this.isYAxis,tickColor:this.theme.tickColor,layout:this.layout,paper:this.paper,set:this.axisSet})},_renderTicks:function(t,e,i,n){var o=this.theme.tickColor,r=this.data,s=r.sizeRatio||1,h=this.isYAxis,u=this.data.options.isCenter,l=this.data.isPositionRight,c=a.makeTickPixelPositions(t*s,e),d=this.paperAdditionalHeight+1,p=this.paperAdditionalWidth;c.length=r.tickCount,this.graphRenderer.renderTicks({paper:this.paper,layout:this.layout,positions:c,isVertical:h,isCenter:u,additionalSize:n,additionalWidth:p,additionalHeight:d,isPositionRight:l,tickColor:o,set:this.axisSet})},_renderTickArea:function(t,e,i){var n=!this.isYAxis&&!this.options.divided;this._renderTickLine(t,n,i||0),this._renderTicks(t,e,n,i||0)},_renderLabelArea:function(t,e,i,n){var o=this.data.sizeRatio||1,r=a.makeTickPixelPositions(t*o,e,0),s=r[1]-r[0];this._renderLabels(r,i,s,n||0)},_renderRotationLabels:function(t,e,i,o){var a=this,r=this.graphRenderer,s=this.isYAxis,h=this.theme.label,u=this.data.degree,l=i/2,c=this.layout.position.top+n.AXIS_LABEL_PADDING,d=this.layout.position.left;tui.util.forEach(t,function(t,n){var p=t+(o||0),f={};s?(f.top=p+l,f.left=i):(f.top=c,f.left=d+p,a.isLabelAxis&&(f.left+=l)),r.renderRotatedLabel({degree:u,labelText:e[n],paper:a.paper,positionTopAndLeft:f,set:a.axisSet,theme:h})})},_renderNormalLabels:function(t,e,i,a){var r=this,s=this.graphRenderer,h=this.isYAxis,u=this.data.isPositionRight,l=this.isLabelAxis,c=this.theme.label,d=this.dataProcessor,p=o.isLineTypeChart(d.chartType,d.seriesTypes),f=p&&this.options.pointOnColumn,m=this.layout;tui.util.forEach(t,function(t,o){var d,g,_=t+a,T=i/2,v={};h?(d=_,l?d+=T+m.position.top:d=m.dimension.height+m.position.top-d,g=u?m.position.left+n.AXIS_LABEL_PADDING:m.position.left+m.dimension.width-n.AXIS_LABEL_PADDING):(d=m.position.top+n.CHART_PADDING+n.AXIS_LABEL_PADDING,g=_+m.position.left,l&&(p&&!f||(g+=T))),v.top=Math.round(d),v.left=Math.round(g),s.renderLabel({isPositionRight:u,isVertical:h,labelSize:i,labelText:e[o],paper:r.paper,positionTopAndLeft:v,set:r.axisSet,theme:c})})},_renderLabels:function(t,e,i,n){var o,a=!this.isYAxis&&this.isLabelAxis&&!1===this.options.rotateLabel,r="xAxis"===this.componentName&&this.data.degree;(o=a?this.data.multilineLabels:e).length&&(t.length=o.length),o=s.addPrefixSuffix(o,this.options.prefix,this.options.suffix),r?this._renderRotationLabels(t,o,i,n):this._renderNormalLabels(t,o,i,n)},animateForAddingData:function(t){this.isYAxis||this.graphRenderer.animateForAddingData(t.tickSize)}});function u(t){var e=t.chartOptions.chartType,i=t.name;return t.isYAxis="yAxis"===i||"rightYAxis"===i,t.shifting=t.chartOptions.series.shifting,"combo"===e?t.isYAxis?t.theme=t.theme[t.seriesTypes[0]]:"rightYAxis"===i&&(t.componentType="yAxis",t.theme=t.theme[t.seriesTypes[1]],t.index=1):t.isYAxis?t.theme=t.theme[e]:t.theme=t.theme,new h(t)}u.componentType="axis",u.Axis=h,t.exports=u},function(t,e,i){"use strict";var n=i(6),o={calculateLimit:function(t,e){var i,n=0,o={};return t<0&&(n=t,e-=t,t=0),i=(e-t)/20,o.max=e+i+n,o.min=e/6>t?n:t-i+n,o},makeTickPixelPositions:function(t,e,i){var n=[];return i=i||0,e>0&&((n=tui.util.map(tui.util.range(0,e),function(n){return(0===n?0:n/(e-1))*t+i}))[n.length-1]-=1),n},makeLabelsFromLimit:function(t,e){var i=o.findMultipleNum(e),n=Math.round(t.min*i),a=Math.round(t.max*i),r=tui.util.range(n,a+1,e*i);return tui.util.map(r,function(t){return t/i})},calculateStepFromLimit:function(t,e){return o.divide(o.subtract(t.max,t.min),e-1)},sumPlusValues:function(t){var e=tui.util.filter(t,function(t){return t>0});return o.sum(e)},sumMinusValues:function(t){var e=tui.util.filter(t,function(t){return t<0});return o.sum(e)},makePercentageValue:function(t,e){return t/e*100},calculateRatio:function(t,e,i,n){return(t-i)/e*n}};o.getDecimalLength=function(t){var e=String(t).split(".");return 2===e.length?e[1].length:0},o.findMultipleNum=function(){var t=[].slice.call(arguments),e=tui.util.map(t,function(t){return o.getDecimalLength(t)}),i=n.max(e);return Math.pow(10,i)},o.mod=function(t,e){var i=o.findMultipleNum(e);return 1===i?t%e:t*i%(e*i)/i},o.add=function(t,e){var i=o.findMultipleNum(t,e);return(t*i+e*i)/i},o.subtract=function(t,e){var i=o.findMultipleNum(t,e);return(t*i-e*i)/i},o.multiply=function(t,e){var i=o.findMultipleNum(t,e);return t*i*(e*i)/(i*i)},o.divide=function(t,e){var i=o.findMultipleNum(t,e);return t*i/(e*i)},o.sum=function(t){var e=t.slice();return e.unshift(0),tui.util.reduce(e,function(t,e){return o.add(parseFloat(t),parseFloat(e))})},t.exports=o},function(t,e,i){"use strict";var n=i(2),o=i(14),a=i(6),r=Array.prototype.concat,s=tui.util.browser,h=s.msie&&7===s.version,u=s.msie&&s.version<=8,l=window.getComputedStyle||!1,c={concatStr:function(){return String.prototype.concat.apply("",arguments)},makeFontCssText:function(t){var e=[];return t?(t.fontSize&&e.push(this.concatStr("font-size:",t.fontSize,"px")),t.fontFamily&&e.push(this.concatStr("font-family:",t.fontFamily)),t.color&&e.push(this.concatStr("color:",t.color)),t.fontWeight&&e.push(this.concatStr("font-weight:",t.fontWeight)),e.join(";")):""},checkEl:null,_createSizeCheckEl:function(){var t,e;return this.checkEl?this.checkEl.style.cssText="":(t=o.create("DIV","tui-chart-size-check-element"),e=o.create("SPAN"),t.appendChild(e),this.checkEl=t),this.checkEl},_makeCachingKey:function(t,e,i){var n=[t,i];return tui.util.forEach(e,function(t,e){n.push(t+e)}),n.join("-")},_addCssStyle:function(t,e){t.style.fontSize=(e.fontSize||n.DEFAULT_LABEL_FONT_SIZE)+"px",e.fontFamily&&(t.style.fontFamily=e.fontFamily),e.fontWeight&&(t.style.fontWeight=e.fontWeight),e.cssText&&(t.style.cssText+=e.cssText)},sizeCache:{},_getRenderedLabelSize:function(t,e,i){var n,o,a,r;return e=e||{},(t=tui.util.isExisty(t)?String(t):"")?(n=this._makeCachingKey(t,e,i),(r=this.sizeCache[n])||((a=(o=this._createSizeCheckEl()).firstChild).innerHTML=t,this._addCssStyle(o,e),document.body.appendChild(o),r=a[i],document.body.removeChild(o),this.sizeCache[n]=r),r):0},getRenderedLabelWidth:function(t,e){return this._getRenderedLabelSize(t,e,"offsetWidth")},getRenderedLabelHeight:function(t,e){return this._getRenderedLabelSize(t,e,"offsetHeight")},_getRenderedLabelsMaxSize:function(t,e,i){var n,o=0;return t&&t.length&&(n=tui.util.map(t,function(t){return i(t,e)}),o=a.max(n)),o},getRenderedLabelsMaxWidth:function(t,e){var i=tui.util.bind(this.getRenderedLabelWidth,this);return this._getRenderedLabelsMaxSize(t,e,i)},getRenderedLabelsMaxHeight:function(t,e){var i=tui.util.bind(this.getRenderedLabelHeight,this);return this._getRenderedLabelsMaxSize(t,e,i)},renderDimension:function(t,e){t.style.cssText=[this.concatStr("width:",e.width,"px"),this.concatStr("height:",e.height,"px")].join(";")},renderPosition:function(t,e){tui.util.isUndefined(e)||tui.util.forEachArray(["top","bottom","left","right"],function(i){var n=e[i];tui.util.isNumber(n)&&(t.style[i]=e[i]+"px")})},renderBackground:function(t,e){e&&(t.style.background=e)},renderFontFamily:function(t,e){e&&(t.style.fontFamily=e)},renderTitle:function(t,e,i){var n,a;return t?((n=o.create("DIV",i)).innerHTML=t,a=c.makeFontCssText(e),e.background&&(a+=";"+this.concatStr("background:",e.background)),n.style.cssText=a,n):null},expandBound:function(t){var e=t.dimension,i=t.position;return{dimension:{width:e.width+2*n.SERIES_EXPAND_SIZE,height:e.height+2*n.SERIES_EXPAND_SIZE},position:{left:i.left-n.SERIES_EXPAND_SIZE,top:i.top-n.SERIES_EXPAND_SIZE}}},_properCase:function(t){return t.substring(0,1).toUpperCase()+t.substring(1)},makeMouseEventDetectorName:function(t,e,i){return t+this._properCase(e)+this._properCase(i)},formatValue:function(t,e,i,n,o){var a=[String(t)].concat(e||[]);return o=o||"value",tui.util.reduce(a,function(t,e){return e(t,i,n,o)})},formatValues:function(t,e,i,n,o){return e&&e.length?tui.util.map(t,function(t){return c.formatValue(t,e,i,n,o)}):t},formatDate:function(t,e){var i=tui.util.isDate(t)?t:new Date(t);return e=e||n.DEFAULT_DATE_FORMAT,tui.util.formatDate(e,i)||t},formatDates:function(t,e){var i=this.formatDate;return e=e||n.DEFAULT_DATE_FORMAT,tui.util.map(t,function(t){return i(t,e)})},cancelAnimation:function(t){t&&t.id&&(cancelAnimationFrame(t.id),delete t.id)},startAnimation:function(t,e,i){var n,o={};return n=(new Date).getTime(),o.id=requestAnimationFrame(function a(){var r=(new Date).getTime()-n,s=Math.min(r/t,1);e(s),1===s?(delete o.id,i&&i()):o.id=requestAnimationFrame(a)}),o},isIE7:function(){return h},isOldBrowser:function(){return u},formatToZeroFill:function(t,e){if((t=String(t)).length>=e)return t;for(;t.length<e;)t="0"+t;return t},formatToDecimal:function(t,e){var i;return 0===e?Math.round(t):(i=Math.pow(10,e),t=Math.round(t*i)/i,t=parseFloat(t).toFixed(e))},formatToComma:function(t){var e,i,n,o,a="",s=t;return e=(t=String(t)).indexOf("-")>-1?"-":"",t.indexOf(".")>-1?(i=t.split("."),t=String(Math.abs(i[0])),a="."+i[1]):t=String(Math.abs(t)),t.length<=3?o=s:(i=t.split("").reverse(),n=i.length-1,i=tui.util.map(i,function(t,e){var i=[t];return e<n&&(e+1)%3==0&&i.push(","),i}),o=e+r.apply([],i).reverse().join("")+a),o},makeCssTextFromMap:function(t){return tui.util.map(t,function(t,e){return c.concatStr(e,":",t)}).join(";")},_perseString:function(t){return"string"==typeof t||"number"==typeof t?String(t):""},addPrefixSuffix:function(t,e,i){return e=this._perseString(e),i=this._perseString(i),""!==e||""!==i?tui.util.map(t,function(t){return e+t+i}):t},getStyle:function(t){return l?window.getComputedStyle(t,""):t.currentStyle}};function d(t,e){t=tui.util.isArray(t)?t:[t],tui.util.forEachArray(t,e)}function p(t){return"alpha(opacity="+t*n.OLD_BROWSER_OPACITY_100+")"}u?(c.makeOpacityCssText=function(t){var e="";return tui.util.isExisty(t)&&(e=";filter:"+p(t)),e},c.setOpacity=function(t,e){var i=p(e);d(t,function(t){t.style.filter=i})}):(c.makeOpacityCssText=function(t){var e="";return tui.util.isExisty(t)&&(e=";opacity:"+t),e},c.setOpacity=function(t,e){d(t,function(t){t.style.opacity=e})}),tui.util.defineNamespace("tui.chart"),tui.chart.renderUtil=c,t.exports=c},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(23),r=tui.util,s=r.map,h=r.defineClass({init:function(t){this.className="tui-chart-plot-area",this.dataProcessor=t.dataProcessor,this.options=t.options||{},this.options.showLine=!!r.isUndefined(this.options.showLine)||this.options.showLine,this.options.lines=this.options.lines||[],this.options.bands=this.options.bands||[],this.xAxisTypeOption=t.xAxisTypeOption,this.theme=t.theme||{},this.chartType=t.chartType,this.chartTypes=t.chartTypes,this.layout=null,this.axisDataMap=null,this.drawingType=n.COMPONENT_TYPE_RAPHAEL},_renderPlotArea:function(t){var e;e=this.layout.dimension,o.isLineTypeChart(this.chartType,this.chartTypes)&&this._renderOptionalLines(t,e),this.options.showLine&&this._renderPlotLines(t,e)},_setDataForRendering:function(t){t&&(this.layout=t.layout,this.dimensionMap=t.dimensionMap,this.axisDataMap=t.axisDataMap,this.paper=t.paper)},render:function(t){var e=t&&t.paper||this.paper;this.plotSet=e.set(),this.additionalPlotSet=e.set(),this._setDataForRendering(t),this._renderPlotArea(this.paper),this.additionalPlotSet.toBack(),this.plotSet.toBack(),e.pushDownBackgroundToBottom()},rerender:function(t){this.additionalPlotSet.remove(),this.plotSet.remove(),this.render(t)},resize:function(t){this.rerender(t)},zoom:function(t){this.rerender(t)},_makeVerticalLineTemplateParams:function(t){return r.extend({className:"vertical",positionType:"left",width:"1px"},t)},_makeHorizontalLineTemplateParams:function(t){return r.extend({className:"horizontal",positionType:"bottom",height:"1px"},t)},_renderLine:function(t,e){var i=this.layout.position.top,n="M"+t+","+i+"V"+(i+this.layout.dimension.height),o=this.paper.path(n);return o.attr({opacity:e.opacity||1,stroke:e.color}),this.additionalPlotSet.push(o),o},_renderBand:function(t,e,i){var n=this.layout.position,o=this.layout.dimension,a=o.width-t+n.left,r=e<0?a:e,s=this.paper.rect(t,n.top,r,o.height);return s.attr({fill:i.color,opacity:i.opacity||1,stroke:i.color}),this.additionalPlotSet.push(s),s},_createOptionalLineValueRange:function(t){var e=t.range||[t.value];return o.isDatetimeType(this.xAxisTypeOption)&&(e=s(e,function(t){return new Date(t).getTime()||t})),e},_createOptionalLinePosition:function(t,e,i){var n=(i-t.dataMin)/t.distance,o=n*e;return 1===n&&(o-=1),o<0&&(o=null),o},_createOptionalLinePositionWhenLabelAxis:function(t,e){var i,n=this.dataProcessor,o=n.findCategoryIndex(e),a=null;return r.isNull(o)||(a=(i=0===o?0:o/(n.getCategoryCount()-1))*t),1===i&&(a-=1),a},_createOptionalLinePositionMap:function(t,e,i){var n,o,a=this._createOptionalLineValueRange(t);return e.isLabelAxis?(n=this._createOptionalLinePositionWhenLabelAxis(i,a[0]),o=this._createOptionalLinePositionWhenLabelAxis(i,a[1])):(n=this._createOptionalLinePosition(e,i,a[0]),o=a[1]&&this._createOptionalLinePosition(e,i,a[1])),r.isNull(n)&&(o=this._testPlotBandCoversSeriesArea(a)?i:o||0,n=0),{start:n,end:o}},_testPlotBandCoversSeriesArea:function(t){var e,i,n,a;return o.isDatetimeType(this.xAxisTypeOption)?(i=(e=this.dataProcessor.getCategories()).length>0?e.length-1:0,n=e[0],a=e[i],t[0]<=n&&t[1]>=a):this.dataProcessor.containedAllVisibleCategory(t[0],t[1])},_renderOptionalLine:function(t,e,i,n){var o,a=this._createOptionalLinePositionMap(n,t,e);return r.isExisty(a.start)&&a.start>=0&&a.start<=e&&(i.width=1,i.color=n.color||"transparent",i.opacity=n.opacity,o=this._renderLine(a.start+this.layout.position.left,i)),o},_makeOptionalBand:function(t,e,i,n){var o,a=n.range;return a&&a.length&&this._makeRangeTo2DArray(n),o=s(n.range,function(i){return this._createOptionalLinePositionMap({range:i},t,e)},this),n.mergeOverlappingRanges&&(o.sort(u),o=this._mergeOverlappingPositionMaps(o)),s(o,function(t){var o,a=t.end-t.start;return r.isExisty(t.start)&&t.start>=0&&t.start<=e&&(i.color=n.color||"transparent",i.opacity=n.opacity,o=this._renderBand(t.start+this.layout.position.left,a,i)),o},this)},_makeOptionalLines:function(t,e){var i=e.width,n=this.axisDataMap.xAxis,o=this._makeVerticalLineTemplateParams({height:e.height+"px"}),a=r.bind(this._renderOptionalLine,this,n,i,o);return s(t,a)},_makeOptionalBands:function(t,e){var i=e.width,n=this.axisDataMap.xAxis,o=this._makeVerticalLineTemplateParams({height:e.height+"px"}),a=r.bind(this._makeOptionalBand,this,n,i,o);return s(t,a)},_renderOptionalLines:function(t,e){var i=[];i.concat(this._makeOptionalBands(this.options.bands,e)),i.concat(this._makeOptionalLines(this.options.lines,e)),this.optionalLines=i},_renderVerticalLines:function(t,e){var i=this._makeHorizontalPositions(t.width),n=this,o=this.layout,a=o.position.left,s=o.position.top;r.forEach(i,function(t){var i="M"+(t+a)+","+s+"V"+(s+o.dimension.height),r=n.paper.path(i);r.attr({stroke:e,"stroke-width":1}),n.plotSet.push(r)})},_renderHorizontalLines:function(t,e){var i=this._makeVerticalPositions(t.height),n=this,o=this.layout,a=o.position.left,s=o.position.top,h=i[1]-i[0];r.forEach(i,function(t,i){var r="M"+a+","+(h*i+s)+"H"+(a+o.dimension.width),u=n.paper.path(r);u.attr({stroke:e,"stroke-width":1}),n.plotSet.push(u)})},_renderPlotLines:function(t,e){var i=this.theme;o.isLineTypeChart(this.chartType)||this._renderVerticalLines(e,i.lineColor),this._renderHorizontalLines(e,i.lineColor)},_makeVerticalPositions:function(t){var e=this.axisDataMap,i=e.yAxis||e.rightYAxis,n=a.makeTickPixelPositions(t,i.validTickCount);return n.shift(),n},_makeDividedPlotPositions:function(t,e){var i,n,o,r,s=this.dimensionMap.yAxis.width;return e=parseInt(e/2,10)+1,n=(t-=s)-(i=Math.round(t/2)),o=a.makeTickPixelPositions(i,e),r=a.makeTickPixelPositions(n,e,i+s),o.pop(),r.shift(),o.concat(r)},_makeHorizontalPositions:function(t){var e,i=this.axisDataMap.xAxis.validTickCount;return this.options.divided?e=this._makeDividedPlotPositions(t,i):(e=a.makeTickPixelPositions(t,i)).shift(),e},addPlotLine:function(t){this.options.lines.push(t),this.rerender()},addPlotBand:function(t){this.options.bands.push(t),this.rerender()},removePlotLine:function(t){this.options.lines=r.filter(this.options.lines,function(e){return e.id!==t}),this.rerender()},removePlotBand:function(t){this.options.bands=r.filter(this.options.bands,function(e){return e.id!==t}),this.rerender()},animateForAddingData:function(t){var e=this;this.dataProcessor.isCoordinateType()||t.shifting&&r.forEach(this.optionalLines,function(i){var n=i.getBBox();n.x-t.tickSize<e.layout.position.left?i.animate({transform:"T"+t.tickSize+","+n.y,opacity:0},300,"linear",function(){i.remove()}):i.animate({transform:"T"+t.tickSize+","+n.y},300)})},_makeRangeTo2DArray:function(t){var e=t.range;e&&tui.util.isArray(e)&&(0===e.length||!r.isArray(e[0]))&&(t.range=[e])},_mergeOverlappingPositionMaps:function(t){var e,i,n,o=1,a=t.length;for(a&&(i=(e=[t[0]])[0]);o<a;o+=1)(n=t[o]).start<=i.end?i.end=Math.max(n.end,i.end):(e.push(n),i=n);return e}});function u(t,e){return t.start-e.start}function l(t){var e=t.chartOptions.chartType,i=t.seriesTypes,n=t.chartOptions.xAxis.type;return t.chartType=e,t.chartTypes=i,t.xAxisTypeOption=n,new h(t)}l.componentType="plot",l.Plot=h,t.exports=l},function(t,e,i){"use strict";var n=i(2),o=i(7),a=tui.util.defineClass({init:function(t){this.theme=t.theme||{},this.titleText=t.text,this.offset=t.offset,this.graphRenderer=o.get(n.COMPONENT_TYPE_RAPHAEL,"title"),this.drawingType=n.COMPONENT_TYPE_RAPHAEL},render:function(t){this.titleSet=this._renderTitleArea(t.paper)},resize:function(t){var e=t.dimensionMap,i=e.legend?e.legend.width:0,n=e.series.width+i;this.graphRenderer.resize(n,this.titleSet)},rerender:function(t){this.titleSet.remove(),this.render(t)},_renderTitleArea:function(t){return this.graphRenderer.render(t,this.titleText,this.offset,this.theme)}});function r(t){var e=t.chartOptions.chart||{title:{}},i=null;return e.title&&e.title.text&&(t.text=e.title.text,t.offset=e.title.offset,i=new a(t)),i}r.componentType="title",r.Title=a,t.exports=r},function(t,e,i){"use strict";var n=i(28),o=i(2),a=i(7),r=tui.util.defineClass({className:"tui-chart-plot-area",init:function(t){this.options=tui.util.extend({type:"spiderweb"},t.options),this.theme=t.theme||{},this.graphRenderer=a.get(o.COMPONENT_TYPE_RAPHAEL,"radialPlot"),this.drawingType=o.COMPONENT_TYPE_RAPHAEL},_renderPlotArea:function(t,e,i,n){var o={paper:t,layout:e,plotPositions:i,labelData:n,theme:this.theme,options:this.options};return this.graphRenderer.render(o)},_makePositions:function(t,e){var i=e.dimension.width-o.RADIAL_PLOT_PADDING-o.RADIAL_MARGIN_FOR_CATEGORY,a=e.dimension.height-o.RADIAL_PLOT_PADDING-o.RADIAL_MARGIN_FOR_CATEGORY,r=i/2+o.RADIAL_PLOT_PADDING/2+o.RADIAL_MARGIN_FOR_CATEGORY/2+e.position.left,s=a/2-o.RADIAL_PLOT_PADDING/2-o.RADIAL_MARGIN_FOR_CATEGORY/2-e.position.top,h=t.yAxis.tickCount;return function(t){var e,i,o,a,r,s,h=t.width,u=t.height,l=t.centerX,c=t.centerY,d=t.angleStepCount,p=t.stepCount,f=Math.min(h,u)/2,m=360/d,g=[];for(a=f/(p-1),r=0;r<p;r+=1){for(e=[],i=c+a*r,s=0;s<d;s+=1)o=n.rotatePointAroundOrigin(l,c,l,i,m*s),e.push({left:o.x,top:u-o.y});e.push(e[0]),g[r]=e}return g}({width:i,height:a,centerX:r,centerY:s,angleStepCount:t.xAxis.labels.length,stepCount:h})},_makeCategoryPositions:function(t,e){var i=e.dimension.width-o.RADIAL_PLOT_PADDING-o.RADIAL_CATEGORY_PADDING,a=e.dimension.height-o.RADIAL_PLOT_PADDING-o.RADIAL_CATEGORY_PADDING;return function(t){var e,i,o,a,r,s=t.width,h=t.height,u=t.centerX,l=t.centerY,c=t.angleStepCount,d=Math.min(h,s)/2,p=360/c,f=[];for(a=l+d,o=0;o<c;o+=1)r=360-p*o,i=n.rotatePointAroundOrigin(u,l,u,a,r),e=r>0&&r<180?"end":r>180&&r<360?"start":"middle",f.push({left:i.x,top:h-i.y,anchor:e});return f}({width:i,height:a,centerX:i/2+o.RADIAL_PLOT_PADDING/2+o.RADIAL_CATEGORY_PADDING/2+e.position.left,centerY:a/2-o.RADIAL_PLOT_PADDING/2-o.RADIAL_CATEGORY_PADDING/2-e.position.top,angleStepCount:t.xAxis.labels.length})},_makeLabelData:function(t,e,i){var n,o,a=t.xAxis.labels,r=t.yAxis.labels,s=this._makeCategoryPositions(t,e),h=[],u=[];for(n=0;n<a.length;n+=1)h.push({text:a[n],position:s[n]});for(o=0;o<r.length-1;o+=1)u.push({text:r[o],position:i[o][0]});return{category:h,step:u}},render:function(t){var e=this._makePositions(t.axisDataMap,t.layout),i=this._makeLabelData(t.axisDataMap,t.layout,e);this.plotSet=this._renderPlotArea(t.paper,t.layout,e,i)},rerender:function(t){this.plotSet.remove(),this.render(t)},resize:function(t){this.rerender(t)}});function s(t){return new r(t)}s.componentType="plot",s.RadialPlot=r,t.exports=s},function(t,e,i){"use strict";var n=i(2);function o(t,e){return Math.cos(t*n.RAD)*e}function a(t,e){return Math.sin(t*n.RAD)*e}t.exports={rotatePointAroundOrigin:function(t,e,i,n,o){var a=o*(Math.PI/180),r=(i-t)*Math.cos(a)-(n-e)*Math.sin(a),s=(i-t)*Math.sin(a)+(n-e)*Math.cos(a);return{x:r+=t,y:s+=e}},calculateAdjacent:o,calculateRotatedHeight:function(t,e,i){return 2*(a(t,e/2)+a(n.ANGLE_90-t,i/2))},calculateRotatedWidth:function(t,e,i){return 2*(o(t,e/2)+o(n.ANGLE_90-t,i/2))},calculateOpposite:a}},function(t,e,i){"use strict";var n=i(2),o=i(30),a=i(14),r=i(34),s=i(5),h=i(24),u=["xls","csv","png","jpeg"],l="menu-opened",c=tui.util.defineClass({init:function(t){this.className="tui-chart-chartExportMenu-area",this.dataProcessor=t.dataProcessor,this.chartTitle=t.chartTitle||"tui-chart",this.chartType=t.chartType,this.layout=null,this.chartExportMenuContainer=null,this.chartExportMenu=null,this.options=t.options,this.eventBus=t.eventBus,this.drawingType=n.COMPONENT_TYPE_DOM,this.theme=t.theme||null},_createChartExportMenuButton:function(){var t=a.create("div",n.CLASS_NAME_CHART_EXPORT_MENU_BUTTON);return this.options.buttonClass&&a.addClass(t,this.options.buttonClass),t},_renderChartExportMenuArea:function(t){var e=this._createChartExportMenuButton(),i=this.layout.dimension;t.appendChild(e),h.renderDimension(t,i),h.renderPosition(t,this.layout.position)},_renderChartExportMenu:function(t){var e=this.dataProcessor.seriesDataModelMap,i=this.isDataDownloadAvailable(e),r=o.isDownloadSupported,s=o.isImageExtension,h=o.isImageDownloadAvailable,l=a.create("ul",n.CLASS_NAME_CHART_EXPORT_MENU),c=l.style,d=this.theme,p=[];r&&(i||h)?p=tui.util.map(u,function(t){var e;return(!s(t)&&i||s(t)&&h)&&((e=a.create("li",n.CLASS_NAME_CHART_EXPORT_MENU_ITEM)).id=t,e.innerHTML="Export to ."+t),e}):(c.width="200px",p[0]=a.create("li",n.CLASS_NAME_CHART_EXPORT_MENU_ITEM),p[0].innerHTML="Browser does not support client-side download."),d&&(d.borderWidth&&(c.borderWidth=d.borderWidth),d.borderRadius&&(c.borderRadius=d.borderRadius),d.backgroundColor&&(c.backgroundColor=d.backgroundColor),d.color&&(c.color=d.color)),this.options.menuClass&&a.addClass(l,this.options.menuClass),a.append(l,p),this.chartExportMenu=l,a.append(t,l)},_setDataForRendering:function(t){t&&(this.layout=t.layout,this.dimensionMap=t.dimensionMap,this.axisDataMap=t.axisDataMap)},render:function(t){var e=null;return o.isDownloadSupported&&(e=this.container=t.paper,a.addClass(e,this.className),this._setDataForRendering(t),this._renderChartExportMenuArea(e),this._renderChartExportMenu(e),this.chartExportMenuContainer=e,this._attachEvent()),e},rerender:function(){this._hideChartExportMenu()},resize:function(){},_showChartExportMenu:function(){a.addClass(this.chartExportMenuContainer,l),this.chartExportMenu.style.display="block"},_hideChartExportMenu:function(){this.chartExportMenuContainer&&(a.removeClass(this.chartExportMenuContainer,l),this.chartExportMenu.style.display="none")},_onClick:function(t){var e=t.target||t.srcElement,i=this.container.parentNode.getElementsByTagName("svg")[0];a.hasClass(e,n.CLASS_NAME_CHART_EXPORT_MENU_ITEM)?(e.id&&(this.eventBus.fire("beforeImageDownload"),o.exportChart(this.chartTitle,e.id,this.dataProcessor.rawData,i,this.options),this.eventBus.fire("afterImageDownload")),this._hideChartExportMenu()):a.hasClass(e,n.CLASS_NAME_CHART_EXPORT_MENU_BUTTON)&&this.chartExportMenuContainer===e.parentNode?a.hasClass(this.chartExportMenuContainer,l)?this._hideChartExportMenu():this._showChartExportMenu():this._hideChartExportMenu()},isDataDownloadAvailable:function(t){var e=!0;return s.isTreemapChart(this.chartType)?e=!1:tui.util.forEach(t,function(t){return t.isCoordinateType&&(e=!1),!1}),e},_attachEvent:function(){r.on(this.chartExportMenuContainer.parentNode,"click",this._onClick,this)},_detachEvent:function(){r.off(this.chartExportMenuContainer.parentNode,"click",this._onClick)}});function d(t){var e=t.options.visible,i=null,n=t.chartOptions.chart||{};return n.title&&(t.chartTitle=n.title.text),e&&(i=new c(t)),i}d.componentType="chartExportMenu",t.exports=d},function(t,e,i){"use strict";var n=i(6),o=i(31),a=i(33),r=tui.util.browser,s=r.msie&&(10===r.version||11===r.version),h=!s||s&&document.createElement("canvas").getContext("2d").drawSvg,u=tui.util.isExisty(document.createElement("a").download),l=window.Blob&&window.navigator.msSaveOrOpenBlob;function c(t){return n.any(a.getExtensions(),function(e){return t===e})}t.exports={exportChart:function(t,e,i,r,s){var h,u=s&&s[e]?s[e]:{};c(e)?a.downloadImage(t,e,r):(h=e,n.any(o.getExtensions(),function(t){return h===t})&&o.downloadData(t,e,i,u))},isDownloadSupported:u||l,isImageDownloadAvailable:h,isImageExtension:c,addExtension:function(t,e){var i,n=e&&tui.util.isString(e);"data"===t?i=o:"image"===t&&(i=a),i&&n&&i.getExtensions().push(e)}}},function(t,e,i){"use strict";var n=i(32),o=i(2),a={xls:"data:application/vnd.ms-excel;base64,",csv:"data:text/csv,"},r={xls:l,csv:c},s=[].concat([],o.DATA_EXTENSIONS),h={downloadData:function(t,e,i,o){var s=u(i),h=a[e]+r[e](s,o);n.execDownload(t,e,h)},getExtensions:function(){return s}};function u(t){var e,i,n,o=[],a=t.categories&&tui.util.isExisty(t.categories.x);return t&&(a?e=t.categories.x:t.categories&&(e=t.categories),o.push([""].concat(e)),tui.util.forEach(t.series,function(e){tui.util.forEach(e,function(e,r){a?(i=t.categories.y[r],n=e):(i=e.name,n=e.data),o.push([i].concat(n))})})),o}function l(t){var e,i,n='<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head>\x3c!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>Ark1</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--\x3e<meta name=ProgId content=Excel.Sheet><meta charset=UTF-8></head><body>'+(e=t,i="<table>",tui.util.forEach(e,function(t,e){var n=0===e?"th":"td";i+="<tr>",tui.util.forEach(t,function(t,o){i+="<"+n+(0!==e||0===o?' class="number"':"")+">"+t+"</"+n+">"}),i+="</tr>"}),i+="</table>")+"</body></html>";return window.btoa(unescape(encodeURIComponent(n)))}function c(t,e){var i="",n=e&&e.lineDelimiter||"\n",o=e&&e.itemDelimiter||",",a=t.length-1;return tui.util.forEachArray(t,function(t,e){var r=t.length-1;tui.util.forEachArray(t,function(t,e){var n=tui.util.isNumber(t)?t:'"'+t+'"';i+=n,e<r&&(i+=o)}),e<a&&(i+=n)}),encodeURIComponent(i)}h._makeCsvBodyWithRawData=c,h._makeXlsBodyWithRawData=l,h._get2DArrayFromRawData=u,t.exports=h},function(t,e,i){"use strict";var n=i(6),o=i(2),a={downloadAttribute:function(t,e,i){var n;i&&((n=document.createElement("a")).href=i,n.target="_blank",n.download=t+"."+e,document.body.appendChild(n),n.click(),n.remove())},msSaveOrOpenBlob:function(t,e,i){var a=(r=e,n.any(o.IMAGE_EXTENSIONS,function(t){return r===t})?function(t){var e,i,n,o,a,r=t.substr(0,t.indexOf(";base64,")).substr(t.indexOf(":")+1),s=atob(t.substr(t.indexOf(",")+1)),h=[];for(e=0;e<s.length;e+=1024){for(i=s.slice(e,e+1024),n=new Array(i.length),o=0;o<i.length;o+=1)n[o]=i.charCodeAt(o);a=new window.Uint8Array(n),h.push(a)}return new Blob(h,{type:r})}(i):new Blob([i]));var r;window.navigator.msSaveOrOpenBlob(a,t+"."+e)}};t.exports={execDownload:function(t,e,i){var n,o,r=(o=tui.util.isExisty(document.createElement("a").download),window.Blob&&window.navigator.msSaveOrOpenBlob?n="msSaveOrOpenBlob":o&&(n="downloadAttribute"),n);r&&tui.util.isString(i)&&a[r](t,e,i)}}},function(t,e,i){"use strict";var n=i(32),o=i(2),a=tui.util.browser,r=a.msie&&(10===a.version||11===a.version),s=window.URL||window.webkitURL||window,h=[].concat([],o.IMAGE_EXTENSIONS);t.exports={downloadImage:function(t,e,i){var o,a,h,u,l,c,d,p,f,m,g,_,T,v,x,y,D,A,E,C;"svg"===i.tagName?(a=i.parentNode,(h=document.createElement("canvas")).width=a.offsetWidth,h.height=a.offsetHeight,E=(D=i).parentNode,(C=document.createElement("DIV")).appendChild(D),A=C.innerHTML,E.appendChild(D),C=null,E=null,o=A,r?(T=o,v=t,x=e,y=(_=h).getContext("2d"),r&&(T=(T=(T=(T=T.replace(/xmlns:NS1=""/,"")).replace(/NS1:xmlns:xlink="http:\/\/www\.w3\.org\/1999\/xlink"/,"")).replace(/xmlns="http:\/\/www\.w3\.org\/2000\/svg"/,"")).replace(/xmlns:xlink="http:\/\/www\.w3\.org\/1999\/xlink"/,"")),y.drawSvg(T,0,0),n.execDownload(v,x,_.toDataURL("image/"+x,1))):(l=o,c=t,d=e,p=(u=h).getContext("2d"),f=new Blob([l],{type:"image/svg+xml"}),m=s.createObjectURL(f),(g=new Image).onload=function(){p.drawImage(g,0,0,u.width,u.height),n.execDownload(c,d,u.toDataURL("image/"+d,1)),s.revokeObjectURL(m)},g.src=m)):"canvas"===i.tagName&&(h=i,n.execDownload(t,e,h.toDataURL("image/"+e,1)))},getExtensions:function(){return h}}},function(t,e){"use strict";var i={},n={_attachEvent:function(t,e,n,o){var a;a=o?tui.util.bind(n,o):n,i[e+n]=a,t.attachEvent("on"+e,a)},_addEventListener:function(t,e,n,o){var a;a=o?tui.util.bind(n,o):n,i[e+n]=a,t.addEventListener(e,a)},_bindEvent:function(t,e,i,o){var a;"addEventListener"in t?a=this._addEventListener:"attachEvent"in t&&(a=this._attachEvent),n._bindEvent=a,a(t,e,i,o)},on:function(t,e,i,o){var a={};tui.util.isString(e)?a[e]=i:(a=e,o=i),tui.util.forEach(a,function(e,i){n._bindEvent(t,i,e,o)})},_detachEvent:function(t,e,n){i[e+n]&&(t.detachEvent("on"+e,i[e+n]),delete i[e+n])},_removeEventListener:function(t,e,n){t.removeEventListener(e,i[e+n]),delete i[e+n]},_unbindEvent:function(t,e,i){var o;"removeEventListener"in t?o=n._removeEventListener:"detachEvent"in t&&(o=n._detachEvent),n._unbindEvent=o,o(t,e,i)},off:function(t,e,i){var o={};tui.util.isString(e)?o[e]=i:o=e,tui.util.forEach(o,function(e,i){n._unbindEvent(t,i,e)})}};t.exports=n},function(t,e,i){"use strict";var n=i(2),o=i(36),a=i(7),r=i(5),s=n.LEGEND_ICON_HEIGHT,h=tui.util.defineClass({init:function(t){this.theme=t.theme,this.options=t.options||{},this.chartType=t.chartType,this.seriesTypes=t.seriesTypes||[this.chartType],this.eventBus=t.eventBus,this.className="tui-chart-legend-area",this.dataProcessor=t.dataProcessor,this.legendModel=new o({theme:this.theme,labels:t.dataProcessor.getLegendLabels(),legendData:t.dataProcessor.getLegendData(),seriesTypes:this.seriesTypes,chartType:this.chartType}),this.layout=null,this.graphRenderer=a.get(n.COMPONENT_TYPE_RAPHAEL,"legend"),this.paper=null,this.drawingType=n.COMPONENT_TYPE_RAPHAEL},_setDataForRendering:function(t){t&&(this.layout=t.layout,this.paper=t.paper)},_render:function(t){this._setDataForRendering(t),this.legendSet=this._renderLegendArea(t.paper)},render:function(t){this._render(t),this._listenEvents()},rerender:function(t){this.legendSet.remove(),this._render(t)},resize:function(t){this.rerender(t)},_getLegendRenderingData:function(t,e,i){var n=this,o=(r.isBarTypeChart(this.chartType)||r.isBoxplotChart(this.chartType))&&this.dataProcessor.options.series.colorByPoint;return tui.util.map(t,function(t,a){return{checkbox:!1===n.options.showCheckbox?null:{checked:n.legendModel.isCheckedIndex(a)},iconType:t.chartType||"rect",colorByPoint:o,index:a,theme:t.theme,label:t.label,labelHeight:e,labelWidth:i[a],isUnselected:n.legendModel.isUnselectedIndex(a)}})},_renderLegendArea:function(t){var e=this.legendModel.getData(),i=this.graphRenderer,o=r.isHorizontalLegend(this.options.align),a=this.layout.position,h=i.makeLabelWidths(e,this.theme.label),u=e[0]?e[0].theme:{},l=i.getRenderedLabelHeight("DEFAULT_TEXT",u)-1,c=h.length,d=Math.max(s,l),p=(n.LINE_MARGIN_TOP+d)*(o?1:c);return i.render({paper:t,legendData:this._getLegendRenderingData(e,l,h),isHorizontal:o,position:{left:a.left+n.LEGEND_AREA_PADDING+n.CHART_PADDING,top:a.top+n.LEGEND_AREA_PADDING+n.CHART_PADDING},dimension:{height:p,width:0},labelTheme:this.theme.label,labelWidths:h,eventBus:this.eventBus})},_fireChangeCheckedLegendsEvent:function(){this.eventBus.fire("changeCheckedLegends",this.legendModel.getCheckedIndexes())},_fireSelectLegendEvent:function(t){var e=this.legendModel.getSelectedIndex(),i=tui.util.isNull(e)?e:t.seriesIndex;this.eventBus.fire("selectLegend",t.chartType,i)},_fireSelectLegendPublicEvent:function(t){this.eventBus.fire(n.PUBLIC_EVENT_PREFIX+"selectLegend",{legend:t.label,chartType:t.chartType,index:t.index})},_selectLegend:function(t){var e=this.legendModel.getDatum(t);this.legendModel.toggleSelectedIndex(t),tui.util.isNull(this.legendModel.getSelectedIndex())||this.legendModel.isCheckedSelectedIndex()||(this.legendModel.checkSelectedIndex(),this._fireChangeCheckedLegendsEvent()),this.graphRenderer.selectLegend(this.legendModel.getSelectedIndex(),this.legendSet),this._fireSelectLegendEvent(e),this._fireSelectLegendPublicEvent(e)},_getCheckedIndexes:function(){var t=[];return tui.util.forEachArray(this.legendModel.checkedWholeIndexes,function(e,i){e&&t.push(i)}),t},_checkLegend:function(){var t=this.legendModel.getSelectedDatum();this.legendModel.isCheckedSelectedIndex()||this.legendModel.updateSelectedIndex(null),this._fireChangeCheckedLegendsEvent(),t&&this._fireSelectLegendEvent(t)},_checkboxClick:function(t){var e;this.legendModel.toggleCheckedIndex(t),(e=this._getCheckedIndexes()).length>0?(this.legendModel.updateCheckedLegendsWith(e),this._checkLegend()):this.legendModel.toggleCheckedIndex(t)},_labelClick:function(t){this._selectLegend(t)},_listenEvents:function(){this.eventBus.on("checkboxClicked",this._checkboxClick,this),this.eventBus.on("labelClicked",this._labelClick,this)}});function u(t){var e=!!tui.util.isUndefined(t.options.visible)||t.options.visible,i=t.dataProcessor.seriesTypes,n=t.chartOptions.chartType,o=null;return e&&(t.seriesTypes=i,t.chartType=n,o=new h(t)),o}tui.util.CustomEvents.mixin(h),u.componentType="legend",u.Legend=h,t.exports=u},function(t,e){"use strict";var i=Array.prototype.concat,n=tui.util.forEachArray,o=tui.util.defineClass({init:function(t){this.theme=t.theme,this.labels=t.labels,this.legendData=t.legendData,this.seriesTypes=t.seriesTypes||[],this.chartType=t.chartType,this.data=null,this.selectedIndex=null,this.checkedIndexesMap={},this.checkedWholeIndexes=[],this._setData(),this._initCheckedIndexes()},_initCheckedIndexes:function(){var t=this,e=[];n(this.legendData,function(i,n){i.visible&&e.push(n),t.checkedWholeIndexes[n]=i.visible}),this.updateCheckedLegendsWith(e)},_setThemeToLegendData:function(t,e,i){var o=0;n(t,function(t,n){var a={color:e.colors[n]};e.borderColor&&(a.borderColor=e.borderColor),t.theme=a,t.index=n,i&&tui.util.isUndefined(i[n])?t.seriesIndex=-1:(t.seriesIndex=o,o+=1)})},_setData:function(){var t,e,n=this,o=this.theme,a=this.chartType,r=this.seriesTypes,s=this.legendData,h=this.checkedIndexesMap;!r||r.length<2?(this._setThemeToLegendData(s,o[a],h[a]),t=s):(e=0,t=i.apply([],tui.util.map(r,function(t){var i,a,r=n.labels[t].length,u=e+r;return i=s.slice(e,u),a=h[t],e=u,n._setThemeToLegendData(i,o[t],a),i}))),this.data=t},getData:function(){return this.data},getDatum:function(t){return this.data[t]},getDatumByLabel:function(t){var e=null;return n(this.data,function(i){return i.label===t&&(e=i),!e}),e},getSelectedDatum:function(){return this.getDatum(this.selectedIndex)},updateSelectedIndex:function(t){this.selectedIndex=t},toggleSelectedIndex:function(t){var e;e=this.selectedIndex===t?null:t,this.updateSelectedIndex(e)},getSelectedIndex:function(){return this.selectedIndex},isUnselectedIndex:function(t){return!tui.util.isNull(this.selectedIndex)&&this.selectedIndex!==t},isCheckedSelectedIndex:function(){return this.isCheckedIndex(this.selectedIndex)},toggleCheckedIndex:function(t){this.checkedWholeIndexes[t]=!this.checkedWholeIndexes[t]},_updateCheckedIndex:function(t){this.checkedWholeIndexes[t]=!0},isCheckedIndex:function(t){return!!this.checkedWholeIndexes[t]},_addSendingDatum:function(t){var e=this.getDatum(t);this.checkedIndexesMap[e.chartType]||(this.checkedIndexesMap[e.chartType]=[]),this.checkedIndexesMap[e.chartType][e.index]=!0},checkSelectedIndex:function(){this._updateCheckedIndex(this.selectedIndex),this._addSendingDatum(this.selectedIndex),this._setData()},getCheckedIndexes:function(){return this.checkedIndexesMap},_resetCheckedData:function(){this.checkedWholeIndexes=[],this.checkedIndexesMap={}},updateCheckedLegendsWith:function(t){var e=this;this._resetCheckedData(),n(t,function(t){e._updateCheckedIndex(t),e._addSendingDatum(t)}),this._setData()}});t.exports=o},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(7),r=tui.util.defineClass({init:function(t){var e=t.libType;this.chartType=t.chartType,this.theme=t.theme,this.options=t.options||{},this.dataProcessor=t.dataProcessor,this.colorSpectrum=t.colorSpectrum,this.eventBus=t.eventBus,this.graphRenderer=a.get(e,"mapLegend"),this.isHorizontal=o.isHorizontalLegend(this.options.align),this.scaleData=null,this.drawingType=n.COMPONENT_TYPE_RAPHAEL,this._attachToEventBus()},_attachToEventBus:function(){this.eventBus.on({showWedge:this.onShowWedge,hideTooltip:this.onHideWedge},this),this.eventBus.on("beforeImageDownload",tui.util.bind(this._removeLocationURLFromFillAttribute,this)),this.eventBus.on("afterImageDownload",tui.util.bind(this._restoreLocationURLToFillAttribute,this))},_removeLocationURLFromFillAttribute:function(){this.graphRenderer.removeLocationURLFromFillAttribute()},_restoreLocationURLToFillAttribute:function(){this.graphRenderer.restoreLocationURLToFillAttribute()},_makeBaseDataToMakeTickArea:function(){var t=this.layout.dimension,e=this.scaleData,i=e.stepCount||e.tickCount-1,o={};return o.position=this.layout.position,this.isHorizontal?(o.step=t.width/i,o.position.top+=n.MAP_LEGEND_GRAPH_SIZE+n.MAP_LEGEND_LABEL_PADDING):(o.step=t.height/i,o.position.left+=n.MAP_LEGEND_GRAPH_SIZE+n.MAP_LEGEND_LABEL_PADDING),o},_renderTickArea:function(t){this.graphRenderer.renderTicksAndLabels(this.paper,this._makeBaseDataToMakeTickArea(),this.scaleData.labels,this.isHorizontal,t)},_makeVerticalGraphDimension:function(){return{width:n.MAP_LEGEND_GRAPH_SIZE,height:this.layout.dimension.height}},_makeHorizontalGraphDimension:function(){return{width:this.layout.dimension.width+10,height:n.MAP_LEGEND_GRAPH_SIZE}},_renderGraph:function(t){var e;e=this.isHorizontal?this._makeHorizontalGraphDimension():this._makeVerticalGraphDimension(),this.graphRenderer.render(this.paper,{dimension:e,position:this.layout.position},this.colorSpectrum,this.isHorizontal,t)},_renderLegendArea:function(){var t=this.paper.set();return this._renderGraph(t),this._renderTickArea(t),t},_setDataForRendering:function(t){this.layout=t.layout,this.paper=t.paper,this.scaleData=t.legendScaleData},render:function(t){this._setDataForRendering(t),this.legnedSet=this._renderLegendArea()},rerender:function(t){this.legnedSet.remove(),this.render(t)},resize:function(t){this.rerender(t)},onShowWedge:function(t){this.graphRenderer.showWedge(n.MAP_LEGEND_SIZE*t)},onHideWedge:function(){this.graphRenderer.hideWedge()}});function s(t){var e=!!tui.util.isUndefined(t.options.visible)||t.options.visible,i=t.chartOptions.chartType,n=null;return e&&(t.chartType=i,n=new r(t)),n}s.componentType="legend",s.SpectrumLegend=r,t.exports=s},function(t,e,i){"use strict";var n=i(2),o=i(23),a=i(24),r=i(7),s=tui.util.defineClass({circleRatios:[1,.5,.25],init:function(t){var e=t.libType;this.chartType=t.chartType,this.dataProcessor=t.dataProcessor,this.labelTheme={fontSize:n.CIRCLE_LEGEND_LABEL_FONT_SIZE,fontFamily:t.baseFontFamily},this.graphRenderer=r.get(e,"circleLegend"),this.layout=null,this.maxRadius=null,this.drawingType=n.COMPONENT_TYPE_RAPHAEL},_formatLabel:function(t,e){var i,n=this.dataProcessor.getFormatFunctions();return i=0===e?String(parseInt(t,10)):a.formatToDecimal(String(t),e),a.formatValue(i,n,this.chartType,"circleLegend","r")},_makeLabels:function(){var t=this,e=this.dataProcessor.getMaxValue(this.chartType,"r"),i=o.getDecimalLength(e);return tui.util.map(this.circleRatios,function(n){return t._formatLabel(e*n,i)})},_render:function(t){return this.graphRenderer.render(t,this.layout,this.maxRadius,this.circleRatios,this._makeLabels())},_setDataForRendering:function(t){this.layout=t.layout,this.maxRadius=t.maxRadius},render:function(t){this._setDataForRendering(t),this.circleLegendSet=this._render(t.paper)},rerender:function(t){this.circleLegendSet.remove(),this._setDataForRendering(t),this.circleLegendSet=this._render(t.paper)},resize:function(t){this.rerender(t)}});function h(t){var e=t.chartOptions.chartType,i=t.chartTheme,n=tui.util.pick(t.chartOptions,"circleLegend","visible"),o=null;return(!!tui.util.isUndefined(n)||n)&&(t.chartType=e,t.baseFontFamily=i.chart.fontFamily,o=new s(t)),o}h.componentType="legend",h.CircleLegend=s,t.exports=h},function(t,e,i){"use strict";var n=i(40),o=i(45),a=i(47),r=i(5);function s(t,e,i){var n,o=(100*t.ratio).toFixed(4),a=parseFloat(o);return n=(o=a<9e-4||o.length>5?o.substr(0,4):String(a))+"&nbsp;%&nbsp;"||"",e.ratioLabel=i+n,e.label=t.tooltipLabel||(t.label?t.label:""),e}function h(t){var e,i=t.chartOptions.chartType,h=t.seriesTypes,u=t.chartOptions.xAxis,l=[];return tui.util.forEach(tui.util.filter(t.chartTheme.legend,function(t){return tui.util.isArray(t.colors)}),function(t){l=l.concat(t.colors)}),e="map"===i?a:t.options.grouped?o:n,("pie"===i||r.isPieDonutComboChart(i,h))&&(t.labelFormatter=s),t.chartType=i,t.chartTypes=h,t.xAxisType=u.type,t.dateFormat=u.dateFormat,t.colors=l,e(t)}h.componentType="tooltip",t.exports=h},function(t,e,i){"use strict";var n=i(41),o=i(42),a=i(2),r=i(5),s=i(43),h=tui.util.defineClass(n,{init:function(){n.apply(this,arguments)},_makeTooltipHtml:function(t,e){var i,n=r.isPieChart(this.chartType)||r.isPieDonutComboChart(this.chartType,this.chartTypes);return r.isBoxplotChart(this.chartType)?tui.util.isNumber(e.outlierIndex)?(i=s.tplBoxplotChartOutlier,e.label=e.outliers[e.outlierIndex].label):i=s.tplBoxplotChartDefault:i=n?s.tplPieChart:this.dataProcessor.coordinateType?s.tplCoordinatetypeChart:s.tplDefault,i(tui.util.extend({categoryVisible:t?"show":"hide",category:t},e))},_makeHtmlForValueTypes:function(t,e){return tui.util.map(e,function(e){return t[e]?"<div>"+e+": "+t[e]+"</div>":""}).join("")},_makeSingleTooltipHtml:function(t,e){var i=e.groupIndex,n=tui.util.extend({},tui.util.pick(this.data,t,e.groupIndex,e.index));return r.isBoxplotChart(this.chartType)&&tui.util.isNumber(e.outlierIndex)&&(n.outlierIndex=e.outlierIndex),(n=tui.util.extend({suffix:this.suffix},n)).valueTypes=this._makeHtmlForValueTypes(n,["x","y","r"]),this.templateFunc(n.category,n,this.getRawCategory(i))},_setDefaultTooltipPositionOption:function(){this.options.align||(this.isVertical?this.options.align=a.TOOLTIP_DEFAULT_ALIGN_OPTION:this.options.align=a.TOOLTIP_DEFAULT_HORIZONTAL_ALIGN_OPTION)},_makeShowTooltipParams:function(t,e){var i,n,o=t.index,a=this.dataProcessor.getLegendItem(o);return a?(i=a.chartType,n=tui.util.extend({chartType:i,legend:a.label,legendIndex:o,index:t.groupIndex},e),r.isBoxplotChart(i)&&tui.util.isNumber(t.outlierIndex)&&(n.outlierIndex=t.outlierIndex),n):null},_makeTooltipDatum:function(t,e,i){var n=t&&i.label?":&nbsp;":"",o=i.tooltipLabel,a=this.labelFormatter,r={legend:t||""};return r.label=o||(i.label?n+i.label:""),a&&(r=a(i,r,n)),r.category=e||"",tui.util.extend(r,i.pickValueMapForTooltip())},makeTooltipData:function(){var t=this,e=this.dataProcessor.getLegendLabels(),i=r.isTreemapChart(this.chartType),n={},o={};return tui.util.isArray(e)?n[this.chartType]=e:n=e,this.dataProcessor.eachBySeriesGroup(function(e,i,a){var r;a=a||t.chartType,r=e.map(function(e,o){var r=t.dataProcessor.makeTooltipCategory(i,o,t.isVertical);return e?t._makeTooltipDatum(n[a][o],r,e):null}),o[a]||(o[a]=[]),o[a].push(r)},i),o}});function u(t){return new h(t)}o.mixin(h),u.componentType="tooltip",u.NormalTooltip=h,t.exports=u},function(t,e,i){"use strict";var n=i(2),o=i(14),a=i(5),r=i(24),s=tui.util.defineClass({init:function(t){var e=a.isPieChart(t.chartType);this.chartType=t.chartType,this.chartTypes=t.chartTypes,this.dataProcessor=t.dataProcessor,this.options=t.options,this.colors=t.colors,this.theme=t.theme,this.isVertical=t.isVertical,this.eventBus=t.eventBus,this.labelTheme=t.labelTheme,this.xAxisType=t.xAxisType,this.dateFormat=t.dateFormat,this.labelFormatter=t.labelFormatter,this.className="tui-chart-tooltip-area",this.tooltipContainer=null,this.suffix=this.options.suffix?"&nbsp;"+this.options.suffix:"",this.templateFunc=this.options.template||tui.util.bind(this._makeTooltipHtml,this),this.animationTime=e?n.TOOLTIP_PIE_ANIMATION_TIME:n.TOOLTIP_ANIMATION_TIME,this.data=[],this.layout=null,this.dimensionMap=null,this.positionMap=null,this.drawingType=n.COMPONENT_TYPE_DOM,this._setDefaultTooltipPositionOption(),this._saveOriginalPositionOptions(),this._attachToEventBus()},_attachToEventBus:function(){this.eventBus.on({showTooltip:this.onShowTooltip,hideTooltip:this.onHideTooltip},this),this.onShowTooltipContainer&&this.eventBus.on({showTooltipContainer:this.onShowTooltipContainer,hideTooltipContainer:this.onHideTooltipContainer},this)},_makeTooltipHtml:function(){},_setDefaultTooltipPositionOption:function(){},_saveOriginalPositionOptions:function(){this.orgPositionOptions={align:this.options.align,offset:this.options.offset}},makeTooltipData:function(){},_setDataForRendering:function(t){this.layout=t.layout,this.dimensionMap=t.dimensionMap,this.positionMap=t.positionMap},render:function(t){var e=t.paper;return o.addClass(e,this.className),this._setDataForRendering(t),this.data=this.makeTooltipData(),r.renderPosition(e,this.layout.position),this.tooltipContainer=e,e},rerender:function(t){this.resize(t),this.data=this.makeTooltipData()},resize:function(t){this._setDataForRendering(t),r.renderPosition(this.tooltipContainer,this.layout.position),this.positionModel&&this.positionModel.updateBound(this.layout)},zoom:function(){this.data=this.makeTooltipData()},_getTooltipElement:function(){var t;return this.tooltipElement||(this.tooltipElement=t=o.create("DIV","tui-chart-tooltip"),o.append(this.tooltipContainer,t)),this.tooltipElement},onShowTooltip:function(t){var e,i=this._getTooltipElement(),n=a.isComboChart(this.chartType)&&a.isScatterChart(t.chartType);a.isChartToDetectMouseEventOnSeries(t.chartType)&&!n||!i.offsetWidth||(e={left:i.offsetLeft,top:i.offsetTop}),this._showTooltip(i,t,e)},getTooltipDimension:function(t){return{width:t.offsetWidth,height:t.offsetHeight}},_moveToPosition:function(t,e,i){i?this._slideTooltip(t,i,e):r.renderPosition(t,e)},_slideTooltip:function(t,e,i){var n=i.top-e.top,o=i.left-e.left;r.cancelAnimation(this.slidingAnimation),this.slidingAnimation=r.startAnimation(this.animationTime,function(i){var a=o*i,r=n*i;t.style.left=e.left+a+"px",t.style.top=e.top+r+"px"})},onHideTooltip:function(t,e){var i=this._getTooltipElement();this._hideTooltip(i,t,e)},setAlign:function(t){this.options.align=t,this.positionModel&&this.positionModel.updateOptions(this.options)},_updateOffsetOption:function(t){this.options.offset=t,this.positionModel&&this.positionModel.updateOptions(this.options)},setOffset:function(t){var e=tui.util.extend({},this.options.offset);tui.util.isExisty(t.x)&&(e.x=t.x),tui.util.isExisty(t.y)&&(e.y=t.y),this._updateOffsetOption(tui.util.extend({},this.options.offset,e))},setPosition:function(t){var e=tui.util.extend({},this.options.offset);tui.util.isExisty(t.left)&&(e.x=t.left),tui.util.isExisty(t.top)&&(e.y=t.y),this._updateOffsetOption(e)},resetAlign:function(){var t=this.orgPositionOptions.align;this.options.align=t,this.positionModel&&this.positionModel.updateOptions(this.options)},resetOffset:function(){this.options.offset=this.orgPositionOptions.offset,this._updateOffsetOption(this.options.offset)},getRawCategory:function(t,e){var i=this.isVertical?"x":"y",n=this.dataProcessor.categoriesMap?this.dataProcessor.categoriesMap[i]:null,o="";return n&&(o=n[t]),e&&(o=r.formatDate(o,e)),o}});t.exports=s},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(14),r=i(24),s={_setIndexesCustomAttribute:function(t,e){t.setAttribute("data-groupIndex",e.groupIndex),t.setAttribute("data-index",e.index)},_getIndexesCustomAttribute:function(t){var e=t.getAttribute("data-groupIndex"),i=t.getAttribute("data-index"),n=null;return tui.util.isNull(e)||tui.util.isNull(i)||(n={groupIndex:parseInt(e,10),index:parseInt(i,10)}),n},_setShowedCustomAttribute:function(t,e){t.setAttribute("data-showed",e)},_isShowedTooltip:function(t){var e=t.getAttribute("data-showed");return"true"===e||!0===e},_makeLeftPositionOfNotBarChart:function(t,e,i,o){var a=t,r=i||0,s=o||n.TOOLTIP_GAP;return e.indexOf("left")>-1?a-=r+s:e.indexOf("center")>-1&&r?a-=r/2:a+=s,a},_makeTopPositionOfNotBarChart:function(t,e,i,o){var a=t,r=i||0;return e.indexOf("bottom")>-1?a+=r+o:e.indexOf("middle")>-1&&r?a+=r/2:a-=r+n.TOOLTIP_GAP,a},_makeTooltipPositionForNotBarChart:function(t){var e=t.bound,i=t.positionOption,o=t.dimension.width-(e.width||0),a=e.width?0:n.TOOLTIP_GAP,r=t.alignOption||"",s=t.dimension.height,h=e.left-this.layout.position.left+i.left,u=e.top-this.layout.position.top+i.top-n.TOOLTIP_GAP;return{left:this._makeLeftPositionOfNotBarChart(h,r,o,a),top:this._makeTopPositionOfNotBarChart(u,r,s,a)}},_makeTooltipPositionToMousePosition:function(t){return t.bound||(t.bound=t.bound||{},tui.util.extend(t.bound,t.mousePosition)),this._makeTooltipPositionForNotBarChart(t)},_makeLeftPositionForBarChart:function(t,e,i){var o=t;return e.indexOf("left")>-1?o-=i:e.indexOf("center")>-1?o-=i/2:o+=n.TOOLTIP_GAP,o},_makeTopPositionForBarChart:function(t,e,i){var n=t;return e.indexOf("top")>-1?n-=i:e.indexOf("middle")>-1&&(n-=i/2),n},_makeTooltipPositionForBarChart:function(t){var e=this.layout.position,i=t.bound,n=t.positionOption,o=t.dimension.height-(i.height||0),a=t.alignOption||"",r=t.dimension.width,s=i.left+i.width+n.left-e.left,h=i.top+n.top-e.top;return{left:this._makeLeftPositionForBarChart(s,a,r),top:this._makeTopPositionForBarChart(h,a,o)}},_makeTooltipPositionForTreemapChart:function(t){var e=this.layout.position,i=t.bound,o=t.positionOption,a=r.getRenderedLabelHeight(n.MAX_HEIGHT_WORLD,this.labelTheme);return{left:i.left+(i.width-t.dimension.width)/2+o.left-e.left,top:i.top+i.height/2-a+o.top-e.top}},_adjustPosition:function(t,e){var i=this.dimensionMap.chart,n=this.layout.position;return e.left=Math.max(e.left,-n.left),e.left=Math.min(e.left,i.width-n.left-t.width),e.top=Math.max(e.top,-n.top),e.top=Math.min(e.top,i.height-n.top-t.height),e},_makeTooltipPosition:function(t){var e,i,n,a={};return t.mousePosition?a=this._makeTooltipPositionToMousePosition(t):(o.isBarChart(t.chartType)?(a=this._makeTooltipPositionForBarChart(t),e="width",i="left",n=1):o.isTreemapChart(t.chartType)?a=this._makeTooltipPositionForTreemapChart(t):(a=this._makeTooltipPositionForNotBarChart(t),e="height",i="top",n=-1),t.allowNegativeTooltip&&(a=this._moveToSymmetry(a,{bound:t.bound,indexes:t.indexes,dimension:t.dimension,chartType:t.chartType,sizeType:e,positionType:i,addPadding:n})),a=this._adjustPosition(t.dimension,a)),a},_moveToSymmetry:function(t,e){var i,n,a,r=e.bound,s=e.sizeType,h=e.positionType,u=e.seriesType||e.chartType,l=this.dataProcessor.getValue(e.indexes.groupIndex,e.indexes.index,u),c=o.isBarChart(this.chartType)?-1:1;return l<0&&(i=e.dimension[s],n=r[s],a=t[h]+(n+i)*c,t[h]=a),t},_isChangedIndexes:function(t,e){return!!t&&(t.groupIndex!==e.groupIndex||t.index!==e.index)},_showTooltip:function(t,e,i){var o,r=this.tooltipContainer.parentNode.getBoundingClientRect(),s=e.indexes,h=this._getIndexesCustomAttribute(t),u=this.options.offset||{},l={},c=t&&t.getAttribute("data-chart-type");!e.bound&&e.mousePosition&&(e.bound={left:e.mousePosition.left-r.left+n.CHART_PADDING,top:e.mousePosition.top-r.top+n.CHART_PADDING}),(this._isChangedIndexes(h,s)||c!==e.chartType)&&this.eventBus.fire("hoverOffSeries",h,c),t.innerHTML=this._makeSingleTooltipHtml(e.seriesType||e.chartType,s),t.setAttribute("data-chart-type",e.chartType),this._setIndexesCustomAttribute(t,s),this._setShowedCustomAttribute(t,!0),this._fireBeforeShowTooltipPublicEvent(s,e.silent),a.addClass(t,"show"),l.left=u.x||0,l.top=u.y||0,o=this._makeTooltipPosition(tui.util.extend({dimension:this.getTooltipDimension(t),positionOption:l,alignOption:this.options.align||""},e)),this._moveToPosition(t,o,i),this.eventBus.fire("hoverSeries",s,e.chartType),this._fireAfterShowTooltipPublicEvent(s,{element:t,position:o},e.silent),delete e.silent},_fireBeforeShowTooltipPublicEvent:function(t,e){var i;e||(i=this._makeShowTooltipParams(t),this.eventBus.fire(n.PUBLIC_EVENT_PREFIX+"beforeShowTooltip",i))},_fireAfterShowTooltipPublicEvent:function(t,e,i){var o;i||(o=this._makeShowTooltipParams(t,e),this.eventBus.fire(n.PUBLIC_EVENT_PREFIX+"afterShowTooltip",o))},_executeHidingTooltip:function(t){a.removeClass(t,"show"),t.removeAttribute("data-groupIndex"),t.removeAttribute("data-index"),t.style.cssText=""},_hideTooltip:function(t,e,i){var a=this,r=this._getIndexesCustomAttribute(t),s=t.getAttribute("data-chart-type"),h=!(!i||!i.silent);o.isChartToDetectMouseEventOnSeries(s)?(this.eventBus.fire("hoverOffSeries",r,s),this._fireBeforeHideTooltipPublicEvent(r,h),this._executeHidingTooltip(t)):s&&(this._setShowedCustomAttribute(t,!1),this.eventBus.fire("hoverOffSeries",r,s),this._isChangedIndexes(this.prevIndexes,r)&&delete this.prevIndexes,setTimeout(function(){a._isShowedTooltip(t)||(a._fireBeforeHideTooltipPublicEvent(r,h),a._executeHidingTooltip(t))},n.HIDE_DELAY))},_fireBeforeHideTooltipPublicEvent:function(t,e){e||this.eventBus.fire(n.PUBLIC_EVENT_PREFIX+"beforeHideTooltip",void 0)},onShowTooltipContainer:function(){this.tooltipContainer.style.zIndex=n.TOOLTIP_ZINDEX},onHideTooltipContainer:function(){this.tooltipContainer.style.zIndex=0},mixin:function(t){tui.util.extend(t.prototype,this)}};t.exports=s},function(t,e,i){"use strict";var n=i(44),o='<div class="tui-chart-default-tooltip"><div class="{{ categoryVisible }}">{{ category }}</div><div><span>{{ legend }}</span><span>{{ label }}</span><span>{{ suffix }}</span></div></div>',a='<div class="tui-chart-default-tooltip"><div class="{{ categoryVisible }}">{{ category }}</div><div><span>{{ legend }}</span><span>{{ ratioLabel }}</span><span>( {{ label }} {{ suffix }})</span></div></div>',r='<div class="tui-chart-default-tooltip"><div>{{ category }}</div><div><span>{{ legend }}</span><span>{{ label }}</span></div>{{ valueTypes }}</div>',s='<div class="tui-chart-default-tooltip tui-chart-group-tooltip"><div>{{ category }}</div>{{ items }}</div>',h='<div><div class="tui-chart-legend-rect {{ chartType }}" style="{{ cssText }}"></div>&nbsp;<span>{{ legend }}</span>:&nbsp;<span>{{ value }}</span><span>{{ suffix }}</span></div>',u="background-color:{{ color }}",l='<div class="tui-chart-default-tooltip"><div>{{ name }}: {{ value }}{{ suffix }}</div></div>',c='<div class="tui-chart-default-tooltip"><div class="{{ categoryVisible }}">{{ category }}</div><div><span>{{ legend }}</span></div><div><span>Maximum: </span><span>{{ maxLabel }}</span><span>{{ suffix }}</span></div><div><span>Upper Quartile: </span><span>{{ uqLabel }}</span><span>{{ suffix }}</span></div><div><span>Median: </span><span>{{ medianLabel }}</span><span>{{ suffix }}</span></div><div><span>Lower Quartile: </span><span>{{ lqLabel }}</span><span>{{ suffix }}</span></div><div><span>Minimum: </span><span>{{ minLabel }}</span><span>{{ suffix }}</span></div></div>',d='<div class="tui-chart-default-tooltip"><div class="{{ categoryVisible }}">{{ category }}</div><div><span>{{ legend }}</span></div><div><span>Outlier: </span><span>{{ label }}</span><span>{{ suffix }}</span></div></div>';t.exports={tplDefault:n.template(o),tplPieChart:n.template(a),tplCoordinatetypeChart:n.template(r),tplGroup:n.template(s),tplGroupItem:n.template(h),tplGroupCssText:n.template(u),tplMapChartDefault:n.template(l),tplBoxplotChartDefault:n.template(c),tplBoxplotChartOutlier:n.template(d)}},function(t,e){"use strict";t.exports={template:function(t){return function(e){var i=t;return tui.util.forEach(e,function(t,e){var n=new RegExp("{{\\s*"+e+"\\s*}}","g");i=i.replace(n,String(t).replace("$","＄"))}),i}}}},function(t,e,i){"use strict";var n=i(41),o=i(46),a=i(2),r=i(14),s=i(24),h=i(9),u=i(43),l=tui.util.defineClass(n,{init:function(){this.prevIndex=null,n.apply(this,arguments)},_makeTooltipHtml:function(t,e){var i=u.tplGroupItem,n=u.tplGroupCssText,o=this._makeColors(this.theme),a=tui.util.map(e,function(t,e){return t.value?i(tui.util.extend({cssText:n({color:o[e]})},t)):null}).join("");return u.tplGroup({category:t,items:a})},_setDefaultTooltipPositionOption:function(){this.options.align||(this.isVertical?this.options.align=a.TOOLTIP_DEFAULT_GROUP_ALIGN_OPTION:this.options.align=a.TOOLTIP_DEFAULT_GROUP_HORIZONTAL_ALIGN_OPTION)},render:function(t){var e=n.prototype.render.call(this,t),i=this.dimensionMap.chart,a=this.layout;return t.checkedLegends&&(this.theme={colors:this.colors}),this.positionModel=new o(i,a,this.isVertical,this.options),e},rerender:function(t){n.prototype.rerender.call(this,t),this.prevIndex=null,t.checkedLegends&&(this.theme=this._updateLegendTheme(t.checkedLegends))},zoom:function(){this.prevIndex=null,n.prototype.zoom.call(this)},_updateLegendTheme:function(t){var e=[];return tui.util.forEachArray(this.dataProcessor.getOriginalLegendData(),function(i){(t[i.chartType]||t)[i.index]&&e.push(i.theme.color)}),{colors:e}},makeTooltipData:function(){var t=this,e=this.dataProcessor.getCategoryCount(this.isVertical);return tui.util.map(this.dataProcessor.getSeriesGroups(),function(i,n){return{category:t.dataProcessor.makeTooltipCategory(n,e-n,t.isVertical),values:i.pluck("label")}})},_makeColors:function(t){var e,i,n,o=0,a=this.dataProcessor.getLegendData();return t.colors?t.colors:(e=h.series.colors.slice(0,a.length),tui.util.map(tui.util.pluck(a,"chartType"),function(a){var r;return n!==a&&(i=t[a]?t[a].colors:e,o=0),n=a,r=i[o],o+=1,r}))},_makeItemRenderingData:function(t){var e=this.dataProcessor,i=this.suffix;return tui.util.map(t,function(t,n){var o=e.getLegendItem(n);return{value:t,legend:o.label,chartType:o.chartType,suffix:i}})},_makeGroupTooltipHtml:function(t){var e,i=this.data[t],n="";return i&&(e=this._makeItemRenderingData(i.values),n=this.templateFunc(i.category,e,this.getRawCategory(t))),n},_getTooltipSectorElement:function(){var t;return this.groupTooltipSector||(this.groupTooltipSector=t=r.create("DIV","tui-chart-group-tooltip-sector"),r.append(this.tooltipContainer,t)),this.groupTooltipSector},_makeVerticalTooltipSectorBound:function(t,e,i){return{dimension:{width:i?1:e.end-e.start,height:t},position:{left:e.start,top:a.SERIES_EXPAND_SIZE}}},_makeHorizontalTooltipSectorBound:function(t,e){return{dimension:{width:t,height:e.end-e.start},position:{left:a.SERIES_EXPAND_SIZE,top:e.start}}},_makeTooltipSectorBound:function(t,e,i,n){return i?this._makeVerticalTooltipSectorBound(t,e,n):this._makeHorizontalTooltipSectorBound(t,e)},_showTooltipSector:function(t,e,i,n,o){var a=this._getTooltipSectorElement(),h=e.start===e.end,u=this._makeTooltipSectorBound(t,e,i,h);h?this.eventBus.fire("showGroupTooltipLine",u):(s.renderDimension(a,u.dimension),s.renderPosition(a,u.position),r.addClass(a,"show")),o&&(n-=1),this.eventBus.fire("showGroupAnimation",n)},_hideTooltipSector:function(t){var e=this._getTooltipSectorElement();r.hasClass(e,"show")?r.removeClass(e,"show"):this.eventBus.fire("hideGroupTooltipLine"),this.eventBus.fire("hideGroupAnimation",t),this.eventBus.fire("hideGroupTooltipLine")},_showTooltip:function(t,e,i){var n,o;tui.util.isNull(this.prevIndex)||this.eventBus.fire("hideGroupAnimation",this.prevIndex),t.innerHTML=this._makeGroupTooltipHtml(e.index),this._fireBeforeShowTooltipPublicEvent(e.index,e.range,e.silent),r.addClass(t,"show"),this._showTooltipSector(e.size,e.range,e.isVertical,e.index,e.isMoving),n=this.getTooltipDimension(t),o=this.positionModel.calculatePosition(n,e.range),this._moveToPosition(t,o,i),this._fireAfterShowTooltipPublicEvent(e.index,e.range,{element:t,position:o},e.silent),this.prevIndex=e.index},_fireBeforeShowTooltipPublicEvent:function(t,e,i){i||this.eventBus.fire(a.PUBLIC_EVENT_PREFIX+"beforeShowTooltip",{chartType:this.chartType,index:t,range:e})},_fireAfterShowTooltipPublicEvent:function(t,e,i,n){n||this.eventBus.fire(a.PUBLIC_EVENT_PREFIX+"afterShowTooltip",tui.util.extend({chartType:this.chartType,index:t,range:e},i))},_hideTooltip:function(t,e,i){var n=i.silent;this.prevIndex=null,this._fireBeforeHideTooltipPublicEvent(e,n),this._hideTooltipSector(e),r.removeClass(t,"show"),t.style.cssText=""},_fireBeforeHideTooltipPublicEvent:function(t,e){e||this.eventBus.fire(a.PUBLIC_EVENT_PREFIX+"beforeHideTooltip",{chartType:this.chartType,index:t})}});function c(t){return new l(t)}c.componentType="tooltip",c.GroupTooltip=l,t.exports=c},function(t,e,i){"use strict";var n=i(2),o=tui.util.defineClass({init:function(t,e,i,n){this.chartDimension=t,this.areaBound=e,this.isVertical=i,this.options=n,this.positions={},this._setData(t,e,i,n)},_getHorizontalDirection:function(t){return(t=t||"").indexOf("left")>-1?n.TOOLTIP_DIRECTION_BACKWARD:t.indexOf("center")>-1?n.TOOLTIP_DIRECTION_CENTER:n.TOOLTIP_DIRECTION_FORWARD},_makeVerticalData:function(t,e,i){return{positionType:"left",sizeType:"width",direction:this._getHorizontalDirection(i),areaPosition:e.position.left,areaSize:e.dimension.width,chartSize:t.width,basePosition:n.SERIES_EXPAND_SIZE}},_getVerticalDirection:function(t){return(t=t||"").indexOf("top")>-1?n.TOOLTIP_DIRECTION_BACKWARD:t.indexOf("bottom")>-1?n.TOOLTIP_DIRECTION_FORWARD:n.TOOLTIP_DIRECTION_CENTER},_makeHorizontalData:function(t,e,i){return{positionType:"top",sizeType:"height",direction:this._getVerticalDirection(i),areaPosition:e.position.top,areaSize:e.dimension.height,chartSize:t.height,basePosition:n.SERIES_EXPAND_SIZE}},_setData:function(t,e,i,n){var o=this._makeVerticalData(t,e,n.align),a=this._makeHorizontalData(t,e,n.align),r=n.offset||{};i?(this.mainData=o,this.subData=a):(this.mainData=a,this.subData=o),this.positionOption={},this.positionOption.left=r.x||0,this.positionOption.top=r.y||0,this.positions={}},_calculateMainPositionValue:function(t,e,i){var o=e.start===e.end,a=o?9:5,r=i.basePosition;return i.direction===n.TOOLTIP_DIRECTION_FORWARD?r+=e.end+a:i.direction===n.TOOLTIP_DIRECTION_BACKWARD?r+=e.start-t-a:r+=o?e.start-t/2:e.start+(e.end-e.start-t)/2,r},_calculateSubPositionValue:function(t,e){var i=e.areaSize/2;return e.direction===n.TOOLTIP_DIRECTION_FORWARD?i+e.basePosition:e.direction===n.TOOLTIP_DIRECTION_BACKWARD?i-t+e.basePosition:i-t/2+e.basePosition},_makePositionValueDiff:function(t,e,i){return t+i.areaPosition+e-i.chartSize},_adjustBackwardPositionValue:function(t,e,i,o){var a;return t<-o.areaPosition&&(a=this._calculateMainPositionValue(i,e,{direction:n.TOOLTIP_DIRECTION_FORWARD,basePosition:o.basePosition}),t=this._makePositionValueDiff(a,i,o)>0?-o.areaPosition:a),t},_adjustForwardPositionValue:function(t,e,i,o){var a,r=this._makePositionValueDiff(t,i,o);return r>0&&((a=this._calculateMainPositionValue(i,e,{direction:n.TOOLTIP_DIRECTION_BACKWARD,basePosition:o.basePosition}))<-o.areaPosition?t-=r:t=a),t},_adjustMainPositionValue:function(t,e,i,o){return o.direction===n.TOOLTIP_DIRECTION_BACKWARD?t=this._adjustBackwardPositionValue(t,e,i,o):o.direction===n.TOOLTIP_DIRECTION_FORWARD?t=this._adjustForwardPositionValue(t,e,i,o):(t=Math.max(t,-o.areaPosition),t=Math.min(t,o.chartSize-o.areaPosition-i)),t},_adjustSubPositionValue:function(t,e,i){return t=i.direction===n.TOOLTIP_DIRECTION_FORWARD?Math.min(t,i.chartSize-i.areaPosition-e):Math.max(t,-i.areaPosition)},_makeCachingKey:function(t){return t.start+"-"+t.end},_addPositionOptionValue:function(t,e){return t+this.positionOption[e]},_makeMainPositionValue:function(t,e,i){var n;return n=this._calculateMainPositionValue(t[i.sizeType],e,i),n=this._addPositionOptionValue(n,i.positionType),n=this._adjustMainPositionValue(n,e,t[i.sizeType],i)},_makeSubPositionValue:function(t,e){var i;return i=this._calculateSubPositionValue(t[e.sizeType],e),i=this._addPositionOptionValue(i,e.positionType),i=this._adjustSubPositionValue(i,t[e.sizeType],e)},calculatePosition:function(t,e){var i=this._makeCachingKey(e),n=this.mainData,o=this.subData,a=this.positions[i];return a||((a={})[n.positionType]=this._makeMainPositionValue(t,e,n),a[o.positionType]=this._makeSubPositionValue(t,o),this.positions[i]=a),a},updateOptions:function(t){this.options=t,this._setData(this.chartDimension,this.areaBound,this.isVertical,t)},updateBound:function(t){this.areaBound=t,this._setData(this.chartDimension,t,this.isVertical,this.options)}});t.exports=o},function(t,e,i){"use strict";var n=i(2),o=i(41),a=i(42),r=i(43),s=tui.util.defineClass(o,{init:function(t){this.mapModel=t.mapModel,o.apply(this,arguments)},_makeTooltipHtml:function(t){return r.tplMapChartDefault(t)},_makeSingleTooltipHtml:function(t,e){var i=this.mapModel.getDatum(e.index),n=this.options.suffix?" "+this.options.suffix:"";return this.templateFunc({name:i.name||i.code,value:i.label,suffix:n})},_makeShowTooltipParams:function(t,e){var i=this.mapModel.getDatum(t.index);return tui.util.extend({chartType:this.chartType,code:i.code,name:i.name,value:i.label,index:t.index},e)},_setDefaultTooltipPositionOption:function(){this.options.align||(this.options.align=n.TOOLTIP_DEFAULT_ALIGN_OPTION)}});function h(t){return new s(t)}a.mixin(s),h.componentType="tooltip",t.exports=h},function(t,e,i){"use strict";var n=i(49),o=i(2),a=i(34),r=i(14),s=i(24),h=tui.util.defineClass(n,{init:function(t){this.chartType=t.chartType,this.eventBus=t.eventBus,this.isDown=!1,this.drawingType=o.COMPONENT_TYPE_DOM},_renderMouseEventDetectorArea:function(t){s.renderDimension(t,this.layout.dimension),s.renderPosition(t,this.layout.position)},_onClick:function(){},_onMousedown:function(t){this.isDown=!0,this.eventBus.fire("dragStartMapSeries",{left:t.clientX,top:t.clientY})},_dragEnd:function(){this.isDrag=!1,r.removeClass(this.mouseEventDetectorContainer,"drag"),this.eventBus.fire("dragEndMapSeries")},_onMouseup:function(t){this.isDown=!1,this.isDrag?this._dragEnd():this._onMouseEvent("click",t),this.isMove=!1},_onMousemove:function(t){this.isDown?(this.isDrag||r.addClass(this.mouseEventDetectorContainer,"drag"),this.isDrag=!0,this.eventBus.fire("dragMapSeries",{left:t.clientX,top:t.clientY})):(this.isMove=!0,this._onMouseEvent("move",t))},_onMouseout:function(t){this.isDrag?this._dragEnd():this._onMouseEvent("move",t),this.isDown=!1},_onMousewheel:function(t){var e=t.wheelDelta||t.detail*o.FF_WHEELDELTA_ADJUSTING_VALUE;return this.eventBus.fire("wheel",e,{left:t.clientX,top:t.clientY}),t.preventDefault&&t.preventDefault(),!1},attachEvent:function(t){n.prototype.attachEvent.call(this,t),tui.util.browser.firefox?a.on(t,"DOMMouseScroll",this._onMousewheel,this):a.on(t,"mousewheel",this._onMousewheel,this)}});function u(t){return new h(t)}u.componentType="mouseEventDetector",t.exports=u},function(t,e,i){"use strict";var n=i(50),o=i(51),a=i(2),r=i(34),s=i(5),h=i(14),u=i(24),l=tui.util.defineClass({init:function(t){var e;this.chartType=t.chartType,this.chartTypes=t.chartTypes,this.isVertical=t.isVertical,this.dataProcessor=t.dataProcessor,this.allowSelect=t.allowSelect,this.eventBus=t.eventBus,this.layout=null,this.selectedData=null,this.prevClientPosition=null,this.prevFoundData=null,e=s.isLineTypeChart(this.chartType,this.chartTypes),this.expandSize=e?a.SERIES_EXPAND_SIZE:0,this.seriesItemBoundsData=[],this.seriesCount=s.isComboChart(this.chartType)?2:1,this._attachToEventBus(),this.drawingType=a.COMPONENT_TYPE_DOM},_attachToEventBus:function(){this.eventBus.on("receiveSeriesData",this.onReceiveSeriesData,this)},_getRenderingBound:function(){return u.expandBound(this.layout)},_renderMouseEventDetectorArea:function(t,e){var i,o,a=this.layout.dimension;this.dimension=a,o=new n(this.layout,e,this.chartType,this.isVertical,this.chartTypes),this.tickBaseCoordinateModel=o,i=this._getRenderingBound(),u.renderDimension(t,i.dimension),u.renderPosition(t,i.position)},_setDataForRendering:function(t){this.layout=t.layout},_pickTickCount:function(t){return this.isVertical?t.xAxis.eventTickCount||t.xAxis.tickCount:t.yAxis.tickCount},render:function(t){var e,i=t.paper;return this.positionMap=t.positionMap,h.addClass(i,"tui-chart-series-custom-event-area"),t.axisDataMap.xAxis&&(e=this._pickTickCount(t.axisDataMap)),this._setDataForRendering(t),this._renderMouseEventDetectorArea(i,e),this.attachEvent(i),this.mouseEventDetectorContainer=i,this.transparentChild=this._createTransparentChild(),h.append(i,this.transparentChild),i},_createTransparentChild:function(){var t=document.createElement("DIV"),e=t.style;return e.backgroundColor="#fff",e.height=u.getStyle(this.mouseEventDetectorContainer).height,u.setOpacity(t,0),t},_calculateLayerPosition:function(t,e,i){var n,o,r=this.mouseEventDetectorContainer.getBoundingClientRect(),s=this.positionMap.series,h=this.expandSize,u={};return(i=!!tui.util.isUndefined(i)||i)&&(n=r.right-h,o=r.left+h,t=Math.min(Math.max(t,o),n)),u.x=t-r.left+s.left+h-a.CHART_PADDING,tui.util.isUndefined(e)||(u.y=e-r.top+s.top+h-a.CHART_PADDING),u},onReceiveSeriesData:function(t){var e=this.seriesItemBoundsData,i=this.seriesCount;e.length===i&&(e=[]),e.push(t),e.length===i&&(this.boundsBaseCoordinateModel=new o(e))},rerender:function(t){var e;t.axisDataMap.xAxis&&(e=this._pickTickCount(t.axisDataMap)),this.selectedData=null,this._setDataForRendering(t),this._renderMouseEventDetectorArea(this.mouseEventDetectorContainer,e),this.transparentChild.style.height=u.getStyle(this.mouseEventDetectorContainer).height},resize:function(t){this.containerBound=null,this.rerender(t)},_isChangedSelectData:function(t,e){return!t||!e||t.chartType!==e.chartType||t.indexes.groupIndex!==e.indexes.groupIndex||t.indexes.index!==e.indexes.index},_findDataFromBoundsCoordinateModel:function(t){var e,i=t.x,n=t.y;return e=s.isTreemapChart(this.chartType)?0:this.tickBaseCoordinateModel.findIndex(this.isVertical?i:n),this.boundsBaseCoordinateModel.findData(e,i,n)},_findData:function(t,e){var i=this._calculateLayerPosition(t,e);return this._findDataFromBoundsCoordinateModel(i)},_showTooltip:function(){},animateForAddingData:function(){var t,e;this.prevClientPosition&&((t=this._findData(this.prevClientPosition.x,this.prevClientPosition.y))&&(e=this.prevFoundData&&this.prevFoundData.indexes.groupIndex===t.indexes.groupIndex,this._showTooltip(t,e)),this.prevFoundData=t)},_onMouseEvent:function(t,e){h.addClass(this.mouseEventDetectorContainer,"hide"),this.eventBus.fire(t+"Series",{left:e.clientX,top:e.clientY}),h.removeClass(this.mouseEventDetectorContainer,"hide")},_unselectSelectedData:function(){this.eventBus.fire("unselectSeries",this.selectedData),this.selectedData=null},_onClick:function(t){var e=this._findData(t.clientX,t.clientY);this._isChangedSelectData(this.selectedData,e)?e&&(this.selectedData&&this._unselectSelectedData(),this.eventBus.fire("selectSeries",e),this.allowSelect&&(this.selectedData=e)):this._unselectSelectedData()},_onMousedown:function(){},_onMouseup:function(){},_onMousemove:function(t){this.prevClientPosition={x:t.clientX,y:t.clientY}},_onMouseout:function(){this.prevClientPosition=null,this.prevFoundData=null},attachEvent:function(t){r.on(t,{click:this._onClick,mousedown:this._onMousedown,mouseup:this._onMouseup,mousemove:this._onMousemove,mouseout:this._onMouseout},this)},findDataByIndexes:function(){}});tui.util.CustomEvents.mixin(l),t.exports=l},function(t,e,i){"use strict";var n=i(5),o=i(6),a=tui.util.defineClass({init:function(t,e,i,o,a){this.isLineType=n.isLineTypeChart(i,a),this.data=this._makeData(t,e,o)},_getRanges:function(t,e,i){var n=e,o=i/2;return tui.util.map(tui.util.range(0,t),function(){var t={min:n-o,max:n+o};return n+=i,t})},_makeLineTypeData:function(t,e,i){var n=(t+1)/(e-1),o=this._getRanges(e,i||0,n);return o[e-1].max-=1,o},_makeNormalData:function(t,e,i){var n=e-1,a=t/n,r=i||0;return tui.util.map(tui.util.range(0,n),function(){var e=o.min([t+r,a+r]),i={min:r,max:e};return r=e,i})},_makeData:function(t,e,i){var n=i?"width":"height",o=i?"left":"top";return this.isLineType?this._makeLineTypeData(t.dimension[n],e,t.position[o]):this._makeNormalData(t.dimension[n],e,t.position[o])},findIndex:function(t){var e=-1;return tui.util.forEachArray(this.data,function(i,n){return!(i.min<t&&i.max>=t)||(e=n,!1)}),e},getLastIndex:function(){return this.data.length-1},makeRange:function(t,e){var i,n=this.data[t];return this.isLineType?{start:i=parseInt(n.max-(n.max-n.min)/2,10),end:i}:{start:n.min-(e||0),end:n.max-(e||0)}}});t.exports=a},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(6),r=tui.util.defineClass({init:function(t){this.data=this._makeData(t)},_makeRectTypePositionData:function(t,e){var i=!o.isBoxTypeChart(e);return tui.util.map(t,function(t,n){return tui.util.map(t,function(t,o){var a;return t?(a=t.end,{sendData:{chartType:e,indexes:{groupIndex:n,index:o},allowNegativeTooltip:i,bound:a},bound:{left:a.left,top:a.top,right:a.left+a.width,bottom:a.top+a.height}}):null})})},_makeOutliersPositionDataForBoxplot:function(t,e,i){var n=!o.isBoxTypeChart(e),a=[].concat(t);tui.util.forEach(a,function(t,o){tui.util.forEach(t,function(t,a){var r;t.outliers&&t.outliers.length&&(r=tui.util.map(t.outliers,function(t,i){var r={top:t.top-3,left:t.left-3,width:6,height:6};return{sendData:{chartType:e,indexes:{groupIndex:o,index:a,outlierIndex:i},allowNegativeTooltip:n,bound:r},bound:{left:r.left,top:r.top,right:r.left+r.width,bottom:r.top+r.height}}}),i[o]=i[o].concat(r))})})},_makeDotTypePositionData:function(t,e){return t?tui.util.map(a.pivot(t),function(t,i){return tui.util.map(t,function(t,o){return t?{sendData:{chartType:e,indexes:{groupIndex:i,index:o},bound:t},bound:{left:t.left-n.DOT_RADIUS,top:t.top-n.DOT_RADIUS,right:t.left+n.DOT_RADIUS,bottom:t.top+n.DOT_RADIUS}}:null})}):[]},_joinData:function(t){var e=[];return tui.util.forEachArray(t,function(t){tui.util.forEachArray(t,function(t,i){var n;e[i]?(n=e[i].length,tui.util.forEachArray(t,function(t){t&&(t.sendData.indexes.legendIndex=t.sendData.indexes.index+n)}),e[i]=e[i].concat(t)):e[i]=t})}),e},_makeData:function(t){var e=this,i=tui.util.map(t,function(t){var i;return i=o.isLineTypeChart(t.chartType)?e._makeDotTypePositionData(t.data.groupPositions,t.chartType):e._makeRectTypePositionData(t.data.groupBounds,t.chartType),o.isBoxplotChart(t.chartType)&&e._makeOutliersPositionDataForBoxplot(t.data.groupBounds,t.chartType,i),i});return this._joinData(i)},_findCandidates:function(t,e,i){return tui.util.filter(t,function(t){var n,o,a=t&&t.bound,r=!1;return a&&(n=a.left<=e&&a.right>=e,o=a.top<=i&&a.bottom>=i,r=n&&o),r})},findData:function(t,e,i){var n,o=1e4,a=null;return t>-1&&this.data[t]&&(n=this._findCandidates(this.data[t],e,i),tui.util.forEachArray(n,function(t){var e=Math.abs(i-t.bound.top);o>e&&(o=e,a=t.sendData)})),a},findDataByIndexes:function(t){var e=this.data[t.index][t.seriesIndex].sendData;return tui.util.isNumber(t.outlierIndex)?this._findOutlierDataByIndexes(t):e},_findOutlierDataByIndexes:function(t){var e=null;return tui.util.forEachArray(this.data[t.index],function(i){var n=i.sendData.indexes,o=n.index===t.seriesIndex&&n.outlierIndex===t.outlierIndex;return o&&(e=i.sendData),!o}),e}});t.exports=r},function(t,e,i){"use strict";var n=i(5),o=i(53),a=i(56),r=i(57),s=i(58),h=i(48);function u(t){var e,i=t.chartOptions.chartType,u=t.seriesTypes,l=t.chartOptions.series.zoomable,c=t.chartOptions.series.allowSelect;return e=t.chartOptions.tooltip.grouped?r:n.isMapChart(i)?h:n.isBarTypeChart(i)||n.isBoxplotChart(i)||n.isHeatmapChart(i)||n.isTreemapChart(i)?s:n.isCoordinateTypeChart(i)||n.isPieChart(i)||n.isPieDonutComboChart(i,u)?a:o,t.chartType=i,t.chartTypes=u,t.zoomable=l,t.allowSelect=c,e(t)}u.componentType="mouseEventDetector",t.exports=u},function(t,e,i){"use strict";var n=i(49),o=i(54),a=i(55),r=tui.util.defineClass(n,{init:function(t){n.call(this,t),this.prevFoundData=null,this.zoomable=t.zoomable,this.zoomable&&(tui.util.extend(this,o),this._initForZoom(t.zoomable))},onReceiveSeriesData:function(t){var e=this.seriesItemBoundsData,i=this.seriesCount;e.length===i&&(e=[]),e.push(t),e.length===i&&(this.dataModel=new a(e)),this.zoomable&&this._showTooltipAfterZoom()},_findData:function(t,e){var i=this._calculateLayerPosition(t,e);return this.dataModel.findData(i,50)},_findDataForZoomable:function(t,e){var i=this._calculateLayerPosition(t,e);return this.dataModel.findData(i)},_getFirstData:function(t){return this.dataModel.getFirstData(t)},_getLastData:function(t){return this.dataModel.getLastData(t)},_showTooltip:function(t){this.eventBus.fire("showTooltip",t)},_hideTooltip:function(t){t=t||{},this.eventBus.fire("hideTooltip",this.prevFoundData,t)},_onMousemove:function(t){var e,i;n.prototype._onMousemove.call(this,t),i=this._findData(t.clientX,t.clientY),this.zoomable&&(e=this._isAfterDragMouseup()),!e&&this._isChangedSelectData(this.prevFoundData,i)&&(i?this._showTooltip(i):this.prevFoundData&&this._hideTooltip(),this.prevFoundData=i)},_onMouseout:function(){this.prevFoundData&&this._hideTooltip(),n.prototype._onMouseout.call(this)},findDataByIndexes:function(t){return this.dataModel.findDataByIndexes(t)}});function s(t){return new r(t)}s.componentType="mouseEventDetector",t.exports=s},function(t,e,i){"use strict";var n=i(49),o=i(2),a=i(14),r=i(24),s=i(34),h={_initForZoom:function(t){this.zoomable=t,this.dragStartIndexes=null,this.startClientPosition=null,this.startLayerX=null,this.dragSelectionElement=null,this.containerBound=null,this.isShowTooltipAfterZoom=!1,this.afterMouseup=!1,this.prevDistanceOfRange=null,this.reverseMove=null,this.resetZoomBtn=null},_showTooltipAfterZoom:function(){var t,e=this.isShowTooltipAfterZoom;this.isShowTooltipAfterZoom=!1,e&&this.dragStartIndexes&&(t=this.reverseMove?this._getFirstData(this.dragStartIndexes.index):this._getLastData(this.dragEndIndexes.index))&&this._showTooltip(t)},_updateDimensionForDragSelection:function(t){r.renderDimension(t,{height:this.layout.dimension.height})},_renderDragSelection:function(){var t=a.create("DIV","tui-chart-drag-selection");return this._updateDimensionForDragSelection(t),t},render:function(t){var e=n.prototype.render.call(this,t),i=this._renderDragSelection();return a.append(e,i),this.dragSelectionElement=i,e},resize:function(t){this.containerBound=null,n.prototype.resize.call(this,t),this._updateDimensionForDragSelection(this.dragSelectionElement)},_onClick:function(){},_isAfterDragMouseup:function(){var t=this.afterMouseup;return t&&(this.afterMouseup=!1),t},_bindDragEvent:function(t){t.setCapture&&t.setCapture(),s.on(document,"mousemove",this._onDrag,this),s.off(this.mouseEventDetectorContainer,"mouseup",this._onMouseup,this),s.on(document,"mouseup",this._onMouseupAfterDrag,this)},_unbindDragEvent:function(){this.downTarget&&this.downTarget.releaseCapture&&this.downTarget.releaseCapture(),s.off(document,"mousemove",this._onDrag,this),s.off(document,"mouseup",this._onMouseupAfterDrag,this),s.on(this.mouseEventDetectorContainer,"mouseup",this._onMouseup,this)},_onMousedown:function(t){var e;this.zoomable&&(e=t.target||t.srcElement,this.startClientPosition={x:t.clientX,y:t.clientY},this.startLayerX=this._calculateLayerPosition(t.clientX).x,this.downTarget=e,this._bindDragEvent(e))},_showDragSelection:function(t){var e=this._calculateLayerPosition(t).x,i=Math.min(e,this.startLayerX)-this.layout.position.left,n=Math.abs(e-this.startLayerX),o=this.dragSelectionElement;o.style.left=i+"px",o.style.width=n+"px",a.addClass(o,"show")},_hideDragSelection:function(){a.removeClass(this.dragSelectionElement,"show")},_onDrag:function(t){var e,i=this.startClientPosition,n=t.target||t.srcElement;i&&(e=this._findDataForZoomable(i.x,i.y),a.hasClass(n,o.CLASS_NAME_RESET_ZOOM_BTN)||(tui.util.isNull(this.dragStartIndexes)?this.dragStartIndexes=e?e.indexes:{}:this._showDragSelection(t.clientX)))},_adjustIndexRange:function(t,e){var i=[t,e].sort(function(t,e){return t-e}),n=i[1]-i[0];return 0===n?0===i[0]?i[1]+=2:(i[0]-=1,i[1]+=1):1===n&&(0===i[0]?i[1]+=1:i[0]-=1),i},_fireZoom:function(t,e){var i=t>e,n=this._adjustIndexRange(t,e),o=n[1]-n[0];this.prevDistanceOfRange!==o&&(this.prevDistanceOfRange=o,this.reverseMove=i,this.eventBus.fire("zoom",n))},_setIsShowTooltipAfterZoomFlag:function(t,e){var i=this._calculateLayerPosition(t,e,!1).x,n=this._calculateLayerPosition(t,e).x;this.isShowTooltipAfterZoom=i===n},_onMouseupAfterDrag:function(t){var e,i=this._findDataForZoomable(t.clientX,t.clientY);this._unbindDragEvent(),tui.util.isNull(this.dragStartIndexes)?(e=t.target||t.srcElement,a.hasClass(e,o.CLASS_NAME_RESET_ZOOM_BTN)?(this._hideTooltip(),this.prevDistanceOfRange=null,this.eventBus.fire("resetZoom")):n.prototype._onClick.call(this,t)):this.dragStartIndexes&&i?(this.dragEndIndexes=i.indexes,this._setIsShowTooltipAfterZoomFlag(t.clientX,t.clientY),this._hideDragSelection(),this._fireZoom(this.dragStartIndexes.groupIndex,this.dragEndIndexes.groupIndex)):(this._setIsShowTooltipAfterZoomFlag(t.clientX,t.clientY),this._hideDragSelection()),this.startClientPosition=null,this.dragStartIndexes=null,this.startLayerX=null,this.afterMouseup=!0},_renderResetZoomBtn:function(){var t=a.create("DIV",o.CLASS_NAME_RESET_ZOOM_BTN);return t.innerHTML="Reset Zoom",t},zoom:function(t){this.prevFoundData=null,this.rerender(t),this._updateDimensionForDragSelection(this.dragSelectionElement),this.resetZoomBtn?t.isResetZoom&&(this.mouseEventDetectorContainer.removeChild(this.resetZoomBtn),this.resetZoomBtn=null):(this.resetZoomBtn=this._renderResetZoomBtn(),a.append(this.mouseEventDetectorContainer,this.resetZoomBtn))}};t.exports=h},function(t,e,i){"use strict";var n=i(5),o=i(6),a=Array.prototype.concat,r=tui.util.defineClass({init:function(t){this.data=this._makeData(t),this.lastGroupIndex=0},_makeData:function(t){var e=0,i=t.length,r=tui.util.map(t,function(t,a){var r=t.data.groupPositions||t.data.groupBounds,s=t.chartType;return(n.isLineTypeChart(s)||n.isRadialChart(s))&&(r=o.pivot(r)),e=Math.max(r.length-1,e),tui.util.map(r,function(t,e){return tui.util.map(t,function(t,n){var o=null;return t&&(o={chartType:s,indexes:{groupIndex:e,index:n},bound:t}),i>1&&(o.indexes.legendIndex=a),o})})});return r=a.apply([],r),this.lastGroupIndex=e,tui.util.filter(a.apply([],r),function(t){return!!t})},findData:function(t,e){var i,n=1e5;return e=e||Number.MAX_VALUE,tui.util.forEach(this.data,function(o){var a=t.x-o.bound.left,r=t.y-o.bound.top,s=Math.sqrt(Math.pow(a,2)+Math.pow(r,2));s<e&&s<n&&(n=s,i=o)}),i},findDataByIndexes:function(t){var e=null;return tui.util.forEachArray(this.data,function(i){return i.indexes.groupIndex===t.index&&i.indexes.index===t.seriesIndex&&(e=i),!e}),e},getFirstData:function(t){var e={index:0,seriesIndex:t};return this.findDataByIndexes(e)},getLastData:function(t){var e={index:this.lastGroupIndex,seriesIndex:t};return this.findDataByIndexes(e)}});t.exports=r},function(t,e,i){"use strict";var n=i(2),o=i(49),a=i(24),r=tui.util.defineClass(o,{init:function(t){this.chartType=t.chartType,this.drawingType=n.COMPONENT_TYPE_DOM,this.eventBus=t.eventBus},_renderMouseEventDetectorArea:function(t){a.renderDimension(t,this.layout.dimension),a.renderPosition(t,this.layout.position)},onReceiveSeriesData:function(){},_onClick:function(t){this._onMouseEvent("click",t)},_onMousemove:function(t){this._onMouseEvent("move",t)},_onMouseout:function(t){this._onMouseEvent("move",t)}});function s(t){return new r(t)}s.componentType="mouseEventDetector",t.exports=s},function(t,e,i){"use strict";var n=i(2),o=i(49),a=i(54),r=tui.util.defineClass(o,{init:function(t){o.call(this,t),this.prevIndex=null,this.zoomable=t.zoomable,this.sizeType=this.isVertical?"height":"width",this.zoomable&&(tui.util.extend(this,a),this._initForZoom(t.zoomable))},initMouseEventDetectorData:function(t){o.prototype.initMouseEventDetectorData.call(this,t),this.zoomable&&this._showTooltipAfterZoom()},_findGroupData:function(t,e){var i,n=this._calculateLayerPosition(t,e,!0);return i=this.isVertical?n.x:n.y,{indexes:{groupIndex:this.tickBaseCoordinateModel.findIndex(i)}}},_findDataForZoomable:function(t,e){return this._findGroupData(t,e)},_getFirstData:function(){return{indexes:{groupIndex:0}}},_getLastData:function(){return{indexes:{groupIndex:this.tickBaseCoordinateModel.getLastIndex()}}},_isOuterPosition:function(t,e){var i=this.dimension,n=i.width,o=i.height,a=this.layout.position,r=a.top,s=a.left;return t<s||t>s+n||e<r||e>r+o},_showTooltip:function(t,e){var i=t.indexes.groupIndex,o=(this.isVertical?this.layout.position.left:this.layout.position.top)-n.CHART_PADDING;this.tickBaseCoordinateModel.data.length>i&&(this.prevIndex=i,this.eventBus.fire("showTooltip",{index:i,range:this.tickBaseCoordinateModel.makeRange(i,o),size:this.dimension[this.sizeType],isVertical:this.isVertical,isMoving:e,silent:t.silent}))},_hideTooltip:function(t){t=t||{},this.eventBus.fire("hideTooltip",this.prevIndex,t),this.prevIndex=null},_onMousemove:function(t){var e,i;o.prototype._onMousemove.call(this,t),this.zoomable&&this._isAfterDragMouseup()||(-1===(i=(e=this._findGroupData(t.clientX,t.clientY)).indexes.groupIndex)?this._onMouseout(t):this.prevIndex!==i&&this._showTooltip(e))},_onMouseout:function(t){var e;e=this._calculateLayerPosition(t.clientX,t.clientY,!1),this._isOuterPosition(e.x,e.y)&&!tui.util.isNull(this.prevIndex)&&this._hideTooltip(),o.prototype._onMouseout.call(this)}});function s(t){return new r(t)}s.componentType="mouseEventDetector",t.exports=s},function(t,e,i){"use strict";var n=i(49),o=i(2),a=i(5),r=i(14),s=tui.util.defineClass(n,{init:function(){n.apply(this,arguments),this.prevFoundData=null,this.zoomHistory=[-1],this.historyBackBtn=null},_attachToEventBus:function(){n.prototype._attachToEventBus.call(this),this.eventBus.on("afterZoom",this.onAfterZoom,this)},_showTooltip:function(t){this.eventBus.fire("showTooltip",t)},_hideTooltip:function(t){t=t||{},this.eventBus.fire("hideTooltip",this.prevFoundData,t),this.prevFoundData=null,this.styleCursor(!1)},styleCursor:function(t){var e=this.mouseEventDetectorContainer;e.style.cursor=t?"pointer":"default"},_onMousemove:function(t){var e,i=this._calculateLayerPosition(t.clientX,t.clientY),n=this._findDataFromBoundsCoordinateModel(i);this._isChangedSelectData(this.prevFoundData,n)&&(this.prevFoundData&&this._hideTooltip(),this.prevFoundData=n,n&&(a.isTreemapChart(this.chartType)&&(e=this._getSeriesItemByIndexes(n.indexes),this.styleCursor(e.hasChild)),this._showTooltip(n)))},_zoomHistoryBack:function(){var t=this.zoomHistory[this.zoomHistory.length-2];this.zoomHistory.pop(),this.eventBus.fire("zoom",t),1===this.zoomHistory.length&&(this.mouseEventDetectorContainer.removeChild(this.historyBackBtn),this.historyBackBtn=null)},_getSeriesItemByIndexes:function(t){return this.dataProcessor.getSeriesDataModel(o.CHART_TYPE_TREEMAP).getSeriesItem(t.groupIndex,t.index,!0)},_onClick:function(t){var e,i,s=t.target||t.srcElement;if(n.prototype._onClick.call(this,t),a.isTreemapChart(this.chartType)){if(r.hasClass(s,o.CLASS_NAME_RESET_ZOOM_BTN))return this._hideTooltip(),void this._zoomHistoryBack();if(e=this._calculateLayerPosition(t.clientX,t.clientY),i=this._findDataFromBoundsCoordinateModel(e)){if(!this._getSeriesItemByIndexes(i.indexes).hasChild)return;this._hideTooltip(),this.eventBus.fire("zoom",i.indexes.index)}}},_onMouseout:function(t){var e=this.mouseEventDetectorContainer.getBoundingClientRect(),i=t.clientX,o=t.clientY;e.left<=i&&e.top<=o&&e.right>=i&&e.bottom>=o||(this.prevFoundData&&this._hideTooltip(),n.prototype._onMouseout.call(this))},onAfterZoom:function(t){this.historyBackBtn||(this.historyBackBtn=r.create("DIV",o.CLASS_NAME_RESET_ZOOM_BTN),this.historyBackBtn.innerHTML="< Back",r.append(this.mouseEventDetectorContainer,this.historyBackBtn)),this.zoomHistory[this.zoomHistory.length-1]!==t&&this.zoomHistory.push(t)},findDataByIndexes:function(t){return this.boundsBaseCoordinateModel.findDataByIndexes(t)}});function h(t){return new s(t)}h.componentType="mouseEventDetector",t.exports=h},function(t,e,i){"use strict";var n=i(60),o=i(62),a=i(2),r=i(5),s=tui.util.defineClass(n,{init:function(){n.apply(this,arguments)},_makeBound:function(t,e,i,n,o){return{start:{top:i,left:n,width:0,height:e},end:{top:i,left:o,width:t,height:e}}},_calculateAdditionalLeft:function(t){var e=0;return this.options.divided&&t>0&&(e=this.dimensionMap.yAxis.width+a.OVERLAPPING_WIDTH),e},_makeBarChartBound:function(t,e,i,n,o){var a,r,s,h=t.baseBarSize*n.ratioDistance,u=this._calculateAdditionalLeft(n.value),l=t.baseBarSize*n.startRatio,c=t.basePosition+l+u,d=n.stack!==e.prevStack;return(!i||!this.options.diverging&&d)&&(a=i?this.dataProcessor.findStackIndex(n.stack):o,e.top=e.baseTop+t.pointInterval*a,e.plusLeft=0,e.minusLeft=0),n.value>=0?(r=c+e.plusLeft,e.plusLeft+=h):(e.minusLeft-=h,r=c+e.minusLeft),e.prevStack=n.stack,s=e.top+t.pointInterval-t.barSize/2,this._makeBound(h,t.barSize,s,c,r)},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=r.isValidStackOption(this.options.stackType),n=this.layout.dimension,o=this._makeBaseDataForMakingBound(n.height,n.width);return e.map(function(e,n){var a=n*o.groupSize+t.layout.position.top,r={baseTop:a,top:a,plusLeft:0,minusLeft:0,prevStack:null},s=tui.util.bind(t._makeBarChartBound,t,o,r,i);return e.map(s)})},_calculateTopPositionOfSumLabel:function(t,e){return t.top+(t.height-e+a.TEXT_PADDING)/2}});function h(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="bar",t.chartBackground=i.chart.background,new s(t)}o.mixin(s),h.componentType="series",h.BarChartSeries=s,t.exports=h},function(t,e,i){"use strict";var n=tui.util.browser,o=n.msie&&7===n.version,a=i(2),r=i(14),s=i(5),h=i(24),u=i(7),l=i(61),c=tui.util.defineClass({className:"tui-chart-series-area",init:function(t){var e=t.libType;this.chartType=t.chartType,this.seriesType=t.seriesType||t.chartType,this.componentType=t.componentType,this.dataProcessor=t.dataProcessor,this.eventBus=t.eventBus,this.chartBackground=t.chartBackground,this.options=t.options||{},this.orgTheme=this.theme=t.theme,this.graphRenderer=u.get(e,t.chartType),this.seriesContainer=null,this.seriesLabelContainer=null,this.seriesData=[],this.selectedLegendIndex=null,this.labelShowEffector=null,this.paper=null,this.limit=null,this.aligned=null,this.layout=null,this.dimensionMap=null,this.positionMap=null,this.axisDataMap=null,this.beforeAxisDataMap=null,this.drawingType=a.COMPONENT_TYPE_RAPHAEL,this._attachToEventBus()},_attachToEventBus:function(){var t=tui.util.bind(function(){this.isInitRenderCompleted=!0,this.eventBus.off("load",t)},this);this.eventBus.on(a.PUBLIC_EVENT_PREFIX+"load",t),this.eventBus.on({selectLegend:this.onSelectLegend,selectSeries:this.onSelectSeries,unselectSeries:this.onUnselectSeries,hoverSeries:this.onHoverSeries,hoverOffSeries:this.onHoverOffSeries,showGroupAnimation:this.onShowGroupAnimation,hideGroupAnimation:this.onHideGroupAnimation},this),this.onShowTooltip&&this.eventBus.on("showTooltip",this.onShowTooltip,this),this.onShowGroupTooltipLine&&this.eventBus.on({showGroupTooltipLine:this.onShowGroupTooltipLine,hideGroupTooltipLine:this.onHideGroupTooltipLine},this),this.onClickSeries&&this.eventBus.on({clickSeries:this.onClickSeries,moveSeries:this.onMoveSeries},this)},_getSeriesDataModel:function(){return this.dataProcessor.getSeriesDataModel(this.seriesType)},_makeSeriesData:function(){},getSeriesData:function(){return this.seriesData},_renderSeriesLabel:function(){},_renderSeriesLabelArea:function(t){return this._renderSeriesLabel(t)},_sendBoundsToMouseEventDetector:function(t){this.eventBus.fire("receiveSeriesData",{chartType:this.chartType,data:t})},_renderSeriesArea:function(t,e){var i,n;i=this.dimensionMap.extendedSeries,this.seriesData=n=this._makeSeriesData(),this._sendBoundsToMouseEventDetector(n),(this.hasDataForRendering(n)||"map"===this.chartType)&&(e&&(this.seriesSet=e(i,n,t)),s.isShowLabel(this.options)&&(this.labelSet=this._renderSeriesLabelArea(t)))},_makeParamsForGraphRendering:function(t,e){return tui.util.extend({dimension:t,position:this.layout.position,chartType:this.seriesType,theme:this.theme,options:this.options},e)},_renderGraph:function(t,e,i){var n=this._makeParamsForGraphRendering(t,e);return this.graphRenderer.render(i,n)},_setDataForRendering:function(t){this.paper=t.paper,this.limit=t.limitMap[this.chartType],t.axisDataMap&&t.axisDataMap.xAxis&&(this.aligned=t.axisDataMap.xAxis.aligned),this.layout=t.layout,this.dimensionMap=t.dimensionMap,this.positionMap=t.positionMap,this.axisDataMap=t.axisDataMap},render:function(t){var e;this.paper=t.paper,this._setDataForRendering(t),this.beforeAxisDataMap=this.axisDataMap,t.checkedLegends&&(e=t.checkedLegends[this.seriesType],this.options.colorByPoint||(this.theme=this._getCheckedSeriesTheme(this.orgTheme,e))),this._renderSeriesArea(t.paper,tui.util.bind(this._renderGraph,this)),this.paper.pushDownBackgroundToBottom&&this.paper.pushDownBackgroundToBottom()},_getCheckedSeriesTheme:function(t,e){var i;return e.length?((i=JSON.parse(JSON.stringify(t))).colors=tui.util.filter(i.colors,function(t,i){return e[i]}),i):t},_clearSeriesContainer:function(){this.seriesSet&&this.seriesSet.remove&&this.seriesSet.remove(),this.labelSet&&this.labelSet.remove&&this.labelSet.remove(),this.seriesData=[]},rerender:function(t){var e;this._clearSeriesContainer(),this.dataProcessor.getGroupCount(this.seriesType)&&(t.checkedLegends&&(e=t.checkedLegends[this.seriesType],this.theme=this._getCheckedSeriesTheme(this.orgTheme,e)),this._setDataForRendering(t),this._renderSeriesArea(t.paper,tui.util.bind(this._renderGraph,this)),this.labelShowEffector&&clearInterval(this.labelShowEffector.timerId),!e&&this.isInitRenderCompleted||this.animateComponent(!0),tui.util.isNull(this.selectedLegendIndex)||this.graphRenderer.selectLegend(this.selectedLegendIndex))},_isLabelVisible:function(){return!(!this.options.showLabel&&!this.options.showLegend)},_resizeGraph:function(t,e){return this.graphRenderer.resize(tui.util.extend({dimension:this.dimensionMap.chart},e)),this.seriesSet},resize:function(t){this._setDataForRendering(t),this.labelSet&&this.labelSet.remove&&this.labelSet.remove(),this._renderSeriesArea(t.paper,tui.util.bind(this._resizeGraph,this))},_renderPosition:function(t,e){var i=h.isOldBrowser()?1:0;h.renderPosition(t,{top:e.top-i,left:e.left-2*i})},_getLimitDistanceFromZeroPoint:function(t,e){var i=e.min,n=e.max,o=n-i,a=0,r=0;return i<=0&&n>=0?(a=(o+i)/o*t,r=(o-n)/o*t):i>0&&(a=t),{toMax:a,toMin:r}},_findLabelElement:function(t){return r.hasClass(t,a.CLASS_NAME_SERIES_LABEL)?t:r.findParentByClass(t,a.CLASS_NAME_SERIES_LABEL)},onHoverSeries:function(t,e){e===this.chartType&&this.graphRenderer.showAnimation&&this.graphRenderer.showAnimation(t)},onHoverOffSeries:function(t,e){e===this.chartType&&this.graphRenderer.hideAnimation&&t&&this.graphRenderer.hideAnimation(t)},onShowGroupAnimation:function(t){this.graphRenderer.showGroupAnimation&&this.graphRenderer.showGroupAnimation(t)},onHideGroupAnimation:function(t){this.graphRenderer.hideGroupAnimation&&this.graphRenderer.hideGroupAnimation(t)},animateComponent:function(t){this.graphRenderer.animate&&this.seriesSet?this.graphRenderer.animate(tui.util.bind(this.animateSeriesLabelArea,this,t),this.seriesSet):this.animateSeriesLabelArea(t)},_fireLoadEvent:function(t){t||this.eventBus.fire(a.PUBLIC_EVENT_PREFIX+"load")},animateSeriesLabelArea:function(t){this._isLabelVisible()?o?(this._fireLoadEvent(t),this.labelSet.attr({opacity:1})):this.labelSet&&this.labelSet.length&&l.animateOpacity(this.labelSet,0,1,600):this._fireLoadEvent(t)},_makeExportationSeriesData:function(t){var e,i=t.indexes,n=tui.util.isExisty(i.legendIndex)?i.legendIndex:i.index,o=this.dataProcessor.getLegendItem(n),a=tui.util.isExisty(i.groupIndex)?i.groupIndex:0,r=this._getSeriesDataModel().getSeriesItem(a,i.index);return tui.util.isExisty(r)&&((e={chartType:o.chartType,legend:o.label,legendIndex:n}).index=r.index),e},_executeGraphRenderer:function(t,e){var i,n=!1;return this.eventBus.fire("hideTooltipContainer"),this.seriesLabelContainer&&r.hasClass(this.seriesLabelContainer,"show")&&(r.removeClass(this.seriesLabelContainer,"show"),n=!0),i=this.graphRenderer[e](t),n&&r.addClass(this.seriesLabelContainer,"show"),this.eventBus.fire("showTooltipContainer"),i},onSelectSeries:function(t,e){var i;t.chartType===this.chartType&&(i=a.PUBLIC_EVENT_PREFIX+"selectSeries",this.eventBus.fire(i,this._makeExportationSeriesData(t)),e=!!tui.util.isEmpty(e)||e,this.options.allowSelect&&this.graphRenderer.selectSeries&&e&&this.graphRenderer.selectSeries(t.indexes))},onUnselectSeries:function(t){var e;t.chartType===this.chartType&&(e=a.PUBLIC_EVENT_PREFIX+"unselectSeries",this.eventBus.fire(e,this._makeExportationSeriesData(t)),this.options.allowSelect&&this.graphRenderer.unselectSeries&&this.graphRenderer.unselectSeries(t.indexes))},onSelectLegend:function(t,e){this.seriesType===t||tui.util.isNull(e)||(e=-1),this.selectedLegendIndex=e,this._getSeriesDataModel().getGroupCount()&&this.graphRenderer.selectLegend(e)},showLabel:function(){this.options.showLabel=!0,this.seriesLabelContainer||this._renderSeriesLabelArea(this.paper)},hideLabel:function(){this.options.showLabel=!1,this.seriesLabelContainer&&(r.removeClass(this.seriesLabelContainer,"show"),r.removeClass(this.seriesLabelContainer,"opacity"))},hasDataForRendering:function(t){return!(!t||!t.isAvailable())}});t.exports=c},function(t,e){"use strict";var i=window.Raphael,n={makeLinePath:function(t,e,i){var n,o=[t.left,t.top],a=[e.left,e.top];return n=(i=i||1)%2/2,tui.util.forEachArray(o,function(t,e){t===a[e]&&(o[e]=a[e]=Math.round(t)-n)}),["M"].concat(o).concat("L").concat(a)},renderLine:function(t,e,i,n){var o=t.path([e]),a={stroke:i,"stroke-width":n||2};return"transparent"===i&&(a.stroke="#fff",a["stroke-opacity"]=0),o.attr(a),o},renderText:function(t,e,i,n){var o=t.text(e.left,e.top,i);return n&&(n["dominant-baseline"]?o.node.setAttribute("dominant-baseline",n["dominant-baseline"]):o.node.setAttribute("dominant-baseline","central"),o.attr(n)),o},renderArea:function(t,e,i){var n=t.path(e);return i=tui.util.extend({"stroke-opacity":0},i),n.attr(i),n},renderCircle:function(t,e,i,n){var o=t.circle(e.left,e.top,i);return n&&o.attr(n),o},renderRect:function(t,e,i){var n=t.rect(e.left,e.top,e.width,e.height);return i&&n.attr(i),n},updateRectBound:function(t,e){t.attr({x:e.left,y:e.top,width:e.width,height:e.height})},forEach2dArray:function(t,e){t&&tui.util.forEachArray(t,function(t,i){tui.util.forEachArray(t,function(t,n){e(t,i,n)})})},makeChangedLuminanceColor:function(t,e){return t=t.replace("#",""),e=e||0,"#"+tui.util.map(tui.util.range(3),function(i){var n=parseInt(t.substr(2*i,2),16),o=n+n*e;return o=Math.round(Math.min(Math.max(0,o),255)).toString(16),tui.chart.renderUtil.formatToZeroFill(o,2)}).join("")},getRenderedTextSize:function(t,e,n){var o=i(document.body,100,100),a=o.text(0,0,t).attr({"font-size":e,"font-family":n}),r=a.getBBox();return a.remove(),o.remove(),{width:r.width,height:r.height}},animateOpacity:function(t,e,n,a){var r=o(a)?a:600,s=o(e)?e:0,h=o(n)?n:1,u=i.animation({opacity:h},r);t.attr({opacity:s}),t.animate(u)}};function o(t){return tui.util.isExisty(t)&&"number"==typeof t}t.exports=n},function(t,e,i){"use strict";var n=i(2),o=i(63),a=i(5),r=i(23),s=i(24),h=i(61),u=tui.util.defineClass({_makeSeriesData:function(){var t=this._makeBounds(this.layout.dimension);return this.groupBounds=t,{groupBounds:t,seriesDataModel:this._getSeriesDataModel(),isAvailable:function(){return t&&t.length>0}}},_getBarWidthOptionSize:function(t,e){var i=0;return e&&(e/2>=t?e=2*t:e<0&&(e=0),i=e),i},_calculateAdditionalPosition:function(t,e,i){var n=0;return e&&e<t&&(n=t/2+(t-e)*i/2),n},_makeBaseDataForMakingBound:function(t,e){var i,o,r,s,h,u,l=a.isValidStackOption(this.options.stackType),c=this._getSeriesDataModel(),d=t/c.getGroupCount(),p=-this.layout.position.top+n.CHART_PADDING,f=this._getLimitDistanceFromZeroPoint(e,this.limit).toMin;return i=a.isColumnChart(this.chartType)?p:a.isBoxplotChart(this.chartType)?this.layout.position.top-n.CHART_PADDING:this.layout.position.left,c.rawSeriesData.length>0&&(o=.8*(h=d/((l?this.options.diverging?1:this.dataProcessor.getStackCount(this.seriesType):c.getFirstSeriesGroup().getSeriesItemCount())+1)),r=this.options.barWidth||this.options.pointWidth,o=this._getBarWidthOptionSize(h,r)||o,s=f+i,a.isColumnChart(this.chartType)&&(s=e-s),a.isBoxplotChart(this.chartType)&&f&&(s-=2*f),u={baseBarSize:e,groupSize:d,barSize:o,pointInterval:h,firstAdditionalPosition:h,basePosition:s}),u},_renderNormalSeriesLabel:function(t){var e,i=this.graphRenderer,n=this._getSeriesDataModel(),r=this.seriesData.groupBounds,s=this.theme.label,h=this.selectedLegendIndex,u=n.map(function(t){return t.map(function(t){var e={end:t.endLabel};return tui.util.isExisty(t.start)&&(e.start=t.startLabel),e})});return e=a.isBarChart(this.chartType)?o.boundsToLabelPositionsForBarChart(n,r,s):o.boundsToLabelPositionsForColumnChart(n,r,s),i.renderSeriesLabel(t,e,u,s,h)},_makeSumValues:function(t){var e=r.sum(t);return s.formatValue(e,this.dataProcessor.getFormatFunctions(),this.chartType,"seires")},_makeStackedLabelPosition:function(t){return{left:t.left+t.width/2,top:t.top+t.height/2}},_makeStackedLabelPositions:function(t){var e=this;return t.seriesGroup.map(function(i,n){var o,a=t.bounds[n];return a&&i&&(o=e._makeStackedLabelPosition(a.end)),{end:o}})},getGroupLabels:function(t,e,i){var n=a.isNormalStack(this.options.stackType);return t.map(function(t){var o,a=t.map(function(t){return{end:t.endLabel}});return n&&(e.push(r.sumPlusValues(t.pluck("value"))),(o=r.sumMinusValues(t.pluck("value")))<0&&i.push(o)),a})},getGroupPositions:function(t,e){var i=this;return t.map(function(t,n){return i._makeStackedLabelPositions({seriesGroup:t,bounds:e[n]})})},_renderStackedSeriesLabel:function(t){var e=this,i=[],o=[],r=this.theme.label,u=this.seriesData.groupBounds,l=this._getSeriesDataModel(),c=this.getGroupPositions(l,u),d=this.getGroupLabels(l,i,o),p=a.isNormalStack(this.options.stackType),f=a.isBarChart(this.chartType),m=f?"width":"height",g=f?"left":"top",_=f?1:-1;return p&&(tui.util.forEach(d,function(t,n){var a=i[n],r=o[n];r<0&&e.options.diverging&&(r*=-1),t.push({end:s.formatToComma(a)}),o.length&&t.push({end:s.formatToComma(r)})}),tui.util.forEach(c,function(t,a){var s=u[a],l=s[s.length-1].end,c=s[Math.max(parseInt(s.length/2,10),1)-1].end,d=e._makeStackedLabelPosition(l),p=e._makeStackedLabelPosition(c),f=i[a],T=o[a],v=h.getRenderedTextSize(f,r.fontSize,r.fontFamily),x=h.getRenderedTextSize(T,r.fontSize,r.fontFamily),y=(l[m]+v[m])/2,D=(c[m]+x[m])/2;d[g]+=(y+n.LEGEND_LABEL_LEFT_PADDING)*_,p[g]-=(D+n.LEGEND_LABEL_LEFT_PADDING)*_,t.push({end:d}),o.length&&t.push({end:p})})),this.graphRenderer.renderSeriesLabel(t,c,d,r,!0)},_renderSeriesLabel:function(t){return this.options.stackType?this._renderStackedSeriesLabel(t):this._renderNormalSeriesLabel(t)}});u.mixin=function(t){tui.util.extend(t.prototype,u.prototype)},t.exports=u},function(t,e,i){"use strict";var n=i(2),o=i(24),a={_calculateLeftPositionForCenterAlign:function(t){return t.left+t.width/2},_calculateTopPositionForMiddleAlign:function(t){return t.top+t.height/2},_makePositionForBoundType:function(t){return{left:this._calculateLeftPositionForCenterAlign(t),top:this._calculateTopPositionForMiddleAlign(t)}},_makePositionMap:function(t,e,i,n,o){var a=t.value,r=a>=0,s={end:o(e,i,t.endLabel||t.label,n,r)};return t.isRange&&(r=a<0,s.start=o(e,i,t.startLabel,n,r)),s},boundsToLabelPositions:function(t,e,i,a,r){var s=this,h=o.getRenderedLabelHeight(n.MAX_HEIGHT_WORLD,i);return a=a||tui.util.bind(this._makePositionForBoundType,this),r=!!r,t.map(function(t,n){var o=e[n];return t.map(function(t,e){var n=o[e].end;return s._makePositionMap(t,n,h,i,a)})},r)},_makePositionForBarChart:function(t,e,i,a,r){var s=o.getRenderedLabelWidth(i,a),h=t.left;return r?h+=t.width+n.SERIES_LABEL_PADDING:h-=s+n.SERIES_LABEL_PADDING,{left:h,top:this._calculateTopPositionForMiddleAlign(t)}},boundsToLabelPositionsForBarChart:function(t,e,i){var n=tui.util.bind(this._makePositionForBarChart,this);return this.boundsToLabelPositions(t,e,i,n)},_makePositionForColumnChart:function(t,e,i,o,a){var r=t.top;return a?r-=e+n.SERIES_LABEL_PADDING:r+=t.height+n.SERIES_LABEL_PADDING,{left:this._calculateLeftPositionForCenterAlign(t),top:r}},boundsToLabelPositionsForColumnChart:function(t,e,i){var n=tui.util.bind(this._makePositionForColumnChart,this);return this.boundsToLabelPositions(t,e,i,n)},boundsToLabelPostionsForTreemap:function(t,e){var i=this;return tui.util.map(t,function(t){var n,o=e[t.id];return o&&(n=i._makePositionForBoundType(o)),n})}};t.exports=a},function(t,e,i){"use strict";var n=i(60),o=i(62),a=i(2),r=i(5),s=i(24),h=tui.util.defineClass(n,{init:function(){n.apply(this,arguments)},_makeBound:function(t,e,i,n,o){return{start:{top:n,left:i,width:t,height:0},end:{top:o,left:i,width:t,height:e}}},_makeColumnChartBound:function(t,e,i,n,o){var r,s,h,u=Math.abs(t.baseBarSize*n.ratioDistance),l=t.baseBarSize*n.startRatio,c=t.basePosition+l+a.SERIES_EXPAND_SIZE,d=n.stack!==e.prevStack;return(!i||!this.options.diverging&&d)&&(r=i?this.dataProcessor.findStackIndex(n.stack):o,e.left=e.baseLeft+t.pointInterval*r,e.plusTop=0,e.minusTop=0),n.value>=0?(e.plusTop-=u,s=c+e.plusTop):(s=c+e.minusTop,e.minusTop+=u),e.prevStack=n.stack,h=e.left+t.pointInterval-t.barSize/2,this._makeBound(t.barSize,u,h,c,s)},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=r.isValidStackOption(this.options.stackType),n=this.layout.dimension,o=this._makeBaseDataForMakingBound(n.width,n.height);return e.map(function(e,n){var a=n*o.groupSize+t.layout.position.left,r={baseLeft:a,left:a,plusTop:0,minusTop:0,prevStack:null},s=tui.util.bind(t._makeColumnChartBound,t,o,r,i);return e.map(s)})},_calculateLeftPositionOfSumLabel:function(t,e){var i=s.getRenderedLabelWidth(e,this.theme.label);return t.left+(t.width-i+a.TEXT_PADDING)/2}});function u(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="column",t.chartBackground=i.chart.background,new h(t)}o.mixin(h),u.componentType="series",u.ColumnChartSeries=h,t.exports=u},function(t,e,i){"use strict";var n=i(60),o=i(66),a=tui.util.defineClass(n,{init:function(){n.apply(this,arguments),this.movingAnimation=null},_makePositions:function(t){return this._makeBasicPositions(t)},_makeSeriesData:function(){var t=this._makePositions();return{chartBackground:this.chartBackground,groupPositions:t,isAvailable:function(){return t&&t.length>0}}},rerender:function(t){return this._cancelMovingAnimation(),n.prototype.rerender.call(this,t)}});function r(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="line",t.chartBackground=i.chart.background,new a(t)}o.mixin(a),r.componentType="series",t.exports=r},function(t,e,i){"use strict";var n=i(6),o=i(2),a=i(5),r=i(23),s=i(24),h=tui.util.defineClass({_makePositionsForDefaultType:function(t){var e,i=this.layout.dimension,n=this._getSeriesDataModel(),o=t||i.width||0,a=i.height,r=n.getGroupCount(),s=this.layout.position.top,h=this.layout.position.left;return this.aligned?e=o/(r>1?r-1:r):h+=(e=o/r)/2,n.map(function(t){return t.map(function(t,i){var n;return tui.util.isNull(t.end)||(n={left:h+e*i,top:s+a-t.ratio*a},tui.util.isExisty(t.startRatio)&&(n.startTop=s+a-t.startRatio*a)),n})},!0)},_makePositionForCoordinateType:function(t){var e=this.layout.dimension,i=this._getSeriesDataModel(),n=t||e.width||0,a=e.height,s=this.axisDataMap.xAxis,h=0,u=this.layout.position.top,l=this.layout.position.left;return s.sizeRatio&&(h=r.multiply(n,s.positionRatio),n=r.multiply(n,s.sizeRatio)),i.map(function(t){return t.map(function(t){var e;return tui.util.isNull(t.end)||(e={left:l+t.ratioMap.x*n+h,top:u+a-t.ratioMap.y*a},tui.util.isExisty(t.ratioMap.start)&&(e.startTop=a-t.ratioMap.start*a+o.SERIES_EXPAND_SIZE)),e})},!0)},_makeBasicPositions:function(t){return this.dataProcessor.isCoordinateType()?this._makePositionForCoordinateType(t):this._makePositionsForDefaultType(t)},_calculateLabelPositionTop:function(t,e,i,n){var r=t.top;return a.isValidStackOption(this.options.stackType)?(t.startTop+r-i)/2+1:e>=0&&!n||e<0&&n?r-i-o.SERIES_LABEL_PADDING:r+o.SERIES_LABEL_PADDING},_makeLabelPosition:function(t,e,i,n,o){return{left:t.left,top:this._calculateLabelPositionTop(t,n,e/2,o)}},_getLabelPositions:function(t,e){var i=this,o=n.pivot(this.seriesData.groupPositions),a=t.getFirstItemLabel(),r=s.getRenderedLabelHeight(a,e);return t.map(function(t,e){return t.map(function(t,n){var a=o[e][n],s={end:i._makeLabelPosition(a,r,t.endLabel,t.end)};return t.isRange&&(a.top=a.startTop,s.start=i._makeLabelPosition(a,r,t.startLabel,t.start)),s})})},_getLabelTexts:function(t){return t.map(function(t){return t.map(function(t){var e={end:t.endLabel};return t.isRange&&(e.start=t.startLabel),e})})},_renderSeriesLabel:function(t){var e=this.theme.label,i=this._getSeriesDataModel(),n=this._getLabelTexts(i),o=this._getLabelPositions(i,e);return this.graphRenderer.renderSeriesLabel(t,o,n,e)},onShowGroupTooltipLine:function(t){this.graphRenderer.showGroupTooltipLine&&this.graphRenderer.showGroupTooltipLine(t,this.layout)},onHideGroupTooltipLine:function(){this.seriesData&&this.seriesData.isAvailable()&&this.graphRenderer.hideGroupTooltipLine&&this.graphRenderer.hideGroupTooltipLine()},zoom:function(t){this._cancelMovingAnimation(),this._clearSeriesContainer(t.paper),this._setDataForRendering(t),this._renderSeriesArea(t.paper,tui.util.bind(this._renderGraph,this)),this.animateComponent(!0),tui.util.isNull(this.selectedLegendIndex)||this.graphRenderer.selectLegend(this.selectedLegendIndex)},_isChangedLimit:function(t,e){return t.min!==e.min||t.max!==e.max},_isChangedAxisLimit:function(){var t=this.beforeAxisDataMap,e=this.axisDataMap,i=!0;return t&&(i=this._isChangedLimit(t.yAxis.limit,e.yAxis.limit),e.xAxis.limit&&(i=i||this._isChangedLimit(t.xAxis.limit,e.xAxis.limit))),this.beforeAxisDataMap=e,i},_animate:function(t){var e=this,i=o.ADDING_DATA_ANIMATION_DURATION;this._isChangedAxisLimit()&&this.seriesLabelContainer&&(this.seriesLabelContainer.innerHTML=""),t&&(this.movingAnimation=s.startAnimation(i,t,function(){e.movingAnimation=null}))},_makeZeroTopForAddingData:function(){var t=this.layout.dimension.height,e=this.axisDataMap.yAxis.limit;return this._getLimitDistanceFromZeroPoint(t,e).toMax+o.SERIES_EXPAND_SIZE},animateForAddingData:function(t){var e,i,n,o,a=this.dimensionMap.extendedSeries,r=this.layout.dimension.width,s=t.tickSize,h=this.options.shifting;this.limit=t.limitMap[this.chartType],this.axisDataMap=t.axisDataMap,e=this._makeSeriesData(),i=this._makeParamsForGraphRendering(a,e),h&&(r+=s),n=this._makePositions(r),o=this._makeZeroTopForAddingData(),this.graphRenderer.animateForAddingData(i,s,n,h,o)},_cancelMovingAnimation:function(){this.movingAnimation&&(cancelAnimationFrame(this.movingAnimation.id),this.movingAnimation=null)}});h.mixin=function(t){tui.util.extend(t.prototype,h.prototype)},t.exports=h},function(t,e,i){"use strict";var n=i(60),o=i(2),a=i(28),r=tui.util.defineClass(n,{init:function(){n.apply(this,arguments),this.options=tui.util.extend({showDot:!0,showArea:!0},this.options),this.movingAnimation=null,this.drawingType=o.COMPONENT_TYPE_RAPHAEL},_makePositionsForRadial:function(t,e){var i,n=this.layout,r=n.dimension,s=r.width-o.RADIAL_PLOT_PADDING-o.RADIAL_MARGIN_FOR_CATEGORY,h=r.height-o.RADIAL_PLOT_PADDING-o.RADIAL_MARGIN_FOR_CATEGORY,u=s/2+o.RADIAL_PLOT_PADDING/2+o.RADIAL_MARGIN_FOR_CATEGORY/2+n.position.left,l=h/2-o.RADIAL_PLOT_PADDING/2-o.RADIAL_MARGIN_FOR_CATEGORY/2-n.position.top,c=360/e;return i=Math.min(s,h)/2,tui.util.map(t,function(t){var e=tui.util.map(t,function(t,e){var n,o,r,s,d;return tui.util.isNull(t.end)||(d=t.ratio*i,o=l+d,r=360-c*e,n={left:(s=a.rotatePointAroundOrigin(u,l,u,o,r)).x,top:h-s.y}),n});return e.push(e[0]),e},!0)},_getSeriesGroups:function(){return this._getSeriesDataModel().map(function(t){return t.map(function(t){return t})},!0)},_makeSeriesData:function(){var t=this._getSeriesGroups(),e=this._makePositionsForRadial(t,this._getSeriesDataModel().getGroupCount());return{groupPositions:e,isAvailable:function(){return e&&e.length>0}}},rerender:function(t){return n.prototype.rerender.call(this,t)}});function s(t){var e=t.chartOptions.chartType,i=t.chartOptions.libType,n=t.chartTheme;return t.libType=i,t.chartType=e,t.chartBackground=n.background,new r(t)}s.componentType="series",s.RadialChartSeries=r,t.exports=s},function(t,e,i){"use strict";var n=i(60),o=i(66),a=i(5),r=tui.util.defineClass(n,{init:function(){n.apply(this,arguments),this.movingAnimation=null},_makePositionTopOfZeroPoint:function(){var t=this.layout.dimension,e=this.axisDataMap.yAxis.limit,i=this.layout.position.top,n=this._getLimitDistanceFromZeroPoint(t.height,e).toMax+i;return e.min>=0&&!n&&(n=t.height),n},_makeStackedPositions:function(t){var e=this.layout.dimension.height,i=this.layout.position.top,n=this._makePositionTopOfZeroPoint(),o=[];return tui.util.map(t,function(t){return tui.util.map(t,function(t,a){var r=o[a]||n,s=t?t.top:0,h=t?r-(e-s+i):r;return t&&(t.startTop=r,t.top=h),o[a]=h,t})})},_makePositions:function(t){var e=this._makeBasicPositions(t);return a.isValidStackOption(this.options.stackType)&&(e=this._makeStackedPositions(e)),e},_makeSeriesData:function(){var t=this.layout.dimension,e=this.layout.position.top,i=this._getLimitDistanceFromZeroPoint(t.height,this.limit).toMax+e,n=this._makePositions();return{chartBackground:this.chartBackground,groupPositions:n,hasRangeData:this._getSeriesDataModel().hasRangeData(),zeroTop:i,isAvailable:function(){return n&&n.length>0}}},rerender:function(t){return this._cancelMovingAnimation(),n.prototype.rerender.call(this,t)}});function s(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="area",t.chartBackground=i.chart.background,new r(t)}o.mixin(r),s.componentType="series",s.AreaChartSeries=r,t.exports=s},function(t,e,i){"use strict";var n=i(2),o=i(60),a=i(70),r=tui.util.defineClass(o,{init:function(){this.prevClickedIndex=null,this.maxRadius=null,this.drawingType=n.COMPONENT_TYPE_RAPHAEL,o.apply(this,arguments)},_calculateStep:function(){var t,e,i=0,n=this.dataProcessor.isXCountGreaterThanYCount(this.chartType);return this.dataProcessor.hasCategories(n)&&(t=this.layout.dimension,e=this.dataProcessor.getCategoryCount(n),i=(n?t.height:t.width)/e),i},_makeBound:function(t,e,i){var n=this.layout.dimension,o=this.layout.position,a=tui.util.isExisty(t.x)?t.x*n.width:e,r=tui.util.isExisty(t.y)?t.y*n.height:e;return{left:o.left+a,top:o.top+n.height-r,radius:Math.max(i*t.r,2)}},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=this.maxRadius,n=this._calculateStep(),o=n?n/2:0;return e.map(function(e,a){var r=o+n*a;return e.map(function(e){return e&&e.ratioMap?t._makeBound(e.ratioMap,r,i):null})})},_setDataForRendering:function(t){this.maxRadius=t.maxRadius,o.prototype._setDataForRendering.call(this,t)}});function s(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="bubble",t.chartBackground=i.chart.background,new r(t)}a.mixin(r),s.componentType="series",s.BubbleChartSeries=r,t.exports=s},function(t,e){"use strict";var i=tui.util.defineClass({_makeSeriesData:function(){var t=this._makeBounds();return{groupBounds:t,seriesDataModel:this._getSeriesDataModel(),isAvailable:function(){return t&&t.length>0}}},showTooltip:function(t,e,i,n,o){this.eventBus.fire("showTooltip",tui.util.extend({indexes:{groupIndex:i,index:n},mousePosition:o},t))},hideTooltip:function(){this.eventBus.fire("hideTooltip")},_renderGraph:function(t,e,i){var n={showTooltip:tui.util.bind(this.showTooltip,this,{chartType:this.chartType}),hideTooltip:tui.util.bind(this.hideTooltip,this)},o=this._makeParamsForGraphRendering(t,e);return this.graphRenderer.render(i,o,n)},onClickSeries:function(t){var e,i=this._executeGraphRenderer(t,"findIndexes"),n=this.prevClickedIndexes,o=this.options.allowSelect;i&&n&&(this.onUnselectSeries({indexes:n}),this.prevClickedIndexes=null),i&&(e=!n||i.index!==n.index||i.groupIndex!==n.groupIndex,o&&!e||(this.onSelectSeries({chartType:this.chartType,indexes:i},e),o&&(this.prevClickedIndexes=i)))},onMoveSeries:function(t){this._executeGraphRenderer(t,"moveMouseOnSeries")}});i.mixin=function(t){tui.util.extend(t.prototype,i.prototype)},t.exports=i},function(t,e,i){"use strict";var n=i(60),o=i(70),a=i(2),r=tui.util.defineClass(n,{init:function(){this.prevClickedIndex=null,n.apply(this,arguments)},_makeBound:function(t){var e=this.layout.dimension,i=this.layout.position;return{left:i.left+t.x*e.width,top:e.height-t.y*e.height+i.top,radius:a.SCATTER_RADIUS}},_makeBounds:function(){var t=this;return this._getSeriesDataModel().map(function(e){return e.map(function(e){return e&&e.ratioMap?t._makeBound(e.ratioMap):null})})}});function s(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="scatter",t.chartBackground=i.chart.background,new r(t)}o.mixin(r),s.componentType="series",s.ScatterChartSeries=r,t.exports=s},function(t,e,i){"use strict";var n=i(60),o=i(2),a=tui.util.browser,r=a.msie&&a.version<=8,s=tui.util.defineClass(n,{init:function(t){this.basePosition={left:0,top:0},this.zoomMagn=1,this.mapRatio=1,this.graphDimension={},this.limitPosition={},this.mapModel=t.mapModel,this.colorSpectrum=t.colorSpectrum,this.prevPosition=null,this.prevMovedIndex=null,this.isDrag=!1,this.startPosition=null,n.call(this,t)},_attachToEventBus:function(){n.prototype._attachToEventBus.call(this),r||this.eventBus.on({dragStartMapSeries:this.onDragStartMapSeries,dragMapSeries:this.onDragMapSeries,dragEndMapSeries:this.onDragEndMapSeries,zoomMap:this.onZoomMap},this)},_setMapRatio:function(t){var e=this.layout.dimension,i=t||this.mapModel.getMapDimension(),n=e.width/i.width,o=e.height/i.height;this.mapRatio=Math.min(n,o)},_setGraphDimension:function(){var t=this.layout.dimension;this.graphDimension={width:t.width*this.zoomMagn,height:t.height*this.zoomMagn}},render:function(t){n.prototype.render.call(this,t),this._setMapRatio()},_setLimitPositionToMoveMap:function(){var t=this.layout.dimension,e=this.graphDimension;this.limitPosition={left:t.width-e.width,top:t.height-e.height}},_renderGraph:function(){this._setGraphDimension(),this._setLimitPositionToMoveMap(),this.graphRenderer.render(this.paper,{colorSpectrum:this.colorSpectrum,mapModel:this.mapModel,layout:this.layout,theme:this.theme})},_renderSeriesLabel:function(){var t=this.mapModel.getLabelData(this.zoomMagn*this.mapRatio);return this.graphRenderer.renderSeriesLabels(this.paper,t,this.theme.label)},_renderSeriesArea:function(t,e,i){n.prototype._renderSeriesArea.call(this,t,e,i)},_adjustMapPosition:function(t){return{left:Math.max(Math.min(t.left,0),this.limitPosition.left),top:Math.max(Math.min(t.top,0),this.limitPosition.top)}},_updateBasePositionForZoom:function(t,e,i){var n=this.basePosition,o=n.left-e.left/2,a=n.top-e.top/2,r={left:o*i+this.limitPosition.left/2,top:a*i+this.limitPosition.top/2};this.basePosition=this._adjustMapPosition(r)},_zoom:function(t,e){var i=this.graphDimension,n=this.limitPosition;this._setGraphDimension(),this._setLimitPositionToMoveMap(),this._updateBasePositionForZoom(i,n,t),this._setMapRatio(this.graphDimension),this.graphRenderer.scaleMapPaths(t,e,this.mapRatio,i,i)},_updatePositionsToResize:function(t){var e=this.mapRatio/t;this.basePosition.left*=e,this.basePosition.top*=e,this.limitPosition.left*=e,this.limitPosition.top*=e},onClickSeries:function(t){var e=this._executeGraphRenderer(t,"findSectorIndex");tui.util.isNull(e)||this.eventBus.fire("selectSeries",{chartType:this.chartType,index:e,code:this.mapModel.getDatum(e).code})},_isChangedPosition:function(t,e){return!t||t.left!==e.left||t.top!==e.top},_showWedge:function(t){var e=this.mapModel.getDatum(t);tui.util.isUndefined(e.ratio)||this.eventBus.fire("showWedge",e.ratio)},_showTooltip:function(t,e){this.eventBus.fire("showTooltip",{chartType:this.chartType,indexes:{index:t},mousePosition:{left:e.left,top:e.top-o.TOOLTIP_GAP}})},onMoveSeries:function(t){var e,i=this._executeGraphRenderer(t,"findSectorIndex");tui.util.isNull(i)?tui.util.isNull(this.prevMovedIndex)||(this.graphRenderer.restoreColor(this.prevMovedIndex),this.eventBus.fire("hideTooltip"),this.prevMovedIndex=null):(this.prevMovedIndex!==i&&(tui.util.isNull(this.prevMovedIndex)||(this.graphRenderer.restoreColor(this.prevMovedIndex),this.eventBus.fire("hideTooltip")),this.graphRenderer.changeColor(i)),this._isChangedPosition(this.prevPosition,t)&&(e=this.paper.canvas.getBoundingClientRect(),this._showTooltip(i,{left:t.left-e.left,top:t.top-e.top}),this.prevMovedIndex=i),this._showWedge(i)),this.prevPosition=t},onDragStartMapSeries:function(t){this.startPosition={left:t.left,top:t.top}},_movePosition:function(t,e){var i={x:(e.left-t.left)*this.mapRatio,y:(e.top-t.top)*this.mapRatio};this.graphRenderer.moveMapPaths(i,this.graphDimension)},onDragMapSeries:function(t){this._movePosition(this.startPosition,t),this.startPosition=t,this.isDrag||(this.isDrag=!0,this.eventBus.fire("hideTooltip"))},onDragEndMapSeries:function(){this.isDrag=!1},onZoomMap:function(t,e){var i=t/this.zoomMagn,n=this.layout.position,a=e||{left:this.layout.dimension.width/2,top:this.layout.dimension.height/2};this.zoomMagn=t,this._zoom(i,{left:a.left-n.left,top:a.top-n.top}),this.eventBus.fire(o.PUBLIC_EVENT_PREFIX+"zoom",t)},_makeExportationSeriesData:function(t){return t}});function h(t){var e=t.chartOptions.libType;return t.libType=e,t.chartType="map",new s(t)}h.componentType="series",h.MapChartSeries=s,t.exports=h},function(t,e,i){"use strict";var n=i(60),o=i(2),a=i(5),r=tui.util.defineClass(n,{init:function(t){n.call(this,t),this.isCombo=!!t.isCombo,this.isShowOuterLabel=a.isShowOuterLabel(this.options),this.quadrantRange=null,this.prevClickedIndex=null,this.drawingType=o.COMPONENT_TYPE_RAPHAEL,this._setDefaultOptions()},_makeValidAngle:function(t,e){return tui.util.isUndefined(t)?t=e:t<0?t=o.ANGLE_360-Math.abs(t)%o.ANGLE_360:t>0&&(t%=o.ANGLE_360),t},_transformRadiusRange:function(t){return t=t||["0%","100%"],tui.util.map(t,function(t){var e=.01*parseInt(t,10);return Math.max(Math.min(e,1),0)})},_setDefaultOptions:function(){var t=this.options;t.startAngle=this._makeValidAngle(t.startAngle,0),t.endAngle=this._makeValidAngle(t.endAngle,t.startAngle),t.radiusRange=this._transformRadiusRange(t.radiusRange),1===t.radiusRange.length&&t.radiusRange.unshift(0)},_calculateAngleForRendering:function(){var t=this.options.startAngle,e=this.options.endAngle;return t<e?e-t:t>e?o.ANGLE_360-(t-e):o.ANGLE_360},_makeSectorData:function(t){var e=this,i=this._getSeriesDataModel().getFirstSeriesGroup(),n=t.cx,o=t.cy,a=t.r,r=this.options.startAngle,s=this._calculateAngleForRendering(),h=this.options.radiusRange[0],u=.5*a;return h&&(u+=u*h),i?i.map(function(t){var i=t?t.ratio:0,h=s*i,l=r+h,c={start:{startAngle:r,endAngle:r},end:{startAngle:r,endAngle:l}},d={cx:n,cy:o,angle:r+h/2};return r=l,{ratio:i,angles:c,centerPosition:e._getArcPosition(tui.util.extend({r:u},d)),outerPosition:{start:e._getArcPosition(tui.util.extend({r:a},d)),middle:e._getArcPosition(tui.util.extend({r:a+10},d))}}}):null},_makeSeriesData:function(){var t=this._makeCircleBound(),e=this._makeSectorData(t);return{chartBackground:this.chartBackground,circleBound:t,sectorData:e,isAvailable:function(){return e&&e.length>0}}},_getQuadrantFromAngle:function(t,e){var i=parseInt(t/o.ANGLE_90,10)+1;return e&&t%o.ANGLE_90==0&&(i+=1===i?3:-1),i},_getRangeForQuadrant:function(){return this.quadrantRange||(this.quadrantRange={start:this._getQuadrantFromAngle(this.options.startAngle),end:this._getQuadrantFromAngle(this.options.endAngle,!0)}),this.quadrantRange},_isInQuadrantRange:function(t,e){var i=this._getRangeForQuadrant();return i.start===t&&i.end===e},_calculateBaseSize:function(){var t,e=this.layout.dimension,i=e.width,n=e.height;return this.isCombo||(t=this._getRangeForQuadrant(),this._isInQuadrantRange(2,3)||this._isInQuadrantRange(4,1)?n*=2:this._isInQuadrantRange(1,2)||this._isInQuadrantRange(3,4)?i*=2:t.start===t.end&&(i*=2,n*=2)),Math.min(i,n)},_calculateRadius:function(){var t=this.isShowOuterLabel?o.PIE_GRAPH_SMALL_RATIO:o.PIE_GRAPH_DEFAULT_RATIO;return this._calculateBaseSize()*t*this.options.radiusRange[1]/2},_calculateCenterXY:function(t){var e=this.layout.dimension,i=this.layout.position,n=t/2,o=e.width/2+i.left,a=e.height/2+i.top;return this.isCombo||(this._isInQuadrantRange(1,1)?(o-=n,a+=n):this._isInQuadrantRange(1,2)?o-=n:this._isInQuadrantRange(2,2)?(o-=n,a-=n):this._isInQuadrantRange(2,3)?a-=n:this._isInQuadrantRange(3,3)?(o+=n,a-=n):this._isInQuadrantRange(3,4)?o+=n:this._isInQuadrantRange(4,1)?a+=n:this._isInQuadrantRange(4,4)&&(o+=n,a+=n)),{cx:o,cy:a}},_makeCircleBound:function(){var t=this._calculateRadius(),e=this._calculateCenterXY(t);return tui.util.extend({r:t},e)},_getArcPosition:function(t){return{left:t.cx+t.r*Math.sin(t.angle*o.RAD),top:t.cy-t.r*Math.cos(t.angle*o.RAD)}},_renderGraph:function(t,e,i){var n={showTooltip:tui.util.bind(this.showTooltip,this,{allowNegativeTooltip:!!this.allowNegativeTooltip,seriesType:this.seriesType,chartType:this.chartType}),hideTooltip:tui.util.bind(this.hideTooltip,this)},o=this._makeParamsForGraphRendering(t,e),a=this.seriesType,r=this.dataProcessor.seriesDataModelMap,s=[],h=0;return tui.util.forEach(this.dataProcessor.seriesTypes,function(t){var e=!0;return t!==a?s.push(t):e=!1,e}),tui.util.forEach(s,function(t){h+=r[t].baseGroups.length}),o.additionalIndex=h,this.graphRenderer.render(i,o,n)},resize:function(){n.prototype.resize.apply(this,arguments),this._moveLegendLines()},showTooltip:function(t,e,i,n,o){this.eventBus.fire("showTooltip",tui.util.extend({indexes:{groupIndex:i,index:n},mousePosition:o},t))},hideTooltip:function(){this.eventBus.fire("hideTooltip")},_makeSeriesDataBySelection:function(t){return{indexes:{index:t,groupIndex:t}}},_renderLegendLabel:function(t,e){var i,n=this.dataProcessor.getLegendLabels(this.seriesType);return i=e.funcMoveToPosition?tui.util.map(e.positions,function(t,i){var o=null;return t&&(o=e.funcMoveToPosition(t,n[i])),o}):e.positions,this.graphRenderer.renderLabels(t,i,n,this.theme.label)},_pickPositionsFromSectorData:function(t){return tui.util.map(this.seriesData.sectorData,function(e){return e.ratio?e[t]:null})},_renderCenterLegend:function(t){return this._renderLegendLabel(t,{positions:this._pickPositionsFromSectorData("centerPosition")})},_addEndPosition:function(t,e){tui.util.forEachArray(e,function(e){var i;e&&((i=tui.util.extend({},e.middle)).left<t?i.left-=o.SERIES_OUTER_LABEL_PADDING:i.left+=o.SERIES_OUTER_LABEL_PADDING,e.end=i)})},_moveToOuterPosition:function(t,e,i){var n=e.end,a=n.left,r=n.top,s=this.graphRenderer.getRenderedLabelWidth(i,this.theme.label)/2+o.SERIES_LABEL_PADDING;return a<t?a-=s:a+=s,{left:a,top:r}},_renderOuterLegend:function(t){var e=this.getSeriesData().circleBound.cx,i=this._pickPositionsFromSectorData("outerPosition"),n=tui.util.filter(i,function(t){return t});return this._addEndPosition(e,n),this.graphRenderer.renderLegendLines(n),this._renderLegendLabel(t,{positions:i,funcMoveToPosition:tui.util.bind(this._moveToOuterPosition,this,e),separator:":&nbsp;"})},_renderSeriesLabel:function(t){return a.isLabelAlignOuter(this.options.labelAlign)?this._renderOuterLegend(t):this._renderCenterLegend(t)},animateSeriesLabelArea:function(){this.graphRenderer.animateLegendLines(this.selectedLegendIndex),n.prototype.animateSeriesLabelArea.call(this)},_moveLegendLines:function(){var t=this.dimensionMap.chart.width/2,e=this._pickPositionsFromSectorData("outerPosition"),i=tui.util.filter(e,function(t){return t});this._addEndPosition(t,i),this.graphRenderer.moveLegendLines(i)},_isDetectedLabel:function(t){var e=document.elementFromPoint(t.left,t.top);return tui.util.isString(e.className)},onClickSeries:function(t){var e,i,n=this._executeGraphRenderer(t,"findSectorInfo"),o=this.prevClickedIndex,a=this.options.allowSelect;(n||this._isDetectedLabel(t))&&tui.util.isExisty(o)&&a&&(this.onUnselectSeries({indexes:{index:o}}),this.prevClickedIndex=null),n&&n.chartType===this.seriesType&&(i=(e=n.index)>-1&&e!==o,a&&!i||(this.onSelectSeries({chartType:this.chartType,indexes:{index:e,legendIndex:n.legendIndex}},i),a&&e>-1&&(this.prevClickedIndex=e)))},onMoveSeries:function(t){this._executeGraphRenderer(t,"moveMouseOnSeries")}});function s(t){var e=t.chartOptions.libType,i=t.chartTheme,n=t.chartOptions.chartType;return t.libType=e,t.chartType="pie","combo"===n&&(t.seriesType=t.name.split("Series")[0],t.isCombo=!0),t.chartBackground=i.chart.background,new r(t)}s.componentType="series",s.PieChartSeries=r,t.exports=s},function(t,e,i){"use strict";var n=i(60),o=i(63),a=tui.util.defineClass(n,{init:function(t){this.colorSpectrum=t.colorSpectrum,n.call(this,t)},_makeSeriesData:function(){var t=this._makeBounds(),e=this._getSeriesDataModel();return{colorSpectrum:this.colorSpectrum,groupBounds:t,seriesDataModel:e,isAvailable:function(){return t&&t.length>0}}},_makeBound:function(t,e,i,n){var o=this.layout.dimension.height;return{end:{left:t*i+this.layout.position.left,top:o-e*(n+1)+this.layout.position.top,width:t,height:e}}},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=this.layout.dimension,n=i.width/this.dataProcessor.getCategoryCount(!1),o=i.height/this.dataProcessor.getCategoryCount(!0);return e.map(function(e,i){return e.map(function(e,a){return t._makeBound(n,o,i,a)})})},onShowTooltip:function(t){var e=this._getSeriesDataModel(),i=t.indexes,n=e.getSeriesItem(i.groupIndex,i.index).ratio;this.eventBus.fire("showWedge",n)},_renderSeriesLabel:function(t){var e=this._getSeriesDataModel(),i=this.seriesData.groupBounds,n=this.theme.label,a=this.selectedLegendIndex,r=o.boundsToLabelPositions(e,i,n),s=e.map(function(t){return t.valuesMap.value});return this.graphRenderer.renderSeriesLabel(t,r,s,n,a)},resize:function(){this.boundMap=null,n.prototype.resize.apply(this,arguments)},_makeExportationSeriesData:function(t){return{x:t.indexes.groupIndex,y:t.indexes.index}}});function r(t){var e=t.chartOptions.libType;return t.libType=e,t.chartType="heatmap",new a(t)}r.componentType="series",r.HeatmapChartSeries=a,t.exports=r},function(t,e,i){"use strict";var n=i(60),o=i(76),a=i(63),r=i(2),s=i(5),h=tui.util.defineClass(n,{init:function(t){n.call(this,t),this.theme.borderColor=this.theme.borderColor||r.TREEMAP_DEFAULT_BORDER,this.rootId=r.TREEMAP_ROOT_ID,this.startDepth=1,this.selectedGroup=null,this.boundMap=null,this.colorSpectrum=t.colorSpectrum,this._initOptions()},_initOptions:function(){this.options.useColorValue=!!this.options.useColorValue,tui.util.isUndefined(this.options.zoomable)&&(this.options.zoomable=!this.options.useColorValue),tui.util.isUndefined(this.options.useLeafLabel)&&(this.options.useLeafLabel=!this.options.zoomable)},_makeSeriesData:function(){var t=this._getBoundMap(),e=this._makeBounds(t);return{boundMap:t,groupBounds:e,seriesDataModel:this._getSeriesDataModel(),startDepth:this.startDepth,isPivot:!0,colorSpectrum:this.options.useColorValue?this.colorSpectrum:null,chartBackground:this.chartBackground,zoomable:this.options.zoomable,isAvailable:function(){return e&&e.length>0}}},_makeBoundMap:function(t,e,i){var n,a=this,r=this._getSeriesDataModel(),s=tui.util.extend({},this.layout.dimension,this.layout.position);return i=i||s,n=r.findSeriesItemsByParent(t),e=tui.util.extend(e||{},o.squarify(i,n)),tui.util.forEachArray(n,function(t){e=a._makeBoundMap(t.id,e,e[t.id])}),e},_makeBounds:function(t){var e,i=this.startDepth,n=this._getSeriesDataModel();return e=this.options.zoomable?function(t){return t.depth===i}:function(t){return!t.hasChild},n.map(function(i){return i.map(function(i){var n=t[i.id],o=null;return n&&e(i)&&(o={end:n}),o},!0)},!0)},_getBoundMap:function(){return this.boundMap||(this.boundMap=this._makeBoundMap(this.rootId)),this.boundMap},_shouldDimmed:function(t,e,i){var n,o=!1;return e&&i.id!==e.id&&i.group===e.group&&(n=t.findParentByDepth(i.id,e.depth+1))&&n.parent===e.id&&(o=!0),o},_renderSeriesLabel:function(t){var e,i,n,o=this._getSeriesDataModel(),r=this._getBoundMap(),s=this.theme.label,h=this.options.labelTemplate;return i=this.options.useLeafLabel?o.findLeafSeriesItems(this.selectedGroup):o.findSeriesItemsByDepth(this.startDepth,this.selectedGroup),n=tui.util.map(i,function(t){return h?h(t.pickLabelTemplateData()):t.label}),e=a.boundsToLabelPostionsForTreemap(i,r,s),this.graphRenderer.renderSeriesLabelForTreemap(t,e,n,s)},resize:function(){this.boundMap=null,n.prototype.resize.apply(this,arguments)},_zoom:function(t,e,i){this._clearSeriesContainer(),this.boundMap=null,this.rootId=t,this.startDepth=e,this.selectedGroup=i,this._renderSeriesArea(this.paper,tui.util.bind(this._renderGraph,this))},zoom:function(t){var e,i=t.index;this.labelSet.remove(),-1!==i?(e=this._getSeriesDataModel().getSeriesItem(0,i,!0))&&e.hasChild&&(this._zoom(e.id,e.depth+1,e.group),this.eventBus.fire("afterZoom",i)):this._zoom(r.TREEMAP_ROOT_ID,1,null)},_makeExportationSeriesData:function(t){var e=t.indexes,i=this._getSeriesDataModel().getSeriesItem(e.groupIndex,e.index,!0);return tui.util.extend({chartType:this.chartType,indexes:i.indexes})},onHoverSeries:function(t){s.isShowLabel(this.options)&&this.graphRenderer.showAnimation(t,this.options.useColorValue,.6)},onHoverOffSeries:function(t){s.isShowLabel(this.options)&&t&&this.graphRenderer.hideAnimation(t,this.options.useColorValue)},onShowTooltip:function(t){var e=this._getSeriesDataModel(),i=t.indexes,n=e.getSeriesItem(i.groupIndex,i.index,!0).colorRatio;n>-1&&this.eventBus.fire("showWedge",n)}});function u(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="treemap",t.chartBackground=i.chart.background,new h(t)}u.componentType="series",u.TreemapChartSeries=h,t.exports=u},function(t,e,i){"use strict";var n=i(23),o=i(6),a={boundMap:{},_makeBaseBound:function(t){return tui.util.extend({},t)},_calculateScale:function(t,e,i){return e*i/n.sum(t)},_makeBaseData:function(t,e,i){var n=this._calculateScale(tui.util.pluck(t,"value"),e,i);return tui.util.map(t,function(t){return{id:t.id,weight:t.value*n}}).sort(function(t,e){return e.weight-t.weight})},_worst:function(t,e,i,n){var o=t*t,a=n*n;return Math.max(a*i/o,o/(a*e))},_changedStackDirection:function(t,e,i,n){var a=o.min(e),r=o.max(e),s=this._worst(t,a,r,i);return this._worst(t+n,Math.min(a,n),Math.max(r,n),i)>=s},_isVerticalStack:function(t){return t.height<t.width},_selectBaseSize:function(t){return this._isVerticalStack(t)?t.height:t.width},_calculateFixedSize:function(t,e,i){var o;return e||(o=tui.util.pluck(i,"weight"),e=n.sum(o)),e/t},_addBounds:function(t,e,i,n){tui.util.reduce([t].concat(e),function(t,e){var o=e.weight/i;return n(o,t,e.id),t+o})},_addBound:function(t,e,i,n,o){this.boundMap[o]={left:t,top:e,width:i,height:n}},_addBoundsForVerticalStack:function(t,e,i,n){var o=this,a=this._calculateFixedSize(i,n,t);this._addBounds(e.top,t,a,function(t,i,n){o._addBound(e.left,i,a,t,n)}),e.left+=a,e.width-=a},_addBoundsForHorizontalStack:function(t,e,i,n){var o=this,a=this._calculateFixedSize(i,n,t);this._addBounds(e.left,t,a,function(t,i,n){o._addBound(i,e.top,t,a,n)}),e.top+=a,e.height-=a},_getAddingBoundsFunction:function(t){return this._isVerticalStack(t)?tui.util.bind(this._addBoundsForVerticalStack,this):tui.util.bind(this._addBoundsForHorizontalStack,this)},squarify:function(t,e){var i,o,a=this,r=this._makeBaseBound(t),s=this._makeBaseData(e,r.width,r.height),h=[];return this.boundMap={},tui.util.forEachArray(s,function(t){var e=tui.util.pluck(h,"weight"),s=n.sum(e);h.length&&a._changedStackDirection(s,e,i,t.weight)&&(o(h,r,i,s),h=[]),h.length||(i=a._selectBaseSize(r),o=a._getAddingBoundsFunction(r)),h.push(t)}),h.length&&o(h,r,i),this.boundMap}};t.exports=a},function(t,e,i){"use strict";var n=i(60),o=i(62),a=i(2),r=i(5),s=i(24),h=tui.util.defineClass(n,{init:function(){n.apply(this,arguments)},_makeBoxplotChartBound:function(t,e,i,n,o){var r,s,h,u,l=Math.abs(t.baseBarSize*n.ratioDistance),c=t.baseBarSize*(1-n.lqRatio),d=t.basePosition+c+a.SERIES_EXPAND_SIZE,p=t.basePosition+a.SERIES_EXPAND_SIZE;return r=o,e.left=e.baseLeft+t.pointInterval*r,e.plusTop=0,e.minusTop=0,n.value>=0?(e.plusTop-=l,s=d+e.plusTop):(s=d+e.minusTop,e.minusTop+=l),h=e.left+t.pointInterval-t.barSize/2,u=tui.util.map(n.outliers,function(e){return{top:t.baseBarSize*(1-e.ratio)+p,left:h+t.barSize/2}}),{start:{top:d,left:h,width:t.barSize,height:0},end:{top:s,left:h,width:t.barSize,height:l},min:{top:t.baseBarSize*(1-n.minRatio)+p,left:h,width:t.barSize,height:0},max:{top:t.baseBarSize*(1-n.maxRatio)+p,left:h,width:t.barSize,height:0},median:{top:t.baseBarSize*(1-n.medianRatio)+p,left:h,width:t.barSize,height:0},outliers:u}},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=r.isValidStackOption(this.options.stackType),n=this.layout.dimension,o=this._makeBaseDataForMakingBound(n.width,n.height);return e.map(function(e,n){var a=n*o.groupSize+t.layout.position.left,r={baseLeft:a,left:a,plusTop:0,minusTop:0,prevStack:null},s=tui.util.bind(t._makeBoxplotChartBound,t,o,r,i);return e.map(s)})},_calculateLeftPositionOfSumLabel:function(t,e){var i=s.getRenderedLabelWidth(e,this.theme.label);return t.left+(t.width-i+a.TEXT_PADDING)/2}});function u(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="boxplot",t.chartBackground=i.chart.background,new h(t)}o.mixin(h),u.componentType="series",u.BoxplotChartSeries=h,t.exports=u},function(t,e,i){"use strict";var n=tui.util.browser.msie&&tui.util.browser.version<=8,o=i(79),a=i(2),r=i(14),s=i(24),h=i(34),u=tui.util.defineClass({className:"tui-chart-zoom-area",init:function(t){this.eventBus=t.eventBus,this.magn=1,this.stackedWheelDelta=0,this.drawingType=a.COMPONENT_TYPE_DOM,this._attachToEventBus()},_attachToEventBus:function(){this.eventBus.on("wheel",this.onWheel,this)},render:function(t){var e;return n||((e=r.create("DIV",this.className)).innerHTML+=o.ZOOM_BUTTONS,s.renderPosition(e,t.positionMap.series),this._attachEvent(e)),e},_findBtnElement:function(t){var e="tui-chart-zoom-btn",i=t;return r.hasClass(t,e)||(i=r.findParentByClass(t,e)),i},_zoom:function(t,e){this.eventBus.fire("zoomMap",t,e)},_onClick:function(t){var e=t.target||t.srcElement,i=this._findBtnElement(e).getAttribute("data-magn"),n=this._calculateMagn(i);return n>5?this.magn=5:n<1?this.magn=1:n>=1&&this._zoom(n),t.preventDefault&&t.preventDefault(),!1},_attachEvent:function(t){h.on(t,"click",this._onClick,this)},_calculateMagn:function(t){return t>0?this.magn+=.1:t<0&&(this.magn-=.1),this.magn},onWheel:function(t,e){var i=this._calculateMagn(t);i>5?this.magn=5:i<1?this.magn=1:i>=1&&this._zoom(i,e)}});function l(t){return new u(t)}l.componentType="zoom",t.exports=l},function(t,e,i){"use strict";var n=i(44),o={HTML_SERIES_LABEL:'<div class="tui-chart-series-label" style="{{ cssText }}"{{ rangeLabelAttribute }}>{{ label }}</div>',TEXT_CSS_TEXT:"left:{{ left }}px;top:{{ top }}px;font-family:{{ fontFamily }};font-size:{{ fontSize }}px;font-weight:{{ fontWeight }}{{opacity}}",TEXT_CSS_TEXT_FOR_LINE_TYPE:"left:{{ left }}%;top:{{ top }}%;font-family:{{ fontFamily }};font-size:{{ fontSize }}px;font-weight:{{ fontWeight }}{{opacity}}",HTML_ZOOM_BUTTONS:'<a class="tui-chart-zoom-btn" href="#" data-magn="1"><div class="horizontal-line"></div><div class="vertical-line"></div></a><a class="tui-chart-zoom-btn" href="#" data-magn="-1"><div class="horizontal-line"></div></a>',HTML_SERIES_BLOCK:'<div class="tui-chart-series-block" style="{{ cssText }}">{{ label }}</div>'};t.exports={tplSeriesLabel:n.template(o.HTML_SERIES_LABEL),tplCssText:n.template(o.TEXT_CSS_TEXT),tplCssTextForLineType:n.template(o.TEXT_CSS_TEXT_FOR_LINE_TYPE),ZOOM_BUTTONS:o.HTML_ZOOM_BUTTONS,tplSeriesBlock:n.template(o.HTML_SERIES_BLOCK)}},function(t,e,i){"use strict";var n=i(2),o=i(81),a=i(82),r=i(86),s=i(88),h=i(83),u=i(4),l=i(5),c=i(24),d=i(23),p=i(11),f=Array.prototype.concat,m=tui.util.isUndefined,g=tui.util.defineClass(o,{init:function(t,e,i,n){this.originalRawData=p.deepCopy(t),this.chartType=e,this.options=i,this.seriesTypes=n,this.originalLegendData=null,this.dynamicData=[],this.defaultValues=[0,500],this.initData(t),this.initZoomedRawData(),this.baseInit()},getOriginalRawData:function(){return p.deepCopy(this.originalRawData)},getZoomedRawData:function(){var t=this.zoomedRawData;return t=t?p.deepCopy(t):this.getOriginalRawData()},_filterSeriesDataByIndexRange:function(t,e,i){return tui.util.forEachArray(t,function(t){t.data=t.data.slice(e,i+1)}),t},_filterRawDataByIndexRange:function(t,e){var i=this,n=e[0],o=e[1];return tui.util.forEach(t.series,function(e,a){t.series[a]=i._filterSeriesDataByIndexRange(e,n,o)}),t.categories&&(t.categories=t.categories.slice(n,o+1)),t},updateRawDataForZoom:function(t){var e=this.getRawData(),i=this.getZoomedRawData();this.zoomedRawData=this._filterRawDataByIndexRange(i,t),e=this._filterRawDataByIndexRange(e,t),this.initData(e)},initZoomedRawData:function(){this.zoomedRawData=null},initData:function(t){this.rawData=t,this.categoriesMap=null,this.stacks=null,this.seriesDataModelMap={},this.seriesGroups=null,this.valuesMap={},this.legendLabels=null,this.legendData=null,this.multilineCategories=null,this.coordinateType=null},getRawData:function(){return this.rawData},findChartType:function(t){return u.findChartType(this.rawData.seriesAlias,t)},_escapeCategories:function(t){return tui.util.map(t,function(t){return tui.util.encodeHTMLEntity(String(t))})},_mapCategories:function(t,e){var i=e+"Axis",n=this.options[i]||{};return t=(tui.util.isArray(n)?tui.util.filter(n,function(t){return t.type&&l.isDatetimeType(t.type)}):n.type&&l.isDatetimeType(n.type))?tui.util.map(t,function(t){return new Date(t).getTime()||t}):this._escapeCategories(t)},_processCategories:function(t){var e=this.rawData.categories,i={};return tui.util.isArray(e)?i[t]=this._mapCategories(e,t):e&&(e.x&&(i.x=this._mapCategories(e.x,"x")),e.y&&(i.y=this._mapCategories(e.y,"y").reverse())),i},getCategories:function(t){var e=t?"y":"x",i=[];return this.categoriesMap||(this.categoriesMap=this._processCategories(e)),tui.util.isExisty(t)?i=this.categoriesMap[e]||[]:tui.util.forEach(this.categoriesMap,function(t){return i=t,!1}),i},getCategoryCount:function(t){var e=this.getCategories(t);return e?e.length:0},hasCategories:function(t){return!!this.getCategoryCount(t)},isXCountGreaterThanYCount:function(t){return this.getSeriesDataModel(t).isXCountGreaterThanYCount()},hasXValue:function(t){var e=this.isXCountGreaterThanYCount(t);return!this.hasCategories(e)||e},hasYValue:function(t){var e=this.isXCountGreaterThanYCount(t);return!this.hasCategories(e)||!e},getCategory:function(t,e){return this.getCategories(e)[t]},findCategoryIndex:function(t){var e=this.getCategories(),i=null;return tui.util.forEachArray(e,function(e,n){return e===t&&(i=n),tui.util.isNull(i)}),i},containedAllVisibleCategory:function(t,e){var i,n,o,a,r,s,h=this.getCategories();return!!h.length&&(!(!this.originalRawData||!this.originalRawData.categories)&&(i=h[0],n=h[h.length-1],tui.util.forEachArray(this.originalRawData.categories,function(h,u){var l,c;return h===t?r=u:h===e?s=u:h===i?o=u:h===n&&(a=u),l=o&&(tui.util.isUndefined(r)||s),c=s&&tui.util.isUndefined(a),!(l||c)}),r<o&&a<s))},_getTooltipCategory:function(t,e){var i=this.getCategory(t,e),n=e?"yAxis":"xAxis",o=this.options[n]||{},a=this.options.tooltip||{};return l.isDatetimeType(a.type)?i=c.formatDate(i,a.dateFormat):l.isDatetimeType(o.type)&&(i=c.formatDate(i,o.dateFormat)),i},makeTooltipCategory:function(t,e,i){var n=!i,o=this._getTooltipCategory(t,n),a=this.getCategoryCount(!n);return a&&(o+=", "+this._getTooltipCategory(a-e-1,!n)),o},getStacks:function(t){return this.stacks||(this.stacks=u.pickStacks(this.rawData.series[t])),this.stacks},getStackCount:function(t){return this.getStacks(t).length},findStackIndex:function(t){return tui.util.inArray(t,this.getStacks())},isCoordinateType:function(){var t=this.chartType,e=this.coordinateType;return tui.util.isExisty(e)||(e=(e=(e=l.isCoordinateTypeChart(t))||l.isLineScatterComboChart(t,this.seriesTypes))||l.isLineTypeChart(t)&&!this.hasCategories(),this.coordinateType=e),e},getSeriesDataModel:function(t){var e,i,n;return this.seriesDataModelMap[t]||(i=this.findChartType(t),e=this.rawData.series[t],n=l.isBoxplotChart(this.chartType)?r:l.isTreemapChart(this.chartType)?s:a,this.seriesDataModelMap[t]=new n(e,i,this.options,this.getFormatFunctions(),this.isCoordinateType())),this.seriesDataModelMap[t]},getGroupCount:function(t){return this.getSeriesDataModel(t).getGroupCount()},_pushCategory:function(t){this.rawData.categories&&(this.rawData.categories.push(t),this.originalRawData.categories.push(t))},_shiftCategory:function(){this.rawData.categories&&(this.rawData.categories.shift(),this.originalRawData.categories.shift())},_findRawSeriesDatumByName:function(t,e){var i=null,n=this.rawData.series[e];return tui.util.forEachArray(n,function(e){var n=e.name===t;return n&&(i=e),!n}),i},_pushValue:function(t,e,i){var n=this._findRawSeriesDatumByName(t.name,i);t.data.push(e),n&&n.data.push(e)},_pushValues:function(t,e,i){var n=this;tui.util.forEachArray(t,function(t,o){n._pushValue(t,e[o],i)})},_pushSeriesData:function(t){var e,i=this;"combo"!==this.chartType&&tui.util.isArray(t)&&(e=t,(t={})[this.chartType]=e),tui.util.forEach(this.originalRawData.series,function(e,n){i._pushValues(e,t[n],n)})},_shiftValues:function(t,e){var i=this;tui.util.forEachArray(t,function(t){var n=i._findRawSeriesDatumByName(t.name,e);t.data.shift(),n&&n.data.shift()})},_shiftSeriesData:function(){var t=this;tui.util.forEach(this.originalRawData.series,function(e,i){t._shiftValues(e,i)})},addDynamicData:function(t,e){this.dynamicData.push({category:t,values:e})},_pushDynamicData:function(t){this._pushCategory(t.category),this._pushSeriesData(t.values)},_pushDynamicDataForCoordinateType:function(t){var e=this;tui.util.forEachArray(this.originalRawData.series,function(i){e._pushValue(i,t[i.name])})},addDataFromDynamicData:function(){var t=this.dynamicData.shift();return t&&(this.isCoordinateType()?this._pushDynamicDataForCoordinateType(t.values):this._pushDynamicData(t),this.initData(this.rawData)),!!t},shiftData:function(){this._shiftCategory(),this._shiftSeriesData(),this.initData(this.rawData)},addDataFromRemainDynamicData:function(t){var e=this,i=this.dynamicData;this.dynamicData=[],tui.util.forEach(i,function(i){e._pushCategory(i.category),e._pushSeriesData(i.values),t&&(e._shiftCategory(),e._shiftSeriesData())}),this.initData(this.rawData)},_eachByAllSeriesDataModel:function(t){var e=this,i=this.seriesTypes||[this.chartType];tui.util.forEachArray(i,function(i){return t(e.getSeriesDataModel(i),i)})},isValidAllSeriesDataModel:function(){var t=!0;return this._eachByAllSeriesDataModel(function(e){return t=!!e.getGroupCount()}),t},_makeSeriesGroups:function(){var t=[];return this._eachByAllSeriesDataModel(function(e){e.each(function(e,i){t[i]||(t[i]=[]),t[i]=t[i].concat(e.items)})}),tui.util.map(t,function(t){return new h(t)})},getSeriesGroups:function(){return this.seriesGroups||(this.seriesGroups=this._makeSeriesGroups()),this.seriesGroups},getValue:function(t,e,i){return this.getSeriesDataModel(i).getValue(t,e)},getDefaultDatetimeValues:function(){var t=Date.now();return[t-36e5,t]},isSeriesDataEmpty:function(t){var e=this.rawData,i=e&&!e.series;return!e||i||!e.series[t]||e.series[t]&&!e.series[t].length},isLimitOptionsEmpty:function(t){var e=this.options[t]||{};return m(e.min)&&m(e.max)},isLimitOptionsInsufficient:function(t){var e=this.options[t]||{};return m(e.min)||m(e.max)},_createValues:function(t,e,i){var n,o,a=this.options,r=a.plot,s=a[i]||{},h=s.type,u=this.isSeriesDataEmpty(t),c=this.isLimitOptionsEmpty(i),d=this.isLimitOptionsInsufficient(i),p=l.isLineChart(t)||l.isAreaChart(t)||l.isLineAreaComboChart(t,this.seriesTypes),f=this.defaultValues;return l.isComboChart(t)?(n=[],this._eachByAllSeriesDataModel(function(t){n=n.concat(t.getValues(e))})):u&&d?(!c&&d&&(f=f.concat([s.min||s.max])),"x"===e&&"datetime"===h?(n=this.getDefaultDatetimeValues(),p&&r&&(o=this.getValuesFromPlotOptions(r,h),n=n.concat(o))):n=f):n=this.getSeriesDataModel(t).getValues(e),n},getValuesFromPlotOptions:function(t,e){var i=[];return t.lines&&tui.util.forEach(t.lines,function(t){i.push("datetime"!==e?t.value:new Date(t.value))}),t.bands&&tui.util.forEach(t.bands,function(t){var n=tui.util.map(t.range,function(t){return"datetime"!==e?t:new Date(t)});i=i.concat(n)}),i},getValues:function(t,e,i){var n;return n=t+e,this.valuesMap[n]||(this.valuesMap[n]=this._createValues(t,e,i)),this.valuesMap[n]},eachBySeriesGroup:function(t,e){this._eachByAllSeriesDataModel(function(i,n){i.each(function(e,i){t(e,i,n)},e)})},_pickLegendLabel:function(t){return t.name?tui.util.encodeHTMLEntity(t.name):null},_isVisibleLegend:function(t){var e=!0;return tui.util.isExisty(t.visible)&&!1===t.visible&&(e=!1),e},_pickLegendData:function(t){var e,i=this.rawData.series,n={};return"visibility"===t?e=this._isVisibleLegend:"label"===t&&(e=this._pickLegendLabel),e&&(tui.util.forEach(i,function(t,i){n[i]=tui.util.map(t,e)}),n=tui.util.filter(n,tui.util.isExisty)),n},getLegendLabels:function(t){return this.legendLabels||(this.legendLabels=this._pickLegendData("label")),this.legendLabels[t]||this.legendLabels},getLegendVisibility:function(t){return this.legendVisibilities||(this.legendVisibilities=this._pickLegendData("visibility")),this.legendVisibilities[t]||this.legendVisibilities},_makeLegendData:function(){var t,e,i=this.getLegendLabels(this.chartType),n=this.seriesTypes||[this.chartType],o=this.getLegendVisibility();return tui.util.isArray(i)?(t=[this.chartType])[this.chartType]=i:(n=this.seriesTypes,t=i),e=tui.util.map(n,function(e){return tui.util.map(t[e],function(t,i){var n=tui.util.isArray(o[e]);return{chartType:e,label:t,visible:n?o[e][i]:o[i]}})}),f.apply([],e)},getLegendData:function(){return this.legendData||(this.legendData=this._makeLegendData()),this.originalLegendData||(this.originalLegendData=this.legendData),this.legendData},getOriginalLegendData:function(){return this.originalLegendData},getLegendItem:function(t){return this.getLegendData()[t]},getFirstItemLabel:function(t){return this.getSeriesDataModel(t).getFirstItemLabel()},addDataRatiosOfPieChart:function(t){this.getSeriesDataModel(t).addDataRatiosOfPieChart()},addDataRatiosForCoordinateType:function(t,e,i){l.isLineTypeChart(t)&&this._addStartValueToAllSeriesItem(e.yAxis,t),this.getSeriesDataModel(t).addDataRatiosForCoordinateType(e,i)},_addStartValueToAllSeriesItem:function(t,e){var i=0;t.min>=0?i=t.min:t.max<=0&&(i=t.max),this.getSeriesDataModel(e).addStartValueToAllSeriesItem(i)},addDataRatios:function(t,e,i){var n=this.getSeriesDataModel(i);this._addStartValueToAllSeriesItem(t,i),n.addDataRatios(t,e)},addDataRatiosForTreemapChart:function(t,e){this.getSeriesDataModel(e).addDataRatios(t)},_createBaseValuesForNormalStackedChart:function(t){var e=this.getSeriesDataModel(t),i=[];return e.each(function(t){var e=t._makeValuesMapPerStack();tui.util.forEach(e,function(t){var e=d.sumPlusValues(t),n=d.sumMinusValues(t);i=i.concat([e,n])})}),i},createBaseValuesForLimit:function(t,e,i,n,o){var a;return l.isComboChart(this.chartType)&&e?(a=this.getValues(this.chartType,n),l.isNormalStackChart(t,i)&&(a=a.concat(this._createBaseValuesForNormalStackedChart(t)))):a=l.isTreemapChart(t)?this.getValues(t,"colorValue"):l.isNormalStackChart(t,i)?this._createBaseValuesForNormalStackedChart(t):this.getValues(t,n,o),a},findOverflowItem:function(t,e){var i=this.getSeriesDataModel(t),o=i.getMaxValue("r"),a=function(t){return t.r/o>n.HALF_RATIO};return{minItem:i.findMinSeriesItem(e,a),maxItem:i.findMaxSeriesItem(e,a)}}});t.exports=g},function(t,e,i){"use strict";var n=i(6),o=i(24),a=i(23),r=tui.util.defineClass({baseInit:function(){this.formatFunctions=null},getValues:function(){},getMaxValue:function(t,e){return n.max(this.getValues(t,e))},getFormattedMaxValue:function(t,e,i){var n=this.getMaxValue(t,i),a=this.getFormatFunctions();return o.formatValue(n,a,t,e,i)},_pickMaxLenUnderPoint:function(t){var e=0;return tui.util.forEachArray(t,function(t){var i=a.getDecimalLength(t);i>e&&(e=i)}),e},_isZeroFill:function(t){return t.length>2&&"0"===t.charAt(0)},_isDecimal:function(t){var e=t.indexOf(".");return e>-1&&e<t.length-1},_isComma:function(t){return t.indexOf(",")>-1},_formatToZeroFill:function(t,e){return(e<0?"-":"")+(e=o.formatToZeroFill(Math.abs(e),t))},_formatToDecimal:function(t,e){return o.formatToDecimal(e,t)},_findSimpleTypeFormatFunctions:function(t){var e,i=[];if(this._isDecimal(t))e=this._pickMaxLenUnderPoint([t]),i=[tui.util.bind(this._formatToDecimal,this,e)];else if(this._isZeroFill(t))return e=t.length,i=[tui.util.bind(this._formatToZeroFill,this,e)];return this._isComma(t)&&i.push(o.formatToComma),i},_findFormatFunctions:function(){var t=tui.util.pick(this.options,"chart","format"),e=[];return tui.util.isFunction(t)?e=[t]:tui.util.isString(t)&&(e=this._findSimpleTypeFormatFunctions(t)),e},getFormatFunctions:function(){return this.formatFunctions||(this.formatFunctions=this._findFormatFunctions()),this.formatFunctions}});t.exports=r},function(t,e,i){"use strict";var n=i(83),o=i(84),a=i(85),r=i(5),s=i(23),h=i(6),u=Array.prototype.concat,l=tui.util.defineClass({init:function(t,e,i,n,o){this.chartType=e,this.options=i||{},this.formatFunctions=n,this.rawSeriesData=t||[],this.isCoordinateType=o,this.baseGroups=null,this.groups=null,this.options.series=this.options.series||{},this.isDivergingChart=r.isDivergingChart(e,this.options.series.diverging),this.valuesMap={},this._removeRangeValue()},_removeRangeValue:function(){var t=tui.util.pick(this.options,"series")||{};r.isAllowRangeData(this.chartType)&&!r.isValidStackOption(t.stackType)&&!t.spline||this.isCoordinateType||tui.util.forEachArray(this.rawSeriesData,function(t){tui.util.isArray(t.data)&&tui.util.forEachArray(t.data,function(e,i){tui.util.isExisty(e)&&(t.data[i]=u.apply(e)[0])})})},_createBaseGroups:function(){var t,e,i=this.chartType,n=this.formatFunctions,s=this.options.xAxis,h=this.isDivergingChart,u=this.isCoordinateType,l=r.isPieChart(this.chartType),c=r.isHeatmapChart(this.chartType)||r.isTreemapChart(this.chartType);return u?(e=a,t=function(t){t.sort(function(t,e){return t.x-e.x})}):(e=o,t=function(){}),tui.util.map(this.rawSeriesData,function(o){var a,r,d;return r=tui.util.isArray(o)?o:[].concat(o.data),c||(a=o.stack),(u||l)&&(r=tui.util.filter(r,tui.util.isExisty)),d=tui.util.map(r,function(t,o){return new e({datum:t,chartType:i,formatFunctions:n,index:o,stack:a,isDivergingChart:h,xAxisType:s.type,dateFormat:s.dateFormat})}),t(d),d})},_getBaseGroups:function(){return this.baseGroups||(this.baseGroups=this._createBaseGroups()),this.baseGroups},_createSeriesGroupsFromRawData:function(t){var e=this._getBaseGroups();return t&&(e=h.pivot(e)),tui.util.map(e,function(t){return new n(t)})},_getSeriesGroups:function(){return this.groups||(this.groups=this._createSeriesGroupsFromRawData(!0)),this.groups},getGroupCount:function(){return this._getSeriesGroups().length},_getPivotGroups:function(){return this.pivotGroups||(this.pivotGroups=this._createSeriesGroupsFromRawData()),this.pivotGroups},getSeriesGroup:function(t,e){return e?this._getPivotGroups()[t]:this._getSeriesGroups()[t]},getFirstSeriesGroup:function(t){return this.getSeriesGroup(0,t)},getFirstItemLabel:function(){return this.getFirstSeriesGroup().getFirstSeriesItem().label},getSeriesItem:function(t,e,i){return this.getSeriesGroup(t,i).getSeriesItem(e)},getFirstSeriesItem:function(){return this.getSeriesItem(0,0)},getValue:function(t,e){return this.getSeriesItem(t,e).value},getMinValue:function(t){return h.min(this.getValues(t))},getMaxValue:function(t){return h.max(this.getValues(t))},_findSeriesItem:function(t){var e;return this.each(function(i){return!(e=i.find(t))}),e},_findSeriesItemByValue:function(t,e,i){return i=i||function(){return null},this._findSeriesItem(function(n){return n&&n[t]===e&&i(n)})},findMinSeriesItem:function(t,e){var i=this.getMinValue(t);return this._findSeriesItemByValue(t,i,e)},findMaxSeriesItem:function(t,e){var i=this.getMaxValue(t);return this._findSeriesItemByValue(t,i,e)},_createValues:function(t){var e=this.map(function(e){return e.getValues(t)});return e=u.apply([],e),tui.util.filter(e,function(t){return!isNaN(t)})},getValues:function(t){return t=t||"value",this.valuesMap[t]||(this.valuesMap[t]=this._createValues(t)),this.valuesMap[t]},isXCountGreaterThanYCount:function(){return this.getValues("x").length>this.getValues("y").length},_addRatiosWhenNormalStacked:function(t){var e=Math.abs(t.max-t.min);this.each(function(t){t.addRatios(e)})},_calculateBaseRatio:function(){var t=this.getValues(),e=s.sumPlusValues(t),i=Math.abs(s.sumMinusValues(t));return e>0&&i>0?.5:1},_addRatiosWhenPercentStacked:function(){var t=this._calculateBaseRatio();this.each(function(e){e.addRatiosWhenPercentStacked(t)})},_addRatiosWhenDivergingStacked:function(){this.each(function(t){var e=t.pluck("value"),i=s.sumPlusValues(e),n=Math.abs(s.sumMinusValues(e));t.addRatiosWhenDivergingStacked(i,n)})},_makeSubtractionValue:function(t){var e=r.allowMinusPointRender(this.chartType),i=0;return!e&&r.isMinusLimit(t)?i=t.max:(e||t.min>=0)&&(i=t.min),i},_addRatios:function(t){var e=Math.abs(t.max-t.min),i=this._makeSubtractionValue(t);this.each(function(t){t.addRatios(e,i)})},addDataRatios:function(t,e){var i=r.isAllowedStackOption(this.chartType);i&&r.isNormalStack(e)?this._addRatiosWhenNormalStacked(t):i&&r.isPercentStack(e)?this.isDivergingChart?this._addRatiosWhenDivergingStacked():this._addRatiosWhenPercentStacked():this._addRatios(t)},addDataRatiosOfPieChart:function(){this.each(function(t){var e=s.sum(t.pluck("value"));t.addRatios(e)})},addDataRatiosForCoordinateType:function(t,e){var i,n,o,a,r=t.xAxis,s=t.yAxis,u=e?h.max(this.getValues("r")):0;r&&(i=Math.abs(r.max-r.min),n=this._makeSubtractionValue(r)),s&&(o=Math.abs(s.max-s.min),a=this._makeSubtractionValue(s)),this.each(function(t){t.each(function(t){t&&(t.addRatio("x",i,n),t.addRatio("y",o,a),t.addRatio("r",u,0),tui.util.isExisty(t.start)&&t.addRatio("start",o,a))})})},addStartValueToAllSeriesItem:function(t){this.each(function(e){e.addStartValueToAllSeriesItem(t)})},hasRangeData:function(){var t=!1;return this.each(function(e){return!(t=e.hasRangeData())}),t},each:function(t,e){var i=e?this._getPivotGroups():this._getSeriesGroups();tui.util.forEachArray(i,function(e,i){return t(e,i)})},map:function(t,e){var i=[];return this.each(function(e,n){i.push(t(e,n))},e),i}});t.exports=l},function(t,e,i){"use strict";var n=i(23),o=tui.util.defineClass({init:function(t){this.items=t,this.valuesMap={},this.valuesMapPerStack=null},getSeriesItemCount:function(){return this.items.length},getSeriesItem:function(t){return this.items[t]},getFirstSeriesItem:function(){return this.getSeriesItem(0)},_createValues:function(t){var e=[];return this.each(function(i){i&&(tui.util.isExisty(i[t])&&e.push(i[t]),tui.util.isExisty(i.start)&&e.push(i.start))}),e},getValues:function(t){return t=t||"value",this.valuesMap[t]||(this.valuesMap[t]=this._createValues(t)),this.valuesMap[t]},_makeValuesMapPerStack:function(){var t={};return this.each(function(e){t[e.stack]||(t[e.stack]=[]),t[e.stack].push(e.value)}),t},getValuesMapPerStack:function(){return this.valuesMapPerStack||(this.valuesMapPerStack=this._makeValuesMapPerStack()),this.valuesMapPerStack},_makeSumMapPerStack:function(){var t=this.getValuesMapPerStack(),e={};return tui.util.forEach(t,function(t,i){e[i]=n.sum(tui.util.map(t,function(t){return Math.abs(t)}))}),e},addStartValueToAllSeriesItem:function(t){this.each(function(e){e&&e.addStart(t)})},addRatiosWhenPercentStacked:function(t){var e=this._makeSumMapPerStack();this.each(function(i){var n=e[i.stack];i.addRatio(n,0,t)})},addRatiosWhenDivergingStacked:function(t,e){this.each(function(i){var n=i.value>=0?t:e;i.addRatio(n,0,.5)})},addRatios:function(t,e){this.each(function(i){i&&i.addRatio(t,e)})},hasRangeData:function(){var t=!1;return this.each(function(e){return!(t=e&&e.isRange)}),t},each:function(t){tui.util.forEachArray(this.items,t)},map:function(t){return tui.util.map(this.items,t)},pluck:function(t){var e=tui.util.filter(this.items,tui.util.isExisty);return tui.util.pluck(e,t)},find:function(t){var e;return this.each(function(i){return t(i)&&(e=i),!e}),e||null},filter:function(t){return tui.util.filter(this.items,t)}});t.exports=o},function(t,e,i){"use strict";var n=i(2),o=i(24),a=i(23),r=tui.util.defineClass({init:function(t){this.chartType=t.chartType,this.stack=t.stack||n.DEFAULT_STACK,this.isDivergingChart=t.isDivergingChart,this.formatFunctions=t.formatFunctions,this.isRange=!1,this.value=null,this.label=null,this.ratio=null,this.end=null,this.endLabel=null,this.endRatio=null,this.start=null,this.startLabel=null,this.startRatio=null,this.ratioDistance=null,this._initValues(t.datum,t.index)},_initValues:function(t,e){var i=this._createValues(t),n=i.length>1,a=i[0];this.value=this.end=a,this.index=e,this.isDivergingChart&&(a=Math.abs(a)),tui.util.isNull(a)?this.label="":this.label=o.formatValue(a,this.formatFunctions,this.chartType,"makingSeriesLabel"),this.endLabel=this.label,n&&(this.addStart(i[1],!0),this._updateFormattedValueforRange(),this.isRange=!0)},_createValues:function(t){var e=tui.util.map([].concat(t),function(t){return tui.util.isNull(t)?null:parseFloat(t)});return e=e.sort(function(t,e){return t<0&&e<0?t-e:e-t})},addStart:function(t){tui.util.isNull(this.start)&&(this.start=t,this.startLabel=o.formatValue(t,this.formatFunctions,this.chartType,"series"))},_updateFormattedValueforRange:function(){this.label=this.startLabel+" ~ "+this.endLabel},addRatio:function(t,e,i){t=t||1,i=i||1,e=e||0,this.ratio=this.endRatio=a.calculateRatio(this.value,t,e,i),tui.util.isExisty(this.start)&&(this.startRatio=a.calculateRatio(this.start,t,e,i),this.ratioDistance=Math.abs(this.endRatio-this.startRatio))},_getFormattedValueForTooltip:function(t){return o.formatValue(this[t],this.formatFunctions,this.chartType,"tooltip",t)},pickValueMapForTooltip:function(){var t={value:this._getFormattedValueForTooltip("value"),ratio:this.ratio};return tui.util.isExisty(this.start)&&(t.start=this._getFormattedValueForTooltip("start"),t.end=this._getFormattedValueForTooltip("end"),t.startRatio=this.startRatio,t.endRatio=this.endRatio),t}});t.exports=r},function(t,e,i){"use strict";var n=i(5),o=i(24),a=tui.util.defineClass({init:function(t){this.chartType=t.chartType,this.formatFunctions=t.formatFunctions,this.xAxisType=t.xAxisType,this.dateFormat=t.dateFormat,this.ratioMap={},this._initData(t.datum,t.index)},_initData:function(t,e){var i;tui.util.isArray(t)?(this.x=t[0]||0,this.y=t[1]||0,n.isBubbleChart(this.chartType)?(this.r=t[2],this.label=t[3]||""):this.label=t[2]||""):(this.x=t.x,this.y=t.y,this.r=t.r,this.label=t.label||""),n.isDatetimeType(this.xAxisType)&&(i=tui.util.isDate(this.x)?this.x:new Date(this.x),this.x=i.getTime()||0),this.index=e,this.label||(n.isLineTypeChart(this.chartType)&&n.isDatetimeType(this.xAxisType)?this.label=o.formatDate(this.x,this.dateFormat):this.label=o.formatValue(this.x,this.formatFunctions,this.chartType,"series"),this.label+=",&nbsp;"+o.formatValue(this.y,this.formatFunctions,this.chartType,"series"))},addStart:function(t){this.start=t},addRatio:function(t,e,i){!tui.util.isExisty(this.ratioMap[t])&&e&&(this.ratioMap[t]=(this[t]-i)/e)},_getFormattedValueForTooltip:function(t){var e=this.ratioMap[t],i=this[t],n=o.formatValue(i,this.formatFunctions,this.chartType,"tooltip",t);return tui.util.isNumber(e)?n:i},pickValueMapForTooltip:function(){var t={x:this._getFormattedValueForTooltip("x"),y:this._getFormattedValueForTooltip("y"),xRatio:this.ratioMap.x,yRatio:this.ratioMap.y};return tui.util.isExisty(this.r)&&(t.r=this._getFormattedValueForTooltip("r"),t.rRatio=this.ratioMap.r),t}});t.exports=a},function(t,e,i){"use strict";var n=i(87),o=i(82),a=Array.prototype.concat,r=tui.util.defineClass(o,{init:function(t,e,i,n){this.chartType=e,this.options=i||{},this.formatFunctions=n,this.rawSeriesData=t||[],this.baseGroups=null,this.groups=null,this.options.series=this.options.series||{},this.valuesMap={}},_createBaseGroups:function(){var t=this.chartType,e=this.formatFunctions;return tui.util.map(this.rawSeriesData,function(i){var o=tui.util.isArray(i)?i:[].concat(i.data);return tui.util.map(o,function(i,o){return new n({datum:i,chartType:t,formatFunctions:e,index:o})})})},_createValues:function(){var t=[];return this.map(function(e){tui.util.forEach(e.items,function(e){t.push(e.min),t.push(e.max),t.push(e.uq),t.push(e.lq),t.push(e.median)})}),t=a.apply([],t),tui.util.filter(t,function(t){return!isNaN(t)})}});t.exports=r},function(t,e,i){"use strict";var n=i(24),o=i(23),a=tui.util.defineClass({init:function(t){this.chartType=t.chartType,this.formatFunctions=t.formatFunctions,this.value=null,this.label=null,this.ratio=null,this.min=null,this.minLabel=null,this.minRatio=null,this.max=null,this.maxLabel=null,this.maxRatio=null,this.median=null,this.medianLabel=null,this.medianRatio=null,this.lq=null,this.lqLabel=null,this.lqRatio=null,this.uq=null,this.uqLabel=null,this.uqRatio=null,this.ratioDistance=null,this._initValues(t.datum,t.index)},_initValues:function(t,e){var i,o=this,a=this._createValues(t),r="makingSeriesLabel",s=a[4],h=a[3],u=a[2],l=a[1],c=a[0],d=a.length>5;this.value=this.max=s,this.uq=h,this.median=u,this.lq=l,this.min=c,this.index=e,d&&(this.outliers=[],i=this.outliers,tui.util.forEach(a.slice(5),function(t){i.push({value:t,label:n.formatValue(t,o.formatFunctions,o.chartType,r)})})),this.label=n.formatValue(s,this.formatFunctions,this.chartType,r),this.maxLabel=this.label,this.uqLabel=n.formatValue(h,this.formatFunctions,this.chartType,r),this.medianLabel=n.formatValue(u,this.formatFunctions,this.chartType,r),this.lqLabel=n.formatValue(l,this.formatFunctions,this.chartType,r),this.minLabel=n.formatValue(c,this.formatFunctions,this.chartType,r)},_createValues:function(t){return tui.util.map([].concat(t),function(t){return tui.util.isNull(t)?null:parseFloat(t)})},addStart:function(t){tui.util.isNull(this.min)&&(this.min=t,this.minLabel=n.formatValue(t,this.formatFunctions,this.chartType,"series"))},_updateFormattedValueforRange:function(){this.label=this.minLabel+" ~ "+this.maxLabel},addRatio:function(t,e,i){var n=o.calculateRatio;t=t||1,i=i||1,e=e||0,this.ratio=this.maxRatio=n(this.max,t,e,i),this.uqRatio=n(this.uq,t,e,i),this.medianRatio=n(this.median,t,e,i),this.lqRatio=n(this.lq,t,e,i),this.minRatio=n(this.min,t,e,i),tui.util.forEach(this.outliers,function(o){o.ratio=n(o.value,t,e,i)}),this.ratioDistance=Math.abs(this.uqRatio-this.lqRatio)},_getFormattedValueForTooltip:function(t){return n.formatValue(this[t],this.formatFunctions,this.chartType,"tooltip",t)},pickValueMapForTooltip:function(){var t={value:this._getFormattedValueForTooltip("value"),ratio:this.ratio};return tui.util.isExisty(this.min)&&(t.min=this._getFormattedValueForTooltip("min"),t.max=this._getFormattedValueForTooltip("max"),t.minRatio=this.minRatio,t.maxRatio=this.maxRatio,t.maxLabel=this.maxLabel,t.minLabel=this.minLabel,t.uqLabel=this.uqLabel,t.lqLabel=this.lqLabel,t.medianLabel=this.medianLabel,t.outliers=this.outliers),t}});t.exports=a},function(t,e,i){"use strict";var n=i(82),o=i(89),a=i(2),r=i(23),s=Array.prototype.slice,h=tui.util.defineClass(n,{init:function(){n.apply(this,arguments),this.foundSeriesItemsMap={},this.seriesItemMap={}},_flattenHierarchicalData:function(t,e,i){var n,o=this,r=[];return e?n=e+"_":(n=a.TREEMAP_ID_PREFIX,e=a.TREEMAP_ROOT_ID),i=i||[],tui.util.forEachArray(t,function(t,a){var s=n+a,h=t.children,u=i.concat(a);t.indexes=u,tui.util.isNull(t.value)||r.push(t),t.id||(t.id=s),t.parent||(t.parent=e),h&&(r=r.concat(o._flattenHierarchicalData(h,s,u)),delete t.children)}),r},_partitionRawSeriesDataByParent:function(t,e){var i=[],n=[];return tui.util.forEachArray(t,function(t){t.parent===e?i.push(t):n.push(t)}),[i,n]},_setTreeProperties:function(t,e,i,n){var o=this,a=this._partitionRawSeriesDataByParent(t,i),s=a[0],h=a[1],u=e+1;return tui.util.forEachArray(s,function(t,i){var a,l;t.depth=e,t.group=tui.util.isUndefined(n)?i:n,a=o._setTreeProperties(h,u,t.id,t.group),(l=tui.util.filter(a,function(t){return t.depth===u})).length?(t.value=r.sum(tui.util.pluck(l,"value")),t.hasChild=!0):t.hasChild=!1,s=s.concat(a)}),s},_setRatio:function(t,e){var i=this,n=this._partitionRawSeriesDataByParent(t,e),o=n[0],a=n[1],s=r.sum(tui.util.pluck(o,"value"));tui.util.forEachArray(o,function(t){var e=tui.util.isNull(t.value)?0:t.value;t.ratio=e/s,t.hasChild&&i._setRatio(a,t.id)})},_createBaseGroups:function(){var t=this.chartType,e=this.seriesItemMap,i=this.formatFunctions,n=this._flattenHierarchicalData(this.rawSeriesData);return n=this._setTreeProperties(n,1,a.TREEMAP_ROOT_ID),this._setRatio(n,a.TREEMAP_ROOT_ID),[tui.util.map(n,function(n){var a=new o(n,i,t);return e[a.id]=a,a})]},_findSeriesItems:function(t,e){return this.foundSeriesItemsMap[t]||(this.foundSeriesItemsMap[t]=this.getFirstSeriesGroup(!0).filter(e)),this.foundSeriesItemsMap[t]},_makeCacheKey:function(t){var e=t;return arguments.length>1&&(e+=s.call(arguments,1).join("_")),e},_isValidGroup:function(t,e){return!tui.util.isExisty(e)||t===e},findSeriesItemsByDepth:function(t,e){var i=this,n=this._makeCacheKey(a.TREEMAP_DEPTH_KEY_PREFIX,t,e);return this._findSeriesItems(n,function(n){return n.depth===t&&i._isValidGroup(n.group,e)})},findSeriesItemsByParent:function(t){var e=this._makeCacheKey(a.TREEMAP_PARENT_KEY_PREFIX,t);return this._findSeriesItems(e,function(e){return e.parent===t})},findLeafSeriesItems:function(t){var e=this,i=this._makeCacheKey(a.TREEMAP_LEAF_KEY_PREFIX,t);return this._findSeriesItems(i,function(i){return!i.hasChild&&e._isValidGroup(i.group,t)})},findParentByDepth:function(t,e){var i=this.seriesItemMap[t]||null;return i&&i.depth!==e&&(i=this.findParentByDepth(i.parent,e)),i},initSeriesItemsMap:function(){this.foundSeriesItemsMap=null}});t.exports=h},function(t,e,i){"use strict";var n=i(23),o=i(24),a=tui.util.defineClass({init:function(t,e,i){this.chartType=i,this.formatFunctions=e,this.id=t.id,this.parent=t.parent,this.value=t.value,this.ratio=t.ratio,this.colorValue=t.colorValue,this.depth=t.depth,this.label=t.label||"",this.group=t.group,this.hasChild=!!t.hasChild,this.indexes=t.indexes},addRatio:function(t,e){t=t||1,e=e||0,this.colorRatio=n.calculateRatio(this.colorValue,t,e,1)||-1},pickValueMapForTooltip:function(){var t=this.formatFunctions,e=this.chartType,i=this.colorValue,n=o.formatValue(this.value,t,e,"tooltipValue"),a={value:n,label:(this.label?this.label+": ":"")+n,ratio:this.ratio};return tui.util.isExisty(i)&&(a.colorValue=o.formatValue(i,t,e,"tooltipColorValue"),a.colorRatio=this.colorRatio),a},pickLabelTemplateData:function(){var t={value:this.value,ratio:this.ratio,label:this.label};return tui.util.isExisty(this.colorValue)&&(t.colorValue=this.colorValue,t.colorValueRatio=this.ratio),t}});t.exports=a},function(t,e,i){"use strict";var n=i(91),o=i(97),a=i(2),r=i(5),s={_createBoundsModel:function(t,e){return new n({chartType:e.chartType,seriesTypes:e.seriesTypes,options:e.options,theme:e.theme,dataProcessor:t,hasAxes:e.hasAxes,isVertical:e.isVertical})},_createScaleDataModel:function(t,e,i){return new o({chartType:i.chartType,seriesTypes:i.seriesTypes,options:i.options,theme:i.theme,dataProcessor:t,boundsModel:e,hasRightYAxis:i.hasRightYAxis,addedDataCount:i.addedDataCount})},addYAxisScale:function(t,e,i,n){t.addScale(e,i&&i.options||n||{},{valueType:i.valueType||"value",areaType:i.areaType,chartType:i.chartType},i.additionalOptions)},_registerYAxisDimension:function(t,e,i,n,o){var a,r=t.get(n),s=null;r&&((a=i[n])&&(s=a.limit),e.registerYAxisDimension(s,n,r.options,r.theme,o))},_setLayoutBoundsAndScale:function(t,e,i,n,o){var s,h=o.options,u=o.scaleOption||{},l=o.addingDataMode,c=o.isVertical;e.has("xAxis")&&i.registerXAxisHeight(),e.has("legend")&&(e.get("legend").colorSpectrum?i.registerSpectrumLegendDimension():i.registerLegendDimension()),u.yAxis&&this.addYAxisScale(n,"yAxis",u.yAxis,o.options.yAxis),u.rightYAxis&&this.addYAxisScale(n,"rightYAxis",u.rightYAxis),u.legend&&n.addScale("legend",{},{chartType:o.chartType},{tickCounts:[a.SPECTRUM_LEGEND_TICK_COUNT]}),s=n.scaleDataMap,this._registerYAxisDimension(e,i,s,"yAxis",c),this._registerYAxisDimension(e,i,s,"rightYAxis",c),u.xAxis&&n.addScale("xAxis",h.xAxis,{valueType:u.xAxis.valueType||"value"},u.xAxis.additionalOptions),o.hasAxes&&n.setAxisDataMap(),i.registerSeriesDimension(),e.has("circleLegend")&&h.circleLegend.visible&&i.registerCircleLegendDimension(n.axisDataMap),e.has("xAxis")&&(r.isAutoTickInterval(h.xAxis.tickInterval)&&n.updateXAxisDataForAutoTickInterval(o.prevXAxisData,l),n.updateXAxisDataForLabel(l)),i.registerBoundsData(n.axisDataMap.xAxis)},build:function(t,e,i){var n,o=this._createBoundsModel(t,i),a=this._createScaleDataModel(t,o,i);return this._setLayoutBoundsAndScale(t,e,o,a,i),n={dimensionMap:o.dimensionMap,positionMap:o.positionMap,limitMap:a.makeLimitMap(i.seriesTypes||[i.chartType],i.isVertical)},a.axisDataMap&&(n.axisDataMap=a.axisDataMap),r.isBubbleChart(i.chartType)&&(n.maxRadius=o.calculateMaxRadius(a.axisDataMap)),a.scaleDataMap.legend&&(n.legendScaleData=a.scaleDataMap.legend),n}};t.exports=s},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(24),r=i(61),s=i(92),h=i(93),u=i(94),l=i(95),c=i(96),d=tui.util.defineClass({init:function(t){this.options=t.options||{},this.options.legend=this.options.legend||{},this.options.yAxis=this.options.yAxis||{},this.theme=t.theme||{},this.hasAxes=t.hasAxes,this.chartType=t.chartType,this.seriesTypes=t.seriesTypes||[],this.dataProcessor=t.dataProcessor,this.initBoundsData()},initBoundsData:function(){this.dimensionMap={legend:{width:0},yAxis:{width:0},rightYAxis:{width:0},xAxis:{height:0},circleLegend:{width:0},chartExportMenu:{width:0}},this.positionMap={},this.chartLeftPadding=n.CHART_PADDING,this.maxRadiusForBubbleChart=null,this._registerChartDimension(),this._registerTitleDimension(),this._registerChartExportMenuDimension()},_registerDimension:function(t,e){this.dimensionMap[t]=tui.util.extend(this.dimensionMap[t]||{},e)},getBound:function(t){return{dimension:this.dimensionMap[t]||{},position:this.positionMap[t]||{}}},_setBound:function(t,e){this.dimensionMap[t]=e.dimension,this.positionMap[t]=e.position},getDimension:function(t){return this.dimensionMap[t]},getDimensionMap:function(t){var e=this,i={};return t&&t.length?tui.util.forEachArray(t,function(t){i[t]=e.dimensionMap[t]}):i=this.dimensionMap,JSON.parse(JSON.stringify(i))},getPosition:function(t){return this.positionMap[t]},_registerChartDimension:function(){var t=this.options.chart||{},e={width:t.width||n.CHART_DEFAULT_WIDTH,height:t.height||n.CHART_DEFAULT_HEIGHT};this._registerDimension("chart",e)},_registerTitleDimension:function(){var t=this.options.chart||{},e=tui.util.isExisty(t.title)?r.getRenderedTextSize(t.title.text,this.theme.title.fontSize,this.theme.title.fontFamily).height:0,i={height:e?e+n.TITLE_PADDING:0};this._registerDimension("title",i)},_registerChartExportMenuDimension:function(){var t;t=this.options.chartExportMenu.visible?{height:17+n.CHART_PADDING,width:60}:{width:0,height:0},this._registerDimension("chartExportMenu",t)},registerXAxisHeight:function(){this._registerDimension("xAxis",{height:h.calculateXAxisHeight(this.options.xAxis.title,this.theme.xAxis)})},registerLegendDimension:function(){var t=tui.util.pluck(this.dataProcessor.getOriginalLegendData(),"label"),e=this.options.legend,i=this.theme.legend.label,n=this.getDimension("chart").width,o=u.calculate(e,i,t,n);this._registerDimension("legend",o)},registerSpectrumLegendDimension:function(){var t,e=this.dataProcessor.getFormattedMaxValue(this.chartType,"legend"),i=this.theme.label;t=o.isHorizontalLegend(this.options.legend.align)?c._makeHorizontalDimension(e,i):c._makeVerticalDimension(e,i),this._registerDimension("legend",t)},registerYAxisDimension:function(t,e,i,n,a){var r,s;if(t)r=[t.min,t.max];else{if(!o.isHeatmapChart(this.chartType)&&a)return;r=this.dataProcessor.getCategories(!0)}s=tui.util.isArray(i)?"yAxis"===e?i[0]:i[1]:i,this._registerDimension(e,{width:h.calculateYAxisWidth(r,s,n)})},calculateSeriesWidth:function(){var t=this.getDimensionMap(["chart","yAxis","legend","rightYAxis"]);return l.calculateWidth(t,this.options.legend)},calculateSeriesHeight:function(){var t=this.getDimensionMap(["chart","title","legend","xAxis","chartExportMenu"]);return l.calculateHeight(t,this.options.legend)},getBaseSizeForLimit:function(t){return t?this.calculateSeriesHeight():this.calculateSeriesWidth()},_makeSeriesDimension:function(){return{width:this.calculateSeriesWidth(),height:this.calculateSeriesHeight()}},registerSeriesDimension:function(){var t=this._makeSeriesDimension();this._registerDimension("series",t)},_updateLegendAndSeriesWidth:function(t,e){var i=this.options.legend;o.isVerticalLegend(i.align)&&i.visible&&this._registerDimension("legend",{width:t}),this._registerDimension("series",{width:this.getDimension("series").width-e})},registerCircleLegendDimension:function(t){var e,i,a=this.getDimension("series"),r=this.options.legend,h=this.dataProcessor.getFormattedMaxValue(this.chartType,"circleLegend","r"),u=this.theme.chart.fontFamily,l=s.calculateCircleLegendWidth(a,t,h,u);e=o.isVerticalLegend(r.align)&&r.visible?this.getDimension("legend").width:0,i=(l=Math.min(l,Math.max(e,n.MIN_LEGEND_WIDTH)))-e,this._registerDimension("circleLegend",{width:l,height:l}),i>0&&this._updateLegendAndSeriesWidth(l,i)},_makePlotDimension:function(){var t=this.getDimension("series");return{width:t.width,height:t.height+n.OVERLAPPING_WIDTH}},_registerCenterComponentsDimension:function(){var t=this.getDimension("series");this._registerDimension("tooltip",t),this._registerDimension("mouseEventDetector",t)},_registerAxisComponentsDimension:function(){var t=this._makePlotDimension();this._registerDimension("plot",t),this._registerDimension("xAxis",{width:t.width}),this._registerDimension("yAxis",{height:t.height}),this._registerDimension("rightYAxis",{height:t.height})},_updateDimensionsWidth:function(t){var e=Math.max(t.overflowLeft,0),i=e+Math.max(t.overflowRight,0);this.chartLeftPadding+=e,this.dimensionMap.plot.width-=i,this.dimensionMap.series.width-=i,this.dimensionMap.mouseEventDetector.width-=i,this.dimensionMap.xAxis.width-=i},_updateDimensionsHeight:function(t){this.dimensionMap.plot.height-=t,this.dimensionMap.series.height-=t,this.dimensionMap.mouseEventDetector.height-=t,this.dimensionMap.tooltip.height-=t,this.dimensionMap.yAxis.height-=t,this.dimensionMap.rightYAxis.height-=t,this.dimensionMap.xAxis.height+=t},_updateDimensionsForXAxisLabel:function(t){(t.overflowRight>0||t.overflowLeft>0)&&this._updateDimensionsWidth(t),t.overflowHeight&&this._updateDimensionsHeight(t.overflowHeight)},_registerAxisComponentsPosition:function(t){var e=this.getPosition("series"),i=this.getDimension("series"),o=t+this.getDimension("yAxis").width+i.width;this.positionMap.plot={top:e.top,left:e.left},this.positionMap.yAxis={top:e.top,left:this.chartLeftPadding+t},this.positionMap.xAxis={top:e.top+i.height,left:e.left},this.positionMap.rightYAxis={top:e.top,left:this.chartLeftPadding+o-n.OVERLAPPING_WIDTH}},_makeLegendPosition:function(){var t,e,i=this.dimensionMap,a=this.getDimension("series"),r=this.options.legend,s=i.title.height||i.chartExportMenu.height;return o.isLegendAlignBottom(r.align)&&(s+=a.height+this.getDimension("xAxis").height+n.LEGEND_AREA_PADDING),o.isHorizontalLegend(r.align)?e=(this.getDimension("chart").width-this.getDimension("legend").width)/2:o.isLegendAlignLeft(r.align)?e=this.chartLeftPadding:(t=this.getDimension("yAxis").width+this.getDimension("rightYAxis").width,e=this.chartLeftPadding+t+a.width),{top:s,left:e}},_makeChartExportMenuPosition:function(){return{top:1,right:20}},_makeCircleLegendPosition:function(){var t,e=this.getPosition("series"),i=this.getDimension("series"),a=this.getDimension("circleLegend"),r=this.options.legend;return t=o.isLegendAlignLeft(r.align)?0:e.left+i.width,o.isVerticalLegend(r.align)&&r.visible&&(t+=(this.getDimension("legend").width+n.CHART_PADDING-a.width)/2),{top:e.top+i.height-a.height,left:t}},_isNeedExpansionSeries:function(){var t=this.chartType;return!(o.isPieChart(t)||o.isMapChart(t)||o.isTreemapChart(t)||o.isRadialChart(t)||o.isPieDonutComboChart(t,this.seriesTypes))},_registerEssentialComponentsPositions:function(){var t,e=this.getPosition("series");this.positionMap.mouseEventDetector=tui.util.extend({},e),this.positionMap.legend=this._makeLegendPosition(),this.positionMap.chartExportMenu=this._makeChartExportMenuPosition(),this.getDimension("circleLegend").width&&(this.positionMap.circleLegend=this._makeCircleLegendPosition()),t=this._isNeedExpansionSeries()?{top:e.top-n.SERIES_EXPAND_SIZE,left:e.left-n.SERIES_EXPAND_SIZE}:e,this.positionMap.tooltip=t},_registerPositions:function(){var t=this.options.legend.align,e=this.options.legend.visible,i=this.getDimension("legend"),a=o.isLegendAlignTop(t)&&e?i.height:0,r=o.isLegendAlignLeft(t)&&e?i.width:0,s={top:Math.max(this.getDimension("title").height,this.getDimension("chartExportMenu").height)+n.CHART_PADDING+a,left:this.chartLeftPadding+r+this.getDimension("yAxis").width};this.positionMap.series=s,this.hasAxes&&this._registerAxisComponentsPosition(r),this._registerEssentialComponentsPositions()},_registerExtendedSeriesBound:function(){var t=this.getBound("series");this._isNeedExpansionSeries()&&(t=a.expandBound(t)),this._setBound("extendedSeries",t)},_updateBoundsForYAxisCenterOption:function(){var t=this.getDimension("yAxis").width,e=Math.floor(this.getDimension("series").width/2)+n.OVERLAPPING_WIDTH,i=t-n.OVERLAPPING_WIDTH,o=a.isOldBrowser()?1:0;this.dimensionMap.extendedSeries.width+=t,this.dimensionMap.xAxis.width+=n.OVERLAPPING_WIDTH,this.dimensionMap.plot.width+=t+n.OVERLAPPING_WIDTH,this.dimensionMap.mouseEventDetector.width+=t,this.dimensionMap.tooltip.width+=t,this.positionMap.series.left-=t-o,this.positionMap.extendedSeries.left-=i-o,this.positionMap.plot.left-=i,this.positionMap.yAxis.left+=e,this.positionMap.xAxis.left-=i,this.positionMap.mouseEventDetector.left-=i,this.positionMap.tooltip.left-=i},registerBoundsData:function(t){this._registerCenterComponentsDimension(),this.hasAxes&&(this._registerAxisComponentsDimension(),this._updateDimensionsForXAxisLabel(t)),this._registerPositions(),this._registerExtendedSeriesBound(),this.options.yAxis.isCenter&&this._updateBoundsForYAxisCenterOption()},calculateMaxRadius:function(t){var e=this.getDimensionMap(["series","circleLegend"]);return s.calculateMaxRadius(e,t)}});t.exports=d},function(t,e,i){"use strict";var n=i(2),o=i(24),a={_calculatePixelStep:function(t,e){var i,n=t.tickCount;return i=t.isLabelAxis?e/n/2:e/(n-1),parseInt(i,10)},_calculateRadiusByAxisData:function(t,e){var i=this._calculatePixelStep(e.yAxis,t.height),n=this._calculatePixelStep(e.xAxis,t.width);return Math.min(i,n)},_getCircleLegendLabelMaxWidth:function(t,e){return o.getRenderedLabelWidth(t,{fontSize:n.CIRCLE_LEGEND_LABEL_FONT_SIZE,fontFamily:e})},calculateCircleLegendWidth:function(t,e,i,o){var a=this._calculateRadiusByAxisData(t,e),r=this._getCircleLegendLabelMaxWidth(i,o);return Math.max(2*a,r)+n.CIRCLE_LEGEND_PADDING},calculateMaxRadius:function(t,e){var i=this._calculateRadiusByAxisData(t.series,e),o=t.circleLegend.width;return Math.min((o-n.CIRCLE_LEGEND_PADDING)/2,i)}};t.exports=a},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(24),r={calculateXAxisHeight:function(t,e){var i=t?a.getRenderedLabelHeight(t.text,e.title):0;return(i?i+n.TITLE_PADDING:0)+a.getRenderedLabelHeight(n.MAX_HEIGHT_WORLD,e.label)+n.CHART_PADDING},calculateYAxisWidth:function(t,e,i){var r=e.title||"",s=0,h=0;return t=a.addPrefixSuffix(t,e.prefix,e.suffix),e.isCenter?h+=n.AXIS_LABEL_PADDING:s=!1===e.rotateTitle?a.getRenderedLabelWidth(r.text,i.title)+n.TITLE_PADDING:a.getRenderedLabelHeight(r.text,i.title)+n.TITLE_PADDING,o.isDatetimeType(e.type)&&(t=a.formatDates(t,e.dateFormat)),h+=a.getRenderedLabelsMaxWidth(t,i.label)+s+n.AXIS_LABEL_PADDING}};t.exports=r},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(23),r=i(24),s=i(6),h=n.LEGEND_CHECKBOX_WIDTH,u=n.LEGEND_ICON_WIDTH,l=n.LEGEND_ICON_HEIGHT,c=n.LEGEND_LABEL_LEFT_PADDING,d=n.LEGEND_AREA_PADDING,p={legendMargin:c+d,_calculateLegendsWidthSum:function(t,e,i){var n=d+i+u+c,o=this.legendMargin;return a.sum(tui.util.map(t,function(t){return r.getRenderedLabelWidth(t,e)+n+o}))},_divideLegendLabels:function(t,e){var i=Math.round(t.length/e),n=[],o=[];return tui.util.forEachArray(t,function(t){o.length<i?o.push(t):(n.push(o),o=[t])}),o.length&&n.push(o),n},_getMaxLineWidth:function(t,e,i){var n=this,o=tui.util.map(t,function(t){return n._calculateLegendsWidthSum(t,e,i)});return s.max(o)},_makeDividedLabelsAndMaxLineWidth:function(t,e,i,n){var o,a,r=1,s=0,h=0;do{if(o=this._divideLegendLabels(t,r),h===(s=this._getMaxLineWidth(o,i,n))){o=a;break}h=s,a=o,r+=1}while(s>=e);return{labels:o,maxLineWidth:s}},_calculateHorizontalLegendHeight:function(t,e){var i=Math.max.apply(null,tui.util.map(t,function(t){return r.getRenderedLabelsMaxHeight(t,e)}));return(Math.max(l,i)+n.LINE_MARGIN_TOP)*t.length-n.LINE_MARGIN_TOP},_makeHorizontalDimension:function(t,e,i,o){var a=this._makeDividedLabelsAndMaxLineWidth(e,i,t,o),r=this._calculateHorizontalLegendHeight(a.labels,t)+2*d;return{width:Math.max(a.maxLineWidth,n.MIN_LEGEND_WIDTH),height:r}},_makeVerticalDimension:function(t,e,i){return{width:d+i+u+c+r.getRenderedLabelsMaxWidth(e,t)+this.legendMargin,height:0}},calculate:function(t,e,i,n){var a=!1===t.showCheckbox?0:h+c,r={};return t.visible?r=o.isHorizontalLegend(t.align)?this._makeHorizontalDimension(e,i,n,a):this._makeVerticalDimension(e,i,a):r.width=0,r}};t.exports=p},function(t,e,i){"use strict";var n=i(2),o=i(5),a={calculateWidth:function(t,e){var i=t.chart.width,a=t.yAxis.width+t.rightYAxis.width,r=t.legend,s=0;return o.isVerticalLegend(e.align)&&e.visible&&(s=r?r.width:0),i-2*n.CHART_PADDING-a-s},calculateHeight:function(t,e){var i,a=t.chart.height,r=Math.max(t.title.height,t.chartExportMenu.height);return i=(o.isHorizontalLegend(e.align)&&e.visible?t.legend.height:0)+t.xAxis.height,a-2*n.CHART_PADDING-r-i}};t.exports=a},function(t,e,i){"use strict";var n=i(2),o=i(24),a={_makeVerticalDimension:function(t,e){var i=o.getRenderedLabelWidth(t,e),a=n.LEGEND_AREA_PADDING+n.MAP_LEGEND_LABEL_PADDING;return{width:n.MAP_LEGEND_GRAPH_SIZE+i+a,height:n.MAP_LEGEND_SIZE}},_makeHorizontalDimension:function(t,e){var i=o.getRenderedLabelHeight(t,e),a=n.LEGEND_AREA_PADDING+n.MAP_LEGEND_LABEL_PADDING;return{width:n.MAP_LEGEND_SIZE,height:n.MAP_LEGEND_GRAPH_SIZE+i+a}}};t.exports=a},function(t,e,i){"use strict";var n=i(98),o=i(100),a=i(101),r=i(5),s=i(24),h=tui.util.defineClass({init:function(t){this.chartType=t.chartType,this.seriesTypes=t.seriesTypes,this.dataProcessor=t.dataProcessor,this.boundsModel=t.boundsModel,this.options=t.options,this.theme=t.theme,this.hasRightYAxis=!!t.hasRightYAxis,this.prevValidLabelCount=null,this.initScaleData(t.addedDataCount),this.initForAutoTickInterval()},initScaleData:function(t){this.scaleDataMap={},this.axisDataMap={},this.addedDataCount=t},initForAutoTickInterval:function(){this.firstTickCount=null},_pickLimitOption:function(t){return{min:(t=t||{}).min,max:t.max}},_createBaseScaleData:function(t,e,i,o){var a=t.chartType,s="xAxis"!==t.areaType,h=this.dataProcessor.createBaseValuesForLimit(a,o.isSingleYAxis,e.stackType,t.valueType,t.areaType),u=this.boundsModel.getBaseSizeForLimit(s),l=tui.util.extend(e,{isVertical:s,limitOption:this._pickLimitOption(i),tickCounts:o.tickCounts});return r.isBubbleChart(a)&&(l.overflowItem=this.dataProcessor.findOverflowItem(a,t.valueType)),n.makeScaleData(h,u,a,l)},_createScaleLabels:function(t,e,i,n){var a=this.dataProcessor.getFormatFunctions(),r=tui.util.extend(i,{dateFormat:n});return o.createFormattedLabels(t,e,r,a)},_createScaleData:function(t,e,i){var n,o,a=this.options.series,r=e.chartType||this.chartType;return e.chartType=r,a=a[r]||a,n={stackType:i.stackType||a.stackType,diverging:a.diverging,type:t.type},o=this._createBaseScaleData(e,n,t,i),tui.util.extend(o,{labels:this._createScaleLabels(o,e,n,t.dateFormat),axisOptions:t})},_createValueAxisData:function(t,e,i,n,o){var r,s,h=this.dataProcessor.hasCategories(),u=!n&&!h&&i,l=t.labels,c=t.limit,d=t.step,p=l.length,f=a.makeValueAxisData({labels:l,tickCount:l.length,limit:c,step:d,options:t.axisOptions,labelTheme:e,isVertical:!!n,isPositionRight:!!o,aligned:i});return u&&(r=this.dataProcessor.getValues(this.chartType,"x"),s=a.makeAdditionalDataForCoordinateLineType(l,r,c,d,p),tui.util.extend(f,s)),f},_createLabelAxisData:function(t,e,i,n,o){return a.makeLabelAxisData({labels:this.dataProcessor.getCategories(n),options:t,labelTheme:e,isVertical:!!n,isPositionRight:!!o,aligned:i,addedDataCount:this.options.series.shifting?this.addedDataCount:0})},_createAxisData:function(t,e,i,n,o){var a=r.isLineTypeChart(this.chartType,this.seriesTypes)&&!e.pointOnColumn;return t?this._createValueAxisData(t,i,a,n,o):this._createLabelAxisData(e,i,a,n,o)},_createAxesData:function(){var t=this.scaleDataMap,e=this.options,i=this.theme,n=tui.util.isArray(e.yAxis)?e.yAxis:[e.yAxis],o={};return o.xAxis=this._createAxisData(t.xAxis,e.xAxis,i.xAxis.label),o.yAxis=this._createAxisData(t.yAxis,n[0],i.yAxis.label,!0),this.hasRightYAxis&&(o.rightYAxis=this._createAxisData(t.rightYAxis,n[1],i.yAxis.label,!0,!0),o.rightYAxis.aligned=o.xAxis.aligned),o},addScale:function(t,e,i,n){n=n||{},(i=i||{}).areaType=i.areaType||t,i.chartType=n.chartType||i.chartType,this.scaleDataMap[t]=this._createScaleData(e,i,n)},setAxisDataMap:function(){this.axisDataMap=this._createAxesData()},updateXAxisDataForAutoTickInterval:function(t,e){var i=this.options.series.shifting,n=this.options.series.zoomable,o=this.axisDataMap.xAxis,r=this.boundsModel.getDimension("series").width,s=this.addedDataCount;i||!t||n?a.updateLabelAxisDataForAutoTickInterval(o,r,s,e):a.updateLabelAxisDataForStackingDynamicData(o,t,this.firstTickCount),this.firstTickCount||(this.firstTickCount=o.tickCount)},updateXAxisDataForLabel:function(t){var e,i,n,o=this.axisDataMap.xAxis,r=o.labels,h=this.boundsModel.getDimensionMap(["series","yAxis","chart"]),u=o.isLabelAxis,l=this.theme.xAxis.label;t&&(r=r.slice(0,r.length-1)),r=s.addPrefixSuffix(r,this.options.xAxis.prefix,this.options.xAxis.suffix),e=tui.util.filter(r,function(t){return!!t}),i=tui.util.isNull(this.prevValidLabelCount)?e.length:this.prevValidLabelCount,this.options.yAxis.isCenter&&(i+=1,h.yAxis.width=0),n=!1===o.options.rotateLabel?a.makeAdditionalDataForMultilineLabels(r,i,l,u,h):a.makeAdditionalDataForRotatedLabels(e,i,l,u,h),this.prevValidLabelCount=i,tui.util.extend(o,n)},_findLimit:function(t,e,i){return 0===e?i?t.yAxis:t.xAxis:t.rightYAxis?t.rightYAxis:t.yAxis},makeLimitMap:function(t,e){var i=this,n=this.scaleDataMap,o={};return n.xAxis&&(o.xAxis=n.xAxis.limit),n.yAxis&&(o.yAxis=n.yAxis.limit),n.rightYAxis&&(o.rightYAxis=n.rightYAxis.limit),n.legend&&(o.legend=n.legend.limit),tui.util.forEachArray(t,function(t,n){o[t]=i._findLimit(o,n,e)}),o}});t.exports=h},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(23),r=i(6),s=i(99),h=Math.abs,u={_makeLimitForDivergingOption:function(t){var e=Math.max(h(t.min),h(t.max));return{min:-e,max:e}},_adjustLimitForBubbleChart:function(t,e,i){var n=t.min,o=t.max;return i.minItem&&(n-=e),i.maxItem&&(o+=e),{min:n,max:o}},millisecondMap:{year:31536e6,month:26784e5,week:6048e5,date:864e5,hour:36e5,minute:6e4,second:1e3},millisecondTypes:["year","month","week","date","hour","minute","second"],_findDateType:function(t,e){var i,o=t.max-t.min,a=this.millisecondTypes,r=this.millisecondMap,s=a.length-1;return o?tui.util.forEachArray(a,function(t,n){var h,u=r[t],l=Math.floor(o/u);return l&&(i=a[h=n<s&&l<2&&l<e?n+1:n]),!tui.util.isExisty(h)}):i=n.DATE_TYPE_SECOND,i},_makeDatetimeInfo:function(t,e){var i=this._findDateType(t,e),n=this.millisecondMap[i],o=a.divide(t.min,n);return{divisionNumber:n,minDate:o,dataLimit:{min:0,max:a.divide(t.max,n)-o}}},_restoreScaleToDatetimeType:function(t,e,i){var n=t.limit;return t.step=a.multiply(t.step,i),n.min=a.multiply(a.add(n.min,e),i),n.max=a.multiply(a.add(n.max,e),i),t},_getLimitSafely:function(t){var e={min:r.min(t),max:r.max(t)};return 1===t.length?t[0]>0?e.min=0:e.max=0:0===e.min&&0===e.max?e.max=10:e.min===e.max&&(e.min-=e.min/10,e.max+=e.max/10),e},_calculateDatetimeScale:function(t,e,i){var n,o,a;return a=(n=this._makeDatetimeInfo(this._getLimitSafely(t),t.length)).dataLimit,i&&(a=this._makeLimitForDivergingOption(a)),o=s({min:a.min,max:a.max,offsetSize:e,minimumStepSize:1}),o=this._restoreScaleToDatetimeType(o,n.minDate,n.divisionNumber)},_calculatePercentStackedScale:function(t,e){return 0===a.sumMinusValues(t)?n.PERCENT_STACKED_AXIS_SCALE:0===a.sumPlusValues(t)?n.MINUS_PERCENT_STACKED_AXIS_SCALE:e?n.DIVERGING_PERCENT_STACKED_AXIS_SCALE:n.DUAL_PERCENT_STACKED_AXIS_SCALE},_calculateCoordinateScale:function(t,e,i,n,o){var a,r=this._getLimitSafely(t),h=o.limitOption,u=o.stepCount,l=r.min,c=r.max;return h&&(h.min||h.max)&&(u=null,l=tui.util.isExisty(h.min)?h.min:l,c=tui.util.isExisty(h.max)?h.max:c),a=s({min:l,max:c,stepCount:u,offsetSize:e}),i?a.limit=this._adjustLimitForBubbleChart(a.limit,a.step,i):n&&(a.limit=this._makeLimitForDivergingOption(a.limit)),a},makeScaleData:function(t,e,i,n){var a,r=o.isDivergingChart(i,n.diverging),s=n.overflowItem;return o.isPercentStackChart(i,n.stackType)?a=this._calculatePercentStackedScale(t,r):o.isDatetimeType(n.type)?a=this._calculateDatetimeScale(t,e,r):(o.isRadialChart(i)&&(n.stepCount=Math.floor(e/100)),a=this._calculateCoordinateScale(t,e,s,r,n)),a}};t.exports=u},function(t,e){"use strict";var i=[1,2,5,10],n=88;function o(t){var e=0===t?1:Math.log(Math.abs(t))/Math.LN10;return Math.pow(10,Math.floor(e))}function a(t){var e=o(t);return function(t){var e,n,o;for(n=0,o=i.length;n<o&&!(t<=((e=i[n])+(i[n+1]||e))/2);n+=1);return e}(t/e)*e}function r(t){var e,i,n,r,s,h,u,l,c,d=a(t.step),p=(e=t.limit.min,i=t.limit.max,n=d,r=Math.min(o(i),o(n)),h=n*(s=r>1?1:1/r),i=Math.ceil(i*s/h)*h/s,{min:e=e>n?Math.floor(e*s/h)*h/s:e<0?-Math.ceil(Math.abs(e)*s/h)*h/s:0,max:i}),f=Math.abs(p.max-p.min),m=(u=f,l=d,c=1/Math.min(o(u),o(l)),u*c/(l*c));return{limit:{min:p.min,max:p.max},step:d,stepCount:m}}t.exports=function(t){var e,i,o,a,s,h,u,l,c=t.min,d=t.max,p=t.offsetSize,f=t.stepCount,m=t.minimumStepSize,g=(e=c,i=d,o=p,a=f,s=m,u=Math.abs(i-e),l=u/o,a||(a=Math.ceil(o/n)),h=l*(o/a),tui.util.isNumber(s)&&h<s&&(a=u/(h=s)),{limit:{min:e,max:i},step:h,stepCount:a});return g=r(g)}},function(t,e,i){"use strict";var n=i(5),o=i(23),a=i(24),r=Math.abs,s={_getFormatFunctions:function(t,e,i){return n.isPercentStackChart(t,e)&&(i=[function(t){return t+"%"}]),i},_createScaleValues:function(t,e,i){var a=o.makeLabelsFromLimit(t.limit,t.step);return n.isDivergingChart(e,i)?tui.util.map(a,r):a},createFormattedLabels:function(t,e,i,o){var r,s=e.chartType,h=e.areaType,u=e.valueType,l=this._createScaleValues(t,s,i.diverging);return n.isDatetimeType(i.type)?r=a.formatDates(l,i.dateFormat):(o=this._getFormatFunctions(s,i.stackType,o),r=a.formatValues(l,o,s,h,u)),r}};t.exports=s},function(t,e,i){"use strict";var n=i(2),o=i(5),a=i(28),r=i(24),s=i(6),h={_makeLabelsByIntervalOption:function(t,e,i){return i=i||0,t=tui.util.map(t,function(t,o){return(o+i)%e!=0&&(t=n.EMPTY_AXIS_LABEL),t})},makeLabelAxisData:function(t){var e=t.labels.length,i=t.options||{},n=t.labels;if(o.isValidLabelInterval(i.labelInterval,i.tickInterval)&&t.labels.length>i.labelInterval&&(n=this._makeLabelsByIntervalOption(t.labels,i.labelInterval,t.addedDataCount)),o.isDatetimeType(i.type)&&(n=r.formatDates(n,i.dateFormat)),"custom"===i.type){var a=i.dateFormat,s=[];n.forEach(function(t){s.push(a(new Date(t)))}),n=s}return t.aligned||(e+=1),{labels:n,tickCount:e,validTickCount:0,isLabelAxis:!0,options:i,isVertical:!!t.isVertical,isPositionRight:!!t.isPositionRight,aligned:!!t.aligned}},makeValueAxisData:function(t){var e=t.labels,i=t.tickCount,n=t.limit;return{labels:e,tickCount:i,validTickCount:i,limit:n,dataMin:n.min,distance:n.max-n.min,step:t.step,options:t.options,isVertical:!!t.isVertical,isPositionRight:!!t.isPositionRight,aligned:!!t.aligned}},makeAdditionalDataForCoordinateLineType:function(t,e,i,n,o){var a,r=1,h=0,u=s.min(e),l=s.max(e);return(a=l-u)&&(i.min<u&&(i.min+=n,r-=h=(i.min-u)/a,o-=1,t.shift()),i.max>l&&(i.max-=n,r-=(l-i.max)/a,o-=1,t.pop())),{labels:t,tickCount:o,validTickCount:o,limit:i,dataMin:u,distance:a,positionRatio:h,sizeRatio:r}},_makeAdjustingIntervalInfo:function(t,e,i){var n,o=parseInt(e/i,10),a=parseInt(t/o,10),r=null;return a>1&&((n=t-a*o)>=a&&(o+=parseInt(n/a,0),n%=a),r={blockCount:o,beforeRemainBlockCount:n,interval:a}),r},_makeCandidatesForAdjustingInterval:function(t,e){var i=this,n=tui.util.range(90,121,5),o=tui.util.map(n,function(n){return i._makeAdjustingIntervalInfo(t,e,n)});return tui.util.filter(o,function(t){return!!t})},_calculateAdjustingIntervalInfo:function(t,e){var i=this._makeCandidatesForAdjustingInterval(t,e),n=null;return i.length&&(n=s.min(i,function(t){return t.blockCount})),n},_makeFilteredLabelsByInterval:function(t,e,i){return tui.util.filter(t.slice(e),function(t,e){return e%i==0})},updateLabelAxisDataForAutoTickInterval:function(t,e,i,n){var o,a,r,s,h,u;n&&(t.tickCount-=1,t.labels.pop()),o=t.tickCount-1,(a=this._calculateAdjustingIntervalInfo(o,e))&&(r=a.blockCount,s=a.interval,h=a.beforeRemainBlockCount,t.eventTickCount=t.tickCount,(u=Math.round(h/2)-i%s)<0&&(u+=s),t.labels=this._makeFilteredLabelsByInterval(t.labels,u,s),tui.util.extend(t,{startIndex:u,tickCount:r+1,positionRatio:u/o,sizeRatio:1-h/o,interval:s}))},updateLabelAxisDataForStackingDynamicData:function(t,e,i){var n,o=e.interval,a=e.startIndex,r=t.tickCount-1,s=r/o,h=i?i-1:0;h&&2*h<=s&&(o*=2),t.labels=this._makeFilteredLabelsByInterval(t.labels,a,o),n=r-o*(s=t.labels.length-1),tui.util.extend(t,{startIndex:a,eventTickCount:t.tickCount,tickCount:t.labels.length,positionRatio:a/r,sizeRatio:1-n/r,interval:o})},_calculateXAxisLabelAreaWidth:function(t,e,i){return t||(i-=1),e/i},_createMultilineLabel:function(t,e,i){var n=String(t).split(/\s+/),o=n[0],a=[];return tui.util.forEachArray(n.slice(1),function(t){r.getRenderedLabelWidth(o+" "+t,i)>e?(a.push(o),o=t):o+=" "+t}),o&&a.push(o),a.join("<br>")},_createMultilineLabels:function(t,e,i){var n=this._createMultilineLabel;return tui.util.map(t,function(t){return n(t,i,e)})},_calculateMultilineHeight:function(t,e,i){return r.getRenderedLabelsMaxHeight(t,tui.util.extend({cssText:"line-height:1.2;width:"+i+"px"},e))},makeAdditionalDataForMultilineLabels:function(t,e,i,n,o){var a=o.series.width,s=this._calculateXAxisLabelAreaWidth(n,a,e),h=this._createMultilineLabels(t,i,a);return{multilineLabels:h,overflowHeight:this._calculateMultilineHeight(h,i,s)-r.getRenderedLabelsMaxHeight(t,i),overflowLeft:s/2-o.yAxis.width}},_findRotationDegree:function(t,e,i){var o=null;return tui.util.forEachArray(n.DEGREE_CANDIDATES,function(r){var s=a.calculateRotatedWidth(r,e,i);return o=r,!(s<=t+n.XAXIS_LABEL_COMPARE_MARGIN)}),o},_calculateRotatedWidth:function(t,e,i,o){var s=r.getRenderedLabelWidth(e,o),h=a.calculateRotatedWidth(t,s,i);return h-=a.calculateAdjacent(n.ANGLE_90-t,i/2)},_calculateLimitWidth:function(t,e,i){var n=t;return e&&(n+=i/2),n},makeAdditionalDataForRotatedLabels:function(t,e,i,o,s){var h,u,l,c=r.getRenderedLabelsMaxWidth(t,i),d=s.series.width,p=this._calculateXAxisLabelAreaWidth(o,d,e),f=null,m=n.CHART_PADDING+s.yAxis.width+d;return p<c?(u=r.getRenderedLabelsMaxHeight(t,i),f={degree:h=this._findRotationDegree(p,c,u),overflowHeight:a.calculateRotatedHeight(h,c,u)-u,overflowLeft:(l=this._calculateRotatedWidth(h,t[0],u,i))-this._calculateLimitWidth(s.yAxis.width,o,p),overflowRight:(m+=l)-s.chart.width}):(m+=c,f={overflowLeft:(p=r.getRenderedLabelWidth(t[0],i)/2)-s.yAxis.width,overflowRight:m-s.chart.width}),f}};t.exports=h},function(t,e,i){"use strict";var n=i(20),o=i(2),a=i(4),r=tui.util.defineClass(n,{className:"tui-column-chart",init:function(t,e,i){a.updateRawSeriesDataByOptions(t,i.series),this._updateOptionsRelatedDiverging(i),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},_updateOptionsRelatedDiverging:function(t){t.series=t.series||{},t.series.diverging&&(t.series.stackType=t.series.stackType||o.NORMAL_STACK_TYPE)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("columnSeries","columnSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){return{yAxis:!0}},addDataRatios:function(t){var e=this.options.series||{},i=this.chartType,n=(e[i]||e).stackType;this.dataProcessor.addDataRatios(t[i],n,i)}});t.exports=r},function(t,e,i){"use strict";var n=i(20),o=i(5),a=i(104),r=i(65),s=i(4),h=tui.util.defineClass(n,{className:"tui-line-chart",Series:r,init:function(t,e,i){n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0}),this.dataProcessor.isCoordinateType()&&(delete this.options.xAxis.tickInterval,this.options.tooltip.grouped=!1,this.options.series.shifting=!1),this._dynamicDataHelper=new a(this)},addData:function(t,e){this._dynamicDataHelper.addData(t,e)},onChangeCheckedLegends:function(t,e,i){this._dynamicDataHelper.reset(),this._dynamicDataHelper.changeCheckedLegends(t,e,i)},addDataRatios:function(t){var e,i=this,n=this.chartTypes||[this.chartType],a=this.options.series||{};e=this.dataProcessor.isCoordinateType()?function(e){var n=o.isBubbleChart(e);i.dataProcessor.addDataRatiosForCoordinateType(e,t,n)}:function(e){var n=(a[e]||a).stackType;i.dataProcessor.addDataRatios(t[e],n,e)},tui.util.forEachArray(n,e)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("lineSeries","lineSeries"),this.componentManager.register("xAxis","axis"),this.componentManager.register("yAxis","axis"),this.componentManager.register("legend","legend"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){var t,e,i={},n=this.options.xAxis;return this.dataProcessor.isCoordinateType()?(t=(e=n&&"datetime"===n.type)&&tui.util.isExisty(n.dateFormat),i.xAxis={valueType:"x"},e&&(i.xAxis.type=(n||{}).dateTime),t&&(i.xAxis.format=(n||{}).dateFormat),i.yAxis={valueType:"y"}):i.yAxis=!0,i},addPlotLine:function(t){this.componentManager.get("plot").addPlotLine(t)},addPlotBand:function(t){this.componentManager.get("plot").addPlotBand(t)},removePlotLine:function(t){this.componentManager.get("plot").removePlotLine(t)},removePlotBand:function(t){this.componentManager.get("plot").removePlotBand(t)},_renderForZoom:function(t){var e=this.readyForRender();this.componentManager.render("zoom",e,{isResetZoom:t})},onZoom:function(t){this._dynamicDataHelper.pauseAnimation(),this.dataProcessor.updateRawDataForZoom(t),this._renderForZoom(!1)},onResetZoom:function(){var t=this.dataProcessor.getOriginalRawData();this._dynamicDataHelper.checkedLegends&&(t=s.filterCheckedRawData(t,this._dynamicDataHelper.checkedLegends)),this.dataProcessor.initData(t),this.dataProcessor.initZoomedRawData(),this.dataProcessor.addDataFromRemainDynamicData(tui.util.pick(this.options.series,"shifting")),this._renderForZoom(!0),this._dynamicDataHelper.restartAnimation()}});t.exports=h},function(t,e,i){"use strict";var n=i(2),o=i(5),a=tui.util.defineClass({init:function(t){var e=tui.util.bind(function(){this.isInitRenderCompleted=!0,this.chart.off(e)},this);this.chart=t,this.isInitRenderCompleted=!1,this.chart.on("load",e),this.reset()},reset:function(){this.lookupping=!1,this.paused=!1,this.rerenderingDelayTimerId=null,this.addedDataCount=0,this.checkedLegends=null,this.prevXAxisData=null},_calculateAnimateTickSize:function(t){var e,i=this.chart.dataProcessor,n=this.chart.options.xAxis.tickInterval,a=!!this.chart.options.series.shifting;return e=i.isCoordinateType()?i.getValues(this.chart.chartType,"x").length-1:i.getCategoryCount(!1)-1,a&&!o.isAutoTickInterval(n)&&(e-=1),t/e},_animateForAddingData:function(){var t,e=this.chart,i=e.readyForRender(!0),n=!!this.chart.options.series.shifting;this.addedDataCount+=1,t=this._calculateAnimateTickSize(i.dimensionMap.xAxis.width),e.componentManager.render("animateForAddingData",i,{tickSize:t,shifting:n}),n&&e.dataProcessor.shiftData()},_rerenderForAddingData:function(){var t=this.chart,e=t.readyForRender();t.componentManager.render("rerender",e)},_checkForAddedData:function(){var t=this.chart,e=this;t.dataProcessor.addDataFromDynamicData()?this.paused?t.options.series.shifting&&t.dataProcessor.shiftData():(this._animateForAddingData(),this.rerenderingDelayTimerId=setTimeout(function(){e.rerenderingDelayTimerId=null,e._rerenderForAddingData(),e._checkForAddedData()},400)):this.lookupping=!1},changeCheckedLegends:function(t,e,i){var o=this,a=this.chart,r=!!a.options.series.shifting,s=this.paused;s||this.pauseAnimation(),this.checkedLegends=t,a.rerender(t,e,i),s||setTimeout(function(){a.dataProcessor.addDataFromRemainDynamicData(r),o.restartAnimation()},n.RERENDER_TIME)},pauseAnimation:function(){this.paused=!0,this.rerenderingDelayTimerId&&(clearTimeout(this.rerenderingDelayTimerId),this.rerenderingDelayTimerId=null,this.chart.options.series.shifting&&this.chart.dataProcessor.shiftData())},restartAnimation:function(){this.paused=!1,this.lookupping=!1,this._startLookup()},_startLookup:function(){this.lookupping||(this.lookupping=!0,this._checkForAddedData())},addData:function(t,e){e||(e=t,t=null),this.chart.dataProcessor.addDynamicData(t,e),this.isInitRenderCompleted?this._startLookup():e&&(this.addedDataCount+=1)}});t.exports=a},function(t,e,i){"use strict";var n=i(20),o=i(104),a=i(4),r=i(68),s=tui.util.defineClass(n,{className:"tui-area-chart",Series:r,init:function(t,e,i){a.removeSeriesStack(t.series),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0}),this._dynamicDataHelper=new o(this)},addData:function(t,e){this._dynamicDataHelper.addData(t,e)},onChangeCheckedLegends:function(t,e,i){this._dynamicDataHelper.reset(),this._dynamicDataHelper.changeCheckedLegends(t,e,i)},addDataRatios:function(t){var e,i=this,n=this.chartTypes||[this.chartType],o=this.options.series||{};e=this.dataProcessor.isCoordinateType()?function(e){i.dataProcessor.addDataRatiosForCoordinateType(e,t,!1)}:function(e){var n=(o[e]||o).stackType;i.dataProcessor.addDataRatios(t[e],n,e)},tui.util.forEachArray(n,e)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("areaSeries","areaSeries"),this.componentManager.register("xAxis","axis"),this.componentManager.register("yAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){var t={};return this.dataProcessor.isCoordinateType()?(t.xAxis={valueType:"x"},t.yAxis={valueType:"y"}):t.yAxis=!0,t},addPlotLine:function(t){this.componentManager.get("plot").addPlotLine(t)},addPlotBand:function(t){this.componentManager.get("plot").addPlotBand(t)},removePlotLine:function(t){this.componentManager.get("plot").removePlotLine(t)},removePlotBand:function(t){this.componentManager.get("plot").removePlotBand(t)},_renderForZoom:function(t){var e=this.readyForRender();this.componentManager.render("zoom",e,{isResetZoom:t})},onZoom:function(t){this._dynamicDataHelper.pauseAnimation(),this.dataProcessor.updateRawDataForZoom(t),this._renderForZoom(!1)},onResetZoom:function(){var t=this.dataProcessor.getOriginalRawData();this._dynamicDataHelper.checkedLegends&&(t=a.filterCheckedRawData(t,this._dynamicDataHelper.checkedLegends)),this.dataProcessor.initData(t),this.dataProcessor.initZoomedRawData(),this.dataProcessor.addDataFromRemainDynamicData(tui.util.pick(this.options.series,"shifting")),this._renderForZoom(!0),this._dynamicDataHelper.restartAnimation()}});t.exports=s},function(t,e,i){"use strict";var n=i(20),o=i(4),a=i(5),r=i(107),s=tui.util.defineClass(n,{init:function(t,e,i){var o=r({rawSeriesData:t.series,yAxisOptions:i.yAxis});this.chartTypes=o.chartTypes,this.seriesTypes=o.seriesTypes,this.yAxisOptions=this._makeYAxisOptions(this.chartTypes,i.yAxis),this.hasRightYAxis=tui.util.isArray(i.yAxis)&&i.yAxis.length>1,i.tooltip=i.tooltip||{},i.tooltip.grouped=!0,n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},_makeYAxisOptions:function(t,e){var i={};return e=e||{},tui.util.forEachArray(t,function(t,n){i[t]=e[n]||e}),i},onChangeCheckedLegends:function(t){var e=this.dataProcessor.getOriginalRawData(),i=o.filterCheckedRawData(e,t),n=r({rawSeriesData:i.series,yAxisOptions:this.options.yAxis});this.chartTypes=n.chartTypes,this.seriesTypes=n.seriesTypes,this.rerender(t,i,n)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("columnSeries","columnSeries"),this.componentManager.register("lineSeries","lineSeries"),this.componentManager.register("yAxis","axis"),this.hasRightYAxis&&this.componentManager.register("rightYAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){var t={yAxis:this._makeYAxisScaleOption("yAxis",this.chartTypes[0],!this.hasRightYAxis)};return this.hasRightYAxis&&(t.rightYAxis=this._makeYAxisScaleOption("rightYAxis",this.chartTypes[1])),t},_makeYAxisScaleOption:function(t,e,i){var n=this.yAxisOptions[e],o={isSingleYAxis:!!i};return i&&this.options.series&&this._setAdditionalOptions(o),{options:n,areaType:"yAxis",chartType:e,additionalOptions:o}},_setAdditionalOptions:function(t){var e=this.dataProcessor;tui.util.forEach(this.options.series,function(i,n){var o;i.stackType&&(o=e.findChartType(n),a.isAllowedStackOption(o)&&(t.chartType=o,t.stackType=i.stackType))})},addDataRatios:function(t){var e,i=this,n=this.chartTypes||[this.chartType],o=this.options.series||{};e=function(e){var n=(o[e]||o).stackType;i.dataProcessor.addDataRatios(t[e],n,e)},tui.util.forEachArray(n,e)}});t.exports=s},function(t,e){"use strict";t.exports=function(t){var e=(i=t.rawSeriesData,n=t.yAxisOptions,u=tui.util.keys(i).sort(),o=n,r=u.slice(),s=[].concat(o||[]),h=!1,!s.length||1===s.length&&!s[0].chartType?r=[]:s.length&&(a=tui.util.map(s,function(t){return t.chartType}),tui.util.forEachArray(a,function(t,e){h=h||t&&r[e]!==t||!1}),h&&r.reverse()),l=r,c=l.length?l:u,d=tui.util.filter(l,function(t){return i[t].length}),1===d.length?{chartTypes:d,seriesTypes:d}:{chartTypes:c,seriesTypes:u});var i,n,o,a,r,s,h,u,l,c,d;return{chartTypes:e.chartTypes,seriesTypes:e.seriesTypes}}},function(t,e,i){"use strict";var n=i(20),o=tui.util.defineClass(n,{init:function(t,e,i){this.chartTypes=["line","scatter"],this.seriesTypes=["line","scatter"],n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},getScaleOption:function(){return{yAxis:{valueType:"y"},xAxis:{valueType:"x"}}},addDataRatios:function(t){var e,i=this,n=this.chartTypes||[this.chartType];e=function(e){i.dataProcessor.addDataRatiosForCoordinateType(e,t,!1)},tui.util.forEachArray(n,e)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("lineSeries","lineSeries"),this.componentManager.register("scatterSeries","scatterSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")}});t.exports=o},function(t,e,i){"use strict";var n=i(20),o=i(4),a=i(5),r=i(107),s=i(104),h=tui.util.defineClass(n,{className:"tui-combo-chart",init:function(t,e,i){var o=r({rawSeriesData:t.series,yAxisOptions:i.yAxis});this.chartTypes=o.chartTypes,this.seriesTypes=o.seriesTypes,this.yAxisOptions=this._makeYAxisOptions(this.chartTypes,i.yAxis),this.hasRightYAxis=tui.util.isArray(i.yAxis)&&i.yAxis.length>1,i.tooltip=i.tooltip||{},i.tooltip.grouped=!0,n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0}),this._dynamicDataHelper=new s(this)},onChangeCheckedLegends:function(t){var e=this.dataProcessor.getZoomedRawData(),i=o.filterCheckedRawData(e,t),n=r({rawSeriesData:i.series,yAxisOptions:this.options.yAxis});this._dynamicDataHelper.reset(),this._dynamicDataHelper.changeCheckedLegends(t,i,n)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("areaSeries","areaSeries"),this.componentManager.register("lineSeries","lineSeries"),this.componentManager.register("xAxis","axis"),this.componentManager.register("yAxis","axis"),this.hasRightYAxis&&this.componentManager.register("rightYAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){var t={yAxis:this._makeYAxisScaleOption("yAxis",this.chartTypes[0],!this.hasRightYAxis)};return this.hasRightYAxis&&(t.rightYAxis=this._makeYAxisScaleOption("rightYAxis",this.chartTypes[1])),t},_makeYAxisScaleOption:function(t,e,i){var n=this.yAxisOptions[e],o={isSingleYAxis:!!i};return i&&this.options.series&&this._setAdditionalOptions(o),{options:n,areaType:"yAxis",chartType:e,additionalOptions:o}},_makeYAxisOptions:function(t,e){var i={};return e=e||{},tui.util.forEachArray(t,function(t,n){i[t]=e[n]||e}),i},addData:function(t,e){this._dynamicDataHelper.addData(t,e)},_setAdditionalOptions:function(t){var e=this.dataProcessor;tui.util.forEach(this.options.series,function(i,n){var o;i.stackType&&(o=e.findChartType(n),a.isAllowedStackOption(o)&&(t.chartType=o,t.stackType=i.stackType))})},addDataRatios:function(t){var e,i=this,n=this.chartTypes||[this.chartType],o=this.options.series||{};e=this.dataProcessor.isCoordinateType()?function(e){i.dataProcessor.addDataRatiosForCoordinateType(e,t,!1)}:function(e){var n=(o[e]||o).stackType;i.dataProcessor.addDataRatios(t[e],n,e)},tui.util.forEachArray(n,e)},_renderForZoom:function(t){var e=this.readyForRender();this.componentManager.render("zoom",e,{isResetZoom:t})},onZoom:function(t){this._dynamicDataHelper.pauseAnimation(),this.dataProcessor.updateRawDataForZoom(t),this._renderForZoom(!1)},onResetZoom:function(){var t=this.dataProcessor.getOriginalRawData();this._dynamicDataHelper.checkedLegends&&(t=o.filterCheckedRawData(t,this._dynamicDataHelper.checkedLegends)),this.dataProcessor.initData(t),this.dataProcessor.initZoomedRawData(),this.dataProcessor.addDataFromRemainDynamicData(tui.util.pick(this.options.series,"shifting")),this._renderForZoom(!0),this._dynamicDataHelper.restartAnimation()}});t.exports=h},function(t,e,i){"use strict";var n=i(20),o=i(4),a=tui.util.defineClass(n,{className:"tui-combo-chart",init:function(t,e,i){this.seriesTypes=tui.util.keys(t.series).sort(),this.chartTypes=["pie","pie"],n.call(this,{rawData:t,theme:e,options:i,isVertical:!0})},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("legend","legend"),this.componentManager.register("pie1Series","pieSeries"),this.componentManager.register("pie2Series","pieSeries"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},addDataRatios:function(){var t=this,e=this.seriesTypes||[this.chartType];tui.util.forEachArray(e,function(e){t.dataProcessor.addDataRatiosOfPieChart(e)})},onChangeCheckedLegends:function(t){var e=this.dataProcessor.getOriginalRawData(),i=o.filterCheckedRawData(e,t);n.prototype.onChangeCheckedLegends.call(this,t,i,{seriesTypes:this.seriesTypes})}});t.exports=a},function(t,e,i){"use strict";var n=i(20),o=i(2),a=tui.util.defineClass(n,{className:"tui-pie-chart",init:function(t,e,i){i.tooltip=i.tooltip||{},i.tooltip.align||(i.tooltip.align=o.TOOLTIP_DEFAULT_ALIGN_OPTION),n.call(this,{rawData:t,theme:e,options:i})},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("legend","legend"),this.componentManager.register("pieSeries","pieSeries"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},addDataRatios:function(){this.dataProcessor.addDataRatiosOfPieChart(this.chartType)}});t.exports=a},function(t,e,i){"use strict";var n=i(20),o=i(2),a=tui.util.defineClass(n,{className:"tui-bubble-chart",init:function(t,e,i){i.tooltip=i.tooltip||{},i.circleLegend=i.circleLegend||{},i.tooltip.align||(i.tooltip.align=o.TOOLTIP_DEFAULT_ALIGN_OPTION),tui.util.isUndefined(i.circleLegend.visible)&&(i.circleLegend.visible=!0),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0})},getScaleOption:function(){var t={};return this.dataProcessor.hasXValue(this.chartType)&&(t.xAxis={valueType:"x"}),this.dataProcessor.hasYValue(this.chartType)&&(t.yAxis={valueType:"y"}),t},_setDefaultOptions:function(t){n.prototype._setDefaultOptions.call(this,t),this.options.circleLegend=this.options.circleLegend||{},tui.util.isUndefined(this.options.circleLegend.visible)&&(this.options.circleLegend.visible=!0)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("circleLegend","circleLegend"),this.componentManager.register("bubbleSeries","bubbleSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},addDataRatios:function(t){this.dataProcessor.addDataRatiosForCoordinateType(this.chartType,t,!0)}});t.exports=a},function(t,e,i){"use strict";var n=i(20),o=i(2),a=tui.util.defineClass(n,{className:"tui-scatter-chart",init:function(t,e,i){i.tooltip=i.tooltip||{},i.tooltip.align||(i.tooltip.align=o.TOOLTIP_DEFAULT_ALIGN_OPTION),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0})},getScaleOption:function(){return{xAxis:{valueType:"x"},yAxis:{valueType:"y"}}},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("scatterSeries","scatterSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},addDataRatios:function(t){this.dataProcessor.addDataRatiosForCoordinateType(this.chartType,t,!1)}});t.exports=a},function(t,e,i){"use strict";var n=i(20),o=i(115),a=i(2),r=tui.util.defineClass(n,{className:"tui-heatmap-chart",init:function(t,e,i){i.tooltip=i.tooltip||{},i.tooltip.align||(i.tooltip.align=a.TOOLTIP_DEFAULT_ALIGN_OPTION),i.tooltip.grouped=!1,n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},_addComponents:function(){var t=this.theme.series[this.chartType],e=new o(t.startColor,t.endColor);this._addComponentsForAxisType({axis:[{name:"yAxis",isVertical:!0},{name:"xAxis"}],legend:{classType:"spectrumLegend",additionalParams:{colorSpectrum:e}},series:[{name:"heatmapSeries",data:{colorSpectrum:e}}],tooltip:!0,mouseEventDetector:!0})},getScaleOption:function(){return{legend:!0}},addDataRatios:function(t){this.dataProcessor.addDataRatios(t.legend,null,this.chartType)},addComponents:function(){var t=this.theme.series[this.chartType],e=new o(t.startColor,t.endColor);this.componentManager.register("title","title"),this.componentManager.register("legend","spectrumLegend",{colorSpectrum:e}),this.componentManager.register("heatmapSeries","heatmapSeries",{colorSpectrum:e}),this.componentManager.register("xAxis","axis"),this.componentManager.register("yAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")}});t.exports=r},function(t,e,i){"use strict";var n=i(116),o=tui.util.defineClass({init:function(t,e){var i;this.start=n.colorNameToHex(t),this.startRGB=n.hexToRGB(this.start),this.end=n.colorNameToHex(e),i=n.hexToRGB(this.end),this.distances=this._makeDistances(this.startRGB,i),this.colorMap={}},_makeDistances:function(t,e){return tui.util.map(t,function(t,i){return e[i]-t})},getColor:function(t){var e,i,o=this.colorMap[t];return o||(e=this.distances,i=tui.util.map(this.startRGB,function(i,n){return i+parseInt(e[n]*t,10)}),o=n.rgbToHEX.apply(null,i)),o||null}});t.exports=o},function(t,e){"use strict";var i=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o={leadingZero:function(t,e){var i="",n=0;if(String(t).length>e)return String(t);for(;n<e-1;n+=1)i+="0";return(i+t).slice(-1*e)},isValidRGB:function(t){return i.test(t)},hexToRGB:function(t){return!!o.isValidRGB(t)&&(t=t.substring(1),[parseInt(t.substr(0,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(4,2),16)])},rgbToHEX:function(t,e,i){var n="#"+o.leadingZero(t.toString(16),2)+o.leadingZero(e.toString(16),2)+o.leadingZero(i.toString(16),2);return!!o.isValidRGB(n)&&n},colorNameToHex:function(t){return n[t.toLowerCase()]||t}};tui.util.defineNamespace("tui.chart"),tui.chart.colorutil=o,t.exports=o},function(t,e,i){"use strict";var n=i(20),o=i(115),a=tui.util.defineClass(n,{className:"tui-treemap-chart",init:function(t,e,i){i.tooltip=i.tooltip||{},i.tooltip.grouped=!1,n.call(this,{rawData:t,theme:e,options:i,hasAxes:!1,isVertical:!0})},addComponents:function(){var t=this.theme.series[this.chartType],e=this.options.series.useColorValue,i=e?new o(t.startColor,t.endColor):null;this.componentManager.register("title","title"),this.componentManager.register("treemapSeries","treemapSeries",{colorSpectrum:i}),e&&this.options.legend.visible&&this.componentManager.register("legend","spectrumLegend",{colorSpectrum:i}),this.componentManager.register("tooltip","tooltip",tui.util.extend({labelTheme:tui.util.pick(this.theme,"series","label")})),this.componentManager.register("mouseEventDetector","mouseEventDetector"),this.componentManager.register("chartExportMenu","chartExportMenu")},getScaleOption:function(){return{legend:!0}},addDataRatios:function(t){this.dataProcessor.addDataRatiosForTreemapChart(t.legend,this.chartType)},onZoom:function(t){this.componentManager.render("zoom",null,{index:t})}});t.exports=a},function(t,e,i){"use strict";var n=i(20),o=i(10),a=i(119),r=i(120),s=i(115),h=tui.util.defineClass(n,{init:function(t,e,i){this.className="tui-map-chart",i.map=o.get(i.map),i.tooltip=i.tooltip||{},i.legend=i.legend||{},n.call(this,{rawData:t,theme:e,options:i,DataProcessor:r})},addComponents:function(){var t=this.theme.series[this.chartType],e=new a(this.dataProcessor,this.options.map),i=new s(t.startColor,t.endColor);this.componentManager.register("title","title"),this.componentManager.register("legend","spectrumLegend",{colorSpectrum:i}),this.componentManager.register("tooltip","tooltip",{mapModel:e}),this.componentManager.register("mapSeries","mapSeries",{mapModel:e,colorSpectrum:i}),this.componentManager.register("zoom","zoom"),this.componentManager.register("mouseEventDetector","mapChartEventDetector")},getScaleOption:function(){return{legend:!0}},addDataRatios:function(t){this.dataProcessor.addDataRatios(t.legend)}});t.exports=h},function(t,e,i){"use strict";var n=i(2),o=i(6),a=tui.util.defineClass({init:function(t,e){this.commandFuncMap={M:tui.util.bind(this._makeCoordinate,this),m:tui.util.bind(this._makeCoordinateFromRelativeCoordinate,this),L:tui.util.bind(this._makeCoordinate,this),l:tui.util.bind(this._makeCoordinateFromRelativeCoordinate,this),H:tui.util.bind(this._makeXCoordinate,this),h:tui.util.bind(this._makeXCoordinateFroRelativeCoordinate,this),V:tui.util.bind(this._makeYCoordinate,this),v:tui.util.bind(this._makeYCoordinateFromRelativeCoordinate,this)},this.ignoreCommandMap={Z:!0,z:!0},this.mapDimension=null,this.dataProcessor=t,this.rawMapData=e,this.mapData=null},_splitCoordinate:function(t){var e=t.split(","),i={x:parseFloat(e[0])};return e[1]&&(i.y=parseFloat(e[1])),i},_makeCoordinate:function(t){return this._splitCoordinate(t)},_makeCoordinateFromRelativeCoordinate:function(t,e){var i=this._splitCoordinate(t);return{x:i.x+e.x,y:i.y+e.y}},_makeXCoordinate:function(t){return{x:this._splitCoordinate(t).x}},_makeXCoordinateFroRelativeCoordinate:function(t,e){return{x:this._splitCoordinate(t).x+e.x}},_makeYCoordinate:function(t){return{y:this._splitCoordinate(t).x}},_makeYCoordinateFromRelativeCoordinate:function(t,e){return{y:this._splitCoordinate(t).x+e.y}},_splitPath:function(t){for(var e,i,n=0,o=t.length,a=[],r="";n<o;n+=1)e=t.charAt(n),this.commandFuncMap[e]?(i&&r&&a.push({type:i,coordinate:r}),i=e,r=""):this.ignoreCommandMap[e]||(r+=e);return i&&r&&a.push({type:i,coordinate:r}),a},_makeCoordinatesFromPath:function(t){var e=this,i=this._splitPath(t),n={x:0,y:0};return tui.util.map(i,function(t){var i=(0,e.commandFuncMap[t.type])(t.coordinate,n);return tui.util.extend(n,i),i})},_findBoundFromCoordinates:function(t){var e=tui.util.filter(tui.util.pluck(t,"x"),function(t){return!tui.util.isUndefined(t)}),i=tui.util.filter(tui.util.pluck(t,"y"),function(t){return!tui.util.isUndefined(t)}),n=o.max(e),a=o.min(e),r=o.max(i),s=o.min(i);return{dimension:{width:n-a,height:r-s},position:{left:a,top:s}}},_makeLabelPosition:function(t,e){return e=e||n.MAP_CHART_LABEL_DEFAULT_POSITION_RATIO,{left:t.position.left+t.dimension.width*e.x,top:t.position.top+t.dimension.height*e.y}},_createMapData:function(t){var e=this;return tui.util.map(t,function(t){var i,n,o,a,r,s=e._makeCoordinatesFromPath(t.path),h=e._findBoundFromCoordinates(s),u=e.dataProcessor.getValueMapDatum(t.code);return u&&(o=u.label,a=u.ratio,i=u.name||t.name,n=u.labelCoordinate||t.labelCoordinate),r={code:t.code,name:i,path:t.path,bound:h,labelPosition:e._makeLabelPosition(h,n)},o&&(r.label=o),a&&(r.ratio=a),r})},getMapData:function(){return this.mapData||(this.mapData=this._createMapData(this.rawMapData)),this.mapData},getDatum:function(t){return this.getMapData()[t]},getLabelData:function(t){var e=this,i=this.getMapData(),n=tui.util.filter(i,function(t){return e.dataProcessor.getValueMapDatum(t.code)});return tui.util.map(n,function(e){return{name:e.name,labelPosition:{left:e.labelPosition.left*t,top:e.labelPosition.top*t}}})},_makeMapDimension:function(){var t=this.getMapData(),e=tui.util.map(t,function(t){return t.bound.position.left}),i=tui.util.map(t,function(t){return t.bound.position.left+t.bound.dimension.width}),n=tui.util.map(t,function(t){return t.bound.position.top}),a=tui.util.map(t,function(t){return t.bound.position.top+t.bound.dimension.height});return{width:o.max(i)-o.min(e),height:o.max(a)-o.min(n)}},getMapDimension:function(){return this.mapDimension||(this.mapDimension=this._makeMapDimension()),this.mapDimension}});t.exports=a},function(t,e,i){"use strict";var n=i(81),o=i(24),a=tui.util.defineClass(n,{init:function(t,e,i){this.rawData=t,this.options=i},initData:function(t){this.rawData=t,this.valueMap=null},_makeValueMap:function(){var t=this.rawData.series.map,e={},i=this._findFormatFunctions();return tui.util.forEachArray(t,function(t){var n={value:t.data,label:o.formatValue(t.data,i,"map","series")};t.name&&(n.name=t.name),t.labelCoordinate&&(n.labelCoordinate=t.labelCoordinate),e[t.code]=n}),e},getValueMap:function(){return this.valueMap||(this.valueMap=this._makeValueMap()),this.valueMap},getValues:function(){return tui.util.pluck(this.getValueMap(),"value")},getValueMapDatum:function(t){return this.getValueMap()[t]},addDataRatios:function(t){var e=t.min,i=t.max-e;tui.util.forEach(this.getValueMap(),function(t){t.ratio=(t.value-e)/i})},createBaseValuesForLimit:function(){return this.getValues()},getLegendVisibility:function(){return null}});t.exports=a},function(t,e,i){"use strict";var n=i(20),o=i(65),a=tui.util.defineClass(n,{className:"tui-radial-chart",Series:o,init:function(t,e,i){i.tooltip&&(i.tooltip.grouped=!1),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("legend","legend"),this.componentManager.register("plot","radialPlot"),this.componentManager.register("radialSeries","radialSeries"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},addDataRatios:function(t){this.dataProcessor.addDataRatios(t[this.chartType],null,this.chartType)},getScaleOption:function(){return{yAxis:{}}}});t.exports=a},function(t,e,i){"use strict";var n=i(20),o=i(4),a=tui.util.defineClass(n,{className:"tui-boxplot-chart",init:function(t,e,i){o.appendOutliersToSeriesData(t),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("boxplotSeries","boxplotSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){return{yAxis:!0}},onChangeCheckedLegends:function(t){var e;this.hasRightYAxis&&(e={optionChartTypes:["boxplot","boxplot"]}),n.prototype.onChangeCheckedLegends.call(this,t,null,e)},addDataRatios:function(t){var e=this.options.series||{},i=this.chartType,n=(e[i]||e).stackType;this.dataProcessor.addDataRatios(t[i],n,i)}});t.exports=a},function(t,e,i){"use strict";var n=i(2),o=i(8),a=i(9);o.register(n.DEFAULT_THEME_NAME,a)},function(t,e,i){"use strict";var n=window.Raphael,o=i(125),a=i(126),r=i(127),s=i(129),h=i(131),u=i(132),l=i(133),c=i(134),d=i(135),p=i(136),f=i(137),m=i(138),g=i(139),_=i(140),T={bar:o,boxplot:a,column:o,line:r,area:s,pie:h,bubble:l,scatter:l,heatmap:c,treemap:c,map:d,radial:u,legend:p,mapLegend:f,circleLegend:m,radialPlot:i(141),title:g,axis:_};tui.chart.registerPlugin("Raphael",T,function(t,e){var i,o,a,r,s,h,u,l,c,d=n(t,e.width,e.height),p=d.rect(0,0,e.width,e.height);return d.raphael.svg&&(i=d,o=document.createElementNS("http://www.w3.org/2000/svg","filter"),a=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur"),r=document.createElementNS("http://www.w3.org/2000/svg","feFlood"),s=document.createElementNS("http://www.w3.org/2000/svg","feComposite"),h=document.createElementNS("http://www.w3.org/2000/svg","feMorphology"),u=document.createElementNS("http://www.w3.org/2000/svg","feMerge"),l=document.createElementNS("http://www.w3.org/2000/svg","feMergeNode"),c=document.createElementNS("http://www.w3.org/2000/svg","feMergeNode"),o.id="glow",r.setAttribute("result","flood"),r.setAttribute("flood-color","#ffffff"),r.setAttribute("flood-opacity","0.5"),s.setAttribute("in","flood"),s.setAttribute("result","mask"),s.setAttribute("in2","SourceGraphic"),s.setAttribute("operator","in"),h.setAttribute("in","mask"),h.setAttribute("result","dilated"),h.setAttribute("operator","dilate"),h.setAttribute("radius","2"),a.setAttribute("in","dilated"),a.setAttribute("result","blurred"),a.setAttribute("stdDeviation","1"),l.setAttribute("in","blurred"),c.setAttribute("in","SourceGraphic"),o.appendChild(r),o.appendChild(s),o.appendChild(h),o.appendChild(a),o.appendChild(u),u.appendChild(l),u.appendChild(c),i.defs.appendChild(o)),d.pushDownBackgroundToBottom=function(){p.toBack()},d.changeChartBackgroundColor=function(t){p.attr({fill:t})},d.changeChartBackgroundOpacity=function(t){p.attr({"fill-opacity":t})},d.resizeBackground=function(t,e){p.attr({width:t,height:e})},p.attr({fill:"#fff","stroke-width":0}),d})},function(t,e,i){"use strict";var n=i(61),o=window.Raphael,a=tui.util.defineClass({render:function(t,e){var i=e.groupBounds;return i?(this.paper=t,this.theme=e.theme,this.seriesDataModel=e.seriesDataModel,this.chartType=e.chartType,this.paper.setStart(),this.options=e.options,this.theme=e.theme,this.groupBars=this._renderBars(i),this.groupBorders=this._renderBarBorders(i),this.overlay=this._renderOverlay(),this.groupBounds=i,this.paper.setFinish()):null},_renderOverlay:function(){return this._renderBar({width:1,height:1,left:0,top:0},"#fff",{"fill-opacity":0})},_renderBar:function(t,e,i){return t.width<0||t.height<0?null:n.renderRect(this.paper,t,tui.util.extend({fill:e,stroke:"none"},i))},_renderBars:function(t){var e=this,i=this.theme.colors,n=this.options.colorByPoint;return tui.util.map(t,function(t,o){return tui.util.map(t,function(t,a){var r,s;return t?(s=e.seriesDataModel.getSeriesItem(o,a),r=n?i[o]:i[a],{rect:e._renderBar(t.start,r),color:r,bound:t.end,item:s,groupIndex:o,index:a,isRange:s.isRange}):null})})},_makeRectPoints:function(t){return{leftTop:{left:Math.ceil(t.left),top:Math.ceil(t.top)},rightTop:{left:Math.ceil(t.left+t.width),top:Math.ceil(t.top)},rightBottom:{left:Math.ceil(t.left+t.width),top:Math.ceil(t.top+t.height)},leftBottom:{left:Math.ceil(t.left),top:Math.ceil(t.top+t.height)}}},_makeTopLinePath:function(t,e,i){var o,a=null,r=i.value;return("bar"===e||r>=0||i.isRange)&&((o=tui.util.extend({},t.leftTop)).left-="column"===e||r<0?1:0,a=n.makeLinePath(o,t.rightTop).join(" ")),a},_makeRightLinePath:function(t,e,i){var o=null;return("column"===e||i.value>=0||i.isRange)&&(o=n.makeLinePath(t.rightTop,t.rightBottom).join(" ")),o},_makeBottomLinePath:function(t,e,i){var o=null;return("bar"===e||i.value<0||i.isRange)&&(o=n.makeLinePath(t.leftBottom,t.rightBottom).join(" ")),o},_makeLeftLinePath:function(t,e,i){var o=null;return("column"===e||i.value<0||i.isRange)&&(o=n.makeLinePath(t.leftTop,t.leftBottom).join(" ")),o},_makeBorderLinesPaths:function(t,e,i){var n=this._makeRectPoints(t),o={top:this._makeTopLinePath(n,e,i),right:this._makeRightLinePath(n,e,i),bottom:this._makeBottomLinePath(n,e,i),left:this._makeLeftLinePath(n,e,i)};return tui.util.filter(o,function(t){return t})},_renderBorderLines:function(t,e,i,o){var a=this,r=this._makeBorderLinesPaths(t,i,o),s={};return tui.util.forEach(r,function(t,i){s[i]=n.renderLine(a.paper,t,e,1)}),s},_renderBarBorders:function(t){var e=this,i=this.theme.borderColor;return i?tui.util.map(t,function(t,n){return tui.util.map(t,function(t,o){var a;return t?(a=e.seriesDataModel.getSeriesItem(n,o),e._renderBorderLines(t.start,i,e.chartType,a)):null})}):null},_animateRect:function(t,e){t.animate({x:e.left,y:e.top,width:e.width,height:e.height},700,">")},_animateBorders:function(t,e,i,n){var o=this._makeBorderLinesPaths(e,i,n);tui.util.forEach(t,function(t,e){t.animate({path:o[e]},700,">")})},animate:function(t){var e=this,i=this.groupBorders||[];n.forEach2dArray(this.groupBars,function(t,n,o){var a=i[n]&&i[n][o];t&&(e._animateRect(t.rect,t.bound),a&&e._animateBorders(a,t.bound,e.chartType,t.item))}),t&&(this.callbackTimeout=setTimeout(function(){t(),delete e.callbackTimeout},700))},showAnimation:function(t){var e=this.groupBars[t.groupIndex][t.index].bound;this.overlay.attr({width:e.width,height:e.height,x:e.left,y:e.top,"fill-opacity":.3})},hideAnimation:function(){this.overlay.attr({width:1,height:1,x:0,y:0,"fill-opacity":0})},_updateRectBound:function(t,e){t.attr({x:e.left,y:e.top,width:e.width,height:e.height})},resize:function(t){var e=this,i=this.groupBorders||[],o=t.dimension,a=t.groupBounds;this.groupBounds=a,this.paper.setSize(o.width,o.height),n.forEach2dArray(this.groupBars,function(t,o,r){var s,h;t&&(s=i[o]&&i[o][r],h=a[o][r].end,t.bound=h,n.updateRectBound(t.rect,h),s&&e._updateBordersPath(s,h,e.chartType,t.item))})},_changeBordersColor:function(t,e){tui.util.forEach(t,function(t){t.attr({stroke:e})})},_changeBarColor:function(t,e,i){var n;this.groupBars[t.groupIndex][t.index].rect.attr({fill:e}),i&&(n=this.groupBorders[t.groupIndex][t.index],this._changeBordersColor(n,i))},selectSeries:function(t){var e,i=this.groupBars[t.groupIndex][t.index],a=o.color(i.color),r=this.theme.selectionColor||n.makeChangedLuminanceColor(a.hex,.2),s=this.theme.borderColor;s&&(e=o.color(s),s=n.makeChangedLuminanceColor(e.hex,.2)),this._changeBarColor(t,r,s)},unselectSeries:function(t){var e=this.groupBars[t.groupIndex][t.index],i=this.theme.borderColor;this._changeBarColor(t,e.color,i)},selectLegend:function(t){var e=this.groupBorders||[],i=tui.util.isNull(t);n.forEach2dArray(this.groupBars,function(n,o,a){var r,s;n&&(r=e[o]&&e[o][a],s=i||t===a?1:.3,n.rect.attr({"fill-opacity":s}),r&&tui.util.forEach(r,function(t){t.attr({"stroke-opacity":s})}))})},renderSeriesLabel:function(t,e,i,o,a){var r={"font-size":o.fontSize,"font-family":o.fontFamily,"font-weight":o.fontWeight,fill:o.color,opacity:0,"text-anchor":a?"middle":"start"},s=t.set();return tui.util.forEach(i,function(i,o){tui.util.forEach(i,function(i,a){var h,u=e[o][a],l=n.renderText(t,u.end,i.end,r);l.node.style.userSelect="none",l.node.style.cursor="default",l.node.setAttribute("filter","url(#glow)"),s.push(l),u.start&&((h=n.renderText(t,u.start,i.start,r)).node.style.userSelect="none",h.node.style.cursor="default",h.node.setAttribute("filter","url(#glow)"),s.push(h))})}),s}});t.exports=a},function(t,e,i){"use strict";var n=i(61),o=window.Raphael,a=tui.util.defineClass({render:function(t,e){var i=e.groupBounds;return i?(this.paper=t,this.theme=e.theme,this.options=e.options,this.seriesDataModel=e.seriesDataModel,this.chartType=e.chartType,this.paper.setStart(),this.groupWhiskers=[],this.groupMedians=[],this.groupBoxes=this._renderBoxplots(i),this.groupBorders=this._renderBoxBorders(i),this.rectOverlay=this._renderRectOverlay(),this.circleOverlay=this._renderCircleOverlay(),this.groupBounds=i,this.paper.setFinish()):null},_renderRectOverlay:function(){return n.renderRect(this.paper,{width:1,height:1,left:0,top:0},tui.util.extend({"stroke-width":0},{"fill-opacity":0}))},_renderCircleOverlay:function(){return n.renderCircle(this.paper,{left:0,top:0},0,tui.util.extend({"stroke-width":0},{"fill-opacity":0}))},_renderBox:function(t,e,i){return t.width<0||t.height<0?null:n.renderRect(this.paper,t,tui.util.extend({fill:"#fff",stroke:e,"stroke-width":1},i))},_renderBoxes:function(t){var e=this,i=this.theme.colors,n=this.options.colorByPoint;return tui.util.map(t,function(t,o){return tui.util.map(t,function(t,a){var r,s,h;return t?(h=e.seriesDataModel.getSeriesItem(o,a),r=n?i[o]:i[a],t.start&&(s=e._renderBox(t.start,r)),{rect:s,color:r,bound:t.end,item:h,groupIndex:o,index:a}):null})})},_renderBoxplots:function(t){var e=this._renderBoxes(t);return this.groupWhiskers=this._renderWhiskers(t),this.groupMedians=this._renderMedianLines(t),this.groupOutliers=this._renderOutliers(t),e},_renderWhisker:function(t,e,i){var o=this.paper,a=e.top-t.top,r=a>0?1:-1,s=t.width,h=t.left,u=s/4,l="M"+(h+u)+","+t.top+"H"+(h+3*u),c="M"+(h+2*u)+","+t.top+"V"+(t.top+Math.abs(a)*r),d=n.renderLine(o,l,i,2),p=n.renderLine(o,c,i,1),f=[];return d.attr({opacity:0}),p.attr({opacity:0}),f.push(d),f.push(p),f},_renderWhiskers:function(t){var e=this,i=this.theme.colors,n=this.options.colorByPoint,o=[];return tui.util.forEach(t,function(t,a){var r=[];tui.util.forEach(t,function(t,o){var s=n?i[a]:i[o];t&&(r=(r=r.concat(e._renderWhisker(t.min,t.start,s))).concat(e._renderWhisker(t.max,t.end,s)))}),o.push(r)}),o},_renderMedianLine:function(t,e){var i=t.width,o="M"+t.left+","+t.top+"H"+(t.left+i),a=n.renderLine(this.paper,o,e,2);return a.attr({opacity:0}),a},_renderMedianLines:function(t){var e=this,i=this.theme.colors,n=this.options.colorByPoint,o=[];return tui.util.forEach(t,function(t,a){var r=[];tui.util.forEach(t,function(t,o){var s=n?i[a]:i[o];t&&r.push(e._renderMedianLine(t.median,s))}),o.push(r)}),o},_renderOutlier:function(t,e){var i=n.renderCircle(this.paper,{left:t.left,top:t.top},3,{stroke:e});return i.attr({opacity:0}),i},_renderOutliers:function(t){var e=this,i=this.theme.colors,n=this.options.colorByPoint,o=[];return tui.util.forEach(t,function(t,a){var r=[];tui.util.forEach(t,function(t,o){var s=n?i[a]:i[o],h=[];t&&(t.outliers.length&&tui.util.forEach(t.outliers,function(t){h.push(e._renderOutlier(t,s))}),r.push(h))}),o.push(r)}),o},_makeRectPoints:function(t){return{leftTop:{left:Math.ceil(t.left),top:Math.ceil(t.top)},rightTop:{left:Math.ceil(t.left+t.width),top:Math.ceil(t.top)},rightBottom:{left:Math.ceil(t.left+t.width),top:Math.ceil(t.top+t.height)},leftBottom:{left:Math.ceil(t.left),top:Math.ceil(t.top+t.height)}}},_renderBorderLines:function(t,e,i,o){var a=this,r=this._makeBorderLinesPaths(t,i,o),s={};return tui.util.forEach(r,function(t,i){s[i]=n.renderLine(a.paper,t,e,1)}),s},_renderBoxBorders:function(t){var e=this,i=this.theme.borderColor;return i?tui.util.map(t,function(t,n){return tui.util.map(t,function(t,o){var a;return t?(a=e.seriesDataModel.getSeriesItem(n,o),e._renderBorderLines(t.start,i,e.chartType,a)):null})}):null},_animateRect:function(t,e){t.animate({x:e.left,y:e.top,width:e.width,height:e.height},700,">")},animate:function(t){var e=this,i=o.animation({opacity:1},700);n.forEach2dArray(this.groupBoxes,function(t){t&&e._animateRect(t.rect,t.bound)}),n.forEach2dArray(e.groupWhiskers,function(t){t.animate(i.delay(700))}),n.forEach2dArray(e.groupMedians,function(t){t.animate(i.delay(700))}),n.forEach2dArray(e.groupOutliers,function(t){tui.util.forEach(t,function(t){t.animate(i.delay(700))})}),t&&(this.callbackTimeout=setTimeout(function(){t(),delete e.callbackTimeout},700))},showAnimation:function(t){tui.util.isNumber(t.outlierIndex)?this.showOutlierAnimation(t):this.showRectAnimation(t)},showRectAnimation:function(t){var e=this.groupBoxes[t.groupIndex][t.index],i=e.bound;this.rectOverlay.attr({width:i.width,height:i.height,x:i.left,y:i.top,fill:e.color,"fill-opacity":.3})},showOutlierAnimation:function(t){var e=this.groupOutliers[t.groupIndex][t.index][t.outlierIndex].attr();this.circleOverlay.attr({r:e.r,cx:e.cx,cy:e.cy,fill:e.stroke,"fill-opacity":.3,stroke:e.stroke,"stroke-width":2})},hideAnimation:function(){this.circleOverlay.attr({width:1,height:1,x:0,y:0,"fill-opacity":0,"stroke-width":0}),this.rectOverlay.attr({width:1,height:1,x:0,y:0,"fill-opacity":0})},_updateRectBound:function(t,e){t.attr({x:e.left,y:e.top,width:e.width,height:e.height})},resize:function(t){var e=t.dimension,i=t.groupBounds;this.groupBounds=i,this.paper.setSize(e.width,e.height),n.forEach2dArray(this.groupBoxes,function(t,e,o){var a;t&&(a=i[e][o].end,t.bound=a,n.updateRectBound(t.rect,a))})},_changeBordersColor:function(t,e){tui.util.forEach(t,function(t){t.attr({stroke:e})})},_changeBoxColor:function(t,e,i){var n;this.groupBoxes[t.groupIndex][t.index].rect.attr({stroke:e}),i&&(n=this.groupBorders[t.groupIndex][t.index],this._changeBordersColor(n,i))},selectSeries:function(t){var e,i=this.groupBoxes[t.groupIndex][t.index],a=o.color(i.color),r=this.theme.selectionColor||n.makeChangedLuminanceColor(a.hex,.2),s=this.theme.borderColor;s&&(e=o.color(s),s=n.makeChangedLuminanceColor(e.hex,.2)),this._changeBoxColor(t,r,s)},unselectSeries:function(t){var e=this.groupBoxes[t.groupIndex][t.index],i=this.theme.borderColor;this._changeBoxColor(t,e.color,i)},selectLegend:function(t){var e=tui.util.isNull(t);n.forEach2dArray(this.groupBoxes,function(i,n,o){var a;i&&(a=e||t===o?1:.3,i.rect.attr({"stroke-opacity":a}))}),n.forEach2dArray(this.groupWhiskers,function(i,n,o){var a=e||t===o?1:.3;i.attr({"stroke-opacity":a})}),n.forEach2dArray(this.groupMedians,function(i,n,o){var a=e||t===o?1:.3;i.attr({"stroke-opacity":a})})},renderSeriesLabel:function(t,e,i,o,a){var r={"font-size":o.fontSize,"font-family":o.fontFamily,"font-weight":o.fontWeight,fill:o.color,opacity:0,"text-anchor":a?"middle":"start"},s=t.set();return tui.util.forEach(i,function(i,o){tui.util.forEach(i,function(i,a){var h,u=e[o][a],l=n.renderText(t,u.end,i.end,r);l.node.style.userSelect="none",l.node.style.cursor="default",l.node.setAttribute("filter","url(#glow)"),s.push(l),u.start&&((h=n.renderText(t,u.start,i.start,r)).node.style.userSelect="none",h.node.style.cursor="default",h.node.setAttribute("filter","url(#glow)"),s.push(h))})}),s}});t.exports=a},function(t,e,i){"use strict";var n=i(128),o=i(61),a=tui.util.defineClass(n,{init:function(){this.selectedLegendIndex=null,this.chartType="line",this.lineWidth=2},render:function(t,e){var i,n=e.dimension,o=e.groupPositions,a=e.theme,r=a.colors,s=e.options,h=s.showDot?1:0,u=s.spline,l=this.lineWidth=tui.util.isNumber(s.pointWidth)?s.pointWidth:this.lineWidth,c=this.makeBorderStyle(a.borderColor,h),d=this.makeOutDotStyle(h,c);return i=u?this._getSplineLinesPath(o,s.connectNulls):this._getLinesPath(o,s.connectNulls),this.paper=t,this.theme=e.theme,this.isSpline=u,this.dimension=n,this.position=e.position,t.setStart(),this.groupLines=this._renderLines(t,i,r,l),this.tooltipLine=this._renderTooltipLine(t,n.height),this.groupDots=this._renderDots(t,o,r,h),s.allowSelect&&(this.selectionDot=this._makeSelectionDot(t),this.selectionColor=a.selectionColor),this.colors=r,this.borderStyle=c,this.outDotStyle=d,this.groupPositions=o,this.groupPaths=i,this.dotOpacity=h,delete this.pivotGroupDots,t.setFinish()},_getLinesPath:function(t,e){var i=this;return tui.util.map(t,function(t){return i._makeLinesPath(t,null,e)})},_getSplineLinesPath:function(t,e){var i=this;return tui.util.map(t,function(t){return i._makeSplineLinesPath(t,e)})},_renderLines:function(t,e,i,n){return tui.util.map(e,function(e,a){var r=i[a]||"transparent";return o.renderLine(t,e.join(" "),r,n)})},resize:function(t){var e=this,i=t.dimension,n=t.groupPositions;this.resizeClipRect(i),this.groupPositions=n,this.groupPaths=this.isSpline?this._getSplineLinesPath(n):this._getLinesPath(n),this.paper.setSize(i.width,i.height),this.tooltipLine.attr({top:i.height}),tui.util.forEachArray(this.groupPaths,function(t,i){e.groupLines[i].attr({path:t.join(" ")}),tui.util.forEachArray(e.groupDots[i],function(t,o){t.endDot&&e._moveDot(t.endDot.dot,n[i][o])})})},selectLegend:function(t){var e=this,i=tui.util.isNull(t);this.selectedLegendIndex=t,tui.util.forEachArray(this.groupLines,function(n,o){var a=i||t===o?1:.3;n.attr({"stroke-opacity":a}),tui.util.forEachArray(e.groupDots[o],function(t){t.opacity=a,e.dotOpacity&&t.endDot.dot.attr({"fill-opacity":a})})})},animateForAddingData:function(t,e,i,n){var o=this,a=t.options.spline?this._getSplineLinesPath(i):this._getLinesPath(i),r=0;i.length&&(n&&(r=1),tui.util.forEachArray(this.groupLines,function(t,s){var h=o.groupDots[s],u=i[s];n&&o._removeFirstDot(h),tui.util.forEachArray(h,function(t,i){var n=u[i+r];o._animateByPosition(t.endDot.dot,n,e)}),o._animateByPath(t,a[s],e)}))},renderSeriesLabel:function(t,e,i,n){var a={"font-size":n.fontSize,"font-family":n.fontFamily,"font-weight":n.fontWeight,fill:n.color,"text-anchor":"middle",opacity:0},r=t.set();return tui.util.forEach(i,function(i,n){tui.util.forEach(i,function(i,s){var h,u=e[n][s],l=o.renderText(t,u.end,i.end,a);r.push(l),l.node.style.userSelect="none",l.node.style.cursor="default",l.node.setAttribute("filter","url(#glow)"),u.start&&((h=o.renderText(t,u.start,i.start,a)).node.style.userSelect="none",h.node.style.cursor="default",h.node.setAttribute("filter","url(#glow)"),r.push(h))})}),r}});t.exports=a},function(t,e,i){"use strict";var n=i(61),o=tui.util.browser,a=o.msie&&o.version<=8,r="clipRectForAnimation",s=Array.prototype.concat,h=tui.util.defineClass({_makeLinesPath:function(t,e,i){var n=[],o=!1;return e=e||"top",tui.util.map(t,function(t){var a=o&&!i?"M":"L";t?(n.push([a,t.left,t[e]]),o&&(o=!1)):o=!0}),(n=s.apply([],n)).length>0&&(n[0]="M"),n},_getAnchor:function(t,e,i){var n,o,a,r,s,h=(e.left-t.left)/2,u=(i.left-e.left)/2,l=Math.atan((e.left-t.left)/Math.abs(e.top-t.top)),c=Math.atan((i.left-e.left)/Math.abs(e.top-i.top));return l=t.top<e.top?Math.PI-l:l,c=i.top<e.top?Math.PI-c:c,n=Math.PI/2-(l+c)%(2*Math.PI)/2,o=h*Math.sin(n+l),a=h*Math.cos(n+l),r=u*Math.sin(n+c),s=u*Math.cos(n+c),{x1:e.left-o,y1:e.top+a,x2:e.left+r,y2:e.top+s}},_getSplinePositionsGroups:function(t,e){var i=[],n=[];return tui.util.forEach(t,function(o,a){var r=a===t.length-1;o&&n.push(o),(!o&&n.length>0&&!e||r)&&(i.push(n),n=[])}),i},_getSplinePartialPaths:function(t){var e,i,n,o,a,r,s,h=this,u=[];return tui.util.forEach(t,function(t){s=e=t[0],n=t.length,o=e,i=t[n-1],a=t.slice(1).slice(0,n-2),(r=tui.util.map(a,function(e,i){var n=t[i+2],a=h._getAnchor(o,e,n);return o=e,Math.abs(a.y1-s.top)>Math.abs(s.top-e.top)&&(a.y1=e.top),Math.abs(a.y2-n.top)>Math.abs(n.top-e.top)&&(a.y2=e.top),s=e,[a.x1,a.y1,e.left,e.top,a.x2,a.y2]})).push([i.left,i.top,i.left,i.top]),r.unshift(["M",e.left,e.top,"C",e.left,e.top]),u.push(r)}),u},_makeSplineLinesPath:function(t,e){var i=[],n=this._getSplinePositionsGroups(t,e),o=this._getSplinePartialPaths(n);return tui.util.forEach(o,function(t){i=i.concat(t)}),i},_renderTooltipLine:function(t,e){var i=n.makeLinePath({left:10,top:e},{left:10,top:0});return n.renderLine(t,i,"transparent",1)},makeBorderStyle:function(t,e){var i;return t&&(i={stroke:t,"stroke-width":1,"stroke-opacity":e}),i},makeOutDotStyle:function(t,e){var i={"fill-opacity":t,"stroke-opacity":0,r:3};return e&&tui.util.extend(i,e),i},renderDot:function(t,e,i,n){var o,a,r,s=this.theme&&this.theme.dot||{dot:{}};return e&&(o=t.circle(e.left,e.top,s.radius||3),a={fill:s.fillColor||i,"fill-opacity":tui.util.isNumber(n)?n:s.fillOpacity,stroke:s.strokeColor||i,"stroke-opacity":tui.util.isNumber(n)?n:s.strokeOpacity,"stroke-width":s.strokeWidth},o.attr(a),r={dot:o,color:i}),r},_moveDotsToFront:function(t){n.forEach2dArray(t,function(t){t.endDot.dot.toFront(),t.startDot&&t.startDot.dot.toFront()})},_renderDots:function(t,e,i,n,o){var a=this;return tui.util.map(e,function(e,r){var s=i[r];return tui.util.map(e,function(e){var i,r={endDot:a.renderDot(t,e,s,n)};return a.hasRangeData&&((i=tui.util.extend({},e)).top=i.startTop,r.startDot=a.renderDot(t,i,s,n)),o&&(o.push(r.endDot.dot),r.startDot&&o.push(r.startDot.dot)),r})})},_getCenter:function(t,e){return{left:(t.left+e.left)/2,top:(t.top+e.top)/2}},_showDot:function(t){var e=this.theme.dot.hover,i={"fill-opacity":e.fillOpacity,stroke:e.strokeColor||t.color,"stroke-opacity":e.strokeOpacity,"stroke-width":e.strokeWidth,r:e.radius};this.prevDotAttributes=t.dot.attr(),e.fillColor&&(i.fill=e.fillColor),t.dot.attr(i)},_updateLineStrokeWidth:function(t,e){t.attr({"stroke-width":e})},showAnimation:function(t){var e,i,n=t.groupIndex,o=t.index,a=this.groupLines?this.groupLines[o]:this.groupAreas[o],r=this.groupDots[o][n];r&&("area"===this.chartType?(e=2*this.lineWidth,i=a.startLine,a=a.line):e=2*this.lineWidth,this._updateLineStrokeWidth(a,e),i&&this._updateLineStrokeWidth(i,e),this._showDot(r.endDot),r.startDot&&this._showDot(r.startDot))},_getPivotGroupDots:function(){return!this.pivotGroupDots&&this.groupDots&&(this.pivotGroupDots=tui.chart.arrayUtil.pivot(this.groupDots)),this.pivotGroupDots},_showGroupDots:function(t){var e=this,i=this._getPivotGroupDots();i&&i[t]&&tui.util.forEachArray(i[t],function(t){t.endDot&&e._showDot(t.endDot),t.startDot&&e._showDot(t.startDot)})},showGroupTooltipLine:function(t,e){var i=Math.max(t.position.left,11),o=n.makeLinePath({left:i,top:e.position.top+t.dimension.height},{left:i,top:e.position.top});this.tooltipLine&&this.tooltipLine.attr({path:o,stroke:"#999","stroke-opacity":1})},showGroupAnimation:function(t){this._showGroupDots(t)},_hideDot:function(t,e){var i=this.prevDotAttributes,n=this.outDotStyle;i&&!tui.util.isUndefined(e)&&(n=tui.util.extend({r:i.r,"stroke-opacity":i["stroke-opacity"],"stroke-width":i["stroke-width"]},{"fill-opacity":e})),t.attr(n)},hideAnimation:function(t){var e,i,n,o,a=t.groupIndex,r=t.index,s=this.dotOpacity,h=this.groupDots[r];h&&h[a]&&(e=this.groupLines?this.groupLines[r]:this.groupAreas[r],i=h[a],"area"===this.chartType?(n=this.lineWidth,o=e.startLine,e=e.line):n=this.lineWidth,s&&!tui.util.isNull(this.selectedLegendIndex)&&this.selectedLegendIndex!==r&&(s=.3),e&&this._updateLineStrokeWidth(e,n),o&&this._updateLineStrokeWidth(o,n),i&&(this._hideDot(i.endDot.dot,s),i.startDot&&this._hideDot(i.startDot.dot,s)))},_hideGroupDots:function(t){var e=this,i=!tui.util.isNull(this.selectedLegendIndex),n=this.dotOpacity,o=this._getPivotGroupDots();o&&o[t]&&tui.util.forEachArray(o[t],function(t,o){var a=n;a&&i&&e.selectedLegendIndex!==o&&(a=.3),t.endDot&&e._hideDot(t.endDot.dot,a),t.startDot&&e._hideDot(t.startDot.dot,a)})},hideGroupTooltipLine:function(){this.tooltipLine.attr({"stroke-opacity":0})},hideGroupAnimation:function(t){this._hideGroupDots(t)},_moveDot:function(t,e){var i={cx:e.left,cy:e.top};this.dotOpacity&&(i=tui.util.extend({"fill-opacity":this.dotOpacity},i,this.borderStyle)),t.attr(i)},animate:function(t,e){var i,n,o,s,h,u,l=this.paper,c=this.dimension,d=this.position,p=this.clipRect;!a&&c&&(p?p.attr({width:0}):(i=l,n=d,o=c,s=r,h=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),(u=i.rect(n.left-10,n.top-10,0,o.height)).id=s+"_rect",h.id=s,h.appendChild(u.node),i.defs.appendChild(h),p=u,this.clipRect=p),e.forEach(function(t){t.node.setAttribute("clip-path","url(#"+r+")")}),p.animate({width:c.width},700,">",t))},_makeSelectionDot:function(t){var e=t.circle(0,0,7);return e.attr({fill:"#ffffff","fill-opacity":0,"stroke-opacity":0,"stroke-width":2}),e},selectSeries:function(t){var e=this.groupDots[t.index][t.groupIndex],i=this.groupPositions[t.index][t.groupIndex];this.selectedItem=e,this.selectionDot.attr({cx:i.left,cy:i.top,"fill-opacity":.5,"stroke-opacity":1,stroke:this.selectionColor||e.endDot.color}),this.selectionStartDot&&this.selectionStartDot.attr({cx:i.left,cy:i.startTop,"fill-opacity":.5,"stroke-opacity":1,stroke:this.selectionColor||e.startDot.color})},unselectSeries:function(t){var e=this.groupDots[t.index][t.groupIndex];this.selectedItem===e&&this.selectionDot.attr({"fill-opacity":0,"stroke-opacity":0}),this.selectionStartDot&&this.selectionStartDot.attr({"fill-opacity":0,"stroke-opacity":0})},setSize:function(t,e){t=t||this.dimension.width,e=e||this.dimension.height,this.paper.setSize(t,e)},_animateByPosition:function(t,e,i){var n={cx:e.left,cy:e.top};tui.util.isExisty(i)&&(n.transform="t-"+i+",0"),t.animate(n,300)},_animateByPath:function(t,e,i){var n={path:e.join(" ")};tui.util.isExisty(i)&&(n.transform="t-"+i+",0"),t.animate(n,300)},_removeFirstDot:function(t){var e=t.shift();e.endDot.dot.remove(),e.startDot&&e.startDot.dot.remove()},clear:function(){delete this.paper.dots,this.paper.clear()},resizeClipRect:function(t){this.paper.getById(r+"_rect").attr({width:t.width,height:t.height})}});t.exports=h},function(t,e,i){"use strict";var n=i(128),o=i(61),a=Array.prototype.concat,r=i(2).GUIDE_AREACHART_AREAOPACITY_TYPE,s=i(130),h=tui.util.defineClass(n,{init:function(){this.selectedLegendIndex=null,this.chartType="area",this.lineWidth=1},render:function(t,e){var i=e.dimension,n=e.groupPositions,o=e.theme,a=o.colors,r=e.options,s=this._isAreaOpacityNumber(r.areaOpacity)?r.areaOpacity:.5,h=r.showDot?1:0,u=this.makeBorderStyle(o.borderColor,h),l=this.makeOutDotStyle(h,u),c=this.lineWidth=tui.util.isNumber(r.pointWidth)?r.pointWidth:this.lineWidth;return this.paper=t,this.theme=e.theme,this.isSpline=r.spline,this.dimension=i,this.position=e.position,this.zeroTop=e.zeroTop,this.hasRangeData=e.hasRangeData,t.setStart(),this.groupPaths=this._getAreaChartPath(n,null,r.connectNulls),this.groupAreas=this._renderAreas(t,this.groupPaths,a,c,s),this.tooltipLine=this._renderTooltipLine(t,i.height),this.groupDots=this._renderDots(t,n,a,h),r.allowSelect&&(this.selectionDot=this._makeSelectionDot(t),this.selectionColor=o.selectionColor,this.hasRangeData&&(this.selectionStartDot=this._makeSelectionDot(t))),this.outDotStyle=l,this.groupPositions=n,this.dotOpacity=h,this.pivotGroupDots=null,t.setFinish()},_getAreaChartPath:function(t,e,i){return this.isSpline?this._makeSplineAreaChartPath(t,e):this._makeAreaChartPath(t,e,i)},_renderAreas:function(t,e,i,n,a){return(i=i.slice(0,e.length)).reverse(),e.reverse(),tui.util.map(e,function(e,r){var s=i[r]||"transparent",h=s,u={area:o.renderArea(t,e.area.join(" "),{fill:s,opacity:a,stroke:s}),line:o.renderLine(t,e.line.join(" "),h,n)};return e.startLine&&(u.startLine=o.renderLine(t,e.startLine.join(" "),h,1)),u}).reverse()},_makeHeight:function(t,e){return Math.abs(t-e)},_makeAreasPath:function(t,e){var i,n=[],o=[],r=!1,s=t.length,h=[],u=[];return tui.util.forEachArray(t,function(t,e){var i;t?(r?(i="M",r=!1):i="L",h.push([i,t.left,t.top]),u.unshift(["L",t.left,t.startTop])):(r=!0,u.push(["z"])),t&&e!==s-1||(o.push(h.concat(u)),h=[],u=[])}),tui.util.forEachArray(o,function(t){n=n.concat(t)}),!1!==e&&(i=t.length-1,n.splice(i+1,0,n[i],n[i+1])),(n=a.apply([],n))[0]="M",n},_makeAreaChartPath:function(t,e,i){var n=this;return tui.util.map(t,function(t){var o;return o={area:n._makeAreasPath(t,e),line:n._makeLinesPath(t,null,i)},n.hasRangeData&&(o.startLine=n._makeLinesPath(t,"startTop")),o})},_makeSplineAreaBottomPath:function(t){var e=this;return tui.util.map(t,function(t){return["L",t.left,e.zeroTop]}).reverse()},_makeSplineAreaChartPath:function(t,e){var i=this;return tui.util.map(t,function(t){var n,o=i._makeSplineLinesPath(t),a=JSON.parse(JSON.stringify(o)),r=i._makeSplineAreaBottomPath(t);return!1!==e&&(n=t[t.length-1],a.push(["L",n.left,n.top]),r.unshift(["L",n.left,i.zeroTop])),{area:a.concat(r),line:o}})},resize:function(t){var e=this,i=t.dimension,n=t.groupPositions;this.resizeClipRect(i),this.zeroTop=t.zeroTop,this.groupPositions=n,this.groupPaths=this._getAreaChartPath(n),this.paper.setSize(i.width,i.height),this.tooltipLine.attr({top:i.height}),tui.util.forEachArray(this.groupPaths,function(t,i){var o=e.groupAreas[i];o.area.attr({path:t.area.join(" ")}),o.line.attr({path:t.line.join(" ")}),o.startLine&&o.startLine.attr({path:t.startLine.join(" ")}),tui.util.forEachArray(e.groupDots[i],function(t,o){var a,r=n[i][o];t.endDot&&e._moveDot(t.endDot.dot,r),t.startDot&&((a=tui.util.extend({},r)).top=a.startTop,e._moveDot(t.startDot.dot,a))})})},selectLegend:function(t){var e=this,i=tui.util.isNull(t);this.selectedLegendIndex=t,tui.util.forEachArray(this.groupAreas,function(n,o){var a=i||t===o?1:.3;n.area.attr({"fill-opacity":a}),n.line.attr({"stroke-opacity":a}),n.startLine&&n.startLine.attr({"stroke-opacity":a}),tui.util.forEachArray(e.groupDots[o],function(t){e.dotOpacity&&(t.endDot.dot.attr({"fill-opacity":a}),t.startDot&&t.startDot.dot.attr({"fill-opacity":a}))})})},animateForAddingData:function(t,e,i,n,o){var a=this,r=this._getAreaChartPath(i,!1),s=0;i.length&&(n&&(s=1),this.zeroTop=o,tui.util.forEachArray(this.groupAreas,function(t,o){var h=a.groupDots[o],u=i[o],l=r[o];n&&a._removeFirstDot(h),tui.util.forEachArray(h,function(t,i){var n=u[i+s];a._animateByPosition(t.endDot.dot,n,e),t.startDot&&a._animateByPosition(t.startDot.dot,{left:n.left,top:n.startTop},e)}),a._animateByPath(t.area,l.area,e),a._animateByPath(t.line,l.line,e),t.startLine&&a._animateByPath(t.startLine,l.startLine,e)}))},renderSeriesLabel:function(t,e,i,n){var a={"font-size":n.fontSize,"font-family":n.fontFamily,"font-weight":n.fontWeight,fill:n.color,"text-anchor":"middle",opacity:0},r=t.set();return tui.util.forEach(i,function(i,n){tui.util.forEach(i,function(i,s){var h,u=e[n][s],l=o.renderText(t,u.end,i.end,a);r.push(l),l.node.style.userSelect="none",l.node.style.cursor="default",l.node.setAttribute("filter","url(#glow)"),u.start&&((h=o.renderText(t,u.start,i.start,a)).node.style.userSelect="none",h.node.style.cursor="default",h.node.setAttribute("filter","url(#glow)"),r.push(h))})}),r},_isAreaOpacityNumber:function(t){var e=tui.util.isNumber(t);return e?(t<0||t>1)&&s.print(r,"warn"):tui.util.isUndefined(t)||s.print(r,"error"),e}});t.exports=h},function(t,e){"use strict";t.exports={print:function(t,e){e=e||"log",window.console&&window.console[e](t)}}},function(t,e,i){"use strict";var n=i(61),o=window.Raphael,a=Math.PI/180,r=tui.util.defineClass({render:function(t,e,i){var n=t.set();return this.paper=t,this.holeRatio=e.options.radiusRange[0],this.chartBackground=e.chartBackground,this.chartType=e.chartType,this.callbacks=i,this.selectionColor=e.theme.selectionColor,this.circleBound=e.circleBound,this.sectorName="sector_"+this.chartType,this._setSectorAttr(),this.sectorInfos=this._renderPie(e.sectorData,e.theme.colors,e.additionalIndex,n),this.overlay=this._renderOverlay(),this.prevPosition=null,this.prevHoverSector=null,n},clear:function(){this.legendLines=null,this.paper.clear()},_makeSectorPath:function(t,e,i,n,o){var r=n*a,s=o*a;return{path:["M",t,e,"L",t+i*Math.sin(r),e-i*Math.cos(r),"A",i,i,0,o-n>180?1:0,1,t+i*Math.sin(s),e-i*Math.cos(s),"Z"]}},_makeDonutSectorPath:function(t,e,i,n,o,r){var s=n*a,h=o*a,u=r||i*this.holeRatio,l=t+i*Math.sin(s),c=e-i*Math.cos(s),d=t+u*Math.sin(s),p=e-u*Math.cos(s),f=o-n>180?1:0;return{path:["M",l,c,"A",i,i,0,f,1,t+i*Math.sin(h),e-i*Math.cos(h),"L",t+u*Math.sin(h),e-u*Math.cos(h),"A",u,u,0,f,0,d,p,"Z"]}},_setSectorAttr:function(){var t;this.paper.customAttributes[this.sectorName]||(t=this.holeRatio?this._makeDonutSectorPath:this._makeSectorPath,this.paper.customAttributes[this.sectorName]=tui.util.bind(t,this))},_renderOverlay:function(){var t={paper:this.paper,circleBound:{cx:0,cy:0,r:0},angles:{startAngle:0,endAngle:0},attrs:{fill:"none",opacity:0,stroke:this.chartBackground.color,"stroke-width":1}},e=this._renderSector(t);return e.data("id","overlay"),e.data("chartType",this.chartType),{inner:e,outer:this._renderSector(t)}},_renderSector:function(t){var e=t.circleBound,i=t.angles,n=t.attrs;return n[this.sectorName]=[e.cx,e.cy,e.r,i.startAngle,i.endAngle],t.paper.path().attr(n)},_renderPie:function(t,e,i,n){var o=this,a=this.circleBound,r=this.chartBackground,s=[];return tui.util.forEachArray(t,function(t,h){var u=t.ratio,l=e[h],c=o._renderSector({paper:o.paper,circleBound:a,angles:t.angles.start,attrs:{fill:r.color,stroke:r.color,"stroke-width":1}});c.data("index",h),c.data("legendIndex",h+i),c.data("chartType",o.chartType),s.push({sector:c,color:l,angles:t.angles.end,ratio:u}),n.push(c)}),s},renderLegendLines:function(t){var e,i=this.paper;this.legendLines||(e=this._makeLinePaths(t),this.legendLines=tui.util.map(e,function(t){return n.renderLine(i,t,"transparent",1)}))},_makeLinePaths:function(t){return tui.util.map(t,function(t){return[n.makeLinePath(t.start,t.middle),n.makeLinePath(t.middle,t.end),"Z"].join("")})},_showOverlay:function(t,e){var i,n=this.overlay,o=this.sectorInfos[t],a=o.angles.startAngle,r=o.angles.endAngle,s=this.circleBound;(i={fill:"#fff",opacity:.3})[this.sectorName]=[s.cx,s.cy,s.r,a,r,s.r*this.holeRatio],n.inner.attr(i),n.inner.data("index",t),n.inner.data("legendIndex",e),n.outer.attr({path:this._makeDonutSectorPath(s.cx,s.cy,s.r+10,a,r,s.r).path,fill:o.color,opacity:.3})},_hideOverlay:function(){var t=this.overlay,e={fill:"none",opacity:0};t.inner.attr(e),t.outer.attr(e)},animate:function(t){var e=0,i=this.sectorName,n=this.circleBound,a=[n.cx,n.cy,n.r];tui.util.forEachArray(this.sectorInfos,function(t){var n,r=t.angles,s={fill:t.color},h=700*t.ratio;0===r.startAngle&&360===r.endAngle&&(r.endAngle=359.99),s[i]=a.concat([r.startAngle,r.endAngle]),n=o.animation(s,h,">"),t.sector.animate(n.delay(e)),e+=h}),t&&setTimeout(t,e)},animateLegendLines:function(t){var e;this.legendLines&&(e=tui.util.isNull(t),tui.util.forEachArray(this.legendLines,function(i,n){var o=e||t===n?1:.3;i.animate({stroke:"black","stroke-opacity":o})}))},resize:function(t){var e=t.dimension,i=t.circleBound,n=this.sectorName,o=this.labelSet;this.circleBound=i,this.paper.setSize(e.width,e.height),tui.util.forEachArray(this.sectorInfos,function(t,e){var a,r=t.angles,s={};s[n]=[i.cx,i.cy,i.r,r.startAngle,r.endAngle],t.sector.attr(s),o&&o.length&&(a=t.sector.getBBox(),o[e].attr({x:a.x+a.width/2,y:a.y+a.height/2}))})},moveLegendLines:function(t){var e;this.legendLines&&(e=this._makeLinePaths(t),tui.util.forEachArray(this.legendLines,function(t,i){return t.attr({path:e[i]}),t}))},findSectorInfo:function(t){var e=this.paper&&this.paper.getElementByPoint(t.left,t.top),i=null;return e&&(i={legendIndex:tui.util.isExisty(e.data("legendIndex"))?e.data("legendIndex"):-1,index:tui.util.isExisty(e.data("index"))?e.data("index"):-1,chartType:e.data("chartType")}),i},_isChangedPosition:function(t,e){return!t||t.left!==e.left||t.top!==e.top},_showTooltip:function(t,e){var i=[{},0,t.data("index"),{left:e.left-20,top:e.top-20}];this.callbacks.showTooltip.apply(null,i)},_isValidSector:function(t){return t&&t.data("chartType")===this.chartType},moveMouseOnSeries:function(t){var e=this.paper&&this.paper.getElementByPoint(t.left,t.top);this._isValidSector(e)?(this.prevHoverSector!==e&&(this._showOverlay(e.data("index"),e.data("legendIndex")),this.prevHoverSector=e),this._isChangedPosition(this.prevPosition,t)&&this._showTooltip(e,t)):this.prevHoverSector&&(this._hideOverlay(),this.callbacks.hideTooltip(),this.prevHoverSector=null),this.prevPosition=t},selectSeries:function(t){var e,i,a,r=this.sectorInfos[t.index];r&&(i=o.color(r.color),e=n.makeChangedLuminanceColor(i.hex,.2),a=this.selectionColor||e,r.sector.attr({fill:a}))},unselectSeries:function(t){var e=this.sectorInfos[t.index];e&&e.sector.attr({fill:e.color})},selectLegend:function(t){var e=tui.util.isNull(t),i=this.legendLines;tui.util.forEachArray(this.sectorInfos,function(n,o){var a=e||t===o?1:.3;n.sector.attr({"fill-opacity":a}),i&&i[o].attr({"stroke-opacity":a})})},getRenderedLabelWidth:function(t,e){return n.getRenderedTextSize(t,e.fontSize,e.fontFamily).width},getRenderedLabelHeight:function(t,e){return n.getRenderedTextSize(t,e.fontSize,e.fontFamily).height},renderLabels:function(t,e,i,o){var a=t.set(),r={"font-size":o.fontSize,"font-family":o.fontFamily,"font-weight":o.fontWeight,"text-anchor":"middle",fill:o.color,opacity:0};return tui.util.forEach(e,function(e,o){var s;e&&((s=n.renderText(t,e,i[o],r)).node.style.userSelect="none",s.node.style.cursor="default",s.node.setAttribute("filter","url(#glow)")),a.push(s)}),this.labelSet=a,a}});t.exports=r},function(t,e,i){"use strict";var n=i(128),o=i(61),a=tui.util.defineClass(n,{init:function(){this.selectedLegendIndex=null,this.chartType="radial",this.lineWidth=2},render:function(t,e){var i=e.dimension,n=e.groupPositions,o=e.theme,a=o.colors,r=e.options.showDot?1:0,s=e.options.showArea,h=this._getLinesPath(n),u=this.makeBorderStyle(o.borderColor,r),l=this.makeOutDotStyle(r,u),c=t.set(),d=this.lineWidth=e.options.pointWidth?e.options.pointWidth:this.lineWidth;return this.paper=t,this.theme=e.theme,this.dimension=i,this.position=e.position,s&&(this.groupAreas=this._renderArea(t,h,a,c)),this.groupLines=this._renderLines(t,h,a,d,c),this.groupDots=this._renderDots(t,n,a,r,c),e.options.allowSelect&&(this.selectionDot=this._makeSelectionDot(t),this.selectionColor=o.selectionColor),this.colors=a,this.borderStyle=u,this.outDotStyle=l,this.groupPositions=n,this.groupPaths=h,this.dotOpacity=r,c},_getLinesPath:function(t){var e=this;return tui.util.map(t,function(t){return e._makeLinesPath(t)})},_renderLines:function(t,e,i,n,a){return tui.util.map(e,function(e,r){var s=i[r]||"transparent",h=o.renderLine(t,e.join(" "),s,n);return a.push(h),h})},_renderArea:function(t,e,i,n){return tui.util.map(e,function(e,a){var r=i[a]||"transparent",s=o.renderArea(t,e,{fill:r,opacity:.4,"stroke-width":0,stroke:r});return n.push(s),s})},resize:function(t){var e=this,i=t.dimension,n=t.groupPositions;this.groupPositions=n,this.groupPaths=this._getLinesPath(n),this.paper.setSize(i.width,i.height),tui.util.forEachArray(this.groupPaths,function(t,i){e.groupLines[i].attr({path:t.join(" ")}),e.groupAreas[i].attr({path:t.join(" ")}),tui.util.forEachArray(e.groupDots[i],function(t,o){e._moveDot(t.endDot.dot,n[i][o])})})},selectLegend:function(t){var e=this,i=tui.util.isNull(t);this.selectedLegendIndex=t,tui.util.forEachArray(this.groupLines,function(n,o){var a=i||t===o?1:.3;n.attr({"stroke-opacity":a}),tui.util.forEachArray(e.groupDots[o],function(t){t.opacity=a,e.dotOpacity&&t.endDot.dot.attr({"fill-opacity":a})})})}});t.exports=a},function(t,e,i){"use strict";var n=i(61),o=window.Raphael,a=tui.util.defineClass({render:function(t,e,i){var n=t.set();return this.paper=t,this.theme=e.theme,this.seriesDataModel=e.seriesDataModel,this.groupBounds=e.groupBounds,this.callbacks=i,this.overlay=this._renderOverlay(),this.groupCircleInfos=this._renderCircles(n),this.prevCircle=null,this.prevOverCircle=null,this.animationTimeoutId=null,n},_renderOverlay:function(){var t={fill:"none",stroke:"#fff","stroke-opacity":.3,"stroke-width":2};return n.renderCircle(this.paper,{left:0,top:0},0,t)},_renderCircles:function(t){var e=this,i=this.theme.colors;return tui.util.map(this.groupBounds,function(o,a){return tui.util.map(o,function(o,r){var s,h,u=null;return o&&(s=i[r],h=n.renderCircle(e.paper,o,0,{fill:s,opacity:0,stroke:"none"}),t.push(h),h.data("groupIndex",a),h.data("index",r),u={circle:h,color:s,bound:o}),u})})},_animateCircle:function(t,e){t.animate({r:e,opacity:.5},700,">")},animate:function(){var t=this;n.forEach2dArray(this.groupCircleInfos,function(e){e&&t._animateCircle(e.circle,e.bound.radius)})},_updatePosition:function(t,e){t.attr({cx:e.left,cy:e.top,r:e.radius})},resize:function(t){var e=this,i=t.dimension,o=t.groupBounds;this.groupBounds=o,this.paper.setSize(i.width,i.height),n.forEach2dArray(this.groupCircleInfos,function(t,i,n){var a=o[i][n];t&&(t.bound=a,e._updatePosition(t.circle,a))})},findIndexes:function(t){var e=this.paper.getElementByPoint(t.left,t.top),i=null;return e&&(i={index:e.data("index"),groupIndex:e.data("groupIndex")}),i},_isChangedPosition:function(t,e){return!t||t.left!==e.left||t.top!==e.top},showAnimation:function(t){var e=this.groupCircleInfos[t.groupIndex][t.index],i=e.bound;this.overlay.attr({cx:i.left,cy:i.top,r:i.radius+2,stroke:e.color,opacity:1})},hideAnimation:function(){this.overlay.attr({cx:0,cy:0,r:0,opacity:0})},_findCircle:function(t){for(var e,i,n=[],o=this.paper;tui.util.isUndefined(e);)(i=o.getElementByPoint(t.left,t.top))?i.attrs.opacity>.3?e=i:(n.push(i),i.hide()):e=null;return e||(e=n[0]),tui.util.forEachArray(n,function(t){t.show()}),e},moveMouseOnSeries:function(t){var e,i=this._findCircle(t);i&&tui.util.isExisty(i.data("groupIndex"))?(e=[{},i.data("groupIndex"),i.data("index"),{left:t.left-20,top:t.top-20}],this._isChangedPosition(this.prevPosition,t)&&(this.callbacks.showTooltip.apply(null,e),this.prevOverCircle=i)):this.prevOverCircle&&(this.callbacks.hideTooltip(),this.prevOverCircle=null),this.prevPosition=t},selectSeries:function(t){var e=t.groupIndex,i=t.index,a=this.groupCircleInfos[e][i],r=o.color(a.color),s=this.theme.selectionColor||n.makeChangedLuminanceColor(r.hex,.2);a.circle.attr({fill:s})},unselectSeries:function(t){var e=t.groupIndex,i=t.index,n=this.groupCircleInfos[e][i];n.circle.attr({fill:n.color})},selectLegend:function(t){var e=tui.util.isNull(t);n.forEach2dArray(this.groupCircleInfos,function(i,n,o){var a;i&&(a=e||t===o?.5:.3,i.circle.attr({opacity:a}))})}});t.exports=a},function(t,e,i){"use strict";var n=i(61),o=tui.util.defineClass({render:function(t,e){var i=t.set();return this.paper=t,this.theme=e.theme||{},this.colorSpectrum=e.colorSpectrum,this.chartBackground=e.chartBackground,this.zoomable=e.zoomable,this.borderColor=this.theme.borderColor||"none",this.borderWidth=this.theme.borderWidth,this.groupBounds=e.groupBounds,this.boundMap=e.boundMap,this._bindGetBoundFunction(),this._bindGetColorFunction(),this.boxesSet=this._renderBoxes(e.seriesDataModel,e.startDepth,!!e.isPivot,i),i},_bindGetBoundFunction:function(){this.boundMap?this._getBound=this._getBoundFromBoundMap:this._getBound=this._getBoundFromGroupBounds},_bindGetColorFunction:function(){this.colorSpectrum?this._getColor=this._getColorFromSpectrum:this.zoomable?this._getColor=this._getColorFromColorsWhenZoomable:this._getColor=this._getColorFromColors},_getBoundFromGroupBounds:function(t){return this.groupBounds[t.groupIndex][t.index].end},_getBoundFromBoundMap:function(t){return this.boundMap[t.id]},_getColorFromSpectrum:function(t){return t.hasChild?"none":this.colorSpectrum.getColor(t.colorRatio||t.ratio)||this.chartBackground},_getColorFromColors:function(t){return t.hasChild?"none":this.theme.colors[t.group]},_getColorFromColorsWhenZoomable:function(t,e){return t.depth===e?this.theme.colors[t.group]:"none"},_renderRect:function(t,e,i){return n.renderRect(this.paper,t,{fill:e,stroke:this.borderColor,"stroke-width":i})},_getStrokeWidth:function(t,e){return this.borderWidth?this.borderWidth:tui.util.isExisty(t)?Math.max(1,3-(t-e)):1},_renderBoxes:function(t,e,i,n){var o,a=this;return o=this.colorSpectrum||!this.zoomable?function(t){t.toBack()}:function(){},t.map(function(t,i){return t.map(function(t,r){var s,h,u=null,l=a._getStrokeWidth(t.depth,e);return t.groupIndex=i,t.index=r,(s=a._getBound(t))&&(h=a._getColor(t,e),u={rect:a._renderRect(s,h,l),seriesItem:t,color:h},o(u.rect),n&&n.push(u.rect)),u})},i)},_animateChangingColor:function(t,e,i){var n={"fill-opacity":tui.util.isExisty(i)?i:1};e&&(n.fill=e),t.animate(n,100,">")},showAnimation:function(t,e,i){var n,o=this.boxesSet[t.groupIndex][t.index];o&&(n=(e=!!tui.util.isUndefined(e)||e)?this.theme.overColor:o.color,o.seriesItem.hasChild&&(e&&o.rect.attr({"fill-opacity":0}),o.rect.toFront()),this._animateChangingColor(o.rect,n,i))},hideAnimation:function(t,e){var i,n=this.colorSpectrum,o=this.boxesSet[t.groupIndex][t.index],a=1,r=o.rect.paper;o&&(o.seriesItem.hasChild?(i=null,e&&(a=0)):i=o.color,this._animateChangingColor(o.rect,i,a),setTimeout(function(){!n&&o.seriesItem.hasChild&&(o.rect.toBack(),r.pushDownBackgroundToBottom())},100))},resize:function(t){var e=this,i=t.dimension;this.boundMap=t.boundMap,this.groupBounds=t.groupBounds,this.paper.setSize(i.width,i.height),n.forEach2dArray(this.boxesSet,function(t,i,o){var a;t&&(a=e._getBound(t.seriesItem,i,o))&&n.updateRectBound(t.rect,a)})},renderSeriesLabel:function(t,e,i,o){var a=t.set(),r={"font-size":o.fontSize,"font-family":o.fontFamily,"font-weight":o.fontWeight,fill:o.color,opacity:0};return tui.util.forEach(i,function(i,o){tui.util.forEach(i,function(i,s){var h=n.renderText(t,e[o][s].end,i,r);h.node.style.userSelect="none",h.node.style.cursor="default",h.node.setAttribute("filter","url(#glow)"),a.push(h)})}),a},renderSeriesLabelForTreemap:function(t,e,i,o){var a=t.set(),r={"font-size":o.fontSize,"font-family":o.fontFamily,"font-weight":o.fontWeight,fill:o.color,opacity:0};return tui.util.forEach(i,function(i,o){var s=n.renderText(t,e[o],i,r);s.node.style.userSelect="none",s.node.style.cursor="default",s.node.setAttribute("filter","url(#glow)"),a.push(s)}),a}});t.exports=o},function(t,e,i){"use strict";var n=i(61),o=i(14),a=tui.util.browser,r=a.msie&&a.version<=8,s=tui.util.defineClass({render:function(t,e){var i,n,a,s,h=e.mapModel.getMapDimension();this.ratio=this._getDimensionRatio(e.layout.dimension,h),this.dimension=e.layout.dimension,this.position=e.layout.position,this.paper=t,this.sectorSet=t.set(),this.sectors=this._renderMap(e,this.ratio),r||(this.g=(i=t,n=this.sectorSet,a="tui-chart-series-group",(s=document.createElementNS("http://www.w3.org/2000/svg","g")).id=a,n.forEach(function(t){o.append(s,t.node)}),i.canvas.appendChild(s),s)),this.overColor=e.theme.overColor},_getDimensionRatio:function(t,e){return Math.min(t.height/e.height,t.width/e.width)},_renderMap:function(t,e){var i=this.sectorSet,o=t.layout.position,a=this.paper,r=t.colorSpectrum;return tui.util.map(t.mapModel.getMapData(),function(t,s){var h=t.ratio||0,u=r.getColor(h),l=n.renderArea(a,t.path,{fill:u,opacity:1,stroke:"gray","stroke-opacity":1,transform:"s"+e+","+e+",0,0t"+o.left/e+","+o.top/e});return l.data("index",s),i.push(l),{sector:l,color:u,ratio:t.ratio}})},findSectorIndex:function(t){var e=this.paper.getElementByPoint(t.left,t.top),i=e&&e.data("index"),n=!tui.util.isUndefined(i)&&this.sectors[i];return n&&!tui.util.isUndefined(n.ratio)?i:null},changeColor:function(t){this.sectors[t].sector.animate({fill:this.overColor},100,">")},restoreColor:function(t){var e=this.sectors[t];e.sector.animate({fill:e.color},100,">")},scaleMapPaths:function(t,e,i,n,o){var a,r,s=this.g.transform.baseVal,h=this.paper.canvas.createSVGTransform(),u=this.paper.canvas.createSVGMatrix(),l=this.paper.raphael.matrix(),c=s.numberOfItems?s.getItem(0).matrix:{a:1,b:0,c:0,d:1,e:0,f:0},d=o.width-this.dimension.width,p=o.height-this.dimension.height,f=c.e/c.a,m=c.f/c.d,g=-d/c.a,_=-p/c.d;l.scale(t,t,e.left*i-f*t,e.top*i-m*t),a=l.e/l.a+f,r=l.f/l.d+m,a>=0?l.e=-f*l.a:a<g&&(l.e=g-f),r>=0?l.f=-m*l.a:r<_&&(l.f=_-m),u.a=l.a,u.b=l.b,u.c=l.c,u.d=l.d,u.e=l.e,u.f=l.f,h.setMatrix(u),s.appendItem(h),s.initialize(s.consolidate())},moveMapPaths:function(t,e){var i,n,o,a,r=this.paper.canvas.createSVGMatrix(),s=this.paper.raphael.matrix(),h=this.g.transform.baseVal,u=this.paper.canvas.createSVGTransform(),l=e.width-this.dimension.width,c=e.height-this.dimension.height,d=h.numberOfItems?h.getItem(0).matrix:{a:1,b:0,c:0,d:1,e:0,f:0};s.translate(t.x,t.y),o=s.e/s.a,a=s.f/s.d,i=o+d.e/d.a,n=a+d.f/d.d,i>=0&&o>0?s.e=0:i<0&&i<-l/d.a&&o<0&&(s.e=0),n>=0&&a>0?s.f=0:n<0&&n<-c/d.d&&a<0&&(s.f=0),r.a=s.a,r.b=s.b,r.c=s.c,r.d=s.d,r.e=s.e,r.f=s.f,u.setMatrix(r),h.appendItem(u),h.initialize(h.consolidate())},renderSeriesLabels:function(t,e,i){var o={"font-size":i.fontSize,"font-family":i.fontFamily,"font-weight":i.fontWeight,fill:i.color,"text-anchor":"middle",opacity:0,transform:"s"+this.ratio+","+this.ratio+",0,0t"+this.position.left/this.ratio+","+this.position.top/this.ratio},a=t.set(),s=this;return tui.util.forEach(e,function(e){var i=e.labelPosition,h=n.renderText(t,i,e.name||e.code,o);a.push(h),h.node.style.userSelect="none",h.node.style.cursor="default",h.node.setAttribute("filter","url(#glow)"),r||s.g.appendChild(h.node)}),a}});t.exports=s},function(t,e,i){"use strict";var n,o=i(2),a=i(61),r=i(6);n=tui.util.defineClass({init:function(){this._checkBoxWidth=0,this._checkBoxHeight=0,this._iconHeight=0,this._legendItemHeight=0,this._currentPageCount=1,this._showCheckbox=!0},_renderLegendItems:function(t){var e=this,i=o.LEGEND_LABEL_LEFT_PADDING,n=tui.util.extend({},this.basePosition);tui.util.forEach(t,function(t,a){var r=t.index,s=t.colorByPoint?"#aaa":t.theme.color,h=t.isUnselected,u=t.labelHeight,l=t.checkbox,c=n.left+e._calculateSingleLegendWidth(r)>=e.paper.width;e.isHorizontal&&c&&(n.top+=e._legendItemHeight+o.LABEL_PADDING_TOP,n.left=e.basePosition.left),e._showCheckbox&&(e._renderCheckbox(n,{isChecked:l.checked,legendIndex:r,legendSet:e.legendSet}),n.left+=e._checkBoxWidth+i),e._renderIcon(n,{legendColor:s,iconType:t.iconType,labelHeight:u,isUnselected:h,legendIndex:r,legendSet:e.legendSet}),n.left+=o.LEGEND_ICON_WIDTH+i,e._renderLabel(n,{labelText:t.label,labelHeight:u,isUnselected:h,legendIndex:r,legendSet:e.legendSet}),e.isHorizontal?n.left+=e.labelWidths[a]+i:(n.left=e.basePosition.left,n.top+=e._legendItemHeight+o.LINE_MARGIN_TOP)})},_getLegendData:function(t,e){var i,n,a,r=this.basePosition.top,s=this.dimension.height,h=this.paper.height,u=t;return!this.isHorizontal&&s+2*r>h&&(i=h-2*r,this._legendItemHeight=Math.max(t[0].labelHeight,o.LEGEND_ICON_HEIGHT),n=this._legendItemHeight+o.LINE_MARGIN_TOP,a=Math.floor(i/n),u=t.slice((e-1)*a,e*a)),u},render:function(t){var e,i;return this.eventBus=t.eventBus,this.paper=t.paper,this.dimension=t.dimension,this.legendSet=this.paper.set(),this.labelWidths=t.labelWidths,this.labelTheme=t.labelTheme,this.basePosition=t.position,this.isHorizontal=t.isHorizontal,this.originalLegendData=t.legendData,this.originalLegendData.length&&(this._showCheckbox=tui.util.isExisty(t.legendData[0].checkbox),this._setComponentDimensionsBaseOnLabelHeight(t.legendData[0].labelHeight),t.dimension.width=this._calculateLegendWidth(t.legendData[0].labelHeight),e=this._getLegendData(t.legendData,this._currentPageCount),this._renderLegendItems(e),!this.isHorizontal&&e&&e.length<t.legendData.length&&(i=this.paper.height-2*this.basePosition.top,this.availablePageCount=Math.ceil(t.dimension.height/i),this._renderPaginationArea(this.basePosition,{width:t.dimension.width,height:i}))),this.legendSet},_paginateLegendAreaTo:function(t){var e=this._currentPageCount;this._removeLegendItems(),"next"===t?e+=1:e-=1,this._renderLegendItems(this._getLegendData(this.originalLegendData,e))},_removeLegendItems:function(){this.legendSet.forEach(function(t){tui.util.forEach(t.events,function(t){t.unbind()}),t.remove()})},_renderPaginationArea:function(t,e){var i=this,n=t.top+e.height-o.CHART_PADDING,r=t.left-o.CHART_PADDING+e.width-10,s=r-15,h=["M",r,",",n+3,"L",r+5,",",n+8,"L",r+10,",",n+3].join(""),u=["M",s,",",n+8,"L",s+5,",",n+3,"L",s+10,",",n+8].join("");this.upperButton=a.renderLine(this.paper,u,"#555",3),this.lowerButton=a.renderLine(this.paper,h,"#555",3),this.upperButton.click(function(){i._currentPageCount>1&&(i._paginateLegendAreaTo("previous"),i._currentPageCount-=1)}),this.lowerButton.click(function(){i._currentPageCount<i.availablePageCount&&(i._paginateLegendAreaTo("next"),i._currentPageCount+=1)})},makeLabelWidths:function(t,e){return tui.util.map(t,function(t){return a.getRenderedTextSize(t.label,e.fontSize,e.fontFamily).width+o.LEGEND_AREA_PADDING})},getRenderedLabelHeight:function(t,e){return a.getRenderedTextSize(t,e.fontSize,e.fontFamily).height},_renderLabel:function(t,e){var i=this.eventBus,n=this.labelTheme,o={left:t.left,top:t.top+this._iconHeight/2},r={"font-size":n.fontSize,"font-family":n.fontFamily,"font-weight":n.fontWeight,opacity:e.isUnselected?.5:1,"text-anchor":"start"},s=a.renderText(this.paper,o,e.labelText,r);s.data("index",e.legendIndex),s.node.style.userSelect="none",s.node.style.cursor="pointer",e.legendSet.push(s),s.click(function(){i.fire("labelClicked",e.legendIndex)})},_renderCheckbox:function(t,e){var i,n=this,o=t.left,a=t.top+(this._legendItemHeight-this._checkBoxHeight)/2,r="M"+(.3*this._checkBoxWidth+o)+","+(.5*this._checkBoxHeight+a)+"L"+(.5*this._checkBoxWidth+o)+","+(.7*this._checkBoxHeight+a)+"L"+(.8*this._checkBoxWidth+o)+","+(.2*this._checkBoxHeight+a);(i=this.paper.set()).push(this.paper.rect(o,a,this._checkBoxWidth,this._checkBoxHeight,2).attr({fill:"#fff"})),e.isChecked&&i.push(this.paper.path(r)),i.data("index",e.legendIndex),i.click(function(){n.eventBus.fire("checkboxClicked",e.legendIndex)}),i.forEach(function(t){e.legendSet.push(t)})},_renderIcon:function(t,e){var i,n,r=this;this.paper.setStart(),"line"===e.iconType?(n="M"+t.left+","+(t.top+this._legendItemHeight/2)+"H"+(t.left+o.LEGEND_ICON_WIDTH),(i=a.renderLine(this.paper,n,e.legendColor,3)).attr("stroke-opacity",e.isUnselected?.5:1)):i=a.renderRect(this.paper,{left:t.left,top:t.top,width:o.LEGEND_ICON_WIDTH,height:this._iconHeight},{"stroke-width":0,fill:e.legendColor,opacity:e.isUnselected?.5:1}),i.data("icon",e.iconType),i.data("index",e.legendIndex),i.click(function(){r.eventBus.fire("labelClicked",e.legendIndex)}),e.legendSet.push(i)},selectLegend:function(t,e){e.forEach(function(e){var i=e.data("index"),n="line"===e.data("icon")?"stroke-opacity":"opacity";tui.util.isNull(i)||tui.util.isUndefined(i)?e.attr(n,1):tui.util.isUndefined(i)||(tui.util.isNumber(t)&&i!==t?e.attr(n,.5):e.attr(n,1))})},_getCheckboxWidth:function(){return this._showCheckbox?this._checkBoxWidth+o.LEGEND_LABEL_LEFT_PADDING:0},_getLabelWidth:function(t){return(t?this.labelWidths[t]||0:r.max(this.labelWidths))+o.LEGEND_LABEL_LEFT_PADDING},_calculateLegendWidth:function(){return this._calculateSingleLegendWidth()},_calculateSingleLegendWidth:function(t){return o.LEGEND_AREA_PADDING+this._getCheckboxWidth()+(o.LEGEND_ICON_WIDTH+o.LEGEND_LABEL_LEFT_PADDING)+this._getLabelWidth(t)+o.LEGEND_AREA_PADDING},_setComponentDimensionsBaseOnLabelHeight:function(t){this._legendItemHeight=Math.max(t,o.LEGEND_ICON_HEIGHT),this._iconHeight=this._legendItemHeight,this._checkBoxWidth=this._checkBoxHeight=t}}),t.exports=n},function(t,e,i){"use strict";var n=i(61),o=i(2).LEGEND_AREA_PADDING,a=tui.util.defineClass({render:function(t,e,i,n,a){var r;e.position.left+=2*o,e.position.top+=o,r=this._renderGradientBar(t,e,i,n),a.push(r),this.wedge=this._renderWedge(t,e.position),a.push(this.wedge),this.gradientBar=r},renderTicksAndLabels:function(t,e,i,o,a){tui.util.forEach(i,function(i,r){var s=e.step*r,h=tui.util.extend({},e.position),u="M";o?(h.left+=s,u+=h.left+","+(h.top-35)+"V"+(h.top-35+15)):(h.top+=s,u+=h.left-35+","+h.top+"H"+(h.left-35+15)),a.push(n.renderLine(t,u,"#ccc",1)),a.push(n.renderText(t,h,i))})},_renderGradientBar:function(t,e,i,a){var r,s,h=e.dimension.height,u=e.position.left;return a?(h-=o,r=360,this._makeWedghPath=this._makeHorizontalWedgePath):(r=270,this._makeWedghPath=this._makeVerticalWedgePath),s={left:u,top:e.position.top,width:e.dimension.width-o,height:h},n.renderRect(t,s,{fill:r+"-"+i.start+"-"+i.end,stroke:"none"})},_renderWedge:function(t,e){return t.path(this.verticalBasePath).attr({fill:"gray",stroke:"none",opacity:0,transform:"t"+e.left+","+e.top})},verticalBasePath:["M",16,6,"L",24,3,"L",24,9],_makeVerticalWedgePath:function(t){var e=this.verticalBasePath;return e[2]=t,e[5]=t-3,e[8]=t+3,e},horizontalBasePath:["M",5,16,"L",8,24,"L",2,24],_makeHorizontalWedgePath:function(t){var e=this.horizontalBasePath,i=t+o/2;return e[1]=i,e[4]=i+3,e[7]=i-3,e},showWedge:function(t){var e=this._makeWedghPath(t);this.wedge.attr({path:e,opacity:1})},hideWedge:function(){this.wedge.attr({opacity:0})},removeLocationURLFromFillAttribute:function(){var t=this.gradientBar,e=t.node.getAttribute("fill");this.locationURL=/url\('?([^#]+)#[^#]+'?\)/.exec(e)[1],t.node.setAttribute("fill",e.replace(this.locationURL,""))},restoreLocationURLToFillAttribute:function(){var t=this.gradientBar,e=t.node.getAttribute("fill");t.node.setAttribute("fill",e.replace("#",this.locationURL+"#"))}});t.exports=a},function(t,e,i){"use strict";var n=i(61),o=tui.util.defineClass({render:function(t,e,i,o,a){var r=e.position.left+e.dimension.width/2,s=t.set();return tui.util.forEachArray(o,function(o,h){var u=i*o,l=e.position.top+e.dimension.height-u,c=n.renderCircle(t,{left:r,top:l},u,{fill:"none",opacity:1,stroke:"#888","stroke-width":1});s.push(c),s.push(n.renderText(t,{left:r,top:l-u-5},a[h]))}),s}});t.exports=o},function(t,e,i){"use strict";var n=i(61),o=i(2),a=tui.util.defineClass({render:function(t,e,i,a){var r=a.fontSize,s=a.fontFamily,h=n.getRenderedTextSize(e,r,s),u={left:t.width/2,top:(h.height+o.TITLE_PADDING)/2},l=t.set();return i&&(i.x?u.left+=i.x:i.y&&(u.top+=i.y)),l.push(n.renderText(t,u,e,{"font-family":a.fontFamily,"font-size":a.fontSize,"font-weight":a.fontWeight,fill:a.color,"text-anchor":"middle"})),l},resize:function(t,e){e.attr({x:t/2})}});t.exports=a},function(t,e,i){"use strict";var n=i(61),o=tui.util.defineClass({init:function(){this.ticks=[]},renderBackground:function(t,e,i,o){var a=o&&o.background||{},r=a.color||"#fff",s=a.opacity||1;return n.renderRect(t,{left:0,top:e.top,width:i.width+e.left-4,height:i.height},{fill:r,opacity:s,"stroke-width":0})},renderTitle:function(t,e){var i,o=e.theme,a={"dominant-baseline":"auto","font-family":o.fontFamily,"font-size":o.fontSize,"font-weight":o.fontWeight,fill:o.color,"text-anchor":"middle"},r=this.calculatePosition(t,e);a.transform=function(t,e){var i="none";t.isPositionRight?i="r90,"+e.left+","+e.top:t.isVertical&&function(t){if(tui.util.isExisty(t.rotateTitle))return!0===t.rotateTitle;return!0}(t)&&(i="r-90,"+e.left+","+e.top);return i}(e.rotationInfo,r),(i=n.renderText(t,r,e.text,a)).node.style.userSelect="none",i.node.style.cursor="default",e.set.push(i)},renderLabel:function(t){var e,i=t.positionTopAndLeft,o=t.labelText,a=t.paper,r=t.isVertical,s=t.isPositionRight,h=t.theme,u={"dominant-baseline":"central","font-family":h.fontFamily,"font-size":h.fontSize,"font-weight":h.fontWeight,fill:h.color};u["text-anchor"]=s?"start":r?"end":"middle",(e=n.renderText(a,i,o,u)).node.style.userSelect="none",e.node.style.cursor="default",t.set.push(e),this.ticks.push(e)},renderRotatedLabel:function(t){var e=t.positionTopAndLeft,i=t.labelText,o=t.paper,a=t.theme,r=n.renderText(o,e,i,{"dominant-baseline":"central","font-family":a.fontFamily,"font-size":a.fontSize,"font-weight":a.fontWeight,fill:a.color,"text-anchor":"end",transform:"r"+-t.degree+","+(e.left+20)+","+e.top});r.node.style.userSelect="none",r.node.style.cursor="arrow",t.set.push(r),this.ticks.push(r)},renderTicks:function(t){var e,i=this,n=t.paper,o=t.positions,a=t.additionalSize,r=t.isVertical,s=t.isCenter,h=t.isPositionRight,u=t.tickColor,l=t.layout,c=l.position.left+l.dimension.width,d=l.position.top,p=l.position.left;tui.util.forEach(o,function(o){var f="M";(o+=a)>l.dimension.width||(r?s?(f+=p+","+(d+o),f+="H"+(p+5),f+="M"+c+","+(d+o),f+="H"+(c-5)):h?(f+=p+","+(d+o),f+="H"+(p+5)):(f+=c+","+(d+o),f+="H"+(c-5)):(f+=p+o+","+d,f+="V"+(d+5)),isNaN(o)||(e=n.path(f).attr({stroke:u}),t.set.push(e),i.ticks.push(e)))})},renderTickLine:function(t){var e,i,n=t.areaSize,o=t.paper,a=t.layout,r=t.isNotDividedXAxis,s=t.additionalSize,h=t.isPositionRight,u=t.isCenter,l=t.isVertical,c=t.tickColor,d="M",p=a.position.top,f=a.position.left,m=a.dimension.height+p,g=f+a.dimension.width;h?(d+=f+","+p,d+="V"+m):l?(d+=g+","+(e=p),u?(d+="V"+m,d+="M"+f+","+e,d+="V"+m):d+="V"+(p+n)):(d+=r?f:f+s,d+=","+p+"H",i=f+n,r||(i+=s),d+=i),t.set.push(o.path(d).attr({"stroke-width":1,stroke:c}))},animateForAddingData:function(t){tui.util.forEach(this.ticks,function(e){e.animate({transform:"t-"+t+",0"},300)})},calculatePosition:function(t,e){var i,o,a,r,s,h,u,l=e.rotationInfo,c=(i=e.text,o=e.theme,n.getRenderedTextSize(i,o.fontSize,o.fontFamily).height),d=e.layout,p=(a=l.isVertical,r=d.dimension,s=d.position,h=a?r.height:r.width,u=a?s.top:s.left,h/2+u),f={};return l.isCenter?(f.top=t.height-c/2,f.left=d.position.left+d.dimension.width/2):l.isPositionRight?(f.top=p,f.left=d.position.left+d.dimension.width):l.isVertical?(f.top=p,f.left=d.position.left+c/2):(f.top=d.position.top+d.dimension.height,f.left=p),l.isCenter||function(t,e){if(!e)return;e.x&&(t.left+=e.x);e.y&&(t.top+=e.y)}(f,e.offset),f}});t.exports=o},function(t,e,i){"use strict";var n=i(61),o=i(6),a=tui.util.defineClass({render:function(t){var e=t.paper.set();return this.paper=t.paper,this.layout=t.layout,this.plotPositions=t.plotPositions,this.theme=t.theme,this.options=t.options,this.labelData=t.labelData,this._renderPlot(e),this._renderLabels(e),e.toBack(),this.paper.pushDownBackgroundToBottom(),e},_renderPlot:function(t){"circle"===this.options.type?this._renderCirclePlot(t):this._renderSpiderwebPlot(t),this._renderCatergoryLines(t)},_renderSpiderwebPlot:function(t){var e=this._getLinesPath(this.plotPositions);this._renderLines(e,this.theme.lineColor,t)},_renderCirclePlot:function(t){var e,i,o,a=this.plotPositions,r=a[0][0],s=this.theme.lineColor;for(e=1;e<a.length;e+=1)i=a[e][0],o=r.top-i.top,t.push(n.renderCircle(this.paper,r,o,{stroke:s}))},_renderCatergoryLines:function(t){var e=this._getLinesPath(o.pivot(this.plotPositions));this._renderLines(e,this.theme.lineColor,t)},_renderLabels:function(t){var e=this.paper,i=this.theme,o=this.labelData,a={fill:i.lineColor,"font-size":i.label.fontSize,"font-family":i.label.fontFamily,"text-anchor":"end","font-weight":"100","dominant-baseline":"middle"};tui.util.forEachArray(o.category,function(i){var o=tui.util.extend({},a,{"text-anchor":i.position.anchor}),r=n.renderText(e,i.position,i.text,o);r.node.style.userSelect="none",r.node.style.cursor="default",t.push(r)}),tui.util.forEachArray(o.step,function(i){var o=n.renderText(e,i.position,i.text,a);i.position.top-=8,i.position.left-=3,o.node.style.userSelect="none",o.node.style.cursor="default",t.push(o)})},_renderLines:function(t,e,i){var o=this.paper;return tui.util.map(t,function(t){var a=n.renderLine(o,t.join(" "),e,1);return i.push(a),a})},_getLinesPath:function(t){var e=this;return tui.util.map(t,function(t){return e._makeLinesPath(t)})},_makeLinesPath:function(t,e,i){var n=[],o=!1;return e=e||"top",tui.util.map(t,function(t){var a=o&&!i?"M":"L";t?(n.push([a,t.left,t[e]]),o&&(o=!1)):o=!0}),(n=Array.prototype.concat.apply([],n))[0]="M",n}});t.exports=a}]);
/*-----/js/toast/tui.chart/chart.min.js / end -----*/

/*----- / start -----*/
