// dette er en test

if (!window.console) {console =  {log: function() {}}};

(function(b,l){function c(d,n,A){if(A===l&&1===d.nodeType)if(A="data-"+n.replace(oa,"-$1").toLowerCase(),A=d.getAttribute(A),"string"===typeof A){try{A="true"===A?!0:"false"===A?!1:"null"===A?null:f.isNumeric(A)?+A:$c.test(A)?f.parseJSON(A):A}catch(a){}f.data(d,n,A)}else A=l;return A}function k(d){for(var n in d)if(!("data"===n&&f.isEmptyObject(d[n]))&&"toJSON"!==n)return!1;return!0}function h(d,n,A){var a=n+"defer",b=n+"queue",c=n+"mark",e=f._data(d,a);e&&(("queue"===A||!f._data(d,b))&&("mark"===
A||!f._data(d,c)))&&setTimeout(function(){!f._data(d,b)&&!f._data(d,c)&&(f.removeData(d,a,!0),e.fire())},0)}function r(){return!1}function q(){return!0}function w(d,n,A){n=n||0;if(f.isFunction(n))return f.grep(d,function(d,a){return!!n.call(d,a,d)===A});if(n.nodeType)return f.grep(d,function(d){return d===n===A});if("string"===typeof n){var a=f.grep(d,function(d){return 1===d.nodeType});if(Wd.test(n))return f.filter(n,a,!A);n=f.filter(n,a)}return f.grep(d,function(d){return 0<=f.inArray(d,n)===A})}
function E(d){var n=ad.split("|");d=d.createDocumentFragment();if(d.createElement)for(;n.length;)d.createElement(n.pop());return d}function P(d,n){if(1===n.nodeType&&f.hasData(d)){var A,a,b;a=f._data(d);var c=f._data(n,a),e=a.events;if(e)for(A in delete c.handle,c.events={},e){a=0;for(b=e[A].length;a<b;a++)f.event.add(n,A,e[A][a])}c.data&&(c.data=f.extend({},c.data))}}function R(d,n){var A;1===n.nodeType&&(n.clearAttributes&&n.clearAttributes(),n.mergeAttributes&&n.mergeAttributes(d),A=n.nodeName.toLowerCase(),
"object"===A?n.outerHTML=d.outerHTML:"input"===A&&("checkbox"===d.type||"radio"===d.type)?(d.checked&&(n.defaultChecked=n.checked=d.checked),n.value!==d.value&&(n.value=d.value)):"option"===A?n.selected=d.defaultSelected:"input"===A||"textarea"===A?n.defaultValue=d.defaultValue:"script"===A&&n.text!==d.text&&(n.text=d.text),n.removeAttribute(f.expando),n.removeAttribute("_submit_attached"),n.removeAttribute("_change_attached"))}function J(d){return"undefined"!==typeof d.getElementsByTagName?d.getElementsByTagName("*"):
"undefined"!==typeof d.querySelectorAll?d.querySelectorAll("*"):[]}function V(d){if("checkbox"===d.type||"radio"===d.type)d.defaultChecked=d.checked}function T(d){var n=(d.nodeName||"").toLowerCase();"input"===n?V(d):"script"!==n&&"undefined"!==typeof d.getElementsByTagName&&f.grep(d.getElementsByTagName("input"),V)}function v(d,n,A){var a="width"===n?d.offsetWidth:d.offsetHeight,b="width"===n?1:0;if(0<a){if("border"!==A)for(;4>b;b+=2)A||(a-=parseFloat(f.css(d,"padding"+Ba[b]))||0),a="margin"===A?
a+(parseFloat(f.css(d,A+Ba[b]))||0):a-(parseFloat(f.css(d,"border"+Ba[b]+"Width"))||0);return a+"px"}a=Ca(d,n);if(0>a||null==a)a=d.style[n];if(Eb.test(a))return a;a=parseFloat(a)||0;if(A)for(;4>b;b+=2)a+=parseFloat(f.css(d,"padding"+Ba[b]))||0,"padding"!==A&&(a+=parseFloat(f.css(d,"border"+Ba[b]+"Width"))||0),"margin"===A&&(a+=parseFloat(f.css(d,A+Ba[b]))||0);return a+"px"}function e(d){return function(n,A){"string"!==typeof n&&(A=n,n="*");if(f.isFunction(A))for(var a=n.toLowerCase().split(lb),b=
0,c=a.length,e,g;b<c;b++)e=a[b],(g=/^\+/.test(e))&&(e=e.substr(1)||"*"),e=d[e]=d[e]||[],e[g?"unshift":"push"](A)}}function a(d,n,A,b,f,c){f=f||n.dataTypes[0];c=c||{};c[f]=!0;f=d[f];for(var e=0,g=f?f.length:0,j=d===Fb,m;e<g&&(j||!m);e++)m=f[e](n,A,b),"string"===typeof m&&(!j||c[m]?m=l:(n.dataTypes.unshift(m),m=a(d,n,A,b,m,c)));if((j||!m)&&!c["*"])m=a(d,n,A,b,"*",c);return m}function p(d,n){var A,a,b=f.ajaxSettings.flatOptions||{};for(A in n)n[A]!==l&&((b[A]?d:a||(a={}))[A]=n[A]);a&&f.extend(!0,d,a)}
function m(d,n,A,a){if(f.isArray(n))f.each(n,function(n,b){A||Da.test(d)?a(d,b):m(d+"["+("object"===typeof b?n:"")+"]",b,A,a)});else if(!A&&"object"===f.type(n))for(var b in n)m(d+"["+b+"]",n[b],A,a);else a(d,n)}function j(){try{return new b.XMLHttpRequest}catch(d){}}function t(){setTimeout(g,0);return Gb=f.now()}function g(){Gb=l}function S(d,n){var a={};f.each(Hb.concat.apply([],Hb.slice(0,n)),function(){a[this]=d});return a}function ja(d){if(!Ib[d]){var n=C.body,a=f("<"+d+">").appendTo(n),b=a.css("display");
a.remove();if("none"===b||""===b){sa||(sa=C.createElement("iframe"),sa.frameBorder=sa.width=sa.height=0);n.appendChild(sa);if(!Ea||!sa.createElement)Ea=(sa.contentWindow||sa.contentDocument).document,Ea.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),Ea.close();a=Ea.createElement(d);Ea.body.appendChild(a);b=f.css(a,"display");n.removeChild(sa)}Ib[d]=b}return Ib[d]}function ta(d){return f.isWindow(d)?d:9===d.nodeType?d.defaultView||d.parentWindow:!1}var C=b.document,ua=b.location,f,
L=function(){if(!y.isReady){try{C.documentElement.doScroll("left")}catch(d){setTimeout(L,1);return}y.ready()}},y=function(d,n){return new y.fn.init(d,n,ga)},va=b.jQuery,xa=b.$,ga,ka=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,s=/\S/,D=/^\s+/,B=/\s+$/,N=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,U=/^[\],:{}\s]*$/,La=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,ya=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Y=/(?:^|:|,)(?:\s*\[)+/g,jc=/(webkit)[ \/]([\w.]+)/,kc=/(opera)(?:.*version)?[ \/]([\w.]+)/,
ab=/(msie) ([\w.]+)/,lc=/(mozilla)(?:.*? rv:([\w.]+))?/,Jb=/-([a-z]|[0-9])/ig,mb=/^-ms-/,Kb=function(d,n){return(n+"").toUpperCase()},mc=b.navigator.userAgent,Fa,Qa,Ra,bd=Object.prototype.toString,nb=Object.prototype.hasOwnProperty,ob=Array.prototype.push,Sa=Array.prototype.slice,za=String.prototype.trim,nc=Array.prototype.indexOf,oc={};y.fn=y.prototype={constructor:y,init:function(d,n,a){var b;if(!d)return this;if(d.nodeType)return this.context=this[0]=d,this.length=1,this;if("body"===d&&!n&&C.body)return this.context=
C,this[0]=C.body,this.selector=d,this.length=1,this;if("string"===typeof d){if((b="<"===d.charAt(0)&&">"===d.charAt(d.length-1)&&3<=d.length?[null,d,null]:ka.exec(d))&&(b[1]||!n)){if(b[1])return a=(n=n instanceof y?n[0]:n)?n.ownerDocument||n:C,(d=N.exec(d))?y.isPlainObject(n)?(d=[C.createElement(d[1])],y.fn.attr.call(d,n,!0)):d=[a.createElement(d[1])]:(d=y.buildFragment([b[1]],[a]),d=(d.cacheable?y.clone(d.fragment):d.fragment).childNodes),y.merge(this,d);if((n=C.getElementById(b[2]))&&n.parentNode){if(n.id!==
b[2])return a.find(d);this.length=1;this[0]=n}this.context=C;this.selector=d;return this}return!n||n.jquery?(n||a).find(d):this.constructor(n).find(d)}if(y.isFunction(d))return a.ready(d);d.selector!==l&&(this.selector=d.selector,this.context=d.context);return y.makeArray(d,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return Sa.call(this,0)},get:function(d){return null==d?this.toArray():0>d?this[this.length+d]:this[d]},pushStack:function(d,n,a){var b=
this.constructor();y.isArray(d)?ob.apply(b,d):y.merge(b,d);b.prevObject=this;b.context=this.context;"find"===n?b.selector=this.selector+(this.selector?" ":"")+a:n&&(b.selector=this.selector+"."+n+"("+a+")");return b},each:function(d,n){return y.each(this,d,n)},ready:function(d){y.bindReady();Qa.add(d);return this},eq:function(d){d=+d;return-1===d?this.slice(d):this.slice(d,d+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(Sa.apply(this,
arguments),"slice",Sa.call(arguments).join(","))},map:function(d){return this.pushStack(y.map(this,function(n,a){return d.call(n,a,n)}))},end:function(){return this.prevObject||this.constructor(null)},push:ob,sort:[].sort,splice:[].splice};y.fn.init.prototype=y.fn;y.extend=y.fn.extend=function(){var d,n,a,b,f,c=arguments[0]||{},e=1,g=arguments.length,j=!1;"boolean"===typeof c&&(j=c,c=arguments[1]||{},e=2);"object"!==typeof c&&!y.isFunction(c)&&(c={});g===e&&(c=this,--e);for(;e<g;e++)if(null!=(d=arguments[e]))for(n in d)a=
c[n],b=d[n],c!==b&&(j&&b&&(y.isPlainObject(b)||(f=y.isArray(b)))?(f?(f=!1,a=a&&y.isArray(a)?a:[]):a=a&&y.isPlainObject(a)?a:{},c[n]=y.extend(j,a,b)):b!==l&&(c[n]=b));return c};y.extend({noConflict:function(d){b.$===y&&(b.$=xa);d&&b.jQuery===y&&(b.jQuery=va);return y},isReady:!1,readyWait:1,holdReady:function(d){d?y.readyWait++:y.ready(!0)},ready:function(d){if(!0===d&&!--y.readyWait||!0!==d&&!y.isReady){if(!C.body)return setTimeout(y.ready,1);y.isReady=!0;!0!==d&&0<--y.readyWait||(Qa.fireWith(C,[y]),
y.fn.trigger&&y(C).trigger("ready").off("ready"))}},bindReady:function(){if(!Qa){Qa=y.Callbacks("once memory");if("complete"===C.readyState)return setTimeout(y.ready,1);if(C.addEventListener)C.addEventListener("DOMContentLoaded",Ra,!1),b.addEventListener("load",y.ready,!1);else if(C.attachEvent){C.attachEvent("onreadystatechange",Ra);b.attachEvent("onload",y.ready);var d=!1;try{d=null==b.frameElement}catch(n){}C.documentElement.doScroll&&d&&L()}}},isFunction:function(d){return"function"===y.type(d)},
isArray:Array.isArray||function(d){return"array"===y.type(d)},isWindow:function(d){return null!=d&&d==d.window},isNumeric:function(d){return!isNaN(parseFloat(d))&&isFinite(d)},type:function(d){return null==d?String(d):oc[bd.call(d)]||"object"},isPlainObject:function(d){if(!d||"object"!==y.type(d)||d.nodeType||y.isWindow(d))return!1;try{if(d.constructor&&!nb.call(d,"constructor")&&!nb.call(d.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}for(var a in d);return a===l||nb.call(d,a)},
isEmptyObject:function(d){for(var n in d)return!1;return!0},error:function(d){throw Error(d);},parseJSON:function(d){if("string"!==typeof d||!d)return null;d=y.trim(d);if(b.JSON&&b.JSON.parse)return b.JSON.parse(d);if(U.test(d.replace(La,"@").replace(ya,"]").replace(Y,"")))return(new Function("return "+d))();y.error("Invalid JSON: "+d)},parseXML:function(d){if("string"!==typeof d||!d)return null;var n,a;try{b.DOMParser?(a=new DOMParser,n=a.parseFromString(d,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),
n.async="false",n.loadXML(d))}catch(f){n=l}(!n||!n.documentElement||n.getElementsByTagName("parsererror").length)&&y.error("Invalid XML: "+d);return n},noop:function(){},globalEval:function(d){d&&s.test(d)&&(b.execScript||function(d){b.eval.call(b,d)})(d)},camelCase:function(d){return d.replace(mb,"ms-").replace(Jb,Kb)},nodeName:function(d,n){return d.nodeName&&d.nodeName.toUpperCase()===n.toUpperCase()},each:function(d,n,a){var b,f=0,c=d.length,e=c===l||y.isFunction(d);if(a)if(e)for(b in d){if(!1===
n.apply(d[b],a))break}else for(;f<c&&!1!==n.apply(d[f++],a););else if(e)for(b in d){if(!1===n.call(d[b],b,d[b]))break}else for(;f<c&&!1!==n.call(d[f],f,d[f++]););return d},trim:za?function(d){return null==d?"":za.call(d)}:function(d){return null==d?"":d.toString().replace(D,"").replace(B,"")},makeArray:function(d,n){var a=n||[];if(null!=d){var b=y.type(d);null==d.length||"string"===b||"function"===b||"regexp"===b||y.isWindow(d)?ob.call(a,d):y.merge(a,d)}return a},inArray:function(d,n,a){var b;if(n){if(nc)return nc.call(n,
d,a);b=n.length;for(a=a?0>a?Math.max(0,b+a):a:0;a<b;a++)if(a in n&&n[a]===d)return a}return-1},merge:function(d,n){var a=d.length,b=0;if("number"===typeof n.length)for(var f=n.length;b<f;b++)d[a++]=n[b];else for(;n[b]!==l;)d[a++]=n[b++];d.length=a;return d},grep:function(d,n,a){var b=[],f;a=!!a;for(var c=0,e=d.length;c<e;c++)f=!!n(d[c],c),a!==f&&b.push(d[c]);return b},map:function(d,n,a){var b,f,c=[],e=0,g=d.length;if(d instanceof y||g!==l&&"number"===typeof g&&(0<g&&d[0]&&d[g-1]||0===g||y.isArray(d)))for(;e<
g;e++)b=n(d[e],e,a),null!=b&&(c[c.length]=b);else for(f in d)b=n(d[f],f,a),null!=b&&(c[c.length]=b);return c.concat.apply([],c)},guid:1,proxy:function(d,n){if("string"===typeof n){var a=d[n];n=d;d=a}if(!y.isFunction(d))return l;var b=Sa.call(arguments,2),a=function(){return d.apply(n,b.concat(Sa.call(arguments)))};a.guid=d.guid=d.guid||a.guid||y.guid++;return a},access:function(d,n,a,b,f,c,e){var g,j=null==a,m=0,p=d.length;if(a&&"object"===typeof a){for(m in a)y.access(d,n,m,a[m],1,c,b);f=1}else if(b!==
l){g=e===l&&y.isFunction(b);j&&(g?(g=n,n=function(d,n,a){return g.call(y(d),a)}):(n.call(d,b),n=null));if(n)for(;m<p;m++)n(d[m],a,g?b.call(d[m],m,n(d[m],a)):b,e);f=1}return f?d:j?n.call(d):p?n(d[0],a):c},now:function(){return(new Date).getTime()},uaMatch:function(d){d=d.toLowerCase();d=jc.exec(d)||kc.exec(d)||ab.exec(d)||0>d.indexOf("compatible")&&lc.exec(d)||[];return{browser:d[1]||"",version:d[2]||"0"}},sub:function(){function d(n,a){return new d.fn.init(n,a)}y.extend(!0,d,this);d.superclass=this;
d.fn=d.prototype=this();d.fn.constructor=d;d.sub=this.sub;d.fn.init=function(a,b){b&&(b instanceof y&&!(b instanceof d))&&(b=d(b));return y.fn.init.call(this,a,b,n)};d.fn.init.prototype=d.fn;var n=d(C);return d},browser:{}});y.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(d,n){oc["[object "+n+"]"]=n.toLowerCase()});Fa=y.uaMatch(mc);Fa.browser&&(y.browser[Fa.browser]=!0,y.browser.version=Fa.version);y.browser.webkit&&(y.browser.safari=!0);s.test("\u00a0")&&(D=/^[\s\xA0]+/,
B=/[\s\xA0]+$/);ga=y(C);C.addEventListener?Ra=function(){C.removeEventListener("DOMContentLoaded",Ra,!1);y.ready()}:C.attachEvent&&(Ra=function(){"complete"===C.readyState&&(C.detachEvent("onreadystatechange",Ra),y.ready())});f=y;var qc={};f.Callbacks=function(d){var n;if(d){if(!(n=qc[d])){n=d;var a=qc[n]={},b,c;n=n.split(/\s+/);b=0;for(c=n.length;b<c;b++)a[n[b]]=!0;n=a}}else n={};d=n;var e=[],g=[],j,m,p,t,v,s,L=function(n){var a,b,A,c;a=0;for(b=n.length;a<b;a++)A=n[a],c=f.type(A),"array"===c?L(A):
"function"===c&&(!d.unique||!y.has(A))&&e.push(A)},k=function(n,a){a=a||[];j=!d.memory||[n,a];p=m=!0;s=t||0;t=0;for(v=e.length;e&&s<v;s++)if(!1===e[s].apply(n,a)&&d.stopOnFalse){j=!0;break}p=!1;e&&(d.once?!0===j?y.disable():e=[]:g&&g.length&&(j=g.shift(),y.fireWith(j[0],j[1])))},y={add:function(){if(e){var d=e.length;L(arguments);p?v=e.length:j&&!0!==j&&(t=d,k(j[0],j[1]))}return this},remove:function(){if(e)for(var n=arguments,a=0,b=n.length;a<b;a++)for(var A=0;A<e.length&&!(n[a]===e[A]&&(p&&A<=v&&
(v--,A<=s&&s--),e.splice(A--,1),d.unique));A++);return this},has:function(d){if(e)for(var n=0,a=e.length;n<a;n++)if(d===e[n])return!0;return!1},empty:function(){e=[];return this},disable:function(){e=g=j=l;return this},disabled:function(){return!e},lock:function(){g=l;(!j||!0===j)&&y.disable();return this},locked:function(){return!g},fireWith:function(n,a){g&&(p?d.once||g.push([n,a]):(!d.once||!j)&&k(n,a));return this},fire:function(){y.fireWith(this,arguments);return this},fired:function(){return!!m}};
return y};var Lb=[].slice;f.extend({Deferred:function(d){var n=f.Callbacks("once memory"),a=f.Callbacks("once memory"),b=f.Callbacks("memory"),c="pending",e={resolve:n,reject:a,notify:b},g={done:n.add,fail:a.add,progress:b.add,state:function(){return c},isResolved:n.fired,isRejected:a.fired,then:function(d,n,a){j.done(d).fail(n).progress(a);return this},always:function(){j.done.apply(j,arguments).fail.apply(j,arguments);return this},pipe:function(d,n,a){return f.Deferred(function(b){f.each({done:[d,
"resolve"],fail:[n,"reject"],progress:[a,"notify"]},function(d,n){var a=n[0],A=n[1],c;if(f.isFunction(a))j[d](function(){if((c=a.apply(this,arguments))&&f.isFunction(c.promise))c.promise().then(b.resolve,b.reject,b.notify);else b[A+"With"](this===j?b:this,[c])});else j[d](b[A])})}).promise()},promise:function(d){if(null==d)d=g;else for(var n in g)d[n]=g[n];return d}},j=g.promise({}),m;for(m in e)j[m]=e[m].fire,j[m+"With"]=e[m].fireWith;j.done(function(){c="resolved"},a.disable,b.lock).fail(function(){c=
"rejected"},n.disable,b.lock);d&&d.call(j,j);return j},when:function(d){function n(d){return function(n){b[d]=1<arguments.length?Lb.call(arguments,0):n;--j||m.resolveWith(m,b)}}function a(d){return function(n){g[d]=1<arguments.length?Lb.call(arguments,0):n;m.notifyWith(p,g)}}var b=Lb.call(arguments,0),c=0,e=b.length,g=Array(e),j=e,m=1>=e&&d&&f.isFunction(d.promise)?d:f.Deferred(),p=m.promise();if(1<e){for(;c<e;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(n(c),m.reject,a(c)):
--j;j||m.resolveWith(m,b)}else m!==d&&m.resolveWith(m,e?[d]:[]);return p}});var ed=f,rc;var ea,Mb,Ta,Nb,qb,aa,Ma,Ga,Ua,sc,Na,K=C.createElement("div");K.setAttribute("className","t");K.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";Mb=K.getElementsByTagName("*");Ta=K.getElementsByTagName("a")[0];if(!Mb||!Mb.length||!Ta)rc={};else{Nb=C.createElement("select");qb=Nb.appendChild(C.createElement("option"));aa=K.getElementsByTagName("input")[0];
ea={leadingWhitespace:3===K.firstChild.nodeType,tbody:!K.getElementsByTagName("tbody").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/top/.test(Ta.getAttribute("style")),hrefNormalized:"/a"===Ta.getAttribute("href"),opacity:/^0.55/.test(Ta.style.opacity),cssFloat:!!Ta.style.cssFloat,checkOn:"on"===aa.value,optSelected:qb.selected,getSetAttribute:"t"!==K.className,enctype:!!C.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==C.createElement("nav").cloneNode(!0).outerHTML,
submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0};f.boxModel=ea.boxModel="CSS1Compat"===C.compatMode;aa.checked=!0;ea.noCloneChecked=aa.cloneNode(!0).checked;Nb.disabled=!0;ea.optDisabled=!qb.disabled;try{delete K.test}catch(Yd){ea.deleteExpando=!1}!K.addEventListener&&(K.attachEvent&&K.fireEvent)&&(K.attachEvent("onclick",function(){ea.noCloneEvent=!1}),K.cloneNode(!0).fireEvent("onclick"));
aa=C.createElement("input");aa.value="t";aa.setAttribute("type","radio");ea.radioValue="t"===aa.value;aa.setAttribute("checked","checked");aa.setAttribute("name","t");K.appendChild(aa);Ma=C.createDocumentFragment();Ma.appendChild(K.lastChild);ea.checkClone=Ma.cloneNode(!0).cloneNode(!0).lastChild.checked;ea.appendChecked=aa.checked;Ma.removeChild(aa);Ma.appendChild(K);if(K.attachEvent)for(sc in{submit:1,change:1,focusin:1})Ua="on"+sc,Na=Ua in K,Na||(K.setAttribute(Ua,"return;"),Na="function"===typeof K[Ua]),
ea[sc+"Bubbles"]=Na;Ma.removeChild(K);Ma=Nb=qb=K=aa=null;f(function(){var d,n,a,c,e=C.getElementsByTagName("body")[0];e&&(d=C.createElement("div"),d.style.cssText="padding:0;margin:0;border:0;visibility:hidden;width:0;height:0;position:static;top:0;margin-top:1px",e.insertBefore(d,e.firstChild),K=C.createElement("div"),d.appendChild(K),K.innerHTML="<table><tr><td style='padding:0;margin:0;border:0;display:none'></td><td>t</td></tr></table>",Ga=K.getElementsByTagName("td"),Na=0===Ga[0].offsetHeight,
Ga[0].style.display="",Ga[1].style.display="none",ea.reliableHiddenOffsets=Na&&0===Ga[0].offsetHeight,b.getComputedStyle&&(K.innerHTML="",n=C.createElement("div"),n.style.width="0",n.style.marginRight="0",K.style.width="2px",K.appendChild(n),ea.reliableMarginRight=0===(parseInt((b.getComputedStyle(n,null)||{marginRight:0}).marginRight,10)||0)),"undefined"!==typeof K.style.zoom&&(K.innerHTML="",K.style.width=K.style.padding="1px",K.style.border=0,K.style.overflow="hidden",K.style.display="inline",
K.style.zoom=1,ea.inlineBlockNeedsLayout=3===K.offsetWidth,K.style.display="block",K.style.overflow="visible",K.innerHTML="<div style='width:5px;'></div>",ea.shrinkWrapBlocks=3!==K.offsetWidth),K.style.cssText="position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:0;visibility:hidden;",K.innerHTML="<div style='position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:5px solid #000;display:block;'><div style='padding:0;margin:0;border:0;display:block;overflow:hidden;'></div></div><table style='position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:5px solid #000;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>",
n=K.firstChild,a=n.firstChild,c=n.nextSibling.firstChild.firstChild,c={doesNotAddBorder:5!==a.offsetTop,doesAddBorderForTableAndCells:5===c.offsetTop},a.style.position="fixed",a.style.top="20px",c.fixedPosition=20===a.offsetTop||15===a.offsetTop,a.style.position=a.style.top="",n.style.overflow="hidden",n.style.position="relative",c.subtractsBorderForOverflowNotVisible=-5===a.offsetTop,c.doesNotIncludeMarginInBodyOffset=1!==e.offsetTop,b.getComputedStyle&&(K.style.marginTop="1%",ea.pixelMargin="1%"!==
(b.getComputedStyle(K,null)||{marginTop:0}).marginTop),"undefined"!==typeof d.style.zoom&&(d.style.zoom=1),e.removeChild(d),K=null,f.extend(ea,c))});rc=ea}ed.support=rc;var $c=/^(?:\{.*\}|\[.*\])$/,oa=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(d){d=d.nodeType?f.cache[d[f.expando]]:d[f.expando];return!!d&&!k(d)},data:function(d,n,a,b){if(f.acceptData(d)){var c;
c=f.expando;var e="string"===typeof n,g=d.nodeType,j=g?f.cache:d,m=g?d[c]:d[c]&&c,p="events"===n;if(m&&j[m]&&(p||b||j[m].data)||!(e&&a===l)){m||(g?d[c]=m=++f.uuid:m=c);j[m]||(j[m]={},g||(j[m].toJSON=f.noop));if("object"===typeof n||"function"===typeof n)b?j[m]=f.extend(j[m],n):j[m].data=f.extend(j[m].data,n);c=d=j[m];b||(d.data||(d.data={}),d=d.data);a!==l&&(d[f.camelCase(n)]=a);if(p&&!d[n])return c.events;e?(a=d[n],null==a&&(a=d[f.camelCase(n)])):a=d;return a}}},removeData:function(d,n,a){if(f.acceptData(d)){var b,
c,e,g=f.expando,j=d.nodeType,m=j?f.cache:d,p=j?d[g]:g;if(m[p]){if(n&&(b=a?m[p]:m[p].data)){f.isArray(n)||(n in b?n=[n]:(n=f.camelCase(n),n=n in b?[n]:n.split(" ")));c=0;for(e=n.length;c<e;c++)delete b[n[c]];if(!(a?k:f.isEmptyObject)(b))return}if(!a&&(delete m[p].data,!k(m[p])))return;f.support.deleteExpando||!m.setInterval?delete m[p]:m[p]=null;j&&(f.support.deleteExpando?delete d[g]:d.removeAttribute?d.removeAttribute(g):d[g]=null)}}},_data:function(d,n,a){return f.data(d,n,a,!0)},acceptData:function(d){if(d.nodeName){var n=
f.noData[d.nodeName.toLowerCase()];if(n)return!(!0===n||d.getAttribute("classid")!==n)}return!0}});f.fn.extend({data:function(d,n){var a,b,e,g,j,m=this[0],p=0,t=null;if(d===l){if(this.length&&(t=f.data(m),1===m.nodeType&&!f._data(m,"parsedAttrs"))){e=m.attributes;for(j=e.length;p<j;p++)g=e[p].name,0===g.indexOf("data-")&&(g=f.camelCase(g.substring(5)),c(m,g,t[g]));f._data(m,"parsedAttrs",!0)}return t}if("object"===typeof d)return this.each(function(){f.data(this,d)});a=d.split(".",2);a[1]=a[1]?"."+
a[1]:"";b=a[1]+"!";return f.access(this,function(n){if(n===l)return t=this.triggerHandler("getData"+b,[a[0]]),t===l&&m&&(t=f.data(m,d),t=c(m,d,t)),t===l&&a[1]?this.data(a[0]):t;a[1]=n;this.each(function(){var c=f(this);c.triggerHandler("setData"+b,a);f.data(this,d,n);c.triggerHandler("changeData"+b,a)})},null,n,1<arguments.length,null,!1)},removeData:function(d){return this.each(function(){f.removeData(this,d)})}});f.extend({_mark:function(d,n){d&&(n=(n||"fx")+"mark",f._data(d,n,(f._data(d,n)||0)+
1))},_unmark:function(d,n,a){!0!==d&&(a=n,n=d,d=!1);if(n){a=a||"fx";var b=a+"mark";(d=d?0:(f._data(n,b)||1)-1)?f._data(n,b,d):(f.removeData(n,b,!0),h(n,a,"mark"))}},queue:function(d,n,a){var b;if(d)return n=(n||"fx")+"queue",b=f._data(d,n),a&&(!b||f.isArray(a)?b=f._data(d,n,f.makeArray(a)):b.push(a)),b||[]},dequeue:function(d,n){n=n||"fx";var a=f.queue(d,n),b=a.shift(),c={};"inprogress"===b&&(b=a.shift());b&&("fx"===n&&a.unshift("inprogress"),f._data(d,n+".run",c),b.call(d,function(){f.dequeue(d,
n)},c));a.length||(f.removeData(d,n+"queue "+n+".run",!0),h(d,n,"queue"))}});f.fn.extend({queue:function(d,n){var a=2;"string"!==typeof d&&(n=d,d="fx",a--);return arguments.length<a?f.queue(this[0],d):n===l?this:this.each(function(){var a=f.queue(this,d,n);"fx"===d&&"inprogress"!==a[0]&&f.dequeue(this,d)})},dequeue:function(d){return this.each(function(){f.dequeue(this,d)})},delay:function(d,n){d=f.fx?f.fx.speeds[d]||d:d;return this.queue(n||"fx",function(n,a){var b=setTimeout(n,d);a.stop=function(){clearTimeout(b)}})},
clearQueue:function(d){return this.queue(d||"fx",[])},promise:function(d,n){function a(){--g||b.resolveWith(c,[c])}"string"!==typeof d&&(n=d,d=l);d=d||"fx";for(var b=f.Deferred(),c=this,e=c.length,g=1,j=d+"defer",m=d+"queue",p=d+"mark",t;e--;)if(t=f.data(c[e],j,l,!0)||(f.data(c[e],m,l,!0)||f.data(c[e],p,l,!0))&&f.data(c[e],j,f.Callbacks("once memory"),!0))g++,t.add(a);a();return b.promise(n)}});var bb=/[\n\t\r]/g,Va=/\s+/,Ob=/\r/g,Zd=/^(?:button|input)$/i,fd=/^(?:button|input|object|select|textarea)$/i,
gd=/^a(?:rea)?$/i,tc=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,uc=f.support.getSetAttribute,wa,Pb,hd;f.fn.extend({attr:function(d,n){return f.access(this,f.attr,d,n,1<arguments.length)},removeAttr:function(d){return this.each(function(){f.removeAttr(this,d)})},prop:function(d,n){return f.access(this,f.prop,d,n,1<arguments.length)},removeProp:function(d){d=f.propFix[d]||d;return this.each(function(){try{this[d]=l,delete this[d]}catch(n){}})},
addClass:function(d){var n,a,b,c,e,g,j;if(f.isFunction(d))return this.each(function(n){f(this).addClass(d.call(this,n,this.className))});if(d&&"string"===typeof d){n=d.split(Va);a=0;for(b=this.length;a<b;a++)if(c=this[a],1===c.nodeType)if(!c.className&&1===n.length)c.className=d;else{e=" "+c.className+" ";g=0;for(j=n.length;g<j;g++)~e.indexOf(" "+n[g]+" ")||(e+=n[g]+" ");c.className=f.trim(e)}}return this},removeClass:function(d){var n,a,b,c,e,g,j;if(f.isFunction(d))return this.each(function(n){f(this).removeClass(d.call(this,
n,this.className))});if(d&&"string"===typeof d||d===l){n=(d||"").split(Va);a=0;for(b=this.length;a<b;a++)if(c=this[a],1===c.nodeType&&c.className)if(d){e=(" "+c.className+" ").replace(bb," ");g=0;for(j=n.length;g<j;g++)e=e.replace(" "+n[g]+" "," ");c.className=f.trim(e)}else c.className=""}return this},toggleClass:function(d,n){var a=typeof d,b="boolean"===typeof n;return f.isFunction(d)?this.each(function(a){f(this).toggleClass(d.call(this,a,this.className,n),n)}):this.each(function(){if("string"===
a)for(var c,e=0,g=f(this),j=n,m=d.split(Va);c=m[e++];)j=b?j:!g.hasClass(c),g[j?"addClass":"removeClass"](c);else if("undefined"===a||"boolean"===a)this.className&&f._data(this,"__className__",this.className),this.className=this.className||!1===d?"":f._data(this,"__className__")||""})},hasClass:function(d){d=" "+d+" ";for(var n=0,a=this.length;n<a;n++)if(1===this[n].nodeType&&-1<(" "+this[n].className+" ").replace(bb," ").indexOf(d))return!0;return!1},val:function(d){var n,a,b,c=this[0];if(arguments.length)return b=
f.isFunction(d),this.each(function(a){var c=f(this);if(1===this.nodeType&&(a=b?d.call(this,a,c.val()):d,null==a?a="":"number"===typeof a?a+="":f.isArray(a)&&(a=f.map(a,function(d){return null==d?"":d+""})),n=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()],!n||!("set"in n)||n.set(this,a,"value")===l))this.value=a});if(c){if((n=f.valHooks[c.type]||f.valHooks[c.nodeName.toLowerCase()])&&"get"in n&&(a=n.get(c,"value"))!==l)return a;a=c.value;return"string"===typeof a?a.replace(Ob,""):null==
a?"":a}}});f.extend({valHooks:{option:{get:function(d){var n=d.attributes.value;return!n||n.specified?d.value:d.text}},select:{get:function(d){var n,a,b=d.selectedIndex,c=[],e=d.options,g="select-one"===d.type;if(0>b)return null;d=g?b:0;for(a=g?b+1:e.length;d<a;d++)if(n=e[d],n.selected&&(f.support.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!f.nodeName(n.parentNode,"optgroup"))){n=f(n).val();if(g)return n;c.push(n)}return g&&!c.length&&e.length?f(e[b]).val():
c},set:function(d,n){var a=f.makeArray(n);f(d).find("option").each(function(){this.selected=0<=f.inArray(f(this).val(),a)});a.length||(d.selectedIndex=-1);return a}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(d,n,a,b){var c,e,g=d.nodeType;if(d&&!(3===g||8===g||2===g)){if(b&&n in f.attrFn)return f(d)[n](a);if("undefined"===typeof d.getAttribute)return f.prop(d,n,a);if(b=1!==g||!f.isXMLDoc(d))n=n.toLowerCase(),e=f.attrHooks[n]||(tc.test(n)?Pb:wa);if(a!==
l)if(null===a)f.removeAttr(d,n);else{if(e&&"set"in e&&b&&(c=e.set(d,a,n))!==l)return c;d.setAttribute(n,""+a);return a}else{if(e&&"get"in e&&b&&null!==(c=e.get(d,n)))return c;c=d.getAttribute(n);return null===c?l:c}}},removeAttr:function(d,n){var a,b,c,e,g,j=0;if(n&&1===d.nodeType){b=n.toLowerCase().split(Va);for(e=b.length;j<e;j++)if(c=b[j])a=f.propFix[c]||c,(g=tc.test(c))||f.attr(d,c,""),d.removeAttribute(uc?c:a),g&&a in d&&(d[a]=!1)}},attrHooks:{type:{set:function(d,n){if(Zd.test(d.nodeName)&&
d.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&"radio"===n&&f.nodeName(d,"input")){var a=d.value;d.setAttribute("type",n);a&&(d.value=a);return n}}},value:{get:function(d,n){return wa&&f.nodeName(d,"button")?wa.get(d,n):n in d?d.value:null},set:function(d,n,a){if(wa&&f.nodeName(d,"button"))return wa.set(d,n,a);d.value=n}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",
rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(d,n,a){var b,c,e;e=d.nodeType;if(d&&!(3===e||8===e||2===e)){if(e=1!==e||!f.isXMLDoc(d))n=f.propFix[n]||n,c=f.propHooks[n];return a!==l?c&&"set"in c&&(b=c.set(d,a,n))!==l?b:d[n]=a:c&&"get"in c&&null!==(b=c.get(d,n))?b:d[n]}},propHooks:{tabIndex:{get:function(d){var n=d.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):fd.test(d.nodeName)||gd.test(d.nodeName)&&
d.href?0:l}}}});f.attrHooks.tabindex=f.propHooks.tabIndex;Pb={get:function(d,n){var a,b=f.prop(d,n);return!0===b||"boolean"!==typeof b&&(a=d.getAttributeNode(n))&&!1!==a.nodeValue?n.toLowerCase():l},set:function(d,n,a){!1===n?f.removeAttr(d,a):(n=f.propFix[a]||a,n in d&&(d[n]=!0),d.setAttribute(a,a.toLowerCase()));return a}};uc||(hd={name:!0,id:!0,coords:!0},wa=f.valHooks.button={get:function(d,n){var a;return(a=d.getAttributeNode(n))&&(hd[n]?""!==a.nodeValue:a.specified)?a.nodeValue:l},set:function(d,
n,a){var b=d.getAttributeNode(a);b||(b=C.createAttribute(a),d.setAttributeNode(b));return b.nodeValue=n+""}},f.attrHooks.tabindex.set=wa.set,f.each(["width","height"],function(d,n){f.attrHooks[n]=f.extend(f.attrHooks[n],{set:function(d,a){if(""===a)return d.setAttribute(n,"auto"),a}})}),f.attrHooks.contenteditable={get:wa.get,set:function(d,n,a){""===n&&(n="false");wa.set(d,n,a)}});f.support.hrefNormalized||f.each(["href","src","width","height"],function(d,n){f.attrHooks[n]=f.extend(f.attrHooks[n],
{get:function(d){d=d.getAttribute(n,2);return null===d?l:d}})});f.support.style||(f.attrHooks.style={get:function(d){return d.style.cssText.toLowerCase()||l},set:function(d,n){return d.style.cssText=""+n}});f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(d){if(d=d.parentNode)d.selectedIndex,d.parentNode&&d.parentNode.selectedIndex;return null}}));f.support.enctype||(f.propFix.enctype="encoding");f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]=
{get:function(d){return null===d.getAttribute("value")?"on":d.value}}});f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(d,n){if(f.isArray(n))return d.checked=0<=f.inArray(f(d).val(),n)}})});var vc=/^(?:textarea|input|select)$/i,wc=/^([^\.]*)?(?:\.(.+))?$/,xc=/(?:^|\s)hover(\.\S+)?\b/,Qb=/^key/,id=/^(?:mouse|contextmenu)|click/,rb=/^(?:focusinfocus|focusoutblur)$/,jd=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,kd=function(d){if(d=jd.exec(d))d[1]=(d[1]||
"").toLowerCase(),d[3]=d[3]&&RegExp("(?:^|\\s)"+d[3]+"(?:\\s|$)");return d},yc=function(d){return f.event.special.hover?d:d.replace(xc,"mouseenter$1 mouseleave$1")};f.event={add:function(d,n,a,b,c){var e,g,j,m,p,t,v,s,L;if(!(3===d.nodeType||8===d.nodeType||!n||!a||!(e=f._data(d)))){a.handler&&(v=a,a=v.handler,c=v.selector);a.guid||(a.guid=f.guid++);j=e.events;j||(e.events=j={});g=e.handle;g||(e.handle=g=function(d){return"undefined"!==typeof f&&(!d||f.event.triggered!==d.type)?f.event.dispatch.apply(g.elem,
arguments):l},g.elem=d);n=f.trim(yc(n)).split(" ");for(e=0;e<n.length;e++){m=wc.exec(n[e])||[];p=m[1];t=(m[2]||"").split(".").sort();L=f.event.special[p]||{};p=(c?L.delegateType:L.bindType)||p;L=f.event.special[p]||{};m=f.extend({type:p,origType:m[1],data:b,handler:a,guid:a.guid,selector:c,quick:c&&kd(c),namespace:t.join(".")},v);s=j[p];if(!s&&(s=j[p]=[],s.delegateCount=0,!L.setup||!1===L.setup.call(d,b,t,g)))d.addEventListener?d.addEventListener(p,g,!1):d.attachEvent&&d.attachEvent("on"+p,g);L.add&&
(L.add.call(d,m),m.handler.guid||(m.handler.guid=a.guid));c?s.splice(s.delegateCount++,0,m):s.push(m);f.event.global[p]=!0}d=null}},global:{},remove:function(d,n,a,b,c){var e=f.hasData(d)&&f._data(d),g,j,m,p,t,v,s,L,k,l;if(e&&(s=e.events)){n=f.trim(yc(n||"")).split(" ");for(g=0;g<n.length;g++)if(j=wc.exec(n[g])||[],m=p=j[1],j=j[2],m){L=f.event.special[m]||{};m=(b?L.delegateType:L.bindType)||m;k=s[m]||[];t=k.length;j=j?RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(v=
0;v<k.length;v++)if(l=k[v],(c||p===l.origType)&&(!a||a.guid===l.guid)&&(!j||j.test(l.namespace))&&(!b||b===l.selector||"**"===b&&l.selector))k.splice(v--,1),l.selector&&k.delegateCount--,L.remove&&L.remove.call(d,l);0===k.length&&t!==k.length&&((!L.teardown||!1===L.teardown.call(d,j))&&f.removeEvent(d,m,e.handle),delete s[m])}else for(m in s)f.event.remove(d,m+n[g],a,b,!0);if(f.isEmptyObject(s)){if(n=e.handle)n.elem=null;f.removeData(d,["events","handle"],!0)}}},customEvent:{getData:!0,setData:!0,
changeData:!0},trigger:function(d,n,a,c){if(!a||!(3===a.nodeType||8===a.nodeType)){var e=d.type||d,g=[],j,m,p,t,v;if(!rb.test(e+f.event.triggered)&&(0<=e.indexOf("!")&&(e=e.slice(0,-1),j=!0),0<=e.indexOf(".")&&(g=e.split("."),e=g.shift(),g.sort()),a&&!f.event.customEvent[e]||f.event.global[e]))if(d="object"===typeof d?d[f.expando]?d:new f.Event(e,d):new f.Event(e),d.type=e,d.isTrigger=!0,d.exclusive=j,d.namespace=g.join("."),d.namespace_re=d.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.)?")+"(\\.|$)"):
null,j=0>e.indexOf(":")?"on"+e:"",a){if(d.result=l,d.target||(d.target=a),n=null!=n?f.makeArray(n):[],n.unshift(d),p=f.event.special[e]||{},!(p.trigger&&!1===p.trigger.apply(a,n))){v=[[a,p.bindType||e]];if(!c&&!p.noBubble&&!f.isWindow(a)){t=p.delegateType||e;g=rb.test(t+e)?a:a.parentNode;for(m=null;g;g=g.parentNode)v.push([g,t]),m=g;m&&m===a.ownerDocument&&v.push([m.defaultView||m.parentWindow||b,t])}for(m=0;m<v.length&&!d.isPropagationStopped();m++)g=v[m][0],d.type=v[m][1],(t=(f._data(g,"events")||
{})[d.type]&&f._data(g,"handle"))&&t.apply(g,n),(t=j&&g[j])&&(f.acceptData(g)&&!1===t.apply(g,n))&&d.preventDefault();d.type=e;if(!c&&!d.isDefaultPrevented()&&(!p._default||!1===p._default.apply(a.ownerDocument,n))&&!("click"===e&&f.nodeName(a,"a"))&&f.acceptData(a))if(j&&a[e]&&("focus"!==e&&"blur"!==e||0!==d.target.offsetWidth)&&!f.isWindow(a))(m=a[j])&&(a[j]=null),f.event.triggered=e,a[e](),f.event.triggered=l,m&&(a[j]=m);return d.result}}else for(m in a=f.cache,a)a[m].events&&a[m].events[e]&&f.event.trigger(d,
n,a[m].handle.elem,!0)}},dispatch:function(d){d=f.event.fix(d||b.event);var a=(f._data(this,"events")||{})[d.type]||[],c=a.delegateCount,e=[].slice.call(arguments,0),g=!d.exclusive&&!d.namespace,j=f.event.special[d.type]||{},m=[],p,t,v,s,L,k,y;e[0]=d;d.delegateTarget=this;if(!(j.preDispatch&&!1===j.preDispatch.call(this,d))){if(c&&!(d.button&&"click"===d.type)){v=f(this);v.context=this.ownerDocument||this;for(t=d.target;t!=this;t=t.parentNode||this)if(!0!==t.disabled){L={};k=[];v[0]=t;for(p=0;p<c;p++){s=
a[p];y=s.selector;if(L[y]===l){var h=L,ta=y,r;if(s.quick){r=s.quick;var q=t.attributes||{};r=(!r[1]||t.nodeName.toLowerCase()===r[1])&&(!r[2]||(q.id||{}).value===r[2])&&(!r[3]||r[3].test((q["class"]||{}).value))}else r=v.is(y);h[ta]=r}L[y]&&k.push(s)}k.length&&m.push({elem:t,matches:k})}}a.length>c&&m.push({elem:this,matches:a.slice(c)});for(p=0;p<m.length&&!d.isPropagationStopped();p++){c=m[p];d.currentTarget=c.elem;for(a=0;a<c.matches.length&&!d.isImmediatePropagationStopped();a++)if(s=c.matches[a],
g||!d.namespace&&!s.namespace||d.namespace_re&&d.namespace_re.test(s.namespace))d.data=s.data,d.handleObj=s,s=((f.event.special[s.origType]||{}).handle||s.handler).apply(c.elem,e),s!==l&&(d.result=s,!1===s&&(d.preventDefault(),d.stopPropagation()))}j.postDispatch&&j.postDispatch.call(this,d);return d.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},
keyHooks:{props:["char","charCode","key","keyCode"],filter:function(d,a){null==d.which&&(d.which=null!=a.charCode?a.charCode:a.keyCode);return d}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(d,a){var b,c,f=a.button,e=a.fromElement;null==d.pageX&&null!=a.clientX&&(b=d.target.ownerDocument||C,c=b.documentElement,b=b.body,d.pageX=a.clientX+(c&&c.scrollLeft||b&&b.scrollLeft||0)-(c&&c.clientLeft||b&&b.clientLeft||
0),d.pageY=a.clientY+(c&&c.scrollTop||b&&b.scrollTop||0)-(c&&c.clientTop||b&&b.clientTop||0));!d.relatedTarget&&e&&(d.relatedTarget=e===d.target?a.toElement:e);!d.which&&f!==l&&(d.which=f&1?1:f&2?3:f&4?2:0);return d}},fix:function(d){if(d[f.expando])return d;var a,b,c=d,e=f.event.fixHooks[d.type]||{},g=e.props?this.props.concat(e.props):this.props;d=f.Event(c);for(a=g.length;a;)b=g[--a],d[b]=c[b];d.target||(d.target=c.srcElement||C);3===d.target.nodeType&&(d.target=d.target.parentNode);d.metaKey===
l&&(d.metaKey=d.ctrlKey);return e.filter?e.filter(d,c):d},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(d,a,b){f.isWindow(this)&&(this.onbeforeunload=b)},teardown:function(d,a){this.onbeforeunload===a&&(this.onbeforeunload=null)}}},simulate:function(d,a,b,c){d=f.extend(new f.Event,b,{type:d,isSimulated:!0,originalEvent:{}});c?f.event.trigger(d,null,a):f.event.dispatch.call(a,d);d.isDefaultPrevented()&&
b.preventDefault()}};f.event.handle=f.event.dispatch;f.removeEvent=C.removeEventListener?function(d,a,b){d.removeEventListener&&d.removeEventListener(a,b,!1)}:function(d,a,b){d.detachEvent&&d.detachEvent("on"+a,b)};f.Event=function(d,a){if(!(this instanceof f.Event))return new f.Event(d,a);d&&d.type?(this.originalEvent=d,this.type=d.type,this.isDefaultPrevented=d.defaultPrevented||!1===d.returnValue||d.getPreventDefault&&d.getPreventDefault()?q:r):this.type=d;a&&f.extend(this,a);this.timeStamp=d&&
d.timeStamp||f.now();this[f.expando]=!0};f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=q;var d=this.originalEvent;d&&(d.preventDefault?d.preventDefault():d.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=q;var d=this.originalEvent;d&&(d.stopPropagation&&d.stopPropagation(),d.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=q;this.stopPropagation()},isDefaultPrevented:r,isPropagationStopped:r,isImmediatePropagationStopped:r};
f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(d,a){f.event.special[d]={delegateType:a,bindType:a,handle:function(d){var b=d.relatedTarget,c=d.handleObj,e;if(!b||b!==this&&!f.contains(this,b))d.type=c.origType,e=c.handler.apply(this,arguments),d.type=a;return e}}});f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(d){d=d.target;if((d=f.nodeName(d,"input")||f.nodeName(d,"button")?
d.form:l)&&!d._submit_attached)f.event.add(d,"submit._submit",function(d){d._submit_bubble=!0}),d._submit_attached=!0})},postDispatch:function(d){d._submit_bubble&&(delete d._submit_bubble,this.parentNode&&!d.isTrigger&&f.event.simulate("submit",this.parentNode,d,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}});f.support.changeBubbles||(f.event.special.change={setup:function(){if(vc.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type)f.event.add(this,
"propertychange._change",function(d){"checked"===d.originalEvent.propertyName&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(d){this._just_changed&&!d.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,d,!0))});return!1}f.event.add(this,"beforeactivate._change",function(d){d=d.target;vc.test(d.nodeName)&&!d._change_attached&&(f.event.add(d,"change._change",function(d){this.parentNode&&(!d.isSimulated&&!d.isTrigger)&&f.event.simulate("change",this.parentNode,d,!0)}),
d._change_attached=!0)})},handle:function(d){var a=d.target;if(this!==a||d.isSimulated||d.isTrigger||"radio"!==a.type&&"checkbox"!==a.type)return d.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return vc.test(this.nodeName)}});f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(d,a){var b=0,c=function(d){f.event.simulate(a,d.target,f.event.fix(d),!0)};f.event.special[a]={setup:function(){0===b++&&C.addEventListener(d,c,!0)},teardown:function(){0===
--b&&C.removeEventListener(d,c,!0)}}});f.fn.extend({on:function(d,a,b,c,e){var g,j;if("object"===typeof d){"string"!==typeof a&&(b=b||a,a=l);for(j in d)this.on(j,a,b,d[j],e);return this}null==b&&null==c?(c=a,b=a=l):null==c&&("string"===typeof a?(c=b,b=l):(c=b,b=a,a=l));if(!1===c)c=r;else if(!c)return this;1===e&&(g=c,c=function(d){f().off(d);return g.apply(this,arguments)},c.guid=g.guid||(g.guid=f.guid++));return this.each(function(){f.event.add(this,d,c,b,a)})},one:function(d,a,b,c){return this.on(d,
a,b,c,1)},off:function(d,a,b){if(d&&d.preventDefault&&d.handleObj){var c=d.handleObj;f(d.delegateTarget).off(c.namespace?c.origType+"."+c.namespace:c.origType,c.selector,c.handler);return this}if("object"===typeof d){for(c in d)this.off(c,a,d[c]);return this}if(!1===a||"function"===typeof a)b=a,a=l;!1===b&&(b=r);return this.each(function(){f.event.remove(this,d,b,a)})},bind:function(d,a,b){return this.on(d,null,a,b)},unbind:function(d,a){return this.off(d,null,a)},live:function(d,a,b){f(this.context).on(d,
this.selector,a,b);return this},die:function(d,a){f(this.context).off(d,this.selector||"**",a);return this},delegate:function(d,a,b,c){return this.on(a,d,b,c)},undelegate:function(d,a,b){return 1==arguments.length?this.off(d,"**"):this.off(a,d,b)},trigger:function(d,a){return this.each(function(){f.event.trigger(d,a,this)})},triggerHandler:function(d,a){if(this[0])return f.event.trigger(d,a,this[0],!0)},toggle:function(d){var a=arguments,b=d.guid||f.guid++,c=0,e=function(b){var e=(f._data(this,"lastToggle"+
d.guid)||0)%c;f._data(this,"lastToggle"+d.guid,e+1);b.preventDefault();return a[e].apply(this,arguments)||!1};for(e.guid=b;c<a.length;)a[c++].guid=b;return this.click(e)},hover:function(d,a){return this.mouseenter(d).mouseleave(a||d)}});f.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(d,a){f.fn[a]=function(d,b){null==b&&
(b=d,d=null);return 0<arguments.length?this.on(a,null,d,b):this.trigger(a)};f.attrFn&&(f.attrFn[a]=!0);Qb.test(a)&&(f.event.fixHooks[a]=f.event.keyHooks);id.test(a)&&(f.event.fixHooks[a]=f.event.mouseHooks)});var zc=function(d,a,b,c,f,e){f=0;for(var g=c.length;f<g;f++){var j=c[f];if(j){for(var m=!1,j=j[d];j;){if(j[cb]===b){m=c[j.sizset];break}1===j.nodeType&&!e&&(j[cb]=b,j.sizset=f);if(j.nodeName.toLowerCase()===a){m=j;break}j=j[d]}c[f]=m}}},Ac=function(d,a,b,c,f,e){f=0;for(var g=c.length;f<g;f++){var j=
c[f];if(j){for(var m=!1,j=j[d];j;){if(j[cb]===b){m=c[j.sizset];break}if(1===j.nodeType)if(e||(j[cb]=b,j.sizset=f),"string"!==typeof a){if(j===a){m=!0;break}}else if(0<I.filter(a,[j]).length){m=j;break}j=j[d]}c[f]=m}}},Bc=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,cb="sizcache"+(Math.random()+"").replace(".",""),Rb=0,Cc=Object.prototype.toString,sb=!1,Sb=!0,Wa=/\\/g,qa=/\r\n/g,db=/\W/;[0,0].sort(function(){Sb=
!1;return 0});var I=function(d,a,b,c){b=b||[];var f=a=a||C;if(1!==a.nodeType&&9!==a.nodeType)return[];if(!d||"string"!==typeof d)return b;var e,g,j,m,p,t=!0,v=I.isXML(a),s=[],L=d;do if(Bc.exec(""),e=Bc.exec(L))if(L=e[3],s.push(e[1]),e[2]){m=e[3];break}while(e);if(1<s.length&&Dc.exec(d))if(2===s.length&&M.relative[s[0]])g=Ec(s[0]+s[1],a,c);else for(g=M.relative[s[0]]?[a]:I(s.shift(),a);s.length;)d=s.shift(),M.relative[d]&&(d+=s.shift()),g=Ec(d,g,c);else if(!c&&(1<s.length&&9===a.nodeType&&!v&&M.match.ID.test(s[0])&&
!M.match.ID.test(s[s.length-1]))&&(e=I.find(s.shift(),a,v),a=e.expr?I.filter(e.expr,e.set)[0]:e.set[0]),a){e=c?{expr:s.pop(),set:ra(c)}:I.find(s.pop(),1===s.length&&("~"===s[0]||"+"===s[0])&&a.parentNode?a.parentNode:a,v);g=e.expr?I.filter(e.expr,e.set):e.set;for(0<s.length?j=ra(g):t=!1;s.length;)e=p=s.pop(),M.relative[p]?e=s.pop():p="",null==e&&(e=a),M.relative[p](j,e,v)}else j=[];j||(j=g);j||I.error(p||d);if("[object Array]"===Cc.call(j))if(t)if(a&&1===a.nodeType)for(d=0;null!=j[d];d++)j[d]&&(!0===
j[d]||1===j[d].nodeType&&I.contains(a,j[d]))&&b.push(g[d]);else for(d=0;null!=j[d];d++)j[d]&&1===j[d].nodeType&&b.push(g[d]);else b.push.apply(b,j);else ra(j,b);m&&(I(m,f,b,c),I.uniqueSort(b));return b};I.uniqueSort=function(d){if(tb&&(sb=Sb,d.sort(tb),sb))for(var a=1;a<d.length;a++)d[a]===d[a-1]&&d.splice(a--,1);return d};I.matches=function(d,a){return I(d,null,null,a)};I.matchesSelector=function(d,a){return 0<I(a,null,null,[d]).length};I.find=function(d,a,b){var c,e,f,g,j,m;if(!d)return[];e=0;for(f=
M.order.length;e<f;e++)if(j=M.order[e],g=M.leftMatch[j].exec(d))if(m=g[1],g.splice(1,1),"\\"!==m.substr(m.length-1)&&(g[1]=(g[1]||"").replace(Wa,""),c=M.find[j](g,a,b),null!=c)){d=d.replace(M.match[j],"");break}c||(c="undefined"!==typeof a.getElementsByTagName?a.getElementsByTagName("*"):[]);return{set:c,expr:d}};I.filter=function(d,a,b,c){for(var e,f,g,j,m,p,t,s,v=d,L=[],k=a,y=a&&a[0]&&I.isXML(a[0]);d&&a.length;){for(g in M.filter)if(null!=(e=M.leftMatch[g].exec(d))&&e[2])if(p=M.filter[g],m=e[1],
f=!1,e.splice(1,1),"\\"!==m.substr(m.length-1)){k===L&&(L=[]);if(M.preFilter[g])if(e=M.preFilter[g](e,k,b,L,c,y)){if(!0===e)continue}else f=j=!0;if(e)for(t=0;null!=(m=k[t]);t++)m&&(j=p(m,e,t,k),s=c^j,b&&null!=j?s?f=!0:k[t]=!1:s&&(L.push(m),f=!0));if(j!==l){b||(k=L);d=d.replace(M.match[g],"");if(!f)return[];break}}if(d===v)if(null==f)I.error(d);else break;v=d}return k};I.error=function(d){throw Error("Syntax error, unrecognized expression: "+d);};var eb=I.getText=function(d){var a,b;a=d.nodeType;var c=
"";if(a)if(1===a||9===a||11===a){if("string"===typeof d.textContent)return d.textContent;if("string"===typeof d.innerText)return d.innerText.replace(qa,"");for(d=d.firstChild;d;d=d.nextSibling)c+=eb(d)}else{if(3===a||4===a)return d.nodeValue}else for(a=0;b=d[a];a++)8!==b.nodeType&&(c+=eb(b));return c},M=I.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(d){return d.getAttribute("href")},type:function(d){return d.getAttribute("type")}},relative:{"+":function(d,a){var b=
"string"===typeof a,c=b&&!db.test(a),b=b&&!c;c&&(a=a.toLowerCase());for(var c=0,e=d.length,f;c<e;c++)if(f=d[c]){for(;(f=f.previousSibling)&&1!==f.nodeType;);d[c]=b||f&&f.nodeName.toLowerCase()===a?f||!1:f===a}b&&I.filter(a,d,!0)},">":function(d,a){var b,c="string"===typeof a,e=0,f=d.length;if(c&&!db.test(a))for(a=a.toLowerCase();e<f;e++){if(b=d[e])b=b.parentNode,d[e]=b.nodeName.toLowerCase()===a?b:!1}else{for(;e<f;e++)(b=d[e])&&(d[e]=c?b.parentNode:b.parentNode===a);c&&I.filter(a,d,!0)}},"":function(d,
a,b){var c,e=Rb++,f=Ac;"string"===typeof a&&!db.test(a)&&(c=a=a.toLowerCase(),f=zc);f("parentNode",a,e,d,c,b)},"~":function(d,a,b){var c,e=Rb++,f=Ac;"string"===typeof a&&!db.test(a)&&(c=a=a.toLowerCase(),f=zc);f("previousSibling",a,e,d,c,b)}},find:{ID:function(d,a,b){if("undefined"!==typeof a.getElementById&&!b)return(d=a.getElementById(d[1]))&&d.parentNode?[d]:[]},NAME:function(d,a){if("undefined"!==typeof a.getElementsByName){for(var b=[],c=a.getElementsByName(d[1]),e=0,f=c.length;e<f;e++)c[e].getAttribute("name")===
d[1]&&b.push(c[e]);return 0===b.length?null:b}},TAG:function(d,a){if("undefined"!==typeof a.getElementsByTagName)return a.getElementsByTagName(d[1])}},preFilter:{CLASS:function(d,a,b,c,e,f){d=" "+d[1].replace(Wa,"")+" ";if(f)return d;f=0;for(var g;null!=(g=a[f]);f++)g&&(e^(g.className&&0<=(" "+g.className+" ").replace(/[\t\n\r]/g," ").indexOf(d))?b||c.push(g):b&&(a[f]=!1));return!1},ID:function(d){return d[1].replace(Wa,"")},TAG:function(d){return d[1].replace(Wa,"").toLowerCase()},CHILD:function(d){if("nth"===
d[1]){d[2]||I.error(d[0]);d[2]=d[2].replace(/^\+|\s*/g,"");var a=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===d[2]&&"2n"||"odd"===d[2]&&"2n+1"||!/\D/.test(d[2])&&"0n+"+d[2]||d[2]);d[2]=a[1]+(a[2]||1)-0;d[3]=a[3]-0}else d[2]&&I.error(d[0]);d[0]=Rb++;return d},ATTR:function(d,a,b,c,e,f){a=d[1]=d[1].replace(Wa,"");!f&&M.attrMap[a]&&(d[1]=M.attrMap[a]);d[4]=(d[4]||d[5]||"").replace(Wa,"");"~="===d[2]&&(d[4]=" "+d[4]+" ");return d},PSEUDO:function(d,a,b,c,e){if("not"===d[1])if(1<(Bc.exec(d[3])||"").length||
/^\w/.test(d[3]))d[3]=I(d[3],null,null,a);else return d=I.filter(d[3],a,b,1^e),b||c.push.apply(c,d),!1;else if(M.match.POS.test(d[0])||M.match.CHILD.test(d[0]))return!0;return d},POS:function(d){d.unshift(!0);return d}},filters:{enabled:function(d){return!1===d.disabled&&"hidden"!==d.type},disabled:function(d){return!0===d.disabled},checked:function(d){return!0===d.checked},selected:function(d){d.parentNode&&d.parentNode.selectedIndex;return!0===d.selected},parent:function(d){return!!d.firstChild},
empty:function(d){return!d.firstChild},has:function(d,a,b){return!!I(b[3],d).length},header:function(d){return/h\d/i.test(d.nodeName)},text:function(d){var a=d.getAttribute("type"),b=d.type;return"input"===d.nodeName.toLowerCase()&&"text"===b&&(a===b||null===a)},radio:function(d){return"input"===d.nodeName.toLowerCase()&&"radio"===d.type},checkbox:function(d){return"input"===d.nodeName.toLowerCase()&&"checkbox"===d.type},file:function(d){return"input"===d.nodeName.toLowerCase()&&"file"===d.type},
password:function(d){return"input"===d.nodeName.toLowerCase()&&"password"===d.type},submit:function(d){var a=d.nodeName.toLowerCase();return("input"===a||"button"===a)&&"submit"===d.type},image:function(d){return"input"===d.nodeName.toLowerCase()&&"image"===d.type},reset:function(d){var a=d.nodeName.toLowerCase();return("input"===a||"button"===a)&&"reset"===d.type},button:function(d){var a=d.nodeName.toLowerCase();return"input"===a&&"button"===d.type||"button"===a},input:function(d){return/input|select|textarea|button/i.test(d.nodeName)},
focus:function(d){return d===d.ownerDocument.activeElement}},setFilters:{first:function(d,a){return 0===a},last:function(d,a,b,c){return a===c.length-1},even:function(d,a){return 0===a%2},odd:function(d,a){return 1===a%2},lt:function(d,a,b){return a<b[3]-0},gt:function(d,a,b){return a>b[3]-0},nth:function(d,a,b){return b[3]-0===a},eq:function(d,a,b){return b[3]-0===a}},filter:{PSEUDO:function(d,a,b,c){var e=a[1],f=M.filters[e];if(f)return f(d,b,a,c);if("contains"===e)return 0<=(d.textContent||d.innerText||
eb([d])||"").indexOf(a[3]);if("not"===e){a=a[3];b=0;for(c=a.length;b<c;b++)if(a[b]===d)return!1;return!0}I.error(e)},CHILD:function(d,a){var b,c,e,f,g,j;b=a[1];j=d;switch(b){case "only":case "first":for(;j=j.previousSibling;)if(1===j.nodeType)return!1;if("first"===b)return!0;j=d;case "last":for(;j=j.nextSibling;)if(1===j.nodeType)return!1;return!0;case "nth":b=a[2];c=a[3];if(1===b&&0===c)return!0;e=a[0];if((f=d.parentNode)&&(f[cb]!==e||!d.nodeIndex)){g=0;for(j=f.firstChild;j;j=j.nextSibling)1===j.nodeType&&
(j.nodeIndex=++g);f[cb]=e}j=d.nodeIndex-c;return 0===b?0===j:0===j%b&&0<=j/b}},ID:function(d,a){return 1===d.nodeType&&d.getAttribute("id")===a},TAG:function(d,a){return"*"===a&&1===d.nodeType||!!d.nodeName&&d.nodeName.toLowerCase()===a},CLASS:function(d,a){return-1<(" "+(d.className||d.getAttribute("class"))+" ").indexOf(a)},ATTR:function(d,a){var b=a[1],b=I.attr?I.attr(d,b):M.attrHandle[b]?M.attrHandle[b](d):null!=d[b]?d[b]:d.getAttribute(b),c=b+"",e=a[2],f=a[4];return null==b?"!="===e:!e&&I.attr?
null!=b:"="===e?c===f:"*="===e?0<=c.indexOf(f):"~="===e?0<=(" "+c+" ").indexOf(f):!f?c&&!1!==b:"!="===e?c!==f:"^="===e?0===c.indexOf(f):"$="===e?c.substr(c.length-f.length)===f:"|="===e?c===f||c.substr(0,f.length+1)===f+"-":!1},POS:function(d,a,b,c){var e=M.setFilters[a[2]];if(e)return e(d,b,a,c)}}},Dc=M.match.POS,Aa=function(d,a){return"\\"+(a-0+1)},Ha;for(Ha in M.match)M.match[Ha]=RegExp(M.match[Ha].source+/(?![^\[]*\])(?![^\(]*\))/.source),M.leftMatch[Ha]=RegExp(/(^(?:.|\r|\n)*?)/.source+M.match[Ha].source.replace(/\\(\d+)/g,
Aa));M.match.globalPOS=Dc;var ra=function(d,a){d=Array.prototype.slice.call(d,0);return a?(a.push.apply(a,d),a):d};try{Array.prototype.slice.call(C.documentElement.childNodes,0)[0].nodeType}catch($d){ra=function(d,a){var b=0,c=a||[];if("[object Array]"===Cc.call(d))Array.prototype.push.apply(c,d);else if("number"===typeof d.length)for(var e=d.length;b<e;b++)c.push(d[b]);else for(;d[b];b++)c.push(d[b]);return c}}var tb,ub;C.documentElement.compareDocumentPosition?tb=function(d,a){return d===a?(sb=
!0,0):!d.compareDocumentPosition||!a.compareDocumentPosition?d.compareDocumentPosition?-1:1:d.compareDocumentPosition(a)&4?-1:1}:(tb=function(d,a){if(d===a)return sb=!0,0;if(d.sourceIndex&&a.sourceIndex)return d.sourceIndex-a.sourceIndex;var b,c,e=[],f=[];b=d.parentNode;c=a.parentNode;var g=b;if(b===c)return ub(d,a);if(b){if(!c)return 1}else return-1;for(;g;)e.unshift(g),g=g.parentNode;for(g=c;g;)f.unshift(g),g=g.parentNode;b=e.length;c=f.length;for(g=0;g<b&&g<c;g++)if(e[g]!==f[g])return ub(e[g],
f[g]);return g===b?ub(d,f[g],-1):ub(e[g],a,1)},ub=function(d,a,b){if(d===a)return b;for(d=d.nextSibling;d;){if(d===a)return-1;d=d.nextSibling}return 1});var vb=C.createElement("div"),ld="script"+(new Date).getTime(),Tb=C.documentElement;vb.innerHTML="<a name='"+ld+"'/>";Tb.insertBefore(vb,Tb.firstChild);C.getElementById(ld)&&(M.find.ID=function(d,a,b){if("undefined"!==typeof a.getElementById&&!b)return(a=a.getElementById(d[1]))?a.id===d[1]||"undefined"!==typeof a.getAttributeNode&&a.getAttributeNode("id").nodeValue===
d[1]?[a]:l:[]},M.filter.ID=function(d,a){var b="undefined"!==typeof d.getAttributeNode&&d.getAttributeNode("id");return 1===d.nodeType&&b&&b.nodeValue===a});Tb.removeChild(vb);var Tb=vb=null,Oa=C.createElement("div");Oa.appendChild(C.createComment(""));0<Oa.getElementsByTagName("*").length&&(M.find.TAG=function(d,a){var b=a.getElementsByTagName(d[1]);if("*"===d[1]){for(var c=[],e=0;b[e];e++)1===b[e].nodeType&&c.push(b[e]);b=c}return b});Oa.innerHTML="<a href='#'></a>";Oa.firstChild&&("undefined"!==
typeof Oa.firstChild.getAttribute&&"#"!==Oa.firstChild.getAttribute("href"))&&(M.attrHandle.href=function(d){return d.getAttribute("href",2)});Oa=null;if(C.querySelectorAll){var Ub=I,wb=C.createElement("div");wb.innerHTML="<p class='TEST'></p>";if(!(wb.querySelectorAll&&0===wb.querySelectorAll(".TEST").length)){var I=function(d,a,b,c){a=a||C;if(!c&&!I.isXML(a)){var e=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(d);if(e&&(1===a.nodeType||9===a.nodeType)){if(e[1])return ra(a.getElementsByTagName(d),b);
if(e[2]&&M.find.CLASS&&a.getElementsByClassName)return ra(a.getElementsByClassName(e[2]),b)}if(9===a.nodeType){if("body"===d&&a.body)return ra([a.body],b);if(e&&e[3]){var f=a.getElementById(e[3]);if(f&&f.parentNode){if(f.id===e[3])return ra([f],b)}else return ra([],b)}try{return ra(a.querySelectorAll(d),b)}catch(g){}}else if(1===a.nodeType&&"object"!==a.nodeName.toLowerCase()){var e=a,j=(f=a.getAttribute("id"))||"__sizzle__",m=a.parentNode,p=/^\s*[+~]/.test(d);f?j=j.replace(/'/g,"\\$&"):a.setAttribute("id",
j);p&&m&&(a=a.parentNode);try{if(!p||m)return ra(a.querySelectorAll("[id='"+j+"'] "+d),b)}catch(t){}finally{f||e.removeAttribute("id")}}}return Ub(d,a,b,c)},Fc;for(Fc in Ub)I[Fc]=Ub[Fc];wb=null}}var Vb=C.documentElement,xb=Vb.matchesSelector||Vb.mozMatchesSelector||Vb.webkitMatchesSelector||Vb.msMatchesSelector;if(xb){var ae=!xb.call(C.createElement("div"),"div"),md=!1;try{xb.call(C.documentElement,"[test!='']:sizzle")}catch(Pe){md=!0}I.matchesSelector=function(d,a){a=a.replace(/\=\s*([^'"\]]*)\s*\]/g,
"='$1']");if(!I.isXML(d))try{if(md||!M.match.PSEUDO.test(a)&&!/!=/.test(a)){var b=xb.call(d,a);if(b||!ae||d.document&&11!==d.document.nodeType)return b}}catch(c){}return 0<I(a,null,null,[d]).length}}var fb=C.createElement("div");fb.innerHTML="<div class='test e'></div><div class='test'></div>";fb.getElementsByClassName&&0!==fb.getElementsByClassName("e").length&&(fb.lastChild.className="e",1!==fb.getElementsByClassName("e").length&&(M.order.splice(1,0,"CLASS"),M.find.CLASS=function(d,a,b){if("undefined"!==
typeof a.getElementsByClassName&&!b)return a.getElementsByClassName(d[1])},fb=null));I.contains=C.documentElement.contains?function(d,a){return d!==a&&(d.contains?d.contains(a):!0)}:C.documentElement.compareDocumentPosition?function(d,a){return!!(d.compareDocumentPosition(a)&16)}:function(){return!1};I.isXML=function(d){return(d=(d?d.ownerDocument||d:0).documentElement)?"HTML"!==d.nodeName:!1};var Ec=function(d,a,b){var c,e=[],f="";for(a=a.nodeType?[a]:a;c=M.match.PSEUDO.exec(d);)f+=c[0],d=d.replace(M.match.PSEUDO,
"");d=M.relative[d]?d+"*":d;c=0;for(var g=a.length;c<g;c++)I(d,a[c],e,b);return I.filter(f,e)};I.attr=f.attr;I.selectors.attrMap={};f.find=I;f.expr=I.selectors;f.expr[":"]=f.expr.filters;f.unique=I.uniqueSort;f.text=I.getText;f.isXMLDoc=I.isXML;f.contains=I.contains;var be=/Until$/,ce=/^(?:parents|prevUntil|prevAll)/,de=/,/,Wd=/^.[^:#\[\.,]*$/,ee=Array.prototype.slice,Wb=f.expr.match.globalPOS,Gc={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(d){var a=this,b,c;if("string"!==
typeof d)return f(d).filter(function(){b=0;for(c=a.length;b<c;b++)if(f.contains(a[b],this))return!0});var e=this.pushStack("","find",d),g,j,m;b=0;for(c=this.length;b<c;b++)if(g=e.length,f.find(d,this[b],e),0<b)for(j=g;j<e.length;j++)for(m=0;m<g;m++)if(e[m]===e[j]){e.splice(j--,1);break}return e},has:function(d){var a=f(d);return this.filter(function(){for(var d=0,b=a.length;d<b;d++)if(f.contains(this,a[d]))return!0})},not:function(d){return this.pushStack(w(this,d,!1),"not",d)},filter:function(d){return this.pushStack(w(this,
d,!0),"filter",d)},is:function(d){return!!d&&("string"===typeof d?Wb.test(d)?0<=f(d,this.context).index(this[0]):0<f.filter(d,this).length:0<this.filter(d).length)},closest:function(d,a){var b=[],c,e,g=this[0];if(f.isArray(d)){for(e=1;g&&g.ownerDocument&&g!==a;){for(c=0;c<d.length;c++)f(g).is(d[c])&&b.push({selector:d[c],elem:g,level:e});g=g.parentNode;e++}return b}var j=Wb.test(d)||"string"!==typeof d?f(d,a||this.context):0;c=0;for(e=this.length;c<e;c++)for(g=this[c];g;)if(j?-1<j.index(g):f.find.matchesSelector(g,
d)){b.push(g);break}else if(g=g.parentNode,!g||!g.ownerDocument||g===a||11===g.nodeType)break;b=1<b.length?f.unique(b):b;return this.pushStack(b,"closest",d)},index:function(d){return!d?this[0]&&this[0].parentNode?this.prevAll().length:-1:"string"===typeof d?f.inArray(this[0],f(d)):f.inArray(d.jquery?d[0]:d,this)},add:function(d,a){var b="string"===typeof d?f(d,a):f.makeArray(d&&d.nodeType?[d]:d),c=f.merge(this.get(),b);return this.pushStack(!b[0]||!b[0].parentNode||11===b[0].parentNode.nodeType||
!c[0]||!c[0].parentNode||11===c[0].parentNode.nodeType?c:f.unique(c))},andSelf:function(){return this.add(this.prevObject)}});f.each({parent:function(d){return(d=d.parentNode)&&11!==d.nodeType?d:null},parents:function(d){return f.dir(d,"parentNode")},parentsUntil:function(d,a,b){return f.dir(d,"parentNode",b)},next:function(d){return f.nth(d,2,"nextSibling")},prev:function(d){return f.nth(d,2,"previousSibling")},nextAll:function(d){return f.dir(d,"nextSibling")},prevAll:function(d){return f.dir(d,
"previousSibling")},nextUntil:function(d,a,b){return f.dir(d,"nextSibling",b)},prevUntil:function(d,a,b){return f.dir(d,"previousSibling",b)},siblings:function(d){return f.sibling((d.parentNode||{}).firstChild,d)},children:function(d){return f.sibling(d.firstChild)},contents:function(d){return f.nodeName(d,"iframe")?d.contentDocument||d.contentWindow.document:f.makeArray(d.childNodes)}},function(d,a){f.fn[d]=function(b,c){var e=f.map(this,a,b);be.test(d)||(c=b);c&&"string"===typeof c&&(e=f.filter(c,
e));e=1<this.length&&!Gc[d]?f.unique(e):e;if((1<this.length||de.test(c))&&ce.test(d))e=e.reverse();return this.pushStack(e,d,ee.call(arguments).join(","))}});f.extend({filter:function(d,a,b){b&&(d=":not("+d+")");return 1===a.length?f.find.matchesSelector(a[0],d)?[a[0]]:[]:f.find.matches(d,a)},dir:function(d,a,b){var c=[];for(d=d[a];d&&9!==d.nodeType&&(b===l||1!==d.nodeType||!f(d).is(b));)1===d.nodeType&&c.push(d),d=d[a];return c},nth:function(d,a,b){a=a||1;for(var c=0;d&&!(1===d.nodeType&&++c===a);d=
d[b]);return d},sibling:function(d,a){for(var b=[];d;d=d.nextSibling)1===d.nodeType&&d!==a&&b.push(d);return b}});var ad="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fe=/ jQuery\d+="(?:\d+|null)"/g,Hc=/^\s+/,nd=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ic=/<([\w:]+)/,ge=/<tbody/i,yb=/<|&#?\w+;/,he=/<(?:script|style)/i,ie=/<(?:script|object|embed|option|style)/i,
od=RegExp("<(?:"+ad+")[\\s/>]","i"),pd=/checked\s*(?:[^=]|=\s*.checked.)/i,qd=/\/(java|ecma)script/i,Jc=/^\s*<!(?:\[CDATA\[|\-\-)/,la={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Xb=E(C);la.optgroup=la.option;la.tbody=
la.tfoot=la.colgroup=la.caption=la.thead;la.th=la.td;f.support.htmlSerialize||(la._default=[1,"div<div>","</div>"]);f.fn.extend({text:function(d){return f.access(this,function(d){return d===l?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||C).createTextNode(d))},null,d,arguments.length)},wrapAll:function(d){if(f.isFunction(d))return this.each(function(a){f(this).wrapAll(d.call(this,a))});if(this[0]){var a=f(d,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&a.insertBefore(this[0]);
a.map(function(){for(var d=this;d.firstChild&&1===d.firstChild.nodeType;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(d){return f.isFunction(d)?this.each(function(a){f(this).wrapInner(d.call(this,a))}):this.each(function(){var a=f(this),b=a.contents();b.length?b.wrapAll(d):a.append(d)})},wrap:function(d){var a=f.isFunction(d);return this.each(function(b){f(this).wrapAll(a?d.call(this,b):d)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||
f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(d){1===this.nodeType&&this.appendChild(d)})},prepend:function(){return this.domManip(arguments,!0,function(d){1===this.nodeType&&this.insertBefore(d,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(d){this.parentNode.insertBefore(d,this)});if(arguments.length){var d=f.clean(arguments);d.push.apply(d,this.toArray());return this.pushStack(d,
"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(d){this.parentNode.insertBefore(d,this.nextSibling)});if(arguments.length){var d=this.pushStack(this,"after",arguments);d.push.apply(d,f.clean(arguments));return d}},remove:function(d,a){for(var b=0,c;null!=(c=this[b]);b++)if(!d||f.filter(d,[c]).length)!a&&1===c.nodeType&&(f.cleanData(c.getElementsByTagName("*")),f.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},
empty:function(){for(var d=0,a;null!=(a=this[d]);d++)for(1===a.nodeType&&f.cleanData(a.getElementsByTagName("*"));a.firstChild;)a.removeChild(a.firstChild);return this},clone:function(d,a){d=null==d?!1:d;a=null==a?d:a;return this.map(function(){return f.clone(this,d,a)})},html:function(d){return f.access(this,function(d){var a=this[0]||{},b=0,c=this.length;if(d===l)return 1===a.nodeType?a.innerHTML.replace(fe,""):null;if("string"===typeof d&&!he.test(d)&&(f.support.leadingWhitespace||!Hc.test(d))&&
!la[(Ic.exec(d)||["",""])[1].toLowerCase()]){d=d.replace(nd,"<$1></$2>");try{for(;b<c;b++)a=this[b]||{},1===a.nodeType&&(f.cleanData(a.getElementsByTagName("*")),a.innerHTML=d);a=0}catch(e){}}a&&this.empty().append(d)},null,d,arguments.length)},replaceWith:function(d){if(this[0]&&this[0].parentNode){if(f.isFunction(d))return this.each(function(a){var b=f(this),c=b.html();b.replaceWith(d.call(this,a,c))});"string"!==typeof d&&(d=f(d).detach());return this.each(function(){var a=this.nextSibling,b=this.parentNode;
f(this).remove();a?f(a).before(d):f(b).append(d)})}return this.length?this.pushStack(f(f.isFunction(d)?d():d),"replaceWith",d):this},detach:function(d){return this.remove(d,!0)},domManip:function(d,a,b){var c,e,g,j=d[0],m=[];if(!f.support.checkClone&&3===arguments.length&&"string"===typeof j&&pd.test(j))return this.each(function(){f(this).domManip(d,a,b,!0)});if(f.isFunction(j))return this.each(function(c){var e=f(this);d[0]=j.call(this,c,a?e.html():l);e.domManip(d,a,b)});if(this[0]){c=j&&j.parentNode;
c=f.support.parentNode&&c&&11===c.nodeType&&c.childNodes.length===this.length?{fragment:c}:f.buildFragment(d,this,m);g=c.fragment;if(e=1===g.childNodes.length?g=g.firstChild:g.firstChild){a=a&&f.nodeName(e,"tr");e=0;for(var p=this.length,t=p-1;e<p;e++)b.call(a?f.nodeName(this[e],"table")?this[e].getElementsByTagName("tbody")[0]||this[e].appendChild(this[e].ownerDocument.createElement("tbody")):this[e]:this[e],c.cacheable||1<p&&e<t?f.clone(g,!0,!0):g)}m.length&&f.each(m,function(d,a){a.src?f.ajax({type:"GET",
global:!1,url:a.src,async:!1,dataType:"script"}):f.globalEval((a.text||a.textContent||a.innerHTML||"").replace(Jc,"/*$0*/"));a.parentNode&&a.parentNode.removeChild(a)})}return this}});f.buildFragment=function(d,a,b){var c,e,g,j,m=d[0];a&&a[0]&&(j=a[0].ownerDocument||a[0]);j.createDocumentFragment||(j=C);if(1===d.length&&"string"===typeof m&&512>m.length&&j===C&&"<"===m.charAt(0)&&!ie.test(m)&&(f.support.checkClone||!pd.test(m))&&(f.support.html5Clone||!od.test(m)))e=!0,(g=f.fragments[m])&&1!==g&&
(c=g);c||(c=j.createDocumentFragment(),f.clean(d,j,c,b));e&&(f.fragments[m]=g?c:1);return{fragment:c,cacheable:e}};f.fragments={};f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(d,a){f.fn[d]=function(b){var c=[];b=f(b);var e=1===this.length&&this[0].parentNode;if(e&&11===e.nodeType&&1===e.childNodes.length&&1===b.length)return b[a](this[0]),this;for(var e=0,g=b.length;e<g;e++){var j=(0<e?this.clone(!0):this).get();f(b[e])[a](j);
c=c.concat(j)}return this.pushStack(c,d,b.selector)}});f.extend({clone:function(d,a,b){var c,e,g;f.support.html5Clone||f.isXMLDoc(d)||!od.test("<"+d.nodeName+">")?c=d.cloneNode(!0):(c=C.createElement("div"),Xb.appendChild(c),c.innerHTML=d.outerHTML,c=c.firstChild);var j=c;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(1===d.nodeType||11===d.nodeType)&&!f.isXMLDoc(d)){R(d,j);c=J(d);e=J(j);for(g=0;c[g];++g)e[g]&&R(c[g],e[g])}if(a&&(P(d,j),b)){c=J(d);e=J(j);for(g=0;c[g];++g)P(c[g],e[g])}return j},
clean:function(d,a,b,c){var e,g=[];a=a||C;"undefined"===typeof a.createElement&&(a=a.ownerDocument||a[0]&&a[0].ownerDocument||C);for(var j=0,m;null!=(m=d[j]);j++)if("number"===typeof m&&(m+=""),m){if("string"===typeof m)if(yb.test(m)){m=m.replace(nd,"<$1></$2>");e=(Ic.exec(m)||["",""])[1].toLowerCase();var p=la[e]||la._default,t=p[0],s=a.createElement("div"),v=Xb.childNodes;a===C?Xb.appendChild(s):E(a).appendChild(s);for(s.innerHTML=p[1]+m+p[2];t--;)s=s.lastChild;if(!f.support.tbody){t=ge.test(m);
p="table"===e&&!t?s.firstChild&&s.firstChild.childNodes:"<table>"===p[1]&&!t?s.childNodes:[];for(e=p.length-1;0<=e;--e)f.nodeName(p[e],"tbody")&&!p[e].childNodes.length&&p[e].parentNode.removeChild(p[e])}!f.support.leadingWhitespace&&Hc.test(m)&&s.insertBefore(a.createTextNode(Hc.exec(m)[0]),s.firstChild);m=s.childNodes;s&&(s.parentNode.removeChild(s),0<v.length&&(s=v[v.length-1])&&s.parentNode&&s.parentNode.removeChild(s))}else m=a.createTextNode(m);var L;if(!f.support.appendChecked)if(m[0]&&"number"===
typeof(L=m.length))for(e=0;e<L;e++)T(m[e]);else T(m);m.nodeType?g.push(m):g=f.merge(g,m)}if(b){d=function(d){return!d.type||qd.test(d.type)};for(j=0;g[j];j++)a=g[j],c&&f.nodeName(a,"script")&&(!a.type||qd.test(a.type))?c.push(a.parentNode?a.parentNode.removeChild(a):a):(1===a.nodeType&&(m=f.grep(a.getElementsByTagName("script"),d),g.splice.apply(g,[j+1,0].concat(m))),b.appendChild(a))}return g},cleanData:function(d){for(var a,b,c=f.cache,e=f.event.special,g=f.support.deleteExpando,j=0,m;null!=(m=
d[j]);j++)if(!m.nodeName||!f.noData[m.nodeName.toLowerCase()])if(b=m[f.expando]){if((a=c[b])&&a.events){for(var p in a.events)e[p]?f.event.remove(m,p):f.removeEvent(m,p,a.handle);a.handle&&(a.handle.elem=null)}g?delete m[f.expando]:m.removeAttribute&&m.removeAttribute(f.expando);delete c[b]}}});var Kc=/alpha\([^)]*\)/i,je=/opacity=([^)]*)/,rd=/([A-Z]|^ms)/g,sd=/^[\-+]?(?:\d*\.)?\d+$/i,Eb=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,td=/^([\-+])=([\-+.\de]+)/,ud=/^margin/,Lc={position:"absolute",visibility:"hidden",
display:"block"},Ba=["Top","Right","Bottom","Left"],Ca,vd,wd;f.fn.css=function(d,a){return f.access(this,function(d,a,b){return b!==l?f.style(d,a,b):f.css(d,a)},d,a,1<arguments.length)};f.extend({cssHooks:{opacity:{get:function(d,a){if(a){var b=Ca(d,"opacity");return""===b?"1":b}return d.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(d,a,b,c){if(d&&
!(3===d.nodeType||8===d.nodeType||!d.style)){var e,g=f.camelCase(a),j=d.style,m=f.cssHooks[g];a=f.cssProps[g]||g;if(b!==l){c=typeof b;if("string"===c&&(e=td.exec(b)))b=+(e[1]+1)*+e[2]+parseFloat(f.css(d,a)),c="number";if(!(null==b||"number"===c&&isNaN(b)))if("number"===c&&!f.cssNumber[g]&&(b+="px"),!m||!("set"in m)||(b=m.set(d,b))!==l)try{j[a]=b}catch(p){}}else return m&&"get"in m&&(e=m.get(d,!1,c))!==l?e:j[a]}},css:function(d,a,b){var c,e;a=f.camelCase(a);e=f.cssHooks[a];a=f.cssProps[a]||a;"cssFloat"===
a&&(a="float");if(e&&"get"in e&&(c=e.get(d,!0,b))!==l)return c;if(Ca)return Ca(d,a)},swap:function(d,a,b){var c={},e;for(e in a)c[e]=d.style[e],d.style[e]=a[e];b=b.call(d);for(e in a)d.style[e]=c[e];return b}});f.curCSS=f.css;C.defaultView&&C.defaultView.getComputedStyle&&(vd=function(d,a){var b,c,e,g=d.style;a=a.replace(rd,"-$1").toLowerCase();if((c=d.ownerDocument.defaultView)&&(e=c.getComputedStyle(d,null)))b=e.getPropertyValue(a),""===b&&!f.contains(d.ownerDocument.documentElement,d)&&(b=f.style(d,
a));!f.support.pixelMargin&&(e&&ud.test(a)&&Eb.test(b))&&(c=g.width,g.width=b,b=e.width,g.width=c);return b});C.documentElement.currentStyle&&(wd=function(d,a){var b,c,e=d.currentStyle&&d.currentStyle[a],f=d.style;if(null==e&&f&&(b=f[a]))e=b;if(Eb.test(e)){b=f.left;if(c=d.runtimeStyle&&d.runtimeStyle.left)d.runtimeStyle.left=d.currentStyle.left;f.left="fontSize"===a?"1em":e;e=f.pixelLeft+"px";f.left=b;c&&(d.runtimeStyle.left=c)}return""===e?"auto":e});Ca=vd||wd;f.each(["height","width"],function(d,
a){f.cssHooks[a]={get:function(d,b,c){if(b)return 0!==d.offsetWidth?v(d,a,c):f.swap(d,Lc,function(){return v(d,a,c)})},set:function(d,a){return sd.test(a)?a+"px":a}}});f.support.opacity||(f.cssHooks.opacity={get:function(d,a){return je.test((a&&d.currentStyle?d.currentStyle.filter:d.style.filter)||"")?parseFloat(RegExp.$1)/100+"":a?"1":""},set:function(d,a){var b=d.style,c=d.currentStyle,e=f.isNumeric(a)?"alpha(opacity="+100*a+")":"",g=c&&c.filter||b.filter||"";b.zoom=1;if(1<=a&&""===f.trim(g.replace(Kc,
""))&&(b.removeAttribute("filter"),c&&!c.filter))return;b.filter=Kc.test(g)?g.replace(Kc,e):g+" "+e}});f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(d,a){return f.swap(d,{display:"inline-block"},function(){return a?Ca(d,"margin-right"):d.style.marginRight})}})});f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(d){var a=d.offsetHeight;return 0===d.offsetWidth&&0===a||!f.support.reliableHiddenOffsets&&"none"===(d.style&&d.style.display||f.css(d,"display"))},
f.expr.filters.visible=function(d){return!f.expr.filters.hidden(d)});f.each({margin:"",padding:"",border:"Width"},function(d,a){f.cssHooks[d+a]={expand:function(b){var c="string"===typeof b?b.split(" "):[b],e={};for(b=0;4>b;b++)e[d+Ba[b]+a]=c[b]||c[b-2]||c[0];return e}}});var ke=/%20/g,Da=/\[\]$/,Yb=/\r?\n/g,xd=/#.*$/,yd=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Zb=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Mc=/^(?:GET|HEAD)$/,zd=/^\/\//,
Nc=/\?/,Oc=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,$b=/^(?:select|textarea)/i,lb=/\s+/,Ad=/([?&])_=[^&]*/,Pc=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Qc=f.fn.load,Fb={},Rc={},Pa,Xa,ac=["*/"]+["*"];try{Pa=ua.href}catch(Bd){Pa=C.createElement("a"),Pa.href="",Pa=Pa.href}Xa=Pc.exec(Pa.toLowerCase())||[];f.fn.extend({load:function(d,a,b){if("string"!==typeof d&&Qc)return Qc.apply(this,arguments);if(!this.length)return this;var c=d.indexOf(" ");if(0<=c){var e=d.slice(c,d.length);d=
d.slice(0,c)}c="GET";a&&(f.isFunction(a)?(b=a,a=l):"object"===typeof a&&(a=f.param(a,f.ajaxSettings.traditional),c="POST"));var g=this;f.ajax({url:d,type:c,dataType:"html",data:a,complete:function(d,a,c){c=d.responseText;d.isResolved()&&(d.done(function(d){c=d}),g.html(e?f("<div>").append(c.replace(Oc,"")).find(e):c));b&&g.each(b,[c,a,d])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):
this}).filter(function(){return this.name&&!this.disabled&&(this.checked||$b.test(this.nodeName)||Zb.test(this.type))}).map(function(d,a){var b=f(this).val();return null==b?null:f.isArray(b)?f.map(b,function(d){return{name:a.name,value:d.replace(Yb,"\r\n")}}):{name:a.name,value:b.replace(Yb,"\r\n")}}).get()}});f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(d,a){f.fn[a]=function(d){return this.on(a,d)}});f.each(["get","post"],function(d,a){f[a]=function(d,
b,c,e){f.isFunction(b)&&(e=e||c,c=b,b=l);return f.ajax({type:a,url:d,data:b,success:c,dataType:e})}});f.extend({getScript:function(d,a){return f.get(d,l,a,"script")},getJSON:function(d,a,b){return f.get(d,a,b,"json")},ajaxSetup:function(d,a){a?p(d,f.ajaxSettings):(a=d,d=f.ajaxSettings);p(d,a);return d},ajaxSettings:{url:Pa,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(Xa[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,
async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":ac},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":b.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:e(Fb),ajaxTransport:e(Rc),ajax:function(d,b){function c(d,a,b,n){if(2!==q){q=2;ta&&clearTimeout(ta);h=l;k=n||"";B.readyState=0<d?
4:0;var v,L,y;n=a;if(b){var r=e,S=B,va=r.contents,A=r.dataTypes,w=r.responseFields,C,N,ja,ga;for(N in w)N in b&&(S[w[N]]=b[N]);for(;"*"===A[0];)A.shift(),C===l&&(C=r.mimeType||S.getResponseHeader("content-type"));if(C)for(N in va)if(va[N]&&va[N].test(C)){A.unshift(N);break}if(A[0]in b)ja=A[0];else{for(N in b){if(!A[0]||r.converters[N+" "+A[0]]){ja=N;break}ga||(ga=N)}ja=ja||ga}ja?(ja!==A[0]&&A.unshift(ja),b=b[ja]):b=void 0}else b=l;if(200<=d&&300>d||304===d){if(e.ifModified){if(C=B.getResponseHeader("Last-Modified"))f.lastModified[t]=
C;if(C=B.getResponseHeader("Etag"))f.etag[t]=C}if(304===d)n="notmodified",v=!0;else try{C=e;C.dataFilter&&(b=C.dataFilter(b,C.dataType));var xa=C.dataTypes;N={};var ua,U,E=xa.length,La,ka=xa[0],I,K,P,ya,J;for(ua=1;ua<E;ua++){if(1===ua)for(U in C.converters)"string"===typeof U&&(N[U.toLowerCase()]=C.converters[U]);I=ka;ka=xa[ua];if("*"===ka)ka=I;else if("*"!==I&&I!==ka){K=I+" "+ka;P=N[K]||N["* "+ka];if(!P)for(ya in J=l,N)if(La=ya.split(" "),La[0]===I||"*"===La[0])if(J=N[La[1]+" "+ka]){ya=N[ya];!0===
ya?P=J:!0===J&&(P=ya);break}!P&&!J&&f.error("No conversion from "+K.replace(" "," to "));!0!==P&&(b=P?P(b):J(ya(b)))}}L=b;n="success";v=!0}catch(M){n="parsererror",y=M}}else if(y=n,!n||d)n="error",0>d&&(d=0);B.status=d;B.statusText=""+(a||n);v?m.resolveWith(g,[L,n,B]):m.rejectWith(g,[B,n,y]);B.statusCode(s);s=l;D&&j.trigger("ajax"+(v?"Success":"Error"),[B,e,v?L:y]);p.fireWith(g,[B,n]);D&&(j.trigger("ajaxComplete",[B,e]),--f.active||f.event.trigger("ajaxStop"))}}"object"===typeof d&&(b=d,d=l);b=b||
{};var e=f.ajaxSetup({},b),g=e.context||e,j=g!==e&&(g.nodeType||g instanceof f)?f(g):f.event,m=f.Deferred(),p=f.Callbacks("once memory"),s=e.statusCode||{},t,v={},L={},k,y,h,ta,r,q=0,D,S,B={readyState:0,setRequestHeader:function(d,a){if(!q){var b=d.toLowerCase();d=L[b]=L[b]||d;v[d]=a}return this},getAllResponseHeaders:function(){return 2===q?k:null},getResponseHeader:function(d){var a;if(2===q){if(!y)for(y={};a=yd.exec(k);)y[a[1].toLowerCase()]=a[2];a=y[d.toLowerCase()]}return a===l?null:a},overrideMimeType:function(d){q||
(e.mimeType=d);return this},abort:function(d){d=d||"abort";h&&h.abort(d);c(0,d);return this}};m.promise(B);B.success=B.done;B.error=B.fail;B.complete=p.add;B.statusCode=function(d){if(d){var a;if(2>q)for(a in d)s[a]=[s[a],d[a]];else a=d[B.status],B.then(a,a)}return this};e.url=((d||e.url)+"").replace(xd,"").replace(zd,Xa[1]+"//");e.dataTypes=f.trim(e.dataType||"*").toLowerCase().split(lb);null==e.crossDomain&&(r=Pc.exec(e.url.toLowerCase()),e.crossDomain=!(!r||!(r[1]!=Xa[1]||r[2]!=Xa[2]||(r[3]||("http:"===
r[1]?80:443))!=(Xa[3]||("http:"===Xa[1]?80:443)))));e.data&&(e.processData&&"string"!==typeof e.data)&&(e.data=f.param(e.data,e.traditional));a(Fb,e,b,B);if(2===q)return!1;D=e.global;e.type=e.type.toUpperCase();e.hasContent=!Mc.test(e.type);D&&0===f.active++&&f.event.trigger("ajaxStart");if(!e.hasContent&&(e.data&&(e.url+=(Nc.test(e.url)?"&":"?")+e.data,delete e.data),t=e.url,!1===e.cache)){r=f.now();var va=e.url.replace(Ad,"$1_="+r);e.url=va+(va===e.url?(Nc.test(e.url)?"&":"?")+"_="+r:"")}(e.data&&
e.hasContent&&!1!==e.contentType||b.contentType)&&B.setRequestHeader("Content-Type",e.contentType);e.ifModified&&(t=t||e.url,f.lastModified[t]&&B.setRequestHeader("If-Modified-Since",f.lastModified[t]),f.etag[t]&&B.setRequestHeader("If-None-Match",f.etag[t]));B.setRequestHeader("Accept",e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+("*"!==e.dataTypes[0]?", "+ac+"; q=0.01":""):e.accepts["*"]);for(S in e.headers)B.setRequestHeader(S,e.headers[S]);if(e.beforeSend&&(!1===e.beforeSend.call(g,
B,e)||2===q))return B.abort(),!1;for(S in{success:1,error:1,complete:1})B[S](e[S]);if(h=a(Rc,e,b,B)){B.readyState=1;D&&j.trigger("ajaxSend",[B,e]);e.async&&0<e.timeout&&(ta=setTimeout(function(){B.abort("timeout")},e.timeout));try{q=1,h.send(v,c)}catch(w){if(2>q)c(-1,w);else throw w;}}else c(-1,"No Transport");return B},param:function(d,a){var b=[],c=function(d,a){a=f.isFunction(a)?a():a;b[b.length]=encodeURIComponent(d)+"="+encodeURIComponent(a)};a===l&&(a=f.ajaxSettings.traditional);if(f.isArray(d)||
d.jquery&&!f.isPlainObject(d))f.each(d,function(){c(this.name,this.value)});else for(var e in d)m(e,d[e],a,c);return b.join("&").replace(ke,"+")}});f.extend({active:0,lastModified:{},etag:{}});var Tc=f.now(),Ab=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+Tc++}});f.ajaxPrefilter("json jsonp",function(d,a,c){a="string"===typeof d.data&&/^application\/x\-www\-form\-urlencoded/.test(d.contentType);if("jsonp"===d.dataTypes[0]||!1!==d.jsonp&&(Ab.test(d.url)||
a&&Ab.test(d.data))){var e,g=d.jsonpCallback=f.isFunction(d.jsonpCallback)?d.jsonpCallback():d.jsonpCallback,j=b[g],m=d.url,p=d.data,t="$1"+g+"$2";!1!==d.jsonp&&(m=m.replace(Ab,t),d.url===m&&(a&&(p=p.replace(Ab,t)),d.data===p&&(m+=(/\?/.test(m)?"&":"?")+d.jsonp+"="+g)));d.url=m;d.data=p;b[g]=function(d){e=[d]};c.always(function(){b[g]=j;if(e&&f.isFunction(j))b[g](e[0])});d.converters["script json"]=function(){e||f.error(g+" was not called");return e[0]};d.dataTypes[0]="json";return"script"}});f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},
contents:{script:/javascript|ecmascript/},converters:{"text script":function(d){f.globalEval(d);return d}}});f.ajaxPrefilter("script",function(d){d.cache===l&&(d.cache=!1);d.crossDomain&&(d.type="GET",d.global=!1)});f.ajaxTransport("script",function(d){if(d.crossDomain){var a,b=C.head||C.getElementsByTagName("head")[0]||C.documentElement;return{send:function(c,e){a=C.createElement("script");a.async="async";d.scriptCharset&&(a.charset=d.scriptCharset);a.src=d.url;a.onload=a.onreadystatechange=function(d,
c){if(c||!a.readyState||/loaded|complete/.test(a.readyState))a.onload=a.onreadystatechange=null,b&&a.parentNode&&b.removeChild(a),a=l,c||e(200,"success")};b.insertBefore(a,b.firstChild)},abort:function(){if(a)a.onload(0,1)}}}});var bc=b.ActiveXObject?function(){for(var d in hb)hb[d](0,1)}:!1,Ed=0,hb;f.ajaxSettings.xhr=b.ActiveXObject?function(){var d;if(!(d=!this.isLocal&&j()))a:{try{d=new b.ActiveXObject("Microsoft.XMLHTTP");break a}catch(a){}d=void 0}return d}:j;var Uc=f.ajaxSettings.xhr();f.extend(f.support,
{ajax:!!Uc,cors:!!Uc&&"withCredentials"in Uc});f.support.ajax&&f.ajaxTransport(function(d){if(!d.crossDomain||f.support.cors){var a;return{send:function(c,e){var g=d.xhr(),j,m;d.username?g.open(d.type,d.url,d.async,d.username,d.password):g.open(d.type,d.url,d.async);if(d.xhrFields)for(m in d.xhrFields)g[m]=d.xhrFields[m];d.mimeType&&g.overrideMimeType&&g.overrideMimeType(d.mimeType);!d.crossDomain&&!c["X-Requested-With"]&&(c["X-Requested-With"]="XMLHttpRequest");try{for(m in c)g.setRequestHeader(m,
c[m])}catch(p){}g.send(d.hasContent&&d.data||null);a=function(b,c){var m,p,t,s,v;try{if(a&&(c||4===g.readyState))if(a=l,j&&(g.onreadystatechange=f.noop,bc&&delete hb[j]),c)4!==g.readyState&&g.abort();else{m=g.status;t=g.getAllResponseHeaders();s={};if((v=g.responseXML)&&v.documentElement)s.xml=v;try{s.text=g.responseText}catch(L){}try{p=g.statusText}catch(k){p=""}!m&&d.isLocal&&!d.crossDomain?m=s.text?200:404:1223===m&&(m=204)}}catch(y){c||e(-1,y)}s&&e(m,p,s,t)};!d.async||4===g.readyState?a():(j=
++Ed,bc&&(hb||(hb={},f(b).unload(bc)),hb[j]=a),g.onreadystatechange=a)},abort:function(){a&&a(0,1)}}}});var Ib={},sa,Ea,Vc=/^(?:toggle|show|hide)$/,Fd=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cc,Hb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],Gb;f.fn.extend({show:function(d,a,b){if(d||0===d)return this.animate(S("show",3),d,a,b);b=0;for(var c=this.length;b<c;b++)d=this[b],d.style&&(a=d.style.display,!f._data(d,
"olddisplay")&&"none"===a&&(a=d.style.display=""),(""===a&&"none"===f.css(d,"display")||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",ja(d.nodeName)));for(b=0;b<c;b++)if(d=this[b],d.style&&(a=d.style.display,""===a||"none"===a))d.style.display=f._data(d,"olddisplay")||"";return this},hide:function(d,a,b){if(d||0===d)return this.animate(S("hide",3),d,a,b);b=0;for(var c=this.length;b<c;b++)d=this[b],d.style&&(a=f.css(d,"display"),"none"!==a&&!f._data(d,"olddisplay")&&f._data(d,
"olddisplay",a));for(b=0;b<c;b++)this[b].style&&(this[b].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(d,a,b){var c="boolean"===typeof d;f.isFunction(d)&&f.isFunction(a)?this._toggle.apply(this,arguments):null==d||c?this.each(function(){var a=c?d:f(this).is(":hidden");f(this)[a?"show":"hide"]()}):this.animate(S("toggle",3),d,a,b);return this},fadeTo:function(d,a,b,c){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:a},d,b,c)},animate:function(d,
a,b,c){function e(){!1===g.queue&&f._mark(this);var a=f.extend({},g),b=1===this.nodeType,c=b&&f(this).is(":hidden"),j,m,n,p,t;a.animatedProperties={};for(n in d)if(j=f.camelCase(n),n!==j&&(d[j]=d[n],delete d[n]),(m=f.cssHooks[j])&&"expand"in m)for(n in p=m.expand(d[j]),delete d[j],p)n in d||(d[n]=p[n]);for(j in d){m=d[j];f.isArray(m)?(a.animatedProperties[j]=m[1],m=d[j]=m[0]):a.animatedProperties[j]=a.specialEasing&&a.specialEasing[j]||a.easing||"swing";if("hide"===m&&c||"show"===m&&!c)return a.complete.call(this);
if(b&&("height"===j||"width"===j))a.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],"inline"===f.css(this,"display")&&"none"===f.css(this,"float")&&(!f.support.inlineBlockNeedsLayout||"inline"===ja(this.nodeName)?this.style.display="inline-block":this.style.zoom=1)}null!=a.overflow&&(this.style.overflow="hidden");for(n in d)if(b=new f.fx(this,a,n),m=d[n],Vc.test(m))if(j=f._data(this,"toggle"+n)||("toggle"===m?c?"show":"hide":0))f._data(this,"toggle"+n,"show"===j?"hide":"show"),
b[j]();else b[m]();else j=Fd.exec(m),p=b.cur(),j?(m=parseFloat(j[2]),t=j[3]||(f.cssNumber[n]?"":"px"),"px"!==t&&(f.style(this,n,(m||1)+t),p*=(m||1)/b.cur(),f.style(this,n,p+t)),j[1]&&(m=("-="===j[1]?-1:1)*m+p),b.custom(p,m,t)):b.custom(p,m,"");return!0}var g=f.speed(a,b,c);if(f.isEmptyObject(d))return this.each(g.complete,[!1]);d=f.extend({},d);return!1===g.queue?this.each(e):this.queue(g.queue,e)},stop:function(a,b,c){"string"!==typeof a&&(c=b,b=a,a=l);b&&!1!==a&&this.queue(a||"fx",[]);return this.each(function(){var b,
e=!1,g=f.timers,j=f._data(this);c||f._unmark(!0,this);if(null==a)for(b in j){if(j[b]&&j[b].stop&&b.indexOf(".run")===b.length-4){var m=j[b];f.removeData(this,b,!0);m.stop(c)}}else if(j[b=a+".run"]&&j[b].stop)j=j[b],f.removeData(this,b,!0),j.stop(c);for(b=g.length;b--;)if(g[b].elem===this&&(null==a||g[b].queue===a)){if(c)g[b](!0);else g[b].saveState();e=!0;g.splice(b,1)}(!c||!e)&&f.dequeue(this,a)})}});f.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},
fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,d,c){return this.animate(b,a,d,c)}});f.extend({speed:function(a,b,c){var e=a&&"object"===typeof a?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};e.duration=f.fx.off?0:"number"===typeof e.duration?e.duration:e.duration in f.fx.speeds?f.fx.speeds[e.duration]:f.fx.speeds._default;if(null==e.queue||!0===e.queue)e.queue="fx";e.old=e.complete;e.complete=function(a){f.isFunction(e.old)&&
e.old.call(this);e.queue?f.dequeue(this,e.queue):!1!==a&&f._unmark(this)};return e},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+0.5}},timers:[],fx:function(a,b,c){this.options=b;this.elem=a;this.prop=c;b.orig=b.orig||{}}});f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop]))return this.elem[this.prop];
var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||"auto"===b?0:b:a},custom:function(a,b,c){function e(a){return g.step(a)}var g=this,j=f.fx;this.startTime=Gb||t();this.end=b;this.now=this.start=a;this.pos=this.state=0;this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px");e.queue=this.options.queue;e.elem=this.elem;e.saveState=function(){f._data(g.elem,"fxshow"+g.prop)===l&&(g.options.hide?f._data(g.elem,"fxshow"+g.prop,g.start):g.options.show&&f._data(g.elem,"fxshow"+g.prop,
g.end))};e()&&(f.timers.push(e)&&!cc)&&(cc=setInterval(j.tick,j.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop);this.options.show=!0;a!==l?this.custom(this.cur(),a):this.custom("width"===this.prop||"height"===this.prop?1:0,this.cur());f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop);this.options.hide=!0;this.custom(this.cur(),0)},
step:function(a){var b,c=Gb||t(),e=!0,g=this.elem,j=this.options;if(a||c>=j.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();j.animatedProperties[this.prop]=!0;for(b in j.animatedProperties)!0!==j.animatedProperties[b]&&(e=!1);if(e){null!=j.overflow&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,d){g.style["overflow"+d]=j.overflow[a]});j.hide&&f(g).hide();if(j.hide||j.show)for(b in j.animatedProperties)f.style(g,b,j.orig[b]),f.removeData(g,"fxshow"+b,!0),
f.removeData(g,"toggle"+b,!0);if(a=j.complete)j.complete=!1,a.call(g)}return!1}Infinity==j.duration?this.now=c:(a=c-this.startTime,this.state=a/j.duration,this.pos=f.easing[j.animatedProperties[this.prop]](this.state,a,0,1,j.duration),this.now=this.start+(this.end-this.start)*this.pos);this.update();return!0}};f.extend(f.fx,{tick:function(){for(var a,b=f.timers,c=0;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cc);cc=null},speeds:{slow:600,
fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&null!=a.elem.style[a.prop]?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}});f.each(Hb.concat.apply([],Hb),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})});f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var dc,Gd=/^t(?:able|d|h)$/i,Wc=/^(?:body|html)$/i;
dc="getBoundingClientRect"in C.documentElement?function(a,b,c,e){try{e=a.getBoundingClientRect()}catch(g){}if(!e||!f.contains(c,a))return e?{top:e.top,left:e.left}:{top:0,left:0};a=b.body;b=ta(b);return{top:e.top+(b.pageYOffset||f.support.boxModel&&c.scrollTop||a.scrollTop)-(c.clientTop||a.clientTop||0),left:e.left+(b.pageXOffset||f.support.boxModel&&c.scrollLeft||a.scrollLeft)-(c.clientLeft||a.clientLeft||0)}}:function(a,b,c){var e,g=a.offsetParent,j=b.body;e=(b=b.defaultView)?b.getComputedStyle(a,
null):a.currentStyle;for(var m=a.offsetTop,p=a.offsetLeft;(a=a.parentNode)&&(a!==j&&a!==c)&&!(f.support.fixedPosition&&"fixed"===e.position);){e=b?b.getComputedStyle(a,null):a.currentStyle;m-=a.scrollTop;p-=a.scrollLeft;if(a===g){m+=a.offsetTop;p+=a.offsetLeft;if(f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!Gd.test(a.nodeName)))m+=parseFloat(e.borderTopWidth)||0,p+=parseFloat(e.borderLeftWidth)||0;g=a.offsetParent}f.support.subtractsBorderForOverflowNotVisible&&"visible"!==
e.overflow&&(m+=parseFloat(e.borderTopWidth)||0,p+=parseFloat(e.borderLeftWidth)||0)}if("relative"===e.position||"static"===e.position)m+=j.offsetTop,p+=j.offsetLeft;f.support.fixedPosition&&"fixed"===e.position&&(m+=Math.max(c.scrollTop,j.scrollTop),p+=Math.max(c.scrollLeft,j.scrollLeft));return{top:m,left:p}};f.fn.offset=function(a){if(arguments.length)return a===l?this:this.each(function(b){f.offset.setOffset(this,a,b)});var b=this[0],c=b&&b.ownerDocument;return!c?null:b===c.body?f.offset.bodyOffset(b):
dc(b,c,c.documentElement)};f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=f.css(a,"position");"static"===e&&(a.style.position="relative");var g=f(a),j=g.offset(),m=f.css(a,"top"),p=f.css(a,"left"),t={},s={};("absolute"===e||"fixed"===e)&&-1<f.inArray("auto",[m,p])?(s=g.position(),e=s.top,p=s.left):(e=parseFloat(m)||
0,p=parseFloat(p)||0);f.isFunction(b)&&(b=b.call(a,c,j));null!=b.top&&(t.top=b.top-j.top+e);null!=b.left&&(t.left=b.left-j.left+p);"using"in b?b.using.call(a,t):g.css(t)}};f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=Wc.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0;c.left-=parseFloat(f.css(a,"marginLeft"))||0;e.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(f.css(b[0],
"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||C.body;a&&!Wc.test(a.nodeName)&&"static"===f.css(a,"position");)a=a.offsetParent;return a})}});f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);f.fn[a]=function(e){return f.access(this,function(a,d,e){var g=ta(a);if(e===l)return g?b in g?g[b]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:
a[d];g?g.scrollTo(!c?e:f(g).scrollLeft(),c?e:f(g).scrollTop()):a[d]=e},a,e,arguments.length,null)}});f.each({Height:"height",Width:"width"},function(a,b){var c="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,b,"padding")):this[b]():null};f.fn["outer"+a]=function(a){var d=this[0];return d?d.style?parseFloat(f.css(d,b,a?"margin":"border")):this[b]():null};f.fn[b]=function(a){return f.access(this,function(a,d,b){if(f.isWindow(a))return d=
a.document,a=d.documentElement[c],f.support.boxModel&&a||d.body&&d.body[c]||a;if(9===a.nodeType)return d=a.documentElement,d[c]>=d[e]?d[c]:Math.max(a.body[e],d[e],a.body[g],d[g]);if(b===l)return a=f.css(a,d),d=parseFloat(a),f.isNumeric(d)?d:a;f(a).css(d,b)},b,a,arguments.length,null)}});b.jQuery=b.$=f;"function"===typeof define&&(define.amd&&define.amd.jQuery)&&define("jquery",[],function(){return f})})(window);var Handsontable={extension:{},helper:{}};
(function(b,l,c){function k(b){return(b=b.data("typeahead"))&&b.$menu.is(":visible")?b:!1}function h(b,e,a,p){c.helper.stringify(b.getDataAtCell(e,a))===c.helper.stringify(p.checkedTemplate)?b.setDataAtCell(e,a,p.uncheckedTemplate):b.setDataAtCell(e,a,p.checkedTemplate)}c.Core=function(v,e){this.rootElement=v;var a,p,m,j,t,g,k,l,h=this;a={settings:{},selStart:null,selEnd:null,editProxy:!1,isPopulated:null,scrollable:null,undoRedo:null,extensions:{},colToProp:null,propToCol:null,dataSchema:null,dataType:"array"};
var r=b.browser.msie&&7>=parseInt(b.browser.version,10);this.minWidthFix=function(a){r&&(a.innerHTML=a.className?'<div class="minWidthFix '+a.className+'">'+a.innerHTML+"</div>":'<div class="minWidthFix">'+a.innerHTML+"</div>")};var q=b.browser.msie&&7>=parseInt(b.browser.version,10);this.positionFix=function(a){q&&(0>a.top&&(a.top=0),0>a.left&&(a.left=0))};p={recursiveDuckSchema:function(a){var c;if(b.isPlainObject(a)){c={};for(var e in a)a.hasOwnProperty(e)&&(c[e]=b.isPlainObject(a[e])?p.recursiveDuckSchema(a[e]):
null)}else c=[];return c},recursiveDuckColumns:function(c,e,g){var f,j;"undefined"===typeof e&&(e=0,g="");if(b.isPlainObject(c))for(j in c)c.hasOwnProperty(j)&&(null===c[j]?(f=g+j,a.colToProp.push(f),a.propToCol[f]=e,e++):e=p.recursiveDuckColumns(c[j],e,j+"."));return e},createMap:function(){if("undefined"===typeof p.getSchema())throw Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");var b,c;b=p.getSchema();a.colToProp=[];a.propToCol={};if(a.settings.columns){b=
0;for(c=a.settings.columns.length;b<c;b++)a.colToProp[b]=a.settings.columns[b].data,a.propToCol[a.settings.columns[b].data]=b}else p.recursiveDuckColumns(b)},colToProp:function(b){return"undefined"!==typeof a.colToProp[b]?a.colToProp[b]:b},propToCol:function(b){return"undefined"!==typeof a.propToCol[b]?a.propToCol[b]:b},getSchema:function(){return a.settings.dataSchema||a.duckDataSchema},createRow:function(c){var e;if("array"===a.dataType){e=[];for(var g=0;g<h.colCount;g++)e.push(null)}else e=b.extend(!0,
{},p.getSchema());!c||c.row>=h.rowCount?a.settings.data.push(e):a.settings.data.splice(c.row,0,e)},createCol:function(b){if("object"===a.dataType||a.settings.columns)throw Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting");var c=0;if(!b||b.col>=h.colCount)for(;c<h.rowCount;c++)"undefined"===typeof a.settings.data[c]&&(a.settings.data[c]=[]),a.settings.data[c].push("");else for(;c<
h.rowCount;c++)a.settings.data[c].splice(b.col,0,"")},removeRow:function(b,c){!b||b.row===h.rowCount-1?a.settings.data.pop():a.settings.data.splice(b.row,c.row-b.row+1)},removeCol:function(b,c){if("object"===a.dataType||a.settings.columns)throw Error("cannot remove column with object data source or columns option specified");var e=0;if(!b||b.col===h.colCount-1)for(;e<h.rowCount;e++)a.settings.data[e].pop();else for(var g=c.col-b.col+1;e<h.rowCount;e++)a.settings.data[e].splice(b.col,g)},get:function(b,
c){if("string"===typeof c&&-1<c.indexOf(".")){var e=c.split("."),g=a.settings.data[b];if(!g)return null;for(var f=0,j=e.length;f<j;f++)if(g=g[e[f]],"undefined"===typeof g)return null;return g}return a.settings.data[b]?a.settings.data[b][c]:null},set:function(b,c,e){if("string"===typeof c&&-1<c.indexOf(".")){c=c.split(".");b=a.settings.data[b];for(var g=0,f=c.length-1;g<f;g++)b=b[c[g]];b[c[g]]=e}else a.settings.data[b][c]=e},clear:function(){for(var a=0;a<h.rowCount;a++)for(var b=0;b<h.colCount;b++)p.set(a,
p.colToProp(b),"")},getAll:function(){return a.settings.data},getRange:function(a,b){var c,e,g,f,j=[],m;e=Math.max(a.row,b.row);f=Math.max(a.col,b.col);for(c=Math.min(a.row,b.row);c<=e;c++){m=[];for(g=Math.min(a.col,b.col);g<=f;g++)m.push(p.get(c,p.colToProp(g)));j.push(m)}return j},getText:function(a,b){return SheetClip.stringify(p.getRange(a,b))}};m={alter:function(c,e,g){var f,t,v,s;f=b.extend(!0,[],p.getAll());switch(c){case "insert_row":h.countRows()<a.settings.maxRows&&(p.createRow(e),h.view.createRow(e),
h.view.renderRow(e.row),h.blockedCols.refresh(),a.selStart&&a.selStart.row>=e.row?(a.selStart.row+=1,j.transformEnd(1,0)):j.transformEnd(0,0));break;case "insert_col":h.countCols()<a.settings.maxCols&&(p.createCol(e),h.view.createCol(e),h.view.renderCol(e.col),h.blockedRows.refresh(),a.selStart&&a.selStart.col>=e.col?(a.selStart.col+=1,j.transformEnd(0,1)):j.transformEnd(0,0));break;case "remove_row":p.removeRow(e,g);h.view.removeRow(e,g);(c=m.keepEmptyRows())||h.blockedCols.refresh();j.transformEnd(0,
0);break;case "remove_col":p.removeCol(e,g),h.view.removeCol(e,g),(c=m.keepEmptyRows())||h.blockedRows.refresh(),j.transformEnd(0,0)}e=[];c=p.getAll();g=0;for(t=c.length;g<t;g++){v=0;for(s=c[g].length;v<s;v++)e.push([g,v,f[g]?f[g][v]:null,c[g][v]])}h.rootElement.triggerHandler("datachange.handsontable",[e,"alter"])},keepEmptyRows:function(){var c,e,g,f=0,m=0,t=!1,s=!1,v,k=b(a.tableBody);for(c=a.settings.data.length;h.rowCount<c;)h.view.createRow(),t=!0;for(;h.rowCount>c;)h.view.removeRow(),t=!0;for(;h.colCount<
h.countCols();)h.view.createCol(),h.view.renderCol(h.colCount-1),t=!0;for(;h.colCount>h.countCols();)h.view.removeCol(),t=!0;c=h.countRows()-1;a:for(;0<=c;c--){e=0;for(g=h.colCount;e<g;e++)if(v=p.get(c,p.colToProp(e)),""!==v&&null!==v&&"undefined"!==typeof v)break a;f++}e=h.countRows();if(e<a.settings.minRows)for(c=0;c<a.settings.minRows-e;c++)p.createRow();if(h.countRows()<a.settings.minRows)for(;h.countRows()<a.settings.minRows;f++)h.view.createRow(),h.view.renderRow(h.countRows()-1),t=!0;if(f<
a.settings.minSpareRows)for(;f<a.settings.minSpareRows&&h.countRows()<a.settings.maxRows;f++)p.createRow(),h.view.createRow(),h.view.renderRow(h.countRows()-1),t=!0;if(a.settings.minHeight&&0<k.height()&&k.height()<=a.settings.minHeight)for(;k.height()<=a.settings.minHeight&&h.countRows()<a.settings.maxRows;)p.createRow(),h.view.createRow(),h.view.renderRow(h.countRows()-1),t=!0;if(0<h.countRows()-1){e=h.countCols()-1;a:for(;0<=e;e--){for(c=0;c<h.countRows();c++)if(v=p.get(c,p.colToProp(e)),""!==
v&&null!==v&&"undefined"!==typeof v)break a;m++}}if(h.countCols()<a.settings.minCols)for(;h.countCols()<a.settings.minCols;m++)a.settings.columns||p.createCol(),h.view.createCol(),h.view.renderCol(h.countCols()-1),s=!0;if("array"===a.dataType&&m<a.settings.minSpareCols)for(;m<a.settings.minSpareCols&&h.countCols()<a.settings.maxCols;m++)a.settings.columns||p.createCol(),h.view.createCol(),h.view.renderCol(h.colCount-1),s=!0;if(a.settings.minWidth&&0<k.width()&&k.width()<=a.settings.minWidth)for(;k.width()<=
a.settings.minWidth&&h.countCols()<a.settings.maxCols;)a.settings.columns||p.createCol(),h.view.createCol(),h.view.renderCol(h.colCount-1),s=!0;if(!t&&a.settings.enterBeginsEditing)for(;a.settings.minRows&&h.countRows()>a.settings.minRows&&a.settings.minSpareRows&&f>a.settings.minSpareRows&&(!a.settings.minHeight||k.height()-k.find("tr:last").height()-4>a.settings.minHeight);f--)h.view.removeRow(),p.removeRow(),t=!0;if(!s&&a.settings.enterBeginsEditing)for(;a.settings.startCols&&h.countCols()>a.settings.startCols&&
a.settings.minSpareCols&&m>a.settings.minSpareCols&&(!a.settings.minWidth||k.width()-k.find("tr:last").find("td:last").width()-4>a.settings.minWidth);m--)a.settings.columns||p.removeCol(),h.view.removeCol(),s=!0;f=h.countRows();m=h.countCols();(0===f||0===m)&&j.deselect();t&&a.selStart&&(a.selStart.row>f-1?(a.selStart.row=f-1,a.selEnd.row>a.selStart.row&&(a.selEnd.row=a.selStart.row)):a.selEnd.row>f-1&&(a.selEnd.row=f-1,a.selStart.row>a.selEnd.row&&(a.selStart.row=a.selEnd.row)));s&&a.selStart&&(a.selStart.col>
m-1?(a.selStart.col=m-1,a.selEnd.col>a.selStart.col&&(a.selEnd.col=a.selStart.col)):a.selEnd.col>m-1&&(a.selEnd.col=m-1,a.selStart.col>a.selEnd.col&&(a.selStart.col=a.selEnd.col)));if(t||s)j.refreshBorders(),h.blockedCols.update(),h.blockedRows.update();return t||s},isCellWritable:function(b,c){if(a.isPopulated){var e=b.data("readOnly");return"undefined"===typeof e?!c.readOnly:!e}return!0},populateFromArray:function(b,c,e,g){var f,j,m,t,v=[],k={};j=c.length;if(0===j)return!1;k.row=b.row;k.col=b.col;
for(f=0;f<j&&!(e&&k.row>e.row||!a.settings.minSpareRows&&k.row>h.countRows()-1||k.row>=a.settings.maxRows);f++){k.col=b.col;t=c[f]?c[f].length:0;for(m=0;m<t&&!(e&&k.col>e.col||!a.settings.minSpareCols&&k.col>h.colCount-1||k.col>=a.settings.maxCols);m++){h.view.getCellAtCoords(k);if(h.getCellMeta(k.row,k.col).isWritable){var l=p.colToProp(k.col);v.push([k.row,l,c[f][m]])}k.col++;e&&m===t-1&&(m=-1)}k.row++;e&&f===j-1&&(f=-1)}h.setDataAtCell(v,null,null,g||"populateFromArray")},clear:function(){for(var a=
h.view.getAllCells(),c=0,e=a.length;c<e;c++)b(a[c]).empty(),h.minWidthFix(a[c])},getCornerCoords:function(a){function c(a,e,g){function f(a){return a[g]}return Array.prototype.map?a.apply(Math,e.map(f)):a.apply(Math,b.map(e,f))}return{TL:{row:c(Math.min,a,"row"),col:c(Math.min,a,"col")},BR:{row:c(Math.max,a,"row"),col:c(Math.max,a,"col")}}},getCellsAtCoords:function(a,b){var c=m.getCornerCoords([a,b]),e,g,f=[];for(e=c.TL.row;e<=c.BR.row;e++)for(g=c.TL.col;g<=c.BR.col;g++)f.push(h.view.getCellAtCoords({row:e,
col:g}));return f}};this.selection=j={setRangeStart:function(b){j.deselect();a.selStart=h.view.getCellCoords(b);j.setRangeEnd(b)},setRangeEnd:function(b,c){var e=h.view.getCellCoords(b);j.end(e);a.settings.multiSelect||(a.selStart=e);h.rootElement.triggerHandler("selection.handsontable",[a.selStart.row,a.selStart.col,a.selEnd.row,a.selEnd.col]);h.rootElement.triggerHandler("selectionbyprop.handsontable",[a.selStart.row,p.colToProp(a.selStart.col),a.selEnd.row,p.colToProp(a.selEnd.col)]);j.refreshBorders();
!1!==c&&h.view.scrollViewport(b)},refreshBorders:function(a,b){b||t.destroy(a);j.isSelected()&&(j.refreshBorderDimensions(),b||t.prepare())},refreshBorderDimensions:function(){j.isSelected()&&(k.handle&&k.showHandle(),a.currentBorder.appear([a.selStart]),g.on())},start:function(b){"undefined"!==typeof b&&(a.selStart=b);return a.selStart},end:function(b){"undefined"!==typeof b&&(a.selEnd=b);return a.selEnd},isMultiple:function(){return!(a.selEnd.col===a.selStart.col&&a.selEnd.row===a.selStart.row)},
transformStart:function(b,c,e){a.selStart.row+b>h.rowCount-1?e&&0<a.settings.minSpareRows?h.alter("insert_row",h.rowCount):a.settings.autoWrapCol&&a.selStart.col+c<h.colCount-1&&(b=1-h.rowCount,c=1):a.settings.autoWrapCol&&(0>a.selStart.row+b&&0<=a.selStart.col+c)&&(b=h.rowCount-1,c=-1);a.selStart.col+c>h.colCount-1?e&&0<a.settings.minSpareCols?h.alter("insert_col",h.colCount):a.settings.autoWrapRow&&a.selStart.row+b<h.rowCount-1&&(b=1,c=1-h.colCount):a.settings.autoWrapRow&&(0>a.selStart.col+c&&
0<=a.selStart.row+b)&&(b=-1,c=h.colCount-1);(b=h.view.getCellAtCoords({row:a.selStart.row+b,col:a.selStart.col+c}))?j.setRangeStart(b):j.setRangeStart(h.view.getCellAtCoords(a.selStart))},transformEnd:function(b,c){if(a.selEnd){var e=h.view.getCellAtCoords({row:a.selEnd.row+b,col:a.selEnd.col+c});e&&j.setRangeEnd(e)}},isSelected:function(){var a=j.end();return!a||"undefined"===typeof a.row?!1:!0},inInSelection:function(b){if(!j.isSelected())return!1;var c=m.getCornerCoords([a.selStart,a.selEnd]);
return c.TL.row<=b.row&&c.BR.row>=b.row&&c.TL.col<=b.col&&c.BR.col>=b.col},deselect:function(){j.isSelected()&&(g.off(),a.currentBorder.disappear(),k.handle&&k.hideHandle(),j.end(!1),t.destroy(),h.rootElement.triggerHandler("deselect.handsontable"))},selectAll:function(){if(a.settings.multiSelect){var b=h.view.getAllCells();b.length&&(j.setRangeStart(b[0]),j.setRangeEnd(b[b.length-1],!1))}},empty:function(){if(j.isSelected()){var b=m.getCornerCoords([a.selStart,j.end()]),c,e,g=[];for(c=b.TL.row;c<=
b.BR.row;c++)for(e=b.TL.col;e<=b.BR.col;e++)h.getCellMeta(c,e).isWritable&&g.push([c,p.colToProp(e),""]);h.setDataAtCell(g)}}};g={init:function(){a.selectionBorder=new c.Border(h,{className:"selection",bg:!0})},on:function(){if(!j.isSelected())return!1;j.isMultiple()?a.selectionBorder.appear([a.selStart,j.end()]):a.selectionBorder.disappear()},off:function(){if(!j.isSelected())return!1;a.selectionBorder.disappear()}};this.autofill=k={handle:null,fillBorder:null,init:function(){k.handle?(k.handle.disabled=
!1,k.fillBorder.disabled=!1):(k.handle=new c.FillHandle(h),k.fillBorder=new c.Border(h,{className:"htFillBorder"}),b(k.handle.handle).on("dblclick",k.selectAdjacent));h.rootElement.on("beginediting.handsontable",function(){k.hideHandle()});h.rootElement.on("finishediting.handsontable",function(){j.isSelected()&&k.showHandle()})},disable:function(){k.handle.disabled=!0;k.fillBorder.disabled=!0},selectAdjacent:function(){var b,c,e,g,f;b=j.isMultiple()?a.selectionBorder.corners:a.currentBorder.corners;
k.fillBorder.disappear();c=p.getAll();e=b.BR.row+1;a:for(;e<h.rowCount;e++){for(f=b.TL.col;f<=b.BR.col;f++)if(c[e][f])break a;if(c[e][b.TL.col-1]||c[e][b.BR.col+1])g=e}g&&(k.showBorder(h.view.getCellAtCoords({row:g,col:b.BR.col})),k.apply())},apply:function(){var b,c,e,g;k.handle.isDragged=0;if(b=k.fillBorder.corners)k.fillBorder.disappear(),c=j.isMultiple()?a.selectionBorder.corners:a.currentBorder.corners,b.TL.row===c.TL.row&&b.TL.col<c.TL.col?(e=b.TL,g={row:b.BR.row,col:c.TL.col-1}):b.TL.row===
c.TL.row&&b.BR.col>c.BR.col?(e={row:b.TL.row,col:c.BR.col+1},g=b.BR):b.TL.row<c.TL.row&&b.TL.col===c.TL.col?(e=b.TL,g={row:c.TL.row-1,col:b.BR.col}):b.BR.row>c.BR.row&&b.TL.col===c.TL.col&&(e={row:c.BR.row+1,col:b.TL.col},g=b.BR),e?(m.populateFromArray(e,SheetClip.parse(a.editProxy.val()),g,"autofill"),j.setRangeStart(h.view.getCellAtCoords(b.TL)),j.setRangeEnd(h.view.getCellAtCoords(b.BR))):j.refreshBorders()},showHandle:function(){k.handle.appear([a.selStart,a.selEnd])},hideHandle:function(){k.handle.disappear()},
showBorder:function(b){b=h.view.getCellCoords(b);var c=m.getCornerCoords([a.selStart,a.selEnd]);if("horizontal"!==a.settings.fillHandle&&(c.BR.row<b.row||c.TL.row>b.row))b={row:b.row,col:c.BR.col};else if("vertical"!==a.settings.fillHandle)b={row:c.BR.row,col:b.col};else return;k.fillBorder.appear([a.selStart,a.selEnd,b])}};this.editproxy=t={init:function(){a.editProxy=b('<textarea class="handsontableInput">');a.editProxyHolder=b('<div class="handsontableInputHolder">');a.editProxyHolder.append(a.editProxy);
var e=b(document.body);a.editProxy.on("click",function(a){a.stopPropagation()});a.editProxyHolder.on("cut",function(){setTimeout(function(){j.empty()},100)});a.editProxyHolder.on("paste",function(){setTimeout(function(){h.rootElement.one("datachange.handsontable",function(a,b){if(b.length){var c=b[b.length-1],c=h.view.getCellAtCoords({row:c[0],col:h.propToCol(c[1])});j.setRangeEnd(c)}});var b=a.editProxy.val().replace(/^[\r\n]*/g,"").replace(/[\r\n]*$/g,""),b=SheetClip.parse(b),c=m.getCornerCoords([a.selStart,
a.selEnd]);m.populateFromArray(c.TL,b,{row:Math.max(c.BR.row,b.length-1+c.TL.row),col:Math.max(c.BR.col,b[0].length-1+c.TL.col)},"paste")},100)});a.editProxyHolder.on("keydown",function(g){if(!e.children(".context-menu-list:visible").length&&(a.lastKeyCode=g.keyCode,j.isSelected())){var f=(g.ctrlKey||g.metaKey)&&!g.altKey;if(c.helper.isPrintableChar(g.keyCode)&&f)65===g.keyCode?j.selectAll():88===g.keyCode&&b.browser.opera?a.editProxyHolder.triggerHandler("cut"):86===g.keyCode&&b.browser.opera?a.editProxyHolder.triggerHandler("paste"):
89===g.keyCode||g.shiftKey&&90===g.keyCode?a.undoRedo&&a.undoRedo.redo():90===g.keyCode&&a.undoRedo&&a.undoRedo.undo();else switch(f=g.shiftKey?j.setRangeEnd:j.setRangeStart,g.keyCode){case 38:g.shiftKey?j.transformEnd(-1,0):j.transformStart(-1,0);g.preventDefault();break;case 9:f="function"===typeof a.settings.tabMoves?a.settings.tabMoves(g):a.settings.tabMoves;g.shiftKey?j.transformStart(-f.row,-f.col):j.transformStart(f.row,f.col);g.preventDefault();break;case 39:g.shiftKey?j.transformEnd(0,1):
j.transformStart(0,1);g.preventDefault();break;case 37:g.shiftKey?j.transformEnd(0,-1):j.transformStart(0,-1);g.preventDefault();break;case 8:case 46:j.empty(g);g.preventDefault();break;case 40:g.shiftKey?j.transformEnd(1,0):j.transformStart(1,0);g.preventDefault();break;case 113:g.preventDefault();break;case 13:f="function"===typeof a.settings.enterMoves?a.settings.enterMoves(g):a.settings.enterMoves;g.shiftKey?j.transformStart(-f.row,-f.col):j.transformStart(f.row,f.col);g.preventDefault();break;
case 36:g.ctrlKey||g.metaKey?f(h.view.getCellAtCoords({row:0,col:a.selStart.col})):f(h.view.getCellAtCoords({row:a.selStart.row,col:0}));break;case 35:g.ctrlKey||g.metaKey?f(h.view.getCellAtCoords({row:h.rowCount-1,col:a.selStart.col})):f(h.view.getCellAtCoords({row:a.selStart.row,col:h.colCount-1}));break;case 33:f(h.view.getCellAtCoords({row:0,col:a.selStart.col}));break;case 34:f(h.view.getCellAtCoords({row:h.rowCount-1,col:a.selStart.col}))}}});h.container.append(a.editProxyHolder)},destroy:function(b){"function"===
typeof a.editorDestroyer&&(a.editorDestroyer(b),a.editorDestroyer=null)},prepare:function(){a.editProxy.height(a.editProxy.parent().innerHeight()-4);a.editProxy.val(p.getText(a.selStart,a.selEnd));setTimeout(t.focus,1);a.editorDestroyer=h.view.applyCellTypeMethod("editor",h.view.getCellAtCoords(a.selStart),a.selStart,a.editProxy)},focus:function(){a.editProxy[0].select()}};this.init=function(){this.view=new c.TableView(this);h.rowCount=0;g.init();a.currentBorder=new c.Border(h,{className:"current",
bg:!0});t.init();h.rootElement.on("datachange.handsontable",function(b,c,e){a.settings.onChange&&a.settings.onChange.apply(h.rootElement[0],[c,e])});h.rootElement.on("selection.handsontable",function(b,c,e,g,f){a.settings.onSelection&&a.settings.onSelection.apply(h.rootElement[0],[c,e,g,f])});h.rootElement.on("selectionbyprop.handsontable",function(b,c,e,g,f){a.settings.onSelectionByProp&&a.settings.onSelectionByProp.apply(h.rootElement[0],[c,e,g,f])});this.updateSettings(e);c.PluginHooks.run(h,"afterInit")};
l=function(c,e){var g=b.Deferred(),f=[];if("paste"===e)for(var j=function(a){var e=b.Deferred();f.push(e);var g=c[a][3],j="string"===typeof g?g.toLowerCase():null;return function(b){for(var f=!1,m=0,p=b.length;m<p;m++)if(g===b[m]){f=!0;break}else if(j===b[m].toLowerCase()){c[a][3]=b[m];f=!0;break}f||(c[a]=null);e.resolve()}},m=c.length-1;0<=m;m--){var p=h.getCellMeta(c[m][0],c[m][1]);p.strict&&p.source&&(p=b.isFunction(p.source)?p.source(c[m][3],j(m)):p.source)&&j(m)(p)}b.when(f).then(function(){for(var f=
c.length-1;0<=f;f--)null===c[f]&&c.splice(f,1);a.settings.onBeforeChange&&c.length?(f=a.settings.onBeforeChange.apply(h.rootElement[0],[c,e]),"function"===typeof f?b.when(f).then(function(){g.resolve()}):(!1===f&&c.splice(0,c.length),g.resolve())):g.resolve()});return b.when(g)};this.setDataAtCell=function(c,e,g,f){var t=!1,v=!1,s,k,r;s="object"===typeof c?c:b.isPlainObject(g)?g:[[c,e,g]];k=0;for(r=s.length;k<r;k++)s[k].splice(2,0,p.get(s[k][0],s[k][1]));l(s,f).then(function(){k=0;for(r=s.length;k<
r;k++){c=s[k][0];e=s[k][1];var b=p.propToCol(e);g=s[k][3];if(a.settings.minSpareRows)for(;c>h.rowCount-1;)p.createRow(),h.view.createRow(),h.view.renderRow(h.rowCount-1),t=!0;if("array"===a.dataType&&a.settings.minSpareCols)for(;b>h.colCount-1;)p.createCol(),h.view.createCol(),h.view.renderCol(h.colCount-1),v=!0;h.view.render(c,b,e,g);p.set(c,e,g)}t&&h.blockedCols.refresh();v&&h.blockedRows.refresh();m.keepEmptyRows()||j.refreshBorders();h.rootElement.triggerHandler("datachange.handsontable",[s,f||
"edit"]);h.rootElement.triggerHandler("cellrender.handsontable",[s,f||"edit"])})};this.destroyEditor=function(a){j.refreshBorders(a)};this.populateFromArray=function(a,b,c,e){return m.populateFromArray(a,b,c,e)};this.getCornerCoords=function(a){return m.getCornerCoords(a)};this.getSelected=function(){if(j.isSelected()){var b=m.getCornerCoords([a.selStart,a.selEnd]);return[b.TL.row,b.TL.col,b.BR.row,b.BR.col]}};this.render=function(b,c){if("undefined"===typeof b){b=[];var e,g,f,m,t=h.countRows(),k=
a.settings.columns&&a.settings.columns.length||a.settings.startCols;for(e=0;e<t;e++)for(g=0;g<k;g++)f=p.colToProp(g),m=p.get(e,f),b.push([e,f,m,m])}e=0;for(g=b.length;e<g;e++)h.view.render(b[e][0],p.propToCol(b[e][1]),b[e][1],b[e][3]);j.refreshBorderDimensions();a.editProxy.triggerHandler("refreshBorder");h.rootElement.triggerHandler("cellrender.handsontable",[b,c||"render"])};this.loadData=function(c){a.isPopulated=!1;a.settings.data=c;a.dataType=b.isPlainObject(a.settings.dataSchema)||b.isPlainObject(c[0])?
"object":"array";a.duckDataSchema=c[0]?p.recursiveDuckSchema(c[0]):{};p.createMap();for(c=a.settings.data.length;a.settings.minRows>c;)p.createRow(),c++;void 0===h.colCount&&(h.colCount=h.countCols());m.keepEmptyRows();m.clear();var e=[];c=a.settings.data.length;for(var g=h.countCols(),f=0;f<c;f++)for(var j=0;j<g;j++){var t=p.colToProp(j);e.push([f,t,"",p.get(f,t)])}h.rootElement.triggerHandler("datachange.handsontable",[e,"loadData"]);h.render(e,"loadData");a.isPopulated=!0;h.clearUndo()};this.getData=
function(a,b,c,e){return"undefined"===typeof a?p.getAll():p.getRange({row:a,col:b},{row:c,col:e})};this.updateSettings=function(e){var g,f;if("undefined"!==typeof e.rows)throw Error("'rows' setting is no longer supported. do you mean startRows, minRows or maxRows?");if("undefined"!==typeof e.cols)throw Error("'cols' setting is no longer supported. do you mean startCols, minCols or maxCols?");"undefined"!==typeof e.fillHandle&&(k.handle&&!1===e.fillHandle?k.disable():!k.handle&&!1!==e.fillHandle&&
k.init());"undefined"!==typeof e.undo&&(a.undoRedo&&!1===e.undo?a.undoRedo=null:!a.undoRedo&&!0===e.undo&&(a.undoRedo=new c.UndoRedo(h)));h.blockedCols||(h.blockedCols=new c.BlockedCols(h),h.blockedRows=new c.BlockedRows(h));for(g in e)"data"!==g&&e.hasOwnProperty(g)&&(a.settings[g]=e[g],c.extension[g]&&(a.extensions[g]=new c.extension[g](h,e[g])));if(void 0===a.settings.data)if(void 0===e.data){e.data=[];var t,v=0;for(g=a.settings.startRows;v<g;v++){t=[];var l=0;for(f=a.settings.startCols;l<f;l++)t.push(null);
e.data.push(t)}}else void 0!==e.startRows&&void 0===e.minRows&&(e.minRows=e.startRows),void 0!==e.startCols&&void 0===e.minCols&&(e.minCols=e.startCols);void 0!==e.data?h.loadData(e.data):void 0!==e.columns&&p.createMap();"undefined"!==typeof e.colHeaders&&(!1===e.colHeaders&&a.extensions.ColHeader?a.extensions.ColHeader.destroy():!1!==e.colHeaders&&(a.extensions.ColHeader=new c.ColHeader(h,e.colHeaders)));"undefined"!==typeof e.rowHeaders&&(!1===e.rowHeaders&&a.extensions.RowHeader?a.extensions.RowHeader.destroy():
!1!==e.rowHeaders&&(a.extensions.RowHeader=new c.RowHeader(h,e.rowHeaders)));t=h.blockedRows.count();v=h.blockedCols.count();if(t&&v&&("undefined"!==typeof e.rowHeaders||"undefined"!==typeof e.colHeaders)){h.blockedCorner&&(h.blockedCorner.remove(),h.blockedCorner=null);g=h.table.position();h.positionFix(g);e=document.createElement("div");e.style.position="absolute";e.style.top=g.top+"px";e.style.left=g.left+"px";g=document.createElement("table");g.cellPadding=0;g.cellSpacing=0;e.appendChild(g);l=
document.createElement("thead");g.appendChild(l);var s,r;for(g=0;g<t;g++){s=document.createElement("tr");for(f=v-1;0<=f;f--)r=document.createElement("th"),r.className=h.blockedCols.headers[f].className,r.innerHTML=h.blockedCols.headerText("&nbsp;"),h.minWidthFix(r),s.appendChild(r);l.appendChild(s)}h.blockedCorner=b(e);h.blockedCorner.on("click",function(){j.selectAll()});h.container.append(h.blockedCorner)}else h.blockedCorner&&(h.blockedCorner.remove(),h.blockedCorner=null);m.keepEmptyRows()||j.refreshBorders(null,
!0);h.blockedCols.update();h.blockedRows.update()};this.getSettings=function(){return a.settings};this.clear=function(){j.selectAll();j.empty()};this.isUndoAvailable=function(){return a.undoRedo&&a.undoRedo.isUndoAvailable()};this.isRedoAvailable=function(){return a.undoRedo&&a.undoRedo.isRedoAvailable()};this.undo=function(){a.undoRedo&&a.undoRedo.undo()};this.redo=function(){a.undoRedo&&a.undoRedo.redo()};this.clearUndo=function(){a.undoRedo&&a.undoRedo.clear()};this.alter=function(a,b,c){"undefined"===
typeof c&&(c=b);switch(a){case "insert_row":case "remove_row":m.alter(a,{row:b,col:0},{row:c,col:0});break;case "insert_col":case "remove_col":m.alter(a,{row:0,col:b},{row:0,col:c});break;default:throw Error('There is no such action "'+a+'"');}};this.getCell=function(a,b){return h.view.getCellAtCoords({row:a,col:b})};this.colToProp=function(a){return p.colToProp(a)};this.propToCol=function(a){return p.propToCol(a)};this.getDataAtCell=function(a,b){return p.get(a,p.colToProp(b))};this.getCellMeta=
function(e,g){var f={},j=p.colToProp(g);a.settings.columns&&(f=b.extend(!0,f,a.settings.columns[g]||{}));a.settings.cells&&(f=b.extend(!0,f,a.settings.cells(e,g,j)||{}));f.isWritable=m.isCellWritable(b(h.view.getCellAtCoords({row:e,col:g})),f);c.PluginHooks.run(h,"afterGetCellMeta",[e,g,f]);return f};this.setCellReadOnly=function(a,c){b(h.view.getCellAtCoords({row:a,col:c})).data("readOnly",!0)};this.setCellEditable=function(a,c){b(h.view.getCellAtCoords({row:a,col:c})).data("readOnly",!1)};var f=
function(a,b,c){if(a){if("undefined"!==typeof c)return a.columnLabel(c);c=[];for(var e=0;e<b;e++)c.push(a.columnLabel(e));return c}};this.getRowHeader=function(a){return f(h.rowHeader,h.rowCount,a)};this.getColHeader=function(a){return f(h.colHeader,h.colCount,a)};this.countRows=function(){return a.settings.data.length};this.countCols=function(){if("object"===a.dataType)return a.settings.columns&&a.settings.columns.length?a.settings.columns.length:a.colToProp.length;if("array"===a.dataType)return Math.max(a.settings.columns&&
a.settings.columns.length||0,a.settings.data&&a.settings.data[0]&&a.settings.data[0].length||0)};this.selectCell=function(a,b,c,e,g){if("number"!==typeof a||(0>a||a>=h.rowCount)||("number"!==typeof b||0>b||b>=h.colCount)||"undefined"!==typeof c&&("number"!==typeof c||0>c||c>=h.rowCount||"number"!==typeof e||0>e||e>=h.colCount))return!1;j.start({row:a,col:b});"undefined"===typeof c?j.setRangeEnd(h.getCell(a,b),g):j.setRangeEnd(h.getCell(c,e),g)};this.selectCellByProp=function(a,b,c,e,g){arguments[1]=
p.propToCol(arguments[1]);"undefined"!==typeof arguments[3]&&(arguments[3]=p.propToCol(arguments[3]));return h.selectCell.apply(h,arguments)};this.deselectCell=function(){j.deselect()};this.destroy=function(){h.rootElement.empty();h.rootElement.removeData("handsontable")};this.version="0.7.5"};var r={data:void 0,startRows:5,startCols:5,minRows:0,minCols:0,maxRows:Infinity,maxCols:Infinity,minSpareRows:0,minSpareCols:0,minHeight:0,minWidth:0,multiSelect:!0,fillHandle:!0,undo:!0,outsideClickDeselects:!0,
enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1};b.fn.handsontable=function(h){var e,a,p,m=[],j;if("string"!==typeof h)return j=h||{},this.each(function(){var a=b(this);if(a.data("handsontable"))g=a.data("handsontable"),g.updateSettings(j);else{var g=b.extend(!0,{},r),g;for(e in j)j.hasOwnProperty(e)&&(g[e]=j[e]);g=new c.Core(a,g);a.data("handsontable",g);g.init()}});p=[];if(1<arguments.length){e=1;for(a=arguments.length;e<a;e++)p.push(arguments[e])}this.each(function(){m=
b(this).data("handsontable")[h].apply(this,p)});return m};c.TableView=function(h){function e(){m.isMouseOverTable=!0}function a(){m.isMouseOverTable=!1}var p=this;this.instance=h;var m={};p.instance.container=b('<div class="handsontable"></div>');h=p.instance.rootElement.css("overflow");if("auto"===h||"scroll"===h){p.instance.container[0].style.overflow=h;if(h=p.instance.rootElement.css("width"))p.instance.container[0].style.width=h;if(h=p.instance.rootElement.css("height"))p.instance.container[0].style.height=
h;p.instance.rootElement[0].style.overflow="hidden";p.instance.rootElement[0].style.position="relative"}p.instance.rootElement.append(p.instance.container);p.instance.curScrollTop=p.instance.curScrollLeft=0;p.instance.lastScrollTop=p.instance.lastScrollLeft=null;this.scrollbarSize=this.measureScrollbar();h=b('<div><table class="htCore" cellspacing="0" cellpadding="0"><thead></thead><tbody></tbody></table></div>');m.tableContainer=h[0];p.instance.table=b(m.tableContainer.firstChild);this.$tableBody=
p.instance.table.find("tbody")[0];p.instance.table.on("mousedown","td",function(a){m.isMouseDown=!0;2===a.button&&p.instance.selection.inInSelection(p.getCellCoords(this))||(a.shiftKey?p.instance.selection.setRangeEnd(this):p.instance.selection.setRangeStart(this))});p.instance.table.on("mouseover","td",function(){m.isMouseDown?p.instance.selection.setRangeEnd(this):p.instance.autofill.handle&&p.instance.autofill.handle.isDragged&&(p.instance.autofill.handle.isDragged++,p.instance.autofill.showBorder(this))});
p.instance.table.on("mousewheel","td",function(a,b,c,e){m.virtualScroll&&(e?m.virtualScroll.scrollTop(m.virtualScroll.scrollTop()+44*-e):c&&m.virtualScroll.scrollLeft(m.virtualScroll.scrollLeft()+100*c),a.preventDefault())});p.instance.container.append(h);p.instance.container.on("mouseenter",e).on("mouseleave",a);b("html").on("mouseup",function(){m.isMouseDown&&setTimeout(p.instance.editproxy.focus,1);m.isMouseDown=!1;p.instance.autofill.handle&&p.instance.autofill.handle.isDragged&&(1<p.instance.autofill.handle.isDragged&&
p.instance.autofill.apply(),p.instance.autofill.handle.isDragged=0)}).on("click",function(a){p.instance.getSettings().outsideClickDeselects&&setTimeout(function(){!m.isMouseOverTable&&(a.target!==m.tableContainer&&"context-menu-layer"!==b(a.target).attr("id"))&&p.instance.selection.deselect()},1)});if("html"!==p.instance.container[0].tagName.toLowerCase()&&"body"!==p.instance.container[0].tagName.toLowerCase()&&("scroll"===p.instance.container.css("overflow")||"auto"===p.instance.container.css("overflow")))p.scrollable=
p.instance.container;p.scrollable?(m.virtualScroll=b('<div class="virtualScroll"><div class="spacer"></div></div>'),p.scrollable=m.virtualScroll,p.instance.container.before(m.virtualScroll),p.instance.table[0].style.position="absolute",m.virtualScroll.css({width:p.instance.container.width()+"px",height:p.instance.container.height()+"px",overflow:p.instance.container.css("overflow")}),p.instance.container.css({overflow:"hidden",position:"absolute",top:"0px",left:"0px"}),p.instance.container.width(m.virtualScroll.innerWidth()-
this.scrollbarSize.width),p.instance.container.height(m.virtualScroll.innerHeight()-this.scrollbarSize.height),setInterval(function(){m.virtualScroll.find(".spacer").height(p.instance.table.height());m.virtualScroll.find(".spacer").width(p.instance.table.width())},100),p.scrollable.scrollTop(0),p.scrollable.scrollLeft(0),p.scrollable.on("scroll.handsontable",function(){p.instance.curScrollTop=p.scrollable[0].scrollTop;p.instance.curScrollLeft=p.scrollable[0].scrollLeft;p.instance.curScrollTop!==p.instance.lastScrollTop&&
(p.instance.blockedRows.refreshBorders(),p.instance.blockedCols.main[0].style.top=-p.instance.curScrollTop+"px",p.instance.table[0].style.top=-p.instance.curScrollTop+"px");p.instance.curScrollLeft!==p.instance.lastScrollLeft&&(p.instance.blockedCols.refreshBorders(),p.instance.blockedRows.main[0].style.left=-p.instance.curScrollLeft+"px",p.instance.table[0].style.left=-p.instance.curScrollLeft+"px");if(p.instance.curScrollTop!==p.instance.lastScrollTop||p.instance.curScrollLeft!==p.instance.lastScrollLeft)p.instance.selection.refreshBorders(),
p.instance.blockedCorner&&(0===p.instance.curScrollTop&&0===p.instance.curScrollLeft?(p.instance.blockedCorner.find("th:last-child").css({borderRightWidth:0}),p.instance.blockedCorner.find("tr:last-child th").css({borderBottomWidth:0})):0===p.instance.lastScrollTop&&0===p.instance.lastScrollLeft&&(p.instance.blockedCorner.find("th:last-child").css({borderRightWidth:"1px"}),p.instance.blockedCorner.find("tr:last-child th").css({borderBottomWidth:"1px"})));p.instance.lastScrollTop=p.instance.curScrollTop;
p.instance.lastScrollLeft=p.instance.curScrollLeft;p.instance.selection.refreshBorders()}),c.PluginHooks.push("afterInit",function(){p.scrollable.trigger("scroll.handsontable")})):(p.scrollable=b(l),p.instance.blockedCorner&&(p.instance.blockedCorner.find("th:last-child").css({borderRightWidth:0}),p.instance.blockedCorner.find("tr:last-child th").css({borderBottomWidth:0})));p.scrollable.on("scroll",function(a){a.stopPropagation()});b(l).on("resize",function(){p.instance.blockedCols.update();p.instance.blockedRows.update()});
b(".context-menu-root").on("mouseenter",e).on("mouseleave",a)};c.TableView.prototype.measureScrollbar=function(){var c=b('<div style="width:150px;height:150px;overflow:hidden;position:absolute;top:200px;left:200px"><div style="width:100%;height:100%;position:absolute">x</div>');b("body").append(c);var e=b(c[0].firstChild),a=e.innerWidth(),p=e.innerHeight();c[0].style.overflow="scroll";a-=e.innerWidth();p-=e.innerHeight();0===a&&(a=17);0===p&&(p=17);c.remove();return{width:a,height:p}};c.TableView.prototype.createRow=
function(b){var c,a,p;c=document.createElement("tr");this.instance.blockedCols.createRow(c);for(a=0;a<this.instance.colCount;a++)c.appendChild(p=document.createElement("td")),this.instance.minWidthFix(p);!b||b.row>=this.instance.countRows()?this.$tableBody.appendChild(c):(b=this.instance.getCell(b.row,b.col).parentNode,this.$tableBody.insertBefore(c,b));this.instance.rowCount++};c.TableView.prototype.createCol=function(b){var c=this.$tableBody.childNodes,a,p;this.instance.blockedRows.createCol();
if(!b||b.col>=this.instance.countCols())for(a=0;a<this.instance.rowCount;a++)c[a].appendChild(p=document.createElement("td")),this.instance.minWidthFix(p);else for(a=0;a<this.instance.rowCount;a++)c[a].insertBefore(p=document.createElement("td"),this.instance.getCell(a,b.col)),this.instance.minWidthFix(p);this.instance.colCount++};c.TableView.prototype.removeRow=function(c,e){if(!c||c.row===this.instance.rowCount-1)b(this.$tableBody.childNodes[this.instance.rowCount-1]).remove(),this.instance.rowCount--;
else for(var a=e.row;a>=c.row;a--)b(this.$tableBody.childNodes[a]).remove(),this.instance.rowCount--};c.TableView.prototype.removeCol=function(c,e){var a=this.$tableBody.childNodes,p,m;this.instance.blockedRows&&(p=this.instance.table.find("thead th"));var j=0;if(!c||c.col===this.instance.colCount-1){for(;j<this.instance.rowCount;j++)b(a[j].childNodes[this.instance.colCount+this.instance.blockedCols.count()-1]).remove(),p&&p.eq(this.instance.colCount+this.instance.blockedCols.count()-1).remove();
this.instance.colCount--}else{for(;j<this.instance.rowCount;j++)for(m=e.col;m>=c.col;m--)b(a[j].childNodes[m+this.instance.blockedCols.count()]).remove();if(p)for(m=e.col;m>=c.col;m--)p.eq(m+this.instance.blockedCols.count()).remove();this.instance.colCount-=e.col-c.col+1}};c.TableView.prototype.render=function(b,c,a,p){a={row:b,col:c};b=this.instance.getCell(b,c);this.applyCellTypeMethod("renderer",b,a,p);this.instance.minWidthFix(b);return b};c.TableView.prototype.renderRow=function(b){var c,a;
for(c=0;c<this.instance.colCount;c++)a=this.instance.colToProp(c),this.render(b,c,a,this.instance.getData()[b][a])};c.TableView.prototype.renderCol=function(b){var c,a=this.instance.countRows(),p;for(c=0;c<a;c++)p=this.instance.colToProp(b),this.render(c,b,p,this.instance.getData()[c][p])};c.TableView.prototype.applyCellTypeMethod=function(b,e,a,p){var m=this.instance.colToProp(a.col),j,h=this.instance.getCellMeta(a.row,a.col);h.type&&"function"===typeof h.type[b]&&(j=h.type[b]);"function"!==typeof j&&
(j=c.TextCell[b]);return j(this.instance,e,a.row,a.col,m,p,h)};c.TableView.prototype.getCellCoords=function(b){return{row:b.parentNode.rowIndex-this.instance.blockedRows.count(),col:b.cellIndex-this.instance.blockedCols.count()}};c.TableView.prototype.getCellAtCoords=function(b){if(0>b.row||0>b.col)return null;var c=this.$tableBody.childNodes[b.row];return c?c.childNodes[b.col+this.instance.blockedCols.count()]:null};c.TableView.prototype.getAllCells=function(){var b=[],c,a,p,m,j;c=this.$tableBody.childNodes;
p=this.instance.rowCount;if(0<p){j=this.instance.colCount;for(a=0;a<p;a++)for(m=0;m<j;m++)b.push(c[a].childNodes[m+this.instance.blockedCols.count()])}return b};c.TableView.prototype.scrollViewport=function(c){if(!this.instance.selection.isSelected())return!1;c=b(c);var e=c.offset(),a=this.scrollable.scrollLeft(),p=this.scrollable.scrollTop(),m=this.scrollable.offset(),j=this.instance.blockedCols.count()?b(this.instance.blockedCols.main[0].firstChild).outerWidth():2,h=this.instance.blockedRows.count()?
b(this.instance.blockedRows.main[0].firstChild).outerHeight():2,g=e.top,k=e.left,l,r;m?(l=this.scrollable.outerWidth(),r=this.scrollable.outerHeight(),g+=p-m.top,k+=a-m.left):(l=this.scrollable.width(),r=this.scrollable.height());l-=this.scrollbarSize.width;r-=this.scrollbarSize.height;var q=c.outerHeight(),w=c.outerWidth(),f=this;a+l<=k+w?setTimeout(function(){f.scrollable.scrollLeft(k+w-l)},1):a>k-j&&setTimeout(function(){f.scrollable.scrollLeft(k-j)},1);p+r<=g+q?setTimeout(function(){f.scrollable.scrollTop(g+
q-r)},1):p>g-h&&setTimeout(function(){f.scrollable.scrollTop(g-h)},1)};c.helper.isPrintableChar=function(b){return 32==b||48<=b&&57>=b||96<=b&&111>=b||186<=b&&192>=b||219<=b&&222>=b||226<=b||65<=b&&90>=b};c.helper.stringify=function(b){switch(typeof b){case "string":case "number":return b+"";case "object":return null===b?"":b.toString();case "undefined":return"";default:return b.toString()}};c.Border=function(c,e){this.instance=c;this.$container=c.container;var a=this.$container[0];e.bg&&(this.bg=
document.createElement("div"),this.bg.className="htBorderBg "+e.className,a.insertBefore(this.bg,a.firstChild));this.main=document.createElement("div");this.main.style.position="absolute";this.main.style.top=0;this.main.style.left=0;this.main.innerHTML=Array(5).join('<div class="htBorder '+e.className+'"></div>');this.disappear();a.appendChild(this.main);a=this.main.childNodes;this.top=a[0];this.left=a[1];this.bottom=a[2];this.right=a[3];this.borderWidth=b(this.left).width()};c.Border.prototype={appear:function(c){var e,
a,p,m,j,h;this.disabled||(this.corners=this.instance.getCornerCoords(c),e=b(this.instance.getCell(this.corners.TL.row,this.corners.TL.col)),a=1<c.length?b(this.instance.getCell(this.corners.BR.row,this.corners.BR.col)):e,p=e.offset(),m=1<c.length?a.offset():p,j=this.$container.offset(),h=p.top,c=m.top+a.outerHeight()-h,p=p.left,a=m.left+a.outerWidth()-p,h=h-j.top+this.$container.scrollTop()-1,j=p-j.left+this.$container.scrollLeft()-1,0<parseInt(e.css("border-top-width"))&&(h+=1,c-=1),0<parseInt(e.css("border-left-width"))&&
(j+=1,a-=1),this.bg&&(this.bg.style.top=h+"px",this.bg.style.left=j+"px",this.bg.style.width=a+"px",this.bg.style.height=c+"px",this.bg.style.display="block"),this.top.style.top=h+"px",this.top.style.left=j+"px",this.top.style.width=a+"px",this.left.style.top=h+"px",this.left.style.left=j+"px",this.left.style.height=c+"px",e=Math.floor(this.borderWidth/2),this.bottom.style.top=h+c-e+"px",this.bottom.style.left=j+"px",this.bottom.style.width=a+"px",this.right.style.top=h+"px",this.right.style.left=
j+a-e+"px",this.right.style.height=c+1+"px",this.main.style.display="block")},disappear:function(){this.main.style.display="none";this.bg&&(this.bg.style.display="none");this.corners=null}};c.FillHandle=function(c){this.instance=c;this.$container=c.container;c=this.$container[0];this.handle=document.createElement("div");this.handle.className="htFillHandle";this.disappear();c.appendChild(this.handle);var e=this;b(this.handle).mousedown(function(){e.isDragged=1});this.$container.find("table").on("selectstart",
function(a){a.preventDefault()})};c.FillHandle.prototype={appear:function(c){if(!this.disabled){var e,a,p;c=this.instance.getCornerCoords(c);e=b(this.instance.getCell(c.BR.row,c.BR.col));a=e.offset();p=this.$container.offset();c=a.top-p.top+this.$container.scrollTop()-1;a=a.left-p.left+this.$container.scrollLeft()-1;p=e.outerHeight();e=e.outerWidth();this.handle.style.top=c+p-3+"px";this.handle.style.left=a+e-3+"px";this.handle.style.display="block"}},disappear:function(){this.handle.style.display=
"none"}};c.UndoRedo=function(b){var c=this;this.instance=b;this.clear();b.rootElement.on("datachange.handsontable",function(a,b,m){"undo"!==m&&"redo"!==m&&c.add(b)})};c.UndoRedo.prototype.undo=function(){var c,e;if(this.isUndoAvailable()){var a=b.extend(!0,[],this.data[this.rev]);c=0;for(e=a.length;c<e;c++)a[c].splice(3,1);this.instance.setDataAtCell(a,null,null,"undo");this.rev--}};c.UndoRedo.prototype.redo=function(){var c,e;if(this.isRedoAvailable()){this.rev++;var a=b.extend(!0,[],this.data[this.rev]);
c=0;for(e=a.length;c<e;c++)a[c].splice(2,1);this.instance.setDataAtCell(a,null,null,"redo")}};c.UndoRedo.prototype.isUndoAvailable=function(){return 0<=this.rev};c.UndoRedo.prototype.isRedoAvailable=function(){return this.rev<this.data.length-1};c.UndoRedo.prototype.add=function(b){this.rev++;this.data.splice(this.rev);this.data.push(b)};c.UndoRedo.prototype.clear=function(){this.data=[];this.rev=-1};c.BlockedRows=function(c){var e=this;this.instance=c;this.headers=[];var a=c.table.position();c.positionFix(a);
this.main=b('<div style="position: absolute; top: '+a.top+"px; left: "+a.left+'px"><table class="htBlockedRows" cellspacing="0" cellpadding="0"><thead></thead></table></div>');this.instance.container.append(this.main);this.hasCSS3=!(b.browser.msie&&8>=parseInt(b.browser.version,10));this.update();this.instance.rootElement.on("cellrender.handsontable",function(){setTimeout(function(){e.dimensions()},10)})};c.BlockedRows.prototype.count=function(){return this.headers.length};c.BlockedRows.prototype.createCol=
function(c){var e,a,p=this.count();for(a=0;a<p;a++)e=this.main.find("thead tr."+this.headers[a].className),e.length||(e=b('<tr class="'+this.headers[a].className+'"></tr>'),this.main.find("thead").append(e)),e=this.instance.table.find("thead tr."+this.headers[a].className),e.length||(e=b('<tr class="'+this.headers[a].className+'"></tr>'),this.instance.table.find("thead").append(e)),e=document.createElement("th"),e.className=this.headers[a].className,c&&(e.className+=" "+c),e.innerHTML=this.headerText("&nbsp;"),
this.instance.minWidthFix(e),this.instance.table.find("thead tr."+this.headers[a].className)[0].appendChild(e),e=document.createElement("th"),e.className=this.headers[a].className,c&&(e.className+=" "+c),this.instance.minWidthFix(e),this.main.find("thead tr."+this.headers[a].className)[0].appendChild(e)};c.BlockedRows.prototype.create=function(){var b;if(0<this.count()){this.instance.table.find("thead").empty();this.main.find("thead").empty();for(b=this.instance.blockedCols.count()-1;0<=b;b--)this.createCol(this.instance.blockedCols.headers[b].className);
for(b=0;b<this.instance.colCount;b++)this.createCol()}this.hasCSS3||(this.instance.container.find("thead tr.lastChild").not(":last-child").removeClass("lastChild"),this.instance.container.find("thead tr:last-child").not(".lastChild").addClass("lastChild"))};c.BlockedRows.prototype.refresh=function(){var c;if(0<this.count()){var e=this.count(),a;for(a=0;a<e;a++){c=this.main.find("thead tr."+this.headers[a].className)[0];for(var p=c.childNodes,m=p.length,j=this.instance.blockedCols.count();m>this.instance.colCount+
j;)m--,b(c.childNodes[m]).remove();for(a=0;a<e;a++)for(var h=this.instance.table.find("thead th."+this.headers[a].className),g=0;g<m;g++)c=this.headers[a].columnLabel(g-j),this.headers[a].format&&"small"===this.headers[a].format?(h[g].innerHTML=this.headerText(c),p[g].innerHTML=this.headerText(c)):(h[g].innerHTML=c,p[g].innerHTML=c),this.instance.minWidthFix(h[g]),this.instance.minWidthFix(p[g]),p[g].style.minWidth=h.eq(g).width()+"px"}this.ths=this.main.find("tr:last-child th");this.refreshBorders()}};
c.BlockedRows.prototype.refreshBorders=function(){0<this.count()&&(0===this.instance.curScrollTop?this.ths.css("borderBottomWidth",0):0===this.instance.lastScrollTop&&this.ths.css("borderBottomWidth","1px"))};c.BlockedRows.prototype.dimensions=function(){if(0<this.count())for(var c=this.instance.table.find("thead th"),e=0,a=c.length;e<a;e++)this.ths[e].style.minWidth=b(c[e]).width()+"px"};c.BlockedRows.prototype.update=function(){this.create();this.refresh()};c.BlockedRows.prototype.addHeader=function(b){for(var c=
this.count()-1;0<=c;c--)this.headers[c].className===b.className&&this.headers.splice(c,1);this.headers.push(b);this.headers.sort(function(a,b){return a.priority||0-b.priority||0});this.update()};c.BlockedRows.prototype.destroyHeader=function(b){for(var c=this.count()-1;0<=c;c--)this.headers[c].className===b&&(this.main.find("thead tr."+this.headers[c].className).remove(),this.instance.table.find("thead tr."+this.headers[c].className).remove(),this.headers.splice(c,1))};c.BlockedRows.prototype.headerText=
function(b){return'&nbsp;<span class="small">'+b+"</span>&nbsp;"};c.BlockedCols=function(c){var e=this;this.instance=c;this.headers=[];var a=c.table.position();c.positionFix(a);this.main=b('<div style="position: absolute; top: '+a.top+"px; left: "+a.left+'px"><table class="htBlockedCols" cellspacing="0" cellpadding="0"><thead><tr></tr></thead><tbody></tbody></table></div>');this.instance.container.append(this.main);this.heightMethod=this.determineCellHeightMethod();this.instance.rootElement.on("cellrender.handsontable",
function(){setTimeout(function(){e.dimensions()},10)})};c.BlockedCols.prototype.determineCellHeightMethod=function(){return"height"};c.BlockedCols.prototype.count=function(){return this.headers.length};c.BlockedCols.prototype.createRow=function(b){for(var c,a=document.createElement("tr"),h=0,m=this.count();h<m;h++)c=document.createElement("th"),c.className=this.headers[h].className,this.instance.minWidthFix(c),b.insertBefore(c,b.firstChild),c=document.createElement("th"),c.className=this.headers[h].className,
a.insertBefore(c,a.firstChild);this.main.find("tbody")[0].appendChild(a)};c.BlockedCols.prototype.create=function(){var b=this.count(),c,a;this.main.find("tbody").empty();this.instance.table.find("tbody th").remove();var h=this.main.find("thead tr");h.empty();if(0<b){if(this.instance.blockedRows.count())for(c=0;c<b;c++)a=h[0].getElementsByClassName?h[0].getElementsByClassName(this.headers[c].className)[0]:h.find("."+this.headers[c].className.replace(/\s/i,"."))[0],a||(a=document.createElement("th"),
a.className=this.headers[c].className,a.innerHTML=this.headerText("&nbsp;"),this.instance.minWidthFix(a),h[0].insertBefore(a,h[0].firstChild));b=this.instance.table.find("tbody")[0].childNodes;for(c=0;c<this.instance.rowCount;c++)this.createRow(b[c])}};c.BlockedCols.prototype.refresh=function(){var c=this.count(),e,a,h,m,j;if(0<c){e=this.main.find("tbody")[0];for(var t=e.childNodes,g=t.length;g>this.instance.rowCount;)g--,b(e.childNodes[g]).remove();var k=this.instance.table.find("tbody tr");for(m=
0;m<g;m++)for(e=0;e<c;e++)j=this.headers[e].columnLabel(m),h=k[m].getElementsByClassName?k[m].getElementsByClassName(this.headers[e].className)[0]:b(k[m]).find("."+this.headers[e].className.replace(/\s/i,"."))[0],a=t[m].getElementsByClassName?t[m].getElementsByClassName(this.headers[e].className)[0]:b(t[m]).find("."+this.headers[e].className.replace(/\s/i,"."))[0],this.headers[e].format&&"small"===this.headers[e].format?(h.innerHTML=this.headerText(j),a.innerHTML=this.headerText(j)):(h.innerHTML=
j,a.innerHTML=j),this.instance.minWidthFix(a),a.style.height=b(h)[this.heightMethod]()+"px";this.ths=this.main.find("th:last-child");this.refreshBorders()}};c.BlockedCols.prototype.refreshBorders=function(){0<this.count()&&(0===this.instance.curScrollLeft?this.ths.css("borderRightWidth",0):0===this.instance.lastScrollLeft&&this.ths.css("borderRightWidth","1px"))};c.BlockedCols.prototype.dimensions=function(){if(0<this.count())for(var c=this.instance.table[0].getElementsByTagName("tbody")[0].childNodes,
e=this.main[0].firstChild.getElementsByTagName("tbody")[0].childNodes,a=0,h=c.length;a<h;a++)e[a].firstChild.style.height=b(c[a].firstChild)[this.heightMethod]()+"px"};c.BlockedCols.prototype.update=c.BlockedRows.prototype.update;c.BlockedCols.prototype.addHeader=function(b){for(var c=this.count()-1;0<=c;c--)this.headers[c].className===b.className&&this.headers.splice(c,1);this.headers.push(b);this.headers.sort(function(a,b){return a.priority||0-b.priority||0})};c.BlockedCols.prototype.destroyHeader=
function(b){for(var c=this.count()-1;0<=c;c--)this.headers[c].className===b&&this.headers.splice(c,1)};c.BlockedCols.prototype.headerText=c.BlockedRows.prototype.headerText;c.RowHeader=function(c,e){var a=this;this.className="htRowHeader";c.blockedCols.main.on("mousedown","th.htRowHeader",function(e){!b(e.target).hasClass("btn")&&!b(e.target).hasClass("btnContainer")&&(c.deselectCell(),b(this).addClass("active"),a.lastActive=this,e=c.blockedRows.count(),c.selectCell(this.parentNode.rowIndex-e,0,this.parentNode.rowIndex-
e,c.colCount-1,!1))});c.rootElement.on("deselect.handsontable",function(){a.deselect()});this.labels=e;this.instance=c;this.instance.rowHeader=this;this.format="small";c.blockedCols.addHeader(this)};c.RowHeader.prototype.columnLabel=function(b){return"undefined"!==typeof this.labels[b]?this.labels[b]:b+1};c.RowHeader.prototype.deselect=function(){this.lastActive&&(b(this.lastActive).removeClass("active"),this.lastActive=null)};c.RowHeader.prototype.destroy=function(){this.instance.blockedCols.destroyHeader(this.className)};
c.ColHeader=function(c,e){var a=this;this.className="htColHeader";c.blockedRows.main.on("mousedown","th.htColHeader",function(){c.deselectCell();var e=b(this);e.addClass("active");a.lastActive=this;var e=e.index(),m=c.blockedCols?c.blockedCols.count():0;c.selectCell(0,e-m,c.countRows()-1,e-m,!1)});c.rootElement.on("deselect.handsontable",function(){a.deselect()});this.instance=c;this.labels=e;this.instance.colHeader=this;this.format="small";c.blockedRows.addHeader(this)};c.ColHeader.prototype.columnLabel=
function(b){if("undefined"!==typeof this.labels[b])return this.labels[b];b+=1;for(var c="",a;0<b;)a=(b-1)%26,c=String.fromCharCode(65+a)+c,b=parseInt((b-a)/26);return c};c.ColHeader.prototype.deselect=c.RowHeader.prototype.deselect;c.ColHeader.prototype.destroy=function(){this.instance.blockedRows.destroyHeader(this.className)};c.TextRenderer=function(b,e,a,h,m,j){b=c.helper.stringify(j);b=b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");
e.innerHTML=b.replace(/\n/g,"<br/>")};c.AutocompleteRenderer=function(h,e,a,p,m,j,t){var g=b(e);e=b('<div class="htAutocomplete"></div>');var k=b('<div class="htAutocompleteArrow">&#x25BC;</div>');k.mouseup(function(){g.triggerHandler("dblclick.editor")});c.TextCell.renderer(h,e[0],a,p,m,j,t);""===e.html()&&e.html("&nbsp;");e.append(k);g.empty().append(e)};c.CheckboxRenderer=function(h,e,a,p,m,j,t){"undefined"===typeof t.checkedTemplate&&(t.checkedTemplate=!0);"undefined"===typeof t.uncheckedTemplate&&
(t.uncheckedTemplate=!1);e.innerHTML=j===t.checkedTemplate||j===c.helper.stringify(t.checkedTemplate)?"<input type='checkbox' checked autocomplete='no'>":j===t.uncheckedTemplate||j===c.helper.stringify(t.uncheckedTemplate)?"<input type='checkbox' autocomplete='no'>":null===j?"<input type='checkbox' autocomplete='no' style='opacity: 0.5'>":"#bad value#";b(e).find("input").change(function(){b(this).is(":checked")?h.setDataAtCell(a,m,t.checkedTemplate):h.setDataAtCell(a,m,t.uncheckedTemplate)});return e};
var q={isCellEdited:!1,getCaretPosition:function(b){var c=b[0];if(c.selectionStart)return c.selectionStart;if(document.selection){c.focus();b=document.selection.createRange();if(null==b)return 0;var c=c.createTextRange(),a=c.duplicate();c.moveToBookmark(b.getBookmark());a.setEndPoint("EndToStart",c);return a.text.length}return 0},setCaretPosition:function(b,c){var a=b[0];a.setSelectionRange?(a.focus(),a.setSelectionRange(c,c)):a.createTextRange&&(a=a.createTextRange(),a.collapse(!0),a.moveEnd("character",
c),a.moveStart("character",c),a.select())},beginEditing:function(h,e,a,p,m,j,t,g){q.isCellEdited||(j.on("cut.editor",function(a){a.stopPropagation()}),j.on("paste.editor",function(a){a.stopPropagation()}),e=b(e),h.getCellMeta(a,p).isWritable&&(q.isCellEdited=!0,t?(a=h.getDataAtCell(a,m),a=c.helper.stringify(a)+(g||""),j.val(a),q.setCaretPosition(j,a.length)):j.val(""),q.refreshDimensions(h,e,j),j.parent().removeClass("htHidden"),h.rootElement.triggerHandler("beginediting.handsontable"),setTimeout(function(){j.parent().css({overflow:"visible"})},
1)))},refreshDimensions:function(b,c,a){if(q.isCellEdited){var h=c.width(),m=c.outerHeight()-4;0<parseInt(c.css("border-top-width"))&&(m-=1);0<parseInt(c.css("border-left-width"))&&0<b.blockedCols.count()&&(h-=1);a.autoResize({maxHeight:200,minHeight:m,minWidth:h,maxWidth:Math.max(168,h),animate:!1,extraSpace:0})}},finishEditing:function(c,e,a,h,m,j,t,g){q.triggerOnlyByDestroyer||(q.isCellEdited&&(q.isCellEdited=!1,m=t?[[q.originalValue]]:[[b.trim(j.val())]],g?(a=c.handsontable("getSelected"),c.populateFromArray({row:a[0],
col:a[1]},m,{row:a[2],col:a[3]},!1,"edit")):c.populateFromArray({row:a,col:h},m,null,!1,"edit")),j.off(".editor"),b(e).off(".editor"),j.css({width:0,height:0}),j.parent().addClass("htHidden").css({overflow:"hidden"}),c.container.find(".htBorder.current").off(".editor"),c.rootElement.triggerHandler("finishediting.handsontable"))}};c.TextEditor=function(h,e,a,p,m,j,t){function g(){j[0].focus();q.beginEditing(h,e,a,p,m,j,!0)}q.isCellEdited=!1;q.originalValue=h.getDataAtCell(a,m);q.triggerOnlyByDestroyer=
t.strict;t=b(e);var k=t.offset(),l=h.container.offset(),r=h.container.scrollTop(),w=h.container.scrollLeft(),r=k.top-l.top+r-1,k=k.left-l.left+w-1;0>r&&(r=0);0>k&&(k=0);0<h.blockedRows.count()&&0<parseInt(t.css("border-top-width"))&&(r+=1);0<h.blockedCols.count()&&0<parseInt(t.css("border-left-width"))&&(k+=1);b.browser.msie&&7>=parseInt(b.browser.version,10)&&(r-=1);j.parent().addClass("htHidden").css({top:r,left:k,overflow:"hidden"});j.css({width:0,height:0});j.on("refreshBorder.editor",function(){setTimeout(function(){q.isCellEdited&&
q.refreshDimensions(h,b(e),j)},0)});j.on("keydown.editor",function(g){var f=(g.ctrlKey||g.metaKey)&&!g.altKey;if(c.helper.isPrintableChar(g.keyCode))!q.isCellEdited&&!f?(q.beginEditing(h,e,a,p,m,j),g.stopImmediatePropagation()):f&&(q.isCellEdited&&65===g.keyCode?g.stopPropagation():q.isCellEdited&&88===g.keyCode&&b.browser.opera?g.stopPropagation():q.isCellEdited&&(86===g.keyCode&&b.browser.opera)&&g.stopPropagation());else switch(g.keyCode){case 38:q.isCellEdited&&q.finishEditing(h,e,a,p,m,j,!1);
break;case 9:q.isCellEdited&&q.finishEditing(h,e,a,p,m,j,!1);g.preventDefault();break;case 39:q.isCellEdited&&(q.getCaretPosition(j)===j.val().length?q.finishEditing(h,e,a,p,m,j,!1):g.stopPropagation());break;case 37:q.isCellEdited&&(0===q.getCaretPosition(j)?q.finishEditing(h,e,a,p,m,j,!1):g.stopPropagation());break;case 8:case 46:q.isCellEdited&&g.stopPropagation();break;case 40:q.isCellEdited&&q.finishEditing(h,e,a,p,m,j,!1);break;case 27:q.isCellEdited&&(h.destroyEditor(!0),g.stopPropagation());
break;case 113:q.isCellEdited||(q.beginEditing(h,e,a,p,m,j,!0),g.stopPropagation(),g.preventDefault());break;case 13:if(q.isCellEdited){var k=h.getSelected(),k=!(k[0]===k[2]&&k[1]===k[3]);g.ctrlKey&&!k||g.altKey?(j.val(j.val()+"\n"),j[0].focus(),g.stopPropagation()):q.finishEditing(h,e,a,p,m,j,!1,f)}else h.getSettings().enterBeginsEditing&&(f&&!selection.isMultiple()||g.altKey?q.beginEditing(h,e,a,p,m,j,!0,"\n"):q.beginEditing(h,e,a,p,m,j,!0),g.stopPropagation());g.preventDefault();break;case 36:g.stopPropagation();
break;case 35:g.stopPropagation()}});t.on("dblclick.editor",g);h.container.find(".htBorder.current").on("dblclick.editor",g);return function(b){q.triggerOnlyByDestroyer=!1;q.finishEditing(h,e,a,p,m,j,b)}};c.AutocompleteEditor=function(h,e,a,p,m,j,t){function g(){q=!0;setTimeout(function(){j.data("typeahead").lookup()},1)}var l=j.data("typeahead"),r,q=!1;if(l){if(t.options)for(r in t)t.hasOwnProperty(r)&&(l.options[r]=t.options[r]);l.$menu.off();j.off();l.listen()}else j.typeahead(t.options||{}),l=
j.data("typeahead"),l._show=l.show,l._hide=l.hide,l._render=l.render,l._highlighter=l.highlighter;l.minLength=0;l.highlighter=l._highlighter;l.show=function(){if(!j.parent().hasClass("htHidden"))return l._show.call(this)};l.hide=function(){if(!q)return q=!1,l._hide.call(this)};l.lookup=function(){var a;this.query=this.$element.val();return(a=b.isFunction(this.source)?this.source(this.query,b.proxy(this.process,this)):this.source)?this.process(a):this};l.matcher=function(){return!0};l.select=function(){var b=
this.$menu.find(".active").attr("data-value")||j.val();f(!0);h.setDataAtCell(a,m,l.updater(b));return this.hide()};l.render=function(a){l._render.call(this,a);t.strict||this.$menu.find("li:eq(0)").removeClass("active");return this};for(r in t)t.hasOwnProperty(r)&&(l[r]=t[r]);var w=!1;j.on("keydown.editor",function(a){switch(a.keyCode){case 27:q=!1;break;case 37:case 39:case 38:case 40:case 9:case 13:j.parent().hasClass("htHidden")||a.stopImmediatePropagation(),a.preventDefault()}});j.on("keyup.editor",
function(a){if(!w)switch(a.keyCode){case 9:case 13:if(k(j))setTimeout(function(){var c=b.Event("keydown");c.keyCode=a.keyCode;j.parent().trigger(c)},10);else{var e=b.Event("keyup");e.keyCode=113;j.trigger(e)}break;default:c.helper.isPrintableChar(a.keyCode)||a.stopImmediatePropagation()}});var E=c.TextEditor(h,e,a,p,m,j,t);b(e).on("dblclick.editor",g);h.container.find(".htBorder.current").on("dblclick.editor",g);var f=function(a){w=!0;j.off();E(a);q=!1;k(j)&&k(j).hide()};return f};c.CheckboxEditor=
function(k,e,a,p,m,j,t){function g(){h(k,a,m,t)}"undefined"===typeof t&&(t={});"undefined"===typeof t.checkedTemplate&&(t.checkedTemplate=!0);"undefined"===typeof t.uncheckedTemplate&&(t.uncheckedTemplate=!1);j.on("keydown.editor",function(b){if((!b.ctrlKey&&!b.metaKey||b.altKey)&&c.helper.isPrintableChar(b.keyCode))h(k,a,m,t),b.stopPropagation()});var l=b(e);l.on("dblclick.editor",g);k.container.find(".htBorder.current").on("dblclick.editor",g);return function(){j.off(".editor");l.off(".editor");
k.container.find(".htBorder.current").off(".editor")}};c.AutocompleteCell={renderer:c.AutocompleteRenderer,editor:c.AutocompleteEditor};c.CheckboxCell={renderer:c.CheckboxRenderer,editor:c.CheckboxEditor};c.TextCell={renderer:c.TextRenderer,editor:c.TextEditor};c.PluginHooks={hooks:{afterInit:[],afterGetCellMeta:[]},push:function(b,c){this.hooks[b].push(c)},unshift:function(b,c){this.hooks[b].unshift(c)},run:function(b,c,a){for(var h=0,m=this.hooks[c].length;h<m;h++)a?this.hooks[c][h].apply(b,a):
this.hooks[c][h].call(b)}};c.PluginHooks.push("afterInit",function(){function c(a){return e.blockedCols.main.find("th.htRowHeader.active").length&&("remove_col"===a||"col_left"===a||"col_right"===a)?!0:e.blockedRows.main.find("th.htColHeader.active").length&&("remove_row"===a||"row_above"===a||"row_below"===a)?!0:e.countRows()>=e.getSettings().maxRows&&("row_above"===a||"row_below"===a)?!0:e.countCols()>=e.getSettings().maxCols&&("col_left"===a||"col_right"===a)?!0:!1}var e=this,a={selector:"#"+e.rootElement.attr("id")+
" table, #"+e.rootElement.attr("id")+" div",trigger:"right",callback:function(a){var b=e.getSelected();switch(a){case "row_above":e.alter("insert_row",b[0]);break;case "row_below":e.alter("insert_row",b[2]+1);break;case "col_left":e.alter("insert_col",b[1]);break;case "col_right":e.alter("insert_col",b[3]+1);break;case "remove_row":e.alter(a,b[0],b[2]);break;case "remove_col":e.alter(a,b[1],b[3]);break;case "undo":e.undo();break;case "redo":e.redo()}}},h={row_above:{name:"Sett inn rad over",disabled:c},
row_below:{name:"Sett inn rad under",disabled:c},hsep1:"---------",col_left:{name:"Insert column on the left",disabled:c},col_right:{name:"Insert column on the right",disabled:c},hsep2:"---------",remove_row:{name:"Slett rad",disabled:c},remove_col:{name:"Remove column",disabled:c},hsep3:"---------",undo:{name:"Undo",disabled:function(){return!e.isUndoAvailable()}},redo:{name:"Redo",disabled:function(){return!e.isRedoAvailable()}}},m={},j,k,g=e.getSettings();if(g.contextMenu){if(!0===g.contextMenu)m.items=
h;else if("[object Array]"===Object.prototype.toString.apply(g.contextMenu)){m.items={};j=0;for(k=g.contextMenu.length;j<k;j++){var l=g.contextMenu[j];if("undefined"===typeof h[l])throw Error('Context menu key "'+l+'" is not recognised');m.items[l]=h[l]}}else if("[object Object]"===Object.prototype.toString.apply(g.contextMenu)){m=g.contextMenu;if(m.items)for(j in m.items)m.items.hasOwnProperty(j)&&h[j]&&(m.items[j]="string"===typeof m.items[j]?h[j]:b.extend(!0,h[j],m.items[j]));else m.items=h;if(m.callback){var r=
a.callback,q=m.callback;m.callback=function(a,b){r(a,b);q(a,b)}}}if(!e.rootElement.attr("id"))throw Error("Handsontable container must have an id");b.contextMenu(b.extend(!0,a,m))}});c.PluginHooks.push("afterGetCellMeta",function(b,e,a){var h=this.getSettings(),m=this.getData(),j,k,g;if(h.autoComplete){j=0;for(k=h.autoComplete.length;j<k;j++)if(h.autoComplete[j].match(b,e,m)){"undefined"===typeof a.type?a.type=c.AutocompleteCell:("undefined"===typeof a.type.renderer&&(a.type.renderer=c.AutocompleteCell.renderer),
"undefined"===typeof a.type.editor&&(a.type.editor=c.AutocompleteCell.editor));for(g in h.autoComplete[j])h.autoComplete[j].hasOwnProperty(g)&&("match"!==g&&"undefined"===typeof a[j])&&(a[g]="source"===g?h.autoComplete[j][g](b,e):h.autoComplete[j][g]);break}}});var w=jQuery,E=function(b){this.filter(E.resizableFilterSelector).each(function(){new P(w(this),b)});return this},P=function(b,c){this.clones||(this.config=w.extend({},E.defaults,c),this.el=b,this.nodeName=b[0].nodeName.toLowerCase(),this.previousScrollTop=
null,"original"===c.maxWidth&&(c.maxWidth=b.width()),"original"===c.minWidth&&(c.minWidth=b.width()),"original"===c.maxHeight&&(c.maxHeight=b.height()),"original"===c.minHeight&&(c.minHeight=b.height()),"textarea"===this.nodeName&&b.css({resize:"none",overflowY:"hidden"}),b.data("AutoResizer",this),this.createClone(),this.injectClone(),this.bind())};E.defaults={onResize:function(){},animate:{duration:200,complete:function(){}},extraSpace:50,minHeight:"original",maxHeight:500,minWidth:"original",maxWidth:500};
E.cloneCSSProperties="lineHeight textDecoration letterSpacing fontSize fontFamily fontStyle fontWeight textTransform textAlign direction wordSpacing fontSizeAdjust padding".split(" ");E.cloneCSSValues={position:"absolute",top:-9999,left:-9999,opacity:0,overflow:"hidden",border:"1px solid black",padding:"0.49em"};E.resizableFilterSelector="textarea,input:not(input[type]),input[type=text],input[type=password]";E.AutoResizer=P;w.fn.autoResize=E;P.prototype={bind:function(){var b=w.proxy(function(){this.check();
return!0},this);this.unbind();this.el.bind("keyup.autoResize",b).bind("change.autoResize",b);this.check(null,!0)},unbind:function(){this.el.unbind(".autoResize")},createClone:function(){var b=this.el,c=this,a=this.config;this.clones=w();if("original"!==a.minHeight||"original"!==a.maxHeight)this.hClone=b.clone().height("auto"),this.clones=this.clones.add(this.hClone);if("original"!==a.minWidth||"original"!==a.maxWidth)this.wClone=w("<div/>").width("auto").css({whiteSpace:"nowrap","float":"left"}),
this.clones=this.clones.add(this.wClone);w.each(E.cloneCSSProperties,function(a,m){c.clones.css(m,b.css(m))});this.clones.removeAttr("name").removeAttr("id").attr("tabIndex",-1).css(E.cloneCSSValues)},check:function(b,c){var a=this.config,h=this.wClone,m=this.hClone,j=this.el,k=j.val();if(h){h.text(k);var g=h.outerWidth(),g=g+a.extraSpace>=a.minWidth?g+a.extraSpace:a.minWidth,h=j.width(),g=Math.min(g,a.maxWidth);if(g<h&&g>=a.minWidth||g>=a.minWidth&&g<=a.maxWidth)a.onResize.call(j),j.scrollLeft(0),
a.animate&&!c?j.stop(1,1).animate({width:g},a.animate):j.width(g)}m&&(g&&m.width(g),m.height(0).val(k).scrollTop(1E4),m=m[0].scrollTop+a.extraSpace,this.previousScrollTop!==m&&(this.previousScrollTop=m,m>=a.maxHeight?j.css("overflowY",""):(j.css("overflowY","hidden"),m<a.minHeight&&(m=a.minHeight),a.onResize.call(j),a.animate&&!c?j.stop(1,1).animate({height:m},a.animate):j.height(m))))},destroy:function(){this.unbind();this.el.removeData("AutoResizer");this.clones.remove();delete this.el;delete this.hClone;
delete this.wClone;delete this.clones},injectClone:function(){(E.cloneContainer||(E.cloneContainer=w("<arclones/>").appendTo("body"))).append(this.clones)}};var R=jQuery,J=function(b){var c=b||l.event,a=[].slice.call(arguments,1),h=0,m=0,j=0;b=R.event.fix(c);b.type="mousewheel";c.wheelDelta&&(h=c.wheelDelta/120);c.detail&&(h=-c.detail/3);j=h;void 0!==c.axis&&c.axis===c.HORIZONTAL_AXIS&&(j=0,m=-1*h);void 0!==c.wheelDeltaY&&(j=c.wheelDeltaY/120);void 0!==c.wheelDeltaX&&(m=-1*c.wheelDeltaX/120);a.unshift(b,
h,m,j);return(R.event.dispatch||R.event.handle).apply(this,a)},V=["DOMMouseScroll","mousewheel"];if(R.event.fixHooks)for(var T=V.length;T;)R.event.fixHooks[V[--T]]=R.event.mouseHooks;R.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var b=V.length;b;)this.addEventListener(V[--b],J,!1);else this.onmousewheel=J},teardown:function(){if(this.removeEventListener)for(var b=V.length;b;)this.removeEventListener(V[--b],J,!1);else this.onmousewheel=null}};R.fn.extend({mousewheel:function(b){return b?
this.bind("mousewheel",b):this.trigger("mousewheel")},unmousewheel:function(b){return this.unbind("mousewheel",b)}});l.SheetClip={parse:function(b){var c,a,h=[],m=0,j,k,g,l;a=b.split("\n");1<a.length&&""===a[a.length-1]&&a.pop();b=0;for(c=a.length;b<c;b+=1){a[b]=a[b].split("\t");j=0;for(k=a[b].length;j<k;j+=1)h[m]||(h[m]=[]),g&&0===j?(l=h[m].length-1,h[m][l]=h[m][l]+"\n"+a[b][0],g&&1===(a[b][0].split('"').length-1)%2&&(g=!1,h[m][l]=h[m][l].substring(0,h[m][l].length-1).replace(/""/g,'"'))):j===k-
1&&0===a[b][j].indexOf('"')?(h[m].push(a[b][j].substring(1).replace(/""/g,'"')),g=!0):(h[m].push(a[b][j].replace(/""/g,'"')),g=!1);g||(m+=1)}return h},stringify:function(b){var c,a,h,m,j="",k;c=0;for(a=b.length;c<a;c+=1){h=0;for(m=b[c].length;h<m;h+=1)0<h&&(j+="\t"),k=b[c][h],j="string"===typeof k?-1<k.indexOf("\n")?j+('"'+k.replace(/"/g,'""')+'"'):j+k:null===k||void 0===k?j+"":j+k;j+="\n"}return j}}})(jQuery,window,Handsontable);
!function(b){var l=function(c,k){this.$element=b(c);this.options=b.extend({},b.fn.typeahead.defaults,k);this.matcher=this.options.matcher||this.matcher;this.sorter=this.options.sorter||this.sorter;this.highlighter=this.options.highlighter||this.highlighter;this.updater=this.options.updater||this.updater;this.$menu=b(this.options.menu).appendTo("body");this.source=this.options.source;this.shown=!1;this.listen()};l.prototype={constructor:l,select:function(){var b=this.$menu.find(".active").attr("data-value");
this.$element.val(this.updater(b)).change();return this.hide()},updater:function(b){return b},show:function(){var c=b.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});this.$menu.css({top:c.top+c.height,left:c.left});this.$menu.show();this.shown=!0;return this},hide:function(){this.$menu.hide();this.shown=!1;return this},lookup:function(){var c;this.query=this.$element.val();return!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(c=b.isFunction(this.source)?
this.source(this.query,b.proxy(this.process,this)):this.source)?this.process(c):this},process:function(c){var k=this;c=b.grep(c,function(b){return k.matcher(b)});c=this.sorter(c);return!c.length?this.shown?this.hide():this:this.render(c.slice(0,this.options.items)).show()},matcher:function(b){return~b.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(b){for(var k=[],h=[],l=[],q;q=b.shift();)q.toLowerCase().indexOf(this.query.toLowerCase())?~q.indexOf(this.query)?h.push(q):l.push(q):
k.push(q);return k.concat(h,l)},highlighter:function(b){var k=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return b.replace(RegExp("("+k+")","ig"),function(b,c){return"<strong>"+c+"</strong>"})},render:function(c){var k=this;c=b(c).map(function(c,l){c=b(k.options.item).attr("data-value",l);c.find("a").html(k.highlighter(l));return c[0]});c.first().addClass("active");this.$menu.html(c);return this},next:function(){var c=this.$menu.find(".active").removeClass("active").next();c.length||
(c=b(this.$menu.find("li")[0]));c.addClass("active")},prev:function(){var b=this.$menu.find(".active").removeClass("active").prev();b.length||(b=this.$menu.find("li").last());b.addClass("active")},listen:function(){this.$element.on("blur",b.proxy(this.blur,this)).on("keypress",b.proxy(this.keypress,this)).on("keyup",b.proxy(this.keyup,this));if(b.browser.chrome||b.browser.webkit||b.browser.msie)this.$element.on("keydown",b.proxy(this.keydown,this));this.$menu.on("click",b.proxy(this.click,this)).on("mouseenter",
"li",b.proxy(this.mouseenter,this))},move:function(b){if(this.shown){switch(b.keyCode){case 9:case 13:case 27:b.preventDefault();break;case 38:b.preventDefault();this.prev();break;case 40:b.preventDefault(),this.next()}b.stopPropagation()}},keydown:function(c){this.suppressKeyPressRepeat=!~b.inArray(c.keyCode,[40,38,9,13,27]);this.move(c)},keypress:function(b){this.suppressKeyPressRepeat||this.move(b)},keyup:function(b){switch(b.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;
this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}b.stopPropagation();b.preventDefault()},blur:function(){var b=this;setTimeout(function(){b.hide()},150)},click:function(b){b.stopPropagation();b.preventDefault();this.select()},mouseenter:function(c){this.$menu.find(".active").removeClass("active");b(c.currentTarget).addClass("active")}};b.fn.typeahead=function(c){return this.each(function(){var k=b(this),h=k.data("typeahead"),r="object"==typeof c&&c;h||k.data("typeahead",
h=new l(this,r));if("string"==typeof c)h[c]()})};b.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1};b.fn.typeahead.Constructor=l;b(function(){b("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(c){var k=b(this);k.data("typeahead")||(c.preventDefault(),k.typeahead(k.data()))})})}(window.jQuery);
(function(b,l){function c(a){return a.id&&b('label[for="'+a.id+'"]').val()||a.name}function k(a,e,h){h||(h=0);e.each(function(){var e=b(this),j=this,p=this.nodeName.toLowerCase(),r,q;"label"==p&&e.find("input, textarea, select").length&&(r=e.text(),e=e.children().first(),j=e.get(0),p=j.nodeName.toLowerCase());switch(p){case "menu":q={name:e.attr("label"),items:{}};h=k(q.items,e.children(),h);break;case "a":case "button":q={name:e.text(),disabled:!!e.attr("disabled"),callback:function(){e.click()}};
break;case "menuitem":case "command":switch(e.attr("type")){case l:case "command":case "menuitem":q={name:e.attr("label"),disabled:!!e.attr("disabled"),callback:function(){e.click()}};break;case "checkbox":q={type:"checkbox",disabled:!!e.attr("disabled"),name:e.attr("label"),selected:!!e.attr("checked")};break;case "radio":q={type:"radio",disabled:!!e.attr("disabled"),name:e.attr("label"),radio:e.attr("radiogroup"),value:e.attr("id"),selected:!!e.attr("checked")};break;default:q=l}break;case "hr":q=
"-------";break;case "input":switch(e.attr("type")){case "text":q={type:"text",name:r||c(j),disabled:!!e.attr("disabled"),value:e.val()};break;case "checkbox":q={type:"checkbox",name:r||c(j),disabled:!!e.attr("disabled"),selected:!!e.attr("checked")};break;case "radio":q={type:"radio",name:r||c(j),disabled:!!e.attr("disabled"),radio:!!e.attr("name"),value:e.val(),selected:!!e.attr("checked")};break;default:q=l}break;case "select":q={type:"select",name:r||c(j),disabled:!!e.attr("disabled"),selected:e.val(),
options:{}};e.children().each(function(){q.options[this.value]=b(this).text()});break;case "textarea":q={type:"textarea",name:r||c(j),disabled:!!e.attr("disabled"),value:e.val()};break;case "label":break;default:q={type:"html",html:e.clone(!0)}}q&&(h++,a["key"+h]=q)});return h}b.support.htmlMenuitem="HTMLMenuItemElement"in window;b.support.htmlCommand="HTMLCommandElement"in window;b.support.eventSelectstart="onselectstart"in document.documentElement;var h=null,r=!1,q=b(window),w=0,E={},P={},R={},
J={selector:null,appendTo:null,trigger:"right",autoHide:!1,delay:200,determinePosition:function(a){if(b.ui&&b.ui.position)a.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none");else{var c=this.offset();c.top+=this.outerHeight();c.left+=this.outerWidth()/2-a.outerWidth()/2;a.css(c)}},position:function(a,c,e){if(!c&&!e)a.determinePosition.call(this,a.$menu);else{"maintain"===c&&"maintain"===e?c=a.$menu.position():(a.$trigger.parents().andSelf().filter(function(){return"fixed"==
b(this).css("position")}).length&&(e-=q.scrollTop(),c-=q.scrollLeft()),c={top:e,left:c});e=q.scrollTop()+q.height();var g=q.scrollLeft()+q.width(),h=a.$menu.height(),k=a.$menu.width();c.top+h>e&&(c.top-=h);c.left+k>g&&(c.left-=k);a.$menu.css(c)}},positionSubmenu:function(a){if(b.ui&&b.ui.position)a.css("display","block").position({my:"left top",at:"right top",of:this,collision:"fit"}).css("display","");else{var c={top:0,left:this.outerWidth()};a.css(c)}},zIndex:1,animation:{duration:50,show:"slideDown",
hide:"slideUp"},events:{show:b.noop,hide:b.noop},callback:null,items:{}},V=null,T=null,v=null,e,a={abortevent:function(a){a.preventDefault();a.stopImmediatePropagation()},contextmenu:function(a){var c=b(this);a.preventDefault();a.stopImmediatePropagation();if(!("right"!=a.data.trigger&&a.originalEvent)&&!c.hasClass("context-menu-disabled")){h=c;if(a.data.build){var e=a.data.build(h,a);if(!1===e)return;a.data=b.extend(!0,{},J,a.data,e||{});if(!a.data.items||b.isEmptyObject(a.data.items))throw window.console&&
(console.error||console.log)("No items specified to show in contextMenu"),Error("No Items sepcified");a.data.$trigger=h;p.create(a.data)}p.show.call(c,a.data,a.pageX,a.pageY)}},click:function(a){a.preventDefault();a.stopImmediatePropagation();b(this).trigger(b.Event("contextmenu",{data:a.data,pageX:a.pageX,pageY:a.pageY}))},mousedown:function(a){var c=b(this);h&&(h.length&&!h.is(c))&&h.data("contextMenu").$menu.trigger("contextmenu:hide");2==a.button&&(h=c.data("contextMenuActive",!0))},mouseup:function(a){var c=
b(this);c.data("contextMenuActive")&&(h&&h.length&&h.is(c)&&!c.hasClass("context-menu-disabled"))&&(a.preventDefault(),a.stopImmediatePropagation(),h=c,c.trigger(b.Event("contextmenu",{data:a.data,pageX:a.pageX,pageY:a.pageY})));c.removeData("contextMenuActive")},mouseenter:function(c){var j=b(this),k=b(c.relatedTarget),g=b(document);if(!k.is(".context-menu-list")&&!k.closest(".context-menu-list").length&&(!h||!h.length))T=c.pageX,v=c.pageY,e=c.data,g.on("mousemove.contextMenuShow",a.mousemove),V=
setTimeout(function(){V=null;g.off("mousemove.contextMenuShow");h=j;j.trigger(b.Event("contextmenu",{data:e,pageX:T,pageY:v}))},c.data.delay)},mousemove:function(a){T=a.pageX;v=a.pageY},mouseleave:function(a){a=b(a.relatedTarget);if(!a.is(".context-menu-list")&&!a.closest(".context-menu-list").length){try{clearTimeout(V)}catch(c){}V=null}},layerClick:function(a){var c=b(this),e=c.data("contextMenuRoot"),g=!1,h=a.button,k=a.pageX,p=a.pageY,l,r,f;a.preventDefault();a.stopImmediatePropagation();c.on("mouseup",
function(){g=!0});setTimeout(function(){var w;if("left"==e.trigger&&0==h||"right"==e.trigger&&2==h)if(document.elementFromPoint){e.$layer.hide();l=document.elementFromPoint(k-q.scrollLeft(),p-q.scrollTop());e.$layer.show();f=[];for(w in E)f.push(w);l=b(l).closest(f.join(", "));if(l.length&&l.is(e.$trigger[0])){e.position.call(e.$trigger,e,k,p);return}}else if(r=e.$trigger.offset(),w=b(window),r.top+=w.scrollTop(),r.top<=a.pageY&&(r.left+=w.scrollLeft(),r.left<=a.pageX&&(r.bottom=r.top+e.$trigger.outerHeight(),
r.bottom>=a.pageY&&(r.right=r.left+e.$trigger.outerWidth(),r.right>=a.pageX)))){e.position.call(e.$trigger,e,k,p);return}w=function(a){a&&(a.preventDefault(),a.stopImmediatePropagation());e.$menu.trigger("contextmenu:hide");l&&l.length&&setTimeout(function(){l.contextMenu({x:k,y:p})},50)};if(g)w();else c.on("mouseup",w)},50)},keyStop:function(a,b){b.isInput||a.preventDefault();a.stopPropagation()},key:function(b){var c=h.data("contextMenu")||{};c.$menu.children();switch(b.keyCode){case 9:case 38:if(a.keyStop(b,
c),c.isInput){if(9==b.keyCode&&b.shiftKey){b.preventDefault();c.$selected&&c.$selected.find("input, textarea, select").blur();c.$menu.trigger("prevcommand");return}if(38==b.keyCode&&"checkbox"==c.$selected.find("input, textarea, select").prop("type")){b.preventDefault();return}}else if(9!=b.keyCode||b.shiftKey){c.$menu.trigger("prevcommand");return}case 40:a.keyStop(b,c);if(c.isInput){if(9==b.keyCode){b.preventDefault();c.$selected&&c.$selected.find("input, textarea, select").blur();c.$menu.trigger("nextcommand");
return}if(40==b.keyCode&&"checkbox"==c.$selected.find("input, textarea, select").prop("type")){b.preventDefault();return}}else{c.$menu.trigger("nextcommand");return}break;case 37:a.keyStop(b,c);if(c.isInput||!c.$selected||!c.$selected.length)break;if(!c.$selected.parent().hasClass("context-menu-root")){b=c.$selected.parent().parent();c.$selected.trigger("contextmenu:blur");c.$selected=b;return}break;case 39:a.keyStop(b,c);if(c.isInput||!c.$selected||!c.$selected.length)break;var e=c.$selected.data("contextMenu")||
{};if(e.$menu&&c.$selected.hasClass("context-menu-submenu")){c.$selected=null;e.$selected=null;e.$menu.trigger("nextcommand");return}break;case 35:case 36:if(!c.$selected||!c.$selected.find("input, textarea, select").length)(c.$selected&&c.$selected.parent()||c.$menu).children(":not(.disabled, .not-selectable)")[36==b.keyCode?"first":"last"]().trigger("contextmenu:focus"),b.preventDefault();return;case 13:a.keyStop(b,c);if(c.isInput){if(c.$selected&&!c.$selected.is("textarea, select")){b.preventDefault();
return}break}c.$selected&&c.$selected.trigger("mouseup");return;case 32:case 33:case 34:a.keyStop(b,c);return;case 27:a.keyStop(b,c);c.$menu.trigger("contextmenu:hide");return;default:if(e=String.fromCharCode(b.keyCode).toUpperCase(),c.accesskeys[e]){c.accesskeys[e].$node.trigger(c.accesskeys[e].$menu?"contextmenu:focus":"mouseup");return}}b.stopPropagation();c.$selected&&c.$selected.trigger(b)},prevItem:function(c){c.stopPropagation();var e=b(this).data("contextMenu")||{};if(e.$selected){var h=e.$selected,
e=e.$selected.parent().data("contextMenu")||{};e.$selected=h}for(var h=e.$menu.children(),g=!e.$selected||!e.$selected.prev().length?h.last():e.$selected.prev(),k=g;g.hasClass("disabled")||g.hasClass("not-selectable");)if(g=g.prev().length?g.prev():h.last(),g.is(k))return;e.$selected&&a.itemMouseleave.call(e.$selected.get(0),c);a.itemMouseenter.call(g.get(0),c);c=g.find("input, textarea, select");c.length&&c.focus()},nextItem:function(c){c.stopPropagation();var e=b(this).data("contextMenu")||{};if(e.$selected){var h=
e.$selected,e=e.$selected.parent().data("contextMenu")||{};e.$selected=h}for(var h=e.$menu.children(),g=!e.$selected||!e.$selected.next().length?h.first():e.$selected.next(),k=g;g.hasClass("disabled")||g.hasClass("not-selectable");)if(g=g.next().length?g.next():h.first(),g.is(k))return;e.$selected&&a.itemMouseleave.call(e.$selected.get(0),c);a.itemMouseenter.call(g.get(0),c);c=g.find("input, textarea, select");c.length&&c.focus()},focusInput:function(){var a=b(this).closest(".context-menu-item"),
c=a.data(),e=c.contextMenu,c=c.contextMenuRoot;c.$selected=e.$selected=a;c.isInput=e.isInput=!0},blurInput:function(){var a=b(this).closest(".context-menu-item").data();a.contextMenuRoot.isInput=a.contextMenu.isInput=!1},menuMouseenter:function(){b(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(a){var c=b(this).data().contextMenuRoot;c.$layer&&c.$layer.is(a.relatedTarget)&&(c.hovering=!1)},itemMouseenter:function(a){var c=b(this),e=c.data(),g=e.contextMenu,e=e.contextMenuRoot;e.hovering=
!0;a&&(e.$layer&&e.$layer.is(a.relatedTarget))&&(a.preventDefault(),a.stopImmediatePropagation());(g.$menu?g:e).$menu.children(".hover").trigger("contextmenu:blur");c.hasClass("disabled")||c.hasClass("not-selectable")?g.$selected=null:c.trigger("contextmenu:focus")},itemMouseleave:function(a){var c=b(this),e=c.data(),g=e.contextMenu,e=e.contextMenuRoot;e!==g&&e.$layer&&e.$layer.is(a.relatedTarget)?(e.$selected&&e.$selected.trigger("contextmenu:blur"),a.preventDefault(),a.stopImmediatePropagation(),
e.$selected=g.$selected=g.$node):c.trigger("contextmenu:blur")},itemClick:function(a){var c=b(this),e=c.data(),g=e.contextMenuRoot,h=e.contextMenuKey;if(e.contextMenu.items[h]&&!c.hasClass("disabled")&&!c.hasClass("context-menu-submenu")){a.preventDefault();a.stopImmediatePropagation();if(b.isFunction(g.callbacks[h]))a=g.callbacks[h];else if(b.isFunction(g.callback))a=g.callback;else return;!1!==a.call(g.$trigger,h,g)?g.$menu.trigger("contextmenu:hide"):g.$menu.parent().length&&p.update.call(g.$trigger,
g)}},inputClick:function(a){a.stopImmediatePropagation()},hideMenu:function(a,c){var e=b(this).data("contextMenuRoot");p.hide.call(e.$trigger,e,c&&c.force)},focusItem:function(a){a.stopPropagation();a=b(this);var c=a.data(),e=c.contextMenu,c=c.contextMenuRoot;a.addClass("hover").siblings(".hover").trigger("contextmenu:blur");e.$selected=c.$selected=a;e.$node&&c.positionSubmenu.call(e.$node,e.$menu)},blurItem:function(a){a.stopPropagation();a=b(this);var c=a.data().contextMenu;a.removeClass("hover");
c.$selected=null}},p={show:function(c,e,k){var g=b(this),l={};b("#context-menu-layer").trigger("mousedown");c.$trigger=g;if(!1===c.events.show.call(g,c))h=null;else{p.update.call(g,c);c.position.call(g,c,e,k);if(c.zIndex){e=0;for(k=g;!(e=Math.max(e,parseInt(k.css("z-index"),10)||0),k=k.parent(),!k||!k.length||-1<"html body".indexOf(k.prop("nodeName").toLowerCase())););l.zIndex=e+c.zIndex}p.layer.call(c.$menu,c,l.zIndex);c.$menu.find("ul").css("zIndex",l.zIndex+1);c.$menu.css(l)[c.animation.show](c.animation.duration);
g.data("contextMenu",c);b(document).off("keydown.contextMenu").on("keydown.contextMenu",a.key);if(c.autoHide){var r=g.position();r.right=r.left+g.outerWidth();r.bottom=r.top+this.outerHeight();b(document).on("mousemove.contextMenuAutoHide",function(a){c.$layer&&(!c.hovering&&(!(a.pageX>=r.left&&a.pageX<=r.right)||!(a.pageY>=r.top&&a.pageY<=r.bottom)))&&c.$menu.trigger("contextmenu:hide")})}}},hide:function(a,c){var e=b(this);a||(a=e.data("contextMenu")||{});if(c||!(a.events&&!1===a.events.hide.call(e,
a))){if(a.$layer){var g=a.$layer;setTimeout(function(){g.remove()},10);try{delete a.$layer}catch(k){a.$layer=null}}h=null;a.$menu.find(".hover").trigger("contextmenu:blur");a.$selected=null;b(document).off(".contextMenuAutoHide").off("keydown.contextMenu");a.$menu&&a.$menu[a.animation.hide](a.animation.duration,function(){a.build&&(a.$menu.remove(),b.each(a,function(b){switch(b){case "ns":case "selector":case "build":case "trigger":return!0;default:a[b]=l;try{delete a[b]}catch(c){}return!0}}))})}},
create:function(c,e){e===l&&(e=c);c.$menu=b('<ul class="context-menu-list '+(c.className||"")+'"></ul>').data({contextMenu:c,contextMenuRoot:e});b.each(["callbacks","commands","inputs"],function(a,b){c[b]={};e[b]||(e[b]={})});e.accesskeys||(e.accesskeys={});b.each(c.items,function(h,g){var k=b('<li class="context-menu-item '+(g.className||"")+'"></li>'),l=null,r=null;g.$node=k.data({contextMenu:c,contextMenuRoot:e,contextMenuKey:h});if(g.accesskey){for(var q=g.accesskey.split(/\s+/),w=[],f=0,v;v=
q[f];f++)v=v[0].toUpperCase(),w.push(v);for(q=0;f=w[q];q++)if(!e.accesskeys[f]){e.accesskeys[f]=g;g._name=g.name.replace(RegExp("("+f+")","i"),'<span class="context-menu-accesskey">$1</span>');break}}if("string"==typeof g)k.addClass("context-menu-separator not-selectable");else if(g.type&&R[g.type])R[g.type].call(k,g,c,e),b.each([c,e],function(a,c){c.commands[h]=g;b.isFunction(g.callback)&&(c.callbacks[h]=g.callback)});else{"html"==g.type?k.addClass("context-menu-html not-selectable"):g.type?(l=b("<label></label>").appendTo(k),
b("<span></span>").html(g._name||g.name).appendTo(l),k.addClass("context-menu-input"),c.hasTypes=!0,b.each([c,e],function(a,b){b.commands[h]=g;b.inputs[h]=g})):g.items&&(g.type="sub");switch(g.type){case "text":r=b('<input type="text" value="1" name="context-menu-input-'+h+'" value="">').val(g.value||"").appendTo(l);break;case "textarea":r=b('<textarea name="context-menu-input-'+h+'"></textarea>').val(g.value||"").appendTo(l);g.height&&r.height(g.height);break;case "checkbox":r=b('<input type="checkbox" value="1" name="context-menu-input-'+
h+'" value="">').val(g.value||"").prop("checked",!!g.selected).prependTo(l);break;case "radio":r=b('<input type="radio" value="1" name="context-menu-input-'+g.radio+'" value="">').val(g.value||"").prop("checked",!!g.selected).prependTo(l);break;case "select":r=b('<select name="context-menu-input-'+h+'">').appendTo(l);g.options&&(b.each(g.options,function(a,c){b("<option></option>").val(a).text(c).appendTo(r)}),r.val(g.selected));break;case "sub":b("<span></span>").html(g._name||g.name).appendTo(k);
g.appendTo=g.$node;p.create(g,e);k.data("contextMenu",g).addClass("context-menu-submenu");g.callback=null;break;case "html":b(g.html).appendTo(k);break;default:b.each([c,e],function(a,c){c.commands[h]=g;b.isFunction(g.callback)&&(c.callbacks[h]=g.callback)}),b("<span></span>").html(g._name||g.name||"").appendTo(k)}if(g.type&&("sub"!=g.type&&"html"!=g.type)&&(r.on("focus",a.focusInput).on("blur",a.blurInput),g.events))r.on(g.events,c);g.icon&&k.addClass("icon icon-"+g.icon)}g.$input=r;g.$label=l;k.appendTo(c.$menu);
if(!c.hasTypes&&b.support.eventSelectstart)k.on("selectstart.disableTextSelect",a.abortevent)});c.$node||c.$menu.css("display","none").addClass("context-menu-root");c.$menu.appendTo(c.appendTo||document.body)},update:function(a,c){var e=this;c===l&&(c=a,a.$menu.find("ul").andSelf().css({position:"static",display:"block"}).each(function(){var a=b(this);a.width(a.css("position","absolute").width()).css("position","static")}).css({position:"",display:""}));a.$menu.children().each(function(){var g=b(this),
h=g.data("contextMenuKey"),k=a.items[h],h=b.isFunction(k.disabled)&&k.disabled.call(e,h,c)||!0===k.disabled;g[h?"addClass":"removeClass"]("disabled");if(k.type)switch(g.find("input, select, textarea").prop("disabled",h),k.type){case "text":case "textarea":k.$input.val(k.value||"");break;case "checkbox":case "radio":k.$input.val(k.value||"").prop("checked",!!k.selected);break;case "select":k.$input.val(k.selected||"")}k.$menu&&p.update.call(e,k,c)})},layer:function(c,e){var h=c.$layer=b('<div id="context-menu-layer" style="position:fixed; z-index:'+
e+'; top:0; left:0; opacity: 0; filter: alpha(opacity=0); background-color: #000;"></div>').css({height:q.height(),width:q.width(),display:"block"}).data("contextMenuRoot",c).insertBefore(this).on("contextmenu",a.abortevent).on("mousedown",a.layerClick);b.support.fixedPosition||h.css({position:"absolute",height:b(document).height()});return h}};b.fn.contextMenu=function(a){a===l?this.first().trigger("contextmenu"):a.x&&a.y?this.first().trigger(b.Event("contextmenu",{pageX:a.x,pageY:a.y})):"hide"===
a?(a=this.data("contextMenu").$menu)&&a.trigger("contextmenu:hide"):a?this.removeClass("context-menu-disabled"):a||this.addClass("context-menu-disabled");return this};b.contextMenu=function(c,e){"string"!=typeof c&&(e=c,c="create");"string"==typeof e?e={selector:e}:e===l&&(e={});var h=b.extend(!0,{},J,e||{}),g=b(document);switch(c){case "create":if(!h.selector)throw Error("No selector specified");if(h.selector.match(/.context-menu-(list|item|input)($|\s)/))throw Error('Cannot bind to selector "'+
h.selector+'" as it contains a reserved className');if(!h.build&&(!h.items||b.isEmptyObject(h.items)))throw Error("No Items sepcified");w++;h.ns=".contextMenu"+w;E[h.selector]=h.ns;P[h.ns]=h;h.trigger||(h.trigger="right");r||(g.on({"contextmenu:hide.contextMenu":a.hideMenu,"prevcommand.contextMenu":a.prevItem,"nextcommand.contextMenu":a.nextItem,"contextmenu.contextMenu":a.abortevent,"mouseenter.contextMenu":a.menuMouseenter,"mouseleave.contextMenu":a.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",
".context-menu-input",a.inputClick).on({"mouseup.contextMenu":a.itemClick,"contextmenu:focus.contextMenu":a.focusItem,"contextmenu:blur.contextMenu":a.blurItem,"contextmenu.contextMenu":a.abortevent,"mouseenter.contextMenu":a.itemMouseenter,"mouseleave.contextMenu":a.itemMouseleave},".context-menu-item"),r=!0);g.on("contextmenu"+h.ns,h.selector,h,a.contextmenu);switch(h.trigger){case "hover":g.on("mouseenter"+h.ns,h.selector,h,a.mouseenter).on("mouseleave"+h.ns,h.selector,h,a.mouseleave);break;case "left":g.on("click"+
h.ns,h.selector,h,a.click)}h.build||p.create(h);break;case "destroy":if(h.selector){if(E[h.selector]){var k=b(".context-menu-list").filter(":visible");k.length&&k.data().contextMenuRoot.$trigger.is(h.selector)&&k.trigger("contextmenu:hide",{force:!0});try{P[E[h.selector]].$menu&&P[E[h.selector]].$menu.remove(),delete P[E[h.selector]]}catch(q){P[E[h.selector]]=null}g.off(E[h.selector])}}else g.off(".contextMenu .contextMenuAutoHide"),b.each(E,function(a,b){g.off(b)}),E={},P={},w=0,r=!1,b("#context-menu-layer, .context-menu-list").remove();
break;case "html5":(!b.support.htmlCommand&&!b.support.htmlMenuitem||"boolean"==typeof e&&e)&&b('menu[type="context"]').each(function(){this.id&&b.contextMenu({selector:"[contextmenu="+this.id+"]",items:b.contextMenu.fromMenu(this)})}).css("display","none");break;default:throw Error('Unknown operation "'+c+'"');}return this};b.contextMenu.setInputValues=function(a,c){c===l&&(c={});b.each(a.inputs,function(a,b){switch(b.type){case "text":case "textarea":b.value=c[a]||"";break;case "checkbox":b.selected=
c[a]?!0:!1;break;case "radio":b.selected=(c[b.radio]||"")==b.value?!0:!1;break;case "select":b.selected=c[a]||""}})};b.contextMenu.getInputValues=function(a,c){c===l&&(c={});b.each(a.inputs,function(a,b){switch(b.type){case "text":case "textarea":case "select":c[a]=b.$input.val();break;case "checkbox":c[a]=b.$input.prop("checked");break;case "radio":b.$input.prop("checked")&&(c[b.radio]=b.value)}});return c};b.contextMenu.fromMenu=function(a){a=b(a);var c={};k(c,a.children());return c};b.contextMenu.defaults=
J;b.contextMenu.types=R})(jQuery);
(function(b,l){function c(a,b,c){return[parseInt(a[0],10)*(J.test(a[0])?b/100:1),parseInt(a[1],10)*(J.test(a[1])?c/100:1)]}b.ui=b.ui||{};var k,h=Math.max,r=Math.abs,q=Math.round,w=/left|center|right/,E=/top|center|bottom/,P=/[\+\-]\d+%?/,R=/^\w+/,J=/%$/,V=b.fn.position;b.position={scrollbarWidth:function(){if(k!==l)return k;var a,c,e=b("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>");c=e.children()[0];b("body").append(e);a=c.offsetWidth;
e.css("overflow","scroll");c=c.offsetWidth;a===c&&(c=e[0].clientWidth);e.remove();return k=a-c},getScrollInfo:function(a){var c=a.isWindow?"":a.element.css("overflow-x"),e=a.isWindow?"":a.element.css("overflow-y"),e="scroll"===e||"auto"===e&&a.height<a.element[0].scrollHeight;return{width:"scroll"===c||"auto"===c&&a.width<a.element[0].scrollWidth?b.position.scrollbarWidth():0,height:e?b.position.scrollbarWidth():0}},getWithinInfo:function(a){a=b(a||window);var c=b.isWindow(a[0]);return{element:a,
isWindow:c,offset:a.offset()||{left:0,top:0},scrollLeft:a.scrollLeft(),scrollTop:a.scrollTop(),width:c?a.width():a.outerWidth(),height:c?a.height():a.outerHeight()}}};b.fn.position=function(a){if(!a||!a.of)return V.apply(this,arguments);a=b.extend({},a);var e,j,k,m,p,l=b(a.of),f=b.position.getWithinInfo(a.within),v=b.position.getScrollInfo(f),y=l[0],J=(a.collision||"flip").split(" "),T={};9===y.nodeType?(j=l.width(),k=l.height(),m={top:0,left:0}):b.isWindow(y)?(j=l.width(),k=l.height(),m={top:l.scrollTop(),
left:l.scrollLeft()}):y.preventDefault?(a.at="left top",j=k=0,m={top:y.pageY,left:y.pageX}):(j=l.outerWidth(),k=l.outerHeight(),m=l.offset());p=b.extend({},m);b.each(["my","at"],function(){var b=(a[this]||"").split(" "),c,e;1===b.length&&(b=w.test(b[0])?b.concat(["center"]):E.test(b[0])?["center"].concat(b):["center","center"]);b[0]=w.test(b[0])?b[0]:"center";b[1]=E.test(b[1])?b[1]:"center";c=P.exec(b[0]);e=P.exec(b[1]);T[this]=[c?c[0]:0,e?e[0]:0];a[this]=[R.exec(b[0])[0],R.exec(b[1])[0]]});1===J.length&&
(J[1]=J[0]);"right"===a.at[0]?p.left+=j:"center"===a.at[0]&&(p.left+=j/2);"bottom"===a.at[1]?p.top+=k:"center"===a.at[1]&&(p.top+=k/2);e=c(T.at,j,k);p.left+=e[0];p.top+=e[1];return this.each(function(){var w,y,s=b(this),D=s.outerWidth(),B=s.outerHeight(),N=parseInt(b.css(this,"marginLeft"),10)||0,U=parseInt(b.css(this,"marginTop"),10)||0,E=D+N+(parseInt(b.css(this,"marginRight"),10)||0)+v.width,P=B+U+(parseInt(b.css(this,"marginBottom"),10)||0)+v.height,Y=b.extend({},p),R=c(T.my,s.outerWidth(),s.outerHeight());
"right"===a.my[0]?Y.left-=D:"center"===a.my[0]&&(Y.left-=D/2);"bottom"===a.my[1]?Y.top-=B:"center"===a.my[1]&&(Y.top-=B/2);Y.left+=R[0];Y.top+=R[1];b.support.offsetFractions||(Y.left=q(Y.left),Y.top=q(Y.top));w={marginLeft:N,marginTop:U};b.each(["left","top"],function(c,h){if(b.ui.position[J[c]])b.ui.position[J[c]][h](Y,{targetWidth:j,targetHeight:k,elemWidth:D,elemHeight:B,collisionPosition:w,collisionWidth:E,collisionHeight:P,offset:[e[0]+R[0],e[1]+R[1]],my:a.my,at:a.at,within:f,elem:s})});b.fn.bgiframe&&
s.bgiframe();a.using&&(y=function(b){var c=m.left-Y.left,e=c+j-D,g=m.top-Y.top,f=g+k-B,p={target:{element:l,left:m.left,top:m.top,width:j,height:k},element:{element:s,left:Y.left,top:Y.top,width:D,height:B},horizontal:0>e?"left":0<c?"right":"center",vertical:0>f?"top":0<g?"bottom":"middle"};j<D&&r(c+e)<j&&(p.horizontal="center");k<B&&r(g+f)<k&&(p.vertical="middle");p.important=h(r(c),r(e))>h(r(g),r(f))?"horizontal":"vertical";a.using.call(this,b,p)});s.offset(b.extend(Y,{using:y}))})};b.ui.position=
{fit:{left:function(a,b){var c=b.within,e=c.isWindow?c.scrollLeft:c.offset.left,j=c.width,k=a.left-b.collisionPosition.marginLeft,c=e-k,m=k+b.collisionWidth-j-e;b.collisionWidth>j?0<c&&0>=m?(e=a.left+c+b.collisionWidth-j-e,a.left+=c-e):a.left=0<m&&0>=c?e:c>m?e+j-b.collisionWidth:e:a.left=0<c?a.left+c:0<m?a.left-m:h(a.left-k,a.left)},top:function(a,b){var c=b.within,e=c.isWindow?c.scrollTop:c.offset.top,j=b.within.height,k=a.top-b.collisionPosition.marginTop,c=e-k,m=k+b.collisionHeight-j-e;b.collisionHeight>
j?0<c&&0>=m?(e=a.top+c+b.collisionHeight-j-e,a.top+=c-e):a.top=0<m&&0>=c?e:c>m?e+j-b.collisionHeight:e:a.top=0<c?a.top+c:0<m?a.top-m:h(a.top-k,a.top)}},flip:{left:function(a,b){var c=b.within,e=c.offset.left+c.scrollLeft,h=c.width,j=c.isWindow?c.scrollLeft:c.offset.left,k=a.left-b.collisionPosition.marginLeft,c=k-j,f=k+b.collisionWidth-h-j,k="left"===b.my[0]?-b.elemWidth:"right"===b.my[0]?b.elemWidth:0,m="left"===b.at[0]?b.targetWidth:"right"===b.at[0]?-b.targetWidth:0,p=-2*b.offset[0];if(0>c){if(e=
a.left+k+m+p+b.collisionWidth-h-e,0>e||e<r(c))a.left+=k+m+p}else if(0<f&&(e=a.left-b.collisionPosition.marginLeft+k+m+p-j,0<e||r(e)<f))a.left+=k+m+p},top:function(a,b){var c=b.within,e=c.offset.top+c.scrollTop,h=c.height,j=c.isWindow?c.scrollTop:c.offset.top,k=a.top-b.collisionPosition.marginTop,c=k-j,f=k+b.collisionHeight-h-j,k="top"===b.my[1]?-b.elemHeight:"bottom"===b.my[1]?b.elemHeight:0,m="top"===b.at[1]?b.targetHeight:"bottom"===b.at[1]?-b.targetHeight:0,p=-2*b.offset[1];if(0>c){if(e=a.top+
k+m+p+b.collisionHeight-h-e,a.top+k+m+p>c&&(0>e||e<r(c)))a.top+=k+m+p}else if(0<f&&(e=a.top-b.collisionPosition.marginTop+k+m+p-j,a.top+k+m+p>f&&(0<e||r(e)<f)))a.top+=k+m+p}},flipfit:{left:function(){b.ui.position.flip.left.apply(this,arguments);b.ui.position.fit.left.apply(this,arguments)},top:function(){b.ui.position.flip.top.apply(this,arguments);b.ui.position.fit.top.apply(this,arguments)}}};var T,v,e,a,p=document.getElementsByTagName("body")[0];e=document.createElement("div");T=document.createElement(p?
"div":"body");v={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};p&&b.extend(v,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in v)T.style[a]=v[a];T.appendChild(e);v=p||document.documentElement;v.insertBefore(T,v.firstChild);e.style.cssText="position: absolute; left: 10.7432222px;";e=b(e).offset().left;b.support.offsetFractions=10<e&&11>e;T.innerHTML="";v.removeChild(T);if(!1!==b.uiBackCompat){var m=jQuery,j=m.fn.position;m.fn.position=function(a){if(!a||!a.offset)return j.call(this,
a);var b=a.offset.split(" "),c=a.at.split(" ");1===b.length&&(b[1]=b[0]);/^\d/.test(b[0])&&(b[0]="+"+b[0]);/^\d/.test(b[1])&&(b[1]="+"+b[1]);1===c.length&&(/left|center|right/.test(c[0])?c[1]="center":(c[1]=c[0],c[0]="center"));return j.call(this,m.extend(a,{at:c[0]+b[0]+" "+c[1]+b[1],offset:l}))}}})(jQuery);!function(b){b(function(){var l=b.support,c;a:{c=document.createElement("bootstrap");var k={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},h;for(h in k)if(void 0!==c.style[h]){c=k[h];break a}c=void 0}l.transition=c&&{end:c}})}(window.jQuery);
!function(b){var l=function(c){b(c).on("click",'[data-dismiss="alert"]',this.close)};l.prototype.close=function(c){function k(){q.trigger("closed").remove()}var h=b(this),l=h.attr("data-target"),q;l||(l=h.attr("href"),l=l&&l.replace(/.*(?=#[^\s]*$)/,""));q=b(l);c&&c.preventDefault();q.length||(q=h.hasClass("alert")?h:h.parent());q.trigger(c=b.Event("close"));c.isDefaultPrevented()||(q.removeClass("in"),b.support.transition&&q.hasClass("fade")?q.on(b.support.transition.end,k):k())};b.fn.alert=function(c){return this.each(function(){var k=
b(this),h=k.data("alert");h||k.data("alert",h=new l(this));"string"==typeof c&&h[c].call(k)})};b.fn.alert.Constructor=l;b(document).on("click.alert.data-api",'[data-dismiss="alert"]',l.prototype.close)}(window.jQuery);
!function(b){var l=function(c,k){this.$element=b(c);this.options=b.extend({},b.fn.button.defaults,k)};l.prototype.setState=function(b){var k=this.$element,h=k.data(),l=k.is("input")?"val":"html";b+="Text";h.resetText||k.data("resetText",k[l]());k[l](h[b]||this.options[b]);setTimeout(function(){"loadingText"==b?k.addClass("disabled").attr("disabled","disabled"):k.removeClass("disabled").removeAttr("disabled")},0)};l.prototype.toggle=function(){var b=this.$element.closest('[data-toggle="buttons-radio"]');
b&&b.find(".active").removeClass("active");this.$element.toggleClass("active")};b.fn.button=function(c){return this.each(function(){var k=b(this),h=k.data("button"),r="object"==typeof c&&c;h||k.data("button",h=new l(this,r));"toggle"==c?h.toggle():c&&h.setState(c)})};b.fn.button.defaults={loadingText:"loading..."};b.fn.button.Constructor=l;b(document).on("click.button.data-api","[data-toggle^=button]",function(c){c=b(c.target);c.hasClass("btn")||(c=c.closest(".btn"));c.button("toggle")})}(window.jQuery);
!function(b){var l=function(c,k){this.$element=b(c);this.options=k;this.options.slide&&this.slide(this.options.slide);"hover"==this.options.pause&&this.$element.on("mouseenter",b.proxy(this.pause,this)).on("mouseleave",b.proxy(this.cycle,this))};l.prototype={cycle:function(c){return c||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(b.proxy(this.next,this),this.options.interval)),this},to:function(c){var k=this.$element.find(".item.active"),h=k.parent().children(),
k=h.index(k),l=this;if(!(c>h.length-1||0>c))return this.sliding?this.$element.one("slid",function(){l.to(c)}):k==c?this.pause().cycle():this.slide(c>k?"next":"prev",b(h[c]))},pause:function(c){return c||(this.paused=!0),this.$element.find(".next, .prev").length&&b.support.transition.end&&(this.$element.trigger(b.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(!this.sliding)return this.slide("next")},prev:function(){if(!this.sliding)return this.slide("prev")},
slide:function(c,k){var h=this.$element.find(".item.active"),l=k||h[c](),q=this.interval,w="next"==c?"left":"right",E="next"==c?"first":"last",P=this;this.sliding=!0;q&&this.pause();l=l.length?l:this.$element.find(".item")[E]();E=b.Event("slide",{relatedTarget:l[0]});if(!l.hasClass("active")){if(b.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(E);if(E.isDefaultPrevented())return;l.addClass(c);l[0].offsetWidth;h.addClass(w);l.addClass(w);this.$element.one(b.support.transition.end,
function(){l.removeClass([c,w].join(" ")).addClass("active");h.removeClass(["active",w].join(" "));P.sliding=!1;setTimeout(function(){P.$element.trigger("slid")},0)})}else{this.$element.trigger(E);if(E.isDefaultPrevented())return;h.removeClass("active");l.addClass("active");this.sliding=!1;this.$element.trigger("slid")}return q&&this.cycle(),this}}};b.fn.carousel=function(c){return this.each(function(){var k=b(this),h=k.data("carousel"),r=b.extend({},b.fn.carousel.defaults,"object"==typeof c&&c),
q="string"==typeof c?c:r.slide;h||k.data("carousel",h=new l(this,r));"number"==typeof c?h.to(c):q?h[q]():r.interval&&h.cycle()})};b.fn.carousel.defaults={interval:5E3,pause:"hover"};b.fn.carousel.Constructor=l;b(document).on("click.carousel.data-api","[data-slide]",function(c){var k=b(this),h,l=b(k.attr("data-target")||(h=k.attr("href"))&&h.replace(/.*(?=#[^\s]+$)/,"")),k=b.extend({},l.data(),k.data());l.carousel(k);c.preventDefault()})}(window.jQuery);
!function(b){var l=function(c,k){this.$element=b(c);this.options=b.extend({},b.fn.collapse.defaults,k);this.options.parent&&(this.$parent=b(this.options.parent));this.options.toggle&&this.toggle()};l.prototype={constructor:l,dimension:function(){return this.$element.hasClass("width")?"width":"height"},show:function(){var c,k,h,l;if(!this.transitioning){c=this.dimension();k=b.camelCase(["scroll",c].join("-"));if((h=this.$parent&&this.$parent.find("> .accordion-group > .in"))&&h.length){if((l=h.data("collapse"))&&
l.transitioning)return;h.collapse("hide");l||h.data("collapse",null)}this.$element[c](0);this.transition("addClass",b.Event("show"),"shown");b.support.transition&&this.$element[c](this.$element[0][k])}},hide:function(){var c;this.transitioning||(c=this.dimension(),this.reset(this.$element[c]()),this.transition("removeClass",b.Event("hide"),"hidden"),this.$element[c](0))},reset:function(b){var k=this.dimension();return this.$element.removeClass("collapse")[k](b||"auto")[0].offsetWidth,this.$element[null!==
b?"addClass":"removeClass"]("collapse"),this},transition:function(c,k,h){var l=this,q=function(){"show"==k.type&&l.reset();l.transitioning=0;l.$element.trigger(h)};this.$element.trigger(k);k.isDefaultPrevented()||(this.transitioning=1,this.$element[c]("in"),b.support.transition&&this.$element.hasClass("collapse")?this.$element.one(b.support.transition.end,q):q())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};b.fn.collapse=function(c){return this.each(function(){var k=b(this),
h=k.data("collapse"),r="object"==typeof c&&c;h||k.data("collapse",h=new l(this,r));"string"==typeof c&&h[c]()})};b.fn.collapse.defaults={toggle:!0};b.fn.collapse.Constructor=l;b(document).on("click.collapse.data-api","[data-toggle=collapse]",function(c){var k=b(this),h;c=k.attr("data-target")||c.preventDefault()||(h=k.attr("href"))&&h.replace(/.*(?=#[^\s]+$)/,"");h=b(c).data("collapse")?"toggle":k.data();k[b(c).hasClass("in")?"addClass":"removeClass"]("collapsed");b(c).collapse(h)})}(window.jQuery);
!function(b){function l(){b(k).each(function(){c(b(this)).removeClass("open")})}function c(c){var h=c.attr("data-target"),k;return h||(h=c.attr("href"),h=h&&/#/.test(h)&&h.replace(/.*(?=#[^\s]*$)/,"")),k=b(h),k.length||(k=c.parent()),k}var k="[data-toggle=dropdown]",h=function(c){var h=b(c).on("click.dropdown.data-api",this.toggle);b("html").on("click.dropdown.data-api",function(){h.parent().removeClass("open")})};h.prototype={constructor:h,toggle:function(){var h=b(this),k,w;if(!h.is(".disabled, :disabled"))return k=
c(h),w=k.hasClass("open"),l(),w||(k.toggleClass("open"),h.focus()),!1},keydown:function(h){var k,l,E;if(/(38|40|27)/.test(h.keyCode)&&(k=b(this),h.preventDefault(),h.stopPropagation(),!k.is(".disabled, :disabled"))){l=c(k);E=l.hasClass("open");if(!E||E&&27==h.keyCode)return k.click();k=b("[role=menu] li:not(.divider) a",l);k.length&&(l=k.index(k.filter(":focus")),38==h.keyCode&&0<l&&l--,40==h.keyCode&&l<k.length-1&&l++,~l||(l=0),k.eq(l).focus())}}};b.fn.dropdown=function(c){return this.each(function(){var k=
b(this),l=k.data("dropdown");l||k.data("dropdown",l=new h(this));"string"==typeof c&&l[c].call(k)})};b.fn.dropdown.Constructor=h;b(document).on("click.dropdown.data-api touchstart.dropdown.data-api",l).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(b){b.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",k,h.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",k+", [role=menu]",h.prototype.keydown)}(window.jQuery);
!function(b){var l=function(c,k){this.options=k;this.$element=b(c).delegate('[data-dismiss="modal"]',"click.dismiss.modal",b.proxy(this.hide,this));this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};l.prototype={constructor:l,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var c=this,k=b.Event("show");this.$element.trigger(k);!this.isShown&&!k.isDefaultPrevented()&&(this.isShown=!0,this.escape(),this.backdrop(function(){var h=b.support.transition&&
c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(document.body);c.$element.show();h&&c.$element[0].offsetWidth;c.$element.addClass("in").attr("aria-hidden",!1);c.enforceFocus();h?c.$element.one(b.support.transition.end,function(){c.$element.focus().trigger("shown")}):c.$element.focus().trigger("shown")}))},hide:function(c){c&&c.preventDefault();c=b.Event("hide");this.$element.trigger(c);this.isShown&&!c.isDefaultPrevented()&&(this.isShown=!1,this.escape(),b(document).off("focusin.modal"),
this.$element.removeClass("in").attr("aria-hidden",!0),b.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var c=this;b(document).on("focusin.modal",function(b){c.$element[0]!==b.target&&!c.$element.has(b.target).length&&c.$element.focus()})},escape:function(){var b=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(k){27==k.which&&b.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},
hideWithTransition:function(){var c=this,k=setTimeout(function(){c.$element.off(b.support.transition.end);c.hideModal()},500);this.$element.one(b.support.transition.end,function(){clearTimeout(k);c.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden");this.backdrop()},removeBackdrop:function(){this.$backdrop.remove();this.$backdrop=null},backdrop:function(c){var k=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var h=b.support.transition&&k;this.$backdrop=
b('<div class="modal-backdrop '+k+'" />').appendTo(document.body);this.$backdrop.click("static"==this.options.backdrop?b.proxy(this.$element[0].focus,this.$element[0]):b.proxy(this.hide,this));h&&this.$backdrop[0].offsetWidth;this.$backdrop.addClass("in");h?this.$backdrop.one(b.support.transition.end,c):c()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),b.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(b.support.transition.end,b.proxy(this.removeBackdrop,
this)):this.removeBackdrop()):c&&c()}};b.fn.modal=function(c){return this.each(function(){var k=b(this),h=k.data("modal"),r=b.extend({},b.fn.modal.defaults,k.data(),"object"==typeof c&&c);h||k.data("modal",h=new l(this,r));"string"==typeof c?h[c]():r.show&&h.show()})};b.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0};b.fn.modal.Constructor=l;b(document).on("click.modal.data-api",'[data-toggle="modal"]',function(c){var k=b(this),h=k.attr("href"),l=b(k.attr("data-target")||h&&h.replace(/.*(?=#[^\s]+$)/,
"")),h=l.data("modal")?"toggle":b.extend({remote:!/#/.test(h)&&h},l.data(),k.data());c.preventDefault();l.modal(h).one("hide",function(){k.focus()})})}(window.jQuery);
!function(b){var l=function(b,k){this.init("tooltip",b,k)};l.prototype={constructor:l,init:function(c,k,h){var l,q;this.type=c;this.$element=b(k);this.options=this.getOptions(h);this.enabled=!0;"click"==this.options.trigger?this.$element.on("click."+this.type,this.options.selector,b.proxy(this.toggle,this)):"manual"!=this.options.trigger&&(l="hover"==this.options.trigger?"mouseenter":"focus",q="hover"==this.options.trigger?"mouseleave":"blur",this.$element.on(l+"."+this.type,this.options.selector,
b.proxy(this.enter,this)),this.$element.on(q+"."+this.type,this.options.selector,b.proxy(this.leave,this)));this.options.selector?this._options=b.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(c){return c=b.extend({},b.fn[this.type].defaults,c,this.$element.data()),c.delay&&"number"==typeof c.delay&&(c.delay={show:c.delay,hide:c.delay}),c},enter:function(c){var k=b(c.currentTarget)[this.type](this._options).data(this.type);if(!k.options.delay||!k.options.delay.show)return k.show();
clearTimeout(this.timeout);k.hoverState="in";this.timeout=setTimeout(function(){"in"==k.hoverState&&k.show()},k.options.delay.show)},leave:function(c){var k=b(c.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!k.options.delay||!k.options.delay.hide)return k.hide();k.hoverState="out";this.timeout=setTimeout(function(){"out"==k.hoverState&&k.hide()},k.options.delay.hide)},show:function(){var b,k,h,l,q,w,E;if(this.hasContent()&&this.enabled){b=this.tip();
this.setContent();this.options.animation&&b.addClass("fade");w="function"==typeof this.options.placement?this.options.placement.call(this,b[0],this.$element[0]):this.options.placement;k=/in/.test(w);b.detach().css({top:0,left:0,display:"block"}).insertAfter(this.$element);h=this.getPosition(k);l=b[0].offsetWidth;q=b[0].offsetHeight;switch(k?w.split(" ")[1]:w){case "bottom":E={top:h.top+h.height,left:h.left+h.width/2-l/2};break;case "top":E={top:h.top-q,left:h.left+h.width/2-l/2};break;case "left":E=
{top:h.top+h.height/2-q/2,left:h.left-l};break;case "right":E={top:h.top+h.height/2-q/2,left:h.left+h.width}}b.offset(E).addClass(w).addClass("in")}},setContent:function(){var b=this.tip(),k=this.getTitle();b.find(".tooltip-inner")[this.options.html?"html":"text"](k);b.removeClass("fade in top bottom left right")},hide:function(){var c=this.tip();c.removeClass("in");if(b.support.transition&&this.$tip.hasClass("fade")){var k=setTimeout(function(){c.off(b.support.transition.end).detach()},500);c.one(b.support.transition.end,
function(){clearTimeout(k);c.detach()})}else c.detach();return this},fixTitle:function(){var b=this.$element;(b.attr("title")||"string"!=typeof b.attr("data-original-title"))&&b.attr("data-original-title",b.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(c){return b.extend({},c?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var b,k=this.$element,h=this.options;
return b=k.attr("data-original-title")||("function"==typeof h.title?h.title.call(k[0]):h.title),b},tip:function(){return this.$tip=this.$tip||b(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(c){c=b(c.currentTarget)[this.type](this._options).data(this.type);c[c.tip().hasClass("in")?"hide":
"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};b.fn.tooltip=function(c){return this.each(function(){var k=b(this),h=k.data("tooltip"),r="object"==typeof c&&c;h||k.data("tooltip",h=new l(this,r));"string"==typeof c&&h[c]()})};b.fn.tooltip.Constructor=l;b.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover",title:"",delay:0,
html:!1}}(window.jQuery);
!function(b){var l=function(b,k){this.init("popover",b,k)};l.prototype=b.extend({},b.fn.tooltip.Constructor.prototype,{constructor:l,setContent:function(){var b=this.tip(),k=this.getTitle(),h=this.getContent();b.find(".popover-title")[this.options.html?"html":"text"](k);b.find(".popover-content > *")[this.options.html?"html":"text"](h);b.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var b,k=this.$element,h=this.options;
return b=k.attr("data-content")||("function"==typeof h.content?h.content.call(k[0]):h.content),b},tip:function(){return this.$tip||(this.$tip=b(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});b.fn.popover=function(c){return this.each(function(){var k=b(this),h=k.data("popover"),r="object"==typeof c&&c;h||k.data("popover",h=new l(this,r));"string"==typeof c&&h[c]()})};b.fn.popover.Constructor=l;b.fn.popover.defaults=b.extend({},
b.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery);
!function(b){function l(c,k){var h=b.proxy(this.process,this),l=b(c).is("body")?b(window):b(c),q;this.options=b.extend({},b.fn.scrollspy.defaults,k);this.$scrollElement=l.on("scroll.scroll-spy.data-api",h);this.selector=(this.options.target||(q=b(c).attr("href"))&&q.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a";this.$body=b("body");this.refresh();this.process()}l.prototype={constructor:l,refresh:function(){var c=this;this.offsets=b([]);this.targets=b([]);this.$body.find(this.selector).map(function(){var c=
b(this),c=c.data("target")||c.attr("href"),h=/^#\w/.test(c)&&b(c);return h&&h.length&&[[h.position().top,c]]||null}).sort(function(b,c){return b[0]-c[0]}).each(function(){c.offsets.push(this[0]);c.targets.push(this[1])})},process:function(){var b=this.$scrollElement.scrollTop()+this.options.offset,k=(this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight)-this.$scrollElement.height(),h=this.offsets,l=this.targets,q=this.activeTarget,w;if(b>=k)return q!=(w=l.last()[0])&&this.activate(w);for(w=
h.length;w--;)q!=l[w]&&b>=h[w]&&(!h[w+1]||b<=h[w+1])&&this.activate(l[w])},activate:function(c){this.activeTarget=c;b(this.selector).parent(".active").removeClass("active");c=b(this.selector+'[data-target="'+c+'"],'+this.selector+'[href="'+c+'"]').parent("li").addClass("active");c.parent(".dropdown-menu").length&&(c=c.closest("li.dropdown").addClass("active"));c.trigger("activate")}};b.fn.scrollspy=function(c){return this.each(function(){var k=b(this),h=k.data("scrollspy"),r="object"==typeof c&&c;
h||k.data("scrollspy",h=new l(this,r));"string"==typeof c&&h[c]()})};b.fn.scrollspy.Constructor=l;b.fn.scrollspy.defaults={offset:10};b(window).on("load",function(){b('[data-spy="scroll"]').each(function(){var c=b(this);c.scrollspy(c.data())})})}(window.jQuery);
!function(b){var l=function(c){this.element=b(c)};l.prototype={constructor:l,show:function(){var c=this.element,k=c.closest("ul:not(.dropdown-menu)"),h=c.attr("data-target"),l,q;h||(h=c.attr("href"),h=h&&h.replace(/.*(?=#[^\s]*$)/,""));c.parent("li").hasClass("active")||(l=k.find(".active:last a")[0],q=b.Event("show",{relatedTarget:l}),c.trigger(q),q.isDefaultPrevented()||(h=b(h),this.activate(c.parent("li"),k),this.activate(h,h.parent(),function(){c.trigger({type:"shown",relatedTarget:l})})))},activate:function(c,
k,h){function l(){q.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");c.addClass("active");w?(c[0].offsetWidth,c.addClass("in")):c.removeClass("fade");c.parent(".dropdown-menu")&&c.closest("li.dropdown").addClass("active");h&&h()}var q=k.find("> .active"),w=h&&b.support.transition&&q.hasClass("fade");w?q.one(b.support.transition.end,l):l();q.removeClass("in")}};b.fn.tab=function(c){return this.each(function(){var k=b(this),h=k.data("tab");h||k.data("tab",h=new l(this));
"string"==typeof c&&h[c]()})};b.fn.tab.Constructor=l;b(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(c){c.preventDefault();b(this).tab("show")})}(window.jQuery);
!function(b){var l=function(c,k){this.$element=b(c);this.options=b.extend({},b.fn.typeahead.defaults,k);this.matcher=this.options.matcher||this.matcher;this.sorter=this.options.sorter||this.sorter;this.highlighter=this.options.highlighter||this.highlighter;this.updater=this.options.updater||this.updater;this.$menu=b(this.options.menu).appendTo("body");this.source=this.options.source;this.shown=!1;this.listen()};l.prototype={constructor:l,select:function(){var b=this.$menu.find(".active").attr("data-value");
return this.$element.val(this.updater(b)).change(),this.hide()},updater:function(b){return b},show:function(){var c=b.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:c.top+c.height,left:c.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(){var c;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(c=b.isFunction(this.source)?
this.source(this.query,b.proxy(this.process,this)):this.source,c?this.process(c):this)},process:function(c){var k=this;return c=b.grep(c,function(b){return k.matcher(b)}),c=this.sorter(c),c.length?this.render(c.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(b){return~b.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(b){for(var k=[],h=[],l=[],q;q=b.shift();)q.toLowerCase().indexOf(this.query.toLowerCase())?~q.indexOf(this.query)?h.push(q):l.push(q):
k.push(q);return k.concat(h,l)},highlighter:function(b){var k=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return b.replace(RegExp("("+k+")","ig"),function(b,c){return"<strong>"+c+"</strong>"})},render:function(c){var k=this;return c=b(c).map(function(c,l){return c=b(k.options.item).attr("data-value",l),c.find("a").html(k.highlighter(l)),c[0]}),c.first().addClass("active"),this.$menu.html(c),this},next:function(){var c=this.$menu.find(".active").removeClass("active").next();c.length||
(c=b(this.$menu.find("li")[0]));c.addClass("active")},prev:function(){var b=this.$menu.find(".active").removeClass("active").prev();b.length||(b=this.$menu.find("li").last());b.addClass("active")},listen:function(){this.$element.on("blur",b.proxy(this.blur,this)).on("keypress",b.proxy(this.keypress,this)).on("keyup",b.proxy(this.keyup,this));this.eventSupported("keydown")&&this.$element.on("keydown",b.proxy(this.keydown,this));this.$menu.on("click",b.proxy(this.click,this)).on("mouseenter","li",b.proxy(this.mouseenter,
this))},eventSupported:function(b){var k=b in this.$element;return k||(this.$element.setAttribute(b,"return;"),k="function"==typeof this.$element[b]),k},move:function(b){if(this.shown){switch(b.keyCode){case 9:case 13:case 27:b.preventDefault();break;case 38:b.preventDefault();this.prev();break;case 40:b.preventDefault(),this.next()}b.stopPropagation()}},keydown:function(c){this.suppressKeyPressRepeat=!~b.inArray(c.keyCode,[40,38,9,13,27]);this.move(c)},keypress:function(b){this.suppressKeyPressRepeat||
this.move(b)},keyup:function(b){switch(b.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}b.stopPropagation();b.preventDefault()},blur:function(){var b=this;setTimeout(function(){b.hide()},150)},click:function(b){b.stopPropagation();b.preventDefault();this.select()},mouseenter:function(c){this.$menu.find(".active").removeClass("active");b(c.currentTarget).addClass("active")}};
b.fn.typeahead=function(c){return this.each(function(){var k=b(this),h=k.data("typeahead"),r="object"==typeof c&&c;h||k.data("typeahead",h=new l(this,r));"string"==typeof c&&h[c]()})};b.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1};b.fn.typeahead.Constructor=l;b(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(c){var k=b(this);k.data("typeahead")||(c.preventDefault(),k.typeahead(k.data()))})}(window.jQuery);
!function(b){var l=function(c,k){this.options=b.extend({},b.fn.affix.defaults,k);this.$window=b(window).on("scroll.affix.data-api",b.proxy(this.checkPosition,this)).on("click.affix.data-api",b.proxy(function(){setTimeout(b.proxy(this.checkPosition,this),1)},this));this.$element=b(c);this.checkPosition()};l.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=b(document).height(),k=this.$window.scrollTop(),h=this.$element.offset(),l=this.options.offset,q=l.bottom,w=l.top;"object"!=
typeof l&&(q=w=l);"function"==typeof w&&(w=l.top());"function"==typeof q&&(q=l.bottom());c=null!=this.unpin&&k+this.unpin<=h.top?!1:null!=q&&h.top+this.$element.height()>=c-q?"bottom":null!=w&&k<=w?"top":!1;this.affixed!==c&&(this.affixed=c,this.unpin="bottom"==c?h.top-k:null,this.$element.removeClass("affix affix-top affix-bottom").addClass("affix"+(c?"-"+c:"")))}};b.fn.affix=function(c){return this.each(function(){var k=b(this),h=k.data("affix"),r="object"==typeof c&&c;h||k.data("affix",h=new l(this,
r));"string"==typeof c&&h[c]()})};b.fn.affix.Constructor=l;b.fn.affix.defaults={offset:0};b(window).on("load",function(){b('[data-spy="affix"]').each(function(){var c=b(this),k=c.data();k.offset=k.offset||{};k.offsetBottom&&(k.offset.bottom=k.offsetBottom);k.offsetTop&&(k.offset.top=k.offsetTop);c.affix(k)})})}(window.jQuery);(function(){function b(a){return a.target}function l(a){return a.source}function c(a){for(var b=-1,c=a.length,d=[];c>++b;)d.push(a[b]);return d}function k(){}function h(a){return a}function r(){return!0}function q(a){return"function"==typeof a?a:function(){return a}}function w(a,b,c){return function(){var d=c.apply(b,arguments);return arguments.length?a:d}}function E(a){return null!=a&&!isNaN(a)}function P(a){return a.length}function R(a){return 1===a.length?function(b,c){a(null==b?c:null)}:a}function J(a){return a.responseText}
function V(a){return JSON.parse(a.responseText)}function T(a){var b=document.createRange();return b.selectNode(document.body),b.createContextualFragment(a.responseText)}function v(a){return a.responseXML}function e(){}function a(a){function b(){for(var d,e=c,F=-1,f=e.length;f>++F;)(d=e[F].on)&&d.apply(this,arguments);return a}var c=[],d=new k;return b.on=function(b,e){var F,f=d.get(b);return 2>arguments.length?f&&f.on:(f&&(f.on=null,c=c.slice(0,F=c.indexOf(f)).concat(c.slice(F+1)),d.remove(b)),e&&
c.push(d.set(b,{on:e})),a)},b}function p(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function m(a){return a+""}function j(a){return function(b){return 1-a(1-b)}}function t(a){return function(b){return 0.5*(0.5>b?a(2*b):2-a(2-2*b))}}function g(a){return a*a}function S(a){return a*a*a}function ja(a){return 1-Math.cos(a*H/2)}function ta(a){return Math.pow(2,10*(a-1))}function C(a){return 1-Math.sqrt(1-a*a)}function ua(a){return 1/2.75>a?
7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+0.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375}function f(){d3.event.stopPropagation();d3.event.preventDefault()}function L(){for(var a,b=d3.event;a=b.sourceEvent;)b=a;return b}function y(b){for(var c=new e,d=0,f=arguments.length;f>++d;)c[arguments[d]]=a(c);return c.of=function(a,d){return function(e){try{var G=e.sourceEvent=d3.event;e.target=b;d3.event=e;c[e.type].apply(a,d)}finally{d3.event=G}}},c}function va(a){var b=
[a.a,a.b],c=[a.c,a.d],d=xa(b),e=b[0]*c[0]+b[1]*c[1],f=xa((c[0]+=-e*b[0],c[1]+=-e*b[1],c))||0;b[0]*c[1]<c[0]*b[1]&&(b[0]*=-1,b[1]*=-1,d*=-1,e*=-1);this.rotate=(d?Math.atan2(b[1],b[0]):Math.atan2(-c[0],c[1]))*ia;this.translate=[a.e,a.f];this.scale=[d,f];this.skew=f?Math.atan2(e,f)*ia:0}function xa(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]);return b&&(a[0]/=b,a[1]/=b),b}function ga(a){return"transform"==a?d3.interpolateTransform:d3.interpolate}function ka(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-
a)*b}}function s(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function D(){}function B(a,b,c){return new N(a,b,c)}function N(a,b,c){this.r=a;this.g=b;this.b=c}function U(a){return 16>a?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function La(a,b,c){var d,e,f,g=0,h=0,j=0;if(d=/([a-z]+)\((.*)\)/i.exec(a))switch(e=d[2].split(","),d[1]){case "hsl":return c(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100);case "rgb":return b(kc(e[0]),kc(e[1]),
kc(e[2]))}return(f=Id.get(a))?b(f.r,f.g,f.b):(null!=a&&"#"===a.charAt(0)&&(4===a.length?(g=a.charAt(1),g+=g,h=a.charAt(2),h+=h,j=a.charAt(3),j+=j):7===a.length&&(g=a.substring(1,3),h=a.substring(3,5),j=a.substring(5,7)),g=parseInt(g,16),h=parseInt(h,16),j=parseInt(j,16)),b(g,h,j))}function ya(a,b,c){var d,e,f=Math.min(a/=255,b/=255,c/=255),g=Math.max(a,b,c),h=g-f,j=(g+f)/2;return h?(e=0.5>j?h/(g+f):h/(2-g-f),d=a==g?(b-c)/h+(c>b?6:0):b==g?(c-a)/h+2:(a-b)/h+4,d*=60):e=d=0,ab(d,e,j)}function Y(a,b,c){a=
jc(a);b=jc(b);c=jc(c);var d=ob((0.4124564*a+0.3575761*b+0.1804375*c)/We),e=ob((0.2126729*a+0.7151522*b+0.072175*c)/Xe);a=ob((0.0193339*a+0.119192*b+0.9503041*c)/Ye);return Fa(116*e-16,500*(d-e),200*(e-a))}function jc(a){return 0.04045>=(a/=255)?a/12.92:Math.pow((a+0.055)/1.055,2.4)}function kc(a){var b=parseFloat(a);return"%"===a.charAt(a.length-1)?Math.round(2.55*b):b}function ab(a,b,c){return new lc(a,b,c)}function lc(a,b,c){this.h=a;this.s=b;this.l=c}function Jb(a,b,c){function d(a){return 360<
a?a-=360:0>a&&(a+=360),60>a?e+(f-e)*a/60:180>a?f:240>a?e+(f-e)*(240-a)/60:e}var e,f;return a%=360,0>a&&(a+=360),b=0>b?0:1<b?1:b,c=0>c?0:1<c?1:c,f=0.5>=c?c*(1+b):c+b-c*b,e=2*c-f,B(Math.round(255*d(a+120)),Math.round(255*d(a)),Math.round(255*d(a-120)))}function mb(a,b,c){return new Kb(a,b,c)}function Kb(a,b,c){this.h=a;this.c=b;this.l=c}function mc(a,b,c){return Fa(c,Math.cos(a*=O)*b,Math.sin(a)*b)}function Fa(a,b,c){return new Qa(a,b,c)}function Qa(a,b,c){this.l=a;this.a=b;this.b=c}function Ra(a,b,
c){a=(a+16)/116;b=a+b/500;c=a-c/200;return b=nb(b)*We,a=nb(a)*Xe,c=nb(c)*Ye,B(Sa(3.2404542*b-1.5371385*a-0.4985314*c),Sa(-0.969266*b+1.8760108*a+0.041556*c),Sa(0.0556434*b-0.2040259*a+1.0572252*c))}function bd(a,b,c){return mb(180*(Math.atan2(c,b)/H),Math.sqrt(b*b+c*c),a)}function nb(a){return 0.206893034<a?a*a*a:(a-4/29)/7.787037}function ob(a){return 0.008856<a?Math.pow(a,1/3):7.787037*a+4/29}function Sa(a){return Math.round(255*(0.00304>=a?12.92*a:1.055*Math.pow(a,1/2.4)-0.055))}function za(a){return pe(a,
W),a}function nc(a){return function(){return Jd(a,this)}}function oc(a){return function(){return Ze(a,this)}}function qc(a,b){function c(){this.removeAttribute(a)}function d(){this.removeAttributeNS(a.space,a.local)}function e(){this.setAttribute(a,b)}function f(){this.setAttributeNS(a.space,a.local,b)}function g(){var c=b.apply(this,arguments);null==c?this.removeAttribute(a):this.setAttribute(a,c)}function h(){var c=b.apply(this,arguments);null==c?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,
a.local,c)}return a=d3.ns.qualify(a),null==b?a.local?d:c:"function"==typeof b?a.local?h:g:a.local?f:e}function Lb(a){return RegExp("(?:^|\\s+)"+d3.requote(a)+"(?:\\s+|$)","g")}function ed(a,b){function c(){for(var d=-1;e>++d;)a[d](this,b)}function d(){for(var c=-1,G=b.apply(this,arguments);e>++c;)a[c](this,G)}a=a.trim().split(/\s+/).map(rc);var e=a.length;return"function"==typeof b?d:c}function rc(a){var b=Lb(a);return function(c,d){if(e=c.classList)return d?e.add(a):e.remove(a);var e=c.className,
f=null!=e.baseVal,g=f?e.baseVal:e;d?(b.lastIndex=0,b.test(g)||(g=(g+" "+a).trim().replace(/\s+/g," "),f?e.baseVal=g:c.className=g)):g&&(g=g.replace(b," ").trim().replace(/\s+/g," "),f?e.baseVal=g:c.className=g)}}function ea(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);null==d?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return null==b?d:"function"==typeof b?f:e}function Mb(a,b){function c(){delete this[a]}
function d(){this[a]=b}function e(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}return null==b?c:"function"==typeof b?e:d}function Ta(a){return function(){return $e(this,a)}}function Nb(a){return arguments.length||(a=d3.ascending),function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function qb(a,b,c){function d(){var b=this[f];b&&(this.removeEventListener(a,b,b.$),delete this[f])}function e(){function g(a){var c=d3.event;d3.event=a;h[0]=X.__data__;try{b.apply(X,h)}finally{d3.event=
c}}var X=this,h=gb(arguments);d.call(this);this.addEventListener(a,this[f]=g,g.$=c);g._=b}var f="__on"+a,g=a.indexOf(".");return 0<g&&(a=a.substring(0,g)),b?e:d}function aa(a,b){for(var c=0,d=a.length;d>c;c++)for(var e,f=a[c],g=0,h=f.length;h>g;g++)(e=f[g])&&b(e,g,c);return a}function Ma(a){return pe(a,Bb),a}function Ga(a,b){return pe(a,fa),a.id=b,a}function Ua(a,b,c,d){var e=a.__transition__||(a.__transition__={active:0,count:0}),f=e[c];if(!f){var g=d.time;return f=e[c]={tween:new k,event:d3.dispatch("start",
"end"),time:g,ease:d.ease,delay:d.delay,duration:d.duration},++e.count,d3.timer(function(d){function Z(d){return e.active>c?j():(e.active=c,m.start.call(a,k,b),f.tween.forEach(function(c,d){(d=d.call(a,k,b))&&s.push(d)}),h(d)||d3.timer(h,0,g),1)}function h(d){if(e.active!==c)return j();d=(d-p)/n;for(var f=l(d),g=s.length;0<g;)s[--g].call(a,f);return 1<=d?(j(),m.end.call(a,k,b),1):void 0}function j(){return--e.count?delete e[c]:delete a.__transition__,1}var k=a.__data__,l=f.ease,m=f.event,p=f.delay,
n=f.duration,s=[];return d>=p?Z(d):d3.timer(Z,p,g),1},0,g),f}}function sc(a){return null==a&&(a=""),function(){this.textContent=a}}function Na(a,b,c,d){var e=a.id;return aa(a,"function"==typeof c?function(a,z,f){a.__transition__[e].tween.set(b,d(c.call(a,a.__data__,z,f)))}:(c=d(c),function(a){a.__transition__[e].tween.set(b,c)}))}function K(){for(var a,b=Date.now(),c=ec;c;)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;a=Yd()-b;24<a?(isFinite(a)&&(clearTimeout(Kd),Kd=setTimeout(K,a)),Ld=
0):(Ld=1,af(K))}function Yd(){for(var a=null,b=ec,c=1/0;b;)b.flush?(delete ue[b.callback.id],b=a?a.next=b.next:ec=b.next):(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function $c(a,b){var c=a.ownerSVGElement||a;if(c.createSVGPoint){var d=c.createSVGPoint();if(0>ve&&(window.scrollX||window.scrollY)){var c=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0),e=c[0][0].getScreenCTM();ve=!(e.f||e.e);c.remove()}return ve?(d.x=b.pageX,d.y=b.pageY):(d.x=
b.clientX,d.y=b.clientY),d=d.matrixTransform(a.getScreenCTM().inverse()),[d.x,d.y]}c=a.getBoundingClientRect();return[b.clientX-c.left-a.clientLeft,b.clientY-c.top-a.clientTop]}function oa(){}function bb(a){var b=a[0];a=a[a.length-1];return a>b?[b,a]:[a,b]}function Va(a){return a.rangeExtent?a.rangeExtent():bb(a.range())}function Ob(a,b){var c,d=0,e=a.length-1,f=a[d],g=a[e];return f>g&&(c=d,d=e,e=c,c=f,f=g,g=c),(b=b(g-f))&&(a[d]=b.floor(f),a[e]=b.ceil(g)),a}function Zd(){return Math}function fd(a,
b,c,d){function e(){var X=2<Math.min(a.length,b.length)?vc:hd,j=d?s:ka;return g=X(a,b,j,c),h=X(b,a,j,d3.interpolate),f}function f(a){return g(a)}var g,h;return f.invert=function(a){return h(a)},f.domain=function(b){return arguments.length?(a=b.map(Number),e()):a},f.range=function(a){return arguments.length?(b=a,e()):b},f.rangeRound=function(a){return f.range(a).interpolate(d3.interpolateRound)},f.clamp=function(a){return arguments.length?(d=a,e()):d},f.interpolate=function(a){return arguments.length?
(c=a,e()):c},f.ticks=function(b){return wa(a,b)},f.tickFormat=function(b){return Pb(a,b)},f.nice=function(){return Ob(a,tc),e()},f.copy=function(){return fd(a,b,c,d)},e()}function gd(a,b){return d3.rebind(a,b,"range","rangeRound","interpolate","clamp")}function tc(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),a&&{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function uc(a,b){var c=bb(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),
d=b/d*e;return 0.15>=d?e*=10:0.35>=d?e*=5:0.75>=d&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+0.5*e,c[2]=e,c}function wa(a,b){return d3.range.apply(d3,uc(a,b))}function Pb(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(uc(a,b)[2])/Math.LN10+0.01))+"f")}function hd(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function vc(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;for(a[h]<a[0]&&(a=a.slice().reverse(),b=b.slice().reverse());h>=
++g;)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,h)-1;return f[c](e[c](b))}}function wc(a,b){function c(d){return a(b(d))}var d=b.pow;return c.invert=function(b){return d(a.invert(b))},c.domain=function(e){return arguments.length?(b=0>e[0]?Qb:xc,d=b.pow,a.domain(e.map(b)),c):a.domain().map(d)},c.nice=function(){return a.domain(Ob(a.domain(),Zd)),c},c.ticks=function(){var c=bb(a.domain()),e=[];if(c.every(isFinite)){var G=Math.floor(c[0]),f=Math.ceil(c[1]),
g=d(c[0]),c=d(c[1]);if(b===Qb)for(e.push(d(G));f>G++;)for(var h=9;0<h;h--)e.push(d(G)*h);else{for(;f>G;G++)for(h=1;10>h;h++)e.push(d(G)*h);e.push(d(G))}for(G=0;g>e[G];G++);for(f=e.length;e[f-1]>c;f--);e=e.slice(G,f)}return e},c.tickFormat=function(a,z){if(2>arguments.length&&(z=Hf),!arguments.length)return z;var e,f=Math.max(0.1,a/c.ticks().length),g=b===Qb?(e=-1E-12,Math.floor):(e=1E-12,Math.ceil);return function(a){return f>=a/d(g(b(a)+e))?z(a):""}},c.copy=function(){return wc(a.copy(),b)},gd(c,
a)}function xc(a){return Math.log(0>a?0:a)/Math.LN10}function Qb(a){return-Math.log(0<a?0:-a)/Math.LN10}function id(a,b){function c(b){return a(d(b))}var d=rb(b),e=rb(1/b);return c.invert=function(b){return e(a.invert(b))},c.domain=function(b){return arguments.length?(a.domain(b.map(d)),c):a.domain().map(e)},c.ticks=function(a){return wa(c.domain(),a)},c.tickFormat=function(a){return Pb(c.domain(),a)},c.nice=function(){return c.domain(Ob(c.domain(),tc))},c.exponent=function(a){if(!arguments.length)return b;
var z=c.domain();return d=rb(b=a),e=rb(1/b),c.domain(z)},c.copy=function(){return id(a.copy(),b)},gd(c,a)}function rb(a){return function(b){return 0>b?-Math.pow(-b,a):Math.pow(b,a)}}function jd(a,b){function c(b){return f[((e.get(b)||e.set(b,a.push(b)))-1)%f.length]}function d(b,c){return d3.range(a.length).map(function(a){return b+c*a})}var e,f,g;return c.domain=function(d){if(!arguments.length)return a;a=[];e=new k;for(var f,g=-1,Z=d.length;Z>++g;)e.has(f=d[g])||e.set(f,a.push(f));return c[b.t].apply(c,
b.a)},c.range=function(a){return arguments.length?(f=a,g=0,b={t:"range",a:arguments},c):f},c.rangePoints=function(e,h){2>arguments.length&&(h=0);var X=e[0],j=e[1],k=(j-X)/(Math.max(1,a.length-1)+h);return f=d(2>a.length?(X+j)/2:X+k*h/2,k),g=0,b={t:"rangePoints",a:arguments},c},c.rangeBands=function(e,h,X){2>arguments.length&&(h=0);3>arguments.length&&(X=h);var j=e[1]<e[0],k=e[j-0],l=(e[1-j]-k)/(a.length-h+2*X);return f=d(k+l*X,l),j&&f.reverse(),g=l*(1-h),b={t:"rangeBands",a:arguments},c},c.rangeRoundBands=
function(e,h,X){2>arguments.length&&(h=0);3>arguments.length&&(X=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=Math.floor((l-k)/(a.length-h+2*X));return f=d(k+Math.round((l-k-(a.length-h)*m)/2),m),j&&f.reverse(),g=Math.round(m*(1-h)),b={t:"rangeRoundBands",a:arguments},c},c.rangeBand=function(){return g},c.rangeExtent=function(){return bb(b.a[0])},c.copy=function(){return jd(a,b)},c.domain(a)}function kd(a,b){function c(){var f=0,G=b.length;for(e=[];G>++f;)e[f-1]=d3.quantile(a,f/G);return d}function d(a){return isNaN(a=
+a)?0/0:b[d3.bisect(e,a)]}var e;return d.domain=function(b){return arguments.length?(a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),c()):a},d.range=function(a){return arguments.length?(b=a,c()):b},d.quantiles=function(){return e},d.copy=function(){return kd(a,b)},c()}function yc(a,b,c){function d(b){return c[Math.max(0,Math.min(g,Math.floor(f*(b-a))))]}function e(){return f=c.length/(b-a),g=c.length-1,d}var f,g;return d.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-
1],e()):[a,b]},d.range=function(a){return arguments.length?(c=a,e()):c},d.copy=function(){return yc(a,b,c)},e()}function zc(a,b){function c(d){return b[d3.bisect(a,d)]}return c.domain=function(b){return arguments.length?(a=b,c):a},c.range=function(a){return arguments.length?(b=a,c):b},c.copy=function(){return zc(a,b)},c}function Ac(a){function b(a){return+a}return b.invert=b,b.domain=b.range=function(c){return arguments.length?(a=c.map(b),b):a},b.ticks=function(b){return wa(a,b)},b.tickFormat=function(b){return Pb(a,
b)},b.copy=function(){return Ac(a)},b}function Bc(a){return a.innerRadius}function cb(a){return a.outerRadius}function Rb(a){return a.startAngle}function Cc(a){return a.endAngle}function sb(a){function b(F){function g(){k.push("M",f(a(l),h))}for(var j,k=[],l=[],m=-1,Hd=F.length,p=q(c),n=q(d);Hd>++m;)e.call(this,j=F[m],m)?l.push([+p.call(this,j,m),+n.call(this,j,m)]):l.length&&(g(),l=[]);return l.length&&g(),k.length?k.join(""):null}var c=Sb,d=Wa,e=r,f=qa,g=f.key,h=0.7;return b.x=function(a){return arguments.length?
(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b.defined=function(a){return arguments.length?(e=a,b):e},b.interpolate=function(a){return arguments.length?(g="function"==typeof a?f=a:(f=we.get(a)||qa).key,b):g},b.tension=function(a){return arguments.length?(h=a,b):h},b}function Sb(a){return a[0]}function Wa(a){return a[1]}function qa(a){return a.join("L")}function db(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];c>++b;)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function I(a){for(var b=
0,c=a.length,d=a[0],e=[d[0],",",d[1]];c>++b;)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function eb(a,b){if(1>b.length||a.length!=b.length&&a.length!=b.length+2)return qa(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,j=1;if(c&&(d+="Q"+(f[0]-2*g[0]/3)+","+(f[1]-2*g[1]/3)+","+f[0]+","+f[1],e=a[1],j=2),1<b.length){h=b[1];f=a[j];j++;d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(e=2;b.length>e;e++,j++)f=a[j],h=b[e],d+="S"+(f[0]-h[0])+","+(f[1]-
h[1])+","+f[0]+","+f[1]}c&&(c=a[j],d+="Q"+(f[0]+2*h[0]/3)+","+(f[1]+2*h[1]/3)+","+c[0]+","+c[1]);return d}function M(a,b){for(var c,d=[],e=(1-b)/2,f=a[0],g=a[1],h=1,j=a.length;j>++h;)c=f,f=g,g=a[h],d.push([e*(g[0]-c[0]),e*(g[1]-c[1])]);return d}function Dc(a){if(3>a.length)return qa(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],e=[e,",",f];for(Ha(e,g,h);c>++b;)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),Ha(e,g,h);for(b=-1;2>++b;)g.shift(),g.push(d[0]),h.shift(),
h.push(d[1]),Ha(e,g,h);return e.join("")}function Aa(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function Ha(a,b,c){a.push("C",Aa(bf,b),",",Aa(bf,c),",",Aa(cf,b),",",Aa(cf,c),",",Aa(fc,b),",",Aa(fc,c))}function ra(a,b){return(b[1]-a[1])/(b[0]-a[0])}function $d(a){for(var b,c,d,e=-1,f=a.length;f>++e;)b=a[e],c=b[0],d=b[1]+Cb,b[0]=c*Math.cos(d),b[1]=c*Math.sin(d);return a}function tb(a){function b(F){function j(){s.push("M",h(a(t),m),l,k(a(r.reverse()),m),"Z")}for(var p,Ve,n,s=[],r=[],t=[],Db=
-1,D=F.length,B=q(c),w=q(e),N=c===d?function(){return Ve}:q(d),v=e===f?function(){return n}:q(f);D>++Db;)g.call(this,p=F[Db],Db)?(r.push([Ve=+B.call(this,p,Db),n=+w.call(this,p,Db)]),t.push([+N.call(this,p,Db),+v.call(this,p,Db)])):r.length&&(j(),r=[],t=[]);return r.length&&j(),s.length?s.join(""):null}var c=Sb,d=Sb,e=0,f=Wa,g=r,h=qa,j=h.key,k=h,l="L",m=0.7;return b.x=function(a){return arguments.length?(c=d=a,b):d},b.x0=function(a){return arguments.length?(c=a,b):c},b.x1=function(a){return arguments.length?
(d=a,b):d},b.y=function(a){return arguments.length?(e=f=a,b):f},b.y0=function(a){return arguments.length?(e=a,b):e},b.y1=function(a){return arguments.length?(f=a,b):f},b.defined=function(a){return arguments.length?(g=a,b):g},b.interpolate=function(a){return arguments.length?(j="function"==typeof a?h=a:(h=we.get(a)||qa).key,k=h.reverse||h,l=h.closed?"M":"L",b):j},b.tension=function(a){return arguments.length?(m=a,b):m},b}function ub(a){return a.radius}function vb(a){return[a.x,a.y]}function ld(){return 64}
function Tb(){return"circle"}function Oa(a){a=Math.sqrt(a/H);return"M0,"+a+"A"+a+","+a+" 0 1,1 0,"+-a+"A"+a+","+a+" 0 1,1 0,"+a+"Z"}function Ub(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function wb(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function Fc(){Xc||(Xc=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);
var a,b=d3.event;try{Xc.scrollTop=1E3,Xc.dispatchEvent(b),a=1E3-Xc.scrollTop}catch(c){a=b.wheelDelta||5*-b.detail}return a}function Vb(a){var b=a.source;a=a.target;var c;var d=a;if(b===d)c=b;else{c=xb(b);for(var d=xb(d),e=c.pop(),f=d.pop(),g=null;e===f;)g=e,e=c.pop(),f=d.pop();c=g}for(d=[b];b!==c;)b=b.parent,d.push(b);for(b=d.length;a!==c;)d.splice(b,0,a),a=a.parent;return d}function xb(a){for(var b=[],c=a.parent;null!=c;)b.push(a),a=c,c=c.parent;return b.push(a),b}function ae(a){a.fixed|=2}function md(a){a.fixed&=
1}function Pe(a){a.fixed|=4;a.px=a.x;a.py=a.y}function fb(a){a.fixed&=3}function Ec(a,b,c){var d=0,e=0;if(a.charge=0,!a.leaf)for(var f,g=a.nodes,h=g.length,j=-1;h>++j;)f=g[j],null!=f&&(Ec(f,b,c),a.charge+=f.charge,d+=f.charge*f.cx,e+=f.charge*f.cy);a.point&&(a.leaf||(a.point.x+=Math.random()-0.5,a.point.y+=Math.random()-0.5),b*=c[a.point.index],a.charge+=a.pointCharge=b,d+=b*a.point.x,e+=b*a.point.y);a.cx=d/a.charge;a.cy=e/a.charge}function be(){return 20}function ce(){return 1}function de(a){return a.x}
function Wd(a){return a.y}function ee(a,b,c){a.y0=b;a.y=c}function Wb(a){return d3.range(a.length)}function Gc(a){var b=-1;a=a[0].length;for(var c=[];a>++b;)c[b]=0;return c}function ad(a){for(var b,c=1,d=0,e=a[0][1],f=a.length;f>c;++c)(b=a[c][1])>e&&(d=c,e=b);return d}function fe(a){return a.reduce(Hc,0)}function Hc(a,b){return a+b[1]}function nd(a,b){return Ic(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function Ic(a,b){for(var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];b>=++c;)f[c]=e*c+d;return f}function ge(a){return[d3.min(a),
d3.max(a)]}function yb(a,b){return d3.rebind(a,b,"sort","children","value"),a.nodes=a,a.links=pd,a}function he(a){return a.children}function ie(a){return a.value}function od(a,b){return b.value-a.value}function pd(a){return d3.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function qd(a,b){return a.value-b.value}function Jc(a,b){var c=a._pack_next;a._pack_next=b;b._pack_prev=a;b._pack_next=c;c._pack_prev=b}function la(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+
b.r;return 0.001<e*e-c*c-d*d}function Xb(a){function b(a){l=Math.min(a.x-a.r,l);m=Math.max(a.x+a.r,m);p=Math.min(a.y-a.r,p);n=Math.max(a.y+a.r,n)}if((c=a.children)&&(k=c.length)){var c,d,e,f,g,h,j,k,l=1/0,m=-1/0,p=1/0,n=-1/0;if(c.forEach(Kc),d=c[0],d.x=-d.r,d.y=0,b(d),1<k&&(e=c[1],e.x=e.r,e.y=0,b(e),2<k)){f=c[2];sd(d,e,f);b(f);Jc(d,f);d._pack_prev=f;Jc(f,e);e=d._pack_next;for(g=3;k>g;g++){sd(d,e,f=c[g]);var s=0,q=1,r=1;for(h=e._pack_next;h!==e;h=h._pack_next,q++)if(la(h,f)){s=1;break}if(1==s)for(j=
d._pack_prev;j!==h._pack_prev&&!la(j,f);j=j._pack_prev,r++);s?(r>q||q==r&&e.r<d.r?(f=d,h=e=h):(f=d=j,h=e),f._pack_next=h,h._pack_prev=f,g--):(Jc(d,f),e=f,b(f))}}d=(l+m)/2;e=(p+n)/2;for(g=j=0;k>g;g++)f=c[g],f.x-=d,f.y-=e,j=Math.max(j,f.r+Math.sqrt(f.x*f.x+f.y*f.y));a.r=j;c.forEach(je)}}function Kc(a){a._pack_next=a._pack_prev=a}function je(a){delete a._pack_next;delete a._pack_prev}function rd(a,b,c,d){var e=a.children;if(a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d,e){a=-1;for(var f=e.length;f>++a;)rd(e[a],b,
c,d)}}function sd(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f)){var g=b.r+c.r,h=e*e+f*f,g=g*g,d=d*d;b=0.5+(d-g)/(2*h);g=Math.sqrt(Math.max(0,2*g*(d+h)-(d-=h)*d-g*g))/(2*h);c.x=a.x+b*e+g*f;c.y=a.y+b*f-g*e}else c.x=a.x+d,c.y=a.y}function Eb(a){var b=a.children;return b&&b.length?Eb(b[0]):a}function td(a){var b,c=a.children;return c&&(b=c.length)?td(c[b-1]):a}function ud(a,b){return a.parent==b.parent?1:2}function Lc(a){var b=a.children;return b&&b.length?b[0]:a._tree.thread}function Ba(a){var b,
c=a.children;return c&&(b=c.length)?c[b-1]:a._tree.thread}function Ca(a,b){var c=a.children;if(c&&(e=c.length))for(var d,e,f=-1;e>++f;)0<b(d=Ca(c[f],b),a)&&(a=d);return a}function vd(a,b){return a.x-b.x}function wd(a,b){return b.x-a.x}function ke(a,b){return a.depth-b.depth}function Da(a,b){function c(a,d){var e=a.children;if(e&&(f=e.length))for(var z,f,g=null,h=-1;f>++h;)z=e[h],c(z,g),g=z;b(a,d)}c(a,null)}function Yb(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function xd(a,b){var c=a.x+b[3],d=a.y+b[0],
e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return 0>e&&(c+=e/2,e=0),0>f&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function yd(a,b){function c(a,e){return d3.xhr(a,b,e).response(d)}function d(a){return c.parse(a.responseText)}function e(b){return b.map(f).join(a)}function f(a){return g.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var g=RegExp('["'+a+"\n]"),h=a.charCodeAt(0);return c.parse=function(a){var b;return c.parseRows(a,function(a){return b?b(a):(b=Function("d","return {"+a.map(function(a,b){return JSON.stringify(a)+
": d["+b+"]"}).join(",")+"}"),void 0)})},c.parseRows=function(a,b){function c(){if(G>=F)return f;if(e)return e=!1,z;var b=G;if(34===a.charCodeAt(b)){for(var d=b;F>d++;)if(34===a.charCodeAt(d)){if(34!==a.charCodeAt(d+1))break;++d}G=d+2;var g=a.charCodeAt(d+1);return 13===g?(e=!0,10===a.charCodeAt(d+2)&&++G):10===g&&(e=!0),a.substring(b+1,d).replace(/""/g,'"')}for(;F>G;){g=a.charCodeAt(G++);d=1;if(10===g)e=!0;else if(13===g)e=!0,10===a.charCodeAt(G)&&(++G,++d);else if(g!==h)continue;return a.substring(b,
G-d)}return a.substring(b)}for(var d,e,z={},f={},g=[],F=a.length,G=0,Z=0;(d=c())!==f;){for(var j=[];d!==z&&d!==f;)j.push(d),d=c();(!b||(j=b(j,Z++)))&&g.push(j)}return g},c.format=function(a){return a.map(e).join("\n")},c}function Zb(a,b){df.hasOwnProperty(a.type)&&df[a.type](a,b)}function Mc(a,b,c){var d=-1,e=a.length-c;for(b.lineStart();e>++d;)c=a[d],b.point(c[0],c[1]);b.lineEnd()}function zd(a,b){var c=-1,d=a.length;for(b.polygonStart();d>++c;)Mc(a[c],b,1);b.polygonEnd()}function Nc(a){return[Math.atan2(a[1],
a[0]),Math.asin(Math.max(-1,Math.min(1,a[2])))]}function Oc(a,b){return Q>Math.abs(a[0]-b[0])&&Q>Math.abs(a[1]-b[1])}function $b(a){var b=a[0];a=a[1];var c=Math.cos(a);return[c*Math.cos(b),c*Math.sin(b),Math.sin(a)]}function lb(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function Ad(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function Pc(a,b){a[0]+=b[0];a[1]+=b[1];a[2]+=b[2]}function Qc(a){function b(d){function f(b,c){b=a(b,c);d.point(b[0],b[1])}function g(){k=0/0;s.point=
F;d.lineStart()}function F(b,f){var g=$b([b,f]),h=a(b,f);c(k,l,Z,m,p,n,k=h[0],l=h[1],Z=b,m=g[0],p=g[1],n=g[2],e,d);d.point(k,l)}function h(){s.point=f;d.lineEnd()}function j(){var a,b,z,f,Hd,q;g();s.point=function(c,d){F(a=c,d);b=k;z=l;f=m;Hd=p;q=n;s.point=F};s.lineEnd=function(){c(k,l,Z,m,p,n,b,z,a,f,Hd,q,e,d);s.lineEnd=h;h()}}var Z,k,l,m,p,n,s={point:f,lineStart:g,lineEnd:h,polygonStart:function(){d.polygonStart();s.lineStart=j},polygonEnd:function(){d.polygonEnd();s.lineStart=g}};return s}function c(b,
e,f,g,F,h,j,X,k,l,m,p,n,s){var q=j-b,r=X-e,t=q*q+r*r;if(t>4*d&&n--){var D=g+l,B=F+m,w=h+p,N=Math.sqrt(D*D+B*B+w*w),v=Math.asin(w/=N),y=Q>Math.abs(Math.abs(w)-1)?(f+k)/2:Math.atan2(B,D),U=a(y,v),v=U[0],U=U[1],A=v-b,E=U-e,C=r*A-q*E;(C*C/t>d||0.3<Math.abs((q*A+r*E)/t-0.5))&&(c(b,e,f,g,F,h,v,U,y,D/=N,B/=N,w,n,s),s.point(v,U),c(v,U,y,D,B,w,j,X,k,l,m,p,n,s))}}var d=0.5,e=16;return b.precision=function(a){return arguments.length?(e=0<(d=a*a)&&16,b):Math.sqrt(d)},b}function Fb(a,b){function c(a,b){var d=
Math.sqrt(f-2*e*Math.sin(b))/e;return[d*Math.sin(a*=e),g-d*Math.cos(a)]}var d=Math.sin(a),e=(d+Math.sin(b))/2,f=1+d*(2*e-d),g=Math.sqrt(f)/e;return c.invert=function(a,b){var c=g-b;return[Math.atan2(a,c)/e,Math.asin((f-(a*a+c*c)*e*e)/(2*e))]},c}function Rc(a){function b(a,c){d>a&&(d=a);a>f&&(f=a);e>c&&(e=c);c>g&&(g=c)}function c(){h.point=h.lineEnd=oa}var d,e,f,g,h={point:b,lineStart:oa,lineEnd:oa,polygonStart:function(){h.lineEnd=c},polygonEnd:function(){h.point=b}};return function(b){return g=f=
-(d=e=1/0),d3.geo.stream(b,a(h)),[[d,e],[f,g]]}}function Pa(a,b){if(!ha){++Ia;a*=O;var c=Math.cos(b*=O);ca+=(c*Math.cos(a)-ca)/Ia;da+=(c*Math.sin(a)-da)/Ia;ba+=(Math.sin(b)-ba)/Ia}}function Xa(){var a,b;ha=1;ac();ha=2;var c=Ja.point;Ja.point=function(d,e){c(a=d,b=e)};Ja.lineEnd=function(){Ja.point(a,b);Bd();Ja.lineEnd=Bd}}function ac(){function a(e,z){e*=O;var f=Math.cos(z*=O),g=f*Math.cos(e),f=f*Math.sin(e),h=Math.sin(z),j=Math.atan2(Math.sqrt((j=c*h-d*f)*j+(j=d*g-b*h)*j+(j=b*f-c*g)*j),b*g+c*f+d*
h);Ia+=j;ca+=j*(b+(b=g));da+=j*(c+(c=f));ba+=j*(d+(d=h))}var b,c,d;1<ha||(1>ha&&(ha=1,Ia=ca=da=ba=0),Ja.point=function(e,f){e*=O;var g=Math.cos(f*=O);b=g*Math.cos(e);c=g*Math.sin(e);d=Math.sin(f);Ja.point=a})}function Bd(){Ja.point=Pa}function Tc(a,b){var c=Math.cos(a),d=Math.sin(a);return function(e,f,g,h){null!=e?(e=Ab(c,e),f=Ab(c,f),(0<g?f>e:e>f)&&(e+=2*g*H)):(e=a+2*g*H,f=a);for(var j,k=g*b;0<g?e>f:f>e;e-=k)h.point((j=Nc([c,-d*Math.cos(e),-d*Math.sin(e)]))[0],j[1])}}function Ab(a,b){var c=$b(b);
c[0]-=a;var d=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);c[0]/=d;c[1]/=d;c[2]/=d;d=Math.acos(Math.max(-1,Math.min(1,-c[1])));return((0>-c[2]?-d:d)+2*Math.PI-Q)%(2*Math.PI)}function bc(a,b,c){return function(d){function e(b,c){a(b,c)&&d.point(b,c)}function f(a,b){r.point(a,b)}function g(){t.point=f;r.lineStart()}function h(){t.point=e;r.lineEnd()}function j(a,b){w.point(a,b);q.push([a,b])}function k(){w.lineStart();q=[]}function l(){j(q[0][0],q[0][1]);w.lineEnd();var a;a=w.clean();var b=te.buffer(),
c=b.length;if(!c)return s=!0,n+=Ib(q,-1),q=null,void 0;if(q=null,1&a){a=b[0];p+=Ib(a,1);var e,c=a.length-1,b=-1;for(d.lineStart();c>++b;)d.point((e=a[b])[0],e[1]);return d.lineEnd(),void 0}1<c&&2&a&&b.push(b.pop().concat(b.shift()));m.push(b.filter(Uc))}var m,p,n,s,q,r=b(d),t={point:e,lineStart:g,lineEnd:h,polygonStart:function(){t.point=j;t.lineStart=k;t.lineEnd=l;s=!1;n=p=0;m=[];d.polygonStart()},polygonEnd:function(){t.point=e;t.lineStart=g;t.lineEnd=h;m=d3.merge(m);if(m.length)a:{var a=d,b=[],
z=[];if(m.forEach(function(a){var c=a.length;if(!(1>=c)){var d=a[0],c=a[c-1];a={point:d,points:a,other:null,visited:!1,entry:!0,subject:!0};d={point:d,points:[d],other:a,visited:!1,entry:!1,subject:!1};a.other=d;b.push(a);z.push(d);a={point:c,points:[c],other:null,visited:!1,entry:!1,subject:!0};d={point:c,points:[c],other:a,visited:!1,entry:!0,subject:!1};a.other=d;b.push(a);z.push(d)}}),z.sort(hb),Ed(b),Ed(z),b.length)for(var f,F,j,k=b[0];;){for(f=k;f.visited;)if((f=f.next)===k)break a;F=f.points;
a.lineStart();do{if(f.visited=f.other.visited=!0,f.entry){if(f.subject)for(var l=0;F.length>l;l++)a.point((j=F[l])[0],j[1]);else c(f.point,f.next.point,1,a);f=f.next}else{if(f.subject){F=f.prev.points;for(l=F.length;0<=--l;)a.point((j=F[l])[0],j[1])}else c(f.point,f.prev.point,-1,a);f=f.prev}f=f.other;F=f.points}while(!f.visited);a.lineEnd()}}else(-Q>p||s&&-Q>n)&&(d.lineStart(),c(null,null,1,d),d.lineEnd());d.polygonEnd();m=null},sphere:function(){d.polygonStart();d.lineStart();c(null,null,1,d);d.lineEnd();
d.polygonEnd()}},te,D,B=[];te={lineStart:function(){B.push(D=[])},point:function(a,b){D.push([a,b])},lineEnd:oa,buffer:function(){var a=B;return B=[],D=null,a}};var w=b(te);return t}}function Ed(a){if(b=a.length){for(var b,c,d=0,e=a[0];b>++d;)e.next=c=a[d],c.prev=e,e=c;e.next=c=a[0];c.prev=e}}function hb(a,b){return(0>(a=a.point)[0]?a[1]-H/2-Q:H/2-a[1])-(0>(b=b.point)[0]?b[1]-H/2-Q:H/2-b[1])}function Uc(a){return 1<a.length}function Ib(a,b){if(!(c=a.length))return 0;var c,d,e,f=0,g=0;d=a[0];e=d[0];
for(var h=d[1],j=Math.cos(h),k=Math.atan2(b*Math.sin(e)*j,Math.sin(h)),l=1-b*Math.cos(e)*j,m=k;c>++f;)d=a[f],j=Math.cos(h=d[1]),d=Math.atan2(b*Math.sin(e=d[0])*j,Math.sin(h)),e=1-b*Math.cos(e)*j,Q>Math.abs(l-2)&&Q>Math.abs(e-2)||(Q>Math.abs(e)||Q>Math.abs(l)||(Q>Math.abs(Math.abs(d-k)-H)?2<e+l&&(g+=4*(d-k)):g+=Q>Math.abs(l-2)?4*(d-m):((3*H+d-k)%(2*H)-H)*(l+e)),m=k,k=d,l=e);return g}function sa(a,b){function c(d,e){return d=a(d,e),b(d[0],d[1])}return a.invert&&b.invert&&(c.invert=function(c,d){return c=
b.invert(c,d),a.invert(c[0],c[1])}),c}function Ea(a,b){return[a,b]}function Vc(a,b){return[a/(2*H),Math.max(-0.5,Math.min(0.5,Math.log(Math.tan(H/4+b/2))/(2*H)))]}function Fd(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+-2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function cc(){function a(b,c){g.push("M",b,",",c,f)}function b(a,d){g.push("M",a,",",d);h.point=c}function c(a,b){g.push("L",a,",",b)}function d(){h.point=a}function e(){g.push("Z")}var f=Fd(4.5),g=[],h={point:a,lineStart:function(){h.point=b},lineEnd:d,
polygonStart:function(){h.lineEnd=e},polygonEnd:function(){h.lineEnd=d;h.point=a},pointRadius:function(a){return f=Fd(a),h},result:function(){if(g.length){var a=g.join("");return g=[],a}}};return h}function Hb(a){function b(c,d){a.moveTo(c,d);a.arc(c,d,g,0,2*H)}function c(b,e){a.moveTo(b,e);h.point=d}function d(b,c){a.lineTo(b,c)}function e(){h.point=b}function f(){a.closePath()}var g=4.5,h={point:b,lineStart:function(){h.point=c},lineEnd:e,polygonStart:function(){h.lineEnd=f},polygonEnd:function(){h.lineEnd=
e;h.point=b},pointRadius:function(a){return g=a,h},result:oa};return h}function Gb(){function a(b,c){Md+=e*b-d*c;d=b;e=c}var b,c,d,e;ib.point=function(f,g){ib.point=a;b=d=f;c=e=g};ib.lineEnd=function(){a(b,c)}}function dc(a,b){ha||(ca+=a,da+=b,++ba)}function Gd(){function a(d,e){var z=d-b,f=e-c,z=Math.sqrt(z*z+f*f);ca+=z*(b+d)/2;da+=z*(c+e)/2;ba+=z;b=d;c=e}var b,c;if(1!==ha){if(!(1>ha))return;ha=1;ca=da=ba=0}Ka.point=function(d,e){Ka.point=a;b=d;c=e}}function Wc(){Ka.point=dc}function d(){function a(b,
c){var z=e*b-d*c;ca+=z*(d+b);da+=z*(e+c);ba+=3*z;d=b;e=c}var b,c,d,e;2>ha&&(ha=2,ca=da=ba=0);Ka.point=function(f,g){Ka.point=a;b=d=f;c=e=g};Ka.lineEnd=function(){a(b,c)}}function n(){function a(b,c){if(b*=O,c*=O,!(Q>Math.abs(Math.abs(f)-H/2)&&Q>Math.abs(Math.abs(c)-H/2))){var z=Math.cos(c),F=Math.sin(c);if(Q>Math.abs(f-H/2))jb+=2*(b-d);else{var G=b-e,j=Math.cos(G),k=Math.atan2(Math.sqrt((k=z*Math.sin(G))*k+(k=g*F-h*z*j)*k),h*F+g*z*j),j=(k+H+f+c)/4;jb+=(0>G&&G>-H||G>H?-4:4)*Math.atan(Math.sqrt(Math.abs(Math.tan(j)*
Math.tan(j-k/2)*Math.tan(j-H/4-f/2)*Math.tan(j-H/4-c/2))))}d=e;e=b;f=c;g=z;h=F}}var b,c,d,e,f,g,h;kb.point=function(j,k){kb.point=a;d=e=(b=j)*O;f=(c=k)*O;g=Math.cos(f);h=Math.sin(f)};kb.lineEnd=function(){a(b,c)}}function A(a){return Vd(function(){return a})()}function Vd(a){function b(a){return a=g(a[0]*O,a[1]*O),[a[0]*l+h,j-a[1]*l]}function c(a){return a=g.invert((a[0]-h)/l,(j-a[1])/l),[a[0]*ia,a[1]*ia]}function d(){g=sa(f=Ge(q,r,t),e);var a=e(n,s);return h=m-a[0]*l,j=p+a[1]*l,b}var e,f,g,h,j,k=
Qc(function(a,b){return a=e(a,b),[a[0]*l+h,j-a[1]*l]}),l=150,m=480,p=250,n=0,s=0,q=0,r=0,t=0,D=ef,B=null;return b.stream=function(a){var b=f,c=D(k(a));return{point:function(a,d){d=b(a*O,d*O);a=d[0];c.point(a>H?a-2*H:-H>a?a+2*H:a,d[1])},sphere:function(){c.sphere()},lineStart:function(){c.lineStart()},lineEnd:function(){c.lineEnd()},polygonStart:function(){c.polygonStart()},polygonEnd:function(){c.polygonEnd()}}},b.clipAngle=function(a){var c;if(arguments.length){if(null==a)c=(B=a,ef);else{var d=function(a,
b){return Math.cos(a)*Math.cos(b)>z},e=function(a,b){var c=$b(a,0),d=$b(b,0),e=[1,0,0],c=Ad(c,d),f=lb(c,c),d=c[0],g=f-d*d;if(!g)return a;f=z*f/g;g=-z*d/g;d=Ad(e,c);e=[e[0]*f,e[1]*f,e[2]*f];Pc(e,[c[0]*g,c[1]*g,c[2]*g]);c=lb(e,d);f=lb(d,d);g=Math.sqrt(c*c-f*(lb(e,e)-1));c=[d[0]*((-c-g)/f),d[1]*((-c-g)/f),d[2]*((-c-g)/f)];return Pc(c,e),Nc(c)};c=(B=+a)*O;var z=Math.cos(c);c=Tc(c,6*O);c=bc(d,function(a){var b,c,z,f;return{lineStart:function(){z=c=!1;f=1},point:function(g,h){var F,G=[g,h],j=d(g,h);!b&&
(z=c=j)&&a.lineStart();j!==c&&(F=e(b,G),(Oc(b,F)||Oc(G,F))&&(G[0]+=Q,G[1]+=Q,j=d(G[0],G[1])));j!==c&&(f=0,(c=j)?(a.lineStart(),F=e(G,b),a.point(F[0],F[1])):(F=e(b,G),a.point(F[0],F[1]),a.lineEnd()),b=F);!j||b&&Oc(b,G)||a.point(G[0],G[1]);b=G},lineEnd:function(){c&&a.lineEnd();b=null},clean:function(){return f|(z&&c)<<1}}},c)}c=(D=c,b)}else c=B;return c},b.scale=function(a){return arguments.length?(l=+a,d()):l},b.translate=function(a){return arguments.length?(m=+a[0],p=+a[1],d()):[m,p]},b.center=function(a){return arguments.length?
(n=a[0]%360*O,s=a[1]%360*O,d()):[n*ia,s*ia]},b.rotate=function(a){return arguments.length?(q=a[0]%360*O,r=a[1]%360*O,t=2<a.length?a[2]%360*O:0,d()):[q*ia,r*ia,t*ia]},d3.rebind(b,k,"precision"),function(){return e=a.apply(this,arguments),b.invert=e.invert&&c,d()}}function Ge(a,b,c){return a?b||c?sa(Ie(a),Je(b,c)):Ie(a):b||c?Je(b,c):Ea}function He(a){return function(b,c){return b+=a,[b>H?b-2*H:-H>b?b+2*H:b,c]}}function Ie(a){var b=He(a);return b.invert=He(-a),b}function Je(a,b){function c(a,b){var z=
Math.cos(b),h=Math.cos(a)*z,z=Math.sin(a)*z,F=Math.sin(b),G=F*d+h*e;return[Math.atan2(z*f-G*g,h*d-F*e),Math.asin(Math.max(-1,Math.min(1,G*f+z*g)))]}var d=Math.cos(a),e=Math.sin(a),f=Math.cos(b),g=Math.sin(b);return c.invert=function(a,b){var c=Math.cos(b),z=Math.cos(a)*c,c=Math.sin(a)*c,h=Math.sin(b),F=h*f-c*g;return[Math.atan2(c*f+h*g,z*d+F*e),Math.asin(Math.max(-1,Math.min(1,F*d-z*e)))]},c}function ic(a,b){function c(b,d){var e=Math.cos(b),f=Math.cos(d),e=a(e*f);return[e*f*Math.sin(b),e*Math.sin(d)]}
return c.invert=function(a,c){var d=Math.sqrt(a*a+c*c),e=b(d),z=Math.sin(e),e=Math.cos(e);return[Math.atan2(a*z,d*e),Math.asin(d&&c*z/d)]},c}function Bf(a,b,c,d){var e,f,g,h,j,k,l;return e=d[a],f=e[0],g=e[1],e=d[b],h=e[0],j=e[1],e=d[c],k=e[0],l=e[1],0<(l-g)*(h-f)-(j-g)*(k-f)}function Xd(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function Ke(a,b,c,d){var e=a[0],f=c[0],g=b[0]-e,h=d[0]-f;a=a[1];c=c[1];b=b[1]-a;d=d[1]-c;f=(h*(a-c)-d*(e-f))/(d*g-h*b);return[e+f*g,a+f*b]}function Le(a,
b){var c=a.map(function(a,b){return{index:b,x:a[0],y:a[1]}}).sort(function(a,b){return a.y<b.y?-1:a.y>b.y?1:a.x<b.x?-1:a.x>b.x?1:0}),d=null,e={list:[],leftEnd:null,rightEnd:null,init:function(){e.leftEnd=e.createHalfEdge(null,"l");e.rightEnd=e.createHalfEdge(null,"l");e.leftEnd.r=e.rightEnd;e.rightEnd.l=e.leftEnd;e.list.unshift(e.leftEnd,e.rightEnd)},createHalfEdge:function(a,b){return{edge:a,side:b,vertex:null,l:null,r:null}},insert:function(a,b){b.l=a;b.r=a.r;a.r.l=b;a.r=b},leftBound:function(a){var b=
e.leftEnd;do b=b.r;while(b!=e.rightEnd&&f.rightOf(b,a));return b.l},del:function(a){a.l.r=a.r;a.r.l=a.l;a.edge=null},right:function(a){return a.r},left:function(a){return a.l},leftRegion:function(a){return null==a.edge?d:a.edge.region[a.side]},rightRegion:function(a){return null==a.edge?d:a.edge.region[xe[a.side]]}},f={bisect:function(a,b){var c={region:{l:a,r:b},ep:{l:null,r:null}},d=b.x-a.x,e=b.y-a.y;return c.c=a.x*d+a.y*e+0.5*(d*d+e*e),(0<d?d:-d)>(0<e?e:-e)?(c.a=1,c.b=e/d,c.c/=d):(c.b=1,c.a=d/
e,c.c/=e),c},intersect:function(a,b){var c=a.edge,d=b.edge;if(!c||!d||c.region.r==d.region.r)return null;var e=c.a*d.b-c.b*d.a;if(1E-10>Math.abs(e))return null;var z,f,g=(c.c*d.b-d.c*c.b)/e,e=(d.c*c.a-c.c*d.a)/e,h=c.region.r,F=d.region.r;h.y<F.y||h.y==F.y&&h.x<F.x?(z=a,f=c):(z=b,f=d);return(c=g>=f.region.r.x)&&"l"===z.side||!c&&"r"===z.side?null:{x:g,y:e}},rightOf:function(a,b){var c=a.edge,d=c.region.r,e=b.x>d.x;if(e&&"l"===a.side)return 1;if(!e&&"r"===a.side)return 0;if(1===c.a){var z=b.y-d.y,f=
b.x-d.x,g=0;!e&&0>c.b||e&&0<=c.b?g=z>=c.b*f:(g=b.x+b.y*c.b>c.c,0>c.b&&(g=!g));d=d.x-c.region.l.x;g=c.b*(f*f-z*z)<d*z*(1+2*f/d+c.b*c.b);0>c.b&&(g=!g)}else f=c.c-c.a*b.x,c=b.y-f,z=b.x-d.x,d=f-d.y,g=c*c>z*z+d*d;return"l"===a.side?g:!g},endPoint:function(a,c,d){a.ep[c]=d;a.ep[xe[c]]&&b(a)},distance:function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}},g={list:[],insert:function(a,b,c){a.vertex=b;a.ystar=b.y+c;c=0;for(var d=g.list,e=d.length;e>c;c++){var z=d[c];if(!(a.ystar>z.ystar||a.ystar==
z.ystar&&b.x>z.vertex.x))break}d.splice(c,0,a)},del:function(a){for(var b=0,c=g.list,d=c.length;d>b&&c[b]!=a;++b);c.splice(b,1)},empty:function(){return 0===g.list.length},nextEvent:function(a){for(var b=0,c=g.list,d=c.length;d>b;++b)if(c[b]==a)return c[b+1];return null},min:function(){var a=g.list[0];return{x:a.vertex.x,y:a.ystar}},extractMin:function(){return g.list.shift()}};e.init();for(var d=c.shift(),h,j,k,l,m,p,n,s,q,r,t=c.shift();;)if(g.empty()||(h=g.min()),t&&(g.empty()||t.y<h.y||t.y==h.y&&
t.x<h.x))j=e.leftBound(t),k=e.right(j),n=e.rightRegion(j),r=f.bisect(n,t),p=e.createHalfEdge(r,"l"),e.insert(j,p),(q=f.intersect(j,p))&&(g.del(j),g.insert(j,q,f.distance(q,t))),j=p,p=e.createHalfEdge(r,"r"),e.insert(j,p),(q=f.intersect(p,k))&&g.insert(p,q,f.distance(q,t)),t=c.shift();else{if(g.empty())break;j=g.extractMin();l=e.left(j);k=e.right(j);m=e.right(k);n=e.leftRegion(j);p=e.rightRegion(k);q=j.vertex;f.endPoint(j.edge,j.side,q);f.endPoint(k.edge,k.side,q);e.del(j);g.del(k);e.del(k);j="l";
n.y>p.y&&(s=n,n=p,p=s,j="r");r=f.bisect(n,p);p=e.createHalfEdge(r,j);e.insert(l,p);f.endPoint(r,xe[j],q);(q=f.intersect(l,p))&&(g.del(l),g.insert(l,q,f.distance(q,n)));(q=f.intersect(p,m))&&g.insert(p,q,f.distance(q,n))}for(j=e.right(e.leftEnd);j!=e.rightEnd;j=e.right(j))b(j.edge)}function pc(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=0.5*(c+e),h=0.5*(d+f);b=b.nodes;b[0]&&pc(a,b[0],c,d,g,h);b[1]&&pc(a,b[1],g,d,e,h);b[2]&&pc(a,b[2],c,h,g,f);b[3]&&pc(a,b[3],g,h,e,f)}}function pb(){this._=new Date(1<arguments.length?
Date.UTC.apply(this,arguments):arguments[0])}function dd(a,b,c,d){for(var e,f,g=0,h=b.length,j=c.length;h>g;){if(d>=j)return-1;if(e=b.charCodeAt(g++),37===e){if(f=If[b.charAt(g++)],!f||0>(d=f(a,c,d)))return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function cd(a){return RegExp("^(?:"+a.map(d3.requote).join("|")+")","i")}function Me(a){for(var b=new k,c=-1,d=a.length;d>++c;)b.set(a[c].toLowerCase(),c);return b}function pa(a,b,c){a+="";var d=a.length;return c>d?Array(c-d+1).join(b)+a:a}function Ne(a,
b,c){ma.lastIndex=0;return(b=ma.exec(b.substring(c,c+2)))?(a.d=+b[0],c+b[0].length):-1}function Oe(a,b,c){ma.lastIndex=0;return(b=ma.exec(b.substring(c,c+2)))?(a.H=+b[0],c+b[0].length):-1}function se(a){return a.toISOString()}function zb(a,b,c){function d(b){var c=a(b),e=f(c,1);return e-b>b-c?c:e}function e(c){return b(c=a(new na(c-1)),1),c}function f(a,c){return b(a=new na(+a),c),a}function g(a,d,z){a=e(a);var f=[];if(1<z)for(;d>a;)c(a)%z||f.push(new Date(+a)),b(a,1);else for(;d>a;)f.push(new Date(+a)),
b(a,1);return f}a.floor=a;a.round=d;a.ceil=e;a.offset=f;a.range=g;var h=a.utc=Cd(a);return h.floor=h,h.round=Cd(d),h.ceil=Cd(e),h.offset=Cd(f),h.range=function(a,b,c){try{na=pb;var d=new pb;return d._=a,g(d,b,c)}finally{na=Date}},a}function Cd(a){return function(b,c){try{na=pb;var d=new pb;return d._=b,a(d,c)._}finally{na=Date}}}function le(a,b,c){function d(b){return a(b)}return d.invert=function(b){return me(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map(me)},
d.nice=function(a){return d.domain(Ob(d.domain(),function(){return a}))},d.ticks=function(c,e){var f,g=d.domain();f=g[0];g=g[g.length-1];f=g>f?[f,g]:[g,f];if("function"!=typeof c){var g=(f[1]-f[0])/c,h=d3.bisect(Nd,g);if(h==Nd.length)return b.year(f,c);if(!h)return a.ticks(c).map(me);Math.log(g/Nd[h-1])<Math.log(Nd[h]/g)&&--h;c=b[h];e=c[1];c=c[0].range}return c(f[0],new Date(+f[1]+1),e)},d.tickFormat=function(){return c},d.copy=function(){return le(a.copy(),b,c)},d3.rebind(d,a,"range","rangeRound",
"interpolate","clamp")}function me(a){return new Date(a)}function Qe(a){return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}function ne(a){var b=new Date(a,0,1);return b.setFullYear(a),b}function Cf(a){var b=a.getFullYear(),c=ne(b),d=ne(b+1);return b+(a-c)/(d-c)}function oe(a){var b=new Date(Date.UTC(a,0,1));return b.setUTCFullYear(a),b}function Df(a){var b=a.getUTCFullYear(),c=oe(b),d=oe(b+1);return b+(a-c)/(d-c)}var Dd=[3,3];Date.now||(Date.now=function(){return+new Date});
try{document.createElement("div").style.setProperty("opacity",0,"")}catch(hg){var Re=CSSStyleDeclaration.prototype,Ef=Re.setProperty;Re.setProperty=function(a,b,c){Ef.call(this,a,b+"",c)}}d3={version:"3.0.2"};var H=Math.PI,Q=1E-6,O=H/180,ia=180/H,gb=function(a){return Array.prototype.slice.call(a)};try{gb(document.documentElement.childNodes)[0].nodeType}catch(ig){gb=c}var pe=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.map=function(a){var b=new k,c;for(c in a)b.set(c,
a[c]);return b};var Se=k,qe={has:function(a){return Sc+a in this},get:function(a){return this[Sc+a]},set:function(a,b){return this[Sc+a]=b},remove:function(a){return a=Sc+a,a in this&&delete this[a]},keys:function(){var a=[];return this.forEach(function(b){a.push(b)}),a},values:function(){var a=[];return this.forEach(function(b,c){a.push(c)}),a},entries:function(){var a=[];return this.forEach(function(b,c){a.push({key:b,value:c})}),a},forEach:function(a){for(var b in this)b.charCodeAt(0)===Ff&&a.call(this,
b.substring(1),this[b])}};try{for(var Te in qe)Object.defineProperty(Se.prototype,Te,{value:qe[Te],enumerable:!1})}catch(jg){Se.prototype=qe}var Sc="\x00",Ff=Sc.charCodeAt(0);d3.functor=q;d3.rebind=function(a,b){for(var c,d=1,e=arguments.length;e>++d;)a[c=arguments[d]]=w(a,b,b[c]);return a};d3.ascending=function(a,b){return b>a?-1:a>b?1:a>=b?0:0/0};d3.descending=function(a,b){return a>b?-1:b>a?1:b>=a?0:0/0};d3.mean=function(a,b){var c,d=a.length,e=0,f=-1,g=0;if(1===arguments.length)for(;d>++f;)E(c=
a[f])&&(e+=(c-e)/++g);else for(;d>++f;)E(c=b.call(a,a[f],f))&&(e+=(c-e)/++g);return g?e:void 0};d3.median=function(a,b){return 1<arguments.length&&(a=a.map(b)),a=a.filter(E),a.length?d3.quantile(a.sort(d3.ascending),0.5):void 0};d3.min=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;f>++e&&(null==(c=a[e])||c!=c);)c=void 0;for(;f>++e;)null!=(d=a[e])&&c>d&&(c=d)}else{for(;f>++e&&(null==(c=b.call(a,a[e],e))||c!=c);)c=void 0;for(;f>++e;)null!=(d=b.call(a,a[e],e))&&c>d&&(c=d)}return c};
d3.max=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;f>++e&&(null==(c=a[e])||c!=c);)c=void 0;for(;f>++e;)null!=(d=a[e])&&d>c&&(c=d)}else{for(;f>++e&&(null==(c=b.call(a,a[e],e))||c!=c);)c=void 0;for(;f>++e;)null!=(d=b.call(a,a[e],e))&&d>c&&(c=d)}return c};d3.extent=function(a,b){var c,d,e,f=-1,g=a.length;if(1===arguments.length){for(;g>++f&&(null==(c=e=a[f])||c!=c);)c=e=void 0;for(;g>++f;)null!=(d=a[f])&&(c>d&&(c=d),d>e&&(e=d))}else{for(;g>++f&&(null==(c=e=b.call(a,a[f],f))||
c!=c);)c=void 0;for(;g>++f;)null!=(d=b.call(a,a[f],f))&&(c>d&&(c=d),d>e&&(e=d))}return[c,e]};d3.random={normal:function(a,b){var c=arguments.length;return 2>c&&(b=1),1>c&&(a=0),function(){var c,d;do c=2*Math.random()-1,d=2*Math.random()-1,d=c*c+d*d;while(!d||1<d);return a+b*c*Math.sqrt(-2*Math.log(d)/d)}},logNormal:function(a,b){var c=arguments.length;2>c&&(b=1);1>c&&(a=0);var d=d3.random.normal();return function(){return Math.exp(a+b*d())}},irwinHall:function(a){return function(){for(var b=0,c=0;a>
c;c++)b+=Math.random();return b/a}}};d3.sum=function(a,b){var c,d=0,e=a.length,f=-1;if(1===arguments.length)for(;e>++f;)isNaN(c=+a[f])||(d+=c);else for(;e>++f;)isNaN(c=+b.call(a,a[f],f))||(d+=c);return d};d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=+a[d-1];return(c-=d)?e+c*(a[d]-e):e};d3.shuffle=function(a){for(var b,c,d=a.length;d;)c=0|Math.random()*d--,b=a[d],a[d]=a[c],a[c]=b;return a};d3.transpose=function(a){return d3.zip.apply(d3,a)};d3.zip=function(){if(!(d=arguments.length))return[];
for(var a=-1,b=d3.min(arguments,P),c=Array(b);b>++a;)for(var d,e=-1,f=c[a]=Array(d);d>++e;)f[e]=arguments[e][a];return c};d3.bisector=function(a){return{left:function(b,c,d,e){3>arguments.length&&(d=0);for(4>arguments.length&&(e=b.length);e>d;){var f=d+e>>>1;c>a.call(b,b[f],f)?d=f+1:e=f}return d},right:function(b,c,d,e){3>arguments.length&&(d=0);for(4>arguments.length&&(e=b.length);e>d;){var f=d+e>>>1;a.call(b,b[f],f)>c?e=f:d=f+1}return d}}};var Ue=d3.bisector(function(a){return a});d3.bisectLeft=
Ue.left;d3.bisect=d3.bisectRight=Ue.right;d3.nest=function(){function a(b,g){if(g>=f.length)return d?d.call(e,b):c?b.sort(c):b;for(var h,j,F,l=-1,m=b.length,p=f[g++],n=new k,s={};m>++l;)(F=n.get(h=p(j=b[l])))?F.push(j):n.set(h,[j]);return n.forEach(function(b,c){s[b]=a(c,g)}),s}function b(a,c){if(c>=f.length)return a;var d,e=[],z=g[c++];for(d in a)e.push({key:d,values:b(a[d],c)});return z&&e.sort(function(a,b){return z(a.key,b.key)}),e}var c,d,e={},f=[],g=[];return e.map=function(b){return a(b,0)},
e.entries=function(c){return b(a(c,0),0)},e.key=function(a){return f.push(a),e},e.sortKeys=function(a){return g[f.length-1]=a,e},e.sortValues=function(a){return c=a,e},e.rollup=function(a){return d=a,e},e};d3.keys=function(a){var b=[],c;for(c in a)b.push(c);return b};d3.values=function(a){var b=[],c;for(c in a)b.push(a[c]);return b};d3.entries=function(a){var b=[],c;for(c in a)b.push({key:c,value:a[c]});return b};d3.permute=function(a,b){for(var c=[],d=-1,e=b.length;e>++d;)c[d]=a[b[d]];return c};
d3.merge=function(a){return Array.prototype.concat.apply([],a)};d3.range=function(a,b,c){if(3>arguments.length&&(c=1,2>arguments.length&&(b=a,a=0)),1/0===(b-a)/c)throw Error("infinite range");var d,e=[],f;d=Math.abs(c);for(f=1;d*f%1;)f*=10;var g=-1;if(a*=f,b*=f,c*=f,0>c)for(;(d=a+c*++g)>b;)e.push(d/f);else for(;b>(d=a+c*++g);)e.push(d/f);return e};d3.requote=function(a){return a.replace(Gf,"\\$&")};var Gf=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,
b)))/b:Math.round(a)};d3.xhr=function(a,b,c){function d(){var a=k.status;!a&&k.responseText||200<=a&&300>a||304===a?f.load.call(e,j.call(e,k)):f.error.call(e,k)}var e={},f=d3.dispatch("progress","load","error"),g={},j=h,k=new (window.XDomainRequest&&/^(http(s)?:)?\/\//.test(a)?XDomainRequest:XMLHttpRequest);return"onload"in k?k.onload=k.onerror=d:k.onreadystatechange=function(){3<k.readyState&&d()},k.onprogress=function(a){var b=d3.event;d3.event=a;try{f.progress.call(e,k)}finally{d3.event=b}},e.header=
function(a,b){return a=(a+"").toLowerCase(),2>arguments.length?g[a]:(null==b?delete g[a]:g[a]=b+"",e)},e.mimeType=function(a){return arguments.length?(b=null==a?null:a+"",e):b},e.response=function(a){return j=a,e},["get","post"].forEach(function(a){e[a]=function(){return e.send.apply(e,[a].concat(gb(arguments)))}}),e.send=function(c,d,f){if(2===arguments.length&&"function"==typeof d&&(f=d,d=null),k.open(c,a,!0),null==b||"accept"in g||(g.accept=b+",*/*"),k.setRequestHeader)for(var h in g)k.setRequestHeader(h,
g[h]);return null!=b&&k.overrideMimeType&&k.overrideMimeType(b),null!=f&&e.on("error",f).on("load",function(a){f(null,a)}),k.send(null==d?null:d),e},e.abort=function(){return k.abort(),e},d3.rebind(e,f,"on"),2===arguments.length&&"function"==typeof b&&(c=b,b=null),null==c?e:e.get(R(c))};d3.text=function(){return d3.xhr.apply(d3,arguments).response(J)};d3.json=function(a,b){return d3.xhr(a,"application/json",b).response(V)};d3.html=function(a,b){return d3.xhr(a,"text/html",b).response(T)};d3.xml=function(){return d3.xhr.apply(d3,
arguments).response(v)};var re={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:re,qualify:function(a){var b=a.indexOf(":"),c=a;return 0<=b&&(c=a.substring(0,b),a=a.substring(b+1)),re.hasOwnProperty(c)?{space:re[c],local:a}:a}};d3.dispatch=function(){for(var b=new e,c=-1,d=arguments.length;d>++c;)b[arguments[c]]=a(b);return b};e.prototype.on=function(a,
b){var c=a.indexOf("."),d="";return 0<c&&(d=a.substring(c+1),a=a.substring(0,c)),2>arguments.length?this[a].on(d):this[a].on(d,b)};d3.format=function(a){a=Jf.exec(a);var b=a[1]||" ",c=a[2]||">",d=a[3]||"",e=a[4]||"",f=a[5],g=+a[6],h=a[7],j=a[8],k=a[9],l=1,p="",n=!1;switch(j&&(j=+j.substring(1)),(f||"0"===b&&"="===c)&&(f=b="0",c="=",h&&(g-=Math.floor((g-1)/4))),k){case "n":h=!0;k="g";break;case "%":l=100;p="%";k="f";break;case "p":l=100;p="%";k="r";break;case "b":case "o":case "x":case "X":e&&(e="0"+
k.toLowerCase());case "c":case "d":n=!0;j=0;break;case "s":l=-1,k="r"}"#"===e&&(e="");"r"!=k||j||(k="g");var k=Kf.get(k)||m,s=f&&h;return function(a){if(n&&a%1)return"";var z=0>a||0===a&&0>1/a?(a=-a,"-"):d;if(0>l){var m=d3.formatPrefix(a,j);a=m.scale(a);p=m.symbol}else a*=l;a=k(a,j);!f&&h&&(a=ye(a));var m=e.length+a.length+(s?0:z.length),q=g>m?Array(m=g-m+1).join(b):"";return s&&(a=ye(q+a)),a.replace(".","."),z+=e,("<"===c?z+a+q:">"===c?q+z+a:"^"===c?q.substring(0,m>>=1)+z+a+q.substring(m):z+(s?a:
q+a))+p}};var Jf=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,Kf=d3.map({b:function(a){return a.toString(2)},c:function(a){return String.fromCharCode(a)},o:function(a){return a.toString(8)},x:function(a){return a.toString(16)},X:function(a){return a.toString(16).toUpperCase()},g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return d3.round(a,b=p(a,b)).toFixed(Math.max(0,Math.min(20,
b)))}}),ye=h;if(Dd)var Lf=Dd.length,ye=function(a){for(var b=a.lastIndexOf("."),c=0<=b?"."+a.substring(b+1):(b=a.length,""),d=[],e=0,f=Dd[0];0<b&&0<f;)d.push(a.substring(b-=f,b+f)),f=Dd[e=(e+1)%Lf];return d.reverse().join(",")+c};var Mf="y z a f p n \u03bc m  k M G T P E Z Y".split(" ").map(function(a,b){var c=Math.pow(10,3*Math.abs(8-b));return{scale:8<b?function(a){return a/c}:function(a){return a*c},symbol:a}});d3.formatPrefix=function(a,b){var c=0;return a&&(0>a&&(a*=-1),b&&(a=d3.round(a,p(a,
b))),c=1+Math.floor(1E-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,3*Math.floor((0>=c?c+1:c-1)/3)))),Mf[8+c/3]};var ff=function(){return h},Nf=d3.map({linear:ff,poly:function(a){return function(b){return Math.pow(b,a)}},quad:function(){return g},cubic:function(){return S},sin:function(){return ja},exp:function(){return ta},circle:function(){return C},elastic:function(a,b){var c;return 2>arguments.length&&(b=0.45),arguments.length?c=b/(2*H)*Math.asin(1/a):(a=1,c=b/4),function(d){return 1+
a*Math.pow(2,10*-d)*Math.sin(2*(d-c)*H/b)}},back:function(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}},bounce:function(){return ua}}),Of=d3.map({"in":h,out:j,"in-out":t,"out-in":function(a){return t(j(a))}});d3.ease=function(a){var b=a.indexOf("-"),c=0<=b?a.substring(0,b):a,b=0<=b?a.substring(b+1):"in",c=Nf.get(c)||ff,b=Of.get(b)||h,d=b(c.apply(null,Array.prototype.slice.call(arguments,1)));return function(a){return 0>=a?0:1<=a?1:d(a)}};d3.event=null;d3.transform=function(a){var b=
document.createElementNS(d3.ns.prefix.svg,"g");return(d3.transform=function(a){b.setAttribute("transform",a);a=b.transform.baseVal.consolidate();return new va(a?a.matrix:Pf)})(a)};va.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Pf={a:1,b:0,c:0,d:1,e:0,f:0};d3.interpolate=function(a,b){for(var c,d=d3.interpolators.length;0<=--d&&!(c=d3.interpolators[d](a,b)););return c};d3.interpolateNumber=function(a,b){return b-=
a,function(c){return a+b*c}};d3.interpolateRound=function(a,b){return b-=a,function(c){return Math.round(a+b*c)}};d3.interpolateString=function(a,b){var c,d,e,f,g=0,h=[],j=[];for(d=Od.lastIndex=0;c=Od.exec(b);++d)c.index&&h.push(b.substring(g,c.index)),j.push({i:h.length,x:c[0]}),h.push(null),g=Od.lastIndex;b.length>g&&h.push(b.substring(g));d=0;for(e=j.length;(c=Od.exec(a))&&e>d;++d)if(f=j[d],f.x==c[0]){if(f.i)if(null==h[f.i+1]){h[f.i-1]+=f.x;h.splice(f.i,1);for(c=d+1;e>c;++c)j[c].i--}else{h[f.i-
1]+=f.x+h[f.i+1];h.splice(f.i,2);for(c=d+1;e>c;++c)j[c].i-=2}else if(null==h[f.i+1])h[f.i]=f.x;else{h[f.i]=f.x+h[f.i+1];h.splice(f.i+1,1);for(c=d+1;e>c;++c)j[c].i--}j.splice(d,1);e--;d--}else f.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(f.x));for(;e>d;)f=j.pop(),null==h[f.i+1]?h[f.i]=f.x:(h[f.i]=f.x+h[f.i+1],h.splice(f.i+1,1)),e--;return 1===h.length?null==h[0]?j[0].x:function(){return b}:function(a){for(d=0;e>d;++d)h[(f=j[d]).i]=f.x(a);return h.join("")}};d3.interpolateTransform=function(a,
b){var c,d=[],e=[],f=d3.transform(a),g=d3.transform(b),h=f.translate,j=g.translate,k=f.rotate,l=g.rotate,m=f.skew,p=g.skew,f=f.scale,g=g.scale;return h[0]!=j[0]||h[1]!=j[1]?(d.push("translate(",null,",",null,")"),e.push({i:1,x:d3.interpolateNumber(h[0],j[0])},{i:3,x:d3.interpolateNumber(h[1],j[1])})):j[0]||j[1]?d.push("translate("+j+")"):d.push(""),k!=l?(180<k-l?l+=360:180<l-k&&(k+=360),e.push({i:d.push(d.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(k,l)})):l&&d.push(d.pop()+"rotate("+l+")"),
m!=p?e.push({i:d.push(d.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(m,p)}):p&&d.push(d.pop()+"skewX("+p+")"),f[0]!=g[0]||f[1]!=g[1]?(c=d.push(d.pop()+"scale(",null,",",null,")"),e.push({i:c-4,x:d3.interpolateNumber(f[0],g[0])},{i:c-2,x:d3.interpolateNumber(f[1],g[1])})):(1!=g[0]||1!=g[1])&&d.push(d.pop()+"scale("+g+")"),c=e.length,function(a){for(var b,f=-1;c>++f;)d[(b=e[f]).i]=b.x(a);return d.join("")}};d3.interpolateRgb=function(a,b){a=d3.rgb(a);b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=
b.g-d,h=b.b-e;return function(a){return"#"+U(Math.round(c+f*a))+U(Math.round(d+g*a))+U(Math.round(e+h*a))}};d3.interpolateHsl=function(a,b){a=d3.hsl(a);b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return 180<f?f-=360:-180>f&&(f+=360),function(a){return Jb(c+f*a,d+g*a,e+h*a)+""}};d3.interpolateLab=function(a,b){a=d3.lab(a);b=d3.lab(b);var c=a.l,d=a.a,e=a.b,f=b.l-c,g=b.a-d,h=b.b-e;return function(a){return Ra(c+f*a,d+g*a,e+h*a)+""}};d3.interpolateHcl=function(a,b){a=d3.hcl(a);b=d3.hcl(b);
var c=a.h,d=a.c,e=a.l,f=b.h-c,g=b.c-d,h=b.l-e;return 180<f?f-=360:-180>f&&(f+=360),function(a){return mc(c+f*a,d+g*a,e+h*a)+""}};d3.interpolateArray=function(a,b){var c,d=[],e=[],f=a.length,g=b.length,h=Math.min(a.length,b.length);for(c=0;h>c;++c)d.push(d3.interpolate(a[c],b[c]));for(;f>c;++c)e[c]=a[c];for(;g>c;++c)e[c]=b[c];return function(a){for(c=0;h>c;++c)e[c]=d[c](a);return e}};d3.interpolateObject=function(a,b){var c,d={},e={};for(c in a)c in b?d[c]=ga(c)(a[c],b[c]):e[c]=a[c];for(c in b)c in
a||(e[c]=b[c]);return function(a){for(c in d)e[c]=d[c](a);return e}};var Od=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return("string"==typeof a||"string"==typeof b)&&d3.interpolateString(a+"",b+"")},function(a,b){return("string"==typeof b?Id.has(b)||/^(#|rgb\(|hsl\()/.test(b):b instanceof D)&&d3.interpolateRgb(a,b)},function(a,b){return!isNaN(a=+a)&&!isNaN(b=+b)&&d3.interpolateNumber(a,
b)}];D.prototype.toString=function(){return this.rgb()+""};d3.rgb=function(a,b,c){return 1===arguments.length?a instanceof N?B(a.r,a.g,a.b):La(""+a,B,Jb):B(~~a,~~b,~~c)};var Pd=N.prototype=new D;Pd.brighter=function(a){a=Math.pow(0.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b;return b||c||d?(b&&30>b&&(b=30),c&&30>c&&(c=30),d&&30>d&&(d=30),B(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))):B(30,30,30)};Pd.darker=function(a){return a=Math.pow(0.7,
arguments.length?a:1),B(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))};Pd.hsl=function(){return ya(this.r,this.g,this.b)};Pd.toString=function(){return"#"+U(this.r)+U(this.g)+U(this.b)};var Id=d3.map({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",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",
deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#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",grey:"#808080",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",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",
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:"#db7093",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",slategrey:"#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"});Id.forEach(function(a,b){Id.set(a,La(b,B,Jb))});d3.hsl=function(a,b,c){return 1===arguments.length?a instanceof lc?ab(a.h,a.s,a.l):La(""+a,ya,ab):ab(+a,+b,+c)};var ze=lc.prototype=new D;ze.brighter=function(a){return a=Math.pow(0.7,arguments.length?a:1),ab(this.h,this.s,this.l/a)};ze.darker=function(a){return a=Math.pow(0.7,arguments.length?a:1),ab(this.h,this.s,a*this.l)};ze.rgb=function(){return Jb(this.h,this.s,this.l)};
d3.hcl=function(a,b,c){return 1===arguments.length?a instanceof Kb?mb(a.h,a.c,a.l):a instanceof Qa?bd(a.l,a.a,a.b):bd((a=Y((a=d3.rgb(a)).r,a.g,a.b)).l,a.a,a.b):mb(+a,+b,+c)};var Ae=Kb.prototype=new D;Ae.brighter=function(a){return mb(this.h,this.c,Math.min(100,this.l+Qd*(arguments.length?a:1)))};Ae.darker=function(a){return mb(this.h,this.c,Math.max(0,this.l-Qd*(arguments.length?a:1)))};Ae.rgb=function(){return mc(this.h,this.c,this.l).rgb()};d3.lab=function(a,b,c){return 1===arguments.length?a instanceof
Qa?Fa(a.l,a.a,a.b):a instanceof Kb?mc(a.l,a.c,a.h):Y((a=d3.rgb(a)).r,a.g,a.b):Fa(+a,+b,+c)};var Qd=18,We=0.95047,Xe=1,Ye=1.08883,Be=Qa.prototype=new D;Be.brighter=function(a){return Fa(Math.min(100,this.l+Qd*(arguments.length?a:1)),this.a,this.b)};Be.darker=function(a){return Fa(Math.max(0,this.l-Qd*(arguments.length?a:1)),this.a,this.b)};Be.rgb=function(){return Ra(this.l,this.a,this.b)};var Jd=function(a,b){return b.querySelector(a)},Ze=function(a,b){return b.querySelectorAll(a)},gc=document.documentElement,
Qf=gc.matchesSelector||gc.webkitMatchesSelector||gc.mozMatchesSelector||gc.msMatchesSelector||gc.oMatchesSelector,$e=function(a,b){return Qf.call(a,b)};"function"==typeof Sizzle&&(Jd=function(a,b){return Sizzle(a,b)[0]||null},Ze=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))},$e=Sizzle.matchesSelector);var W=[];d3.selection=function(){return Yc};d3.selection.prototype=W;W.select=function(a){var b,c,d,e,f=[];"function"!=typeof a&&(a=nc(a));for(var g=-1,h=this.length;h>++g;){f.push(b=[]);b.parentNode=
(d=this[g]).parentNode;for(var j=-1,k=d.length;k>++j;)(e=d[j])?(b.push(c=a.call(e,e.__data__,j)),c&&"__data__"in e&&(c.__data__=e.__data__)):b.push(null)}return za(f)};W.selectAll=function(a){var b,c,d=[];"function"!=typeof a&&(a=oc(a));for(var e=-1,f=this.length;f>++e;)for(var g=this[e],h=-1,j=g.length;j>++h;)(c=g[h])&&(d.push(b=gb(a.call(c,c.__data__,h))),b.parentNode=c);return za(d)};W.attr=function(a,b){if(2>arguments.length){if("string"==typeof a){var c=this.node();return a=d3.ns.qualify(a),
a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(qc(b,a[b]));return this}return this.each(qc(a,b))};W.classed=function(a,b){if(2>arguments.length){if("string"==typeof a){var c=this.node(),d=(a=a.trim().split(/^|\s+/g)).length,e=-1;if(b=c.classList)for(;d>++e;){if(!b.contains(a[e]))return!1}else{b=c.className;for(null!=b.baseVal&&(b=b.baseVal);d>++e;)if(!Lb(a[e]).test(b))return!1}return!0}for(b in a)this.each(ed(b,a[b]));return this}return this.each(ed(a,b))};W.style=
function(a,b,c){var d=arguments.length;if(3>d){if("string"!=typeof a){2>d&&(b="");for(c in a)this.each(ea(c,a[c],b));return this}if(2>d)return getComputedStyle(this.node(),null).getPropertyValue(a);c=""}return this.each(ea(a,b,c))};W.property=function(a,b){if(2>arguments.length){if("string"==typeof a)return this.node()[a];for(b in a)this.each(Mb(b,a[b]));return this}return this.each(Mb(a,b))};W.text=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);
this.textContent=null==b?"":b}:null==a?function(){this.textContent=""}:function(){this.textContent=a}):this.node().textContent};W.html=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}:null==a?function(){this.innerHTML=""}:function(){this.innerHTML=a}):this.node().innerHTML};W.append=function(a){function b(){return this.appendChild(document.createElementNS(this.namespaceURI,a))}function c(){return this.appendChild(document.createElementNS(a.space,
a.local))}return a=d3.ns.qualify(a),this.select(a.local?c:b)};W.insert=function(a,b){function c(){return this.insertBefore(document.createElementNS(this.namespaceURI,a),Jd(b,this))}function d(){return this.insertBefore(document.createElementNS(a.space,a.local),Jd(b,this))}return a=d3.ns.qualify(a),this.select(a.local?d:c)};W.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})};W.data=function(a,b){function c(a,d){var e,f,g,z=a.length,m=d.length,p=Math.min(z,
m),n=Math.max(z,m),G=[],s=[],Z=[];if(b){var n=new k,X=[];g=d.length;for(e=-1;z>++e;)p=b.call(f=a[e],f.__data__,e),n.has(p)?Z[g++]=f:n.set(p,f),X.push(p);for(e=-1;m>++e;)p=b.call(d,g=d[e],e),n.has(p)?(G[e]=f=n.get(p),f.__data__=g,s[e]=Z[e]=null):(s[e]={__data__:g},G[e]=Z[e]=null),n.remove(p);for(e=-1;z>++e;)n.has(X[e])&&(Z[e]=a[e])}else{for(e=-1;p>++e;)f=a[e],g=d[e],f?(f.__data__=g,G[e]=f,s[e]=Z[e]=null):(s[e]={__data__:g},G[e]=Z[e]=null);for(;m>e;++e)s[e]={__data__:d[e]},G[e]=Z[e]=null;for(;n>e;++e)Z[e]=
a[e],s[e]=G[e]=null}s.update=G;s.parentNode=G.parentNode=Z.parentNode=a.parentNode;h.push(s);j.push(G);l.push(Z)}var d,e,f=-1,g=this.length;if(!arguments.length){for(a=Array(g=(d=this[0]).length);g>++f;)(e=d[f])&&(a[f]=e.__data__);return a}var h=Ma([]),j=za([]),l=za([]);if("function"==typeof a)for(;g>++f;)c(d=this[f],a.call(d,d.parentNode.__data__,f));else for(;g>++f;)c(d=this[f],a);return j.enter=function(){return h},j.exit=function(){return l},j};W.datum=function(a){return arguments.length?this.property("__data__",
a):this.property("__data__")};W.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=Ta(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]);b.parentNode=(c=this[f]).parentNode;for(var h=0,j=c.length;j>h;h++)(d=c[h])&&a.call(d,d.__data__,h)&&b.push(d)}return za(e)};W.order=function(){for(var a=-1,b=this.length;b>++a;)for(var c,d=this[a],e=d.length-1,f=d[e];0<=--e;)(c=d[e])&&(f&&f!==c.nextSibling&&f.parentNode.insertBefore(c,f),f=c);return this};W.sort=function(a){a=Nb.apply(this,arguments);for(var b=
-1,c=this.length;c>++b;)this[b].sort(a);return this.order()};W.on=function(a,b,c){var d=arguments.length;if(3>d){if("string"!=typeof a){2>d&&(b=!1);for(c in a)this.each(qb(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(qb(a,b,c))};W.each=function(a){return aa(this,function(b,c,d){a.call(b,b.__data__,c,d)})};W.call=function(a){var b=gb(arguments);return a.apply(b[0]=this,b),this};W.empty=function(){return!this.node()};W.node=function(){for(var a=0,b=this.length;b>
a;a++)for(var c=this[a],d=0,e=c.length;e>d;d++){var f=c[d];if(f)return f}return null};W.transition=function(){var a,b,c=Zc||++gf,d=[],e=Object.create(Rd);e.time=Date.now();for(var f=-1,g=this.length;g>++f;){d.push(a=[]);for(var h=this[f],j=-1,k=h.length;k>++j;)(b=h[j])&&Ua(b,j,c,e),a.push(b)}return Ga(d,c)};var Yc=za([[document]]);Yc[0].parentNode=gc;d3.select=function(a){return"string"==typeof a?Yc.select(a):za([[a]])};d3.selectAll=function(a){return"string"==typeof a?Yc.selectAll(a):za([gb(a)])};
var Bb=[];d3.selection.enter=Ma;d3.selection.enter.prototype=Bb;Bb.append=W.append;Bb.insert=W.insert;Bb.empty=W.empty;Bb.node=W.node;Bb.select=function(a){for(var b,c,d,e,f,g=[],h=-1,j=this.length;j>++h;){d=(e=this[h]).update;g.push(b=[]);b.parentNode=e.parentNode;for(var k=-1,l=e.length;l>++k;)(f=e[k])?(b.push(d[k]=c=a.call(e.parentNode,f.__data__,k)),c.__data__=f.__data__):b.push(null)}return za(g)};var Zc,fa=[],gf=0,Rd={ease:function(a){if(0>=a)return 0;if(1<=a)return 1;var b=a*a,c=b*a;return 4*
(0.5>a?c:3*(a-b)+c-0.75)},delay:0,duration:250};fa.call=W.call;fa.empty=W.empty;fa.node=W.node;d3.transition=function(a){return arguments.length?Zc?a.transition():a:Yc.transition()};d3.transition.prototype=fa;fa.select=function(a){var b,c,d,e=this.id,f=[];"function"!=typeof a&&(a=nc(a));for(var g=-1,h=this.length;h>++g;){f.push(b=[]);for(var j=this[g],k=-1,l=j.length;l>++k;)(d=j[k])&&(c=a.call(d,d.__data__,k))?("__data__"in d&&(c.__data__=d.__data__),Ua(c,k,e,d.__transition__[e]),b.push(c)):b.push(null)}return Ga(f,
e)};fa.selectAll=function(a){var b,c,d,e,f=this.id,g=[];"function"!=typeof a&&(a=oc(a));for(var h=-1,j=this.length;j>++h;)for(var k=this[h],l=-1,m=k.length;m>++l;)if(b=k[l]){e=b.__transition__[f];c=a.call(b,b.__data__,l);g.push(b=[]);for(var p=-1,n=c.length;n>++p;)Ua(d=c[p],p,f,e),b.push(d)}return Ga(g,f)};fa.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=Ta(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]);c=this[f];for(var h=0,j=c.length;j>h;h++)(d=c[h])&&a.call(d,d.__data__,h)&&b.push(d)}return Ga(e,
this.id,this.time).ease(this.ease())};fa.attr=function(a,b){function c(){this.removeAttribute(f)}function d(){this.removeAttributeNS(f.space,f.local)}if(2>arguments.length){for(b in a)this.attr(b,a[b]);return this}var e=ga(a),f=d3.ns.qualify(a);return Na(this,"attr."+a,b,function(a){function b(){var c,d=this.getAttribute(f);return d!==a&&(c=e(d,a),function(a){this.setAttribute(f,c(a))})}function g(){var b,c=this.getAttributeNS(f.space,f.local);return c!==a&&(b=e(c,a),function(a){this.setAttributeNS(f.space,
f.local,b(a))})}return null==a?f.local?d:c:(a+="",f.local?g:b)})};fa.attrTween=function(a,b){function c(a,d){var f=b.call(this,a,d,this.getAttribute(e));return f&&function(a){this.setAttribute(e,f(a))}}function d(a,c){var f=b.call(this,a,c,this.getAttributeNS(e.space,e.local));return f&&function(a){this.setAttributeNS(e.space,e.local,f(a))}}var e=d3.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)};fa.style=function(a,b,c){function d(){this.style.removeProperty(a)}var e=arguments.length;if(3>
e){if("string"!=typeof a){2>e&&(b="");for(c in a)this.style(c,a[c],b);return this}c=""}var f=ga(a);return Na(this,"style."+a,b,function(b){function e(){var d,g=getComputedStyle(this,null).getPropertyValue(a);return g!==b&&(d=f(g,b),function(b){this.style.setProperty(a,d(b),c)})}return null==b?d:(b+="",e)})};fa.styleTween=function(a,b,c){return 3>arguments.length&&(c=""),this.tween("style."+a,function(d,e){var f=b.call(this,d,e,getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,
f(b),c)}})};fa.text=function(a){return Na(this,"text",a,sc)};fa.remove=function(){return this.each("end.transition",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})};fa.ease=function(a){var b=this.id;return 1>arguments.length?this.node().__transition__[b].ease:("function"!=typeof a&&(a=d3.ease.apply(d3,arguments)),aa(this,function(c){c.__transition__[b].ease=a}))};fa.delay=function(a){var b=this.id;return aa(this,"function"==typeof a?function(c,d,e){c.__transition__[b].delay=
0|a.call(c,c.__data__,d,e)}:(a|=0,function(c){c.__transition__[b].delay=a}))};fa.duration=function(a){var b=this.id;return aa(this,"function"==typeof a?function(c,d,e){c.__transition__[b].duration=Math.max(1,0|a.call(c,c.__data__,d,e))}:(a=Math.max(1,0|a),function(c){c.__transition__[b].duration=a}))};fa.each=function(a,b){var c=this.id;if(2>arguments.length){var d=Rd,e=Zc;Zc=c;aa(this,function(b,d,e){Rd=b.__transition__[c];a.call(b,b.__data__,d,e)});Rd=d;Zc=e}else aa(this,function(d){d.__transition__[c].event.on(a,
b)});return this};fa.transition=function(){for(var a,b,c,d,e=this.id,f=++gf,g=[],h=0,j=this.length;j>h;h++){g.push(a=[]);b=this[h];for(var k=0,l=b.length;l>k;k++)(c=b[k])&&(d=Object.create(c.__transition__[e]),d.delay+=d.duration,Ua(c,k,f,d)),a.push(c)}return Ga(g,f)};fa.tween=function(a,b){var c=this.id;return 2>arguments.length?this.node().__transition__[c].tween.get(a):aa(this,null==b?function(b){b.__transition__[c].tween.remove(a)}:function(d){d.__transition__[c].tween.set(a,b)})};var Ld,Kd,Rf=
0,ue={},ec=null;d3.timer=function(a,b,c){if(3>arguments.length){if(2>arguments.length)b=0;else if(!isFinite(b))return;c=Date.now()}var d=ue[a.id];d&&d.callback===a?(d.then=c,d.delay=b):ue[a.id=++Rf]=ec={callback:a,then:c,delay:b,next:ec};Ld||(Kd=clearTimeout(Kd),Ld=1,af(K))};d3.timer.flush=function(){for(var a,b=Date.now(),c=ec;c;)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;Yd()};var af=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||
window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.mouse=function(a){return $c(a,L())};var ve=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(a,b){return 2>arguments.length&&(b=L().touches),b?gb(b).map(function(b){var c=$c(a,b);return c.identifier=b.identifier,c}):[]};d3.scale={};d3.scale.linear=function(){return fd([0,1],[0,1],d3.interpolate,!1)};d3.scale.log=function(){return wc(d3.scale.linear(),xc)};var Hf=d3.format(".0e");xc.pow=function(a){return Math.pow(10,a)};Qb.pow=
function(a){return-Math.pow(10,-a)};d3.scale.pow=function(){return id(d3.scale.linear(),1)};d3.scale.sqrt=function(){return d3.scale.pow().exponent(0.5)};d3.scale.ordinal=function(){return jd([],{t:"range",a:[[]]})};d3.scale.category10=function(){return d3.scale.ordinal().range(Sf)};d3.scale.category20=function(){return d3.scale.ordinal().range(Tf)};d3.scale.category20b=function(){return d3.scale.ordinal().range(Uf)};d3.scale.category20c=function(){return d3.scale.ordinal().range(Vf)};var Sf="#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" "),
Tf="#1f77b4 #aec7e8 #ff7f0e #ffbb78 #2ca02c #98df8a #d62728 #ff9896 #9467bd #c5b0d5 #8c564b #c49c94 #e377c2 #f7b6d2 #7f7f7f #c7c7c7 #bcbd22 #dbdb8d #17becf #9edae5".split(" "),Uf="#393b79 #5254a3 #6b6ecf #9c9ede #637939 #8ca252 #b5cf6b #cedb9c #8c6d31 #bd9e39 #e7ba52 #e7cb94 #843c39 #ad494a #d6616b #e7969c #7b4173 #a55194 #ce6dbd #de9ed6".split(" "),Vf="#3182bd #6baed6 #9ecae1 #c6dbef #e6550d #fd8d3c #fdae6b #fdd0a2 #31a354 #74c476 #a1d99b #c7e9c0 #756bb1 #9e9ac8 #bcbddc #dadaeb #636363 #969696 #bdbdbd #d9d9d9".split(" ");
d3.scale.quantile=function(){return kd([],[])};d3.scale.quantize=function(){return yc(0,1,[0,1])};d3.scale.threshold=function(){return zc([0.5],[0,1])};d3.scale.identity=function(){return Ac([0,1])};d3.svg={};d3.svg.arc=function(){function a(){var f=b.apply(this,arguments),g=c.apply(this,arguments),h=d.apply(this,arguments)+Cb,j=e.apply(this,arguments)+Cb,k=(h>j&&(k=h,h=j,j=k),j-h),z=H>k?"0":"1",l=Math.cos(h),h=Math.sin(h),m=Math.cos(j),j=Math.sin(j);return k>=Wf?f?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+
-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+f+"A"+f+","+f+" 0 1,0 0,"+-f+"A"+f+","+f+" 0 1,0 0,"+f+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":f?"M"+g*l+","+g*h+"A"+g+","+g+" 0 "+z+",1 "+g*m+","+g*j+"L"+f*m+","+f*j+"A"+f+","+f+" 0 "+z+",0 "+f*l+","+f*h+"Z":"M"+g*l+","+g*h+"A"+g+","+g+" 0 "+z+",1 "+g*m+","+g*j+"L0,0Z"}var b=Bc,c=cb,d=Rb,e=Cc;return a.innerRadius=function(c){return arguments.length?(b=q(c),a):b},a.outerRadius=function(b){return arguments.length?(c=q(b),a):c},a.startAngle=
function(b){return arguments.length?(d=q(b),a):d},a.endAngle=function(b){return arguments.length?(e=q(b),a):e},a.centroid=function(){var a=(b.apply(this,arguments)+c.apply(this,arguments))/2,f=(d.apply(this,arguments)+e.apply(this,arguments))/2+Cb;return[Math.cos(f)*a,Math.sin(f)*a]},a};var Cb=-H/2,Wf=2*H-1E-6;d3.svg.line=function(){return sb(h)};var we=d3.map({linear:qa,"linear-closed":function(a){return qa(a)+"Z"},"step-before":db,"step-after":I,basis:Dc,"basis-open":function(a){if(4>a.length)return qa(a);
for(var b,c=[],d=-1,e=a.length,f=[0],g=[0];3>++d;)b=a[d],f.push(b[0]),g.push(b[1]);c.push(Aa(fc,f)+","+Aa(fc,g));for(--d;e>++d;)b=a[d],f.shift(),f.push(b[0]),g.shift(),g.push(b[1]),Ha(c,f,g);return c.join("")},"basis-closed":function(a){for(var b,c,d=-1,e=a.length,f=e+4,g=[],h=[];4>++d;)c=a[d%e],g.push(c[0]),h.push(c[1]);b=[Aa(fc,g),",",Aa(fc,h)];for(--d;f>++d;)c=a[d%e],g.shift(),g.push(c[0]),h.shift(),h.push(c[1]),Ha(b,g,h);return b.join("")},bundle:function(a,b){var c=a.length-1;if(c)for(var d,
e,f=a[0][0],g=a[0][1],h=a[c][0]-f,j=a[c][1]-g,k=-1;c>=++k;)d=a[k],e=k/c,d[0]=b*d[0]+(1-b)*(f+e*h),d[1]=b*d[1]+(1-b)*(g+e*j);return Dc(a)},cardinal:function(a,b){return 3>a.length?qa(a):a[0]+eb(a,M(a,b))},"cardinal-open":function(a,b){return 4>a.length?qa(a):a[1]+eb(a.slice(1,a.length-1),M(a,b))},"cardinal-closed":function(a,b){return 3>a.length?qa(a):a[0]+eb((a.push(a[0]),a),M([a[a.length-2]].concat(a,[a[1]]),b))},monotone:function(a){if(3>a.length)a=qa(a);else{var b=a[0],c,d,e,f,g=[],h;c=0;h=a.length-
1;for(var j=[],k=a[1],l=j[0]=ra(a[0],k);h>++c;)j[c]=(l+(l=ra(k,k=a[c+1])))/2;h=(j[c]=l,j);j=-1;for(k=a.length-1;k>++j;)c=ra(a[j],a[j+1]),1E-6>Math.abs(c)?h[j]=h[j+1]=0:(d=h[j]/c,e=h[j+1]/c,f=d*d+e*e,9<f&&(f=3*c/Math.sqrt(f),h[j]=f*d,h[j+1]=f*e));for(j=-1;k>=++j;)f=(a[Math.min(k,j+1)][0]-a[Math.max(0,j-1)][0])/(6*(1+h[j]*h[j])),g.push([f||0,h[j]*f||0]);a=b+eb(a,g)}return a}});we.forEach(function(a,b){b.key=a;b.closed=/-closed$/.test(a)});var bf=[0,2/3,1/3,0],cf=[0,1/3,2/3,0],fc=[0,1/6,2/3,1/6];d3.svg.line.radial=
function(){var a=sb($d);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a};db.reverse=I;I.reverse=db;d3.svg.area=function(){return tb(h)};d3.svg.area.radial=function(){var a=tb($d);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a};d3.svg.chord=function(){function a(b,f){var g=c(this,d,b,f),h=c(this,e,b,f);return"M"+g.p0+("A"+g.r+","+g.r+" 0 "+ +(g.a1-g.a0>H)+",1 "+g.p1)+
(g.a0==h.a0&&g.a1==h.a1?"Q 0,0 "+g.p0:"Q 0,0 "+h.p0+("A"+h.r+","+h.r+" 0 "+ +(h.a1-h.a0>H)+",1 "+h.p1)+("Q 0,0 "+g.p0))+"Z"}function c(a,b,d,e){var j=b.call(a,d,e);b=f.call(a,j,e);d=g.call(a,j,e)+Cb;a=h.call(a,j,e)+Cb;return{r:b,a0:d,a1:a,p0:[b*Math.cos(d),b*Math.sin(d)],p1:[b*Math.cos(a),b*Math.sin(a)]}}var d=l,e=b,f=ub,g=Rb,h=Cc;return a.radius=function(b){return arguments.length?(f=q(b),a):f},a.source=function(b){return arguments.length?(d=q(b),a):d},a.target=function(b){return arguments.length?
(e=q(b),a):e},a.startAngle=function(b){return arguments.length?(g=q(b),a):g},a.endAngle=function(b){return arguments.length?(h=q(b),a):h},a};d3.svg.diagonal=function(){function a(b,f){var g=c.call(this,b,f),h=d.call(this,b,f),j=(g.y+h.y)/2,g=[g,{x:g.x,y:j},{x:h.x,y:j},h];return g=g.map(e),"M"+g[0]+"C"+g[1]+" "+g[2]+" "+g[3]}var c=l,d=b,e=vb;return a.source=function(b){return arguments.length?(c=q(b),a):c},a.target=function(b){return arguments.length?(d=q(b),a):d},a.projection=function(b){return arguments.length?
(e=b,a):e},a};d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=vb,c=a.projection;return a.projection=function(a){var d;if(arguments.length){var e=b=a;d=c(function(){var a=e.apply(this,arguments),b=a[0],a=a[1]+Cb;return[b*Math.cos(a),b*Math.sin(a)]})}else d=b;return d},a};d3.svg.symbol=function(){function a(d,e){return(hf.get(b.call(this,d,e))||Oa)(c.call(this,d,e))}var b=Tb,c=ld;return a.type=function(c){return arguments.length?(b=q(c),a):b},a.size=function(b){return arguments.length?(c=
q(b),a):c},a};var hf=d3.map({circle:Oa,cross:function(a){a=Math.sqrt(a/5)/2;return"M"+-3*a+","+-a+"H"+-a+"V"+-3*a+"H"+a+"V"+-a+"H"+3*a+"V"+a+"H"+a+"V"+3*a+"H"+-a+"V"+a+"H"+-3*a+"Z"},diamond:function(a){a=Math.sqrt(a/(2*jf));var b=a*jf;return"M0,"+-a+"L"+b+",0 0,"+a+" "+-b+",0Z"},square:function(a){a=Math.sqrt(a)/2;return"M"+-a+","+-a+"L"+a+","+-a+" "+a+","+a+" "+-a+","+a+"Z"},"triangle-down":function(a){a=Math.sqrt(a/Sd);var b=a*Sd/2;return"M0,"+b+"L"+a+","+-b+" "+-a+","+-b+"Z"},"triangle-up":function(a){a=
Math.sqrt(a/Sd);var b=a*Sd/2;return"M0,"+-b+"L"+a+","+b+" "+-a+","+b+"Z"}});d3.svg.symbolTypes=hf.keys();var Sd=Math.sqrt(3),jf=Math.tan(30*O);d3.svg.axis=function(){function a(m){m.each(function(){var a,m=d3.select(this),p=null==k?c.ticks?c.ticks.apply(c,j):c.domain():k,z=null==b?c.tickFormat?c.tickFormat.apply(c,j):String:b,n=l;if(s=[],n&&1<p.length){for(var s,q,r,t=bb(c.domain()),D=-1,B=p.length,w=(p[1]-p[0])/++n;B>++D;)for(q=n;0<--q;)(r=+p[D]-q*w)>=t[0]&&s.push(r);--D;for(q=0;n>++q&&(r=+p[D]+
q*w)<t[1];)s.push(r)}q=m.selectAll(".minor").data(s,String);n=q.enter().insert("line","g").attr("class","tick minor").style("opacity",1E-6);s=d3.transition(q.exit()).style("opacity",1E-6).remove();q=d3.transition(q).style("opacity",1);var Ya=m.selectAll("g").data(p,String),p=Ya.enter().insert("g","path").style("opacity",1E-6),t=d3.transition(Ya.exit()).style("opacity",1E-6).remove();r=d3.transition(Ya).style("opacity",1);var D=Va(c),w=m.selectAll(".domain").data([0]),m=d3.transition(w),v=c.copy(),
B=this.__chart__||v;this.__chart__=v;w.enter().append("path").attr("class","domain");p.append("line").attr("class","tick");p.append("text");var w=p.select("line"),N=r.select("line"),z=Ya.select("text").text(z),Ya=p.select("text"),y=r.select("text");switch(d){case "bottom":a=Ub;n.attr("y2",f);q.attr("x2",0).attr("y2",f);w.attr("y2",e);Ya.attr("y",Math.max(e,0)+h);N.attr("x2",0).attr("y2",e);y.attr("x",0).attr("y",Math.max(e,0)+h);z.attr("dy",".71em").style("text-anchor","middle");m.attr("d","M"+D[0]+
","+g+"V0H"+D[1]+"V"+g);break;case "top":a=Ub;n.attr("y2",-f);q.attr("x2",0).attr("y2",-f);w.attr("y2",-e);Ya.attr("y",-(Math.max(e,0)+h));N.attr("x2",0).attr("y2",-e);y.attr("x",0).attr("y",-(Math.max(e,0)+h));z.attr("dy","0em").style("text-anchor","middle");m.attr("d","M"+D[0]+","+-g+"V0H"+D[1]+"V"+-g);break;case "left":a=wb;n.attr("x2",-f);q.attr("x2",-f).attr("y2",0);w.attr("x2",-e);Ya.attr("x",-(Math.max(e,0)+h));N.attr("x2",-e).attr("y2",0);y.attr("x",-(Math.max(e,0)+h)).attr("y",0);z.attr("dy",
".32em").style("text-anchor","end");m.attr("d","M"+-g+","+D[0]+"H0V"+D[1]+"H"+-g);break;case "right":a=wb,n.attr("x2",f),q.attr("x2",f).attr("y2",0),w.attr("x2",e),Ya.attr("x",Math.max(e,0)+h),N.attr("x2",e).attr("y2",0),y.attr("x",Math.max(e,0)+h).attr("y",0),z.attr("dy",".32em").style("text-anchor","start"),m.attr("d","M"+g+","+D[0]+"H0V"+D[1]+"H"+g)}if(c.ticks)p.call(a,B),r.call(a,v),t.call(a,v),n.call(a,B),q.call(a,v),s.call(a,v);else{var U=v.rangeBand()/2,z=function(a){return v(a)+U};p.call(a,
z);r.call(a,z)}})}var b,c=d3.scale.linear(),d="bottom",e=6,f=6,g=6,h=3,j=[10],k=null,l=0;return a.scale=function(b){return arguments.length?(c=b,a):c},a.orient=function(b){return arguments.length?(d=b,a):d},a.ticks=function(){return arguments.length?(j=arguments,a):j},a.tickValues=function(b){return arguments.length?(k=b,a):k},a.tickFormat=function(c){return arguments.length?(b=c,a):b},a.tickSize=function(b,c){if(!arguments.length)return e;var d=arguments.length-1;return e=+b,f=1<d?+c:e,g=0<d?+arguments[d]:
e,a},a.tickPadding=function(b){return arguments.length?(h=+b,a):h},a.tickSubdivide=function(b){return arguments.length?(l=+b,a):l},a};d3.svg.brush=function(){function a(f){f.each(function(){var f,g=d3.select(this),h=g.selectAll(".background").data([0]),m=g.selectAll(".extent").data([0]),p=g.selectAll(".resize").data(l,String);g.style("pointer-events","all").on("mousedown.brush",e).on("touchstart.brush",e);h.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor",
"crosshair");m.enter().append("rect").attr("class","extent").style("cursor","move");p.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return Xf[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");p.style("display",a.empty()?"none":null);p.exit().remove();j&&(f=Va(j),h.attr("x",f[0]).attr("width",f[1]-f[0]),c(g));k&&(f=Va(k),
h.attr("y",f[0]).attr("height",f[1]-f[0]),d(g));b(g)})}function b(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+m[+/e$/.test(a)][0]+","+m[+/^s/.test(a)][1]+")"})}function c(a){a.select(".extent").attr("x",m[0][0]);a.selectAll(".extent,.n>rect,.s>rect").attr("width",m[1][0]-m[0][0])}function d(a){a.select(".extent").attr("y",m[0][1]);a.selectAll(".extent,.e>rect,.w>rect").attr("height",m[1][1]-m[0][1])}function e(){function l(){var a=d3.event.changedTouches;return a?d3.touches(t,
a)[0]:d3.mouse(t)}function p(){var a=l(),e=!1;r&&(a[0]+=r[0],a[1]+=r[1]);Za||(d3.event.altKey?(q||(q=[(m[0][0]+m[1][0])/2,(m[0][1]+m[1][1])/2]),y[0]=m[+(a[0]<q[0])][0],y[1]=m[+(a[1]<q[1])][1]):q=null);v&&n(a,j,0)&&(c(X),e=!0);N&&n(a,k,1)&&(d(X),e=!0);e&&(b(X),B({type:"brush",mode:Za?"move":"resize"}))}function n(a,b,c){var d,e,f=Va(b);b=f[0];var f=f[1],h=y[c],j=m[1][c]-m[0][c];return Za&&(b-=h,f-=j+h),d=Math.max(b,Math.min(f,a[c])),Za?e=(d+=h)+j:(q&&(h=Math.max(b,Math.min(f,2*q[c]-d))),d>h?(e=d,d=
h):e=h),m[0][c]!==d||m[1][c]!==e?(g=null,m[0][c]=d,m[1][c]=e,!0):void 0}function s(){p();X.style("pointer-events","all").selectAll(".resize").style("display",a.empty()?"none":null);d3.select("body").style("cursor",null);U.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);B({type:"brushend"});f()}var q,r,t=this,D=d3.select(d3.event.target),B=h.of(t,arguments),X=d3.select(t),w=D.datum(),v=!/^(n|s)$/.test(w)&&
j,N=!/^(e|w)$/.test(w)&&k,Za=D.classed("extent"),y=l(),U=d3.select(window).on("mousemove.brush",p).on("mouseup.brush",s).on("touchmove.brush",p).on("touchend.brush",s).on("keydown.brush",function(){32==d3.event.keyCode&&(Za||(q=null,y[0]-=m[1][0],y[1]-=m[1][1],Za=2),f())}).on("keyup.brush",function(){32==d3.event.keyCode&&2==Za&&(y[0]+=m[1][0],y[1]+=m[1][1],Za=0,f())});if(Za)y[0]=m[0][0]-y[0],y[1]=m[0][1]-y[1];else if(w){var A=+/w$/.test(w),w=+/^n/.test(w);r=[m[1-A][0]-y[0],m[1-w][1]-y[1]];y[0]=m[A][0];
y[1]=m[w][1]}else d3.event.altKey&&(q=y.slice());X.style("pointer-events","none").selectAll(".resize").style("display",null);d3.select("body").style("cursor",D.style("cursor"));B({type:"brushstart"});p();f()}var g,h=y(a,"brushstart","brush","brushend"),j=null,k=null,l=Ce[0],m=[[0,0],[0,0]];return a.x=function(b){return arguments.length?(j=b,l=Ce[!j<<1|!k],a):j},a.y=function(b){return arguments.length?(k=b,l=Ce[!j<<1|!k],a):k},a.extent=function(b){var c,d,e,f,h;return arguments.length?(g=[[0,0],[0,
0]],j&&(c=b[0],d=b[1],k&&(c=c[0],d=d[0]),g[0][0]=c,g[1][0]=d,j.invert&&(c=j(c),d=j(d)),c>d&&(h=c,c=d,d=h),m[0][0]=0|c,m[1][0]=0|d),k&&(e=b[0],f=b[1],j&&(e=e[1],f=f[1]),g[0][1]=e,g[1][1]=f,k.invert&&(e=k(e),f=k(f)),e>f&&(h=e,e=f,f=h),m[0][1]=0|e,m[1][1]=0|f),a):(b=g||m,j&&(c=b[0][0],d=b[1][0],g||(c=m[0][0],d=m[1][0],j.invert&&(c=j.invert(c),d=j.invert(d)),c>d&&(h=c,c=d,d=h))),k&&(e=b[0][1],f=b[1][1],g||(e=m[0][1],f=m[1][1],k.invert&&(e=k.invert(e),f=k.invert(f)),e>f&&(h=e,e=f,f=h))),j&&k?[[c,e],[d,
f]]:j?[c,d]:k&&[e,f])},a.clear=function(){return g=null,m[0][0]=m[0][1]=m[1][0]=m[1][1]=0,a},a.empty=function(){return j&&m[0][0]===m[1][0]||k&&m[0][1]===m[1][1]},d3.rebind(a,h,"on")};var Xf={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ce=["n e s w nw ne se sw".split(" "),["e","w"],["n","s"],[]];d3.behavior={};d3.behavior.drag=function(){function a(){this.on("mousedown.drag",b).on("touchstart.drag",b)}function b(){function a(){var b=
j.parentNode;return null!=l?d3.touches(b).filter(function(a){return a.identifier===l})[0]:d3.mouse(b)}function e(){k({type:"dragend"});z&&(f(),d3.event.target===m&&n.on("click.drag",g,!0));n.on(null!=l?"touchmove.drag-"+l:"mousemove.drag",null).on(null!=l?"touchend.drag-"+l:"mouseup.drag",null)}function g(){f();n.on("click.drag",null)}var h,j=this,k=c.of(j,arguments),m=d3.event.target,l=d3.event.touches?d3.event.changedTouches[0].identifier:null,p=a(),z=0,n=d3.select(window).on(null!=l?"touchmove.drag-"+
l:"mousemove.drag",function(){if(!j.parentNode)return e();var b=a(),c=b[0]-p[0],d=b[1]-p[1];z|=c|d;p=b;f();k({type:"drag",x:b[0]+h[0],y:b[1]+h[1],dx:c,dy:d})}).on(null!=l?"touchend.drag-"+l:"mouseup.drag",e,!0);d?(h=d.apply(j,arguments),h=[h.x-p[0],h.y-p[1]]):h=[0,0];null==l&&f();k({type:"dragstart"})}var c=y(a,"drag","dragstart","dragend"),d=null;return a.origin=function(b){return arguments.length?(d=b,a):d},d3.rebind(a,c,"on")};d3.behavior.zoom=function(){function a(){this.on("mousedown.zoom",h).on("mousewheel.zoom",
j).on("mousemove.zoom",k).on("DOMMouseScroll.zoom",j).on("dblclick.zoom",l).on("touchstart.zoom",m).on("touchmove.zoom",p).on("touchend.zoom",m)}function b(a){return[(a[0]-w[0])/v,(a[1]-w[1])/v]}function c(a){v=Math.max(N[0],Math.min(N[1],a))}function d(a,b){b=[b[0]*v+w[0],b[1]*v+w[1]];w[0]+=a[0]-b[0];w[1]+=a[1]-b[1]}function e(){r&&r.domain(q.range().map(function(a){return(a-w[0])/v}).map(q.invert));D&&D.domain(t.range().map(function(a){return(a-w[1])/v}).map(t.invert))}function g(a){e();d3.event.preventDefault();
a({type:"zoom",scale:v,translate:w})}function h(){function a(){f();l.on("click.zoom",null)}var c=this,e=U.of(c,arguments),j=d3.event.target,k=0,l=d3.select(window).on("mousemove.zoom",function(){k=1;d(d3.mouse(c),m);g(e)}).on("mouseup.zoom",function(){k&&f();l.on("mousemove.zoom",null).on("mouseup.zoom",null);k&&d3.event.target===j&&l.on("click.zoom",a,!0)}),m=b(d3.mouse(c));window.focus();f()}function j(){n||(n=b(d3.mouse(this)));c(Math.pow(2,0.002*Fc())*v);d(d3.mouse(this),n);g(U.of(this,arguments))}
function k(){n=null}function l(){var a=d3.mouse(this),e=b(a),f=Math.log(v)/Math.LN2;c(Math.pow(2,d3.event.shiftKey?Math.ceil(f)-1:Math.floor(f)+1));d(a,e);g(U.of(this,arguments))}function m(){var a=d3.touches(this),e=Date.now();if(s=v,n={},a.forEach(function(a){n[a.identifier]=b(a)}),f(),1===a.length){if(500>e-B){var h=a[0],a=b(a[0]);c(2*v);d(h,a);g(U.of(this,arguments))}B=e}}function p(){var a=d3.touches(this),b=a[0],e=n[b.identifier];if(a=a[1]){var f=n[a.identifier],b=[(b[0]+a[0])/2,(b[1]+a[1])/
2],e=[(e[0]+f[0])/2,(e[1]+f[1])/2];c(d3.event.scale*s)}d(b,e);B=null;g(U.of(this,arguments))}var n,s,q,r,t,D,B,w=[0,0],v=1,N=kf,U=y(a,"zoom");return a.translate=function(b){return arguments.length?(w=b.map(Number),e(),a):w},a.scale=function(b){return arguments.length?(v=+b,e(),a):v},a.scaleExtent=function(b){return arguments.length?(N=null==b?kf:b.map(Number),a):N},a.x=function(b){return arguments.length?(r=b,q=b.copy(),w=[0,0],v=1,a):r},a.y=function(b){return arguments.length?(D=b,t=b.copy(),w=[0,
0],v=1,a):D},d3.rebind(a,U,"on")};var Xc,kf=[0,1/0];d3.layout={};d3.layout.bundle=function(){return function(a){for(var b=[],c=-1,d=a.length;d>++c;)b.push(Vb(a[c]));return b}};d3.layout.chord=function(){function a(){var k,m,p,n,z,s={},q=[],r=d3.range(f),t=[];c=[];d=[];k=0;for(n=-1;f>++n;){m=0;for(z=-1;f>++z;)m+=e[n][z];q.push(m);t.push(d3.range(f));k+=m}g&&r.sort(function(a,b){return g(q[a],q[b])});h&&t.forEach(function(a,b){a.sort(function(a,c){return h(e[b][a],e[b][c])})});k=(2*H-l*f)/k;m=0;for(n=
-1;f>++n;){p=m;for(z=-1;f>++z;){var D=r[n],B=t[D][z],w=e[D][B],v=m,N=m+=w*k;s[D+"-"+B]={index:D,subindex:B,startAngle:v,endAngle:N,value:w}}d[D]={index:D,startAngle:p,endAngle:m,value:(m-p)/k};m+=l}for(n=-1;f>++n;)for(z=n-1;f>++z;)k=s[n+"-"+z],m=s[z+"-"+n],(k.value||m.value)&&c.push(k.value<m.value?{source:m,target:k}:{source:k,target:m});j&&b()}function b(){c.sort(function(a,b){return j((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)})}var c,d,e,f,g,h,j,k={},l=0;return k.matrix=
function(a){return arguments.length?(f=(e=a)&&e.length,c=d=null,k):e},k.padding=function(a){return arguments.length?(l=a,c=d=null,k):l},k.sortGroups=function(a){return arguments.length?(g=a,c=d=null,k):g},k.sortSubgroups=function(a){return arguments.length?(h=a,c=null,k):h},k.sortChords=function(a){return arguments.length?(j=a,c&&b(),k):j},k.chords=function(){return c||a(),c},k.groups=function(){return d||a(),d},k};d3.layout.force=function(){function a(b){return function(a,c,d,e){if(a.point!==b){d=
a.cx-b.x;var f=a.cy-b.y,g=1/Math.sqrt(d*d+f*f);if(t>(e-c)*g)return c=a.charge*g*g,b.px-=d*c,b.py-=f*c,!0;a.point&&isFinite(g)&&(c=a.pointCharge*g*g,b.px-=d*c,b.py-=f*c)}return!a.charge}}function b(a){a.px=d3.event.x;a.py=d3.event.y;j.resume()}var c,d,e,f,g,j={},k=d3.dispatch("start","tick","end"),m=[1,1],l=0.9,p=be,n=ce,s=-30,r=0.1,t=0.8,D=[],B=[];return j.tick=function(){if(0.005>(d*=0.99))return k.end({type:"end",alpha:d=0}),!0;var b,c,h,j,p,n,q,F,G=D.length,t=B.length;for(c=0;t>c;++c)h=B[c],b=
h.source,j=h.target,q=j.x-b.x,F=j.y-b.y,(p=q*q+F*F)&&(p=d*f[c]*((p=Math.sqrt(p))-e[c])/p,q*=p,F*=p,j.x-=q*(n=b.weight/(j.weight+b.weight)),j.y-=F*n,b.x+=q*(n=1-n),b.y+=F*n);if((n=d*r)&&(q=m[0]/2,F=m[1]/2,c=-1,n))for(;G>++c;)h=D[c],h.x+=(q-h.x)*n,h.y+=(F-h.y)*n;if(s){Ec(b=d3.geom.quadtree(D),d,g);for(c=-1;G>++c;)(h=D[c]).fixed||b.visit(a(h))}for(c=-1;G>++c;)h=D[c],h.fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*l,h.y-=(h.py-(h.py=h.y))*l);k.tick({type:"tick",alpha:d})},j.nodes=function(a){return arguments.length?
(D=a,j):D},j.links=function(a){return arguments.length?(B=a,j):B},j.size=function(a){return arguments.length?(m=a,j):m},j.linkDistance=function(a){return arguments.length?(p=q(a),j):p},j.distance=j.linkDistance,j.linkStrength=function(a){return arguments.length?(n=q(a),j):n},j.friction=function(a){return arguments.length?(l=a,j):l},j.charge=function(a){return arguments.length?(s="function"==typeof a?a:+a,j):s},j.gravity=function(a){return arguments.length?(r=a,j):r},j.theta=function(a){return arguments.length?
(t=a,j):t},j.alpha=function(a){return arguments.length?(d?d=0<a?a:0:0<a&&(k.start({type:"start",alpha:d=a}),d3.timer(j.tick)),j):d},j.start=function(){function a(e,f){var g,h;if(!d){d=[];for(c=0;k>c;++c)d[c]=[];for(c=0;l>c;++c)g=B[c],d[g.source.index].push(g.target),d[g.target.index].push(g.source)}h=d[b];for(var j=-1,m=h.length;m>++j;)if(!isNaN(g=h[j][e]))return g;return Math.random()*f}var b,c,d,h,k=D.length,l=B.length,z=m[0],q=m[1];for(b=0;k>b;++b)(h=D[b]).index=b,h.weight=0;e=[];f=[];for(b=0;l>
b;++b)h=B[b],"number"==typeof h.source&&(h.source=D[h.source]),"number"==typeof h.target&&(h.target=D[h.target]),e[b]=p.call(this,h,b),f[b]=n.call(this,h,b),++h.source.weight,++h.target.weight;for(b=0;k>b;++b)h=D[b],isNaN(h.x)&&(h.x=a("x",z)),isNaN(h.y)&&(h.y=a("y",q)),isNaN(h.px)&&(h.px=h.x),isNaN(h.py)&&(h.py=h.y);if(g=[],"function"==typeof s)for(b=0;k>b;++b)g[b]=+s.call(this,D[b],b);else for(b=0;k>b;++b)g[b]=s;return j.resume()},j.resume=function(){return j.alpha(0.1)},j.stop=function(){return j.alpha(0)},
j.drag=function(){c||(c=d3.behavior.drag().origin(h).on("dragstart",ae).on("drag",b).on("dragend",md));this.on("mouseover.force",Pe).on("mouseout.force",fb).call(c)},d3.rebind(j,k,"on")};d3.layout.partition=function(){function a(b,c,d,e){var f=b.children;if(b.x=c,b.y=b.depth*e,b.dx=d,b.dy=e,f&&(g=f.length)){var g,h,j=-1;for(d=b.value?d/b.value:0;g>++j;)a(h=f[j],c,b=h.value*d,e),c+=b}}function b(a){a=a.children;var c=0;if(a&&(d=a.length))for(var d,e=-1;d>++e;)c=Math.max(c,b(a[e]));return 1+c}function c(f,
g){var h=d.call(this,f,g);return a(h[0],0,e[0],e[1]/b(h[0])),h}var d=d3.layout.hierarchy(),e=[1,1];return c.size=function(a){return arguments.length?(e=a,c):e},yb(c,d)};d3.layout.pie=function(){function a(f){var g=f.map(function(c,d){return+b.call(a,c,d)}),h=+("function"==typeof d?d.apply(this,arguments):d),j=(("function"==typeof e?e.apply(this,arguments):e)-d)/d3.sum(g),k=d3.range(f.length);null!=c&&k.sort(c===lf?function(a,b){return g[b]-g[a]}:function(a,b){return c(f[a],f[b])});var m=[];return k.forEach(function(a){var b;
m[a]={data:f[a],value:b=g[a],startAngle:h,endAngle:h+=b*j}}),m}var b=Number,c=lf,d=0,e=2*H;return a.value=function(c){return arguments.length?(b=c,a):b},a.sort=function(b){return arguments.length?(c=b,a):c},a.startAngle=function(b){return arguments.length?(d=b,a):d},a.endAngle=function(b){return arguments.length?(e=b,a):e},a};var lf={};d3.layout.stack=function(){function a(h,j){var k=h.map(function(c,d){return b.call(a,c,d)}),m=k.map(function(b){return b.map(function(b,c){return[f.call(a,b,c),g.call(a,
b,c)]})}),l=c.call(a,m,j),k=d3.permute(k,l),m=d3.permute(m,l),p,n,s=d.call(a,m,j),q=k.length,r=k[0].length;for(p=0;r>p;++p){e.call(a,k[0][p],n=s[p],m[0][p][1]);for(l=1;q>l;++l)e.call(a,k[l][p],n+=m[l-1][p][1],m[l][p][1])}return h}var b=h,c=Wb,d=Gc,e=ee,f=de,g=Wd;return a.values=function(c){return arguments.length?(b=c,a):b},a.order=function(b){return arguments.length?(c="function"==typeof b?b:Yf.get(b)||Wb,a):c},a.offset=function(b){return arguments.length?(d="function"==typeof b?b:Zf.get(b)||Gc,
a):d},a.x=function(b){return arguments.length?(f=b,a):f},a.y=function(b){return arguments.length?(g=b,a):g},a.out=function(b){return arguments.length?(e=b,a):e},a};var Yf=d3.map({"inside-out":function(a){var b,c=a.length,d=a.map(ad),e=a.map(fe),f=d3.range(c).sort(function(a,b){return d[a]-d[b]}),g=0,h=0,j=[],k=[];for(a=0;c>a;++a)b=f[a],h>g?(g+=e[b],j.push(b)):(h+=e[b],k.push(b));return k.reverse().concat(j)},reverse:function(a){return d3.range(a.length).reverse()},"default":Wb}),Zf=d3.map({silhouette:function(a){var b,
c,d,e=a.length,f=a[0].length,g=[],h=0,j=[];for(c=0;f>c;++c){for(d=b=0;e>b;b++)d+=a[b][c][1];d>h&&(h=d);g.push(d)}for(c=0;f>c;++c)j[c]=(h-g[c])/2;return j},wiggle:function(a){var b,c,d,e,f,g,h,j,k,m=a.length,l=a[0],p=l.length,n=[];n[0]=j=k=0;for(c=1;p>c;++c){for(e=b=0;m>b;++b)e+=a[b][c][1];f=b=0;for(h=l[c][0]-l[c-1][0];m>b;++b){d=0;for(g=(a[b][c][1]-a[b][c-1][1])/(2*h);b>d;++d)g+=(a[d][c][1]-a[d][c-1][1])/h;f+=g*a[b][c][1]}n[c]=j-=e?f/e*h:0;k>j&&(k=j)}for(c=0;p>c;++c)n[c]-=k;return n},expand:function(a){var b,
c,d,e=a.length,f=a[0].length,g=1/e,h=[];for(c=0;f>c;++c){for(d=b=0;e>b;b++)d+=a[b][c][1];if(d)for(b=0;e>b;b++)a[b][c][1]/=d;else for(b=0;e>b;b++)a[b][c][1]=g}for(c=0;f>c;++c)h[c]=0;return h},zero:Gc});d3.layout.histogram=function(){function a(f,g){var h,j,k=[],m=f.map(c,this),l=d.call(this,m,g),p=e.call(this,l,m,g);g=-1;for(var n=m.length,s=p.length-1,z=b?1:1/n;s>++g;)h=k[g]=[],h.dx=p[g+1]-(h.x=p[g]),h.y=0;if(0<s)for(g=-1;n>++g;)j=m[g],j>=l[0]&&l[1]>=j&&(h=k[d3.bisect(p,j,1,s)-1],h.y+=z,h.push(f[g]));
return k}var b=!0,c=Number,d=ge,e=nd;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=q(b),a):d},a.bins=function(b){return arguments.length?(e="number"==typeof b?function(a){return Ic(a,b)}:q(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a};d3.layout.hierarchy=function(){function a(b,g,h){var j=e.call(c,b,g);if(b.depth=g,h.push(b),j&&(k=j.length)){for(var k,m=-1,l=b.children=[],p=0,n=g+1;k>++m;)g=a(j[m],n,h),g.parent=
b,l.push(g),p+=g.value;d&&l.sort(d);f&&(b.value=p)}else f&&(b.value=+f.call(c,b,g)||0);return b}function b(a,d){var e=a.children,g=0;if(e&&(h=e.length))for(var h,j=-1,k=d+1;h>++j;)g+=b(e[j],k);else f&&(g=+f.call(c,a,d)||0);return f&&(a.value=g),g}function c(b){var d=[];return a(b,0,d),d}var d=od,e=he,f=ie;return c.sort=function(a){return arguments.length?(d=a,c):d},c.children=function(a){return arguments.length?(e=a,c):e},c.value=function(a){return arguments.length?(f=a,c):f},c.revalue=function(a){return b(a,
0),a},c};d3.layout.pack=function(){function a(e,f){var g=b.call(this,e,f),h=g[0];h.x=0;h.y=0;Da(h,function(a){a.r=Math.sqrt(a.value)});Da(h,Xb);var j=d[0],k=d[1],m=Math.max(2*h.r/j,2*h.r/k);if(0<c){var l=c*m/2;Da(h,function(a){a.r+=l});Da(h,Xb);Da(h,function(a){a.r-=l});m=Math.max(2*h.r/j,2*h.r/k)}return rd(h,j/2,k/2,1/m),g}var b=d3.layout.hierarchy().sort(qd),c=0,d=[1,1];return a.size=function(b){return arguments.length?(d=b,a):d},a.padding=function(b){return arguments.length?(c=+b,a):c},yb(a,b)};
d3.layout.cluster=function(){function a(e,f){var g,h=b.call(this,e,f),j=h[0],k=0;Da(j,function(a){var b=a.children;b&&b.length?(a.x=b.reduce(function(a,b){return a+b.x},0)/b.length,a.y=1+d3.max(b,function(a){return a.y})):(a.x=g?k+=c(a,g):0,a.y=0,g=a)});var m=Eb(j),l=td(j),p=m.x-c(m,l)/2,n=l.x+c(l,m)/2;return Da(j,function(a){a.x=(a.x-p)/(n-p)*d[0];a.y=(1-(j.y?a.y/j.y:1))*d[1]}),h}var b=d3.layout.hierarchy().sort(null).value(null),c=ud,d=[1,1];return a.separation=function(b){return arguments.length?
(c=b,a):c},a.size=function(b){return arguments.length?(d=b,a):d},yb(a,b)};d3.layout.tree=function(){function a(e,f){function g(a,b){var d=a.children,e=a._tree;if(d&&(f=d.length)){for(var f,h,j,k=d[0],m=k,l=-1;f>++l;){j=d[l];g(j,h);var p=j;if(h){for(var n=void 0,s=p,z=p,q=p.parent.children[0],r=s._tree.mod,F=z._tree.mod,D=h._tree.mod,t=q._tree.mod;h=Ba(h),s=Lc(s),h&&s;){q=Lc(q);z=Ba(z);z._tree.ancestor=p;n=h._tree.prelim+D-s._tree.prelim-r+c(h,s);if(0<n){var B=h._tree.ancestor.parent==p.parent?h._tree.ancestor:
m,w=p,v=n,B=B._tree,w=w._tree,Z=v/(w.number-B.number);B.change+=Z;w.change-=Z;w.shift+=v;w.prelim+=v;w.mod+=v;r+=n;F+=n}D+=h._tree.mod;r+=s._tree.mod;t+=q._tree.mod;F+=z._tree.mod}h&&!Ba(z)&&(z._tree.thread=h,z._tree.mod+=D-F);s&&!Lc(q)&&(q._tree.thread=s,q._tree.mod+=r-t,m=p)}h=j}l=f=0;p=a.children;for(m=p.length;0<=--m;)d=p[m]._tree,d.prelim+=f,d.mod+=f,f+=d.shift+(l+=d.change);j=0.5*(k._tree.prelim+j._tree.prelim);b?(e.prelim=b._tree.prelim+c(a,b),e.mod=e.prelim-j):e.prelim=j}else b&&(e.prelim=
b._tree.prelim+c(a,b))}function h(a,b){a.x=a._tree.prelim+b;var c=a.children;if(c&&(d=c.length)){var d,e=-1;for(b+=a._tree.mod;d>++e;)h(c[e],b)}}var j=b.call(this,e,f),k=j[0];Da(k,function(a,b){a._tree={ancestor:a,prelim:0,mod:0,change:0,shift:0,number:b?b._tree.number+1:0}});g(k);h(k,-k._tree.prelim);var m=Ca(k,wd),l=Ca(k,vd),p=Ca(k,ke),n=m.x-c(m,l)/2,s=l.x+c(l,m)/2,z=p.depth||1;return Da(k,function(a){a.x=(a.x-n)/(s-n)*d[0];a.y=a.depth/z*d[1];delete a._tree}),j}var b=d3.layout.hierarchy().sort(null).value(null),
c=ud,d=[1,1];return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(d=b,a):d},yb(a,b)};d3.layout.treemap=function(){function a(b,c){for(var d,e,f=-1,g=b.length;g>++f;)e=(d=b[f]).value*(0>c?0:c),d.area=isNaN(e)||0>=e?0:e}function b(c){var e=c.children;if(e&&e.length){var f,g=m(c),h=[],j=e.slice(),k=1/0,l="slice"===p?g.dx:"dice"===p?g.dy:"slice-dice"===p?1&c.depth?g.dy:g.dx:Math.min(g.dx,g.dy);a(j,g.dx*g.dy/c.value);for(h.area=0;0<(c=j.length);){h.push(c=
j[c-1]);h.area+=c.area;if(!(c="squarify"!==p)){f=k;var s;c=l;s=void 0;for(var q=h.area,r=0,D=1/0,t=-1,B=h.length;B>++t;)(s=h[t].area)&&(D>s&&(D=s),s>r&&(r=s));s=(q*=q,c*=c,q?Math.max(c*r*n/q,q/(c*D*n)):1/0);c=f>=(f=s)}c?(j.pop(),k=f):(h.area-=h.pop().area,d(h,l,g,!1),l=Math.min(g.dx,g.dy),h.length=h.area=0,k=1/0)}h.length&&(d(h,l,g,!0),h.length=h.area=0);e.forEach(b)}}function c(b){var e=b.children;if(e&&e.length){var f=m(b),g=e.slice(),h=[];a(g,f.dx*f.dy/b.value);for(h.area=0;b=g.pop();)h.push(b),
h.area+=b.area,null!=b.z&&(d(h,b.z?f.dx:f.dy,f,!g.length),h.length=h.area=0);e.forEach(c)}}function d(a,b,c,e){var f,g=-1,j=a.length,k=c.x,m=c.y,l=b?h(a.area/b):0;if(b==c.dx){for((e||l>c.dy)&&(l=c.dy);j>++g;)f=a[g],f.x=k,f.y=m,f.dy=l,k+=f.dx=Math.min(c.x+c.dx-k,l?h(f.area/l):0);f.z=!0;f.dx+=c.x+c.dx-k;c.y+=l;c.dy-=l}else{for((e||l>c.dx)&&(l=c.dx);j>++g;)f=a[g],f.x=k,f.y=m,f.dx=l,m+=f.dy=Math.min(c.y+c.dy-m,l?h(f.area/l):0);f.z=!1;f.dy+=c.y+c.dy-m;c.x+=l;c.dx-=l}}function e(d){d=f||g(d);var h=d[0];
return h.x=0,h.y=0,h.dx=j[0],h.dy=j[1],f&&g.revalue(h),a([h],h.dx*h.dy/h.value),(f?c:b)(h),l&&(f=d),d}var f,g=d3.layout.hierarchy(),h=Math.round,j=[1,1],k=null,m=Yb,l=!1,p="squarify",n=0.5*(1+Math.sqrt(5));return e.size=function(a){return arguments.length?(j=a,e):j},e.padding=function(a){function b(c){var d=a.call(e,c,c.depth);return null==d?Yb(c):xd(c,"number"==typeof d?[d,d,d,d]:d)}function c(b){return xd(b,a)}if(!arguments.length)return k;var d;return m=null==(k=a)?Yb:"function"==(d=typeof a)?
b:"number"===d?(a=[a,a,a,a],c):c,e},e.round=function(a){return arguments.length?(h=a?Math.round:Number,e):h!=Number},e.sticky=function(a){return arguments.length?(l=a,f=null,e):l},e.ratio=function(a){return arguments.length?(n=a,e):n},e.mode=function(a){return arguments.length?(p=a+"",e):p},yb(e,g)};d3.csv=yd(",","text/csv");d3.tsv=yd("\t","text/tab-separated-values");d3.geo={};d3.geo.stream=function(a,b){mf.hasOwnProperty(a.type)?mf[a.type](a,b):Zb(a,b)};var mf={Feature:function(a,b){Zb(a.geometry,
b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;e>++d;)Zb(c[d].geometry,b)}},df={Sphere:function(a,b){b.sphere()},Point:function(a,b){var c=a.coordinates;b.point(c[0],c[1])},MultiPoint:function(a,b){for(var c,d=a.coordinates,e=-1,f=d.length;f>++e;)c=d[e],b.point(c[0],c[1])},LineString:function(a,b){Mc(a.coordinates,b,0)},MultiLineString:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;e>++d;)Mc(c[d],b,0)},Polygon:function(a,b){zd(a.coordinates,b)},MultiPolygon:function(a,
b){for(var c=a.coordinates,d=-1,e=c.length;e>++d;)zd(c[d],b)},GeometryCollection:function(a,b){for(var c=a.geometries,d=-1,e=c.length;e>++d;)Zb(c[d],b)}};d3.geo.albersUsa=function(){function a(f){var g=f[0],h=f[1];return(50<h?c:-140>g?d:21>h?e:b)(f)}var b=d3.geo.albers(),c=d3.geo.albers().rotate([160,0]).center([0,60]).parallels([55,65]),d=d3.geo.albers().rotate([160,0]).center([0,20]).parallels([8,18]),e=d3.geo.albers().rotate([60,0]).center([0,10]).parallels([8,18]);return a.scale=function(f){return arguments.length?
(b.scale(f),c.scale(0.6*f),d.scale(f),e.scale(1.5*f),a.translate(b.translate())):b.scale()},a.translate=function(f){if(!arguments.length)return b.translate();var g=b.scale(),h=f[0],j=f[1];return b.translate(f),c.translate([h-0.4*g,j+0.17*g]),d.translate([h-0.19*g,j+0.2*g]),e.translate([h+0.58*g,j+0.43*g]),a},a.scale(b.scale())};(d3.geo.albers=function(){var a=29.5*O,b=45.5*O,c=Vd(Fb),d=c(a,b);return d.parallels=function(d){return arguments.length?c(a=d[0]*O,b=d[1]*O):[a*ia,b*ia]},d.rotate([98,0]).center([0,
38]).scale(1E3)}).raw=Fb;var nf=ic(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(d3.geo.azimuthalEqualArea=function(){return A(nf)}).raw=nf;var of=ic(function(a){return(a=Math.acos(a))&&a/Math.sin(a)},h);(d3.geo.azimuthalEquidistant=function(){return A(of)}).raw=of;d3.geo.bounds=Rc(h);d3.geo.centroid=function(a){ha=Ia=ca=da=ba=0;d3.geo.stream(a,Ja);var b;return Ia&&Math.abs(b=Math.sqrt(ca*ca+da*da+ba*ba))>Q?[Math.atan2(da,ca)*ia,Math.asin(Math.max(-1,Math.min(1,ba/
b)))*ia]:void 0};var ha,Ia,ca,da,ba,Ja={sphere:function(){2>ha&&(ha=2,Ia=ca=da=ba=0)},point:Pa,lineStart:ac,lineEnd:Bd,polygonStart:function(){2>ha&&(ha=2,Ia=ca=da=ba=0);Ja.lineStart=Xa},polygonEnd:function(){Ja.lineStart=ac}};d3.geo.circle=function(){function a(){var b="function"==typeof d?d.apply(this,arguments):d,e=Ge(-b[0]*O,-b[1]*O,0).invert,f=[];return c(null,null,1,{point:function(a,b){f.push(a=e(a,b));a[0]*=ia;a[1]*=ia}}),{type:"Polygon",coordinates:[f]}}var b,c,d=[0,0],e=6;return a.origin=
function(b){return arguments.length?(d=b,a):d},a.angle=function(d){return arguments.length?(c=Tc((b=+d)*O,e*O),a):b},a.precision=function(d){return arguments.length?(c=Tc(b*O,(e=+d)*O),a):e},a.angle(90)};var ef=bc(r,function(a){var b,c=0/0,d=0/0,e=0/0;return{lineStart:function(){a.lineStart();b=1},point:function(f,g){var h=0<f?H:-H,j=Math.abs(f-c);if(Q>Math.abs(j-H))a.point(c,d=0<(d+g)/2?H/2:-H/2),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),a.point(f,d),b=0;else if(e!==h&&j>=H){Q>Math.abs(c-
e)&&(c-=e*Q);Q>Math.abs(f-h)&&(f-=h*Q);var j=c,k=d,l=f,m,p,n=Math.sin(j-l);d=Math.abs(n)>Q?Math.atan((Math.sin(k)*(p=Math.cos(g))*Math.sin(l)-Math.sin(g)*(m=Math.cos(k))*Math.sin(j))/(m*p*n)):(k+g)/2;a.point(e,d);a.lineEnd();a.lineStart();a.point(h,d);b=0}a.point(c=f,d=g);e=h},lineEnd:function(){a.lineEnd();c=d=0/0},clean:function(){return 2-b}}},function(a,b,c,d){null==a?(c=c*H/2,d.point(-H,c),d.point(0,c),d.point(H,c),d.point(H,0),d.point(H,-c),d.point(0,-c),d.point(-H,-c),d.point(-H,0),d.point(-H,
c)):Math.abs(a[0]-b[0])>Q?(a=(a[0]<b[0]?1:-1)*H,c=c*a/2,d.point(-a,c),d.point(0,c),d.point(a,c)):d.point(b[0],b[1])});(d3.geo.equirectangular=function(){return A(Ea).scale(250/H)}).raw=Ea.invert=Ea;var pf=ic(function(a){return 1/a},Math.atan);(d3.geo.gnomonic=function(){return A(pf)}).raw=pf;d3.geo.graticule=function(){function a(){return{type:"MultiLineString",coordinates:b()}}function b(){return d3.range(Math.ceil(d/j)*j,c,j).map(g).concat(d3.range(Math.ceil(f/k)*k,e,k).map(h))}var c,d,e,f,g,h,
j=22.5,k=j,l=2.5;return a.lines=function(){return b().map(function(a){return{type:"LineString",coordinates:a}})},a.outline=function(){return{type:"Polygon",coordinates:[g(d).concat(h(e).slice(1),g(c).reverse().slice(1),h(f).reverse().slice(1))]}},a.extent=function(b){return arguments.length?(d=+b[0][0],c=+b[1][0],f=+b[0][1],e=+b[1][1],d>c&&(b=d,d=c,c=b),f>e&&(b=f,f=e,e=b),a.precision(l)):[[d,f],[c,e]]},a.step=function(b){return arguments.length?(j=+b[0],k=+b[1],a):[j,k]},a.precision=function(b){var j;
if(arguments.length){l=+b;j=e;var k=d3.range(f,j-Q,l).concat(j);g=function(a){return k.map(function(b){return[a,b]})};j=c;var m=d3.range(d,j-Q,l).concat(j);j=(h=function(a){return m.map(function(b){return[b,a]})},a)}else j=l;return j},a.extent([[-180+Q,-90+Q],[180-Q,90-Q]])};d3.geo.interpolate=function(a,b){var c=a[0]*O,d=a[1]*O,e=b[0]*O,f=b[1]*O,g=function(a){var b=Math.sin(a*=s)*q,c=Math.sin(s-a)*q;a=c*l+b*p;var d=c*m+b*n,b=c*j+b*k;return[Math.atan2(d,a)/O,Math.atan2(b,Math.sqrt(a*a+d*d))/O]},h=
Math.cos(d),j=Math.sin(d),d=Math.cos(f),k=Math.sin(f),l=h*Math.cos(c),m=h*Math.sin(c),p=d*Math.cos(e),n=d*Math.sin(e),s=Math.acos(Math.max(-1,Math.min(1,j*k+h*d*Math.cos(e-c)))),q=1/Math.sin(s);return g.distance=s,g};d3.geo.greatArc=function(){function a(){for(var b=c||f.apply(this,arguments),d=k||g.apply(this,arguments),j=e||d3.geo.interpolate(b,d),k=0,l=h/j.distance,b=[b];1>(k+=l);)b.push(j(k));return b.push(d),{type:"LineString",coordinates:b}}var c,d,e,f=l,g=b,h=6*O;return a.distance=function(){return(e||
d3.geo.interpolate(c||f.apply(this,arguments),d||g.apply(this,arguments))).distance},a.source=function(b){return arguments.length?(f=b,c="function"==typeof b?null:b,e=c&&d?d3.geo.interpolate(c,d):null,a):f},a.target=function(b){return arguments.length?(g=b,d="function"==typeof b?null:b,e=c&&d?d3.geo.interpolate(c,d):null,a):g},a.precision=function(b){return arguments.length?(h=b*O,a):h/O},a};Vc.invert=function(a,b){return[2*H*a,2*Math.atan(Math.exp(2*H*b))-H/2]};(d3.geo.mercator=function(){return A(Vc).scale(500)}).raw=
Vc;var qf=ic(function(){return 1},Math.asin);(d3.geo.orthographic=function(){return A(qf)}).raw=qf;d3.geo.path=function(){function a(b){return b&&d3.geo.stream(b,d(e.pointRadius("function"==typeof f?+f.apply(this,arguments):f))),e.result()}var b,c,d,e,f=4.5;return a.area=function(a){return Td=0,d3.geo.stream(a,d(ib)),Td},a.centroid=function(a){return ha=ca=da=ba=0,d3.geo.stream(a,d(Ka)),ba?[ca/ba,da/ba]:void 0},a.bounds=function(a){return Rc(d)(a)},a.projection=function(c){var e;if(arguments.length){if(b=
c){if(!(e=c.stream)){var f=Qc(function(a,b){return c([a*ia,b*ia])});e=function(a){return a=f(a),{point:function(b,c){a.point(b*O,c*O)},sphere:function(){a.sphere()},lineStart:function(){a.lineStart()},lineEnd:function(){a.lineEnd()},polygonStart:function(){a.polygonStart()},polygonEnd:function(){a.polygonEnd()}}}}}else e=h;e=(d=e,a)}else e=b;return e},a.context=function(b){return arguments.length?(e=null==(c=b)?new cc:new Hb(b),a):c},a.pointRadius=function(b){return arguments.length?(f="function"==
typeof b?b:+b,a):f},a.projection(d3.geo.albersUsa()).context(null)};var Td,Md,ib={point:oa,lineStart:oa,lineEnd:oa,polygonStart:function(){Md=0;ib.lineStart=Gb},polygonEnd:function(){ib.lineStart=ib.lineEnd=ib.point=oa;Td+=Math.abs(Md/2)}},Ka={point:dc,lineStart:Gd,lineEnd:Wc,polygonStart:function(){Ka.lineStart=d},polygonEnd:function(){Ka.point=dc;Ka.lineStart=Gd;Ka.lineEnd=Wc}};d3.geo.area=function(a){return hc=0,d3.geo.stream(a,kb),hc};var hc,jb,kb={sphere:function(){hc+=4*H},point:oa,lineStart:oa,
lineEnd:oa,polygonStart:function(){jb=0;kb.lineStart=n},polygonEnd:function(){hc+=0>jb?4*H+jb:jb;kb.lineStart=kb.lineEnd=kb.point=oa}};d3.geo.projection=A;d3.geo.projectionMutator=Vd;var rf=ic(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(d3.geo.stereographic=function(){return A(rf)}).raw=rf;d3.geom={};d3.geom.hull=function(a){if(3>a.length)return[];var b,c,d,e,f,g,h,j,k;c=a.length;var l=c-1,m=[],p=[],n=0;for(b=1;c>b;++b)a[b][1]<a[n][1]?n=b:a[b][1]==a[n][1]&&(n=a[b][0]<a[n][0]?
b:n);for(b=0;c>b;++b)b!==n&&(e=a[b][1]-a[n][1],d=a[b][0]-a[n][0],m.push({angle:Math.atan2(e,d),index:b}));m.sort(function(a,b){return a.angle-b.angle});k=m[0].angle;j=m[0].index;h=0;for(b=1;l>b;++b)c=m[b].index,k==m[b].angle?(d=a[j][0]-a[n][0],e=a[j][1]-a[n][1],f=a[c][0]-a[n][0],g=a[c][1]-a[n][1],d*d+e*e>=f*f+g*g?m[b].index=-1:(m[h].index=-1,k=m[b].angle,h=b,j=c)):(k=m[b].angle,h=b,j=c);p.push(n);for(c=b=0;2>b;++c)-1!==m[c].index&&(p.push(m[c].index),b++);for(d=p.length;l>c;++c)if(-1!==m[c].index){for(;!Bf(p[d-
2],p[d-1],m[c].index,a);)--d;p[d++]=m[c].index}l=[];for(b=0;d>b;++b)l.push(a[p[b]]);return l};d3.geom.polygon=function(a){return a.area=function(){for(var b=0,c=a.length,d=a[c-1][1]*a[0][0]-a[c-1][0]*a[0][1];c>++b;)d+=a[b-1][1]*a[b][0]-a[b-1][0]*a[b][1];return 0.5*d},a.centroid=function(b){var c,d,e=-1,f=a.length,g=0,h=0,j=a[f-1];for(arguments.length||(b=-1/(6*a.area()));f>++e;)c=j,j=a[e],d=c[0]*j[1]-j[0]*c[1],g+=(c[0]+j[0])*d,h+=(c[1]+j[1])*d;return[g*b,h*b]},a.clip=function(b){for(var c,d,e,f,g,
h,j=-1,k=a.length,m=a[k-1];k>++j;){c=b.slice();b.length=0;f=a[j];g=c[(e=c.length)-1];for(d=-1;e>++d;)h=c[d],Xd(h,m,f)?(Xd(g,m,f)||b.push(Ke(g,h,m,f)),b.push(h)):Xd(g,m,f)&&b.push(Ke(g,h,m,f)),g=h;m=f}return b},a};d3.geom.voronoi=function(a){var b=a.map(function(){return[]});return Le(a,function(a){var c,d,e,f,g,h;1===a.a&&0<=a.b?(c=a.ep.r,d=a.ep.l):(c=a.ep.l,d=a.ep.r);1===a.a?(g=c?c.y:-1E6,e=a.c-a.b*g,h=d?d.y:1E6,f=a.c-a.b*h):(e=c?c.x:-1E6,g=a.c-a.a*e,f=d?d.x:1E6,h=a.c-a.a*f);c=[e,g];f=[f,h];b[a.region.l.index].push(c,
f);b[a.region.r.index].push(c,f)}),b=b.map(function(b,c){var d=a[c][0],e=a[c][1],f=b.map(function(a){return Math.atan2(a[0]-d,a[1]-e)});return d3.range(b.length).sort(function(a,b){return f[a]-f[b]}).filter(function(a,b,c){return!b||f[a]-f[c[b-1]]>Q}).map(function(a){return b[a]})}),b.forEach(function(b,c){var d=b.length;if(!d)return b.push([-1E6,-1E6],[-1E6,1E6],[1E6,1E6],[1E6,-1E6]);if(!(2<d)){var e=a[c],f=b[0],g=b[1],d=e[0],e=e[1],h=f[0],f=f[1],j=g[0],k=g[1],m=Math.abs(j-h),g=k-f;Q>Math.abs(g)?
(d=f>e?-1E6:1E6,b.push([-1E6,d],[1E6,d])):Q>m?(d=h>d?-1E6:1E6,b.push([d,-1E6],[d,1E6])):(d=(h-d)*(k-f)>(j-h)*(f-e)?1E6:-1E6,e=Math.abs(g)-m,Q>Math.abs(e)?b.push([0>g?d:-d,d]):(0<e&&(d*=-1),b.push([-1E6,d],[1E6,d])))}}),b};var xe={l:"r",r:"l"};d3.geom.delaunay=function(a){var b=a.map(function(){return[]}),c=[];return Le(a,function(c){b[c.region.l.index].push(a[c.region.r.index])}),b.forEach(function(b,d){var e=a[d],f=e[0],g=e[1];b.forEach(function(a){a.angle=Math.atan2(a[0]-f,a[1]-g)});b.sort(function(a,
b){return a.angle-b.angle});for(var h=0,j=b.length-1;j>h;h++)c.push([e,b[h],b[h+1]])}),c};d3.geom.quadtree=function(a,b,c,d,e){function f(a,b,c,d,e,h){if(!isNaN(b.x)&&!isNaN(b.y))if(a.leaf){var j=a.point;j?0.01>Math.abs(j.x-b.x)+Math.abs(j.y-b.y)?g(a,b,c,d,e,h):(a.point=null,g(a,j,c,d,e,h),g(a,b,c,d,e,h)):a.point=b}else g(a,b,c,d,e,h)}function g(a,b,c,d,e,h){var j=0.5*(c+e),k=0.5*(d+h),m=b.x>=j,l=b.y>=k,p=(l<<1)+m;a.leaf=!1;a=a.nodes[p]||(a.nodes[p]={leaf:!0,nodes:[],point:null});m?c=j:e=j;l?d=k:
h=k;f(a,b,c,d,e,h)}var h,j=-1,k=a.length;if(5>arguments.length)if(3===arguments.length)e=c,d=b,c=b=0;else{b=c=1/0;for(d=e=-1/0;k>++j;)h=a[j],b>h.x&&(b=h.x),c>h.y&&(c=h.y),h.x>d&&(d=h.x),h.y>e&&(e=h.y)}h=d-b;j=e-c;h>j?e=c+h:d=b+j;var m={leaf:!0,nodes:[],point:null};return m.add=function(a){f(m,a,b,c,d,e)},m.visit=function(a){pc(a,m,b,c,d,e)},a.forEach(m.add),m};d3.time={};var na=Date;pb.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},
getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){$a.setUTCDate.apply(this._,arguments)},setDay:function(){$a.setUTCDay.apply(this._,arguments)},
setFullYear:function(){$a.setUTCFullYear.apply(this._,arguments)},setHours:function(){$a.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){$a.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){$a.setUTCMinutes.apply(this._,arguments)},setMonth:function(){$a.setUTCMonth.apply(this._,arguments)},setSeconds:function(){$a.setUTCSeconds.apply(this._,arguments)},setTime:function(){$a.setTime.apply(this._,arguments)}};var $a=Date.prototype,sf="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
tf="Sun Mon Tue Wed Thu Fri Sat".split(" "),De="January February March April May June July August September October November December".split(" "),Ee="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");d3.time.format=function(a){function b(d){for(var e,f,g,h=[],j=-1,k=0;c>++j;)37===a.charCodeAt(j)&&(h.push(a.substring(k,j)),null!=(f=$f[e=a.charAt(++j)])&&(e=a.charAt(++j)),(g=Ud[e])&&(e=g(d,null==f?"e"===e?" ":"0":f)),h.push(e),k=j+1);return h.push(a.substring(k,j)),h.join("")}var c=a.length;
return b.parse=function(b){var c={y:1900,m:0,d:1,H:0,M:0,S:0,L:0};if(dd(c,a,b,0)!=b.length)return null;"p"in c&&(c.H=c.H%12+12*c.p);b=new na;return b.setFullYear(c.y,c.m,c.d),b.setHours(c.H,c.M,c.S,c.L),b},b.toString=function(){return a},b};var uf=cd(sf),vf=cd(tf),wf=cd(De),ag=Me(De),xf=cd(Ee),bg=Me(Ee),$f={"-":"",_:" ","0":"0"},Ud={a:function(a){return tf[a.getDay()]},A:function(a){return sf[a.getDay()]},b:function(a){return Ee[a.getMonth()]},B:function(a){return De[a.getMonth()]},c:d3.time.format("%a %b %e %X %Y"),
d:function(a,b){return pa(a.getDate(),b,2)},e:function(a,b){return pa(a.getDate(),b,2)},H:function(a,b){return pa(a.getHours(),b,2)},I:function(a,b){return pa(a.getHours()%12||12,b,2)},j:function(a,b){return pa(1+d3.time.dayOfYear(a),b,3)},L:function(a,b){return pa(a.getMilliseconds(),b,3)},m:function(a,b){return pa(a.getMonth()+1,b,2)},M:function(a,b){return pa(a.getMinutes(),b,2)},p:function(a){return 12<=a.getHours()?"PM":"AM"},S:function(a,b){return pa(a.getSeconds(),b,2)},U:function(a,b){return pa(d3.time.sundayOfYear(a),
b,2)},w:function(a){return a.getDay()},W:function(a,b){return pa(d3.time.mondayOfYear(a),b,2)},x:d3.time.format("%m/%d/%Y"),X:d3.time.format("%H:%M:%S"),y:function(a,b){return pa(a.getFullYear()%100,b,2)},Y:function(a,b){return pa(a.getFullYear()%1E4,b,4)},Z:function(a){var b=a.getTimezoneOffset();a=0<b?"-":"+";var c=~~(Math.abs(b)/60),b=Math.abs(b)%60;return a+pa(c,"0",2)+pa(b,"0",2)},"%":function(){return"%"}},If={a:function(a,b,c){vf.lastIndex=0;return(a=vf.exec(b.substring(c)))?c+a[0].length:
-1},A:function(a,b,c){uf.lastIndex=0;return(a=uf.exec(b.substring(c)))?c+a[0].length:-1},b:function(a,b,c){xf.lastIndex=0;return(b=xf.exec(b.substring(c)))?(a.m=bg.get(b[0].toLowerCase()),c+b[0].length):-1},B:function(a,b,c){wf.lastIndex=0;return(b=wf.exec(b.substring(c)))?(a.m=ag.get(b[0].toLowerCase()),c+b[0].length):-1},c:function(a,b,c){return dd(a,""+Ud.c,b,c)},d:Ne,e:Ne,H:Oe,I:Oe,L:function(a,b,c){ma.lastIndex=0;return(b=ma.exec(b.substring(c,c+3)))?(a.L=+b[0],c+b[0].length):-1},m:function(a,
b,c){ma.lastIndex=0;return(b=ma.exec(b.substring(c,c+2)))?(a.m=b[0]-1,c+b[0].length):-1},M:function(a,b,c){ma.lastIndex=0;return(b=ma.exec(b.substring(c,c+2)))?(a.M=+b[0],c+b[0].length):-1},p:function(a,b,c){b=cg.get(b.substring(c,c+=2).toLowerCase());return null==b?-1:(a.p=b,c)},S:function(a,b,c){ma.lastIndex=0;return(b=ma.exec(b.substring(c,c+2)))?(a.S=+b[0],c+b[0].length):-1},x:function(a,b,c){return dd(a,""+Ud.x,b,c)},X:function(a,b,c){return dd(a,""+Ud.X,b,c)},y:function(a,b,c){ma.lastIndex=
0;return(b=ma.exec(b.substring(c,c+2)))?(a.y=+b[0]+(68<+b[0]?1900:2E3),c+b[0].length):-1},Y:function(a,b,c){ma.lastIndex=0;return(b=ma.exec(b.substring(c,c+4)))?(a.y=+b[0],c+b[0].length):-1}},ma=/^\s*\d+/,cg=d3.map({am:0,pm:1});d3.time.format.utc=function(a){function b(a){try{na=pb;var d=new na;return d._=a,c(d)}finally{na=Date}}var c=d3.time.format(a);return b.parse=function(a){try{na=pb;var b=c.parse(a);return b&&b._}finally{na=Date}},b.toString=c.toString,b};var yf=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");
d3.time.format.iso=Date.prototype.toISOString?se:yf;se.parse=function(a){a=new Date(a);return isNaN(a)?null:a};se.toString=yf.toString;d3.time.second=zb(function(a){return new na(1E3*Math.floor(a/1E3))},function(a,b){a.setTime(a.getTime()+1E3*Math.floor(b))},function(a){return a.getSeconds()});d3.time.seconds=d3.time.second.range;d3.time.seconds.utc=d3.time.second.utc.range;d3.time.minute=zb(function(a){return new na(6E4*Math.floor(a/6E4))},function(a,b){a.setTime(a.getTime()+6E4*Math.floor(b))},
function(a){return a.getMinutes()});d3.time.minutes=d3.time.minute.range;d3.time.minutes.utc=d3.time.minute.utc.range;d3.time.hour=zb(function(a){var b=a.getTimezoneOffset()/60;return new na(36E5*(Math.floor(a/36E5-b)+b))},function(a,b){a.setTime(a.getTime()+36E5*Math.floor(b))},function(a){return a.getHours()});d3.time.hours=d3.time.hour.range;d3.time.hours.utc=d3.time.hour.utc.range;d3.time.day=zb(function(a){var b=new na(1970,0);return b.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),b},
function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()-1});d3.time.days=d3.time.day.range;d3.time.days.utc=d3.time.day.utc.range;d3.time.dayOfYear=function(a){var b=d3.time.year(a);return Math.floor((a-b-6E4*(a.getTimezoneOffset()-b.getTimezoneOffset()))/864E5)};"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ").forEach(function(a,b){a=a.toLowerCase();b=7-b;var c=d3.time[a]=zb(function(a){return(a=d3.time.day(a)).setDate(a.getDate()-(a.getDay()+b)%7),a},function(a,
b){a.setDate(a.getDate()+7*Math.floor(b))},function(a){var c=d3.time.year(a).getDay();return Math.floor((d3.time.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});d3.time[a+"s"]=c.range;d3.time[a+"s"].utc=c.utc.range;d3.time[a+"OfYear"]=function(a){var c=d3.time.year(a).getDay();return Math.floor((d3.time.dayOfYear(a)+(c+b)%7)/7)}});d3.time.week=d3.time.sunday;d3.time.weeks=d3.time.sunday.range;d3.time.weeks.utc=d3.time.sunday.utc.range;d3.time.weekOfYear=d3.time.sundayOfYear;d3.time.month=zb(function(a){return a=
d3.time.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()});d3.time.months=d3.time.month.range;d3.time.months.utc=d3.time.month.utc.range;d3.time.year=zb(function(a){return a=d3.time.day(a),a.setMonth(0,1),a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()});d3.time.years=d3.time.year.range;d3.time.years.utc=d3.time.year.utc.range;var Nd=[1E3,5E3,15E3,3E4,6E4,3E5,9E5,18E5,36E5,108E5,216E5,432E5,864E5,1728E5,6048E5,2592E6,
7776E6,31536E6],Fe=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]],dg=[[d3.time.format("%Y"),r],[d3.time.format("%B"),function(a){return a.getMonth()}],[d3.time.format("%b %d"),function(a){return 1!=a.getDate()}],[d3.time.format("%a %d"),
function(a){return a.getDay()&&1!=a.getDate()}],[d3.time.format("%I %p"),function(a){return a.getHours()}],[d3.time.format("%I:%M"),function(a){return a.getMinutes()}],[d3.time.format(":%S"),function(a){return a.getSeconds()}],[d3.time.format(".%L"),function(a){return a.getMilliseconds()}]],zf=d3.scale.linear(),eg=Qe(dg);Fe.year=function(a,b){return zf.domain(a.map(Cf)).ticks(b).map(ne)};d3.time.scale=function(){return le(d3.scale.linear(),Fe,eg)};var Af=Fe.map(function(a){return[a[0].utc,a[1]]}),
fg=[[d3.time.format.utc("%Y"),r],[d3.time.format.utc("%B"),function(a){return a.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(a){return 1!=a.getUTCDate()}],[d3.time.format.utc("%a %d"),function(a){return a.getUTCDay()&&1!=a.getUTCDate()}],[d3.time.format.utc("%I %p"),function(a){return a.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(a){return a.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(a){return a.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(a){return a.getUTCMilliseconds()}]],
gg=Qe(fg);Af.year=function(a,b){return zf.domain(a.map(Df)).ticks(b).map(oe)};d3.time.scale.utc=function(){return le(d3.scale.linear(),Af,gg)}})();(function(){function b(a,c,e){if(a===c)return 0!==a||1/a==1/c;if(null==a||null==c)return a===c;a._chain&&(a=a._wrapped);c._chain&&(c=c._wrapped);if(a.isEqual&&g.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&g.isFunction(c.isEqual))return c.isEqual(a);var f=E.call(a);if(f!=E.call(c))return!1;switch(f){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:0==a?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source==
c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if("object"!=typeof a||"object"!=typeof c)return!1;for(var h=e.length;h--;)if(e[h]==a)return!0;e.push(a);var h=0,j=!0;if("[object Array]"==f){if(h=a.length,j=h==c.length)for(;h--&&(j=h in a==h in c&&b(a[h],c[h],e)););}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return!1;for(var k in a)if(g.has(a,k)&&(h++,!(j=g.has(c,k)&&b(a[k],c[k],e))))break;if(j){for(k in c)if(g.has(c,k)&&!h--)break;
j=!h}}e.pop();return j}var l=this,c=l._,k={},h=Array.prototype,r=Object.prototype,q=h.slice,w=h.unshift,E=r.toString,P=r.hasOwnProperty,R=h.forEach,J=h.map,V=h.reduce,T=h.reduceRight,v=h.filter,e=h.every,a=h.some,p=h.indexOf,m=h.lastIndexOf,r=Array.isArray,j=Object.keys,t=Function.prototype.bind,g=function(a){return new ga(a)};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=g),exports._=g):l._=g;g.VERSION="1.3.3";var S=g.each=g.forEach=function(a,
b,c){if(null!=a)if(R&&a.forEach===R)a.forEach(b,c);else if(a.length===+a.length)for(var e=0,f=a.length;e<f&&!(e in a&&b.call(c,a[e],e,a)===k);e++);else for(e in a)if(g.has(a,e)&&b.call(c,a[e],e,a)===k)break};g.map=g.collect=function(a,b,c){var e=[];if(null==a)return e;if(J&&a.map===J)return a.map(b,c);S(a,function(a,f,g){e[e.length]=b.call(c,a,f,g)});a.length===+a.length&&(e.length=a.length);return e};g.reduce=g.foldl=g.inject=function(a,b,c,e){var f=2<arguments.length;null==a&&(a=[]);if(V&&a.reduce===
V)return e&&(b=g.bind(b,e)),f?a.reduce(b,c):a.reduce(b);S(a,function(a,g,h){f?c=b.call(e,c,a,g,h):(c=a,f=!0)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return c};g.reduceRight=g.foldr=function(a,b,c,e){var f=2<arguments.length;null==a&&(a=[]);if(T&&a.reduceRight===T)return e&&(b=g.bind(b,e)),f?a.reduceRight(b,c):a.reduceRight(b);var h=g.toArray(a).reverse();e&&!f&&(b=g.bind(b,e));return f?g.reduce(h,b,c,e):g.reduce(h,b)};g.find=g.detect=function(a,b,c){var e;ja(a,function(a,
f,g){if(b.call(c,a,f,g))return e=a,!0});return e};g.filter=g.select=function(a,b,c){var e=[];if(null==a)return e;if(v&&a.filter===v)return a.filter(b,c);S(a,function(a,f,g){b.call(c,a,f,g)&&(e[e.length]=a)});return e};g.reject=function(a,b,c){var e=[];if(null==a)return e;S(a,function(a,f,g){b.call(c,a,f,g)||(e[e.length]=a)});return e};g.every=g.all=function(a,b,c){var f=!0;if(null==a)return f;if(e&&a.every===e)return a.every(b,c);S(a,function(a,e,g){if(!(f=f&&b.call(c,a,e,g)))return k});return!!f};
var ja=g.some=g.any=function(b,c,e){c||(c=g.identity);var f=!1;if(null==b)return f;if(a&&b.some===a)return b.some(c,e);S(b,function(a,b,g){if(f||(f=c.call(e,a,b,g)))return k});return!!f};g.include=g.contains=function(a,b){var c=!1;return null==a?c:p&&a.indexOf===p?-1!=a.indexOf(b):c=ja(a,function(a){return a===b})};g.invoke=function(a,b){var c=q.call(arguments,2);return g.map(a,function(a){return(g.isFunction(b)?b||a:a[b]).apply(a,c)})};g.pluck=function(a,b){return g.map(a,function(a){return a[b]})};
g.max=function(a,b,c){if(!b&&g.isArray(a)&&a[0]===+a[0])return Math.max.apply(Math,a);if(!b&&g.isEmpty(a))return-Infinity;var e={computed:-Infinity};S(a,function(a,f,g){f=b?b.call(c,a,f,g):a;f>=e.computed&&(e={value:a,computed:f})});return e.value};g.min=function(a,b,c){if(!b&&g.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!b&&g.isEmpty(a))return Infinity;var e={computed:Infinity};S(a,function(a,f,g){f=b?b.call(c,a,f,g):a;f<e.computed&&(e={value:a,computed:f})});return e.value};g.shuffle=
function(a){var b=[],c;S(a,function(a,e){c=Math.floor(Math.random()*(e+1));b[e]=b[c];b[c]=a});return b};g.sortBy=function(a,b,c){var e=g.isFunction(b)?b:function(a){return a[b]};return g.pluck(g.map(a,function(a,b,f){return{value:a,criteria:e.call(c,a,b,f)}}).sort(function(a,b){var c=a.criteria,e=b.criteria;return void 0===c?1:void 0===e?-1:c<e?-1:c>e?1:0}),"value")};g.groupBy=function(a,b){var c={},e=g.isFunction(b)?b:function(a){return a[b]};S(a,function(a,b){var f=e(a,b);(c[f]||(c[f]=[])).push(a)});
return c};g.sortedIndex=function(a,b,c){c||(c=g.identity);for(var e=0,f=a.length;e<f;){var h=e+f>>1;c(a[h])<c(b)?e=h+1:f=h}return e};g.toArray=function(a){return!a?[]:g.isArray(a)||g.isArguments(a)?q.call(a):a.toArray&&g.isFunction(a.toArray)?a.toArray():g.values(a)};g.size=function(a){return g.isArray(a)?a.length:g.keys(a).length};g.first=g.head=g.take=function(a,b,c){return null!=b&&!c?q.call(a,0,b):a[0]};g.initial=function(a,b,c){return q.call(a,0,a.length-(null==b||c?1:b))};g.last=function(a,
b,c){return null!=b&&!c?q.call(a,Math.max(a.length-b,0)):a[a.length-1]};g.rest=g.tail=function(a,b,c){return q.call(a,null==b||c?1:b)};g.compact=function(a){return g.filter(a,function(a){return!!a})};g.flatten=function(a,b){return g.reduce(a,function(a,c){if(g.isArray(c))return a.concat(b?c:g.flatten(c));a[a.length]=c;return a},[])};g.without=function(a){return g.difference(a,q.call(arguments,1))};g.uniq=g.unique=function(a,b,c){c=c?g.map(a,c):a;var e=[];3>a.length&&(b=!0);g.reduce(c,function(c,f,
h){if(b?g.last(c)!==f||!c.length:!g.include(c,f))c.push(f),e.push(a[h]);return c},[]);return e};g.union=function(){return g.uniq(g.flatten(arguments,!0))};g.intersection=g.intersect=function(a){var b=q.call(arguments,1);return g.filter(g.uniq(a),function(a){return g.every(b,function(b){return 0<=g.indexOf(b,a)})})};g.difference=function(a){var b=g.flatten(q.call(arguments,1),!0);return g.filter(a,function(a){return!g.include(b,a)})};g.zip=function(){for(var a=q.call(arguments),b=g.max(g.pluck(a,"length")),
c=Array(b),e=0;e<b;e++)c[e]=g.pluck(a,""+e);return c};g.indexOf=function(a,b,c){if(null==a)return-1;var e;if(c)return c=g.sortedIndex(a,b),a[c]===b?c:-1;if(p&&a.indexOf===p)return a.indexOf(b);c=0;for(e=a.length;c<e;c++)if(c in a&&a[c]===b)return c;return-1};g.lastIndexOf=function(a,b){if(null==a)return-1;if(m&&a.lastIndexOf===m)return a.lastIndexOf(b);for(var c=a.length;c--;)if(c in a&&a[c]===b)return c;return-1};g.range=function(a,b,c){1>=arguments.length&&(b=a||0,a=0);c=arguments[2]||1;for(var e=
Math.max(Math.ceil((b-a)/c),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=c;return g};var ta=function(){};g.bind=function(a,b){var c,e;if(a.bind===t&&t)return t.apply(a,q.call(arguments,1));if(!g.isFunction(a))throw new TypeError;e=q.call(arguments,2);return c=function(){if(!(this instanceof c))return a.apply(b,e.concat(q.call(arguments)));ta.prototype=a.prototype;var f=new ta,g=a.apply(f,e.concat(q.call(arguments)));return Object(g)===g?g:f}};g.bindAll=function(a){var b=q.call(arguments,1);0==b.length&&(b=
g.functions(a));S(b,function(b){a[b]=g.bind(a[b],a)});return a};g.memoize=function(a,b){var c={};b||(b=g.identity);return function(){var e=b.apply(this,arguments);return g.has(c,e)?c[e]:c[e]=a.apply(this,arguments)}};g.delay=function(a,b){var c=q.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)};g.defer=function(a){return g.delay.apply(g,[a,1].concat(q.call(arguments,1)))};g.throttle=function(a,b){var c,e,f,h,j,k,m=g.debounce(function(){j=h=!1},b);return function(){c=this;
e=arguments;f||(f=setTimeout(function(){f=null;j&&a.apply(c,e);m()},b));h?j=!0:k=a.apply(c,e);m();h=!0;return k}};g.debounce=function(a,b,c){var e;return function(){var f=this,g=arguments;c&&!e&&a.apply(f,g);clearTimeout(e);e=setTimeout(function(){e=null;c||a.apply(f,g)},b)}};g.once=function(a){var b=!1,c;return function(){if(b)return c;b=!0;return c=a.apply(this,arguments)}};g.wrap=function(a,b){return function(){var c=[a].concat(q.call(arguments,0));return b.apply(this,c)}};g.compose=function(){var a=
arguments;return function(){for(var b=arguments,c=a.length-1;0<=c;c--)b=[a[c].apply(this,b)];return b[0]}};g.after=function(a,b){return 0>=a?b():function(){if(1>--a)return b.apply(this,arguments)}};g.keys=j||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],c;for(c in a)g.has(a,c)&&(b[b.length]=c);return b};g.values=function(a){return g.map(a,g.identity)};g.functions=g.methods=function(a){var b=[],c;for(c in a)g.isFunction(a[c])&&b.push(c);return b.sort()};g.extend=function(a){S(q.call(arguments,
1),function(b){for(var c in b)a[c]=b[c]});return a};g.pick=function(a){var b={};S(g.flatten(q.call(arguments,1)),function(c){c in a&&(b[c]=a[c])});return b};g.defaults=function(a){S(q.call(arguments,1),function(b){for(var c in b)null==a[c]&&(a[c]=b[c])});return a};g.clone=function(a){return!g.isObject(a)?a:g.isArray(a)?a.slice():g.extend({},a)};g.tap=function(a,b){b(a);return a};g.isEqual=function(a,c){return b(a,c,[])};g.isEmpty=function(a){if(null==a)return!0;if(g.isArray(a)||g.isString(a))return 0===
a.length;for(var b in a)if(g.has(a,b))return!1;return!0};g.isElement=function(a){return!!(a&&1==a.nodeType)};g.isArray=r||function(a){return"[object Array]"==E.call(a)};g.isObject=function(a){return a===Object(a)};g.isArguments=function(a){return"[object Arguments]"==E.call(a)};g.isArguments(arguments)||(g.isArguments=function(a){return!(!a||!g.has(a,"callee"))});g.isFunction=function(a){return"[object Function]"==E.call(a)};g.isString=function(a){return"[object String]"==E.call(a)};g.isNumber=function(a){return"[object Number]"==
E.call(a)};g.isFinite=function(a){return g.isNumber(a)&&isFinite(a)};g.isNaN=function(a){return a!==a};g.isBoolean=function(a){return!0===a||!1===a||"[object Boolean]"==E.call(a)};g.isDate=function(a){return"[object Date]"==E.call(a)};g.isRegExp=function(a){return"[object RegExp]"==E.call(a)};g.isNull=function(a){return null===a};g.isUndefined=function(a){return void 0===a};g.has=function(a,b){return P.call(a,b)};g.noConflict=function(){l._=c;return this};g.identity=function(a){return a};g.times=
function(a,b,c){for(var e=0;e<a;e++)b.call(c,e)};g.escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")};g.result=function(a,b){if(null==a)return null;var c=a[b];return g.isFunction(c)?c.call(a):c};g.mixin=function(a){S(g.functions(a),function(b){var c=g[b]=a[b];ga.prototype[b]=function(){var a=q.call(arguments);w.call(a,this._wrapped);return ka(c.apply(g,a),this._chain)}})};var C=0;g.uniqueId=
function(a){var b=C++;return a?a+b:b};g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ua=/.^/,f={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"},L;for(L in f)f[f[L]]=L;var y=/\\|'|\r|\n|\t|\u2028|\u2029/g,va=/\\(\\|'|r|n|t|u2028|u2029)/g,xa=function(a){return a.replace(va,function(a,b){return f[b]})};g.template=function(a,b,c){c=g.defaults(c||{},g.templateSettings);a="__p+='"+a.replace(y,function(a){return"\\"+f[a]}).replace(c.escape||
ua,function(a,b){return"'+\n_.escape("+xa(b)+")+\n'"}).replace(c.interpolate||ua,function(a,b){return"'+\n("+xa(b)+")+\n'"}).replace(c.evaluate||ua,function(a,b){return"';\n"+xa(b)+"\n;__p+='"})+"';\n";c.variable||(a="with(obj||{}){\n"+a+"}\n");a="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+a+"return __p;\n";var e=new Function(c.variable||"obj","_",a);if(b)return e(b,g);b=function(a){return e.call(this,a,g)};b.source="function("+(c.variable||"obj")+"){\n"+a+
"}";return b};g.chain=function(a){return g(a).chain()};var ga=function(a){this._wrapped=a};g.prototype=ga.prototype;var ka=function(a,b){return b?g(a).chain():a};g.mixin(g);S("pop push reverse shift sort splice unshift".split(" "),function(a){var b=h[a];ga.prototype[a]=function(){var c=this._wrapped;b.apply(c,arguments);var e=c.length;("shift"==a||"splice"==a)&&0===e&&delete c[0];return ka(c,this._chain)}});S(["concat","join","slice"],function(a){var b=h[a];ga.prototype[a]=function(){return ka(b.apply(this._wrapped,
arguments),this._chain)}});ga.prototype.chain=function(){this._chain=!0;return this};ga.prototype.value=function(){return this._wrapped}}).call(this);!function(b,l){var c=l.prototype.trim,k=l.prototype.trimRight,h=l.prototype.trimLeft,r=function(b,a){if(1>a)return"";for(var c="";0<a;)a&1&&(c+=b),a>>=1,b+=b;return c},q=[].slice,w=function(b){return null==b?"\\s":b.source?b.source:"["+v.escapeRegExp(b)+"]"},E={lt:"<",gt:">",quot:'"',apos:"'",amp:"&"},P={},R;for(R in E)P[E[R]]=R;var J,V=function(b){return Object.prototype.toString.call(b).slice(8,-1).toLowerCase()},T=function(){return T.cache.hasOwnProperty(arguments[0])||(T.cache[arguments[0]]=T.parse(arguments[0])),
T.format.call(null,T.cache[arguments[0]],arguments)};J=(T.format=function(b,a){var c=1,h=b.length,j="",k,g=[],q,w,v;for(q=0;q<h;q++)if(j=V(b[q]),"string"===j)g.push(b[q]);else if("array"===j){j=b[q];if(j[2]){k=a[c];for(w=0;w<j[2].length;w++){if(!k.hasOwnProperty(j[2][w]))throw Error(J('[_.sprintf] property "%s" does not exist',j[2][w]));k=k[j[2][w]]}}else j[1]?k=a[j[1]]:k=a[c++];if(/[^s]/.test(j[8])&&"number"!=V(k))throw Error(J("[_.sprintf] expecting number but found %s",V(k)));switch(j[8]){case "b":k=
k.toString(2);break;case "c":k=l.fromCharCode(k);break;case "d":k=parseInt(k,10);break;case "e":k=j[7]?k.toExponential(j[7]):k.toExponential();break;case "f":k=j[7]?parseFloat(k).toFixed(j[7]):parseFloat(k);break;case "o":k=k.toString(8);break;case "s":k=(k=l(k))&&j[7]?k.substring(0,j[7]):k;break;case "u":k=Math.abs(k);break;case "x":k=k.toString(16);break;case "X":k=k.toString(16).toUpperCase()}k=/[def]/.test(j[8])&&j[3]&&0<=k?"+"+k:k;w=j[4]?"0"==j[4]?"0":j[4].charAt(1):" ";v=j[6]-l(k).length;w=
j[6]?r(w,v):"";g.push(j[5]?k+w:w+k)}return g.join("")},T.cache={},T.parse=function(b){for(var a=[],c=[],h=0;b;){if(null!==(a=/^[^\x25]+/.exec(b)))c.push(a[0]);else if(null!==(a=/^\x25{2}/.exec(b)))c.push("%");else{if(null===(a=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(b)))throw Error("[_.sprintf] huh?");if(a[2]){var h=h|1,j=[],k=a[2],g=[];if(null===(g=/^([a-z_][a-z_\d]*)/i.exec(k)))throw Error("[_.sprintf] huh?");for(j.push(g[1]);""!==(k=k.substring(g[0].length));){if(null===
(g=/^\.([a-z_][a-z_\d]*)/i.exec(k)))if(null===(g=/^\[(\d+)\]/.exec(k)))throw Error("[_.sprintf] huh?");j.push(g[1])}a[2]=j}else h|=2;if(3===h)throw Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");c.push(a)}b=b.substring(a[0].length)}return c},T);var v={VERSION:"2.2.0rc",isBlank:function(b){return null==b&&(b=""),/^\s*$/.test(b)},stripTags:function(b){return null==b?"":l(b).replace(/<\/?[^>]+>/g,"")},capitalize:function(b){return b=null==b?"":l(b),b.charAt(0).toUpperCase()+
b.slice(1)},chop:function(b,a){return null==b?[]:(b=l(b),a=~~a,0<a?b.match(RegExp(".{1,"+a+"}","g")):[b])},clean:function(b){return v.strip(b).replace(/\s+/g," ")},count:function(b,a){return null==b||null==a?0:l(b).split(a).length-1},chars:function(b){return null==b?[]:l(b).split("")},swapCase:function(b){return null==b?"":l(b).replace(/\S/g,function(a){return a===a.toUpperCase()?a.toLowerCase():a.toUpperCase()})},escapeHTML:function(b){return null==b?"":l(b).replace(/[&<>"']/g,function(a){return"&"+
P[a]+";"})},unescapeHTML:function(b){return null==b?"":l(b).replace(/\&([^;]+);/g,function(a,b){var c;return b in E?E[b]:(c=b.match(/^#x([\da-fA-F]+)$/))?l.fromCharCode(parseInt(c[1],16)):(c=b.match(/^#(\d+)$/))?l.fromCharCode(~~c[1]):a})},escapeRegExp:function(b){return null==b?"":l(b).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},splice:function(b,a,c,h){b=v.chars(b);return b.splice(~~a,~~c,h),b.join("")},insert:function(b,a,c){return v.splice(b,a,0,c)},include:function(b,a){return""===a?!0:null==
b?!1:-1!==l(b).indexOf(a)},join:function(){var b=q.call(arguments),a=b.shift();return null==a&&(a=""),b.join(a)},lines:function(b){return null==b?[]:l(b).split("\n")},reverse:function(b){return v.chars(b).reverse().join("")},startsWith:function(b,a){return""===a?!0:null==b||null==a?!1:(b=l(b),a=l(a),b.length>=a.length&&b.slice(0,a.length)===a)},endsWith:function(b,a){return""===a?!0:null==b||null==a?!1:(b=l(b),a=l(a),b.length>=a.length&&b.slice(b.length-a.length)===a)},succ:function(b){return null==
b?"":(b=l(b),b.slice(0,-1)+l.fromCharCode(b.charCodeAt(b.length-1)+1))},titleize:function(b){return null==b?"":l(b).replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()})},camelize:function(b){return v.trim(b).replace(/[-_\s]+(.)?/g,function(a,b){return b.toUpperCase()})},underscored:function(b){return v.trim(b).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(b){return v.trim(b).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},classify:function(b){return v.titleize(l(b).replace(/_/g,
" ")).replace(/\s/g,"")},humanize:function(b){return v.capitalize(v.underscored(b).replace(/_id$/,"").replace(/_/g," "))},trim:function(b,a){return null==b?"":!a&&c?c.call(b):(a=w(a),l(b).replace(RegExp("^"+a+"+|"+a+"+$","g"),""))},ltrim:function(b,a){return null==b?"":!a&&h?h.call(b):(a=w(a),l(b).replace(RegExp("^"+a+"+"),""))},rtrim:function(b,a){return null==b?"":!a&&k?k.call(b):(a=w(a),l(b).replace(RegExp(a+"+$"),""))},truncate:function(b,a,c){return null==b?"":(b=l(b),c=c||"...",a=~~a,b.length>
a?b.slice(0,a)+c:b)},prune:function(b,a,c){if(null==b)return"";b=l(b);a=~~a;c=null!=c?l(c):"...";if(b.length<=a)return b;a=b.slice(0,a+1).replace(/.(?=\W*\w*$)/g,function(a){return a.toUpperCase()!==a.toLowerCase()?"A":" "});return a.slice(a.length-2).match(/\w\w/)?a=a.replace(/\s*\S+$/,""):a=v.rtrim(a.slice(0,a.length-1)),(a+c).length>b.length?b:b.slice(0,a.length)+c},words:function(b,a){return v.isBlank(b)?[]:v.trim(b,a).split(a||/\s+/)},pad:function(b,a,c,h){b=null==b?"":l(b);a=~~a;var j=0;c?1<
c.length&&(c=c.charAt(0)):c=" ";switch(h){case "right":return j=a-b.length,b+r(c,j);case "both":return j=a-b.length,r(c,Math.ceil(j/2))+b+r(c,Math.floor(j/2));default:return j=a-b.length,r(c,j)+b}},lpad:function(b,a,c){return v.pad(b,a,c)},rpad:function(b,a,c){return v.pad(b,a,c,"right")},lrpad:function(b,a,c){return v.pad(b,a,c,"both")},sprintf:J,vsprintf:function(b,a){return a.unshift(b),J.apply(null,a)},toNumber:function(b,a){if(null==b||""==b)return 0;b=l(b);var c;c=1*(1*b||0).toFixed(~~a)||0;
return 0===c&&!b.match(/^0+$/)?Number.NaN:c},numberFormat:function(b,a,c,h){if(isNaN(b)||null==b)return"";b=b.toFixed(~~a);h=h||",";b=b.split(".");c=b[1]?(c||".")+b[1]:"";return b[0].replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+h)+c},strRight:function(b,a){if(null==b)return"";b=l(b);var c=(a=null!=a?l(a):a)?b.indexOf(a):-1;return~c?b.slice(c+a.length,b.length):b},strRightBack:function(b,a){if(null==b)return"";b=l(b);var c=(a=null!=a?l(a):a)?b.lastIndexOf(a):-1;return~c?b.slice(c+a.length,b.length):b},strLeft:function(b,
a){if(null==b)return"";b=l(b);var c=(a=null!=a?l(a):a)?b.indexOf(a):-1;return~c?b.slice(0,c):b},strLeftBack:function(b,a){if(null==b)return"";b+="";var c=b.lastIndexOf(null!=a?""+a:a);return~c?b.slice(0,c):b},toSentence:function(b,a,c,h){a=a||", ";c=c||" and ";var j=b.slice(),k=j.pop();return 2<b.length&&h&&(c=v.rtrim(a)+c),j.length?j.join(a)+c+k:k},toSentenceSerial:function(){var b=q.call(arguments);return b[3]=!0,v.toSentence.apply(v,b)},slugify:function(b){if(null==b)return"";var a=RegExp(w("\u0105\u00e0\u00e1\u00e4\u00e2\u00e3\u0107\u0119\u00e8\u00e9\u00eb\u00ea\u00ec\u00ed\u00ef\u00ee\u0142\u0144\u00f2\u00f3\u00f6\u00f4\u00f5\u00f9\u00fa\u00fc\u00fb\u00f1\u00e7\u017c\u017a"),
"g");return b=l(b).toLowerCase().replace(a,function(a){a="\u0105\u00e0\u00e1\u00e4\u00e2\u00e3\u0107\u0119\u00e8\u00e9\u00eb\u00ea\u00ec\u00ed\u00ef\u00ee\u0142\u0144\u00f2\u00f3\u00f6\u00f4\u00f5\u00f9\u00fa\u00fc\u00fb\u00f1\u00e7\u017c\u017a".indexOf(a);return"aaaaaaceeeeeiiiilnooooouuuunczz".charAt(a)||"-"}),v.dasherize(b.replace(/[^\w\s-]/g,""))},surround:function(b,a){return[a,b,a].join("")},quote:function(b){return v.surround(b,'"')},exports:function(){var b={},a;for(a in this)this.hasOwnProperty(a)&&
!a.match(/^(?:include|contains|reverse)$/)&&(b[a]=this[a]);return b},repeat:function(b,a,c){if(null==b)return"";a=~~a;if(null==c)return r(l(b),a);for(var h=[];0<a;h[--a]=b);return h.join(c)},levenshtein:function(b,a){if(null==b&&null==a)return 0;if(null==b)return l(a).length;if(null==a)return l(b).length;b=l(b);a=l(a);for(var c=[],h,j,k=0;k<=a.length;k++)for(var g=0;g<=b.length;g++)k&&g?b.charAt(g-1)===a.charAt(k-1)?j=h:j=Math.min(c[g],c[g-1],h)+1:j=k+g,h=c[g],c[g]=j;return c.pop()}};v.strip=v.trim;
v.lstrip=v.ltrim;v.rstrip=v.rtrim;v.center=v.lrpad;v.rjust=v.lpad;v.ljust=v.rpad;v.contains=v.include;v.q=v.quote;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(module.exports=v),exports._s=v):"function"==typeof define&&define.amd?define("underscore.string",[],function(){return v}):(b._=b._||{},b._.string=b._.str=v)}(this,String);_.mixin(_.str.exports());
var add=function(b){return b.join("+")},x=function(b,l){return b+"\\cdot "+l},pl=function(b,l){return b+" + "+l},fr=function(b,l){return"\\frac{"+b+"}{ "+l+"}"},sq=function(b){return"\\sqrt{"+b+"}"},par=function(b){return"("+b+")"},uu=function(b){return" \\underline{ \\underline{"+b+"} } "},u=function(b){return"  \\underline{"+b+"}"},pwr=function(b,l){return b+"^{"+l+"}"},red=function(b){return"\\color{red}{"+b+"}"},eqnl=function(b,l){return l?"{"+b+"} = \\\\{"+l+"}":"{"+b+"} = "},eq=function(b,l){return l?
"{"+b+"} = {"+l+"}":"{"+b+"} = "},subs=function(b,l){return b+"_{"+l+"} "},sups=function(b,l){return b+"^{"+l+"} "},interval=function(b){return"["+b[0]+", "+b[1]+"\\rangle "},o=function(b){b=_.numberFormat(b,2,".","\\space ");console.log(b);return"00"===_.strRightBack(b,".")?_.strLeftBack(b,"."):b};_.mixin(_.str.exports());
var inputListData=" 1 1 1 2 2 3 5 5 5 ",outputTag=$("#DataUt"),listeMode=function(){$("#frekvensDataInn").hide();$("#tallsystemInn").hide();$("#klasseDataInn").hide();$("#nyTabell").hide();$("#DataInn").show();outputTag=$("#DataUt");$("#DataInn").html('<form class="form-horizontal"><input id="inputList"  value="'+inputListData+'" type="text"></form>');$("#DataInn").keyup(_.debounce(function(){inputListData=$("#inputList").val();inputValidator=function(){var b=_.map(_.without($("#inputList").val().split(/\s+/),""),
Number);return 0==b.length?"<H2>Skriv inn tall adskilt av mellomrom</H2>":_.every(b,function(b){return!_.isNaN(b)})?!1:"<H2>Listen kan kun inneholde tall</H2>"};RedrawOutData()},100))},clearOutput=function(){$("#DataUt").html("");$("#frekvensDataUt").html("")};
function frekvensHeaderRenderer(b,l,c,k,h,r,q){Handsontable.TextCell.renderer.apply(this,arguments);var w=frekvensData.slice(1);_.initial(w);$(l).css({background:"white"});if(0===c)$(l).css({"font-size":"125%","font-weight":"bold"});else if(c!=frekvensData.length-1&&0!=c&&1!=c&&frekvensData[c-1][0]>=frekvensData[c][0])$(l).css({background:"#F2DEDE"});else if(c!=frekvensData.length-1&&0!=c&&!_.isNumber(frekvensData[c][1]))$(l).css({background:"#F2DEDE"});else if(void 0===r||""===r)l.style.background=
"#EEE"}
var frekvensData=[["Type","Frekvens"],[1,2],[2,5],[3,8],[4,7],[5,4],[6,1]],frekvensInputTable=$("#frekvensDataInn").handsontable({data:frekvensData,startRows:1,startCols:2,minSpareRows:1,contextMenu:["row_below","remove_row"],onChange:_.debounce(function(b,l){"loadData"!=l&&(frekvensInputTable.handsontable("loadData",frekvensData),beregn&&RedrawOutData())},300),onBeforeChange:function(b){for(var l=b.length-1;0<=l;l--){if(0==b[l][0])return!0;if(_.isNaN(Number(b[l][3]))||0>Number(b[l][3]))return!1;b[l][3]=
Number(b[l][3])}},onSelection:function(b,l,c,k){!1==frekvensInputTable.handsontable("getCellMeta",c,k).isWritable?frekvensInputTable.handsontable("updateSettings",{fillHandle:!1}):frekvensInputTable.handsontable("updateSettings",{fillHandle:!0})},cells:function(b,l){var c={};0===b&&1===l&&(c.readOnly=!0);c.type={renderer:frekvensHeaderRenderer};return c}});$("#frekvensDataInn").hide();$("#nyTabell").hide();
var frekvensMode=function(){$("#DataInn").hide();$("#tallsystemInn").hide();$("#klasseDataInn").hide();$("#frekvensDataInn").show();$("#FrekvensDataUt").show();$("#nyTabell").show();outputTag=$("#frekvensDataUt");$("#nyTabell").click(function(){frekvensData=[["Type","Frekvens"]];frekvensInputTable.handsontable("loadData",frekvensData);RedrawOutData()});inputValidator=function(){var b=frekvensData.slice(1),b=_.initial(b);return 0==b.length?"<H2>Fyll inn i frekvenstabellen</H2>":!_.every(b,function(b,
c,k){return 0===c||k[c-1][0]<b[0]})?"<H2>Kolonnen til venstre i frekvenstabellen m\u00e5 v\u00e6re sortert fra minst til st\u00f8rst</H2>":!_.every(b,function(b,c,k){return _.isNumber(k[c][0])&&_.isNumber(k[c][1])})?"<H2>Frekvenstabellen er ikke fullstendig utfylt</H2>":!1}};
function klasseHeaderRenderer(b,l,c,k,h,r,q){Handsontable.TextCell.renderer.apply(this,arguments);$(l).css({background:"white"});0===c&&$(l).css({"font-size":"125%","font-weight":"bold"});c!=klasseData.length-1&&klasseData[c][0]>=klasseData[c][1]&&(console.log("Mindre enn forrige "+klasseData[c]+"---"+klasseData.length),$(l).css({background:"#F2DEDE"}));c!=klasseData.length-1&&(0!=c&&1!=c&&klasseData[c-1][0]>=klasseData[c][0])&&(console.log("floppa"),$(l).css({background:"#F2DEDE"}));console.log("value: "+
r);c!=klasseData.length-1&&(void 0===r||""===r||null===r)&&$(l).css({background:"#F2DEDE"})}
var klasseData=[["Fra","Til","Frekvens"],[150,160,28],[160,165,18],[165,170,43],[170,175,35],[175,180,48],[180,185,23],[185,190,15],[190,200,8]],klasseInputTable=$("#klasseDataInn").handsontable({data:klasseData,startRows:1,startCols:3,minSpareRows:1,contextMenu:["row_below","remove_row"],onChange:_.debounce(function(b,l){if("loadData"!=l){for(var c=b.length-1;0<=c;c--){var k=b[c][0],h=b[c][1],r=b[c][3];0==k||(k==klasseData.length||1==k&&0==h||k==klasseData.length-1||k==klasseData.length-2&&1==h)||
(0==h?klasseData[k-1][1]=r:1==h?klasseData[k+1][0]=r:console.log(""));klasseInputTable.handsontable("loadData",klasseData)}beregn&&RedrawOutData()}},300),onBeforeChange:function(b){for(var l=b.length-1;0<=l;l--){if(0==b[l][0])return!0;if(_.isNaN(Number(b[l][3]))||0>Number(b[l][3]))return!1;b[l][3]=Number(b[l][3])}},onSelection:function(b,l,c,k){!1==klasseInputTable.handsontable("getCellMeta",c,k).isWritable?klasseInputTable.handsontable("updateSettings",{fillHandle:!1}):klasseInputTable.handsontable("updateSettings",
{fillHandle:!0})},cells:function(b){var l={};0===b&&(l.readOnly=!0);l.type={renderer:klasseHeaderRenderer};return l}});$("#klasseDataInn").hide();
var klasseMode=function(){$("#DataInn").hide();$("#tallsystemInn").hide();$("#frekvensDataInn").hide();$("#klasseDataInn").show();$("#FrekvensDataUt").show();outputTag=$("#frekvensDataUt");$("#nyTabell").show();$("#nyTabell").click(function(){klasseData=[["Fra","Til","Frekvens"]];klasseInputTable.handsontable("loadData",klasseData);RedrawOutData()});inputValidator=function(){var b=klasseData.slice(1),b=_.initial(b);return 0==b.length?"<H2>Fyll inn i tabellen</H2>":!_.every(b,function(b,c,k){return 0===
c||k[c-1][0]<b[0]})||!_.every(b,function(b,c,k){return k[c][0]<b[1]})?"<H2>Det er overlappende intervaller i tabellen </H2>":!_.every(b,function(b,c,k){return _.isNumber(k[c][0])&&_.isNumber(k[c][1])&&_.isNumber(k[c][2])})?"<H2>Tabellen er ikke fullstendig utfylt</H2>":!1}},tallsystemMode=function(){$("#DataInn").hide();$("#frekvensDataInn").hide();$("#tallsystemInn").show();$("#klasseDataInn").hide();outputTag=$("#DataUt");$("#tallsystemInn").html('<h2>Skriv inn et tall p\u00e5 totallsystemet (kun 0 og 1):</h2><form ><input class="bigTextbox"  id="2to10inn" type="text" value="1010"/><br /></form>');
$("#tallsystemInn").keyup(_.debounce(function(){RedrawOutData()},500))};function trim(b){return b.replace(/^\s+|\s+$/g,"")}
var ListeSnitt=function(b){var l=_.map(trim($("#inputList").val()).split(/\s+/),Number);return _.template("<%= title %><p>Finner summen av observasjonsverdiene: $<%= regnUtSum %>$  </p><P>Finner antall observasjoner: $<%= visLengde %>$</P><p>Gjennomsnittet er da: $<%= regnUtSnitt %>$</p>",{title:b?"":"<h2>Finner gjennomsnitt:</h2>",regnUtSum:"S = "+l.join(" + ")+" = "+_.reduce(l,function(b,k){return b+k},0),visLengde:"N =  "+l.length,regnUtSnitt:function(){var b=_.reduce(l,function(b,c){return b+
c},0),k=1*l.length;return"{S \\over N} = {"+b+" \\over "+k+"} = "+o(b/k)}()})},ListeTypetall=function(){var b=_.map(trim($("#inputList").val()).split(/\s+/),Number),l=_.reduce(b,function(b,c){c in b?b[c]++:b[c]=1;return b},{}),b=_.map(_.keys(l),function(b){return[b,l[b]]}).sort(function(b,c){return b[0]-c[0]}),c="<thead><tr><th>Verdi $x$</th><th>Frekvens $f$</th></tr></thead>";_.each(b,function(b){c+="<tr><td>$"+b[0]+"$</td><td>$"+b[1]+"$</td></tr>"});var k=_.map(_.keys(l),function(b){return[b,l[b]]}).sort(function(b,
c){return c[1]-b[1]}),b=_.reduce(k,function(b,c){c[1]==k[0][1]&&b.push(c[0]);return b},[]).join(" og ");return _.template('<h2>Finn typetall:</h2><p>Teller opp verdiene og lager en frekvenstabell:<table class="table table-bordered table-striped table-condensed" style="height:0; width:0;" id="typetallVerdiTabell"><%= typetallVerdiTabell %></table></p> <P>Ser i tabellen og finner de hyppigst forekommende verdiene</P><p>Typetall(ene) er: <%= typetallSiste %> </p>',{typetallVerdiTabell:c,typetallSiste:b})},
ListeMedian=function(){var b=_.map(trim($("#inputList").val()).split(/\s+/),Number);return _.template("<h2>Finn median:</h2><p>Sorterer observasjonene: $<%= medianSorter %>$</p><P>Finner antall observasjoner: <%= medianVisLengde %> </P><p>Finner midtpunktet: <%= medianMidtersteObservasjon %>  </p><p><%= medianMedian %></p>",{medianSorter:function(){var l=1;return _.map(b.sort(function(b,k){return b-k}),function(b){return b+"_{("+l++ +")}"}).join(" \\;\\; ")}(),medianVisLengde:"N =  "+b.length,medianMidtersteObservasjon:function(){var l;
l=""+("\\({N + 1 \\over 2} = {"+b.length+" + 1 \\over 2} = "+(b.length+1)/2+" \\)");return l=0==b.length%2?l+"<br/>Fordi det er et partall antall observasjoner er medianen lik gjennomsnittet av de to verdiene som ligger p\u00e5 hver sin side av midtpunktet":l+"<br/>Fordi det er et oddetall antall observasjoner er medianen lik den verdien som svarer til midtpunktet."}(),medianMedian:function(){var l="",c=b.sort(function(b,c){return b-c});if(0==b.length%2)var k=b.length/2-1,h=k+1,l=l+("Medianen er gjennomsnittet av verdiene nummer "+
(k+1)+" og "+(1+h)+". \\({"+c[k]+" + "+c[h]+" \\over 2 }= "+(c[k]+c[h])/2+"\\)");else k=(b.length+1)/2,l+="Medianen er verdi nummer "+k+". Dermed er medianen "+c[k-1]+".";return"<P>"+l+"</P>"}()})},ListeVariasjonsbredde=function(){var b=_.map(trim($("#inputList").val()).split(/\s+/),Number),l=_.min(b),b=_.max(b);return _.template("<h2>Finn variasjonsbredden:</h2><p>Finner minste verdi: $<%= minst %>$</p><P>Finner st\u00f8rste verdi: $<%= storst %>$</P><p>Variasjonsbredden er da: $\\text{st\u00f8rste verdi} - \\text{minste verdi} = <%= storst %> - <%= minst %> = <%= samlet %>$  </p>",
{minst:l,storst:b,samlet:b-l})},ListeVarianse=function(b){var l=_.map(trim($("#inputList").val()).split(/\s+/),Number),c=_.reduce(l,function(b,c){return b+c},0),k=1*l.length,h=c/k,c=_.reduce(l,function(b,c){return b+Math.pow(h-c,2)},0)/k,l="\\text{Variansen} = { ("+o(h)+" - "+l.join(")^2 + ("+o(h)+"-")+")^2 \\over "+k+"} ="+o(c);return _.template("<%= title %><H3>Finner f\u00f8rst gjennomsnittet:</H3><p><%= singleGjennomsnittUtregning %></p><H3>Bruker gjennomsnittet for \u00e5 regne ut variansen</H3><p>$<%=singleVarianseUtregning %>$</p><p>Variansen er: $  <%= singleVarianseSvar %>$</p>",
{title:"undefined"===typeof b?"<h2>Finn variansen:</h2>":"",singleGjennomsnittUtregning:ListeSnitt("noTitle"),singleVarianseSvar:o(c),singleVarianseUtregning:l})},ListeStandardavvik=function(){var b=_.map(trim($("#inputList").val()).split(/\s+/),Number),l=_.reduce(b,function(b,c){return b+c},0),c=1*b.length,k=l/c,l=_.reduce(b,function(b,c){return b+Math.pow(k-c,2)},0)/c;b.join(")^2 + ("+k+"-");return _.template("<h2 >Finn standardavvik:</h2><%= finnVariansen %><H3>Bruker variansen for \u00e5 regne ut standardavvik</H3><p>Standardavviket er: $ \\sqrt{\\text{Variansen}} = \\sqrt{<%= variansen %>} = <%= standardavvik %>$</p>",
{finnVariansen:ListeVarianse("inEmbedded"),variansen:o(l),standardavvik:o(Math.sqrt(l))})},ListeStolpe=function(){var b=_.map(trim($("#inputList").val()).split(/\s+/),Number),l=_.reduce(b,function(b,c){c in b?b[c]++:b[c]=1;return b},{}),b=_.map(_.keys(l),function(b){return[b,l[b]]}).sort(function(b,c){return b[0]-c[0]});outputTag.append("<h2>S\u00f8ylediagram:</h2>");var c=d3.scale.ordinal().rangeRoundBands([0,640],0.1),k=d3.scale.linear().range([320,0]),h=d3.svg.axis().scale(c).orient("bottom"),
r=d3.svg.axis().scale(k).orient("left"),q=d3.select("#DataUt").append("svg").attr("width",700).attr("height",400).append("g").attr("transform","translate(40,20)");c.domain(b.map(function(b){return b[0]}));k.domain([0,d3.max(b,function(b){return b[1]})]);q.append("g").attr("class","x axis").attr("transform","translate(0,320)").call(h);q.append("g").attr("class","y axis").call(r).append("text").attr("transform","rotate(-90)").attr("y",6).attr("dy",".51em").style("text-anchor","end").text("Frekvens");
q.selectAll(".bar").data(b).enter().append("rect").attr("class","bar").attr("x",function(b){return c(b[0])}).attr("width",c.rangeBand()).attr("y",function(b){return k(b[1])}).attr("height",function(b){return 320-k(b[1])});q.append("text").attr("class","x label").attr("text-anchor","end").attr("x",320).attr("y",360).text("Verdier");return""},ListeKake=function(){var b=_.map(trim($("#inputList").val()).split(/\s+/),Number),l=_.reduce(b,function(b,c){c in b?b[c]++:b[c]=1;return b},{}),b=_.map(_.keys(l),
function(b){return{label:b,value:l[b]}}).sort(function(b,c){return b.label-c.label});outputTag.append("<h2>Kakediagram:</h2>");var c=Math.min(500,400)/2,k=d3.scale.ordinal().range("#98abc5 #8a89a6 #7b6888 #6b486b #a05d56 #d0743c #ff8c00".split(" ")),h=d3.svg.arc().outerRadius(c-10).innerRadius(0),c=d3.layout.pie().sort(null).value(function(b){return b.value}),r=d3.select("#DataUt").append("svg").attr("width",500).attr("height",400).append("g").attr("transform","translate(250,200)");b.forEach(function(b){b[1]=
+b[1]});b=r.selectAll(".arc").data(c(b)).enter().append("g").attr("class","arc");b.append("path").attr("d",h).style("fill",function(b){return k(b.data.label)});b.append("text").attr("transform",function(b){return"translate("+h.centroid(b)+")"}).attr("dy",".35em").style("text-anchor","middle").style("font-size","20px").style("color","white").text(function(b){return b.data.label});return""},Tallsystem2til10=function(){var b=$("#2to10inn").val(),b=b.trim();if(!_.every(_.chars(b),function(b){return"0"===
b||"1"===b}))return"<H2>Kun 0 og 1 er gyldig input</H2>";var l=_.map(b.split(""),Number),l=l.reverse(),c=0,k=0,h=0,l=eq(eqnl(add(_.map(l,function(b){return x(red(b),pwr(2,c++))}).reverse()),add(_.map(l,function(b){return b*Math.pow(2,k++)}).reverse())),red(uu(subs(_.reduce(_.map(l,function(b){return b*Math.pow(2,h++)}).reverse(),function(b,c){return b+c}),"(10)"))));return _.template("<h2 >Konverterer $<%= input %>$ til 10-tallsystemet:</h2>$<%= out %>$",{input:b+"_{(2)}",out:l})},FrekvensSnitt=function(b){var l=
frekvensData.slice(1),l=_.initial(l),c=$("<table>");c.addClass("table table-bordered table-striped table-condensed");c.css({width:0,height:0});c.append("<thead><tr><th>Verdi&nbsp;$x$</th><th>Frekvens&nbsp;$f$</th><th>$f \\cdot x$</th></tr></thead>");var k=0,h=0;_.each(l,function(b){k+=parseInt(b[1]);h+=parseInt(b[0])*parseInt(b[1]);c.append("<tr><td>$"+b[0]+"$</td><td>$"+b[1]+"$</td><td>$"+b[0]*b[1]+"$</td></tr>")});c.append("<tr><td>&nbsp;</td><td>$N="+k+"$</td><td>$S="+h+"$</td></tr>");l=_.template("<%= table %>Gjennomsnittet er: $ g = \\frac{S}{N} = <%= snitt %>$",
{table:c.wrap("<div></div>").parent().html(),snitt:eq(fr(h,k),o(h/k))});return(b?"":"<h2>Finner gjennomsnittet:</h2>")+l},FrekvensTypetall=function(){var b=frekvensData.slice(1),b=_.initial(b),l=$("<table>");l.addClass("table table-bordered table-striped table-condensed");l.css({width:0,height:0});l.append("<thead><tr><th>Verdi&nbsp;$x$</th><th>Frekvens&nbsp;$f$</th></thead>");var c=0,k=b[0],h=[k];_.each(b.slice(1),function(b){Number(k[1])<Number(b[1])?(k=b,h=[k]):k[1]==b[1]&&h.push(b)});var r="";
_.each(b,function(b){c+=parseInt(b[1],10);r=b[1]==k[1]?'class="info"':"";currTD=l.append("<tr "+r+"><td>$"+b[0]+"$</td><td>$"+b[1]+"$</td></tr>")});l.append("<tr><td>&nbsp;</td><td>$N="+c+"$</td></tr>");return _.template("<h2>Finner typetallet:</h2><%= table %>Typetallet er <%= typetall %>",{table:l.wrap("<div></div>").parent().html(),typetall:_.toSentence(_.pluck(h,0),", "," og ")})};function repeatArray(b,l){var c=b.length,k=[];for(i=0;i<l;i++)k.push(b[i%c]);return k}
var FrekvensMedian=function(){var b=frekvensData.slice(1),b=_.initial(b);if(!_.every(b,function(b){return 1E6>b[1]}))return"Kalkulatoren kan for tiden dessverre ikke finne medianen av tabeller med s\u00e5 h\u00f8ye frekvenser. Beklager.";var l=$("<table>");l.addClass("table table-bordered table-striped table-condensed");l.css({width:0,height:0});l.append("<thead><tr><th>Verdi&nbsp;$x$</th><th>Frekvens&nbsp;$f$</th><th>Kumulativ&nbsp;frekvens</th></tr></thead>");var c=0;_.each(b,function(b){c+=parseInt(b[1])});
var k=0,h=[""];_.each(b,function(b,q){h=h.concat(repeatArray([parseInt(b[0])],b[1]));var r=k;k+=parseInt(b[1]);var R=0===q?k:eq(pl(r,b[1]),k),J="";if(0==c%2)var J=c/2,V=J+1,J=J>r&&J<=k||V>r&&V<=k?' class="info" ':"";else J=(c+1)/2,J=J>r&&J<=k?' class="info" ':"";l.append("<tr"+J+"><td>$"+b[0]+"$</td><td>$"+b[1]+"$</td><td>$"+R+"$</td></tr>")});var r=b="",q="";0==k%2?(b="Dette er et partall. <br/> Medianen er derfor snittet av observasjon nummer $"+[fr("N","2"),fr(k,"2"),k/2].join(" = ")+"$ og den neste observasjonen, som er observasjon nummer $"+
(k/2+1)+"$",q="Observasjon nr $"+k/2+"$ er $"+h[k/2]+"$<br>Observasjon nr $"+(k/2+1)+"$ er $"+h[k/2+1]+"$<br>",r="$"+fr(h[k/2]+" + "+h[k/2+1],"2")+" = "+fr(h[k/2]+h[k/2+1],"2")+" = "+(h[k/2]+h[k/2+1])/2+"$"):(q="Observasjon nr $"+(k+1)/2+"$ er $"+h[(k+1)/2]+"$<br>",b="Det er et oddetall. <br/>Medianen er da observasjon nummer $"+[fr("N +1","2"),fr(k+"+ 1","2"),fr(k+1,"2"),(k+1)/2].join(" = ")+"$",r="$"+h[(k+1)/2]+"$");l.append("<tr><td>&nbsp;</td><td>$N="+k+"$</td><td>&nbsp;</td></tr>");return _.template("<h2>Finner medianen:</h2><%= table %>Vi har her $<%= N %>$ observasjoner. <%= medUtr %><br/><%= ObsNr%>Medianen er dermed: <%= median %>",
{table:l.wrap("<div></div>").parent().html(),N:k,ObsNr:q,medUtr:b,median:r})},FrekvensVarianse=function(b){var l=frekvensData.slice(1),l=_.initial(l),c=0,k=0;_.each(l,function(b){c+=parseInt(b[1]);k+=parseInt(b[0])*parseInt(b[1])});var h=k/c,r=$("<table>");r.addClass("table table-bordered table-striped table-condensed");r.css({width:0,height:0});r.append("<thead><tr><th>Verdi&nbsp;$x$</th><th>Frekvens&nbsp;$f$</th><th>$f \\cdot x$</th><th>$f \\cdot (x - g)$</th></tr></thead>");var q=0,w=0,E=0;_.each(l,
function(b){q+=parseInt(b[1]);w+=parseInt(b[0])*parseInt(b[1]);var c=b[1]*Math.pow(b[0]-h,2);E+=c;r.append("<tr><td>$"+b[0]+"$</td><td>$"+b[1]+"$</td><td>$"+b[0]*b[1]+"$</td><td>$"+x(b[1],sups(par(b[0]+"-"+o(h)),2))+" ="+o(c)+"$</td></tr>")});r.append("<tr><td>&nbsp;</td><td>$N="+q+"$</td><td>$S="+w+"$</td><td>$A="+o(E)+"$</td></tr>");return _.template((b?"":"<h2>Finner variansen:</h2>")+"<h3>M\u00e5 f\u00f8rst finne gjennomsnittet:</h3><%= gjSnitt %><h3>Bruker gjennomsnittet til \u00e5 finne variansen:</h3><%= table %>Summen av kvadratene av avvikene er $ A = <%= A %>$<br>Variansen er: $<%= varUtr %>$",
{gjSnitt:FrekvensSnitt("Uten tittel"),table:r.wrap("<div></div>").parent().html(),A:o(E),varUtr:fr("A","N")+"="+fr(o(E),q)+"="+o(E/q)})},FrekvensStandardavvik=function(b){var l=frekvensData.slice(1),l=_.initial(l),c=0,k=0;_.each(l,function(b){c+=parseInt(b[1]);k+=parseInt(b[0])*parseInt(b[1])});var h=k/c,r=0,q=0,w=0;_.each(l,function(b){r+=parseInt(b[1]);q+=parseInt(b[0])*parseInt(b[1]);b=b[1]*Math.pow(b[0]-h,2);w+=b});return _.template(b?"":"<h2>Finner standardavviket:</h2><%= varUtr %><H3>Bruker variansen til \u00e5 finne standardavviket:</h3>Standardavviket er: $<%= stdUtr %>$",
{varUtr:FrekvensVarianse("Uten tittel"),stdUtr:sq(o(w/r))+"="+o(Math.sqrt(w/r))})},FrekvensVariasjonsbredde=function(){var b=frekvensData.slice(1),b=_.initial(b),l=parseInt(_.max(b,function(b){return b[0]})[0]),b=parseInt(_.min(b,function(b){return b[0]})[0]);return _.template("<h2>Finner Variasjonsbredden:</h2>Den minste verdien er <%= minVer %><br/>Den st\u00f8rste verdien er <%= maxVer %><br/>Variasjonsbredden er st\u00f8rste verdi minus minste verdi = $<%= varbredd %>$",{minVer:b,maxVer:l,varbredd:l+
"-"+b+"="+(l-b)})},FrekvensStolpe=function(){console.log("FrekvensStolpe er blit kallet");var b=frekvensData[0],l=frekvensData.slice(1),l=_.initial(l);outputTag.append("<h2>S\u00f8ylediagram:</h2>");var c=d3.scale.ordinal().rangeRoundBands([0,615],0.1),k=d3.scale.linear().range([320,0]),h=d3.svg.axis().scale(c).orient("bottom"),r=d3.svg.axis().scale(k).orient("left"),q=d3.select("#frekvensDataUt").append("svg").attr("width",700).attr("height",400).append("g").attr("transform","translate(65,20)");
c.domain(l.map(function(b){return b[0]}));k.domain([0,d3.max(l,function(b){return b[1]})]);q.append("g").attr("class","x axis").attr("transform","translate(0,320)").call(h);q.append("g").attr("class","y axis").call(r).append("text").attr("transform","rotate(-90)").attr("y",6).attr("dy",".51em").style("text-anchor","end").text("Frekvens");q.selectAll(".bar").data(l).enter().append("rect").attr("class","bar").attr("x",function(b){return c(b[0])}).attr("width",c.rangeBand()).attr("y",function(b){return k(b[1])}).attr("height",
function(b){return 320-k(b[1])});q.append("text").attr("class","x label").attr("text-anchor","end").attr("x",307.5).attr("y",360).text(b[0]);return""},FrekvensKake=function(){var b=frekvensData.slice(1),b=_.initial(b);outputTag.append("<h2>Kakediagram:</h2>");var l=Math.min(500,400)/2,c=d3.scale.ordinal().range("#98abc5 #8a89a6 #7b6888 #6b486b #a05d56 #d0743c #ff8c00".split(" ")),k=d3.svg.arc().outerRadius(l-10).innerRadius(0),l=d3.layout.pie().sort(null).value(function(b){return b[1]}),h=d3.select("#frekvensDataUt").append("svg").attr("width",
500).attr("height",400).append("g").attr("transform","translate(250,200)");b.forEach(function(b){b[1]=+b[1]});b=h.selectAll(".arc").data(l(b)).enter().append("g").attr("class","arc");b.append("path").attr("d",k).style("fill",function(b){return c(b.data[0])});b.append("text").attr("transform",function(b){return"translate("+k.centroid(b)+")"}).attr("dy",".35em").style("text-anchor","middle").style("font-size","20px").style("color","white").text(function(b){return b.data[0]})},KlasseSnitt=function(b){var l=
klasseData.slice(1),l=_.initial(l),c=$("<table>");c.addClass("table table-bordered table-striped table-condensed");c.css({width:0,height:0});c.append("<thead><tr><th>Klasse&nbsp;$[a, b \\rangle $</th><th>Klassemidtpunkt&nbsp;$x_m$</th><th>Frekvens&nbsp;$f$</th><th>Klassesum&nbsp;$f \\cdot x_m$</th></tr></thead>");var k=0,h=0;_.each(l,function(b){b=_.map(b,Number);k+=b[2];var l=(b[1]+b[0])/2,w=l*b[2];h+=w;c.append("<tr><td>$["+b[0]+" , "+b[1]+"\\rangle $</td><td>$"+l+"$</td><td>$"+b[2]+"$</td><td>$"+
w+"$</td></tr>")});c.append("<tr><td>&nbsp;</td><td>&nbsp;</td><td>$N="+k+"$</td><td>$S="+h+"$</td></tr>");l=_.template("<%= table %>Gjennomsnittet er omtrent: $ g = \\frac{S}{N} = <%= snitt %>$",{table:c.wrap("<div></div>").parent().html(),snitt:eq(fr(h,k),o(h/k))});return(b?"":"<h2>Finner gjennomsnittet:</h2>")+l},KlasseMedian=function(){var b=klasseData.slice(1),b=_.initial(b);if(!_.every(b,function(b){return 1E6>b[2]}))return"Kalkulatoren kan for tiden dessverre ikke finne medianen av tabeller med s\u00e5 h\u00f8ye frekvenser. Beklager.";
var l=$("<table>");l.addClass("table table-bordered table-striped table-condensed");l.css({width:0,height:0});l.append("<thead><tr><th>Klasse&nbsp;$[a, b \\rangle $</th><th>Frekvens&nbsp;$f$</th><th>Kumulativ&nbsp;frekvens</th></tr></thead>");var c=0;_.each(b,function(b){b=_.map(b,Number);c+=b[2]});var k=0,h=[""];_.each(b,function(b,q){b=_.map(b,Number);var r=k;k+=parseInt(b[2]);h=h.concat(repeatArray([[b[0],b[1],r,k,b[2]]],b[2]));var R=0===q?k:eq(pl(r,b[2]),k),J="";if(0==c%2)var J=c/2,V=J+1,J=J>
r&&J<=k||V>r&&V<=k?' class="info" ':"";else J=(c+1)/2,J=J>r&&J<=k?' class="info" ':"";l.append("<tr"+J+"><td>$["+b[0]+" , "+b[1]+"\\rangle $</td><td>$"+b[2]+"$</td><td>$"+R+"$</td></tr>")});var r=b="",q="",r="";0==k%2?(b="Dette er et partall. <br/> Fordi vi ikke kan finne n\u00f8yaktig median i klassedelt materiale sier vi at medianen er observasjon nummer $"+[fr("N","2"),fr(k,"2"),k/2].join(" = ")+"$",r=h[k/2],q="Observasjon nr $"+k/2+"$ er i intervallet $"+interval(r)+"$<br>Ettersom det er "+r[2]+
" observasjoner som er lavere enn "+r[0]+" er observasjonen nummer $"+k/2+"-"+r[2]+"="+(k/2-r[2])+"$ i intervallet $"+interval(r)+"$<br/>"):(q=(k+1)/2,b="Det er et oddetall. <br/>Medianen er da observasjon nummer $"+[fr("N +1","2"),fr(k+"+ 1","2"),fr(k+1,"2"),(k+1)/2].join(" = ")+"$",r=h[q],q="Observasjon nr $"+q+"$ er i intervallet $"+interval(r)+"$<br>Ettersom det er "+r[2]+" observasjoner som er lavere enn "+r[0]+" er observasjonen nummer $"+q+"-"+r[2]+"="+(q-r[2])+"$ i intervallet $"+interval(r)+
"$<br/>");r="$"+r[0]+"+"+x(fr(k/2-r[2],r[4]),r[1]-r[0])+"="+uu(o(r[0]+(k/2-r[2])/r[4]*(r[1]-r[0])))+"$<br>";l.append("<tr><td>&nbsp;</td><td>$N="+k+"$</td><td>&nbsp;</td></tr>");return _.template("<h2>Finner medianen:</h2><%= table %>Vi har her $<%= N %>$ observasjoner. <%= medUtr %><br/><%= ObsNr%>Medianen er dermed omtrent: <%= median %>",{table:l.wrap("<div></div>").parent().html(),N:k,ObsNr:q,medUtr:b,median:r})},KlasseHist=function(){var b=klasseData.slice(1),b=_.initial(b);outputTag.append("<h2>Histogram:</h2>");
var l=d3.select("#frekvensDataUt").append("svg").attr("width",700).attr("height",500).append("g").attr("transform","translate(60,10)"),c=d3.scale.linear().range([0,620]),k=d3.scale.linear().range([420,0]);b.forEach(function(b){_.map(b,Number)});for(var h=0,r=b.length,q;h<r;h++)q=b[h],q.offset=q[0],q.width=q[1]-q[0],q.height=q[2]/q.width;console.log(b.map(function(b){return b[1]}));c.domain([d3.min(b.map(function(b){return b[0]})),d3.max(b.map(function(b){return b[1]}))]);k.domain([0,d3.max(b.map(function(b){return b.height}))]);
l.selectAll(".bin").data(b).enter().append("rect").attr("class","bin").attr("x",function(b){return c(b.offset)}).attr("width",function(b){console.log("!!!"+b.width);return c(b[1])-c(b[0])-1}).attr("y",function(b){return k(b.height)}).attr("height",function(b){return 420-k(b.height)});l.append("g").attr("class","hist x axis").attr("transform","translate(0,420)").call(d3.svg.axis().scale(c).orient("bottom"));l.append("g").attr("class","y axis").call(d3.svg.axis().scale(k).orient("left")).append("text").attr("transform",
"rotate(-90)").attr("y",6).attr("dy",".51em").style("text-anchor","end").text("Histogramh\u00f8yde")},beregn=void 0,inputValidator=function(){return!1},RedrawOutData=function(){clearOutput();if(beregn){var b=inputValidator()||beregn();b?outputTag.html(b).show():outputTag.show();MathJax.Hub.Queue(["Typeset",MathJax.Hub])}else console.log("beregn er "+beregn),$("#DataUt").html("Du m\u00e5 velge en funksjon i menyen \u00f8verst").show()};
$(document).ready(function(){$("#ListeSnitt").click(function(){listeMode();clearOutput();beregn=ListeSnitt;beregn();RedrawOutData()});$("#ListeTypetall").click(function(){listeMode();clearOutput();beregn=ListeTypetall;beregn();RedrawOutData()});$("#ListeMedian").click(function(){listeMode();clearOutput();beregn=ListeMedian;beregn();RedrawOutData()});$("#ListeVarianse").click(function(){listeMode();clearOutput();beregn=ListeVarianse;beregn();RedrawOutData()});$("#ListeStandardavvik").click(function(){listeMode();
clearOutput();beregn=ListeStandardavvik;beregn();RedrawOutData()});$("#ListeVariasjonsbredde").click(function(){listeMode();clearOutput();beregn=ListeVariasjonsbredde;RedrawOutData()});$("#ListeStolpe").click(function(){listeMode();clearOutput();beregn=ListeStolpe;RedrawOutData()});$("#ListeKake").click(function(){listeMode();clearOutput();beregn=ListeKake;RedrawOutData()});$("#FrekvensSnitt").click(function(){frekvensMode();clearOutput();beregn=FrekvensSnitt;RedrawOutData()});$("#FrekvensTypetall").click(function(){frekvensMode();
clearOutput();beregn=FrekvensTypetall;RedrawOutData()});$("#FrekvensMedian").click(function(){frekvensMode();clearOutput();beregn=FrekvensMedian;RedrawOutData()});$("#FrekvensVarianse").click(function(){frekvensMode();clearOutput();beregn=FrekvensVarianse;RedrawOutData()});$("#FrekvensStandardavvik").click(function(){frekvensMode();clearOutput();beregn=FrekvensStandardavvik;RedrawOutData()});$("#FrekvensVariasjonsbredde").click(function(){console.log("$( '#FrekvensVariasjonsbredde' ).click(function( event ) { ");
frekvensMode();clearOutput();beregn=FrekvensVariasjonsbredde;RedrawOutData()});$("#FrekvensStolpe").click(function(){console.log("$( '#FrekvensStolpe' ).click(function( event ) { ");frekvensMode();clearOutput();beregn=FrekvensStolpe;RedrawOutData()});$("#FrekvensKake").click(function(){frekvensMode();clearOutput();beregn=FrekvensKake;RedrawOutData()});$("#KlasseSnitt").click(function(){klasseMode();clearOutput();beregn=KlasseSnitt;RedrawOutData()});$("#KlasseMedian").click(function(){klasseMode();
clearOutput();beregn=KlasseMedian;RedrawOutData()});$("#KlasseHist").click(function(){klasseMode();clearOutput();beregn=KlasseHist;RedrawOutData()});$("#Tallsystem2til10").click(function(){tallsystemMode();clearOutput();beregn=Tallsystem2til10;RedrawOutData()});$("#regnUtKnapp").click(function(b){b.preventDefault();RedrawOutData()});$("#DataInn").html("<H1>Velg en funksjon i menyen over</H1><P>2PY-kalkulatoren er laget for \u00e5 hjelpe elever som tar matematikk 2P og 2PY med statistikkoppgaver.</P><P>Kalkulatoren er programmert av Jan Egil Hagen, l\u00e6rer ved Hellerud vgs i Oslo. Send tilbakemeldinger og foresp\u00f8rsler til <a href='mailto:jehagen@matematikk.net'>jehagen@matematikk.net</A></P>")});  