text: function Gauge(a,b){this.element=a;var c=this;this.configure=function(a){this.config=a,this.config.size=.9*this.config.size,this.config.raduis=.97*this.config.size/2,this.config.cx=this.config.size/2,this.config.cy=this.config.size/2,this.config.min=void 0!=a.min?a.min:0,this.config.max=void 0!=a.max?a.max:100,this.config.range=this.config.max-this.config.min,this.config.majorTicks=a.majorTicks||5,this.config.minorTicks=a.minorTicks||2,this.config.greenColor=a.greenColor||"#109618",this.config.yellowColor=a.yellowColor||"#FF9900",this.config.redColor=a.redColor||"#DC3912",this.config.transitionDuration=a.transitionDuration||500},this.render=function(){this.body=d3.select(this.element).append("svg:svg").attr("class","gauge").attr("width",this.config.size).attr("height",this.config.size),this.body.append("svg:circle").attr("cx",this.config.cx).attr("cy",this.config.cy).attr("r",this.config.raduis).style("fill","#ccc").style("stroke","#000").style("stroke-width","0.5px"),this.body.append("svg:circle").attr("cx",this.config.cx).attr("cy",this.config.cy).attr("r",.9*this.config.raduis).style("fill","#fff").style("stroke","#e0e0e0").style("stroke-width","2px");for(var a in this.config.greenZones)this.drawBand(this.config.greenZones[a].from,this.config.greenZones[a].to,c.config.greenColor);for(var a in this.config.yellowZones)this.drawBand(this.config.yellowZones[a].from,this.config.yellowZones[a].to,c.config.yellowColor);for(var a in this.config.redZones)this.drawBand(this.config.redZones[a].from,this.config.redZones[a].to,c.config.redColor);if(void 0!=this.config.label){var b=Math.round(this.config.size/9);this.body.append("svg:text").attr("x",this.config.cx).attr("y",this.config.cy/2+b/2).attr("dy",b/2).attr("text-anchor","middle").text(this.config.label).style("font-size",b+"px").style("fill","#333").style("stroke-width","0px")}for(var b=Math.round(this.config.size/16),d=this.config.range/(this.config.majorTicks-1),e=this.config.min;e<=this.config.max;e+=d){for(var f=d/this.config.minorTicks,g=e+f;g<Math.min(e+d,this.config.max);g+=f){var h=this.valueToPoint(g,.75),i=this.valueToPoint(g,.85);this.body.append("svg:line").attr("x1",h.x).attr("y1",h.y).attr("x2",i.x).attr("y2",i.y).style("stroke","#666").style("stroke-width","1px")}var h=this.valueToPoint(e,.7),i=this.valueToPoint(e,.85);if(this.body.append("svg:line").attr("x1",h.x).attr("y1",h.y).attr("x2",i.x).attr("y2",i.y).style("stroke","#333").style("stroke-width","2px"),e==this.config.min||e==this.config.max){var j=this.valueToPoint(e,.63);this.body.append("svg:text").attr("x",j.x).attr("y",j.y).attr("dy",b/3).attr("text-anchor",e==this.config.min?"start":"end").text(e).style("font-size",b+"px").style("fill","#333").style("stroke-width","0px")}}var k=this.body.append("svg:g").attr("class","pointerContainer"),l=(this.config.min+this.config.max)/2,m=this.buildPointerPath(l),n=d3.svg.line().x(function(a){return a.x}).y(function(a){return a.y}).interpolate("basis");k.selectAll("path").data([m]).enter().append("svg:path").attr("d",n).style("fill","#dc3912").style("stroke","#c63310").style("fill-opacity",.7),k.append("svg:circle").attr("cx",this.config.cx).attr("cy",this.config.cy).attr("r",.12*this.config.raduis).style("fill","#4684EE").style("stroke","#666").style("opacity",1);var b=Math.round(this.config.size/10);k.selectAll("text").data([l]).enter().append("svg:text").attr("x",this.config.cx).attr("y",this.config.size-this.config.cy/4-b).attr("dy",b/2).attr("text-anchor","middle").style("font-size",b+"px").style("fill","#000").style("stroke-width","0px"),this.redraw(this.config.min,0)},this.buildPointerPath=function(a){function b(a,b){var d=c.valueToPoint(a,b);return d.x-=c.config.cx,d.y-=c.config.cy,d}var d=this.config.range/13,e=b(a,.85),f=b(a-d,.12),g=b(a+d,.12),h=a-this.config.range*(1/.75)/2,i=b(h,.28),j=b(h-d,.12),k=b(h+d,.12);return[e,f,k,i,j,g,e]},this.drawBand=function(a,b,d){0>=b-a||this.body.append("svg:path").style("fill",d).attr("d",d3.svg.arc().startAngle(this.valueToRadians(a)).endAngle(this.valueToRadians(b)).innerRadius(.65*this.config.raduis).outerRadius(.85*this.config.raduis)).attr("transform",function(){return"translate("+c.config.cx+", "+c.config.cy+") rotate(270)"})},this.redraw=function(a,b){var d=this.body.select(".pointerContainer");d.selectAll("text").text(Math.round(a));var e=d.selectAll("path");e.transition().duration(void 0!=b?b:this.config.transitionDuration).attrTween("transform",function(){var b=a;a>c.config.max?b=c.config.max+.02*c.config.range:a<c.config.min&&(b=c.config.min-.02*c.config.range);var d=c.valueToDegrees(b)-90,e=c._currentRotation||d;return c._currentRotation=d,function(a){var b=e+(d-e)*a;return"translate("+c.config.cx+", "+c.config.cy+") rotate("+b+")"}})},this.valueToDegrees=function(a){return a/this.config.range*270-(this.config.min/this.config.range*270+45)},this.valueToRadians=function(a){return this.valueToDegrees(a)*Math.PI/180},this.valueToPoint=function(a,b){return{x:this.config.cx-this.config.raduis*b*Math.cos(this.valueToRadians(a)),y:this.config.cy-this.config.raduis*b*Math.sin(this.valueToRadians(a))}},this.configure(b)}(function(){var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.push,h=d.slice,i=d.concat,j=e.toString,k=e.hasOwnProperty,l=d.forEach,m=d.map,n=d.reduce,o=d.reduceRight,p=d.filter,q=d.every,r=d.some,s=d.indexOf,t=d.lastIndexOf,u=Array.isArray,v=Object.keys,w=f.bind,x=function(a){return a instanceof x?a:this instanceof x?void(this._wrapped=a):new x(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=x),exports._=x):a._=x,x.VERSION="1.5.2";var y=x.each=x.forEach=function(a,b,d){if(null!=a)if(l&&a.forEach===l)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;f>e;e++)if(b.call(d,a[e],e,a)===c)return}else for(var g=x.keys(a),e=0,f=g.length;f>e;e++)if(b.call(d,a[g[e]],g[e],a)===c)return};x.map=x.collect=function(a,b,c){var d=[];return null==a?d:m&&a.map===m?a.map(b,c):(y(a,function(a,e,f){d.push(b.call(c,a,e,f))}),d)};var z="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),n&&a.reduce===n)return d&&(b=x.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(y(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError(z);return c},x.reduceRight=x.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),o&&a.reduceRight===o)return d&&(b=x.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=a.length;if(f!==+f){var g=x.keys(a);f=g.length}if(y(a,function(h,i,j){i=g?g[--f]:--f,e?c=b.call(d,c,a[i],i,j):(c=a[i],e=!0)}),!e)throw new TypeError(z);return c},x.find=x.detect=function(a,b,c){var d;return A(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},x.filter=x.select=function(a,b,c){var d=[];return null==a?d:p&&a.filter===p?a.filter(b,c):(y(a,function(a,e,f){b.call(c,a,e,f)&&d.push(a)}),d)},x.reject=function(a,b,c){return x.filter(a,function(a,d,e){return!b.call(c,a,d,e)},c)},x.every=x.all=function(a,b,d){b||(b=x.identity);var e=!0;return null==a?e:q&&a.every===q?a.every(b,d):(y(a,function(a,f,g){return(e=e&&b.call(d,a,f,g))?void 0:c}),!!e)};var A=x.some=x.any=function(a,b,d){b||(b=x.identity);var e=!1;return null==a?e:r&&a.some===r?a.some(b,d):(y(a,function(a,f,g){return e||(e=b.call(d,a,f,g))?c:void 0}),!!e)};x.contains=x.include=function(a,b){return null==a?!1:s&&a.indexOf===s?-1!=a.indexOf(b):A(a,function(a){return a===b})},x.invoke=function(a,b){var c=h.call(arguments,2),d=x.isFunction(b);return x.map(a,function(a){return(d?b:a[b]).apply(a,c)})},x.pluck=function(a,b){return x.map(a,function(a){return a[b]})},x.where=function(a,b,c){return x.isEmpty(b)?c?void 0:[]:x[c?"find":"filter"](a,function(a){for(var c in b)if(b[c]!==a[c])return!1;return!0})},x.findWhere=function(a,b){return x.where(a,b,!0)},x.max=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.max.apply(Math,a);if(!b&&x.isEmpty(a))return-1/0;var d={computed:-1/0,value:-1/0};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>d.computed&&(d={value:a,computed:g})}),d.value},x.min=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.min.apply(Math,a);if(!b&&x.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})}),d.value},x.shuffle=function(a){var b,c=0,d=[];return y(a,function(a){b=x.random(c++),d[c-1]=d[b],d[b]=a}),d},x.sample=function(a,b,c){return arguments.length<2||c?a[x.random(a.length-1)]:x.shuffle(a).slice(0,Math.max(0,b))};var B=function(a){return x.isFunction(a)?a:function(b){return b[a]}};x.sortBy=function(a,b,c){var d=B(b);return x.pluck(x.map(a,function(a,b,e){return{value:a,index:b,criteria:d.call(c,a,b,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var C=function(a){return function(b,c,d){var e={},f=null==c?x.identity:B(c);return y(b,function(c,g){var h=f.call(d,c,g,b);a(e,h,c)}),e}};x.groupBy=C(function(a,b,c){(x.has(a,b)?a[b]:a[b]=[]).push(c)}),x.indexBy=C(function(a,b,c){a[b]=c}),x.countBy=C(function(a,b){x.has(a,b)?a[b]++:a[b]=1}),x.sortedIndex=function(a,b,c,d){c=null==c?x.identity:B(c);for(var e=c.call(d,b),f=0,g=a.length;g>f;){var h=f+g>>>1;c.call(d,a[h])<e?f=h+1:g=h}return f},x.toArray=function(a){return a?x.isArray(a)?h.call(a):a.length===+a.length?x.map(a,x.identity):x.values(a):[]},x.size=function(a){return null==a?0:a.length===+a.length?a.length:x.keys(a).length},x.first=x.head=x.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:h.call(a,0,b)},x.initial=function(a,b,c){return h.call(a,0,a.length-(null==b||c?1:b))},x.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:h.call(a,Math.max(a.length-b,0))},x.rest=x.tail=x.drop=function(a,b,c){return h.call(a,null==b||c?1:b)},x.compact=function(a){return x.filter(a,x.identity)};var D=function(a,b,c){return b&&x.every(a,x.isArray)?i.apply(c,a):(y(a,function(a){x.isArray(a)||x.isArguments(a)?b?g.apply(c,a):D(a,b,c):c.push(a)}),c)};x.flatten=function(a,b){return D(a,b,[])},x.without=function(a){return x.difference(a,h.call(arguments,1))},x.uniq=x.unique=function(a,b,c,d){x.isFunction(b)&&(d=c,c=b,b=!1);var e=c?x.map(a,c,d):a,f=[],g=[];return y(e,function(c,d){(b?d&&g[g.length-1]===c:x.contains(g,c))||(g.push(c),f.push(a[d]))}),f},x.union=function(){return x.uniq(x.flatten(arguments,!0))},x.intersection=function(a){var b=h.call(arguments,1);return x.filter(x.uniq(a),function(a){return x.every(b,function(b){return x.indexOf(b,a)>=0})})},x.difference=function(a){var b=i.apply(d,h.call(arguments,1));return x.filter(a,function(a){return!x.contains(b,a)})},x.zip=function(){for(var a=x.max(x.pluck(arguments,"length").concat(0)),b=new Array(a),c=0;a>c;c++)b[c]=x.pluck(arguments,""+c);return b},x.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},x.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=x.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}if(s&&a.indexOf===s)return a.indexOf(b,c);for(;e>d;d++)if(a[d]===b)return d;return-1},x.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=null!=c;if(t&&a.lastIndexOf===t)return d?a.lastIndexOf(b,c):a.lastIndexOf(b);for(var e=d?c:a.length;e--;)if(a[e]===b)return e;return-1},x.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);d>e;)f[e++]=a,a+=c;return f};var E=function(){};x.bind=function(a,b){var c,d;if(w&&a.bind===w)return w.apply(a,h.call(arguments,1));if(!x.isFunction(a))throw new TypeError;return c=h.call(arguments,2),d=function(){if(!(this instanceof d))return a.apply(b,c.concat(h.call(arguments)));E.prototype=a.prototype;var e=new E;E.prototype=null;var f=a.apply(e,c.concat(h.call(arguments)));return Object(f)===f?f:e}},x.partial=function(a){var b=h.call(arguments,1);return function(){return a.apply(this,b.concat(h.call(arguments)))}},x.bindAll=function(a){var b=h.call(arguments,1);if(0===b.length)throw new Error("bindAll must be passed function names");return y(b,function(b){a[b]=x.bind(a[b],a)}),a},x.memoize=function(a,b){var c={};return b||(b=x.identity),function(){var d=b.apply(this,arguments);return x.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},x.delay=function(a,b){var c=h.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},x.defer=function(a){return x.delay.apply(x,[a,1].concat(h.call(arguments,1)))},x.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:new Date,g=null,f=a.apply(d,e)};return function(){var j=new Date;h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k?(clearTimeout(g),g=null,h=j,f=a.apply(d,e)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},x.debounce=function(a,b,c){var d,e,f,g,h;return function(){f=this,e=arguments,g=new Date;var i=function(){var j=new Date-g;b>j?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e)))},j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e)),h}},x.once=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},x.wrap=function(a,b){return function(){var c=[a];return g.apply(c,arguments),b.apply(this,c)}},x.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},x.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},x.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)x.has(a,c)&&b.push(c);return b},x.values=function(a){for(var b=x.keys(a),c=b.length,d=new Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},x.pairs=function(a){for(var b=x.keys(a),c=b.length,d=new Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},x.invert=function(a){for(var b={},c=x.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},x.functions=x.methods=function(a){var b=[];for(var c in a)x.isFunction(a[c])&&b.push(c);return b.sort()},x.extend=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)a[c]=b[c]}),a},x.pick=function(a){var b={},c=i.apply(d,h.call(arguments,1));return y(c,function(c){c in a&&(b[c]=a[c])}),b},x.omit=function(a){var b={},c=i.apply(d,h.call(arguments,1));for(var e in a)x.contains(c,e)||(b[e]=a[e]);return b},x.defaults=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)void 0===a[c]&&(a[c]=b[c])}),a},x.clone=function(a){return x.isObject(a)?x.isArray(a)?a.slice():x.extend({},a):a},x.tap=function(a,b){return b(a),a};var F=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof x&&(a=a._wrapped),b instanceof x&&(b=b._wrapped);var e=j.call(a);if(e!=j.call(b))return!1;switch(e){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]==a)return d[f]==b;var g=a.constructor,h=b.constructor;if(g!==h&&!(x.isFunction(g)&&g instanceof g&&x.isFunction(h)&&h instanceof h))return!1;c.push(a),d.push(b);var i=0,k=!0;if("[object Array]"==e){if(i=a.length,k=i==b.length)for(;i--&&(k=F(a[i],b[i],c,d)););}else{for(var l in a)if(x.has(a,l)&&(i++,!(k=x.has(b,l)&&F(a[l],b[l],c,d))))break;if(k){for(l in b)if(x.has(b,l)&&!i--)break;k=!i}}return c.pop(),d.pop(),k};x.isEqual=function(a,b){return F(a,b,[],[])},x.isEmpty=function(a){if(null==a)return!0;if(x.isArray(a)||x.isString(a))return 0===a.length;for(var b in a)if(x.has(a,b))return!1;return!0},x.isElement=function(a){return!(!a||1!==a.nodeType)},x.isArray=u||function(a){return"[object Array]"==j.call(a)},x.isObject=function(a){return a===Object(a)},y(["Arguments","Function","String","Number","Date","RegExp"],function(a){x["is"+a]=function(b){return j.call(b)=="[object "+a+"]"}}),x.isArguments(arguments)||(x.isArguments=function(a){return!(!a||!x.has(a,"callee"))}),"function"!=typeof/./&&(x.isFunction=function(a){return"function"==typeof a}),x.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},x.isNaN=function(a){return x.isNumber(a)&&a!=+a},x.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==j.call(a)},x.isNull=function(a){return null===a},x.isUndefined=function(a){return void 0===a},x.has=function(a,b){return k.call(a,b)},x.noConflict=function(){return a._=b,this},x.identity=function(a){return a},x.times=function(a,b,c){for(var d=Array(Math.max(0,a)),e=0;a>e;e++)d[e]=b.call(c,e);return d},x.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))};var G={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};G.unescape=x.invert(G.escape);var H={escape:new RegExp("["+x.keys(G.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(G.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(a){x[a]=function(b){return null==b?"":(""+b).replace(H[a],function(b){return G[a][b]})}}),x.result=function(a,b){if(null==a)return void 0;var c=a[b];return x.isFunction(c)?c.call(a):c},x.mixin=function(a){y(x.functions(a),function(b){var c=x[b]=a[b];x.prototype[b]=function(){var a=[this._wrapped];return g.apply(a,arguments),M.call(this,c.apply(x,a))}})};var I=0;x.uniqueId=function(a){var b=++I+"";return a?a+b:b},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var J=/(.)^/,K={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(a,b,c){var d;c=x.defaults({},c,x.templateSettings);var e=new RegExp([(c.escape||J).source,(c.interpolate||J).source,(c.evaluate||J).source].join("|")+"|$","g"),f=0,g="__p+='";a.replace(e,function(b,c,d,e,h){return g+=a.slice(f,h).replace(L,function(a){return"\\"+K[a]}),c&&(g+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),d&&(g+="'+\n((__t=("+d+"))==null?'':__t)+\n'"),e&&(g+="';\n"+e+"\n__p+='"),f=h+b.length,b}),g+="';\n",c.variable||(g="with(obj||{}){\n"+g+"}\n"),g="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+g+"return __p;\n";try{d=new Function(c.variable||"obj","_",g)}catch(h){throw h.source=g,h}if(b)return d(b,x);var i=function(a){return d.call(this,a,x)};return i.source="function("+(c.variable||"obj")+"){\n"+g+"}",i},x.chain=function(a){return x(a).chain()};var M=function(a){return this._chain?x(a).chain():a};x.mixin(x),y(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];x.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!=a&&"splice"!=a||0!==c.length||delete c[0],M.call(this,c)}}),y(["concat","join","slice"],function(a){var b=d[a];x.prototype[a]=function(){return M.call(this,b.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this),function(a,b){"use strict";function c(){function a(a,c){return b.extend(new(b.extend(function(){},{prototype:a})),c)}function c(a,b){var c=b.caseInsensitiveMatch,d={originalPath:a,regexp:a},e=d.keys=[];return a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(a,b,c,d){var f="?"===d?d:null,g="*"===d?d:null;return e.push({name:c,optional:!!f}),b=b||"",""+(f?"":b)+"(?:"+(f?b:"")+(g&&"(.+?)"||"([^/]+)")+(f||"")+")"+(f||"")}).replace(/([\/$\*])/g,"\\$1"),d.regexp=new RegExp("^"+a+"$",c?"i":""),d}var d={};this.when=function(a,e){if(d[a]=b.extend({reloadOnSearch:!0},e,a&&c(a,e)),a){var f="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";d[f]=b.extend({redirectTo:a},c(f,e))}return this},this.otherwise=function(a){return this.when(null,a),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce",function(c,e,f,g,h,i,j,k){function l(a,b){var c=b.keys,d={};if(!b.regexp)return null;var e=b.regexp.exec(a);if(!e)return null;for(var f=1,g=e.length;g>f;++f){var h=c[f-1],i="string"==typeof e[f]?decodeURIComponent(e[f]):e[f];h&&i&&(d[h.name]=i)}return d}function m(){var a=n(),d=q.current;a&&d&&a.$$route===d.$$route&&b.equals(a.pathParams,d.pathParams)&&!a.reloadOnSearch&&!p?(d.params=a.params,b.copy(d.params,f),c.$broadcast("$routeUpdate",d)):(a||d)&&(p=!1,c.$broadcast("$routeChangeStart",a,d),q.current=a,a&&a.redirectTo&&(b.isString(a.redirectTo)?e.path(o(a.redirectTo,a.params)).search(a.params).replace():e.url(a.redirectTo(a.pathParams,e.path(),e.search())).replace()),g.when(a).then(function(){if(a){var c,d,e=b.extend({},a.resolve);return b.forEach(e,function(a,c){e[c]=b.isString(a)?h.get(a):h.invoke(a)}),b.isDefined(c=a.template)?b.isFunction(c)&&(c=c(a.params)):b.isDefined(d=a.templateUrl)&&(b.isFunction(d)&&(d=d(a.params)),d=k.getTrustedResourceUrl(d),b.isDefined(d)&&(a.loadedTemplateUrl=d,c=i.get(d,{cache:j}).then(function(a){return a.data}))),b.isDefined(c)&&(e.$template=c),g.all(e)}}).then(function(e){a==q.current&&(a&&(a.locals=e,b.copy(a.params,f)),c.$broadcast("$routeChangeSuccess",a,d))},function(b){a==q.current&&c.$broadcast("$routeChangeError",a,d,b)}))}function n(){var c,f;return b.forEach(d,function(d){!f&&(c=l(e.path(),d))&&(f=a(d,{params:b.extend({},e.search(),c),pathParams:c}),f.$$route=d)}),f||d[null]&&a(d[null],{params:{},pathParams:{}})}function o(a,c){var d=[];return b.forEach((a||"").split(":"),function(a,b){if(0===b)d.push(a);else{var e=a.match(/(\w+)(.*)/),f=e[1];d.push(c[f]),d.push(e[2]||""),delete c[f]}}),d.join("")}var p=!1,q={routes:d,reload:function(){p=!0,c.$evalAsync(m)}};return c.$on("$locationChangeSuccess",m),q}]}function d(){this.$get=function(){return{}}}function e(a,c,d){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(e,f,g,h,i){function j(){n&&(n.remove(),n=null),l&&(l.$destroy(),l=null),m&&(d.leave(m,function(){n=null}),n=m,m=null)}function k(){var g=a.current&&a.current.locals,h=g&&g.$template;if(b.isDefined(h)){var k=e.$new(),n=a.current,q=i(k,function(a){d.enter(a,null,m||f,function(){!b.isDefined(o)||o&&!e.$eval(o)||c()}),j()});m=q,l=n.scope=k,l.$emit("$viewContentLoaded"),l.$eval(p)}else j()}var l,m,n,o=g.autoscroll,p=g.onload||"";e.$on("$routeChangeSuccess",k),k()}}}function f(a,b,c){return{restrict:"ECA",priority:-400,link:function(d,e){var f=c.current,g=f.locals;e.html(g.$template);var h=a(e.contents());if(f.controller){g.$scope=d;var i=b(f.controller,g);f.controllerAs&&(d[f.controllerAs]=i),e.data("$ngControllerController",i),e.children().data("$ngControllerController",i)}h(d)}}}var g=b.module("ngRoute",["ng"]).provider("$route",c);g.provider("$routeParams",d),g.directive("ngView",e),g.directive("ngView",f),e.$inject=["$route","$anchorScroll","$animate"],f.$inject=["$compile","$controller","$route"]}(window,window.angular),function(a,b,c){"use strict";function d(a){return null!=a&&""!==a&&"hasOwnProperty"!==a&&h.test("."+a)}function e(a,b){if(!d(b))throw g("badmember",'Dotted member path "@{0}" is invalid.',b);for(var e=b.split("."),f=0,h=e.length;h>f&&a!==c;f++){var i=e[f];a=null!==a?a[i]:c}return a}function f(a,c){c=c||{},b.forEach(c,function(a,b){delete c[b]});for(var d in a)!a.hasOwnProperty(d)||"$"===d.charAt(0)&&"$"===d.charAt(1)||(c[d]=a[d]);return c}var g=b.$$minErr("$resource"),h=/^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;b.module("ngResource",["ng"]).factory("$resource",["$http","$q",function(a,d){function h(a){return i(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function i(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,b?"%20":"+")}function j(a,b){this.template=a,this.defaults=b||{},this.urlParams={}}function k(h,i,r){function s(a,b){var c={};return b=o({},i,b),n(b,function(b,d){q(b)&&(b=b()),c[d]=b&&b.charAt&&"@"==b.charAt(0)?e(a,b.substr(1)):b}),c}function t(a){return a.resource}function u(a){f(a||{},this)}var v=new j(h);return r=o({},l,r),n(r,function(e,h){var i=/^(POST|PUT|PATCH)$/i.test(e.method);u[h]=function(h,j,k,l){var r,w,x,y={};switch(arguments.length){case 4:x=l,w=k;case 3:case 2:if(!q(j)){y=h,r=j,w=k;break}if(q(h)){w=h,x=j;break}w=j,x=k;case 1:q(h)?w=h:i?r=h:y=h;break;case 0:break;default:throw g("badargs","Expected up to 4 arguments [params, data, success, error], got {0} arguments",arguments.length)}var z=this instanceof u,A=z?r:e.isArray?[]:new u(r),B={},C=e.interceptor&&e.interceptor.response||t,D=e.interceptor&&e.interceptor.responseError||c;n(e,function(a,b){"params"!=b&&"isArray"!=b&&"interceptor"!=b&&(B[b]=p(a))}),i&&(B.data=r),v.setUrlParams(B,o({},s(r,e.params||{}),y),e.url);var E=a(B).then(function(a){var c=a.data,d=A.$promise;if(c){if(b.isArray(c)!==!!e.isArray)throw g("badcfg","Error in resource configuration. Expected response to contain an {0} but got an {1}",e.isArray?"array":"object",b.isArray(c)?"array":"object");e.isArray?(A.length=0,n(c,function(a){A.push(new u(a))})):(f(c,A),A.$promise=d)}return A.$resolved=!0,a.resource=A,a},function(a){return A.$resolved=!0,(x||m)(a),d.reject(a)});return E=E.then(function(a){var b=C(a);return(w||m)(b,a.headers),b},D),z?E:(A.$promise=E,A.$resolved=!1,A)},u.prototype["$"+h]=function(a,b,c){q(a)&&(c=b,b=a,a={});var d=u[h].call(this,a,this,b,c);return d.$promise||d}}),u.bind=function(a){return k(h,o({},i,a),r)},u}var l={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}},m=b.noop,n=b.forEach,o=b.extend,p=b.copy,q=b.isFunction;return j.prototype={setUrlParams:function(a,c,d){var e,f,i=this,j=d||i.template,k=i.urlParams={};n(j.split(/\W/),function(a){if("hasOwnProperty"===a)throw g("badname","hasOwnProperty is not a valid parameter name.");!new RegExp("^\\d+$").test(a)&&a&&new RegExp("(^|[^\\\\]):"+a+"(\\W|$)").test(j)&&(k[a]=!0)}),j=j.replace(/\\:/g,":"),c=c||{},n(i.urlParams,function(a,d){e=c.hasOwnProperty(d)?c[d]:i.defaults[d],b.isDefined(e)&&null!==e?(f=h(e),j=j.replace(new RegExp(":"+d+"(\\W|$)","g"),function(a,b){return f+b})):j=j.replace(new RegExp("(/?):"+d+"(\\W|$)","g"),function(a,b,c){return"/"==c.charAt(0)?c:b+c})}),j=j.replace(/\/+$/,"")||"/",j=j.replace(/\/\.(?=\w+($|\?))/,"."),a.url=j.replace(/\/\\\./,"/."),n(c,function(b,c){i.urlParams[c]||(a.params=a.params||{},a.params[c]=b)})}},k}])}(window,window.angular),function(a,b,c){"use strict";b.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(a,d){function e(){var a,e,f,i;for(a in h)k(g[a])&&d.cookies(a,c);for(a in g)e=g[a],b.isString(e)||(e=""+e,g[a]=e),e!==h[a]&&(d.cookies(a,e),i=!0);if(i){i=!1,f=d.cookies();for(a in g)g[a]!==f[a]&&(k(f[a])?delete g[a]:g[a]=f[a],i=!0)}}var f,g={},h={},i=!1,j=b.copy,k=b.isUndefined;return d.addPollFn(function(){var b=d.cookies();f!=b&&(f=b,j(b,h),j(b,g),i&&a.$apply())})(),i=!0,a.$watch(e),g}]).factory("$cookieStore",["$cookies",function(a){return{get:function(c){var d=a[c];return d?b.fromJson(d):d},put:function(c,d){a[c]=b.toJson(d)},remove:function(b){delete a[b]}}}])}(window,window.angular),function(a,b){"use strict";function c(){this.$get=["$$sanitizeUri",function(a){return function(b){var c=[];return f(b,i(c,function(b,c){return!/^unsafe/.test(a(b,c))})),c.join("")}}]}function d(a){var c=[],d=i(c,b.noop);return d.chars(a),c.join("")}function e(a){var b,c={},d=a.split(",");for(b=0;b<d.length;b++)c[d[b]]=!0;return c}function f(a,c){function d(a,d,f,h){if(d=b.lowercase(d),x[d])for(;s.last()&&y[s.last()];)e("",s.last());w[d]&&s.last()==d&&e("",d),h=t[d]||!!h,h||s.push(d);var i={};f.replace(m,function(a,b,c,d,e){var f=c||d||e||"";i[b]=g(f)}),c.start&&c.start(d,i,h)}function e(a,d){var e,f=0;if(d=b.lowercase(d))for(f=s.length-1;f>=0&&s[f]!=d;f--);if(f>=0){for(e=s.length-1;e>=f;e--)c.end&&c.end(s[e]);s.length=f}}var f,h,i,s=[],u=a;for(s.last=function(){return s[s.length-1]};a;){if(h=!0,s.last()&&z[s.last()])a=a.replace(new RegExp("(.*)<\\s*\\/\\s*"+s.last()+"[^>]*>","i"),function(a,b){return b=b.replace(p,"$1").replace(r,"$1"),c.chars&&c.chars(g(b)),""}),e("",s.last());else if(0===a.indexOf("<!--")?(f=a.indexOf("--",4),f>=0&&a.lastIndexOf("-->",f)===f&&(c.comment&&c.comment(a.substring(4,f)),a=a.substring(f+3),h=!1)):q.test(a)?(i=a.match(q),i&&(a=a.replace(i[0],""),h=!1)):o.test(a)?(i=a.match(l),i&&(a=a.substring(i[0].length),i[0].replace(l,e),h=!1)):n.test(a)&&(i=a.match(k),i&&(a=a.substring(i[0].length),i[0].replace(k,d),h=!1)),h){f=a.indexOf("<");var v=0>f?a:a.substring(0,f);a=0>f?"":a.substring(f),c.chars&&c.chars(g(v))}if(a==u)throw j("badparse","The sanitizer was unable to parse the following block of html: {0}",a);u=a}e()}function g(a){if(!a)return"";var b=E.exec(a),c=b[1],d=b[3],e=b[2];return e&&(D.innerHTML=e.replace(/</g,"&lt;"),e="textContent"in D?D.textContent:D.innerText),c+e+d}function h(a){return a.replace(/&/g,"&amp;").replace(s,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function i(a,c){var d=!1,e=b.bind(a,a.push);return{start:function(a,f,g){a=b.lowercase(a),!d&&z[a]&&(d=a),d||A[a]!==!0||(e("<"),e(a),b.forEach(f,function(d,f){var g=b.lowercase(f),i="img"===a&&"src"===g||"background"===g;C[g]!==!0||B[g]===!0&&!c(d,i)||(e(" "),e(f),e('="'),e(h(d)),e('"'))}),e(g?"/>":">"))},end:function(a){a=b.lowercase(a),d||A[a]!==!0||(e("</"),e(a),e(">")),a==d&&(d=!1)},chars:function(a){d||e(h(a))}}}var j=b.$$minErr("$sanitize"),k=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,l=/^<\s*\/\s*([\w:-]+)[^>]*>/,m=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,n=/^</,o=/^<\s*\//,p=/<!--(.*?)-->/g,q=/<!DOCTYPE([^>]*?)>/i,r=/<!\[CDATA\[(.*?)]]>/g,s=/([^\#-~| |!])/g,t=e("area,br,col,hr,img,wbr"),u=e("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),v=e("rp,rt"),w=b.extend({},v,u),x=b.extend({},u,e("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),y=b.extend({},v,e("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),z=e("script,style"),A=b.extend({},t,x,y,w),B=e("background,cite,href,longdesc,src,usemap"),C=b.extend({},B,e("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,target,title,type,valign,value,vspace,width")),D=document.createElement("pre"),E=/^(\s*)([\s\S]*?)(\s*)$/;b.module("ngSanitize",[]).provider("$sanitize",c),b.module("ngSanitize").filter("linky",["$sanitize",function(a){var c=/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>]/,e=/^mailto:/;return function(f,g){function h(a){a&&n.push(d(a))}function i(a,c){n.push("<a "),b.isDefined(g)&&(n.push('target="'),n.push(g),n.push('" ')),n.push('href="'),n.push(a),n.push('">'),h(c),n.push("</a>")}if(!f)return f;for(var j,k,l,m=f,n=[];j=m.match(c);)k=j[0],j[2]==j[3]&&(k="mailto:"+k),l=j.index,h(m.substr(0,l)),i(k,j[0].replace(e,"")),m=m.substring(l+j[0].length);return h(m),a(n.join(""))}}])}(window,window.angular),function(){var a=angular.module("restangular",[]);a.provider("Restangular",function(){var a={};a.init=function(a,b){function c(a,b,c,d){var e={};return _.each(_.keys(d),function(f){var g=d[f];g.params=_.extend({},g.params,a.defaultRequestParams[g.method.toLowerCase()]),_.isEmpty(g.params)&&delete g.params,e[f]=a.isSafe(g.method)?function(){return b(_.extend(g,{url:c}))}:function(a){return b(_.extend(g,{url:c,data:a}))}}),e}a.configuration=b;var d=["get","head","options","trace","getlist"];b.isSafe=function(a){return _.contains(d,a.toLowerCase())
  };var e=/^https?:\/\//i;b.isAbsoluteUrl=function(a){return a&&e.test(a)},b.baseUrl=_.isUndefined(b.baseUrl)?"":b.baseUrl,a.setBaseUrl=function(a){return b.baseUrl=/\/$/.test(a)?a.substring(0,a.length-1):a,this},b.extraFields=b.extraFields||[],a.setExtraFields=function(a){return b.extraFields=a,this},b.defaultHttpFields=b.defaultHttpFields||{},a.setDefaultHttpFields=function(a){return b.defaultHttpFields=a,this},b.withHttpValues=function(a,c){return _.defaults(c,a,b.defaultHttpFields)},b.encodeIds=_.isUndefined(b.encodeIds)?!0:b.encodeIds,a.setEncodeIds=function(a){b.encodeIds=a},b.defaultRequestParams=b.defaultRequestParams||{get:{},post:{},put:{},remove:{},common:{}},a.setDefaultRequestParams=function(a,c){var d=[],e=c||a;return _.isUndefined(c)?d.push("common"):_.isArray(a)?d=a:d.push(a),_.each(d,function(a){b.defaultRequestParams[a]=e}),this},a.requestParams=b.defaultRequestParams,b.defaultHeaders=b.defaultHeaders||{},a.setDefaultHeaders=function(c){return b.defaultHeaders=c,a.defaultHeaders=b.defaultHeaders,this},a.defaultHeaders=b.defaultHeaders,b.methodOverriders=b.methodOverriders||[],a.setMethodOverriders=function(a){var c=_.extend([],a);return b.isOverridenMethod("delete",c)&&c.push("remove"),b.methodOverriders=c,this},b.isOverridenMethod=function(a,c){var d=c||b.methodOverriders;return!_.isUndefined(_.find(d,function(b){return b.toLowerCase()===a.toLowerCase()}))},b.urlCreator=b.urlCreator||"path",a.setUrlCreator=function(a){if(!_.has(b.urlCreatorFactory,a))throw new Error("URL Path selected isn't valid");return b.urlCreator=a,this},b.restangularFields=b.restangularFields||{id:"id",route:"route",parentResource:"parentResource",restangularCollection:"restangularCollection",cannonicalId:"__cannonicalId",etag:"restangularEtag",selfLink:"href",get:"get",getList:"getList",put:"put",post:"post",remove:"remove",head:"head",trace:"trace",options:"options",patch:"patch",getRestangularUrl:"getRestangularUrl",getRequestedUrl:"getRequestedUrl",putElement:"putElement",addRestangularMethod:"addRestangularMethod",getParentList:"getParentList",clone:"clone",ids:"ids",httpConfig:"_$httpConfig",reqParams:"reqParams"},a.setRestangularFields=function(a){return b.restangularFields=_.extend(b.restangularFields,a),this},b.setFieldToElem=function(a,b,c){var d=a.split("."),e=b;return _.each(_.initial(d),function(a){e[a]={},e=e[a]}),e[_.last(d)]=c,this},b.getFieldFromElem=function(a,b){var c=a.split("."),d=angular.copy(b);return _.each(c,function(a){d&&(d=d[a])}),d},b.setIdToElem=function(a,c){return b.setFieldToElem(b.restangularFields.id,a,c),this},b.getIdFromElem=function(a){return b.getFieldFromElem(b.restangularFields.id,a)},b.isValidId=function(a){return""!==a&&!_.isUndefined(a)&&!_.isNull(a)},b.setUrlToElem=function(a,c){return b.setFieldToElem(b.restangularFields.selfLink,a,c),this},b.getUrlFromElem=function(a){return b.getFieldFromElem(b.restangularFields.selfLink,a)},b.useCannonicalId=_.isUndefined(b.useCannonicalId)?!1:b.useCannonicalId,a.setUseCannonicalId=function(a){return b.useCannonicalId=a,this},b.getCannonicalIdFromElem=function(a){var c=a[b.restangularFields.cannonicalId],d=b.isValidId(c)?c:b.getIdFromElem(a);return d},b.responseExtractor=b.responseExtractor||function(a){return a},a.setResponseExtractor=function(a){return b.responseExtractor=a,this},a.setResponseInterceptor=a.setResponseExtractor,b.fullRequestInterceptor=b.fullRequestInterceptor||function(a,b,c,d,e,f,g){return{element:a,headers:e,params:f,httpConfig:g}},a.setRequestInterceptor=function(a){return b.fullRequestInterceptor=function(b,c,d,e,f,g,h){return{headers:f,params:g,element:a(b,c,d,e),httpConfig:h}},this},a.setFullRequestInterceptor=function(a){return b.fullRequestInterceptor=a,this},b.errorInterceptor=b.errorInterceptor||function(){},a.setErrorInterceptor=function(a){return b.errorInterceptor=a,this},b.onBeforeElemRestangularized=b.onBeforeElemRestangularized||function(a){return a},a.setOnBeforeElemRestangularized=function(a){return b.onBeforeElemRestangularized=a,this},b.onElemRestangularized=b.onElemRestangularized||function(a){return a},a.setOnElemRestangularized=function(a){return b.onElemRestangularized=a,this},a.setListTypeIsArray=function(){},b.shouldSaveParent=b.shouldSaveParent||function(){return!0},a.setParentless=function(a){return _.isArray(a)?b.shouldSaveParent=function(b){return!_.contains(a,b)}:_.isBoolean(a)&&(b.shouldSaveParent=function(){return!a}),this},b.suffix=_.isUndefined(b.suffix)?null:b.suffix,a.setRequestSuffix=function(a){return b.suffix=a,this},b.transformers=b.transformers||{},a.addElementTransformer=function(a,c,d){var e=null,f=null;2===arguments.length?f=c:(f=d,e=c);var g=b.transformers[a];g||(g=b.transformers[a]=[]),g.push(function(a,b){return _.isNull(e)||a==e?f(b):b})},a.extendCollection=function(b,c){return a.addElementTransformer(b,!0,c)},a.extendModel=function(b,c){return a.addElementTransformer(b,!1,c)},b.transformElem=function(a,c,d,e){var f=b.transformers[d],g=a;return f&&_.each(f,function(a){g=a(c,g)}),b.onElemRestangularized(g,c,d,e)},b.fullResponse=_.isUndefined(b.fullResponse)?!1:b.fullResponse,a.setFullResponse=function(a){return b.fullResponse=a,this},b.urlCreatorFactory={};var f=function(){};f.prototype.setConfig=function(a){return this.config=a,this},f.prototype.parentsArray=function(a){for(var b=[];a;)b.push(a),a=a[this.config.restangularFields.parentResource];return b.reverse()},f.prototype.resource=function(a,d,e,f,g,h,i,j){var k=_.defaults(g||{},this.config.defaultRequestParams.common),l=_.defaults(f||{},this.config.defaultHeaders);i&&(b.isSafe(j)?l["If-None-Match"]=i:l["If-Match"]=i);var m=this.base(a);if(h){var n="";/\/$/.test(m)||(n+="/"),n+=h,m+=n}return this.config.suffix&&-1===m.indexOf(this.config.suffix,m.length-this.config.suffix.length)&&(m+=this.config.suffix),a[this.config.restangularFields.httpConfig]=void 0,c(this.config,d,m,{getList:this.config.withHttpValues(e,{method:"GET",params:k,headers:l}),get:this.config.withHttpValues(e,{method:"GET",params:k,headers:l}),put:this.config.withHttpValues(e,{method:"PUT",params:k,headers:l}),post:this.config.withHttpValues(e,{method:"POST",params:k,headers:l}),remove:this.config.withHttpValues(e,{method:"DELETE",params:k,headers:l}),head:this.config.withHttpValues(e,{method:"HEAD",params:k,headers:l}),trace:this.config.withHttpValues(e,{method:"TRACE",params:k,headers:l}),options:this.config.withHttpValues(e,{method:"OPTIONS",params:k,headers:l}),patch:this.config.withHttpValues(e,{method:"PATCH",params:k,headers:l})})};var g=function(){};g.prototype=new f,g.prototype.base=function(a){var c=this;return _.reduce(this.parentsArray(a),function(a,d){var e,f=c.config.getUrlFromElem(d);if(f){if(c.config.isAbsoluteUrl(f))return f;e=f}else if(e=d[c.config.restangularFields.route],d[c.config.restangularFields.restangularCollection]){var g=d[c.config.restangularFields.ids];g&&(e+="/"+g.join(","))}else{var h;h=c.config.useCannonicalId?c.config.getCannonicalIdFromElem(d):c.config.getIdFromElem(d),b.isValidId(h)&&(e+="/"+(c.config.encodeIds?encodeURIComponent(h):h))}return a+"/"+e},this.config.baseUrl)},g.prototype.fetchUrl=function(a,b){var c=this.base(a);return b&&(c+="/"+b),c},g.prototype.fetchRequestedUrl=function(a,c){function d(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b.sort()}function e(a,b,c){for(var e=d(a),f=0;f<e.length;f++)b.call(c,a[e[f]],e[f]);return e}function f(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,b?"%20":"+")}var g=this.fetchUrl(a,c),h=a[b.restangularFields.reqParams];if(!h)return g;var i=[];return e(h,function(a,b){null!=a&&void 0!=a&&(angular.isArray(a)||(a=[a]),angular.forEach(a,function(a){angular.isObject(a)&&(a=angular.toJson(a)),i.push(f(b)+"="+f(a))}))}),g+(-1===g.indexOf("?")?"?":"&")+i.join("&")},b.urlCreatorFactory.path=g};var b={};a.init(this,b),this.$get=["$http","$q",function(c,d){function e(f){function g(a,b,c,d){if(b[f.restangularFields.route]=c,b[f.restangularFields.getRestangularUrl]=_.bind(N.fetchUrl,N,b),b[f.restangularFields.getRequestedUrl]=_.bind(N.fetchRequestedUrl,N,b),b[f.restangularFields.addRestangularMethod]=_.bind(K,b),b[f.restangularFields.clone]=_.bind(s,b,b),b[f.restangularFields.reqParams]=_.isEmpty(d)?null:d,b.withHttpConfig=_.bind(z,b),b.one=_.bind(h,b,b),b.all=_.bind(i,b,b),b.several=_.bind(j,b,b),b.oneUrl=_.bind(k,b,b),b.allUrl=_.bind(l,b,b),a&&f.shouldSaveParent(c)){var e=f.getIdFromElem(a),g=f.getUrlFromElem(a),m=_.union(_.values(_.pick(f.restangularFields,["route","parentResource"])),f.extraFields),n=_.pick(a,m);f.isValidId(e)&&f.setIdToElem(n,e),f.isValidId(g)&&f.setUrlToElem(n,g),b[f.restangularFields.parentResource]=n}else b[f.restangularFields.parentResource]=null;return b}function h(a,b,c){var d={};return f.setIdToElem(d,c),t(a,d,b)}function i(a,b){return u(a,[],b,!0)}function j(a,b){var c=[];return c[f.restangularFields.ids]=Array.prototype.splice.call(arguments,2),u(a,c,b,!0)}function k(a,b,c){var d={};return f.setUrlToElem(d,c),t(a,d,b)}function l(a,b,c){var d={};return f.setUrlToElem(d,c),u(a,d,b,!0)}function m(a,b){return a.call=_.bind(n,a),a.get=_.bind(o,a),a[f.restangularFields.restangularCollection]=b,b&&(a.push=_.bind(n,a,"push")),a}function n(a){var b=d.defer(),c=arguments;return this.then(function(d){var e=Array.prototype.slice.call(c,1),f=d[a];f.apply(d,e),b.resolve(d)}),m(b.promise,this[f.restangularFields.restangularCollection])}function o(a){var b=d.defer();return this.then(function(c){b.resolve(c[a])}),m(b.promise,this[f.restangularFields.restangularCollection])}function p(a,b,c){return f.fullResponse?a.resolve(_.extend(b,{data:c})):void a.resolve(c)}function q(a){return _.isArray(a)?_.without(a,_.values(_.omit(f.restangularFields,"id"))):_.omit(a,_.values(_.omit(f.restangularFields,"id")))}function r(a){a.customOperation=_.bind(J,a),_.each(["put","post","get","delete"],function(b){_.each(["do","custom"],function(c){var d,e="delete"===b?"remove":b,f=c+b.toUpperCase();d="put"!==e&&"post"!==e?J:function(a,b,c,d,e){return _.bind(J,this)(a,c,d,e,b)},a[f]=_.bind(d,a,e)})}),a.customGETLIST=_.bind(y,a),a.doGETLIST=a.customGETLIST}function s(a){var b=angular.copy(a);return t(b[f.restangularFields.parentResource],b,b[f.restangularFields.route])}function t(a,b,c,d,e){var h=f.onBeforeElemRestangularized(b,!1,c),i=g(a,h,c,e);return f.useCannonicalId&&(i[f.restangularFields.cannonicalId]=f.getIdFromElem(i)),d&&(i[f.restangularFields.getParentList]=function(){return d}),i[f.restangularFields.restangularCollection]=!1,i[f.restangularFields.get]=_.bind(B,i),i[f.restangularFields.getList]=_.bind(y,i),i[f.restangularFields.put]=_.bind(D,i),i[f.restangularFields.post]=_.bind(E,i),i[f.restangularFields.remove]=_.bind(C,i),i[f.restangularFields.head]=_.bind(F,i),i[f.restangularFields.trace]=_.bind(G,i),i[f.restangularFields.options]=_.bind(H,i),i[f.restangularFields.patch]=_.bind(I,i),r(i),f.transformElem(i,!1,c,M)}function u(a,b,c,d){var e=f.onBeforeElemRestangularized(b,!0,c),h=g(a,e,c,d);return h[f.restangularFields.restangularCollection]=!0,h[f.restangularFields.post]=_.bind(E,h,null),h[f.restangularFields.head]=_.bind(F,h),h[f.restangularFields.trace]=_.bind(G,h),h[f.restangularFields.putElement]=_.bind(w,h),h[f.restangularFields.options]=_.bind(H,h),h[f.restangularFields.patch]=_.bind(I,h),h[f.restangularFields.get]=_.bind(v,h),h[f.restangularFields.getList]=_.bind(y,h,null),r(h),f.transformElem(h,!0,c,M)}function v(a,b,c){return this.customGET(a.toString(),b,c)}function w(a,b,c){var e=this,f=this[a],g=d.defer();return f.put(b,c).then(function(b){var c=s(e);c[a]=b,g.resolve(c)},function(a){g.reject(a)}),m(g.promise,!0)}function x(a,b,c,d,e,g){var h=f.responseExtractor(a,b,c,d,e,g),i=e.headers("ETag");return h&&i&&(h[f.restangularFields.etag]=i),h}function y(a,b,e){var g=this,h=d.defer(),i="getList",j=N.fetchUrl(this,a),k=a||g[f.restangularFields.route],l=f.fullRequestInterceptor(null,i,k,j,e||{},b||{},this[f.restangularFields.httpConfig]||{});return N.resource(this,c,l.httpConfig,l.headers,l.params,a,this[f.restangularFields.etag],i).getList().then(function(b){var c=b.data,d=b.config.params,e=x(c,i,k,j,b,h),l=_.map(e,function(b){return g[f.restangularFields.restangularCollection]?t(g[f.restangularFields.parentResource],b,g[f.restangularFields.route],e):t(g,b,a,e)});l=_.extend(e,l),g[f.restangularFields.restangularCollection]?p(h,b,u(g[f.restangularFields.parentResource],l,g[f.restangularFields.route],d)):p(h,b,u(g,l,a,d))},function(a){f.errorInterceptor(a)!==!1&&h.reject(a)}),m(h.promise,!0)}function z(a){return this[f.restangularFields.httpConfig]=a,this}function A(a,b,e,g,h){var i=this,j=d.defer(),k=e||{},l=b||this[f.restangularFields.route],n=N.fetchUrl(this,b),o=g||this,r=o[f.restangularFields.etag];_.isObject(o)&&(o=q(o));var s=f.fullRequestInterceptor(o,a,l,n,h||{},k||{},this[f.restangularFields.httpConfig]||{}),u=function(c){var d=c.data,e=c.config.params,g=x(d,a,l,n,c,j);g?"post"!==a||i[f.restangularFields.restangularCollection]?p(j,c,t(i[f.restangularFields.parentResource],g,i[f.restangularFields.route],e)):p(j,c,t(i,g,b,e)):p(j,c,void 0)},v=function(a){f.errorInterceptor(a)!==!1&&j.reject(a)},w=a,y=_.extend({},s.headers),z=f.isOverridenMethod(a);return z&&(w="post",y=_.extend(y,{"X-HTTP-Method-Override":"remove"===a?"DELETE":a})),f.isSafe(a)?z?N.resource(this,c,s.httpConfig,y,s.params,b,r,w)[w]({}).then(u,v):N.resource(this,c,s.httpConfig,y,s.params,b,r,w)[w]().then(u,v):N.resource(this,c,s.httpConfig,y,s.params,b,r,w)[w](s.element).then(u,v),m(j.promise)}function B(a,b){return _.bind(A,this)("get",void 0,a,void 0,b)}function C(a,b){return _.bind(A,this)("remove",void 0,a,void 0,b)}function D(a,b){return _.bind(A,this)("put",void 0,a,void 0,b)}function E(a,b,c,d){return _.bind(A,this)("post",a,c,b,d)}function F(a,b){return _.bind(A,this)("head",void 0,a,void 0,b)}function G(a,b){return _.bind(A,this)("trace",void 0,a,void 0,b)}function H(a,b){return _.bind(A,this)("options",void 0,a,void 0,b)}function I(a,b,c){return _.bind(A,this)("patch",void 0,b,a,c)}function J(a,b,c,d,e){return _.bind(A,this)(a,b,c,e,d)}function K(a,b,c,d,e,g){var h;h="getList"===b?_.bind(y,this,c):_.bind(J,this,b,c);var i=function(a,b,c){var f=_.defaults({params:a,headers:b,elem:c},{params:d,headers:e,elem:g});return h(f.params,f.headers,f.elem)};this[a]=f.isSafe(b)?i:function(a,b,c){return i(b,c,a)}}function L(c){var d=angular.copy(b);return a.init(d,d),c(d),e(d)}var M={},N=new f.urlCreatorFactory[f.urlCreator];return N.setConfig(f),a.init(M,f),M.copy=_.bind(s,M),M.withConfig=_.bind(L,M),M.one=_.bind(h,M,null),M.all=_.bind(i,M,null),M.several=_.bind(j,M,null),M.oneUrl=_.bind(k,M,null),M.allUrl=_.bind(l,M,null),M.restangularizeElement=_.bind(t,M),M.restangularizeCollection=_.bind(u,M),M}return e(b)}]})}(),function(a,b){"use strict";var c=6,d=4,e="asc",f="desc",g="_ng_field_",h="_ng_depth_",i="_ng_hidden_",j="_ng_column_",k=/CUSTOM_FILTERS/g,l=/COL_FIELD/g,m=/DISPLAY_CELL_TEMPLATE/g,n=/EDITABLE_CELL_TEMPLATE/g,o=/CELL_EDITABLE_CONDITION/g,p=/<.+>/;a.ngGrid={},a.ngGrid.i18n={};var q=(angular.module("ngGrid.services",[]),angular.module("ngGrid.directives",[])),r=angular.module("ngGrid.filters",[]);angular.module("ngGrid",["ngGrid.services","ngGrid.directives","ngGrid.filters"]);var s=function(a,b,d,e){if(void 0===a.selectionProvider.selectedItems)return!0;var f,g=d.which||d.keyCode,h=!1,i=!1,j=void 0===a.selectionProvider.lastClickedRow?1:a.selectionProvider.lastClickedRow.rowIndex,k=a.columns.filter(function(a){return a.visible}),l=a.columns.filter(function(a){return a.pinned});if(a.col&&(f=k.indexOf(a.col)),37!==g&&38!==g&&39!==g&&40!==g&&(e.config.noTabInterference||9!==g)&&13!==g)return!0;if(a.enableCellSelection){9===g&&d.preventDefault();var m=a.showSelectionCheckbox?1===a.col.index:0===a.col.index,n=1===a.$index||0===a.$index,o=a.$index===a.renderedColumns.length-1||a.$index===a.renderedColumns.length-2,p=k.indexOf(a.col)===k.length-1,q=l.indexOf(a.col)===l.length-1;if(37===g||9===g&&d.shiftKey){var r=0;m||(f-=1),n?m&&9===g&&d.shiftKey?(r=e.$canvas.width(),f=k.length-1,i=!0):r=e.$viewport.scrollLeft()-a.col.width:l.length>0&&(r=e.$viewport.scrollLeft()-k[f].width),e.$viewport.scrollLeft(r)}else(39===g||9===g&&!d.shiftKey)&&(o?p&&9===g&&!d.shiftKey?(e.$viewport.scrollLeft(0),f=a.showSelectionCheckbox?1:0,h=!0):e.$viewport.scrollLeft(e.$viewport.scrollLeft()+a.col.width):q&&e.$viewport.scrollLeft(0),p||(f+=1))}var s;s=a.configGroups.length>0?e.rowFactory.parsedData.filter(function(a){return!a.isAggRow}):e.filteredRows;var t=0;if(0!==j&&(38===g||13===g&&d.shiftKey||9===g&&d.shiftKey&&i)?t=-1:j!==s.length-1&&(40===g||13===g&&!d.shiftKey||9===g&&h)&&(t=1),t){var u=s[j+t];u.beforeSelectionChange(u,d)&&(u.continueSelection(d),a.$emit("ngGridEventDigestGridParent"),a.selectionProvider.lastClickedRow.renderedRowIndex>=a.renderedRows.length-c-2?e.$viewport.scrollTop(e.$viewport.scrollTop()+a.rowHeight):a.selectionProvider.lastClickedRow.renderedRowIndex<=c+2&&e.$viewport.scrollTop(e.$viewport.scrollTop()-a.rowHeight))}return a.enableCellSelection&&setTimeout(function(){a.domAccessProvider.focusCellElement(a,a.renderedColumns.indexOf(k[f]))},3),!1};String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=this.length>>>0,c=Number(arguments[1])||0;for(c=0>c?Math.ceil(c):Math.floor(c),0>c&&(c+=b);b>c;c++)if(c in this&&this[c]===a)return c;return-1}),Array.prototype.filter||(Array.prototype.filter=function(a){var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments[1],f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),r.filter("checkmark",function(){return function(a){return a?"✔":"✘"}}),r.filter("ngColumns",function(){return function(a){return a.filter(function(a){return!a.isAggCol})}}),angular.module("ngGrid.services").factory("$domUtilityService",["$utilityService","$window",function(a,c){var d={},e={},f=function(){var a=b("<div></div>");a.appendTo("body"),a.height(100).width(100).css("position","absolute").css("overflow","scroll"),a.append('<div style="height: 400px; width: 400px;"></div>'),d.ScrollH=a.height()-a[0].clientHeight,d.ScrollW=a.width()-a[0].clientWidth,a.empty(),a.attr("style",""),a.append('<span style="font-family: Verdana, Helvetica, Sans-Serif; font-size: 14px;"><strong>M</strong></span>'),d.LetterW=a.children().first().width(),a.remove()};return d.eventStorage={},d.AssignGridContainers=function(a,c,e){e.$root=b(c),e.$topPanel=e.$root.find(".ngTopPanel"),e.$groupPanel=e.$root.find(".ngGroupPanel"),e.$headerContainer=e.$topPanel.find(".ngHeaderContainer"),a.$headerContainer=e.$headerContainer,e.$headerScroller=e.$topPanel.find(".ngHeaderScroller"),e.$headers=e.$headerScroller.children(),e.$viewport=e.$root.find(".ngViewport"),e.$canvas=e.$viewport.find(".ngCanvas"),e.$footerPanel=e.$root.find(".ngFooterPanel");var f=a.$watch(function(){return e.$viewport.scrollLeft()},function(a){return e.$headerContainer.scrollLeft(a)});a.$on("$destroy",function(){b(e.$root.parent()).off("resize.nggrid"),e.$root=null,e.$topPanel=null,e.$headerContainer=null,e.$headers=null,e.$canvas=null,e.$footerPanel=null,f()}),d.UpdateGridLayout(a,e)},d.getRealWidth=function(a){var c=0,d={visibility:"hidden",display:"block"},e=a.parents().andSelf().not(":visible");return b.swap(e[0],d,function(){c=a.outerWidth()}),c},d.UpdateGridLayout=function(a,b){if(b.$root){var c=b.$viewport.scrollTop();b.elementDims.rootMaxW=b.$root.width(),b.$root.is(":hidden")&&(b.elementDims.rootMaxW=d.getRealWidth(b.$root)),b.elementDims.rootMaxH=b.$root.height(),b.refreshDomSizes(),a.adjustScrollTop(c,!0)}},d.numberOfGrids=0,d.setStyleText=function(a,b){var d=a.styleSheet,e=a.gridId,f=c.document;d||(d=f.getElementById(e)),d||(d=f.createElement("style"),d.type="text/css",d.id=e,(f.head||f.getElementsByTagName("head")[0]).appendChild(d)),d.styleSheet&&!d.sheet?d.styleSheet.cssText=b:d.innerHTML=b,a.styleSheet=d,a.styleText=b},d.BuildStyles=function(a,b,c){var e,f=b.config.rowHeight,g=b.gridId,h=a.columns,i=0,j=a.totalRowWidth();e="."+g+" .ngCanvas { width: "+j+"px; }."+g+" .ngRow { width: "+j+"px; }."+g+" .ngCanvas { width: "+j+"px; }."+g+" .ngHeaderScroller { width: "+(j+d.ScrollH)+"px}";for(var k=0;k<h.length;k++){var l=h[k];l.visible!==!1&&(e+="."+g+" .col"+k+" { width: "+l.width+"px; left: "+i+"px; height: "+f+"px }."+g+" .colt"+k+" { width: "+l.width+"px; }",i+=l.width)}d.setStyleText(b,e),a.adjustScrollLeft(b.$viewport.scrollLeft()),c&&d.digest(a)},d.setColLeft=function(a,b,c){if(c.styleText){var f=e[a.index];f||(f=e[a.index]=new RegExp(".col"+a.index+" { width: [0-9]+px; left: [0-9]+px"));var g=c.styleText.replace(f,".col"+a.index+" { width: "+a.width+"px; left: "+b+"px");d.setStyleText(c,g)}},d.setColLeft.immediate=1,d.RebuildGrid=function(a,b){d.UpdateGridLayout(a,b),(null==b.config.maintainColumnRatios||b.config.maintainColumnRatios)&&b.configureColumnWidths(),a.adjustScrollLeft(b.$viewport.scrollLeft()),d.BuildStyles(a,b,!0)},d.digest=function(a){a.$root.$$phase||a.$digest()},d.ScrollH=17,d.ScrollW=17,d.LetterW=10,f(),d}]),angular.module("ngGrid.services").factory("$sortService",["$parse",function(a){var b={};return b.colSortFnCache={},b.isCustomSort=!1,b.guessSortFn=function(a){var c=typeof a;switch(c){case"number":return b.sortNumber;case"boolean":return b.sortBool;case"string":return a.match(/^[-+]?[£$¤]?[\d,.]+%?$/)?b.sortNumberStr:b.sortAlpha;default:return"[object Date]"===Object.prototype.toString.call(a)?b.sortDate:b.basicSort}},b.basicSort=function(a,b){return a===b?0:b>a?-1:1},b.sortNumber=function(a,b){return a-b},b.sortNumberStr=function(a,b){var c,d,e=!1,f=!1;return c=parseFloat(a.replace(/[^0-9.-]/g,"")),isNaN(c)&&(e=!0),d=parseFloat(b.replace(/[^0-9.-]/g,"")),isNaN(d)&&(f=!0),e&&f?0:e?1:f?-1:c-d},b.sortAlpha=function(a,b){var c=a.toLowerCase(),d=b.toLowerCase();return c===d?0:d>c?-1:1},b.sortDate=function(a,b){var c=a.getTime(),d=b.getTime();return c===d?0:d>c?-1:1},b.sortBool=function(a,b){return a&&b?0:a||b?a?1:-1:0},b.sortData=function(c,d){if(d&&c){var f,g,h=c.fields.length,i=c.fields,j=d.slice(0);d.sort(function(d,k){for(var l,m,n=0,o=0;0===n&&h>o;){f=c.columns[o],g=c.directions[o],m=b.getSortFn(f,j);var p=a(i[o])(d),q=a(i[o])(k);b.isCustomSort?(l=m(p,q),n=g===e?l:0-l):!p&&0!==p||!q&&0!==q?q||p?p?q||(n=-1):n=1:n=0:(l=m(p,q),n=g===e?l:0-l),o++}return n})}},b.Sort=function(a,c){b.isSorting||(b.isSorting=!0,b.sortData(a,c),b.isSorting=!1)},b.getSortFn=function(c,d){var e,f;if(b.colSortFnCache[c.field])e=b.colSortFnCache[c.field];else if(void 0!==c.sortingAlgorithm)e=c.sortingAlgorithm,b.colSortFnCache[c.field]=c.sortingAlgorithm,b.isCustomSort=!0;else{if(f=d[0],!f)return e;e=b.guessSortFn(a(c.field)(f)),e?b.colSortFnCache[c.field]=e:e=b.sortAlpha}return e},b}]),angular.module("ngGrid.services").factory("$utilityService",["$parse",function(c){var d=/function (.{1,})\(/,e={visualLength:function(a){var c=document.getElementById("testDataLength");c||(c=document.createElement("SPAN"),c.id="testDataLength",c.style.visibility="hidden",document.body.appendChild(c));var d=b(a);b(c).css({font:d.css("font"),"font-size":d.css("font-size"),"font-family":d.css("font-family")}),c.innerHTML=d.text();var e=c.offsetWidth;return document.body.removeChild(c),e},forIn:function(a,b){for(var c in a)a.hasOwnProperty(c)&&b(a[c],c)},evalProperty:function(a,b){return c("entity."+b)({entity:a})},endsWith:function(a,b){return a&&b&&"string"==typeof a?-1!==a.indexOf(b,a.length-b.length):!1},isNullOrUndefined:function(a){return void 0===a||null===a?!0:!1},getElementsByClassName:function(a){if(document.getElementsByClassName)return document.getElementsByClassName(a);for(var b=[],c=new RegExp("\\b"+a+"\\b"),d=document.getElementsByTagName("*"),e=0;e<d.length;e++){var f=d[e].className;c.test(f)&&b.push(d[e])}return b},newId:function(){var a=(new Date).getTime();return function(){return a+=1}}(),seti18n:function(b,c){var d=a.ngGrid.i18n[c];for(var e in d)b.i18n[e]=d[e]},getInstanceType:function(a){var b=d.exec(a.constructor.toString());if(b&&b.length>1){var c=b[1].replace(/^\s+|\s+$/g,"");return c}return""}};return e}]);var t=function(a,b,c,d){this.rowIndex=0,this.offsetTop=this.rowIndex*c,this.entity=a,this.label=a.gLabel,this.field=a.gField,this.depth=a.gDepth,this.parent=a.parent,this.children=a.children,this.aggChildren=a.aggChildren,this.aggIndex=a.aggIndex,this.collapsed=d,this.groupInitState=d,this.rowFactory=b,this.rowHeight=c,this.isAggRow=!0,this.offsetLeft=25*a.gDepth,this.aggLabelFilter=a.aggLabelFilter};t.prototype.toggleExpand=function(){this.collapsed=this.collapsed?!1:!0,this.orig&&(this.orig.collapsed=this.collapsed),this.notifyChildren()},t.prototype.setExpand=function(a){this.collapsed=a,this.notifyChildren()},t.prototype.notifyChildren=function(){for(var a=Math.max(this.rowFactory.aggCache.length,this.children.length),b=0;a>b;b++)if(this.aggChildren[b]&&(this.aggChildren[b].entity[i]=this.collapsed,this.collapsed&&this.aggChildren[b].setExpand(this.collapsed)),this.children[b]&&(this.children[b][i]=this.collapsed),b>this.aggIndex&&this.rowFactory.aggCache[b]){var c=this.rowFactory.aggCache[b],d=30*this.children.length;c.offsetTop=this.collapsed?c.offsetTop-d:c.offsetTop+d}this.rowFactory.renderedChange()},t.prototype.aggClass=function(){return this.collapsed?"ngAggArrowCollapsed":"ngAggArrowExpanded"},t.prototype.totalChildren=function(){if(this.aggChildren.length>0){var a=0,b=function(c){c.aggChildren.length>0?angular.forEach(c.aggChildren,function(a){b(a)}):a+=c.children.length};return b(this),a}return this.children.length},t.prototype.copy=function(){var a=new t(this.entity,this.rowFactory,this.rowHeight,this.groupInitState);return a.orig=this,a};var u=function(a,c,d,g,h,i){var j=this,l=a.colDef,m=500,n=0,o=null;j.colDef=a.colDef,j.width=l.width,j.groupIndex=0,j.isGroupedBy=!1,j.minWidth=l.minWidth?l.minWidth:50,j.maxWidth=l.maxWidth?l.maxWidth:9e3,j.enableCellEdit=void 0!==l.enableCellEdit?l.enableCellEdit:a.enableCellEdit||a.enableCellEditOnFocus,j.cellEditableCondition=l.cellEditableCondition||a.cellEditableCondition||"true",j.headerRowHeight=a.headerRowHeight,j.displayName=void 0===l.displayName?l.field:l.displayName,j.index=a.index,j.isAggCol=a.isAggCol,j.cellClass=l.cellClass,j.sortPriority=void 0,j.cellFilter=l.cellFilter?l.cellFilter:"",j.field=l.field,j.aggLabelFilter=l.aggLabelFilter||l.cellFilter,j.visible=i.isNullOrUndefined(l.visible)||l.visible,j.sortable=!1,j.resizable=!1,j.pinnable=!1,j.pinned=a.enablePinning&&l.pinned,j.originalIndex=null==a.originalIndex?j.index:a.originalIndex,j.groupable=i.isNullOrUndefined(l.groupable)||l.groupable,a.enableSort&&(j.sortable=i.isNullOrUndefined(l.sortable)||l.sortable),a.enableResize&&(j.resizable=i.isNullOrUndefined(l.resizable)||l.resizable),a.enablePinning&&(j.pinnable=i.isNullOrUndefined(l.pinnable)||l.pinnable),j.sortDirection=void 0,j.sortingAlgorithm=l.sortFn,j.headerClass=l.headerClass,j.cursor=j.sortable?"pointer":"default",j.headerCellTemplate=l.headerCellTemplate||h.get("headerCellTemplate.html"),j.cellTemplate=l.cellTemplate||h.get("cellTemplate.html").replace(k,j.cellFilter?"|"+j.cellFilter:""),j.enableCellEdit&&(j.cellEditTemplate=l.cellEditTemplate||h.get("cellEditTemplate.html"),j.editableCellTemplate=l.editableCellTemplate||h.get("editableCellTemplate.html")),l.cellTemplate&&!p.test(l.cellTemplate)&&(j.cellTemplate=h.get(l.cellTemplate)||b.ajax({type:"GET",url:l.cellTemplate,async:!1}).responseText),j.enableCellEdit&&l.editableCellTemplate&&!p.test(l.editableCellTemplate)&&(j.editableCellTemplate=h.get(l.editableCellTemplate)||b.ajax({type:"GET",url:l.editableCellTemplate,async:!1}).responseText),l.headerCellTemplate&&!p.test(l.headerCellTemplate)&&(j.headerCellTemplate=h.get(l.headerCellTemplate)||b.ajax({type:"GET",url:l.headerCellTemplate,async:!1}).responseText),j.colIndex=function(){var a=j.pinned?"pinned ":"";return a+="col"+j.index+" colt"+j.index,j.cellClass&&(a+=" "+j.cellClass),a},j.groupedByClass=function(){return j.isGroupedBy?"ngGroupedByIcon":"ngGroupIcon"},j.toggleVisible=function(){j.visible=!j.visible},j.showSortButtonUp=function(){return j.sortable?j.sortDirection===f:j.sortable},j.showSortButtonDown=function(){return j.sortable?j.sortDirection===e:j.sortable},j.noSortVisible=function(){return!j.sortDirection},j.sort=function(b){if(!j.sortable)return!0;var c=j.sortDirection===e?f:e;return j.sortDirection=c,a.sortCallback(j,b),!1},j.gripClick=function(){n++,1===n?o=setTimeout(function(){n=0},m):(clearTimeout(o),a.resizeOnDataCallback(j),n=0)},j.gripOnMouseDown=function(a){return c.isColumnResizing=!0,a.ctrlKey&&!j.pinned?(j.toggleVisible(),g.BuildStyles(c,d),!0):(a.target.parentElement.style.cursor="col-resize",j.startMousePosition=a.clientX,j.origWidth=j.width,b(document).mousemove(j.onMouseMove),b(document).mouseup(j.gripOnMouseUp),!1)},j.onMouseMove=function(a){var b=a.clientX-j.startMousePosition,e=b+j.origWidth;return j.width=e<j.minWidth?j.minWidth:e>j.maxWidth?j.maxWidth:e,c.hasUserChangedGridColumnWidths=!0,g.BuildStyles(c,d),!1},j.gripOnMouseUp=function(a){return b(document).off("mousemove",j.onMouseMove),b(document).off("mouseup",j.gripOnMouseUp),a.target.parentElement.style.cursor="default",g.digest(c),c.isColumnResizing=!1,!1},j.copy=function(){var b=new u(a,c,d,g,h,i);return b.isClone=!0,b.orig=j,b},j.setVars=function(a){j.orig=a,j.width=a.width,j.groupIndex=a.groupIndex,j.isGroupedBy=a.isGroupedBy,j.displayName=a.displayName,j.index=a.index,j.isAggCol=a.isAggCol,j.cellClass=a.cellClass,j.cellFilter=a.cellFilter,j.field=a.field,j.aggLabelFilter=a.aggLabelFilter,j.visible=a.visible,j.sortable=a.sortable,j.resizable=a.resizable,j.pinnable=a.pinnable,j.pinned=a.pinned,j.originalIndex=a.originalIndex,j.sortDirection=a.sortDirection,j.sortingAlgorithm=a.sortingAlgorithm,j.headerClass=a.headerClass,j.headerCellTemplate=a.headerCellTemplate,j.cellTemplate=a.cellTemplate,j.cellEditTemplate=a.cellEditTemplate}},v=function(a){this.outerHeight=null,this.outerWidth=null,b.extend(this,a)},w=function(a){this.previousColumn=null,this.grid=a};w.prototype.changeUserSelect=function(a,b){a.css({"-webkit-touch-callout":b,"-webkit-user-select":b,"-khtml-user-select":b,"-moz-user-select":"none"===b?"-moz-none":b,"-ms-user-select":b,"user-select":b})},w.prototype.focusCellElement=function(a,b){if(a.selectionProvider.lastClickedRow){var c=void 0!==b?b:this.previousColumn,d=a.selectionProvider.lastClickedRow.clone?a.selectionProvider.lastClickedRow.clone.elm:a.selectionProvider.lastClickedRow.elm;if(void 0!==c&&d){var e=angular.element(d[0].children).filter(function(){return 8!==this.nodeType}),f=Math.max(Math.min(a.renderedColumns.length-1,c),0);this.grid.config.showSelectionCheckbox&&angular.element(e[f]).scope()&&0===angular.element(e[f]).scope().col.index&&(f=1),e[f]&&e[f].children[1].children[0].focus(),this.previousColumn=c}}},w.prototype.selectionHandlers=function(a,b){function c(c){if(16===c.keyCode)return f.changeUserSelect(b,"none",c),!0;if(!e){e=!0;var d=s(a,b,c,f.grid);return e=!1,d}return!0}function d(a){return 16===a.keyCode&&f.changeUserSelect(b,"text",a),!0}var e=!1,f=this;b.bind("keydown",c),b.bind("keyup",d),b.on("$destroy",function(){b.off("keydown",c),b.off("keyup",d)})};var x=function(c,d,e,f){var g=this;g.colToMove=void 0,g.groupToMove=void 0,g.assignEvents=function(){c.config.jqueryUIDraggable&&!c.config.enablePinning?(c.$groupPanel.droppable({addClasses:!1,drop:function(a){g.onGroupDrop(a)}}),c.$groupPanel.on("$destroy",function(){c.$groupPanel=null})):(c.$groupPanel.on("mousedown",g.onGroupMouseDown).on("dragover",g.dragOver).on("drop",g.onGroupDrop),c.$topPanel.on("mousedown",".ngHeaderScroller",g.onHeaderMouseDown).on("dragover",".ngHeaderScroller",g.dragOver),c.$groupPanel.on("$destroy",function(){c.$groupPanel&&c.$groupPanel.off("mousedown"),c.$groupPanel=null}),c.config.enableColumnReordering&&c.$topPanel.on("drop",".ngHeaderScroller",g.onHeaderDrop),c.$topPanel.on("$destroy",function(){c.$topPanel&&c.$topPanel.off("mousedown"),c.config.enableColumnReordering&&c.$topPanel&&c.$topPanel.off("drop"),c.$topPanel=null
  })),d.$on("$destroy",d.$watch("renderedColumns",function(){f(g.setDraggables)}))},g.dragStart=function(a){a.dataTransfer.setData("text","")},g.dragOver=function(a){a.preventDefault()},g.setDraggables=function(){if(c.config.jqueryUIDraggable)c.$root&&c.$root.find(".ngHeaderSortColumn").draggable({helper:"clone",appendTo:"body",stack:"div",addClasses:!1,start:function(a){g.onHeaderMouseDown(a)}}).droppable({drop:function(a){g.onHeaderDrop(a)}});else{var a=c.$root.find(".ngHeaderSortColumn");if(angular.forEach(a,function(a){a.className&&-1!==a.className.indexOf("ngHeaderSortColumn")&&(a.setAttribute("draggable","true"),a.addEventListener&&(a.addEventListener("dragstart",g.dragStart),angular.element(a).on("$destroy",function(){angular.element(a).off("dragstart",g.dragStart),a.removeEventListener("dragstart",g.dragStart)})))}),-1!==navigator.userAgent.indexOf("MSIE")){var b=c.$root.find(".ngHeaderSortColumn");b.bind("selectstart",function(){return this.dragDrop(),!1}),angular.element(b).on("$destroy",function(){b.off("selectstart")})}}},g.onGroupMouseDown=function(a){var d=b(a.target);if("ngRemoveGroup"!==d[0].className){var e=angular.element(d).scope();e&&(c.config.jqueryUIDraggable||(d.attr("draggable","true"),this.addEventListener&&(this.addEventListener("dragstart",g.dragStart),angular.element(this).on("$destroy",function(){this.removeEventListener("dragstart",g.dragStart)})),-1!==navigator.userAgent.indexOf("MSIE")&&(d.bind("selectstart",function(){return this.dragDrop(),!1}),d.on("$destroy",function(){d.off("selectstart")}))),g.groupToMove={header:d,groupName:e.group,index:e.$index})}else g.groupToMove=void 0},g.onGroupDrop=function(a){a.stopPropagation();var e,f;g.groupToMove?(e=b(a.target).closest(".ngGroupElement"),"ngGroupPanel"===e.context.className?(d.configGroups.splice(g.groupToMove.index,1),d.configGroups.push(g.groupToMove.groupName)):(f=angular.element(e).scope(),f&&g.groupToMove.index!==f.$index&&(d.configGroups.splice(g.groupToMove.index,1),d.configGroups.splice(f.$index,0,g.groupToMove.groupName))),g.groupToMove=void 0,c.fixGroupIndexes()):g.colToMove&&(-1===d.configGroups.indexOf(g.colToMove.col)&&(e=b(a.target).closest(".ngGroupElement"),"ngGroupPanel"===e.context.className||"ngGroupPanelDescription ng-binding"===e.context.className?d.groupBy(g.colToMove.col):(f=angular.element(e).scope(),f&&d.removeGroup(f.$index))),g.colToMove=void 0),d.$$phase||d.$apply()},g.onHeaderMouseDown=function(a){var c=b(a.target).closest(".ngHeaderSortColumn"),d=angular.element(c).scope();d&&(g.colToMove={header:c,col:d.col})},g.onHeaderDrop=function(a){if(g.colToMove&&!g.colToMove.col.pinned){var f=b(a.target).closest(".ngHeaderSortColumn"),h=angular.element(f).scope();if(h){if(g.colToMove.col===h.col||h.col.pinned)return;d.columns.splice(g.colToMove.col.index,1),d.columns.splice(h.col.index,0,g.colToMove.col),c.fixColumnIndexes(),g.colToMove=void 0,e.digest(d)}}},g.assignGridEventHandlers=function(){-1===c.config.tabIndex?(c.$viewport.attr("tabIndex",e.numberOfGrids),e.numberOfGrids++):c.$viewport.attr("tabIndex",c.config.tabIndex);var f,g=function(){clearTimeout(f),f=setTimeout(function(){e.RebuildGrid(d,c)},100)};b(a).on("resize.nggrid",g);var h,i=function(){clearTimeout(h),h=setTimeout(function(){e.RebuildGrid(d,c)},100)};b(c.$root.parent()).on("resize.nggrid",i),d.$on("$destroy",function(){b(a).off("resize.nggrid",g)})},g.assignGridEventHandlers(),g.assignEvents()},y=function(a,b){a.maxRows=function(){var c=Math.max(a.totalServerItems,b.data.length);return c},a.$on("$destroy",a.$watch("totalServerItems",function(){a.currentMaxPages=a.maxPages()})),a.multiSelect=b.config.enableRowSelection&&b.config.multiSelect,a.selectedItemCount=b.selectedItemCount,a.maxPages=function(){return 0===a.maxRows()?1:Math.ceil(a.maxRows()/a.pagingOptions.pageSize)},a.pageForward=function(){var b=a.pagingOptions.currentPage;a.totalServerItems>0?a.pagingOptions.currentPage=Math.min(b+1,a.maxPages()):a.pagingOptions.currentPage++},a.pageBackward=function(){var b=a.pagingOptions.currentPage;a.pagingOptions.currentPage=Math.max(b-1,1)},a.pageToFirst=function(){a.pagingOptions.currentPage=1},a.pageToLast=function(){var b=a.maxPages();a.pagingOptions.currentPage=b},a.cantPageForward=function(){var c=a.pagingOptions.currentPage,d=a.maxPages();return a.totalServerItems>0?c>=d:b.data.length<1},a.cantPageToLast=function(){return a.totalServerItems>0?a.cantPageForward():!0},a.cantPageBackward=function(){var b=a.pagingOptions.currentPage;return 1>=b}},z=function(e,f,g,h,j,k,l,m,n,o,q){var r={aggregateTemplate:void 0,afterSelectionChange:function(){},beforeSelectionChange:function(){return!0},checkboxCellTemplate:void 0,checkboxHeaderTemplate:void 0,columnDefs:void 0,data:[],dataUpdated:function(){},enableCellEdit:!1,enableCellEditOnFocus:!1,enableCellSelection:!1,enableColumnResize:!1,enableColumnReordering:!1,enableColumnHeavyVirt:!1,enablePaging:!1,enablePinning:!1,enableRowSelection:!0,enableSorting:!0,enableHighlighting:!1,excludeProperties:[],filterOptions:{filterText:"",useExternalFilter:!1},footerRowHeight:55,footerTemplate:void 0,forceSyncScrolling:!0,groups:[],groupsCollapsedByDefault:!0,headerRowHeight:30,headerRowTemplate:void 0,jqueryUIDraggable:!1,jqueryUITheme:!1,keepLastSelected:!0,maintainColumnRatios:void 0,menuTemplate:void 0,multiSelect:!0,pagingOptions:{pageSizes:[250,500,1e3],pageSize:250,currentPage:1},pinSelectionCheckbox:!1,plugins:[],primaryKey:void 0,rowHeight:30,rowTemplate:void 0,selectedItems:[],selectWithCheckboxOnly:!1,showColumnMenu:!1,showFilter:!1,showFooter:!1,showGroupPanel:!1,showSelectionCheckbox:!1,sortInfo:{fields:[],columns:[],directions:[]},tabIndex:-1,totalServerItems:0,useExternalSorting:!1,i18n:"en",virtualizationThreshold:50,noTabInterference:!1},s=this;s.maxCanvasHt=0,s.config=b.extend(r,a.ngGrid.config,f),s.config.showSelectionCheckbox=s.config.showSelectionCheckbox&&s.config.enableColumnHeavyVirt===!1,s.config.enablePinning=s.config.enablePinning&&s.config.enableColumnHeavyVirt===!1,s.config.selectWithCheckboxOnly=s.config.selectWithCheckboxOnly&&s.config.showSelectionCheckbox!==!1,s.config.pinSelectionCheckbox=s.config.enablePinning,"string"==typeof f.columnDefs&&(s.config.columnDefs=e.$eval(f.columnDefs)),s.rowCache=[],s.rowMap=[],s.gridId="ng"+l.newId(),s.$root=null,s.$groupPanel=null,s.$topPanel=null,s.$headerContainer=null,s.$headerScroller=null,s.$headers=null,s.$viewport=null,s.$canvas=null,s.rootDim=s.config.gridDim,s.data=[],s.lateBindColumns=!1,s.filteredRows=[],s.initTemplates=function(){var a=["rowTemplate","aggregateTemplate","headerRowTemplate","checkboxCellTemplate","checkboxHeaderTemplate","menuTemplate","footerTemplate"],b=[];return angular.forEach(a,function(a){b.push(s.getTemplate(a))}),q.all(b)},s.getTemplate=function(a){var b=s.config[a],c=s.gridId+a+".html",d=q.defer();if(b&&!p.test(b))o.get(b,{cache:k}).success(function(a){k.put(c,a),d.resolve()}).error(function(){d.reject("Could not load template: "+b)});else if(b)k.put(c,b),d.resolve();else{var e=a+".html";k.put(c,k.get(e)),d.resolve()}return d.promise},"object"==typeof s.config.data&&(s.data=s.config.data),s.calcMaxCanvasHeight=function(){var a;return a=s.config.groups.length>0?s.rowFactory.parsedData.filter(function(a){return!a[i]}).length*s.config.rowHeight:s.filteredRows.length*s.config.rowHeight},s.elementDims={scrollW:0,scrollH:0,rowIndexCellW:25,rowSelectedCellW:25,rootMaxW:0,rootMaxH:0},s.setRenderedRows=function(a){e.renderedRows.length=a.length;for(var b=0;b<a.length;b++)!e.renderedRows[b]||a[b].isAggRow||e.renderedRows[b].isAggRow?(e.renderedRows[b]=a[b].copy(),e.renderedRows[b].collapsed=a[b].collapsed,a[b].isAggRow||e.renderedRows[b].setVars(a[b])):e.renderedRows[b].setVars(a[b]),e.renderedRows[b].rowIndex=a[b].rowIndex,e.renderedRows[b].offsetTop=a[b].offsetTop,e.renderedRows[b].selected=a[b].selected,a[b].renderedRowIndex=b;s.refreshDomSizes(),e.$emit("ngGridEventRows",a)},s.minRowsToRender=function(){var a=e.viewportDimHeight()||1;return Math.floor(a/s.config.rowHeight)},s.refreshDomSizes=function(){var a=new v;a.outerWidth=s.elementDims.rootMaxW,a.outerHeight=s.elementDims.rootMaxH,s.rootDim=a,s.maxCanvasHt=s.calcMaxCanvasHeight()},s.buildColumnDefsFromData=function(){s.config.columnDefs=[];var a=s.data[0];return a?void l.forIn(a,function(a,b){-1===s.config.excludeProperties.indexOf(b)&&s.config.columnDefs.push({field:b})}):void(s.lateBoundColumns=!0)},s.buildColumns=function(){var a=s.config.columnDefs,b=[];if(a||(s.buildColumnDefsFromData(),a=s.config.columnDefs),s.config.showSelectionCheckbox&&b.push(new u({colDef:{field:"✔",width:s.elementDims.rowSelectedCellW,sortable:!1,resizable:!1,groupable:!1,headerCellTemplate:k.get(e.gridId+"checkboxHeaderTemplate.html"),cellTemplate:k.get(e.gridId+"checkboxCellTemplate.html"),pinned:s.config.pinSelectionCheckbox},index:0,headerRowHeight:s.config.headerRowHeight,sortCallback:s.sortData,resizeOnDataCallback:s.resizeOnData,enableResize:s.config.enableColumnResize,enableSort:s.config.enableSorting,enablePinning:s.config.enablePinning},e,s,h,k,l)),a.length>0){var c=s.config.showSelectionCheckbox?1:0,d=e.configGroups.length;e.configGroups.length=0,angular.forEach(a,function(a,f){f+=c;var g=new u({colDef:a,index:f+d,originalIndex:f,headerRowHeight:s.config.headerRowHeight,sortCallback:s.sortData,resizeOnDataCallback:s.resizeOnData,enableResize:s.config.enableColumnResize,enableSort:s.config.enableSorting,enablePinning:s.config.enablePinning,enableCellEdit:s.config.enableCellEdit||s.config.enableCellEditOnFocus,cellEditableCondition:s.config.cellEditableCondition},e,s,h,k,l),i=s.config.groups.indexOf(a.field);-1!==i&&(g.isGroupedBy=!0,e.configGroups.splice(i,0,g),g.groupIndex=e.configGroups.length),b.push(g)}),e.columns=b,s.config.groups.length>0&&s.rowFactory.getGrouping(s.config.groups)}},s.configureColumnWidths=function(){var a=[],b=[],c=0,d=0,f={};if(angular.forEach(e.columns,function(a,b){if(!l.isNullOrUndefined(a.originalIndex)){var c=a.originalIndex;s.config.showSelectionCheckbox&&(0===a.originalIndex&&a.visible&&(d+=25),c--),f[c]=b}}),angular.forEach(s.config.columnDefs,function(g,h){var i=e.columns[f[h]];g.index=h;var j,k=!1;if(l.isNullOrUndefined(g.width)?g.width="*":(k=isNaN(g.width)?l.endsWith(g.width,"%"):!1,j=k?g.width:parseInt(g.width,10)),isNaN(j)&&!e.hasUserChangedGridColumnWidths){if(j=g.width,"auto"===j){i.width=i.minWidth,d+=i.width;var m=i;return void e.$on("$destroy",e.$on("ngGridEventData",function(){s.resizeOnData(m)}))}if(-1!==j.indexOf("*"))return i.visible!==!1&&(c+=j.length),void a.push(g);if(k)return void b.push(g);throw'unable to parse column width, use percentage ("10%","20%", etc...) or "*" to use remaining width of grid'}i.visible!==!1&&(d+=i.width=parseInt(i.width,10))}),b.length>0){s.config.maintainColumnRatios=s.config.maintainColumnRatios!==!1;var g=0,i=0;angular.forEach(b,function(a){var b=e.columns[f[a.index]],c=parseFloat(a.width)/100;g+=c,b.visible||(i+=c)});var j=g-i;angular.forEach(b,function(a){var b=e.columns[f[a.index]],c=parseFloat(a.width)/100;c/=i>0?j:g;var h=s.rootDim.outerWidth*g;b.width=h*c,d+=b.width})}if(a.length>0){s.config.maintainColumnRatios=s.config.maintainColumnRatios!==!1;var k=s.rootDim.outerWidth-d;s.maxCanvasHt>e.viewportDimHeight()&&(k-=h.ScrollW);var m=Math.floor(k/c);angular.forEach(a,function(b,c){var g=e.columns[f[b.index]];g.width=m*b.width.length,g.visible!==!1&&(d+=g.width);var i=c===a.length-1;if(i&&d<s.rootDim.outerWidth){var j=s.rootDim.outerWidth-d;s.maxCanvasHt>e.viewportDimHeight()&&(j-=h.ScrollW),g.width+=j}})}},s.init=function(){return s.initTemplates().then(function(){e.selectionProvider=new E(s,e,n),e.domAccessProvider=new w(s),s.rowFactory=new C(s,e,h,k,l),s.searchProvider=new D(e,s,j),s.styleProvider=new F(e,s),e.$on("$destroy",e.$watch("configGroups",function(a){var b=[];angular.forEach(a,function(a){b.push(a.field||a)}),s.config.groups=b,s.rowFactory.filteredRowsChanged(),e.$emit("ngGridEventGroups",a)},!0)),e.$on("$destroy",e.$watch("columns",function(a){e.isColumnResizing||h.RebuildGrid(e,s),e.$emit("ngGridEventColumns",a)},!0)),e.$on("$destroy",e.$watch(function(){return f.i18n},function(a){l.seti18n(e,a)})),s.maxCanvasHt=s.calcMaxCanvasHeight(),s.config.sortInfo.fields&&s.config.sortInfo.fields.length>0&&e.$on("$destroy",e.$watch(function(){return s.config.sortInfo},function(){g.isSorting||(s.sortColumnsInit(),e.$emit("ngGridEventSorted",s.config.sortInfo))},!0))})},s.resizeOnData=function(a){var c=a.minWidth,d=l.getElementsByClassName("col"+a.index);angular.forEach(d,function(a,d){var e;if(0===d){var f=b(a).find(".ngHeaderText");e=l.visualLength(f)+10}else{var g=b(a).find(".ngCellText");e=l.visualLength(g)+10}e>c&&(c=e)}),a.width=a.longest=Math.min(a.maxWidth,c+7),h.BuildStyles(e,s,!0)},s.lastSortedColumns=[],s.sortData=function(a,c){if(c&&c.shiftKey&&s.config.sortInfo){var d=s.config.sortInfo.columns.indexOf(a);-1===d?(1===s.config.sortInfo.columns.length&&(s.config.sortInfo.columns[0].sortPriority=1),s.config.sortInfo.columns.push(a),a.sortPriority=s.config.sortInfo.columns.length,s.config.sortInfo.fields.push(a.field),s.config.sortInfo.directions.push(a.sortDirection),s.lastSortedColumns.push(a)):s.config.sortInfo.directions[d]=a.sortDirection}else if(!s.config.useExternalSorting||s.config.useExternalSorting&&s.config.sortInfo){var f=b.isArray(a);s.config.sortInfo.columns.length=0,s.config.sortInfo.fields.length=0,s.config.sortInfo.directions.length=0;var g=function(a){s.config.sortInfo.columns.push(a),s.config.sortInfo.fields.push(a.field),s.config.sortInfo.directions.push(a.sortDirection),s.lastSortedColumns.push(a)};f?angular.forEach(a,function(a,b){a.sortPriority=b+1,g(a)}):(s.clearSortingData(a),a.sortPriority=void 0,g(a)),s.sortActual(),s.searchProvider.evalFilter(),e.$emit("ngGridEventSorted",s.config.sortInfo)}},s.sortColumnsInit=function(){s.config.sortInfo.columns?s.config.sortInfo.columns.length=0:s.config.sortInfo.columns=[];var a=[];angular.forEach(e.columns,function(b){var c=s.config.sortInfo.fields.indexOf(b.field);-1!==c&&(b.sortDirection=s.config.sortInfo.directions[c]||"asc",a[c]=b)}),s.sortData(1===a.length?a[0]:a)},s.sortActual=function(){if(!s.config.useExternalSorting){var a=s.data.slice(0);angular.forEach(a,function(a,b){var c=s.rowMap[b];if(void 0!==c){var d=s.rowCache[c];void 0!==d&&(a.preSortSelected=d.selected,a.preSortIndex=b)}}),g.Sort(s.config.sortInfo,a),angular.forEach(a,function(a,b){s.rowCache[b].entity=a,s.rowCache[b].selected=a.preSortSelected,s.rowMap[a.preSortIndex]=b,delete a.preSortSelected,delete a.preSortIndex})}},s.clearSortingData=function(a){a?(angular.forEach(s.lastSortedColumns,function(b){a.index!==b.index&&(b.sortDirection="",b.sortPriority=null)}),s.lastSortedColumns[0]=a,s.lastSortedColumns.length=1):(angular.forEach(s.lastSortedColumns,function(a){a.sortDirection="",a.sortPriority=null}),s.lastSortedColumns=[])},s.fixColumnIndexes=function(){for(var a=0;a<e.columns.length;a++)e.columns[a].index=a},s.fixGroupIndexes=function(){angular.forEach(e.configGroups,function(a,b){a.groupIndex=b+1})},e.elementsNeedMeasuring=!0,e.columns=[],e.renderedRows=[],e.renderedColumns=[],e.headerRow=null,e.rowHeight=s.config.rowHeight,e.jqueryUITheme=s.config.jqueryUITheme,e.showSelectionCheckbox=s.config.showSelectionCheckbox,e.enableCellSelection=s.config.enableCellSelection,e.enableCellEditOnFocus=s.config.enableCellEditOnFocus,e.footer=null,e.selectedItems=s.config.selectedItems,e.multiSelect=s.config.multiSelect,e.showFooter=s.config.showFooter,e.footerRowHeight=e.showFooter?s.config.footerRowHeight:0,e.showColumnMenu=s.config.showColumnMenu,e.forceSyncScrolling=s.config.forceSyncScrolling,e.showMenu=!1,e.configGroups=[],e.gridId=s.gridId,e.enablePaging=s.config.enablePaging,e.pagingOptions=s.config.pagingOptions,e.i18n={},l.seti18n(e,s.config.i18n),e.adjustScrollLeft=function(a){for(var b=0,c=0,d=e.columns.length,f=[],g=!s.config.enableColumnHeavyVirt,i=0,j=function(a){g?f.push(a):e.renderedColumns[i]?e.renderedColumns[i].setVars(a):e.renderedColumns[i]=a.copy(),i++},k=0;d>k;k++){var l=e.columns[k];if(l.visible!==!1){var m=l.width+b;if(l.pinned){j(l);var n=k>0?a+c:a;h.setColLeft(l,n,s),c+=l.width}else m>=a&&b<=a+s.rootDim.outerWidth&&j(l);b+=l.width}}g&&(e.renderedColumns=f)},s.prevScrollTop=0,s.prevScrollIndex=0,e.adjustScrollTop=function(a,b){if(s.prevScrollTop!==a||b){a>0&&s.$viewport[0].scrollHeight-a<=s.$viewport.outerHeight()&&e.$emit("ngGridEventScroll");var f,g=Math.floor(a/s.config.rowHeight);if(s.filteredRows.length>s.config.virtualizationThreshold){if(s.prevScrollTop<a&&g<s.prevScrollIndex+d)return;if(s.prevScrollTop>a&&g>s.prevScrollIndex-d)return;f=new A(Math.max(0,g-c),g+s.minRowsToRender()+c)}else{var h=e.configGroups.length>0?s.rowFactory.parsedData.length:s.filteredRows.length;f=new A(0,Math.max(h,s.minRowsToRender()+c))}s.prevScrollTop=a,s.rowFactory.UpdateViewableRange(f),s.prevScrollIndex=g}},e.toggleShowMenu=function(){e.showMenu=!e.showMenu},e.toggleSelectAll=function(a,b){e.selectionProvider.toggleSelectAll(a,!1,b)},e.totalFilteredItemsLength=function(){return s.filteredRows.length},e.showGroupPanel=function(){return s.config.showGroupPanel},e.topPanelHeight=function(){return s.config.showGroupPanel===!0?s.config.headerRowHeight+32:s.config.headerRowHeight},e.viewportDimHeight=function(){return Math.max(0,s.rootDim.outerHeight-e.topPanelHeight()-e.footerRowHeight-2)},e.groupBy=function(a){if(!(s.data.length<1)&&a.groupable&&a.field){a.sortDirection||a.sort({shiftKey:e.configGroups.length>0?!0:!1});var b=e.configGroups.indexOf(a);-1===b?(a.isGroupedBy=!0,e.configGroups.push(a),a.groupIndex=e.configGroups.length):e.removeGroup(b),s.$viewport.scrollTop(0),h.digest(e)}},e.removeGroup=function(a){var b=e.columns.filter(function(b){return b.groupIndex===a+1})[0];b.isGroupedBy=!1,b.groupIndex=0,e.columns[a].isAggCol&&(e.columns.splice(a,1),e.configGroups.splice(a,1),s.fixGroupIndexes()),0===e.configGroups.length&&(s.fixColumnIndexes(),h.digest(e)),e.adjustScrollLeft(0)},e.togglePin=function(a){for(var b=a.index,c=0,d=0;d<e.columns.length&&e.columns[d].pinned;d++)c++;a.pinned&&(c=Math.max(a.originalIndex,c-1)),a.pinned=!a.pinned,e.columns.splice(b,1),e.columns.splice(c,0,a),s.fixColumnIndexes(),h.BuildStyles(e,s,!0),s.$viewport.scrollLeft(s.$viewport.scrollLeft()-a.width)},e.totalRowWidth=function(){for(var a=0,b=e.columns,c=0;c<b.length;c++)b[c].visible!==!1&&(a+=b[c].width);return a},e.headerScrollerDim=function(){var a=e.viewportDimHeight(),b=s.maxCanvasHt,c=b>a,d=new v;return d.autoFitHeight=!0,d.outerWidth=e.totalRowWidth(),c?d.outerWidth+=s.elementDims.scrollW:b-a<=s.elementDims.scrollH&&(d.outerWidth+=s.elementDims.scrollW),d}},A=function(a,b){this.topRow=a,this.bottomRow=b},B=function(a,b,c,d,e){this.entity=a,this.config=b,this.selectionProvider=c,this.rowIndex=d,this.utils=e,this.selected=c.getSelection(a),this.cursor=this.config.enableRowSelection&&!this.config.selectWithCheckboxOnly?"pointer":"default",this.beforeSelectionChange=b.beforeSelectionChangeCallback,this.afterSelectionChange=b.afterSelectionChangeCallback,this.offsetTop=this.rowIndex*b.rowHeight,this.rowDisplayIndex=0};B.prototype.setSelection=function(a){this.selectionProvider.setSelection(this,a),this.selectionProvider.lastClickedRow=this},B.prototype.continueSelection=function(a){this.selectionProvider.ChangeSelection(this,a)},B.prototype.ensureEntity=function(a){this.entity!==a&&(this.entity=a,this.selected=this.selectionProvider.getSelection(this.entity))},B.prototype.toggleSelected=function(a){if(!this.config.enableRowSelection&&!this.config.enableCellSelection)return!0;var b=a.target||a;return"checkbox"===b.type&&"ngSelectionCell ng-scope"!==b.parentElement.className?!0:this.config.selectWithCheckboxOnly&&"checkbox"!==b.type?(this.selectionProvider.lastClickedRow=this,!0):(this.beforeSelectionChange(this,a)&&this.continueSelection(a),!1)},B.prototype.alternatingRowClass=function(){var a=this.rowIndex%2===0,b={ngRow:!0,selected:this.selected,even:a,odd:!a,"ui-state-default":this.config.jqueryUITheme&&a,"ui-state-active":this.config.jqueryUITheme&&!a};return b},B.prototype.getProperty=function(a){return this.utils.evalProperty(this.entity,a)},B.prototype.copy=function(){return this.clone=new B(this.entity,this.config,this.selectionProvider,this.rowIndex,this.utils),this.clone.isClone=!0,this.clone.elm=this.elm,this.clone.orig=this,this.clone},B.prototype.setVars=function(a){a.clone=this,this.entity=a.entity,this.selected=a.selected,this.orig=a};var C=function(a,b,d,e,f){var k=this;k.aggCache={},k.parentCache=[],k.dataChanged=!0,k.parsedData=[],k.rowConfig={},k.selectionProvider=b.selectionProvider,k.rowHeight=30,k.numberOfAggregates=0,k.groupedData=void 0,k.rowHeight=a.config.rowHeight,k.rowConfig={enableRowSelection:a.config.enableRowSelection,rowClasses:a.config.rowClasses,selectedItems:b.selectedItems,selectWithCheckboxOnly:a.config.selectWithCheckboxOnly,beforeSelectionChangeCallback:a.config.beforeSelectionChange,afterSelectionChangeCallback:a.config.afterSelectionChange,jqueryUITheme:a.config.jqueryUITheme,enableCellSelection:a.config.enableCellSelection,rowHeight:a.config.rowHeight},k.renderedRange=new A(0,a.minRowsToRender()+c),k.buildEntityRow=function(a,b){return new B(a,k.rowConfig,k.selectionProvider,b,f)},k.buildAggregateRow=function(b,c){var d=k.aggCache[b.aggIndex];return d||(d=new t(b,k,k.rowConfig.rowHeight,a.config.groupsCollapsedByDefault),k.aggCache[b.aggIndex]=d),d.rowIndex=c,d.offsetTop=c*k.rowConfig.rowHeight,d},k.UpdateViewableRange=function(a){k.renderedRange=a,k.renderedChange()},k.filteredRowsChanged=function(){a.lateBoundColumns&&a.filteredRows.length>0&&(a.config.columnDefs=void 0,a.buildColumns(),a.lateBoundColumns=!1,b.$evalAsync(function(){b.adjustScrollLeft(0)})),k.dataChanged=!0,a.config.groups.length>0&&k.getGrouping(a.config.groups),k.UpdateViewableRange(k.renderedRange)},k.renderedChange=function(){if(!k.groupedData||a.config.groups.length<1)return k.renderedChangeNoGroups(),void a.refreshDomSizes();k.wasGrouped=!0,k.parentCache=[];var b=0,c=k.parsedData.filter(function(a){return a.isAggRow?a.parent&&a.parent.collapsed?!1:!0:(a[i]||(a.rowIndex=b++),!a[i])});k.totalRows=c.length;for(var d=[],e=k.renderedRange.topRow;e<k.renderedRange.bottomRow;e++)c[e]&&(c[e].offsetTop=e*a.config.rowHeight,d.push(c[e]));a.setRenderedRows(d)},k.renderedChangeNoGroups=function(){for(var b=[],c=k.renderedRange.topRow;c<k.renderedRange.bottomRow;c++)a.filteredRows[c]&&(a.filteredRows[c].rowIndex=c,a.filteredRows[c].offsetTop=c*a.config.rowHeight,b.push(a.filteredRows[c]));a.setRenderedRows(b)},k.fixRowCache=function(){var b=a.data.length,c=b-a.rowCache.length;if(0>c)a.rowCache.length=a.rowMap.length=b;else for(var d=a.rowCache.length;b>d;d++)a.rowCache[d]=a.rowFactory.buildEntityRow(a.data[d],d)},k.parseGroupData=function(a){if(a.values)for(var b=0;b<a.values.length;b++)k.parentCache[k.parentCache.length-1].children.push(a.values[b]),k.parsedData.push(a.values[b]);else for(var c in a)if(c!==g&&c!==h&&c!==j&&a.hasOwnProperty(c)){var d=k.buildAggregateRow({gField:a[g],gLabel:c,gDepth:a[h],isAggRow:!0,_ng_hidden_:!1,children:[],aggChildren:[],aggIndex:k.numberOfAggregates,aggLabelFilter:a[j].aggLabelFilter},0);k.numberOfAggregates++,d.parent=k.parentCache[d.depth-1],d.parent&&(d.parent.collapsed=!1,d.parent.aggChildren.push(d)),k.parsedData.push(d),k.parentCache[d.depth]=d,k.parseGroupData(a[c])}},k.getGrouping=function(c){function l(a,b){return a.filter(function(a){return a.field===b})}k.aggCache=[],k.numberOfAggregates=0,k.groupedData={};for(var m=a.filteredRows,n=c.length,o=b.columns,p=0;p<m.length;p++){var q=m[p].entity;if(!q)return;m[p][i]=a.config.groupsCollapsedByDefault;for(var r=k.groupedData,s=0;s<c.length;s++){var t=c[s],v=l(o,t)[0],w=f.evalProperty(q,t);w=w?w.toString():"null",r[w]||(r[w]={}),r[g]||(r[g]=t),r[h]||(r[h]=s),r[j]||(r[j]=v),r=r[w]}r.values||(r.values=[]),r.values.push(m[p])}if(o.length>0)for(var x=0;x<c.length;x++)!o[x].isAggCol&&n>=x&&o.splice(0,0,new u({colDef:{field:"",width:25,sortable:!1,resizable:!1,headerCellTemplate:'<div class="ngAggHeader"></div>',pinned:a.config.pinSelectionCheckbox},enablePinning:a.config.enablePinning,isAggCol:!0,headerRowHeight:a.config.headerRowHeight},b,a,d,e,f));a.fixColumnIndexes(),b.adjustScrollLeft(0),k.parsedData.length=0,k.parseGroupData(k.groupedData),k.fixRowCache()},a.config.groups.length>0&&a.filteredRows.length>0&&k.getGrouping(a.config.groups)},D=function(a,c,d){var e=this,f=[];e.extFilter=c.config.filterOptions.useExternalFilter,a.showFilter=c.config.showFilter,a.filterText="",e.fieldMap={};var g=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c.toLowerCase()]=a[c]);return b},h=function(a,b,c){var e;for(var f in b)if(b.hasOwnProperty(f)){var i=c[f.toLowerCase()];if(!i)continue;var j=b[f];if("object"!=typeof j||j instanceof Date){var k=null,l=null;if(i&&i.cellFilter&&(l=i.cellFilter.split(":"),k=d(l[0])),null!==j&&void 0!==j){if("function"==typeof k){var m=k(j,l[1].slice(1,-1)).toString();e=a.regex.test(m)}else e=a.regex.test(j.toString());if(e)return!0}}else{var n=g(i);if(e=h(a,j,n))return!0}}return!1},i=function(a,b){var c,f=e.fieldMap[a.columnDisplay];if(!f)return!1;var g=f.cellFilter.split(":"),h=f.cellFilter?d(g[0]):null,i=b[a.column]||b[f.field.split(".")[0]];if(null===i||void 0===i)return!1;if("function"==typeof h){var j=h("object"==typeof i?k(i,f.field):i,g[1]).toString();c=a.regex.test(j)}else c=a.regex.test("object"==typeof i?k(i,f.field).toString():i.toString());return c?!0:!1},j=function(a){for(var b=0,c=f.length;c>b;b++){var d,g=f[b];if(d=g.column?i(g,a):h(g,a,e.fieldMap),!d)return!1}return!0};e.evalFilter=function(){c.filteredRows=0===f.length?c.rowCache:c.rowCache.filter(function(a){return j(a.entity)});for(var a=0;a<c.filteredRows.length;a++)c.filteredRows[a].rowIndex=a;c.rowFactory.filteredRowsChanged()};var k=function(a,b){if("object"!=typeof a||"string"!=typeof b)return a;var c=b.split("."),d=a;if(c.length>1){for(var e=1,f=c.length;f>e;e++)if(d=d[c[e]],!d)return a;return d}return a},l=function(a,b){try{return new RegExp(a,b)}catch(c){return new RegExp(a.replace(/(\^|\$|\(|\)|<|>|\[|\]|\{|\}|\\|\||\.|\*|\+|\?)/g,"\\$1"))}},m=function(a){f=[];var c;if(c=b.trim(a))for(var d=c.split(";"),e=0;e<d.length;e++){var g=d[e].split(":");if(g.length>1){var h=b.trim(g[0]),i=b.trim(g[1]);h&&i&&f.push({column:h,columnDisplay:h.replace(/\s+/g,"").toLowerCase(),regex:l(i,"i")})}else{var j=b.trim(g[0]);j&&f.push({column:"",regex:l(j,"i")})}}};e.extFilter||a.$on("$destroy",a.$watch("columns",function(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.field)if(c.field.match(/\./g)){for(var d=c.field.split("."),f=e.fieldMap,g=0;g<d.length-1;g++)f[d[g]]=f[d[g]]||{},f=f[d[g]];f[d[d.length-1]]=c}else e.fieldMap[c.field.toLowerCase()]=c;c.displayName&&(e.fieldMap[c.displayName.toLowerCase().replace(/\s+/g,"")]=c)}})),a.$on("$destroy",a.$watch(function(){return c.config.filterOptions.filterText},function(b){a.filterText=b})),a.$on("$destroy",a.$watch("filterText",function(b){e.extFilter||(a.$emit("ngGridEventFilter",b),m(b),e.evalFilter())}))},E=function(a,b,c){var d=this;d.multi=a.config.multiSelect,d.selectedItems=a.config.selectedItems,d.selectedIndex=a.config.selectedIndex,d.lastClickedRow=void 0,d.ignoreSelectedItemChanges=!1,d.pKeyParser=c(a.config.primaryKey),d.ChangeSelection=function(c,e){var f=e.which||e.keyCode,g=40===f||38===f;if(e&&e.shiftKey&&!e.keyCode&&d.multi&&a.config.enableRowSelection){if(d.lastClickedRow){var h;h=b.configGroups.length>0?a.rowFactory.parsedData.filter(function(a){return!a.isAggRow}):a.filteredRows;var i=c.rowIndex,j=d.lastClickedRowIndex;if(i===j)return!1;j>i?(i^=j,j=i^j,i^=j,i--):j++;for(var k=[];i>=j;j++)k.push(h[j]);if(k[k.length-1].beforeSelectionChange(k,e)){for(var l=0;l<k.length;l++){var m=k[l],n=m.selected;m.selected=!n,m.clone&&(m.clone.selected=m.selected);var o=d.selectedItems.indexOf(m.entity);-1===o?d.selectedItems.push(m.entity):d.selectedItems.splice(o,1)}k[k.length-1].afterSelectionChange(k,e)}return d.lastClickedRow=c,d.lastClickedRowIndex=c.rowIndex,!0}}else d.multi?(!e.keyCode||g&&!a.config.selectWithCheckboxOnly)&&d.setSelection(c,!c.selected):d.lastClickedRow===c?d.setSelection(d.lastClickedRow,a.config.keepLastSelected?!0:!c.selected):(d.lastClickedRow&&d.setSelection(d.lastClickedRow,!1),d.setSelection(c,!c.selected));return d.lastClickedRow=c,d.lastClickedRowIndex=c.rowIndex,!0},d.getSelection=function(a){return-1!==d.getSelectionIndex(a)},d.getSelectionIndex=function(b){var c=-1;if(a.config.primaryKey){var e=d.pKeyParser(b);angular.forEach(d.selectedItems,function(a,b){e===d.pKeyParser(a)&&(c=b)})}else c=d.selectedItems.indexOf(b);return c},d.setSelection=function(b,c){if(a.config.enableRowSelection){if(c)-1===d.getSelectionIndex(b.entity)&&(!d.multi&&d.selectedItems.length>0&&d.toggleSelectAll(!1,!0),d.selectedItems.push(b.entity));else{var e=d.getSelectionIndex(b.entity);-1!==e&&d.selectedItems.splice(e,1)}b.selected=c,b.orig&&(b.orig.selected=c),b.clone&&(b.clone.selected=c),b.afterSelectionChange(b)}},d.toggleSelectAll=function(b,c,e){var f=e?a.filteredRows:a.rowCache;if(c||a.config.beforeSelectionChange(f,b)){var g=d.selectedItems.length;g>0&&(d.selectedItems.length=0);for(var h=0;h<f.length;h++)f[h].selected=b,f[h].clone&&(f[h].clone.selected=b),b&&d.selectedItems.push(f[h].entity);c||a.config.afterSelectionChange(f,b)}}},F=function(a,b){a.headerCellStyle=function(a){return{height:a.headerRowHeight+"px"}},a.rowStyle=function(b){var c={top:b.offsetTop+"px",height:a.rowHeight+"px"};return b.isAggRow&&(c.left=b.offsetLeft),c},a.canvasStyle=function(){return{height:b.maxCanvasHt+"px"}},a.headerScrollerStyle=function(){return{height:b.config.headerRowHeight+"px"}},a.topPanelStyle=function(){return{width:b.rootDim.outerWidth+"px",height:a.topPanelHeight()+"px"}},a.headerStyle=function(){return{width:b.rootDim.outerWidth+"px",height:b.config.headerRowHeight+"px"}},a.groupPanelStyle=function(){return{width:b.rootDim.outerWidth+"px",height:"32px"}},a.viewportStyle=function(){return{width:b.rootDim.outerWidth+"px",height:a.viewportDimHeight()+"px"}},a.footerStyle=function(){return{width:b.rootDim.outerWidth+"px",height:a.footerRowHeight+"px"}}};q.directive("ngCellHasFocus",["$domUtilityService",function(a){var b=function(b){b.isFocused=!0,a.digest(b),b.$broadcast("ngGridEventStartCellEdit"),b.$emit("ngGridEventStartCellEdit"),b.$on("$destroy",b.$on("ngGridEventEndCellEdit",function(){b.isFocused=!1,a.digest(b)}))};return function(a,c){function d(){return a.enableCellEditOnFocus?j=!0:c.focus(),!0}function e(d){a.enableCellEditOnFocus&&(d.preventDefault(),j=!1,b(a,c))}function f(){return i=!0,a.enableCellEditOnFocus&&!j&&b(a,c),!0}function g(){return i=!1,!0}function h(d){return a.enableCellEditOnFocus||(i&&37!==d.keyCode&&38!==d.keyCode&&39!==d.keyCode&&40!==d.keyCode&&9!==d.keyCode&&!d.shiftKey&&13!==d.keyCode&&b(a,c),i&&d.shiftKey&&d.keyCode>=65&&d.keyCode<=90&&b(a,c),27===d.keyCode&&c.focus()),!0}var i=!1,j=!1;a.editCell=function(){a.enableCellEditOnFocus||setTimeout(function(){b(a,c)},0)},c.bind("mousedown",d),c.bind("click",e),c.bind("focus",f),c.bind("blur",g),c.bind("keydown",h),c.on("$destroy",function(){c.off("mousedown",d),c.off("click",e),c.off("focus",f),c.off("blur",g),c.off("keydown",h)})}}]),q.directive("ngCellText",function(){return function(a,b){function c(a){a.preventDefault()}function d(a){a.preventDefault()}b.bind("mouseover",c),b.bind("mouseleave",d),b.on("$destroy",function(){b.off("mouseover",c),b.off("mouseleave",d)})}}),q.directive("ngCell",["$compile","$domUtilityService",function(a,c){var d={scope:!1,compile:function(){return{pre:function(c,d){var e,f=c.col.cellTemplate.replace(l,"row.entity."+c.col.field);c.col.enableCellEdit?(e=c.col.cellEditTemplate,e=e.replace(o,c.col.cellEditableCondition),e=e.replace(m,f),e=e.replace(n,c.col.editableCellTemplate.replace(l,"row.entity."+c.col.field))):e=f;var g=b(e);d.append(g),a(g)(c),c.enableCellSelection&&-1===g[0].className.indexOf("ngSelectionCell")&&(g[0].setAttribute("tabindex",0),g.addClass("ngCellElement"))
  },post:function(a,b){a.enableCellSelection&&a.domAccessProvider.selectionHandlers(a,b),a.$on("$destroy",a.$on("ngGridEventDigestCell",function(){c.digest(a)}))}}}};return d}]),q.directive("ngEditCellIf",[function(){return{transclude:"element",priority:1e3,terminal:!0,restrict:"A",compile:function(a,b,c){return function(a,b,d){var e,f;a.$on("$destroy",a.$watch(d.ngEditCellIf,function(d){e&&(e.remove(),e=void 0),f&&(f.$destroy(),f=void 0),d&&(f=a.$new(),c(f,function(a){e=a,b.after(a)}))}))}}}}]),q.directive("ngGridFooter",["$compile","$templateCache",function(a,b){var c={scope:!1,compile:function(){return{pre:function(c,d){0===d.children().length&&d.append(a(b.get(c.gridId+"footerTemplate.html"))(c))}}}};return c}]),q.directive("ngGridMenu",["$compile","$templateCache",function(a,b){var c={scope:!1,compile:function(){return{pre:function(c,d){0===d.children().length&&d.append(a(b.get(c.gridId+"menuTemplate.html"))(c))}}}};return c}]),q.directive("ngGrid",["$compile","$filter","$templateCache","$sortService","$domUtilityService","$utilityService","$timeout","$parse","$http","$q",function(a,c,d,e,f,g,h,i,j,k){var l={scope:!0,compile:function(){return{pre:function(l,m,n){var o=b(m),p=l.$eval(n.ngGrid);p.gridDim=new v({outerHeight:b(o).height(),outerWidth:b(o).width()});var q=new z(l,p,e,f,c,d,g,h,i,j,k);return l.$on("$destroy",function(){p.gridDim=null,p.selectRow=null,p.selectItem=null,p.selectAll=null,p.selectVisible=null,p.groupBy=null,p.sortBy=null,p.gridId=null,p.ngGrid=null,p.$gridScope=null,p.$gridServices=null,l.domAccessProvider.grid=null,angular.element(q.styleSheet).remove(),q.styleSheet=null}),q.init().then(function(){if("string"==typeof p.columnDefs?l.$on("$destroy",l.$parent.$watch(p.columnDefs,function(a){return a?(q.lateBoundColumns=!1,l.columns=[],q.config.columnDefs=a,q.buildColumns(),q.eventProvider.assignEvents(),void f.RebuildGrid(l,q)):(q.refreshDomSizes(),void q.buildColumns())},!0)):q.buildColumns(),"string"==typeof p.totalServerItems?l.$on("$destroy",l.$parent.$watch(p.totalServerItems,function(a){l.totalServerItems=angular.isDefined(a)?a:0})):l.totalServerItems=0,"string"==typeof p.data){var c=function(a){q.data=b.extend([],a),q.rowFactory.fixRowCache(),angular.forEach(q.data,function(a,b){var c=q.rowMap[b]||b;q.rowCache[c]&&q.rowCache[c].ensureEntity(a),q.rowMap[c]=b}),q.searchProvider.evalFilter(),q.configureColumnWidths(),q.refreshDomSizes(),q.config.sortInfo.fields.length>0&&(q.sortColumnsInit(),l.$emit("ngGridEventSorted",q.config.sortInfo)),l.$emit("ngGridEventData",q.gridId)};l.$on("$destroy",l.$parent.$watch(p.data,c)),l.$on("$destroy",l.$parent.$watch(p.data+".length",function(){c(l.$eval(p.data)),l.adjustScrollTop(q.$viewport.scrollTop(),!0)}))}return q.footerController=new y(l,q),m.addClass("ngGrid").addClass(q.gridId.toString()),p.enableHighlighting||m.addClass("unselectable"),p.jqueryUITheme&&m.addClass("ui-widget"),m.append(a(d.get("gridTemplate.html"))(l)),f.AssignGridContainers(l,m,q),q.eventProvider=new x(q,l,f,h),p.selectRow=function(a,b){q.rowCache[a]&&(q.rowCache[a].clone&&q.rowCache[a].clone.setSelection(b?!0:!1),q.rowCache[a].setSelection(b?!0:!1))},p.selectItem=function(a,b){p.selectRow(q.rowMap[a],b)},p.selectAll=function(a){l.toggleSelectAll(a)},p.selectVisible=function(a){l.toggleSelectAll(a,!0)},p.groupBy=function(a){if(a)l.groupBy(l.columns.filter(function(b){return b.field===a})[0]);else{var c=b.extend(!0,[],l.configGroups);angular.forEach(c,l.groupBy)}},p.sortBy=function(a){var b=l.columns.filter(function(b){return b.field===a})[0];b&&b.sort()},p.gridId=q.gridId,p.ngGrid=q,p.$gridScope=l,p.$gridServices={SortService:e,DomUtilityService:f,UtilityService:g},l.$on("$destroy",l.$on("ngGridEventDigestGrid",function(){f.digest(l.$parent)})),l.$on("$destroy",l.$on("ngGridEventDigestGridParent",function(){f.digest(l.$parent)})),l.$evalAsync(function(){l.adjustScrollLeft(0)}),angular.forEach(p.plugins,function(a){"function"==typeof a&&(a=new a);var b=l.$new();a.init(b,q,p.$gridServices),p.plugins[g.getInstanceType(a)]=a,l.$on("$destroy",function(){b.$destroy()})}),"function"==typeof p.init&&p.init(q,l),null})}}}};return l}]),q.directive("ngHeaderCell",["$compile",function(a){var b={scope:!1,compile:function(){return{pre:function(b,c){c.append(a(b.col.headerCellTemplate)(b))}}}};return b}]),q.directive("ngHeaderRow",["$compile","$templateCache",function(a,b){var c={scope:!1,compile:function(){return{pre:function(c,d){0===d.children().length&&d.append(a(b.get(c.gridId+"headerRowTemplate.html"))(c))}}}};return c}]),q.directive("ngInput",[function(){return{require:"ngModel",link:function(a,b,c,d){function e(c){switch(c.keyCode){case 37:case 38:case 39:case 40:c.stopPropagation();break;case 27:a.$$phase||a.$apply(function(){d.$setViewValue(h),b.blur()});break;case 13:(a.enableCellEditOnFocus&&a.totalFilteredItemsLength()-1>a.row.rowIndex&&a.row.rowIndex>0||a.col.enableCellEdit)&&b.blur()}return!0}function f(a){a.stopPropagation()}function g(a){a.stopPropagation()}var h,i=a.$watch("ngModel",function(){h=d.$modelValue,i()});b.bind("keydown",e),b.bind("click",f),b.bind("mousedown",g),b.on("$destroy",function(){b.off("keydown",e),b.off("click",f),b.off("mousedown",g)}),a.$on("$destroy",a.$on("ngGridEventStartCellEdit",function(){b.focus(),b.select()})),angular.element(b).bind("blur",function(){a.$emit("ngGridEventEndCellEdit")})}}}]),q.directive("ngRow",["$compile","$domUtilityService","$templateCache",function(a,b,c){var d={scope:!1,compile:function(){return{pre:function(d,e){if(d.row.elm=e,d.row.clone&&(d.row.clone.elm=e),d.row.isAggRow){var f=c.get(d.gridId+"aggregateTemplate.html");f=d.row.aggLabelFilter?f.replace(k,"| "+d.row.aggLabelFilter):f.replace(k,""),e.append(a(f)(d))}else e.append(a(c.get(d.gridId+"rowTemplate.html"))(d));d.$on("$destroy",d.$on("ngGridEventDigestRow",function(){b.digest(d)}))}}}};return d}]),q.directive("ngViewport",[function(){return function(a,b){function c(b){var c=b.target.scrollLeft,d=b.target.scrollTop;return a.$headerContainer&&a.$headerContainer.scrollLeft(c),a.adjustScrollLeft(c),a.adjustScrollTop(d),a.forceSyncScrolling?i():(clearTimeout(g),g=setTimeout(i,150)),f=c,h=d,e=!1,!0}function d(){return e=!0,b.focus&&b.focus(),!0}var e,f,g,h=0,i=function(){a.$root.$$phase||a.$digest()};b.bind("scroll",c),b.bind("mousewheel DOMMouseScroll",d),b.on("$destroy",function(){b.off("scroll",c),b.off("mousewheel DOMMouseScroll",d)}),a.enableCellSelection||a.domAccessProvider.selectionHandlers(a,b)}}]),a.ngGrid.i18n.da={ngAggregateLabel:"artikler",ngGroupPanelDescription:"Grupér rækker udfra en kolonne ved at trække dens overskift hertil.",ngSearchPlaceHolder:"Søg...",ngMenuText:"Vælg kolonner:",ngShowingItemsLabel:"Viste rækker:",ngTotalItemsLabel:"Rækker totalt:",ngSelectedItemsLabel:"Valgte rækker:",ngPageSizeLabel:"Side størrelse:",ngPagerFirstTitle:"Første side",ngPagerNextTitle:"Næste side",ngPagerPrevTitle:"Forrige side",ngPagerLastTitle:"Sidste side"},a.ngGrid.i18n.de={ngAggregateLabel:"eintrag",ngGroupPanelDescription:"Ziehen Sie eine Spaltenüberschrift hierhin um nach dieser Spalte zu gruppieren.",ngSearchPlaceHolder:"Suche...",ngMenuText:"Spalten auswählen:",ngShowingItemsLabel:"Zeige Einträge:",ngTotalItemsLabel:"Einträge gesamt:",ngSelectedItemsLabel:"Ausgewählte Einträge:",ngPageSizeLabel:"Einträge pro Seite:",ngPagerFirstTitle:"Erste Seite",ngPagerNextTitle:"Nächste Seite",ngPagerPrevTitle:"Vorherige Seite",ngPagerLastTitle:"Letzte Seite"},a.ngGrid.i18n.en={ngAggregateLabel:"items",ngGroupPanelDescription:"Drag a column header here and drop it to group by that column.",ngSearchPlaceHolder:"Search...",ngMenuText:"Choose Columns:",ngShowingItemsLabel:"Showing Items:",ngTotalItemsLabel:"Total Items:",ngSelectedItemsLabel:"Selected Items:",ngPageSizeLabel:"Page Size:",ngPagerFirstTitle:"First Page",ngPagerNextTitle:"Next Page",ngPagerPrevTitle:"Previous Page",ngPagerLastTitle:"Last Page"},a.ngGrid.i18n.es={ngAggregateLabel:"Artículos",ngGroupPanelDescription:"Arrastre un encabezado de columna aquí y soltarlo para agrupar por esa columna.",ngSearchPlaceHolder:"Buscar...",ngMenuText:"Elegir columnas:",ngShowingItemsLabel:"Artículos Mostrando:",ngTotalItemsLabel:"Artículos Totales:",ngSelectedItemsLabel:"Artículos Seleccionados:",ngPageSizeLabel:"Tamaño de Página:",ngPagerFirstTitle:"Primera Página",ngPagerNextTitle:"Página Siguiente",ngPagerPrevTitle:"Página Anterior",ngPagerLastTitle:"Última Página"},a.ngGrid.i18n.fa={ngAggregateLabel:"موردها",ngGroupPanelDescription:"یک عنوان ستون اینجا را بردار و به گروهی از آن ستون بیانداز.",ngSearchPlaceHolder:"جستجو...",ngMenuText:"انتخاب ستون‌ها:",ngShowingItemsLabel:"نمایش موردها:",ngTotalItemsLabel:"همهٔ موردها:",ngSelectedItemsLabel:"موردهای انتخاب‌شده:",ngPageSizeLabel:"اندازهٔ صفحه:",ngPagerFirstTitle:"صفحهٔ اول",ngPagerNextTitle:"صفحهٔ بعد",ngPagerPrevTitle:"صفحهٔ قبل",ngPagerLastTitle:"آخرین صفحه"},a.ngGrid.i18n.fr={ngAggregateLabel:"articles",ngGroupPanelDescription:"Faites glisser un en-tête de colonne ici et déposez-le vers un groupe par cette colonne.",ngSearchPlaceHolder:"Recherche...",ngMenuText:"Choisir des colonnes:",ngShowingItemsLabel:"Articles Affichage des:",ngTotalItemsLabel:"Nombre total d'articles:",ngSelectedItemsLabel:"Éléments Articles:",ngPageSizeLabel:"Taille de page:",ngPagerFirstTitle:"Première page",ngPagerNextTitle:"Page Suivante",ngPagerPrevTitle:"Page précédente",ngPagerLastTitle:"Dernière page"},a.ngGrid.i18n.nl={ngAggregateLabel:"items",ngGroupPanelDescription:"Sleep hier een kolomkop om op te groeperen.",ngSearchPlaceHolder:"Zoeken...",ngMenuText:"Kies kolommen:",ngShowingItemsLabel:"Toon items:",ngTotalItemsLabel:"Totaal items:",ngSelectedItemsLabel:"Geselecteerde items:",ngPageSizeLabel:"Pagina grootte:, ",ngPagerFirstTitle:"Eerste pagina",ngPagerNextTitle:"Volgende pagina",ngPagerPrevTitle:"Vorige pagina",ngPagerLastTitle:"Laatste pagina"},a.ngGrid.i18n["pt-br"]={ngAggregateLabel:"itens",ngGroupPanelDescription:"Arraste e solte uma coluna aqui para agrupar por essa coluna",ngSearchPlaceHolder:"Procurar...",ngMenuText:"Selecione as colunas:",ngShowingItemsLabel:"Mostrando os Itens:",ngTotalItemsLabel:"Total de Itens:",ngSelectedItemsLabel:"Items Selecionados:",ngPageSizeLabel:"Tamanho da Página:",ngPagerFirstTitle:"Primeira Página",ngPagerNextTitle:"Próxima Página",ngPagerPrevTitle:"Página Anterior",ngPagerLastTitle:"Última Página"},a.ngGrid.i18n["zh-cn"]={ngAggregateLabel:"条目",ngGroupPanelDescription:"拖曳表头到此处以进行分组",ngSearchPlaceHolder:"搜索...",ngMenuText:"数据分组与选择列：",ngShowingItemsLabel:"当前显示条目：",ngTotalItemsLabel:"条目总数：",ngSelectedItemsLabel:"选中条目：",ngPageSizeLabel:"每页显示数：",ngPagerFirstTitle:"回到首页",ngPagerNextTitle:"下一页",ngPagerPrevTitle:"上一页",ngPagerLastTitle:"前往尾页"},a.ngGrid.i18n["zh-tw"]={ngAggregateLabel:"筆",ngGroupPanelDescription:"拖拉表頭到此處以進行分組",ngSearchPlaceHolder:"搜尋...",ngMenuText:"選擇欄位：",ngShowingItemsLabel:"目前顯示筆數：",ngTotalItemsLabel:"總筆數：",ngSelectedItemsLabel:"選取筆數：",ngPageSizeLabel:"每頁顯示：",ngPagerFirstTitle:"第一頁",ngPagerNextTitle:"下一頁",ngPagerPrevTitle:"上一頁",ngPagerLastTitle:"最後頁"},angular.module("ngGrid").run(["$templateCache",function(a){a.put("aggregateTemplate.html",'<div ng-click="row.toggleExpand()" ng-style="rowStyle(row)" class="ngAggregate">\r\n    <span class="ngAggregateText">{{row.label CUSTOM_FILTERS}} ({{row.totalChildren()}} {{AggItemsLabel}})</span>\r\n    <div class="{{row.aggClass()}}"></div>\r\n</div>\r\n'),a.put("cellEditTemplate.html",'<div ng-cell-has-focus ng-dblclick="CELL_EDITABLE_CONDITION && editCell()">\r\n	<div ng-edit-cell-if="!(isFocused && CELL_EDITABLE_CONDITION)">	\r\n		DISPLAY_CELL_TEMPLATE\r\n	</div>\r\n	<div ng-edit-cell-if="isFocused && CELL_EDITABLE_CONDITION">\r\n		EDITABLE_CELL_TEMPLATE\r\n	</div>\r\n</div>\r\n'),a.put("cellTemplate.html",'<div class="ngCellText" ng-class="col.colIndex()"><span ng-cell-text>{{COL_FIELD CUSTOM_FILTERS}}</span></div>'),a.put("checkboxCellTemplate.html",'<div class="ngSelectionCell"><input tabindex="-1" class="ngSelectionCheckbox" type="checkbox" ng-checked="row.selected" /></div>'),a.put("checkboxHeaderTemplate.html",'<input class="ngSelectionHeader" type="checkbox" ng-show="multiSelect" ng-model="allSelected" ng-change="toggleSelectAll(allSelected, true)"/>'),a.put("editableCellTemplate.html",'<input ng-class="\'colt\' + col.index" ng-input="COL_FIELD" ng-model="COL_FIELD" />'),a.put("footerTemplate.html",'<div ng-show="showFooter" class="ngFooterPanel" ng-class="{\'ui-widget-content\': jqueryUITheme, \'ui-corner-bottom\': jqueryUITheme}" ng-style="footerStyle()">\r\n    <div class="ngTotalSelectContainer" >\r\n        <div class="ngFooterTotalItems" ng-class="{\'ngNoMultiSelect\': !multiSelect}" >\r\n            <span class="ngLabel">{{i18n.ngTotalItemsLabel}} {{maxRows()}}</span><span ng-show="filterText.length > 0" class="ngLabel">({{i18n.ngShowingItemsLabel}} {{totalFilteredItemsLength()}})</span>\r\n        </div>\r\n        <div class="ngFooterSelectedItems" ng-show="multiSelect">\r\n            <span class="ngLabel">{{i18n.ngSelectedItemsLabel}} {{selectedItems.length}}</span>\r\n        </div>\r\n    </div>\r\n    <div class="ngPagerContainer" style="float: right; margin-top: 10px;" ng-show="enablePaging" ng-class="{\'ngNoMultiSelect\': !multiSelect}">\r\n        <div style="float:left; margin-right: 10px;" class="ngRowCountPicker">\r\n            <span style="float: left; margin-top: 3px;" class="ngLabel">{{i18n.ngPageSizeLabel}}</span>\r\n            <select style="float: left;height: 27px; width: 100px" ng-model="pagingOptions.pageSize" >\r\n                <option ng-repeat="size in pagingOptions.pageSizes">{{size}}</option>\r\n            </select>\r\n        </div>\r\n        <div style="float:left; margin-right: 10px; line-height:25px;" class="ngPagerControl" style="float: left; min-width: 135px;">\r\n            <button type="button" class="ngPagerButton" ng-click="pageToFirst()" ng-disabled="cantPageBackward()" title="{{i18n.ngPagerFirstTitle}}"><div class="ngPagerFirstTriangle"><div class="ngPagerFirstBar"></div></div></button>\r\n            <button type="button" class="ngPagerButton" ng-click="pageBackward()" ng-disabled="cantPageBackward()" title="{{i18n.ngPagerPrevTitle}}"><div class="ngPagerFirstTriangle ngPagerPrevTriangle"></div></button>\r\n            <input class="ngPagerCurrent" min="1" max="{{currentMaxPages}}" type="number" style="width:50px; height: 24px; margin-top: 1px; padding: 0 4px;" ng-model="pagingOptions.currentPage"/>\r\n            <span class="ngGridMaxPagesNumber" ng-show="maxPages() > 0">/ {{maxPages()}}</span>\r\n            <button type="button" class="ngPagerButton" ng-click="pageForward()" ng-disabled="cantPageForward()" title="{{i18n.ngPagerNextTitle}}"><div class="ngPagerLastTriangle ngPagerNextTriangle"></div></button>\r\n            <button type="button" class="ngPagerButton" ng-click="pageToLast()" ng-disabled="cantPageToLast()" title="{{i18n.ngPagerLastTitle}}"><div class="ngPagerLastTriangle"><div class="ngPagerLastBar"></div></div></button>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),a.put("gridTemplate.html",'<div class="ngTopPanel" ng-class="{\'ui-widget-header\':jqueryUITheme, \'ui-corner-top\': jqueryUITheme}" ng-style="topPanelStyle()">\r\n    <div class="ngGroupPanel" ng-show="showGroupPanel()" ng-style="groupPanelStyle()">\r\n        <div class="ngGroupPanelDescription" ng-show="configGroups.length == 0">{{i18n.ngGroupPanelDescription}}</div>\r\n        <ul ng-show="configGroups.length > 0" class="ngGroupList">\r\n            <li class="ngGroupItem" ng-repeat="group in configGroups">\r\n                <span class="ngGroupElement">\r\n                    <span class="ngGroupName">{{group.displayName}}\r\n                        <span ng-click="removeGroup($index)" class="ngRemoveGroup">x</span>\r\n                    </span>\r\n                    <span ng-hide="$last" class="ngGroupArrow"></span>\r\n                </span>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n    <div class="ngHeaderContainer" ng-style="headerStyle()">\r\n        <div ng-header-row class="ngHeaderScroller" ng-style="headerScrollerStyle()"></div>\r\n    </div>\r\n    <div ng-grid-menu></div>\r\n</div>\r\n<div class="ngViewport" unselectable="on" ng-viewport ng-class="{\'ui-widget-content\': jqueryUITheme}" ng-style="viewportStyle()">\r\n    <div class="ngCanvas" ng-style="canvasStyle()">\r\n        <div ng-style="rowStyle(row)" ng-repeat="row in renderedRows" ng-click="row.toggleSelected($event)" ng-class="row.alternatingRowClass()" ng-row></div>\r\n    </div>\r\n</div>\r\n<div ng-grid-footer></div>\r\n'),a.put("headerCellTemplate.html",'<div class="ngHeaderSortColumn {{col.headerClass}}" ng-style="{\'cursor\': col.cursor}" ng-class="{ \'ngSorted\': !col.noSortVisible() }">\r\n    <div ng-click="col.sort($event)" ng-class="\'colt\' + col.index" class="ngHeaderText">{{col.displayName}}</div>\r\n    <div class="ngSortButtonDown" ng-click="col.sort($event)" ng-show="col.showSortButtonDown()"></div>\r\n    <div class="ngSortButtonUp" ng-click="col.sort($event)" ng-show="col.showSortButtonUp()"></div>\r\n    <div class="ngSortPriority">{{col.sortPriority}}</div>\r\n    <div ng-class="{ ngPinnedIcon: col.pinned, ngUnPinnedIcon: !col.pinned }" ng-click="togglePin(col)" ng-show="col.pinnable"></div>\r\n</div>\r\n<div ng-show="col.resizable" class="ngHeaderGrip" ng-click="col.gripClick($event)" ng-mousedown="col.gripOnMouseDown($event)"></div>\r\n'),a.put("headerRowTemplate.html",'<div ng-style="{ height: col.headerRowHeight }" ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngHeaderCell">\r\n	<div class="ngVerticalBar" ng-style="{height: col.headerRowHeight}" ng-class="{ ngVerticalBarVisible: !$last }">&nbsp;</div>\r\n	<div ng-header-cell></div>\r\n</div>'),a.put("menuTemplate.html",'<div ng-show="showColumnMenu || showFilter"  class="ngHeaderButton" ng-click="toggleShowMenu()">\r\n    <div class="ngHeaderButtonArrow"></div>\r\n</div>\r\n<div ng-show="showMenu" class="ngColMenu">\r\n    <div ng-show="showFilter">\r\n        <input placeholder="{{i18n.ngSearchPlaceHolder}}" type="text" ng-model="filterText"/>\r\n    </div>\r\n    <div ng-show="showColumnMenu">\r\n        <span class="ngMenuText">{{i18n.ngMenuText}}</span>\r\n        <ul class="ngColList">\r\n            <li class="ngColListItem" ng-repeat="col in columns | ngColumns">\r\n                <label><input ng-disabled="col.pinned" type="checkbox" class="ngColListCheckbox" ng-model="col.visible"/>{{col.displayName}}</label>\r\n				<a title="Group By" ng-class="col.groupedByClass()" ng-show="col.groupable && col.visible" ng-click="groupBy(col)"></a>\r\n				<span class="ngGroupingNumber" ng-show="col.groupIndex > 0">{{col.groupIndex}}</span>          \r\n            </li>\r\n        </ul>\r\n    </div>\r\n</div>'),a.put("rowTemplate.html",'<div ng-style="{ \'cursor\': row.cursor }" ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngCell {{col.cellClass}}">\r\n	<div class="ngVerticalBar" ng-style="{height: rowHeight}" ng-class="{ ngVerticalBarVisible: !$last }">&nbsp;</div>\r\n	<div ng-cell></div>\r\n</div>')}])}(window,jQuery),d3=function(){function a(a){return null!=a&&!isNaN(a)}function b(a){return a.length}function c(a){for(var b=1;a*b%1;)b*=10;return b}function d(a,b){try{for(var c in b)Object.defineProperty(a.prototype,c,{value:b[c],enumerable:!1})}catch(d){a.prototype=b}}function e(){}function f(){}function g(a,b,c){return function(){var d=c.apply(b,arguments);return d===b?a:d}}function h(a,b){if(b in a)return b;b=b.charAt(0).toUpperCase()+b.substring(1);for(var c=0,d=lh.length;d>c;++c){var e=lh[c]+b;if(e in a)return e}}function i(){}function j(){}function k(a){function b(){for(var b,d=c,e=-1,f=d.length;++e<f;)(b=d[e].on)&&b.apply(this,arguments);return a}var c=[],d=new e;return b.on=function(b,e){var f,g=d.get(b);return arguments.length<2?g&&g.on:(g&&(g.on=null,c=c.slice(0,f=c.indexOf(g)).concat(c.slice(f+1)),d.remove(b)),e&&c.push(d.set(b,{on:e})),a)},b}function l(){Wg.event.preventDefault()}function m(){for(var a,b=Wg.event;a=b.sourceEvent;)b=a;return b}function n(a){for(var b=new j,c=0,d=arguments.length;++c<d;)b[arguments[c]]=k(b);return b.of=function(c,d){return function(e){try{var f=e.sourceEvent=Wg.event;e.target=a,Wg.event=e,b[e.type].apply(c,d)}finally{Wg.event=f}}},b}function o(a){return nh(a,sh),a}function p(a){return"function"==typeof a?a:function(){return oh(a,this)}}function q(a){return"function"==typeof a?a:function(){return ph(a,this)}}function r(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=Wg.ns.qualify(a),null==b?a.local?d:c:"function"==typeof b?a.local?h:g:a.local?f:e}function s(a){return a.trim().replace(/\s+/g," ")}function t(a){return new RegExp("(?:^|\\s+)"+Wg.requote(a)+"(?:\\s+|$)","g")}function u(a){return a.trim().split(/^|\s+/)}function v(a,b){function c(){for(var c=-1;++c<e;)a[c](this,b)}function d(){for(var c=-1,d=b.apply(this,arguments);++c<e;)a[c](this,d)}a=u(a).map(w);var e=a.length;return"function"==typeof b?d:c}function w(a){var b=t(a);return function(c,d){if(e=c.classList)return d?e.add(a):e.remove(a);var e=c.getAttribute("class")||"";d?(b.lastIndex=0,b.test(e)||c.setAttribute("class",s(e+" "+a))):c.setAttribute("class",s(e.replace(b," ")))}}function x(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 y(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 z(a){return"function"==typeof a?a:(a=Wg.ns.qualify(a)).local?function(){return this.ownerDocument.createElementNS(a.space,a.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,a)}}function A(a){return{__data__:a}}function B(a){return function(){return rh(this,a)}}function C(a){return arguments.length||(a=Wg.ascending),function(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}}function D(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 E(a){return nh(a,uh),a}function F(a){var b,c;return function(d,e,f){var g,h=a[f].update,i=h.length;for(f!=c&&(c=f,b=0),e>=b&&(b=e+1);!(g=h[b])&&++b<i;);return g}}function G(){var a=this.__transition__;a&&++a.active}function H(a,b,c){function d(){var b=this[g];b&&(this.removeEventListener(a,b,b.$),delete this[g])}function e(){var e=j(b,Yg(arguments));d.call(this),this.addEventListener(a,this[g]=e,e.$=c),e._=b}function f(){var b,c=new RegExp("^__on([^.]+)"+Wg.requote(a)+"$");for(var d in this)if(b=d.match(c)){var e=this[d];this.removeEventListener(b[1],e,e.$),delete this[d]}}var g="__on"+a,h=a.indexOf("."),j=I;h>0&&(a=a.substring(0,h));var k=wh.get(a);return k&&(a=k,j=J),h?b?e:d:b?i:f}function I(a,b){return function(c){var d=Wg.event;Wg.event=c,b[0]=this.__data__;try{a.apply(this,b)}finally{Wg.event=d}}}function J(a,b){var c=I(a,b);return function(a){var b=this,d=a.relatedTarget;d&&(d===b||8&d.compareDocumentPosition(b))||c.call(b,a)}}function K(){var a=".dragsuppress-"+ ++yh,b="click"+a,c=Wg.select(_g).on("touchmove"+a,l).on("dragstart"+a,l).on("selectstart"+a,l);if(xh){var d=$g.style,e=d[xh];d[xh]="none"}return function(f){function g(){c.on(b,null)}c.on(a,null),xh&&(d[xh]=e),f&&(c.on(b,function(){l(),g()},!0),setTimeout(g,0))}}function L(a,b){b.changedTouches&&(b=b.changedTouches[0]);var c=a.ownerSVGElement||a;if(c.createSVGPoint){var d=c.createSVGPoint();if(0>zh&&(_g.scrollX||_g.scrollY)){c=Wg.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var e=c[0][0].getScreenCTM();zh=!(e.f||e.e),c.remove()}return zh?(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]}var f=a.getBoundingClientRect();return[b.clientX-f.left-a.clientLeft,b.clientY-f.top-a.clientTop]}function M(a){return a>0?1:0>a?-1:0}function N(a){return a>1?0:-1>a?Ah:Math.acos(a)}function O(a){return a>1?Ch:-1>a?-Ch:Math.asin(a)}function P(a){return((a=Math.exp(a))-1/a)/2}function Q(a){return((a=Math.exp(a))+1/a)/2}function R(a){return((a=Math.exp(2*a))-1)/(a+1)}function S(a){return(a=Math.sin(a/2))*a}function T(){}function U(a,b,c){return new V(a,b,c)}function V(a,b,c){this.h=a,this.s=b,this.l=c}function W(a,b,c){function d(a){return a>360?a-=360:0>a&&(a+=360),60>a?f+(g-f)*a/60:180>a?g:240>a?f+(g-f)*(240-a)/60:f}function e(a){return Math.round(255*d(a))}var f,g;return a=isNaN(a)?0:(a%=360)<0?a+360:a,b=isNaN(b)?0:0>b?0:b>1?1:b,c=0>c?0:c>1?1:c,g=.5>=c?c*(1+b):c+b-c*b,f=2*c-g,hb(e(a+120),e(a),e(a-120))}function X(a,b,c){return new Y(a,b,c)}function Y(a,b,c){this.h=a,this.c=b,this.l=c}function Z(a,b,c){return isNaN(a)&&(a=0),isNaN(b)&&(b=0),$(c,Math.cos(a*=Fh)*b,Math.sin(a)*b)}function $(a,b,c){return new _(a,b,c)}function _(a,b,c){this.l=a,this.a=b,this.b=c}function ab(a,b,c){var d=(a+16)/116,e=d+b/500,f=d-c/200;return e=cb(e)*Qh,d=cb(d)*Rh,f=cb(f)*Sh,hb(eb(3.2404542*e-1.5371385*d-.4985314*f),eb(-.969266*e+1.8760108*d+.041556*f),eb(.0556434*e-.2040259*d+1.0572252*f))}function bb(a,b,c){return a>0?X(Math.atan2(c,b)*Gh,Math.sqrt(b*b+c*c),a):X(0/0,0/0,a)}function cb(a){return a>.206893034?a*a*a:(a-4/29)/7.787037}function db(a){return a>.008856?Math.pow(a,1/3):7.787037*a+4/29}function eb(a){return Math.round(255*(.00304>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055))}function fb(a){return hb(a>>16,a>>8&255,255&a)}function gb(a){return fb(a)+""}function hb(a,b,c){return new ib(a,b,c)}function ib(a,b,c){this.r=a,this.g=b,this.b=c}function jb(a){return 16>a?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function kb(a,b,c){var d,e,f,g=0,h=0,i=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(ob(e[0]),ob(e[1]),ob(e[2]))}return(f=Vh.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,i=a.charAt(3),i+=i):7===a.length&&(g=a.substring(1,3),h=a.substring(3,5),i=a.substring(5,7)),g=parseInt(g,16),h=parseInt(h,16),i=parseInt(i,16)),b(g,h,i))}function lb(a,b,c){var d,e,f=Math.min(a/=255,b/=255,c/=255),g=Math.max(a,b,c),h=g-f,i=(g+f)/2;return h?(e=.5>i?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):(d=0/0,e=i>0&&1>i?0:d),U(d,e,i)}function mb(a,b,c){a=nb(a),b=nb(b),c=nb(c);var d=db((.4124564*a+.3575761*b+.1804375*c)/Qh),e=db((.2126729*a+.7151522*b+.072175*c)/Rh),f=db((.0193339*a+.119192*b+.9503041*c)/Sh);return $(116*e-16,500*(d-e),200*(e-f))}function nb(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function ob(a){var b=parseFloat(a);return"%"===a.charAt(a.length-1)?Math.round(2.55*b):b}function pb(a){return"function"==typeof a?a:function(){return a}}function qb(a){return a}function rb(a){return function(b,c,d){return 2===arguments.length&&"function"==typeof c&&(d=c,c=null),sb(b,c,a,d)}}function sb(a,b,c,d){function e(){var a,b=i.status;if(!b&&i.responseText||b>=200&&300>b||304===b){try{a=c.call(f,i)}catch(d){return void g.error.call(f,d)}g.load.call(f,a)}else g.error.call(f,i)}var f={},g=Wg.dispatch("beforesend","progress","load","error"),h={},i=new XMLHttpRequest,j=null;return!_g.XDomainRequest||"withCredentials"in i||!/^(http(s)?:)?\/\//.test(a)||(i=new XDomainRequest),"onload"in i?i.onload=i.onerror=e:i.onreadystatechange=function(){i.readyState>3&&e()},i.onprogress=function(a){var b=Wg.event;Wg.event=a;try{g.progress.call(f,i)}finally{Wg.event=b}},f.header=function(a,b){return a=(a+"").toLowerCase(),arguments.length<2?h[a]:(null==b?delete h[a]:h[a]=b+"",f)},f.mimeType=function(a){return arguments.length?(b=null==a?null:a+"",f):b},f.responseType=function(a){return arguments.length?(j=a,f):j},f.response=function(a){return c=a,f},["get","post"].forEach(function(a){f[a]=function(){return f.send.apply(f,[a].concat(Yg(arguments)))}}),f.send=function(c,d,e){if(2===arguments.length&&"function"==typeof d&&(e=d,d=null),i.open(c,a,!0),null==b||"accept"in h||(h.accept=b+",*/*"),i.setRequestHeader)for(var k in h)i.setRequestHeader(k,h[k]);return null!=b&&i.overrideMimeType&&i.overrideMimeType(b),null!=j&&(i.responseType=j),null!=e&&f.on("error",e).on("load",function(a){e(null,a)}),g.beforesend.call(f,i),i.send(null==d?null:d),f},f.abort=function(){return i.abort(),f},Wg.rebind(f,g,"on"),null==d?f:f.get(tb(d))}function tb(a){return 1===a.length?function(b,c){a(null==b?c:null)}:a}function ub(){var a=vb(),b=wb()-a;b>24?(isFinite(b)&&(clearTimeout(Zh),Zh=setTimeout(ub,b)),Yh=0):(Yh=1,_h(ub))}function vb(){var a=Date.now();for($h=Wh;$h;)a>=$h.t&&($h.f=$h.c(a-$h.t)),$h=$h.n;return a}function wb(){for(var a,b=Wh,c=1/0;b;)b.f?b=a?a.n=b.n:Wh=b.n:(b.t<c&&(c=b.t),b=(a=b).n);return Xh=a,c}function xb(a,b){var c=Math.pow(10,3*ih(8-b));return{scale:b>8?function(a){return a/c}:function(a){return a*c},symbol:a}}function yb(a,b){return b-(a?Math.ceil(Math.log(a)/Math.LN10):1)}function zb(a){return a+""}function Ab(){}function Bb(a,b,c){var d=c.s=a+b,e=d-a,f=d-e;c.t=a-f+(b-e)}function Cb(a,b){a&&li.hasOwnProperty(a.type)&&li[a.type](a,b)}function Db(a,b,c){var d,e=-1,f=a.length-c;for(b.lineStart();++e<f;)d=a[e],b.point(d[0],d[1],d[2]);b.lineEnd()}function Eb(a,b){var c=-1,d=a.length;for(b.polygonStart();++c<d;)Db(a[c],b,1);b.polygonEnd()}function Fb(){function a(a,b){a*=Fh,b=b*Fh/2+Ah/4;var c=a-d,g=Math.cos(b),h=Math.sin(b),i=f*h,j=e*g+i*Math.cos(c),k=i*Math.sin(c);ni.add(Math.atan2(k,j)),d=a,e=g,f=h}var b,c,d,e,f;oi.point=function(g,h){oi.point=a,d=(b=g)*Fh,e=Math.cos(h=(c=h)*Fh/2+Ah/4),f=Math.sin(h)},oi.lineEnd=function(){a(b,c)}}function Gb(a){var b=a[0],c=a[1],d=Math.cos(c);return[d*Math.cos(b),d*Math.sin(b),Math.sin(c)]}function Hb(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function Ib(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 Jb(a,b){a[0]+=b[0],a[1]+=b[1],a[2]+=b[2]}function Kb(a,b){return[a[0]*b,a[1]*b,a[2]*b]}function Lb(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);a[0]/=b,a[1]/=b,a[2]/=b}function Mb(a){return[Math.atan2(a[1],a[0]),O(a[2])]}function Nb(a,b){return ih(a[0]-b[0])<Dh&&ih(a[1]-b[1])<Dh}function Ob(a,b){a*=Fh;var c=Math.cos(b*=Fh);Pb(c*Math.cos(a),c*Math.sin(a),Math.sin(b))}function Pb(a,b,c){++pi,ri+=(a-ri)/pi,si+=(b-si)/pi,ti+=(c-ti)/pi}function Qb(){function a(a,e){a*=Fh;var f=Math.cos(e*=Fh),g=f*Math.cos(a),h=f*Math.sin(a),i=Math.sin(e),j=Math.atan2(Math.sqrt((j=c*i-d*h)*j+(j=d*g-b*i)*j+(j=b*h-c*g)*j),b*g+c*h+d*i);qi+=j,ui+=j*(b+(b=g)),vi+=j*(c+(c=h)),wi+=j*(d+(d=i)),Pb(b,c,d)}var b,c,d;Ai.point=function(e,f){e*=Fh;var g=Math.cos(f*=Fh);b=g*Math.cos(e),c=g*Math.sin(e),d=Math.sin(f),Ai.point=a,Pb(b,c,d)}}function Rb(){Ai.point=Ob}function Sb(){function a(a,b){a*=Fh;var c=Math.cos(b*=Fh),g=c*Math.cos(a),h=c*Math.sin(a),i=Math.sin(b),j=e*i-f*h,k=f*g-d*i,l=d*h-e*g,m=Math.sqrt(j*j+k*k+l*l),n=d*g+e*h+f*i,o=m&&-N(n)/m,p=Math.atan2(m,n);xi+=o*j,yi+=o*k,zi+=o*l,qi+=p,ui+=p*(d+(d=g)),vi+=p*(e+(e=h)),wi+=p*(f+(f=i)),Pb(d,e,f)}var b,c,d,e,f;Ai.point=function(g,h){b=g,c=h,Ai.point=a,g*=Fh;var i=Math.cos(h*=Fh);d=i*Math.cos(g),e=i*Math.sin(g),f=Math.sin(h),Pb(d,e,f)},Ai.lineEnd=function(){a(b,c),Ai.lineEnd=Rb,Ai.point=Ob}}function Tb(){return!0}function Ub(a,b,c,d,e){var f=[],g=[];if(a.forEach(function(a){if(!((b=a.length-1)<=0)){var b,c=a[0],d=a[b];if(Nb(c,d)){e.lineStart();for(var h=0;b>h;++h)e.point((c=a[h])[0],c[1]);return void e.lineEnd()}var i=new Wb(c,a,null,!0),j=new Wb(c,null,i,!1);i.o=j,f.push(i),g.push(j),i=new Wb(d,a,null,!1),j=new Wb(d,null,i,!0),i.o=j,f.push(i),g.push(j)
  }}),g.sort(b),Vb(f),Vb(g),f.length){for(var h=0,i=c,j=g.length;j>h;++h)g[h].e=i=!i;for(var k,l,m=f[0];;){for(var n=m,o=!0;n.v;)if((n=n.n)===m)return;k=n.z,e.lineStart();do{if(n.v=n.o.v=!0,n.e){if(o)for(var h=0,j=k.length;j>h;++h)e.point((l=k[h])[0],l[1]);else d(n.x,n.n.x,1,e);n=n.n}else{if(o){k=n.p.z;for(var h=k.length-1;h>=0;--h)e.point((l=k[h])[0],l[1])}else d(n.x,n.p.x,-1,e);n=n.p}n=n.o,k=n.z,o=!o}while(!n.v);e.lineEnd()}}}function Vb(a){if(b=a.length){for(var b,c,d=0,e=a[0];++d<b;)e.n=c=a[d],c.p=e,e=c;e.n=c=a[0],c.p=e}}function Wb(a,b,c,d){this.x=a,this.z=b,this.o=c,this.e=d,this.v=!1,this.n=this.p=null}function Xb(a,b,c,d){return function(e,f){function g(b,c){var d=e(b,c);a(b=d[0],c=d[1])&&f.point(b,c)}function h(a,b){var c=e(a,b);q.point(c[0],c[1])}function i(){s.point=h,q.lineStart()}function j(){s.point=g,q.lineEnd()}function k(a,b){p.push([a,b]);var c=e(a,b);u.point(c[0],c[1])}function l(){u.lineStart(),p=[]}function m(){k(p[0][0],p[0][1]),u.lineEnd();var a,b=u.clean(),c=t.buffer(),d=c.length;if(p.pop(),o.push(p),p=null,d){if(1&b){a=c[0];var e,d=a.length-1,g=-1;for(f.lineStart();++g<d;)f.point((e=a[g])[0],e[1]);return void f.lineEnd()}d>1&&2&b&&c.push(c.pop().concat(c.shift())),n.push(c.filter(Yb))}}var n,o,p,q=b(f),r=e.invert(d[0],d[1]),s={point:g,lineStart:i,lineEnd:j,polygonStart:function(){s.point=k,s.lineStart=l,s.lineEnd=m,n=[],o=[],f.polygonStart()},polygonEnd:function(){s.point=g,s.lineStart=i,s.lineEnd=j,n=Wg.merge(n);var a=_b(r,o);n.length?Ub(n,$b,a,c,f):a&&(f.lineStart(),c(null,null,1,f),f.lineEnd()),f.polygonEnd(),n=o=null},sphere:function(){f.polygonStart(),f.lineStart(),c(null,null,1,f),f.lineEnd(),f.polygonEnd()}},t=Zb(),u=b(t);return s}}function Yb(a){return a.length>1}function Zb(){var a,b=[];return{lineStart:function(){b.push(a=[])},point:function(b,c){a.push([b,c])},lineEnd:i,buffer:function(){var c=b;return b=[],a=null,c},rejoin:function(){b.length>1&&b.push(b.pop().concat(b.shift()))}}}function $b(a,b){return((a=a.x)[0]<0?a[1]-Ch-Dh:Ch-a[1])-((b=b.x)[0]<0?b[1]-Ch-Dh:Ch-b[1])}function _b(a,b){var c=a[0],d=a[1],e=[Math.sin(c),-Math.cos(c),0],f=0,g=0;ni.reset();for(var h=0,i=b.length;i>h;++h){var j=b[h],k=j.length;if(k)for(var l=j[0],m=l[0],n=l[1]/2+Ah/4,o=Math.sin(n),p=Math.cos(n),q=1;;){q===k&&(q=0),a=j[q];var r=a[0],s=a[1]/2+Ah/4,t=Math.sin(s),u=Math.cos(s),v=r-m,w=ih(v)>Ah,x=o*t;if(ni.add(Math.atan2(x*Math.sin(v),p*u+x*Math.cos(v))),f+=w?v+(v>=0?Bh:-Bh):v,w^m>=c^r>=c){var y=Ib(Gb(l),Gb(a));Lb(y);var z=Ib(e,y);Lb(z);var A=(w^v>=0?-1:1)*O(z[2]);(d>A||d===A&&(y[0]||y[1]))&&(g+=w^v>=0?1:-1)}if(!q++)break;m=r,o=t,p=u,l=a}}return(-Dh>f||Dh>f&&0>ni)^1&g}function ac(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=f>0?Ah:-Ah,i=ih(f-c);ih(i-Ah)<Dh?(a.point(c,d=(d+g)/2>0?Ch:-Ch),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),a.point(f,d),b=0):e!==h&&i>=Ah&&(ih(c-e)<Dh&&(c-=e*Dh),ih(f-h)<Dh&&(f-=h*Dh),d=bc(c,d,f,g),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 bc(a,b,c,d){var e,f,g=Math.sin(a-c);return ih(g)>Dh?Math.atan((Math.sin(b)*(f=Math.cos(d))*Math.sin(c)-Math.sin(d)*(e=Math.cos(b))*Math.sin(a))/(e*f*g)):(b+d)/2}function cc(a,b,c,d){var e;if(null==a)e=c*Ch,d.point(-Ah,e),d.point(0,e),d.point(Ah,e),d.point(Ah,0),d.point(Ah,-e),d.point(0,-e),d.point(-Ah,-e),d.point(-Ah,0),d.point(-Ah,e);else if(ih(a[0]-b[0])>Dh){var f=a[0]<b[0]?Ah:-Ah;e=c*f/2,d.point(-f,e),d.point(0,e),d.point(f,e)}else d.point(b[0],b[1])}function dc(a){function b(a,b){return Math.cos(a)*Math.cos(b)>f}function c(a){var c,f,i,j,k;return{lineStart:function(){j=i=!1,k=1},point:function(l,m){var n,o=[l,m],p=b(l,m),q=g?p?0:e(l,m):p?e(l+(0>l?Ah:-Ah),m):0;if(!c&&(j=i=p)&&a.lineStart(),p!==i&&(n=d(c,o),(Nb(c,n)||Nb(o,n))&&(o[0]+=Dh,o[1]+=Dh,p=b(o[0],o[1]))),p!==i)k=0,p?(a.lineStart(),n=d(o,c),a.point(n[0],n[1])):(n=d(c,o),a.point(n[0],n[1]),a.lineEnd()),c=n;else if(h&&c&&g^p){var r;q&f||!(r=d(o,c,!0))||(k=0,g?(a.lineStart(),a.point(r[0][0],r[0][1]),a.point(r[1][0],r[1][1]),a.lineEnd()):(a.point(r[1][0],r[1][1]),a.lineEnd(),a.lineStart(),a.point(r[0][0],r[0][1])))}!p||c&&Nb(c,o)||a.point(o[0],o[1]),c=o,i=p,f=q},lineEnd:function(){i&&a.lineEnd(),c=null},clean:function(){return k|(j&&i)<<1}}}function d(a,b,c){var d=Gb(a),e=Gb(b),g=[1,0,0],h=Ib(d,e),i=Hb(h,h),j=h[0],k=i-j*j;if(!k)return!c&&a;var l=f*i/k,m=-f*j/k,n=Ib(g,h),o=Kb(g,l),p=Kb(h,m);Jb(o,p);var q=n,r=Hb(o,q),s=Hb(q,q),t=r*r-s*(Hb(o,o)-1);if(!(0>t)){var u=Math.sqrt(t),v=Kb(q,(-r-u)/s);if(Jb(v,o),v=Mb(v),!c)return v;var w,x=a[0],y=b[0],z=a[1],A=b[1];x>y&&(w=x,x=y,y=w);var B=y-x,C=ih(B-Ah)<Dh,D=C||Dh>B;if(!C&&z>A&&(w=z,z=A,A=w),D?C?z+A>0^v[1]<(ih(v[0]-x)<Dh?z:A):z<=v[1]&&v[1]<=A:B>Ah^(x<=v[0]&&v[0]<=y)){var E=Kb(q,(-r+u)/s);return Jb(E,o),[v,Mb(E)]}}}function e(b,c){var d=g?a:Ah-a,e=0;return-d>b?e|=1:b>d&&(e|=2),-d>c?e|=4:c>d&&(e|=8),e}var f=Math.cos(a),g=f>0,h=ih(f)>Dh,i=Fc(a,6*Fh);return Xb(b,c,i,g?[0,-a]:[-Ah,a-Ah])}function ec(a,b,c,d){return function(e){var f,g=e.a,h=e.b,i=g.x,j=g.y,k=h.x,l=h.y,m=0,n=1,o=k-i,p=l-j;if(f=a-i,o||!(f>0)){if(f/=o,0>o){if(m>f)return;n>f&&(n=f)}else if(o>0){if(f>n)return;f>m&&(m=f)}if(f=c-i,o||!(0>f)){if(f/=o,0>o){if(f>n)return;f>m&&(m=f)}else if(o>0){if(m>f)return;n>f&&(n=f)}if(f=b-j,p||!(f>0)){if(f/=p,0>p){if(m>f)return;n>f&&(n=f)}else if(p>0){if(f>n)return;f>m&&(m=f)}if(f=d-j,p||!(0>f)){if(f/=p,0>p){if(f>n)return;f>m&&(m=f)}else if(p>0){if(m>f)return;n>f&&(n=f)}return m>0&&(e.a={x:i+m*o,y:j+m*p}),1>n&&(e.b={x:i+n*o,y:j+n*p}),e}}}}}}function fc(a,b,c,d){function e(d,e){return ih(d[0]-a)<Dh?e>0?0:3:ih(d[0]-c)<Dh?e>0?2:1:ih(d[1]-b)<Dh?e>0?1:0:e>0?3:2}function f(a,b){return g(a.x,b.x)}function g(a,b){var c=e(a,1),d=e(b,1);return c!==d?c-d:0===c?b[1]-a[1]:1===c?a[0]-b[0]:2===c?a[1]-b[1]:b[0]-a[0]}return function(h){function i(a){for(var b=0,c=r.length,d=a[1],e=0;c>e;++e)for(var f,g=1,h=r[e],i=h.length,k=h[0];i>g;++g)f=h[g],k[1]<=d?f[1]>d&&j(k,f,a)>0&&++b:f[1]<=d&&j(k,f,a)<0&&--b,k=f;return 0!==b}function j(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1])}function k(f,h,i,j){var k=0,l=0;if(null==f||(k=e(f,i))!==(l=e(h,i))||g(f,h)<0^i>0){do j.point(0===k||3===k?a:c,k>1?d:b);while((k=(k+i+4)%4)!==l)}else j.point(h[0],h[1])}function l(e,f){return e>=a&&c>=e&&f>=b&&d>=f}function m(a,b){l(a,b)&&h.point(a,b)}function n(){E.point=p,r&&r.push(s=[]),z=!0,y=!1,w=x=0/0}function o(){q&&(p(t,u),v&&y&&C.rejoin(),q.push(C.buffer())),E.point=m,y&&h.lineEnd()}function p(a,b){a=Math.max(-Ci,Math.min(Ci,a)),b=Math.max(-Ci,Math.min(Ci,b));var c=l(a,b);if(r&&s.push([a,b]),z)t=a,u=b,v=c,z=!1,c&&(h.lineStart(),h.point(a,b));else if(c&&y)h.point(a,b);else{var d={a:{x:w,y:x},b:{x:a,y:b}};D(d)?(y||(h.lineStart(),h.point(d.a.x,d.a.y)),h.point(d.b.x,d.b.y),c||h.lineEnd(),A=!1):c&&(h.lineStart(),h.point(a,b),A=!1)}w=a,x=b,y=c}var q,r,s,t,u,v,w,x,y,z,A,B=h,C=Zb(),D=ec(a,b,c,d),E={point:m,lineStart:n,lineEnd:o,polygonStart:function(){h=C,q=[],r=[],A=!0},polygonEnd:function(){h=B,q=Wg.merge(q);var b=i([a,d]),c=A&&b,e=q.length;(c||e)&&(h.polygonStart(),c&&(h.lineStart(),k(null,null,1,h),h.lineEnd()),e&&Ub(q,f,b,k,h),h.polygonEnd()),q=r=s=null}};return E}}function gc(a,b){function c(c,d){return c=a(c,d),b(c[0],c[1])}return a.invert&&b.invert&&(c.invert=function(c,d){return c=b.invert(c,d),c&&a.invert(c[0],c[1])}),c}function hc(a){var b=0,c=Ah/3,d=xc(a),e=d(b,c);return e.parallels=function(a){return arguments.length?d(b=a[0]*Ah/180,c=a[1]*Ah/180):[b/Ah*180,c/Ah*180]},e}function ic(a,b){function c(a,b){var c=Math.sqrt(f-2*e*Math.sin(b))/e;return[c*Math.sin(a*=e),g-c*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,O((f-(a*a+c*c)*e*e)/(2*e))]},c}function jc(){function a(a,b){Ei+=e*a-d*b,d=a,e=b}var b,c,d,e;Ji.point=function(f,g){Ji.point=a,b=d=f,c=e=g},Ji.lineEnd=function(){a(b,c)}}function kc(a,b){Fi>a&&(Fi=a),a>Hi&&(Hi=a),Gi>b&&(Gi=b),b>Ii&&(Ii=b)}function lc(){function a(a,b){g.push("M",a,",",b,f)}function b(a,b){g.push("M",a,",",b),h.point=c}function c(a,b){g.push("L",a,",",b)}function d(){h.point=a}function e(){g.push("Z")}var f=mc(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=mc(a),h},result:function(){if(g.length){var a=g.join("");return g=[],a}}};return h}function mc(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+-2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function nc(a,b){ri+=a,si+=b,++ti}function oc(){function a(a,d){var e=a-b,f=d-c,g=Math.sqrt(e*e+f*f);ui+=g*(b+a)/2,vi+=g*(c+d)/2,wi+=g,nc(b=a,c=d)}var b,c;Li.point=function(d,e){Li.point=a,nc(b=d,c=e)}}function pc(){Li.point=nc}function qc(){function a(a,b){var c=a-d,f=b-e,g=Math.sqrt(c*c+f*f);ui+=g*(d+a)/2,vi+=g*(e+b)/2,wi+=g,g=e*a-d*b,xi+=g*(d+a),yi+=g*(e+b),zi+=3*g,nc(d=a,e=b)}var b,c,d,e;Li.point=function(f,g){Li.point=a,nc(b=d=f,c=e=g)},Li.lineEnd=function(){a(b,c)}}function rc(a){function b(b,c){a.moveTo(b,c),a.arc(b,c,g,0,Bh)}function c(b,c){a.moveTo(b,c),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:i};return h}function sc(a){function b(a){return(h?d:c)(a)}function c(b){return vc(b,function(c,d){c=a(c,d),b.point(c[0],c[1])})}function d(b){function c(c,d){c=a(c,d),b.point(c[0],c[1])}function d(){t=0/0,y.point=f,b.lineStart()}function f(c,d){var f=Gb([c,d]),g=a(c,d);e(t,u,s,v,w,x,t=g[0],u=g[1],s=c,v=f[0],w=f[1],x=f[2],h,b),b.point(t,u)}function g(){y.point=c,b.lineEnd()}function i(){d(),y.point=j,y.lineEnd=k}function j(a,b){f(l=a,m=b),n=t,o=u,p=v,q=w,r=x,y.point=f}function k(){e(t,u,s,v,w,x,n,o,l,p,q,r,h,b),y.lineEnd=g,g()}var l,m,n,o,p,q,r,s,t,u,v,w,x,y={point:c,lineStart:d,lineEnd:g,polygonStart:function(){b.polygonStart(),y.lineStart=i},polygonEnd:function(){b.polygonEnd(),y.lineStart=d}};return y}function e(b,c,d,h,i,j,k,l,m,n,o,p,q,r){var s=k-b,t=l-c,u=s*s+t*t;if(u>4*f&&q--){var v=h+n,w=i+o,x=j+p,y=Math.sqrt(v*v+w*w+x*x),z=Math.asin(x/=y),A=ih(ih(x)-1)<Dh||ih(d-m)<Dh?(d+m)/2:Math.atan2(w,v),B=a(A,z),C=B[0],D=B[1],E=C-b,F=D-c,G=t*E-s*F;(G*G/u>f||ih((s*E+t*F)/u-.5)>.3||g>h*n+i*o+j*p)&&(e(b,c,d,h,i,j,C,D,A,v/=y,w/=y,x,q,r),r.point(C,D),e(C,D,A,v,w,x,k,l,m,n,o,p,q,r))}}var f=.5,g=Math.cos(30*Fh),h=16;return b.precision=function(a){return arguments.length?(h=(f=a*a)>0&&16,b):Math.sqrt(f)},b}function tc(a){var b=sc(function(b,c){return a([b*Gh,c*Gh])});return function(a){return yc(b(a))}}function uc(a){this.stream=a}function vc(a,b){return{point:b,sphere:function(){a.sphere()},lineStart:function(){a.lineStart()},lineEnd:function(){a.lineEnd()},polygonStart:function(){a.polygonStart()},polygonEnd:function(){a.polygonEnd()}}}function wc(a){return xc(function(){return a})()}function xc(a){function b(a){return a=h(a[0]*Fh,a[1]*Fh),[a[0]*m+i,j-a[1]*m]}function c(a){return a=h.invert((a[0]-i)/m,(j-a[1])/m),a&&[a[0]*Gh,a[1]*Gh]}function d(){h=gc(g=Bc(r,s,t),f);var a=f(p,q);return i=n-a[0]*m,j=o+a[1]*m,e()}function e(){return k&&(k.valid=!1,k=null),b}var f,g,h,i,j,k,l=sc(function(a,b){return a=f(a,b),[a[0]*m+i,j-a[1]*m]}),m=150,n=480,o=250,p=0,q=0,r=0,s=0,t=0,u=Bi,v=qb,w=null,x=null;return b.stream=function(a){return k&&(k.valid=!1),k=yc(u(g,l(v(a)))),k.valid=!0,k},b.clipAngle=function(a){return arguments.length?(u=null==a?(w=a,Bi):dc((w=+a)*Fh),e()):w},b.clipExtent=function(a){return arguments.length?(x=a,v=a?fc(a[0][0],a[0][1],a[1][0],a[1][1]):qb,e()):x},b.scale=function(a){return arguments.length?(m=+a,d()):m},b.translate=function(a){return arguments.length?(n=+a[0],o=+a[1],d()):[n,o]},b.center=function(a){return arguments.length?(p=a[0]%360*Fh,q=a[1]%360*Fh,d()):[p*Gh,q*Gh]},b.rotate=function(a){return arguments.length?(r=a[0]%360*Fh,s=a[1]%360*Fh,t=a.length>2?a[2]%360*Fh:0,d()):[r*Gh,s*Gh,t*Gh]},Wg.rebind(b,l,"precision"),function(){return f=a.apply(this,arguments),b.invert=f.invert&&c,d()}}function yc(a){return vc(a,function(b,c){a.point(b*Fh,c*Fh)})}function zc(a,b){return[a,b]}function Ac(a,b){return[a>Ah?a-Bh:-Ah>a?a+Bh:a,b]}function Bc(a,b,c){return a?b||c?gc(Dc(a),Ec(b,c)):Dc(a):b||c?Ec(b,c):Ac}function Cc(a){return function(b,c){return b+=a,[b>Ah?b-Bh:-Ah>b?b+Bh:b,c]}}function Dc(a){var b=Cc(a);return b.invert=Cc(-a),b}function Ec(a,b){function c(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*d+h*e;return[Math.atan2(i*f-k*g,h*d-j*e),O(k*f+i*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),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*f-i*g;return[Math.atan2(i*f+j*g,h*d+k*e),O(k*d-h*e)]},c}function Fc(a,b){var c=Math.cos(a),d=Math.sin(a);return function(e,f,g,h){var i=g*b;null!=e?(e=Gc(c,e),f=Gc(c,f),(g>0?f>e:e>f)&&(e+=g*Bh)):(e=a+g*Bh,f=a-.5*i);for(var j,k=e;g>0?k>f:f>k;k-=i)h.point((j=Mb([c,-d*Math.cos(k),-d*Math.sin(k)]))[0],j[1])}}function Gc(a,b){var c=Gb(b);c[0]-=a,Lb(c);var d=N(-c[1]);return((-c[2]<0?-d:d)+2*Math.PI-Dh)%(2*Math.PI)}function Hc(a,b,c){var d=Wg.range(a,b-Dh,c).concat(b);return function(a){return d.map(function(b){return[a,b]})}}function Ic(a,b,c){var d=Wg.range(a,b-Dh,c).concat(b);return function(a){return d.map(function(b){return[b,a]})}}function Jc(a){return a.source}function Kc(a){return a.target}function Lc(a,b,c,d){var e=Math.cos(b),f=Math.sin(b),g=Math.cos(d),h=Math.sin(d),i=e*Math.cos(a),j=e*Math.sin(a),k=g*Math.cos(c),l=g*Math.sin(c),m=2*Math.asin(Math.sqrt(S(d-b)+e*g*S(c-a))),n=1/Math.sin(m),o=m?function(a){var b=Math.sin(a*=m)*n,c=Math.sin(m-a)*n,d=c*i+b*k,e=c*j+b*l,g=c*f+b*h;return[Math.atan2(e,d)*Gh,Math.atan2(g,Math.sqrt(d*d+e*e))*Gh]}:function(){return[a*Gh,b*Gh]};return o.distance=m,o}function Mc(){function a(a,e){var f=Math.sin(e*=Fh),g=Math.cos(e),h=ih((a*=Fh)-b),i=Math.cos(h);Mi+=Math.atan2(Math.sqrt((h=g*Math.sin(h))*h+(h=d*f-c*g*i)*h),c*f+d*g*i),b=a,c=f,d=g}var b,c,d;Ni.point=function(e,f){b=e*Fh,c=Math.sin(f*=Fh),d=Math.cos(f),Ni.point=a},Ni.lineEnd=function(){Ni.point=Ni.lineEnd=i}}function Nc(a,b){function c(b,c){var d=Math.cos(b),e=Math.cos(c),f=a(d*e);return[f*e*Math.sin(b),f*Math.sin(c)]}return c.invert=function(a,c){var d=Math.sqrt(a*a+c*c),e=b(d),f=Math.sin(e),g=Math.cos(e);return[Math.atan2(a*f,d*g),Math.asin(d&&c*f/d)]},c}function Oc(a,b){function c(a,b){var c=ih(ih(b)-Ch)<Dh?0:g/Math.pow(e(b),f);return[c*Math.sin(f*a),g-c*Math.cos(f*a)]}var d=Math.cos(a),e=function(a){return Math.tan(Ah/4+a/2)},f=a===b?Math.sin(a):Math.log(d/Math.cos(b))/Math.log(e(b)/e(a)),g=d*Math.pow(e(a),f)/f;return f?(c.invert=function(a,b){var c=g-b,d=M(f)*Math.sqrt(a*a+c*c);return[Math.atan2(a,c)/f,2*Math.atan(Math.pow(g/d,1/f))-Ch]},c):Qc}function Pc(a,b){function c(a,b){var c=f-b;return[c*Math.sin(e*a),f-c*Math.cos(e*a)]}var d=Math.cos(a),e=a===b?Math.sin(a):(d-Math.cos(b))/(b-a),f=d/e+a;return ih(e)<Dh?zc:(c.invert=function(a,b){var c=f-b;return[Math.atan2(a,c)/e,f-M(e)*Math.sqrt(a*a+c*c)]},c)}function Qc(a,b){return[a,Math.log(Math.tan(Ah/4+b/2))]}function Rc(a){var b,c=wc(a),d=c.scale,e=c.translate,f=c.clipExtent;return c.scale=function(){var a=d.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.translate=function(){var a=e.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.clipExtent=function(a){var g=f.apply(c,arguments);if(g===c){if(b=null==a){var h=Ah*d(),i=e();f([[i[0]-h,i[1]-h],[i[0]+h,i[1]+h]])}}else b&&(g=null);return g},c.clipExtent(null)}function Sc(a,b){return[Math.log(Math.tan(Ah/4+b/2)),-a]}function Tc(a){return a[0]}function Uc(a){return a[1]}function Vc(a,b,c,d){var e,f,g,h,i,j,k;return e=d[a],f=e[0],g=e[1],e=d[b],h=e[0],i=e[1],e=d[c],j=e[0],k=e[1],(k-g)*(h-f)-(i-g)*(j-f)>0}function Wc(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function Xc(a,b,c,d){var e=a[0],f=c[0],g=b[0]-e,h=d[0]-f,i=a[1],j=c[1],k=b[1]-i,l=d[1]-j,m=(h*(i-j)-l*(e-f))/(l*g-h*k);return[e+m*g,i+m*k]}function Yc(a){var b=a[0],c=a[a.length-1];return!(b[0]-c[0]||b[1]-c[1])}function Zc(){sd(this),this.edge=this.site=this.circle=null}function $c(a){var b=Zi.pop()||new Zc;return b.site=a,b}function _c(a){jd(a),Wi.remove(a),Zi.push(a),sd(a)}function ad(a){var b=a.circle,c=b.x,d=b.cy,e={x:c,y:d},f=a.P,g=a.N,h=[a];_c(a);for(var i=f;i.circle&&ih(c-i.circle.x)<Dh&&ih(d-i.circle.cy)<Dh;)f=i.P,h.unshift(i),_c(i),i=f;h.unshift(i),jd(i);for(var j=g;j.circle&&ih(c-j.circle.x)<Dh&&ih(d-j.circle.cy)<Dh;)g=j.N,h.push(j),_c(j),j=g;h.push(j),jd(j);var k,l=h.length;for(k=1;l>k;++k)j=h[k],i=h[k-1],pd(j.edge,i.site,j.site,e);i=h[0],j=h[l-1],j.edge=nd(i.site,j.site,null,e),id(i),id(j)}function bd(a){for(var b,c,d,e,f=a.x,g=a.y,h=Wi._;h;)if(d=cd(h,g)-f,d>Dh)h=h.L;else{if(e=f-dd(h,g),!(e>Dh)){d>-Dh?(b=h.P,c=h):e>-Dh?(b=h,c=h.N):b=c=h;break}if(!h.R){b=h;break}h=h.R}var i=$c(a);if(Wi.insert(b,i),b||c){if(b===c)return jd(b),c=$c(b.site),Wi.insert(i,c),i.edge=c.edge=nd(b.site,i.site),id(b),void id(c);if(!c)return void(i.edge=nd(b.site,i.site));jd(b),jd(c);var j=b.site,k=j.x,l=j.y,m=a.x-k,n=a.y-l,o=c.site,p=o.x-k,q=o.y-l,r=2*(m*q-n*p),s=m*m+n*n,t=p*p+q*q,u={x:(q*s-n*t)/r+k,y:(m*t-p*s)/r+l};pd(c.edge,j,o,u),i.edge=nd(j,a,null,u),c.edge=nd(a,o,null,u),id(b),id(c)}}function cd(a,b){var c=a.site,d=c.x,e=c.y,f=e-b;if(!f)return d;var g=a.P;if(!g)return-1/0;c=g.site;var h=c.x,i=c.y,j=i-b;if(!j)return h;var k=h-d,l=1/f-1/j,m=k/j;return l?(-m+Math.sqrt(m*m-2*l*(k*k/(-2*j)-i+j/2+e-f/2)))/l+d:(d+h)/2}function dd(a,b){var c=a.N;if(c)return cd(c,b);var d=a.site;return d.y===b?d.x:1/0}function ed(a){this.site=a,this.edges=[]}function fd(a){for(var b,c,d,e,f,g,h,i,j,k,l=a[0][0],m=a[1][0],n=a[0][1],o=a[1][1],p=Vi,q=p.length;q--;)if(f=p[q],f&&f.prepare())for(h=f.edges,i=h.length,g=0;i>g;)k=h[g].end(),d=k.x,e=k.y,j=h[++g%i].start(),b=j.x,c=j.y,(ih(d-b)>Dh||ih(e-c)>Dh)&&(h.splice(g,0,new qd(od(f.site,k,ih(d-l)<Dh&&o-e>Dh?{x:l,y:ih(b-l)<Dh?c:o}:ih(e-o)<Dh&&m-d>Dh?{x:ih(c-o)<Dh?b:m,y:o}:ih(d-m)<Dh&&e-n>Dh?{x:m,y:ih(b-m)<Dh?c:n}:ih(e-n)<Dh&&d-l>Dh?{x:ih(c-n)<Dh?b:l,y:n}:null),f.site,null)),++i)}function gd(a,b){return b.angle-a.angle}function hd(){sd(this),this.x=this.y=this.arc=this.site=this.cy=null}function id(a){var b=a.P,c=a.N;if(b&&c){var d=b.site,e=a.site,f=c.site;if(d!==f){var g=e.x,h=e.y,i=d.x-g,j=d.y-h,k=f.x-g,l=f.y-h,m=2*(i*l-j*k);if(!(m>=-Eh)){var n=i*i+j*j,o=k*k+l*l,p=(l*n-j*o)/m,q=(i*o-k*n)/m,l=q+h,r=$i.pop()||new hd;r.arc=a,r.site=e,r.x=p+g,r.y=l+Math.sqrt(p*p+q*q),r.cy=l,a.circle=r;for(var s=null,t=Yi._;t;)if(r.y<t.y||r.y===t.y&&r.x<=t.x){if(!t.L){s=t.P;break}t=t.L}else{if(!t.R){s=t;break}t=t.R}Yi.insert(s,r),s||(Xi=r)}}}}function jd(a){var b=a.circle;b&&(b.P||(Xi=b.N),Yi.remove(b),$i.push(b),sd(b),a.circle=null)}function kd(a){for(var b,c=Ui,d=ec(a[0][0],a[0][1],a[1][0],a[1][1]),e=c.length;e--;)b=c[e],(!ld(b,a)||!d(b)||ih(b.a.x-b.b.x)<Dh&&ih(b.a.y-b.b.y)<Dh)&&(b.a=b.b=null,c.splice(e,1))}function ld(a,b){var c=a.b;if(c)return!0;var d,e,f=a.a,g=b[0][0],h=b[1][0],i=b[0][1],j=b[1][1],k=a.l,l=a.r,m=k.x,n=k.y,o=l.x,p=l.y,q=(m+o)/2,r=(n+p)/2;if(p===n){if(g>q||q>=h)return;if(m>o){if(f){if(f.y>=j)return}else f={x:q,y:i};c={x:q,y:j}}else{if(f){if(f.y<i)return}else f={x:q,y:j};c={x:q,y:i}}}else if(d=(m-o)/(p-n),e=r-d*q,-1>d||d>1)if(m>o){if(f){if(f.y>=j)return}else f={x:(i-e)/d,y:i};c={x:(j-e)/d,y:j}}else{if(f){if(f.y<i)return}else f={x:(j-e)/d,y:j};c={x:(i-e)/d,y:i}}else if(p>n){if(f){if(f.x>=h)return}else f={x:g,y:d*g+e};c={x:h,y:d*h+e}}else{if(f){if(f.x<g)return}else f={x:h,y:d*h+e};c={x:g,y:d*g+e}}return a.a=f,a.b=c,!0}function md(a,b){this.l=a,this.r=b,this.a=this.b=null}function nd(a,b,c,d){var e=new md(a,b);return Ui.push(e),c&&pd(e,a,b,c),d&&pd(e,b,a,d),Vi[a.i].edges.push(new qd(e,a,b)),Vi[b.i].edges.push(new qd(e,b,a)),e}function od(a,b,c){var d=new md(a,null);return d.a=b,d.b=c,Ui.push(d),d}function pd(a,b,c,d){a.a||a.b?a.l===c?a.b=d:a.a=d:(a.a=d,a.l=b,a.r=c)}function qd(a,b,c){var d=a.a,e=a.b;this.edge=a,this.site=b,this.angle=c?Math.atan2(c.y-b.y,c.x-b.x):a.l===b?Math.atan2(e.x-d.x,d.y-e.y):Math.atan2(d.x-e.x,e.y-d.y)}function rd(){this._=null}function sd(a){a.U=a.C=a.L=a.R=a.P=a.N=null}function td(a,b){var c=b,d=b.R,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.R=d.L,c.R&&(c.R.U=c),d.L=c}function ud(a,b){var c=b,d=b.L,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.L=d.R,c.L&&(c.L.U=c),d.R=c}function vd(a){for(;a.L;)a=a.L;return a}function wd(a,b){var c,d,e,f=a.sort(xd).pop();for(Ui=[],Vi=new Array(a.length),Wi=new rd,Yi=new rd;;)if(e=Xi,f&&(!e||f.y<e.y||f.y===e.y&&f.x<e.x))(f.x!==c||f.y!==d)&&(Vi[f.i]=new ed(f),bd(f),c=f.x,d=f.y),f=a.pop();else{if(!e)break;ad(e.arc)}b&&(kd(b),fd(b));var g={cells:Vi,edges:Ui};return Wi=Yi=Ui=Vi=null,g}function xd(a,b){return b.y-a.y||b.x-a.x}function yd(a,b,c){return(a.x-c.x)*(b.y-a.y)-(a.x-b.x)*(c.y-a.y)}function zd(a){return a.x}function Ad(a){return a.y}function Bd(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function Cd(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=.5*(c+e),h=.5*(d+f),i=b.nodes;i[0]&&Cd(a,i[0],c,d,g,h),i[1]&&Cd(a,i[1],g,d,e,h),i[2]&&Cd(a,i[2],c,h,g,f),i[3]&&Cd(a,i[3],g,h,e,f)}}function Dd(a,b){a=Wg.rgb(a),b=Wg.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"#"+jb(Math.round(c+f*a))+jb(Math.round(d+g*a))+jb(Math.round(e+h*a))}}function Ed(a,b){var c,d={},e={};for(c in a)c in b?d[c]=Hd(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}}function Fd(a,b){return b-=a=+a,function(c){return a+b*c}}function Gd(a,b){var c,d,e,f,g,h=0,i=0,j=[],k=[];for(a+="",b+="",aj.lastIndex=0,d=0;c=aj.exec(b);++d)c.index&&j.push(b.substring(h,i=c.index)),k.push({i:j.length,x:c[0]}),j.push(null),h=aj.lastIndex;for(h<b.length&&j.push(b.substring(h)),d=0,f=k.length;(c=aj.exec(a))&&f>d;++d)if(g=k[d],g.x==c[0]){if(g.i)if(null==j[g.i+1])for(j[g.i-1]+=g.x,j.splice(g.i,1),e=d+1;f>e;++e)k[e].i--;else for(j[g.i-1]+=g.x+j[g.i+1],j.splice(g.i,2),e=d+1;f>e;++e)k[e].i-=2;else if(null==j[g.i+1])j[g.i]=g.x;else for(j[g.i]=g.x+j[g.i+1],j.splice(g.i+1,1),e=d+1;f>e;++e)k[e].i--;k.splice(d,1),f--,d--}else g.x=Fd(parseFloat(c[0]),parseFloat(g.x));for(;f>d;)g=k.pop(),null==j[g.i+1]?j[g.i]=g.x:(j[g.i]=g.x+j[g.i+1],j.splice(g.i+1,1)),f--;return 1===j.length?null==j[0]?(g=k[0].x,function(a){return g(a)+""}):function(){return b}:function(a){for(d=0;f>d;++d)j[(g=k[d]).i]=g.x(a);return j.join("")}}function Hd(a,b){for(var c,d=Wg.interpolators.length;--d>=0&&!(c=Wg.interpolators[d](a,b)););return c}function Id(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(Hd(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}}function Jd(a){return function(b){return 0>=b?0:b>=1?1:a(b)}}function Kd(a){return function(b){return 1-a(1-b)}}function Ld(a){return function(b){return.5*(.5>b?a(2*b):2-a(2-2*b))}}function Md(a){return a*a}function Nd(a){return a*a*a}function Od(a){if(0>=a)return 0;if(a>=1)return 1;var b=a*a,c=b*a;return 4*(.5>a?c:3*(a-b)+c-.75)}function Pd(a){return function(b){return Math.pow(b,a)}}function Qd(a){return 1-Math.cos(a*Ch)}function Rd(a){return Math.pow(2,10*(a-1))}function Sd(a){return 1-Math.sqrt(1-a*a)}function Td(a,b){var c;return arguments.length<2&&(b=.45),arguments.length?c=b/Bh*Math.asin(1/a):(a=1,c=b/4),function(d){return 1+a*Math.pow(2,-10*d)*Math.sin((d-c)*Bh/b)}}function Ud(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function Vd(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Wd(a,b){a=Wg.hcl(a),b=Wg.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 isNaN(g)&&(g=0,d=isNaN(d)?b.c:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return Z(c+f*a,d+g*a,e+h*a)+""}}function Xd(a,b){a=Wg.hsl(a),b=Wg.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 isNaN(g)&&(g=0,d=isNaN(d)?b.s:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return W(c+f*a,d+g*a,e+h*a)+""}}function Yd(a,b){a=Wg.lab(a),b=Wg.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 ab(c+f*a,d+g*a,e+h*a)+""}}function Zd(a,b){return b-=a,function(c){return Math.round(a+b*c)}}function $d(a){var b=[a.a,a.b],c=[a.c,a.d],d=ae(b),e=_d(b,c),f=ae(be(c,b,-e))||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]))*Gh,this.translate=[a.e,a.f],this.scale=[d,f],this.skew=f?Math.atan2(e,f)*Gh:0}function _d(a,b){return a[0]*b[0]+a[1]*b[1]}function ae(a){var b=Math.sqrt(_d(a,a));return b&&(a[0]/=b,a[1]/=b),b}function be(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function ce(a,b){var c,d=[],e=[],f=Wg.transform(a),g=Wg.transform(b),h=f.translate,i=g.translate,j=f.rotate,k=g.rotate,l=f.skew,m=g.skew,n=f.scale,o=g.scale;return h[0]!=i[0]||h[1]!=i[1]?(d.push("translate(",null,",",null,")"),e.push({i:1,x:Fd(h[0],i[0])},{i:3,x:Fd(h[1],i[1])})):d.push(i[0]||i[1]?"translate("+i+")":""),j!=k?(j-k>180?k+=360:k-j>180&&(j+=360),e.push({i:d.push(d.pop()+"rotate(",null,")")-2,x:Fd(j,k)})):k&&d.push(d.pop()+"rotate("+k+")"),l!=m?e.push({i:d.push(d.pop()+"skewX(",null,")")-2,x:Fd(l,m)}):m&&d.push(d.pop()+"skewX("+m+")"),n[0]!=o[0]||n[1]!=o[1]?(c=d.push(d.pop()+"scale(",null,",",null,")"),e.push({i:c-4,x:Fd(n[0],o[0])},{i:c-2,x:Fd(n[1],o[1])})):(1!=o[0]||1!=o[1])&&d.push(d.pop()+"scale("+o+")"),c=e.length,function(a){for(var b,f=-1;++f<c;)d[(b=e[f]).i]=b.x(a);return d.join("")}}function de(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-a)*b}}function ee(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function fe(a){for(var b=a.source,c=a.target,d=he(b,c),e=[b];b!==d;)b=b.parent,e.push(b);for(var f=e.length;c!==d;)e.splice(f,0,c),c=c.parent;return e}function ge(a){for(var b=[],c=a.parent;null!=c;)b.push(a),a=c,c=c.parent;return b.push(a),b}function he(a,b){if(a===b)return a;for(var c=ge(a),d=ge(b),e=c.pop(),f=d.pop(),g=null;e===f;)g=e,e=c.pop(),f=d.pop();return g}function ie(a){a.fixed|=2}function je(a){a.fixed&=-7}function ke(a){a.fixed|=4,a.px=a.x,a.py=a.y}function le(a){a.fixed&=-5}function me(a,b,c){var d=0,e=0;if(a.charge=0,!a.leaf)for(var f,g=a.nodes,h=g.length,i=-1;++i<h;)f=g[i],null!=f&&(me(f,b,c),a.charge+=f.charge,d+=f.charge*f.cx,e+=f.charge*f.cy);if(a.point){a.leaf||(a.point.x+=Math.random()-.5,a.point.y+=Math.random()-.5);var j=b*c[a.point.index];a.charge+=a.pointCharge=j,d+=j*a.point.x,e+=j*a.point.y}a.cx=d/a.charge,a.cy=e/a.charge}function ne(a,b){return Wg.rebind(a,b,"sort","children","value"),a.nodes=a,a.links=re,a}function oe(a){return a.children}function pe(a){return a.value}function qe(a,b){return b.value-a.value}function re(a){return Wg.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function se(a){return a.x}function te(a){return a.y}function ue(a,b,c){a.y0=b,a.y=c}function ve(a){return Wg.range(a.length)}function we(a){for(var b=-1,c=a[0].length,d=[];++b<c;)d[b]=0;return d}function xe(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 ye(a){return a.reduce(ze,0)}function ze(a,b){return a+b[1]}function Ae(a,b){return Be(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function Be(a,b){for(var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];++c<=b;)f[c]=e*c+d;return f}function Ce(a){return[Wg.min(a),Wg.max(a)]}function De(a,b){return a.parent==b.parent?1:2}function Ee(a){var b=a.children;return b&&b.length?b[0]:a._tree.thread}function Fe(a){var b,c=a.children;return c&&(b=c.length)?c[b-1]:a._tree.thread}function Ge(a,b){var c=a.children;if(c&&(e=c.length))for(var d,e,f=-1;++f<e;)b(d=Ge(c[f],b),a)>0&&(a=d);return a}function He(a,b){return a.x-b.x}function Ie(a,b){return b.x-a.x}function Je(a,b){return a.depth-b.depth}function Ke(a,b){function c(a,d){var e=a.children;if(e&&(g=e.length))for(var f,g,h=null,i=-1;++i<g;)f=e[i],c(f,h),h=f;b(a,d)}c(a,null)}function Le(a){for(var b,c=0,d=0,e=a.children,f=e.length;--f>=0;)b=e[f]._tree,b.prelim+=c,b.mod+=c,c+=b.shift+(d+=b.change)}function Me(a,b,c){a=a._tree,b=b._tree;var d=c/(b.number-a.number);a.change+=d,b.change-=d,b.shift+=c,b.prelim+=c,b.mod+=c}function Ne(a,b,c){return a._tree.ancestor.parent==b.parent?a._tree.ancestor:c}function Oe(a,b){return a.value-b.value}function Pe(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function Qe(a,b){a._pack_next=b,b._pack_prev=a}function Re(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return.999*e*e>c*c+d*d}function Se(a){function b(a){k=Math.min(a.x-a.r,k),l=Math.max(a.x+a.r,l),m=Math.min(a.y-a.r,m),n=Math.max(a.y+a.r,n)}if((c=a.children)&&(j=c.length)){var c,d,e,f,g,h,i,j,k=1/0,l=-1/0,m=1/0,n=-1/0;if(c.forEach(Te),d=c[0],d.x=-d.r,d.y=0,b(d),j>1&&(e=c[1],e.x=e.r,e.y=0,b(e),j>2))for(f=c[2],We(d,e,f),b(f),Pe(d,f),d._pack_prev=f,Pe(f,e),e=d._pack_next,g=3;j>g;g++){We(d,e,f=c[g]);var o=0,p=1,q=1;for(h=e._pack_next;h!==e;h=h._pack_next,p++)if(Re(h,f)){o=1;break}if(1==o)for(i=d._pack_prev;i!==h._pack_prev&&!Re(i,f);i=i._pack_prev,q++);o?(q>p||p==q&&e.r<d.r?Qe(d,e=h):Qe(d=i,e),g--):(Pe(d,f),e=f,b(f))}var r=(k+l)/2,s=(m+n)/2,t=0;for(g=0;j>g;g++)f=c[g],f.x-=r,f.y-=s,t=Math.max(t,f.r+Math.sqrt(f.x*f.x+f.y*f.y));a.r=t,c.forEach(Ue)}}function Te(a){a._pack_next=a._pack_prev=a}function Ue(a){delete a._pack_next,delete a._pack_prev}function Ve(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)for(var f=-1,g=e.length;++f<g;)Ve(e[f],b,c,d)}function We(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,d*=d;var i=.5+(d-g)/(2*h),j=Math.sqrt(Math.max(0,2*g*(d+h)-(d-=h)*d-g*g))/(2*h);c.x=a.x+i*e+j*f,c.y=a.y+i*f-j*e}else c.x=a.x+d,c.y=a.y}function Xe(a){return 1+Wg.max(a,function(a){return a.y})}function Ye(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function Ze(a){var b=a.children;return b&&b.length?Ze(b[0]):a}function $e(a){var b,c=a.children;return c&&(b=c.length)?$e(c[b-1]):a}function _e(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function af(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 bf(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function cf(a){return a.rangeExtent?a.rangeExtent():bf(a.range())}function df(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 ef(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),a[d]=b.floor(f),a[e]=b.ceil(g),a}function ff(a){return a?{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}:kj}function gf(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());++g<=h;)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=Wg.bisect(a,b,1,h)-1;return f[c](e[c](b))}}function hf(a,b,c,d){function e(){var e=Math.min(a.length,b.length)>2?gf:df,i=d?ee:de;return g=e(a,b,i,c),h=e(b,a,i,Hd),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(Zd)},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 mf(a,b)},f.tickFormat=function(b,c){return nf(a,b,c)},f.nice=function(b){return kf(a,b),e()},f.copy=function(){return hf(a,b,c,d)},e()}function jf(a,b){return Wg.rebind(a,b,"range","rangeRound","interpolate","clamp")}function kf(a,b){return ef(a,ff(lf(a,b)[2]))}function lf(a,b){null==b&&(b=10);var c=bf(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return.15>=f?e*=10:.35>=f?e*=5:.75>=f&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+.5*e,c[2]=e,c}function mf(a,b){return Wg.range.apply(Wg,lf(a,b))
  }function nf(a,b,c){var d=lf(a,b);return Wg.format(c?c.replace(fi,function(a,b,c,e,f,g,h,i,j,k){return[b,c,e,f,g,h,i,j||"."+pf(k,d),k].join("")}):",."+of(d[2])+"f")}function of(a){return-Math.floor(Math.log(a)/Math.LN10+.01)}function pf(a,b){var c=of(b[2]);return a in lj?Math.abs(c-of(Math.max(Math.abs(b[0]),Math.abs(b[1]))))+ +("e"!==a):c-2*("%"===a)}function qf(a,b,c,d){function e(a){return(c?Math.log(0>a?0:a):-Math.log(a>0?0:-a))/Math.log(b)}function f(a){return c?Math.pow(b,a):-Math.pow(b,-a)}function g(b){return a(e(b))}return g.invert=function(b){return f(a.invert(b))},g.domain=function(b){return arguments.length?(c=b[0]>=0,a.domain((d=b.map(Number)).map(e)),g):d},g.base=function(c){return arguments.length?(b=+c,a.domain(d.map(e)),g):b},g.nice=function(){var b=ef(d.map(e),c?Math:nj);return a.domain(b),d=b.map(f),g},g.ticks=function(){var a=bf(d),g=[],h=a[0],i=a[1],j=Math.floor(e(h)),k=Math.ceil(e(i)),l=b%1?2:b;if(isFinite(k-j)){if(c){for(;k>j;j++)for(var m=1;l>m;m++)g.push(f(j)*m);g.push(f(j))}else for(g.push(f(j));j++<k;)for(var m=l-1;m>0;m--)g.push(f(j)*m);for(j=0;g[j]<h;j++);for(k=g.length;g[k-1]>i;k--);g=g.slice(j,k)}return g},g.tickFormat=function(a,b){if(!arguments.length)return mj;arguments.length<2?b=mj:"function"!=typeof b&&(b=Wg.format(b));var d,h=Math.max(.1,a/g.ticks().length),i=c?(d=1e-12,Math.ceil):(d=-1e-12,Math.floor);return function(a){return a/f(i(e(a)+d))<=h?b(a):""}},g.copy=function(){return qf(a.copy(),b,c,d)},jf(g,a)}function rf(a,b,c){function d(b){return a(e(b))}var e=sf(b),f=sf(1/b);return d.invert=function(b){return f(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain((c=b.map(Number)).map(e)),d):c},d.ticks=function(a){return mf(c,a)},d.tickFormat=function(a,b){return nf(c,a,b)},d.nice=function(a){return d.domain(kf(c,a))},d.exponent=function(g){return arguments.length?(e=sf(b=g),f=sf(1/b),a.domain(c.map(e)),d):b},d.copy=function(){return rf(a.copy(),b,c)},jf(d,a)}function sf(a){return function(b){return 0>b?-Math.pow(-b,a):Math.pow(b,a)}}function tf(a,b){function c(c){return g[((f.get(c)||"range"===b.t&&f.set(c,a.push(c)))-1)%g.length]}function d(b,c){return Wg.range(a.length).map(function(a){return b+c*a})}var f,g,h;return c.domain=function(d){if(!arguments.length)return a;a=[],f=new e;for(var g,h=-1,i=d.length;++h<i;)f.has(g=d[h])||f.set(g,a.push(g));return c[b.t].apply(c,b.a)},c.range=function(a){return arguments.length?(g=a,h=0,b={t:"range",a:arguments},c):g},c.rangePoints=function(e,f){arguments.length<2&&(f=0);var i=e[0],j=e[1],k=(j-i)/(Math.max(1,a.length-1)+f);return g=d(a.length<2?(i+j)/2:i+k*f/2,k),h=0,b={t:"rangePoints",a:arguments},c},c.rangeBands=function(e,f,i){arguments.length<2&&(f=0),arguments.length<3&&(i=f);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=(l-k)/(a.length-f+2*i);return g=d(k+m*i,m),j&&g.reverse(),h=m*(1-f),b={t:"rangeBands",a:arguments},c},c.rangeRoundBands=function(e,f,i){arguments.length<2&&(f=0),arguments.length<3&&(i=f);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=Math.floor((l-k)/(a.length-f+2*i)),n=l-k-(a.length-f)*m;return g=d(k+Math.round(n/2),m),j&&g.reverse(),h=Math.round(m*(1-f)),b={t:"rangeRoundBands",a:arguments},c},c.rangeBand=function(){return h},c.rangeExtent=function(){return bf(b.a[0])},c.copy=function(){return tf(a,b)},c.domain(a)}function uf(a,b){function c(){var c=0,f=b.length;for(e=[];++c<f;)e[c-1]=Wg.quantile(a,c/f);return d}function d(a){return isNaN(a=+a)?void 0:b[Wg.bisect(e,a)]}var e;return d.domain=function(b){return arguments.length?(a=b.filter(function(a){return!isNaN(a)}).sort(Wg.ascending),c()):a},d.range=function(a){return arguments.length?(b=a,c()):b},d.quantiles=function(){return e},d.invertExtent=function(c){return c=b.indexOf(c),0>c?[0/0,0/0]:[c>0?e[c-1]:a[0],c<e.length?e[c]:a[a.length-1]]},d.copy=function(){return uf(a,b)},c()}function vf(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.invertExtent=function(b){return b=c.indexOf(b),b=0>b?0/0:b/f+a,[b,b+1/f]},d.copy=function(){return vf(a,b,c)},e()}function wf(a,b){function c(c){return c>=c?b[Wg.bisect(a,c)]:void 0}return c.domain=function(b){return arguments.length?(a=b,c):a},c.range=function(a){return arguments.length?(b=a,c):b},c.invertExtent=function(c){return c=b.indexOf(c),[a[c-1],a[c]]},c.copy=function(){return wf(a,b)},c}function xf(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 mf(a,b)},b.tickFormat=function(b,c){return nf(a,b,c)},b.copy=function(){return xf(a)},b}function yf(a){return a.innerRadius}function zf(a){return a.outerRadius}function Af(a){return a.startAngle}function Bf(a){return a.endAngle}function Cf(a){function b(b){function g(){j.push("M",f(a(k),h))}for(var i,j=[],k=[],l=-1,m=b.length,n=pb(c),o=pb(d);++l<m;)e.call(this,i=b[l],l)?k.push([+n.call(this,i,l),+o.call(this,i,l)]):k.length&&(g(),k=[]);return k.length&&g(),j.length?j.join(""):null}var c=Tc,d=Uc,e=Tb,f=Df,g=f.key,h=.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=uj.get(a)||Df).key,b):g},b.tension=function(a){return arguments.length?(h=a,b):h},b}function Df(a){return a.join("L")}function Ef(a){return Df(a)+"Z"}function Ff(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d[0]+(d=a[b])[0])/2,"V",d[1]);return c>1&&e.push("H",d[0]),e.join("")}function Gf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function Hf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function If(a,b){return a.length<4?Df(a):a[1]+Lf(a.slice(1,a.length-1),Mf(a,b))}function Jf(a,b){return a.length<3?Df(a):a[0]+Lf((a.push(a[0]),a),Mf([a[a.length-2]].concat(a,[a[1]]),b))}function Kf(a,b){return a.length<3?Df(a):a[0]+Lf(a,Mf(a,b))}function Lf(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return Df(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;if(c&&(d+="Q"+(f[0]-2*g[0]/3)+","+(f[1]-2*g[1]/3)+","+f[0]+","+f[1],e=a[1],i=2),b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+2*h[0]/3)+","+(f[1]+2*h[1]/3)+","+k[0]+","+k[1]}return d}function Mf(a,b){for(var c,d=[],e=(1-b)/2,f=a[0],g=a[1],h=1,i=a.length;++h<i;)c=f,f=g,g=a[h],d.push([e*(g[0]-c[0]),e*(g[1]-c[1])]);return d}function Nf(a){if(a.length<3)return Df(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]],i=[e,",",f,"L",Rf(xj,g),",",Rf(xj,h)];for(a.push(a[c-1]);++b<=c;)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),Sf(i,g,h);return a.pop(),i.push("L",d),i.join("")}function Of(a){if(a.length<4)return Df(a);for(var b,c=[],d=-1,e=a.length,f=[0],g=[0];++d<3;)b=a[d],f.push(b[0]),g.push(b[1]);for(c.push(Rf(xj,f)+","+Rf(xj,g)),--d;++d<e;)b=a[d],f.shift(),f.push(b[0]),g.shift(),g.push(b[1]),Sf(c,f,g);return c.join("")}function Pf(a){for(var b,c,d=-1,e=a.length,f=e+4,g=[],h=[];++d<4;)c=a[d%e],g.push(c[0]),h.push(c[1]);for(b=[Rf(xj,g),",",Rf(xj,h)],--d;++d<f;)c=a[d%e],g.shift(),g.push(c[0]),h.shift(),h.push(c[1]),Sf(b,g,h);return b.join("")}function Qf(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,i=a[c][1]-g,j=-1;++j<=c;)d=a[j],e=j/c,d[0]=b*d[0]+(1-b)*(f+e*h),d[1]=b*d[1]+(1-b)*(g+e*i);return Nf(a)}function Rf(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function Sf(a,b,c){a.push("C",Rf(vj,b),",",Rf(vj,c),",",Rf(wj,b),",",Rf(wj,c),",",Rf(xj,b),",",Rf(xj,c))}function Tf(a,b){return(b[1]-a[1])/(b[0]-a[0])}function Uf(a){for(var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=Tf(e,f);++b<c;)d[b]=(g+(g=Tf(e=f,f=a[b+1])))/2;return d[b]=g,d}function Vf(a){for(var b,c,d,e,f=[],g=Uf(a),h=-1,i=a.length-1;++h<i;)b=Tf(a[h],a[h+1]),ih(b)<Dh?g[h]=g[h+1]=0:(c=g[h]/b,d=g[h+1]/b,e=c*c+d*d,e>9&&(e=3*b/Math.sqrt(e),g[h]=e*c,g[h+1]=e*d));for(h=-1;++h<=i;)e=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),f.push([e||0,g[h]*e||0]);return f}function Wf(a){return a.length<3?Df(a):a[0]+Lf(a,Vf(a))}function Xf(a){for(var b,c,d,e=-1,f=a.length;++e<f;)b=a[e],c=b[0],d=b[1]+sj,b[0]=c*Math.cos(d),b[1]=c*Math.sin(d);return a}function Yf(a){function b(b){function i(){p.push("M",h(a(r),l),k,j(a(q.reverse()),l),"Z")}for(var m,n,o,p=[],q=[],r=[],s=-1,t=b.length,u=pb(c),v=pb(e),w=c===d?function(){return n}:pb(d),x=e===f?function(){return o}:pb(f);++s<t;)g.call(this,m=b[s],s)?(q.push([n=+u.call(this,m,s),o=+v.call(this,m,s)]),r.push([+w.call(this,m,s),+x.call(this,m,s)])):q.length&&(i(),q=[],r=[]);return q.length&&i(),p.length?p.join(""):null}var c=Tc,d=Tc,e=0,f=Uc,g=Tb,h=Df,i=h.key,j=h,k="L",l=.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?(i="function"==typeof a?h=a:(h=uj.get(a)||Df).key,j=h.reverse||h,k=h.closed?"M":"L",b):i},b.tension=function(a){return arguments.length?(l=a,b):l},b}function Zf(a){return a.radius}function $f(a){return[a.x,a.y]}function _f(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+sj;return[c*Math.cos(d),c*Math.sin(d)]}}function ag(){return 64}function bg(){return"circle"}function cg(a){var b=Math.sqrt(a/Ah);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+-b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"}function dg(a,b){return nh(a,Dj),a.id=b,a}function eg(a,b,c,d){var e=a.id;return D(a,"function"==typeof c?function(a,f,g){a.__transition__[e].tween.set(b,d(c.call(a,a.__data__,f,g)))}:(c=d(c),function(a){a.__transition__[e].tween.set(b,c)}))}function fg(a){return null==a&&(a=""),function(){this.textContent=a}}function gg(a,b,c,d){var f=a.__transition__||(a.__transition__={active:0,count:0}),g=f[c];if(!g){var h=d.time;g=f[c]={tween:new e,time:h,ease:d.ease,delay:d.delay,duration:d.duration},++f.count,Wg.timer(function(d){function e(d){return f.active>c?j():(f.active=c,g.event&&g.event.start.call(a,k,b),g.tween.forEach(function(c,d){(d=d.call(a,k,b))&&p.push(d)}),void Wg.timer(function(){return o.c=i(d||1)?Tb:i,1},0,h))}function i(d){if(f.active!==c)return j();for(var e=d/n,h=l(e),i=p.length;i>0;)p[--i].call(a,h);return e>=1?(g.event&&g.event.end.call(a,k,b),j()):void 0}function j(){return--f.count?delete f[c]:delete a.__transition__,1}var k=a.__data__,l=g.ease,m=g.delay,n=g.duration,o=$h,p=[];return o.t=m+h,d>=m?e(d-m):void(o.c=e)},0,h)}}function hg(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function ig(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function jg(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function kg(a,b,c){function d(b){var c=a(b),d=f(c,1);return d-b>b-c?c:d}function e(c){return b(c=a(new Kj(c-1)),1),c}function f(a,c){return b(a=new Kj(+a),c),a}function g(a,d,f){var g=e(a),h=[];if(f>1)for(;d>g;)c(g)%f||h.push(new Date(+g)),b(g,1);else for(;d>g;)h.push(new Date(+g)),b(g,1);return h}function h(a,b,c){try{Kj=jg;var d=new jg;return d._=a,g(d,b,c)}finally{Kj=Date}}a.floor=a,a.round=d,a.ceil=e,a.offset=f,a.range=g;var i=a.utc=lg(a);return i.floor=i,i.round=lg(d),i.ceil=lg(e),i.offset=lg(f),i.range=h,a}function lg(a){return function(b,c){try{Kj=jg;var d=new jg;return d._=b,a(d,c)._}finally{Kj=Date}}}function mg(a){function b(b){for(var d,e,f,g=[],h=-1,i=0;++h<c;)37===a.charCodeAt(h)&&(g.push(a.substring(i,h)),null!=(e=bk[d=a.charAt(++h)])&&(d=a.charAt(++h)),(f=ck[d])&&(d=f(b,null==e?"e"===d?" ":"0":e)),g.push(d),i=h+1);return g.push(a.substring(i,h)),g.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,Z:null},d=ng(c,a,b,0);if(d!=b.length)return null;"p"in c&&(c.H=c.H%12+12*c.p);var e=null!=c.Z&&Kj!==jg,f=new(e?jg:Kj);return"j"in c?f.setFullYear(c.y,0,c.j):"w"in c&&("W"in c||"U"in c)?(f.setFullYear(c.y,0,1),f.setFullYear(c.y,0,"W"in c?(c.w+6)%7+7*c.W-(f.getDay()+5)%7:c.w+7*c.U-(f.getDay()+6)%7)):f.setFullYear(c.y,c.m,c.d),f.setHours(c.H+Math.floor(c.Z/100),c.M+c.Z%100,c.S,c.L),e?f._:f},b.toString=function(){return a},b}function ng(a,b,c,d){for(var e,f,g,h=0,i=b.length,j=c.length;i>h;){if(d>=j)return-1;if(e=b.charCodeAt(h++),37===e){if(g=b.charAt(h++),f=dk[g in bk?b.charAt(h++):g],!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function og(a){return new RegExp("^(?:"+a.map(Wg.requote).join("|")+")","i")}function pg(a){for(var b=new e,c=-1,d=a.length;++c<d;)b.set(a[c].toLowerCase(),c);return b}function qg(a,b,c){var d=0>a?"-":"",e=(d?-a:a)+"",f=e.length;return d+(c>f?new Array(c-f+1).join(b)+e:e)}function rg(a,b,c){Wj.lastIndex=0;var d=Wj.exec(b.substring(c));return d?(a.w=Xj.get(d[0].toLowerCase()),c+d[0].length):-1}function sg(a,b,c){Uj.lastIndex=0;var d=Uj.exec(b.substring(c));return d?(a.w=Vj.get(d[0].toLowerCase()),c+d[0].length):-1}function tg(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c,c+1));return d?(a.w=+d[0],c+d[0].length):-1}function ug(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c));return d?(a.U=+d[0],c+d[0].length):-1}function vg(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c));return d?(a.W=+d[0],c+d[0].length):-1}function wg(a,b,c){$j.lastIndex=0;var d=$j.exec(b.substring(c));return d?(a.m=_j.get(d[0].toLowerCase()),c+d[0].length):-1}function xg(a,b,c){Yj.lastIndex=0;var d=Yj.exec(b.substring(c));return d?(a.m=Zj.get(d[0].toLowerCase()),c+d[0].length):-1}function yg(a,b,c){return ng(a,ck.c.toString(),b,c)}function zg(a,b,c){return ng(a,ck.x.toString(),b,c)}function Ag(a,b,c){return ng(a,ck.X.toString(),b,c)}function Bg(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c,c+4));return d?(a.y=+d[0],c+d[0].length):-1}function Cg(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c,c+2));return d?(a.y=Eg(+d[0]),c+d[0].length):-1}function Dg(a,b,c){return/^[+-]\d{4}$/.test(b=b.substring(c,c+5))?(a.Z=+b,c+5):-1}function Eg(a){return a+(a>68?1900:2e3)}function Fg(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c,c+2));return d?(a.m=d[0]-1,c+d[0].length):-1}function Gg(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c,c+2));return d?(a.d=+d[0],c+d[0].length):-1}function Hg(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c,c+3));return d?(a.j=+d[0],c+d[0].length):-1}function Ig(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c,c+2));return d?(a.H=+d[0],c+d[0].length):-1}function Jg(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c,c+2));return d?(a.M=+d[0],c+d[0].length):-1}function Kg(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c,c+2));return d?(a.S=+d[0],c+d[0].length):-1}function Lg(a,b,c){ek.lastIndex=0;var d=ek.exec(b.substring(c,c+3));return d?(a.L=+d[0],c+d[0].length):-1}function Mg(a,b,c){var d=fk.get(b.substring(c,c+=2).toLowerCase());return null==d?-1:(a.p=d,c)}function Ng(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=~~(ih(b)/60),e=ih(b)%60;return c+qg(d,"0",2)+qg(e,"0",2)}function Og(a,b,c){ak.lastIndex=0;var d=ak.exec(b.substring(c,c+1));return d?c+d[0].length:-1}function Pg(a){function b(a){try{Kj=jg;var b=new Kj;return b._=a,c(b)}finally{Kj=Date}}var c=mg(a);return b.parse=function(a){try{Kj=jg;var b=c.parse(a);return b&&b._}finally{Kj=Date}},b.toString=c.toString,b}function Qg(a){return a.toISOString()}function Rg(a,b,c){function d(b){return a(b)}function e(a,c){var d=a[1]-a[0],e=d/c,f=Wg.bisect(hk,e);return f==hk.length?[b.year,lf(a.map(function(a){return a/31536e6}),c)[2]]:f?b[e/hk[f-1]<hk[f]/e?f-1:f]:[lk,lf(a,c)[2]]}return d.invert=function(b){return Sg(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map(Sg)},d.nice=function(a,b){function c(c){return!isNaN(c)&&!a.range(c,Sg(+c+1),b).length}var f=d.domain(),g=bf(f),h=null==a?e(g,10):"number"==typeof a&&e(g,a);return h&&(a=h[0],b=h[1]),d.domain(ef(f,b>1?{floor:function(b){for(;c(b=a.floor(b));)b=Sg(b-1);return b},ceil:function(b){for(;c(b=a.ceil(b));)b=Sg(+b+1);return b}}:a))},d.ticks=function(a,b){var c=bf(d.domain()),f=null==a?e(c,10):"number"==typeof a?e(c,a):!a.range&&[{range:a},b];return f&&(a=f[0],b=f[1]),a.range(c[0],Sg(+c[1]+1),1>b?1:b)},d.tickFormat=function(){return c},d.copy=function(){return Rg(a.copy(),b,c)},jf(d,a)}function Sg(a){return new Date(a)}function Tg(a){return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}function Ug(a){return JSON.parse(a.responseText)}function Vg(a){var b=Zg.createRange();return b.selectNode(Zg.body),b.createContextualFragment(a.responseText)}var Wg={version:"3.3.13"};Date.now||(Date.now=function(){return+new Date});var Xg=[].slice,Yg=function(a){return Xg.call(a)},Zg=document,$g=Zg.documentElement,_g=window;try{Yg($g.childNodes)[0].nodeType}catch(ah){Yg=function(a){for(var b=a.length,c=new Array(b);b--;)c[b]=a[b];return c}}try{Zg.createElement("div").style.setProperty("opacity",0,"")}catch(bh){var ch=_g.Element.prototype,dh=ch.setAttribute,eh=ch.setAttributeNS,fh=_g.CSSStyleDeclaration.prototype,gh=fh.setProperty;ch.setAttribute=function(a,b){dh.call(this,a,b+"")},ch.setAttributeNS=function(a,b,c){eh.call(this,a,b,c+"")},fh.setProperty=function(a,b,c){gh.call(this,a,b+"",c)}}Wg.ascending=function(a,b){return b>a?-1:a>b?1:a>=b?0:0/0},Wg.descending=function(a,b){return a>b?-1:b>a?1:b>=a?0:0/0},Wg.min=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f&&!(null!=(c=a[e])&&c>=c);)c=void 0;for(;++e<f;)null!=(d=a[e])&&c>d&&(c=d)}else{for(;++e<f&&!(null!=(c=b.call(a,a[e],e))&&c>=c);)c=void 0;for(;++e<f;)null!=(d=b.call(a,a[e],e))&&c>d&&(c=d)}return c},Wg.max=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f&&!(null!=(c=a[e])&&c>=c);)c=void 0;for(;++e<f;)null!=(d=a[e])&&d>c&&(c=d)}else{for(;++e<f&&!(null!=(c=b.call(a,a[e],e))&&c>=c);)c=void 0;for(;++e<f;)null!=(d=b.call(a,a[e],e))&&d>c&&(c=d)}return c},Wg.extent=function(a,b){var c,d,e,f=-1,g=a.length;if(1===arguments.length){for(;++f<g&&!(null!=(c=e=a[f])&&c>=c);)c=e=void 0;for(;++f<g;)null!=(d=a[f])&&(c>d&&(c=d),d>e&&(e=d))}else{for(;++f<g&&!(null!=(c=e=b.call(a,a[f],f))&&c>=c);)c=void 0;for(;++f<g;)null!=(d=b.call(a,a[f],f))&&(c>d&&(c=d),d>e&&(e=d))}return[c,e]},Wg.sum=function(a,b){var c,d=0,e=a.length,f=-1;if(1===arguments.length)for(;++f<e;)isNaN(c=+a[f])||(d+=c);else for(;++f<e;)isNaN(c=+b.call(a,a[f],f))||(d+=c);return d},Wg.mean=function(b,c){var d,e=b.length,f=0,g=-1,h=0;if(1===arguments.length)for(;++g<e;)a(d=b[g])&&(f+=(d-f)/++h);else for(;++g<e;)a(d=c.call(b,b[g],g))&&(f+=(d-f)/++h);return h?f:void 0},Wg.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=+a[d-1],f=c-d;return f?e+f*(a[d]-e):e},Wg.median=function(b,c){return arguments.length>1&&(b=b.map(c)),b=b.filter(a),b.length?Wg.quantile(b.sort(Wg.ascending),.5):void 0},Wg.bisector=function(a){return{left:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a.call(b,b[f],f)<c?d=f+1:e=f}return d},right:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;c<a.call(b,b[f],f)?e=f:d=f+1}return d}}};var hh=Wg.bisector(function(a){return a});Wg.bisectLeft=hh.left,Wg.bisect=Wg.bisectRight=hh.right,Wg.shuffle=function(a){for(var b,c,d=a.length;d;)c=Math.random()*d--|0,b=a[d],a[d]=a[c],a[c]=b;return a},Wg.permute=function(a,b){for(var c=b.length,d=new Array(c);c--;)d[c]=a[b[c]];return d},Wg.pairs=function(a){for(var b,c=0,d=a.length-1,e=a[0],f=new Array(0>d?0:d);d>c;)f[c]=[b=e,e=a[++c]];return f},Wg.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,c=Wg.min(arguments,b),d=new Array(c);++a<c;)for(var e,f=-1,g=d[a]=new Array(e);++f<e;)g[f]=arguments[f][a];return d},Wg.transpose=function(a){return Wg.zip.apply(Wg,a)},Wg.keys=function(a){var b=[];for(var c in a)b.push(c);return b},Wg.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},Wg.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},Wg.merge=function(a){for(var b,c,d,e=a.length,f=-1,g=0;++f<e;)g+=a[f].length;for(c=new Array(g);--e>=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c};var ih=Math.abs;Wg.range=function(a,b,d){if(arguments.length<3&&(d=1,arguments.length<2&&(b=a,a=0)),(b-a)/d===1/0)throw new Error("infinite range");var e,f=[],g=c(ih(d)),h=-1;if(a*=g,b*=g,d*=g,0>d)for(;(e=a+d*++h)>b;)f.push(e/g);else for(;(e=a+d*++h)<b;)f.push(e/g);return f},Wg.map=function(a){var b=new e;if(a instanceof e)a.forEach(function(a,c){b.set(a,c)});else for(var c in a)b.set(c,a[c]);return b},d(e,{has:function(a){return jh+a in this},get:function(a){return this[jh+a]},set:function(a,b){return this[jh+a]=b},remove:function(a){return a=jh+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)===kh&&a.call(this,b.substring(1),this[b])}});var jh="\x00",kh=jh.charCodeAt(0);Wg.nest=function(){function a(b,h,i){if(i>=g.length)return d?d.call(f,h):c?h.sort(c):h;for(var j,k,l,m,n=-1,o=h.length,p=g[i++],q=new e;++n<o;)(m=q.get(j=p(k=h[n])))?m.push(k):q.set(j,[k]);return b?(k=b(),l=function(c,d){k.set(c,a(b,d,i))}):(k={},l=function(c,d){k[c]=a(b,d,i)}),q.forEach(l),k}function b(a,c){if(c>=g.length)return a;var d=[],e=h[c++];return a.forEach(function(a,e){d.push({key:a,values:b(e,c)})}),e?d.sort(function(a,b){return e(a.key,b.key)}):d}var c,d,f={},g=[],h=[];return f.map=function(b,c){return a(c,b,0)},f.entries=function(c){return b(a(Wg.map,c,0),0)},f.key=function(a){return g.push(a),f},f.sortKeys=function(a){return h[g.length-1]=a,f},f.sortValues=function(a){return c=a,f},f.rollup=function(a){return d=a,f},f},Wg.set=function(a){var b=new f;if(a)for(var c=0,d=a.length;d>c;++c)b.add(a[c]);return b},d(f,{has:function(a){return jh+a in this},add:function(a){return this[jh+a]=!0,a},remove:function(a){return a=jh+a,a in this&&delete this[a]},values:function(){var a=[];return this.forEach(function(b){a.push(b)}),a},forEach:function(a){for(var b in this)b.charCodeAt(0)===kh&&a.call(this,b.substring(1))}}),Wg.behavior={},Wg.rebind=function(a,b){for(var c,d=1,e=arguments.length;++d<e;)a[c=arguments[d]]=g(a,b,b[c]);return a};var lh=["webkit","ms","moz","Moz","o","O"];Wg.dispatch=function(){for(var a=new j,b=-1,c=arguments.length;++b<c;)a[arguments[b]]=k(a);return a},j.prototype.on=function(a,b){var c=a.indexOf("."),d="";if(c>=0&&(d=a.substring(c+1),a=a.substring(0,c)),a)return arguments.length<2?this[a].on(d):this[a].on(d,b);if(2===arguments.length){if(null==b)for(a in this)this.hasOwnProperty(a)&&this[a].on(d,null);return this}},Wg.event=null,Wg.requote=function(a){return a.replace(mh,"\\$&")};var mh=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,nh={}.__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]},oh=function(a,b){return b.querySelector(a)},ph=function(a,b){return b.querySelectorAll(a)},qh=$g[h($g,"matchesSelector")],rh=function(a,b){return qh.call(a,b)};"function"==typeof Sizzle&&(oh=function(a,b){return Sizzle(a,b)[0]||null},ph=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))},rh=Sizzle.matchesSelector),Wg.selection=function(){return vh};var sh=Wg.selection.prototype=[];sh.select=function(a){var b,c,d,e,f=[];a=p(a);for(var g=-1,h=this.length;++g<h;){f.push(b=[]),b.parentNode=(d=this[g]).parentNode;for(var i=-1,j=d.length;++i<j;)(e=d[i])?(b.push(c=a.call(e,e.__data__,i,g)),c&&"__data__"in e&&(c.__data__=e.__data__)):b.push(null)}return o(f)},sh.selectAll=function(a){var b,c,d=[];a=q(a);for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)(c=g[h])&&(d.push(b=Yg(a.call(c,c.__data__,h,e))),b.parentNode=c);return o(d)};var th={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/"};Wg.ns={prefix:th,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&(c=a.substring(0,b),a=a.substring(b+1)),th.hasOwnProperty(c)?{space:th[c],local:a}:a}},sh.attr=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node();return a=Wg.ns.qualify(a),a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(r(b,a[b]));return this}return this.each(r(a,b))},sh.classed=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node(),d=(a=u(a)).length,e=-1;if(b=c.classList){for(;++e<d;)if(!b.contains(a[e]))return!1}else for(b=c.getAttribute("class");++e<d;)if(!t(a[e]).test(b))return!1;return!0}for(b in a)this.each(v(b,a[b]));return this}return this.each(v(a,b))},sh.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(x(c,a[c],b));return this}if(2>d)return _g.getComputedStyle(this.node(),null).getPropertyValue(a);c=""}return this.each(x(a,b,c))},sh.property=function(a,b){if(arguments.length<2){if("string"==typeof a)return this.node()[a];for(b in a)this.each(y(b,a[b]));return this}return this.each(y(a,b))},sh.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},sh.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},sh.append=function(a){return a=z(a),this.select(function(){return this.appendChild(a.apply(this,arguments))})},sh.insert=function(a,b){return a=z(a),b=p(b),this.select(function(){return this.insertBefore(a.apply(this,arguments),b.apply(this,arguments)||null)})},sh.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},sh.data=function(a,b){function c(a,c){var d,f,g,h=a.length,l=c.length,m=Math.min(h,l),n=new Array(l),o=new Array(l),p=new Array(h);if(b){var q,r=new e,s=new e,t=[];for(d=-1;++d<h;)q=b.call(f=a[d],f.__data__,d),r.has(q)?p[d]=f:r.set(q,f),t.push(q);for(d=-1;++d<l;)q=b.call(c,g=c[d],d),(f=r.get(q))?(n[d]=f,f.__data__=g):s.has(q)||(o[d]=A(g)),s.set(q,g),r.remove(q);for(d=-1;++d<h;)r.has(t[d])&&(p[d]=a[d])}else{for(d=-1;++d<m;)f=a[d],g=c[d],f?(f.__data__=g,n[d]=f):o[d]=A(g);for(;l>d;++d)o[d]=A(c[d]);for(;h>d;++d)p[d]=a[d]}o.update=n,o.parentNode=n.parentNode=p.parentNode=a.parentNode,i.push(o),j.push(n),k.push(p)}var d,f,g=-1,h=this.length;if(!arguments.length){for(a=new Array(h=(d=this[0]).length);++g<h;)(f=d[g])&&(a[g]=f.__data__);return a}var i=E([]),j=o([]),k=o([]);if("function"==typeof a)for(;++g<h;)c(d=this[g],a.call(d,d.parentNode.__data__,g));else for(;++g<h;)c(d=this[g],a);return j.enter=function(){return i},j.exit=function(){return k},j},sh.datum=function(a){return arguments.length?this.property("__data__",a):this.property("__data__")},sh.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=B(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]),b.parentNode=(c=this[f]).parentNode;for(var h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return o(e)},sh.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c,d=this[a],e=d.length-1,f=d[e];--e>=0;)(c=d[e])&&(f&&f!==c.nextSibling&&f.parentNode.insertBefore(c,f),f=c);return this},sh.sort=function(a){a=C.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},sh.each=function(a){return D(this,function(b,c,d){a.call(b,b.__data__,c,d)})},sh.call=function(a){var b=Yg(arguments);return a.apply(b[0]=this,b),this},sh.empty=function(){return!this.node()},sh.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},sh.size=function(){var a=0;return this.each(function(){++a}),a};var uh=[];Wg.selection.enter=E,Wg.selection.enter.prototype=uh,uh.append=sh.append,uh.empty=sh.empty,uh.node=sh.node,uh.call=sh.call,uh.size=sh.size,uh.select=function(a){for(var b,c,d,e,f,g=[],h=-1,i=this.length;++h<i;){d=(e=this[h]).update,g.push(b=[]),b.parentNode=e.parentNode;for(var j=-1,k=e.length;++j<k;)(f=e[j])?(b.push(d[j]=c=a.call(e.parentNode,f.__data__,j,h)),c.__data__=f.__data__):b.push(null)}return o(g)},uh.insert=function(a,b){return arguments.length<2&&(b=F(this)),sh.insert.call(this,a,b)},sh.transition=function(){for(var a,b,c=zj||++Ej,d=[],e=Aj||{time:Date.now(),ease:Od,delay:0,duration:250},f=-1,g=this.length;++f<g;){d.push(a=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(b=h[i])&&gg(b,i,c,e),a.push(b)}return dg(d,c)},sh.interrupt=function(){return this.each(G)},Wg.select=function(a){var b=["string"==typeof a?oh(a,Zg):a];return b.parentNode=$g,o([b])},Wg.selectAll=function(a){var b=Yg("string"==typeof a?ph(a,Zg):a);return b.parentNode=$g,o([b])};var vh=Wg.select($g);sh.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(H(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(H(a,b,c))};var wh=Wg.map({mouseenter:"mouseover",mouseleave:"mouseout"});wh.forEach(function(a){"on"+a in Zg&&wh.remove(a)});var xh="onselectstart"in Zg?null:h($g.style,"userSelect"),yh=0;Wg.mouse=function(a){return L(a,m())};var zh=/WebKit/.test(_g.navigator.userAgent)?-1:0;Wg.touches=function(a,b){return arguments.length<2&&(b=m().touches),b?Yg(b).map(function(b){var c=L(a,b);return c.identifier=b.identifier,c}):[]},Wg.behavior.drag=function(){function a(){this.on("mousedown.drag",g).on("touchstart.drag",h)}function b(){return Wg.event.changedTouches[0].identifier}function c(a,b){return Wg.touches(a).filter(function(a){return a.identifier===b})[0]}function d(a,b,c,d){return function(){function g(){var a=b(k,n),c=a[0]-p[0],d=a[1]-p[1];q|=c|d,p=a,l({type:"drag",x:a[0]+i[0],y:a[1]+i[1],dx:c,dy:d})}function h(){r.on(c+"."+o,null).on(d+"."+o,null),s(q&&Wg.event.target===m),l({type:"dragend"})}var i,j=this,k=j.parentNode,l=e.of(j,arguments),m=Wg.event.target,n=a(),o=null==n?"drag":"drag-"+n,p=b(k,n),q=0,r=Wg.select(_g).on(c+"."+o,g).on(d+"."+o,h),s=K();f?(i=f.apply(j,arguments),i=[i.x-p[0],i.y-p[1]]):i=[0,0],l({type:"dragstart"})}}var e=n(a,"drag","dragstart","dragend"),f=null,g=d(i,Wg.mouse,"mousemove","mouseup"),h=d(b,c,"touchmove","touchend");return a.origin=function(b){return arguments.length?(f=b,a):f},Wg.rebind(a,e,"on")};var Ah=Math.PI,Bh=2*Ah,Ch=Ah/2,Dh=1e-6,Eh=Dh*Dh,Fh=Ah/180,Gh=180/Ah,Hh=Math.SQRT2,Ih=2,Jh=4;Wg.interpolateZoom=function(a,b){function c(a){var b=a*s;if(r){var c=Q(p),g=f/(Ih*m)*(c*R(Hh*b+p)-P(p));return[d+g*j,e+g*k,f*c/Q(Hh*b+p)]}return[d+a*j,e+a*k,f*Math.exp(Hh*b)]}var d=a[0],e=a[1],f=a[2],g=b[0],h=b[1],i=b[2],j=g-d,k=h-e,l=j*j+k*k,m=Math.sqrt(l),n=(i*i-f*f+Jh*l)/(2*f*Ih*m),o=(i*i-f*f-Jh*l)/(2*i*Ih*m),p=Math.log(Math.sqrt(n*n+1)-n),q=Math.log(Math.sqrt(o*o+1)-o),r=q-p,s=(r||Math.log(i/f))/Hh;return c.duration=1e3*s,c},Wg.behavior.zoom=function(){function a(a){a.on(B,j).on(Mh+".zoom",m).on(C,o).on("dblclick.zoom",p).on(E,k)}function b(a){return[(a[0]-y.x)/y.k,(a[1]-y.y)/y.k]}function c(a){return[a[0]*y.k+y.x,a[1]*y.k+y.y]}function d(a){y.k=Math.max(A[0],Math.min(A[1],a))}function e(a,b){b=c(b),y.x+=a[0]-b[0],y.y+=a[1]-b[1]}function f(){v&&v.domain(u.range().map(function(a){return(a-y.x)/y.k}).map(u.invert)),x&&x.domain(w.range().map(function(a){return(a-y.y)/y.k}).map(w.invert))
  }function g(a){a({type:"zoomstart"})}function h(a){f(),a({type:"zoom",scale:y.k,translate:[y.x,y.y]})}function i(a){a({type:"zoomend"})}function j(){function a(){k=1,e(Wg.mouse(d),m),h(f)}function c(){l.on(C,_g===d?o:null).on(D,null),n(k&&Wg.event.target===j),i(f)}var d=this,f=F.of(d,arguments),j=Wg.event.target,k=0,l=Wg.select(_g).on(C,a).on(D,c),m=b(Wg.mouse(d)),n=K();G.call(d),g(f)}function k(){function a(){var a=Wg.touches(o);return n=y.k,a.forEach(function(a){a.identifier in q&&(q[a.identifier]=b(a))}),a}function c(){for(var b=Wg.event.changedTouches,c=0,f=b.length;f>c;++c)q[b[c].identifier]=null;var g=a(),i=Date.now();if(1===g.length){if(500>i-t){var j=g[0],k=q[j.identifier];d(2*y.k),e(j,k),l(),h(p)}t=i}else if(g.length>1){var j=g[0],m=g[1],n=j[0]-m[0],o=j[1]-m[1];r=n*n+o*o}}function f(){for(var a,b,c,f,g=Wg.touches(o),i=0,j=g.length;j>i;++i,f=null)if(c=g[i],f=q[c.identifier]){if(b)break;a=c,b=f}if(f){var k=(k=c[0]-a[0])*k+(k=c[1]-a[1])*k,l=r&&Math.sqrt(k/r);a=[(a[0]+c[0])/2,(a[1]+c[1])/2],b=[(b[0]+f[0])/2,(b[1]+f[1])/2],d(l*n)}t=null,e(a,b),h(p)}function m(){if(Wg.event.touches.length){for(var b=Wg.event.changedTouches,c=0,d=b.length;d>c;++c)delete q[b[c].identifier];for(var e in q)return void a()}w.on(u,null).on(v,null),x.on(B,j).on(E,k),z(),i(p)}var n,o=this,p=F.of(o,arguments),q={},r=0,s=Wg.event.changedTouches[0].identifier,u="touchmove.zoom-"+s,v="touchend.zoom-"+s,w=Wg.select(_g).on(u,f).on(v,m),x=Wg.select(o).on(B,null).on(E,c),z=K();G.call(o),c(),g(p)}function m(){var a=F.of(this,arguments);s?clearTimeout(s):(G.call(this),g(a)),s=setTimeout(function(){s=null,i(a)},50),l();var c=r||Wg.mouse(this);q||(q=b(c)),d(Math.pow(2,.002*Kh())*y.k),e(c,q),h(a)}function o(){q=null}function p(){var a=F.of(this,arguments),c=Wg.mouse(this),f=b(c),j=Math.log(y.k)/Math.LN2;g(a),d(Math.pow(2,Wg.event.shiftKey?Math.ceil(j)-1:Math.floor(j)+1)),e(c,f),h(a),i(a)}var q,r,s,t,u,v,w,x,y={x:0,y:0,k:1},z=[960,500],A=Lh,B="mousedown.zoom",C="mousemove.zoom",D="mouseup.zoom",E="touchstart.zoom",F=n(a,"zoomstart","zoom","zoomend");return a.event=function(a){a.each(function(){var a=F.of(this,arguments),b=y;zj?Wg.select(this).transition().each("start.zoom",function(){y=this.__chart__||{x:0,y:0,k:1},g(a)}).tween("zoom:zoom",function(){var c=z[0],d=z[1],e=c/2,f=d/2,g=Wg.interpolateZoom([(e-y.x)/y.k,(f-y.y)/y.k,c/y.k],[(e-b.x)/b.k,(f-b.y)/b.k,c/b.k]);return function(b){var d=g(b),i=c/d[2];this.__chart__=y={x:e-d[0]*i,y:f-d[1]*i,k:i},h(a)}}).each("end.zoom",function(){i(a)}):(this.__chart__=y,g(a),h(a),i(a))})},a.translate=function(b){return arguments.length?(y={x:+b[0],y:+b[1],k:y.k},f(),a):[y.x,y.y]},a.scale=function(b){return arguments.length?(y={x:y.x,y:y.y,k:+b},f(),a):y.k},a.scaleExtent=function(b){return arguments.length?(A=null==b?Lh:[+b[0],+b[1]],a):A},a.center=function(b){return arguments.length?(r=b&&[+b[0],+b[1]],a):r},a.size=function(b){return arguments.length?(z=b&&[+b[0],+b[1]],a):z},a.x=function(b){return arguments.length?(v=b,u=b.copy(),y={x:0,y:0,k:1},a):v},a.y=function(b){return arguments.length?(x=b,w=b.copy(),y={x:0,y:0,k:1},a):x},Wg.rebind(a,F,"on")};var Kh,Lh=[0,1/0],Mh="onwheel"in Zg?(Kh=function(){return-Wg.event.deltaY*(Wg.event.deltaMode?120:1)},"wheel"):"onmousewheel"in Zg?(Kh=function(){return Wg.event.wheelDelta},"mousewheel"):(Kh=function(){return-Wg.event.detail},"MozMousePixelScroll");T.prototype.toString=function(){return this.rgb()+""},Wg.hsl=function(a,b,c){return 1===arguments.length?a instanceof V?U(a.h,a.s,a.l):kb(""+a,lb,U):U(+a,+b,+c)};var Nh=V.prototype=new T;Nh.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),U(this.h,this.s,this.l/a)},Nh.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),U(this.h,this.s,a*this.l)},Nh.rgb=function(){return W(this.h,this.s,this.l)},Wg.hcl=function(a,b,c){return 1===arguments.length?a instanceof Y?X(a.h,a.c,a.l):a instanceof _?bb(a.l,a.a,a.b):bb((a=mb((a=Wg.rgb(a)).r,a.g,a.b)).l,a.a,a.b):X(+a,+b,+c)};var Oh=Y.prototype=new T;Oh.brighter=function(a){return X(this.h,this.c,Math.min(100,this.l+Ph*(arguments.length?a:1)))},Oh.darker=function(a){return X(this.h,this.c,Math.max(0,this.l-Ph*(arguments.length?a:1)))},Oh.rgb=function(){return Z(this.h,this.c,this.l).rgb()},Wg.lab=function(a,b,c){return 1===arguments.length?a instanceof _?$(a.l,a.a,a.b):a instanceof Y?Z(a.l,a.c,a.h):mb((a=Wg.rgb(a)).r,a.g,a.b):$(+a,+b,+c)};var Ph=18,Qh=.95047,Rh=1,Sh=1.08883,Th=_.prototype=new T;Th.brighter=function(a){return $(Math.min(100,this.l+Ph*(arguments.length?a:1)),this.a,this.b)},Th.darker=function(a){return $(Math.max(0,this.l-Ph*(arguments.length?a:1)),this.a,this.b)},Th.rgb=function(){return ab(this.l,this.a,this.b)},Wg.rgb=function(a,b,c){return 1===arguments.length?a instanceof ib?hb(a.r,a.g,a.b):kb(""+a,hb,W):hb(~~a,~~b,~~c)};var Uh=ib.prototype=new T;Uh.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return b||c||d?(b&&e>b&&(b=e),c&&e>c&&(c=e),d&&e>d&&(d=e),hb(Math.min(255,~~(b/a)),Math.min(255,~~(c/a)),Math.min(255,~~(d/a)))):hb(e,e,e)},Uh.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),hb(~~(a*this.r),~~(a*this.g),~~(a*this.b))},Uh.hsl=function(){return lb(this.r,this.g,this.b)},Uh.toString=function(){return"#"+jb(this.r)+jb(this.g)+jb(this.b)};var Vh=Wg.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Vh.forEach(function(a,b){Vh.set(a,fb(b))}),Wg.functor=pb,Wg.xhr=rb(qb),Wg.dsv=function(a,b){function c(a,c,f){arguments.length<3&&(f=c,c=null);var g=sb(a,b,null==c?d:e(c),f);return g.row=function(a){return arguments.length?g.response(null==(c=a)?d:e(a)):c},g}function d(a){return c.parse(a.responseText)}function e(a){return function(b){return c.parse(b.responseText,a)}}function g(b){return b.map(h).join(a)}function h(a){return i.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var i=new RegExp('["'+a+"\n]"),j=a.charCodeAt(0);return c.parse=function(a,b){var d;return c.parseRows(a,function(a,c){if(d)return d(a,c-1);var e=new Function("d","return {"+a.map(function(a,b){return JSON.stringify(a)+": d["+b+"]"}).join(",")+"}");d=b?function(a,c){return b(e(a),c)}:e})},c.parseRows=function(a,b){function c(){if(k>=i)return g;if(e)return e=!1,f;var b=k;if(34===a.charCodeAt(b)){for(var c=b;c++<i;)if(34===a.charCodeAt(c)){if(34!==a.charCodeAt(c+1))break;++c}k=c+2;var d=a.charCodeAt(c+1);return 13===d?(e=!0,10===a.charCodeAt(c+2)&&++k):10===d&&(e=!0),a.substring(b+1,c).replace(/""/g,'"')}for(;i>k;){var d=a.charCodeAt(k++),h=1;if(10===d)e=!0;else if(13===d)e=!0,10===a.charCodeAt(k)&&(++k,++h);else if(d!==j)continue;return a.substring(b,k-h)}return a.substring(b)}for(var d,e,f={},g={},h=[],i=a.length,k=0,l=0;(d=c())!==g;){for(var m=[];d!==f&&d!==g;)m.push(d),d=c();(!b||(m=b(m,l++)))&&h.push(m)}return h},c.format=function(b){if(Array.isArray(b[0]))return c.formatRows(b);var d=new f,e=[];return b.forEach(function(a){for(var b in a)d.has(b)||e.push(d.add(b))}),[e.map(h).join(a)].concat(b.map(function(b){return e.map(function(a){return h(b[a])}).join(a)})).join("\n")},c.formatRows=function(a){return a.map(g).join("\n")},c},Wg.csv=Wg.dsv(",","text/csv"),Wg.tsv=Wg.dsv("	","text/tab-separated-values");var Wh,Xh,Yh,Zh,$h,_h=_g[h(_g,"requestAnimationFrame")]||function(a){setTimeout(a,17)};Wg.timer=function(a,b,c){var d=arguments.length;2>d&&(b=0),3>d&&(c=Date.now());var e=c+b,f={c:a,t:e,f:!1,n:null};Xh?Xh.n=f:Wh=f,Xh=f,Yh||(Zh=clearTimeout(Zh),Yh=1,_h(ub))},Wg.timer.flush=function(){vb(),wb()};var ai=".",bi=",",ci=[3,3],di="$",ei=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(xb);Wg.formatPrefix=function(a,b){var c=0;return a&&(0>a&&(a*=-1),b&&(a=Wg.round(a,yb(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)))),ei[8+c/3]},Wg.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)},Wg.format=function(a){var b=fi.exec(a),c=b[1]||" ",d=b[2]||">",e=b[3]||"",f=b[4]||"",g=b[5],h=+b[6],i=b[7],j=b[8],k=b[9],l=1,m="",n=!1;switch(j&&(j=+j.substring(1)),(g||"0"===c&&"="===d)&&(g=c="0",d="=",i&&(h-=Math.floor((h-1)/4))),k){case"n":i=!0,k="g";break;case"%":l=100,m="%",k="f";break;case"p":l=100,m="%",k="r";break;case"b":case"o":case"x":case"X":"#"===f&&(f="0"+k.toLowerCase());case"c":case"d":n=!0,j=0;break;case"s":l=-1,k="r"}"#"===f?f="":"$"===f&&(f=di),"r"!=k||j||(k="g"),null!=j&&("g"==k?j=Math.max(1,Math.min(21,j)):("e"==k||"f"==k)&&(j=Math.max(0,Math.min(20,j)))),k=gi.get(k)||zb;var o=g&&i;return function(a){if(n&&a%1)return"";var b=0>a||0===a&&0>1/a?(a=-a,"-"):e;if(0>l){var p=Wg.formatPrefix(a,j);a=p.scale(a),m=p.symbol}else a*=l;a=k(a,j);var q=a.lastIndexOf("."),r=0>q?a:a.substring(0,q),s=0>q?"":ai+a.substring(q+1);!g&&i&&(r=hi(r));var t=f.length+r.length+s.length+(o?0:b.length),u=h>t?new Array(t=h-t+1).join(c):"";return o&&(r=hi(u+r)),b+=f,a=r+s,("<"===d?b+a+u:">"===d?u+b+a:"^"===d?u.substring(0,t>>=1)+b+a+u.substring(t):b+(o?a:u+a))+m}};var fi=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,gi=Wg.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(a=Wg.round(a,yb(a,b))).toFixed(Math.max(0,Math.min(20,yb(a*(1+1e-15),b))))}}),hi=qb;if(ci){var ii=ci.length;hi=function(a){for(var b=a.length,c=[],d=0,e=ci[0];b>0&&e>0;)c.push(a.substring(b-=e,b+e)),e=ci[d=(d+1)%ii];return c.reverse().join(bi)}}Wg.geo={},Ab.prototype={s:0,t:0,add:function(a){Bb(a,this.t,ji),Bb(ji.s,this.s,this),this.s?this.t+=ji.t:this.s=ji.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ji=new Ab;Wg.geo.stream=function(a,b){a&&ki.hasOwnProperty(a.type)?ki[a.type](a,b):Cb(a,b)};var ki={Feature:function(a,b){Cb(a.geometry,b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;++d<e;)Cb(c[d].geometry,b)}},li={Sphere:function(a,b){b.sphere()},Point:function(a,b){a=a.coordinates,b.point(a[0],a[1],a[2])},MultiPoint:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)a=c[d],b.point(a[0],a[1],a[2])},LineString:function(a,b){Db(a.coordinates,b,0)},MultiLineString:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)Db(c[d],b,0)},Polygon:function(a,b){Eb(a.coordinates,b)},MultiPolygon:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)Eb(c[d],b)},GeometryCollection:function(a,b){for(var c=a.geometries,d=-1,e=c.length;++d<e;)Cb(c[d],b)}};Wg.geo.area=function(a){return mi=0,Wg.geo.stream(a,oi),mi};var mi,ni=new Ab,oi={sphere:function(){mi+=4*Ah},point:i,lineStart:i,lineEnd:i,polygonStart:function(){ni.reset(),oi.lineStart=Fb},polygonEnd:function(){var a=2*ni;mi+=0>a?4*Ah+a:a,oi.lineStart=oi.lineEnd=oi.point=i}};Wg.geo.bounds=function(){function a(a,b){t.push(u=[k=a,m=a]),l>b&&(l=b),b>n&&(n=b)}function b(b,c){var d=Gb([b*Fh,c*Fh]);if(r){var e=Ib(r,d),f=[e[1],-e[0],0],g=Ib(f,e);Lb(g),g=Mb(g);var i=b-o,j=i>0?1:-1,p=g[0]*Gh*j,q=ih(i)>180;if(q^(p>j*o&&j*b>p)){var s=g[1]*Gh;s>n&&(n=s)}else if(p=(p+360)%360-180,q^(p>j*o&&j*b>p)){var s=-g[1]*Gh;l>s&&(l=s)}else l>c&&(l=c),c>n&&(n=c);q?o>b?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b):m>=k?(k>b&&(k=b),b>m&&(m=b)):b>o?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b)}else a(b,c);r=d,o=b}function c(){v.point=b}function d(){u[0]=k,u[1]=m,v.point=a,r=null}function e(a,c){if(r){var d=a-o;s+=ih(d)>180?d+(d>0?360:-360):d}else p=a,q=c;oi.point(a,c),b(a,c)}function f(){oi.lineStart()}function g(){e(p,q),oi.lineEnd(),ih(s)>Dh&&(k=-(m=180)),u[0]=k,u[1]=m,r=null}function h(a,b){return(b-=a)<0?b+360:b}function i(a,b){return a[0]-b[0]}function j(a,b){return b[0]<=b[1]?b[0]<=a&&a<=b[1]:a<b[0]||b[1]<a}var k,l,m,n,o,p,q,r,s,t,u,v={point:a,lineStart:c,lineEnd:d,polygonStart:function(){v.point=e,v.lineStart=f,v.lineEnd=g,s=0,oi.polygonStart()},polygonEnd:function(){oi.polygonEnd(),v.point=a,v.lineStart=c,v.lineEnd=d,0>ni?(k=-(m=180),l=-(n=90)):s>Dh?n=90:-Dh>s&&(l=-90),u[0]=k,u[1]=m}};return function(a){n=m=-(k=l=1/0),t=[],Wg.geo.stream(a,v);var b=t.length;if(b){t.sort(i);for(var c,d=1,e=t[0],f=[e];b>d;++d)c=t[d],j(c[0],e)||j(c[1],e)?(h(e[0],c[1])>h(e[0],e[1])&&(e[1]=c[1]),h(c[0],e[1])>h(e[0],e[1])&&(e[0]=c[0])):f.push(e=c);for(var g,c,o=-1/0,b=f.length-1,d=0,e=f[b];b>=d;e=c,++d)c=f[d],(g=h(e[1],c[0]))>o&&(o=g,k=c[0],m=e[1])}return t=u=null,1/0===k||1/0===l?[[0/0,0/0],[0/0,0/0]]:[[k,l],[m,n]]}}(),Wg.geo.centroid=function(a){pi=qi=ri=si=ti=ui=vi=wi=xi=yi=zi=0,Wg.geo.stream(a,Ai);var b=xi,c=yi,d=zi,e=b*b+c*c+d*d;return Eh>e&&(b=ui,c=vi,d=wi,Dh>qi&&(b=ri,c=si,d=ti),e=b*b+c*c+d*d,Eh>e)?[0/0,0/0]:[Math.atan2(c,b)*Gh,O(d/Math.sqrt(e))*Gh]};var pi,qi,ri,si,ti,ui,vi,wi,xi,yi,zi,Ai={sphere:i,point:Ob,lineStart:Qb,lineEnd:Rb,polygonStart:function(){Ai.lineStart=Sb},polygonEnd:function(){Ai.lineStart=Qb}},Bi=Xb(Tb,ac,cc,[-Ah,-Ah/2]),Ci=1e9;Wg.geo.clipExtent=function(){var a,b,c,d,e,f,g={stream:function(a){return e&&(e.valid=!1),e=f(a),e.valid=!0,e},extent:function(h){return arguments.length?(f=fc(a=+h[0][0],b=+h[0][1],c=+h[1][0],d=+h[1][1]),e&&(e.valid=!1,e=null),g):[[a,b],[c,d]]}};return g.extent([[0,0],[960,500]])},(Wg.geo.conicEqualArea=function(){return hc(ic)}).raw=ic,Wg.geo.albers=function(){return Wg.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Wg.geo.albersUsa=function(){function a(a){var f=a[0],g=a[1];return b=null,c(f,g),b||(d(f,g),b)||e(f,g),b}var b,c,d,e,f=Wg.geo.albers(),g=Wg.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),h=Wg.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i={point:function(a,c){b=[a,c]}};return a.invert=function(a){var b=f.scale(),c=f.translate(),d=(a[0]-c[0])/b,e=(a[1]-c[1])/b;return(e>=.12&&.234>e&&d>=-.425&&-.214>d?g:e>=.166&&.234>e&&d>=-.214&&-.115>d?h:f).invert(a)},a.stream=function(a){var b=f.stream(a),c=g.stream(a),d=h.stream(a);return{point:function(a,e){b.point(a,e),c.point(a,e),d.point(a,e)},sphere:function(){b.sphere(),c.sphere(),d.sphere()},lineStart:function(){b.lineStart(),c.lineStart(),d.lineStart()},lineEnd:function(){b.lineEnd(),c.lineEnd(),d.lineEnd()},polygonStart:function(){b.polygonStart(),c.polygonStart(),d.polygonStart()},polygonEnd:function(){b.polygonEnd(),c.polygonEnd(),d.polygonEnd()}}},a.precision=function(b){return arguments.length?(f.precision(b),g.precision(b),h.precision(b),a):f.precision()},a.scale=function(b){return arguments.length?(f.scale(b),g.scale(.35*b),h.scale(b),a.translate(f.translate())):f.scale()},a.translate=function(b){if(!arguments.length)return f.translate();var j=f.scale(),k=+b[0],l=+b[1];return c=f.translate(b).clipExtent([[k-.455*j,l-.238*j],[k+.455*j,l+.238*j]]).stream(i).point,d=g.translate([k-.307*j,l+.201*j]).clipExtent([[k-.425*j+Dh,l+.12*j+Dh],[k-.214*j-Dh,l+.234*j-Dh]]).stream(i).point,e=h.translate([k-.205*j,l+.212*j]).clipExtent([[k-.214*j+Dh,l+.166*j+Dh],[k-.115*j-Dh,l+.234*j-Dh]]).stream(i).point,a},a.scale(1070)};var Di,Ei,Fi,Gi,Hi,Ii,Ji={point:i,lineStart:i,lineEnd:i,polygonStart:function(){Ei=0,Ji.lineStart=jc},polygonEnd:function(){Ji.lineStart=Ji.lineEnd=Ji.point=i,Di+=ih(Ei/2)}},Ki={point:kc,lineStart:i,lineEnd:i,polygonStart:i,polygonEnd:i},Li={point:nc,lineStart:oc,lineEnd:pc,polygonStart:function(){Li.lineStart=qc},polygonEnd:function(){Li.point=nc,Li.lineStart=oc,Li.lineEnd=pc}};Wg.geo.path=function(){function a(a){return a&&("function"==typeof h&&f.pointRadius(+h.apply(this,arguments)),g&&g.valid||(g=e(f)),Wg.geo.stream(a,g)),f.result()}function b(){return g=null,a}var c,d,e,f,g,h=4.5;return a.area=function(a){return Di=0,Wg.geo.stream(a,e(Ji)),Di},a.centroid=function(a){return ri=si=ti=ui=vi=wi=xi=yi=zi=0,Wg.geo.stream(a,e(Li)),zi?[xi/zi,yi/zi]:wi?[ui/wi,vi/wi]:ti?[ri/ti,si/ti]:[0/0,0/0]},a.bounds=function(a){return Hi=Ii=-(Fi=Gi=1/0),Wg.geo.stream(a,e(Ki)),[[Fi,Gi],[Hi,Ii]]},a.projection=function(a){return arguments.length?(e=(c=a)?a.stream||tc(a):qb,b()):c},a.context=function(a){return arguments.length?(f=null==(d=a)?new lc:new rc(a),"function"!=typeof h&&f.pointRadius(h),b()):d},a.pointRadius=function(b){return arguments.length?(h="function"==typeof b?b:(f.pointRadius(+b),+b),a):h},a.projection(Wg.geo.albersUsa()).context(null)},Wg.geo.transform=function(a){return{stream:function(b){var c=new uc(b);for(var d in a)c[d]=a[d];return c}}},uc.prototype={point:function(a,b){this.stream.point(a,b)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Wg.geo.projection=wc,Wg.geo.projectionMutator=xc,(Wg.geo.equirectangular=function(){return wc(zc)}).raw=zc.invert=zc,Wg.geo.rotation=function(a){function b(b){return b=a(b[0]*Fh,b[1]*Fh),b[0]*=Gh,b[1]*=Gh,b}return a=Bc(a[0]%360*Fh,a[1]*Fh,a.length>2?a[2]*Fh:0),b.invert=function(b){return b=a.invert(b[0]*Fh,b[1]*Fh),b[0]*=Gh,b[1]*=Gh,b},b},Ac.invert=zc,Wg.geo.circle=function(){function a(){var a="function"==typeof d?d.apply(this,arguments):d,b=Bc(-a[0]*Fh,-a[1]*Fh,0).invert,e=[];return c(null,null,1,{point:function(a,c){e.push(a=b(a,c)),a[0]*=Gh,a[1]*=Gh}}),{type:"Polygon",coordinates:[e]}}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=Fc((b=+d)*Fh,e*Fh),a):b},a.precision=function(d){return arguments.length?(c=Fc(b*Fh,(e=+d)*Fh),a):e},a.angle(90)},Wg.geo.distance=function(a,b){var c,d=(b[0]-a[0])*Fh,e=a[1]*Fh,f=b[1]*Fh,g=Math.sin(d),h=Math.cos(d),i=Math.sin(e),j=Math.cos(e),k=Math.sin(f),l=Math.cos(f);return Math.atan2(Math.sqrt((c=l*g)*c+(c=j*k-i*l*h)*c),i*k+j*l*h)},Wg.geo.graticule=function(){function a(){return{type:"MultiLineString",coordinates:b()}}function b(){return Wg.range(Math.ceil(f/q)*q,e,q).map(m).concat(Wg.range(Math.ceil(j/r)*r,i,r).map(n)).concat(Wg.range(Math.ceil(d/o)*o,c,o).filter(function(a){return ih(a%q)>Dh}).map(k)).concat(Wg.range(Math.ceil(h/p)*p,g,p).filter(function(a){return ih(a%r)>Dh}).map(l))}var c,d,e,f,g,h,i,j,k,l,m,n,o=10,p=o,q=90,r=360,s=2.5;return a.lines=function(){return b().map(function(a){return{type:"LineString",coordinates:a}})},a.outline=function(){return{type:"Polygon",coordinates:[m(f).concat(n(i).slice(1),m(e).reverse().slice(1),n(j).reverse().slice(1))]}},a.extent=function(b){return arguments.length?a.majorExtent(b).minorExtent(b):a.minorExtent()},a.majorExtent=function(b){return arguments.length?(f=+b[0][0],e=+b[1][0],j=+b[0][1],i=+b[1][1],f>e&&(b=f,f=e,e=b),j>i&&(b=j,j=i,i=b),a.precision(s)):[[f,j],[e,i]]},a.minorExtent=function(b){return arguments.length?(d=+b[0][0],c=+b[1][0],h=+b[0][1],g=+b[1][1],d>c&&(b=d,d=c,c=b),h>g&&(b=h,h=g,g=b),a.precision(s)):[[d,h],[c,g]]},a.step=function(b){return arguments.length?a.majorStep(b).minorStep(b):a.minorStep()},a.majorStep=function(b){return arguments.length?(q=+b[0],r=+b[1],a):[q,r]},a.minorStep=function(b){return arguments.length?(o=+b[0],p=+b[1],a):[o,p]},a.precision=function(b){return arguments.length?(s=+b,k=Hc(h,g,90),l=Ic(d,c,s),m=Hc(j,i,90),n=Ic(f,e,s),a):s},a.majorExtent([[-180,-90+Dh],[180,90-Dh]]).minorExtent([[-180,-80-Dh],[180,80+Dh]])},Wg.geo.greatArc=function(){function a(){return{type:"LineString",coordinates:[b||d.apply(this,arguments),c||e.apply(this,arguments)]}}var b,c,d=Jc,e=Kc;return a.distance=function(){return Wg.geo.distance(b||d.apply(this,arguments),c||e.apply(this,arguments))},a.source=function(c){return arguments.length?(d=c,b="function"==typeof c?null:c,a):d},a.target=function(b){return arguments.length?(e=b,c="function"==typeof b?null:b,a):e},a.precision=function(){return arguments.length?a:0},a},Wg.geo.interpolate=function(a,b){return Lc(a[0]*Fh,a[1]*Fh,b[0]*Fh,b[1]*Fh)},Wg.geo.length=function(a){return Mi=0,Wg.geo.stream(a,Ni),Mi};var Mi,Ni={sphere:i,point:i,lineStart:Mc,lineEnd:i,polygonStart:i,polygonEnd:i},Oi=Nc(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(Wg.geo.azimuthalEqualArea=function(){return wc(Oi)}).raw=Oi;var Pi=Nc(function(a){var b=Math.acos(a);return b&&b/Math.sin(b)},qb);(Wg.geo.azimuthalEquidistant=function(){return wc(Pi)}).raw=Pi,(Wg.geo.conicConformal=function(){return hc(Oc)}).raw=Oc,(Wg.geo.conicEquidistant=function(){return hc(Pc)}).raw=Pc;var Qi=Nc(function(a){return 1/a},Math.atan);(Wg.geo.gnomonic=function(){return wc(Qi)}).raw=Qi,Qc.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Ch]},(Wg.geo.mercator=function(){return Rc(Qc)}).raw=Qc;var Ri=Nc(function(){return 1},Math.asin);(Wg.geo.orthographic=function(){return wc(Ri)}).raw=Ri;var Si=Nc(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(Wg.geo.stereographic=function(){return wc(Si)}).raw=Si,Sc.invert=function(a,b){return[-b,2*Math.atan(Math.exp(a))-Ch]},(Wg.geo.transverseMercator=function(){var a=Rc(Sc),b=a.center,c=a.rotate;return a.center=function(a){return a?b([-a[1],a[0]]):(a=b(),[-a[1],a[0]])},a.rotate=function(a){return a?c([a[0],a[1],a.length>2?a[2]+90:90]):(a=c(),[a[0],a[1],a[2]-90])},a.rotate([0,0])}).raw=Sc,Wg.geom={},Wg.geom.hull=function(a){function b(a){if(a.length<3)return[];var b,e,f,g,h,i,j,k,l,m,n,o,p=pb(c),q=pb(d),r=a.length,s=r-1,t=[],u=[],v=0;if(p===Tc&&d===Uc)b=a;else for(f=0,b=[];r>f;++f)b.push([+p.call(this,e=a[f],f),+q.call(this,e,f)]);for(f=1;r>f;++f)(b[f][1]<b[v][1]||b[f][1]==b[v][1]&&b[f][0]<b[v][0])&&(v=f);for(f=0;r>f;++f)f!==v&&(i=b[f][1]-b[v][1],h=b[f][0]-b[v][0],t.push({angle:Math.atan2(i,h),index:f}));for(t.sort(function(a,b){return a.angle-b.angle}),n=t[0].angle,m=t[0].index,l=0,f=1;s>f;++f){if(g=t[f].index,n==t[f].angle){if(h=b[m][0]-b[v][0],i=b[m][1]-b[v][1],j=b[g][0]-b[v][0],k=b[g][1]-b[v][1],h*h+i*i>=j*j+k*k){t[f].index=-1;continue}t[l].index=-1}n=t[f].angle,l=f,m=g}for(u.push(v),f=0,g=0;2>f;++g)t[g].index>-1&&(u.push(t[g].index),f++);for(o=u.length;s>g;++g)if(!(t[g].index<0)){for(;!Vc(u[o-2],u[o-1],t[g].index,b);)--o;u[o++]=t[g].index}var w=[];for(f=o-1;f>=0;--f)w.push(a[u[f]]);return w}var c=Tc,d=Uc;return arguments.length?b(a):(b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b)},Wg.geom.polygon=function(a){return nh(a,Ti),a};var Ti=Wg.geom.polygon.prototype=[];Ti.area=function(){for(var a,b=-1,c=this.length,d=this[c-1],e=0;++b<c;)a=d,d=this[b],e+=a[1]*d[0]-a[0]*d[1];return.5*e},Ti.centroid=function(a){var b,c,d=-1,e=this.length,f=0,g=0,h=this[e-1];for(arguments.length||(a=-1/(6*this.area()));++d<e;)b=h,h=this[d],c=b[0]*h[1]-h[0]*b[1],f+=(b[0]+h[0])*c,g+=(b[1]+h[1])*c;return[f*a,g*a]},Ti.clip=function(a){for(var b,c,d,e,f,g,h=Yc(a),i=-1,j=this.length-Yc(this),k=this[j-1];++i<j;){for(b=a.slice(),a.length=0,e=this[i],f=b[(d=b.length-h)-1],c=-1;++c<d;)g=b[c],Wc(g,k,e)?(Wc(f,k,e)||a.push(Xc(f,g,k,e)),a.push(g)):Wc(f,k,e)&&a.push(Xc(f,g,k,e)),f=g;h&&a.push(a[0]),k=e}return a};var Ui,Vi,Wi,Xi,Yi,Zi=[],$i=[];ed.prototype.prepare=function(){for(var a,b=this.edges,c=b.length;c--;)a=b[c].edge,a.b&&a.a||b.splice(c,1);return b.sort(gd),b.length},qd.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},rd.prototype={insert:function(a,b){var c,d,e;if(a){if(b.P=a,b.N=a.N,a.N&&(a.N.P=b),a.N=b,a.R){for(a=a.R;a.L;)a=a.L;a.L=b}else a.R=b;c=a}else this._?(a=vd(this._),b.P=null,b.N=a,a.P=a.L=b,c=a):(b.P=b.N=null,this._=b,c=null);for(b.L=b.R=null,b.U=c,b.C=!0,a=b;c&&c.C;)d=c.U,c===d.L?(e=d.R,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.R&&(td(this,c),a=c,c=a.U),c.C=!1,d.C=!0,ud(this,d))):(e=d.L,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.L&&(ud(this,c),a=c,c=a.U),c.C=!1,d.C=!0,td(this,d))),c=a.U;this._.C=!1},remove:function(a){a.N&&(a.N.P=a.P),a.P&&(a.P.N=a.N),a.N=a.P=null;var b,c,d,e=a.U,f=a.L,g=a.R;if(c=f?g?vd(g):f:g,e?e.L===a?e.L=c:e.R=c:this._=c,f&&g?(d=c.C,c.C=a.C,c.L=f,f.U=c,c!==g?(e=c.U,c.U=a.U,a=c.R,e.L=a,c.R=g,g.U=c):(c.U=e,e=c,a=c.R)):(d=a.C,a=c),a&&(a.U=e),!d){if(a&&a.C)return void(a.C=!1);do{if(a===this._)break;if(a===e.L){if(b=e.R,b.C&&(b.C=!1,e.C=!0,td(this,e),b=e.R),b.L&&b.L.C||b.R&&b.R.C){b.R&&b.R.C||(b.L.C=!1,b.C=!0,ud(this,b),b=e.R),b.C=e.C,e.C=b.R.C=!1,td(this,e),a=this._;break}}else if(b=e.L,b.C&&(b.C=!1,e.C=!0,ud(this,e),b=e.L),b.L&&b.L.C||b.R&&b.R.C){b.L&&b.L.C||(b.R.C=!1,b.C=!0,td(this,b),b=e.L),b.C=e.C,e.C=b.L.C=!1,ud(this,e),a=this._;break}b.C=!0,a=e,e=e.U}while(!a.C);a&&(a.C=!1)}}},Wg.geom.voronoi=function(a){function b(a){var b=new Array(a.length),d=h[0][0],e=h[0][1],f=h[1][0],g=h[1][1];return wd(c(a),h).cells.forEach(function(c,h){var i=c.edges,j=c.site,k=b[h]=i.length?i.map(function(a){var b=a.start();return[b.x,b.y]}):j.x>=d&&j.x<=f&&j.y>=e&&j.y<=g?[[d,g],[f,g],[f,e],[d,e]]:[];k.point=a[h]}),b}function c(a){return a.map(function(a,b){return{x:Math.round(f(a,b)/Dh)*Dh,y:Math.round(g(a,b)/Dh)*Dh,i:b}})}var d=Tc,e=Uc,f=d,g=e,h=_i;return a?b(a):(b.links=function(a){return wd(c(a)).edges.filter(function(a){return a.l&&a.r}).map(function(b){return{source:a[b.l.i],target:a[b.r.i]}})},b.triangles=function(a){var b=[];return wd(c(a)).cells.forEach(function(c,d){for(var e,f,g=c.site,h=c.edges.sort(gd),i=-1,j=h.length,k=h[j-1].edge,l=k.l===g?k.r:k.l;++i<j;)e=k,f=l,k=h[i].edge,l=k.l===g?k.r:k.l,d<f.i&&d<l.i&&yd(g,f,l)<0&&b.push([a[d],a[f.i],a[l.i]])}),b},b.x=function(a){return arguments.length?(f=pb(d=a),b):d},b.y=function(a){return arguments.length?(g=pb(e=a),b):e},b.clipExtent=function(a){return arguments.length?(h=null==a?_i:a,b):h===_i?null:h},b.size=function(a){return arguments.length?b.clipExtent(a&&[[0,0],a]):h===_i?null:h&&h[1]},b)};var _i=[[-1e6,-1e6],[1e6,1e6]];Wg.geom.delaunay=function(a){return Wg.geom.voronoi().triangles(a)},Wg.geom.quadtree=function(a,b,c,d,e){function f(a){function f(a,b,c,d,e,f,g,h){if(!isNaN(c)&&!isNaN(d))if(a.leaf){var i=a.x,k=a.y;if(null!=i)if(ih(i-c)+ih(k-d)<.01)j(a,b,c,d,e,f,g,h);else{var l=a.point;a.x=a.y=a.point=null,j(a,l,i,k,e,f,g,h),j(a,b,c,d,e,f,g,h)}else a.x=c,a.y=d,a.point=b}else j(a,b,c,d,e,f,g,h)}function j(a,b,c,d,e,g,h,i){var j=.5*(e+h),k=.5*(g+i),l=c>=j,m=d>=k,n=(m<<1)+l;a.leaf=!1,a=a.nodes[n]||(a.nodes[n]=Bd()),l?e=j:h=j,m?g=k:i=k,f(a,b,c,d,e,g,h,i)}var k,l,m,n,o,p,q,r,s,t=pb(h),u=pb(i);if(null!=b)p=b,q=c,r=d,s=e;else if(r=s=-(p=q=1/0),l=[],m=[],o=a.length,g)for(n=0;o>n;++n)k=a[n],k.x<p&&(p=k.x),k.y<q&&(q=k.y),k.x>r&&(r=k.x),k.y>s&&(s=k.y),l.push(k.x),m.push(k.y);else for(n=0;o>n;++n){var v=+t(k=a[n],n),w=+u(k,n);p>v&&(p=v),q>w&&(q=w),v>r&&(r=v),w>s&&(s=w),l.push(v),m.push(w)}var x=r-p,y=s-q;x>y?s=q+x:r=p+y;var z=Bd();if(z.add=function(a){f(z,a,+t(a,++n),+u(a,n),p,q,r,s)},z.visit=function(a){Cd(a,z,p,q,r,s)},n=-1,null==b){for(;++n<o;)f(z,a[n],l[n],m[n],p,q,r,s);--n}else a.forEach(z.add);return l=m=a=k=null,z}var g,h=Tc,i=Uc;return(g=arguments.length)?(h=zd,i=Ad,3===g&&(e=c,d=b,c=b=0),f(a)):(f.x=function(a){return arguments.length?(h=a,f):h},f.y=function(a){return arguments.length?(i=a,f):i},f.extent=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=+a[0][0],c=+a[0][1],d=+a[1][0],e=+a[1][1]),f):null==b?null:[[b,c],[d,e]]},f.size=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=c=0,d=+a[0],e=+a[1]),f):null==b?null:[d-b,e-c]},f)},Wg.interpolateRgb=Dd,Wg.interpolateObject=Ed,Wg.interpolateNumber=Fd,Wg.interpolateString=Gd;var aj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;Wg.interpolate=Hd,Wg.interpolators=[function(a,b){var c=typeof b;return("string"===c?Vh.has(b)||/^(#|rgb\(|hsl\()/.test(b)?Dd:Gd:b instanceof T?Dd:"object"===c?Array.isArray(b)?Id:Ed:Fd)(a,b)}],Wg.interpolateArray=Id;var bj=function(){return qb},cj=Wg.map({linear:bj,poly:Pd,quad:function(){return Md},cubic:function(){return Nd},sin:function(){return Qd},exp:function(){return Rd},circle:function(){return Sd},elastic:Td,back:Ud,bounce:function(){return Vd}}),dj=Wg.map({"in":qb,out:Kd,"in-out":Ld,"out-in":function(a){return Ld(Kd(a))}});Wg.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return c=cj.get(c)||bj,d=dj.get(d)||qb,Jd(d(c.apply(null,Xg.call(arguments,1))))},Wg.interpolateHcl=Wd,Wg.interpolateHsl=Xd,Wg.interpolateLab=Yd,Wg.interpolateRound=Zd,Wg.transform=function(a){var b=Zg.createElementNS(Wg.ns.prefix.svg,"g");return(Wg.transform=function(a){if(null!=a){b.setAttribute("transform",a);var c=b.transform.baseVal.consolidate()}return new $d(c?c.matrix:ej)})(a)},$d.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ej={a:1,b:0,c:0,d:1,e:0,f:0};Wg.interpolateTransform=ce,Wg.layout={},Wg.layout.bundle=function(){return function(a){for(var b=[],c=-1,d=a.length;++c<d;)b.push(fe(a[c]));return b}},Wg.layout.chord=function(){function a(){var a,j,l,m,n,o={},p=[],q=Wg.range(f),r=[];for(c=[],d=[],a=0,m=-1;++m<f;){for(j=0,n=-1;++n<f;)j+=e[m][n];p.push(j),r.push(Wg.range(f)),a+=j}for(g&&q.sort(function(a,b){return g(p[a],p[b])}),h&&r.forEach(function(a,b){a.sort(function(a,c){return h(e[b][a],e[b][c])})}),a=(Bh-k*f)/a,j=0,m=-1;++m<f;){for(l=j,n=-1;++n<f;){var s=q[m],t=r[s][n],u=e[s][t],v=j,w=j+=u*a;o[s+"-"+t]={index:s,subindex:t,startAngle:v,endAngle:w,value:u}}d[s]={index:s,startAngle:l,endAngle:j,value:(j-l)/a},j+=k}for(m=-1;++m<f;)for(n=m-1;++n<f;){var x=o[m+"-"+n],y=o[n+"-"+m];(x.value||y.value)&&c.push(x.value<y.value?{source:y,target:x}:{source:x,target:y})}i&&b()}function b(){c.sort(function(a,b){return i((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)
  })}var c,d,e,f,g,h,i,j={},k=0;return j.matrix=function(a){return arguments.length?(f=(e=a)&&e.length,c=d=null,j):e},j.padding=function(a){return arguments.length?(k=a,c=d=null,j):k},j.sortGroups=function(a){return arguments.length?(g=a,c=d=null,j):g},j.sortSubgroups=function(a){return arguments.length?(h=a,c=null,j):h},j.sortChords=function(a){return arguments.length?(i=a,c&&b(),j):i},j.chords=function(){return c||a(),c},j.groups=function(){return d||a(),d},j},Wg.layout.force=function(){function a(a){return function(b,c,d,e){if(b.point!==a){var f=b.cx-a.x,g=b.cy-a.y,h=1/Math.sqrt(f*f+g*g);if(p>(e-c)*h){var i=b.charge*h*h;return a.px-=f*i,a.py-=g*i,!0}if(b.point&&isFinite(h)){var i=b.pointCharge*h*h;a.px-=f*i,a.py-=g*i}}return!b.charge}}function b(a){a.px=Wg.event.x,a.py=Wg.event.y,h.resume()}var c,d,e,f,g,h={},i=Wg.dispatch("start","tick","end"),j=[1,1],k=.9,l=fj,m=gj,n=-30,o=.1,p=.8,q=[],r=[];return h.tick=function(){if((d*=.99)<.005)return i.end({type:"end",alpha:d=0}),!0;var b,c,h,l,m,p,s,t,u,v=q.length,w=r.length;for(c=0;w>c;++c)h=r[c],l=h.source,m=h.target,t=m.x-l.x,u=m.y-l.y,(p=t*t+u*u)&&(p=d*f[c]*((p=Math.sqrt(p))-e[c])/p,t*=p,u*=p,m.x-=t*(s=l.weight/(m.weight+l.weight)),m.y-=u*s,l.x+=t*(s=1-s),l.y+=u*s);if((s=d*o)&&(t=j[0]/2,u=j[1]/2,c=-1,s))for(;++c<v;)h=q[c],h.x+=(t-h.x)*s,h.y+=(u-h.y)*s;if(n)for(me(b=Wg.geom.quadtree(q),d,g),c=-1;++c<v;)(h=q[c]).fixed||b.visit(a(h));for(c=-1;++c<v;)h=q[c],h.fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*k,h.y-=(h.py-(h.py=h.y))*k);i.tick({type:"tick",alpha:d})},h.nodes=function(a){return arguments.length?(q=a,h):q},h.links=function(a){return arguments.length?(r=a,h):r},h.size=function(a){return arguments.length?(j=a,h):j},h.linkDistance=function(a){return arguments.length?(l="function"==typeof a?a:+a,h):l},h.distance=h.linkDistance,h.linkStrength=function(a){return arguments.length?(m="function"==typeof a?a:+a,h):m},h.friction=function(a){return arguments.length?(k=+a,h):k},h.charge=function(a){return arguments.length?(n="function"==typeof a?a:+a,h):n},h.gravity=function(a){return arguments.length?(o=+a,h):o},h.theta=function(a){return arguments.length?(p=+a,h):p},h.alpha=function(a){return arguments.length?(a=+a,d?d=a>0?a:0:a>0&&(i.start({type:"start",alpha:d=a}),Wg.timer(h.tick)),h):d},h.start=function(){function a(a,d){if(!c){for(c=new Array(i),h=0;i>h;++h)c[h]=[];for(h=0;j>h;++h){var e=r[h];c[e.source.index].push(e.target),c[e.target.index].push(e.source)}}for(var f,g=c[b],h=-1,j=g.length;++h<j;)if(!isNaN(f=g[h][a]))return f;return Math.random()*d}var b,c,d,i=q.length,k=r.length,o=j[0],p=j[1];for(b=0;i>b;++b)(d=q[b]).index=b,d.weight=0;for(b=0;k>b;++b)d=r[b],"number"==typeof d.source&&(d.source=q[d.source]),"number"==typeof d.target&&(d.target=q[d.target]),++d.source.weight,++d.target.weight;for(b=0;i>b;++b)d=q[b],isNaN(d.x)&&(d.x=a("x",o)),isNaN(d.y)&&(d.y=a("y",p)),isNaN(d.px)&&(d.px=d.x),isNaN(d.py)&&(d.py=d.y);if(e=[],"function"==typeof l)for(b=0;k>b;++b)e[b]=+l.call(this,r[b],b);else for(b=0;k>b;++b)e[b]=l;if(f=[],"function"==typeof m)for(b=0;k>b;++b)f[b]=+m.call(this,r[b],b);else for(b=0;k>b;++b)f[b]=m;if(g=[],"function"==typeof n)for(b=0;i>b;++b)g[b]=+n.call(this,q[b],b);else for(b=0;i>b;++b)g[b]=n;return h.resume()},h.resume=function(){return h.alpha(.1)},h.stop=function(){return h.alpha(0)},h.drag=function(){return c||(c=Wg.behavior.drag().origin(qb).on("dragstart.force",ie).on("drag.force",b).on("dragend.force",je)),arguments.length?void this.on("mouseover.force",ke).on("mouseout.force",le).call(c):c},Wg.rebind(h,i,"on")};var fj=20,gj=1;Wg.layout.hierarchy=function(){function a(b,g,h){var i=e.call(c,b,g);if(b.depth=g,h.push(b),i&&(j=i.length)){for(var j,k,l=-1,m=b.children=new Array(j),n=0,o=g+1;++l<j;)k=m[l]=a(i[l],o,h),k.parent=b,n+=k.value;d&&m.sort(d),f&&(b.value=n)}else delete b.children,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,i=-1,j=d+1;++i<h;)g+=b(e[i],j);else f&&(g=+f.call(c,a,d)||0);return f&&(a.value=g),g}function c(b){var c=[];return a(b,0,c),c}var d=qe,e=oe,f=pe;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},Wg.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,i,j=-1;for(d=b.value?d/b.value:0;++j<g;)a(h=f[j],c,i=h.value*d,e),c+=i}}function b(a){var c=a.children,d=0;if(c&&(e=c.length))for(var e,f=-1;++f<e;)d=Math.max(d,b(c[f]));return 1+d}function c(c,f){var g=d.call(this,c,f);return a(g[0],0,e[0],e[1]/b(g[0])),g}var d=Wg.layout.hierarchy(),e=[1,1];return c.size=function(a){return arguments.length?(e=a,c):e},ne(c,d)},Wg.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),i=(("function"==typeof e?e.apply(this,arguments):e)-h)/Wg.sum(g),j=Wg.range(f.length);null!=c&&j.sort(c===hj?function(a,b){return g[b]-g[a]}:function(a,b){return c(f[a],f[b])});var k=[];return j.forEach(function(a){var b;k[a]={data:f[a],value:b=g[a],startAngle:h,endAngle:h+=b*i}}),k}var b=Number,c=hj,d=0,e=Bh;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 hj={};Wg.layout.stack=function(){function a(h,i){var j=h.map(function(c,d){return b.call(a,c,d)}),k=j.map(function(b){return b.map(function(b,c){return[f.call(a,b,c),g.call(a,b,c)]})}),l=c.call(a,k,i);j=Wg.permute(j,l),k=Wg.permute(k,l);var m,n,o,p=d.call(a,k,i),q=j.length,r=j[0].length;for(n=0;r>n;++n)for(e.call(a,j[0][n],o=p[n],k[0][n][1]),m=1;q>m;++m)e.call(a,j[m][n],o+=k[m-1][n][1],k[m][n][1]);return h}var b=qb,c=ve,d=we,e=ue,f=se,g=te;return a.values=function(c){return arguments.length?(b=c,a):b},a.order=function(b){return arguments.length?(c="function"==typeof b?b:ij.get(b)||ve,a):c},a.offset=function(b){return arguments.length?(d="function"==typeof b?b:jj.get(b)||we,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 ij=Wg.map({"inside-out":function(a){var b,c,d=a.length,e=a.map(xe),f=a.map(ye),g=Wg.range(d).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(b=0;d>b;++b)c=g[b],i>h?(h+=f[c],j.push(c)):(i+=f[c],k.push(c));return k.reverse().concat(j)},reverse:function(a){return Wg.range(a.length).reverse()},"default":ve}),jj=Wg.map({silhouette:function(a){var b,c,d,e=a.length,f=a[0].length,g=[],h=0,i=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];d>h&&(h=d),g.push(d)}for(c=0;f>c;++c)i[c]=(h-g[c])/2;return i},wiggle:function(a){var b,c,d,e,f,g,h,i,j,k=a.length,l=a[0],m=l.length,n=[];for(n[0]=i=j=0,c=1;m>c;++c){for(b=0,e=0;k>b;++b)e+=a[b][c][1];for(b=0,f=0,h=l[c][0]-l[c-1][0];k>b;++b){for(d=0,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]=i-=e?f/e*h:0,j>i&&(j=i)}for(c=0;m>c;++c)n[c]-=j;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(b=0,d=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:we});Wg.layout.histogram=function(){function a(a,f){for(var g,h,i=[],j=a.map(c,this),k=d.call(this,j,f),l=e.call(this,k,j,f),f=-1,m=j.length,n=l.length-1,o=b?1:1/m;++f<n;)g=i[f]=[],g.dx=l[f+1]-(g.x=l[f]),g.y=0;if(n>0)for(f=-1;++f<m;)h=j[f],h>=k[0]&&h<=k[1]&&(g=i[Wg.bisect(l,h,1,n)-1],g.y+=o,g.push(a[f]));return i}var b=!0,c=Number,d=Ce,e=Ae;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=pb(b),a):d},a.bins=function(b){return arguments.length?(e="number"==typeof b?function(a){return Be(a,b)}:pb(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a},Wg.layout.tree=function(){function a(a,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],l=k,m=-1;++m<f;)j=d[m],g(j,h),l=i(j,h,l),h=j;Le(a);var n=.5*(k._tree.prelim+j._tree.prelim);b?(e.prelim=b._tree.prelim+c(a,b),e.mod=e.prelim-n):e.prelim=n}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;++e<d;)h(c[e],b)}}function i(a,b,d){if(b){for(var e,f=a,g=a,h=b,i=a.parent.children[0],j=f._tree.mod,k=g._tree.mod,l=h._tree.mod,m=i._tree.mod;h=Fe(h),f=Ee(f),h&&f;)i=Ee(i),g=Fe(g),g._tree.ancestor=a,e=h._tree.prelim+l-f._tree.prelim-j+c(h,f),e>0&&(Me(Ne(h,a,d),a,e),j+=e,k+=e),l+=h._tree.mod,j+=f._tree.mod,m+=i._tree.mod,k+=g._tree.mod;h&&!Fe(g)&&(g._tree.thread=h,g._tree.mod+=l-k),f&&!Ee(i)&&(i._tree.thread=f,i._tree.mod+=j-m,d=a)}return d}var j=b.call(this,a,f),k=j[0];Ke(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 l=Ge(k,Ie),m=Ge(k,He),n=Ge(k,Je),o=l.x-c(l,m)/2,p=m.x+c(m,l)/2,q=n.depth||1;return Ke(k,e?function(a){a.x*=d[0],a.y=a.depth*d[1],delete a._tree}:function(a){a.x=(a.x-o)/(p-o)*d[0],a.y=a.depth/q*d[1],delete a._tree}),j}var b=Wg.layout.hierarchy().sort(null).value(null),c=De,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},ne(a,b)},Wg.layout.pack=function(){function a(a,f){var g=c.call(this,a,f),h=g[0],i=e[0],j=e[1],k=null==b?Math.sqrt:"function"==typeof b?b:function(){return b};if(h.x=h.y=0,Ke(h,function(a){a.r=+k(a.value)}),Ke(h,Se),d){var l=d*(b?1:Math.max(2*h.r/i,2*h.r/j))/2;Ke(h,function(a){a.r+=l}),Ke(h,Se),Ke(h,function(a){a.r-=l})}return Ve(h,i/2,j/2,b?1:1/Math.max(2*h.r/i,2*h.r/j)),g}var b,c=Wg.layout.hierarchy().sort(Oe),d=0,e=[1,1];return a.size=function(b){return arguments.length?(e=b,a):e},a.radius=function(c){return arguments.length?(b=null==c||"function"==typeof c?c:+c,a):b},a.padding=function(b){return arguments.length?(d=+b,a):d},ne(a,c)},Wg.layout.cluster=function(){function a(a,f){var g,h=b.call(this,a,f),i=h[0],j=0;Ke(i,function(a){var b=a.children;b&&b.length?(a.x=Ye(b),a.y=Xe(b)):(a.x=g?j+=c(a,g):0,a.y=0,g=a)});var k=Ze(i),l=$e(i),m=k.x-c(k,l)/2,n=l.x+c(l,k)/2;return Ke(i,e?function(a){a.x=(a.x-i.x)*d[0],a.y=(i.y-a.y)*d[1]}:function(a){a.x=(a.x-m)/(n-m)*d[0],a.y=(1-(i.y?a.y/i.y:1))*d[1]}),h}var b=Wg.layout.hierarchy().sort(null).value(null),c=De,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},ne(a,b)},Wg.layout.treemap=function(){function a(a,b){for(var c,d,e=-1,f=a.length;++e<f;)d=(c=a[e]).value*(0>b?0:b),c.area=isNaN(d)||0>=d?0:d}function b(c){var f=c.children;if(f&&f.length){var g,h,i,j=l(c),k=[],m=f.slice(),o=1/0,p="slice"===n?j.dx:"dice"===n?j.dy:"slice-dice"===n?1&c.depth?j.dy:j.dx:Math.min(j.dx,j.dy);for(a(m,j.dx*j.dy/c.value),k.area=0;(i=m.length)>0;)k.push(g=m[i-1]),k.area+=g.area,"squarify"!==n||(h=d(k,p))<=o?(m.pop(),o=h):(k.area-=k.pop().area,e(k,p,j,!1),p=Math.min(j.dx,j.dy),k.length=k.area=0,o=1/0);k.length&&(e(k,p,j,!0),k.length=k.area=0),f.forEach(b)}}function c(b){var d=b.children;if(d&&d.length){var f,g=l(b),h=d.slice(),i=[];for(a(h,g.dx*g.dy/b.value),i.area=0;f=h.pop();)i.push(f),i.area+=f.area,null!=f.z&&(e(i,f.z?g.dx:g.dy,g,!h.length),i.length=i.area=0);d.forEach(c)}}function d(a,b){for(var c,d=a.area,e=0,f=1/0,g=-1,h=a.length;++g<h;)(c=a[g].area)&&(f>c&&(f=c),c>e&&(e=c));return d*=d,b*=b,d?Math.max(b*e*o/d,d/(b*f*o)):1/0}function e(a,b,c,d){var e,f=-1,g=a.length,h=c.x,j=c.y,k=b?i(a.area/b):0;if(b==c.dx){for((d||k>c.dy)&&(k=c.dy);++f<g;)e=a[f],e.x=h,e.y=j,e.dy=k,h+=e.dx=Math.min(c.x+c.dx-h,k?i(e.area/k):0);e.z=!0,e.dx+=c.x+c.dx-h,c.y+=k,c.dy-=k}else{for((d||k>c.dx)&&(k=c.dx);++f<g;)e=a[f],e.x=h,e.y=j,e.dx=k,j+=e.dy=Math.min(c.y+c.dy-j,k?i(e.area/k):0);e.z=!1,e.dy+=c.y+c.dy-j,c.x+=k,c.dx-=k}}function f(d){var e=g||h(d),f=e[0];return f.x=0,f.y=0,f.dx=j[0],f.dy=j[1],g&&h.revalue(f),a([f],f.dx*f.dy/f.value),(g?c:b)(f),m&&(g=e),e}var g,h=Wg.layout.hierarchy(),i=Math.round,j=[1,1],k=null,l=_e,m=!1,n="squarify",o=.5*(1+Math.sqrt(5));return f.size=function(a){return arguments.length?(j=a,f):j},f.padding=function(a){function b(b){var c=a.call(f,b,b.depth);return null==c?_e(b):af(b,"number"==typeof c?[c,c,c,c]:c)}function c(b){return af(b,a)}if(!arguments.length)return k;var d;return l=null==(k=a)?_e:"function"==(d=typeof a)?b:"number"===d?(a=[a,a,a,a],c):c,f},f.round=function(a){return arguments.length?(i=a?Math.round:Number,f):i!=Number},f.sticky=function(a){return arguments.length?(m=a,g=null,f):m},f.ratio=function(a){return arguments.length?(o=a,f):o},f.mode=function(a){return arguments.length?(n=a+"",f):n},ne(f,h)},Wg.random={normal:function(a,b){var c=arguments.length;return 2>c&&(b=1),1>c&&(a=0),function(){var c,d,e;do c=2*Math.random()-1,d=2*Math.random()-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var a=Wg.random.normal.apply(Wg,arguments);return function(){return Math.exp(a())}},bates:function(a){var b=Wg.random.irwinHall(a);return function(){return b()/a}},irwinHall:function(a){return function(){for(var b=0,c=0;a>c;c++)b+=Math.random();return b}}},Wg.scale={};var kj={floor:qb,ceil:qb};Wg.scale.linear=function(){return hf([0,1],[0,1],Hd,!1)};var lj={s:1,g:1,p:1,r:1,e:1};Wg.scale.log=function(){return qf(Wg.scale.linear().domain([0,1]),10,!0,[1,10])};var mj=Wg.format(".0e"),nj={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};Wg.scale.pow=function(){return rf(Wg.scale.linear(),1,[0,1])},Wg.scale.sqrt=function(){return Wg.scale.pow().exponent(.5)},Wg.scale.ordinal=function(){return tf([],{t:"range",a:[[]]})},Wg.scale.category10=function(){return Wg.scale.ordinal().range(oj)},Wg.scale.category20=function(){return Wg.scale.ordinal().range(pj)},Wg.scale.category20b=function(){return Wg.scale.ordinal().range(qj)},Wg.scale.category20c=function(){return Wg.scale.ordinal().range(rj)};var oj=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(gb),pj=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(gb),qj=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(gb),rj=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(gb);Wg.scale.quantile=function(){return uf([],[])},Wg.scale.quantize=function(){return vf(0,1,[0,1])},Wg.scale.threshold=function(){return wf([.5],[0,1])},Wg.scale.identity=function(){return xf([0,1])},Wg.svg={},Wg.svg.arc=function(){function a(){var a=b.apply(this,arguments),f=c.apply(this,arguments),g=d.apply(this,arguments)+sj,h=e.apply(this,arguments)+sj,i=(g>h&&(i=g,g=h,h=i),h-g),j=Ah>i?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=tj?a?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+a+"A"+a+","+a+" 0 1,0 0,"+-a+"A"+a+","+a+" 0 1,0 0,"+a+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":a?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+a*m+","+a*n+"A"+a+","+a+" 0 "+j+",0 "+a*k+","+a*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0Z"}var b=yf,c=zf,d=Af,e=Bf;return a.innerRadius=function(c){return arguments.length?(b=pb(c),a):b},a.outerRadius=function(b){return arguments.length?(c=pb(b),a):c},a.startAngle=function(b){return arguments.length?(d=pb(b),a):d},a.endAngle=function(b){return arguments.length?(e=pb(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+sj;return[Math.cos(f)*a,Math.sin(f)*a]},a};var sj=-Ch,tj=Bh-Dh;Wg.svg.line=function(){return Cf(qb)};var uj=Wg.map({linear:Df,"linear-closed":Ef,step:Ff,"step-before":Gf,"step-after":Hf,basis:Nf,"basis-open":Of,"basis-closed":Pf,bundle:Qf,cardinal:Kf,"cardinal-open":If,"cardinal-closed":Jf,monotone:Wf});uj.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var vj=[0,2/3,1/3,0],wj=[0,1/3,2/3,0],xj=[0,1/6,2/3,1/6];Wg.svg.line.radial=function(){var a=Cf(Xf);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},Gf.reverse=Hf,Hf.reverse=Gf,Wg.svg.area=function(){return Yf(qb)},Wg.svg.area.radial=function(){var a=Yf(Xf);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},Wg.svg.chord=function(){function a(a,h){var i=b(this,f,a,h),j=b(this,g,a,h);return"M"+i.p0+d(i.r,i.p1,i.a1-i.a0)+(c(i,j)?e(i.r,i.p1,i.r,i.p0):e(i.r,i.p1,j.r,j.p0)+d(j.r,j.p1,j.a1-j.a0)+e(j.r,j.p1,i.r,i.p0))+"Z"}function b(a,b,c,d){var e=b.call(a,c,d),f=h.call(a,e,d),g=i.call(a,e,d)+sj,k=j.call(a,e,d)+sj;return{r:f,a0:g,a1:k,p0:[f*Math.cos(g),f*Math.sin(g)],p1:[f*Math.cos(k),f*Math.sin(k)]}}function c(a,b){return a.a0==b.a0&&a.a1==b.a1}function d(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Ah)+",1 "+b}function e(a,b,c,d){return"Q 0,0 "+d}var f=Jc,g=Kc,h=Zf,i=Af,j=Bf;return a.radius=function(b){return arguments.length?(h=pb(b),a):h},a.source=function(b){return arguments.length?(f=pb(b),a):f},a.target=function(b){return arguments.length?(g=pb(b),a):g},a.startAngle=function(b){return arguments.length?(i=pb(b),a):i},a.endAngle=function(b){return arguments.length?(j=pb(b),a):j},a},Wg.svg.diagonal=function(){function a(a,e){var f=b.call(this,a,e),g=c.call(this,a,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(d),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var b=Jc,c=Kc,d=$f;return a.source=function(c){return arguments.length?(b=pb(c),a):b},a.target=function(b){return arguments.length?(c=pb(b),a):c},a.projection=function(b){return arguments.length?(d=b,a):d},a},Wg.svg.diagonal.radial=function(){var a=Wg.svg.diagonal(),b=$f,c=a.projection;return a.projection=function(a){return arguments.length?c(_f(b=a)):b},a},Wg.svg.symbol=function(){function a(a,d){return(yj.get(b.call(this,a,d))||cg)(c.call(this,a,d))}var b=bg,c=ag;return a.type=function(c){return arguments.length?(b=pb(c),a):b},a.size=function(b){return arguments.length?(c=pb(b),a):c},a};var yj=Wg.map({circle:cg,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+-3*b+","+-b+"H"+-b+"V"+-3*b+"H"+b+"V"+-b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+-b+"V"+b+"H"+-3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*Cj)),c=b*Cj;return"M0,"+-b+"L"+c+",0 0,"+b+" "+-c+",0Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+-b+","+-b+"L"+b+","+-b+" "+b+","+b+" "+-b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/Bj),c=b*Bj/2;return"M0,"+c+"L"+b+","+-c+" "+-b+","+-c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/Bj),c=b*Bj/2;return"M0,"+-c+"L"+b+","+c+" "+-b+","+c+"Z"}});Wg.svg.symbolTypes=yj.keys();var zj,Aj,Bj=Math.sqrt(3),Cj=Math.tan(30*Fh),Dj=[],Ej=0;Dj.call=sh.call,Dj.empty=sh.empty,Dj.node=sh.node,Dj.size=sh.size,Wg.transition=function(a){return arguments.length?zj?a.transition():a:vh.transition()},Wg.transition.prototype=Dj,Dj.select=function(a){var b,c,d,e=this.id,f=[];a=p(a);for(var g=-1,h=this.length;++g<h;){f.push(b=[]);for(var i=this[g],j=-1,k=i.length;++j<k;)(d=i[j])&&(c=a.call(d,d.__data__,j,g))?("__data__"in d&&(c.__data__=d.__data__),gg(c,j,e,d.__transition__[e]),b.push(c)):b.push(null)}return dg(f,e)},Dj.selectAll=function(a){var b,c,d,e,f,g=this.id,h=[];a=q(a);for(var i=-1,j=this.length;++i<j;)for(var k=this[i],l=-1,m=k.length;++l<m;)if(d=k[l]){f=d.__transition__[g],c=a.call(d,d.__data__,l,i),h.push(b=[]);for(var n=-1,o=c.length;++n<o;)(e=c[n])&&gg(e,n,g,f),b.push(e)}return dg(h,g)},Dj.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=B(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]);for(var c=this[f],h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return dg(e,this.id)},Dj.tween=function(a,b){var c=this.id;return arguments.length<2?this.node().__transition__[c].tween.get(a):D(this,null==b?function(b){b.__transition__[c].tween.remove(a)}:function(d){d.__transition__[c].tween.set(a,b)})},Dj.attr=function(a,b){function c(){this.removeAttribute(h)}function d(){this.removeAttributeNS(h.space,h.local)}function e(a){return null==a?c:(a+="",function(){var b,c=this.getAttribute(h);return c!==a&&(b=g(c,a),function(a){this.setAttribute(h,b(a))})})}function f(a){return null==a?d:(a+="",function(){var b,c=this.getAttributeNS(h.space,h.local);return c!==a&&(b=g(c,a),function(a){this.setAttributeNS(h.space,h.local,b(a))})})}if(arguments.length<2){for(b in a)this.attr(b,a[b]);return this}var g="transform"==a?ce:Hd,h=Wg.ns.qualify(a);return eg(this,"attr."+a,b,h.local?f:e)},Dj.attrTween=function(a,b){function c(a,c){var d=b.call(this,a,c,this.getAttribute(e));return d&&function(a){this.setAttribute(e,d(a))}}function d(a,c){var d=b.call(this,a,c,this.getAttributeNS(e.space,e.local));return d&&function(a){this.setAttributeNS(e.space,e.local,d(a))}}var e=Wg.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)},Dj.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(b){return null==b?d:(b+="",function(){var d,e=_g.getComputedStyle(this,null).getPropertyValue(a);return e!==b&&(d=Hd(e,b),function(b){this.style.setProperty(a,d(b),c)})})}var f=arguments.length;if(3>f){if("string"!=typeof a){2>f&&(b="");for(c in a)this.style(c,a[c],b);return this}c=""}return eg(this,"style."+a,b,e)},Dj.styleTween=function(a,b,c){function d(d,e){var f=b.call(this,d,e,_g.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),c)}}return arguments.length<3&&(c=""),this.tween("style."+a,d)},Dj.text=function(a){return eg(this,"text",a,fg)},Dj.remove=function(){return this.each("end.transition",function(){var a;this.__transition__.count<2&&(a=this.parentNode)&&a.removeChild(this)})},Dj.ease=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].ease:("function"!=typeof a&&(a=Wg.ease.apply(Wg,arguments)),D(this,function(c){c.__transition__[b].ease=a}))},Dj.delay=function(a){var b=this.id;return D(this,"function"==typeof a?function(c,d,e){c.__transition__[b].delay=+a.call(c,c.__data__,d,e)}:(a=+a,function(c){c.__transition__[b].delay=a}))},Dj.duration=function(a){var b=this.id;return D(this,"function"==typeof a?function(c,d,e){c.__transition__[b].duration=Math.max(1,a.call(c,c.__data__,d,e))}:(a=Math.max(1,a),function(c){c.__transition__[b].duration=a}))},Dj.each=function(a,b){var c=this.id;if(arguments.length<2){var d=Aj,e=zj;zj=c,D(this,function(b,d,e){Aj=b.__transition__[c],a.call(b,b.__data__,d,e)}),Aj=d,zj=e}else D(this,function(d){var e=d.__transition__[c];(e.event||(e.event=Wg.dispatch("start","end"))).on(a,b)});return this},Dj.transition=function(){for(var a,b,c,d,e=this.id,f=++Ej,g=[],h=0,i=this.length;i>h;h++){g.push(a=[]);for(var b=this[h],j=0,k=b.length;k>j;j++)(c=b[j])&&(d=Object.create(c.__transition__[e]),d.delay+=d.duration,gg(c,j,f,d)),a.push(c)}return dg(g,f)},Wg.svg.axis=function(){function a(a){a.each(function(){var a,j=Wg.select(this),k=this.__chart__||c,l=this.__chart__=c.copy(),m=null==i?l.ticks?l.ticks.apply(l,h):l.domain():i,n=null==b?l.tickFormat?l.tickFormat.apply(l,h):qb:b,o=j.selectAll(".tick").data(m,l),p=o.enter().insert("g",".domain").attr("class","tick").style("opacity",Dh),q=Wg.transition(o.exit()).style("opacity",Dh).remove(),r=Wg.transition(o).style("opacity",1),s=cf(l),t=j.selectAll(".domain").data([0]),u=(t.enter().append("path").attr("class","domain"),Wg.transition(t));p.append("line"),p.append("text");var v=p.select("line"),w=r.select("line"),x=o.select("text").text(n),y=p.select("text"),z=r.select("text");switch(d){case"bottom":a=hg,v.attr("y2",e),y.attr("y",Math.max(e,0)+g),w.attr("x2",0).attr("y2",e),z.attr("x",0).attr("y",Math.max(e,0)+g),x.attr("dy",".71em").style("text-anchor","middle"),u.attr("d","M"+s[0]+","+f+"V0H"+s[1]+"V"+f);break;case"top":a=hg,v.attr("y2",-e),y.attr("y",-(Math.max(e,0)+g)),w.attr("x2",0).attr("y2",-e),z.attr("x",0).attr("y",-(Math.max(e,0)+g)),x.attr("dy","0em").style("text-anchor","middle"),u.attr("d","M"+s[0]+","+-f+"V0H"+s[1]+"V"+-f);break;case"left":a=ig,v.attr("x2",-e),y.attr("x",-(Math.max(e,0)+g)),w.attr("x2",-e).attr("y2",0),z.attr("x",-(Math.max(e,0)+g)).attr("y",0),x.attr("dy",".32em").style("text-anchor","end"),u.attr("d","M"+-f+","+s[0]+"H0V"+s[1]+"H"+-f);break;case"right":a=ig,v.attr("x2",e),y.attr("x",Math.max(e,0)+g),w.attr("x2",e).attr("y2",0),z.attr("x",Math.max(e,0)+g).attr("y",0),x.attr("dy",".32em").style("text-anchor","start"),u.attr("d","M"+f+","+s[0]+"H0V"+s[1]+"H"+f)}if(l.rangeBand){var A=l,B=A.rangeBand()/2;k=l=function(a){return A(a)+B}}else k.rangeBand?k=l:q.call(a,l);p.call(a,k),r.call(a,l)})}var b,c=Wg.scale.linear(),d=Fj,e=6,f=6,g=3,h=[10],i=null;return a.scale=function(b){return arguments.length?(c=b,a):c},a.orient=function(b){return arguments.length?(d=b in Gj?b+"":Fj,a):d},a.ticks=function(){return arguments.length?(h=arguments,a):h},a.tickValues=function(b){return arguments.length?(i=b,a):i},a.tickFormat=function(c){return arguments.length?(b=c,a):b},a.tickSize=function(b){var c=arguments.length;return c?(e=+b,f=+arguments[c-1],a):e},a.innerTickSize=function(b){return arguments.length?(e=+b,a):e},a.outerTickSize=function(b){return arguments.length?(f=+b,a):f},a.tickPadding=function(b){return arguments.length?(g=+b,a):g},a.tickSubdivide=function(){return arguments.length&&a},a};var Fj="bottom",Gj={top:1,right:1,bottom:1,left:1};Wg.svg.brush=function(){function a(f){f.each(function(){var f=Wg.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",e).on("touchstart.brush",e),g=f.selectAll(".background").data([0]);g.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var h=f.selectAll(".resize").data(q,qb);h.exit().remove(),h.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return Hj[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"),h.style("display",a.empty()?"none":null);var k,l=Wg.transition(f),m=Wg.transition(g);i&&(k=cf(i),m.attr("x",k[0]).attr("width",k[1]-k[0]),c(l)),j&&(k=cf(j),m.attr("y",k[0]).attr("height",k[1]-k[0]),d(l)),b(l)})}function b(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+k[+/e$/.test(a)]+","+m[+/^s/.test(a)]+")"})}function c(a){a.select(".extent").attr("x",k[0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",k[1]-k[0])}function d(a){a.select(".extent").attr("y",m[0]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",m[1]-m[0])}function e(){function e(){32==Wg.event.keyCode&&(C||(t=null,E[0]-=k[1],E[1]-=m[1],C=2),l())}function n(){32==Wg.event.keyCode&&2==C&&(E[0]+=k[1],E[1]+=m[1],C=0,l())}function q(){var a=Wg.mouse(v),e=!1;u&&(a[0]+=u[0],a[1]+=u[1]),C||(Wg.event.altKey?(t||(t=[(k[0]+k[1])/2,(m[0]+m[1])/2]),E[0]=k[+(a[0]<t[0])],E[1]=m[+(a[1]<t[1])]):t=null),A&&r(a,i,0)&&(c(y),e=!0),B&&r(a,j,1)&&(d(y),e=!0),e&&(b(y),x({type:"brush",mode:C?"move":"resize"}))}function r(a,b,c){var d,e,h=cf(b),i=h[0],j=h[1],l=E[c],n=c?m:k,q=n[1]-n[0];return C&&(i-=l,j-=q+l),d=(c?p:o)?Math.max(i,Math.min(j,a[c])):a[c],C?e=(d+=l)+q:(t&&(l=Math.max(i,Math.min(j,2*t[c]-d))),d>l?(e=d,d=l):e=l),n[0]!=d||n[1]!=e?(c?g=null:f=null,n[0]=d,n[1]=e,!0):void 0}function s(){q(),y.style("pointer-events","all").selectAll(".resize").style("display",a.empty()?"none":null),Wg.select("body").style("cursor",null),F.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D(),x({type:"brushend"})}var t,u,v=this,w=Wg.select(Wg.event.target),x=h.of(v,arguments),y=Wg.select(v),z=w.datum(),A=!/^(n|s)$/.test(z)&&i,B=!/^(e|w)$/.test(z)&&j,C=w.classed("extent"),D=K(),E=Wg.mouse(v),F=Wg.select(_g).on("keydown.brush",e).on("keyup.brush",n);if(Wg.event.changedTouches?F.on("touchmove.brush",q).on("touchend.brush",s):F.on("mousemove.brush",q).on("mouseup.brush",s),y.interrupt().selectAll("*").interrupt(),C)E[0]=k[0]-E[0],E[1]=m[0]-E[1];else if(z){var G=+/w$/.test(z),H=+/^n/.test(z);u=[k[1-G]-E[0],m[1-H]-E[1]],E[0]=k[G],E[1]=m[H]}else Wg.event.altKey&&(t=E.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),Wg.select("body").style("cursor",w.style("cursor")),x({type:"brushstart"}),q()}var f,g,h=n(a,"brushstart","brush","brushend"),i=null,j=null,k=[0,0],m=[0,0],o=!0,p=!0,q=Ij[0];return a.event=function(a){a.each(function(){var a=h.of(this,arguments),b={x:k,y:m,i:f,j:g},c=this.__chart__||b;this.__chart__=b,zj?Wg.select(this).transition().each("start.brush",function(){f=c.i,g=c.j,k=c.x,m=c.y,a({type:"brushstart"})}).tween("brush:brush",function(){var c=Id(k,b.x),d=Id(m,b.y);return f=g=null,function(e){k=b.x=c(e),m=b.y=d(e),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){f=b.i,g=b.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})}):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))})},a.x=function(b){return arguments.length?(i=b,q=Ij[!i<<1|!j],a):i},a.y=function(b){return arguments.length?(j=b,q=Ij[!i<<1|!j],a):j},a.clamp=function(b){return arguments.length?(i&&j?(o=!!b[0],p=!!b[1]):i?o=!!b:j&&(p=!!b),a):i&&j?[o,p]:i?o:j?p:null},a.extent=function(b){var c,d,e,h,l;return arguments.length?(i&&(c=b[0],d=b[1],j&&(c=c[0],d=d[0]),f=[c,d],i.invert&&(c=i(c),d=i(d)),c>d&&(l=c,c=d,d=l),(c!=k[0]||d!=k[1])&&(k=[c,d])),j&&(e=b[0],h=b[1],i&&(e=e[1],h=h[1]),g=[e,h],j.invert&&(e=j(e),h=j(h)),e>h&&(l=e,e=h,h=l),(e!=m[0]||h!=m[1])&&(m=[e,h])),a):(i&&(f?(c=f[0],d=f[1]):(c=k[0],d=k[1],i.invert&&(c=i.invert(c),d=i.invert(d)),c>d&&(l=c,c=d,d=l))),j&&(g?(e=g[0],h=g[1]):(e=m[0],h=m[1],j.invert&&(e=j.invert(e),h=j.invert(h)),e>h&&(l=e,e=h,h=l))),i&&j?[[c,e],[d,h]]:i?[c,d]:j&&[e,h])},a.clear=function(){return a.empty()||(k=[0,0],m=[0,0],f=g=null),a},a.empty=function(){return!!i&&k[0]==k[1]||!!j&&m[0]==m[1]},Wg.rebind(a,h,"on")};var Hj={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ij=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Jj=Wg.time={},Kj=Date,Lj=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];jg.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(){Mj.setUTCDate.apply(this._,arguments)},setDay:function(){Mj.setUTCDay.apply(this._,arguments)},setFullYear:function(){Mj.setUTCFullYear.apply(this._,arguments)},setHours:function(){Mj.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Mj.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Mj.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Mj.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Mj.setUTCSeconds.apply(this._,arguments)
  },setTime:function(){Mj.setTime.apply(this._,arguments)}};var Mj=Date.prototype,Nj="%a %b %e %X %Y",Oj="%m/%d/%Y",Pj="%H:%M:%S",Qj=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Rj=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Sj=["January","February","March","April","May","June","July","August","September","October","November","December"],Tj=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Jj.year=kg(function(a){return a=Jj.day(a),a.setMonth(0,1),a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()}),Jj.years=Jj.year.range,Jj.years.utc=Jj.year.utc.range,Jj.day=kg(function(a){var b=new Kj(2e3,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}),Jj.days=Jj.day.range,Jj.days.utc=Jj.day.utc.range,Jj.dayOfYear=function(a){var b=Jj.year(a);return Math.floor((a-b-6e4*(a.getTimezoneOffset()-b.getTimezoneOffset()))/864e5)},Lj.forEach(function(a,b){a=a.toLowerCase(),b=7-b;var c=Jj[a]=kg(function(a){return(a=Jj.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=Jj.year(a).getDay();return Math.floor((Jj.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});Jj[a+"s"]=c.range,Jj[a+"s"].utc=c.utc.range,Jj[a+"OfYear"]=function(a){var c=Jj.year(a).getDay();return Math.floor((Jj.dayOfYear(a)+(c+b)%7)/7)}}),Jj.week=Jj.sunday,Jj.weeks=Jj.sunday.range,Jj.weeks.utc=Jj.sunday.utc.range,Jj.weekOfYear=Jj.sundayOfYear,Jj.format=mg;var Uj=og(Qj),Vj=pg(Qj),Wj=og(Rj),Xj=pg(Rj),Yj=og(Sj),Zj=pg(Sj),$j=og(Tj),_j=pg(Tj),ak=/^%/,bk={"-":"",_:" ",0:"0"},ck={a:function(a){return Rj[a.getDay()]},A:function(a){return Qj[a.getDay()]},b:function(a){return Tj[a.getMonth()]},B:function(a){return Sj[a.getMonth()]},c:mg(Nj),d:function(a,b){return qg(a.getDate(),b,2)},e:function(a,b){return qg(a.getDate(),b,2)},H:function(a,b){return qg(a.getHours(),b,2)},I:function(a,b){return qg(a.getHours()%12||12,b,2)},j:function(a,b){return qg(1+Jj.dayOfYear(a),b,3)},L:function(a,b){return qg(a.getMilliseconds(),b,3)},m:function(a,b){return qg(a.getMonth()+1,b,2)},M:function(a,b){return qg(a.getMinutes(),b,2)},p:function(a){return a.getHours()>=12?"PM":"AM"},S:function(a,b){return qg(a.getSeconds(),b,2)},U:function(a,b){return qg(Jj.sundayOfYear(a),b,2)},w:function(a){return a.getDay()},W:function(a,b){return qg(Jj.mondayOfYear(a),b,2)},x:mg(Oj),X:mg(Pj),y:function(a,b){return qg(a.getFullYear()%100,b,2)},Y:function(a,b){return qg(a.getFullYear()%1e4,b,4)},Z:Ng,"%":function(){return"%"}},dk={a:rg,A:sg,b:wg,B:xg,c:yg,d:Gg,e:Gg,H:Ig,I:Ig,j:Hg,L:Lg,m:Fg,M:Jg,p:Mg,S:Kg,U:ug,w:tg,W:vg,x:zg,X:Ag,y:Cg,Y:Bg,Z:Dg,"%":Og},ek=/^\s*\d+/,fk=Wg.map({am:0,pm:1});mg.utc=Pg;var gk=Pg("%Y-%m-%dT%H:%M:%S.%LZ");mg.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Qg:gk,Qg.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},Qg.toString=gk.toString,Jj.second=kg(function(a){return new Kj(1e3*Math.floor(a/1e3))},function(a,b){a.setTime(a.getTime()+1e3*Math.floor(b))},function(a){return a.getSeconds()}),Jj.seconds=Jj.second.range,Jj.seconds.utc=Jj.second.utc.range,Jj.minute=kg(function(a){return new Kj(6e4*Math.floor(a/6e4))},function(a,b){a.setTime(a.getTime()+6e4*Math.floor(b))},function(a){return a.getMinutes()}),Jj.minutes=Jj.minute.range,Jj.minutes.utc=Jj.minute.utc.range,Jj.hour=kg(function(a){var b=a.getTimezoneOffset()/60;return new Kj(36e5*(Math.floor(a/36e5-b)+b))},function(a,b){a.setTime(a.getTime()+36e5*Math.floor(b))},function(a){return a.getHours()}),Jj.hours=Jj.hour.range,Jj.hours.utc=Jj.hour.utc.range,Jj.month=kg(function(a){return a=Jj.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),Jj.months=Jj.month.range,Jj.months.utc=Jj.month.utc.range;var hk=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],ik=[[Jj.second,1],[Jj.second,5],[Jj.second,15],[Jj.second,30],[Jj.minute,1],[Jj.minute,5],[Jj.minute,15],[Jj.minute,30],[Jj.hour,1],[Jj.hour,3],[Jj.hour,6],[Jj.hour,12],[Jj.day,1],[Jj.day,2],[Jj.week,1],[Jj.month,1],[Jj.month,3],[Jj.year,1]],jk=[[mg("%Y"),Tb],[mg("%B"),function(a){return a.getMonth()}],[mg("%b %d"),function(a){return 1!=a.getDate()}],[mg("%a %d"),function(a){return a.getDay()&&1!=a.getDate()}],[mg("%I %p"),function(a){return a.getHours()}],[mg("%I:%M"),function(a){return a.getMinutes()}],[mg(":%S"),function(a){return a.getSeconds()}],[mg(".%L"),function(a){return a.getMilliseconds()}]],kk=Tg(jk);ik.year=Jj.year,Jj.scale=function(){return Rg(Wg.scale.linear(),ik,kk)};var lk={range:function(a,b,c){return Wg.range(+a,+b,c).map(Sg)},floor:qb,ceil:qb},mk=ik.map(function(a){return[a[0].utc,a[1]]}),nk=[[Pg("%Y"),Tb],[Pg("%B"),function(a){return a.getUTCMonth()}],[Pg("%b %d"),function(a){return 1!=a.getUTCDate()}],[Pg("%a %d"),function(a){return a.getUTCDay()&&1!=a.getUTCDate()}],[Pg("%I %p"),function(a){return a.getUTCHours()}],[Pg("%I:%M"),function(a){return a.getUTCMinutes()}],[Pg(":%S"),function(a){return a.getUTCSeconds()}],[Pg(".%L"),function(a){return a.getUTCMilliseconds()}]],ok=Tg(nk);return mk.year=Jj.year.utc,Jj.scale.utc=function(){return Rg(Wg.scale.linear(),mk,ok)},Wg.text=rb(function(a){return a.responseText}),Wg.json=function(a,b){return sb(a,"application/json",Ug,b)},Wg.html=function(a,b){return sb(a,"text/html",Vg,b)},Wg.xml=rb(function(a){return a.responseXML}),Wg}(),function(a,b){"object"==typeof exports?module.exports=b(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"==typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],b):a.URI=b(a.punycode,a.IPv6,a.SecondLevelDomains,a)}(this,function(a,b,c,d){"use strict";function e(a,b){return this instanceof e?(void 0===a&&(a="undefined"!=typeof location?location.href+"":""),this.href(a),void 0!==b?this.absoluteTo(b):this):new e(a,b)}function f(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function g(a){return void 0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function h(a){return"Array"===g(a)}function i(a,b){var c,d,e={};if(h(b))for(c=0,d=b.length;d>c;c++)e[b[c]]=!0;else e[b]=!0;for(c=0,d=a.length;d>c;c++)void 0!==e[a[c]]&&(a.splice(c,1),d--,c--);return a}function j(a,b){var c,d;if(h(b)){for(c=0,d=b.length;d>c;c++)if(!j(a,b[c]))return!1;return!0}var e=g(b);for(c=0,d=a.length;d>c;c++)if("RegExp"===e){if("string"==typeof a[c]&&a[c].match(b))return!0}else if(a[c]===b)return!0;return!1}function k(a,b){if(!h(a)||!h(b))return!1;if(a.length!==b.length)return!1;a.sort(),b.sort();for(var c=0,d=a.length;d>c;c++)if(a[c]!==b[c])return!1;return!0}function l(a){return escape(a)}function m(a){return encodeURIComponent(a).replace(/[!'()*]/g,l).replace(/\*/g,"%2A")}var n=d&&d.URI,o=e.prototype,p=Object.prototype.hasOwnProperty;e._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,duplicateQueryParameters:e.duplicateQueryParameters,escapeQuerySpace:e.escapeQuerySpace}},e.duplicateQueryParameters=!1,e.escapeQuerySpace=!0,e.protocol_expression=/^[a-z][a-z0-9-+-]*$/i,e.idn_expression=/[^a-z0-9\.-]/i,e.punycode_expression=/(xn--)/i,e.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,e.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,e.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,e.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},e.invalid_hostname_characters=/[^a-zA-Z0-9\.-]/,e.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src"},e.getDomAttribute=function(a){if(!a||!a.nodeName)return void 0;var b=a.nodeName.toLowerCase();return"input"===b&&"image"!==a.type?void 0:e.domAttributes[b]},e.encode=m,e.decode=decodeURIComponent,e.iso8859=function(){e.encode=escape,e.decode=unescape},e.unicode=function(){e.encode=m,e.decode=decodeURIComponent},e.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}}},e.encodeQuery=function(a,b){var c=e.encode(a+"");return b?c.replace(/%20/g,"+"):c},e.decodeQuery=function(a,b){a+="";try{return e.decode(b?a.replace(/\+/g,"%20"):a)}catch(c){return a}},e.recodePath=function(a){for(var b=(a+"").split("/"),c=0,d=b.length;d>c;c++)b[c]=e.encodePathSegment(e.decode(b[c]));return b.join("/")},e.decodePath=function(a){for(var b=(a+"").split("/"),c=0,d=b.length;d>c;c++)b[c]=e.decodePathSegment(b[c]);return b.join("/")};var q,r={encode:"encode",decode:"decode"},s=function(a,b){return function(c){return e[b](c+"").replace(e.characters[a][b].expression,function(c){return e.characters[a][b].map[c]})}};for(q in r)e[q+"PathSegment"]=s("pathname",r[q]);e.encodeReserved=s("reserved","encode"),e.parse=function(a,b){var c;return b||(b={}),c=a.indexOf("#"),c>-1&&(b.fragment=a.substring(c+1)||null,a=a.substring(0,c)),c=a.indexOf("?"),c>-1&&(b.query=a.substring(c+1)||null,a=a.substring(0,c)),"//"===a.substring(0,2)?(b.protocol=null,a=a.substring(2),a=e.parseAuthority(a,b)):(c=a.indexOf(":"),c>-1&&(b.protocol=a.substring(0,c)||null,b.protocol&&!b.protocol.match(e.protocol_expression)?b.protocol=void 0:"file"===b.protocol?a=a.substring(c+3):"//"===a.substring(c+1,c+3)?(a=a.substring(c+3),a=e.parseAuthority(a,b)):(a=a.substring(c+1),b.urn=!0))),b.path=a,b},e.parseHost=function(a,b){var c,d,e=a.indexOf("/");return-1===e&&(e=a.length),"["===a.charAt(0)?(c=a.indexOf("]"),b.hostname=a.substring(1,c)||null,b.port=a.substring(c+2,e)||null):a.indexOf(":")!==a.lastIndexOf(":")?(b.hostname=a.substring(0,e)||null,b.port=null):(d=a.substring(0,e).split(":"),b.hostname=d[0]||null,b.port=d[1]||null),b.hostname&&"/"!==a.substring(e).charAt(0)&&(e++,a="/"+a),a.substring(e)||"/"},e.parseAuthority=function(a,b){return a=e.parseUserinfo(a,b),e.parseHost(a,b)},e.parseUserinfo=function(a,b){var c,d=a.indexOf("/"),f=d>-1?a.lastIndexOf("@",d):a.indexOf("@");return f>-1&&(-1===d||d>f)?(c=a.substring(0,f).split(":"),b.username=c[0]?e.decode(c[0]):null,c.shift(),b.password=c[0]?e.decode(c.join(":")):null,a=a.substring(f+1)):(b.username=null,b.password=null),a},e.parseQuery=function(a,b){if(!a)return{};if(a=a.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!a)return{};for(var c,d,f,g={},h=a.split("&"),i=h.length,j=0;i>j;j++)c=h[j].split("="),d=e.decodeQuery(c.shift(),b),f=c.length?e.decodeQuery(c.join("="),b):null,g[d]?("string"==typeof g[d]&&(g[d]=[g[d]]),g[d].push(f)):g[d]=f;return g},e.build=function(a){var b="";return a.protocol&&(b+=a.protocol+":"),a.urn||!b&&!a.hostname||(b+="//"),b+=e.buildAuthority(a)||"","string"==typeof a.path&&("/"!==a.path.charAt(0)&&"string"==typeof a.hostname&&(b+="/"),b+=a.path),"string"==typeof a.query&&a.query&&(b+="?"+a.query),"string"==typeof a.fragment&&a.fragment&&(b+="#"+a.fragment),b},e.buildHost=function(a){var b="";return a.hostname?(e.ip6_expression.test(a.hostname)?b+=a.port?"["+a.hostname+"]:"+a.port:a.hostname:(b+=a.hostname,a.port&&(b+=":"+a.port)),b):""},e.buildAuthority=function(a){return e.buildUserinfo(a)+e.buildHost(a)},e.buildUserinfo=function(a){var b="";return a.username&&(b+=e.encode(a.username),a.password&&(b+=":"+e.encode(a.password)),b+="@"),b},e.buildQuery=function(a,b,c){var d,f,g,i,j="";for(f in a)if(p.call(a,f)&&f)if(h(a[f]))for(d={},g=0,i=a[f].length;i>g;g++)void 0!==a[f][g]&&void 0===d[a[f][g]+""]&&(j+="&"+e.buildQueryParameter(f,a[f][g],c),b!==!0&&(d[a[f][g]+""]=!0));else void 0!==a[f]&&(j+="&"+e.buildQueryParameter(f,a[f],c));return j.substring(1)},e.buildQueryParameter=function(a,b,c){return e.encodeQuery(a,c)+(null!==b?"="+e.encodeQuery(b,c):"")},e.addQuery=function(a,b,c){if("object"==typeof b)for(var d in b)p.call(b,d)&&e.addQuery(a,d,b[d]);else{if("string"!=typeof b)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===a[b])return void(a[b]=c);"string"==typeof a[b]&&(a[b]=[a[b]]),h(c)||(c=[c]),a[b]=a[b].concat(c)}},e.removeQuery=function(a,b,c){var d,f,g;if(h(b))for(d=0,f=b.length;f>d;d++)a[b[d]]=void 0;else if("object"==typeof b)for(g in b)p.call(b,g)&&e.removeQuery(a,g,b[g]);else{if("string"!=typeof b)throw new TypeError("URI.addQuery() accepts an object, string as the first parameter");void 0!==c?a[b]===c?a[b]=void 0:h(a[b])&&(a[b]=i(a[b],c)):a[b]=void 0}},e.hasQuery=function(a,b,c,d){if("object"==typeof b){for(var f in b)if(p.call(b,f)&&!e.hasQuery(a,f,b[f]))return!1;return!0}if("string"!=typeof b)throw new TypeError("URI.hasQuery() accepts an object, string as the name parameter");switch(g(c)){case"Undefined":return b in a;case"Boolean":var i=Boolean(h(a[b])?a[b].length:a[b]);return c===i;case"Function":return!!c(a[b],b,a);case"Array":if(!h(a[b]))return!1;var l=d?j:k;return l(a[b],c);case"RegExp":return h(a[b])?d?j(a[b],c):!1:Boolean(a[b]&&a[b].match(c));case"Number":c=String(c);case"String":return h(a[b])?d?j(a[b],c):!1:a[b]===c;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},e.commonPath=function(a,b){var c,d=Math.min(a.length,b.length);for(c=0;d>c;c++)if(a.charAt(c)!==b.charAt(c)){c--;break}return 1>c?a.charAt(0)===b.charAt(0)&&"/"===a.charAt(0)?"/":"":(("/"!==a.charAt(c)||"/"!==b.charAt(c))&&(c=a.substring(0,c).lastIndexOf("/")),a.substring(0,c+1))},e.withinString=function(a,b){return a.replace(e.find_uri_expression,b)},e.ensureValidHostname=function(b){if(b.match(e.invalid_hostname_characters)){if(!a)throw new TypeError("Hostname '"+b+"' contains characters other than [A-Z0-9.-] and Punycode.js is not available");if(a.toASCII(b).match(e.invalid_hostname_characters))throw new TypeError("Hostname '"+b+"' contains characters other than [A-Z0-9.-]")}},e.noConflict=function(a){if(a){var c={URI:this.noConflict()};return URITemplate&&"function"==typeof URITemplate.noConflict&&(c.URITemplate=URITemplate.noConflict()),b&&"function"==typeof b.noConflict&&(c.IPv6=b.noConflict()),SecondLevelDomains&&"function"==typeof SecondLevelDomains.noConflict&&(c.SecondLevelDomains=SecondLevelDomains.noConflict()),c}return d.URI===this&&(d.URI=n),this},o.build=function(a){return a===!0?this._deferred_build=!0:(void 0===a||this._deferred_build)&&(this._string=e.build(this._parts),this._deferred_build=!1),this},o.clone=function(){return new e(this)},o.valueOf=o.toString=function(){return this.build(!1)._string},r={protocol:"protocol",username:"username",password:"password",hostname:"hostname",port:"port"},s=function(a){return function(b,c){return void 0===b?this._parts[a]||"":(this._parts[a]=b||null,this.build(!c),this)}};for(q in r)o[q]=s(r[q]);r={query:"?",fragment:"#"},s=function(a,b){return function(c,d){return void 0===c?this._parts[a]||"":(null!==c&&(c+="",c.charAt(0)===b&&(c=c.substring(1))),this._parts[a]=c,this.build(!d),this)}};for(q in r)o[q]=s(q,r[q]);r={search:["?","query"],hash:["#","fragment"]},s=function(a,b){return function(c,d){var e=this[a](c,d);return"string"==typeof e&&e.length?b+e:e}};for(q in r)o[q]=s(r[q][1],r[q][0]);o.pathname=function(a,b){if(void 0===a||a===!0){var c=this._parts.path||(this._parts.hostname?"/":"");return a?e.decodePath(c):c}return this._parts.path=a?e.recodePath(a):"/",this.build(!b),this},o.path=o.pathname,o.href=function(a,b){var c;if(void 0===a)return this.toString();this._string="",this._parts=e._parts();var d=a instanceof e,f="object"==typeof a&&(a.hostname||a.path||a.pathname);if(a.nodeName){var g=e.getDomAttribute(a);a=a[g]||"",f=!1}if(!d&&f&&void 0!==a.pathname&&(a=a.toString()),"string"==typeof a)this._parts=e.parse(a,this._parts);else{if(!d&&!f)throw new TypeError("invalid input");var h=d?a._parts:a;for(c in h)p.call(this._parts,c)&&(this._parts[c]=h[c])}return this.build(!b),this},o.is=function(a){var b=!1,d=!1,f=!1,g=!1,h=!1,i=!1,j=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,d=e.ip4_expression.test(this._parts.hostname),f=e.ip6_expression.test(this._parts.hostname),b=d||f,g=!b,h=g&&c&&c.has(this._parts.hostname),i=g&&e.idn_expression.test(this._parts.hostname),j=g&&e.punycode_expression.test(this._parts.hostname)),a.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return g;case"sld":return h;case"ip":return b;case"ip4":case"ipv4":case"inet4":return d;case"ip6":case"ipv6":case"inet6":return f;case"idn":return i;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var t=o.protocol,u=o.port,v=o.hostname;o.protocol=function(a,b){if(void 0!==a&&a&&(a=a.replace(/:(\/\/)?$/,""),a.match(/[^a-zA-z0-9\.+-]/)))throw new TypeError("Protocol '"+a+"' contains characters other than [A-Z0-9.+-]");return t.call(this,a,b)},o.scheme=o.protocol,o.port=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a&&(0===a&&(a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),a.match(/[^0-9]/))))throw new TypeError("Port '"+a+"' contains characters other than [0-9]");return u.call(this,a,b)},o.hostname=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a){var c={};e.parseHost(a,c),a=c.hostname}return v.call(this,a,b)},o.host=function(a,b){return this._parts.urn?void 0===a?"":this:void 0===a?this._parts.hostname?e.buildHost(this._parts):"":(e.parseHost(a,this._parts),this.build(!b),this)},o.authority=function(a,b){return this._parts.urn?void 0===a?"":this:void 0===a?this._parts.hostname?e.buildAuthority(this._parts):"":(e.parseAuthority(a,this._parts),this.build(!b),this)},o.userinfo=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.username)return"";var c=e.buildUserinfo(this._parts);return c.substring(0,c.length-1)}return"@"!==a[a.length-1]&&(a+="@"),e.parseUserinfo(a,this._parts),this.build(!b),this},o.resource=function(a,b){var c;return void 0===a?this.path()+this.search()+this.hash():(c=e.parse(a),this._parts.path=c.path,this._parts.query=c.query,this._parts.fragment=c.fragment,this.build(!b),this)},o.subdomain=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,c)||""}var d=this._parts.hostname.length-this.domain().length,g=this._parts.hostname.substring(0,d),h=new RegExp("^"+f(g));return a&&"."!==a.charAt(a.length-1)&&(a+="."),a&&e.ensureValidHostname(a),this._parts.hostname=this._parts.hostname.replace(h,a),this.build(!b),this},o.domain=function(a,b){if(this._parts.urn)return void 0===a?"":this;if("boolean"==typeof a&&(b=a,a=void 0),void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.match(/\./g);if(c&&c.length<2)return this._parts.hostname;var d=this._parts.hostname.length-this.tld(b).length-1;return d=this._parts.hostname.lastIndexOf(".",d-1)+1,this._parts.hostname.substring(d)||""}if(!a)throw new TypeError("cannot set domain empty");if(e.ensureValidHostname(a),!this._parts.hostname||this.is("IP"))this._parts.hostname=a;else{var g=new RegExp(f(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(g,a)}return this.build(!b),this},o.tld=function(a,b){if(this._parts.urn)return void 0===a?"":this;if("boolean"==typeof a&&(b=a,a=void 0),void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var d=this._parts.hostname.lastIndexOf("."),e=this._parts.hostname.substring(d+1);return b!==!0&&c&&c.list[e.toLowerCase()]?c.get(this._parts.hostname)||e:e}var g;if(!a)throw new TypeError("cannot set TLD empty");if(a.match(/[^a-zA-Z0-9-]/)){if(!c||!c.is(a))throw new TypeError("TLD '"+a+"' contains characters other than [A-Z0-9]");g=new RegExp(f(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(g,a)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");g=new RegExp(f(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(g,a)}return this.build(!b),this},o.directory=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||a===!0){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var c=this._parts.path.length-this.filename().length-1,d=this._parts.path.substring(0,c)||(this._parts.hostname?"/":"");return a?e.decodePath(d):d}var g=this._parts.path.length-this.filename().length,h=this._parts.path.substring(0,g),i=new RegExp("^"+f(h));return this.is("relative")||(a||(a="/"),"/"!==a.charAt(0)&&(a="/"+a)),a&&"/"!==a.charAt(a.length-1)&&(a+="/"),a=e.recodePath(a),this._parts.path=this._parts.path.replace(i,a),this.build(!b),this},o.filename=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||a===!0){if(!this._parts.path||"/"===this._parts.path)return"";var c=this._parts.path.lastIndexOf("/"),d=this._parts.path.substring(c+1);return a?e.decodePathSegment(d):d}var g=!1;"/"===a.charAt(0)&&(a=a.substring(1)),a.match(/\.?\//)&&(g=!0);var h=new RegExp(f(this.filename())+"$");return a=e.recodePath(a),this._parts.path=this._parts.path.replace(h,a),g?this.normalizePath(b):this.build(!b),this},o.suffix=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||a===!0){if(!this._parts.path||"/"===this._parts.path)return"";var c,d,g=this.filename(),h=g.lastIndexOf(".");return-1===h?"":(c=g.substring(h+1),d=/^[a-z0-9%]+$/i.test(c)?c:"",a?e.decodePathSegment(d):d)}"."===a.charAt(0)&&(a=a.substring(1));var i,j=this.suffix();if(j)i=new RegExp(a?f(j)+"$":f("."+j)+"$");else{if(!a)return this;this._parts.path+="."+e.recodePath(a)}return i&&(a=e.recodePath(a),this._parts.path=this._parts.path.replace(i,a)),this.build(!b),this},o.segment=function(a,b,c){var d=this._parts.urn?":":"/",e=this.path(),f="/"===e.substring(0,1),g=e.split(d);if(void 0!==a&&"number"!=typeof a&&(c=b,b=a,a=void 0),void 0!==a&&"number"!=typeof a)throw new Error("Bad segment '"+a+"', must be 0-based integer");if(f&&g.shift(),0>a&&(a=Math.max(g.length+a,0)),void 0===b)return void 0===a?g:g[a];if(null===a||void 0===g[a])if(h(b)){g=[];for(var i=0,j=b.length;j>i;i++)(b[i].length||g.length&&g[g.length-1].length)&&(g.length&&!g[g.length-1].length&&g.pop(),g.push(b[i]))}else(b||"string"==typeof b)&&(""===g[g.length-1]?g[g.length-1]=b:g.push(b));else b||"string"==typeof b&&b.length?g[a]=b:g.splice(a,1);return f&&g.unshift(""),this.path(g.join(d),c)},o.segmentCoded=function(a,b,c){var d,f,g;if("number"!=typeof a&&(c=b,b=a,a=void 0),void 0===b){if(d=this.segment(a,b,c),h(d))for(f=0,g=d.length;g>f;f++)d[f]=e.decode(d[f]);else d=void 0!==d?e.decode(d):void 0;return d}if(h(b))for(f=0,g=b.length;g>f;f++)b[f]=e.decode(b[f]);else b="string"==typeof b?e.encode(b):b;return this.segment(a,b,c)};var w=o.query;return o.query=function(a,b){if(a===!0)return e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof a){var c=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace),d=a.call(this,c);return this._parts.query=e.buildQuery(d||c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!b),this}return void 0!==a&&"string"!=typeof a?(this._parts.query=e.buildQuery(a,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!b),this):w.call(this,a,b)},o.setQuery=function(a,b,c){var d=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("object"==typeof a)for(var f in a)p.call(a,f)&&(d[f]=a[f]);else{if("string"!=typeof a)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");d[a]=void 0!==b?b:null}return this._parts.query=e.buildQuery(d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof a&&(c=b),this.build(!c),this},o.addQuery=function(a,b,c){var d=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return e.addQuery(d,a,void 0===b?null:b),this._parts.query=e.buildQuery(d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof a&&(c=b),this.build(!c),this},o.removeQuery=function(a,b,c){var d=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return e.removeQuery(d,a,b),this._parts.query=e.buildQuery(d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof a&&(c=b),this.build(!c),this},o.hasQuery=function(a,b,c){var d=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return e.hasQuery(d,a,b,c)},o.setSearch=o.setQuery,o.addSearch=o.addQuery,o.removeSearch=o.removeQuery,o.hasSearch=o.hasQuery,o.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},o.normalizeProtocol=function(a){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!a)),this},o.normalizeHostname=function(c){return this._parts.hostname&&(this.is("IDN")&&a?this._parts.hostname=a.toASCII(this._parts.hostname):this.is("IPv6")&&b&&(this._parts.hostname=b.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!c)),this},o.normalizePort=function(a){return"string"==typeof this._parts.protocol&&this._parts.port===e.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a)),this},o.normalizePath=function(a){if(this._parts.urn)return this;if(!this._parts.path||"/"===this._parts.path)return this;var b,c,d,f=this._parts.path;for("/"!==f.charAt(0)&&(b=!0,f="/"+f),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/");;){if(c=f.indexOf("/../"),-1===c)break;if(0===c){f=f.substring(3);break}d=f.substring(0,c).lastIndexOf("/"),-1===d&&(d=c),f=f.substring(0,d)+f.substring(c+3)}return b&&this.is("relative")&&(f=f.substring(1)),f=e.recodePath(f),this._parts.path=f,this.build(!a),this},o.normalizePathname=o.normalizePath,o.normalizeQuery=function(a){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(e.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!a)),this},o.normalizeFragment=function(a){return this._parts.fragment||(this._parts.fragment=null,this.build(!a)),this},o.normalizeSearch=o.normalizeQuery,o.normalizeHash=o.normalizeFragment,o.iso8859=function(){var a=e.encode,b=e.decode;return e.encode=escape,e.decode=decodeURIComponent,this.normalize(),e.encode=a,e.decode=b,this},o.unicode=function(){var a=e.encode,b=e.decode;return e.encode=m,e.decode=unescape,this.normalize(),e.encode=a,e.decode=b,this},o.readable=function(){var b=this.clone();b.username("").password("").normalize();var c="";if(b._parts.protocol&&(c+=b._parts.protocol+"://"),b._parts.hostname&&(b.is("punycode")&&a?(c+=a.toUnicode(b._parts.hostname),b._parts.port&&(c+=":"+b._parts.port)):c+=b.host()),b._parts.hostname&&b._parts.path&&"/"!==b._parts.path.charAt(0)&&(c+="/"),c+=b.path(!0),b._parts.query){for(var d="",f=0,g=b._parts.query.split("&"),h=g.length;h>f;f++){var i=(g[f]||"").split("=");d+="&"+e.decodeQuery(i[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==i[1]&&(d+="="+e.decodeQuery(i[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}c+="?"+d.substring(1)}return c+=e.decodeQuery(b.hash(),!0)},o.absoluteTo=function(a){var b,c,d,f=this.clone(),g=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(a instanceof e||(a=new e(a)),f._parts.protocol||(f._parts.protocol=a._parts.protocol),this._parts.hostname)return f;for(c=0;d=g[c];c++)f._parts[d]=a._parts[d];for(g=["query","path"],c=0;d=g[c];c++)!f._parts[d]&&a._parts[d]&&(f._parts[d]=a._parts[d]);return"/"!==f.path().charAt(0)&&(b=a.directory(),f._parts.path=(b?b+"/":"")+f._parts.path,f.normalizePath()),f.build(),f},o.relativeTo=function(a){var b,c,d,f,g,h=this.clone().normalize();if(h._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(a=new e(a).normalize(),b=h._parts,c=a._parts,f=h.path(),g=a.path(),"/"!==f.charAt(0))throw new Error("URI is already relative");if("/"!==g.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(b.protocol===c.protocol&&(b.protocol=null),b.username!==c.username||b.password!==c.password)return h.build();if(null!==b.protocol||null!==b.username||null!==b.password)return h.build();if(b.hostname!==c.hostname||b.port!==c.port)return h.build();if(b.hostname=null,b.port=null,f===g)return b.path="",h.build();if(d=e.commonPath(h.path(),a.path()),!d)return h.build();var i=c.path.substring(d.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return b.path=i+b.path.substring(d.length),h.build()},o.equals=function(a){var b,c,d,f=this.clone(),g=new e(a),i={},j={},l={};if(f.normalize(),g.normalize(),f.toString()===g.toString())return!0;if(b=f.query(),c=g.query(),f.query(""),g.query(""),f.toString()!==g.toString())return!1;if(b.length!==c.length)return!1;i=e.parseQuery(b,this._parts.escapeQuerySpace),j=e.parseQuery(c,this._parts.escapeQuerySpace);for(d in i)if(p.call(i,d)){if(h(i[d])){if(!k(i[d],j[d]))return!1}else if(i[d]!==j[d])return!1;l[d]=!0}for(d in j)if(p.call(j,d)&&!l[d])return!1;return!0},o.duplicateQueryParameters=function(a){return this._parts.duplicateQueryParameters=!!a,this},o.escapeQuerySpace=function(a){return this._parts.escapeQuerySpace=!!a,this},e}),function(){function a(a,b,c){null!=a&&("number"==typeof a?this.fromNumber(a,b,c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function b(){return new a(null)}function c(a,b,c,d,e,f){for(;--f>=0;){var g=b*this[a++]+c[d]+e;e=Math.floor(g/67108864),c[d++]=67108863&g}return e}function d(a,b,c,d,e,f){for(var g=32767&b,h=b>>15;--f>=0;){var i=32767&this[a],j=this[a++]>>15,k=h*i+j*g;i=g*i+((32767&k)<<15)+c[d]+(1073741823&e),e=(i>>>30)+(k>>>15)+h*j+(e>>>30),c[d++]=1073741823&i}return e}function e(a,b,c,d,e,f){for(var g=16383&b,h=b>>14;--f>=0;){var i=16383&this[a],j=this[a++]>>14,k=h*i+j*g;i=g*i+((16383&k)<<14)+c[d]+e,e=(i>>28)+(k>>14)+h*j,c[d++]=268435455&i}return e}function f(a){return fc.charAt(a)}function g(a,b){var c=gc[a.charCodeAt(b)];return null==c?-1:c}function h(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t,a.s=this.s}function i(a){this.t=1,this.s=0>a?-1:0,a>0?this[0]=a:-1>a?this[0]=a+DV:this.t=0}function j(a){var c=b();return c.fromInt(a),c
  }function k(b,c){var d;if(16==c)d=4;else if(8==c)d=3;else if(256==c)d=8;else if(2==c)d=1;else if(32==c)d=5;else{if(4!=c)return void this.fromRadix(b,c);d=2}this.t=0,this.s=0;for(var e=b.length,f=!1,h=0;--e>=0;){var i=8==d?255&b[e]:g(b,e);0>i?"-"==b.charAt(e)&&(f=!0):(f=!1,0==h?this[this.t++]=i:h+d>this.DB?(this[this.t-1]|=(i&(1<<this.DB-h)-1)<<h,this[this.t++]=i>>this.DB-h):this[this.t-1]|=i<<h,h+=d,h>=this.DB&&(h-=this.DB))}8==d&&0!=(128&b[0])&&(this.s=-1,h>0&&(this[this.t-1]|=(1<<this.DB-h)-1<<h)),this.clamp(),f&&a.ZERO.subTo(this,this)}function l(){for(var a=this.s&this.DM;this.t>0&&this[this.t-1]==a;)--this.t}function m(a){if(this.s<0)return"-"+this.negate().toString(a);var b;if(16==a)b=4;else if(8==a)b=3;else if(2==a)b=1;else if(32==a)b=5;else{if(4!=a)return this.toRadix(a);b=2}var c,d=(1<<b)-1,e=!1,g="",h=this.t,i=this.DB-h*this.DB%b;if(h-->0)for(i<this.DB&&(c=this[h]>>i)>0&&(e=!0,g=f(c));h>=0;)b>i?(c=(this[h]&(1<<i)-1)<<b-i,c|=this[--h]>>(i+=this.DB-b)):(c=this[h]>>(i-=b)&d,0>=i&&(i+=this.DB,--h)),c>0&&(e=!0),e&&(g+=f(c));return e?g:"0"}function n(){var c=b();return a.ZERO.subTo(this,c),c}function o(){return this.s<0?this.negate():this}function p(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;if(b=c-a.t,0!=b)return this.s<0?-b:b;for(;--c>=0;)if(0!=(b=this[c]-a[c]))return b;return 0}function q(a){var b,c=1;return 0!=(b=a>>>16)&&(a=b,c+=16),0!=(b=a>>8)&&(a=b,c+=8),0!=(b=a>>4)&&(a=b,c+=4),0!=(b=a>>2)&&(a=b,c+=2),0!=(b=a>>1)&&(a=b,c+=1),c}function r(){return this.t<=0?0:this.DB*(this.t-1)+q(this[this.t-1]^this.s&this.DM)}function s(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a,b.s=this.s}function t(a,b){for(var c=a;c<this.t;++c)b[c-a]=this[c];b.t=Math.max(this.t-a,0),b.s=this.s}function u(a,b){var c,d=a%this.DB,e=this.DB-d,f=(1<<e)-1,g=Math.floor(a/this.DB),h=this.s<<d&this.DM;for(c=this.t-1;c>=0;--c)b[c+g+1]=this[c]>>e|h,h=(this[c]&f)<<d;for(c=g-1;c>=0;--c)b[c]=0;b[g]=h,b.t=this.t+g+1,b.s=this.s,b.clamp()}function v(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)return void(b.t=0);var d=a%this.DB,e=this.DB-d,f=(1<<d)-1;b[0]=this[c]>>d;for(var g=c+1;g<this.t;++g)b[g-c-1]|=(this[g]&f)<<e,b[g-c]=this[g]>>d;d>0&&(b[this.t-c-1]|=(this.s&f)<<e),b.t=this.t-c,b.clamp()}function w(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);e>c;)d+=this[c]-a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d-=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d-=a[c],b[c++]=d&this.DM,d>>=this.DB;d-=a.s}b.s=0>d?-1:0,-1>d?b[c++]=this.DV+d:d>0&&(b[c++]=d),b.t=c,b.clamp()}function x(b,c){var d=this.abs(),e=b.abs(),f=d.t;for(c.t=f+e.t;--f>=0;)c[f]=0;for(f=0;f<e.t;++f)c[f+d.t]=d.am(0,e[f],c,f,0,d.t);c.s=0,c.clamp(),this.s!=b.s&&a.ZERO.subTo(c,c)}function y(a){for(var b=this.abs(),c=a.t=2*b.t;--c>=0;)a[c]=0;for(c=0;c<b.t-1;++c){var d=b.am(c,b[c],a,2*c,0,1);(a[c+b.t]+=b.am(c+1,2*b[c],a,2*c+1,d,b.t-c-1))>=b.DV&&(a[c+b.t]-=b.DV,a[c+b.t+1]=1)}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1)),a.s=0,a.clamp()}function z(c,d,e){var f=c.abs();if(!(f.t<=0)){var g=this.abs();if(g.t<f.t)return null!=d&&d.fromInt(0),void(null!=e&&this.copyTo(e));null==e&&(e=b());var h=b(),i=this.s,j=c.s,k=this.DB-q(f[f.t-1]);k>0?(f.lShiftTo(k,h),g.lShiftTo(k,e)):(f.copyTo(h),g.copyTo(e));var l=h.t,m=h[l-1];if(0!=m){var n=m*(1<<this.F1)+(l>1?h[l-2]>>this.F2:0),o=this.FV/n,p=(1<<this.F1)/n,r=1<<this.F2,s=e.t,t=s-l,u=null==d?b():d;for(h.dlShiftTo(t,u),e.compareTo(u)>=0&&(e[e.t++]=1,e.subTo(u,e)),a.ONE.dlShiftTo(l,u),u.subTo(h,h);h.t<l;)h[h.t++]=0;for(;--t>=0;){var v=e[--s]==m?this.DM:Math.floor(e[s]*o+(e[s-1]+r)*p);if((e[s]+=h.am(0,v,e,t,0,l))<v)for(h.dlShiftTo(t,u),e.subTo(u,e);e[s]<--v;)e.subTo(u,e)}null!=d&&(e.drShiftTo(l,d),i!=j&&a.ZERO.subTo(d,d)),e.t=l,e.clamp(),k>0&&e.rShiftTo(k,e),0>i&&a.ZERO.subTo(e,e)}}}function A(c){var d=b();return this.abs().divRemTo(c,null,d),this.s<0&&d.compareTo(a.ZERO)>0&&c.subTo(d,d),d}function B(a){this.m=a}function C(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function D(a){return a}function E(a){a.divRemTo(this.m,null,a)}function F(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function G(a,b){a.squareTo(b),this.reduce(b)}function H(){if(this.t<1)return 0;var a=this[0];if(0==(1&a))return 0;var b=3&a;return b=b*(2-(15&a)*b)&15,b=b*(2-(255&a)*b)&255,b=b*(2-((65535&a)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV,b>0?this.DV-b:-b}function I(a){this.m=a,this.mp=a.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<a.DB-15)-1,this.mt2=2*a.t}function J(c){var d=b();return c.abs().dlShiftTo(this.m.t,d),d.divRemTo(this.m,null,d),c.s<0&&d.compareTo(a.ZERO)>0&&this.m.subTo(d,d),d}function K(a){var c=b();return a.copyTo(c),this.reduce(c),c}function L(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b<this.m.t;++b){var c=32767&a[b],d=c*this.mpl+((c*this.mph+(a[b]>>15)*this.mpl&this.um)<<15)&a.DM;for(c=b+this.m.t,a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function M(a,b){a.squareTo(b),this.reduce(b)}function N(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function O(){return 0==(this.t>0?1&this[0]:this.s)}function P(c,d){if(c>4294967295||1>c)return a.ONE;var e=b(),f=b(),g=d.convert(this),h=q(c)-1;for(g.copyTo(e);--h>=0;)if(d.sqrTo(e,f),(c&1<<h)>0)d.mulTo(f,g,e);else{var i=e;e=f,f=i}return d.revert(e)}function Q(a,b){var c;return c=256>a||b.isEven()?new B(b):new I(b),this.exp(a,c)}function R(){var a=b();return this.copyTo(a),a}function S(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function T(){return 0==this.t?this.s:this[0]<<24>>24}function U(){return 0==this.t?this.s:this[0]<<16>>16}function V(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function W(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function X(a){if(null==a&&(a=10),0==this.signum()||2>a||a>36)return"0";var c=this.chunkSize(a),d=Math.pow(a,c),e=j(d),f=b(),g=b(),h="";for(this.divRemTo(e,f,g);f.signum()>0;)h=(d+g.intValue()).toString(a).substr(1)+h,f.divRemTo(e,f,g);return g.intValue().toString(a)+h}function Y(b,c){this.fromInt(0),null==c&&(c=10);for(var d=this.chunkSize(c),e=Math.pow(c,d),f=!1,h=0,i=0,j=0;j<b.length;++j){var k=g(b,j);0>k?"-"==b.charAt(j)&&0==this.signum()&&(f=!0):(i=c*i+k,++h>=d&&(this.dMultiply(e),this.dAddOffset(i,0),h=0,i=0))}h>0&&(this.dMultiply(Math.pow(c,h)),this.dAddOffset(i,0)),f&&a.ZERO.subTo(this,this)}function Z(b,c,d){if("number"==typeof c)if(2>b)this.fromInt(1);else for(this.fromNumber(b,d),this.testBit(b-1)||this.bitwiseTo(a.ONE.shiftLeft(b-1),fb,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(c);)this.dAddOffset(2,0),this.bitLength()>b&&this.subTo(a.ONE.shiftLeft(b-1),this);else{var e=new Array,f=7&b;e.length=(b>>3)+1,c.nextBytes(e),f>0?e[0]&=(1<<f)-1:e[0]=0,this.fromString(e,256)}}function $(){var a=this.t,b=new Array;b[0]=this.s;var c,d=this.DB-a*this.DB%8,e=0;if(a-->0)for(d<this.DB&&(c=this[a]>>d)!=(this.s&this.DM)>>d&&(b[e++]=c|this.s<<this.DB-d);a>=0;)8>d?(c=(this[a]&(1<<d)-1)<<8-d,c|=this[--a]>>(d+=this.DB-8)):(c=this[a]>>(d-=8)&255,0>=d&&(d+=this.DB,--a)),0!=(128&c)&&(c|=-256),0==e&&(128&this.s)!=(128&c)&&++e,(e>0||c!=this.s)&&(b[e++]=c);return b}function _(a){return 0==this.compareTo(a)}function ab(a){return this.compareTo(a)<0?this:a}function bb(a){return this.compareTo(a)>0?this:a}function cb(a,b,c){var d,e,f=Math.min(a.t,this.t);for(d=0;f>d;++d)c[d]=b(this[d],a[d]);if(a.t<this.t){for(e=a.s&this.DM,d=f;d<this.t;++d)c[d]=b(this[d],e);c.t=this.t}else{for(e=this.s&this.DM,d=f;d<a.t;++d)c[d]=b(e,a[d]);c.t=a.t}c.s=b(this.s,a.s),c.clamp()}function db(a,b){return a&b}function eb(a){var c=b();return this.bitwiseTo(a,db,c),c}function fb(a,b){return a|b}function gb(a){var c=b();return this.bitwiseTo(a,fb,c),c}function hb(a,b){return a^b}function ib(a){var c=b();return this.bitwiseTo(a,hb,c),c}function jb(a,b){return a&~b}function kb(a){var c=b();return this.bitwiseTo(a,jb,c),c}function lb(){for(var a=b(),c=0;c<this.t;++c)a[c]=this.DM&~this[c];return a.t=this.t,a.s=~this.s,a}function mb(a){var c=b();return 0>a?this.rShiftTo(-a,c):this.lShiftTo(a,c),c}function nb(a){var c=b();return 0>a?this.lShiftTo(-a,c):this.rShiftTo(a,c),c}function ob(a){if(0==a)return-1;var b=0;return 0==(65535&a)&&(a>>=16,b+=16),0==(255&a)&&(a>>=8,b+=8),0==(15&a)&&(a>>=4,b+=4),0==(3&a)&&(a>>=2,b+=2),0==(1&a)&&++b,b}function pb(){for(var a=0;a<this.t;++a)if(0!=this[a])return a*this.DB+ob(this[a]);return this.s<0?this.t*this.DB:-1}function qb(a){for(var b=0;0!=a;)a&=a-1,++b;return b}function rb(){for(var a=0,b=this.s&this.DM,c=0;c<this.t;++c)a+=qb(this[c]^b);return a}function sb(a){var b=Math.floor(a/this.DB);return b>=this.t?0!=this.s:0!=(this[b]&1<<a%this.DB)}function tb(b,c){var d=a.ONE.shiftLeft(b);return this.bitwiseTo(d,c,d),d}function ub(a){return this.changeBit(a,fb)}function vb(a){return this.changeBit(a,jb)}function wb(a){return this.changeBit(a,hb)}function xb(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);e>c;)d+=this[c]+a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d+=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d+=a[c],b[c++]=d&this.DM,d>>=this.DB;d+=a.s}b.s=0>d?-1:0,d>0?b[c++]=d:-1>d&&(b[c++]=this.DV+d),b.t=c,b.clamp()}function yb(a){var c=b();return this.addTo(a,c),c}function zb(a){var c=b();return this.subTo(a,c),c}function Ab(a){var c=b();return this.multiplyTo(a,c),c}function Bb(){var a=b();return this.squareTo(a),a}function Cb(a){var c=b();return this.divRemTo(a,c,null),c}function Db(a){var c=b();return this.divRemTo(a,null,c),c}function Eb(a){var c=b(),d=b();return this.divRemTo(a,c,d),new Array(c,d)}function Fb(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp()}function Gb(a,b){if(0!=a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function Hb(){}function Ib(a){return a}function Jb(a,b,c){a.multiplyTo(b,c)}function Kb(a,b){a.squareTo(b)}function Lb(a){return this.exp(a,new Hb)}function Mb(a,b,c){var d=Math.min(this.t+a.t,b);for(c.s=0,c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;e>d;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=Math.min(a.t,b);e>d;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()}function Nb(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;--d>=0;)c[d]=0;for(d=Math.max(b-this.t,0);d<a.t;++d)c[this.t+d-b]=this.am(b-d,a[d],c,0,0,this.t+d-b);c.clamp(),c.drShiftTo(1,c)}function Ob(c){this.r2=b(),this.q3=b(),a.ONE.dlShiftTo(2*c.t,this.r2),this.mu=this.r2.divide(c),this.m=c}function Pb(a){if(a.s<0||a.t>2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var c=b();return a.copyTo(c),this.reduce(c),c}function Qb(a){return a}function Rb(a){for(a.drShiftTo(this.m.t-1,this.r2),a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a)}function Sb(a,b){a.squareTo(b),this.reduce(b)}function Tb(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function Ub(a,c){var d,e,f=a.bitLength(),g=j(1);if(0>=f)return g;d=18>f?1:48>f?3:144>f?4:768>f?5:6,e=8>f?new B(c):c.isEven()?new Ob(c):new I(c);var h=new Array,i=3,k=d-1,l=(1<<d)-1;if(h[1]=e.convert(this),d>1){var m=b();for(e.sqrTo(h[1],m);l>=i;)h[i]=b(),e.mulTo(m,h[i-2],h[i]),i+=2}var n,o,p=a.t-1,r=!0,s=b();for(f=q(a[p])-1;p>=0;){for(f>=k?n=a[p]>>f-k&l:(n=(a[p]&(1<<f+1)-1)<<k-f,p>0&&(n|=a[p-1]>>this.DB+f-k)),i=d;0==(1&n);)n>>=1,--i;if((f-=i)<0&&(f+=this.DB,--p),r)h[n].copyTo(g),r=!1;else{for(;i>1;)e.sqrTo(g,s),e.sqrTo(s,g),i-=2;i>0?e.sqrTo(g,s):(o=g,g=s,s=o),e.mulTo(s,h[n],g)}for(;p>=0&&0==(a[p]&1<<f);)e.sqrTo(g,s),o=g,g=s,s=o,--f<0&&(f=this.DB-1,--p)}return e.revert(g)}function Vb(a){var b=this.s<0?this.negate():this.clone(),c=a.s<0?a.negate():a.clone();if(b.compareTo(c)<0){var d=b;b=c,c=d}var e=b.getLowestSetBit(),f=c.getLowestSetBit();if(0>f)return b;for(f>e&&(f=e),f>0&&(b.rShiftTo(f,b),c.rShiftTo(f,c));b.signum()>0;)(e=b.getLowestSetBit())>0&&b.rShiftTo(e,b),(e=c.getLowestSetBit())>0&&c.rShiftTo(e,c),b.compareTo(c)>=0?(b.subTo(c,b),b.rShiftTo(1,b)):(c.subTo(b,c),c.rShiftTo(1,c));return f>0&&c.lShiftTo(f,c),c}function Wb(a){if(0>=a)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(0==b)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}function Xb(b){var c=b.isEven();if(this.isEven()&&c||0==b.signum())return a.ZERO;for(var d=b.clone(),e=this.clone(),f=j(1),g=j(0),h=j(0),i=j(1);0!=d.signum();){for(;d.isEven();)d.rShiftTo(1,d),c?(f.isEven()&&g.isEven()||(f.addTo(this,f),g.subTo(b,g)),f.rShiftTo(1,f)):g.isEven()||g.subTo(b,g),g.rShiftTo(1,g);for(;e.isEven();)e.rShiftTo(1,e),c?(h.isEven()&&i.isEven()||(h.addTo(this,h),i.subTo(b,i)),h.rShiftTo(1,h)):i.isEven()||i.subTo(b,i),i.rShiftTo(1,i);d.compareTo(e)>=0?(d.subTo(e,d),c&&f.subTo(h,f),g.subTo(i,g)):(e.subTo(d,e),c&&h.subTo(f,h),i.subTo(g,i))}return 0!=e.compareTo(a.ONE)?a.ZERO:i.compareTo(b)>=0?i.subtract(b):i.signum()<0?(i.addTo(b,i),i.signum()<0?i.add(b):i):i}function Yb(a){var b,c=this.abs();if(1==c.t&&c[0]<=hc[hc.length-1]){for(b=0;b<hc.length;++b)if(c[0]==hc[b])return!0;return!1}if(c.isEven())return!1;for(b=1;b<hc.length;){for(var d=hc[b],e=b+1;e<hc.length&&ic>d;)d*=hc[e++];for(d=c.modInt(d);e>b;)if(d%hc[b++]==0)return!1}return c.millerRabin(a)}function Zb(c){var d=this.subtract(a.ONE),e=d.getLowestSetBit();if(0>=e)return!1;var f=d.shiftRight(e);c=c+1>>1,c>hc.length&&(c=hc.length);for(var g=b(),h=0;c>h;++h){g.fromInt(hc[Math.floor(Math.random()*hc.length)]);var i=g.modPow(f,this);if(0!=i.compareTo(a.ONE)&&0!=i.compareTo(d)){for(var j=1;j++<e&&0!=i.compareTo(d);)if(i=i.modPowInt(2,this),0==i.compareTo(a.ONE))return!1;if(0!=i.compareTo(d))return!1}}return!0}var $b,_b=0xdeadbeefcafe,ac=15715070==(16777215&_b),bc="undefined"!=typeof navigator;bc&&ac&&"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=d,$b=30):bc&&ac&&"Netscape"!=navigator.appName?(a.prototype.am=c,$b=26):(a.prototype.am=e,$b=28),a.prototype.DB=$b,a.prototype.DM=(1<<$b)-1,a.prototype.DV=1<<$b;var cc=52;a.prototype.FV=Math.pow(2,cc),a.prototype.F1=cc-$b,a.prototype.F2=2*$b-cc;var dc,ec,fc="0123456789abcdefghijklmnopqrstuvwxyz",gc=new Array;for(dc="0".charCodeAt(0),ec=0;9>=ec;++ec)gc[dc++]=ec;for(dc="a".charCodeAt(0),ec=10;36>ec;++ec)gc[dc++]=ec;for(dc="A".charCodeAt(0),ec=10;36>ec;++ec)gc[dc++]=ec;B.prototype.convert=C,B.prototype.revert=D,B.prototype.reduce=E,B.prototype.mulTo=F,B.prototype.sqrTo=G,I.prototype.convert=J,I.prototype.revert=K,I.prototype.reduce=L,I.prototype.mulTo=N,I.prototype.sqrTo=M,a.prototype.copyTo=h,a.prototype.fromInt=i,a.prototype.fromString=k,a.prototype.clamp=l,a.prototype.dlShiftTo=s,a.prototype.drShiftTo=t,a.prototype.lShiftTo=u,a.prototype.rShiftTo=v,a.prototype.subTo=w,a.prototype.multiplyTo=x,a.prototype.squareTo=y,a.prototype.divRemTo=z,a.prototype.invDigit=H,a.prototype.isEven=O,a.prototype.exp=P,a.prototype.toString=m,a.prototype.negate=n,a.prototype.abs=o,a.prototype.compareTo=p,a.prototype.bitLength=r,a.prototype.mod=A,a.prototype.modPowInt=Q,a.ZERO=j(0),a.ONE=j(1),Hb.prototype.convert=Ib,Hb.prototype.revert=Ib,Hb.prototype.mulTo=Jb,Hb.prototype.sqrTo=Kb,Ob.prototype.convert=Pb,Ob.prototype.revert=Qb,Ob.prototype.reduce=Rb,Ob.prototype.mulTo=Tb,Ob.prototype.sqrTo=Sb;var hc=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ic=(1<<26)/hc[hc.length-1];a.prototype.chunkSize=V,a.prototype.toRadix=X,a.prototype.fromRadix=Y,a.prototype.fromNumber=Z,a.prototype.bitwiseTo=cb,a.prototype.changeBit=tb,a.prototype.addTo=xb,a.prototype.dMultiply=Fb,a.prototype.dAddOffset=Gb,a.prototype.multiplyLowerTo=Mb,a.prototype.multiplyUpperTo=Nb,a.prototype.modInt=Wb,a.prototype.millerRabin=Zb,a.prototype.clone=R,a.prototype.intValue=S,a.prototype.byteValue=T,a.prototype.shortValue=U,a.prototype.signum=W,a.prototype.toByteArray=$,a.prototype.equals=_,a.prototype.min=ab,a.prototype.max=bb,a.prototype.and=eb,a.prototype.or=gb,a.prototype.xor=ib,a.prototype.andNot=kb,a.prototype.not=lb,a.prototype.shiftLeft=mb,a.prototype.shiftRight=nb,a.prototype.getLowestSetBit=pb,a.prototype.bitCount=rb,a.prototype.testBit=sb,a.prototype.setBit=ub,a.prototype.clearBit=vb,a.prototype.flipBit=wb,a.prototype.add=yb,a.prototype.subtract=zb,a.prototype.multiply=Ab,a.prototype.divide=Cb,a.prototype.remainder=Db,a.prototype.divideAndRemainder=Eb,a.prototype.modPow=Ub,a.prototype.modInverse=Xb,a.prototype.pow=Lb,a.prototype.gcd=Vb,a.prototype.isProbablePrime=Yb,a.prototype.square=Bb,"undefined"!=typeof exports?exports=module.exports=a:this.BigInteger=a}.call(this),function(a){var b,c,d,e=a(window),f={jqueryui:{container:"ui-widget ui-widget-content ui-corner-all",notice:"ui-state-highlight",notice_icon:"ui-icon ui-icon-info",info:"",info_icon:"ui-icon ui-icon-info",success:"ui-state-default",success_icon:"ui-icon ui-icon-circle-check",error:"ui-state-error",error_icon:"ui-icon ui-icon-alert",closer:"ui-icon ui-icon-close",pin_up:"ui-icon ui-icon-pin-w",pin_down:"ui-icon ui-icon-pin-s",hi_menu:"ui-state-default ui-corner-bottom",hi_btn:"ui-state-default ui-corner-all",hi_btnhov:"ui-state-hover",hi_hnd:"ui-icon ui-icon-grip-dotted-horizontal"},bootstrap:{container:"alert",notice:"",notice_icon:"icon-exclamation-sign",info:"alert-info",info_icon:"icon-info-sign",success:"alert-success",success_icon:"icon-ok-sign",error:"alert-error",error_icon:"icon-warning-sign",closer:"icon-remove",pin_up:"icon-pause",pin_down:"icon-play",hi_menu:"well",hi_btn:"btn",hi_btnhov:"",hi_hnd:"icon-chevron-down"}},g=function(){d=a("body"),e=a(window),e.bind("resize",function(){c&&clearTimeout(c),c=setTimeout(a.pnotify_position_all,10)})};document.body?g():a(g),a.extend({pnotify_remove_all:function(){var b=e.data("pnotify");b&&b.length&&a.each(b,function(){this.pnotify_remove&&this.pnotify_remove()})},pnotify_position_all:function(){c&&clearTimeout(c),c=null;var b=e.data("pnotify");b&&b.length&&(a.each(b,function(){var a=this.opts.stack;a&&(a.nextpos1=a.firstpos1,a.nextpos2=a.firstpos2,a.addpos2=0,a.animation=!0)}),a.each(b,function(){this.pnotify_position()}))},pnotify:function(g){var h,i;"object"!=typeof g?(i=a.extend({},a.pnotify.defaults),i.text=g):i=a.extend({},a.pnotify.defaults,g);for(var j in i)"string"==typeof j&&j.match(/^pnotify_/)&&(i[j.replace(/^pnotify_/,"")]=i[j]);if(i.before_init&&i.before_init(i)===!1)return null;var k,m=function(b,c){o.css("display","none");var d=document.elementFromPoint(b.clientX,b.clientY);o.css("display","block");var e=a(d),f=e.css("cursor");o.css("cursor","auto"!=f?f:"default"),k&&k.get(0)==d||(k&&(l.call(k.get(0),"mouseleave",b.originalEvent),l.call(k.get(0),"mouseout",b.originalEvent)),l.call(d,"mouseenter",b.originalEvent),l.call(d,"mouseover",b.originalEvent)),l.call(d,c,b.originalEvent),k=e},n=f[i.styling],o=a("<div />",{"class":"ui-pnotify "+i.addclass,css:{display:"none"},mouseenter:function(a){i.nonblock&&a.stopPropagation(),i.mouse_reset&&"out"==h&&(o.stop(!0),h="in",o.css("height","auto").animate({width:i.width,opacity:i.nonblock?i.nonblock_opacity:i.opacity},"fast")),i.nonblock&&o.animate({opacity:i.nonblock_opacity},"fast"),i.hide&&i.mouse_reset&&o.pnotify_cancel_remove(),i.sticker&&!i.nonblock&&o.sticker.trigger("pnotify_icon").css("visibility","visible"),i.closer&&!i.nonblock&&o.closer.css("visibility","visible")},mouseleave:function(b){i.nonblock&&b.stopPropagation(),k=null,o.css("cursor","auto"),i.nonblock&&"out"!=h&&o.animate({opacity:i.opacity},"fast"),i.hide&&i.mouse_reset&&o.pnotify_queue_remove(),i.sticker_hover&&o.sticker.css("visibility","hidden"),i.closer_hover&&o.closer.css("visibility","hidden"),a.pnotify_position_all()},mouseover:function(a){i.nonblock&&a.stopPropagation()},mouseout:function(a){i.nonblock&&a.stopPropagation()},mousemove:function(a){i.nonblock&&(a.stopPropagation(),m(a,"onmousemove"))},mousedown:function(a){i.nonblock&&(a.stopPropagation(),a.preventDefault(),m(a,"onmousedown"))},mouseup:function(a){i.nonblock&&(a.stopPropagation(),a.preventDefault(),m(a,"onmouseup"))},click:function(a){i.nonblock&&(a.stopPropagation(),m(a,"onclick"))},dblclick:function(a){i.nonblock&&(a.stopPropagation(),m(a,"ondblclick"))}});o.opts=i,o.container=a("<div />",{"class":n.container+" ui-pnotify-container "+("error"==i.type?n.error:"info"==i.type?n.info:"success"==i.type?n.success:n.notice)}).appendTo(o),""!=i.cornerclass&&o.container.removeClass("ui-corner-all").addClass(i.cornerclass),i.shadow&&o.container.addClass("ui-pnotify-shadow"),o.pnotify_version="1.2.0",o.pnotify=function(b){var c=i;"string"==typeof b?i.text=b:i=a.extend({},i,b);for(var d in i)"string"==typeof d&&d.match(/^pnotify_/)&&(i[d.replace(/^pnotify_/,"")]=i[d]);return o.opts=i,i.cornerclass!=c.cornerclass&&o.container.removeClass("ui-corner-all").addClass(i.cornerclass),i.shadow!=c.shadow&&(i.shadow?o.container.addClass("ui-pnotify-shadow"):o.container.removeClass("ui-pnotify-shadow")),i.addclass===!1?o.removeClass(c.addclass):i.addclass!==c.addclass&&o.removeClass(c.addclass).addClass(i.addclass),i.title===!1?o.title_container.slideUp("fast"):i.title!==c.title&&(i.title_escape?o.title_container.text(i.title).slideDown(200):o.title_container.html(i.title).slideDown(200)),i.text===!1?o.text_container.slideUp("fast"):i.text!==c.text&&(i.text_escape?o.text_container.text(i.text).slideDown(200):o.text_container.html(i.insert_brs?String(i.text).replace(/\n/g,"<br />"):i.text).slideDown(200)),o.pnotify_history=i.history,o.pnotify_hide=i.hide,i.type!=c.type&&o.container.removeClass(n.error+" "+n.notice+" "+n.success+" "+n.info).addClass("error"==i.type?n.error:"info"==i.type?n.info:"success"==i.type?n.success:n.notice),(i.icon!==c.icon||i.icon===!0&&i.type!=c.type)&&(o.container.find("div.ui-pnotify-icon").remove(),i.icon!==!1&&a("<div />",{"class":"ui-pnotify-icon"}).append(a("<span />",{"class":i.icon===!0?"error"==i.type?n.error_icon:"info"==i.type?n.info_icon:"success"==i.type?n.success_icon:n.notice_icon:i.icon})).prependTo(o.container)),i.width!==c.width&&o.animate({width:i.width}),i.min_height!==c.min_height&&o.container.animate({minHeight:i.min_height}),i.opacity!==c.opacity&&o.fadeTo(i.animate_speed,i.opacity),!i.closer||i.nonblock?o.closer.css("display","none"):o.closer.css("display","block"),!i.sticker||i.nonblock?o.sticker.css("display","none"):o.sticker.css("display","block"),o.sticker.trigger("pnotify_icon"),i.sticker_hover?o.sticker.css("visibility","hidden"):i.nonblock||o.sticker.css("visibility","visible"),i.closer_hover?o.closer.css("visibility","hidden"):i.nonblock||o.closer.css("visibility","visible"),i.hide?c.hide||o.pnotify_queue_remove():o.pnotify_cancel_remove(),o.pnotify_queue_position(),o},o.pnotify_position=function(a){var b=o.opts.stack;if(b){b.nextpos1||(b.nextpos1=b.firstpos1),b.nextpos2||(b.nextpos2=b.firstpos2),b.addpos2||(b.addpos2=0);var c="none"==o.css("display");if(!c||a){var d,f,g,h={};switch(b.dir1){case"down":g="top";break;case"up":g="bottom";break;case"left":g="right";break;case"right":g="left"}d=parseInt(o.css(g)),isNaN(d)&&(d=0),"undefined"!=typeof b.firstpos1||c||(b.firstpos1=d,b.nextpos1=b.firstpos1);var i;switch(b.dir2){case"down":i="top";break;case"up":i="bottom";break;case"left":i="right";break;case"right":i="left"}if(f=parseInt(o.css(i)),isNaN(f)&&(f=0),"undefined"!=typeof b.firstpos2||c||(b.firstpos2=f,b.nextpos2=b.firstpos2),("down"==b.dir1&&b.nextpos1+o.height()>e.height()||"up"==b.dir1&&b.nextpos1+o.height()>e.height()||"left"==b.dir1&&b.nextpos1+o.width()>e.width()||"right"==b.dir1&&b.nextpos1+o.width()>e.width())&&(b.nextpos1=b.firstpos1,b.nextpos2+=b.addpos2+("undefined"==typeof b.spacing2?25:b.spacing2),b.addpos2=0),b.animation&&b.nextpos2<f)switch(b.dir2){case"down":h.top=b.nextpos2+"px";break;case"up":h.bottom=b.nextpos2+"px";break;case"left":h.right=b.nextpos2+"px";break;case"right":h.left=b.nextpos2+"px"}else o.css(i,b.nextpos2+"px");switch(b.dir2){case"down":case"up":o.outerHeight(!0)>b.addpos2&&(b.addpos2=o.height());break;case"left":case"right":o.outerWidth(!0)>b.addpos2&&(b.addpos2=o.width())}if(b.nextpos1)if(b.animation&&(d>b.nextpos1||h.top||h.bottom||h.right||h.left))switch(b.dir1){case"down":h.top=b.nextpos1+"px";break;case"up":h.bottom=b.nextpos1+"px";break;case"left":h.right=b.nextpos1+"px";break;case"right":h.left=b.nextpos1+"px"}else o.css(g,b.nextpos1+"px");switch((h.top||h.bottom||h.right||h.left)&&o.animate(h,{duration:500,queue:!1}),b.dir1){case"down":case"up":b.nextpos1+=o.height()+("undefined"==typeof b.spacing1?25:b.spacing1);break;case"left":case"right":b.nextpos1+=o.width()+("undefined"==typeof b.spacing1?25:b.spacing1)}}}},o.pnotify_queue_position=function(b){c&&clearTimeout(c),b||(b=10),c=setTimeout(a.pnotify_position_all,b)},o.pnotify_display=function(){o.parent().length||o.appendTo(d),i.before_open&&i.before_open(o)===!1||("top"!=i.stack.push&&o.pnotify_position(!0),"fade"==i.animation||"fade"==i.animation.effect_in?o.show().fadeTo(0,0).hide():1!=i.opacity&&o.show().fadeTo(0,i.opacity).hide(),o.animate_in(function(){i.after_open&&i.after_open(o),o.pnotify_queue_position(),i.hide&&o.pnotify_queue_remove()}))},o.pnotify_remove=function(){o.timer&&(window.clearTimeout(o.timer),o.timer=null),i.before_close&&i.before_close(o)===!1||o.animate_out(function(){i.after_close&&i.after_close(o)===!1||(o.pnotify_queue_position(),i.remove&&o.detach())})},o.animate_in=function(a){h="in";var b;b="undefined"!=typeof i.animation.effect_in?i.animation.effect_in:i.animation,"none"==b?(o.show(),a()):"show"==b?o.show(i.animate_speed,a):"fade"==b?o.show().fadeTo(i.animate_speed,i.opacity,a):"slide"==b?o.slideDown(i.animate_speed,a):"function"==typeof b?b("in",a,o):o.show(b,"object"==typeof i.animation.options_in?i.animation.options_in:{},i.animate_speed,a)},o.animate_out=function(a){h="out";var b;b="undefined"!=typeof i.animation.effect_out?i.animation.effect_out:i.animation,"none"==b?(o.hide(),a()):"show"==b?o.hide(i.animate_speed,a):"fade"==b?o.fadeOut(i.animate_speed,a):"slide"==b?o.slideUp(i.animate_speed,a):"function"==typeof b?b("out",a,o):o.hide(b,"object"==typeof i.animation.options_out?i.animation.options_out:{},i.animate_speed,a)},o.pnotify_cancel_remove=function(){o.timer&&window.clearTimeout(o.timer)},o.pnotify_queue_remove=function(){o.pnotify_cancel_remove(),o.timer=window.setTimeout(function(){o.pnotify_remove()},isNaN(i.delay)?0:i.delay)},o.closer=a("<div />",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:i.closer_hover?"hidden":"visible"},click:function(){o.pnotify_remove(),o.sticker.css("visibility","hidden"),o.closer.css("visibility","hidden")}}).append(a("<span />",{"class":n.closer})).appendTo(o.container),(!i.closer||i.nonblock)&&o.closer.css("display","none"),o.sticker=a("<div />",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:i.sticker_hover?"hidden":"visible"},click:function(){i.hide=!i.hide,i.hide?o.pnotify_queue_remove():o.pnotify_cancel_remove(),a(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){a(this).children().removeClass(n.pin_up+" "+n.pin_down).addClass(i.hide?n.pin_up:n.pin_down)}).append(a("<span />",{"class":n.pin_up})).appendTo(o.container),(!i.sticker||i.nonblock)&&o.sticker.css("display","none"),i.icon!==!1&&a("<div />",{"class":"ui-pnotify-icon"}).append(a("<span />",{"class":i.icon===!0?"error"==i.type?n.error_icon:"info"==i.type?n.info_icon:"success"==i.type?n.success_icon:n.notice_icon:i.icon})).prependTo(o.container),o.title_container=a("<h4 />",{"class":"ui-pnotify-title"}).appendTo(o.container),i.title===!1?o.title_container.hide():i.title_escape?o.title_container.text(i.title):o.title_container.html(i.title),o.text_container=a("<div />",{"class":"ui-pnotify-text"}).appendTo(o.container),i.text===!1?o.text_container.hide():i.text_escape?o.text_container.text(i.text):o.text_container.html(i.insert_brs?String(i.text).replace(/\n/g,"<br />"):i.text),"string"==typeof i.width&&o.css("width",i.width),"string"==typeof i.min_height&&o.container.css("min-height",i.min_height),o.pnotify_history=i.history,o.pnotify_hide=i.hide;var p=e.data("pnotify");if((null==p||"object"!=typeof p)&&(p=[]),p="top"==i.stack.push?a.merge([o],p):a.merge(p,[o]),e.data("pnotify",p),"top"==i.stack.push&&o.pnotify_queue_position(1),i.after_init&&i.after_init(o),i.history){var q=e.data("pnotify_history");if("undefined"==typeof q){q=a("<div />",{"class":"ui-pnotify-history-container "+n.hi_menu,mouseleave:function(){q.animate({top:"-"+b+"px"},{duration:100,queue:!1})}}).append(a("<div />",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(a("<button />",{"class":"ui-pnotify-history-all "+n.hi_btn,text:"All",mouseenter:function(){a(this).addClass(n.hi_btnhov)},mouseleave:function(){a(this).removeClass(n.hi_btnhov)},click:function(){return a.each(p,function(){this.pnotify_history&&(this.is(":visible")?this.pnotify_hide&&this.pnotify_queue_remove():this.pnotify_display&&this.pnotify_display())}),!1}})).append(a("<button />",{"class":"ui-pnotify-history-last "+n.hi_btn,text:"Last",mouseenter:function(){a(this).addClass(n.hi_btnhov)},mouseleave:function(){a(this).removeClass(n.hi_btnhov)},click:function(){var a,b=-1;do{if(a=-1==b?p.slice(b):p.slice(b,b+1),!a[0])break;b--}while(!a[0].pnotify_history||a[0].is(":visible"));return a[0]?(a[0].pnotify_display&&a[0].pnotify_display(),!1):!1}})).appendTo(d);var r=a("<span />",{"class":"ui-pnotify-history-pulldown "+n.hi_hnd,mouseenter:function(){q.animate({top:"0"},{duration:100,queue:!1})}}).appendTo(q);b=r.offset().top+2,q.css({top:"-"+b+"px"}),e.data("pnotify_history",q)}}return i.stack.animation=!1,o.pnotify_display(),o}});var h=/^on/,i=/^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,j=/^(focus|blur|select|change|reset)$|^key(press|down|up)$/,k=/^(scroll|resize|(un)?load|abort|error)$/,l=function(b,c){var d;if(b=b.toLowerCase(),document.createEvent&&this.dispatchEvent){if(b=b.replace(h,""),b.match(i)?(a(this).offset(),d=document.createEvent("MouseEvents"),d.initMouseEvent(b,c.bubbles,c.cancelable,c.view,c.detail,c.screenX,c.screenY,c.clientX,c.clientY,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,c.button,c.relatedTarget)):b.match(j)?(d=document.createEvent("UIEvents"),d.initUIEvent(b,c.bubbles,c.cancelable,c.view,c.detail)):b.match(k)&&(d=document.createEvent("HTMLEvents"),d.initEvent(b,c.bubbles,c.cancelable)),!d)return;this.dispatchEvent(d)}else b.match(h)||(b="on"+b),d=document.createEventObject(c),this.fireEvent(b,d)};a.pnotify.defaults={title:!1,title_escape:!1,text:!1,text_escape:!1,styling:"bootstrap",addclass:"",cornerclass:"",nonblock:!1,nonblock_opacity:.2,history:!0,width:"300px",min_height:"16px",type:"notice",icon:!0,animation:"fade",animate_speed:"slow",opacity:1,shadow:!0,closer:!0,closer_hover:!0,sticker:!0,sticker_hover:!0,hide:!0,delay:8e3,mouse_reset:!0,remove:!0,insert_brs:!0,stack:{dir1:"down",dir2:"left",push:"bottom",spacing1:25,spacing2:25}}}(jQuery),function(){"use strict";function a(a,b){return Math.abs(a-b)<1e-6}var b=function(){function b(b){var d=null,e=[],f=[],g=[],h=angular.extend({},c,b),i=this,j=null;this.center=b.center,this.zoom=h.zoom,this.draggable=h.draggable,this.dragging=!1,this.selector=h.container,this.markers=[],this.options=h.options,this.draw=function(){if(null!=i.center)if(null==d)d=new google.maps.Map(i.selector,angular.extend(i.options,{center:i.center,zoom:i.zoom,draggable:i.draggable,mapTypeId:google.maps.MapTypeId.ROADMAP})),google.maps.event.addListener(d,"dragstart",function(){i.dragging=!0
  }),google.maps.event.addListener(d,"idle",function(){i.dragging=!1}),google.maps.event.addListener(d,"drag",function(){i.dragging=!0}),google.maps.event.addListener(d,"zoom_changed",function(){i.zoom=d.getZoom(),i.center=d.getCenter()}),google.maps.event.addListener(d,"center_changed",function(){i.center=d.getCenter()}),f.length&&angular.forEach(f,function(a){google.maps.event.addListener(d,a.on,a.handler)});else{google.maps.event.trigger(d,"resize");var b=d.getCenter();a(b.lat(),i.center.lat())&&a(b.lng(),i.center.lng())||d.setCenter(i.center),d.getZoom()!=i.zoom&&d.setZoom(i.zoom)}},this.fit=function(){if(d&&e.length){var a=new google.maps.LatLngBounds;angular.forEach(e,function(b){a.extend(b.getPosition())}),d.fitBounds(a)}},this.on=function(a,b){f.push({on:a,handler:b})},this.addMarker=function(a,b,c,f,g,h,k){if(null==i.findMarker(a,b)){var l=new MarkerWithLabel({position:new google.maps.LatLng(a,b),draggable:!1,raiseOnDrag:!0,map:d,labelContent:g,labelAnchor:new google.maps.Point(25,0),labelClass:"marker-label",labelStyle:{opacity:1}});if(null!=f){var m=new google.maps.InfoWindow({content:f});google.maps.event.addListener(l,"click",function(){null!=j&&j.close(),m.open(d,l),j=m})}return e.unshift(l),i.markers.unshift({lat:a,lng:b,draggable:!1,icon:c,infoWindowContent:f,label:g,url:h,thumbnail:k}),l}},this.findMarker=function(b,c){for(var d=0;d<e.length;d++){var f=e[d].getPosition();if(a(f.lat(),b)&&a(f.lng(),c))return e[d]}return null},this.findMarkerIndex=function(b,c){for(var d=0;d<e.length;d++){var f=e[d].getPosition();if(a(f.lat(),b)&&a(f.lng(),c))return d}return-1},this.addInfoWindow=function(a,b,c){var d=new google.maps.InfoWindow({content:c,position:new google.maps.LatLng(a,b)});return g.push(d),d},this.hasMarker=function(a,b){return null!==i.findMarker(a,b)},this.getMarkerInstances=function(){return e},this.removeMarkers=function(a){var b=this;angular.forEach(a,function(a){var c=a.getPosition(),d=c.lat(),f=c.lng(),g=b.findMarkerIndex(d,f);e.splice(g,1),b.markers.splice(g,1),a.setMap(null)})}}var c={zoom:8,draggable:!1,container:null};return b}(),c=angular.module("google-maps",[]);c.directive("googleMap",["$log","$timeout","$filter",function(c,d){var e=function(a){var b=a.map;self.addInfoWindow=function(a,c,d){b.addInfoWindow(a,c,d)}};return e.$inject=["$scope","$element"],{restrict:"ECA",priority:100,transclude:!0,template:"<div class='angular-google-map' ng-transclude></div>",replace:!1,scope:{center:"=center",markers:"=markers",latitude:"=latitude",longitude:"=longitude",zoom:"=zoom",refresh:"&refresh",windows:"=windows",events:"=events"},controller:e,link:function(e,f,g){if(!angular.isDefined(e.center)||!angular.isDefined(e.center.latitude)||!angular.isDefined(e.center.longitude))return void c.error("angular-google-maps: could not find a valid center property");if(!angular.isDefined(e.zoom))return void c.error("angular-google-maps: map zoom property not set");angular.element(f).addClass("angular-google-map");var h={options:{}};g.options&&(h.options=angular.fromJson(g.options));var i=new b(angular.extend(h,{container:f[0],center:new google.maps.LatLng(e.center.latitude,e.center.longitude),draggable:"true"==g.draggable,zoom:e.zoom}));if(i.on("drag",function(){var a=i.center;d(function(){e.$apply(function(){e.center.latitude=a.lat(),e.center.longitude=a.lng()})})}),i.on("zoom_changed",function(){e.zoom!=i.zoom&&d(function(){e.$apply(function(){e.zoom=i.zoom})})}),i.on("center_changed",function(){var a=i.center;d(function(){e.$apply(function(){i.dragging||(e.center.latitude=a.lat(),e.center.longitude=a.lng())})})}),angular.isDefined(e.events))for(var j in e.events)e.events.hasOwnProperty(j)&&angular.isFunction(e.events[j])&&i.on(j,function(){e.events[j].apply(e,[i,j,arguments])});"true"==g.markClick&&!function(){var a=null;i.on("click",function(b){null==a?(a={latitude:b.latLng.lat(),longitude:b.latLng.lng()},e.markers.push(a)):(a.latitude=b.latLng.lat(),a.longitude=b.latLng.lng()),d(function(){e.latitude=a.latitude,e.longitude=a.longitude,e.$apply()})})}(),e.map=i,angular.isUndefined(e.refresh())?i.draw():e.$watch("refresh()",function(a,b){a&&!b&&i.draw()}),e.$watch("markers",function(b){d(function(){angular.forEach(b,function(a){i.hasMarker(a.latitude,a.longitude)||i.addMarker(a.latitude,a.longitude,a.icon,a.infoWindow,a.label)});var c=[];angular.forEach(i.getMarkerInstances(),function(b){for(var d=b.getPosition(),f=d.lat(),g=d.lng(),h=!1,i=0;i<e.markers.length;i++){var j=e.markers[i];a(j.latitude,f)&&a(j.longitude,g)&&(h=!0)}h||c.push(b)}),c.length&&i.removeMarkers(c),"true"==g.fit&&b&&b.length>1&&i.fit()})},!0),e.$watch("center",function(a,b){a!==b&&(i.dragging||(i.center=new google.maps.LatLng(a.latitude,a.longitude),i.draw()))},!0),e.$watch("zoom",function(a,b){a!==b&&(i.zoom=a,i.draw())})}}}])}(),function(){window.visibly={q:document,p:void 0,prefixes:["webkit","ms","o","moz","khtml"],props:["VisibilityState","visibilitychange","Hidden"],m:["focus","blur"],visibleCallbacks:[],hiddenCallbacks:[],genericCallbacks:[],_callbacks:[],cachedPrefix:"",fn:null,onVisible:function(a){"function"==typeof a&&this.visibleCallbacks.push(a)},onHidden:function(a){"function"==typeof a&&this.hiddenCallbacks.push(a)},getPrefix:function(){if(!this.cachedPrefix)for(var a=0;b=this.prefixes[a++];)if(b+this.props[2]in this.q)return this.cachedPrefix=b,this.cachedPrefix},visibilityState:function(){return this._getProp(0)},hidden:function(){return this._getProp(2)},visibilitychange:function(a){"function"==typeof a&&this.genericCallbacks.push(a);var b=this.genericCallbacks.length;if(b)if(this.cachedPrefix)for(;b--;)this.genericCallbacks[b].call(this,this.visibilityState());else for(;b--;)this.genericCallbacks[b].call(this,arguments[0])},isSupported:function(){return this.cachedPrefix+this.props[2]in this.q},_getProp:function(a){return this.q[this.cachedPrefix+this.props[a]]},_execute:function(a){if(a){this._callbacks=1==a?this.visibleCallbacks:this.hiddenCallbacks;for(var b=this._callbacks.length;b--;)this._callbacks[b]()}},_visible:function(){window.visibly._execute(1),window.visibly.visibilitychange.call(window.visibly,"visible")},_hidden:function(){window.visibly._execute(2),window.visibly.visibilitychange.call(window.visibly,"hidden")},_nativeSwitch:function(){this[this._getProp(2)?"_hidden":"_visible"]()},_listen:function(){try{this.isSupported()?this.q.addEventListener(this.cachedPrefix+this.props[1],function(){window.visibly._nativeSwitch.apply(window.visibly,arguments)},1):this.q.addEventListener?(window.addEventListener(this.m[0],this._visible,1),window.addEventListener(this.m[1],this._hidden,1)):this.q.attachEvent&&(this.q.attachEvent("onfocusin",this._visible),this.q.attachEvent("onfocusout",this._hidden))}catch(a){}},init:function(){this.getPrefix(),this._listen()}},this.visibly.init()}();