torque/dist/torque.full.js

18 lines
570 KiB
JavaScript
Raw Normal View History

2017-03-27 19:03:30 +08:00
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.torque=e()}}(function(){var define,module,exports;return function e(t,n,r){function i(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return i(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var s=typeof require=="function"&&require;for(var o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){var r=function(e,t){if(e<0)throw new Error("start must be a positive number");if(e>=t)throw new Error("start must be smaller than end");this.start=e,this.end=t};r.prototype={diff:function(){return this.end-this.start},isLast:function(e){return(e|0)===this.end}},t.exports=r},{}],2:[function(e,t,n){(function(n){function u(e,t){if(!t.steps)throw new Error("steps option missing");this.options=t,this.running=!1,this._tick=this._tick.bind(this),this._t0=+(new Date),this.callback=e,this._time=0,this.itemsReady=!1,this.options=r.extend({animationDelay:0,maxDelta:.2,loop:t.loop===undefined?!0:t.loop},this.options),this.steps(t.steps)}var r=e("./"),i=e("./animator-steps-range"),s=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame||function(e){return n.setTimeout(e,1e3/60)},o=n.cancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelAnimationFrame||n.msCancelAnimationFrame||function(e){clearTimeout(e)};u.prototype={start:function(){this.running=!0,s(this._tick),this.options.onStart&&this.options.onStart(),this.stepsRange().diff()===1&&(this.running=!1)},isRunning:function(){return this.running},stop:function(){this.pause(),this.time(this.stepsRange().start),this.options.onStop&&this.options.onStop()},time:function(e){if(!arguments.length)return this._time;this._time=e;var t=this.range(this.domain(this._time));this.callback(t)},toggle:function(){this.running?this.pause():this.start()},rescale:function(){return this.domainInv=r.math.linear(this.options.animationDelay,this.options.animationDelay+this.options.animationDuration),this.domain=this.domainInv.invert(),this.range=r.math.linear(0,this._defaultStepsRange.end),this.rangeInv=this.range.invert(),this.time(this._time),this.running?this.start():this.pause(),this},duration:function(e){return arguments.length?(this.options.animationDuration=e,this.time()>e&&this.time(0),this.rescale(),this):this.options.animationDuration},steps:function(e){return this.options.steps=e,this._defaultStepsRange=new i(0,e),this.rescale()},stepsRange:function(e,t){if(arguments.length===2){if(e<this._defaultStepsRange.start)throw new Error("start must be within default steps range");if(t>this._defaultStepsRange.end)throw new Error("end must be within default steps range");this._customStepsRange=new i(e,t),this.options.onStepsRange&&this.options.onStepsRange();var n=this.step()|0;(n<e||n>t)&&this.step(e)}return this._customStepsRange||this._defaultStepsRange},removeCustomStepsRange:function(){this._customStepsRange=undefined,this.options.onStepsRange&&this.options.onStepsRange()},step:function(e){if(arguments.length===0)return this.range(this.domain(this._time));this._time=this.domainInv(this.rangeInv(e))},pause:function(){this.running=!1,o(this._tick),this.options.onPause&&this.options.onPause()},_tick:function(){var e=+(new Date),t=(e-this._t0)*.001;t=Math.min(this.options.maxDelta,t),this._t0=e,this._time+=t;var n=this.stepsRange();n.isLast(this.step())&&(this.options.loop?this.step(n.start):(this.time(this.options.animationDuration),this.pause())),this.running&&(this.time(this._time),s(this._tick))}},t.exports=u}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./":11,"./animator-steps-range":1}],3:[fun
.x%i+i)%i,y:t.y};this.provider.getTileData(s,n,function(t){r._tileLoaded(e,t)})},drawTile:function(e){var t=e.canvas;if(!e.data)return;t.width=t.width,this.renderer.setCanvas(t);var n=this.renderer.accumulate(e.data,this.getKey());this.renderer.renderTileAccum(n,0,0)},setKey:function(e){this.keys=[e],this.redraw()},setCartoCSS:function(e){if(!this.renderer)throw new Error("renderer is not valid");return this.renderer.setCartoCSS(e)},setStepsRange:function(e,t){this.animator.stepsRange(e,t)},removeStepsRange:function(){this.animator.removeCustomStepsRange()},getStepsRange:function(){return this.animator.stepsRange()}}),t.exports={GMapsTiledTorqueLayer:f,GMapsTorqueLayer:a}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../":11,"./CanvasLayer":6,"./canvas_tile_layer":7,"./gmaps_tileloader_mixin":8,carto:47}],11:[function(e,t,n){t.exports=e("./core"),t.exports.Animator=e("./animator"),t.exports.cartocss_reference=e("./cartocss_reference"),t.exports.common=e("./common"),t.exports.math=e("./math"),t.exports.Mercator=e("./mercator"),t.exports.net=e("./request"),t.exports.renderer=e("./renderer"),t.exports.providers=e("./provider"),e("./leaflet");var r=e("./gmaps");t.exports.GMapsTileLoader=r.GMapsTileLoader,t.exports.GMapsTorqueLayer=r.GMapsTorqueLayer,t.exports.GMapsTiledTorqueLayer=r.GMapsTiledTorqueLayer,e("./ol")},{"./animator":2,"./cartocss_reference":3,"./common":4,"./core":5,"./gmaps":9,"./leaflet":13,"./math":16,"./mercator":17,"./ol":19,"./provider":23,"./renderer":30,"./request":34}],12:[function(e,t,n){e("./leaflet_tileloader_mixin"),L.CanvasLayer=L.Layer.extend({includes:[L.Mixin.Events,L.Mixin.TileLoader],options:{minZoom:0,maxZoom:28,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:L.Browser.mobile,updateWhenIdle:L.Browser.mobile,tileLoader:!1,zoomAnimation:!0},initialize:function(e){var t=this;e=e||{},this.render=this.render.bind(this),L.Util.setOptions(this,e),this._canvas=this._createCanvas(),this.options.zoomAnimation&&(this._backCanvas=this._createCanvas()),this._ctx=this._canvas.getContext("2d"),this.currentAnimationFrame=-1,this.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)},this.cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||function(e){clearTimeout(e)}},_createCanvas:function(){var e;e=document.createElement("canvas"),e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.pointerEvents="none",e.style.zIndex=this.options.zIndex||0;var t="leaflet-tile-container";return this.options.zoomAnimation&&(t+=" leaflet-zoom-animated"),e.setAttribute("class",t),e},onAdd:function(e){this._map=e;var t=this._map._panes.tilePane,n=L.DomUtil.create("div","leaflet-layer");n.appendChild(this._canvas),this.options.zoomAnimation&&(n.appendChild(this._backCanvas),this._backCanvas.style.display="none"),t.appendChild(n),this._container=n,e.dragging._draggable.on("predrag",function(){var t=e.dragging._draggable;L.DomUtil.setPosition(this._canvas,{x:-t._newPos.x,y:-t._newPos.y})},this),e.on({viewreset:this._reset},this),e.on("move",this.redraw,this),e.on("resize",this._reset,this),this.options.zoomAnimation&&e.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim,moveend:this._reset},this),this.options.tileLoader&&this._initTileLoader(),this._reset()},_animateZoom:function(e){this._animating||(this._animating=!0);var t=this._backCanvas;t.width=this._canvas.width,t.height=this._canvas.height;var n=this._canvas._leaflet_pos||{x:0,y:0};t.getContext("2d").drawImage(this._canvas,0,0),L.DomUtil.setPosition(t,L.DomUtil.getPosition(this._canvas)),this._canvas.style.display="none",t.style.display="block";var r=this._map,i=r.getZoomScale(e.zoom),s=r._latLngToNewLayerPoint(r.getCenter(),e.zoom,e.center),o=r._latLngToNewLayerPoint(e.center,e.zoom,e.cente
}var r=e("../"),i=e("../profiler"),s=r.types.Uint8Array,o=r.types.Int32Array,u=r.types.Uint32Array,f=function(e){this._ready=!1,this._tileQueue=[],this.options=e,this.options.is_time=this.options.is_time===undefined?!0:this.options.is_time,this.options.tiler_protocol=e.tiler_protocol||"http",this.options.tiler_domain=e.tiler_domain||"cartodb.com",this.options.tiler_port=e.tiler_port||80,this.options.data_aggregation&&(this.options.cumulative=this.options.data_aggregation==="cumulative");if(e.resolution===undefined)throw new Error("resolution should be provided");if(e.steps===undefined)throw new Error("steps should be provided");e.start===undefined?this._fetchKeySpan():this._setReady(!0)};f.prototype={proccessTile:function(e,t,n){var r,a=new s(e.length),f=new s(e.length),l=i.metric("ProviderJSON:mem"),c=i.metric("ProviderJSON:point_count"),h=i.metric("ProviderJSON:process_time").start(),p=0,d=-1;for(r=0;r<e.length;++r){var v=e[r];p+=v.dates__uint16.length;for(var m=0;m<v.dates__uint16.length;++m)d=Math.max(d,v.dates__uint16[m])}this.options.cumulative&&(p=(1+d)*e.length);var g=this.options.cumulative?u:s,y=new o(d+1),b=new o(d+1),w=new(this.options.valueDataType||g)(p),E=new u(p);l.inc(4*d+4*d+p+p*4),c.inc(e.length);var S={};for(var r=0;r<e.length;++r){var v=e[r];a[r]=v.x__uint8*this.options.resolution,v.y__uint8===-1?f[r]=0:f[r]=v.y__uint8*this.options.resolution;var p=v.dates__uint16,x=v.vals__uint8;if(!this.options.cumulative)for(var T=0,N=p.length;T<N;++T){var C=S[p[T]]||(S[p[T]]=[]);this.options.cumulative&&(x[T]+=prev_val),prev_val=x[T],C.push([r,x[T]])}else{var k={};for(var T=0,N=p.length;T<N;++T)k[p[T]]=x[T];var L=0;for(var T=p[0];T<=d;++T){var C=S[T]||(S[T]=[]),A=k[T];A&&(L+=A),C.push([r,L])}}}var O=0,M=0,_=0;for(var _=0;_<=d;++_){var D=0,P=S[_];if(P)for(var r=0;r<P.length;++r){var C=P[r];++D,E[O]=C[0],w[O]=C[1],++O}y[_]=M,b[_]=D,M+=D}return h.end(),{x:a,y:f,z:n,coord:{x:t.x,y:t.y,z:n},timeCount:b,timeIndex:y,renderDataPos:E,renderData:w,maxDate:d}},_host:function(){var e=this.options,t=e.sql_api_port,n=(e.user_name||e.user)+"."+(e.sql_api_domain||"cartodb.com")+(t?":"+t:""),r=e.sql_api_protocol||"http";return this.options.url||r+"://"+n+"/api/v2/sql"},url:function(e){var t=this.options,n=t.sql_api_protocol||"http";if(!this.options.cdn_url)return this._host();var r=n+"://";e&&(r+=e+".");var i=t.cdn_url;if(!i.http&&!i.https)throw new Error("cdn_host should contain http and/or https entries");return r+=i[n]+"/"+(t.user_name||t.user)+"/api/v2/sql",r},_hash:function(e){var t=0;if(!e||e.length==0)return t;for(var n=0,r=e.length;n<r;++n)t=(t<<5)-t+e.charCodeAt(n)|0;return t},_extraParams:function(){if(this.options.extra_params){var e=[];for(var t in this.options.extra_params){var n=this.options.extra_params[t];n&&e.push(t+"="+encodeURIComponent(n))}return e.join("&")}return null},isHttps:function(){return this.options.sql_api_protocol&&this.options.sql_api_protocol==="https"},sql:function(e,t,n){n=n||{};var i=this.options.subdomains||"0123";this.isHttps()&&(i=[null]);var s;n.no_cdn?s=this._host():s=this.url(i[Math.abs(this._hash(e))%i.length]);var o=this._extraParams();r.net.get(s+"?q="+encodeURIComponent(e)+(o?"&"+o:""),function(e){n.parseJSON&&(e=JSON.parse(e&&e.responseText)),t&&t(e)})},getTileData:function(e,t,n){this._ready?this._getTileData(e,t,n):this._tileQueue.push([e,t,n])},_setReady:function(e){this._ready=!0,this._processQueue(),this.options.ready&&this.options.ready()},_processQueue:function(){var e;while(e=this._tileQueue.pop())this._getTileData.apply(this,e)},_getTileData:function(e,t,n){var r=i.metric("ProviderJSON:tile_fetch_time").start();this.table=this.options.table;var s=1<<t,o=this.options.column;this.options.is_time&&(o=a("date_part('epoch', {column})",this.options));var u="WITH par AS ( SELECT CDB_XYZ_Resolution({zoom})*{resolution} as res, 256/{resolution} as tile_size, CDB_XYZ_Extent({x}, {y}, {zoom}) as ext ),cte AS ( SELECT ST_SnapToGrid(i.the_geom_webmercator, p.res) g, {countby} c, floor(({column_conv} - {start})/{step}) d FROM ({_sql}) i, par p WHERE i.the_geom_webmercator && p.ex
[1],a[2]);t[u]=f}this._gradients[e(this._style["image-filters"])]=t}this._filters.gradient(t),this._filters.draw()}}}),d.isTurboCarto=function(e){var t=["ramp","colorbrewer","buckets"],n=t.map(function(e){return e+"("}).map(String.prototype.indexOf.bind(e)).every(function(e){return e===-1});return!n},t.exports=d}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../":11,"../profiler":22,"./cartocss_render":28,"./datasource":29,"./torque_filters":33,carto:47,"turbo-carto":155}],32:[function(e,t,n){(function(n){function o(e,t){this.options=t,r.tree.Reference.set(torque["torque-reference"]),this.setCanvas(e),this.setCartoCSS(this.options.cartocss||i)}var r=n.carto||e("carto"),i=["#layer {"," polygon-fill: #FFFF00;"," [value > 10] { polygon-fill: #FFFF00; }"," [value > 100] { polygon-fill: #FFCC00; }"," [value > 1000] { polygon-fill: #FE9929; }"," [value > 10000] { polygon-fill: #FF6600; }"," [value > 100000] { polygon-fill: #FF3300; }","}"].join("\n"),s=Math.PI*2;o.prototype={setCartoCSS:function(e){this._cartoCssStyle=(new r.RendererJS).render(e);if(this._cartoCssStyle.getLayers().length>1)throw new Error("only one CartoCSS layer is supported");this._shader=this._cartoCssStyle.getLayers()[0].shader},setCanvas:function(e){if(!e)return;this._canvas=e,this._ctx=e.getContext("2d")},accumulate:function(e,t){var n=Profiler.metric("RectangleRender:accumulate").start(),r,i,s,o,u,a,f,l,c=this.options.resolution,h=256/c,p=new Float32Array(h*h);typeof t!="object"&&(t=[t]);for(u=0;u<t.length;++u){a=t[u],f=e.timeCount[a];if(f){l=e.timeIndex[a];for(o=0;o<f;++o)s=e.renderDataPos[l+o],r=e.x[s]/c,i=e.y[s]/c,p[r*h+i]+=e.renderData[l+o]}}return n.end(),p},renderTileAccum:function(e,t,n){var r=Profiler.metric("RectangleRender:renderTileAccum").start(),i,s,o,u,a=this.options.resolution,f=this._ctx,l=256/a|0,c=l*l,h=this._colors;this.options.blendmode&&(f.globalCompositeOperation=this.options.blendmode);var p=this._shader["polygon-opacity"]||function(){return 1};for(var d=0;d<c;++d){var v=d,m=e[d];m&&(s=v/l|0,o=v%l,i=this._shader["polygon-fill"]({value:m},{zoom:0}),f.fillStyle=i,u=p({value:m},{zoom:0}),u===null&&(u=1),f.globalAlpha=u,f.fillRect(s*a,256-a-o*a,a,a))}r.end()},renderTile:function(e,t,n){if(!this._canvas)return;var r=this.options.resolution,i=this._ctx,s=this._colors,o=e.timeCount[t];if(o){var u=this._canvas.width,a=this._canvas.height,f=e.timeIndex[t];for(var l=0;l<activePixels;++l){var c=e.renderDataPos[f+l],h=e.renderData[f+l];if(h){var p=s[Math.min(h,s.length-1)],d=e.x[c],v=e.y[c];i.fillStyle=p,i.fillRect(d,v,r,r)}}}return n&&n(null)}},t.exports=o}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{carto:47}],33:[function(e,t,n){"use strict";function r(e,t){if(!(this instanceof r))return new r(e,t);t=t||{},this._canvas=e=typeof e=="string"?document.getElementById(e):e,this._ctx=e.getContext("2d"),this._width=e.width,this._height=e.height,this._max=1,this._data=[],this.canvasClass=t.canvasClass}r.prototype={defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},gradient:function(e){var t=this._createCanvas(),n=t.getContext("2d"),r=n.createLinearGradient(0,0,0,256);t.width=1,t.height=256;for(var i in e)r.addColorStop(+i,e[i]);return n.fillStyle=r,n.fillRect(0,0,1,256),this._grad=n.getImageData(0,0,1,256).data,this},draw:function(){this._grad||this.gradient(this.defaultGradient);var e=this._ctx,t=e.getImageData(0,0,this._canvas.width,this._canvas.height);return this._colorize(t.data,this._grad),e.putImageData(t,0,0),this},_colorize:function(e,t){for(var n=3,r=e.length,i;n<r;n+=4)i=e[n]*4,i&&(e[n-3]=t[i],e[n-2]=t[i+1],e[n-1]=t[i+2])},_createCanvas:function(){return this.canvasClass?new this.canvasClass:document.createElement("canvas")}},t.exports=r},{}],34:[function(e,t,n){(function(n){function s(e,t,n){function u(){i.removeChild(s),clearTimeout(a),delete window[o]}n=n||{},n.timeout=n.timeout===undefined?1e4:n.timeout;var i=document.getElementsByTagName("head")[0],s=document.createElem
;if(n>=s)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"};default:return e}});for(var a=r[n];n<s;a=r[++n])b(a)||!C(a)?o+=" "+a:o+=" "+u(a);return o},n.deprecate=function(e,i){function o(){if(!s){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),s=!0}return e.apply(this,arguments)}if(T(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return o};var s={},o;n.debuglog=function(e){T(o)&&(o=t.env.NODE_DEBUG||""),e=e.toUpperCase();if(!s[e])if((new RegExp("\\b"+e+"\\b","i")).test(o)){var r=t.pid;s[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else s[e]=function(){};return s[e]},n.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow","boolean":"yellow","undefined":"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=g,n.isBoolean=y,n.isNull=b,n.isNullOrUndefined=w,n.isNumber=E,n.isString=S,n.isSymbol=x,n.isUndefined=T,n.isRegExp=N,n.isObject=C,n.isDate=k,n.isError=L,n.isFunction=A,n.isPrimitive=O,n.isBuffer=e("./support/isBuffer");var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",P(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!C(t))return e;var n=Object.keys(t),r=n.length;while(r--)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":44,_process:42,inherits:43}],46:[function(e,t,n){(function(e){function i(t){return e.functions.hsla(t.h,t.s,t.l,t.a)}function s(t){return t instanceof e.Dimension?parseFloat(t.unit=="%"?t.value/100:t.value):typeof t=="number"?t:NaN}function o(e){return Math.min(1,Math.max(0,e))}e.functions={rgb:function(e,t,n){return this.rgba(e,t,n,1)},rgba:function(t,n,r,i){var o=[t,n,r].map(function(e){return s(e)});return i=s(i),o.some(isNaN)||isNaN(i)?null:new e.Color(o,i)},stop:function(e){var t,n;return arguments.length>1&&(t=arguments[1]),arguments.length>2&&(n=arguments[2]),{is:"tag",val:e,color:t,mode:n,toString:function(r){return'\n <stop value="'+e.ev(r)+'"'+(t?' color="'+t.ev(r)+'" ':"")+(n?' mode="'+n.ev(r)+'" ':"")+"/>"}}},hsl:function(e,t,n){return this.hsla(e,t,n,1)},hsla:function(e,t,n,r){function u(e){return e=e<0?e+1:e>1?e-1:e,e*6<1?o+(i-o)*e*6:e*2<1?i:e*3<2?o+(i-o)*(2/3-e)*6:o}e=s(e)%360/360,t=s(t),n=s(n),r=s(r);if([e,t,n,r].some(isNaN))return null;var i=n<=.5?n*(t+1):n+t-n*t,o=n*2-i;return this.rgba(u(e+1/3)*255,u(e)*255,u(e-1/3)*255,r)},hue:function(t){return"toHSL"in t?new e.Dimension(Math.round(t.toHSL().h)):null},saturation:function(t){return"toHSL"in t?new e.Dimension(Math.round(t.toHSL().s*100),"%"):null},lightness:function(t){return"toHSL"in t?new e.Dimension(Math.round(t.toHSL().l*100),"%"):null},alpha:function(t){return"toHSL"in t?new e.Dimension(t.toHSL().a):null},saturate:function(e,t){if("toHSL"in e){var n=e.toHSL();return n.s+=t.value/100,n.s=o(n.s),i(n)}return null},desaturate:function(e,t){if("toHSL"in e){var n=e.toHSL();return n.s-=t.value/100,n.s=o(n.s),i(n)}return null},lighten:function(e,t){if("toHSL"in e){var n=e.toHSL();return n.l+=t.value/100,n.l=o(n.l),i(n)}return null},darken:function(e,t){if("toHSL"in e){var n=e.toHSL();return n.l-=t.value/100,n.l=o(n.l),i(n)}return null},fadein:function(e,t){if("toHSL"in e){var n=e.toHSL();return n.a+=t.value/100,n.a=o(n.a),i(n)}return null},fadeout:function(e,t){if("toHSL"in e){var n=e.toHSL();return n.a-=t.value/100,n.a=o(n.a),i(n)}return null},spin:function(e,t){if("toHSL"in e){var n=e.toHSL(),r=(n.h+t.value)%360;return n.h=r<0?360+r:r,i(n)}return null},replace:function(e,t,n){return e.is==="field"?e.toString+".replace("+t.toString()+", "+n.toSt
},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon",expression:!0},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque",expression:!0},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by de
,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"float",expression:!0,doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"float",expression:!0,"default-value":"0"}},torque:{"-torque-clear-color":{css:"-torque-clear-color",type:"color","default-value":"rgba(255, 255, 255, 0)","default-meaning":"full clear",doc:"color used to clear canvas on each frame"},"-torque-frame-count":{css:"-torque-frame-count","default-value":"128",type:"float","default-meaning":"the data is broken into 128 time frames",doc:"Number of animation steps/frames used in the animation. If the data contains a fewere number of total frames, the lesser value will be used."},"-torque-resolution":{css:"-torque-resolution","default-value":"2",type:"float","default-meaning":"",doc:"Spatial resolution in pixels. A resolution of 1 means no spatial aggregation of the data. Any other resolution of N results in spatial aggregation into cells of NxN pixels. The value N must be power of 2"},"-torque-animation-duration":{css:"-torque-animation-duration","default-value":"30",type:"float","default-meaning":"the animation lasts 30 seconds",doc:"Animation duration in seconds"},"-torque-aggregation-function":{css:"-torque-aggregation-function","default-value":"count(cartodb_id)",type:"string","default-meaning":"the value for each cell is the count of points in that ce
type=="numbers"){for(r in n.value)if(n.value[r].is!=="float")return!1;return!0}if(i.selector(t).type=="tags"){if(!n.value)return!1;if(!n.value[0].value)return n.value[0].is==="tag";for(r=0;r<n.value[0].value.length;r++)if(n.value[0].value[r].is!=="tag")return!1;return!0}if(i.selector(t).type=="functions")return a(n,t);if(i.selector(t).type==="unsigned")return n.value[0].is==="float"?(n.value[0].round(),!0):!1;if(i.selector(t).expression)return!0;if(i.selector(t).validate){var o=!1;for(r=0;r<n.value.length;r++)if(i.selector(t).type==n.value[r].is&&i._validateValue[i.selector(t).validate](e,n.value[r].value))return!0;return o}return i.selector(t).type==n.value[0].is},n.Reference=i})(e("../tree"))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../tree":52,"mapnik-reference":81,underscore:166}],73:[function(e,t,n){(function(e){function t(t){return Object.keys(e.Reference.selector_cache).map(function(n){return[n,e.Reference.editDistance(t,n)]}).sort(function(e,t){return e[1]-t[1]})}e.Rule=function(n,r,i,s){var o=n.split("/");this.name=o.pop(),this.instance=o.length?o[0]:"__default__",this.value=r instanceof e.Value?r:new e.Value([r]),this.index=i,this.symbolizer=e.Reference.symbolizer(this.name),this.filename=s,this.variable=n.charAt(0)==="@"},e.Rule.prototype.is="rule",e.Rule.prototype.clone=function(){var t=Object.create(e.Rule.prototype);return t.name=this.name,t.value=this.value,t.index=this.index,t.instance=this.instance,t.symbolizer=this.symbolizer,t.filename=this.filename,t.variable=this.variable,t},e.Rule.prototype.updateID=function(){return this.id=this.zoom+"#"+this.instance+"#"+this.name},e.Rule.prototype.toString=function(){return"["+e.Zoom.toString(this.zoom)+"] "+this.name+": "+this.value},e.Rule.prototype.toXML=function(n,r,i,s){if(!e.Reference.validSelector(this.name)){var o=t(this.name),u="";return o[0][1]<3&&(u=". Did you mean "+o[0][0]+"?"),n.error({message:"Unrecognized rule: "+this.name+u,index:this.index,type:"syntax",filename:this.filename})}if(this.value instanceof e.Value&&!e.Reference.validValue(n,this.name,this.value)){if(!e.Reference.selector(this.name))return n.error({message:"Unrecognized property: "+this.name,index:this.index,type:"syntax",filename:this.filename});var a;return e.Reference.selector(this.name).validate?a=e.Reference.selector(this.name).validate:typeof e.Reference.selector(this.name).type=="object"?a="keyword (options: "+e.Reference.selector(this.name).type.join(", ")+")":a=e.Reference.selector(this.name).type,n.error({message:"Invalid value for "+this.name+", the type "+a+" is expected. "+this.value+" (of type "+this.value.value[0].is+") "+" was given.",index:this.index,type:"syntax",filename:this.filename})}if(this.variable)return"";if(e.Reference.isFont(this.name)&&this.value.value.length>1){var f=e._getFontSet(n,this.value.value);return'fontset-name="'+f.name+'"'}return r?this.value.toString(n,this.name,i):e.Reference.selectorName(this.name)+'="'+this.value.toString(n,this.name)+'"'},e.Rule.prototype.ev=function(t){return new e.Rule(this.name,this.value.ev(t),this.index,this.filename)}})(e("../tree"))},{"../tree":52}],74:[function(e,t,n){(function(e){e.Ruleset=function(t,n){this.selectors=t,this.rules=n,this._lookups={}},e.Ruleset.prototype={is:"ruleset",ev:function(t){var n,r=new e.Ruleset(this.selectors,this.rules.slice(0));r.root=this.root,t.frames.unshift(r);for(n=0,rule;n<r.rules.length;n++)rule=r.rules[n],r.rules[n]=rule.ev?rule.ev(t):rule;return t.frames.shift(),r},match:function(e){return!e||e.length===0},variables:function(){return this._variables?this._variables:this._variables=this.rules.reduce(function(t,n){return n instanceof e.Rule&&n.variable===!0&&(t[n.name]=n),t},{})},variable:function(e){return this.variables()[e]},rulesets:function(){return this._rulesets?this._rulesets:this._rulesets=this.rules.filter(function(t){return t instanceof e.Ruleset})},find:function(t,n){n=n||this;var r=[],i,s,o=t.toString();return o in this._lookups?this._lookups[o]:(this.rulesets().forEach(function(i){if(i!==n
n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function dr(e,t,n){tr.lastIndex=0;var r=tr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function vr(e,t,n){tr.lastIndex=0;var r=tr.exec(t.slice(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function mr(e,t,n){tr.lastIndex=0;var r=tr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function gr(e,t,n){tr.lastIndex=0;var r=tr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function yr(e,t,n){tr.lastIndex=0;var r=tr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function br(e,t,n){tr.lastIndex=0;var r=tr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function wr(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=w(t)/60|0,i=w(t)%60;return n+rr(r,"0",2)+rr(i,"0",2)}function Er(e,t,n){nr.lastIndex=0;var r=nr.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Sr(e){var t=e.length,n=-1;while(++n<t)e[n][0]=this(e[n][0]);return function(t){var n=0,r=e[n];while(!r[1](t))r=e[++n];return r[0](t)}}function Tr(){}function Cr(e,t,n){var r=n.s=e+t,i=r-e,s=r-i;n.t=e-s+(t-i)}function kr(e,t){e&&Ar.hasOwnProperty(e.type)&&Ar[e.type](e,t)}function Or(e,t,n){var r=-1,i=e.length-n,s;t.lineStart();while(++r<i)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function Mr(e,t){var n=-1,r=e.length;t.polygonStart();while(++n<r)Or(e[n],t,1);t.polygonEnd()}function Hr(){function s(e,t){e*=Pt,t=t*Pt/2+Ot/4;var s=e-n,o=s>=0?1:-1,u=o*s,a=Math.cos(t),f=Math.sin(t),l=i*f,c=r*a+l*Math.cos(u),h=l*o*Math.sin(u);Dr.add(Math.atan2(h,c)),n=e,r=a,i=f}var e,t,n,r,i;Pr.point=function(o,u){Pr.point=s,n=(e=o)*Pt,r=Math.cos(u=(t=u)*Pt/2+Ot/4),i=Math.sin(u)},Pr.lineEnd=function(){s(e,t)}}function Br(e){var t=e[0],n=e[1],r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function jr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fr(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Ir(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function qr(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Rr(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Ur(e){return[Math.atan2(e[1],e[0]),It(e[2])]}function zr(e,t){return w(e[0]-t[0])<Lt&&w(e[1]-t[1])<Lt}function ni(e,t){e*=Pt;var n=Math.cos(t*=Pt);ri(n*Math.cos(e),n*Math.sin(e),Math.sin(t))}function ri(e,t,n){++Wr,Vr+=(e-Vr)/Wr,$r+=(t-$r)/Wr,Jr+=(n-Jr)/Wr}function ii(){function r(r,i){r*=Pt;var s=Math.cos(i*=Pt),o=s*Math.cos(r),u=s*Math.sin(r),a=Math.sin(i),f=Math.atan2(Math.sqrt((f=t*a-n*u)*f+(f=n*o-e*a)*f+(f=e*u-t*o)*f),e*o+t*u+n*a);Xr+=f,Kr+=f*(e+(e=o)),Qr+=f*(t+(t=u)),Gr+=f*(n+(n=a)),ri(e,t,n)}var e,t,n;ti.point=function(i,s){i*=Pt;var o=Math.cos(s*=Pt);e=o*Math.cos(i),t=o*Math.sin(i),n=Math.sin(s),ti.point=r,ri(e,t,n)}}function si(){ti.point=ni}function oi(){function s(e,t){e*=Pt;var s=Math.cos(t*=Pt),o=s*Math.cos(e),u=s*Math.sin(e),a=Math.sin(t),f=r*a-i*u,l=i*o-n*a,c=n*u-r*o,h=Math.sqrt(f*f+l*l+c*c),p=n*o+r*u+i*a,d=h&&-Ft(p)/h,v=Math.atan2(h,p);Yr+=d*f,Zr+=d*l,ei+=d*c,Xr+=v,Kr+=v*(n+(n=o)),Qr+=v*(r+(r=u)),Gr+=v*(i+(i=a)),ri(n,r,i)}var e,t,n,r,i;ti.point=function(o,u){e=o,t=u,ti.point=s,o*=Pt;var a=Math.cos(u*=Pt);n=a*Math.cos(o),r=a*Math.sin(o),i=Math.sin(u),ri(n,r,i)},ti.lineEnd=function(){s(e,t),ti.lineEnd=si,ti.point=ni}}function ui(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function ai(){return!0}function fi(e,t,n,r,i){var s=[],o=[];e.forEach(function(e){if((t=e.length-1)<=0)return;var t,n=e[0],r=e[t];if(zr(n,r)){i.lineStart();for(var u=0;u<t;++u)i.point((n=e[u])[0],n[1]);i.lineEnd();return}var a=new ci(n,e,null,!0),f=new ci(n,null,a,!1);a.o=f,s.push(a),o.push(f),a=new ci(r,e,null,!1),f=new ci(r,null,a,!0),a.o=f,s.push(a),o.push(f)}),o.sort(t),li(s),li(o);if(!s.length)return;for(var u=0,a=n,f=o.length;u<f;++u)o[u].e=a=!a;var l=s[0],c,h;for(;;){var p=l,d=!0;while(p.v)if((p=p.n)===l)return;c=p.z,i.lineStart();do{p.v=p.o.v=!0;if(p.e){if(d)for(var u=0,f=c.length;u<f;++u)i.point((h=c[u])[0],h[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(d){c=p.p.z;for(var u=c.leng
.sqrt(a.x*a.x+a.y*a.y));e.r=b,t.forEach(Vu)}function Xu(e){e._pack_next=e._pack_prev=e}function Vu(e){delete e._pack_next,delete e._pack_prev}function $u(e,t,n,r){var i=e.children;e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r;if(i){var s=-1,o=i.length;while(++s<o)$u(i[s],t,n,r)}}function Ju(e,t,n){var r=e.r+n.r,i=t.x-e.x,s=t.y-e.y;if(r&&(i||s)){var o=t.r+n.r,u=i*i+s*s;o*=o,r*=r;var a=.5+(r-o)/(2*u),f=Math.sqrt(Math.max(0,2*o*(r+u)-(r-=u)*r-o*o))/(2*u);n.x=e.x+a*i+f*s,n.y=e.y+a*s-f*i}else n.x=e.x+r,n.y=e.y}function Ku(e,t){return e.parent==t.parent?1:2}function Qu(e){var t=e.children;return t.length?t[0]:e.t}function Gu(e){var t=e.children,n;return(n=t.length)?t[n-1]:e.t}function Yu(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Zu(e){var t=0,n=0,r=e.children,i=r.length,s;while(--i>=0)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function ea(e,t,n){return e.a.parent===t.parent?e.a:n}function ta(t){return 1+e.max(t,function(e){return e.y})}function na(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function ra(e){var t=e.children;return t&&t.length?ra(t[0]):e}function ia(e){var t=e.children,n;return t&&(n=t.length)?ia(t[n-1]):e}function sa(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function oa(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],s=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),s<0&&(r+=s/2,s=0),{x:n,y:r,dx:i,dy:s}}function ua(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function aa(e){return e.rangeExtent?e.rangeExtent():ua(e.range())}function fa(e,t,n,r){var i=n(e[0],e[1]),s=r(t[0],t[1]);return function(e){return s(i(e))}}function la(e,t){var n=0,r=e.length-1,i=e[n],s=e[r],o;return s<i&&(o=n,n=r,r=o,o=i,i=s,s=o),e[n]=t.floor(i),e[r]=t.ceil(s),e}function ca(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:ha}function pa(t,n,r,i){var s=[],o=[],u=0,a=Math.min(t.length,n.length)-1;t[a]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());while(++u<=a)s.push(r(t[u-1],t[u])),o.push(i(n[u-1],n[u]));return function(n){var r=e.bisect(t,n,1,a)-1;return o[r](s[r](n))}}function da(e,t,n,r){function o(){var o=Math.min(e.length,t.length)>2?pa:fa,a=r?uu:ou;return i=o(e,t,a,n),s=o(t,e,a,ko),u}function u(e){return i(e)}var i,s;return u.invert=function(e){return s(e)},u.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},u.range=function(e){return arguments.length?(t=e,o()):t},u.rangeRound=function(e){return u.range(e).interpolate(Jo)},u.clamp=function(e){return arguments.length?(r=e,o()):r},u.interpolate=function(e){return arguments.length?(n=e,o()):n},u.ticks=function(t){return ya(e,t)},u.tickFormat=function(t,n){return ba(e,t,n)},u.nice=function(t){return ma(e,t),o()},u.copy=function(){return da(e,t,n,r)},o()}function va(t,n){return e.rebind(t,n,"range","rangeRound","interpolate","clamp")}function ma(e,t){return la(e,ca(ga(e,t)[2])),la(e,ca(ga(e,t)[2])),e}function ga(e,t){t==null&&(t=10);var n=ua(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),s=t/r*i;return s<=.15?i*=10:s<=.35?i*=5:s<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+i*.5,n[2]=i,n}function ya(t,n){return e.range.apply(e,ga(t,n))}function ba(t,n,r){var i=ga(t,n);if(r){var s=Wn.exec(r);s.shift();if(s[8]==="s"){var o=e.formatPrefix(Math.max(w(i[0]),w(i[1])));return s[7]||(s[7]="."+Ea(o.scale(i[2]))),s[8]="f",r=e.format(s.join("")),function(e){return r(o.scale(e))+o.symbol}}s[7]||(s[7]="."+Sa(s[8],i)),r=s.join("")}else r=",."+Ea(i[2])+"f";return e.format(r)}function Ea(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function Sa(e,t){var n=Ea(t[2]);return e in wa?Math.abs(n-Ea(Math.max(w(t[0]),w(t[1]))))+ +(e!=="e"):n-(e==="%")*2}function xa(t,n,r,i){function s(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(n)}function o(e){return r?Math.pow(n,e):-Math.pow(n,-e)}function u(e){return t(s(e))}return u.invert=function(e){return o(t.invert(e))},u.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((i=e.map(Number)).map(s)),u):i},u.base=function(e){return arguments.length?(n=+e,t.domain(i.map(s)),u):n},u.nice=function(){var e=la(i.map(s),r
l[0])/2,(a[1]+l[1])/2],N(d*o)}m=null,C(u,a),O(r)}function w(){if(e.event.touches.length){var t=e.event.changedTouches;for(var n=0,s=t.length;n<s;++n)delete i[t[n].identifier];for(var o in i)return void d()}e.selectAll(l).on(u,null),h.on(c,_).on(v,D),p(),M(r)}var n=this,r=g.of(n,arguments),i={},s=0,o,u=".zoom-"+e.event.changedTouches[0].identifier,a="touchmove"+u,f="touchend"+u,l=[],h=e.select(n),p=Tt(n);y(),A(r),h.on(c,null).on(v,y)}function P(){var i=g.of(this,arguments);d?clearTimeout(d):(Af.call(this),n=x(r=s||e.mouse(this)),A(i)),d=setTimeout(function(){d=null,M(i)},50),R(),N(Math.pow(2,Jt()*.002)*t.k),C(r,n),O(i)}function H(){var n=e.mouse(this),r=Math.log(t.k)/Math.LN2;k(this,n,x(n),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var t={x:0,y:0,k:1},n,r,s,u=[960,500],a=$t,f=250,l=0,c="mousedown.zoom",h="mousemove.zoom",p="mouseup.zoom",d,v="touchstart.zoom",m,g=z(S,"zoomstart","zoom","zoomend"),y,b,w,E;return Kt||(Kt="onwheel"in i?(Jt=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in i?(Jt=function(){return e.event.wheelDelta},"mousewheel"):(Jt=function(){return-e.event.detail},"MozMousePixelScroll")),S.event=function(n){n.each(function(){var n=g.of(this,arguments),i=t;Pf?e.select(this).transition().each("start.zoom",function(){t=this.__chart__||{x:0,y:0,k:1},A(n)}).tween("zoom:zoom",function(){var s=u[0],o=u[1],a=r?r[0]:s/2,f=r?r[1]:o/2,l=e.interpolateZoom([(a-t.x)/t.k,(f-t.y)/t.k,s/t.k],[(a-i.x)/i.k,(f-i.y)/i.k,s/i.k]);return function(e){var r=l(e),i=s/r[2];this.__chart__=t={x:a-r[0]*i,y:f-r[1]*i,k:i},O(n)}}).each("interrupt.zoom",function(){M(n)}).each("end.zoom",function(){M(n)}):(this.__chart__=t,A(n),O(n),M(n))})},S.translate=function(e){return arguments.length?(t={x:+e[0],y:+e[1],k:t.k},L(),S):[t.x,t.y]},S.scale=function(e){return arguments.length?(t={x:t.x,y:t.y,k:null},N(+e),L(),S):t.k},S.scaleExtent=function(e){return arguments.length?(a=e==null?$t:[+e[0],+e[1]],S):a},S.center=function(e){return arguments.length?(s=e&&[+e[0],+e[1]],S):s},S.size=function(e){return arguments.length?(u=e&&[+e[0],+e[1]],S):u},S.duration=function(e){return arguments.length?(f=+e,S):f},S.x=function(e){return arguments.length?(b=e,y=e.copy(),t={x:0,y:0,k:1},S):b},S.y=function(e){return arguments.length?(E=e,w=e.copy(),t={x:0,y:0,k:1},S):E},e.rebind(S,g,"on")};var $t=[0,Infinity],Jt,Kt;e.color=Qt,Qt.prototype.toString=function(){return this.rgb()+""},e.hsl=Gt;var Yt=Gt.prototype=new Qt;Yt.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Gt(this.h,this.s,this.l/e)},Yt.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Gt(this.h,this.s,e*this.l)},Yt.rgb=function(){return Zt(this.h,this.s,this.l)},e.hcl=en;var tn=en.prototype=new Qt;tn.brighter=function(e){return new en(this.h,this.c,Math.min(100,this.l+sn*(arguments.length?e:1)))},tn.darker=function(e){return new en(this.h,this.c,Math.max(0,this.l-sn*(arguments.length?e:1)))},tn.rgb=function(){return nn(this.h,this.c,this.l).rgb()},e.lab=rn;var sn=18,on=.95047,un=1,an=1.08883,fn=rn.prototype=new Qt;fn.brighter=function(e){return new rn(Math.min(100,this.l+sn*(arguments.length?e:1)),this.a,this.b)},fn.darker=function(e){return new rn(Math.max(0,this.l-sn*(arguments.length?e:1)),this.a,this.b)},fn.rgb=function(){return ln(this.l,this.a,this.b)},e.rgb=vn;var yn=vn.prototype=new Qt;yn.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,i=30;return!t&&!n&&!r?new vn(i,i,i):(t&&t<i&&(t=i),n&&n<i&&(n=i),r&&r<i&&(r=i),new vn(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e)))},yn.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new vn(e*this.r,e*this.g,e*this.b)},yn.hsl=function(){return En(this.r,this.g,this.b)},yn.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var Nn=e.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:1674427
,f,c,p,w,E,S,x,T;for(f=0;f<s;++f){c=v[f],p=c.source,w=c.target,x=w.x-p.x,T=w.y-p.y;if(E=x*x+T*T)E=o*g[f]*((E=Math.sqrt(E))-m[f])/E,x*=E,T*=E,w.x-=x*(S=p.weight+w.weight?p.weight/(p.weight+w.weight):.5),w.y-=T*S,p.x+=x*(S=1-S),p.y+=T*S}if(S=o*h){x=i[0]/2,T=i[1]/2,f=-1;if(S)while(++f<t)c=d[f],c.x+=(x-c.x)*S,c.y+=(T-c.y)*S}if(l){vu(a=e.geom.quadtree(d),o,y),f=-1;while(++f<t)(c=d[f]).fixed||a.visit(b(c))}f=-1;while(++f<t)c=d[f],c.fixed?(c.x=c.px,c.y=c.py):(c.x-=(c.px-(c.px=c.x))*u,c.y-=(c.py-(c.py=c.y))*u);n.tick({type:"tick",alpha:o})},t.nodes=function(e){return arguments.length?(d=e,t):d},t.links=function(e){return arguments.length?(v=e,t):v},t.size=function(e){return arguments.length?(i=e,t):i},t.linkDistance=function(e){return arguments.length?(a=typeof e=="function"?e:+e,t):a},t.distance=t.linkDistance,t.linkStrength=function(e){return arguments.length?(f=typeof e=="function"?e:+e,t):f},t.friction=function(e){return arguments.length?(u=+e,t):u},t.charge=function(e){return arguments.length?(l=typeof e=="function"?e:+e,t):l},t.chargeDistance=function(e){return arguments.length?(c=e*e,t):Math.sqrt(c)},t.gravity=function(e){return arguments.length?(h=+e,t):h},t.theta=function(e){return arguments.length?(p=e*e,t):Math.sqrt(p)},t.alpha=function(e){return arguments.length?(e=+e,o?e>0?o=e:(r.c=null,r.t=NaN,r=null,n.end({type:"end",alpha:o=0})):e>0&&(n.start({type:"start",alpha:o=e}),r=Bn(t.tick)),t):o},t.start=function(){function h(t,i){if(!u){u=new Array(n);for(a=0;a<n;++a)u[a]=[];for(a=0;a<r;++a){var s=v[a];u[s.source.index].push(s.target),u[s.target.index].push(s.source)}}var o=u[e],a=-1,f=o.length,l;while(++a<f)if(!isNaN(l=o[a][t]))return l;return Math.random()*i}var e,n=d.length,r=v.length,s=i[0],o=i[1],u,c;for(e=0;e<n;++e)(c=d[e]).index=e,c.weight=0;for(e=0;e<r;++e)c=v[e],typeof c.source=="number"&&(c.source=d[c.source]),typeof c.target=="number"&&(c.target=d[c.target]),++c.source.weight,++c.target.weight;for(e=0;e<n;++e)c=d[e],isNaN(c.x)&&(c.x=h("x",s)),isNaN(c.y)&&(c.y=h("y",o)),isNaN(c.px)&&(c.px=c.x),isNaN(c.py)&&(c.py=c.y);m=[];if(typeof a=="function")for(e=0;e<r;++e)m[e]=+a.call(this,v[e],e);else for(e=0;e<r;++e)m[e]=a;g=[];if(typeof f=="function")for(e=0;e<r;++e)g[e]=+f.call(this,v[e],e);else for(e=0;e<r;++e)g[e]=f;y=[];if(typeof l=="function")for(e=0;e<n;++e)y[e]=+l.call(this,d[e],e);else for(e=0;e<n;++e)y[e]=l;return t.resume()},t.resume=function(){return t.alpha(.1)},t.stop=function(){return t.alpha(0)},t.drag=function(){s||(s=e.behavior.drag().origin(P).on("dragstart.force",cu).on("drag.force",w).on("dragend.force",hu));if(!arguments.length)return s;this.on("mouseover.force",pu).on("mouseout.force",du).call(s)},e.rebind(t,n,"on")};var mu=20,gu=1,yu=Infinity;e.layout.hierarchy=function(){function r(i){var s=[i],o=[],u;i.depth=0;while((u=s.pop())!=null){o.push(u);if((f=t.call(r,u,u.depth))&&(a=f.length)){var a,f,l;while(--a>=0)s.push(l=f[a]),l.parent=u,l.depth=u.depth+1;n&&(u.value=0),u.children=f}else n&&(u.value=+n.call(r,u,u.depth)||0),delete u.children}return Eu(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),o}var e=Tu,t=Su,n=xu;return r.sort=function(t){return arguments.length?(e=t,r):e},r.children=function(e){return arguments.length?(t=e,r):t},r.value=function(e){return arguments.length?(n=e,r):n},r.revalue=function(e){return n&&(wu(e,function(e){e.children&&(e.value=0)}),Eu(e,function(e){var t;e.children||(e.value=+n.call(r,e,e.depth)||0);if(t=e.parent)t.value+=e.value})),e},r},e.layout.partition=function(){function r(e,t,n,i){var s=e.children;e.x=t,e.y=e.depth*i,e.dx=n,e.dy=i;if(s&&(u=s.length)){var o=-1,u,a,f;n=e.value?n/e.value:0;while(++o<u)r(a=s[o],t,f=a.value*n,i),t+=f}}function i(e){var t=e.children,n=0;if(t&&(s=t.length)){var r=-1,s;while(++r<s)n=Math.max(n,i(t[r]))}return 1+n}function s(e,s){var o=t.call(this,e,s);return r(o[0],0,n[0],n[1]/i(o[0])),o}var t=e.layout.hierarchy(),n=[1,1];return s.size=function(e){return arguments.length?(n=e,s):n},bu(s,t)},e.layout.pie=function(){function o(u){var a=u.length,f=u.map(function(e,n){return+t.call(o,e,n)}),l=+(t
)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*36e5)},function(e){return e.getHours()}),$n.hours=$n.hour.range,$n.hours.utc=$n.hour.utc.range,$n.month=Gn(function(e){return e=$n.day(e),e.setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),$n.months=$n.month.range,$n.months.utc=$n.month.utc.range;var Yf=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Zf=[[$n.second,1],[$n.second,5],[$n.second,15],[$n.second,30],[$n.minute,1],[$n.minute,5],[$n.minute,15],[$n.minute,30],[$n.hour,1],[$n.hour,3],[$n.hour,6],[$n.hour,12],[$n.day,1],[$n.day,2],[$n.week,1],[$n.month,1],[$n.month,3],[$n.year,1]],el=Vf.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&e.getDate()!=1}],["%b %d",function(e){return e.getDate()!=1}],["%B",function(e){return e.getMonth()}],["%Y",ai]]),tl={range:function(t,n,r){return e.range(Math.ceil(t/r)*r,+n,r).map(Gf)},floor:P,ceil:P};Zf.year=$n.year,$n.scale=function(){return Qf(e.scale.linear(),Zf,el)};var nl=Zf.map(function(e){return[e[0].utc,e[1]]}),rl=$f.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&e.getUTCDate()!=1}],["%b %d",function(e){return e.getUTCDate()!=1}],["%B",function(e){return e.getUTCMonth()}],["%Y",ai]]);nl.year=$n.year.utc,$n.scale.utc=function(){return Qf(e.scale.linear(),nl,rl)},e.text=kn(function(e){return e.responseText}),e.json=function(e,t){return Ln(e,"application/json",il,t)},e.html=function(e,t){return Ln(e,"text/html",sl,t)},e.xml=kn(function(e){return e.responseXML}),typeof define=="function"&&define.amd?(this.d3=e,define(e)):typeof t=="object"&&t.exports?t.exports=e:this.d3=e}()},{}],84:[function(e,t,n){!function(){var n={Burg:{2:["#ffc6c4","#672044"],3:["#ffc6c4","#cc607d","#672044"],4:["#ffc6c4","#e38191","#ad466c","#672044"],5:["#ffc6c4","#ee919b","#cc607d","#9e3963","#672044"],6:["#ffc6c4","#f29ca3","#da7489","#b95073","#93345d","#672044"],7:["#ffc6c4","#f4a3a8","#e38191","#cc607d","#ad466c","#8b3058","#672044"],tags:["quantitative"]},BurgYl:{2:["#fbe6c5","#70284a"],3:["#fbe6c5","#dc7176","#70284a"],4:["#fbe6c5","#ee8a82","#c8586c","#70284a"],5:["#fbe6c5","#f2a28a","#dc7176","#b24b65","#70284a"],6:["#fbe6c5","#f4b191","#e7807d","#d06270","#a44360","#70284a"],7:["#fbe6c5","#f5ba98","#ee8a82","#dc7176","#c8586c","#9c3f5d","#70284a"],tags:["quantitative"]},RedOr:{2:["#f6d2a9","#b13f64"],3:["#f6d2a9","#ea8171","#b13f64"],4:["#f6d2a9","#f19c7c","#dd686c","#b13f64"],5:["#f6d2a9","#f3aa84","#ea8171","#d55d6a","#b13f64"],6:["#f6d2a9","#f4b28a","#ef9177","#e3726d","#cf5669","#b13f64"],7:["#f6d2a9","#f5b78e","#f19c7c","#ea8171","#dd686c","#ca5268","#b13f64"],tags:["quantitative"]},OrYel:{2:["#ecda9a","#ee4d5a"],3:["#ecda9a","#f7945d","#ee4d5a"],4:["#ecda9a","#f3ad6a","#f97b57","#ee4d5a"],5:["#ecda9a","#f1b973","#f7945d","#f86f56","#ee4d5a"],6:["#ecda9a","#f0c079","#f5a363","#f98558","#f76856","#ee4d5a"],7:["#ecda9a","#efc47e","#f3ad6a","#f7945d","#f97b57","#f66356","#ee4d5a"],tags:["quantitative"]},Peach:{2:["#fde0c5","#eb4a40"],3:["#fde0c5","#f59e72","#eb4a40"],4:["#fde0c5","#f8b58b","#f2855d","#eb4a40"],5:["#fde0c5","#f9c098","#f59e72","#f17854","#eb4a40"],6:["#fde0c5","#fac7a1","#f7ac80","#f38f65","#f0704f","#eb4a40"],7:["#fde0c5","#facba6","#f8b58b","#f59e72","#f2855d","#ef6a4c","#eb4a40"],tags:["quantitative"]},PinkYl:{2:["#fef6b5","#e15383"],3:["#fef6b5","#ffa679","#e15383"],4:["#fef6b5","#ffc285","#fa8a76","#e15383"],5:["#fef6b5","#ffd08e","#ffa679","#f67b77","#e15383"],6:["#fef6b5","#ffd795","#ffb77f","#fd9576","#f37378","#e15383"],7:["#fef6b5","#ffdd9a","#ffc285","#ffa679","#fa8a76","#f16d7a","#e15383"],tags:["quantitative"]},Mint:{2:["#e4f1e1","#0d585f"],3:["#e4f1e1","#63a6a0","#0d585f"],4:["#e4f1e1","#89c0b6","#448c8
,"#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}};typeof define=="function"&&define.amd?define(e):typeof t=="object"&&t.exports?t.exports=e:this.colorbrewer=e}()},{}],87:[function(e,t,n){t.exports=e("./colorbrewer.js")},{"./colorbrewer.js":86}],88:[function(e,t,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function i(){var e=arguments,t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff);if(!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0,s=0;return e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++,"%c"===e&&(s=i)}),e.splice(s,0,r),e}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(t){}}function u(){var e;try{e=n.storage.debug}catch(t){}return e}function a(){try{return window.localStorage}catch(e){}}n=t.exports=e("./debug"),n.log=s,n.formatArgs=i,n.save=o,n.load=u,n.useColors=r,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:a(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(u())},{"./debug":89}],89:[function(e,t,n){function s(){return n.colors[r++%n.colors.length]}function o(e){function t(){}function r(){var e=r,t=+(new Date),o=t-(i||t);e.diff=o,e.prev=i,e.curr=t,i=t,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=s());var u=Array.prototype.slice.call(arguments);u[0]=n.coerce(u[0]),"string"!=typeof u[0]&&(u=["%o"].conca
t,n,r,this.css,this.file,i.plugin),o.input={line:n,column:r,source:this.css},this.file&&(o.input.file=this.file),o},e.prototype.origin=function(t,n){if(!this.map)return!1;var r=this.map.consumer(),i=r.originalPositionFor({line:t,column:n});if(!i.source)return!1;var s={file:this.mapResolve(i.source),line:i.line,column:i.column},o=r.sourceContentFor(i.source);return o&&(s.source=o),s},e.prototype.mapResolve=function(t){return f.default.resolve(this.map.consumer().sourceRoot||".",t)},r(e,[{key:"from",get:function(){return this.file||this.id}}]),e}();n.default=p,t.exports=n["default"]},{"./css-syntax-error":100,"./previous-map":110,path:41}],103:[function(e,t,n){"use strict";function v(e){return e&&e.__esModule?e:{"default":e}}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e){return(typeof e=="undefined"?"undefined":i(e))==="object"&&typeof e.then=="function"}n.__esModule=!0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol?"symbol":typeof e},s=e("./map-generator"),o=v(s),u=e("./stringify"),a=v(u),f=e("./warn-once"),l=v(f),c=e("./result"),h=v(c),p=e("./parse"),d=v(p),y=function(){function e(t,n,r){m(this,e),this.stringified=!1,this.processed=!1;var s=undefined;if((typeof n=="undefined"?"undefined":i(n))==="object"&&n.type==="root")s=n;else if(n instanceof e||n instanceof h.default)s=n.root,n.map&&(typeof r.map=="undefined"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var o=d.default;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{s=o(n,r)}catch(u){this.error=u}}this.result=new h.default(t,s,r)}return e.prototype.warnings=function(){return this.sync().warnings()},e.prototype.toString=function t(){return this.css},e.prototype.then=function(t,n){return this.async().then(t,n)},e.prototype.catch=function(t){return this.async().catch(t)},e.prototype.handleError=function(t,n){try{this.error=t;if(t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion){var r=n.postcssPlugin,i=n.postcssVersion,s=this.result.processor.version,o=i.split("."),u=s.split(".");(o[0]!==u[0]||parseInt(o[1])>parseInt(u[1]))&&(0,l.default)("Your current PostCSS version is "+s+", but "+r+" "+"uses "+i+". Perhaps this is "+"the source of the error below.")}}catch(a){console&&console.error&&console.error(a)}},e.prototype.asyncTick=function(t,n){var r=this;if(this.plugin>=this.processor.plugins.length)return this.processed=!0,t();try{(function(){var e=r.processor.plugins[r.plugin],i=r.run(e);r.plugin+=1,g(i)?i.then(function(){r.asyncTick(t,n)}).catch(function(t){r.handleError(t,e),r.processed=!0,n(t)}):r.asyncTick(t,n)})()}catch(i){this.processed=!0,n(i)}},e.prototype.async=function(){var t=this;return this.processed?new Promise(function(e,n){t.error?n(t.error):e(t.stringify())}):this.processing?this.processing:(this.processing=(new Promise(function(e,n){if(t.error)return n(t.error);t.plugin=0,t.asyncTick(e,n)})).then(function(){return t.processed=!0,t.stringify()}),this.processing)},e.prototype.sync=function(){if(this.processed)return this.result;this.processed=!0;if(this.processing)throw new Error("Use process(css).then(cb) to work with async plugins");if(this.error)throw this.error;for(var t=this.result.processor.plugins,n=Array.isArray(t),r=0,t=n?t:t[Symbol.iterator]();;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{r=t.next();if(r.done)break;i=r.value}var s=i,o=this.run(s);if(g(o))throw new Error("Use process(css).then(cb) to work with async plugins")}return this.result},e.prototype.run=function(t){this.result.lastPlugin=t;try{return t(this.result.root,this.result)}catch(n){throw this.handleError(n,t),n}},e.prototype.stringify=function(){if(this.str
,e.prototype.root=function(t){this.body(t),t.raws.after&&this.builder(t.raws.after)},e.prototype.comment=function(t){var n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+r+"*/",t)},e.prototype.decl=function(t,n){var r=this.raw(t,"between","colon"),i=t.prop+r+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),n&&(i+=";"),this.builder(i,t)},e.prototype.rule=function(t){this.block(t,this.rawValue(t,"selector"))},e.prototype.atrule=function(t,n){var r="@"+t.name,i=t.params?this.rawValue(t,"params"):"";typeof t.raws.afterName!="undefined"?r+=t.raws.afterName:i&&(r+=" ");if(t.nodes)this.block(t,r+i);else{var s=(t.raws.between||"")+(n?";":"");this.builder(r+i+s,t)}},e.prototype.body=function(t){var n=t.nodes.length-1;while(n>0){if(t.nodes[n].type!=="comment")break;n-=1}var r=this.raw(t,"semicolon");for(var i=0;i<t.nodes.length;i++){var s=t.nodes[i],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,n!==i||r)}},e.prototype.block=function(t,n){var r=this.raw(t,"between","beforeOpen");this.builder(n+r+"{",t,"start");var i=undefined;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")},e.prototype.raw=function(t,n,r){var o=undefined;r||(r=n);if(n){o=t.raws[n];if(typeof o!="undefined")return o}var u=t.parent;if(r==="before")if(!u||u.type==="root"&&u.first===t)return"";if(!u)return i[r];var a=t.root();a.rawCache||(a.rawCache={});if(typeof a.rawCache[r]!="undefined")return a.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);var f="raw"+s(r);return this[f]?o=this[f](a,t):a.walk(function(e){o=e.raws[n];if(typeof o!="undefined")return!1}),typeof o=="undefined"&&(o=i[r]),a.rawCache[r]=o,o},e.prototype.rawSemicolon=function(t){var n=undefined;return t.walk(function(e){if(e.nodes&&e.nodes.length&&e.last.type==="decl"){n=e.raws.semicolon;if(typeof n!="undefined")return!1}}),n},e.prototype.rawEmptyBody=function(t){var n=undefined;return t.walk(function(e){if(e.nodes&&e.nodes.length===0){n=e.raws.after;if(typeof n!="undefined")return!1}}),n},e.prototype.rawIndent=function(t){if(t.raws.indent)return t.raws.indent;var n=undefined;return t.walk(function(e){var r=e.parent;if(r&&r!==t&&r.parent&&r.parent===t&&typeof e.raws.before!="undefined"){var i=e.raws.before.split("\n");return n=i[i.length-1],n=n.replace(/[^\s]/g,""),!1}}),n},e.prototype.rawBeforeComment=function(t,n){var r=undefined;return t.walkComments(function(e){if(typeof e.raws.before!="undefined")return r=e.raws.before,r.indexOf("\n")!==-1&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"&&(r=this.raw(n,null,"beforeDecl")),r},e.prototype.rawBeforeDecl=function(t,n){var r=undefined;return t.walkDecls(function(e){if(typeof e.raws.before!="undefined")return r=e.raws.before,r.indexOf("\n")!==-1&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"&&(r=this.raw(n,null,"beforeRule")),r},e.prototype.rawBeforeRule=function(t){var n=undefined;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&typeof e.raws.before!="undefined")return n=e.raws.before,n.indexOf("\n")!==-1&&(n=n.replace(/[^\n]+$/,"")),!1}),n},e.prototype.rawBeforeClose=function(t){var n=undefined;return t.walk(function(e){if(e.nodes&&e.nodes.length>0&&typeof e.raws.after!="undefined")return n=e.raws.after,n.indexOf("\n")!==-1&&(n=n.replace(/[^\n]+$/,"")),!1}),n},e.prototype.rawBeforeOpen=function(t){var n=undefined;return t.walk(function(e){if(e.type!=="decl"){n=e.raws.between;if(typeof n!="undefined")return!1}}),n},e.prototype.rawColon=function(t){var n=undefined;return t.walkDecls(function(e){if(typeof e.raws.between!="undefined")return n=e.raws.between.replace(/[^\s:]/g,""),!1}),n},e.prototype.beforeAfter=function(t,n){var r=undefined;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");var i=t.parent,s=0;while(i&&i.type!=="root")s+=1,i=i.parent;if(r.indexOf("\n")!==-1){var o=this.raw(t,null,"in
.toStringWithSourceMap=function(t){var n={code:"",line:1,column:0},i=new r(t),s=!1,u=null,a=null,f=null,l=null;return this.walk(function(e,t){n.code+=e,t.source!==null&&t.line!==null&&t.column!==null?((u!==t.source||a!==t.line||f!==t.column||l!==t.name)&&i.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column},name:t.name}),u=t.source,a=t.line,f=t.column,l=t.name,s=!0):s&&(i.addMapping({generated:{line:n.line,column:n.column}}),u=null,s=!1);for(var r=0,c=e.length;r<c;r++)e.charCodeAt(r)===o?(n.line++,n.column=0,r+1===c?(u=null,s=!1):s&&i.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column},name:t.name})):n.column++}),this.walkSourceContents(function(e,t){i.setSourceContent(e,t)}),{code:n.code,map:i}},n.SourceNode=a},{"./source-map-generator":129,"./util":131}],131:[function(e,t,n){function r(e,t,n){if(t in e)return e[t];if(arguments.length===3)return n;throw new Error('"'+t+'" is a required argument.')}function o(e){var t=e.match(i);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function u(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var t=e,r=o(e);if(r){if(!r.path)return e;t=r.path}var i=n.isAbsolute(t),s=t.split(/\/+/);for(var a,f=0,l=s.length-1;l>=0;l--)a=s[l],a==="."?s.splice(l,1):a===".."?f++:f>0&&(a===""?(s.splice(l+1,f),f=0):(s.splice(l,2),f--));return t=s.join("/"),t===""&&(t=i?"/":"."),r?(r.path=t,u(r)):t}function f(e,t){e===""&&(e="."),t===""&&(t=".");var n=o(t),r=o(e);r&&(e=r.path||"/");if(n&&!n.scheme)return r&&(n.scheme=r.scheme),u(n);if(n||t.match(s))return t;if(r&&!r.host&&!r.path)return r.host=t,u(r);var i=t.charAt(0)==="/"?t:a(e.replace(/\/+$/,"")+"/"+t);return r?(r.path=i,u(r)):i}function l(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");var n=0;while(t.indexOf(e+"/")!==0){var r=e.lastIndexOf("/");if(r<0)return t;e=e.slice(0,r);if(e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function h(e){return e}function p(e){return v(e)?"$"+e:e}function d(e){return v(e)?e.slice(1):e}function v(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var n=t-10;n>=0;n--)if(e.charCodeAt(n)!==36)return!1;return!0}function m(e,t,n){var r=e.source-t.source;return r!==0?r:(r=e.originalLine-t.originalLine,r!==0?r:(r=e.originalColumn-t.originalColumn,r!==0||n?r:(r=e.generatedColumn-t.generatedColumn,r!==0?r:(r=e.generatedLine-t.generatedLine,r!==0?r:e.name-t.name))))}function g(e,t,n){var r=e.generatedLine-t.generatedLine;return r!==0?r:(r=e.generatedColumn-t.generatedColumn,r!==0||n?r:(r=e.source-t.source,r!==0?r:(r=e.originalLine-t.originalLine,r!==0?r:(r=e.originalColumn-t.originalColumn,r!==0?r:e.name-t.name))))}function y(e,t){return e===t?0:e>t?1:-1}function b(e,t){var n=e.generatedLine-t.generatedLine;return n!==0?n:(n=e.generatedColumn-t.generatedColumn,n!==0?n:(n=y(e.source,t.source),n!==0?n:(n=e.originalLine-t.originalLine,n!==0?n:(n=e.originalColumn-t.originalColumn,n!==0?n:y(e.name,t.name)))))}n.getArg=r;var i=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,s=/^data:.+\,.+$/;n.urlParse=o,n.urlGenerate=u,n.normalize=a,n.join=f,n.isAbsolute=function(e){return e.charAt(0)==="/"||!!e.match(i)},n.relative=l;var c=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=c?h:p,n.fromSetString=c?h:d,n.compareByOriginalPositions=m,n.compareByGeneratedPositionsDeflated=g,n.compareByGeneratedPositionsInflated=b},{}],132:[function(e,t,n){n.SourceMapGenerator=e("./lib/source-map-generator").SourceMapGenerator,n.SourceMapConsumer=e("./lib/source-map-consumer").SourceMapConsumer,n.SourceNode=e("./lib/source-node").SourceNode},{"./lib/source-map-consumer":128,"./lib/source-map-generator"
}function E(e,t){var n=o(e),r=p(e),i=Math.sqrt(e.length);return(n-t)/(r/i)}function S(e,t,n){var r=e.length,i=t.length;if(!r||!i)return null;n||(n=0);var s=o(e),u=o(t),a=((r-1)*v(e)+(i-1)*v(t))/(r+i-2);return(s-u-n)/Math.sqrt(a*(1/r+1/i))}function x(e,t){var n=[];if(t<=0)return null;for(var r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function T(e,t){t=t||Math.random;var n=e.length,r,i;while(n>0)i=Math.floor(t()*n--),r=e[n],e[n]=e[i],e[i]=r;return e}function N(e,t){return e=e.slice(),T(e.slice(),t)}function C(e,t,n){var r=N(e,n);return r.slice(0,t)}function k(e,t){var n=e.length*t;return t<0||t>1?null:t===1?e[e.length-1]:t===0?e[0]:n%1!==0?e[Math.ceil(n)-1]:e.length%2===0?(e[n-1]+e[n])/2:e[n]}function L(e,t){if(e.length===0)return null;var n=e.slice().sort(function(e,t){return e-t});if(t.length){var r=[];for(var i=0;i<t.length;i++)r[i]=k(n,t[i]);return r}return k(n,t)}function A(e){return e.length===0?null:L(e,.75)-L(e,.25)}function O(e){if(!e||e.length===0)return null;var t=b(e),n=[];for(var r=0;r<e.length;r++)n.push(Math.abs(e[r]-t));return b(n)}function M(e,t){var n=[],r=[],i,s,o=0;for(i=0;i<e.length+1;i++){var u=[],a=[];for(s=0;s<t+1;s++)u.push(0),a.push(0);n.push(u),r.push(a)}for(i=1;i<t+1;i++){n[1][i]=1,r[1][i]=0;for(s=2;s<e.length+1;s++)r[s][i]=Infinity}for(var f=2;f<e.length+1;f++){var l=0,c=0,h=0,p=0;for(var d=1;d<f+1;d++){var v=f-d+1,m=e[v-1];h++,l+=m,c+=m*m,o=c-l*l/h,p=v-1;if(p!==0)for(s=2;s<t+1;s++)r[f][s]>=o+r[p][s-1]&&(n[f][s]=v,r[f][s]=o+r[p][s-1])}n[f][1]=1,r[f][1]=o}return{lower_class_limits:n,variance_combinations:r}}function _(e,t,n){var r=e.length,i=[],s=n;i[n]=e[e.length-1];while(s>0)i[s-1]=e[t[r][s]-1],r=t[r][s]-1,s--;return i}function D(e,t){if(t>e.length)return null;e=e.slice().sort(function(e,t){return e-t});var n=M(e,t),r=n.lower_class_limits;return _(e,r,t)}function P(e){if(e.length<3)return null;var t=e.length,n=Math.pow(m(e),3),r=d(e,3);return t*r/((t-1)*(t-2)*n)}function B(e){var t=1/(1+.5*Math.abs(e)),n=t*Math.exp(-Math.pow(e,2)-1.26551223+1.00002368*t+.37409196*Math.pow(t,2)+.09678418*Math.pow(t,3)-.18628806*Math.pow(t,4)+.27886807*Math.pow(t,5)-1.13520398*Math.pow(t,6)+1.48851587*Math.pow(t,7)-.82215223*Math.pow(t,8)+.17087277*Math.pow(t,9));return e>=0?1-n:n-1}function j(e){var t=Math.abs(e),n=Math.min(Math.round(t*100),H.length-1);return e>=0?H[n]:+(1-H[n]).toFixed(4)}function F(e,t,n){return(e-t)/n}function q(e){if(e<0)return null;var t=1;for(var n=2;n<=e;n++)t*=n;return t}function R(e,t){function n(e,t,n){return q(t)/(q(e)*q(t-e))*Math.pow(n,e)*Math.pow(1-n,t-e)}if(t<0||t>1||e<=0||e%1!==0)return null;var r=0,i=0,s={};do s[r]=n(r,e,t),i+=s[r],r++;while(i<1-I);return s}function U(e){return e<0||e>1?null:R(1,e)}function z(e){function i(e,t){return Math.pow(Math.E,-t)*Math.pow(t,e)/q(e)}if(e<=0)return null;var t=0,n=0,r={};do r[t]=i(t,e),n+=r[t],t++;while(n<1-I);return r}function X(e,t,n){var r=o(e),i=0,s,u=1,a=t(r),f=[],l=[],c;for(var h=0;h<e.length;h++)f[e[h]]===undefined&&(f[e[h]]=0),f[e[h]]++;for(h=0;h<f.length;h++)f[h]===undefined&&(f[h]=0);for(c in a)c in f&&(l[c]=a[c]*e.length);for(c=l.length-1;c>=0;c--)l[c]<3&&(l[c-1]+=l[c],l.pop(),f[c-1]+=f[c],f.pop());for(c=0;c<f.length;c++)i+=Math.pow(f[c]-l[c],2)/l[c];return s=f.length-u-1,W[s][n]<i}function V(t){function i(t){return function(){var n=Array.prototype.slice.apply(arguments);return n.unshift(this),e[t].apply(e,n)}}var n=!!Object.defineProperty&&!!Object.defineProperties;if(!n)throw new Error("without defineProperty, simple-statistics cannot be mixed in");var r=["median","standard_deviation","sum","sample_skewness","mean","min","max","quantile","geometric_mean","harmonic_mean","root_mean_square"],s;t?s=t.slice():s=Array.prototype;for(var o=0;o<r.length;o++)Object.defineProperty(s,r[o],{value:i(r[o]),configurable:!0,enumerable:!1,writable:!0});return s}var e={};typeof t!="undefined"?t.exports=e:this.ss=e;var H=[.5,.504,.508,.512,.516,.5199,.5239,.5279,.5319,.5359,.5398,.5438,.5478,.5517,.5557,.5596,.5636,.5675,.5714,.5753,.5793,.5832,.5871,.591,.5948,.5987,.6026,.6064,.6103,.6141,.6179,.6217,.6255,.6293,.6331,.6368,.6406,.6