diff --git a/GraphEditor/README.md b/GraphEditor/README.md index 357abb1..439207a 100644 --- a/GraphEditor/README.md +++ b/GraphEditor/README.md @@ -4,6 +4,9 @@ Generate graph from text using mermaid ## Change logs +### v0.0.6-a +* Fix unable to export image from tainted canvas + ### v0.0.5-a * GraphEditor is now compatible with new AntOS API diff --git a/GraphEditor/build/debug/README.md b/GraphEditor/build/debug/README.md index 357abb1..439207a 100644 --- a/GraphEditor/build/debug/README.md +++ b/GraphEditor/build/debug/README.md @@ -4,6 +4,9 @@ Generate graph from text using mermaid ## Change logs +### v0.0.6-a +* Fix unable to export image from tainted canvas + ### v0.0.5-a * GraphEditor is now compatible with new AntOS API diff --git a/GraphEditor/build/debug/main.js b/GraphEditor/build/debug/main.js index 8372782..12cc6a6 100644 --- a/GraphEditor/build/debug/main.js +++ b/GraphEditor/build/debug/main.js @@ -1,4 +1,4 @@ -var t,e;(function(){var t;(t=class t extends this.OS.application.BaseApplication{constructor(t){super("GraphEditor",t)}main(){return mermaid.initialize({theme:"forest"}),this.currfile=this.args&&this.args.length>0?this.args[0].path.asFileHandle():"Untitled".asFileHandle(),this.currfile.dirty=!1,this.datarea=this.find("datarea"),this.preview=this.find("preview"),this.btctn=this.find("btn-container"),ace.config.set("basePath","/scripts/ace"),this.editor=ace.edit(this.datarea),this.editor.setOptions({enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,fontSize:"11pt"}),this.editor.getSession().setUseWrapMode(!0),this.editor.session.setMode("ace/mode/text"),this.editor.setTheme("ace/theme/monokai"),this.editor.on("input",()=>this.editormux?(this.editormux=!1,!1):this.currfile.dirty?void 0:this.currfile.dirty=!0),this.currfile.basename||(this.editormux=!0,this.editor.setValue(t.dummymermaid),this.renderSVG(!1)),this.editor.container.addEventListener("keydown",t=>{if(13===t.keyCode)return this.renderSVG(!0)},!0),this.bindKey("CTRL-R",()=>this.renderSVG(!1)),this.bindKey("ALT-G",()=>this.export("SVG")),this.bindKey("ALT-P",()=>this.export("PNG")),this.bindKey("ALT-N",()=>this.actionFile(this.name+"-New")),this.bindKey("ALT-O",()=>this.actionFile(this.name+"-Open")),this.bindKey("CTRL-S",()=>this.actionFile(this.name+"-Save")),this.bindKey("ALT-W",()=>this.actionFile(this.name+"-Saveas")),this.bindKey("CTRL-M",()=>this.svgToCanvas((function(){}))),this.on("hboxchange",()=>(this.editor.resize(),this.calibrate())),this.on("focus",()=>this.editor.focus()),this.find("btn-zoomin").onbtclick=t=>{if(this.pan)return this.pan.zoomIn()},this.find("btn-zoomout").onbtclick=t=>{if(this.pan)return this.pan.zoomOut()},this.find("btn-reset").onbtclick=t=>{if(this.pan)return this.pan.resetZoom()},this.open(this.currfile)}menu(){return[{text:"__(File)",nodes:[{text:"__(New)",dataid:this.name+"-New",shortcut:"A-N"},{text:"__(Open)",dataid:this.name+"-Open",shortcut:"A-O"},{text:"__(Save)",dataid:this.name+"-Save",shortcut:"C-S"},{text:"__(Save as)",dataid:this.name+"-Saveas",shortcut:"A-W"},{text:"__(Render)",dataid:this.name+"-Render",shortcut:"C-R"},{text:"__(Export as)",nodes:[{text:"SVG",shortcut:"A-G"},{text:"PNG",shortcut:"A-P"}],onchildselect:t=>this.export(t.data.item.data.text)}],onchildselect:t=>this.actionFile(t.data.item.data.dataid)}]}open(t){if("Untitled"!==t.path)return t.dirty=!1,t.read().then(e=>(this.currfile=t,this.editormux=!0,this.currfile.dirty=!1,this.editor.setValue(e),this.scheme.apptitle=""+this.currfile.basename,this.renderSVG(!1))).catch(t=>this.error(t.toString(),t))}save(t){return t.write("text/plain").then(e=>(t.dirty=!1,t.text=t.basename,this.scheme.apptitle=""+this.currfile.basename)).catch(t=>this.error(t.toString(),t))}actionFile(t){var e;switch(e=()=>this.openDialog("FileDialog",{title:__("Save as"),file:this.currfile}).then(t=>(this.currfile.setPath(`${t.file.path}/${t.name}`),this.save(this.currfile))).catch(t=>this.error(t.toString(),t)),t){case this.name+"-Open":return this.openDialog("FileDialog",{title:__("Open file")}).then((t,e)=>this.open(t.file.path.asFileHandle())).catch(t=>this.error(t.toString(),t));case this.name+"-Save":return this.currfile.cache=this.editor.getValue(),this.currfile.basename?this.save(this.currfile):e();case this.name+"-Saveas":return this.currfile.cache=this.editor.getValue(),e();case this.name+"-Render":return this.renderSVG(!1);case this.name+"-New":return this.currfile="Untitled".asFileHandle(),this.currfile.cache="",this.currfile.dirty=!1,this.editormux=!0,this.editor.setValue("")}}export(t){return this.openDialog("FileDialog",{title:__("Export as"),file:this.currfile}).then(e=>{var n,r;r=`${e.file.path}/${e.name}`.asFileHandle();try{switch(t){case"SVG":return r.cache=this.svgtext(),r.write("text/plain").then(t=>this.notify(__("File exported"))).catch(e=>this.error(__("Cannot export to {0}: {1}",t,e.toString()),e));case"PNG":return this.svgToCanvas(e=>{var n;try{return r.cache=e.toDataURL("image/png"),r.write("base64").then(t=>this.notify(__("File exported"))).catch(e=>this.error(__("Cannot export to {0}: {1}",t,e.toString()),e))}catch(t){return n=t,this.error(__("Cannot export to PNG in this browser: {0}",n.toString()),n)}})}}catch(t){return n=t,this.error(__("Cannot export: {0}",n.message),n)}}).catch(t=>this.error(t.toString(),t))}renderSVG(t){var e,n,r;n=Math.floor(1e5*Math.random())+1,r=this.editor.getValue();try{mermaid.parse(r)}catch(n){return e=n,void(t||this.error(__("Syntax error: {0}",e.toString()),e))}return mermaid.render("c"+n,r,(t,e)=>{var n;return this.preview.innerHTML=t,$(this.preview).append(this.btctn),this.calibrate(),n=$(this.preview).children("svg")[0],this.pan=svgPanZoom(n,{zoomEnabled:!0,controlIconsEnabled:!1,fit:!0,center:!0,minZoom:.1})},this.preview)}svgtext(){var t;return t=$(this.preview).children("svg")[0],$("g.label",t).each(t=>$(this).css("font-family","Ubuntu").css("font-size","13px")),$("text",t).each(t=>$(this).css("font-family","Ubuntu").css("font-size","13px")),(new XMLSerializer).serializeToString(t)}svgToCanvas(t){var e,n,r,i,a;return n=new Image,i=this.svgtext(),e=window.URL||window.webkitURL||window,r=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),a=e.createObjectURL(r),n.onload=()=>{var e;return(e=this.find("offscreen")).width=n.width,e.height=n.height,e.getContext("2d").drawImage(n,0,0,n.width,n.height),t(e)},n.src=a}calibrate(){var t,e;if(e=$(this.preview).children("svg")[0])return t=[$(this.preview).width(),$(this.preview).height()],$(e).attr("width",t[0]+"px"),$(e).attr("height",t[1]+"px")}cleanup(t){if(this.currfile&&this.currfile.dirty)return t.preventDefault(),this.ask({title:__("Quit"),text:__("Quit without saving ?")}).then(t=>{if(t)return this.currfile.dirty=!1,this.quit()})}}).dummymermaid="classDiagram\nClass01 <|-- AveryLongClass : Cool\nClass03 *-- Class04\nClass05 o-- Class06\nClass07 .. Class08\nClass09 --\x3e C2 : Where am i?\nClass09 --* C3\nClass09 --|> Class07\nClass07 : equals()\nClass07 : Object[] elementData\nClass01 : size()\nClass01 : int chimp\nClass01 : int gorilla\nClass08 <--\x3e C2: Cool label",t.dependencies=["os://scripts/ace/ace.js"],this.OS.register("GraphEditor",t)}).call(this),function t(e,n,r){function i(o,s){if(!n[o]){if(!e[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[o]={exports:{}};e[o][0].call(l.exports,(function(t){return i(e[o][1][t]||t)}),l,l.exports,t,e,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o=0;r--)this.eventListeners.hasOwnProperty(n[r])&&delete this.eventListeners[n[r]]}for(var i in this.eventListeners)(this.options.eventsListenerElement||this.svg).addEventListener(i,this.eventListeners[i],!1);this.options.mouseWheelZoomEnabled&&(this.options.mouseWheelZoomEnabled=!1,this.enableMouseWheelZoom())},u.prototype.enableMouseWheelZoom=function(){if(!this.options.mouseWheelZoomEnabled){var t=this;this.wheelListener=function(e){return t.handleMouseWheel(e)},r.on(this.options.eventsListenerElement||this.svg,this.wheelListener,!1),this.options.mouseWheelZoomEnabled=!0}},u.prototype.disableMouseWheelZoom=function(){this.options.mouseWheelZoomEnabled&&(r.off(this.options.eventsListenerElement||this.svg,this.wheelListener,!1),this.options.mouseWheelZoomEnabled=!1)},u.prototype.handleMouseWheel=function(t){if(this.options.zoomEnabled&&"none"===this.state){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1);var e=t.deltaY||1,n=Date.now()-this.lastMouseWheelEventTime,r=3+Math.max(0,30-n);this.lastMouseWheelEventTime=Date.now(),"deltaMode"in t&&0===t.deltaMode&&t.wheelDelta&&(e=0===t.deltaY?0:Math.abs(t.wheelDelta)/t.deltaY),e=-.30?1:-1)*Math.log(Math.abs(e)+10)/r;var i=this.svg.getScreenCTM().inverse(),a=o.getEventPoint(t,this.svg).matrixTransform(i),s=Math.pow(1+this.options.zoomScaleSensitivity,-1*e);this.zoomAtPoint(s,a)}},u.prototype.zoomAtPoint=function(t,e,n){var r=this.viewport.getOriginalState();n?(t=Math.max(this.options.minZoom*r.zoom,Math.min(this.options.maxZoom*r.zoom,t)),t/=this.getZoom()):this.getZoom()*tthis.options.maxZoom*r.zoom&&(t=this.options.maxZoom*r.zoom/this.getZoom());var i=this.viewport.getCTM(),a=e.matrixTransform(i.inverse()),o=this.svg.createSVGMatrix().translate(a.x,a.y).scale(t).translate(-a.x,-a.y),s=i.multiply(o);s.a!==i.a&&this.viewport.setCTM(s)},u.prototype.zoom=function(t,e){this.zoomAtPoint(t,o.getSvgCenterPoint(this.svg,this.width,this.height),e)},u.prototype.publicZoom=function(t,e){e&&(t=this.computeFromRelativeZoom(t)),this.zoom(t,e)},u.prototype.publicZoomAtPoint=function(t,e,n){if(n&&(t=this.computeFromRelativeZoom(t)),"SVGPoint"!==a.getType(e)){if(!("x"in e)||!("y"in e))throw new Error("Given point is invalid");e=o.createSVGPoint(this.svg,e.x,e.y)}this.zoomAtPoint(t,e,n)},u.prototype.getZoom=function(){return this.viewport.getZoom()},u.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()},u.prototype.computeFromRelativeZoom=function(t){return t*this.viewport.getOriginalState().zoom},u.prototype.resetZoom=function(){var t=this.viewport.getOriginalState();this.zoom(t.zoom,!0)},u.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())},u.prototype.reset=function(){this.resetZoom(),this.resetPan()},u.prototype.handleDblClick=function(t){var e;if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),this.options.controlIconsEnabled&&(t.target.getAttribute("class")||"").indexOf("svg-pan-zoom-control")>-1)return!1;e=t.shiftKey?1/(2*(1+this.options.zoomScaleSensitivity)):2*(1+this.options.zoomScaleSensitivity);var n=o.getEventPoint(t,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(e,n)},u.prototype.handleMouseDown=function(t,e){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),a.mouseAndTouchNormalize(t,this.svg),this.options.dblClickZoomEnabled&&a.isDblClick(t,e)?this.handleDblClick(t):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=o.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()))},u.prototype.handleMouseMove=function(t){if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),"pan"===this.state&&this.options.panEnabled){var e=o.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()),n=this.firstEventCTM.translate(e.x-this.stateOrigin.x,e.y-this.stateOrigin.y);this.viewport.setCTM(n)}},u.prototype.handleMouseUp=function(t){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),"pan"===this.state&&(this.state="none")},u.prototype.fit=function(){var t=this.viewport.getViewBox(),e=Math.min(this.width/t.width,this.height/t.height);this.zoom(e,!0)},u.prototype.contain=function(){var t=this.viewport.getViewBox(),e=Math.max(this.width/t.width,this.height/t.height);this.zoom(e,!0)},u.prototype.center=function(){var t=this.viewport.getViewBox(),e=.5*(this.width-(t.width+2*t.x)*this.getZoom()),n=.5*(this.height-(t.height+2*t.y)*this.getZoom());this.getPublicInstance().pan({x:e,y:n})},u.prototype.updateBBox=function(){this.viewport.simpleViewBoxCache()},u.prototype.pan=function(t){var e=this.viewport.getCTM();e.e=t.x,e.f=t.y,this.viewport.setCTM(e)},u.prototype.panBy=function(t){var e=this.viewport.getCTM();e.e+=t.x,e.f+=t.y,this.viewport.setCTM(e)},u.prototype.getPan=function(){var t=this.viewport.getState();return{x:t.x,y:t.y}},u.prototype.resize=function(){var t=o.getBoundingClientRectNormalized(this.svg);this.width=t.width,this.height=t.height;var e=this.viewport;e.options.width=this.width,e.options.height=this.height,e.processCTM(),this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())},u.prototype.destroy=function(){var t=this;for(var e in this.beforeZoom=null,this.onZoom=null,this.beforePan=null,this.onPan=null,this.onUpdatedCTM=null,null!=this.options.customEventsHandler&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()}),this.eventListeners)(this.options.eventsListenerElement||this.svg).removeEventListener(e,this.eventListeners[e],!1);this.disableMouseWheelZoom(),this.getPublicInstance().disableControlIcons(),this.reset(),l=l.filter((function(e){return e.svg!==t.svg})),delete this.options,delete this.viewport,delete this.publicInstance,delete this.pi,this.getPublicInstance=function(){return null}},u.prototype.getPublicInstance=function(){var t=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return t.options.panEnabled=!0,t.pi},disablePan:function(){return t.options.panEnabled=!1,t.pi},isPanEnabled:function(){return!!t.options.panEnabled},pan:function(e){return t.pan(e),t.pi},panBy:function(e){return t.panBy(e),t.pi},getPan:function(){return t.getPan()},setBeforePan:function(e){return t.options.beforePan=null===e?null:a.proxy(e,t.publicInstance),t.pi},setOnPan:function(e){return t.options.onPan=null===e?null:a.proxy(e,t.publicInstance),t.pi},enableZoom:function(){return t.options.zoomEnabled=!0,t.pi},disableZoom:function(){return t.options.zoomEnabled=!1,t.pi},isZoomEnabled:function(){return!!t.options.zoomEnabled},enableControlIcons:function(){return t.options.controlIconsEnabled||(t.options.controlIconsEnabled=!0,i.enable(t)),t.pi},disableControlIcons:function(){return t.options.controlIconsEnabled&&(t.options.controlIconsEnabled=!1,i.disable(t)),t.pi},isControlIconsEnabled:function(){return!!t.options.controlIconsEnabled},enableDblClickZoom:function(){return t.options.dblClickZoomEnabled=!0,t.pi},disableDblClickZoom:function(){return t.options.dblClickZoomEnabled=!1,t.pi},isDblClickZoomEnabled:function(){return!!t.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return t.enableMouseWheelZoom(),t.pi},disableMouseWheelZoom:function(){return t.disableMouseWheelZoom(),t.pi},isMouseWheelZoomEnabled:function(){return!!t.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(e){return t.options.zoomScaleSensitivity=e,t.pi},setMinZoom:function(e){return t.options.minZoom=e,t.pi},setMaxZoom:function(e){return t.options.maxZoom=e,t.pi},setBeforeZoom:function(e){return t.options.beforeZoom=null===e?null:a.proxy(e,t.publicInstance),t.pi},setOnZoom:function(e){return t.options.onZoom=null===e?null:a.proxy(e,t.publicInstance),t.pi},zoom:function(e){return t.publicZoom(e,!0),t.pi},zoomBy:function(e){return t.publicZoom(e,!1),t.pi},zoomAtPoint:function(e,n){return t.publicZoomAtPoint(e,n,!0),t.pi},zoomAtPointBy:function(e,n){return t.publicZoomAtPoint(e,n,!1),t.pi},zoomIn:function(){return this.zoomBy(1+t.options.zoomScaleSensitivity),t.pi},zoomOut:function(){return this.zoomBy(1/(1+t.options.zoomScaleSensitivity)),t.pi},getZoom:function(){return t.getRelativeZoom()},setOnUpdatedCTM:function(e){return t.options.onUpdatedCTM=null===e?null:a.proxy(e,t.publicInstance),t.pi},resetZoom:function(){return t.resetZoom(),t.pi},resetPan:function(){return t.resetPan(),t.pi},reset:function(){return t.reset(),t.pi},fit:function(){return t.fit(),t.pi},contain:function(){return t.contain(),t.pi},center:function(){return t.center(),t.pi},updateBBox:function(){return t.updateBBox(),t.pi},resize:function(){return t.resize(),t.pi},getSizes:function(){return{width:t.width,height:t.height,realZoom:t.getZoom(),viewBox:t.viewport.getViewBox()}},destroy:function(){return t.destroy(),t.pi}}),this.publicInstance};var l=[];e.exports=function(t,e){var n=a.getSvg(t);if(null===n)return null;for(var r=l.length-1;r>=0;r--)if(l[r].svg===n)return l[r].instance.getPublicInstance();return l.push({svg:n,instance:new u(n,e)}),l[l.length-1].instance.getPublicInstance()}},{"./control-icons":2,"./shadow-viewport":3,"./svg-utilities":5,"./uniwheel":6,"./utilities":7}],5:[function(t,e,n){var r=t("./utilities"),i="unknown";document.documentMode&&(i="ie"),e.exports={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(t){if(t.clientWidth&&t.clientHeight)return{width:t.clientWidth,height:t.clientHeight};if(t.getBoundingClientRect())return t.getBoundingClientRect();throw new Error("Cannot get BoundingClientRect for SVG.")},getOrCreateViewport:function(t,e){var n=null;if(!(n=r.isElement(e)?e:t.querySelector(e))){var i=Array.prototype.slice.call(t.childNodes||t.children).filter((function(t){return"defs"!==t.nodeName&&"#text"!==t.nodeName}));1===i.length&&"g"===i[0].nodeName&&null===i[0].getAttribute("transform")&&(n=i[0])}if(!n){var a="viewport-"+(new Date).toISOString().replace(/\D/g,"");(n=document.createElementNS(this.svgNS,"g")).setAttribute("id",a);var o=t.childNodes||t.children;if(o&&o.length>0)for(var s=o.length;s>0;s--)"defs"!==o[o.length-s].nodeName&&n.appendChild(o[o.length-s]);t.appendChild(n)}var u=[];return n.getAttribute("class")&&(u=n.getAttribute("class").split(" ")),~u.indexOf("svg-pan-zoom_viewport")||(u.push("svg-pan-zoom_viewport"),n.setAttribute("class",u.join(" "))),n},setupSvgAttributes:function(t){if(t.setAttribute("xmlns",this.svgNS),t.setAttributeNS(this.xmlnsNS,"xmlns:xlink",this.xlinkNS),t.setAttributeNS(this.xmlnsNS,"xmlns:ev",this.evNS),null!==t.parentNode){var e=t.getAttribute("style")||"";-1===e.toLowerCase().indexOf("overflow")&&t.setAttribute("style","overflow: hidden; "+e)}},internetExplorerRedisplayInterval:300,refreshDefsGlobal:r.throttle((function(){for(var t=document.querySelectorAll("defs"),e=t.length,n=0;ne?(clearTimeout(s),s=null,u=l,a=t.apply(r,i),s||(r=i=null)):s||!1===n.trailing||(s=setTimeout(c,f)),a}},createRequestAnimationFrame:function(t){var e=null;return"auto"!==t&&t<60&&t>1&&(e=Math.floor(1e3/t)),null===e?window.requestAnimationFrame||r(33):r(e)}}},{}]},{},[1]),t="undefined"!=typeof self?self:this,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=354)}([function(t,e,n){"use strict";n.r(e);var r=function(t,e){return te?1:t>=e?0:NaN},i=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return r(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)>0?i=a:r=a+1}return r}}},a=i(r),o=a.right,s=a.left,u=o,c=function(t,e){null==e&&(e=l);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);nt?1:e>=t?0:NaN},d=function(t){return null===t?NaN:+t},p=function(t,e){var n,r,i=t.length,a=0,o=-1,s=0,u=0;if(null==e)for(;++o1)return u/(a-1)},y=function(t,e){var n=p(t,e);return n?Math.sqrt(n):n},g=function(t,e){var n,r,i,a=t.length,o=-1;if(null==e){for(;++o=n)for(r=i=n;++on&&(r=n),i=n)for(r=i=n;++on&&(r=n),i0)return[t];if((r=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s=0?(a>=k?10:a>=E?5:a>=S?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=k?10:a>=E?5:a>=S?2:1)}function M(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=k?i*=10:a>=E?i*=5:a>=S&&(i*=2),ef;)h.pop(),--d;var p,y=new Array(d+1);for(i=0;i<=d;++i)(p=y[i]=[]).x0=i>0?h[i-1]:l,p.x1=i=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t);return o+(+n(t[a+1],a+1,t)-o)*(i-a)}},D=function(t,e,n){return t=b.call(t,d).sort(r),Math.ceil((n-e)/(2*(N(t,.75)-N(t,.25))*Math.pow(t.length,-1/3)))},L=function(t,e,n){return Math.ceil((n-e)/(3.5*y(t)*Math.pow(t.length,-1/3)))},F=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a=n)for(r=n;++ar&&(r=n)}else for(;++a=n)for(r=n;++ar&&(r=n);return r},P=function(t,e){var n,r=t.length,i=r,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(r=t[i]).length;--e>=0;)n[--o]=r[e];return n},B=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a=n)for(r=n;++an&&(r=n)}else for(;++a=n)for(r=n;++an&&(r=n);return r},j=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},z=function(t,e){if(n=t.length){var n,i,a=0,o=0,s=t[o];for(null==e&&(e=r);++a=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function ut(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),a=0;ae?1:t>=e?0:NaN}mt.prototype={constructor:mt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var _t="http://www.w3.org/1999/xhtml",wt={svg:"http://www.w3.org/2000/svg",xhtml:_t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},kt=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),wt.hasOwnProperty(e)?{space:wt[e],local:t}:t};function Et(t){return function(){this.removeAttribute(t)}}function St(t){return function(){this.removeAttributeNS(t.space,t.local)}}function At(t,e){return function(){this.setAttribute(t,e)}}function Tt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Mt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Ot(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var Ct=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function Nt(t){return function(){this.style.removeProperty(t)}}function Dt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Lt(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ft(t,e){return t.style.getPropertyValue(e)||Ct(t).getComputedStyle(t,null).getPropertyValue(e)}function Pt(t){return function(){delete this[t]}}function It(t,e){return function(){this[t]=e}}function Rt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Bt(t){return t.trim().split(/^|\s+/)}function jt(t){return t.classList||new zt(t)}function zt(t){this._node=t,this._names=Bt(t.getAttribute("class")||"")}function Yt(t,e){for(var n=jt(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ne=function(t){var e=kt(t);return(e.local?ee:te)(e)};function re(){return null}function ie(){var t=this.parentNode;t&&t.removeChild(this)}function ae(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function oe(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var se={},ue=null;function ce(t,e,n){return t=le(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function le(t,e,n){return function(r){var i=ue;ue=r;try{t.call(this,this.__data__,e,n)}finally{ue=i}}}function fe(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function he(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r=_&&(_=x+1);!(b=m[_])&&++_=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=xt);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==e?Nt:"function"==typeof e?Lt:Dt)(t,e,null==n?"":n)):Ft(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Pt:"function"==typeof e?Rt:It)(t,e)):this.node()[t]},classed:function(t,e){var n=Bt(t+"");if(arguments.length<2){for(var r=jt(this.node()),i=-1,a=n.length;++i>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new qe(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new qe(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Fe.exec(t))?new qe(e[1],e[2],e[3],1):(e=Pe.exec(t))?new qe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ie.exec(t))?Ge(e[1],e[2],e[3],e[4]):(e=Re.exec(t))?Ge(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Be.exec(t))?Qe(e[1],e[2]/100,e[3]/100,1):(e=je.exec(t))?Qe(e[1],e[2]/100,e[3]/100,e[4]):ze.hasOwnProperty(t)?Ve(ze[t]):"transparent"===t?new qe(NaN,NaN,NaN,0):null}function Ve(t){return new qe(t>>16&255,t>>8&255,255&t,1)}function Ge(t,e,n,r){return r<=0&&(t=e=n=NaN),new qe(t,e,n,r)}function We(t){return t instanceof Oe||(t=$e(t)),t?new qe((t=t.rgb()).r,t.g,t.b,t.opacity):new qe}function He(t,e,n,r){return 1===arguments.length?We(t):new qe(t,e,n,null==r?1:r)}function qe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ze(){return"#"+Je(this.r)+Je(this.g)+Je(this.b)}function Xe(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Je(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Qe(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new en(t,e,n,r)}function Ke(t){if(t instanceof en)return new en(t.h,t.s,t.l,t.opacity);if(t instanceof Oe||(t=$e(t)),!t)return new en;if(t instanceof en)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n0&&u<1?0:o,new en(o,s,u,t.opacity)}function tn(t,e,n,r){return 1===arguments.length?Ke(t):new en(t,e,n,null==r?1:r)}function en(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function nn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function rn(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}Te(Oe,$e,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ye,formatHex:Ye,formatHsl:function(){return Ke(this).formatHsl()},formatRgb:Ue,toString:Ue}),Te(qe,He,Me(Oe,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new qe(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new qe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ze,formatHex:Ze,formatRgb:Xe,toString:Xe})),Te(en,tn,Me(Oe,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new en(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new en(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new qe(nn(t>=240?t-240:t+120,i,r),nn(t,i,r),nn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var an=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r180||n<-180?n-360*Math.round(n/360):n):sn(isNaN(t)?e:t)}function ln(t,e){var n=e-t;return n?un(t,n):sn(isNaN(t)?e:t)}var fn=function t(e){var n=function(t){return 1==(t=+t)?ln:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):sn(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=He(t)).r,(e=He(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=ln(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function hn(t){return function(e){var n,r,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(n=0;na&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,u.push({i:o,x:wn(n,r)})),a=Sn.lastIndex;return a=0&&e._call.call(null,t),e=e._next;--Dn}function Gn(){In=(Pn=Bn.now())+Rn,Dn=Ln=0;try{Vn()}finally{Dn=0,function(){for(var t,e,n=bn,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:bn=e);xn=t,Hn(r)}(),In=0}}function Wn(){var t=Bn.now(),e=t-Pn;e>1e3&&(Rn-=e,Pn=t)}function Hn(t){Dn||(Ln&&(Ln=clearTimeout(Ln)),t-In>24?(t<1/0&&(Ln=setTimeout(Gn,t-Bn.now()-Rn)),Fn&&(Fn=clearInterval(Fn))):(Fn||(Pn=Bn.now(),Fn=setInterval(Wn,1e3)),Dn=1,jn(Gn)))}Un.prototype=$n.prototype={constructor:Un,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?zn():+n)+(null==e?0:+e),this._next||xn===this||(xn?xn._next=this:bn=this,xn=this),this._call=t,this._time=n,Hn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Hn())}};var qn=function(t,e,n){var r=new Un;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},Zn=lt("start","end","cancel","interrupt"),Xn=[],Jn=function(t,e,n,r,i,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(u){var c,l,f,h;if(1!==n.state)return s();for(c in i)if((h=i[c]).name===n.name){if(3===h.state)return qn(a);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+c0)throw new Error("too late; already scheduled");return n}function Kn(t,e){var n=tr(t,e);if(n.state>3)throw new Error("too late; already running");return n}function tr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var er,nr,rr,ir,ar=function(t,e){var n,r,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete t.__transition}},or=180/Math.PI,sr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},ur=function(t,e,n,r,i,a){var o,s,u;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:wn(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,s,u),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:wn(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,s,u),function(t,e,n,r,a,o){if(t!==n||e!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:wn(t,n)},{i:s-2,x:wn(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,u),a=o=null,function(t){for(var e,n=-1,r=u.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Qn:Kn;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}var Dr=_e.prototype.constructor;function Lr(t){return function(){this.style.removeProperty(t)}}function Fr(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Pr(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&Fr(t,a,n)),r}return a._value=e,a}function Ir(t){return function(e){this.textContent=t.call(this,e)}}function Rr(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Ir(r)),e}return r._value=t,r}var Br=0;function jr(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function zr(t){return _e().transition(t)}function Yr(){return++Br}var Ur=_e.prototype;function $r(t){return t*t*t}function Vr(t){return--t*t*t+1}function Gr(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}jr.prototype=zr.prototype={constructor:jr,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=ht(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o1&&n.name===e)return new jr([[t]],qr,e,+r);return null},Xr=function(t){return function(){return t}},Jr=function(t,e,n){this.target=t,this.type=e,this.selection=n};function Qr(){ue.stopImmediatePropagation()}var Kr=function(){ue.preventDefault(),ue.stopImmediatePropagation()},ti={name:"drag"},ei={name:"space"},ni={name:"handle"},ri={name:"center"};function ii(t){return[+t[0],+t[1]]}function ai(t){return[ii(t[0]),ii(t[1])]}function oi(t){return function(e){return Cn(e,ue.touches,t)}}var si={name:"x",handles:["w","e"].map(yi),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ui={name:"y",handles:["n","s"].map(yi),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},ci={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(yi),input:function(t){return null==t?null:ai(t)},output:function(t){return t}},li={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},fi={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},hi={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},di={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},pi={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function yi(t){return{type:t}}function gi(){return!ue.ctrlKey&&!ue.button}function mi(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function vi(){return navigator.maxTouchPoints||"ontouchstart"in this}function bi(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function xi(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function _i(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function wi(){return Si(si)}function ki(){return Si(ui)}var Ei=function(){return Si(ci)};function Si(t){var e,n=mi,r=gi,i=vi,a=!0,o=lt("start","brush","end"),s=6;function u(e){var n=e.property("__brush",y).selectAll(".overlay").data([yi("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",li.overlay).merge(n).each((function(){var t=bi(this).extent;we(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([yi("selection")]).enter().append("rect").attr("class","selection").attr("cursor",li.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return li[t.type]})),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=we(this),e=bi(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-s/2:e[0][0]-s/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-s/2:e[0][1]-s/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+s:s})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+s:s}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,e,n){return!n&&t.__brush.emitter||new f(t,e)}function f(t,e){this.that=t,this.args=e,this.state=t.__brush,this.active=0}function h(){if((!e||ue.touches)&&r.apply(this,arguments)){var n,i,o,s,u,f,h,d,p,y,g,m=this,v=ue.target.__data__.type,b="selection"===(a&&ue.metaKey?v="overlay":v)?ti:a&&ue.altKey?ri:ni,x=t===ui?null:di[v],_=t===si?null:pi[v],w=bi(m),k=w.extent,E=w.selection,S=k[0][0],A=k[0][1],T=k[1][0],M=k[1][1],O=0,C=0,N=x&&_&&a&&ue.shiftKey,D=ue.touches?oi(ue.changedTouches[0].identifier):Nn,L=D(m),F=L,P=l(m,arguments,!0).beforestart();"overlay"===v?(E&&(p=!0),w.selection=E=[[n=t===ui?S:L[0],o=t===si?A:L[1]],[u=t===ui?T:n,h=t===si?M:o]]):(n=E[0][0],o=E[0][1],u=E[1][0],h=E[1][1]),i=n,s=o,f=u,d=h;var I=we(m).attr("pointer-events","none"),R=I.selectAll(".overlay").attr("cursor",li[v]);if(ue.touches)P.moved=j,P.ended=Y;else{var B=we(ue.view).on("mousemove.brush",j,!0).on("mouseup.brush",Y,!0);a&&B.on("keydown.brush",U,!0).on("keyup.brush",$,!0),Se(ue.view)}Qr(),ar(m),c.call(m),P.start()}function j(){var t=D(m);!N||y||g||(Math.abs(t[0]-F[0])>Math.abs(t[1]-F[1])?g=!0:y=!0),F=t,p=!0,Kr(),z()}function z(){var t;switch(O=F[0]-L[0],C=F[1]-L[1],b){case ei:case ti:x&&(O=Math.max(S-n,Math.min(T-u,O)),i=n+O,f=u+O),_&&(C=Math.max(A-o,Math.min(M-h,C)),s=o+C,d=h+C);break;case ni:x<0?(O=Math.max(S-n,Math.min(T-n,O)),i=n+O,f=u):x>0&&(O=Math.max(S-u,Math.min(T-u,O)),i=n,f=u+O),_<0?(C=Math.max(A-o,Math.min(M-o,C)),s=o+C,d=h):_>0&&(C=Math.max(A-h,Math.min(M-h,C)),s=o,d=h+C);break;case ri:x&&(i=Math.max(S,Math.min(T,n-O*x)),f=Math.max(S,Math.min(T,u+O*x))),_&&(s=Math.max(A,Math.min(M,o-C*_)),d=Math.max(A,Math.min(M,h+C*_)))}f0&&(n=i-O),_<0?h=d-C:_>0&&(o=s-C),b=ei,R.attr("cursor",li.selection),z());break;default:return}Kr()}function $(){switch(ue.keyCode){case 16:N&&(y=g=N=!1,z());break;case 18:b===ri&&(x<0?u=f:x>0&&(n=i),_<0?h=d:_>0&&(o=s),b=ni,z());break;case 32:b===ei&&(ue.altKey?(x&&(u=f-O*x,n=i+O*x),_&&(h=d-C*_,o=s+C*_),b=ri):(x<0?u=f:x>0&&(n=i),_<0?h=d:_>0&&(o=s),b=ni),R.attr("cursor",li[v]),z());break;default:return}Kr()}}function d(){l(this,arguments).moved()}function p(){l(this,arguments).ended()}function y(){var e=this.__brush||{selection:null};return e.extent=ai(n.apply(this,arguments)),e.dim=t,e}return u.move=function(e,n){e.selection?e.on("start.brush",(function(){l(this,arguments).beforestart().start()})).on("interrupt.brush end.brush",(function(){l(this,arguments).end()})).tween("brush",(function(){var e=this,r=e.__brush,i=l(e,arguments),a=r.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,r.extent),s=Tn(a,o);function u(t){r.selection=1===t&&null===o?null:s(t),c.call(e),i.brush()}return null!==a&&null!==o?u:u(1)})):e.each((function(){var e=this,r=arguments,i=e.__brush,a=t.input("function"==typeof n?n.apply(e,r):n,i.extent),o=l(e,r).beforestart();ar(e),i.selection=null===a?null:a,c.call(e),o.start().brush().end()}))},u.clear=function(t){u.move(t,null)},f.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting?(this.starting=!1,this.emit("start")):this.emit("brush"),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){pe(new Jr(u,e,t.output(this.state.selection)),o.apply,o,[e,this.that,this.args])}},u.extent=function(t){return arguments.length?(n="function"==typeof t?t:Xr(ai(t)),u):n},u.filter=function(t){return arguments.length?(r="function"==typeof t?t:Xr(!!t),u):r},u.touchable=function(t){return arguments.length?(i="function"==typeof t?t:Xr(!!t),u):i},u.handleSize=function(t){return arguments.length?(s=+t,u):s},u.keyModifiers=function(t){return arguments.length?(a=!!t,u):a},u.on=function(){var t=o.on.apply(o,arguments);return t===o?u:t},u}var Ai=Math.cos,Ti=Math.sin,Mi=Math.PI,Oi=Mi/2,Ci=2*Mi,Ni=Math.max;function Di(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}var Li=function(){var t=0,e=null,n=null,r=null;function i(i){var a,o,s,u,c,l,f=i.length,h=[],d=w(f),p=[],y=[],g=y.groups=new Array(f),m=new Array(f*f);for(a=0,c=-1;++c1e-6)if(Math.abs(l*s-u*c)>1e-6&&i){var h=n-a,d=r-o,p=s*s+u*u,y=h*h+d*d,g=Math.sqrt(p),m=Math.sqrt(f),v=i*Math.tan((Ii-Math.acos((p+f-y)/(2*g*m)))/2),b=v/m,x=v/g;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*c)+","+(e+b*l)),this._+="A"+i+","+i+",0,0,"+ +(l*h>c*d)+","+(this._x1=t+x*s)+","+(this._y1=e+x*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,r,i,a){t=+t,e=+e,a=!!a;var o=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+o,c=e+s,l=1^a,f=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+u+","+c),n&&(f<0&&(f=f%Ri+Ri),f>Bi?this._+="A"+n+","+n+",0,1,"+l+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=Ii)+","+l+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Yi=zi;function Ui(t){return t.source}function $i(t){return t.target}function Vi(t){return t.radius}function Gi(t){return t.startAngle}function Wi(t){return t.endAngle}var Hi=function(){var t=Ui,e=$i,n=Vi,r=Gi,i=Wi,a=null;function o(){var o,s=Fi.call(arguments),u=t.apply(this,s),c=e.apply(this,s),l=+n.apply(this,(s[0]=u,s)),f=r.apply(this,s)-Oi,h=i.apply(this,s)-Oi,d=l*Ai(f),p=l*Ti(f),y=+n.apply(this,(s[0]=c,s)),g=r.apply(this,s)-Oi,m=i.apply(this,s)-Oi;if(a||(a=o=Yi()),a.moveTo(d,p),a.arc(0,0,l,f,h),f===g&&h===m||(a.quadraticCurveTo(0,0,y*Ai(g),y*Ti(g)),a.arc(0,0,y,g,m)),a.quadraticCurveTo(0,0,d,p),a.closePath(),o)return a=null,o+""||null}return o.radius=function(t){return arguments.length?(n="function"==typeof t?t:Pi(+t),o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Pi(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Pi(+t),o):i},o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(t){return arguments.length?(e=t,o):e},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o};function qi(){}function Zi(t,e){var n=new qi;if(t instanceof qi)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,a=t.length;if(null==e)for(;++i=r.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var u,c,l,f=-1,h=n.length,d=r[i++],p=Xi(),y=o();++fr.length)return n;var o,s=i[a-1];return null!=e&&a>=r.length?o=n.entries():(o=[],n.each((function(e,n){o.push({key:n,values:t(e,a)})}))),null!=s?o.sort((function(t,e){return s(t.key,e.key)})):o}(a(t,0,ta,ea),0)},key:function(t){return r.push(t),n},sortKeys:function(t){return i[r.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}};function Qi(){return{}}function Ki(t,e,n){t[e]=n}function ta(){return Xi()}function ea(t,e,n){t.set(e,n)}function na(){}var ra=Xi.prototype;function ia(t,e){var n=new na;if(t instanceof na)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/(6/29*3*(6/29))+4/29}function ga(t){return t>6/29?t*t*t:6/29*3*(6/29)*(t-4/29)}function ma(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function va(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ba(t){if(t instanceof wa)return new wa(t.h,t.c,t.l,t.opacity);if(t instanceof pa||(t=fa(t)),0===t.a&&0===t.b)return new wa(NaN,0r!=d>r&&n<(h-c)*(r-l)/(d-l)+c&&(i=-i)}return i}function Pa(t,e,n){var r,i,a,o;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],a=n[r],o=e[r],i<=a&&a<=o||o<=a&&a<=i)}var Ia=function(){},Ra=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]],Ba=function(){var t=1,e=1,n=O,r=s;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Na);else{var r=g(t),i=r[0],o=r[1];e=M(i,o,e),e=w(Math.floor(i/e)*e,Math.floor(o/e)*e,e)}return e.map((function(e){return a(t,e)}))}function a(n,i){var a=[],s=[];return function(n,r,i){var a,s,u,c,l,f,h=new Array,d=new Array;for(a=s=-1,c=n[0]>=r,Ra[c<<1].forEach(p);++a=r,Ra[u|c<<1].forEach(p);for(Ra[c<<0].forEach(p);++s=r,l=n[s*t]>=r,Ra[c<<1|l<<2].forEach(p);++a=r,f=l,l=n[s*t+a+1]>=r,Ra[u|c<<1|l<<2|f<<3].forEach(p);Ra[c|l<<3].forEach(p)}for(a=-1,l=n[s*t]>=r,Ra[l<<2].forEach(p);++a=r,Ra[l<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+s],u=[t[1][0]+a,t[1][1]+s],c=o(r),l=o(u);(e=d[c])?(n=h[l])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(u),i(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(u),d[e.end=l]=e):(e=h[l])?(n=d[c])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(u),i(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=c]=e):h[c]=d[l]={start:c,end:l,ring:[r,u]}}Ra[l<<3].forEach(p)}(n,i,(function(t){r(t,n,i),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e0?a.push([t]):s.push(t)})),s.forEach((function(t){for(var e,n=0,r=a.length;n0&&o0&&s0&&a>0))throw new Error("invalid size");return t=r,e=a,i},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Da(Ca.call(t)):Da(t),i):n},i.smooth=function(t){return arguments.length?(r=t?s:Ia,i):r===s},i};function ja(t,e,n){for(var r=t.width,i=t.height,a=1+(n<<1),o=0;o=n&&(s>=a&&(u-=t.data[s-a+o*r]),e.data[s-n+o*r]=u/Math.min(s+1,r-1+a-s,a))}function za(t,e,n){for(var r=t.width,i=t.height,a=1+(n<<1),o=0;o=n&&(s>=a&&(u-=t.data[o+(s-a)*r]),e.data[o+(s-n)*r]=u/Math.min(s+1,i-1+a-s,a))}function Ya(t){return t[0]}function Ua(t){return t[1]}function $a(){return 1}var Va=function(){var t=Ya,e=Ua,n=$a,r=960,i=500,a=20,o=2,s=3*a,u=r+2*s>>o,c=i+2*s>>o,l=Da(20);function f(r){var i=new Float32Array(u*c),f=new Float32Array(u*c);r.forEach((function(r,a,l){var f=+t(r,a,l)+s>>o,h=+e(r,a,l)+s>>o,d=+n(r,a,l);f>=0&&f=0&&h>o),za({width:u,height:c,data:f},{width:u,height:c,data:i},a>>o),ja({width:u,height:c,data:i},{width:u,height:c,data:f},a>>o),za({width:u,height:c,data:f},{width:u,height:c,data:i},a>>o),ja({width:u,height:c,data:i},{width:u,height:c,data:f},a>>o),za({width:u,height:c,data:f},{width:u,height:c,data:i},a>>o);var d=l(i);if(!Array.isArray(d)){var p=F(i);d=M(0,p,d),(d=w(0,Math.floor(p/d)*d,d)).shift()}return Ba().thresholds(d).size([u,c])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*o),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(y)}function y(t){t[0]=t[0]*Math.pow(2,o)-s,t[1]=t[1]*Math.pow(2,o)-s}function g(){return u=r+2*(s=3*a)>>o,c=i+2*s>>o,f}return f.x=function(e){return arguments.length?(t="function"==typeof e?e:Da(+e),f):t},f.y=function(t){return arguments.length?(e="function"==typeof t?t:Da(+t),f):e},f.weight=function(t){return arguments.length?(n="function"==typeof t?t:Da(+t),f):n},f.size=function(t){if(!arguments.length)return[r,i];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return r=e,i=n,g()},f.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return o=Math.floor(Math.log(t)/Math.LN2),g()},f.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Da(Ca.call(t)):Da(t),f):l},f.bandwidth=function(t){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return a=Math.round((Math.sqrt(4*t*t+1)-1)/2),g()},f},Ga=function(t){return function(){return t}};function Wa(t,e,n,r,i,a,o,s,u,c){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=a,this.y=o,this.dx=s,this.dy=u,this._=c}function Ha(){return!ue.ctrlKey&&!ue.button}function qa(){return this.parentNode}function Za(t){return null==t?{x:ue.x,y:ue.y}:t}function Xa(){return navigator.maxTouchPoints||"ontouchstart"in this}Wa.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Ja=function(){var t,e,n,r,i=Ha,a=qa,o=Za,s=Xa,u={},c=lt("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",g).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var o=b("mouse",a.apply(this,arguments),Nn,this,arguments);o&&(we(ue.view).on("mousemove.drag",p,!0).on("mouseup.drag",y,!0),Se(ue.view),ke(),n=!1,t=ue.clientX,e=ue.clientY,o("start"))}}function p(){if(Ee(),!n){var r=ue.clientX-t,i=ue.clientY-e;n=r*r+i*i>f}u.mouse("drag")}function y(){we(ue.view).on("mousemove.drag mouseup.drag",null),Ae(ue.view,n),Ee(),u.mouse("end")}function g(){if(i.apply(this,arguments)){var t,e,n=ue.changedTouches,r=a.apply(this,arguments),o=n.length;for(t=0;t=a?u=!0:10===(r=t.charCodeAt(o++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o9999?"+"+no(e,6):no(e,4))+"-"+no(t.getUTCMonth()+1,2)+"-"+no(t.getUTCDate(),2)+(a?"T"+no(n,2)+":"+no(r,2)+":"+no(i,2)+"."+no(a,3)+"Z":i?"T"+no(n,2)+":"+no(r,2)+":"+no(i,2)+"Z":r||n?"T"+no(n,2)+":"+no(r,2)+"Z":"")}(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=to(t);return function(r,i){return e(n(r),i,t)}}(t,e):to(t)}));return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=eo(e)),[n.map(o).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=eo(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}},io=ro(","),ao=io.parse,oo=io.parseRows,so=io.format,uo=io.formatBody,co=io.formatRows,lo=io.formatRow,fo=io.formatValue,ho=ro("\t"),po=ho.parse,yo=ho.parseRows,go=ho.format,mo=ho.formatBody,vo=ho.formatRows,bo=ho.formatRow,xo=ho.formatValue;function _o(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;wo&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}var wo=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function ko(t){return+t}function Eo(t){return t*t}function So(t){return t*(2-t)}function Ao(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var To=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),Mo=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Oo=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),Co=Math.PI,No=Co/2;function Do(t){return 1-Math.cos(t*No)}function Lo(t){return Math.sin(t*No)}function Fo(t){return(1-Math.cos(Co*t))/2}function Po(t){return Math.pow(2,10*t-10)}function Io(t){return 1-Math.pow(2,-10*t)}function Ro(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function Bo(t){return 1-Math.sqrt(1-t*t)}function jo(t){return Math.sqrt(1- --t*t)}function zo(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}function Yo(t){return 1-Uo(1-t)}function Uo(t){return(t=+t)<4/11?7.5625*t*t:t<8/11?7.5625*(t-=6/11)*t+.75:t<10/11?7.5625*(t-=9/11)*t+.9375:7.5625*(t-=21/22)*t+63/64}function $o(t){return((t*=2)<=1?1-Uo(1-t):Uo(t-1)+1)/2}var Vo=function t(e){function n(t){return t*t*((e+1)*t-e)}return e=+e,n.overshoot=t,n}(1.70158),Go=function t(e){function n(t){return--t*t*((e+1)*t+e)+1}return e=+e,n.overshoot=t,n}(1.70158),Wo=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),Ho=2*Math.PI,qo=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Ho);function i(t){return e*Math.pow(2,10*--t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*Ho)},i.period=function(n){return t(e,n)},i}(1,.3),Zo=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Ho);function i(t){return 1-e*Math.pow(2,-10*(t=+t))*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*Ho)},i.period=function(n){return t(e,n)},i}(1,.3),Xo=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Ho);function i(t){return((t=2*t-1)<0?e*Math.pow(2,10*t)*Math.sin((r-t)/n):2-e*Math.pow(2,-10*t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*Ho)},i.period=function(n){return t(e,n)},i}(1,.3);function Jo(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}var Qo=function(t,e){return fetch(t,e).then(Jo)};function Ko(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}var ts=function(t,e){return fetch(t,e).then(Ko)};function es(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}var ns=function(t,e){return fetch(t,e).then(es)};function rs(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),ns(e,n).then((function(e){return t(e,r)}))}}function is(t,e,n,r){3===arguments.length&&"function"==typeof n&&(r=n,n=void 0);var i=ro(t);return ns(e,n).then((function(t){return i.parse(t,r)}))}var as=rs(ao),os=rs(po),ss=function(t,e){return new Promise((function(n,r){var i=new Image;for(var a in e)i[a]=e[a];i.onerror=r,i.onload=function(){n(i)},i.src=t}))};function us(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}var cs=function(t,e){return fetch(t,e).then(us)};function ls(t){return function(e,n){return ns(e,n).then((function(e){return(new DOMParser).parseFromString(e,t)}))}}var fs=ls("application/xml"),hs=ls("text/html"),ds=ls("image/svg+xml"),ps=function(t,e){var n;function r(){var r,i,a=n.length,o=0,s=0;for(r=0;r=(a=(y+m)/2))?y=a:m=a,(l=n>=(o=(g+v)/2))?g=o:v=o,i=d,!(d=d[f=l<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(y+m)/2))?y=a:m=a,(l=n>=(o=(g+v)/2))?g=o:v=o}while((f=l<<1|c)==(h=(u>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}var vs=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function bs(t){return t[0]}function xs(t){return t[1]}function _s(t,e,n){var r=new ws(null==e?bs:e,null==n?xs:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ws(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function ks(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Es=_s.prototype=ws.prototype;function Ss(t){return t.x+t.vx}function As(t){return t.y+t.vy}Es.copy=function(){var t,e,n=new ws(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=ks(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=ks(e));return n},Es.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return ms(this.cover(e,n),e,n,t)},Es.addAll=function(t){var e,n,r,i,a=t.length,o=new Array(a),s=new Array(a),u=1/0,c=1/0,l=-1/0,f=-1/0;for(n=0;nl&&(l=r),if&&(f=i));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;nt||t>=i||r>e||e>=a;)switch(s=(eh||(a=u.y0)>d||(o=u.x1)=m)<<1|t>=g)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var v=t-+this._x.call(null,y.data),b=e-+this._y.call(null,y.data),x=v*v+b*b;if(x=(s=(p+g)/2))?p=s:g=s,(l=o>=(u=(y+m)/2))?y=u:m=u,e=d,!(d=d[f=l<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},Es.removeAll=function(t){for(var e=0,n=t.length;eu+d||ic+d||as.index){var p=u-o.x-o.vx,y=c-o.y-o.vy,g=p*p+y*y;gt.r&&(t.r=t[e].r)}function s(){if(e){var r,i,a=e.length;for(n=new Array(a),r=0;r1?(null==n?s.remove(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,r){var i,a,o,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,n),e):c.on(t)}}},Ps=function(){var t,e,n,r,i=ys(-30),a=1,o=1/0,s=.81;function u(r){var i,a=t.length,o=_s(t,Ns,Ds).visitAfter(l);for(n=r,i=0;i=o)){(t.data!==e||t.next)&&(0===l&&(d+=(l=gs())*l),0===f&&(d+=(f=gs())*f),d1?r[0]+r.slice(2):r,+t.slice(n+1)]},zs=function(t){return(t=js(Math.abs(t)))?t[1]:NaN},Ys=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Us(t){if(!(e=Ys.exec(t)))throw new Error("invalid format: "+t);var e;return new $s({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function $s(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}Us.prototype=$s.prototype,$s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Vs,Gs,Ws,Hs,qs=function(t,e){var n=js(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Zs={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return qs(100*t,e)},r:qs,s:function(t,e){var n=js(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Vs=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+js(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Xs=function(t){return t},Js=Array.prototype.map,Qs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Ks=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Xs:(e=Js.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),a.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Xs:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Js.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Us(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,y=t.comma,g=t.precision,m=t.trim,v=t.type;"n"===v?(y=!0,v="g"):Zs[v]||(void 0===g&&(g=12),m=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?a:/[%p]/.test(v)?u:"",_=Zs[v],w=/[defgprs%]/.test(v);function k(t){var i,a,u,h=b,k=x;if("c"===v)k=_(t)+k,t="";else{var E=(t=+t)<0;if(t=isNaN(t)?l:_(Math.abs(t),g),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&(E=!1),h=(E?"("===f?f:c:"-"===f||"("===f?"":f)+h,k=("s"===v?Qs[8+Vs/3]:"")+k+(E&&"("===f?")":""),w)for(i=-1,a=t.length;++i(u=t.charCodeAt(i))||u>57){k=(46===u?o+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}y&&!d&&(t=r(t,1/0));var S=h.length+t.length+k.length,A=S>1)+h+t+k+A.slice(S);break;default:t=A+h+t+k}return s(t)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=Us(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(zs(e)/3))),i=Math.pow(10,-r),a=Qs[8+r/3];return function(t){return n(i*t)+a}}}};function tu(t){return Gs=Ks(t),Ws=Gs.format,Hs=Gs.formatPrefix,Gs}tu({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var eu=function(t){return Math.max(0,-zs(Math.abs(t)))},nu=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zs(e)/3)))-zs(Math.abs(t)))},ru=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,zs(e)-zs(t))+1},iu=function(){return new au};function au(){this.reset()}au.prototype={constructor:au,reset:function(){this.s=this.t=0},add:function(t){su(ou,t,this.t),su(this,ou.s,this.s),this.s?this.t+=ou.t:this.s=ou.t},valueOf:function(){return this.s}};var ou=new au;function su(t,e,n){var r=t.s=e+n,i=r-e,a=r-i;t.t=e-a+(n-i)}var uu=Math.PI,cu=uu/2,lu=uu/4,fu=2*uu,hu=180/uu,du=uu/180,pu=Math.abs,yu=Math.atan,gu=Math.atan2,mu=Math.cos,vu=Math.ceil,bu=Math.exp,xu=(Math.floor,Math.log),_u=Math.pow,wu=Math.sin,ku=Math.sign||function(t){return t>0?1:t<0?-1:0},Eu=Math.sqrt,Su=Math.tan;function Au(t){return t>1?0:t<-1?uu:Math.acos(t)}function Tu(t){return t>1?cu:t<-1?-cu:Math.asin(t)}function Mu(t){return(t=wu(t/2))*t}function Ou(){}function Cu(t,e){t&&Du.hasOwnProperty(t.type)&&Du[t.type](t,e)}var Nu={Feature:function(t,e){Cu(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,a=mu(e=(e*=du)/2+lu),o=wu(e),s=ju*o,u=Bu*a+s*mu(i),c=s*r*wu(i);Yu.add(gu(c,u)),Ru=t,Bu=a,ju=o}var qu=function(t){return Uu.reset(),zu(t,$u),2*Uu};function Zu(t){return[gu(t[1],t[0]),Tu(t[2])]}function Xu(t){var e=t[0],n=t[1],r=mu(n);return[r*mu(e),r*wu(e),wu(n)]}function Ju(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Qu(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ku(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function tc(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function ec(t){var e=Eu(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var nc,rc,ic,ac,oc,sc,uc,cc,lc,fc,hc=iu(),dc={point:pc,lineStart:gc,lineEnd:mc,polygonStart:function(){dc.point=vc,dc.lineStart=bc,dc.lineEnd=xc,hc.reset(),$u.polygonStart()},polygonEnd:function(){$u.polygonEnd(),dc.point=pc,dc.lineStart=gc,dc.lineEnd=mc,Yu<0?(nc=-(ic=180),rc=-(ac=90)):hc>1e-6?ac=90:hc<-1e-6&&(rc=-90),fc[0]=nc,fc[1]=ic},sphere:function(){nc=-(ic=180),rc=-(ac=90)}};function pc(t,e){lc.push(fc=[nc=t,ic=t]),eac&&(ac=e)}function yc(t,e){var n=Xu([t*du,e*du]);if(cc){var r=Qu(cc,n),i=Qu([r[1],-r[0],0],r);ec(i),i=Zu(i);var a,o=t-oc,s=o>0?1:-1,u=i[0]*hu*s,c=pu(o)>180;c^(s*ocac&&(ac=a):c^(s*oc<(u=(u+360)%360-180)&&uac&&(ac=e)),c?t_c(nc,ic)&&(ic=t):_c(t,ic)>_c(nc,ic)&&(nc=t):ic>=nc?(tic&&(ic=t)):t>oc?_c(nc,t)>_c(nc,ic)&&(ic=t):_c(t,ic)>_c(nc,ic)&&(nc=t)}else lc.push(fc=[nc=t,ic=t]);eac&&(ac=e),cc=n,oc=t}function gc(){dc.point=yc}function mc(){fc[0]=nc,fc[1]=ic,dc.point=pc,cc=null}function vc(t,e){if(cc){var n=t-oc;hc.add(pu(n)>180?n+(n>0?360:-360):n)}else sc=t,uc=e;$u.point(t,e),yc(t,e)}function bc(){$u.lineStart()}function xc(){vc(sc,uc),$u.lineEnd(),pu(hc)>1e-6&&(nc=-(ic=180)),fc[0]=nc,fc[1]=ic,cc=null}function _c(t,e){return(e-=t)<0?e+360:e}function wc(t,e){return t[0]-e[0]}function kc(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e_c(r[0],r[1])&&(r[1]=i[1]),_c(i[0],r[1])>_c(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,e=0,r=a[n=a.length-1];e<=n;r=i,++e)i=a[e],(s=_c(r[1],i[0]))>o&&(o=s,nc=i[0],ic=r[1])}return lc=fc=null,nc===1/0||rc===1/0?[[NaN,NaN],[NaN,NaN]]:[[nc,rc],[ic,ac]]},Yc={sphere:Ou,point:Uc,lineStart:Vc,lineEnd:Hc,polygonStart:function(){Yc.lineStart=qc,Yc.lineEnd=Zc},polygonEnd:function(){Yc.lineStart=Vc,Yc.lineEnd=Hc}};function Uc(t,e){t*=du;var n=mu(e*=du);$c(n*mu(t),n*wu(t),wu(e))}function $c(t,e,n){++Ec,Ac+=(t-Ac)/Ec,Tc+=(e-Tc)/Ec,Mc+=(n-Mc)/Ec}function Vc(){Yc.point=Gc}function Gc(t,e){t*=du;var n=mu(e*=du);Rc=n*mu(t),Bc=n*wu(t),jc=wu(e),Yc.point=Wc,$c(Rc,Bc,jc)}function Wc(t,e){t*=du;var n=mu(e*=du),r=n*mu(t),i=n*wu(t),a=wu(e),o=gu(Eu((o=Bc*a-jc*i)*o+(o=jc*r-Rc*a)*o+(o=Rc*i-Bc*r)*o),Rc*r+Bc*i+jc*a);Sc+=o,Oc+=o*(Rc+(Rc=r)),Cc+=o*(Bc+(Bc=i)),Nc+=o*(jc+(jc=a)),$c(Rc,Bc,jc)}function Hc(){Yc.point=Uc}function qc(){Yc.point=Xc}function Zc(){Jc(Pc,Ic),Yc.point=Uc}function Xc(t,e){Pc=t,Ic=e,t*=du,e*=du,Yc.point=Jc;var n=mu(e);Rc=n*mu(t),Bc=n*wu(t),jc=wu(e),$c(Rc,Bc,jc)}function Jc(t,e){t*=du;var n=mu(e*=du),r=n*mu(t),i=n*wu(t),a=wu(e),o=Bc*a-jc*i,s=jc*r-Rc*a,u=Rc*i-Bc*r,c=Eu(o*o+s*s+u*u),l=Tu(c),f=c&&-l/c;Dc+=f*o,Lc+=f*s,Fc+=f*u,Sc+=l,Oc+=l*(Rc+(Rc=r)),Cc+=l*(Bc+(Bc=i)),Nc+=l*(jc+(jc=a)),$c(Rc,Bc,jc)}var Qc=function(t){Ec=Sc=Ac=Tc=Mc=Oc=Cc=Nc=Dc=Lc=Fc=0,zu(t,Yc);var e=Dc,n=Lc,r=Fc,i=e*e+n*n+r*r;return i<1e-12&&(e=Oc,n=Cc,r=Nc,Sc<1e-6&&(e=Ac,n=Tc,r=Mc),(i=e*e+n*n+r*r)<1e-12)?[NaN,NaN]:[gu(n,e)*hu,Tu(r/Eu(i))*hu]},Kc=function(t){return function(){return t}},tl=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function el(t,e){return[pu(t)>uu?t+Math.round(-t/fu)*fu:t,e]}function nl(t,e,n){return(t%=fu)?e||n?tl(il(t),al(e,n)):il(t):e||n?al(e,n):el}function rl(t){return function(e,n){return[(e+=t)>uu?e-fu:e<-uu?e+fu:e,n]}}function il(t){var e=rl(t);return e.invert=rl(-t),e}function al(t,e){var n=mu(t),r=wu(t),i=mu(e),a=wu(e);function o(t,e){var o=mu(e),s=mu(t)*o,u=wu(t)*o,c=wu(e),l=c*n+s*r;return[gu(u*i-l*a,s*n-c*r),Tu(l*i+u*a)]}return o.invert=function(t,e){var o=mu(e),s=mu(t)*o,u=wu(t)*o,c=wu(e),l=c*i-u*a;return[gu(u*i+c*a,s*n+l*r),Tu(l*n-s*r)]},o}el.invert=el;var ol=function(t){function e(e){return(e=t(e[0]*du,e[1]*du))[0]*=hu,e[1]*=hu,e}return t=nl(t[0]*du,t[1]*du,t.length>2?t[2]*du:0),e.invert=function(e){return(e=t.invert(e[0]*du,e[1]*du))[0]*=hu,e[1]*=hu,e},e};function sl(t,e,n,r,i,a){if(n){var o=mu(e),s=wu(e),u=r*n;null==i?(i=e+r*fu,a=e-u/2):(i=ul(o,i),a=ul(o,a),(r>0?ia)&&(i+=r*fu));for(var c,l=i;r>0?l>a:l1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},fl=function(t,e){return pu(t[0]-e[0])<1e-6&&pu(t[1]-e[1])<1e-6};function hl(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var dl=function(t,e,n,r,i){var a,o,s=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(fl(r,o)){for(i.lineStart(),a=0;a=0;--a)i.point((l=c[a])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function pl(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,S=E*k,A=S>uu,T=y*_;if(yl.add(gu(T*E*wu(S),g*w+T*mu(S))),o+=A?k+E*fu:k,A^d>=n^b>=n){var M=Qu(Xu(h),Xu(v));ec(M);var O=Qu(a,M);ec(O);var C=(A^k>=0?-1:1)*Tu(O[2]);(r>C||r===C&&(M[0]||M[1]))&&(s+=A^k>=0?1:-1)}}return(o<-1e-6||o<1e-6&&yl<-1e-6)^1&s},vl=function(t,e,n,r){return function(i){var a,o,s,u=e(i),c=ll(),l=e(c),f=!1,h={point:d,lineStart:y,lineEnd:g,polygonStart:function(){h.point=m,h.lineStart=v,h.lineEnd=b,o=[],a=[]},polygonEnd:function(){h.point=d,h.lineStart=y,h.lineEnd=g,o=R(o);var t=ml(a,r);o.length?(f||(i.polygonStart(),f=!0),dl(o,xl,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),o=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){u.point(t,e)}function y(){h.point=p,u.lineStart()}function g(){h.point=d,u.lineEnd()}function m(t,e){s.push([t,e]),l.point(t,e)}function v(){l.lineStart(),s=[]}function b(){m(s[0][0],s[0][1]),l.lineEnd();var t,e,n,r,u=l.clean(),h=c.result(),d=h.length;if(s.pop(),a.push(s),s=null,d)if(1&u){if((e=(n=h[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&u&&h.push(h.pop().concat(h.shift())),o.push(h.filter(bl))}return h}};function bl(t){return t.length>1}function xl(t,e){return((t=t.x)[0]<0?t[1]-cu-1e-6:cu-t[1])-((e=e.x)[0]<0?e[1]-cu-1e-6:cu-e[1])}var _l=vl((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?uu:-uu,u=pu(a-n);pu(u-uu)<1e-6?(t.point(n,r=(r+o)/2>0?cu:-cu),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&u>=uu&&(pu(n-i)<1e-6&&(n-=1e-6*i),pu(a-s)<1e-6&&(a-=1e-6*s),r=function(t,e,n,r){var i,a,o=wu(t-n);return pu(o)>1e-6?yu((wu(e)*(a=mu(r))*wu(n)-wu(r)*(i=mu(e))*wu(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=a,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*cu,r.point(-uu,i),r.point(0,i),r.point(uu,i),r.point(uu,0),r.point(uu,-i),r.point(0,-i),r.point(-uu,-i),r.point(-uu,0),r.point(-uu,i);else if(pu(t[0]-e[0])>1e-6){var a=t[0]0,i=pu(e)>1e-6;function a(t,n){return mu(t)*mu(n)>e}function o(t,n,r){var i=[1,0,0],a=Qu(Xu(t),Xu(n)),o=Ju(a,a),s=a[0],u=o-s*s;if(!u)return!r&&t;var c=e*o/u,l=-e*s/u,f=Qu(i,a),h=tc(i,c);Ku(h,tc(a,l));var d=f,p=Ju(h,d),y=Ju(d,d),g=p*p-y*(Ju(h,h)-1);if(!(g<0)){var m=Eu(g),v=tc(d,(-p-m)/y);if(Ku(v,h),v=Zu(v),!r)return v;var b,x=t[0],_=n[0],w=t[1],k=n[1];_0^v[1]<(pu(v[0]-x)<1e-6?w:k):w<=v[1]&&v[1]<=k:E>uu^(x<=v[0]&&v[0]<=_)){var A=tc(d,(-p+m)/y);return Ku(A,h),[v,Zu(A)]}}}function s(e,n){var i=r?t:uu-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return vl(a,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,h){var d,p=[f,h],y=a(f,h),g=r?y?0:s(f,h):y?s(f+(f<0?uu:-uu),h):0;if(!e&&(c=u=y)&&t.lineStart(),y!==u&&(!(d=o(e,p))||fl(e,d)||fl(p,d))&&(p[0]+=1e-6,p[1]+=1e-6,y=a(p[0],p[1])),y!==u)l=0,y?(t.lineStart(),d=o(p,e),t.point(d[0],d[1])):(d=o(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(i&&e&&r^y){var m;g&n||!(m=o(p,e,!0))||(l=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!y||e&&fl(e,p)||t.point(p[0],p[1]),e=p,u=y,n=g},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(e,r,i,a){sl(a,t,n,i,e,r)}),r?[0,-t]:[-uu,t-uu])};function kl(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,s,c){var l=0,f=0;if(null==i||(l=o(i,s))!==(f=o(a,s))||u(i,a)<0^s>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+s+4)%4)!==f);else c.point(a[0],a[1])}function o(r,i){return pu(r[0]-t)<1e-6?i>0?0:3:pu(r[0]-n)<1e-6?i>0?2:1:pu(r[1]-e)<1e-6?i>0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var u,c,l,f,h,d,p,y,g,m,v,b=o,x=ll(),_={point:w,lineStart:function(){_.point=k,c&&c.push(l=[]),m=!0,g=!1,p=y=NaN},lineEnd:function(){u&&(k(f,h),d&&g&&x.rejoin(),u.push(x.result())),_.point=w,g&&b.lineEnd()},polygonStart:function(){b=x,u=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;nr&&(h-a)*(r-o)>(d-o)*(t-a)&&++e:d<=r&&(h-a)*(r-o)<(d-o)*(t-a)&&--e;return e}(),n=v&&e,i=(u=R(u)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&dl(u,s,e,a,o),o.polygonEnd()),b=o,u=c=l=null}};function w(t,e){i(t,e)&&b.point(t,e)}function k(a,o){var s=i(a,o);if(c&&l.push([a,o]),m)f=a,h=o,d=s,m=!1,s&&(b.lineStart(),b.point(a,o));else if(s&&g)b.point(a,o);else{var u=[p=Math.max(-1e9,Math.min(1e9,p)),y=Math.max(-1e9,Math.min(1e9,y))],x=[a=Math.max(-1e9,Math.min(1e9,a)),o=Math.max(-1e9,Math.min(1e9,o))];!function(t,e,n,r,i,a){var o,s=t[0],u=t[1],c=0,l=1,f=e[0]-s,h=e[1]-u;if(o=n-s,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>l)return;o>c&&(c=o)}if(o=i-s,f||!(o<0)){if(o/=f,f<0){if(o>l)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=h,h<0){if(o0){if(o>l)return;o>c&&(c=o)}if(o=a-u,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>c&&(c=o)}else if(h>0){if(o0&&(t[0]=s+c*f,t[1]=u+c*h),l<1&&(e[0]=s+l*f,e[1]=u+l*h),!0}}}}}(u,x,t,e,n,r)?s&&(b.lineStart(),b.point(a,o),v=!1):(g||(b.lineStart(),b.point(u[0],u[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=a,y=o,g=s}return _}}var El,Sl,Al,Tl=function(){var t,e,n,r=0,i=0,a=960,o=500;return n={stream:function(n){return t&&e===n?t:t=kl(r,i,a,o)(e=n)},extent:function(s){return arguments.length?(r=+s[0][0],i=+s[0][1],a=+s[1][0],o=+s[1][1],t=e=null,n):[[r,i],[a,o]]}}},Ml=iu(),Ol={sphere:Ou,point:Ou,lineStart:function(){Ol.point=Nl,Ol.lineEnd=Cl},lineEnd:Ou,polygonStart:Ou,polygonEnd:Ou};function Cl(){Ol.point=Ol.lineEnd=Ou}function Nl(t,e){El=t*=du,Sl=wu(e*=du),Al=mu(e),Ol.point=Dl}function Dl(t,e){t*=du;var n=wu(e*=du),r=mu(e),i=pu(t-El),a=mu(i),o=r*wu(i),s=Al*n-Sl*r*a,u=Sl*n+Al*r*a;Ml.add(gu(Eu(o*o+s*s),u)),El=t,Sl=n,Al=r}var Ll=function(t){return Ml.reset(),zu(t,Ol),+Ml},Fl=[null,null],Pl={type:"LineString",coordinates:Fl},Il=function(t,e){return Fl[0]=t,Fl[1]=e,Ll(Pl)},Rl={Feature:function(t,e){return jl(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Il(t[a],t[a-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<1e-12*i)return!0;n=r}return!1}function Ul(t,e){return!!ml(t.map($l),Vl(e))}function $l(t){return(t=t.map(Vl)).pop(),t}function Vl(t){return[t[0]*du,t[1]*du]}var Gl=function(t,e){return(t&&Rl.hasOwnProperty(t.type)?Rl[t.type]:jl)(t,e)};function Wl(t,e,n){var r=w(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function Hl(t,e,n){var r=w(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function ql(){var t,e,n,r,i,a,o,s,u,c,l,f,h=10,d=h,p=90,y=360,g=2.5;function m(){return{type:"MultiLineString",coordinates:v()}}function v(){return w(vu(r/p)*p,n,p).map(l).concat(w(vu(s/y)*y,o,y).map(f)).concat(w(vu(e/h)*h,t,h).filter((function(t){return pu(t%p)>1e-6})).map(u)).concat(w(vu(a/d)*d,i,d).filter((function(t){return pu(t%y)>1e-6})).map(c))}return m.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},m.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(o).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),m.precision(g)):[[r,s],[n,o]]},m.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),m.precision(g)):[[e,a],[t,i]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(p=+t[0],y=+t[1],m):[p,y]},m.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],m):[h,d]},m.precision=function(h){return arguments.length?(g=+h,u=Wl(a,i,90),c=Hl(e,t,g),l=Wl(s,o,90),f=Hl(r,n,g),m):g},m.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Zl(){return ql()()}var Xl,Jl,Ql,Kl,tf=function(t,e){var n=t[0]*du,r=t[1]*du,i=e[0]*du,a=e[1]*du,o=mu(r),s=wu(r),u=mu(a),c=wu(a),l=o*mu(n),f=o*wu(n),h=u*mu(i),d=u*wu(i),p=2*Tu(Eu(Mu(a-r)+o*u*Mu(i-n))),y=wu(p),g=p?function(t){var e=wu(t*=p)/y,n=wu(p-t)/y,r=n*l+e*h,i=n*f+e*d,a=n*s+e*c;return[gu(i,r)*hu,gu(a,Eu(r*r+i*i))*hu]}:function(){return[n*hu,r*hu]};return g.distance=p,g},ef=function(t){return t},nf=iu(),rf=iu(),af={point:Ou,lineStart:Ou,lineEnd:Ou,polygonStart:function(){af.lineStart=of,af.lineEnd=cf},polygonEnd:function(){af.lineStart=af.lineEnd=af.point=Ou,nf.add(pu(rf)),rf.reset()},result:function(){var t=nf/2;return nf.reset(),t}};function of(){af.point=sf}function sf(t,e){af.point=uf,Xl=Ql=t,Jl=Kl=e}function uf(t,e){rf.add(Kl*t-Ql*e),Ql=t,Kl=e}function cf(){uf(Xl,Jl)}var lf,ff,hf,df,pf=af,yf=1/0,gf=yf,mf=-yf,vf=mf,bf={point:function(t,e){tmf&&(mf=t),evf&&(vf=e)},lineStart:Ou,lineEnd:Ou,polygonStart:Ou,polygonEnd:Ou,result:function(){var t=[[yf,gf],[mf,vf]];return mf=vf=-(gf=yf=1/0),t}},xf=0,_f=0,wf=0,kf=0,Ef=0,Sf=0,Af=0,Tf=0,Mf=0,Of={point:Cf,lineStart:Nf,lineEnd:Ff,polygonStart:function(){Of.lineStart=Pf,Of.lineEnd=If},polygonEnd:function(){Of.point=Cf,Of.lineStart=Nf,Of.lineEnd=Ff},result:function(){var t=Mf?[Af/Mf,Tf/Mf]:Sf?[kf/Sf,Ef/Sf]:wf?[xf/wf,_f/wf]:[NaN,NaN];return xf=_f=wf=kf=Ef=Sf=Af=Tf=Mf=0,t}};function Cf(t,e){xf+=t,_f+=e,++wf}function Nf(){Of.point=Df}function Df(t,e){Of.point=Lf,Cf(hf=t,df=e)}function Lf(t,e){var n=t-hf,r=e-df,i=Eu(n*n+r*r);kf+=i*(hf+t)/2,Ef+=i*(df+e)/2,Sf+=i,Cf(hf=t,df=e)}function Ff(){Of.point=Cf}function Pf(){Of.point=Rf}function If(){Bf(lf,ff)}function Rf(t,e){Of.point=Bf,Cf(lf=hf=t,ff=df=e)}function Bf(t,e){var n=t-hf,r=e-df,i=Eu(n*n+r*r);kf+=i*(hf+t)/2,Ef+=i*(df+e)/2,Sf+=i,Af+=(i=df*t-hf*e)*(hf+t),Tf+=i*(df+e),Mf+=3*i,Cf(hf=t,df=e)}var jf=Of;function zf(t){this._context=t}zf.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,fu)}},result:Ou};var Yf,Uf,$f,Vf,Gf,Wf=iu(),Hf={point:Ou,lineStart:function(){Hf.point=qf},lineEnd:function(){Yf&&Zf(Uf,$f),Hf.point=Ou},polygonStart:function(){Yf=!0},polygonEnd:function(){Yf=null},result:function(){var t=+Wf;return Wf.reset(),t}};function qf(t,e){Hf.point=Zf,Uf=Vf=t,$f=Gf=e}function Zf(t,e){Vf-=t,Gf-=e,Wf.add(Eu(Vf*Vf+Gf*Gf)),Vf=t,Gf=e}var Xf=Hf;function Jf(){this._string=[]}function Qf(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Jf.prototype={_radius:4.5,_circle:Qf(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Qf(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var Kf=function(t,e){var n,r,i=4.5;function a(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),zu(t,n(r))),r.result()}return a.area=function(t){return zu(t,n(pf)),pf.result()},a.measure=function(t){return zu(t,n(Xf)),Xf.result()},a.bounds=function(t){return zu(t,n(bf)),bf.result()},a.centroid=function(t){return zu(t,n(jf)),jf.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,ef):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new Jf):new zf(e=t),"function"!=typeof i&&r.pointRadius(i),a):e},a.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),a):i},a.projection(t).context(e)},th=function(t){return{stream:eh(t)}};function eh(t){return function(e){var n=new nh;for(var r in t)n[r]=t[r];return n.stream=e,n}}function nh(){}function rh(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),zu(n,t.stream(bf)),e(bf.result()),null!=r&&t.clipExtent(r),t}function ih(t,e,n){return rh(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}function ah(t,e,n){return ih(t,[[0,0],e],n)}function oh(t,e,n){return rh(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o])}),n)}function sh(t,e,n){return rh(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o])}),n)}nh.prototype={constructor:nh,point:function(t,e){this.stream.point(t,e)},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()}};var uh=mu(30*du),ch=function(t,e){return+e?function(t,e){function n(r,i,a,o,s,u,c,l,f,h,d,p,y,g){var m=c-r,v=l-i,b=m*m+v*v;if(b>4*e&&y--){var x=o+h,_=s+d,w=u+p,k=Eu(x*x+_*_+w*w),E=Tu(w/=k),S=pu(pu(w)-1)<1e-6||pu(a-f)<1e-6?(a+f)/2:gu(_,x),A=t(S,E),T=A[0],M=A[1],O=T-r,C=M-i,N=v*O-m*C;(N*N/b>e||pu((m*O+v*C)/b-.5)>.3||o*h+s*d+u*p2?t[2]%360*du:0,T()):[g*hu,m*hu,v*hu]},S.angle=function(t){return arguments.length?(b=t%360*du,T()):b*hu},S.precision=function(t){return arguments.length?(o=ch(s,E=t*t),M()):Eu(E)},S.fitExtent=function(t,e){return ih(S,t,e)},S.fitSize=function(t,e){return ah(S,t,e)},S.fitWidth=function(t,e){return oh(S,t,e)},S.fitHeight=function(t,e){return sh(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&A,T()}}function yh(t){var e=0,n=uu/3,r=ph(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*du,n=t[1]*du):[e*hu,n*hu]},i}function gh(t,e){var n=wu(t),r=(n+wu(e))/2;if(pu(r)<1e-6)return function(t){var e=mu(t);function n(t,n){return[t*e,wu(n)/e]}return n.invert=function(t,n){return[t/e,Tu(n*e)]},n}(t);var i=1+n*(2*r-n),a=Eu(i)/r;function o(t,e){var n=Eu(i-2*r*wu(e))/r;return[n*wu(t*=r),a-n*mu(t)]}return o.invert=function(t,e){var n=a-e;return[gu(t,pu(n))/r*ku(n),Tu((i-(t*t+n*n)*r*r)/(2*r))]},o}var mh=function(){return yh(gh).scale(155.424).center([0,33.6442])},vh=function(){return mh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},bh=function(){var t,e,n,r,i,a,o=vh(),s=mh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=mh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){a=[t,e]}};function l(t){var e=t[0],o=t[1];return a=null,n.point(e,o),a||(r.point(e,o),a)||(i.point(e,o),a)}function f(){return t=e=null,l}return l.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:o).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[o.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n0?e<1e-6-cu&&(e=1e-6-cu):e>cu-1e-6&&(e=cu-1e-6);var n=i/_u(Oh(e),r);return[n*wu(r*t),i-n*mu(r*t)]}return a.invert=function(t,e){var n=i-e,a=ku(r)*Eu(t*t+n*n);return[gu(t,pu(n))/r*ku(n),2*yu(_u(i/a,1/r))-cu]},a}var Nh=function(){return yh(Ch).scale(109.5).parallels([30,30])};function Dh(t,e){return[t,e]}Dh.invert=Dh;var Lh=function(){return dh(Dh).scale(152.63)};function Fh(t,e){var n=mu(t),r=t===e?wu(t):(n-mu(e))/(e-t),i=n/r+t;if(pu(r)<1e-6)return Dh;function a(t,e){var n=i-e,a=r*t;return[n*wu(a),i-n*mu(a)]}return a.invert=function(t,e){var n=i-e;return[gu(t,pu(n))/r*ku(n),i-ku(r)*Eu(t*t+n*n)]},a}var Ph=function(){return yh(Fh).scale(131.154).center([0,13.9389])},Ih=1.340264,Rh=-.081106,Bh=893e-6,jh=.003796,zh=Eu(3)/2;function Yh(t,e){var n=Tu(zh*wu(e)),r=n*n,i=r*r*r;return[t*mu(n)/(zh*(Ih+3*Rh*r+i*(7*Bh+9*jh*r))),n*(Ih+Rh*r+i*(Bh+jh*r))]}Yh.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(Ih+Rh*i+a*(Bh+jh*i))-e)/(Ih+3*Rh*i+a*(7*Bh+9*jh*i)))*r)*i*i,!(pu(n)<1e-12));++o);return[zh*t*(Ih+3*Rh*i+a*(7*Bh+9*jh*i))/mu(r),Tu(wu(r)/zh)]};var Uh=function(){return dh(Yh).scale(177.158)};function $h(t,e){var n=mu(e),r=mu(t)*n;return[n*wu(t)/r,wu(e)/r]}$h.invert=_h(yu);var Vh=function(){return dh($h).scale(144.049).clipAngle(60)};function Gh(t,e,n,r){return 1===t&&1===e&&0===n&&0===r?ef:eh({point:function(i,a){this.stream.point(i*t+n,a*e+r)}})}var Wh=function(){var t,e,n,r,i,a,o=1,s=0,u=0,c=1,l=1,f=ef,h=null,d=ef;function p(){return r=i=null,a}return a={stream:function(t){return r&&i===t?r:r=f(d(i=t))},postclip:function(r){return arguments.length?(d=r,h=t=e=n=null,p()):d},clipExtent:function(r){return arguments.length?(d=null==r?(h=t=e=n=null,ef):kl(h=+r[0][0],t=+r[0][1],e=+r[1][0],n=+r[1][1]),p()):null==h?null:[[h,t],[e,n]]},scale:function(t){return arguments.length?(f=Gh((o=+t)*c,o*l,s,u),p()):o},translate:function(t){return arguments.length?(f=Gh(o*c,o*l,s=+t[0],u=+t[1]),p()):[s,u]},reflectX:function(t){return arguments.length?(f=Gh(o*(c=t?-1:1),o*l,s,u),p()):c<0},reflectY:function(t){return arguments.length?(f=Gh(o*c,o*(l=t?-1:1),s,u),p()):l<0},fitExtent:function(t,e){return ih(a,t,e)},fitSize:function(t,e){return ah(a,t,e)},fitWidth:function(t,e){return oh(a,t,e)},fitHeight:function(t,e){return sh(a,t,e)}}};function Hh(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}Hh.invert=function(t,e){var n,r=e,i=25;do{var a=r*r,o=a*a;r-=n=(r*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(pu(n)>1e-6&&--i>0);return[t/(.8707+(a=r*r)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),r]};var qh=function(){return dh(Hh).scale(175.295)};function Zh(t,e){return[mu(e)*wu(t),wu(e)]}Zh.invert=_h(Tu);var Xh=function(){return dh(Zh).scale(249.5).clipAngle(90.000001)};function Jh(t,e){var n=mu(e),r=1+mu(t)*n;return[n*wu(t)/r,wu(e)/r]}Jh.invert=_h((function(t){return 2*yu(t)}));var Qh=function(){return dh(Jh).scale(250).clipAngle(142)};function Kh(t,e){return[xu(Su((cu+e)/2)),-t]}Kh.invert=function(t,e){return[-e,2*yu(bu(t))-cu]};var td=function(){var t=Mh(Kh),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)};function ed(t,e){return t.parent===e.parent?1:2}function nd(t,e){return t+e.x}function rd(t,e){return Math.max(t,e.y)}var id=function(){var t=ed,e=1,n=1,r=!1;function i(i){var a,o=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(nd,0)/t.length}(n),e.y=function(t){return 1+t.reduce(rd,0)}(n)):(e.x=a?o+=t(e,a):0,e.y=0,a=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=s.x-t(s,u)/2,l=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-c)/(l-c)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i};function ad(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function od(t,e){var n,r,i,a,o,s=new ld(t),u=+t.value&&(s.value=t.value),c=[s];for(null==e&&(e=sd);n=c.pop();)if(u&&(n.value=+n.data.value),(i=e(n.data))&&(o=i.length))for(n.children=new Array(o),a=o-1;a>=0;--a)c.push(r=n.children[a]=new ld(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(cd)}function sd(t){return t.children}function ud(t){t.data=t.data.data}function cd(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function ld(t){this.data=t,this.depth=this.height=0,this.parent=null}ld.prototype=od.prototype={constructor:ld,count:function(){return this.eachAfter(ad)},each:function(t){var e,n,r,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),n=a.children)for(r=0,i=n.length;r=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return od(this).eachBefore(ud)}};var fd=Array.prototype.slice,hd=function(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(fd.call(t))).length,a=[];r0&&n*n>r*r+i*i}function gd(t,e){for(var n=0;n(o*=o)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=t.x-r*s-a*u,n.y=t.y-r*u+a*s):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-a*u,n.y=e.y+r*u+a*s)):(n.x=e.x+n.r,n.y=e.y)}function _d(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function wd(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,a=(e.y*n.r+n.y*e.r)/r;return i*i+a*a}function kd(t){this._=t,this.next=null,this.previous=null}function Ed(t){if(!(i=t.length))return 0;var e,n,r,i,a,o,s,u,c,l,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;xd(n,e,r=t[2]),e=new kd(e),n=new kd(n),r=new kd(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(s=3;s0)throw new Error("cycle");return a}return n.id=function(e){return arguments.length?(t=Td(e),n):t},n.parentId=function(t){return arguments.length?(e=Td(t),n):e},n};function $d(t,e){return t.parent===e.parent?1:2}function Vd(t){var e=t.children;return e?e[0]:t.t}function Gd(t){var e=t.children;return e?e[e.length-1]:t.t}function Wd(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Hd(t,e,n){return t.a.parent===e.parent?t.a:n}function qd(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}qd.prototype=Object.create(ld.prototype);var Zd=function(){var t=$d,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,a,o=new qd(t,0),s=[o];e=s.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;i>=0;--i)s.push(n=e.children[i]=new qd(r[i],i)),n.parent=e;return(o.parent=new qd(null,0)).children=[o],o}(i);if(u.eachAfter(a),u.parent.m=-u.z,u.eachBefore(o),r)i.eachBefore(s);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=c===l?1:t(c,l)/2,d=h-c.x,p=e/(l.x+h+d),y=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*y}))}return i}function a(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var a=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,a=e,o=e,s=n,u=a.parent.children[0],c=a.m,l=o.m,f=s.m,h=u.m;s=Gd(s),a=Vd(a),s&&a;)u=Vd(u),(o=Gd(o)).a=e,(i=s.z+f-a.z-c+t(s._,a._))>0&&(Wd(Hd(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=a.m,h+=u.m,l+=o.m;s&&!Gd(o)&&(o.t=s,o.m+=f-l),a&&!Vd(u)&&(u.t=a,u.m+=c-h,r=e)}return r}(e,i,e.parent.A||r[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},Xd=function(t,e,n,r,i){for(var a,o=t.children,s=-1,u=o.length,c=t.value&&(i-n)/t.value;++sh&&(h=s),g=l*l*y,(d=Math.max(h/g,g/f))>p){l-=s;break}p=d}m.push(o={value:l,dice:u1?e:1)},n}(Jd),tp=function(){var t=Kd,e=!1,n=1,r=1,i=[0],a=Md,o=Md,s=Md,u=Md,c=Md;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(Pd),t}function f(e){var n=i[e.depth],r=e.x0+n,l=e.y0+n,f=e.x1-n,h=e.y1-n;f=n-1){var l=s[e];return l.x0=i,l.y0=a,l.x1=o,void(l.y1=u)}for(var f=c[e],h=r/2+f,d=e+1,p=n-1;d>>1;c[y]u-a){var v=(i*m+o*g)/r;t(e,d,g,i,a,v,u),t(d,n,m,v,a,o,u)}else{var b=(a*m+u*g)/r;t(e,d,g,i,a,o,b),t(d,n,m,i,b,o,u)}}(0,u,t.value,e,n,r,i)},np=function(t,e,n,r,i){(1&t.depth?Xd:Id)(t,e,n,r,i)},rp=function t(e){function n(t,n,r,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,u,c,l,f=-1,h=o.length,d=t.value;++f1?e:1)},n}(Jd),ip=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},ap=function(t,e){var n=cn(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},op=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}},sp=Math.SQRT2;function up(t){return((t=Math.exp(t))+1/t)/2}var cp=function(t,e){var n,r,i=t[0],a=t[1],o=t[2],s=e[0],u=e[1],c=e[2],l=s-i,f=u-a,h=l*l+f*f;if(h<1e-12)r=Math.log(c/o)/sp,n=function(t){return[i+t*l,a+t*f,o*Math.exp(sp*t*r)]};else{var d=Math.sqrt(h),p=(c*c-o*o+4*h)/(2*o*2*d),y=(c*c-o*o-4*h)/(2*c*2*d),g=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(y*y+1)-y);r=(m-g)/sp,n=function(t){var e,n=t*r,s=up(g),u=o/(2*d)*(s*(e=sp*n+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+u*l,a+u*f,o*s/up(sp*n+g)]}}return n.duration=1e3*r,n};function lp(t){return function(e,n){var r=t((e=tn(e)).h,(n=tn(n)).h),i=ln(e.s,n.s),a=ln(e.l,n.l),o=ln(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var fp=lp(cn),hp=lp(ln);function dp(t,e){var n=ln((t=da(t)).l,(e=da(e)).l),r=ln(t.a,e.a),i=ln(t.b,e.b),a=ln(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=a(e),t+""}}function pp(t){return function(e,n){var r=t((e=_a(e)).h,(n=_a(n)).h),i=ln(e.c,n.c),a=ln(e.l,n.l),o=ln(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var yp=pp(cn),gp=pp(ln);function mp(t){return function e(n){function r(e,r){var i=t((e=Ma(e)).h,(r=Ma(r)).h),a=ln(e.s,r.s),o=ln(e.l,r.l),s=ln(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}var vp=mp(cn),bp=mp(ln);function xp(t,e){for(var n=0,r=e.length-1,i=e[0],a=new Array(r<0?0:r);n1&&(e=t[a[o-2]],n=t[a[o-1]],r=t[s],(n[0]-e[0])*(r[1]-e[1])-(n[1]-e[1])*(r[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}var Ap=function(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e=0;--e)c.push(t[r[a[e]][2]]);for(e=+s;es!=c>s&&o<(u-n)*(s-r)/(c-r)+n&&(l=!l),u=n,c=r;return l},Mp=function(t){for(var e,n,r=-1,i=t.length,a=t[i-1],o=a[0],s=a[1],u=0;++r1);return t+n*a*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(Op),Dp=function t(e){function n(){var t=Np.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(Op),Lp=function t(e){function n(t){return function(){for(var n=0,r=0;rr&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function Jp(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i2?Qp:Jp,i=a=null,f}function f(e){return isNaN(e=+e)?n:(i||(i=r(o.map(t),s,u)))(t(c(e)))}return f.invert=function(n){return c(e((a||(a=r(s,o.map(t),wn)))(n)))},f.domain=function(t){return arguments.length?(o=jp.call(t,Wp),c===qp||(c=Xp(o)),l()):o.slice()},f.range=function(t){return arguments.length?(s=zp.call(t),l()):s.slice()},f.rangeRound=function(t){return s=zp.call(t),u=op,l()},f.clamp=function(t){return arguments.length?(c=t?Xp(o):qp,f):c!==qp},f.interpolate=function(t){return arguments.length?(u=t,l()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function ey(t,e){return ty()(t,e)}var ny=function(t,e,n,r){var i,a=M(t,e,n);switch((r=Us(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=nu(a,o))||(r.precision=i),Hs(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=ru(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=eu(a))||(r.precision=i-2*("%"===r.type))}return Ws(r)};function ry(t){var e=t.domain;return t.ticks=function(t){var n=e();return A(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return ny(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),a=0,o=i.length-1,s=i[a],u=i[o];return u0?r=T(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,n):r<0&&(r=T(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,n)),r>0?(i[a]=Math.floor(s/r)*r,i[o]=Math.ceil(u/r)*r,e(i)):r<0&&(i[a]=Math.ceil(s*r)/r,i[o]=Math.floor(u*r)/r,e(i)),t},t}function iy(){var t=ey(qp,qp);return t.copy=function(){return Kp(t,iy())},Ip.apply(t,arguments),ry(t)}function ay(t){var e;function n(t){return isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=jp.call(e,Wp),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return ay(t).unknown(e)},t=arguments.length?jp.call(t,Wp):[0,1],ry(n)}var oy=function(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],o=t[i];return o0){for(;hu)break;y.push(f)}}else for(;h=1;--l)if(!((f=c*l)u)break;y.push(f)}}else y=A(h,d,Math.min(d-h,p)).map(n);return r?y.reverse():y},r.tickFormat=function(t,i){if(null==i&&(i=10===a?".0e":","),"function"!=typeof i&&(i=Ws(i)),t===1/0)return i;null==t&&(t=10);var o=Math.max(1,a*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*a0?i[r-1]:e[0],r=r?[i[r-1],n]:[i[o-1],i[o]]},o.unknown=function(e){return arguments.length?(t=e,o):o},o.thresholds=function(){return i.slice()},o.copy=function(){return Ay().domain([e,n]).range(a).unknown(t)},Ip.apply(ry(o),arguments)}function Ty(){var t,e=[.5],n=[0,1],r=1;function i(i){return i<=i?n[u(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=zp.call(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=zp.call(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return Ty().domain(e).range(n).unknown(t)},Ip.apply(i,arguments)}var My=new Date,Oy=new Date;function Cy(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e0))return s;do{s.push(o=new Date(+n)),e(n,a),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return My.setTime(+e),Oy.setTime(+r),t(My),t(Oy),Math.floor(n(My,Oy))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Ny=Cy((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Ny.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Cy((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var Dy=Ny,Ly=Ny.range,Fy=Cy((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),Py=Fy,Iy=Fy.range;function Ry(t){return Cy((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var By=Ry(0),jy=Ry(1),zy=Ry(2),Yy=Ry(3),Uy=Ry(4),$y=Ry(5),Vy=Ry(6),Gy=By.range,Wy=jy.range,Hy=zy.range,qy=Yy.range,Zy=Uy.range,Xy=$y.range,Jy=Vy.range,Qy=Cy((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),Ky=Qy,tg=Qy.range,eg=Cy((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),ng=eg,rg=eg.range,ig=Cy((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),ag=ig,og=ig.range,sg=Cy((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),ug=sg,cg=sg.range,lg=Cy((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));lg.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Cy((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):lg:null};var fg=lg,hg=lg.range;function dg(t){return Cy((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var pg=dg(0),yg=dg(1),gg=dg(2),mg=dg(3),vg=dg(4),bg=dg(5),xg=dg(6),_g=pg.range,wg=yg.range,kg=gg.range,Eg=mg.range,Sg=vg.range,Ag=bg.range,Tg=xg.range,Mg=Cy((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),Og=Mg,Cg=Mg.range,Ng=Cy((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Ng.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Cy((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Dg=Ng,Lg=Ng.range;function Fg(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Pg(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ig(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Rg(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,o=t.shortDays,s=t.months,u=t.shortMonths,c=Zg(i),l=Xg(i),f=Zg(a),h=Xg(a),d=Zg(o),p=Xg(o),y=Zg(s),g=Xg(s),m=Zg(u),v=Xg(u),b={a:function(t){return o[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:mm,e:mm,f:wm,H:vm,I:bm,j:xm,L:_m,m:km,M:Em,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Qm,s:Km,S:Sm,u:Am,U:Tm,V:Mm,w:Om,W:Cm,x:null,X:null,y:Nm,Y:Dm,Z:Lm,"%":Jm},x={a:function(t){return o[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Fm,e:Fm,f:jm,H:Pm,I:Im,j:Rm,L:Bm,m:zm,M:Ym,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Qm,s:Km,S:Um,u:$m,U:Vm,V:Gm,w:Wm,W:Hm,x:null,X:null,y:qm,Y:Zm,Z:Xm,"%":Jm},_={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:sm,e:sm,f:dm,H:cm,I:cm,j:um,L:hm,m:om,M:lm,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l[r[0].toLowerCase()],n+r[0].length):-1},q:am,Q:ym,s:gm,S:fm,u:Qg,U:Kg,V:tm,w:Jg,W:em,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:rm,Y:nm,Z:im,"%":pm};function w(t,e){return function(n){var r,i,a,o=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=Pg(Ig(a.y,0,1))).getUTCDay(),r=i>4||0===i?yg.ceil(r):yg(r),r=Og.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=Fg(Ig(a.y,0,1))).getDay(),r=i>4||0===i?jy.ceil(r):jy(r),r=Ky.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?Pg(Ig(a.y,0,1)).getUTCDay():Fg(Ig(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,Pg(a)):Fg(a)}}function E(t,e,n,r){for(var i,a,o=0,s=e.length,u=n.length;o=u)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=_[i in $g?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var Bg,jg,zg,Yg,Ug,$g={"-":"",_:" ",0:"0"},Vg=/^\s*\d+/,Gg=/^%/,Wg=/[\\^$*+?|[\]().{}]/g;function Hg(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function im(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function am(t,e,n){var r=Vg.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function om(t,e,n){var r=Vg.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function sm(t,e,n){var r=Vg.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function um(t,e,n){var r=Vg.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function cm(t,e,n){var r=Vg.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function lm(t,e,n){var r=Vg.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function fm(t,e,n){var r=Vg.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function hm(t,e,n){var r=Vg.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function dm(t,e,n){var r=Vg.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function pm(t,e,n){var r=Gg.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ym(t,e,n){var r=Vg.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function gm(t,e,n){var r=Vg.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function mm(t,e){return Hg(t.getDate(),e,2)}function vm(t,e){return Hg(t.getHours(),e,2)}function bm(t,e){return Hg(t.getHours()%12||12,e,2)}function xm(t,e){return Hg(1+Ky.count(Dy(t),t),e,3)}function _m(t,e){return Hg(t.getMilliseconds(),e,3)}function wm(t,e){return _m(t,e)+"000"}function km(t,e){return Hg(t.getMonth()+1,e,2)}function Em(t,e){return Hg(t.getMinutes(),e,2)}function Sm(t,e){return Hg(t.getSeconds(),e,2)}function Am(t){var e=t.getDay();return 0===e?7:e}function Tm(t,e){return Hg(By.count(Dy(t)-1,t),e,2)}function Mm(t,e){var n=t.getDay();return t=n>=4||0===n?Uy(t):Uy.ceil(t),Hg(Uy.count(Dy(t),t)+(4===Dy(t).getDay()),e,2)}function Om(t){return t.getDay()}function Cm(t,e){return Hg(jy.count(Dy(t)-1,t),e,2)}function Nm(t,e){return Hg(t.getFullYear()%100,e,2)}function Dm(t,e){return Hg(t.getFullYear()%1e4,e,4)}function Lm(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Hg(e/60|0,"0",2)+Hg(e%60,"0",2)}function Fm(t,e){return Hg(t.getUTCDate(),e,2)}function Pm(t,e){return Hg(t.getUTCHours(),e,2)}function Im(t,e){return Hg(t.getUTCHours()%12||12,e,2)}function Rm(t,e){return Hg(1+Og.count(Dg(t),t),e,3)}function Bm(t,e){return Hg(t.getUTCMilliseconds(),e,3)}function jm(t,e){return Bm(t,e)+"000"}function zm(t,e){return Hg(t.getUTCMonth()+1,e,2)}function Ym(t,e){return Hg(t.getUTCMinutes(),e,2)}function Um(t,e){return Hg(t.getUTCSeconds(),e,2)}function $m(t){var e=t.getUTCDay();return 0===e?7:e}function Vm(t,e){return Hg(pg.count(Dg(t)-1,t),e,2)}function Gm(t,e){var n=t.getUTCDay();return t=n>=4||0===n?vg(t):vg.ceil(t),Hg(vg.count(Dg(t),t)+(4===Dg(t).getUTCDay()),e,2)}function Wm(t){return t.getUTCDay()}function Hm(t,e){return Hg(yg.count(Dg(t)-1,t),e,2)}function qm(t,e){return Hg(t.getUTCFullYear()%100,e,2)}function Zm(t,e){return Hg(t.getUTCFullYear()%1e4,e,4)}function Xm(){return"+0000"}function Jm(){return"%"}function Qm(t){return+t}function Km(t){return Math.floor(+t/1e3)}function tv(t){return Bg=Rg(t),jg=Bg.format,zg=Bg.parse,Yg=Bg.utcFormat,Ug=Bg.utcParse,Bg}function ev(t){return new Date(t)}function nv(t){return t instanceof Date?+t:+new Date(+t)}function rv(t,e,n,r,a,o,s,u,c){var l=ey(qp,qp),f=l.invert,h=l.domain,d=c(".%L"),p=c(":%S"),y=c("%I:%M"),g=c("%I %p"),m=c("%a %d"),v=c("%b %d"),b=c("%B"),x=c("%Y"),_=[[s,1,1e3],[s,5,5e3],[s,15,15e3],[s,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[a,1,36e5],[a,3,108e5],[a,6,216e5],[a,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function w(i){return(s(i)1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Gb.h=360*t-100,Gb.s=1.5-1.5*e,Gb.l=.8-.9*e,Gb+""},Hb=He(),qb=Math.PI/3,Zb=2*Math.PI/3,Xb=function(t){var e;return t=(.5-t)*Math.PI,Hb.r=255*(e=Math.sin(t))*e,Hb.g=255*(e=Math.sin(t+qb))*e,Hb.b=255*(e=Math.sin(t+Zb))*e,Hb+""},Jb=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"};function Qb(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Kb=Qb(Ov("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),tx=Qb(Ov("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),ex=Qb(Ov("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),nx=Qb(Ov("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),rx=function(t){return we(ne(t).call(document.documentElement))},ix=0;function ax(){return new ox}function ox(){this._="@"+(++ix).toString(36)}ox.prototype=ax.prototype={constructor:ox,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var sx=function(t){return"string"==typeof t?new be([document.querySelectorAll(t)],[document.documentElement]):new be([null==t?[]:t],ve)},ux=function(t,e){null==e&&(e=Mn().touches);for(var n=0,r=e?e.length:0,i=new Array(r);n1?0:t<-1?mx:Math.acos(t)}function _x(t){return t>=1?vx:t<=-1?-vx:Math.asin(t)}function wx(t){return t.innerRadius}function kx(t){return t.outerRadius}function Ex(t){return t.startAngle}function Sx(t){return t.endAngle}function Ax(t){return t&&t.padAngle}function Tx(t,e,n,r,i,a,o,s){var u=n-t,c=r-e,l=o-i,f=s-a,h=f*u-l*c;if(!(h*h<1e-12))return[t+(h=(l*(e-a)-f*(t-i))/h)*u,e+h*c]}function Mx(t,e,n,r,i,a,o){var s=t-n,u=e-r,c=(o?a:-a)/gx(s*s+u*u),l=c*u,f=-c*s,h=t+l,d=e+f,p=n+l,y=r+f,g=(h+p)/2,m=(d+y)/2,v=p-h,b=y-d,x=v*v+b*b,_=i-a,w=h*y-p*d,k=(b<0?-1:1)*gx(dx(0,_*_*x-w*w)),E=(w*b-v*k)/x,S=(-w*v-b*k)/x,A=(w*b+v*k)/x,T=(-w*v+b*k)/x,M=E-g,O=S-m,C=A-g,N=T-m;return M*M+O*O>C*C+N*N&&(E=A,S=T),{cx:E,cy:S,x01:-l,y01:-f,x11:E*(i/_-1),y11:S*(i/_-1)}}var Ox=function(){var t=wx,e=kx,n=cx(0),r=null,i=Ex,a=Sx,o=Ax,s=null;function u(){var u,c,l=+t.apply(this,arguments),f=+e.apply(this,arguments),h=i.apply(this,arguments)-vx,d=a.apply(this,arguments)-vx,p=lx(d-h),y=d>h;if(s||(s=u=Yi()),f1e-12)if(p>bx-1e-12)s.moveTo(f*hx(h),f*yx(h)),s.arc(0,0,f,h,d,!y),l>1e-12&&(s.moveTo(l*hx(d),l*yx(d)),s.arc(0,0,l,d,h,y));else{var g,m,v=h,b=d,x=h,_=d,w=p,k=p,E=o.apply(this,arguments)/2,S=E>1e-12&&(r?+r.apply(this,arguments):gx(l*l+f*f)),A=px(lx(f-l)/2,+n.apply(this,arguments)),T=A,M=A;if(S>1e-12){var O=_x(S/l*yx(E)),C=_x(S/f*yx(E));(w-=2*O)>1e-12?(x+=O*=y?1:-1,_-=O):(w=0,x=_=(h+d)/2),(k-=2*C)>1e-12?(v+=C*=y?1:-1,b-=C):(k=0,v=b=(h+d)/2)}var N=f*hx(v),D=f*yx(v),L=l*hx(_),F=l*yx(_);if(A>1e-12){var P,I=f*hx(b),R=f*yx(b),B=l*hx(x),j=l*yx(x);if(p1e-12?M>1e-12?(g=Mx(B,j,N,D,f,M,y),m=Mx(I,R,L,F,f,M,y),s.moveTo(g.cx+g.x01,g.cy+g.y01),M1e-12&&w>1e-12?T>1e-12?(g=Mx(L,F,I,R,l,-T,y),m=Mx(N,D,B,j,l,-T,y),s.lineTo(g.cx+g.x01,g.cy+g.y01),T=l;--f)s.point(g[f],m[f]);s.lineEnd(),s.areaEnd()}y&&(g[c]=+t(h,c,u),m[c]=+n(h,c,u),s.point(e?+e(h,c,u):g[c],r?+r(h,c,u):m[c]))}if(d)return s=null,d+""||null}function c(){return Fx().defined(i).curve(o).context(a)}return u.x=function(n){return arguments.length?(t="function"==typeof n?n:cx(+n),e=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:cx(+e),u):t},u.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:cx(+t),u):e},u.y=function(t){return arguments.length?(n="function"==typeof t?t:cx(+t),r=null,u):n},u.y0=function(t){return arguments.length?(n="function"==typeof t?t:cx(+t),u):n},u.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:cx(+t),u):r},u.lineX0=u.lineY0=function(){return c().x(t).y(n)},u.lineY1=function(){return c().x(t).y(r)},u.lineX1=function(){return c().x(e).y(n)},u.defined=function(t){return arguments.length?(i="function"==typeof t?t:cx(!!t),u):i},u.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),u):o},u.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),u):a},u},Ix=function(t,e){return et?1:e>=t?0:NaN},Rx=function(t){return t},Bx=function(){var t=Rx,e=Ix,n=null,r=cx(0),i=cx(bx),a=cx(0);function o(o){var s,u,c,l,f,h=o.length,d=0,p=new Array(h),y=new Array(h),g=+r.apply(this,arguments),m=Math.min(bx,Math.max(-bx,i.apply(this,arguments)-g)),v=Math.min(Math.abs(m)/h,a.apply(this,arguments)),b=v*(m<0?-1:1);for(s=0;s0&&(d+=f);for(null!=e?p.sort((function(t,n){return e(y[t],y[n])})):null!=n&&p.sort((function(t,e){return n(o[t],o[e])})),s=0,c=d?(m-h*b)/d:0;s0?f*c:0)+b,y[u]={data:o[u],index:s,value:f,startAngle:g,endAngle:l,padAngle:v};return y}return o.value=function(e){return arguments.length?(t="function"==typeof e?e:cx(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:cx(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:cx(+t),o):i},o.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:cx(+t),o):a},o},jx=Yx(Nx);function zx(t){this._curve=t}function Yx(t){function e(e){return new zx(t(e))}return e._curve=t,e}function Ux(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(Yx(t)):e()._curve},t}zx.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var $x=function(){return Ux(Fx().curve(jx))},Vx=function(){var t=Px().curve(jx),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Ux(n())},delete t.lineX0,t.lineEndAngle=function(){return Ux(r())},delete t.lineX1,t.lineInnerRadius=function(){return Ux(i())},delete t.lineY0,t.lineOuterRadius=function(){return Ux(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Yx(t)):e()._curve},t},Gx=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]},Wx=Array.prototype.slice;function Hx(t){return t.source}function qx(t){return t.target}function Zx(t){var e=Hx,n=qx,r=Dx,i=Lx,a=null;function o(){var o,s=Wx.call(arguments),u=e.apply(this,s),c=n.apply(this,s);if(a||(a=o=Yi()),t(a,+r.apply(this,(s[0]=u,s)),+i.apply(this,s),+r.apply(this,(s[0]=c,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(t){return arguments.length?(e=t,o):e},o.target=function(t){return arguments.length?(n=t,o):n},o.x=function(t){return arguments.length?(r="function"==typeof t?t:cx(+t),o):r},o.y=function(t){return arguments.length?(i="function"==typeof t?t:cx(+t),o):i},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o}function Xx(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function Jx(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function Qx(t,e,n,r,i){var a=Gx(e,n),o=Gx(e,n=(n+i)/2),s=Gx(r,n),u=Gx(r,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],u[0],u[1])}function Kx(){return Zx(Xx)}function t_(){return Zx(Jx)}function e_(){var t=Zx(Qx);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var n_={draw:function(t,e){var n=Math.sqrt(e/mx);t.moveTo(n,0),t.arc(0,0,n,0,bx)}},r_={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},i_=Math.sqrt(1/3),a_=2*i_,o_={draw:function(t,e){var n=Math.sqrt(e/a_),r=n*i_;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},s_=Math.sin(mx/10)/Math.sin(7*mx/10),u_=Math.sin(bx/10)*s_,c_=-Math.cos(bx/10)*s_,l_={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),r=u_*n,i=c_*n;t.moveTo(0,-n),t.lineTo(r,i);for(var a=1;a<5;++a){var o=bx*a/5,s=Math.cos(o),u=Math.sin(o);t.lineTo(u*n,-s*n),t.lineTo(s*r-u*i,u*r+s*i)}t.closePath()}},f_={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},h_=Math.sqrt(3),d_={draw:function(t,e){var n=-Math.sqrt(e/(3*h_));t.moveTo(0,2*n),t.lineTo(-h_*n,-n),t.lineTo(h_*n,-n),t.closePath()}},p_=Math.sqrt(3)/2,y_=1/Math.sqrt(12),g_=3*(y_/2+1),m_={draw:function(t,e){var n=Math.sqrt(e/g_),r=n/2,i=n*y_,a=r,o=n*y_+n,s=-a,u=o;t.moveTo(r,i),t.lineTo(a,o),t.lineTo(s,u),t.lineTo(-.5*r-p_*i,p_*r+-.5*i),t.lineTo(-.5*a-p_*o,p_*a+-.5*o),t.lineTo(-.5*s-p_*u,p_*s+-.5*u),t.lineTo(-.5*r+p_*i,-.5*i-p_*r),t.lineTo(-.5*a+p_*o,-.5*o-p_*a),t.lineTo(-.5*s+p_*u,-.5*u-p_*s),t.closePath()}},v_=[n_,r_,o_,f_,l_,d_,m_],b_=function(){var t=cx(n_),e=cx(64),n=null;function r(){var r;if(n||(n=r=Yi()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(e){return arguments.length?(t="function"==typeof e?e:cx(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:cx(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r},x_=function(){};function __(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function w_(t){this._context=t}w_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:__(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:__(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var k_=function(t){return new w_(t)};function E_(t){this._context=t}E_.prototype={areaStart:x_,areaEnd:x_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:__(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var S_=function(t){return new E_(t)};function A_(t){this._context=t}A_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:__(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var T_=function(t){return new A_(t)};function M_(t,e){this._basis=new w_(t),this._beta=e}M_.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],o=t[n]-i,s=e[n]-a,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*o),this._beta*e[u]+(1-this._beta)*(a+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var O_=function t(e){function n(t){return 1===e?new w_(t):new M_(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function C_(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function N_(t,e){this._context=t,this._k=(1-e)/6}N_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:C_(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:C_(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var D_=function t(e){function n(t){return new N_(t,e)}return n.tension=function(e){return t(+e)},n}(0);function L_(t,e){this._context=t,this._k=(1-e)/6}L_.prototype={areaStart:x_,areaEnd:x_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:C_(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var F_=function t(e){function n(t){return new L_(t,e)}return n.tension=function(e){return t(+e)},n}(0);function P_(t,e){this._context=t,this._k=(1-e)/6}P_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:C_(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var I_=function t(e){function n(t){return new P_(t,e)}return n.tension=function(e){return t(+e)},n}(0);function R_(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/l,o=(o*c+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,a,o,t._x2,t._y2)}function B_(t,e){this._context=t,this._alpha=e}B_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:R_(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var j_=function t(e){function n(t){return e?new B_(t,e):new N_(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function z_(t,e){this._context=t,this._alpha=e}z_.prototype={areaStart:x_,areaEnd:x_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:R_(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Y_=function t(e){function n(t){return e?new z_(t,e):new L_(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function U_(t,e){this._context=t,this._alpha=e}U_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:R_(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var $_=function t(e){function n(t){return e?new U_(t,e):new P_(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function V_(t){this._context=t}V_.prototype={areaStart:x_,areaEnd:x_,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var G_=function(t){return new V_(t)};function W_(t){return t<0?-1:1}function H_(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(W_(a)+W_(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function q_(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Z_(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function X_(t){this._context=t}function J_(t){this._context=new Q_(t)}function Q_(t){this._context=t}function K_(t){return new X_(t)}function tw(t){return new J_(t)}function ew(t){this._context=t}function nw(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var aw=function(t){return new iw(t,.5)};function ow(t){return new iw(t,0)}function sw(t){return new iw(t,1)}var uw=function(t,e){if((i=t.length)>1)for(var n,r,i,a=1,o=t[e[0]],s=o.length;a=0;)n[e]=e;return n};function lw(t,e){return t[e]}var fw=function(){var t=cx([]),e=cw,n=uw,r=lw;function i(i){var a,o,s=t.apply(this,arguments),u=i.length,c=s.length,l=new Array(c);for(a=0;a0){for(var n,r,i,a=0,o=t[0].length;a0)for(var n,r,i,a,o,s,u=0,c=t[e[0]].length;u0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=o,r[0]=o+=i):(r[0]=0,r[1]=i)},pw=function(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],a=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,a=0,o=1;oa&&(a=e,r=n);return r}var vw=function(t){var e=t.map(bw);return cw(t).sort((function(t,n){return e[t]-e[n]}))};function bw(t){for(var e,n=0,r=-1,i=t.length;++r0)){if(a/=h,h<0){if(a0){if(a>f)return;a>l&&(l=a)}if(a=r-u,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>l&&(l=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>l&&(l=a)}if(a=i-c,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>l&&(l=a)}else if(d>0){if(a0||f<1)||(l>0&&(t[0]=[u+l*h,c+l*d]),f<1&&(t[1]=[u+f*h,c+f*d]),!0)}}}}}function jw(t,e,n,r,i){var a=t[1];if(a)return!0;var o,s,u=t[0],c=t.left,l=t.right,f=c[0],h=c[1],d=l[0],p=l[1],y=(f+d)/2,g=(h+p)/2;if(p===h){if(y=r)return;if(f>d){if(u){if(u[1]>=i)return}else u=[y,n];a=[y,i]}else{if(u){if(u[1]1)if(f>d){if(u){if(u[1]>=i)return}else u=[(n-s)/o,n];a=[(i-s)/o,i]}else{if(u){if(u[1]=r)return}else u=[e,o*e+s];a=[r,o*r+s]}else{if(u){if(u[0]=-sk)){var d=u*u+c*c,p=l*l+f*f,y=(f*d-c*p)/h,g=(u*p-l*d)/h,m=Vw.pop()||new Gw;m.arc=t,m.site=i,m.x=y+o,m.y=(m.cy=g+s)+Math.sqrt(y*y+g*g),t.circle=m;for(var v=null,b=ik._;b;)if(m.yok)s=s.L;else{if(!((i=a-ek(s,o))>ok)){r>-ok?(e=s.P,n=s):i>-ok?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}!function(t){rk[t.index]={site:t,halfedges:[]}}(t);var u=Xw(t);if(nk.insert(e,u),e||n){if(e===n)return Hw(e),n=Xw(e.site),nk.insert(u,n),u.edge=n.edge=Pw(e.site,u.site),Ww(e),void Ww(n);if(n){Hw(e),Hw(n);var c=e.site,l=c[0],f=c[1],h=t[0]-l,d=t[1]-f,p=n.site,y=p[0]-l,g=p[1]-f,m=2*(h*g-d*y),v=h*h+d*d,b=y*y+g*g,x=[(g*v-d*b)/m+l,(h*b-y*v)/m+f];Rw(n.edge,c,p,x),u.edge=Pw(c,t,null,x),n.edge=Pw(t,p,null,x),Ww(e),Ww(n)}else u.edge=Pw(e.site,u.site)}}function tk(t,e){var n=t.site,r=n[0],i=n[1],a=i-e;if(!a)return r;var o=t.P;if(!o)return-1/0;var s=(n=o.site)[0],u=n[1],c=u-e;if(!c)return s;var l=s-r,f=1/a-1/c,h=l/c;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*c)-u+c/2+i-a/2)))/f+r:(r+s)/2}function ek(t,e){var n=t.N;if(n)return tk(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var nk,rk,ik,ak,ok=1e-6,sk=1e-12;function uk(t,e){return e[1]-t[1]||e[0]-t[0]}function ck(t,e){var n,r,i,a=t.sort(uk).pop();for(ak=[],rk=new Array(t.length),nk=new Fw,ik=new Fw;;)if(i=$w,a&&(!i||a[1]ok||Math.abs(i[0][1]-i[1][1])>ok)||delete ak[a]}(o,s,u,c),function(t,e,n,r){var i,a,o,s,u,c,l,f,h,d,p,y,g=rk.length,m=!0;for(i=0;iok||Math.abs(y-h)>ok)&&(u.splice(s,0,ak.push(Iw(o,d,Math.abs(p-t)ok?[t,Math.abs(f-t)ok?[Math.abs(h-r)ok?[n,Math.abs(f-n)ok?[Math.abs(h-e)=s)return null;var u=t-i.site[0],c=e-i.site[1],l=u*u+c*c;do{i=a.cells[r=o],o=null,i.halfedges.forEach((function(n){var r=a.edges[n],s=r.left;if(s!==i.site&&s||(s=r.right)){var u=t-s[0],c=e-s[1],f=u*u+c*c;fr?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}var Ek=function(){var t,e,n=vk,r=bk,i=kk,a=_k,o=wk,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,l=cp,f=lt("start","zoom","end"),h=0;function d(t){t.property("__zoom",xk).on("wheel.zoom",x).on("mousedown.zoom",_).on("dblclick.zoom",w).filter(o).on("touchstart.zoom",k).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new dk(e,t.x,t.y)}function y(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new dk(t.k,r,i)}function g(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function m(t,e,n){t.on("start.zoom",(function(){v(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){v(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,a=v(t,i),o=r.apply(t,i),s=null==n?g(o):"function"==typeof n?n.apply(t,i):n,u=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),c=t.__zoom,f="function"==typeof e?e.apply(t,i):e,h=l(c.invert(s).concat(u/c.k),f.invert(s).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=h(t),n=u/e[2];t=new dk(n,s[0]-e[0]*n,s[1]-e[1]*n)}a.zoom(null,t)}}))}function v(t,e,n){return!n&&t.__zooming||new b(t,e)}function b(t,e){this.that=t,this.args=e,this.active=0,this.extent=r.apply(t,e),this.taps=0}function x(){if(n.apply(this,arguments)){var t=v(this,arguments),e=this.__zoom,r=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,a.apply(this,arguments)))),o=Nn(this);if(t.wheel)t.mouse[0][0]===o[0]&&t.mouse[0][1]===o[1]||(t.mouse[1]=e.invert(t.mouse[0]=o)),clearTimeout(t.wheel);else{if(e.k===r)return;t.mouse=[o,e.invert(o)],ar(this),t.start()}mk(),t.wheel=setTimeout(c,150),t.zoom("mouse",i(y(p(e,r),t.mouse[0],t.mouse[1]),t.extent,u))}function c(){t.wheel=null,t.end()}}function _(){if(!e&&n.apply(this,arguments)){var t=v(this,arguments,!0),r=we(ue.view).on("mousemove.zoom",c,!0).on("mouseup.zoom",l,!0),a=Nn(this),o=ue.clientX,s=ue.clientY;Se(ue.view),gk(),t.mouse=[a,this.__zoom.invert(a)],ar(this),t.start()}function c(){if(mk(),!t.moved){var e=ue.clientX-o,n=ue.clientY-s;t.moved=e*e+n*n>h}t.zoom("mouse",i(y(t.that.__zoom,t.mouse[0]=Nn(t.that),t.mouse[1]),t.extent,u))}function l(){r.on("mousemove.zoom mouseup.zoom",null),Ae(ue.view,t.moved),mk(),t.end()}}function w(){if(n.apply(this,arguments)){var t=this.__zoom,e=Nn(this),a=t.invert(e),o=t.k*(ue.shiftKey?.5:2),s=i(y(p(t,o),e,a),r.apply(this,arguments),u);mk(),c>0?we(this).transition().duration(c).call(m,s,e):we(this).call(d.transform,s)}}function k(){if(n.apply(this,arguments)){var e,r,i,a,o=ue.touches,s=o.length,u=v(this,arguments,ue.changedTouches.length===s);for(gk(),r=0;rf&&M.push("'"+this.terminals_[S]+"'");C=p.showPosition?"Parse error on line "+(u+1)+":\n"+p.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(u+1)+": Unexpected "+(x==h?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(C,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:m,expected:M})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+x);switch(k[0]){case 1:n.push(x),i.push(p.yytext),a.push(p.yylloc),n.push(k[1]),x=null,_?(x=_,_=null):(c=p.yyleng,s=p.yytext,u=p.yylineno,m=p.yylloc,l>0&&l--);break;case 2:if(A=this.productions_[k[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},v&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(O,[s,c,u,y.yy,k[1],i,a].concat(d))))return E;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[k[1]][0]),i.push(O.$),a.push(O._$),T=o[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},A={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 5;case 1:case 2:case 3:case 4:break;case 5:return this.begin("ID"),10;case 6:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),42;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(),5;case 9:return this.begin("LINE"),21;case 10:return this.begin("LINE"),23;case 11:return this.begin("LINE"),24;case 12:return this.begin("LINE"),25;case 13:return this.begin("LINE"),30;case 14:return this.begin("LINE"),27;case 15:return this.begin("LINE"),29;case 16:return this.popState(),13;case 17:return 22;case 18:return 37;case 19:return 38;case 20:return 33;case 21:return 31;case 22:return this.begin("ID"),16;case 23:return this.begin("ID"),17;case 24:return 19;case 25:return 6;case 26:return 15;case 27:return 36;case 28:return 5;case 29:return e.yytext=e.yytext.trim(),42;case 30:return 45;case 31:return 46;case 32:return 43;case 33:return 44;case 34:return 47;case 35:return 48;case 36:return 49;case 37:return 40;case 38:return 41;case 39:return 5;case 40:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:participant\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[2,3,16],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],inclusive:!0}}};function T(){this.yy={}}return S.lexer=A,T.prototype=S,S.Parser=T,new T}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(14).readFileSync(n(15).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(13),n(6)(t))},function(t,e,n){var r=n(169);t.exports={Graph:r.Graph,json:n(272),alg:n(273),version:r.version}},function(t,e,n){var r;try{r={cloneDeep:n(284),constant:n(78),defaults:n(137),each:n(79),filter:n(111),find:n(285),flatten:n(139),forEach:n(109),forIn:n(290),has:n(85),isUndefined:n(122),last:n(291),map:n(123),mapValues:n(292),max:n(293),merge:n(295),min:n(300),minBy:n(301),now:n(302),pick:n(144),range:n(145),reduce:n(125),sortBy:n(309),uniqueId:n(146),values:n(130),zipObject:n(314)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){ +var t,e;(function(){var t;(t=class t extends this.OS.application.BaseApplication{constructor(t){super("GraphEditor",t)}main(){return mermaid.initialize({theme:"forest"}),this.currfile=this.args&&this.args.length>0?this.args[0].path.asFileHandle():"Untitled".asFileHandle(),this.currfile.dirty=!1,this.datarea=this.find("datarea"),this.preview=this.find("preview"),this.btctn=this.find("btn-container"),ace.config.set("basePath","/scripts/ace"),this.editor=ace.edit(this.datarea),this.editor.setOptions({enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,fontSize:"11pt"}),this.editor.getSession().setUseWrapMode(!0),this.editor.session.setMode("ace/mode/text"),this.editor.setTheme("ace/theme/monokai"),this.editor.on("input",()=>this.editormux?(this.editormux=!1,!1):this.currfile.dirty?void 0:this.currfile.dirty=!0),this.currfile.basename||(this.editormux=!0,this.editor.setValue(t.dummymermaid),this.renderSVG(!1)),this.editor.container.addEventListener("keydown",t=>{if(13===t.keyCode)return this.renderSVG(!0)},!0),this.bindKey("CTRL-R",()=>this.renderSVG(!1)),this.bindKey("ALT-G",()=>this.export("SVG")),this.bindKey("ALT-P",()=>this.export("PNG")),this.bindKey("ALT-N",()=>this.actionFile(this.name+"-New")),this.bindKey("ALT-O",()=>this.actionFile(this.name+"-Open")),this.bindKey("CTRL-S",()=>this.actionFile(this.name+"-Save")),this.bindKey("ALT-W",()=>this.actionFile(this.name+"-Saveas")),this.bindKey("CTRL-M",()=>this.svgToCanvas((function(){}))),this.on("hboxchange",()=>(this.editor.resize(),this.calibrate())),this.on("focus",()=>this.editor.focus()),this.find("btn-zoomin").onbtclick=t=>{if(this.pan)return this.pan.zoomIn()},this.find("btn-zoomout").onbtclick=t=>{if(this.pan)return this.pan.zoomOut()},this.find("btn-reset").onbtclick=t=>{if(this.pan)return this.pan.resetZoom()},this.open(this.currfile)}menu(){return[{text:"__(File)",nodes:[{text:"__(New)",dataid:this.name+"-New",shortcut:"A-N"},{text:"__(Open)",dataid:this.name+"-Open",shortcut:"A-O"},{text:"__(Save)",dataid:this.name+"-Save",shortcut:"C-S"},{text:"__(Save as)",dataid:this.name+"-Saveas",shortcut:"A-W"},{text:"__(Render)",dataid:this.name+"-Render",shortcut:"C-R"},{text:"__(Export as)",nodes:[{text:"SVG",shortcut:"A-G"},{text:"PNG",shortcut:"A-P"}],onchildselect:t=>this.export(t.data.item.data.text)}],onchildselect:t=>this.actionFile(t.data.item.data.dataid)}]}open(t){if("Untitled"!==t.path)return t.dirty=!1,t.read().then(e=>(this.currfile=t,this.editormux=!0,this.currfile.dirty=!1,this.editor.setValue(e),this.scheme.apptitle=""+this.currfile.basename,this.renderSVG(!1))).catch(t=>this.error(t.toString(),t))}save(t){return t.write("text/plain").then(e=>(t.dirty=!1,t.text=t.basename,this.scheme.apptitle=""+this.currfile.basename)).catch(t=>this.error(t.toString(),t))}actionFile(t){var e;switch(e=()=>this.openDialog("FileDialog",{title:__("Save as"),file:this.currfile}).then(t=>(this.currfile.setPath(`${t.file.path}/${t.name}`),this.save(this.currfile))).catch(t=>this.error(t.toString(),t)),t){case this.name+"-Open":return this.openDialog("FileDialog",{title:__("Open file")}).then((t,e)=>this.open(t.file.path.asFileHandle())).catch(t=>this.error(t.toString(),t));case this.name+"-Save":return this.currfile.cache=this.editor.getValue(),this.currfile.basename?this.save(this.currfile):e();case this.name+"-Saveas":return this.currfile.cache=this.editor.getValue(),e();case this.name+"-Render":return this.renderSVG(!1);case this.name+"-New":return this.currfile="Untitled".asFileHandle(),this.currfile.cache="",this.currfile.dirty=!1,this.editormux=!0,this.editor.setValue("")}}export(t){return this.openDialog("FileDialog",{title:__("Export as"),file:this.currfile}).then(e=>{var n,r;r=`${e.file.path}/${e.name}`.asFileHandle();try{switch(t){case"SVG":return r.cache=this.svgtext(),r.write("text/plain").then(t=>this.notify(__("File exported"))).catch(e=>this.error(__("Cannot export to {0}: {1}",t,e.toString()),e));case"PNG":return this.svgToCanvas(e=>{var n;try{return r.cache=e.toDataURL("image/png"),r.write("base64").then(t=>this.notify(__("File exported"))).catch(e=>this.error(__("Cannot export to {0}: {1}",t,e.toString()),e))}catch(t){return n=t,this.error(__("Cannot export to PNG in this browser: {0}",n.toString()),n)}})}}catch(t){return n=t,this.error(__("Cannot export: {0}",n.message),n)}}).catch(t=>this.error(t.toString(),t))}renderSVG(t){var e,n,r;n=Math.floor(1e5*Math.random())+1,r=this.editor.getValue();try{mermaid.parse(r)}catch(n){return e=n,void(t||this.error(__("Syntax error: {0}",e.toString()),e))}return mermaid.render("c"+n,r,(t,e)=>{var n;return this.preview.innerHTML=t,$(this.preview).append(this.btctn),this.calibrate(),n=$(this.preview).children("svg")[0],this.pan=svgPanZoom(n,{zoomEnabled:!0,controlIconsEnabled:!1,fit:!0,center:!0,minZoom:.1})},this.preview)}svgtext(){var t;return t=$(this.preview).children("svg")[0],$("g.label",t).each(t=>$(this).css("font-family","Ubuntu").css("font-size","13px")),$("text",t).each(t=>$(this).css("font-family","Ubuntu").css("font-size","13px")),(new XMLSerializer).serializeToString(t)}svgToCanvas(t){var e,n,r,i,a;return(n=new Image).crossOrigin="anonymous",i=this.svgtext(),e=window.URL||window.webkitURL||window,r=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),a=e.createObjectURL(r),n.onload=()=>{var e;return(e=this.find("offscreen")).width=n.width,e.height=n.height,e.getContext("2d").drawImage(n,0,0,n.width,n.height),t(e)},n.src=a}calibrate(){var t,e;if(e=$(this.preview).children("svg")[0])return t=[$(this.preview).width(),$(this.preview).height()],$(e).attr("width",t[0]+"px"),$(e).attr("height",t[1]+"px")}cleanup(t){if(this.currfile&&this.currfile.dirty)return t.preventDefault(),this.ask({title:__("Quit"),text:__("Quit without saving ?")}).then(t=>{if(t)return this.currfile.dirty=!1,this.quit()})}}).dummymermaid="classDiagram\nClass01 <|-- AveryLongClass : Cool\nClass03 *-- Class04\nClass05 o-- Class06\nClass07 .. Class08\nClass09 --\x3e C2 : Where am i?\nClass09 --* C3\nClass09 --|> Class07\nClass07 : equals()\nClass07 : Object[] elementData\nClass01 : size()\nClass01 : int chimp\nClass01 : int gorilla\nClass08 <--\x3e C2: Cool label",t.dependencies=["os://scripts/ace/ace.js"],this.OS.register("GraphEditor",t)}).call(this),function t(e,n,r){function i(o,s){if(!n[o]){if(!e[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[o]={exports:{}};e[o][0].call(l.exports,(function(t){return i(e[o][1][t]||t)}),l,l.exports,t,e,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o=0;r--)this.eventListeners.hasOwnProperty(n[r])&&delete this.eventListeners[n[r]]}for(var i in this.eventListeners)(this.options.eventsListenerElement||this.svg).addEventListener(i,this.eventListeners[i],!1);this.options.mouseWheelZoomEnabled&&(this.options.mouseWheelZoomEnabled=!1,this.enableMouseWheelZoom())},u.prototype.enableMouseWheelZoom=function(){if(!this.options.mouseWheelZoomEnabled){var t=this;this.wheelListener=function(e){return t.handleMouseWheel(e)},r.on(this.options.eventsListenerElement||this.svg,this.wheelListener,!1),this.options.mouseWheelZoomEnabled=!0}},u.prototype.disableMouseWheelZoom=function(){this.options.mouseWheelZoomEnabled&&(r.off(this.options.eventsListenerElement||this.svg,this.wheelListener,!1),this.options.mouseWheelZoomEnabled=!1)},u.prototype.handleMouseWheel=function(t){if(this.options.zoomEnabled&&"none"===this.state){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1);var e=t.deltaY||1,n=Date.now()-this.lastMouseWheelEventTime,r=3+Math.max(0,30-n);this.lastMouseWheelEventTime=Date.now(),"deltaMode"in t&&0===t.deltaMode&&t.wheelDelta&&(e=0===t.deltaY?0:Math.abs(t.wheelDelta)/t.deltaY),e=-.30?1:-1)*Math.log(Math.abs(e)+10)/r;var i=this.svg.getScreenCTM().inverse(),a=o.getEventPoint(t,this.svg).matrixTransform(i),s=Math.pow(1+this.options.zoomScaleSensitivity,-1*e);this.zoomAtPoint(s,a)}},u.prototype.zoomAtPoint=function(t,e,n){var r=this.viewport.getOriginalState();n?(t=Math.max(this.options.minZoom*r.zoom,Math.min(this.options.maxZoom*r.zoom,t)),t/=this.getZoom()):this.getZoom()*tthis.options.maxZoom*r.zoom&&(t=this.options.maxZoom*r.zoom/this.getZoom());var i=this.viewport.getCTM(),a=e.matrixTransform(i.inverse()),o=this.svg.createSVGMatrix().translate(a.x,a.y).scale(t).translate(-a.x,-a.y),s=i.multiply(o);s.a!==i.a&&this.viewport.setCTM(s)},u.prototype.zoom=function(t,e){this.zoomAtPoint(t,o.getSvgCenterPoint(this.svg,this.width,this.height),e)},u.prototype.publicZoom=function(t,e){e&&(t=this.computeFromRelativeZoom(t)),this.zoom(t,e)},u.prototype.publicZoomAtPoint=function(t,e,n){if(n&&(t=this.computeFromRelativeZoom(t)),"SVGPoint"!==a.getType(e)){if(!("x"in e)||!("y"in e))throw new Error("Given point is invalid");e=o.createSVGPoint(this.svg,e.x,e.y)}this.zoomAtPoint(t,e,n)},u.prototype.getZoom=function(){return this.viewport.getZoom()},u.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()},u.prototype.computeFromRelativeZoom=function(t){return t*this.viewport.getOriginalState().zoom},u.prototype.resetZoom=function(){var t=this.viewport.getOriginalState();this.zoom(t.zoom,!0)},u.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())},u.prototype.reset=function(){this.resetZoom(),this.resetPan()},u.prototype.handleDblClick=function(t){var e;if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),this.options.controlIconsEnabled&&(t.target.getAttribute("class")||"").indexOf("svg-pan-zoom-control")>-1)return!1;e=t.shiftKey?1/(2*(1+this.options.zoomScaleSensitivity)):2*(1+this.options.zoomScaleSensitivity);var n=o.getEventPoint(t,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(e,n)},u.prototype.handleMouseDown=function(t,e){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),a.mouseAndTouchNormalize(t,this.svg),this.options.dblClickZoomEnabled&&a.isDblClick(t,e)?this.handleDblClick(t):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=o.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()))},u.prototype.handleMouseMove=function(t){if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),"pan"===this.state&&this.options.panEnabled){var e=o.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()),n=this.firstEventCTM.translate(e.x-this.stateOrigin.x,e.y-this.stateOrigin.y);this.viewport.setCTM(n)}},u.prototype.handleMouseUp=function(t){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),"pan"===this.state&&(this.state="none")},u.prototype.fit=function(){var t=this.viewport.getViewBox(),e=Math.min(this.width/t.width,this.height/t.height);this.zoom(e,!0)},u.prototype.contain=function(){var t=this.viewport.getViewBox(),e=Math.max(this.width/t.width,this.height/t.height);this.zoom(e,!0)},u.prototype.center=function(){var t=this.viewport.getViewBox(),e=.5*(this.width-(t.width+2*t.x)*this.getZoom()),n=.5*(this.height-(t.height+2*t.y)*this.getZoom());this.getPublicInstance().pan({x:e,y:n})},u.prototype.updateBBox=function(){this.viewport.simpleViewBoxCache()},u.prototype.pan=function(t){var e=this.viewport.getCTM();e.e=t.x,e.f=t.y,this.viewport.setCTM(e)},u.prototype.panBy=function(t){var e=this.viewport.getCTM();e.e+=t.x,e.f+=t.y,this.viewport.setCTM(e)},u.prototype.getPan=function(){var t=this.viewport.getState();return{x:t.x,y:t.y}},u.prototype.resize=function(){var t=o.getBoundingClientRectNormalized(this.svg);this.width=t.width,this.height=t.height;var e=this.viewport;e.options.width=this.width,e.options.height=this.height,e.processCTM(),this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())},u.prototype.destroy=function(){var t=this;for(var e in this.beforeZoom=null,this.onZoom=null,this.beforePan=null,this.onPan=null,this.onUpdatedCTM=null,null!=this.options.customEventsHandler&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()}),this.eventListeners)(this.options.eventsListenerElement||this.svg).removeEventListener(e,this.eventListeners[e],!1);this.disableMouseWheelZoom(),this.getPublicInstance().disableControlIcons(),this.reset(),l=l.filter((function(e){return e.svg!==t.svg})),delete this.options,delete this.viewport,delete this.publicInstance,delete this.pi,this.getPublicInstance=function(){return null}},u.prototype.getPublicInstance=function(){var t=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return t.options.panEnabled=!0,t.pi},disablePan:function(){return t.options.panEnabled=!1,t.pi},isPanEnabled:function(){return!!t.options.panEnabled},pan:function(e){return t.pan(e),t.pi},panBy:function(e){return t.panBy(e),t.pi},getPan:function(){return t.getPan()},setBeforePan:function(e){return t.options.beforePan=null===e?null:a.proxy(e,t.publicInstance),t.pi},setOnPan:function(e){return t.options.onPan=null===e?null:a.proxy(e,t.publicInstance),t.pi},enableZoom:function(){return t.options.zoomEnabled=!0,t.pi},disableZoom:function(){return t.options.zoomEnabled=!1,t.pi},isZoomEnabled:function(){return!!t.options.zoomEnabled},enableControlIcons:function(){return t.options.controlIconsEnabled||(t.options.controlIconsEnabled=!0,i.enable(t)),t.pi},disableControlIcons:function(){return t.options.controlIconsEnabled&&(t.options.controlIconsEnabled=!1,i.disable(t)),t.pi},isControlIconsEnabled:function(){return!!t.options.controlIconsEnabled},enableDblClickZoom:function(){return t.options.dblClickZoomEnabled=!0,t.pi},disableDblClickZoom:function(){return t.options.dblClickZoomEnabled=!1,t.pi},isDblClickZoomEnabled:function(){return!!t.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return t.enableMouseWheelZoom(),t.pi},disableMouseWheelZoom:function(){return t.disableMouseWheelZoom(),t.pi},isMouseWheelZoomEnabled:function(){return!!t.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(e){return t.options.zoomScaleSensitivity=e,t.pi},setMinZoom:function(e){return t.options.minZoom=e,t.pi},setMaxZoom:function(e){return t.options.maxZoom=e,t.pi},setBeforeZoom:function(e){return t.options.beforeZoom=null===e?null:a.proxy(e,t.publicInstance),t.pi},setOnZoom:function(e){return t.options.onZoom=null===e?null:a.proxy(e,t.publicInstance),t.pi},zoom:function(e){return t.publicZoom(e,!0),t.pi},zoomBy:function(e){return t.publicZoom(e,!1),t.pi},zoomAtPoint:function(e,n){return t.publicZoomAtPoint(e,n,!0),t.pi},zoomAtPointBy:function(e,n){return t.publicZoomAtPoint(e,n,!1),t.pi},zoomIn:function(){return this.zoomBy(1+t.options.zoomScaleSensitivity),t.pi},zoomOut:function(){return this.zoomBy(1/(1+t.options.zoomScaleSensitivity)),t.pi},getZoom:function(){return t.getRelativeZoom()},setOnUpdatedCTM:function(e){return t.options.onUpdatedCTM=null===e?null:a.proxy(e,t.publicInstance),t.pi},resetZoom:function(){return t.resetZoom(),t.pi},resetPan:function(){return t.resetPan(),t.pi},reset:function(){return t.reset(),t.pi},fit:function(){return t.fit(),t.pi},contain:function(){return t.contain(),t.pi},center:function(){return t.center(),t.pi},updateBBox:function(){return t.updateBBox(),t.pi},resize:function(){return t.resize(),t.pi},getSizes:function(){return{width:t.width,height:t.height,realZoom:t.getZoom(),viewBox:t.viewport.getViewBox()}},destroy:function(){return t.destroy(),t.pi}}),this.publicInstance};var l=[];e.exports=function(t,e){var n=a.getSvg(t);if(null===n)return null;for(var r=l.length-1;r>=0;r--)if(l[r].svg===n)return l[r].instance.getPublicInstance();return l.push({svg:n,instance:new u(n,e)}),l[l.length-1].instance.getPublicInstance()}},{"./control-icons":2,"./shadow-viewport":3,"./svg-utilities":5,"./uniwheel":6,"./utilities":7}],5:[function(t,e,n){var r=t("./utilities"),i="unknown";document.documentMode&&(i="ie"),e.exports={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(t){if(t.clientWidth&&t.clientHeight)return{width:t.clientWidth,height:t.clientHeight};if(t.getBoundingClientRect())return t.getBoundingClientRect();throw new Error("Cannot get BoundingClientRect for SVG.")},getOrCreateViewport:function(t,e){var n=null;if(!(n=r.isElement(e)?e:t.querySelector(e))){var i=Array.prototype.slice.call(t.childNodes||t.children).filter((function(t){return"defs"!==t.nodeName&&"#text"!==t.nodeName}));1===i.length&&"g"===i[0].nodeName&&null===i[0].getAttribute("transform")&&(n=i[0])}if(!n){var a="viewport-"+(new Date).toISOString().replace(/\D/g,"");(n=document.createElementNS(this.svgNS,"g")).setAttribute("id",a);var o=t.childNodes||t.children;if(o&&o.length>0)for(var s=o.length;s>0;s--)"defs"!==o[o.length-s].nodeName&&n.appendChild(o[o.length-s]);t.appendChild(n)}var u=[];return n.getAttribute("class")&&(u=n.getAttribute("class").split(" ")),~u.indexOf("svg-pan-zoom_viewport")||(u.push("svg-pan-zoom_viewport"),n.setAttribute("class",u.join(" "))),n},setupSvgAttributes:function(t){if(t.setAttribute("xmlns",this.svgNS),t.setAttributeNS(this.xmlnsNS,"xmlns:xlink",this.xlinkNS),t.setAttributeNS(this.xmlnsNS,"xmlns:ev",this.evNS),null!==t.parentNode){var e=t.getAttribute("style")||"";-1===e.toLowerCase().indexOf("overflow")&&t.setAttribute("style","overflow: hidden; "+e)}},internetExplorerRedisplayInterval:300,refreshDefsGlobal:r.throttle((function(){for(var t=document.querySelectorAll("defs"),e=t.length,n=0;ne?(clearTimeout(s),s=null,u=l,a=t.apply(r,i),s||(r=i=null)):s||!1===n.trailing||(s=setTimeout(c,f)),a}},createRequestAnimationFrame:function(t){var e=null;return"auto"!==t&&t<60&&t>1&&(e=Math.floor(1e3/t)),null===e?window.requestAnimationFrame||r(33):r(e)}}},{}]},{},[1]),t="undefined"!=typeof self?self:this,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=354)}([function(t,e,n){"use strict";n.r(e);var r=function(t,e){return te?1:t>=e?0:NaN},i=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return r(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)>0?i=a:r=a+1}return r}}},a=i(r),o=a.right,s=a.left,u=o,c=function(t,e){null==e&&(e=l);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);nt?1:e>=t?0:NaN},d=function(t){return null===t?NaN:+t},p=function(t,e){var n,r,i=t.length,a=0,o=-1,s=0,u=0;if(null==e)for(;++o1)return u/(a-1)},y=function(t,e){var n=p(t,e);return n?Math.sqrt(n):n},g=function(t,e){var n,r,i,a=t.length,o=-1;if(null==e){for(;++o=n)for(r=i=n;++on&&(r=n),i=n)for(r=i=n;++on&&(r=n),i0)return[t];if((r=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s=0?(a>=k?10:a>=E?5:a>=S?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=k?10:a>=E?5:a>=S?2:1)}function M(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=k?i*=10:a>=E?i*=5:a>=S&&(i*=2),ef;)h.pop(),--d;var p,y=new Array(d+1);for(i=0;i<=d;++i)(p=y[i]=[]).x0=i>0?h[i-1]:l,p.x1=i=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t);return o+(+n(t[a+1],a+1,t)-o)*(i-a)}},D=function(t,e,n){return t=b.call(t,d).sort(r),Math.ceil((n-e)/(2*(N(t,.75)-N(t,.25))*Math.pow(t.length,-1/3)))},L=function(t,e,n){return Math.ceil((n-e)/(3.5*y(t)*Math.pow(t.length,-1/3)))},F=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a=n)for(r=n;++ar&&(r=n)}else for(;++a=n)for(r=n;++ar&&(r=n);return r},P=function(t,e){var n,r=t.length,i=r,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(r=t[i]).length;--e>=0;)n[--o]=r[e];return n},B=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a=n)for(r=n;++an&&(r=n)}else for(;++a=n)for(r=n;++an&&(r=n);return r},j=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},z=function(t,e){if(n=t.length){var n,i,a=0,o=0,s=t[o];for(null==e&&(e=r);++a=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function ut(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),a=0;ae?1:t>=e?0:NaN}mt.prototype={constructor:mt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var _t="http://www.w3.org/1999/xhtml",wt={svg:"http://www.w3.org/2000/svg",xhtml:_t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},kt=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),wt.hasOwnProperty(e)?{space:wt[e],local:t}:t};function Et(t){return function(){this.removeAttribute(t)}}function St(t){return function(){this.removeAttributeNS(t.space,t.local)}}function At(t,e){return function(){this.setAttribute(t,e)}}function Tt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Mt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Ot(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var Ct=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function Nt(t){return function(){this.style.removeProperty(t)}}function Dt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Lt(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ft(t,e){return t.style.getPropertyValue(e)||Ct(t).getComputedStyle(t,null).getPropertyValue(e)}function Pt(t){return function(){delete this[t]}}function It(t,e){return function(){this[t]=e}}function Rt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Bt(t){return t.trim().split(/^|\s+/)}function jt(t){return t.classList||new zt(t)}function zt(t){this._node=t,this._names=Bt(t.getAttribute("class")||"")}function Yt(t,e){for(var n=jt(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ne=function(t){var e=kt(t);return(e.local?ee:te)(e)};function re(){return null}function ie(){var t=this.parentNode;t&&t.removeChild(this)}function ae(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function oe(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var se={},ue=null;function ce(t,e,n){return t=le(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function le(t,e,n){return function(r){var i=ue;ue=r;try{t.call(this,this.__data__,e,n)}finally{ue=i}}}function fe(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function he(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r=_&&(_=x+1);!(b=m[_])&&++_=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=xt);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==e?Nt:"function"==typeof e?Lt:Dt)(t,e,null==n?"":n)):Ft(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Pt:"function"==typeof e?Rt:It)(t,e)):this.node()[t]},classed:function(t,e){var n=Bt(t+"");if(arguments.length<2){for(var r=jt(this.node()),i=-1,a=n.length;++i>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new qe(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new qe(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Fe.exec(t))?new qe(e[1],e[2],e[3],1):(e=Pe.exec(t))?new qe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ie.exec(t))?Ge(e[1],e[2],e[3],e[4]):(e=Re.exec(t))?Ge(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Be.exec(t))?Qe(e[1],e[2]/100,e[3]/100,1):(e=je.exec(t))?Qe(e[1],e[2]/100,e[3]/100,e[4]):ze.hasOwnProperty(t)?Ve(ze[t]):"transparent"===t?new qe(NaN,NaN,NaN,0):null}function Ve(t){return new qe(t>>16&255,t>>8&255,255&t,1)}function Ge(t,e,n,r){return r<=0&&(t=e=n=NaN),new qe(t,e,n,r)}function We(t){return t instanceof Oe||(t=$e(t)),t?new qe((t=t.rgb()).r,t.g,t.b,t.opacity):new qe}function He(t,e,n,r){return 1===arguments.length?We(t):new qe(t,e,n,null==r?1:r)}function qe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ze(){return"#"+Je(this.r)+Je(this.g)+Je(this.b)}function Xe(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Je(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Qe(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new en(t,e,n,r)}function Ke(t){if(t instanceof en)return new en(t.h,t.s,t.l,t.opacity);if(t instanceof Oe||(t=$e(t)),!t)return new en;if(t instanceof en)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n0&&u<1?0:o,new en(o,s,u,t.opacity)}function tn(t,e,n,r){return 1===arguments.length?Ke(t):new en(t,e,n,null==r?1:r)}function en(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function nn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function rn(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}Te(Oe,$e,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ye,formatHex:Ye,formatHsl:function(){return Ke(this).formatHsl()},formatRgb:Ue,toString:Ue}),Te(qe,He,Me(Oe,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new qe(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new qe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ze,formatHex:Ze,formatRgb:Xe,toString:Xe})),Te(en,tn,Me(Oe,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new en(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new en(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new qe(nn(t>=240?t-240:t+120,i,r),nn(t,i,r),nn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var an=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r180||n<-180?n-360*Math.round(n/360):n):sn(isNaN(t)?e:t)}function ln(t,e){var n=e-t;return n?un(t,n):sn(isNaN(t)?e:t)}var fn=function t(e){var n=function(t){return 1==(t=+t)?ln:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):sn(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=He(t)).r,(e=He(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=ln(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function hn(t){return function(e){var n,r,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(n=0;na&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,u.push({i:o,x:wn(n,r)})),a=Sn.lastIndex;return a=0&&e._call.call(null,t),e=e._next;--Dn}function Gn(){In=(Pn=Bn.now())+Rn,Dn=Ln=0;try{Vn()}finally{Dn=0,function(){for(var t,e,n=bn,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:bn=e);xn=t,Hn(r)}(),In=0}}function Wn(){var t=Bn.now(),e=t-Pn;e>1e3&&(Rn-=e,Pn=t)}function Hn(t){Dn||(Ln&&(Ln=clearTimeout(Ln)),t-In>24?(t<1/0&&(Ln=setTimeout(Gn,t-Bn.now()-Rn)),Fn&&(Fn=clearInterval(Fn))):(Fn||(Pn=Bn.now(),Fn=setInterval(Wn,1e3)),Dn=1,jn(Gn)))}Un.prototype=$n.prototype={constructor:Un,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?zn():+n)+(null==e?0:+e),this._next||xn===this||(xn?xn._next=this:bn=this,xn=this),this._call=t,this._time=n,Hn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Hn())}};var qn=function(t,e,n){var r=new Un;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},Zn=lt("start","end","cancel","interrupt"),Xn=[],Jn=function(t,e,n,r,i,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(u){var c,l,f,h;if(1!==n.state)return s();for(c in i)if((h=i[c]).name===n.name){if(3===h.state)return qn(a);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+c0)throw new Error("too late; already scheduled");return n}function Kn(t,e){var n=tr(t,e);if(n.state>3)throw new Error("too late; already running");return n}function tr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var er,nr,rr,ir,ar=function(t,e){var n,r,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete t.__transition}},or=180/Math.PI,sr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},ur=function(t,e,n,r,i,a){var o,s,u;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:wn(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,s,u),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:wn(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,s,u),function(t,e,n,r,a,o){if(t!==n||e!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:wn(t,n)},{i:s-2,x:wn(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,u),a=o=null,function(t){for(var e,n=-1,r=u.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Qn:Kn;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}var Dr=_e.prototype.constructor;function Lr(t){return function(){this.style.removeProperty(t)}}function Fr(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Pr(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&Fr(t,a,n)),r}return a._value=e,a}function Ir(t){return function(e){this.textContent=t.call(this,e)}}function Rr(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Ir(r)),e}return r._value=t,r}var Br=0;function jr(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function zr(t){return _e().transition(t)}function Yr(){return++Br}var Ur=_e.prototype;function $r(t){return t*t*t}function Vr(t){return--t*t*t+1}function Gr(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}jr.prototype=zr.prototype={constructor:jr,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=ht(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o1&&n.name===e)return new jr([[t]],qr,e,+r);return null},Xr=function(t){return function(){return t}},Jr=function(t,e,n){this.target=t,this.type=e,this.selection=n};function Qr(){ue.stopImmediatePropagation()}var Kr=function(){ue.preventDefault(),ue.stopImmediatePropagation()},ti={name:"drag"},ei={name:"space"},ni={name:"handle"},ri={name:"center"};function ii(t){return[+t[0],+t[1]]}function ai(t){return[ii(t[0]),ii(t[1])]}function oi(t){return function(e){return Cn(e,ue.touches,t)}}var si={name:"x",handles:["w","e"].map(yi),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ui={name:"y",handles:["n","s"].map(yi),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},ci={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(yi),input:function(t){return null==t?null:ai(t)},output:function(t){return t}},li={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},fi={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},hi={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},di={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},pi={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function yi(t){return{type:t}}function gi(){return!ue.ctrlKey&&!ue.button}function mi(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function vi(){return navigator.maxTouchPoints||"ontouchstart"in this}function bi(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function xi(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function _i(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function wi(){return Si(si)}function ki(){return Si(ui)}var Ei=function(){return Si(ci)};function Si(t){var e,n=mi,r=gi,i=vi,a=!0,o=lt("start","brush","end"),s=6;function u(e){var n=e.property("__brush",y).selectAll(".overlay").data([yi("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",li.overlay).merge(n).each((function(){var t=bi(this).extent;we(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([yi("selection")]).enter().append("rect").attr("class","selection").attr("cursor",li.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return li[t.type]})),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=we(this),e=bi(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-s/2:e[0][0]-s/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-s/2:e[0][1]-s/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+s:s})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+s:s}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,e,n){return!n&&t.__brush.emitter||new f(t,e)}function f(t,e){this.that=t,this.args=e,this.state=t.__brush,this.active=0}function h(){if((!e||ue.touches)&&r.apply(this,arguments)){var n,i,o,s,u,f,h,d,p,y,g,m=this,v=ue.target.__data__.type,b="selection"===(a&&ue.metaKey?v="overlay":v)?ti:a&&ue.altKey?ri:ni,x=t===ui?null:di[v],_=t===si?null:pi[v],w=bi(m),k=w.extent,E=w.selection,S=k[0][0],A=k[0][1],T=k[1][0],M=k[1][1],O=0,C=0,N=x&&_&&a&&ue.shiftKey,D=ue.touches?oi(ue.changedTouches[0].identifier):Nn,L=D(m),F=L,P=l(m,arguments,!0).beforestart();"overlay"===v?(E&&(p=!0),w.selection=E=[[n=t===ui?S:L[0],o=t===si?A:L[1]],[u=t===ui?T:n,h=t===si?M:o]]):(n=E[0][0],o=E[0][1],u=E[1][0],h=E[1][1]),i=n,s=o,f=u,d=h;var I=we(m).attr("pointer-events","none"),R=I.selectAll(".overlay").attr("cursor",li[v]);if(ue.touches)P.moved=j,P.ended=Y;else{var B=we(ue.view).on("mousemove.brush",j,!0).on("mouseup.brush",Y,!0);a&&B.on("keydown.brush",U,!0).on("keyup.brush",$,!0),Se(ue.view)}Qr(),ar(m),c.call(m),P.start()}function j(){var t=D(m);!N||y||g||(Math.abs(t[0]-F[0])>Math.abs(t[1]-F[1])?g=!0:y=!0),F=t,p=!0,Kr(),z()}function z(){var t;switch(O=F[0]-L[0],C=F[1]-L[1],b){case ei:case ti:x&&(O=Math.max(S-n,Math.min(T-u,O)),i=n+O,f=u+O),_&&(C=Math.max(A-o,Math.min(M-h,C)),s=o+C,d=h+C);break;case ni:x<0?(O=Math.max(S-n,Math.min(T-n,O)),i=n+O,f=u):x>0&&(O=Math.max(S-u,Math.min(T-u,O)),i=n,f=u+O),_<0?(C=Math.max(A-o,Math.min(M-o,C)),s=o+C,d=h):_>0&&(C=Math.max(A-h,Math.min(M-h,C)),s=o,d=h+C);break;case ri:x&&(i=Math.max(S,Math.min(T,n-O*x)),f=Math.max(S,Math.min(T,u+O*x))),_&&(s=Math.max(A,Math.min(M,o-C*_)),d=Math.max(A,Math.min(M,h+C*_)))}f0&&(n=i-O),_<0?h=d-C:_>0&&(o=s-C),b=ei,R.attr("cursor",li.selection),z());break;default:return}Kr()}function $(){switch(ue.keyCode){case 16:N&&(y=g=N=!1,z());break;case 18:b===ri&&(x<0?u=f:x>0&&(n=i),_<0?h=d:_>0&&(o=s),b=ni,z());break;case 32:b===ei&&(ue.altKey?(x&&(u=f-O*x,n=i+O*x),_&&(h=d-C*_,o=s+C*_),b=ri):(x<0?u=f:x>0&&(n=i),_<0?h=d:_>0&&(o=s),b=ni),R.attr("cursor",li[v]),z());break;default:return}Kr()}}function d(){l(this,arguments).moved()}function p(){l(this,arguments).ended()}function y(){var e=this.__brush||{selection:null};return e.extent=ai(n.apply(this,arguments)),e.dim=t,e}return u.move=function(e,n){e.selection?e.on("start.brush",(function(){l(this,arguments).beforestart().start()})).on("interrupt.brush end.brush",(function(){l(this,arguments).end()})).tween("brush",(function(){var e=this,r=e.__brush,i=l(e,arguments),a=r.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,r.extent),s=Tn(a,o);function u(t){r.selection=1===t&&null===o?null:s(t),c.call(e),i.brush()}return null!==a&&null!==o?u:u(1)})):e.each((function(){var e=this,r=arguments,i=e.__brush,a=t.input("function"==typeof n?n.apply(e,r):n,i.extent),o=l(e,r).beforestart();ar(e),i.selection=null===a?null:a,c.call(e),o.start().brush().end()}))},u.clear=function(t){u.move(t,null)},f.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting?(this.starting=!1,this.emit("start")):this.emit("brush"),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){pe(new Jr(u,e,t.output(this.state.selection)),o.apply,o,[e,this.that,this.args])}},u.extent=function(t){return arguments.length?(n="function"==typeof t?t:Xr(ai(t)),u):n},u.filter=function(t){return arguments.length?(r="function"==typeof t?t:Xr(!!t),u):r},u.touchable=function(t){return arguments.length?(i="function"==typeof t?t:Xr(!!t),u):i},u.handleSize=function(t){return arguments.length?(s=+t,u):s},u.keyModifiers=function(t){return arguments.length?(a=!!t,u):a},u.on=function(){var t=o.on.apply(o,arguments);return t===o?u:t},u}var Ai=Math.cos,Ti=Math.sin,Mi=Math.PI,Oi=Mi/2,Ci=2*Mi,Ni=Math.max;function Di(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}var Li=function(){var t=0,e=null,n=null,r=null;function i(i){var a,o,s,u,c,l,f=i.length,h=[],d=w(f),p=[],y=[],g=y.groups=new Array(f),m=new Array(f*f);for(a=0,c=-1;++c1e-6)if(Math.abs(l*s-u*c)>1e-6&&i){var h=n-a,d=r-o,p=s*s+u*u,y=h*h+d*d,g=Math.sqrt(p),m=Math.sqrt(f),v=i*Math.tan((Ii-Math.acos((p+f-y)/(2*g*m)))/2),b=v/m,x=v/g;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*c)+","+(e+b*l)),this._+="A"+i+","+i+",0,0,"+ +(l*h>c*d)+","+(this._x1=t+x*s)+","+(this._y1=e+x*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,r,i,a){t=+t,e=+e,a=!!a;var o=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+o,c=e+s,l=1^a,f=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+u+","+c),n&&(f<0&&(f=f%Ri+Ri),f>Bi?this._+="A"+n+","+n+",0,1,"+l+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=Ii)+","+l+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Yi=zi;function Ui(t){return t.source}function $i(t){return t.target}function Vi(t){return t.radius}function Gi(t){return t.startAngle}function Wi(t){return t.endAngle}var Hi=function(){var t=Ui,e=$i,n=Vi,r=Gi,i=Wi,a=null;function o(){var o,s=Fi.call(arguments),u=t.apply(this,s),c=e.apply(this,s),l=+n.apply(this,(s[0]=u,s)),f=r.apply(this,s)-Oi,h=i.apply(this,s)-Oi,d=l*Ai(f),p=l*Ti(f),y=+n.apply(this,(s[0]=c,s)),g=r.apply(this,s)-Oi,m=i.apply(this,s)-Oi;if(a||(a=o=Yi()),a.moveTo(d,p),a.arc(0,0,l,f,h),f===g&&h===m||(a.quadraticCurveTo(0,0,y*Ai(g),y*Ti(g)),a.arc(0,0,y,g,m)),a.quadraticCurveTo(0,0,d,p),a.closePath(),o)return a=null,o+""||null}return o.radius=function(t){return arguments.length?(n="function"==typeof t?t:Pi(+t),o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Pi(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Pi(+t),o):i},o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(t){return arguments.length?(e=t,o):e},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o};function qi(){}function Zi(t,e){var n=new qi;if(t instanceof qi)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,a=t.length;if(null==e)for(;++i=r.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var u,c,l,f=-1,h=n.length,d=r[i++],p=Xi(),y=o();++fr.length)return n;var o,s=i[a-1];return null!=e&&a>=r.length?o=n.entries():(o=[],n.each((function(e,n){o.push({key:n,values:t(e,a)})}))),null!=s?o.sort((function(t,e){return s(t.key,e.key)})):o}(a(t,0,ta,ea),0)},key:function(t){return r.push(t),n},sortKeys:function(t){return i[r.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}};function Qi(){return{}}function Ki(t,e,n){t[e]=n}function ta(){return Xi()}function ea(t,e,n){t.set(e,n)}function na(){}var ra=Xi.prototype;function ia(t,e){var n=new na;if(t instanceof na)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/(6/29*3*(6/29))+4/29}function ga(t){return t>6/29?t*t*t:6/29*3*(6/29)*(t-4/29)}function ma(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function va(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ba(t){if(t instanceof wa)return new wa(t.h,t.c,t.l,t.opacity);if(t instanceof pa||(t=fa(t)),0===t.a&&0===t.b)return new wa(NaN,0r!=d>r&&n<(h-c)*(r-l)/(d-l)+c&&(i=-i)}return i}function Pa(t,e,n){var r,i,a,o;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],a=n[r],o=e[r],i<=a&&a<=o||o<=a&&a<=i)}var Ia=function(){},Ra=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]],Ba=function(){var t=1,e=1,n=O,r=s;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Na);else{var r=g(t),i=r[0],o=r[1];e=M(i,o,e),e=w(Math.floor(i/e)*e,Math.floor(o/e)*e,e)}return e.map((function(e){return a(t,e)}))}function a(n,i){var a=[],s=[];return function(n,r,i){var a,s,u,c,l,f,h=new Array,d=new Array;for(a=s=-1,c=n[0]>=r,Ra[c<<1].forEach(p);++a=r,Ra[u|c<<1].forEach(p);for(Ra[c<<0].forEach(p);++s=r,l=n[s*t]>=r,Ra[c<<1|l<<2].forEach(p);++a=r,f=l,l=n[s*t+a+1]>=r,Ra[u|c<<1|l<<2|f<<3].forEach(p);Ra[c|l<<3].forEach(p)}for(a=-1,l=n[s*t]>=r,Ra[l<<2].forEach(p);++a=r,Ra[l<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+s],u=[t[1][0]+a,t[1][1]+s],c=o(r),l=o(u);(e=d[c])?(n=h[l])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(u),i(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(u),d[e.end=l]=e):(e=h[l])?(n=d[c])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(u),i(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=c]=e):h[c]=d[l]={start:c,end:l,ring:[r,u]}}Ra[l<<3].forEach(p)}(n,i,(function(t){r(t,n,i),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e0?a.push([t]):s.push(t)})),s.forEach((function(t){for(var e,n=0,r=a.length;n0&&o0&&s0&&a>0))throw new Error("invalid size");return t=r,e=a,i},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Da(Ca.call(t)):Da(t),i):n},i.smooth=function(t){return arguments.length?(r=t?s:Ia,i):r===s},i};function ja(t,e,n){for(var r=t.width,i=t.height,a=1+(n<<1),o=0;o=n&&(s>=a&&(u-=t.data[s-a+o*r]),e.data[s-n+o*r]=u/Math.min(s+1,r-1+a-s,a))}function za(t,e,n){for(var r=t.width,i=t.height,a=1+(n<<1),o=0;o=n&&(s>=a&&(u-=t.data[o+(s-a)*r]),e.data[o+(s-n)*r]=u/Math.min(s+1,i-1+a-s,a))}function Ya(t){return t[0]}function Ua(t){return t[1]}function $a(){return 1}var Va=function(){var t=Ya,e=Ua,n=$a,r=960,i=500,a=20,o=2,s=3*a,u=r+2*s>>o,c=i+2*s>>o,l=Da(20);function f(r){var i=new Float32Array(u*c),f=new Float32Array(u*c);r.forEach((function(r,a,l){var f=+t(r,a,l)+s>>o,h=+e(r,a,l)+s>>o,d=+n(r,a,l);f>=0&&f=0&&h>o),za({width:u,height:c,data:f},{width:u,height:c,data:i},a>>o),ja({width:u,height:c,data:i},{width:u,height:c,data:f},a>>o),za({width:u,height:c,data:f},{width:u,height:c,data:i},a>>o),ja({width:u,height:c,data:i},{width:u,height:c,data:f},a>>o),za({width:u,height:c,data:f},{width:u,height:c,data:i},a>>o);var d=l(i);if(!Array.isArray(d)){var p=F(i);d=M(0,p,d),(d=w(0,Math.floor(p/d)*d,d)).shift()}return Ba().thresholds(d).size([u,c])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*o),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(y)}function y(t){t[0]=t[0]*Math.pow(2,o)-s,t[1]=t[1]*Math.pow(2,o)-s}function g(){return u=r+2*(s=3*a)>>o,c=i+2*s>>o,f}return f.x=function(e){return arguments.length?(t="function"==typeof e?e:Da(+e),f):t},f.y=function(t){return arguments.length?(e="function"==typeof t?t:Da(+t),f):e},f.weight=function(t){return arguments.length?(n="function"==typeof t?t:Da(+t),f):n},f.size=function(t){if(!arguments.length)return[r,i];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return r=e,i=n,g()},f.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return o=Math.floor(Math.log(t)/Math.LN2),g()},f.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Da(Ca.call(t)):Da(t),f):l},f.bandwidth=function(t){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return a=Math.round((Math.sqrt(4*t*t+1)-1)/2),g()},f},Ga=function(t){return function(){return t}};function Wa(t,e,n,r,i,a,o,s,u,c){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=a,this.y=o,this.dx=s,this.dy=u,this._=c}function Ha(){return!ue.ctrlKey&&!ue.button}function qa(){return this.parentNode}function Za(t){return null==t?{x:ue.x,y:ue.y}:t}function Xa(){return navigator.maxTouchPoints||"ontouchstart"in this}Wa.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Ja=function(){var t,e,n,r,i=Ha,a=qa,o=Za,s=Xa,u={},c=lt("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",g).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var o=b("mouse",a.apply(this,arguments),Nn,this,arguments);o&&(we(ue.view).on("mousemove.drag",p,!0).on("mouseup.drag",y,!0),Se(ue.view),ke(),n=!1,t=ue.clientX,e=ue.clientY,o("start"))}}function p(){if(Ee(),!n){var r=ue.clientX-t,i=ue.clientY-e;n=r*r+i*i>f}u.mouse("drag")}function y(){we(ue.view).on("mousemove.drag mouseup.drag",null),Ae(ue.view,n),Ee(),u.mouse("end")}function g(){if(i.apply(this,arguments)){var t,e,n=ue.changedTouches,r=a.apply(this,arguments),o=n.length;for(t=0;t=a?u=!0:10===(r=t.charCodeAt(o++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o9999?"+"+no(e,6):no(e,4))+"-"+no(t.getUTCMonth()+1,2)+"-"+no(t.getUTCDate(),2)+(a?"T"+no(n,2)+":"+no(r,2)+":"+no(i,2)+"."+no(a,3)+"Z":i?"T"+no(n,2)+":"+no(r,2)+":"+no(i,2)+"Z":r||n?"T"+no(n,2)+":"+no(r,2)+"Z":"")}(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=to(t);return function(r,i){return e(n(r),i,t)}}(t,e):to(t)}));return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=eo(e)),[n.map(o).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=eo(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}},io=ro(","),ao=io.parse,oo=io.parseRows,so=io.format,uo=io.formatBody,co=io.formatRows,lo=io.formatRow,fo=io.formatValue,ho=ro("\t"),po=ho.parse,yo=ho.parseRows,go=ho.format,mo=ho.formatBody,vo=ho.formatRows,bo=ho.formatRow,xo=ho.formatValue;function _o(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;wo&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}var wo=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function ko(t){return+t}function Eo(t){return t*t}function So(t){return t*(2-t)}function Ao(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var To=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),Mo=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Oo=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),Co=Math.PI,No=Co/2;function Do(t){return 1-Math.cos(t*No)}function Lo(t){return Math.sin(t*No)}function Fo(t){return(1-Math.cos(Co*t))/2}function Po(t){return Math.pow(2,10*t-10)}function Io(t){return 1-Math.pow(2,-10*t)}function Ro(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function Bo(t){return 1-Math.sqrt(1-t*t)}function jo(t){return Math.sqrt(1- --t*t)}function zo(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}function Yo(t){return 1-Uo(1-t)}function Uo(t){return(t=+t)<4/11?7.5625*t*t:t<8/11?7.5625*(t-=6/11)*t+.75:t<10/11?7.5625*(t-=9/11)*t+.9375:7.5625*(t-=21/22)*t+63/64}function $o(t){return((t*=2)<=1?1-Uo(1-t):Uo(t-1)+1)/2}var Vo=function t(e){function n(t){return t*t*((e+1)*t-e)}return e=+e,n.overshoot=t,n}(1.70158),Go=function t(e){function n(t){return--t*t*((e+1)*t+e)+1}return e=+e,n.overshoot=t,n}(1.70158),Wo=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),Ho=2*Math.PI,qo=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Ho);function i(t){return e*Math.pow(2,10*--t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*Ho)},i.period=function(n){return t(e,n)},i}(1,.3),Zo=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Ho);function i(t){return 1-e*Math.pow(2,-10*(t=+t))*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*Ho)},i.period=function(n){return t(e,n)},i}(1,.3),Xo=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Ho);function i(t){return((t=2*t-1)<0?e*Math.pow(2,10*t)*Math.sin((r-t)/n):2-e*Math.pow(2,-10*t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*Ho)},i.period=function(n){return t(e,n)},i}(1,.3);function Jo(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}var Qo=function(t,e){return fetch(t,e).then(Jo)};function Ko(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}var ts=function(t,e){return fetch(t,e).then(Ko)};function es(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}var ns=function(t,e){return fetch(t,e).then(es)};function rs(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),ns(e,n).then((function(e){return t(e,r)}))}}function is(t,e,n,r){3===arguments.length&&"function"==typeof n&&(r=n,n=void 0);var i=ro(t);return ns(e,n).then((function(t){return i.parse(t,r)}))}var as=rs(ao),os=rs(po),ss=function(t,e){return new Promise((function(n,r){var i=new Image;for(var a in e)i[a]=e[a];i.onerror=r,i.onload=function(){n(i)},i.src=t}))};function us(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}var cs=function(t,e){return fetch(t,e).then(us)};function ls(t){return function(e,n){return ns(e,n).then((function(e){return(new DOMParser).parseFromString(e,t)}))}}var fs=ls("application/xml"),hs=ls("text/html"),ds=ls("image/svg+xml"),ps=function(t,e){var n;function r(){var r,i,a=n.length,o=0,s=0;for(r=0;r=(a=(y+m)/2))?y=a:m=a,(l=n>=(o=(g+v)/2))?g=o:v=o,i=d,!(d=d[f=l<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(y+m)/2))?y=a:m=a,(l=n>=(o=(g+v)/2))?g=o:v=o}while((f=l<<1|c)==(h=(u>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}var vs=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function bs(t){return t[0]}function xs(t){return t[1]}function _s(t,e,n){var r=new ws(null==e?bs:e,null==n?xs:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ws(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function ks(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Es=_s.prototype=ws.prototype;function Ss(t){return t.x+t.vx}function As(t){return t.y+t.vy}Es.copy=function(){var t,e,n=new ws(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=ks(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=ks(e));return n},Es.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return ms(this.cover(e,n),e,n,t)},Es.addAll=function(t){var e,n,r,i,a=t.length,o=new Array(a),s=new Array(a),u=1/0,c=1/0,l=-1/0,f=-1/0;for(n=0;nl&&(l=r),if&&(f=i));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;nt||t>=i||r>e||e>=a;)switch(s=(eh||(a=u.y0)>d||(o=u.x1)=m)<<1|t>=g)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var v=t-+this._x.call(null,y.data),b=e-+this._y.call(null,y.data),x=v*v+b*b;if(x=(s=(p+g)/2))?p=s:g=s,(l=o>=(u=(y+m)/2))?y=u:m=u,e=d,!(d=d[f=l<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},Es.removeAll=function(t){for(var e=0,n=t.length;eu+d||ic+d||as.index){var p=u-o.x-o.vx,y=c-o.y-o.vy,g=p*p+y*y;gt.r&&(t.r=t[e].r)}function s(){if(e){var r,i,a=e.length;for(n=new Array(a),r=0;r1?(null==n?s.remove(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,r){var i,a,o,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,n),e):c.on(t)}}},Ps=function(){var t,e,n,r,i=ys(-30),a=1,o=1/0,s=.81;function u(r){var i,a=t.length,o=_s(t,Ns,Ds).visitAfter(l);for(n=r,i=0;i=o)){(t.data!==e||t.next)&&(0===l&&(d+=(l=gs())*l),0===f&&(d+=(f=gs())*f),d1?r[0]+r.slice(2):r,+t.slice(n+1)]},zs=function(t){return(t=js(Math.abs(t)))?t[1]:NaN},Ys=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Us(t){if(!(e=Ys.exec(t)))throw new Error("invalid format: "+t);var e;return new $s({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function $s(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}Us.prototype=$s.prototype,$s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Vs,Gs,Ws,Hs,qs=function(t,e){var n=js(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Zs={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return qs(100*t,e)},r:qs,s:function(t,e){var n=js(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Vs=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+js(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Xs=function(t){return t},Js=Array.prototype.map,Qs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Ks=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Xs:(e=Js.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),a.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Xs:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Js.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Us(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,y=t.comma,g=t.precision,m=t.trim,v=t.type;"n"===v?(y=!0,v="g"):Zs[v]||(void 0===g&&(g=12),m=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?a:/[%p]/.test(v)?u:"",_=Zs[v],w=/[defgprs%]/.test(v);function k(t){var i,a,u,h=b,k=x;if("c"===v)k=_(t)+k,t="";else{var E=(t=+t)<0;if(t=isNaN(t)?l:_(Math.abs(t),g),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&(E=!1),h=(E?"("===f?f:c:"-"===f||"("===f?"":f)+h,k=("s"===v?Qs[8+Vs/3]:"")+k+(E&&"("===f?")":""),w)for(i=-1,a=t.length;++i(u=t.charCodeAt(i))||u>57){k=(46===u?o+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}y&&!d&&(t=r(t,1/0));var S=h.length+t.length+k.length,A=S>1)+h+t+k+A.slice(S);break;default:t=A+h+t+k}return s(t)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=Us(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(zs(e)/3))),i=Math.pow(10,-r),a=Qs[8+r/3];return function(t){return n(i*t)+a}}}};function tu(t){return Gs=Ks(t),Ws=Gs.format,Hs=Gs.formatPrefix,Gs}tu({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var eu=function(t){return Math.max(0,-zs(Math.abs(t)))},nu=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zs(e)/3)))-zs(Math.abs(t)))},ru=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,zs(e)-zs(t))+1},iu=function(){return new au};function au(){this.reset()}au.prototype={constructor:au,reset:function(){this.s=this.t=0},add:function(t){su(ou,t,this.t),su(this,ou.s,this.s),this.s?this.t+=ou.t:this.s=ou.t},valueOf:function(){return this.s}};var ou=new au;function su(t,e,n){var r=t.s=e+n,i=r-e,a=r-i;t.t=e-a+(n-i)}var uu=Math.PI,cu=uu/2,lu=uu/4,fu=2*uu,hu=180/uu,du=uu/180,pu=Math.abs,yu=Math.atan,gu=Math.atan2,mu=Math.cos,vu=Math.ceil,bu=Math.exp,xu=(Math.floor,Math.log),_u=Math.pow,wu=Math.sin,ku=Math.sign||function(t){return t>0?1:t<0?-1:0},Eu=Math.sqrt,Su=Math.tan;function Au(t){return t>1?0:t<-1?uu:Math.acos(t)}function Tu(t){return t>1?cu:t<-1?-cu:Math.asin(t)}function Mu(t){return(t=wu(t/2))*t}function Ou(){}function Cu(t,e){t&&Du.hasOwnProperty(t.type)&&Du[t.type](t,e)}var Nu={Feature:function(t,e){Cu(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,a=mu(e=(e*=du)/2+lu),o=wu(e),s=ju*o,u=Bu*a+s*mu(i),c=s*r*wu(i);Yu.add(gu(c,u)),Ru=t,Bu=a,ju=o}var qu=function(t){return Uu.reset(),zu(t,$u),2*Uu};function Zu(t){return[gu(t[1],t[0]),Tu(t[2])]}function Xu(t){var e=t[0],n=t[1],r=mu(n);return[r*mu(e),r*wu(e),wu(n)]}function Ju(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Qu(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ku(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function tc(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function ec(t){var e=Eu(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var nc,rc,ic,ac,oc,sc,uc,cc,lc,fc,hc=iu(),dc={point:pc,lineStart:gc,lineEnd:mc,polygonStart:function(){dc.point=vc,dc.lineStart=bc,dc.lineEnd=xc,hc.reset(),$u.polygonStart()},polygonEnd:function(){$u.polygonEnd(),dc.point=pc,dc.lineStart=gc,dc.lineEnd=mc,Yu<0?(nc=-(ic=180),rc=-(ac=90)):hc>1e-6?ac=90:hc<-1e-6&&(rc=-90),fc[0]=nc,fc[1]=ic},sphere:function(){nc=-(ic=180),rc=-(ac=90)}};function pc(t,e){lc.push(fc=[nc=t,ic=t]),eac&&(ac=e)}function yc(t,e){var n=Xu([t*du,e*du]);if(cc){var r=Qu(cc,n),i=Qu([r[1],-r[0],0],r);ec(i),i=Zu(i);var a,o=t-oc,s=o>0?1:-1,u=i[0]*hu*s,c=pu(o)>180;c^(s*ocac&&(ac=a):c^(s*oc<(u=(u+360)%360-180)&&uac&&(ac=e)),c?t_c(nc,ic)&&(ic=t):_c(t,ic)>_c(nc,ic)&&(nc=t):ic>=nc?(tic&&(ic=t)):t>oc?_c(nc,t)>_c(nc,ic)&&(ic=t):_c(t,ic)>_c(nc,ic)&&(nc=t)}else lc.push(fc=[nc=t,ic=t]);eac&&(ac=e),cc=n,oc=t}function gc(){dc.point=yc}function mc(){fc[0]=nc,fc[1]=ic,dc.point=pc,cc=null}function vc(t,e){if(cc){var n=t-oc;hc.add(pu(n)>180?n+(n>0?360:-360):n)}else sc=t,uc=e;$u.point(t,e),yc(t,e)}function bc(){$u.lineStart()}function xc(){vc(sc,uc),$u.lineEnd(),pu(hc)>1e-6&&(nc=-(ic=180)),fc[0]=nc,fc[1]=ic,cc=null}function _c(t,e){return(e-=t)<0?e+360:e}function wc(t,e){return t[0]-e[0]}function kc(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e_c(r[0],r[1])&&(r[1]=i[1]),_c(i[0],r[1])>_c(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,e=0,r=a[n=a.length-1];e<=n;r=i,++e)i=a[e],(s=_c(r[1],i[0]))>o&&(o=s,nc=i[0],ic=r[1])}return lc=fc=null,nc===1/0||rc===1/0?[[NaN,NaN],[NaN,NaN]]:[[nc,rc],[ic,ac]]},Yc={sphere:Ou,point:Uc,lineStart:Vc,lineEnd:Hc,polygonStart:function(){Yc.lineStart=qc,Yc.lineEnd=Zc},polygonEnd:function(){Yc.lineStart=Vc,Yc.lineEnd=Hc}};function Uc(t,e){t*=du;var n=mu(e*=du);$c(n*mu(t),n*wu(t),wu(e))}function $c(t,e,n){++Ec,Ac+=(t-Ac)/Ec,Tc+=(e-Tc)/Ec,Mc+=(n-Mc)/Ec}function Vc(){Yc.point=Gc}function Gc(t,e){t*=du;var n=mu(e*=du);Rc=n*mu(t),Bc=n*wu(t),jc=wu(e),Yc.point=Wc,$c(Rc,Bc,jc)}function Wc(t,e){t*=du;var n=mu(e*=du),r=n*mu(t),i=n*wu(t),a=wu(e),o=gu(Eu((o=Bc*a-jc*i)*o+(o=jc*r-Rc*a)*o+(o=Rc*i-Bc*r)*o),Rc*r+Bc*i+jc*a);Sc+=o,Oc+=o*(Rc+(Rc=r)),Cc+=o*(Bc+(Bc=i)),Nc+=o*(jc+(jc=a)),$c(Rc,Bc,jc)}function Hc(){Yc.point=Uc}function qc(){Yc.point=Xc}function Zc(){Jc(Pc,Ic),Yc.point=Uc}function Xc(t,e){Pc=t,Ic=e,t*=du,e*=du,Yc.point=Jc;var n=mu(e);Rc=n*mu(t),Bc=n*wu(t),jc=wu(e),$c(Rc,Bc,jc)}function Jc(t,e){t*=du;var n=mu(e*=du),r=n*mu(t),i=n*wu(t),a=wu(e),o=Bc*a-jc*i,s=jc*r-Rc*a,u=Rc*i-Bc*r,c=Eu(o*o+s*s+u*u),l=Tu(c),f=c&&-l/c;Dc+=f*o,Lc+=f*s,Fc+=f*u,Sc+=l,Oc+=l*(Rc+(Rc=r)),Cc+=l*(Bc+(Bc=i)),Nc+=l*(jc+(jc=a)),$c(Rc,Bc,jc)}var Qc=function(t){Ec=Sc=Ac=Tc=Mc=Oc=Cc=Nc=Dc=Lc=Fc=0,zu(t,Yc);var e=Dc,n=Lc,r=Fc,i=e*e+n*n+r*r;return i<1e-12&&(e=Oc,n=Cc,r=Nc,Sc<1e-6&&(e=Ac,n=Tc,r=Mc),(i=e*e+n*n+r*r)<1e-12)?[NaN,NaN]:[gu(n,e)*hu,Tu(r/Eu(i))*hu]},Kc=function(t){return function(){return t}},tl=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function el(t,e){return[pu(t)>uu?t+Math.round(-t/fu)*fu:t,e]}function nl(t,e,n){return(t%=fu)?e||n?tl(il(t),al(e,n)):il(t):e||n?al(e,n):el}function rl(t){return function(e,n){return[(e+=t)>uu?e-fu:e<-uu?e+fu:e,n]}}function il(t){var e=rl(t);return e.invert=rl(-t),e}function al(t,e){var n=mu(t),r=wu(t),i=mu(e),a=wu(e);function o(t,e){var o=mu(e),s=mu(t)*o,u=wu(t)*o,c=wu(e),l=c*n+s*r;return[gu(u*i-l*a,s*n-c*r),Tu(l*i+u*a)]}return o.invert=function(t,e){var o=mu(e),s=mu(t)*o,u=wu(t)*o,c=wu(e),l=c*i-u*a;return[gu(u*i+c*a,s*n+l*r),Tu(l*n-s*r)]},o}el.invert=el;var ol=function(t){function e(e){return(e=t(e[0]*du,e[1]*du))[0]*=hu,e[1]*=hu,e}return t=nl(t[0]*du,t[1]*du,t.length>2?t[2]*du:0),e.invert=function(e){return(e=t.invert(e[0]*du,e[1]*du))[0]*=hu,e[1]*=hu,e},e};function sl(t,e,n,r,i,a){if(n){var o=mu(e),s=wu(e),u=r*n;null==i?(i=e+r*fu,a=e-u/2):(i=ul(o,i),a=ul(o,a),(r>0?ia)&&(i+=r*fu));for(var c,l=i;r>0?l>a:l1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},fl=function(t,e){return pu(t[0]-e[0])<1e-6&&pu(t[1]-e[1])<1e-6};function hl(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var dl=function(t,e,n,r,i){var a,o,s=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(fl(r,o)){for(i.lineStart(),a=0;a=0;--a)i.point((l=c[a])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function pl(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,S=E*k,A=S>uu,T=y*_;if(yl.add(gu(T*E*wu(S),g*w+T*mu(S))),o+=A?k+E*fu:k,A^d>=n^b>=n){var M=Qu(Xu(h),Xu(v));ec(M);var O=Qu(a,M);ec(O);var C=(A^k>=0?-1:1)*Tu(O[2]);(r>C||r===C&&(M[0]||M[1]))&&(s+=A^k>=0?1:-1)}}return(o<-1e-6||o<1e-6&&yl<-1e-6)^1&s},vl=function(t,e,n,r){return function(i){var a,o,s,u=e(i),c=ll(),l=e(c),f=!1,h={point:d,lineStart:y,lineEnd:g,polygonStart:function(){h.point=m,h.lineStart=v,h.lineEnd=b,o=[],a=[]},polygonEnd:function(){h.point=d,h.lineStart=y,h.lineEnd=g,o=R(o);var t=ml(a,r);o.length?(f||(i.polygonStart(),f=!0),dl(o,xl,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),o=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){u.point(t,e)}function y(){h.point=p,u.lineStart()}function g(){h.point=d,u.lineEnd()}function m(t,e){s.push([t,e]),l.point(t,e)}function v(){l.lineStart(),s=[]}function b(){m(s[0][0],s[0][1]),l.lineEnd();var t,e,n,r,u=l.clean(),h=c.result(),d=h.length;if(s.pop(),a.push(s),s=null,d)if(1&u){if((e=(n=h[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&u&&h.push(h.pop().concat(h.shift())),o.push(h.filter(bl))}return h}};function bl(t){return t.length>1}function xl(t,e){return((t=t.x)[0]<0?t[1]-cu-1e-6:cu-t[1])-((e=e.x)[0]<0?e[1]-cu-1e-6:cu-e[1])}var _l=vl((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?uu:-uu,u=pu(a-n);pu(u-uu)<1e-6?(t.point(n,r=(r+o)/2>0?cu:-cu),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&u>=uu&&(pu(n-i)<1e-6&&(n-=1e-6*i),pu(a-s)<1e-6&&(a-=1e-6*s),r=function(t,e,n,r){var i,a,o=wu(t-n);return pu(o)>1e-6?yu((wu(e)*(a=mu(r))*wu(n)-wu(r)*(i=mu(e))*wu(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=a,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*cu,r.point(-uu,i),r.point(0,i),r.point(uu,i),r.point(uu,0),r.point(uu,-i),r.point(0,-i),r.point(-uu,-i),r.point(-uu,0),r.point(-uu,i);else if(pu(t[0]-e[0])>1e-6){var a=t[0]0,i=pu(e)>1e-6;function a(t,n){return mu(t)*mu(n)>e}function o(t,n,r){var i=[1,0,0],a=Qu(Xu(t),Xu(n)),o=Ju(a,a),s=a[0],u=o-s*s;if(!u)return!r&&t;var c=e*o/u,l=-e*s/u,f=Qu(i,a),h=tc(i,c);Ku(h,tc(a,l));var d=f,p=Ju(h,d),y=Ju(d,d),g=p*p-y*(Ju(h,h)-1);if(!(g<0)){var m=Eu(g),v=tc(d,(-p-m)/y);if(Ku(v,h),v=Zu(v),!r)return v;var b,x=t[0],_=n[0],w=t[1],k=n[1];_0^v[1]<(pu(v[0]-x)<1e-6?w:k):w<=v[1]&&v[1]<=k:E>uu^(x<=v[0]&&v[0]<=_)){var A=tc(d,(-p+m)/y);return Ku(A,h),[v,Zu(A)]}}}function s(e,n){var i=r?t:uu-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return vl(a,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,h){var d,p=[f,h],y=a(f,h),g=r?y?0:s(f,h):y?s(f+(f<0?uu:-uu),h):0;if(!e&&(c=u=y)&&t.lineStart(),y!==u&&(!(d=o(e,p))||fl(e,d)||fl(p,d))&&(p[0]+=1e-6,p[1]+=1e-6,y=a(p[0],p[1])),y!==u)l=0,y?(t.lineStart(),d=o(p,e),t.point(d[0],d[1])):(d=o(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(i&&e&&r^y){var m;g&n||!(m=o(p,e,!0))||(l=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!y||e&&fl(e,p)||t.point(p[0],p[1]),e=p,u=y,n=g},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(e,r,i,a){sl(a,t,n,i,e,r)}),r?[0,-t]:[-uu,t-uu])};function kl(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,s,c){var l=0,f=0;if(null==i||(l=o(i,s))!==(f=o(a,s))||u(i,a)<0^s>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+s+4)%4)!==f);else c.point(a[0],a[1])}function o(r,i){return pu(r[0]-t)<1e-6?i>0?0:3:pu(r[0]-n)<1e-6?i>0?2:1:pu(r[1]-e)<1e-6?i>0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var u,c,l,f,h,d,p,y,g,m,v,b=o,x=ll(),_={point:w,lineStart:function(){_.point=k,c&&c.push(l=[]),m=!0,g=!1,p=y=NaN},lineEnd:function(){u&&(k(f,h),d&&g&&x.rejoin(),u.push(x.result())),_.point=w,g&&b.lineEnd()},polygonStart:function(){b=x,u=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;nr&&(h-a)*(r-o)>(d-o)*(t-a)&&++e:d<=r&&(h-a)*(r-o)<(d-o)*(t-a)&&--e;return e}(),n=v&&e,i=(u=R(u)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&dl(u,s,e,a,o),o.polygonEnd()),b=o,u=c=l=null}};function w(t,e){i(t,e)&&b.point(t,e)}function k(a,o){var s=i(a,o);if(c&&l.push([a,o]),m)f=a,h=o,d=s,m=!1,s&&(b.lineStart(),b.point(a,o));else if(s&&g)b.point(a,o);else{var u=[p=Math.max(-1e9,Math.min(1e9,p)),y=Math.max(-1e9,Math.min(1e9,y))],x=[a=Math.max(-1e9,Math.min(1e9,a)),o=Math.max(-1e9,Math.min(1e9,o))];!function(t,e,n,r,i,a){var o,s=t[0],u=t[1],c=0,l=1,f=e[0]-s,h=e[1]-u;if(o=n-s,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>l)return;o>c&&(c=o)}if(o=i-s,f||!(o<0)){if(o/=f,f<0){if(o>l)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=h,h<0){if(o0){if(o>l)return;o>c&&(c=o)}if(o=a-u,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>c&&(c=o)}else if(h>0){if(o0&&(t[0]=s+c*f,t[1]=u+c*h),l<1&&(e[0]=s+l*f,e[1]=u+l*h),!0}}}}}(u,x,t,e,n,r)?s&&(b.lineStart(),b.point(a,o),v=!1):(g||(b.lineStart(),b.point(u[0],u[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=a,y=o,g=s}return _}}var El,Sl,Al,Tl=function(){var t,e,n,r=0,i=0,a=960,o=500;return n={stream:function(n){return t&&e===n?t:t=kl(r,i,a,o)(e=n)},extent:function(s){return arguments.length?(r=+s[0][0],i=+s[0][1],a=+s[1][0],o=+s[1][1],t=e=null,n):[[r,i],[a,o]]}}},Ml=iu(),Ol={sphere:Ou,point:Ou,lineStart:function(){Ol.point=Nl,Ol.lineEnd=Cl},lineEnd:Ou,polygonStart:Ou,polygonEnd:Ou};function Cl(){Ol.point=Ol.lineEnd=Ou}function Nl(t,e){El=t*=du,Sl=wu(e*=du),Al=mu(e),Ol.point=Dl}function Dl(t,e){t*=du;var n=wu(e*=du),r=mu(e),i=pu(t-El),a=mu(i),o=r*wu(i),s=Al*n-Sl*r*a,u=Sl*n+Al*r*a;Ml.add(gu(Eu(o*o+s*s),u)),El=t,Sl=n,Al=r}var Ll=function(t){return Ml.reset(),zu(t,Ol),+Ml},Fl=[null,null],Pl={type:"LineString",coordinates:Fl},Il=function(t,e){return Fl[0]=t,Fl[1]=e,Ll(Pl)},Rl={Feature:function(t,e){return jl(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Il(t[a],t[a-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<1e-12*i)return!0;n=r}return!1}function Ul(t,e){return!!ml(t.map($l),Vl(e))}function $l(t){return(t=t.map(Vl)).pop(),t}function Vl(t){return[t[0]*du,t[1]*du]}var Gl=function(t,e){return(t&&Rl.hasOwnProperty(t.type)?Rl[t.type]:jl)(t,e)};function Wl(t,e,n){var r=w(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function Hl(t,e,n){var r=w(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function ql(){var t,e,n,r,i,a,o,s,u,c,l,f,h=10,d=h,p=90,y=360,g=2.5;function m(){return{type:"MultiLineString",coordinates:v()}}function v(){return w(vu(r/p)*p,n,p).map(l).concat(w(vu(s/y)*y,o,y).map(f)).concat(w(vu(e/h)*h,t,h).filter((function(t){return pu(t%p)>1e-6})).map(u)).concat(w(vu(a/d)*d,i,d).filter((function(t){return pu(t%y)>1e-6})).map(c))}return m.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},m.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(o).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),m.precision(g)):[[r,s],[n,o]]},m.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),m.precision(g)):[[e,a],[t,i]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(p=+t[0],y=+t[1],m):[p,y]},m.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],m):[h,d]},m.precision=function(h){return arguments.length?(g=+h,u=Wl(a,i,90),c=Hl(e,t,g),l=Wl(s,o,90),f=Hl(r,n,g),m):g},m.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Zl(){return ql()()}var Xl,Jl,Ql,Kl,tf=function(t,e){var n=t[0]*du,r=t[1]*du,i=e[0]*du,a=e[1]*du,o=mu(r),s=wu(r),u=mu(a),c=wu(a),l=o*mu(n),f=o*wu(n),h=u*mu(i),d=u*wu(i),p=2*Tu(Eu(Mu(a-r)+o*u*Mu(i-n))),y=wu(p),g=p?function(t){var e=wu(t*=p)/y,n=wu(p-t)/y,r=n*l+e*h,i=n*f+e*d,a=n*s+e*c;return[gu(i,r)*hu,gu(a,Eu(r*r+i*i))*hu]}:function(){return[n*hu,r*hu]};return g.distance=p,g},ef=function(t){return t},nf=iu(),rf=iu(),af={point:Ou,lineStart:Ou,lineEnd:Ou,polygonStart:function(){af.lineStart=of,af.lineEnd=cf},polygonEnd:function(){af.lineStart=af.lineEnd=af.point=Ou,nf.add(pu(rf)),rf.reset()},result:function(){var t=nf/2;return nf.reset(),t}};function of(){af.point=sf}function sf(t,e){af.point=uf,Xl=Ql=t,Jl=Kl=e}function uf(t,e){rf.add(Kl*t-Ql*e),Ql=t,Kl=e}function cf(){uf(Xl,Jl)}var lf,ff,hf,df,pf=af,yf=1/0,gf=yf,mf=-yf,vf=mf,bf={point:function(t,e){tmf&&(mf=t),evf&&(vf=e)},lineStart:Ou,lineEnd:Ou,polygonStart:Ou,polygonEnd:Ou,result:function(){var t=[[yf,gf],[mf,vf]];return mf=vf=-(gf=yf=1/0),t}},xf=0,_f=0,wf=0,kf=0,Ef=0,Sf=0,Af=0,Tf=0,Mf=0,Of={point:Cf,lineStart:Nf,lineEnd:Ff,polygonStart:function(){Of.lineStart=Pf,Of.lineEnd=If},polygonEnd:function(){Of.point=Cf,Of.lineStart=Nf,Of.lineEnd=Ff},result:function(){var t=Mf?[Af/Mf,Tf/Mf]:Sf?[kf/Sf,Ef/Sf]:wf?[xf/wf,_f/wf]:[NaN,NaN];return xf=_f=wf=kf=Ef=Sf=Af=Tf=Mf=0,t}};function Cf(t,e){xf+=t,_f+=e,++wf}function Nf(){Of.point=Df}function Df(t,e){Of.point=Lf,Cf(hf=t,df=e)}function Lf(t,e){var n=t-hf,r=e-df,i=Eu(n*n+r*r);kf+=i*(hf+t)/2,Ef+=i*(df+e)/2,Sf+=i,Cf(hf=t,df=e)}function Ff(){Of.point=Cf}function Pf(){Of.point=Rf}function If(){Bf(lf,ff)}function Rf(t,e){Of.point=Bf,Cf(lf=hf=t,ff=df=e)}function Bf(t,e){var n=t-hf,r=e-df,i=Eu(n*n+r*r);kf+=i*(hf+t)/2,Ef+=i*(df+e)/2,Sf+=i,Af+=(i=df*t-hf*e)*(hf+t),Tf+=i*(df+e),Mf+=3*i,Cf(hf=t,df=e)}var jf=Of;function zf(t){this._context=t}zf.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,fu)}},result:Ou};var Yf,Uf,$f,Vf,Gf,Wf=iu(),Hf={point:Ou,lineStart:function(){Hf.point=qf},lineEnd:function(){Yf&&Zf(Uf,$f),Hf.point=Ou},polygonStart:function(){Yf=!0},polygonEnd:function(){Yf=null},result:function(){var t=+Wf;return Wf.reset(),t}};function qf(t,e){Hf.point=Zf,Uf=Vf=t,$f=Gf=e}function Zf(t,e){Vf-=t,Gf-=e,Wf.add(Eu(Vf*Vf+Gf*Gf)),Vf=t,Gf=e}var Xf=Hf;function Jf(){this._string=[]}function Qf(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Jf.prototype={_radius:4.5,_circle:Qf(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Qf(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var Kf=function(t,e){var n,r,i=4.5;function a(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),zu(t,n(r))),r.result()}return a.area=function(t){return zu(t,n(pf)),pf.result()},a.measure=function(t){return zu(t,n(Xf)),Xf.result()},a.bounds=function(t){return zu(t,n(bf)),bf.result()},a.centroid=function(t){return zu(t,n(jf)),jf.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,ef):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new Jf):new zf(e=t),"function"!=typeof i&&r.pointRadius(i),a):e},a.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),a):i},a.projection(t).context(e)},th=function(t){return{stream:eh(t)}};function eh(t){return function(e){var n=new nh;for(var r in t)n[r]=t[r];return n.stream=e,n}}function nh(){}function rh(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),zu(n,t.stream(bf)),e(bf.result()),null!=r&&t.clipExtent(r),t}function ih(t,e,n){return rh(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}function ah(t,e,n){return ih(t,[[0,0],e],n)}function oh(t,e,n){return rh(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o])}),n)}function sh(t,e,n){return rh(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o])}),n)}nh.prototype={constructor:nh,point:function(t,e){this.stream.point(t,e)},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()}};var uh=mu(30*du),ch=function(t,e){return+e?function(t,e){function n(r,i,a,o,s,u,c,l,f,h,d,p,y,g){var m=c-r,v=l-i,b=m*m+v*v;if(b>4*e&&y--){var x=o+h,_=s+d,w=u+p,k=Eu(x*x+_*_+w*w),E=Tu(w/=k),S=pu(pu(w)-1)<1e-6||pu(a-f)<1e-6?(a+f)/2:gu(_,x),A=t(S,E),T=A[0],M=A[1],O=T-r,C=M-i,N=v*O-m*C;(N*N/b>e||pu((m*O+v*C)/b-.5)>.3||o*h+s*d+u*p2?t[2]%360*du:0,T()):[g*hu,m*hu,v*hu]},S.angle=function(t){return arguments.length?(b=t%360*du,T()):b*hu},S.precision=function(t){return arguments.length?(o=ch(s,E=t*t),M()):Eu(E)},S.fitExtent=function(t,e){return ih(S,t,e)},S.fitSize=function(t,e){return ah(S,t,e)},S.fitWidth=function(t,e){return oh(S,t,e)},S.fitHeight=function(t,e){return sh(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&A,T()}}function yh(t){var e=0,n=uu/3,r=ph(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*du,n=t[1]*du):[e*hu,n*hu]},i}function gh(t,e){var n=wu(t),r=(n+wu(e))/2;if(pu(r)<1e-6)return function(t){var e=mu(t);function n(t,n){return[t*e,wu(n)/e]}return n.invert=function(t,n){return[t/e,Tu(n*e)]},n}(t);var i=1+n*(2*r-n),a=Eu(i)/r;function o(t,e){var n=Eu(i-2*r*wu(e))/r;return[n*wu(t*=r),a-n*mu(t)]}return o.invert=function(t,e){var n=a-e;return[gu(t,pu(n))/r*ku(n),Tu((i-(t*t+n*n)*r*r)/(2*r))]},o}var mh=function(){return yh(gh).scale(155.424).center([0,33.6442])},vh=function(){return mh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},bh=function(){var t,e,n,r,i,a,o=vh(),s=mh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=mh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){a=[t,e]}};function l(t){var e=t[0],o=t[1];return a=null,n.point(e,o),a||(r.point(e,o),a)||(i.point(e,o),a)}function f(){return t=e=null,l}return l.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:o).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[o.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n0?e<1e-6-cu&&(e=1e-6-cu):e>cu-1e-6&&(e=cu-1e-6);var n=i/_u(Oh(e),r);return[n*wu(r*t),i-n*mu(r*t)]}return a.invert=function(t,e){var n=i-e,a=ku(r)*Eu(t*t+n*n);return[gu(t,pu(n))/r*ku(n),2*yu(_u(i/a,1/r))-cu]},a}var Nh=function(){return yh(Ch).scale(109.5).parallels([30,30])};function Dh(t,e){return[t,e]}Dh.invert=Dh;var Lh=function(){return dh(Dh).scale(152.63)};function Fh(t,e){var n=mu(t),r=t===e?wu(t):(n-mu(e))/(e-t),i=n/r+t;if(pu(r)<1e-6)return Dh;function a(t,e){var n=i-e,a=r*t;return[n*wu(a),i-n*mu(a)]}return a.invert=function(t,e){var n=i-e;return[gu(t,pu(n))/r*ku(n),i-ku(r)*Eu(t*t+n*n)]},a}var Ph=function(){return yh(Fh).scale(131.154).center([0,13.9389])},Ih=1.340264,Rh=-.081106,Bh=893e-6,jh=.003796,zh=Eu(3)/2;function Yh(t,e){var n=Tu(zh*wu(e)),r=n*n,i=r*r*r;return[t*mu(n)/(zh*(Ih+3*Rh*r+i*(7*Bh+9*jh*r))),n*(Ih+Rh*r+i*(Bh+jh*r))]}Yh.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(Ih+Rh*i+a*(Bh+jh*i))-e)/(Ih+3*Rh*i+a*(7*Bh+9*jh*i)))*r)*i*i,!(pu(n)<1e-12));++o);return[zh*t*(Ih+3*Rh*i+a*(7*Bh+9*jh*i))/mu(r),Tu(wu(r)/zh)]};var Uh=function(){return dh(Yh).scale(177.158)};function $h(t,e){var n=mu(e),r=mu(t)*n;return[n*wu(t)/r,wu(e)/r]}$h.invert=_h(yu);var Vh=function(){return dh($h).scale(144.049).clipAngle(60)};function Gh(t,e,n,r){return 1===t&&1===e&&0===n&&0===r?ef:eh({point:function(i,a){this.stream.point(i*t+n,a*e+r)}})}var Wh=function(){var t,e,n,r,i,a,o=1,s=0,u=0,c=1,l=1,f=ef,h=null,d=ef;function p(){return r=i=null,a}return a={stream:function(t){return r&&i===t?r:r=f(d(i=t))},postclip:function(r){return arguments.length?(d=r,h=t=e=n=null,p()):d},clipExtent:function(r){return arguments.length?(d=null==r?(h=t=e=n=null,ef):kl(h=+r[0][0],t=+r[0][1],e=+r[1][0],n=+r[1][1]),p()):null==h?null:[[h,t],[e,n]]},scale:function(t){return arguments.length?(f=Gh((o=+t)*c,o*l,s,u),p()):o},translate:function(t){return arguments.length?(f=Gh(o*c,o*l,s=+t[0],u=+t[1]),p()):[s,u]},reflectX:function(t){return arguments.length?(f=Gh(o*(c=t?-1:1),o*l,s,u),p()):c<0},reflectY:function(t){return arguments.length?(f=Gh(o*c,o*(l=t?-1:1),s,u),p()):l<0},fitExtent:function(t,e){return ih(a,t,e)},fitSize:function(t,e){return ah(a,t,e)},fitWidth:function(t,e){return oh(a,t,e)},fitHeight:function(t,e){return sh(a,t,e)}}};function Hh(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}Hh.invert=function(t,e){var n,r=e,i=25;do{var a=r*r,o=a*a;r-=n=(r*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(pu(n)>1e-6&&--i>0);return[t/(.8707+(a=r*r)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),r]};var qh=function(){return dh(Hh).scale(175.295)};function Zh(t,e){return[mu(e)*wu(t),wu(e)]}Zh.invert=_h(Tu);var Xh=function(){return dh(Zh).scale(249.5).clipAngle(90.000001)};function Jh(t,e){var n=mu(e),r=1+mu(t)*n;return[n*wu(t)/r,wu(e)/r]}Jh.invert=_h((function(t){return 2*yu(t)}));var Qh=function(){return dh(Jh).scale(250).clipAngle(142)};function Kh(t,e){return[xu(Su((cu+e)/2)),-t]}Kh.invert=function(t,e){return[-e,2*yu(bu(t))-cu]};var td=function(){var t=Mh(Kh),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)};function ed(t,e){return t.parent===e.parent?1:2}function nd(t,e){return t+e.x}function rd(t,e){return Math.max(t,e.y)}var id=function(){var t=ed,e=1,n=1,r=!1;function i(i){var a,o=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(nd,0)/t.length}(n),e.y=function(t){return 1+t.reduce(rd,0)}(n)):(e.x=a?o+=t(e,a):0,e.y=0,a=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=s.x-t(s,u)/2,l=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-c)/(l-c)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i};function ad(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function od(t,e){var n,r,i,a,o,s=new ld(t),u=+t.value&&(s.value=t.value),c=[s];for(null==e&&(e=sd);n=c.pop();)if(u&&(n.value=+n.data.value),(i=e(n.data))&&(o=i.length))for(n.children=new Array(o),a=o-1;a>=0;--a)c.push(r=n.children[a]=new ld(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(cd)}function sd(t){return t.children}function ud(t){t.data=t.data.data}function cd(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function ld(t){this.data=t,this.depth=this.height=0,this.parent=null}ld.prototype=od.prototype={constructor:ld,count:function(){return this.eachAfter(ad)},each:function(t){var e,n,r,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),n=a.children)for(r=0,i=n.length;r=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return od(this).eachBefore(ud)}};var fd=Array.prototype.slice,hd=function(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(fd.call(t))).length,a=[];r0&&n*n>r*r+i*i}function gd(t,e){for(var n=0;n(o*=o)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=t.x-r*s-a*u,n.y=t.y-r*u+a*s):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-a*u,n.y=e.y+r*u+a*s)):(n.x=e.x+n.r,n.y=e.y)}function _d(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function wd(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,a=(e.y*n.r+n.y*e.r)/r;return i*i+a*a}function kd(t){this._=t,this.next=null,this.previous=null}function Ed(t){if(!(i=t.length))return 0;var e,n,r,i,a,o,s,u,c,l,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;xd(n,e,r=t[2]),e=new kd(e),n=new kd(n),r=new kd(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(s=3;s0)throw new Error("cycle");return a}return n.id=function(e){return arguments.length?(t=Td(e),n):t},n.parentId=function(t){return arguments.length?(e=Td(t),n):e},n};function $d(t,e){return t.parent===e.parent?1:2}function Vd(t){var e=t.children;return e?e[0]:t.t}function Gd(t){var e=t.children;return e?e[e.length-1]:t.t}function Wd(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Hd(t,e,n){return t.a.parent===e.parent?t.a:n}function qd(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}qd.prototype=Object.create(ld.prototype);var Zd=function(){var t=$d,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,a,o=new qd(t,0),s=[o];e=s.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;i>=0;--i)s.push(n=e.children[i]=new qd(r[i],i)),n.parent=e;return(o.parent=new qd(null,0)).children=[o],o}(i);if(u.eachAfter(a),u.parent.m=-u.z,u.eachBefore(o),r)i.eachBefore(s);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=c===l?1:t(c,l)/2,d=h-c.x,p=e/(l.x+h+d),y=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*y}))}return i}function a(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var a=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,a=e,o=e,s=n,u=a.parent.children[0],c=a.m,l=o.m,f=s.m,h=u.m;s=Gd(s),a=Vd(a),s&&a;)u=Vd(u),(o=Gd(o)).a=e,(i=s.z+f-a.z-c+t(s._,a._))>0&&(Wd(Hd(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=a.m,h+=u.m,l+=o.m;s&&!Gd(o)&&(o.t=s,o.m+=f-l),a&&!Vd(u)&&(u.t=a,u.m+=c-h,r=e)}return r}(e,i,e.parent.A||r[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},Xd=function(t,e,n,r,i){for(var a,o=t.children,s=-1,u=o.length,c=t.value&&(i-n)/t.value;++sh&&(h=s),g=l*l*y,(d=Math.max(h/g,g/f))>p){l-=s;break}p=d}m.push(o={value:l,dice:u1?e:1)},n}(Jd),tp=function(){var t=Kd,e=!1,n=1,r=1,i=[0],a=Md,o=Md,s=Md,u=Md,c=Md;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(Pd),t}function f(e){var n=i[e.depth],r=e.x0+n,l=e.y0+n,f=e.x1-n,h=e.y1-n;f=n-1){var l=s[e];return l.x0=i,l.y0=a,l.x1=o,void(l.y1=u)}for(var f=c[e],h=r/2+f,d=e+1,p=n-1;d>>1;c[y]u-a){var v=(i*m+o*g)/r;t(e,d,g,i,a,v,u),t(d,n,m,v,a,o,u)}else{var b=(a*m+u*g)/r;t(e,d,g,i,a,o,b),t(d,n,m,i,b,o,u)}}(0,u,t.value,e,n,r,i)},np=function(t,e,n,r,i){(1&t.depth?Xd:Id)(t,e,n,r,i)},rp=function t(e){function n(t,n,r,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,u,c,l,f=-1,h=o.length,d=t.value;++f1?e:1)},n}(Jd),ip=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},ap=function(t,e){var n=cn(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},op=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}},sp=Math.SQRT2;function up(t){return((t=Math.exp(t))+1/t)/2}var cp=function(t,e){var n,r,i=t[0],a=t[1],o=t[2],s=e[0],u=e[1],c=e[2],l=s-i,f=u-a,h=l*l+f*f;if(h<1e-12)r=Math.log(c/o)/sp,n=function(t){return[i+t*l,a+t*f,o*Math.exp(sp*t*r)]};else{var d=Math.sqrt(h),p=(c*c-o*o+4*h)/(2*o*2*d),y=(c*c-o*o-4*h)/(2*c*2*d),g=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(y*y+1)-y);r=(m-g)/sp,n=function(t){var e,n=t*r,s=up(g),u=o/(2*d)*(s*(e=sp*n+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+u*l,a+u*f,o*s/up(sp*n+g)]}}return n.duration=1e3*r,n};function lp(t){return function(e,n){var r=t((e=tn(e)).h,(n=tn(n)).h),i=ln(e.s,n.s),a=ln(e.l,n.l),o=ln(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var fp=lp(cn),hp=lp(ln);function dp(t,e){var n=ln((t=da(t)).l,(e=da(e)).l),r=ln(t.a,e.a),i=ln(t.b,e.b),a=ln(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=a(e),t+""}}function pp(t){return function(e,n){var r=t((e=_a(e)).h,(n=_a(n)).h),i=ln(e.c,n.c),a=ln(e.l,n.l),o=ln(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var yp=pp(cn),gp=pp(ln);function mp(t){return function e(n){function r(e,r){var i=t((e=Ma(e)).h,(r=Ma(r)).h),a=ln(e.s,r.s),o=ln(e.l,r.l),s=ln(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}var vp=mp(cn),bp=mp(ln);function xp(t,e){for(var n=0,r=e.length-1,i=e[0],a=new Array(r<0?0:r);n1&&(e=t[a[o-2]],n=t[a[o-1]],r=t[s],(n[0]-e[0])*(r[1]-e[1])-(n[1]-e[1])*(r[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}var Ap=function(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e=0;--e)c.push(t[r[a[e]][2]]);for(e=+s;es!=c>s&&o<(u-n)*(s-r)/(c-r)+n&&(l=!l),u=n,c=r;return l},Mp=function(t){for(var e,n,r=-1,i=t.length,a=t[i-1],o=a[0],s=a[1],u=0;++r1);return t+n*a*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(Op),Dp=function t(e){function n(){var t=Np.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(Op),Lp=function t(e){function n(t){return function(){for(var n=0,r=0;rr&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function Jp(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i2?Qp:Jp,i=a=null,f}function f(e){return isNaN(e=+e)?n:(i||(i=r(o.map(t),s,u)))(t(c(e)))}return f.invert=function(n){return c(e((a||(a=r(s,o.map(t),wn)))(n)))},f.domain=function(t){return arguments.length?(o=jp.call(t,Wp),c===qp||(c=Xp(o)),l()):o.slice()},f.range=function(t){return arguments.length?(s=zp.call(t),l()):s.slice()},f.rangeRound=function(t){return s=zp.call(t),u=op,l()},f.clamp=function(t){return arguments.length?(c=t?Xp(o):qp,f):c!==qp},f.interpolate=function(t){return arguments.length?(u=t,l()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function ey(t,e){return ty()(t,e)}var ny=function(t,e,n,r){var i,a=M(t,e,n);switch((r=Us(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=nu(a,o))||(r.precision=i),Hs(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=ru(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=eu(a))||(r.precision=i-2*("%"===r.type))}return Ws(r)};function ry(t){var e=t.domain;return t.ticks=function(t){var n=e();return A(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return ny(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),a=0,o=i.length-1,s=i[a],u=i[o];return u0?r=T(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,n):r<0&&(r=T(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,n)),r>0?(i[a]=Math.floor(s/r)*r,i[o]=Math.ceil(u/r)*r,e(i)):r<0&&(i[a]=Math.ceil(s*r)/r,i[o]=Math.floor(u*r)/r,e(i)),t},t}function iy(){var t=ey(qp,qp);return t.copy=function(){return Kp(t,iy())},Ip.apply(t,arguments),ry(t)}function ay(t){var e;function n(t){return isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=jp.call(e,Wp),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return ay(t).unknown(e)},t=arguments.length?jp.call(t,Wp):[0,1],ry(n)}var oy=function(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],o=t[i];return o0){for(;hu)break;y.push(f)}}else for(;h=1;--l)if(!((f=c*l)u)break;y.push(f)}}else y=A(h,d,Math.min(d-h,p)).map(n);return r?y.reverse():y},r.tickFormat=function(t,i){if(null==i&&(i=10===a?".0e":","),"function"!=typeof i&&(i=Ws(i)),t===1/0)return i;null==t&&(t=10);var o=Math.max(1,a*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*a0?i[r-1]:e[0],r=r?[i[r-1],n]:[i[o-1],i[o]]},o.unknown=function(e){return arguments.length?(t=e,o):o},o.thresholds=function(){return i.slice()},o.copy=function(){return Ay().domain([e,n]).range(a).unknown(t)},Ip.apply(ry(o),arguments)}function Ty(){var t,e=[.5],n=[0,1],r=1;function i(i){return i<=i?n[u(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=zp.call(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=zp.call(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return Ty().domain(e).range(n).unknown(t)},Ip.apply(i,arguments)}var My=new Date,Oy=new Date;function Cy(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e0))return s;do{s.push(o=new Date(+n)),e(n,a),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return My.setTime(+e),Oy.setTime(+r),t(My),t(Oy),Math.floor(n(My,Oy))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Ny=Cy((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Ny.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Cy((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var Dy=Ny,Ly=Ny.range,Fy=Cy((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),Py=Fy,Iy=Fy.range;function Ry(t){return Cy((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var By=Ry(0),jy=Ry(1),zy=Ry(2),Yy=Ry(3),Uy=Ry(4),$y=Ry(5),Vy=Ry(6),Gy=By.range,Wy=jy.range,Hy=zy.range,qy=Yy.range,Zy=Uy.range,Xy=$y.range,Jy=Vy.range,Qy=Cy((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),Ky=Qy,tg=Qy.range,eg=Cy((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),ng=eg,rg=eg.range,ig=Cy((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),ag=ig,og=ig.range,sg=Cy((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),ug=sg,cg=sg.range,lg=Cy((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));lg.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Cy((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):lg:null};var fg=lg,hg=lg.range;function dg(t){return Cy((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var pg=dg(0),yg=dg(1),gg=dg(2),mg=dg(3),vg=dg(4),bg=dg(5),xg=dg(6),_g=pg.range,wg=yg.range,kg=gg.range,Eg=mg.range,Sg=vg.range,Ag=bg.range,Tg=xg.range,Mg=Cy((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),Og=Mg,Cg=Mg.range,Ng=Cy((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Ng.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Cy((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Dg=Ng,Lg=Ng.range;function Fg(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Pg(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ig(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Rg(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,o=t.shortDays,s=t.months,u=t.shortMonths,c=Zg(i),l=Xg(i),f=Zg(a),h=Xg(a),d=Zg(o),p=Xg(o),y=Zg(s),g=Xg(s),m=Zg(u),v=Xg(u),b={a:function(t){return o[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:mm,e:mm,f:wm,H:vm,I:bm,j:xm,L:_m,m:km,M:Em,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Qm,s:Km,S:Sm,u:Am,U:Tm,V:Mm,w:Om,W:Cm,x:null,X:null,y:Nm,Y:Dm,Z:Lm,"%":Jm},x={a:function(t){return o[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Fm,e:Fm,f:jm,H:Pm,I:Im,j:Rm,L:Bm,m:zm,M:Ym,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Qm,s:Km,S:Um,u:$m,U:Vm,V:Gm,w:Wm,W:Hm,x:null,X:null,y:qm,Y:Zm,Z:Xm,"%":Jm},_={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:sm,e:sm,f:dm,H:cm,I:cm,j:um,L:hm,m:om,M:lm,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l[r[0].toLowerCase()],n+r[0].length):-1},q:am,Q:ym,s:gm,S:fm,u:Qg,U:Kg,V:tm,w:Jg,W:em,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:rm,Y:nm,Z:im,"%":pm};function w(t,e){return function(n){var r,i,a,o=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=Pg(Ig(a.y,0,1))).getUTCDay(),r=i>4||0===i?yg.ceil(r):yg(r),r=Og.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=Fg(Ig(a.y,0,1))).getDay(),r=i>4||0===i?jy.ceil(r):jy(r),r=Ky.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?Pg(Ig(a.y,0,1)).getUTCDay():Fg(Ig(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,Pg(a)):Fg(a)}}function E(t,e,n,r){for(var i,a,o=0,s=e.length,u=n.length;o=u)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=_[i in $g?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var Bg,jg,zg,Yg,Ug,$g={"-":"",_:" ",0:"0"},Vg=/^\s*\d+/,Gg=/^%/,Wg=/[\\^$*+?|[\]().{}]/g;function Hg(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function im(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function am(t,e,n){var r=Vg.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function om(t,e,n){var r=Vg.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function sm(t,e,n){var r=Vg.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function um(t,e,n){var r=Vg.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function cm(t,e,n){var r=Vg.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function lm(t,e,n){var r=Vg.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function fm(t,e,n){var r=Vg.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function hm(t,e,n){var r=Vg.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function dm(t,e,n){var r=Vg.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function pm(t,e,n){var r=Gg.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ym(t,e,n){var r=Vg.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function gm(t,e,n){var r=Vg.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function mm(t,e){return Hg(t.getDate(),e,2)}function vm(t,e){return Hg(t.getHours(),e,2)}function bm(t,e){return Hg(t.getHours()%12||12,e,2)}function xm(t,e){return Hg(1+Ky.count(Dy(t),t),e,3)}function _m(t,e){return Hg(t.getMilliseconds(),e,3)}function wm(t,e){return _m(t,e)+"000"}function km(t,e){return Hg(t.getMonth()+1,e,2)}function Em(t,e){return Hg(t.getMinutes(),e,2)}function Sm(t,e){return Hg(t.getSeconds(),e,2)}function Am(t){var e=t.getDay();return 0===e?7:e}function Tm(t,e){return Hg(By.count(Dy(t)-1,t),e,2)}function Mm(t,e){var n=t.getDay();return t=n>=4||0===n?Uy(t):Uy.ceil(t),Hg(Uy.count(Dy(t),t)+(4===Dy(t).getDay()),e,2)}function Om(t){return t.getDay()}function Cm(t,e){return Hg(jy.count(Dy(t)-1,t),e,2)}function Nm(t,e){return Hg(t.getFullYear()%100,e,2)}function Dm(t,e){return Hg(t.getFullYear()%1e4,e,4)}function Lm(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Hg(e/60|0,"0",2)+Hg(e%60,"0",2)}function Fm(t,e){return Hg(t.getUTCDate(),e,2)}function Pm(t,e){return Hg(t.getUTCHours(),e,2)}function Im(t,e){return Hg(t.getUTCHours()%12||12,e,2)}function Rm(t,e){return Hg(1+Og.count(Dg(t),t),e,3)}function Bm(t,e){return Hg(t.getUTCMilliseconds(),e,3)}function jm(t,e){return Bm(t,e)+"000"}function zm(t,e){return Hg(t.getUTCMonth()+1,e,2)}function Ym(t,e){return Hg(t.getUTCMinutes(),e,2)}function Um(t,e){return Hg(t.getUTCSeconds(),e,2)}function $m(t){var e=t.getUTCDay();return 0===e?7:e}function Vm(t,e){return Hg(pg.count(Dg(t)-1,t),e,2)}function Gm(t,e){var n=t.getUTCDay();return t=n>=4||0===n?vg(t):vg.ceil(t),Hg(vg.count(Dg(t),t)+(4===Dg(t).getUTCDay()),e,2)}function Wm(t){return t.getUTCDay()}function Hm(t,e){return Hg(yg.count(Dg(t)-1,t),e,2)}function qm(t,e){return Hg(t.getUTCFullYear()%100,e,2)}function Zm(t,e){return Hg(t.getUTCFullYear()%1e4,e,4)}function Xm(){return"+0000"}function Jm(){return"%"}function Qm(t){return+t}function Km(t){return Math.floor(+t/1e3)}function tv(t){return Bg=Rg(t),jg=Bg.format,zg=Bg.parse,Yg=Bg.utcFormat,Ug=Bg.utcParse,Bg}function ev(t){return new Date(t)}function nv(t){return t instanceof Date?+t:+new Date(+t)}function rv(t,e,n,r,a,o,s,u,c){var l=ey(qp,qp),f=l.invert,h=l.domain,d=c(".%L"),p=c(":%S"),y=c("%I:%M"),g=c("%I %p"),m=c("%a %d"),v=c("%b %d"),b=c("%B"),x=c("%Y"),_=[[s,1,1e3],[s,5,5e3],[s,15,15e3],[s,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[a,1,36e5],[a,3,108e5],[a,6,216e5],[a,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function w(i){return(s(i)1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Gb.h=360*t-100,Gb.s=1.5-1.5*e,Gb.l=.8-.9*e,Gb+""},Hb=He(),qb=Math.PI/3,Zb=2*Math.PI/3,Xb=function(t){var e;return t=(.5-t)*Math.PI,Hb.r=255*(e=Math.sin(t))*e,Hb.g=255*(e=Math.sin(t+qb))*e,Hb.b=255*(e=Math.sin(t+Zb))*e,Hb+""},Jb=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"};function Qb(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Kb=Qb(Ov("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),tx=Qb(Ov("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),ex=Qb(Ov("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),nx=Qb(Ov("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),rx=function(t){return we(ne(t).call(document.documentElement))},ix=0;function ax(){return new ox}function ox(){this._="@"+(++ix).toString(36)}ox.prototype=ax.prototype={constructor:ox,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var sx=function(t){return"string"==typeof t?new be([document.querySelectorAll(t)],[document.documentElement]):new be([null==t?[]:t],ve)},ux=function(t,e){null==e&&(e=Mn().touches);for(var n=0,r=e?e.length:0,i=new Array(r);n1?0:t<-1?mx:Math.acos(t)}function _x(t){return t>=1?vx:t<=-1?-vx:Math.asin(t)}function wx(t){return t.innerRadius}function kx(t){return t.outerRadius}function Ex(t){return t.startAngle}function Sx(t){return t.endAngle}function Ax(t){return t&&t.padAngle}function Tx(t,e,n,r,i,a,o,s){var u=n-t,c=r-e,l=o-i,f=s-a,h=f*u-l*c;if(!(h*h<1e-12))return[t+(h=(l*(e-a)-f*(t-i))/h)*u,e+h*c]}function Mx(t,e,n,r,i,a,o){var s=t-n,u=e-r,c=(o?a:-a)/gx(s*s+u*u),l=c*u,f=-c*s,h=t+l,d=e+f,p=n+l,y=r+f,g=(h+p)/2,m=(d+y)/2,v=p-h,b=y-d,x=v*v+b*b,_=i-a,w=h*y-p*d,k=(b<0?-1:1)*gx(dx(0,_*_*x-w*w)),E=(w*b-v*k)/x,S=(-w*v-b*k)/x,A=(w*b+v*k)/x,T=(-w*v+b*k)/x,M=E-g,O=S-m,C=A-g,N=T-m;return M*M+O*O>C*C+N*N&&(E=A,S=T),{cx:E,cy:S,x01:-l,y01:-f,x11:E*(i/_-1),y11:S*(i/_-1)}}var Ox=function(){var t=wx,e=kx,n=cx(0),r=null,i=Ex,a=Sx,o=Ax,s=null;function u(){var u,c,l=+t.apply(this,arguments),f=+e.apply(this,arguments),h=i.apply(this,arguments)-vx,d=a.apply(this,arguments)-vx,p=lx(d-h),y=d>h;if(s||(s=u=Yi()),f1e-12)if(p>bx-1e-12)s.moveTo(f*hx(h),f*yx(h)),s.arc(0,0,f,h,d,!y),l>1e-12&&(s.moveTo(l*hx(d),l*yx(d)),s.arc(0,0,l,d,h,y));else{var g,m,v=h,b=d,x=h,_=d,w=p,k=p,E=o.apply(this,arguments)/2,S=E>1e-12&&(r?+r.apply(this,arguments):gx(l*l+f*f)),A=px(lx(f-l)/2,+n.apply(this,arguments)),T=A,M=A;if(S>1e-12){var O=_x(S/l*yx(E)),C=_x(S/f*yx(E));(w-=2*O)>1e-12?(x+=O*=y?1:-1,_-=O):(w=0,x=_=(h+d)/2),(k-=2*C)>1e-12?(v+=C*=y?1:-1,b-=C):(k=0,v=b=(h+d)/2)}var N=f*hx(v),D=f*yx(v),L=l*hx(_),F=l*yx(_);if(A>1e-12){var P,I=f*hx(b),R=f*yx(b),B=l*hx(x),j=l*yx(x);if(p1e-12?M>1e-12?(g=Mx(B,j,N,D,f,M,y),m=Mx(I,R,L,F,f,M,y),s.moveTo(g.cx+g.x01,g.cy+g.y01),M1e-12&&w>1e-12?T>1e-12?(g=Mx(L,F,I,R,l,-T,y),m=Mx(N,D,B,j,l,-T,y),s.lineTo(g.cx+g.x01,g.cy+g.y01),T=l;--f)s.point(g[f],m[f]);s.lineEnd(),s.areaEnd()}y&&(g[c]=+t(h,c,u),m[c]=+n(h,c,u),s.point(e?+e(h,c,u):g[c],r?+r(h,c,u):m[c]))}if(d)return s=null,d+""||null}function c(){return Fx().defined(i).curve(o).context(a)}return u.x=function(n){return arguments.length?(t="function"==typeof n?n:cx(+n),e=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:cx(+e),u):t},u.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:cx(+t),u):e},u.y=function(t){return arguments.length?(n="function"==typeof t?t:cx(+t),r=null,u):n},u.y0=function(t){return arguments.length?(n="function"==typeof t?t:cx(+t),u):n},u.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:cx(+t),u):r},u.lineX0=u.lineY0=function(){return c().x(t).y(n)},u.lineY1=function(){return c().x(t).y(r)},u.lineX1=function(){return c().x(e).y(n)},u.defined=function(t){return arguments.length?(i="function"==typeof t?t:cx(!!t),u):i},u.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),u):o},u.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),u):a},u},Ix=function(t,e){return et?1:e>=t?0:NaN},Rx=function(t){return t},Bx=function(){var t=Rx,e=Ix,n=null,r=cx(0),i=cx(bx),a=cx(0);function o(o){var s,u,c,l,f,h=o.length,d=0,p=new Array(h),y=new Array(h),g=+r.apply(this,arguments),m=Math.min(bx,Math.max(-bx,i.apply(this,arguments)-g)),v=Math.min(Math.abs(m)/h,a.apply(this,arguments)),b=v*(m<0?-1:1);for(s=0;s0&&(d+=f);for(null!=e?p.sort((function(t,n){return e(y[t],y[n])})):null!=n&&p.sort((function(t,e){return n(o[t],o[e])})),s=0,c=d?(m-h*b)/d:0;s0?f*c:0)+b,y[u]={data:o[u],index:s,value:f,startAngle:g,endAngle:l,padAngle:v};return y}return o.value=function(e){return arguments.length?(t="function"==typeof e?e:cx(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:cx(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:cx(+t),o):i},o.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:cx(+t),o):a},o},jx=Yx(Nx);function zx(t){this._curve=t}function Yx(t){function e(e){return new zx(t(e))}return e._curve=t,e}function Ux(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(Yx(t)):e()._curve},t}zx.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var $x=function(){return Ux(Fx().curve(jx))},Vx=function(){var t=Px().curve(jx),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Ux(n())},delete t.lineX0,t.lineEndAngle=function(){return Ux(r())},delete t.lineX1,t.lineInnerRadius=function(){return Ux(i())},delete t.lineY0,t.lineOuterRadius=function(){return Ux(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Yx(t)):e()._curve},t},Gx=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]},Wx=Array.prototype.slice;function Hx(t){return t.source}function qx(t){return t.target}function Zx(t){var e=Hx,n=qx,r=Dx,i=Lx,a=null;function o(){var o,s=Wx.call(arguments),u=e.apply(this,s),c=n.apply(this,s);if(a||(a=o=Yi()),t(a,+r.apply(this,(s[0]=u,s)),+i.apply(this,s),+r.apply(this,(s[0]=c,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(t){return arguments.length?(e=t,o):e},o.target=function(t){return arguments.length?(n=t,o):n},o.x=function(t){return arguments.length?(r="function"==typeof t?t:cx(+t),o):r},o.y=function(t){return arguments.length?(i="function"==typeof t?t:cx(+t),o):i},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o}function Xx(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function Jx(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function Qx(t,e,n,r,i){var a=Gx(e,n),o=Gx(e,n=(n+i)/2),s=Gx(r,n),u=Gx(r,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],u[0],u[1])}function Kx(){return Zx(Xx)}function t_(){return Zx(Jx)}function e_(){var t=Zx(Qx);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var n_={draw:function(t,e){var n=Math.sqrt(e/mx);t.moveTo(n,0),t.arc(0,0,n,0,bx)}},r_={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},i_=Math.sqrt(1/3),a_=2*i_,o_={draw:function(t,e){var n=Math.sqrt(e/a_),r=n*i_;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},s_=Math.sin(mx/10)/Math.sin(7*mx/10),u_=Math.sin(bx/10)*s_,c_=-Math.cos(bx/10)*s_,l_={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),r=u_*n,i=c_*n;t.moveTo(0,-n),t.lineTo(r,i);for(var a=1;a<5;++a){var o=bx*a/5,s=Math.cos(o),u=Math.sin(o);t.lineTo(u*n,-s*n),t.lineTo(s*r-u*i,u*r+s*i)}t.closePath()}},f_={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},h_=Math.sqrt(3),d_={draw:function(t,e){var n=-Math.sqrt(e/(3*h_));t.moveTo(0,2*n),t.lineTo(-h_*n,-n),t.lineTo(h_*n,-n),t.closePath()}},p_=Math.sqrt(3)/2,y_=1/Math.sqrt(12),g_=3*(y_/2+1),m_={draw:function(t,e){var n=Math.sqrt(e/g_),r=n/2,i=n*y_,a=r,o=n*y_+n,s=-a,u=o;t.moveTo(r,i),t.lineTo(a,o),t.lineTo(s,u),t.lineTo(-.5*r-p_*i,p_*r+-.5*i),t.lineTo(-.5*a-p_*o,p_*a+-.5*o),t.lineTo(-.5*s-p_*u,p_*s+-.5*u),t.lineTo(-.5*r+p_*i,-.5*i-p_*r),t.lineTo(-.5*a+p_*o,-.5*o-p_*a),t.lineTo(-.5*s+p_*u,-.5*u-p_*s),t.closePath()}},v_=[n_,r_,o_,f_,l_,d_,m_],b_=function(){var t=cx(n_),e=cx(64),n=null;function r(){var r;if(n||(n=r=Yi()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(e){return arguments.length?(t="function"==typeof e?e:cx(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:cx(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r},x_=function(){};function __(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function w_(t){this._context=t}w_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:__(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:__(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var k_=function(t){return new w_(t)};function E_(t){this._context=t}E_.prototype={areaStart:x_,areaEnd:x_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:__(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var S_=function(t){return new E_(t)};function A_(t){this._context=t}A_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:__(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var T_=function(t){return new A_(t)};function M_(t,e){this._basis=new w_(t),this._beta=e}M_.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],o=t[n]-i,s=e[n]-a,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*o),this._beta*e[u]+(1-this._beta)*(a+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var O_=function t(e){function n(t){return 1===e?new w_(t):new M_(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function C_(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function N_(t,e){this._context=t,this._k=(1-e)/6}N_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:C_(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:C_(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var D_=function t(e){function n(t){return new N_(t,e)}return n.tension=function(e){return t(+e)},n}(0);function L_(t,e){this._context=t,this._k=(1-e)/6}L_.prototype={areaStart:x_,areaEnd:x_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:C_(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var F_=function t(e){function n(t){return new L_(t,e)}return n.tension=function(e){return t(+e)},n}(0);function P_(t,e){this._context=t,this._k=(1-e)/6}P_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:C_(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var I_=function t(e){function n(t){return new P_(t,e)}return n.tension=function(e){return t(+e)},n}(0);function R_(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/l,o=(o*c+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,a,o,t._x2,t._y2)}function B_(t,e){this._context=t,this._alpha=e}B_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:R_(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var j_=function t(e){function n(t){return e?new B_(t,e):new N_(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function z_(t,e){this._context=t,this._alpha=e}z_.prototype={areaStart:x_,areaEnd:x_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:R_(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Y_=function t(e){function n(t){return e?new z_(t,e):new L_(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function U_(t,e){this._context=t,this._alpha=e}U_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:R_(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var $_=function t(e){function n(t){return e?new U_(t,e):new P_(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function V_(t){this._context=t}V_.prototype={areaStart:x_,areaEnd:x_,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var G_=function(t){return new V_(t)};function W_(t){return t<0?-1:1}function H_(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(W_(a)+W_(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function q_(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Z_(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function X_(t){this._context=t}function J_(t){this._context=new Q_(t)}function Q_(t){this._context=t}function K_(t){return new X_(t)}function tw(t){return new J_(t)}function ew(t){this._context=t}function nw(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var aw=function(t){return new iw(t,.5)};function ow(t){return new iw(t,0)}function sw(t){return new iw(t,1)}var uw=function(t,e){if((i=t.length)>1)for(var n,r,i,a=1,o=t[e[0]],s=o.length;a=0;)n[e]=e;return n};function lw(t,e){return t[e]}var fw=function(){var t=cx([]),e=cw,n=uw,r=lw;function i(i){var a,o,s=t.apply(this,arguments),u=i.length,c=s.length,l=new Array(c);for(a=0;a0){for(var n,r,i,a=0,o=t[0].length;a0)for(var n,r,i,a,o,s,u=0,c=t[e[0]].length;u0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=o,r[0]=o+=i):(r[0]=0,r[1]=i)},pw=function(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],a=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,a=0,o=1;oa&&(a=e,r=n);return r}var vw=function(t){var e=t.map(bw);return cw(t).sort((function(t,n){return e[t]-e[n]}))};function bw(t){for(var e,n=0,r=-1,i=t.length;++r0)){if(a/=h,h<0){if(a0){if(a>f)return;a>l&&(l=a)}if(a=r-u,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>l&&(l=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>l&&(l=a)}if(a=i-c,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>l&&(l=a)}else if(d>0){if(a0||f<1)||(l>0&&(t[0]=[u+l*h,c+l*d]),f<1&&(t[1]=[u+f*h,c+f*d]),!0)}}}}}function jw(t,e,n,r,i){var a=t[1];if(a)return!0;var o,s,u=t[0],c=t.left,l=t.right,f=c[0],h=c[1],d=l[0],p=l[1],y=(f+d)/2,g=(h+p)/2;if(p===h){if(y=r)return;if(f>d){if(u){if(u[1]>=i)return}else u=[y,n];a=[y,i]}else{if(u){if(u[1]1)if(f>d){if(u){if(u[1]>=i)return}else u=[(n-s)/o,n];a=[(i-s)/o,i]}else{if(u){if(u[1]=r)return}else u=[e,o*e+s];a=[r,o*r+s]}else{if(u){if(u[0]=-sk)){var d=u*u+c*c,p=l*l+f*f,y=(f*d-c*p)/h,g=(u*p-l*d)/h,m=Vw.pop()||new Gw;m.arc=t,m.site=i,m.x=y+o,m.y=(m.cy=g+s)+Math.sqrt(y*y+g*g),t.circle=m;for(var v=null,b=ik._;b;)if(m.yok)s=s.L;else{if(!((i=a-ek(s,o))>ok)){r>-ok?(e=s.P,n=s):i>-ok?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}!function(t){rk[t.index]={site:t,halfedges:[]}}(t);var u=Xw(t);if(nk.insert(e,u),e||n){if(e===n)return Hw(e),n=Xw(e.site),nk.insert(u,n),u.edge=n.edge=Pw(e.site,u.site),Ww(e),void Ww(n);if(n){Hw(e),Hw(n);var c=e.site,l=c[0],f=c[1],h=t[0]-l,d=t[1]-f,p=n.site,y=p[0]-l,g=p[1]-f,m=2*(h*g-d*y),v=h*h+d*d,b=y*y+g*g,x=[(g*v-d*b)/m+l,(h*b-y*v)/m+f];Rw(n.edge,c,p,x),u.edge=Pw(c,t,null,x),n.edge=Pw(t,p,null,x),Ww(e),Ww(n)}else u.edge=Pw(e.site,u.site)}}function tk(t,e){var n=t.site,r=n[0],i=n[1],a=i-e;if(!a)return r;var o=t.P;if(!o)return-1/0;var s=(n=o.site)[0],u=n[1],c=u-e;if(!c)return s;var l=s-r,f=1/a-1/c,h=l/c;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*c)-u+c/2+i-a/2)))/f+r:(r+s)/2}function ek(t,e){var n=t.N;if(n)return tk(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var nk,rk,ik,ak,ok=1e-6,sk=1e-12;function uk(t,e){return e[1]-t[1]||e[0]-t[0]}function ck(t,e){var n,r,i,a=t.sort(uk).pop();for(ak=[],rk=new Array(t.length),nk=new Fw,ik=new Fw;;)if(i=$w,a&&(!i||a[1]ok||Math.abs(i[0][1]-i[1][1])>ok)||delete ak[a]}(o,s,u,c),function(t,e,n,r){var i,a,o,s,u,c,l,f,h,d,p,y,g=rk.length,m=!0;for(i=0;iok||Math.abs(y-h)>ok)&&(u.splice(s,0,ak.push(Iw(o,d,Math.abs(p-t)ok?[t,Math.abs(f-t)ok?[Math.abs(h-r)ok?[n,Math.abs(f-n)ok?[Math.abs(h-e)=s)return null;var u=t-i.site[0],c=e-i.site[1],l=u*u+c*c;do{i=a.cells[r=o],o=null,i.halfedges.forEach((function(n){var r=a.edges[n],s=r.left;if(s!==i.site&&s||(s=r.right)){var u=t-s[0],c=e-s[1],f=u*u+c*c;fr?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}var Ek=function(){var t,e,n=vk,r=bk,i=kk,a=_k,o=wk,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,l=cp,f=lt("start","zoom","end"),h=0;function d(t){t.property("__zoom",xk).on("wheel.zoom",x).on("mousedown.zoom",_).on("dblclick.zoom",w).filter(o).on("touchstart.zoom",k).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new dk(e,t.x,t.y)}function y(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new dk(t.k,r,i)}function g(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function m(t,e,n){t.on("start.zoom",(function(){v(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){v(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,a=v(t,i),o=r.apply(t,i),s=null==n?g(o):"function"==typeof n?n.apply(t,i):n,u=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),c=t.__zoom,f="function"==typeof e?e.apply(t,i):e,h=l(c.invert(s).concat(u/c.k),f.invert(s).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=h(t),n=u/e[2];t=new dk(n,s[0]-e[0]*n,s[1]-e[1]*n)}a.zoom(null,t)}}))}function v(t,e,n){return!n&&t.__zooming||new b(t,e)}function b(t,e){this.that=t,this.args=e,this.active=0,this.extent=r.apply(t,e),this.taps=0}function x(){if(n.apply(this,arguments)){var t=v(this,arguments),e=this.__zoom,r=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,a.apply(this,arguments)))),o=Nn(this);if(t.wheel)t.mouse[0][0]===o[0]&&t.mouse[0][1]===o[1]||(t.mouse[1]=e.invert(t.mouse[0]=o)),clearTimeout(t.wheel);else{if(e.k===r)return;t.mouse=[o,e.invert(o)],ar(this),t.start()}mk(),t.wheel=setTimeout(c,150),t.zoom("mouse",i(y(p(e,r),t.mouse[0],t.mouse[1]),t.extent,u))}function c(){t.wheel=null,t.end()}}function _(){if(!e&&n.apply(this,arguments)){var t=v(this,arguments,!0),r=we(ue.view).on("mousemove.zoom",c,!0).on("mouseup.zoom",l,!0),a=Nn(this),o=ue.clientX,s=ue.clientY;Se(ue.view),gk(),t.mouse=[a,this.__zoom.invert(a)],ar(this),t.start()}function c(){if(mk(),!t.moved){var e=ue.clientX-o,n=ue.clientY-s;t.moved=e*e+n*n>h}t.zoom("mouse",i(y(t.that.__zoom,t.mouse[0]=Nn(t.that),t.mouse[1]),t.extent,u))}function l(){r.on("mousemove.zoom mouseup.zoom",null),Ae(ue.view,t.moved),mk(),t.end()}}function w(){if(n.apply(this,arguments)){var t=this.__zoom,e=Nn(this),a=t.invert(e),o=t.k*(ue.shiftKey?.5:2),s=i(y(p(t,o),e,a),r.apply(this,arguments),u);mk(),c>0?we(this).transition().duration(c).call(m,s,e):we(this).call(d.transform,s)}}function k(){if(n.apply(this,arguments)){var e,r,i,a,o=ue.touches,s=o.length,u=v(this,arguments,ue.changedTouches.length===s);for(gk(),r=0;rf&&M.push("'"+this.terminals_[S]+"'");C=p.showPosition?"Parse error on line "+(u+1)+":\n"+p.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(u+1)+": Unexpected "+(x==h?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(C,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:m,expected:M})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+x);switch(k[0]){case 1:n.push(x),i.push(p.yytext),a.push(p.yylloc),n.push(k[1]),x=null,_?(x=_,_=null):(c=p.yyleng,s=p.yytext,u=p.yylineno,m=p.yylloc,l>0&&l--);break;case 2:if(A=this.productions_[k[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},v&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(O,[s,c,u,y.yy,k[1],i,a].concat(d))))return E;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[k[1]][0]),i.push(O.$),a.push(O._$),T=o[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},A={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 5;case 1:case 2:case 3:case 4:break;case 5:return this.begin("ID"),10;case 6:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),42;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(),5;case 9:return this.begin("LINE"),21;case 10:return this.begin("LINE"),23;case 11:return this.begin("LINE"),24;case 12:return this.begin("LINE"),25;case 13:return this.begin("LINE"),30;case 14:return this.begin("LINE"),27;case 15:return this.begin("LINE"),29;case 16:return this.popState(),13;case 17:return 22;case 18:return 37;case 19:return 38;case 20:return 33;case 21:return 31;case 22:return this.begin("ID"),16;case 23:return this.begin("ID"),17;case 24:return 19;case 25:return 6;case 26:return 15;case 27:return 36;case 28:return 5;case 29:return e.yytext=e.yytext.trim(),42;case 30:return 45;case 31:return 46;case 32:return 43;case 33:return 44;case 34:return 47;case 35:return 48;case 36:return 49;case 37:return 40;case 38:return 41;case 39:return 5;case 40:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:participant\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[2,3,16],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],inclusive:!0}}};function T(){this.yy={}}return S.lexer=A,T.prototype=S,S.Parser=T,new T}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(14).readFileSync(n(15).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(13),n(6)(t))},function(t,e,n){var r=n(169);t.exports={Graph:r.Graph,json:n(272),alg:n(273),version:r.version}},function(t,e,n){var r;try{r={cloneDeep:n(284),constant:n(78),defaults:n(137),each:n(79),filter:n(111),find:n(285),flatten:n(139),forEach:n(109),forIn:n(290),has:n(85),isUndefined:n(122),last:n(291),map:n(123),mapValues:n(292),max:n(293),merge:n(295),min:n(300),minBy:n(301),now:n(302),pick:n(144),range:n(145),reduce:n(125),sortBy:n(309),uniqueId:n(146),values:n(130),zipObject:n(314)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){ /** * @license * Copyright (c) 2012-2013 Chris Pettitt diff --git a/GraphEditor/build/debug/package.json b/GraphEditor/build/debug/package.json index ef1d897..dca6788 100644 --- a/GraphEditor/build/debug/package.json +++ b/GraphEditor/build/debug/package.json @@ -7,7 +7,7 @@ "email": "xsang.le@gmail.com", "licences": "GPLv3" }, - "version":"0.0.5-a", + "version":"0.0.6-a", "category":"Office", "iconclass": "fa fa-sitemap", "mimes":["text/.*graphviz"] diff --git a/GraphEditor/build/release/GraphEditor.zip b/GraphEditor/build/release/GraphEditor.zip index 90721fd..75e4f78 100644 Binary files a/GraphEditor/build/release/GraphEditor.zip and b/GraphEditor/build/release/GraphEditor.zip differ diff --git a/GraphEditor/coffees/main.coffee b/GraphEditor/coffees/main.coffee index 0acd432..76d7d3c 100644 --- a/GraphEditor/coffees/main.coffee +++ b/GraphEditor/coffees/main.coffee @@ -228,6 +228,7 @@ class GraphEditor extends this.OS.application.BaseApplication svgToCanvas: (f) -> img = new Image() + img.crossOrigin="anonymous" svgStr = @svgtext() DOMURL = window.URL || window.webkitURL || window svgBlob = new Blob [svgStr], { type: 'image/svg+xml;charset=utf-8' } diff --git a/GraphEditor/package.json b/GraphEditor/package.json index ef1d897..dca6788 100644 --- a/GraphEditor/package.json +++ b/GraphEditor/package.json @@ -7,7 +7,7 @@ "email": "xsang.le@gmail.com", "licences": "GPLv3" }, - "version":"0.0.5-a", + "version":"0.0.6-a", "category":"Office", "iconclass": "fa fa-sitemap", "mimes":["text/.*graphviz"] diff --git a/packages.json b/packages.json index 3810f85..067e73c 100644 --- a/packages.json +++ b/packages.json @@ -77,7 +77,7 @@ "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GraphEditor/README.md", "category": "Office", "author": "Xuan Sang LE", - "version": "0.0.5-a", + "version": "0.0.6-a", "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GraphEditor/build/release/GraphEditor.zip" }, {